index.2986e58c.js 1.3 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. var M4=Object.defineProperty,O4=Object.defineProperties;var I4=Object.getOwnPropertyDescriptors;var kf=Object.getOwnPropertySymbols;var TE=Object.prototype.hasOwnProperty,_E=Object.prototype.propertyIsEnumerable;var iw=Math.pow,nw=(t,e,r)=>e in t?M4(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,yt=(t,e)=>{for(var r in e||(e={}))TE.call(e,r)&&nw(t,r,e[r]);if(kf)for(var r of kf(e))_E.call(e,r)&&nw(t,r,e[r]);return t},Zr=(t,e)=>O4(t,I4(e));var Sn=(t,e)=>{var r={};for(var n in t)TE.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&kf)for(var n of kf(t))e.indexOf(n)<0&&_E.call(t,n)&&(r[n]=t[n]);return r};var Jr=(t,e,r)=>(nw(t,typeof e!="symbol"?e+"":e,r),r);var AE=(t,e,r)=>new Promise((n,i)=>{var s=l=>{try{a(r.next(l))}catch(c){i(c)}},o=l=>{try{a(r.throw(l))}catch(c){i(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,o);a((r=r.apply(t,e)).next())});import{d6 as Nf,d7 as jh,d as xS,cD as P4,o as V2,X as D4,P as k4,an as N4,al as H4,d8 as Hf,cP as F4,d9 as L4,u as $4,r as Ff,A as B4,c as W4,w as Lf,a as $f,n as eh,b as Bf,j as ME,Z as V4,e as OE,l as U4,a4 as G4,ai as Y4,co as z4,am as j4}from"./index.6c36cb53.js";import{M as K4}from"./index.a696a3d7.js";/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */var U2=1252,X4=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],bS={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969},ES=function(t){X4.indexOf(t)!=-1&&(U2=bS[0]=t)};function q4(){ES(1252)}var as=function(t){ES(t)};function G2(){as(1200),q4()}function IE(t){for(var e=[],r=0,n=t.length;r<n;++r)e[r]=t.charCodeAt(r);return e}function Z4(t){for(var e=[],r=0;r<t.length>>1;++r)e[r]=String.fromCharCode(t.charCodeAt(2*r)+(t.charCodeAt(2*r+1)<<8));return e.join("")}function Y2(t){for(var e=[],r=0;r<t.length>>1;++r)e[r]=String.fromCharCode(t.charCodeAt(2*r+1)+(t.charCodeAt(2*r)<<8));return e.join("")}var Kh=function(t){var e=t.charCodeAt(0),r=t.charCodeAt(1);return e==255&&r==254?Z4(t.slice(2)):e==254&&r==255?Y2(t.slice(2)):e==65279?t.slice(1):t},Wf=function(e){return String.fromCharCode(e)},PE=function(e){return String.fromCharCode(e)},ga,Sa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function DE(t){for(var e="",r=0,n=0,i=0,s=0,o=0,a=0,l=0,c=0;c<t.length;)r=t.charCodeAt(c++),s=r>>2,n=t.charCodeAt(c++),o=(r&3)<<4|n>>4,i=t.charCodeAt(c++),a=(n&15)<<2|i>>6,l=i&63,isNaN(n)?a=l=64:isNaN(i)&&(l=64),e+=Sa.charAt(s)+Sa.charAt(o)+Sa.charAt(a)+Sa.charAt(l);return e}function gi(t){var e="",r=0,n=0,i=0,s=0,o=0,a=0,l=0;t=t.replace(/[^\w\+\/\=]/g,"");for(var c=0;c<t.length;)s=Sa.indexOf(t.charAt(c++)),o=Sa.indexOf(t.charAt(c++)),r=s<<2|o>>4,e+=String.fromCharCode(r),a=Sa.indexOf(t.charAt(c++)),n=(o&15)<<4|a>>2,a!==64&&(e+=String.fromCharCode(n)),l=Sa.indexOf(t.charAt(c++)),i=(a&3)<<6|l,l!==64&&(e+=String.fromCharCode(i));return e}var St=function(){return typeof Buffer!="undefined"&&typeof process!="undefined"&&typeof process.versions!="undefined"&&!!process.versions.node}(),tc=function(){if(typeof Buffer!="undefined"){var t=!Buffer.from;if(!t)try{Buffer.from("foo","utf8")}catch(e){t=!0}return t?function(e,r){return r?new Buffer(e,r):new Buffer(e)}:Buffer.from.bind(Buffer)}return function(){}}();function Na(t){return St?Buffer.alloc?Buffer.alloc(t):new Buffer(t):typeof Uint8Array!="undefined"?new Uint8Array(t):new Array(t)}function kE(t){return St?Buffer.allocUnsafe?Buffer.allocUnsafe(t):new Buffer(t):typeof Uint8Array!="undefined"?new Uint8Array(t):new Array(t)}var os=function(e){return St?tc(e,"binary"):e.split("").map(function(r){return r.charCodeAt(0)&255})};function rc(t){if(Array.isArray(t))return t.map(function(n){return String.fromCharCode(n)}).join("");for(var e=[],r=0;r<t.length;++r)e[r]=String.fromCharCode(t[r]);return e.join("")}function RS(t){if(typeof ArrayBuffer=="undefined")throw new Error("Unsupported");if(t instanceof ArrayBuffer)return RS(new Uint8Array(t));for(var e=new Array(t.length),r=0;r<t.length;++r)e[r]=t[r];return e}var ma=St?function(t){return Buffer.concat(t.map(function(e){return Buffer.isBuffer(e)?e:tc(e)}))}:function(t){if(typeof Uint8Array!="undefined"){var e=0,r=0;for(e=0;e<t.length;++e)r+=t[e].length;var n=new Uint8Array(r),i=0;for(e=0,r=0;e<t.length;r+=i,++e)if(i=t[e].length,t[e]instanceof Uint8Array)n.set(t[e],r);else{if(typeof t[e]=="string")throw"wtf";n.set(new Uint8Array(t[e]),r)}return n}return[].concat.apply([],t.map(function(s){return Array.isArray(s)?s:[].slice.call(s)}))};function J4(t){for(var e=[],r=0,n=t.length+250,i=Na(t.length+255),s=0;s<t.length;++s){var o=t.charCodeAt(s);if(o<128)i[r++]=o;else if(o<2048)i[r++]=192|o>>6&31,i[r++]=128|o&63;else if(o>=55296&&o<57344){o=(o&1023)+64;var a=t.charCodeAt(++s)&1023;i[r++]=240|o>>8&7,i[r++]=128|o>>2&63,i[r++]=128|a>>6&15|(o&3)<<4,i[r++]=128|a&63}else i[r++]=224|o>>12&15,i[r++]=128|o>>6&63,i[r++]=128|o&63;r>n&&(e.push(i.slice(0,r)),r=0,i=Na(65535),n=65530)}return e.push(i.slice(0,r)),ma(e)}var Dn=/\u0000/g,Xh=/[\u0001-\u0006]/g;function vu(t){for(var e="",r=t.length-1;r>=0;)e+=t.charAt(r--);return e}function ls(t,e){var r=""+t;return r.length>=e?r:gr("0",e-r.length)+r}function TS(t,e){var r=""+t;return r.length>=e?r:gr(" ",e-r.length)+r}function X0(t,e){var r=""+t;return r.length>=e?r:r+gr(" ",e-r.length)}function Q4(t,e){var r=""+Math.round(t);return r.length>=e?r:gr("0",e-r.length)+r}function eB(t,e){var r=""+t;return r.length>=e?r:gr("0",e-r.length)+r}var NE=Math.pow(2,32);function gc(t,e){if(t>NE||t<-NE)return Q4(t,e);var r=Math.round(t);return eB(r,e)}function q0(t,e){return e=e||0,t.length>=7+e&&(t.charCodeAt(e)|32)===103&&(t.charCodeAt(e+1)|32)===101&&(t.charCodeAt(e+2)|32)===110&&(t.charCodeAt(e+3)|32)===101&&(t.charCodeAt(e+4)|32)===114&&(t.charCodeAt(e+5)|32)===97&&(t.charCodeAt(e+6)|32)===108}var HE=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],sw=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function tB(t){return t||(t={}),t[0]="General",t[1]="0",t[2]="0.00",t[3]="#,##0",t[4]="#,##0.00",t[9]="0%",t[10]="0.00%",t[11]="0.00E+00",t[12]="# ?/?",t[13]="# ??/??",t[14]="m/d/yy",t[15]="d-mmm-yy",t[16]="d-mmm",t[17]="mmm-yy",t[18]="h:mm AM/PM",t[19]="h:mm:ss AM/PM",t[20]="h:mm",t[21]="h:mm:ss",t[22]="m/d/yy h:mm",t[37]="#,##0 ;(#,##0)",t[38]="#,##0 ;[Red](#,##0)",t[39]="#,##0.00;(#,##0.00)",t[40]="#,##0.00;[Red](#,##0.00)",t[45]="mm:ss",t[46]="[h]:mm:ss",t[47]="mmss.0",t[48]="##0.0E+0",t[49]="@",t[56]='"\u4E0A\u5348/\u4E0B\u5348 "hh"\u6642"mm"\u5206"ss"\u79D2 "',t}var ot={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"\u4E0A\u5348/\u4E0B\u5348 "hh"\u6642"mm"\u5206"ss"\u79D2 "'},FE={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},rB={5:'"$"#,##0_);\\("$"#,##0\\)',63:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',41:'_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'};function Z0(t,e,r){for(var n=t<0?-1:1,i=t*n,s=0,o=1,a=0,l=1,c=0,u=0,h=Math.floor(i);c<e&&(h=Math.floor(i),a=h*o+s,u=h*c+l,!(i-h<5e-8));)i=1/(i-h),s=o,o=a,l=c,c=u;if(u>e&&(c>e?(u=l,a=s):(u=c,a=o)),!r)return[0,n*a,u];var d=Math.floor(n*a/u);return[d,n*a-d*u,u]}function Pl(t,e,r){if(t>2958465||t<0)return null;var n=t|0,i=Math.floor(86400*(t-n)),s=0,o=[],a={D:n,T:i,u:86400*(t-n)-i,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(a.u)<1e-6&&(a.u=0),e&&e.date1904&&(n+=1462),a.u>.9999&&(a.u=0,++i==86400&&(a.T=i=0,++n,++a.D)),n===60)o=r?[1317,10,29]:[1900,2,29],s=3;else if(n===0)o=r?[1317,8,29]:[1900,1,0],s=6;else{n>60&&--n;var l=new Date(1900,0,1);l.setDate(l.getDate()+n-1),o=[l.getFullYear(),l.getMonth()+1,l.getDate()],s=l.getDay(),n<60&&(s=(s+6)%7),r&&(s=lB(l,o))}return a.y=o[0],a.m=o[1],a.d=o[2],a.S=i%60,i=Math.floor(i/60),a.M=i%60,i=Math.floor(i/60),a.H=i,a.q=s,a}var z2=new Date(1899,11,31,0,0,0),nB=z2.getTime(),iB=new Date(1900,2,1,0,0,0);function j2(t,e){var r=t.getTime();return e?r-=1461*24*60*60*1e3:t>=iB&&(r+=24*60*60*1e3),(r-(nB+(t.getTimezoneOffset()-z2.getTimezoneOffset())*6e4))/(24*60*60*1e3)}function _S(t){return t.indexOf(".")==-1?t:t.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function sB(t){return t.indexOf("E")==-1?t:t.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}function oB(t){var e=t<0?12:11,r=_S(t.toFixed(12));return r.length<=e||(r=t.toPrecision(10),r.length<=e)?r:t.toExponential(5)}function aB(t){var e=_S(t.toFixed(11));return e.length>(t<0?12:11)||e==="0"||e==="-0"?t.toPrecision(6):e}function Pd(t){var e=Math.floor(Math.log(Math.abs(t))*Math.LOG10E),r;return e>=-4&&e<=-1?r=t.toPrecision(10+e):Math.abs(e)<=9?r=oB(t):e===10?r=t.toFixed(10).substr(0,12):r=aB(t),_S(sB(r.toUpperCase()))}function Ul(t,e){switch(typeof t){case"string":return t;case"boolean":return t?"TRUE":"FALSE";case"number":return(t|0)===t?t.toString(10):Pd(t);case"undefined":return"";case"object":if(t==null)return"";if(t instanceof Date)return Di(14,j2(t,e&&e.date1904),e)}throw new Error("unsupported value in General format: "+t)}function lB(t,e){e[0]-=581;var r=t.getDay();return t<60&&(r=(r+6)%7),r}function cB(t,e,r,n){var i="",s=0,o=0,a=r.y,l,c=0;switch(t){case 98:a=r.y+543;case 121:switch(e.length){case 1:case 2:l=a%100,c=2;break;default:l=a%1e4,c=4;break}break;case 109:switch(e.length){case 1:case 2:l=r.m,c=e.length;break;case 3:return sw[r.m-1][1];case 5:return sw[r.m-1][0];default:return sw[r.m-1][2]}break;case 100:switch(e.length){case 1:case 2:l=r.d,c=e.length;break;case 3:return HE[r.q][0];default:return HE[r.q][1]}break;case 104:switch(e.length){case 1:case 2:l=1+(r.H+11)%12,c=e.length;break;default:throw"bad hour format: "+e}break;case 72:switch(e.length){case 1:case 2:l=r.H,c=e.length;break;default:throw"bad hour format: "+e}break;case 77:switch(e.length){case 1:case 2:l=r.M,c=e.length;break;default:throw"bad minute format: "+e}break;case 115:if(e!="s"&&e!="ss"&&e!=".0"&&e!=".00"&&e!=".000")throw"bad second format: "+e;return r.u===0&&(e=="s"||e=="ss")?ls(r.S,e.length):(n>=2?o=n===3?1e3:100:o=n===1?10:1,s=Math.round(o*(r.S+r.u)),s>=60*o&&(s=0),e==="s"?s===0?"0":""+s/o:(i=ls(s,2+n),e==="ss"?i.substr(0,2):"."+i.substr(2,e.length-1)));case 90:switch(e){case"[h]":case"[hh]":l=r.D*24+r.H;break;case"[m]":case"[mm]":l=(r.D*24+r.H)*60+r.M;break;case"[s]":case"[ss]":l=((r.D*24+r.H)*60+r.M)*60+Math.round(r.S+r.u);break;default:throw"bad abstime format: "+e}c=e.length===3?1:2;break;case 101:l=a,c=1;break}var u=c>0?ls(l,c):"";return u}function ya(t){var e=3;if(t.length<=e)return t;for(var r=t.length%e,n=t.substr(0,r);r!=t.length;r+=e)n+=(n.length>0?",":"")+t.substr(r,e);return n}var K2=/%/g;function uB(t,e,r){var n=e.replace(K2,""),i=e.length-n.length;return ko(t,n,r*Math.pow(10,2*i))+gr("%",i)}function hB(t,e,r){for(var n=e.length-1;e.charCodeAt(n-1)===44;)--n;return ko(t,e.substr(0,n),r/Math.pow(10,3*(e.length-n)))}function X2(t,e){var r,n=t.indexOf("E")-t.indexOf(".")-1;if(t.match(/^#+0.0E\+0$/)){if(e==0)return"0.0E+0";if(e<0)return"-"+X2(t,-e);var i=t.indexOf(".");i===-1&&(i=t.indexOf("E"));var s=Math.floor(Math.log(e)*Math.LOG10E)%i;if(s<0&&(s+=i),r=(e/Math.pow(10,s)).toPrecision(n+1+(i+s)%i),r.indexOf("e")===-1){var o=Math.floor(Math.log(e)*Math.LOG10E);for(r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(o-r.length+s):r+="E+"+(o-s);r.substr(0,2)==="0.";)r=r.charAt(0)+r.substr(2,i)+"."+r.substr(2+i),r=r.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(a,l,c,u){return l+c+u.substr(0,(i+s)%i)+"."+u.substr(s)+"E"})}else r=e.toExponential(n);return t.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),t.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}var q2=/# (\?+)( ?)\/( ?)(\d+)/;function dB(t,e,r){var n=parseInt(t[4],10),i=Math.round(e*n),s=Math.floor(i/n),o=i-s*n,a=n;return r+(s===0?"":""+s)+" "+(o===0?gr(" ",t[1].length+1+t[4].length):TS(o,t[1].length)+t[2]+"/"+t[3]+ls(a,t[4].length))}function fB(t,e,r){return r+(e===0?"":""+e)+gr(" ",t[1].length+2+t[4].length)}var Z2=/^#*0*\.([0#]+)/,J2=/\).*[0#]/,Q2=/\(###\) ###\\?-####/;function An(t){for(var e="",r,n=0;n!=t.length;++n)switch(r=t.charCodeAt(n)){case 35:break;case 63:e+=" ";break;case 48:e+="0";break;default:e+=String.fromCharCode(r)}return e}function LE(t,e){var r=Math.pow(10,e);return""+Math.round(t*r)/r}function $E(t,e){var r=t-Math.floor(t),n=Math.pow(10,e);return e<(""+Math.round(r*n)).length?0:Math.round(r*n)}function gB(t,e){return e<(""+Math.round((t-Math.floor(t))*Math.pow(10,e))).length?1:0}function mB(t){return t<2147483647&&t>-2147483648?""+(t>=0?t|0:t-1|0):""+Math.floor(t)}function xi(t,e,r){if(t.charCodeAt(0)===40&&!e.match(J2)){var n=e.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?xi("n",n,r):"("+xi("n",n,-r)+")"}if(e.charCodeAt(e.length-1)===44)return hB(t,e,r);if(e.indexOf("%")!==-1)return uB(t,e,r);if(e.indexOf("E")!==-1)return X2(e,r);if(e.charCodeAt(0)===36)return"$"+xi(t,e.substr(e.charAt(1)==" "?2:1),r);var i,s,o,a,l=Math.abs(r),c=r<0?"-":"";if(e.match(/^00+$/))return c+gc(l,e.length);if(e.match(/^[#?]+$/))return i=gc(r,0),i==="0"&&(i=""),i.length>e.length?i:An(e.substr(0,e.length-i.length))+i;if(s=e.match(q2))return dB(s,l,c);if(e.match(/^#+0+$/))return c+gc(l,e.length-e.indexOf("0"));if(s=e.match(Z2))return i=LE(r,s[1].length).replace(/^([^\.]+)$/,"$1."+An(s[1])).replace(/\.$/,"."+An(s[1])).replace(/\.(\d*)$/,function(g,m){return"."+m+gr("0",An(s[1]).length-m.length)}),e.indexOf("0.")!==-1?i:i.replace(/^0\./,".");if(e=e.replace(/^#+([0.])/,"$1"),s=e.match(/^(0*)\.(#*)$/))return c+LE(l,s[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,s[1].length?"0.":".");if(s=e.match(/^#{1,3},##0(\.?)$/))return c+ya(gc(l,0));if(s=e.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+xi(t,e,-r):ya(""+(Math.floor(r)+gB(r,s[1].length)))+"."+ls($E(r,s[1].length),s[1].length);if(s=e.match(/^#,#*,#0/))return xi(t,e.replace(/^#,#*,/,""),r);if(s=e.match(/^([0#]+)(\\?-([0#]+))+$/))return i=vu(xi(t,e.replace(/[\\-]/g,""),r)),o=0,vu(vu(e.replace(/\\/g,"")).replace(/[0#]/g,function(g){return o<i.length?i.charAt(o++):g==="0"?"0":""}));if(e.match(Q2))return i=xi(t,"##########",r),"("+i.substr(0,3)+") "+i.substr(3,3)+"-"+i.substr(6);var u="";if(s=e.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return o=Math.min(s[4].length,7),a=Z0(l,Math.pow(10,o)-1,!1),i=""+c,u=ko("n",s[1],a[1]),u.charAt(u.length-1)==" "&&(u=u.substr(0,u.length-1)+"0"),i+=u+s[2]+"/"+s[3],u=X0(a[2],o),u.length<s[4].length&&(u=An(s[4].substr(s[4].length-u.length))+u),i+=u,i;if(s=e.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return o=Math.min(Math.max(s[1].length,s[4].length),7),a=Z0(l,Math.pow(10,o)-1,!0),c+(a[0]||(a[1]?"":"0"))+" "+(a[1]?TS(a[1],o)+s[2]+"/"+s[3]+X0(a[2],o):gr(" ",2*o+1+s[2].length+s[3].length));if(s=e.match(/^[#0?]+$/))return i=gc(r,0),e.length<=i.length?i:An(e.substr(0,e.length-i.length))+i;if(s=e.match(/^([#0?]+)\.([#0]+)$/)){i=""+r.toFixed(Math.min(s[2].length,10)).replace(/([^0])0+$/,"$1"),o=i.indexOf(".");var h=e.indexOf(".")-o,d=e.length-i.length-h;return An(e.substr(0,h)+i+e.substr(e.length-d))}if(s=e.match(/^00,000\.([#0]*0)$/))return o=$E(r,s[1].length),r<0?"-"+xi(t,e,-r):ya(mB(r)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(g){return"00,"+(g.length<3?ls(0,3-g.length):"")+g})+"."+ls(o,s[1].length);switch(e){case"###,##0.00":return xi(t,"#,##0.00",r);case"###,###":case"##,###":case"#,###":var f=ya(gc(l,0));return f!=="0"?c+f:"";case"###,###.00":return xi(t,"###,##0.00",r).replace(/^0\./,".");case"#,###.00":return xi(t,"#,##0.00",r).replace(/^0\./,".")}throw new Error("unsupported format |"+e+"|")}function pB(t,e,r){for(var n=e.length-1;e.charCodeAt(n-1)===44;)--n;return ko(t,e.substr(0,n),r/Math.pow(10,3*(e.length-n)))}function wB(t,e,r){var n=e.replace(K2,""),i=e.length-n.length;return ko(t,n,r*Math.pow(10,2*i))+gr("%",i)}function eD(t,e){var r,n=t.indexOf("E")-t.indexOf(".")-1;if(t.match(/^#+0.0E\+0$/)){if(e==0)return"0.0E+0";if(e<0)return"-"+eD(t,-e);var i=t.indexOf(".");i===-1&&(i=t.indexOf("E"));var s=Math.floor(Math.log(e)*Math.LOG10E)%i;if(s<0&&(s+=i),r=(e/Math.pow(10,s)).toPrecision(n+1+(i+s)%i),!r.match(/[Ee]/)){var o=Math.floor(Math.log(e)*Math.LOG10E);r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(o-r.length+s):r+="E+"+(o-s),r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(a,l,c,u){return l+c+u.substr(0,(i+s)%i)+"."+u.substr(s)+"E"})}else r=e.toExponential(n);return t.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),t.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}function Ns(t,e,r){if(t.charCodeAt(0)===40&&!e.match(J2)){var n=e.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?Ns("n",n,r):"("+Ns("n",n,-r)+")"}if(e.charCodeAt(e.length-1)===44)return pB(t,e,r);if(e.indexOf("%")!==-1)return wB(t,e,r);if(e.indexOf("E")!==-1)return eD(e,r);if(e.charCodeAt(0)===36)return"$"+Ns(t,e.substr(e.charAt(1)==" "?2:1),r);var i,s,o,a,l=Math.abs(r),c=r<0?"-":"";if(e.match(/^00+$/))return c+ls(l,e.length);if(e.match(/^[#?]+$/))return i=""+r,r===0&&(i=""),i.length>e.length?i:An(e.substr(0,e.length-i.length))+i;if(s=e.match(q2))return fB(s,l,c);if(e.match(/^#+0+$/))return c+ls(l,e.length-e.indexOf("0"));if(s=e.match(Z2))return i=(""+r).replace(/^([^\.]+)$/,"$1."+An(s[1])).replace(/\.$/,"."+An(s[1])),i=i.replace(/\.(\d*)$/,function(g,m){return"."+m+gr("0",An(s[1]).length-m.length)}),e.indexOf("0.")!==-1?i:i.replace(/^0\./,".");if(e=e.replace(/^#+([0.])/,"$1"),s=e.match(/^(0*)\.(#*)$/))return c+(""+l).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,s[1].length?"0.":".");if(s=e.match(/^#{1,3},##0(\.?)$/))return c+ya(""+l);if(s=e.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+Ns(t,e,-r):ya(""+r)+"."+gr("0",s[1].length);if(s=e.match(/^#,#*,#0/))return Ns(t,e.replace(/^#,#*,/,""),r);if(s=e.match(/^([0#]+)(\\?-([0#]+))+$/))return i=vu(Ns(t,e.replace(/[\\-]/g,""),r)),o=0,vu(vu(e.replace(/\\/g,"")).replace(/[0#]/g,function(g){return o<i.length?i.charAt(o++):g==="0"?"0":""}));if(e.match(Q2))return i=Ns(t,"##########",r),"("+i.substr(0,3)+") "+i.substr(3,3)+"-"+i.substr(6);var u="";if(s=e.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return o=Math.min(s[4].length,7),a=Z0(l,Math.pow(10,o)-1,!1),i=""+c,u=ko("n",s[1],a[1]),u.charAt(u.length-1)==" "&&(u=u.substr(0,u.length-1)+"0"),i+=u+s[2]+"/"+s[3],u=X0(a[2],o),u.length<s[4].length&&(u=An(s[4].substr(s[4].length-u.length))+u),i+=u,i;if(s=e.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return o=Math.min(Math.max(s[1].length,s[4].length),7),a=Z0(l,Math.pow(10,o)-1,!0),c+(a[0]||(a[1]?"":"0"))+" "+(a[1]?TS(a[1],o)+s[2]+"/"+s[3]+X0(a[2],o):gr(" ",2*o+1+s[2].length+s[3].length));if(s=e.match(/^[#0?]+$/))return i=""+r,e.length<=i.length?i:An(e.substr(0,e.length-i.length))+i;if(s=e.match(/^([#0]+)\.([#0]+)$/)){i=""+r.toFixed(Math.min(s[2].length,10)).replace(/([^0])0+$/,"$1"),o=i.indexOf(".");var h=e.indexOf(".")-o,d=e.length-i.length-h;return An(e.substr(0,h)+i+e.substr(e.length-d))}if(s=e.match(/^00,000\.([#0]*0)$/))return r<0?"-"+Ns(t,e,-r):ya(""+r).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(g){return"00,"+(g.length<3?ls(0,3-g.length):"")+g})+"."+ls(0,s[1].length);switch(e){case"###,###":case"##,###":case"#,###":var f=ya(""+l);return f!=="0"?c+f:"";default:if(e.match(/\.[0#?]*$/))return Ns(t,e.slice(0,e.lastIndexOf(".")),r)+An(e.slice(e.lastIndexOf(".")))}throw new Error("unsupported format |"+e+"|")}function ko(t,e,r){return(r|0)===r?Ns(t,e,r):xi(t,e,r)}function vB(t){for(var e=[],r=!1,n=0,i=0;n<t.length;++n)switch(t.charCodeAt(n)){case 34:r=!r;break;case 95:case 42:case 92:++n;break;case 59:e[e.length]=t.substr(i,n-i),i=n+1}if(e[e.length]=t.substr(i),r===!0)throw new Error("Format |"+t+"| unterminated string ");return e}var tD=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function Nu(t){for(var e=0,r="",n="";e<t.length;)switch(r=t.charAt(e)){case"G":q0(t,e)&&(e+=6),e++;break;case'"':for(;t.charCodeAt(++e)!==34&&e<t.length;);++e;break;case"\\":e+=2;break;case"_":e+=2;break;case"@":++e;break;case"B":case"b":if(t.charAt(e+1)==="1"||t.charAt(e+1)==="2")return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"\u4E0A":if(t.substr(e,3).toUpperCase()==="A/P"||t.substr(e,5).toUpperCase()==="AM/PM"||t.substr(e,5).toUpperCase()==="\u4E0A\u5348/\u4E0B\u5348")return!0;++e;break;case"[":for(n=r;t.charAt(e++)!=="]"&&e<t.length;)n+=t.charAt(e);if(n.match(tD))return!0;break;case".":case"0":case"#":for(;e<t.length&&("0#?.,E+-%".indexOf(r=t.charAt(++e))>-1||r=="\\"&&t.charAt(e+1)=="-"&&"0#".indexOf(t.charAt(e+2))>-1););break;case"?":for(;t.charAt(++e)===r;);break;case"*":++e,(t.charAt(e)==" "||t.charAt(e)=="*")&&++e;break;case"(":case")":++e;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;e<t.length&&"0123456789".indexOf(t.charAt(++e))>-1;);break;case" ":++e;break;default:++e;break}return!1}function CB(t,e,r,n){for(var i=[],s="",o=0,a="",l="t",c,u,h,d="H";o<t.length;)switch(a=t.charAt(o)){case"G":if(!q0(t,o))throw new Error("unrecognized character "+a+" in "+t);i[i.length]={t:"G",v:"General"},o+=7;break;case'"':for(s="";(h=t.charCodeAt(++o))!==34&&o<t.length;)s+=String.fromCharCode(h);i[i.length]={t:"t",v:s},++o;break;case"\\":var f=t.charAt(++o),g=f==="("||f===")"?f:"t";i[i.length]={t:g,v:f},++o;break;case"_":i[i.length]={t:"t",v:" "},o+=2;break;case"@":i[i.length]={t:"T",v:e},++o;break;case"B":case"b":if(t.charAt(o+1)==="1"||t.charAt(o+1)==="2"){if(c==null&&(c=Pl(e,r,t.charAt(o+1)==="2"),c==null))return"";i[i.length]={t:"X",v:t.substr(o,2)},l=a,o+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":a=a.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(e<0||c==null&&(c=Pl(e,r),c==null))return"";for(s=a;++o<t.length&&t.charAt(o).toLowerCase()===a;)s+=a;a==="m"&&l.toLowerCase()==="h"&&(a="M"),a==="h"&&(a=d),i[i.length]={t:a,v:s},l=a;break;case"A":case"a":case"\u4E0A":var m={t:a,v:a};if(c==null&&(c=Pl(e,r)),t.substr(o,3).toUpperCase()==="A/P"?(c!=null&&(m.v=c.H>=12?"P":"A"),m.t="T",d="h",o+=3):t.substr(o,5).toUpperCase()==="AM/PM"?(c!=null&&(m.v=c.H>=12?"PM":"AM"),m.t="T",o+=5,d="h"):t.substr(o,5).toUpperCase()==="\u4E0A\u5348/\u4E0B\u5348"?(c!=null&&(m.v=c.H>=12?"\u4E0B\u5348":"\u4E0A\u5348"),m.t="T",o+=5,d="h"):(m.t="t",++o),c==null&&m.t==="T")return"";i[i.length]=m,l=a;break;case"[":for(s=a;t.charAt(o++)!=="]"&&o<t.length;)s+=t.charAt(o);if(s.slice(-1)!=="]")throw'unterminated "[" block: |'+s+"|";if(s.match(tD)){if(c==null&&(c=Pl(e,r),c==null))return"";i[i.length]={t:"Z",v:s.toLowerCase()},l=s.charAt(1)}else s.indexOf("$")>-1&&(s=(s.match(/\$([^-\[\]]*)/)||[])[1]||"$",Nu(t)||(i[i.length]={t:"t",v:s}));break;case".":if(c!=null){for(s=a;++o<t.length&&(a=t.charAt(o))==="0";)s+=a;i[i.length]={t:"s",v:s};break}case"0":case"#":for(s=a;++o<t.length&&"0#?.,E+-%".indexOf(a=t.charAt(o))>-1;)s+=a;i[i.length]={t:"n",v:s};break;case"?":for(s=a;t.charAt(++o)===a;)s+=a;i[i.length]={t:a,v:s},l=a;break;case"*":++o,(t.charAt(o)==" "||t.charAt(o)=="*")&&++o;break;case"(":case")":i[i.length]={t:n===1?"t":a,v:a},++o;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(s=a;o<t.length&&"0123456789".indexOf(t.charAt(++o))>-1;)s+=t.charAt(o);i[i.length]={t:"D",v:s};break;case" ":i[i.length]={t:a,v:a},++o;break;case"$":i[i.length]={t:"t",v:"$"},++o;break;default:if(",$-+/():!^&'~{}<>=\u20ACacfijklopqrtuvwxzP".indexOf(a)===-1)throw new Error("unrecognized character "+a+" in "+t);i[i.length]={t:"t",v:a},++o;break}var w=0,C=0,S;for(o=i.length-1,l="t";o>=0;--o)switch(i[o].t){case"h":case"H":i[o].t=d,l="h",w<1&&(w=1);break;case"s":(S=i[o].v.match(/\.0+$/))&&(C=Math.max(C,S[0].length-1)),w<3&&(w=3);case"d":case"y":case"M":case"e":l=i[o].t;break;case"m":l==="s"&&(i[o].t="M",w<2&&(w=2));break;case"X":break;case"Z":w<1&&i[o].v.match(/[Hh]/)&&(w=1),w<2&&i[o].v.match(/[Mm]/)&&(w=2),w<3&&i[o].v.match(/[Ss]/)&&(w=3)}switch(w){case 0:break;case 1:c.u>=.5&&(c.u=0,++c.S),c.S>=60&&(c.S=0,++c.M),c.M>=60&&(c.M=0,++c.H);break;case 2:c.u>=.5&&(c.u=0,++c.S),c.S>=60&&(c.S=0,++c.M);break}var v="",T;for(o=0;o<i.length;++o)switch(i[o].t){case"t":case"T":case" ":case"D":break;case"X":i[o].v="",i[o].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":i[o].v=cB(i[o].t.charCodeAt(0),i[o].v,c,C),i[o].t="t";break;case"n":case"?":for(T=o+1;i[T]!=null&&((a=i[T].t)==="?"||a==="D"||(a===" "||a==="t")&&i[T+1]!=null&&(i[T+1].t==="?"||i[T+1].t==="t"&&i[T+1].v==="/")||i[o].t==="("&&(a===" "||a==="n"||a===")")||a==="t"&&(i[T].v==="/"||i[T].v===" "&&i[T+1]!=null&&i[T+1].t=="?"));)i[o].v+=i[T].v,i[T]={v:"",t:";"},++T;v+=i[o].v,o=T-1;break;case"G":i[o].t="t",i[o].v=Ul(e,r);break}var A="",M,E;if(v.length>0){v.charCodeAt(0)==40?(M=e<0&&v.charCodeAt(0)===45?-e:e,E=ko("n",v,M)):(M=e<0&&n>1?-e:e,E=ko("n",v,M),M<0&&i[0]&&i[0].t=="t"&&(E=E.substr(1),i[0].v="-"+i[0].v)),T=E.length-1;var Y=i.length;for(o=0;o<i.length;++o)if(i[o]!=null&&i[o].t!="t"&&i[o].v.indexOf(".")>-1){Y=o;break}var D=i.length;if(Y===i.length&&E.indexOf("E")===-1){for(o=i.length-1;o>=0;--o)i[o]==null||"n?".indexOf(i[o].t)===-1||(T>=i[o].v.length-1?(T-=i[o].v.length,i[o].v=E.substr(T+1,i[o].v.length)):T<0?i[o].v="":(i[o].v=E.substr(0,T+1),T=-1),i[o].t="t",D=o);T>=0&&D<i.length&&(i[D].v=E.substr(0,T+1)+i[D].v)}else if(Y!==i.length&&E.indexOf("E")===-1){for(T=E.indexOf(".")-1,o=Y;o>=0;--o)if(!(i[o]==null||"n?".indexOf(i[o].t)===-1)){for(u=i[o].v.indexOf(".")>-1&&o===Y?i[o].v.indexOf(".")-1:i[o].v.length-1,A=i[o].v.substr(u+1);u>=0;--u)T>=0&&(i[o].v.charAt(u)==="0"||i[o].v.charAt(u)==="#")&&(A=E.charAt(T--)+A);i[o].v=A,i[o].t="t",D=o}for(T>=0&&D<i.length&&(i[D].v=E.substr(0,T+1)+i[D].v),T=E.indexOf(".")+1,o=Y;o<i.length;++o)if(!(i[o]==null||"n?(".indexOf(i[o].t)===-1&&o!==Y)){for(u=i[o].v.indexOf(".")>-1&&o===Y?i[o].v.indexOf(".")+1:0,A=i[o].v.substr(0,u);u<i[o].v.length;++u)T<E.length&&(A+=E.charAt(T++));i[o].v=A,i[o].t="t",D=o}}}for(o=0;o<i.length;++o)i[o]!=null&&"n?".indexOf(i[o].t)>-1&&(M=n>1&&e<0&&o>0&&i[o-1].v==="-"?-e:e,i[o].v=ko(i[o].t,i[o].v,M),i[o].t="t");var U="";for(o=0;o!==i.length;++o)i[o]!=null&&(U+=i[o].v);return U}var BE=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function WE(t,e){if(e==null)return!1;var r=parseFloat(e[2]);switch(e[1]){case"=":if(t==r)return!0;break;case">":if(t>r)return!0;break;case"<":if(t<r)return!0;break;case"<>":if(t!=r)return!0;break;case">=":if(t>=r)return!0;break;case"<=":if(t<=r)return!0;break}return!1}function SB(t,e){var r=vB(t),n=r.length,i=r[n-1].indexOf("@");if(n<4&&i>-1&&--n,r.length>4)throw new Error("cannot find right format for |"+r.join("|")+"|");if(typeof e!="number")return[4,r.length===4||i>-1?r[r.length-1]:"@"];switch(r.length){case 1:r=i>-1?["General","General","General",r[0]]:[r[0],r[0],r[0],"@"];break;case 2:r=i>-1?[r[0],r[0],r[0],r[1]]:[r[0],r[1],r[0],"@"];break;case 3:r=i>-1?[r[0],r[1],r[0],r[2]]:[r[0],r[1],r[2],"@"];break}var s=e>0?r[0]:e<0?r[1]:r[2];if(r[0].indexOf("[")===-1&&r[1].indexOf("[")===-1)return[n,s];if(r[0].match(/\[[=<>]/)!=null||r[1].match(/\[[=<>]/)!=null){var o=r[0].match(BE),a=r[1].match(BE);return WE(e,o)?[n,r[0]]:WE(e,a)?[n,r[1]]:[n,r[o!=null&&a!=null?2:1]]}return[n,s]}function Di(t,e,r){r==null&&(r={});var n="";switch(typeof t){case"string":t=="m/d/yy"&&r.dateNF?n=r.dateNF:n=t;break;case"number":t==14&&r.dateNF?n=r.dateNF:n=(r.table!=null?r.table:ot)[t],n==null&&(n=r.table&&r.table[FE[t]]||ot[FE[t]]),n==null&&(n=rB[t]||"General");break}if(q0(n,0))return Ul(e,r);e instanceof Date&&(e=j2(e,r.date1904));var i=SB(n,e);if(q0(i[1]))return Ul(e,r);if(e===!0)e="TRUE";else if(e===!1)e="FALSE";else if(e===""||e==null)return"";return CB(i[1],e,r,i[0])}function $l(t,e){if(typeof e!="number"){e=+e||-1;for(var r=0;r<392;++r){if(ot[r]==null){e<0&&(e=r);continue}if(ot[r]==t){e=r;break}}e<0&&(e=391)}return ot[e]=t,e}function rD(){ot=tB()}var yB={5:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',23:"General",24:"General",25:"General",26:"General",27:"m/d/yy",28:"m/d/yy",29:"m/d/yy",30:"m/d/yy",31:"m/d/yy",32:"h:mm:ss",33:"h:mm:ss",34:"h:mm:ss",35:"h:mm:ss",36:"m/d/yy",41:'_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* (#,##0);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',50:"m/d/yy",51:"m/d/yy",52:"m/d/yy",53:"m/d/yy",54:"m/d/yy",55:"m/d/yy",56:"m/d/yy",57:"m/d/yy",58:"m/d/yy",59:"0",60:"0.00",61:"#,##0",62:"#,##0.00",63:'"$"#,##0_);\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',67:"0%",68:"0.00%",69:"# ?/?",70:"# ??/??",71:"m/d/yy",72:"m/d/yy",73:"d-mmm-yy",74:"d-mmm",75:"mmm-yy",76:"h:mm",77:"h:mm:ss",78:"m/d/yy h:mm",79:"mm:ss",80:"[h]:mm:ss",81:"mmss.0"},nD=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;function xB(t){var e=typeof t=="number"?ot[t]:t;return e=e.replace(nD,"(\\d+)"),new RegExp("^"+e+"$")}function bB(t,e,r){var n=-1,i=-1,s=-1,o=-1,a=-1,l=-1;(e.match(nD)||[]).forEach(function(h,d){var f=parseInt(r[d+1],10);switch(h.toLowerCase().charAt(0)){case"y":n=f;break;case"d":s=f;break;case"h":o=f;break;case"s":l=f;break;case"m":o>=0?a=f:i=f;break}}),l>=0&&a==-1&&i>=0&&(a=i,i=-1);var c=(""+(n>=0?n:new Date().getFullYear())).slice(-4)+"-"+("00"+(i>=1?i:1)).slice(-2)+"-"+("00"+(s>=1?s:1)).slice(-2);c.length==7&&(c="0"+c),c.length==8&&(c="20"+c);var u=("00"+(o>=0?o:0)).slice(-2)+":"+("00"+(a>=0?a:0)).slice(-2)+":"+("00"+(l>=0?l:0)).slice(-2);return o==-1&&a==-1&&l==-1?c:n==-1&&i==-1&&s==-1?u:c+"T"+u}var EB=function(){var t={};t.version="1.2.0";function e(){for(var E=0,Y=new Array(256),D=0;D!=256;++D)E=D,E=E&1?-306674912^E>>>1:E>>>1,E=E&1?-306674912^E>>>1:E>>>1,E=E&1?-306674912^E>>>1:E>>>1,E=E&1?-306674912^E>>>1:E>>>1,E=E&1?-306674912^E>>>1:E>>>1,E=E&1?-306674912^E>>>1:E>>>1,E=E&1?-306674912^E>>>1:E>>>1,E=E&1?-306674912^E>>>1:E>>>1,Y[D]=E;return typeof Int32Array!="undefined"?new Int32Array(Y):Y}var r=e();function n(E){var Y=0,D=0,U=0,X=typeof Int32Array!="undefined"?new Int32Array(4096):new Array(4096);for(U=0;U!=256;++U)X[U]=E[U];for(U=0;U!=256;++U)for(D=E[U],Y=256+U;Y<4096;Y+=256)D=X[Y]=D>>>8^E[D&255];var G=[];for(U=1;U!=16;++U)G[U-1]=typeof Int32Array!="undefined"?X.subarray(U*256,U*256+256):X.slice(U*256,U*256+256);return G}var i=n(r),s=i[0],o=i[1],a=i[2],l=i[3],c=i[4],u=i[5],h=i[6],d=i[7],f=i[8],g=i[9],m=i[10],w=i[11],C=i[12],S=i[13],v=i[14];function T(E,Y){for(var D=Y^-1,U=0,X=E.length;U<X;)D=D>>>8^r[(D^E.charCodeAt(U++))&255];return~D}function A(E,Y){for(var D=Y^-1,U=E.length-15,X=0;X<U;)D=v[E[X++]^D&255]^S[E[X++]^D>>8&255]^C[E[X++]^D>>16&255]^w[E[X++]^D>>>24]^m[E[X++]]^g[E[X++]]^f[E[X++]]^d[E[X++]]^h[E[X++]]^u[E[X++]]^c[E[X++]]^l[E[X++]]^a[E[X++]]^o[E[X++]]^s[E[X++]]^r[E[X++]];for(U+=15;X<U;)D=D>>>8^r[(D^E[X++])&255];return~D}function M(E,Y){for(var D=Y^-1,U=0,X=E.length,G=0,ae=0;U<X;)G=E.charCodeAt(U++),G<128?D=D>>>8^r[(D^G)&255]:G<2048?(D=D>>>8^r[(D^(192|G>>6&31))&255],D=D>>>8^r[(D^(128|G&63))&255]):G>=55296&&G<57344?(G=(G&1023)+64,ae=E.charCodeAt(U++)&1023,D=D>>>8^r[(D^(240|G>>8&7))&255],D=D>>>8^r[(D^(128|G>>2&63))&255],D=D>>>8^r[(D^(128|ae>>6&15|(G&3)<<4))&255],D=D>>>8^r[(D^(128|ae&63))&255]):(D=D>>>8^r[(D^(224|G>>12&15))&255],D=D>>>8^r[(D^(128|G>>6&63))&255],D=D>>>8^r[(D^(128|G&63))&255]);return~D}return t.table=r,t.bstr=T,t.buf=A,t.str=M,t}(),xt=function(){var e={};e.version="1.2.1";function r(R,B){for(var k=R.split("/"),H=B.split("/"),W=0,V=0,de=Math.min(k.length,H.length);W<de;++W){if(V=k[W].length-H[W].length)return V;if(k[W]!=H[W])return k[W]<H[W]?-1:1}return k.length-H.length}function n(R){if(R.charAt(R.length-1)=="/")return R.slice(0,-1).indexOf("/")===-1?R:n(R.slice(0,-1));var B=R.lastIndexOf("/");return B===-1?R:R.slice(0,B+1)}function i(R){if(R.charAt(R.length-1)=="/")return i(R.slice(0,-1));var B=R.lastIndexOf("/");return B===-1?R:R.slice(B+1)}function s(R,B){typeof B=="string"&&(B=new Date(B));var k=B.getHours();k=k<<6|B.getMinutes(),k=k<<5|B.getSeconds()>>>1,R.write_shift(2,k);var H=B.getFullYear()-1980;H=H<<4|B.getMonth()+1,H=H<<5|B.getDate(),R.write_shift(2,H)}function o(R){var B=R.read_shift(2)&65535,k=R.read_shift(2)&65535,H=new Date,W=k&31;k>>>=5;var V=k&15;k>>>=4,H.setMilliseconds(0),H.setFullYear(k+1980),H.setMonth(V-1),H.setDate(W);var de=B&31;B>>>=5;var pe=B&63;return B>>>=6,H.setHours(B),H.setMinutes(pe),H.setSeconds(de<<1),H}function a(R){Kr(R,0);for(var B={},k=0;R.l<=R.length-4;){var H=R.read_shift(2),W=R.read_shift(2),V=R.l+W,de={};switch(H){case 21589:k=R.read_shift(1),k&1&&(de.mtime=R.read_shift(4)),W>5&&(k&2&&(de.atime=R.read_shift(4)),k&4&&(de.ctime=R.read_shift(4))),de.mtime&&(de.mt=new Date(de.mtime*1e3));break}R.l=V,B[H]=de}return B}var l;function c(){return l||(l={})}function u(R,B){if(R[0]==80&&R[1]==75)return no(R,B);if((R[0]|32)==109&&(R[1]|32)==105)return tw(R,B);if(R.length<512)throw new Error("CFB file size "+R.length+" < 512");var k=3,H=512,W=0,V=0,de=0,pe=0,he=0,Z=[],P=R.slice(0,512);Kr(P,0);var re=h(P);switch(k=re[0],k){case 3:H=512;break;case 4:H=4096;break;case 0:if(re[1]==0)return no(R,B);default:throw new Error("Major Version: Expected 3 or 4 saw "+k)}H!==512&&(P=R.slice(0,H),Kr(P,28));var fe=R.slice(0,H);d(P,k);var Ee=P.read_shift(4,"i");if(k===3&&Ee!==0)throw new Error("# Directory Sectors: Expected 0 saw "+Ee);P.l+=4,de=P.read_shift(4,"i"),P.l+=4,P.chk("00100000","Mini Stream Cutoff Size: "),pe=P.read_shift(4,"i"),W=P.read_shift(4,"i"),he=P.read_shift(4,"i"),V=P.read_shift(4,"i");for(var xe=-1,Ae=0;Ae<109&&(xe=P.read_shift(4,"i"),!(xe<0));++Ae)Z[Ae]=xe;var Ge=f(R,H);w(he,V,Ge,H,Z);var Nt=S(Ge,de,Z,H);Nt[de].name="!Directory",W>0&&pe!==ae&&(Nt[pe].name="!MiniFAT"),Nt[Z[0]].name="!FAT",Nt.fat_addrs=Z,Nt.ssz=H;var st={},xr=[],Xo=[],fc=[];v(de,Nt,Ge,xr,W,st,Xo,pe),g(Xo,fc,xr),xr.shift();var Qu={FileIndex:Xo,FullPaths:fc};return B&&B.raw&&(Qu.raw={header:fe,sectors:Ge}),Qu}function h(R){if(R[R.l]==80&&R[R.l+1]==75)return[0,0];R.chk(ve,"Header Signature: "),R.l+=16;var B=R.read_shift(2,"u");return[R.read_shift(2,"u"),B]}function d(R,B){var k=9;switch(R.l+=2,k=R.read_shift(2)){case 9:if(B!=3)throw new Error("Sector Shift: Expected 9 saw "+k);break;case 12:if(B!=4)throw new Error("Sector Shift: Expected 12 saw "+k);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+k)}R.chk("0600","Mini Sector Shift: "),R.chk("000000000000","Reserved: ")}function f(R,B){for(var k=Math.ceil(R.length/B)-1,H=[],W=1;W<k;++W)H[W-1]=R.slice(W*B,(W+1)*B);return H[k-1]=R.slice(k*B),H}function g(R,B,k){for(var H=0,W=0,V=0,de=0,pe=0,he=k.length,Z=[],P=[];H<he;++H)Z[H]=P[H]=H,B[H]=k[H];for(;pe<P.length;++pe)H=P[pe],W=R[H].L,V=R[H].R,de=R[H].C,Z[H]===H&&(W!==-1&&Z[W]!==W&&(Z[H]=Z[W]),V!==-1&&Z[V]!==V&&(Z[H]=Z[V])),de!==-1&&(Z[de]=H),W!==-1&&H!=Z[H]&&(Z[W]=Z[H],P.lastIndexOf(W)<pe&&P.push(W)),V!==-1&&H!=Z[H]&&(Z[V]=Z[H],P.lastIndexOf(V)<pe&&P.push(V));for(H=1;H<he;++H)Z[H]===H&&(V!==-1&&Z[V]!==V?Z[H]=Z[V]:W!==-1&&Z[W]!==W&&(Z[H]=Z[W]));for(H=1;H<he;++H)if(R[H].type!==0){if(pe=H,pe!=Z[pe])do pe=Z[pe],B[H]=B[pe]+"/"+B[H];while(pe!==0&&Z[pe]!==-1&&pe!=Z[pe]);Z[H]=-1}for(B[0]+="/",H=1;H<he;++H)R[H].type!==2&&(B[H]+="/")}function m(R,B,k){for(var H=R.start,W=R.size,V=[],de=H;k&&W>0&&de>=0;)V.push(B.slice(de*G,de*G+G)),W-=G,de=Ol(k,de*4);return V.length===0?Or(0):ma(V).slice(0,R.size)}function w(R,B,k,H,W){var V=ae;if(R===ae){if(B!==0)throw new Error("DIFAT chain shorter than expected")}else if(R!==-1){var de=k[R],pe=(H>>>2)-1;if(!de)return;for(var he=0;he<pe&&(V=Ol(de,he*4))!==ae;++he)W.push(V);w(Ol(de,H-4),B-1,k,H,W)}}function C(R,B,k,H,W){var V=[],de=[];W||(W=[]);var pe=H-1,he=0,Z=0;for(he=B;he>=0;){W[he]=!0,V[V.length]=he,de.push(R[he]);var P=k[Math.floor(he*4/H)];if(Z=he*4&pe,H<4+Z)throw new Error("FAT boundary crossed: "+he+" 4 "+H);if(!R[P])break;he=Ol(R[P],Z)}return{nodes:V,data:ZE([de])}}function S(R,B,k,H){var W=R.length,V=[],de=[],pe=[],he=[],Z=H-1,P=0,re=0,fe=0,Ee=0;for(P=0;P<W;++P)if(pe=[],fe=P+B,fe>=W&&(fe-=W),!de[fe]){he=[];var xe=[];for(re=fe;re>=0;){xe[re]=!0,de[re]=!0,pe[pe.length]=re,he.push(R[re]);var Ae=k[Math.floor(re*4/H)];if(Ee=re*4&Z,H<4+Ee)throw new Error("FAT boundary crossed: "+re+" 4 "+H);if(!R[Ae]||(re=Ol(R[Ae],Ee),xe[re]))break}V[fe]={nodes:pe,data:ZE([he])}}return V}function v(R,B,k,H,W,V,de,pe){for(var he=0,Z=H.length?2:0,P=B[R].data,re=0,fe=0,Ee;re<P.length;re+=128){var xe=P.slice(re,re+128);Kr(xe,64),fe=xe.read_shift(2),Ee=PS(xe,0,fe-Z),H.push(Ee);var Ae={name:Ee,type:xe.read_shift(1),color:xe.read_shift(1),L:xe.read_shift(4,"i"),R:xe.read_shift(4,"i"),C:xe.read_shift(4,"i"),clsid:xe.read_shift(16),state:xe.read_shift(4,"i"),start:0,size:0},Ge=xe.read_shift(2)+xe.read_shift(2)+xe.read_shift(2)+xe.read_shift(2);Ge!==0&&(Ae.ct=T(xe,xe.l-8));var Nt=xe.read_shift(2)+xe.read_shift(2)+xe.read_shift(2)+xe.read_shift(2);Nt!==0&&(Ae.mt=T(xe,xe.l-8)),Ae.start=xe.read_shift(4,"i"),Ae.size=xe.read_shift(4,"i"),Ae.size<0&&Ae.start<0&&(Ae.size=Ae.type=0,Ae.start=ae,Ae.name=""),Ae.type===5?(he=Ae.start,W>0&&he!==ae&&(B[he].name="!StreamData")):Ae.size>=4096?(Ae.storage="fat",B[Ae.start]===void 0&&(B[Ae.start]=C(k,Ae.start,B.fat_addrs,B.ssz)),B[Ae.start].name=Ae.name,Ae.content=B[Ae.start].data.slice(0,Ae.size)):(Ae.storage="minifat",Ae.size<0?Ae.size=0:he!==ae&&Ae.start!==ae&&B[he]&&(Ae.content=m(Ae,B[he].data,(B[pe]||{}).data))),Ae.content&&Kr(Ae.content,0),V[Ee]=Ae,de.push(Ae)}}function T(R,B){return new Date((li(R,B+4)/1e7*Math.pow(2,32)+li(R,B)/1e7-11644473600)*1e3)}function A(R,B){return c(),u(l.readFileSync(R),B)}function M(R,B){var k=B&&B.type;switch(k||St&&Buffer.isBuffer(R)&&(k="buffer"),k||"base64"){case"file":return A(R,B);case"base64":return u(os(gi(R)),B);case"binary":return u(os(R),B)}return u(R,B)}function E(R,B){var k=B||{},H=k.root||"Root Entry";if(R.FullPaths||(R.FullPaths=[]),R.FileIndex||(R.FileIndex=[]),R.FullPaths.length!==R.FileIndex.length)throw new Error("inconsistent CFB structure");R.FullPaths.length===0&&(R.FullPaths[0]=H+"/",R.FileIndex[0]={name:H,type:5}),k.CLSID&&(R.FileIndex[0].clsid=k.CLSID),Y(R)}function Y(R){var B="Sh33tJ5";if(!xt.find(R,"/"+B)){var k=Or(4);k[0]=55,k[1]=k[3]=50,k[2]=54,R.FileIndex.push({name:B,type:2,content:k,size:4,L:69,R:69,C:69}),R.FullPaths.push(R.FullPaths[0]+B),D(R)}}function D(R,B){E(R);for(var k=!1,H=!1,W=R.FullPaths.length-1;W>=0;--W){var V=R.FileIndex[W];switch(V.type){case 0:H?k=!0:(R.FileIndex.pop(),R.FullPaths.pop());break;case 1:case 2:case 5:H=!0,isNaN(V.R*V.L*V.C)&&(k=!0),V.R>-1&&V.L>-1&&V.R==V.L&&(k=!0);break;default:k=!0;break}}if(!(!k&&!B)){var de=new Date(1987,1,19),pe=0,he=Object.create?Object.create(null):{},Z=[];for(W=0;W<R.FullPaths.length;++W)he[R.FullPaths[W]]=!0,R.FileIndex[W].type!==0&&Z.push([R.FullPaths[W],R.FileIndex[W]]);for(W=0;W<Z.length;++W){var P=n(Z[W][0]);H=he[P],H||(Z.push([P,{name:i(P).replace("/",""),type:1,clsid:Re,ct:de,mt:de,content:null}]),he[P]=!0)}for(Z.sort(function(Ee,xe){return r(Ee[0],xe[0])}),R.FullPaths=[],R.FileIndex=[],W=0;W<Z.length;++W)R.FullPaths[W]=Z[W][0],R.FileIndex[W]=Z[W][1];for(W=0;W<Z.length;++W){var re=R.FileIndex[W],fe=R.FullPaths[W];if(re.name=i(fe).replace("/",""),re.L=re.R=re.C=-(re.color=1),re.size=re.content?re.content.length:0,re.start=0,re.clsid=re.clsid||Re,W===0)re.C=Z.length>1?1:-1,re.size=0,re.type=5;else if(fe.slice(-1)=="/"){for(pe=W+1;pe<Z.length&&n(R.FullPaths[pe])!=fe;++pe);for(re.C=pe>=Z.length?-1:pe,pe=W+1;pe<Z.length&&n(R.FullPaths[pe])!=n(fe);++pe);re.R=pe>=Z.length?-1:pe,re.type=1}else n(R.FullPaths[W+1]||"")==n(fe)&&(re.R=W+1),re.type=2}}}function U(R,B){var k=B||{};if(k.fileType=="mad")return dc(R,k);switch(D(R),k.fileType){case"zip":return qt(R,k)}var H=function(Ee){for(var xe=0,Ae=0,Ge=0;Ge<Ee.FileIndex.length;++Ge){var Nt=Ee.FileIndex[Ge];if(!!Nt.content){var st=Nt.content.length;st>0&&(st<4096?xe+=st+63>>6:Ae+=st+511>>9)}}for(var xr=Ee.FullPaths.length+3>>2,Xo=xe+7>>3,fc=xe+127>>7,Qu=Xo+Ae+xr+fc,qa=Qu+127>>7,rw=qa<=109?0:Math.ceil((qa-109)/127);Qu+qa+rw+127>>7>qa;)rw=++qa<=109?0:Math.ceil((qa-109)/127);var so=[1,rw,qa,fc,xr,Ae,xe,0];return Ee.FileIndex[0].size=xe<<6,so[7]=(Ee.FileIndex[0].start=so[0]+so[1]+so[2]+so[3]+so[4]+so[5])+(so[6]+7>>3),so}(R),W=Or(H[7]<<9),V=0,de=0;{for(V=0;V<8;++V)W.write_shift(1,me[V]);for(V=0;V<8;++V)W.write_shift(2,0);for(W.write_shift(2,62),W.write_shift(2,3),W.write_shift(2,65534),W.write_shift(2,9),W.write_shift(2,6),V=0;V<3;++V)W.write_shift(2,0);for(W.write_shift(4,0),W.write_shift(4,H[2]),W.write_shift(4,H[0]+H[1]+H[2]+H[3]-1),W.write_shift(4,0),W.write_shift(4,1<<12),W.write_shift(4,H[3]?H[0]+H[1]+H[2]-1:ae),W.write_shift(4,H[3]),W.write_shift(-4,H[1]?H[0]-1:ae),W.write_shift(4,H[1]),V=0;V<109;++V)W.write_shift(-4,V<H[2]?H[1]+V:-1)}if(H[1])for(de=0;de<H[1];++de){for(;V<236+de*127;++V)W.write_shift(-4,V<H[2]?H[1]+V:-1);W.write_shift(-4,de===H[1]-1?ae:de+1)}var pe=function(Ee){for(de+=Ee;V<de-1;++V)W.write_shift(-4,V+1);Ee&&(++V,W.write_shift(-4,ae))};for(de=V=0,de+=H[1];V<de;++V)W.write_shift(-4,Ce.DIFSECT);for(de+=H[2];V<de;++V)W.write_shift(-4,Ce.FATSECT);pe(H[3]),pe(H[4]);for(var he=0,Z=0,P=R.FileIndex[0];he<R.FileIndex.length;++he)P=R.FileIndex[he],P.content&&(Z=P.content.length,!(Z<4096)&&(P.start=de,pe(Z+511>>9)));for(pe(H[6]+7>>3);W.l&511;)W.write_shift(-4,Ce.ENDOFCHAIN);for(de=V=0,he=0;he<R.FileIndex.length;++he)P=R.FileIndex[he],P.content&&(Z=P.content.length,!(!Z||Z>=4096)&&(P.start=de,pe(Z+63>>6)));for(;W.l&511;)W.write_shift(-4,Ce.ENDOFCHAIN);for(V=0;V<H[4]<<2;++V){var re=R.FullPaths[V];if(!re||re.length===0){for(he=0;he<17;++he)W.write_shift(4,0);for(he=0;he<3;++he)W.write_shift(4,-1);for(he=0;he<12;++he)W.write_shift(4,0);continue}P=R.FileIndex[V],V===0&&(P.start=P.size?P.start-1:ae);var fe=V===0&&k.root||P.name;if(Z=2*(fe.length+1),W.write_shift(64,fe,"utf16le"),W.write_shift(2,Z),W.write_shift(1,P.type),W.write_shift(1,P.color),W.write_shift(-4,P.L),W.write_shift(-4,P.R),W.write_shift(-4,P.C),P.clsid)W.write_shift(16,P.clsid,"hex");else for(he=0;he<4;++he)W.write_shift(4,0);W.write_shift(4,P.state||0),W.write_shift(4,0),W.write_shift(4,0),W.write_shift(4,0),W.write_shift(4,0),W.write_shift(4,P.start),W.write_shift(4,P.size),W.write_shift(4,0)}for(V=1;V<R.FileIndex.length;++V)if(P=R.FileIndex[V],P.size>=4096)if(W.l=P.start+1<<9,St&&Buffer.isBuffer(P.content))P.content.copy(W,W.l,0,P.size),W.l+=P.size+511&-512;else{for(he=0;he<P.size;++he)W.write_shift(1,P.content[he]);for(;he&511;++he)W.write_shift(1,0)}for(V=1;V<R.FileIndex.length;++V)if(P=R.FileIndex[V],P.size>0&&P.size<4096)if(St&&Buffer.isBuffer(P.content))P.content.copy(W,W.l,0,P.size),W.l+=P.size+63&-64;else{for(he=0;he<P.size;++he)W.write_shift(1,P.content[he]);for(;he&63;++he)W.write_shift(1,0)}if(St)W.l=W.length;else for(;W.l<W.length;)W.write_shift(1,0);return W}function X(R,B){var k=R.FullPaths.map(function(he){return he.toUpperCase()}),H=k.map(function(he){var Z=he.split("/");return Z[Z.length-(he.slice(-1)=="/"?2:1)]}),W=!1;B.charCodeAt(0)===47?(W=!0,B=k[0].slice(0,-1)+B):W=B.indexOf("/")!==-1;var V=B.toUpperCase(),de=W===!0?k.indexOf(V):H.indexOf(V);if(de!==-1)return R.FileIndex[de];var pe=!V.match(Xh);for(V=V.replace(Dn,""),pe&&(V=V.replace(Xh,"!")),de=0;de<k.length;++de)if((pe?k[de].replace(Xh,"!"):k[de]).replace(Dn,"")==V||(pe?H[de].replace(Xh,"!"):H[de]).replace(Dn,"")==V)return R.FileIndex[de];return null}var G=64,ae=-2,ve="d0cf11e0a1b11ae1",me=[208,207,17,224,161,177,26,225],Re="00000000000000000000000000000000",Ce={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:ae,FREESECT:-1,HEADER_SIGNATURE:ve,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:Re,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function _e(R,B,k){c();var H=U(R,k);l.writeFileSync(B,H)}function p(R){for(var B=new Array(R.length),k=0;k<R.length;++k)B[k]=String.fromCharCode(R[k]);return B.join("")}function y(R,B){var k=U(R,B);switch(B&&B.type||"buffer"){case"file":return c(),l.writeFileSync(B.filename,k),k;case"binary":return typeof k=="string"?k:p(k);case"base64":return DE(typeof k=="string"?k:p(k));case"buffer":if(St)return Buffer.isBuffer(k)?k:tc(k);case"array":return typeof k=="string"?os(k):k}return k}var b;function x(R){try{var B=R.InflateRaw,k=new B;if(k._processChunk(new Uint8Array([3,0]),k._finishFlushFlag),k.bytesRead)b=R;else throw new Error("zlib does not expose bytesRead")}catch(H){console.error("cannot use native zlib: "+(H.message||H))}}function O(R,B){if(!b)return Rt(R,B);var k=b.InflateRaw,H=new k,W=H._processChunk(R.slice(R.l),H._finishFlushFlag);return R.l+=H.bytesRead,W}function _(R){return b?b.deflateRawSync(R):J(R)}var N=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],K=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],le=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];function ce(R){var B=(R<<1|R<<11)&139536|(R<<5|R<<15)&558144;return(B>>16|B>>8|B)&255}for(var te=typeof Uint8Array!="undefined",ge=te?new Uint8Array(1<<8):[],Me=0;Me<1<<8;++Me)ge[Me]=ce(Me);function L(R,B){var k=ge[R&255];return B<=8?k>>>8-B:(k=k<<8|ge[R>>8&255],B<=16?k>>>16-B:(k=k<<8|ge[R>>16&255],k>>>24-B))}function Fe(R,B){var k=B&7,H=B>>>3;return(R[H]|(k<=6?0:R[H+1]<<8))>>>k&3}function ue(R,B){var k=B&7,H=B>>>3;return(R[H]|(k<=5?0:R[H+1]<<8))>>>k&7}function ze(R,B){var k=B&7,H=B>>>3;return(R[H]|(k<=4?0:R[H+1]<<8))>>>k&15}function Ie(R,B){var k=B&7,H=B>>>3;return(R[H]|(k<=3?0:R[H+1]<<8))>>>k&31}function we(R,B){var k=B&7,H=B>>>3;return(R[H]|(k<=1?0:R[H+1]<<8))>>>k&127}function Be(R,B,k){var H=B&7,W=B>>>3,V=(1<<k)-1,de=R[W]>>>H;return k<8-H||(de|=R[W+1]<<8-H,k<16-H)||(de|=R[W+2]<<16-H,k<24-H)||(de|=R[W+3]<<24-H),de&V}function Le(R,B,k){var H=B&7,W=B>>>3;return H<=5?R[W]|=(k&7)<<H:(R[W]|=k<<H&255,R[W+1]=(k&7)>>8-H),B+3}function I(R,B,k){var H=B&7,W=B>>>3;return k=(k&1)<<H,R[W]|=k,B+1}function F(R,B,k){var H=B&7,W=B>>>3;return k<<=H,R[W]|=k&255,k>>>=8,R[W+1]=k,B+8}function z(R,B,k){var H=B&7,W=B>>>3;return k<<=H,R[W]|=k&255,k>>>=8,R[W+1]=k&255,R[W+2]=k>>>8,B+16}function se(R,B){var k=R.length,H=2*k>B?2*k:B+5,W=0;if(k>=B)return R;if(St){var V=kE(H);if(R.copy)R.copy(V);else for(;W<R.length;++W)V[W]=R[W];return V}else if(te){var de=new Uint8Array(H);if(de.set)de.set(R);else for(;W<k;++W)de[W]=R[W];return de}return R.length=H,R}function q(R){for(var B=new Array(R),k=0;k<R;++k)B[k]=0;return B}function ie(R,B,k){var H=1,W=0,V=0,de=0,pe=0,he=R.length,Z=te?new Uint16Array(32):q(32);for(V=0;V<32;++V)Z[V]=0;for(V=he;V<k;++V)R[V]=0;he=R.length;var P=te?new Uint16Array(he):q(he);for(V=0;V<he;++V)Z[W=R[V]]++,H<W&&(H=W),P[V]=0;for(Z[0]=0,V=1;V<=H;++V)Z[V+16]=pe=pe+Z[V-1]<<1;for(V=0;V<he;++V)pe=R[V],pe!=0&&(P[V]=Z[pe+16]++);var re=0;for(V=0;V<he;++V)if(re=R[V],re!=0)for(pe=L(P[V],H)>>H-re,de=(1<<H+4-re)-1;de>=0;--de)B[pe|de<<re]=re&15|V<<4;return H}var Q=te?new Uint16Array(512):q(512),ee=te?new Uint16Array(32):q(32);if(!te){for(var oe=0;oe<512;++oe)Q[oe]=0;for(oe=0;oe<32;++oe)ee[oe]=0}(function(){for(var R=[],B=0;B<32;B++)R.push(5);ie(R,ee,32);var k=[];for(B=0;B<=143;B++)k.push(8);for(;B<=255;B++)k.push(9);for(;B<=279;B++)k.push(7);for(;B<=287;B++)k.push(8);ie(k,Q,288)})();var ne=function(){for(var B=te?new Uint8Array(32768):[],k=0,H=0;k<le.length-1;++k)for(;H<le[k+1];++H)B[H]=k;for(;H<32768;++H)B[H]=29;var W=te?new Uint8Array(259):[];for(k=0,H=0;k<K.length-1;++k)for(;H<K[k+1];++H)W[H]=k;function V(pe,he){for(var Z=0;Z<pe.length;){var P=Math.min(65535,pe.length-Z),re=Z+P==pe.length;for(he.write_shift(1,+re),he.write_shift(2,P),he.write_shift(2,~P&65535);P-- >0;)he[he.l++]=pe[Z++]}return he.l}function de(pe,he){for(var Z=0,P=0,re=te?new Uint16Array(32768):[];P<pe.length;){var fe=Math.min(65535,pe.length-P);if(fe<10){for(Z=Le(he,Z,+(P+fe==pe.length)),Z&7&&(Z+=8-(Z&7)),he.l=Z/8|0,he.write_shift(2,fe),he.write_shift(2,~fe&65535);fe-- >0;)he[he.l++]=pe[P++];Z=he.l*8;continue}Z=Le(he,Z,+(P+fe==pe.length)+2);for(var Ee=0;fe-- >0;){var xe=pe[P];Ee=(Ee<<5^xe)&32767;var Ae=-1,Ge=0;if((Ae=re[Ee])&&(Ae|=P&-32768,Ae>P&&(Ae-=32768),Ae<P))for(;pe[Ae+Ge]==pe[P+Ge]&&Ge<250;)++Ge;if(Ge>2){xe=W[Ge],xe<=22?Z=F(he,Z,ge[xe+1]>>1)-1:(F(he,Z,3),Z+=5,F(he,Z,ge[xe-23]>>5),Z+=3);var Nt=xe<8?0:xe-4>>2;Nt>0&&(z(he,Z,Ge-K[xe]),Z+=Nt),xe=B[P-Ae],Z=F(he,Z,ge[xe]>>3),Z-=3;var st=xe<4?0:xe-2>>1;st>0&&(z(he,Z,P-Ae-le[xe]),Z+=st);for(var xr=0;xr<Ge;++xr)re[Ee]=P&32767,Ee=(Ee<<5^pe[P])&32767,++P;fe-=Ge-1}else xe<=143?xe=xe+48:Z=I(he,Z,1),Z=F(he,Z,ge[xe]),re[Ee]=P&32767,++P}Z=F(he,Z,0)-1}return he.l=(Z+7)/8|0,he.l}return function(he,Z){return he.length<8?V(he,Z):de(he,Z)}}();function J(R){var B=Or(50+Math.floor(R.length*1.1)),k=ne(R,B);return B.slice(0,k)}var Se=te?new Uint16Array(32768):q(32768),Oe=te?new Uint16Array(32768):q(32768),Pe=te?new Uint16Array(128):q(128),je=1,Qe=1;function kt(R,B){var k=Ie(R,B)+257;B+=5;var H=Ie(R,B)+1;B+=5;var W=ze(R,B)+4;B+=4;for(var V=0,de=te?new Uint8Array(19):q(19),pe=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],he=1,Z=te?new Uint8Array(8):q(8),P=te?new Uint8Array(8):q(8),re=de.length,fe=0;fe<W;++fe)de[N[fe]]=V=ue(R,B),he<V&&(he=V),Z[V]++,B+=3;var Ee=0;for(Z[0]=0,fe=1;fe<=he;++fe)P[fe]=Ee=Ee+Z[fe-1]<<1;for(fe=0;fe<re;++fe)(Ee=de[fe])!=0&&(pe[fe]=P[Ee]++);var xe=0;for(fe=0;fe<re;++fe)if(xe=de[fe],xe!=0){Ee=ge[pe[fe]]>>8-xe;for(var Ae=(1<<7-xe)-1;Ae>=0;--Ae)Pe[Ee|Ae<<xe]=xe&7|fe<<3}var Ge=[];for(he=1;Ge.length<k+H;)switch(Ee=Pe[we(R,B)],B+=Ee&7,Ee>>>=3){case 16:for(V=3+Fe(R,B),B+=2,Ee=Ge[Ge.length-1];V-- >0;)Ge.push(Ee);break;case 17:for(V=3+ue(R,B),B+=3;V-- >0;)Ge.push(0);break;case 18:for(V=11+we(R,B),B+=7;V-- >0;)Ge.push(0);break;default:Ge.push(Ee),he<Ee&&(he=Ee);break}var Nt=Ge.slice(0,k),st=Ge.slice(k);for(fe=k;fe<286;++fe)Nt[fe]=0;for(fe=H;fe<30;++fe)st[fe]=0;return je=ie(Nt,Se,286),Qe=ie(st,Oe,30),B}function lt(R,B){if(R[0]==3&&!(R[1]&3))return[Na(B),2];for(var k=0,H=0,W=kE(B||1<<18),V=0,de=W.length>>>0,pe=0,he=0;(H&1)==0;){if(H=ue(R,k),k+=3,H>>>1==0){k&7&&(k+=8-(k&7));var Z=R[k>>>3]|R[(k>>>3)+1]<<8;if(k+=32,Z>0)for(!B&&de<V+Z&&(W=se(W,V+Z),de=W.length);Z-- >0;)W[V++]=R[k>>>3],k+=8;continue}else H>>1==1?(pe=9,he=5):(k=kt(R,k),pe=je,he=Qe);for(;;){!B&&de<V+32767&&(W=se(W,V+32767),de=W.length);var P=Be(R,k,pe),re=H>>>1==1?Q[P]:Se[P];if(k+=re&15,re>>>=4,(re>>>8&255)===0)W[V++]=re;else{if(re==256)break;re-=257;var fe=re<8?0:re-4>>2;fe>5&&(fe=0);var Ee=V+K[re];fe>0&&(Ee+=Be(R,k,fe),k+=fe),P=Be(R,k,he),re=H>>>1==1?ee[P]:Oe[P],k+=re&15,re>>>=4;var xe=re<4?0:re-2>>1,Ae=le[re];for(xe>0&&(Ae+=Be(R,k,xe),k+=xe),!B&&de<Ee&&(W=se(W,Ee+100),de=W.length);V<Ee;)W[V]=W[V-Ae],++V}}}return B?[W,k+7>>>3]:[W.slice(0,V),k+7>>>3]}function Rt(R,B){var k=R.slice(R.l||0),H=lt(k,B);return R.l+=H[1],H[0]}function $t(R,B){if(R)typeof console!="undefined"&&console.error(B);else throw new Error(B)}function no(R,B){var k=R;Kr(k,0);var H=[],W=[],V={FileIndex:H,FullPaths:W};E(V,{root:B.root});for(var de=k.length-4;(k[de]!=80||k[de+1]!=75||k[de+2]!=5||k[de+3]!=6)&&de>=0;)--de;k.l=de+4,k.l+=4;var pe=k.read_shift(2);k.l+=6;var he=k.read_shift(4);for(k.l=he,de=0;de<pe;++de){k.l+=20;var Z=k.read_shift(4),P=k.read_shift(4),re=k.read_shift(2),fe=k.read_shift(2),Ee=k.read_shift(2);k.l+=8;var xe=k.read_shift(4),Ae=a(k.slice(k.l+re,k.l+re+fe));k.l+=re+fe+Ee;var Ge=k.l;k.l=xe+4,Xa(k,Z,P,V,Ae),k.l=Ge}return V}function Xa(R,B,k,H,W){R.l+=2;var V=R.read_shift(2),de=R.read_shift(2),pe=o(R);if(V&8257)throw new Error("Unsupported ZIP encryption");for(var he=R.read_shift(4),Z=R.read_shift(4),P=R.read_shift(4),re=R.read_shift(2),fe=R.read_shift(2),Ee="",xe=0;xe<re;++xe)Ee+=String.fromCharCode(R[R.l++]);if(fe){var Ae=a(R.slice(R.l,R.l+fe));(Ae[21589]||{}).mt&&(pe=Ae[21589].mt),((W||{})[21589]||{}).mt&&(pe=W[21589].mt)}R.l+=fe;var Ge=R.slice(R.l,R.l+Z);switch(de){case 8:Ge=O(R,P);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+de)}var Nt=!1;V&8&&(he=R.read_shift(4),he==134695760&&(he=R.read_shift(4),Nt=!0),Z=R.read_shift(4),P=R.read_shift(4)),Z!=B&&$t(Nt,"Bad compressed size: "+B+" != "+Z),P!=k&&$t(Nt,"Bad uncompressed size: "+k+" != "+P),Zu(H,Ee,Ge,{unsafe:!0,mt:pe})}function qt(R,B){var k=B||{},H=[],W=[],V=Or(1),de=k.compression?8:0,pe=0,he=0,Z=0,P=0,re=0,fe=R.FullPaths[0],Ee=fe,xe=R.FileIndex[0],Ae=[],Ge=0;for(he=1;he<R.FullPaths.length;++he)if(Ee=R.FullPaths[he].slice(fe.length),xe=R.FileIndex[he],!(!xe.size||!xe.content||Ee=="Sh33tJ5")){var Nt=P,st=Or(Ee.length);for(Z=0;Z<Ee.length;++Z)st.write_shift(1,Ee.charCodeAt(Z)&127);st=st.slice(0,st.l),Ae[re]=EB.buf(xe.content,0);var xr=xe.content;de==8&&(xr=_(xr)),V=Or(30),V.write_shift(4,67324752),V.write_shift(2,20),V.write_shift(2,pe),V.write_shift(2,de),xe.mt?s(V,xe.mt):V.write_shift(4,0),V.write_shift(-4,Ae[re]),V.write_shift(4,xr.length),V.write_shift(4,xe.content.length),V.write_shift(2,st.length),V.write_shift(2,0),P+=V.length,H.push(V),P+=st.length,H.push(st),P+=xr.length,H.push(xr),V=Or(46),V.write_shift(4,33639248),V.write_shift(2,0),V.write_shift(2,20),V.write_shift(2,pe),V.write_shift(2,de),V.write_shift(4,0),V.write_shift(-4,Ae[re]),V.write_shift(4,xr.length),V.write_shift(4,xe.content.length),V.write_shift(2,st.length),V.write_shift(2,0),V.write_shift(2,0),V.write_shift(2,0),V.write_shift(2,0),V.write_shift(4,0),V.write_shift(4,Nt),Ge+=V.l,W.push(V),Ge+=st.length,W.push(st),++re}return V=Or(22),V.write_shift(4,101010256),V.write_shift(2,0),V.write_shift(2,0),V.write_shift(2,re),V.write_shift(2,re),V.write_shift(4,Ge),V.write_shift(4,P),V.write_shift(2,0),ma([ma(H),ma(W),V])}var hr={htm:"text/html",xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",png:"image/png",mso:"application/x-mso",thmx:"application/vnd.ms-officetheme",sh33tj5:"application/octet-stream"};function io(R,B){if(R.ctype)return R.ctype;var k=R.name||"",H=k.match(/\.([^\.]+)$/);return H&&hr[H[1]]||B&&(H=(k=B).match(/[\.\\]([^\.\\])+$/),H&&hr[H[1]])?hr[H[1]]:"application/octet-stream"}function Gr(R){for(var B=DE(R),k=[],H=0;H<B.length;H+=76)k.push(B.slice(H,H+76));return k.join(`\r
  2. `)+`\r
  3. `}function pr(R){var B=R.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g,function(Z){var P=Z.charCodeAt(0).toString(16).toUpperCase();return"="+(P.length==1?"0"+P:P)});B=B.replace(/ $/mg,"=20").replace(/\t$/mg,"=09"),B.charAt(0)==`
  4. `&&(B="=0D"+B.slice(1)),B=B.replace(/\r(?!\n)/mg,"=0D").replace(/\n\n/mg,`
  5. =0A`).replace(/([^\r\n])\n/mg,"$1=0A");for(var k=[],H=B.split(`\r
  6. `),W=0;W<H.length;++W){var V=H[W];if(V.length==0){k.push("");continue}for(var de=0;de<V.length;){var pe=76,he=V.slice(de,de+pe);he.charAt(pe-1)=="="?pe--:he.charAt(pe-2)=="="?pe-=2:he.charAt(pe-3)=="="&&(pe-=3),he=V.slice(de,de+pe),de+=pe,de<V.length&&(he+="="),k.push(he)}}return k.join(`\r
  7. `)}function Bt(R){for(var B=[],k=0;k<R.length;++k){for(var H=R[k];k<=R.length&&H.charAt(H.length-1)=="=";)H=H.slice(0,H.length-1)+R[++k];B.push(H)}for(var W=0;W<B.length;++W)B[W]=B[W].replace(/[=][0-9A-Fa-f]{2}/g,function(V){return String.fromCharCode(parseInt(V.slice(1),16))});return os(B.join(`\r
  8. `))}function Pf(R,B,k){for(var H="",W="",V="",de,pe=0;pe<10;++pe){var he=B[pe];if(!he||he.match(/^\s*$/))break;var Z=he.match(/^(.*?):\s*([^\s].*)$/);if(Z)switch(Z[1].toLowerCase()){case"content-location":H=Z[2].trim();break;case"content-type":V=Z[2].trim();break;case"content-transfer-encoding":W=Z[2].trim();break}}switch(++pe,W.toLowerCase()){case"base64":de=os(gi(B.slice(pe).join("")));break;case"quoted-printable":de=Bt(B.slice(pe));break;default:throw new Error("Unsupported Content-Transfer-Encoding "+W)}var P=Zu(R,H.slice(k.length),de,{unsafe:!0});V&&(P.ctype=V)}function tw(R,B){if(p(R.slice(0,13)).toLowerCase()!="mime-version:")throw new Error("Unsupported MAD header");var k=B&&B.root||"",H=(St&&Buffer.isBuffer(R)?R.toString("binary"):p(R)).split(`\r
  9. `),W=0,V="";for(W=0;W<H.length;++W)if(V=H[W],!!/^Content-Location:/i.test(V)&&(V=V.slice(V.indexOf("file")),k||(k=V.slice(0,V.lastIndexOf("/")+1)),V.slice(0,k.length)!=k))for(;k.length>0&&(k=k.slice(0,k.length-1),k=k.slice(0,k.lastIndexOf("/")+1),V.slice(0,k.length)!=k););var de=(H[1]||"").match(/boundary="(.*?)"/);if(!de)throw new Error("MAD cannot find boundary");var pe="--"+(de[1]||""),he=[],Z=[],P={FileIndex:he,FullPaths:Z};E(P);var re,fe=0;for(W=0;W<H.length;++W){var Ee=H[W];Ee!==pe&&Ee!==pe+"--"||(fe++&&Pf(P,H.slice(re,W),k),re=W)}return P}function dc(R,B){var k=B||{},H=k.boundary||"SheetJS";H="------="+H;for(var W=["MIME-Version: 1.0",'Content-Type: multipart/related; boundary="'+H.slice(2)+'"',"","",""],V=R.FullPaths[0],de=V,pe=R.FileIndex[0],he=1;he<R.FullPaths.length;++he)if(de=R.FullPaths[he].slice(V.length),pe=R.FileIndex[he],!(!pe.size||!pe.content||de=="Sh33tJ5")){de=de.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF]/g,function(Ge){return"_x"+Ge.charCodeAt(0).toString(16)+"_"}).replace(/[\u0080-\uFFFF]/g,function(Ge){return"_u"+Ge.charCodeAt(0).toString(16)+"_"});for(var Z=pe.content,P=St&&Buffer.isBuffer(Z)?Z.toString("binary"):p(Z),re=0,fe=Math.min(1024,P.length),Ee=0,xe=0;xe<=fe;++xe)(Ee=P.charCodeAt(xe))>=32&&Ee<128&&++re;var Ae=re>=fe*4/5;W.push(H),W.push("Content-Location: "+(k.root||"file:///C:/SheetJS/")+de),W.push("Content-Transfer-Encoding: "+(Ae?"quoted-printable":"base64")),W.push("Content-Type: "+io(pe,de)),W.push(""),W.push(Ae?pr(P):Gr(P))}return W.push(H+`--\r
  10. `),W.join(`\r
  11. `)}function qu(R){var B={};return E(B,R),B}function Zu(R,B,k,H){var W=H&&H.unsafe;W||E(R);var V=!W&&xt.find(R,B);if(!V){var de=R.FullPaths[0];B.slice(0,de.length)==de?de=B:(de.slice(-1)!="/"&&(de+="/"),de=(de+B).replace("//","/")),V={name:i(B),type:2},R.FileIndex.push(V),R.FullPaths.push(de),W||xt.utils.cfb_gc(R)}return V.content=k,V.size=k?k.length:0,H&&(H.CLSID&&(V.clsid=H.CLSID),H.mt&&(V.mt=H.mt),H.ct&&(V.ct=H.ct)),V}function Bi(R,B){E(R);var k=xt.find(R,B);if(k){for(var H=0;H<R.FileIndex.length;++H)if(R.FileIndex[H]==k)return R.FileIndex.splice(H,1),R.FullPaths.splice(H,1),!0}return!1}function Ju(R,B,k){E(R);var H=xt.find(R,B);if(H){for(var W=0;W<R.FileIndex.length;++W)if(R.FileIndex[W]==H)return R.FileIndex[W].name=i(k),R.FullPaths[W]=k,!0}return!1}function Df(R){D(R,!0)}return e.find=X,e.read=M,e.parse=u,e.write=y,e.writeFile=_e,e.utils={cfb_new:qu,cfb_add:Zu,cfb_del:Bi,cfb_mov:Ju,cfb_gc:Df,ReadShift:nd,CheckField:TD,prep_blob:Kr,bconcat:ma,use_zlib:x,_deflateRaw:J,_inflateRaw:Rt,consts:Ce},e}();function RB(t){if(typeof Deno!="undefined")return Deno.readFileSync(t);if(typeof $!="undefined"&&typeof File!="undefined"&&typeof Folder!="undefined")try{var e=File(t);e.open("r"),e.encoding="binary";var r=e.read();return e.close(),r}catch(n){if(!n.message||!n.message.match(/onstruct/))throw n}throw new Error("Cannot access file "+t)}function Xs(t){for(var e=Object.keys(t),r=[],n=0;n<e.length;++n)Object.prototype.hasOwnProperty.call(t,e[n])&&r.push(e[n]);return r}function AS(t){for(var e=[],r=Xs(t),n=0;n!==r.length;++n)e[t[r[n]]]=r[n];return e}var J0=new Date(1899,11,30,0,0,0);function kn(t,e){var r=t.getTime();e&&(r-=1462*24*60*60*1e3);var n=J0.getTime()+(t.getTimezoneOffset()-J0.getTimezoneOffset())*6e4;return(r-n)/(24*60*60*1e3)}var iD=new Date,TB=J0.getTime()+(iD.getTimezoneOffset()-J0.getTimezoneOffset())*6e4,VE=iD.getTimezoneOffset();function tp(t){var e=new Date;return e.setTime(t*24*60*60*1e3+TB),e.getTimezoneOffset()!==VE&&e.setTime(e.getTime()+(e.getTimezoneOffset()-VE)*6e4),e}function _B(t){var e=0,r=0,n=!1,i=t.match(/P([0-9\.]+Y)?([0-9\.]+M)?([0-9\.]+D)?T([0-9\.]+H)?([0-9\.]+M)?([0-9\.]+S)?/);if(!i)throw new Error("|"+t+"| is not an ISO8601 Duration");for(var s=1;s!=i.length;++s)if(!!i[s]){switch(r=1,s>3&&(n=!0),i[s].slice(i[s].length-1)){case"Y":throw new Error("Unsupported ISO Duration Field: "+i[s].slice(i[s].length-1));case"D":r*=24;case"H":r*=60;case"M":if(n)r*=60;else throw new Error("Unsupported ISO Duration Field: M")}e+=r*parseInt(i[s],10)}return e}var UE=new Date("2017-02-19T19:06:09.000Z"),sD=isNaN(UE.getFullYear())?new Date("2/19/17"):UE,AB=sD.getFullYear()==2017;function Vr(t,e){var r=new Date(t);if(AB)return e>0?r.setTime(r.getTime()+r.getTimezoneOffset()*60*1e3):e<0&&r.setTime(r.getTime()-r.getTimezoneOffset()*60*1e3),r;if(t instanceof Date)return t;if(sD.getFullYear()==1917&&!isNaN(r.getFullYear())){var n=r.getFullYear();return t.indexOf(""+n)>-1||r.setFullYear(r.getFullYear()+100),r}var i=t.match(/\d+/g)||["2017","2","19","0","0","0"],s=new Date(+i[0],+i[1]-1,+i[2],+i[3]||0,+i[4]||0,+i[5]||0);return t.indexOf("Z")>-1&&(s=new Date(s.getTime()-s.getTimezoneOffset()*60*1e3)),s}function Gl(t,e){if(St&&Buffer.isBuffer(t)){if(e){if(t[0]==255&&t[1]==254)return Zh(t.slice(2).toString("utf16le"));if(t[1]==254&&t[2]==255)return Zh(Y2(t.slice(2).toString("binary")))}return t.toString("binary")}if(typeof TextDecoder!="undefined")try{if(e){if(t[0]==255&&t[1]==254)return Zh(new TextDecoder("utf-16le").decode(t.slice(2)));if(t[0]==254&&t[1]==255)return Zh(new TextDecoder("utf-16be").decode(t.slice(2)))}var r={"\u20AC":"\x80","\u201A":"\x82",\u0192:"\x83","\u201E":"\x84","\u2026":"\x85","\u2020":"\x86","\u2021":"\x87","\u02C6":"\x88","\u2030":"\x89",\u0160:"\x8A","\u2039":"\x8B",\u0152:"\x8C",\u017D:"\x8E","\u2018":"\x91","\u2019":"\x92","\u201C":"\x93","\u201D":"\x94","\u2022":"\x95","\u2013":"\x96","\u2014":"\x97","\u02DC":"\x98","\u2122":"\x99",\u0161:"\x9A","\u203A":"\x9B",\u0153:"\x9C",\u017E:"\x9E",\u0178:"\x9F"};return Array.isArray(t)&&(t=new Uint8Array(t)),new TextDecoder("latin1").decode(t).replace(/[€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ]/g,function(s){return r[s]||s})}catch(s){}for(var n=[],i=0;i!=t.length;++i)n.push(String.fromCharCode(t[i]));return n.join("")}function Xr(t){if(typeof JSON!="undefined"&&!Array.isArray(t))return JSON.parse(JSON.stringify(t));if(typeof t!="object"||t==null)return t;if(t instanceof Date)return new Date(t.getTime());var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=Xr(t[r]));return e}function gr(t,e){for(var r="";r.length<e;)r+=t;return r}function us(t){var e=Number(t);if(!isNaN(e))return isFinite(e)?e:NaN;if(!/\d/.test(t))return e;var r=1,n=t.replace(/([\d]),([\d])/g,"$1$2").replace(/[$]/g,"").replace(/[%]/g,function(){return r*=100,""});return!isNaN(e=Number(n))||(n=n.replace(/[(](.*)[)]/,function(i,s){return r=-r,s}),!isNaN(e=Number(n)))?e/r:e}var MB=["january","february","march","april","may","june","july","august","september","october","november","december"];function Mu(t){var e=new Date(t),r=new Date(NaN),n=e.getYear(),i=e.getMonth(),s=e.getDate();if(isNaN(s))return r;var o=t.toLowerCase();if(o.match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)){if(o=o.replace(/[^a-z]/g,"").replace(/([^a-z]|^)[ap]m?([^a-z]|$)/,""),o.length>3&&MB.indexOf(o)==-1)return r}else if(o.match(/[a-z]/))return r;return n<0||n>8099?r:(i>0||s>1)&&n!=101?e:t.match(/[^-0-9:,\/\\]/)?r:e}var OB=function(){var t="abacaba".split(/(:?b)/i).length==5;return function(r,n,i){if(t||typeof n=="string")return r.split(n);for(var s=r.split(n),o=[s[0]],a=1;a<s.length;++a)o.push(i),o.push(s[a]);return o}}();function oD(t){return t?t.content&&t.type?Gl(t.content,!0):t.data?Kh(t.data):t.asNodeBuffer&&St?Kh(t.asNodeBuffer().toString("binary")):t.asBinary?Kh(t.asBinary()):t._data&&t._data.getContent?Kh(Gl(Array.prototype.slice.call(t._data.getContent(),0))):null:null}function aD(t){if(!t)return null;if(t.data)return IE(t.data);if(t.asNodeBuffer&&St)return t.asNodeBuffer();if(t._data&&t._data.getContent){var e=t._data.getContent();return typeof e=="string"?IE(e):Array.prototype.slice.call(e)}return t.content&&t.type?t.content:null}function IB(t){return t&&t.name.slice(-4)===".bin"?aD(t):oD(t)}function Ei(t,e){for(var r=t.FullPaths||Xs(t.files),n=e.toLowerCase().replace(/[\/]/g,"\\"),i=n.replace(/\\/g,"/"),s=0;s<r.length;++s){var o=r[s].replace(/^Root Entry[\/]/,"").toLowerCase();if(n==o||i==o)return t.files?t.files[r[s]]:t.FileIndex[s]}return null}function MS(t,e){var r=Ei(t,e);if(r==null)throw new Error("Cannot find file "+e+" in zip");return r}function Rr(t,e,r){if(!r)return IB(MS(t,e));if(!e)return null;try{return Rr(t,e)}catch(n){return null}}function hi(t,e,r){if(!r)return oD(MS(t,e));if(!e)return null;try{return hi(t,e)}catch(n){return null}}function lD(t,e,r){if(!r)return aD(MS(t,e));if(!e)return null;try{return lD(t,e)}catch(n){return null}}function GE(t){for(var e=t.FullPaths||Xs(t.files),r=[],n=0;n<e.length;++n)e[n].slice(-1)!="/"&&r.push(e[n].replace(/^Root Entry[\/]/,""));return r.sort()}function PB(t,e,r){if(t.FullPaths){if(typeof r=="string"){var n;return St?n=tc(r):n=J4(r),xt.utils.cfb_add(t,e,n)}xt.utils.cfb_add(t,e,r)}else t.file(e,r)}function cD(t,e){switch(e.type){case"base64":return xt.read(t,{type:"base64"});case"binary":return xt.read(t,{type:"binary"});case"buffer":case"array":return xt.read(t,{type:"buffer"})}throw new Error("Unrecognized type "+e.type)}function qh(t,e){if(t.charAt(0)=="/")return t.slice(1);var r=e.split("/");e.slice(-1)!="/"&&r.pop();for(var n=t.split("/");n.length!==0;){var i=n.shift();i===".."?r.pop():i!=="."&&r.push(i)}return r.join("/")}var uD=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
  12. `,DB=/([^"\s?>\/]+)\s*=\s*((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g,YE=/<[\/\?]?[a-zA-Z0-9:_-]+(?:\s+[^"\s?>\/]+\s*=\s*(?:"[^"]*"|'[^']*'|[^'">\s=]+))*\s*[\/\?]?>/mg,kB=/<[^>]*>/g,gn=uD.match(YE)?YE:kB,NB=/<\w*:/,HB=/<(\/?)\w+:/;function Ze(t,e,r){for(var n={},i=0,s=0;i!==t.length&&!((s=t.charCodeAt(i))===32||s===10||s===13);++i);if(e||(n[0]=t.slice(0,i)),i===t.length)return n;var o=t.match(DB),a=0,l="",c=0,u="",h="",d=1;if(o)for(c=0;c!=o.length;++c){for(h=o[c],s=0;s!=h.length&&h.charCodeAt(s)!==61;++s);for(u=h.slice(0,s).trim();h.charCodeAt(s+1)==32;)++s;for(d=(i=h.charCodeAt(s+1))==34||i==39?1:0,l=h.slice(s+1+d,h.length-d),a=0;a!=u.length&&u.charCodeAt(a)!==58;++a);if(a===u.length)u.indexOf("_")>0&&(u=u.slice(0,u.indexOf("_"))),n[u]=l,r||(n[u.toLowerCase()]=l);else{var f=(a===5&&u.slice(0,5)==="xmlns"?"xmlns":"")+u.slice(a+1);if(n[f]&&u.slice(a-3,a)=="ext")continue;n[f]=l,r||(n[f.toLowerCase()]=l)}}return n}function Js(t){return t.replace(HB,"<$1")}var hD={"&quot;":'"',"&apos;":"'","&gt;":">","&lt;":"<","&amp;":"&"},FB=AS(hD),_t=function(){var t=/&(?:quot|apos|gt|lt|amp|#x?([\da-fA-F]+));/ig,e=/_x([\da-fA-F]{4})_/ig;return function r(n){var i=n+"",s=i.indexOf("<![CDATA[");if(s==-1)return i.replace(t,function(a,l){return hD[a]||String.fromCharCode(parseInt(l,a.indexOf("x")>-1?16:10))||a}).replace(e,function(a,l){return String.fromCharCode(parseInt(l,16))});var o=i.indexOf("]]>");return r(i.slice(0,s))+i.slice(s+9,o)+r(i.slice(o+3))}}(),LB=/[&<>'"]/g,$B=/[\u0000-\u001f]/g;function OS(t){var e=t+"";return e.replace(LB,function(r){return FB[r]}).replace(/\n/g,"<br/>").replace($B,function(r){return"&#x"+("000"+r.charCodeAt(0).toString(16)).slice(-4)+";"})}var zE=function(){var t=/&#(\d+);/g;function e(r,n){return String.fromCharCode(parseInt(n,10))}return function(n){return n.replace(t,e)}}();function er(t){switch(t){case 1:case!0:case"1":case"true":case"TRUE":return!0;default:return!1}}function ow(t){for(var e="",r=0,n=0,i=0,s=0,o=0,a=0;r<t.length;){if(n=t.charCodeAt(r++),n<128){e+=String.fromCharCode(n);continue}if(i=t.charCodeAt(r++),n>191&&n<224){o=(n&31)<<6,o|=i&63,e+=String.fromCharCode(o);continue}if(s=t.charCodeAt(r++),n<240){e+=String.fromCharCode((n&15)<<12|(i&63)<<6|s&63);continue}o=t.charCodeAt(r++),a=((n&7)<<18|(i&63)<<12|(s&63)<<6|o&63)-65536,e+=String.fromCharCode(55296+(a>>>10&1023)),e+=String.fromCharCode(56320+(a&1023))}return e}function jE(t){var e=Na(2*t.length),r,n,i=1,s=0,o=0,a;for(n=0;n<t.length;n+=i)i=1,(a=t.charCodeAt(n))<128?r=a:a<224?(r=(a&31)*64+(t.charCodeAt(n+1)&63),i=2):a<240?(r=(a&15)*4096+(t.charCodeAt(n+1)&63)*64+(t.charCodeAt(n+2)&63),i=3):(i=4,r=(a&7)*262144+(t.charCodeAt(n+1)&63)*4096+(t.charCodeAt(n+2)&63)*64+(t.charCodeAt(n+3)&63),r-=65536,o=55296+(r>>>10&1023),r=56320+(r&1023)),o!==0&&(e[s++]=o&255,e[s++]=o>>>8,o=0),e[s++]=r%256,e[s++]=r>>>8;return e.slice(0,s).toString("ucs2")}function KE(t){return tc(t,"binary").toString("utf8")}var Vf="foo bar baz\xE2\x98\x83\xF0\x9F\x8D\xA3",Yt=St&&(KE(Vf)==ow(Vf)&&KE||jE(Vf)==ow(Vf)&&jE)||ow,Zh=St?function(t){return tc(t,"utf8").toString("binary")}:function(t){for(var e=[],r=0,n=0,i=0;r<t.length;)switch(n=t.charCodeAt(r++),!0){case n<128:e.push(String.fromCharCode(n));break;case n<2048:e.push(String.fromCharCode(192+(n>>6))),e.push(String.fromCharCode(128+(n&63)));break;case(n>=55296&&n<57344):n-=55296,i=t.charCodeAt(r++)-56320+(n<<10),e.push(String.fromCharCode(240+(i>>18&7))),e.push(String.fromCharCode(144+(i>>12&63))),e.push(String.fromCharCode(128+(i>>6&63))),e.push(String.fromCharCode(128+(i&63)));break;default:e.push(String.fromCharCode(224+(n>>12))),e.push(String.fromCharCode(128+(n>>6&63))),e.push(String.fromCharCode(128+(n&63)))}return e.join("")},Dd=function(){var t={};return function(r,n){var i=r+"|"+(n||"");return t[i]?t[i]:t[i]=new RegExp("<(?:\\w+:)?"+r+'(?: xml:space="preserve")?(?:[^>]*)>([\\s\\S]*?)</(?:\\w+:)?'+r+">",n||"")}}(),dD=function(){var t=[["nbsp"," "],["middot","\xB7"],["quot",'"'],["apos","'"],["gt",">"],["lt","<"],["amp","&"]].map(function(e){return[new RegExp("&"+e[0]+";","ig"),e[1]]});return function(r){for(var n=r.replace(/^[\t\n\r ]+/,"").replace(/[\t\n\r ]+$/,"").replace(/>\s+/g,">").replace(/\s+</g,"<").replace(/[\t\n\r ]+/g," ").replace(/<\s*[bB][rR]\s*\/?>/g,`
  13. `).replace(/<[^>]*>/g,""),i=0;i<t.length;++i)n=n.replace(t[i][0],t[i][1]);return n}}(),BB=function(){var t={};return function(r){return t[r]!==void 0?t[r]:t[r]=new RegExp("<(?:vt:)?"+r+">([\\s\\S]*?)</(?:vt:)?"+r+">","g")}}(),WB=/<\/?(?:vt:)?variant>/g,VB=/<(?:vt:)([^>]*)>([\s\S]*)</;function XE(t,e){var r=Ze(t),n=t.match(BB(r.baseType))||[],i=[];if(n.length!=r.size){if(e.WTF)throw new Error("unexpected vector length "+n.length+" != "+r.size);return i}return n.forEach(function(s){var o=s.replace(WB,"").match(VB);o&&i.push({v:Yt(o[2]),t:o[1]})}),i}var UB=/(^\s|\s$|\n)/;function GB(t){return Xs(t).map(function(e){return" "+e+'="'+t[e]+'"'}).join("")}function YB(t,e,r){return"<"+t+(r!=null?GB(r):"")+(e!=null?(e.match(UB)?' xml:space="preserve"':"")+">"+e+"</"+t:"/")+">"}function IS(t){if(St&&Buffer.isBuffer(t))return t.toString("utf8");if(typeof t=="string")return t;if(typeof Uint8Array!="undefined"&&t instanceof Uint8Array)return Yt(rc(RS(t)));throw new Error("Bad input format: expected Buffer or string")}var kd=/<(\/?)([^\s?><!\/:]*:|)([^\s?<>:\/]+)(?:[\s?:\/][^>]*)?>/mg,zB={CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",CT:"http://schemas.openxmlformats.org/package/2006/content-types",RELS:"http://schemas.openxmlformats.org/package/2006/relationships",TCMNT:"http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",mx:"http://schemas.microsoft.com/office/mac/excel/2008/main",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",sjs:"http://schemas.openxmlformats.org/package/2006/sheetjs/core-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",xsi:"http://www.w3.org/2001/XMLSchema-instance",xsd:"http://www.w3.org/2001/XMLSchema"},jB=["http://schemas.openxmlformats.org/spreadsheetml/2006/main","http://purl.oclc.org/ooxml/spreadsheetml/main","http://schemas.microsoft.com/office/excel/2006/main","http://schemas.microsoft.com/office/excel/2006/2"];function KB(t,e){for(var r=1-2*(t[e+7]>>>7),n=((t[e+7]&127)<<4)+(t[e+6]>>>4&15),i=t[e+6]&15,s=5;s>=0;--s)i=i*256+t[e+s];return n==2047?i==0?r*(1/0):NaN:(n==0?n=-1022:(n-=1023,i+=Math.pow(2,52)),r*Math.pow(2,n-52)*i)}function XB(t,e,r){var n=(e<0||1/e==-1/0?1:0)<<7,i=0,s=0,o=n?-e:e;isFinite(o)?o==0?i=s=0:(i=Math.floor(Math.log(o)/Math.LN2),s=o*Math.pow(2,52-i),i<=-1023&&(!isFinite(s)||s<Math.pow(2,52))?i=-1022:(s-=Math.pow(2,52),i+=1023)):(i=2047,s=isNaN(e)?26985:0);for(var a=0;a<=5;++a,s/=256)t[r+a]=s&255;t[r+6]=(i&15)<<4|s&15,t[r+7]=i>>4|n}var qE=function(t){for(var e=[],r=10240,n=0;n<t[0].length;++n)if(t[0][n])for(var i=0,s=t[0][n].length;i<s;i+=r)e.push.apply(e,t[0][n].slice(i,i+r));return e},ZE=St?function(t){return t[0].length>0&&Buffer.isBuffer(t[0][0])?Buffer.concat(t[0].map(function(e){return Buffer.isBuffer(e)?e:tc(e)})):qE(t)}:qE,JE=function(t,e,r){for(var n=[],i=e;i<r;i+=2)n.push(String.fromCharCode(To(t,i)));return n.join("").replace(Dn,"")},PS=St?function(t,e,r){return Buffer.isBuffer(t)?t.toString("utf16le",e,r).replace(Dn,""):JE(t,e,r)}:JE,QE=function(t,e,r){for(var n=[],i=e;i<e+r;++i)n.push(("0"+t[i].toString(16)).slice(-2));return n.join("")},fD=St?function(t,e,r){return Buffer.isBuffer(t)?t.toString("hex",e,e+r):QE(t,e,r)}:QE,eR=function(t,e,r){for(var n=[],i=e;i<r;i++)n.push(String.fromCharCode(su(t,i)));return n.join("")},rf=St?function(e,r,n){return Buffer.isBuffer(e)?e.toString("utf8",r,n):eR(e,r,n)}:eR,gD=function(t,e){var r=li(t,e);return r>0?rf(t,e+4,e+4+r-1):""},mD=gD,pD=function(t,e){var r=li(t,e);return r>0?rf(t,e+4,e+4+r-1):""},wD=pD,vD=function(t,e){var r=2*li(t,e);return r>0?rf(t,e+4,e+4+r-1):""},CD=vD,SD=function(e,r){var n=li(e,r);return n>0?PS(e,r+4,r+4+n):""},yD=SD,xD=function(t,e){var r=li(t,e);return r>0?rf(t,e+4,e+4+r):""},bD=xD,ED=function(t,e){return KB(t,e)},Q0=ED,RD=function(e){return Array.isArray(e)||typeof Uint8Array!="undefined"&&e instanceof Uint8Array};St&&(mD=function(e,r){if(!Buffer.isBuffer(e))return gD(e,r);var n=e.readUInt32LE(r);return n>0?e.toString("utf8",r+4,r+4+n-1):""},wD=function(e,r){if(!Buffer.isBuffer(e))return pD(e,r);var n=e.readUInt32LE(r);return n>0?e.toString("utf8",r+4,r+4+n-1):""},CD=function(e,r){if(!Buffer.isBuffer(e))return vD(e,r);var n=2*e.readUInt32LE(r);return e.toString("utf16le",r+4,r+4+n-1)},yD=function(e,r){if(!Buffer.isBuffer(e))return SD(e,r);var n=e.readUInt32LE(r);return e.toString("utf16le",r+4,r+4+n)},bD=function(e,r){if(!Buffer.isBuffer(e))return xD(e,r);var n=e.readUInt32LE(r);return e.toString("utf8",r+4,r+4+n)},Q0=function(e,r){return Buffer.isBuffer(e)?e.readDoubleLE(r):ED(e,r)},RD=function(e){return Buffer.isBuffer(e)||Array.isArray(e)||typeof Uint8Array!="undefined"&&e instanceof Uint8Array});var su=function(t,e){return t[e]},To=function(t,e){return t[e+1]*(1<<8)+t[e]},qB=function(t,e){var r=t[e+1]*256+t[e];return r<32768?r:(65535-r+1)*-1},li=function(t,e){return t[e+3]*(1<<24)+(t[e+2]<<16)+(t[e+1]<<8)+t[e]},Ol=function(t,e){return t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]},ZB=function(t,e){return t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]};function nd(t,e){var r="",n,i,s=[],o,a,l,c;switch(e){case"dbcs":if(c=this.l,St&&Buffer.isBuffer(this))r=this.slice(this.l,this.l+2*t).toString("utf16le");else for(l=0;l<t;++l)r+=String.fromCharCode(To(this,c)),c+=2;t*=2;break;case"utf8":r=rf(this,this.l,this.l+t);break;case"utf16le":t*=2,r=PS(this,this.l,this.l+t);break;case"wstr":return nd.call(this,t,"dbcs");case"lpstr-ansi":r=mD(this,this.l),t=4+li(this,this.l);break;case"lpstr-cp":r=wD(this,this.l),t=4+li(this,this.l);break;case"lpwstr":r=CD(this,this.l),t=4+2*li(this,this.l);break;case"lpp4":t=4+li(this,this.l),r=yD(this,this.l),t&2&&(t+=2);break;case"8lpp4":t=4+li(this,this.l),r=bD(this,this.l),t&3&&(t+=4-(t&3));break;case"cstr":for(t=0,r="";(o=su(this,this.l+t++))!==0;)s.push(Wf(o));r=s.join("");break;case"_wstr":for(t=0,r="";(o=To(this,this.l+t))!==0;)s.push(Wf(o)),t+=2;t+=2,r=s.join("");break;case"dbcs-cont":for(r="",c=this.l,l=0;l<t;++l){if(this.lens&&this.lens.indexOf(c)!==-1)return o=su(this,c),this.l=c+1,a=nd.call(this,t-l,o?"dbcs-cont":"sbcs-cont"),s.join("")+a;s.push(Wf(To(this,c))),c+=2}r=s.join(""),t*=2;break;case"cpstr":case"sbcs-cont":for(r="",c=this.l,l=0;l!=t;++l){if(this.lens&&this.lens.indexOf(c)!==-1)return o=su(this,c),this.l=c+1,a=nd.call(this,t-l,o?"dbcs-cont":"sbcs-cont"),s.join("")+a;s.push(Wf(su(this,c))),c+=1}r=s.join("");break;default:switch(t){case 1:return n=su(this,this.l),this.l++,n;case 2:return n=(e==="i"?qB:To)(this,this.l),this.l+=2,n;case 4:case-4:return e==="i"||(this[this.l+3]&128)===0?(n=(t>0?Ol:ZB)(this,this.l),this.l+=4,n):(i=li(this,this.l),this.l+=4,i);case 8:case-8:if(e==="f")return t==8?i=Q0(this,this.l):i=Q0([this[this.l+7],this[this.l+6],this[this.l+5],this[this.l+4],this[this.l+3],this[this.l+2],this[this.l+1],this[this.l+0]],0),this.l+=8,i;t=8;case 16:r=fD(this,this.l,t);break}}return this.l+=t,r}var JB=function(t,e,r){t[r]=e&255,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24&255},QB=function(t,e,r){t[r]=e&255,t[r+1]=e>>8&255,t[r+2]=e>>16&255,t[r+3]=e>>24&255},e3=function(t,e,r){t[r]=e&255,t[r+1]=e>>>8&255};function t3(t,e,r){var n=0,i=0;if(r==="dbcs"){for(i=0;i!=e.length;++i)e3(this,e.charCodeAt(i),this.l+2*i);n=2*e.length}else if(r==="sbcs"){for(e=e.replace(/[^\x00-\x7F]/g,"_"),i=0;i!=e.length;++i)this[this.l+i]=e.charCodeAt(i)&255;n=e.length}else if(r==="hex"){for(;i<t;++i)this[this.l++]=parseInt(e.slice(2*i,2*i+2),16)||0;return this}else if(r==="utf16le"){var s=Math.min(this.l+t,this.length);for(i=0;i<Math.min(e.length,t);++i){var o=e.charCodeAt(i);this[this.l++]=o&255,this[this.l++]=o>>8}for(;this.l<s;)this[this.l++]=0;return this}else switch(t){case 1:n=1,this[this.l]=e&255;break;case 2:n=2,this[this.l]=e&255,e>>>=8,this[this.l+1]=e&255;break;case 3:n=3,this[this.l]=e&255,e>>>=8,this[this.l+1]=e&255,e>>>=8,this[this.l+2]=e&255;break;case 4:n=4,JB(this,e,this.l);break;case 8:if(n=8,r==="f"){XB(this,e,this.l);break}case 16:break;case-4:n=4,QB(this,e,this.l);break}return this.l+=n,this}function TD(t,e){var r=fD(this,this.l,t.length>>1);if(r!==t)throw new Error(e+"Expected "+t+" saw "+r);this.l+=t.length>>1}function Kr(t,e){t.l=e,t.read_shift=nd,t.chk=TD,t.write_shift=t3}function fn(t,e){t.l+=e}function Or(t){var e=Na(t);return Kr(e,0),e}function Wo(t,e,r){if(!!t){var n,i,s;Kr(t,t.l||0);for(var o=t.length,a=0,l=0;t.l<o;){a=t.read_shift(1),a&128&&(a=(a&127)+((t.read_shift(1)&127)<<7));var c=sm[a]||sm[65535];for(n=t.read_shift(1),s=n&127,i=1;i<4&&n&128;++i)s+=((n=t.read_shift(1))&127)<<7*i;l=t.l+s;var u=c.f&&c.f(t,s,r);if(t.l=l,e(u,c,a))return}}}function ZC(){var t=[],e=St?256:2048,r=function(c){var u=Or(c);return Kr(u,0),u},n=r(e),i=function(){!n||(n.length>n.l&&(n=n.slice(0,n.l),n.l=n.length),n.length>0&&t.push(n),n=null)},s=function(c){return n&&c<n.length-n.l?n:(i(),n=r(Math.max(c+1,e)))},o=function(){return i(),ma(t)},a=function(c){i(),n=c,n.l==null&&(n.l=n.length),s(e)};return{next:s,push:a,end:o,_bufs:t}}function id(t,e,r){var n=Xr(t);if(e.s?(n.cRel&&(n.c+=e.s.c),n.rRel&&(n.r+=e.s.r)):(n.cRel&&(n.c+=e.c),n.rRel&&(n.r+=e.r)),!r||r.biff<12){for(;n.c>=256;)n.c-=256;for(;n.r>=65536;)n.r-=65536}return n}function tR(t,e,r){var n=Xr(t);return n.s=id(n.s,e.s,r),n.e=id(n.e,e.s,r),n}function sd(t,e){if(t.cRel&&t.c<0)for(t=Xr(t);t.c<0;)t.c+=e>8?16384:256;if(t.rRel&&t.r<0)for(t=Xr(t);t.r<0;)t.r+=e>8?1048576:e>5?65536:16384;var r=nt(t);return!t.cRel&&t.cRel!=null&&(r=i3(r)),!t.rRel&&t.rRel!=null&&(r=r3(r)),r}function aw(t,e){return t.s.r==0&&!t.s.rRel&&t.e.r==(e.biff>=12?1048575:e.biff>=8?65536:16384)&&!t.e.rRel?(t.s.cRel?"":"$")+Ir(t.s.c)+":"+(t.e.cRel?"":"$")+Ir(t.e.c):t.s.c==0&&!t.s.cRel&&t.e.c==(e.biff>=12?16383:255)&&!t.e.cRel?(t.s.rRel?"":"$")+qr(t.s.r)+":"+(t.e.rRel?"":"$")+qr(t.e.r):sd(t.s,e.biff)+":"+sd(t.e,e.biff)}function DS(t){return parseInt(n3(t),10)-1}function qr(t){return""+(t+1)}function r3(t){return t.replace(/([A-Z]|^)(\d+)$/,"$1$$$2")}function n3(t){return t.replace(/\$(\d+)$/,"$1")}function kS(t){for(var e=s3(t),r=0,n=0;n!==e.length;++n)r=26*r+e.charCodeAt(n)-64;return r-1}function Ir(t){if(t<0)throw new Error("invalid column "+t);var e="";for(++t;t;t=Math.floor((t-1)/26))e=String.fromCharCode((t-1)%26+65)+e;return e}function i3(t){return t.replace(/^([A-Z])/,"$$$1")}function s3(t){return t.replace(/^\$([A-Z])/,"$1")}function o3(t){return t.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(",")}function Pn(t){for(var e=0,r=0,n=0;n<t.length;++n){var i=t.charCodeAt(n);i>=48&&i<=57?e=10*e+(i-48):i>=65&&i<=90&&(r=26*r+(i-64))}return{c:r-1,r:e-1}}function nt(t){for(var e=t.c+1,r="";e;e=(e-1)/26|0)r=String.fromCharCode((e-1)%26+65)+r;return r+(t.r+1)}function Hu(t){var e=t.indexOf(":");return e==-1?{s:Pn(t),e:Pn(t)}:{s:Pn(t.slice(0,e)),e:Pn(t.slice(e+1))}}function bt(t,e){return typeof e=="undefined"||typeof e=="number"?bt(t.s,t.e):(typeof t!="string"&&(t=nt(t)),typeof e!="string"&&(e=nt(e)),t==e?t:t+":"+e)}function mr(t){var e={s:{c:0,r:0},e:{c:0,r:0}},r=0,n=0,i=0,s=t.length;for(r=0;n<s&&!((i=t.charCodeAt(n)-64)<1||i>26);++n)r=26*r+i;for(e.s.c=--r,r=0;n<s&&!((i=t.charCodeAt(n)-48)<0||i>9);++n)r=10*r+i;if(e.s.r=--r,n===s||i!=10)return e.e.c=e.s.c,e.e.r=e.s.r,e;for(++n,r=0;n!=s&&!((i=t.charCodeAt(n)-64)<1||i>26);++n)r=26*r+i;for(e.e.c=--r,r=0;n!=s&&!((i=t.charCodeAt(n)-48)<0||i>9);++n)r=10*r+i;return e.e.r=--r,e}function rR(t,e){var r=t.t=="d"&&e instanceof Date;if(t.z!=null)try{return t.w=Di(t.z,r?kn(e):e)}catch(n){}try{return t.w=Di((t.XF||{}).numFmtId||(r?14:0),r?kn(e):e)}catch(n){return""+e}}function Fo(t,e,r){return t==null||t.t==null||t.t=="z"?"":t.w!==void 0?t.w:(t.t=="d"&&!t.z&&r&&r.dateNF&&(t.z=r.dateNF),t.t=="e"?sc[t.v]||t.v:e==null?rR(t,t.v):rR(t,e))}function Wa(t,e){var r=e&&e.sheet?e.sheet:"Sheet1",n={};return n[r]=t,{SheetNames:[r],Sheets:n}}function _D(t,e,r){var n=r||{},i=t?Array.isArray(t):n.dense,s=t||(i?[]:{}),o=0,a=0;if(s&&n.origin!=null){if(typeof n.origin=="number")o=n.origin;else{var l=typeof n.origin=="string"?Pn(n.origin):n.origin;o=l.r,a=l.c}s["!ref"]||(s["!ref"]="A1:A1")}var c={s:{c:1e7,r:1e7},e:{c:0,r:0}};if(s["!ref"]){var u=mr(s["!ref"]);c.s.c=u.s.c,c.s.r=u.s.r,c.e.c=Math.max(c.e.c,u.e.c),c.e.r=Math.max(c.e.r,u.e.r),o==-1&&(c.e.r=o=u.e.r+1)}for(var h=0;h!=e.length;++h)if(!!e[h]){if(!Array.isArray(e[h]))throw new Error("aoa_to_sheet expects an array of arrays");for(var d=0;d!=e[h].length;++d)if(typeof e[h][d]!="undefined"){var f={v:e[h][d]},g=o+h,m=a+d;if(c.s.r>g&&(c.s.r=g),c.s.c>m&&(c.s.c=m),c.e.r<g&&(c.e.r=g),c.e.c<m&&(c.e.c=m),e[h][d]&&typeof e[h][d]=="object"&&!Array.isArray(e[h][d])&&!(e[h][d]instanceof Date))f=e[h][d];else if(Array.isArray(f.v)&&(f.f=e[h][d][1],f.v=f.v[0]),f.v===null)if(f.f)f.t="n";else if(n.nullError)f.t="e",f.v=0;else if(n.sheetStubs)f.t="z";else continue;else typeof f.v=="number"?f.t="n":typeof f.v=="boolean"?f.t="b":f.v instanceof Date?(f.z=n.dateNF||ot[14],n.cellDates?(f.t="d",f.w=Di(f.z,kn(f.v))):(f.t="n",f.v=kn(f.v),f.w=Di(f.z,f.v))):f.t="s";if(i)s[g]||(s[g]=[]),s[g][m]&&s[g][m].z&&(f.z=s[g][m].z),s[g][m]=f;else{var w=nt({c:m,r:g});s[w]&&s[w].z&&(f.z=s[w].z),s[w]=f}}}return c.s.c<1e7&&(s["!ref"]=bt(c)),s}function Fu(t,e){return _D(null,t,e)}function a3(t){return t.read_shift(4,"i")}function hn(t){var e=t.read_shift(4);return e===0?"":t.read_shift(e,"dbcs")}function l3(t){return{ich:t.read_shift(2),ifnt:t.read_shift(2)}}function NS(t,e){var r=t.l,n=t.read_shift(1),i=hn(t),s=[],o={t:i,h:i};if((n&1)!==0){for(var a=t.read_shift(4),l=0;l!=a;++l)s.push(l3(t));o.r=s}else o.r=[{ich:0,ifnt:0}];return t.l=r+e,o}var c3=NS;function Hi(t){var e=t.read_shift(4),r=t.read_shift(2);return r+=t.read_shift(1)<<16,t.l++,{c:e,iStyleRef:r}}function nc(t){var e=t.read_shift(2);return e+=t.read_shift(1)<<16,t.l++,{c:-1,iStyleRef:e}}var u3=hn;function HS(t){var e=t.read_shift(4);return e===0||e===4294967295?"":t.read_shift(e,"dbcs")}var h3=hn,JC=HS;function FS(t){var e=t.slice(t.l,t.l+4),r=e[0]&1,n=e[0]&2;t.l+=4;var i=n===0?Q0([0,0,0,0,e[0]&252,e[1],e[2],e[3]],0):Ol(e,0)>>2;return r?i/100:i}function AD(t){var e={s:{},e:{}};return e.s.r=t.read_shift(4),e.e.r=t.read_shift(4),e.s.c=t.read_shift(4),e.e.c=t.read_shift(4),e}var ic=AD;function cn(t){if(t.length-t.l<8)throw"XLS Xnum Buffer underflow";return t.read_shift(8,"f")}function d3(t){var e={},r=t.read_shift(1),n=r>>>1,i=t.read_shift(1),s=t.read_shift(2,"i"),o=t.read_shift(1),a=t.read_shift(1),l=t.read_shift(1);switch(t.l++,n){case 0:e.auto=1;break;case 1:e.index=i;var c=Bl[i];c&&(e.rgb=Hd(c));break;case 2:e.rgb=Hd([o,a,l]);break;case 3:e.theme=i;break}return s!=0&&(e.tint=s>0?s/32767:s/32768),e}function f3(t){var e=t.read_shift(1);t.l++;var r={fBold:e&1,fItalic:e&2,fUnderline:e&4,fStrikeout:e&8,fOutline:e&16,fShadow:e&32,fCondense:e&64,fExtend:e&128};return r}function MD(t,e){var r={2:"BITMAP",3:"METAFILEPICT",8:"DIB",14:"ENHMETAFILE"},n=t.read_shift(4);switch(n){case 0:return"";case 4294967295:case 4294967294:return r[t.read_shift(4)]||""}if(n>400)throw new Error("Unsupported Clipboard: "+n.toString(16));return t.l-=4,t.read_shift(0,e==1?"lpstr":"lpwstr")}function g3(t){return MD(t,1)}function m3(t){return MD(t,2)}var LS=2,Kn=3,Uf=11,nR=12,em=19,Gf=64,p3=65,w3=71,v3=4108,C3=4126,$r=80,OD=81,S3=[$r,OD],y3={1:{n:"CodePage",t:LS},2:{n:"Category",t:$r},3:{n:"PresentationFormat",t:$r},4:{n:"ByteCount",t:Kn},5:{n:"LineCount",t:Kn},6:{n:"ParagraphCount",t:Kn},7:{n:"SlideCount",t:Kn},8:{n:"NoteCount",t:Kn},9:{n:"HiddenCount",t:Kn},10:{n:"MultimediaClipCount",t:Kn},11:{n:"ScaleCrop",t:Uf},12:{n:"HeadingPairs",t:v3},13:{n:"TitlesOfParts",t:C3},14:{n:"Manager",t:$r},15:{n:"Company",t:$r},16:{n:"LinksUpToDate",t:Uf},17:{n:"CharacterCount",t:Kn},19:{n:"SharedDoc",t:Uf},22:{n:"HyperlinksChanged",t:Uf},23:{n:"AppVersion",t:Kn,p:"version"},24:{n:"DigSig",t:p3},26:{n:"ContentType",t:$r},27:{n:"ContentStatus",t:$r},28:{n:"Language",t:$r},29:{n:"Version",t:$r},255:{},2147483648:{n:"Locale",t:em},2147483651:{n:"Behavior",t:em},1919054434:{}},x3={1:{n:"CodePage",t:LS},2:{n:"Title",t:$r},3:{n:"Subject",t:$r},4:{n:"Author",t:$r},5:{n:"Keywords",t:$r},6:{n:"Comments",t:$r},7:{n:"Template",t:$r},8:{n:"LastAuthor",t:$r},9:{n:"RevNumber",t:$r},10:{n:"EditTime",t:Gf},11:{n:"LastPrinted",t:Gf},12:{n:"CreatedDate",t:Gf},13:{n:"ModifiedDate",t:Gf},14:{n:"PageCount",t:Kn},15:{n:"WordCount",t:Kn},16:{n:"CharCount",t:Kn},17:{n:"Thumbnail",t:w3},18:{n:"Application",t:$r},19:{n:"DocSecurity",t:Kn},255:{},2147483648:{n:"Locale",t:em},2147483651:{n:"Behavior",t:em},1919054434:{}},iR={1:"US",2:"CA",3:"",7:"RU",20:"EG",30:"GR",31:"NL",32:"BE",33:"FR",34:"ES",36:"HU",39:"IT",41:"CH",43:"AT",44:"GB",45:"DK",46:"SE",47:"NO",48:"PL",49:"DE",52:"MX",55:"BR",61:"AU",64:"NZ",66:"TH",81:"JP",82:"KR",84:"VN",86:"CN",90:"TR",105:"JS",213:"DZ",216:"MA",218:"LY",351:"PT",354:"IS",358:"FI",420:"CZ",886:"TW",961:"LB",962:"JO",963:"SY",964:"IQ",965:"KW",966:"SA",971:"AE",972:"IL",974:"QA",981:"IR",65535:"US"},b3=[null,"solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"];function E3(t){return t.map(function(e){return[e>>16&255,e>>8&255,e&255]})}var R3=E3([0,16777215,16711680,65280,255,16776960,16711935,65535,0,16777215,16711680,65280,255,16776960,16711935,65535,8388608,32768,128,8421376,8388736,32896,12632256,8421504,10066431,10040166,16777164,13434879,6684774,16744576,26316,13421823,128,16711935,16776960,65535,8388736,8388608,32896,255,52479,13434879,13434828,16777113,10079487,16751052,13408767,16764057,3368703,3394764,10079232,16763904,16750848,16737792,6710937,9868950,13158,3381606,13056,3355392,10040064,10040166,3355545,3355443,16777215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Bl=Xr(R3),sc={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA",255:"#WTF?"},ID={"#NULL!":0,"#DIV/0!":7,"#VALUE!":15,"#REF!":23,"#NAME?":29,"#NUM!":36,"#N/A":42,"#GETTING_DATA":43,"#WTF?":255},sR={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":"workbooks","application/vnd.ms-excel.sheet.macroEnabled.main+xml":"workbooks","application/vnd.ms-excel.sheet.binary.macroEnabled.main":"workbooks","application/vnd.ms-excel.addin.macroEnabled.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":"sheets","application/vnd.ms-excel.worksheet":"sheets","application/vnd.ms-excel.binIndexWs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":"charts","application/vnd.ms-excel.chartsheet":"charts","application/vnd.ms-excel.macrosheet+xml":"macros","application/vnd.ms-excel.macrosheet":"macros","application/vnd.ms-excel.intlmacrosheet":"TODO","application/vnd.ms-excel.binIndexMs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":"dialogs","application/vnd.ms-excel.dialogsheet":"dialogs","application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml":"strs","application/vnd.ms-excel.sharedStrings":"strs","application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":"styles","application/vnd.ms-excel.styles":"styles","application/vnd.openxmlformats-package.core-properties+xml":"coreprops","application/vnd.openxmlformats-officedocument.custom-properties+xml":"custprops","application/vnd.openxmlformats-officedocument.extended-properties+xml":"extprops","application/vnd.openxmlformats-officedocument.customXmlProperties+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":"comments","application/vnd.ms-excel.comments":"comments","application/vnd.ms-excel.threadedcomments+xml":"threadedcomments","application/vnd.ms-excel.person+xml":"people","application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml":"metadata","application/vnd.ms-excel.sheetMetadata":"metadata","application/vnd.ms-excel.pivotTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.chart+xml":"TODO","application/vnd.ms-office.chartcolorstyle+xml":"TODO","application/vnd.ms-office.chartstyle+xml":"TODO","application/vnd.ms-office.chartex+xml":"TODO","application/vnd.ms-excel.calcChain":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings":"TODO","application/vnd.ms-office.activeX":"TODO","application/vnd.ms-office.activeX+xml":"TODO","application/vnd.ms-excel.attachedToolbars":"TODO","application/vnd.ms-excel.connections":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":"TODO","application/vnd.ms-excel.externalLink":"links","application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml":"links","application/vnd.ms-excel.pivotCacheDefinition":"TODO","application/vnd.ms-excel.pivotCacheRecords":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml":"TODO","application/vnd.ms-excel.queryTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml":"TODO","application/vnd.ms-excel.userNames":"TODO","application/vnd.ms-excel.revisionHeaders":"TODO","application/vnd.ms-excel.revisionLog":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml":"TODO","application/vnd.ms-excel.tableSingleCells":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml":"TODO","application/vnd.ms-excel.slicer":"TODO","application/vnd.ms-excel.slicerCache":"TODO","application/vnd.ms-excel.slicer+xml":"TODO","application/vnd.ms-excel.slicerCache+xml":"TODO","application/vnd.ms-excel.wsSortMap":"TODO","application/vnd.ms-excel.table":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":"TODO","application/vnd.openxmlformats-officedocument.theme+xml":"themes","application/vnd.openxmlformats-officedocument.themeOverride+xml":"TODO","application/vnd.ms-excel.Timeline+xml":"TODO","application/vnd.ms-excel.TimelineCache+xml":"TODO","application/vnd.ms-office.vbaProject":"vba","application/vnd.ms-office.vbaProjectSignature":"TODO","application/vnd.ms-office.volatileDependencies":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml":"TODO","application/vnd.ms-excel.controlproperties+xml":"TODO","application/vnd.openxmlformats-officedocument.model+data":"TODO","application/vnd.ms-excel.Survey+xml":"TODO","application/vnd.openxmlformats-officedocument.drawing+xml":"drawings","application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml":"TODO","application/vnd.openxmlformats-officedocument.vmlDrawing":"TODO","application/vnd.openxmlformats-package.relationships+xml":"rels","application/vnd.openxmlformats-officedocument.oleObject":"TODO","image/png":"TODO",sheet:"js"};function T3(){return{workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],threadedcomments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],metadata:[],people:[],TODO:[],xmlns:""}}function _3(t){var e=T3();if(!t||!t.match)return e;var r={};if((t.match(gn)||[]).forEach(function(n){var i=Ze(n);switch(i[0].replace(NB,"<")){case"<?xml":break;case"<Types":e.xmlns=i["xmlns"+(i[0].match(/<(\w+):/)||["",""])[1]];break;case"<Default":r[i.Extension]=i.ContentType;break;case"<Override":e[sR[i.ContentType]]!==void 0&&e[sR[i.ContentType]].push(i.PartName);break}}),e.xmlns!==zB.CT)throw new Error("Unknown Namespace: "+e.xmlns);return e.calcchain=e.calcchains.length>0?e.calcchains[0]:"",e.sst=e.strs.length>0?e.strs[0]:"",e.style=e.styles.length>0?e.styles[0]:"",e.defaults=r,delete e.calcchains,e}var hu={WB:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",SHEET:"http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument",HLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",VML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",XPATH:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",XMISS:"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing",XLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",CXML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",CXMLP:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps",CMNT:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",SST:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",STY:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",THEME:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",CHART:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",CHARTEX:"http://schemas.microsoft.com/office/2014/relationships/chartEx",CS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet",WS:["http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"],DS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet",MS:"http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet",IMG:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",DRAW:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",XLMETA:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",TCMNT:"http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",PEOPLE:"http://schemas.microsoft.com/office/2017/10/relationships/person",VBA:"http://schemas.microsoft.com/office/2006/relationships/vbaProject"};function QC(t){var e=t.lastIndexOf("/");return t.slice(0,e+1)+"_rels/"+t.slice(e+1)+".rels"}function od(t,e){var r={"!id":{}};if(!t)return r;e.charAt(0)!=="/"&&(e="/"+e);var n={};return(t.match(gn)||[]).forEach(function(i){var s=Ze(i);if(s[0]==="<Relationship"){var o={};o.Type=s.Type,o.Target=s.Target,o.Id=s.Id,s.TargetMode&&(o.TargetMode=s.TargetMode);var a=s.TargetMode==="External"?s.Target:qh(s.Target,e);r[a]=o,n[s.Id]=o}}),r["!id"]=n,r}var A3="application/vnd.oasis.opendocument.spreadsheet";function M3(t,e){for(var r=IS(t),n,i;n=kd.exec(r);)switch(n[3]){case"manifest":break;case"file-entry":if(i=Ze(n[0],!1),i.path=="/"&&i.type!==A3)throw new Error("This OpenDocument is not a spreadsheet");break;case"encryption-data":case"algorithm":case"start-key-generation":case"key-derivation":throw new Error("Unsupported ODS Encryption");default:if(e&&e.WTF)throw n}}var ad=[["cp:category","Category"],["cp:contentStatus","ContentStatus"],["cp:keywords","Keywords"],["cp:lastModifiedBy","LastAuthor"],["cp:lastPrinted","LastPrinted"],["cp:revision","RevNumber"],["cp:version","Version"],["dc:creator","Author"],["dc:description","Comments"],["dc:identifier","Identifier"],["dc:language","Language"],["dc:subject","Subject"],["dc:title","Title"],["dcterms:created","CreatedDate","date"],["dcterms:modified","ModifiedDate","date"]],O3=function(){for(var t=new Array(ad.length),e=0;e<ad.length;++e){var r=ad[e],n="(?:"+r[0].slice(0,r[0].indexOf(":"))+":)"+r[0].slice(r[0].indexOf(":")+1);t[e]=new RegExp("<"+n+"[^>]*>([\\s\\S]*?)</"+n+">")}return t}();function PD(t){var e={};t=Yt(t);for(var r=0;r<ad.length;++r){var n=ad[r],i=t.match(O3[r]);i!=null&&i.length>0&&(e[n[1]]=_t(i[1])),n[2]==="date"&&e[n[1]]&&(e[n[1]]=Vr(e[n[1]]))}return e}var I3=[["Application","Application","string"],["AppVersion","AppVersion","string"],["Company","Company","string"],["DocSecurity","DocSecurity","string"],["Manager","Manager","string"],["HyperlinksChanged","HyperlinksChanged","bool"],["SharedDoc","SharedDoc","bool"],["LinksUpToDate","LinksUpToDate","bool"],["ScaleCrop","ScaleCrop","bool"],["HeadingPairs","HeadingPairs","raw"],["TitlesOfParts","TitlesOfParts","raw"]];function DD(t,e,r,n){var i=[];if(typeof t=="string")i=XE(t,n);else for(var s=0;s<t.length;++s)i=i.concat(t[s].map(function(u){return{v:u}}));var o=typeof e=="string"?XE(e,n).map(function(u){return u.v}):e,a=0,l=0;if(o.length>0)for(var c=0;c!==i.length;c+=2){switch(l=+i[c+1].v,i[c].v){case"Worksheets":case"\u5DE5\u4F5C\u8868":case"\u041B\u0438\u0441\u0442\u044B":case"\u0623\u0648\u0631\u0627\u0642 \u0627\u0644\u0639\u0645\u0644":case"\u30EF\u30FC\u30AF\u30B7\u30FC\u30C8":case"\u05D2\u05DC\u05D9\u05D5\u05E0\u05D5\u05EA \u05E2\u05D1\u05D5\u05D3\u05D4":case"Arbeitsbl\xE4tter":case"\xC7al\u0131\u015Fma Sayfalar\u0131":case"Feuilles de calcul":case"Fogli di lavoro":case"Folhas de c\xE1lculo":case"Planilhas":case"Regneark":case"Hojas de c\xE1lculo":case"Werkbladen":r.Worksheets=l,r.SheetNames=o.slice(a,a+l);break;case"Named Ranges":case"Rangos con nombre":case"\u540D\u524D\u4ED8\u304D\u4E00\u89A7":case"Benannte Bereiche":case"Navngivne omr\xE5der":r.NamedRanges=l,r.DefinedNames=o.slice(a,a+l);break;case"Charts":case"Diagramme":r.Chartsheets=l,r.ChartNames=o.slice(a,a+l);break}a+=l}}function P3(t,e,r){var n={};return e||(e={}),t=Yt(t),I3.forEach(function(i){var s=(t.match(Dd(i[0]))||[])[1];switch(i[2]){case"string":s&&(e[i[1]]=_t(s));break;case"bool":e[i[1]]=s==="true";break;case"raw":var o=t.match(new RegExp("<"+i[0]+"[^>]*>([\\s\\S]*?)</"+i[0]+">"));o&&o.length>0&&(n[i[1]]=o[1]);break}}),n.HeadingPairs&&n.TitlesOfParts&&DD(n.HeadingPairs,n.TitlesOfParts,e,r),e}var D3=/<[^>]+>[^<]*/g;function k3(t,e){var r={},n="",i=t.match(D3);if(i)for(var s=0;s!=i.length;++s){var o=i[s],a=Ze(o);switch(a[0]){case"<?xml":break;case"<Properties":break;case"<property":n=_t(a.name);break;case"</property>":n=null;break;default:if(o.indexOf("<vt:")===0){var l=o.split(">"),c=l[0].slice(4),u=l[1];switch(c){case"lpstr":case"bstr":case"lpwstr":r[n]=_t(u);break;case"bool":r[n]=er(u);break;case"i1":case"i2":case"i4":case"i8":case"int":case"uint":r[n]=parseInt(u,10);break;case"r4":case"r8":case"decimal":r[n]=parseFloat(u);break;case"filetime":case"date":r[n]=Vr(u);break;case"cy":case"error":r[n]=_t(u);break;default:if(c.slice(-1)=="/")break;e.WTF&&typeof console!="undefined"&&console.warn("Unexpected",o,c,l)}}else if(o.slice(0,2)!=="</"){if(e.WTF)throw new Error(o)}}}return r}var N3={Title:"Title",Subject:"Subject",Author:"Author",Keywords:"Keywords",Comments:"Description",LastAuthor:"LastAuthor",RevNumber:"Revision",Application:"AppName",LastPrinted:"LastPrinted",CreatedDate:"Created",ModifiedDate:"LastSaved",Category:"Category",Manager:"Manager",Company:"Company",AppVersion:"Version",ContentStatus:"ContentStatus",Identifier:"Identifier",Language:"Language"},lw;function H3(t,e,r){lw||(lw=AS(N3)),e=lw[e]||e,t[e]=r}function $S(t){var e=t.read_shift(4),r=t.read_shift(4);return new Date((r/1e7*Math.pow(2,32)+e/1e7-11644473600)*1e3).toISOString().replace(/\.000/,"")}function kD(t,e,r){var n=t.l,i=t.read_shift(0,"lpstr-cp");if(r)for(;t.l-n&3;)++t.l;return i}function ND(t,e,r){var n=t.read_shift(0,"lpwstr");return r&&(t.l+=4-(n.length+1&3)&3),n}function HD(t,e,r){return e===31?ND(t):kD(t,e,r)}function e1(t,e,r){return HD(t,e,r===!1?0:4)}function F3(t,e){if(!e)throw new Error("VtUnalignedString must have positive length");return HD(t,e,0)}function L3(t){for(var e=t.read_shift(4),r=[],n=0;n!=e;++n){var i=t.l;r[n]=t.read_shift(0,"lpwstr").replace(Dn,""),t.l-i&2&&(t.l+=2)}return r}function $3(t){for(var e=t.read_shift(4),r=[],n=0;n!=e;++n)r[n]=t.read_shift(0,"lpstr-cp").replace(Dn,"");return r}function B3(t){var e=t.l,r=tm(t,OD);t[t.l]==0&&t[t.l+1]==0&&t.l-e&2&&(t.l+=2);var n=tm(t,Kn);return[r,n]}function W3(t){for(var e=t.read_shift(4),r=[],n=0;n<e/2;++n)r.push(B3(t));return r}function oR(t,e){for(var r=t.read_shift(4),n={},i=0;i!=r;++i){var s=t.read_shift(4),o=t.read_shift(4);n[s]=t.read_shift(o,e===1200?"utf16le":"utf8").replace(Dn,"").replace(Xh,"!"),e===1200&&o%2&&(t.l+=2)}return t.l&3&&(t.l=t.l>>2+1<<2),n}function FD(t){var e=t.read_shift(4),r=t.slice(t.l,t.l+e);return t.l+=e,(e&3)>0&&(t.l+=4-(e&3)&3),r}function V3(t){var e={};return e.Size=t.read_shift(4),t.l+=e.Size+3-(e.Size-1)%4,e}function tm(t,e,r){var n=t.read_shift(2),i,s=r||{};if(t.l+=2,e!==nR&&n!==e&&S3.indexOf(e)===-1&&!((e&65534)==4126&&(n&65534)==4126))throw new Error("Expected type "+e+" saw "+n);switch(e===nR?n:e){case 2:return i=t.read_shift(2,"i"),s.raw||(t.l+=2),i;case 3:return i=t.read_shift(4,"i"),i;case 11:return t.read_shift(4)!==0;case 19:return i=t.read_shift(4),i;case 30:return kD(t,n,4).replace(Dn,"");case 31:return ND(t);case 64:return $S(t);case 65:return FD(t);case 71:return V3(t);case 80:return e1(t,n,!s.raw).replace(Dn,"");case 81:return F3(t,n).replace(Dn,"");case 4108:return W3(t);case 4126:case 4127:return n==4127?L3(t):$3(t);default:throw new Error("TypedPropertyValue unrecognized type "+e+" "+n)}}function aR(t,e){var r=t.l,n=t.read_shift(4),i=t.read_shift(4),s=[],o=0,a=0,l=-1,c={};for(o=0;o!=i;++o){var u=t.read_shift(4),h=t.read_shift(4);s[o]=[u,h+r]}s.sort(function(S,v){return S[1]-v[1]});var d={};for(o=0;o!=i;++o){if(t.l!==s[o][1]){var f=!0;if(o>0&&e)switch(e[s[o-1][0]].t){case 2:t.l+2===s[o][1]&&(t.l+=2,f=!1);break;case 80:t.l<=s[o][1]&&(t.l=s[o][1],f=!1);break;case 4108:t.l<=s[o][1]&&(t.l=s[o][1],f=!1);break}if((!e||o==0)&&t.l<=s[o][1]&&(f=!1,t.l=s[o][1]),f)throw new Error("Read Error: Expected address "+s[o][1]+" at "+t.l+" :"+o)}if(e){var g=e[s[o][0]];if(d[g.n]=tm(t,g.t,{raw:!0}),g.p==="version"&&(d[g.n]=String(d[g.n]>>16)+"."+("0000"+String(d[g.n]&65535)).slice(-4)),g.n=="CodePage")switch(d[g.n]){case 0:d[g.n]=1252;case 874:case 932:case 936:case 949:case 950:case 1250:case 1251:case 1253:case 1254:case 1255:case 1256:case 1257:case 1258:case 1e4:case 1200:case 1201:case 1252:case 65e3:case-536:case 65001:case-535:as(a=d[g.n]>>>0&65535);break;default:throw new Error("Unsupported CodePage: "+d[g.n])}}else if(s[o][0]===1){if(a=d.CodePage=tm(t,LS),as(a),l!==-1){var m=t.l;t.l=s[l][1],c=oR(t,a),t.l=m}}else if(s[o][0]===0){if(a===0){l=o,t.l=s[o+1][1];continue}c=oR(t,a)}else{var w=c[s[o][0]],C;switch(t[t.l]){case 65:t.l+=4,C=FD(t);break;case 30:t.l+=4,C=e1(t,t[t.l-4]).replace(/\u0000+$/,"");break;case 31:t.l+=4,C=e1(t,t[t.l-4]).replace(/\u0000+$/,"");break;case 3:t.l+=4,C=t.read_shift(4,"i");break;case 19:t.l+=4,C=t.read_shift(4);break;case 5:t.l+=4,C=t.read_shift(8,"f");break;case 11:t.l+=4,C=vr(t,4);break;case 64:t.l+=4,C=Vr($S(t));break;default:throw new Error("unparsed value: "+t[t.l])}d[w]=C}}return t.l=r+n,d}function lR(t,e,r){var n=t.content;if(!n)return{};Kr(n,0);var i,s,o,a,l=0;n.chk("feff","Byte Order: "),n.read_shift(2);var c=n.read_shift(4),u=n.read_shift(16);if(u!==xt.utils.consts.HEADER_CLSID&&u!==r)throw new Error("Bad PropertySet CLSID "+u);if(i=n.read_shift(4),i!==1&&i!==2)throw new Error("Unrecognized #Sets: "+i);if(s=n.read_shift(16),a=n.read_shift(4),i===1&&a!==n.l)throw new Error("Length mismatch: "+a+" !== "+n.l);i===2&&(o=n.read_shift(16),l=n.read_shift(4));var h=aR(n,e),d={SystemIdentifier:c};for(var f in h)d[f]=h[f];if(d.FMTID=s,i===1)return d;if(l-n.l==2&&(n.l+=2),n.l!==l)throw new Error("Length mismatch 2: "+n.l+" !== "+l);var g;try{g=aR(n,null)}catch(m){}for(f in g)d[f]=g[f];return d.FMTID=[s,o],d}function qo(t,e){return t.read_shift(e),null}function U3(t,e,r){for(var n=[],i=t.l+e;t.l<i;)n.push(r(t,i-t.l));if(i!==t.l)throw new Error("Slurp error");return n}function vr(t,e){return t.read_shift(e)===1}function Tr(t){return t.read_shift(2,"u")}function LD(t,e){return U3(t,e,Tr)}function G3(t){var e=t.read_shift(1),r=t.read_shift(1);return r===1?e:e===1}function nf(t,e,r){var n=t.read_shift(r&&r.biff>=12?2:1),i="sbcs-cont";if(r&&r.biff>=8,!r||r.biff==8){var s=t.read_shift(1);s&&(i="dbcs-cont")}else r.biff==12&&(i="wstr");r.biff>=2&&r.biff<=5&&(i="cpstr");var o=n?t.read_shift(n,i):"";return o}function Y3(t){var e=t.read_shift(2),r=t.read_shift(1),n=r&4,i=r&8,s=1+(r&1),o=0,a,l={};i&&(o=t.read_shift(2)),n&&(a=t.read_shift(4));var c=s==2?"dbcs-cont":"sbcs-cont",u=e===0?"":t.read_shift(e,c);return i&&(t.l+=4*o),n&&(t.l+=a),l.t=u,i||(l.raw="<t>"+l.t+"</t>",l.r=l.t),l}function Yl(t,e,r){var n;if(r){if(r.biff>=2&&r.biff<=5)return t.read_shift(e,"cpstr");if(r.biff>=12)return t.read_shift(e,"dbcs-cont")}var i=t.read_shift(1);return i===0?n=t.read_shift(e,"sbcs-cont"):n=t.read_shift(e,"dbcs-cont"),n}function sf(t,e,r){var n=t.read_shift(r&&r.biff==2?1:2);return n===0?(t.l++,""):Yl(t,n,r)}function oc(t,e,r){if(r.biff>5)return sf(t,e,r);var n=t.read_shift(1);return n===0?(t.l++,""):t.read_shift(n,r.biff<=4||!t.lens?"cpstr":"sbcs-cont")}function z3(t){var e=t.read_shift(1);t.l++;var r=t.read_shift(2);return t.l+=2,[e,r]}function j3(t){var e=t.read_shift(4),r=t.l,n=!1;e>24&&(t.l+=e-24,t.read_shift(16)==="795881f43b1d7f48af2c825dc4852763"&&(n=!0),t.l=r);var i=t.read_shift((n?e-24:e)>>1,"utf16le").replace(Dn,"");return n&&(t.l+=24),i}function K3(t){for(var e=t.read_shift(2),r="";e-- >0;)r+="../";var n=t.read_shift(0,"lpstr-ansi");if(t.l+=2,t.read_shift(2)!=57005)throw new Error("Bad FileMoniker");var i=t.read_shift(4);if(i===0)return r+n.replace(/\\/g,"/");var s=t.read_shift(4);if(t.read_shift(2)!=3)throw new Error("Bad FileMoniker");var o=t.read_shift(s>>1,"utf16le").replace(Dn,"");return r+o}function X3(t,e){var r=t.read_shift(16);switch(r){case"e0c9ea79f9bace118c8200aa004ba90b":return j3(t);case"0303000000000000c000000000000046":return K3(t);default:throw new Error("Unsupported Moniker "+r)}}function Yf(t){var e=t.read_shift(4),r=e>0?t.read_shift(e,"utf16le").replace(Dn,""):"";return r}function q3(t,e){var r=t.l+e,n=t.read_shift(4);if(n!==2)throw new Error("Unrecognized streamVersion: "+n);var i=t.read_shift(2);t.l+=2;var s,o,a,l,c="",u,h;i&16&&(s=Yf(t,r-t.l)),i&128&&(o=Yf(t,r-t.l)),(i&257)===257&&(a=Yf(t,r-t.l)),(i&257)===1&&(l=X3(t,r-t.l)),i&8&&(c=Yf(t,r-t.l)),i&32&&(u=t.read_shift(16)),i&64&&(h=$S(t)),t.l=r;var d=o||a||l||"";d&&c&&(d+="#"+c),d||(d="#"+c),i&2&&d.charAt(0)=="/"&&d.charAt(1)!="/"&&(d="file://"+d);var f={Target:d};return u&&(f.guid=u),h&&(f.time=h),s&&(f.Tooltip=s),f}function $D(t){var e=t.read_shift(1),r=t.read_shift(1),n=t.read_shift(1),i=t.read_shift(1);return[e,r,n,i]}function BD(t,e){var r=$D(t);return r[3]=0,r}function Qs(t){var e=t.read_shift(2),r=t.read_shift(2),n=t.read_shift(2);return{r:e,c:r,ixfe:n}}function Z3(t){var e=t.read_shift(2),r=t.read_shift(2);return t.l+=8,{type:e,flags:r}}function J3(t,e,r){return e===0?"":oc(t,e,r)}function Q3(t,e,r){var n=r.biff>8?4:2,i=t.read_shift(n),s=t.read_shift(n,"i"),o=t.read_shift(n,"i");return[i,s,o]}function WD(t){var e=t.read_shift(2),r=FS(t);return[e,r]}function eW(t,e,r){t.l+=4,e-=4;var n=t.l+e,i=nf(t,e,r),s=t.read_shift(2);if(n-=t.l,s!==n)throw new Error("Malformed AddinUdf: padding = "+n+" != "+s);return t.l+=s,i}function rp(t){var e=t.read_shift(2),r=t.read_shift(2),n=t.read_shift(2),i=t.read_shift(2);return{s:{c:n,r:e},e:{c:i,r}}}function VD(t){var e=t.read_shift(2),r=t.read_shift(2),n=t.read_shift(1),i=t.read_shift(1);return{s:{c:n,r:e},e:{c:i,r}}}var tW=VD;function UD(t){t.l+=4;var e=t.read_shift(2),r=t.read_shift(2),n=t.read_shift(2);return t.l+=12,[r,e,n]}function rW(t){var e={};return t.l+=4,t.l+=16,e.fSharedNote=t.read_shift(2),t.l+=4,e}function nW(t){var e={};return t.l+=4,t.cf=t.read_shift(2),e}function Qr(t){t.l+=2,t.l+=t.read_shift(2)}var iW={0:Qr,4:Qr,5:Qr,6:Qr,7:nW,8:Qr,9:Qr,10:Qr,11:Qr,12:Qr,13:rW,14:Qr,15:Qr,16:Qr,17:Qr,18:Qr,19:Qr,20:Qr,21:UD};function sW(t,e){for(var r=t.l+e,n=[];t.l<r;){var i=t.read_shift(2);t.l-=2;try{n.push(iW[i](t,r-t.l))}catch(s){return t.l=r,n}}return t.l!=r&&(t.l=r),n}function zf(t,e){var r={BIFFVer:0,dt:0};switch(r.BIFFVer=t.read_shift(2),e-=2,e>=2&&(r.dt=t.read_shift(2),t.l-=2),r.BIFFVer){case 1536:case 1280:case 1024:case 768:case 512:case 2:case 7:break;default:if(e>6)throw new Error("Unexpected BIFF Ver "+r.BIFFVer)}return t.read_shift(e),r}function oW(t,e){return e===0||t.read_shift(2),1200}function aW(t,e,r){if(r.enc)return t.l+=e,"";var n=t.l,i=oc(t,0,r);return t.read_shift(e+n-t.l),i}function lW(t,e,r){var n=r&&r.biff==8||e==2?t.read_shift(2):(t.l+=e,0);return{fDialog:n&16,fBelow:n&64,fRight:n&128}}function cW(t,e,r){var n=t.read_shift(4),i=t.read_shift(1)&3,s=t.read_shift(1);switch(s){case 0:s="Worksheet";break;case 1:s="Macrosheet";break;case 2:s="Chartsheet";break;case 6:s="VBAModule";break}var o=nf(t,0,r);return o.length===0&&(o="Sheet1"),{pos:n,hs:i,dt:s,name:o}}function uW(t,e){for(var r=t.l+e,n=t.read_shift(4),i=t.read_shift(4),s=[],o=0;o!=i&&t.l<r;++o)s.push(Y3(t));return s.Count=n,s.Unique=i,s}function hW(t,e){var r={};return r.dsst=t.read_shift(2),t.l+=e-2,r}function dW(t){var e={};e.r=t.read_shift(2),e.c=t.read_shift(2),e.cnt=t.read_shift(2)-e.c;var r=t.read_shift(2);t.l+=4;var n=t.read_shift(1);return t.l+=3,n&7&&(e.level=n&7),n&32&&(e.hidden=!0),n&64&&(e.hpt=r/20),e}function fW(t){var e=Z3(t);if(e.type!=2211)throw new Error("Invalid Future Record "+e.type);var r=t.read_shift(4);return r!==0}function gW(t){return t.read_shift(2),t.read_shift(4)}function cR(t,e,r){var n=0;r&&r.biff==2||(n=t.read_shift(2));var i=t.read_shift(2);r&&r.biff==2&&(n=1-(i>>15),i&=32767);var s={Unsynced:n&1,DyZero:(n&2)>>1,ExAsc:(n&4)>>2,ExDsc:(n&8)>>3};return[s,i]}function mW(t){var e=t.read_shift(2),r=t.read_shift(2),n=t.read_shift(2),i=t.read_shift(2),s=t.read_shift(2),o=t.read_shift(2),a=t.read_shift(2),l=t.read_shift(2),c=t.read_shift(2);return{Pos:[e,r],Dim:[n,i],Flags:s,CurTab:o,FirstTab:a,Selected:l,TabRatio:c}}function pW(t,e,r){if(r&&r.biff>=2&&r.biff<5)return{};var n=t.read_shift(2);return{RTL:n&64}}function wW(){}function vW(t,e,r){var n={dyHeight:t.read_shift(2),fl:t.read_shift(2)};switch(r&&r.biff||8){case 2:break;case 3:case 4:t.l+=2;break;default:t.l+=10;break}return n.name=nf(t,0,r),n}function CW(t){var e=Qs(t);return e.isst=t.read_shift(4),e}function SW(t,e,r){r.biffguess&&r.biff==2&&(r.biff=5);var n=t.l+e,i=Qs(t);r.biff==2&&t.l++;var s=sf(t,n-t.l,r);return i.val=s,i}function yW(t,e,r){var n=t.read_shift(2),i=oc(t,0,r);return[n,i]}var xW=oc;function uR(t,e,r){var n=t.l+e,i=r.biff==8||!r.biff?4:2,s=t.read_shift(i),o=t.read_shift(i),a=t.read_shift(2),l=t.read_shift(2);return t.l=n,{s:{r:s,c:a},e:{r:o,c:l}}}function bW(t){var e=t.read_shift(2),r=t.read_shift(2),n=WD(t);return{r:e,c:r,ixfe:n[0],rknum:n[1]}}function EW(t,e){for(var r=t.l+e-2,n=t.read_shift(2),i=t.read_shift(2),s=[];t.l<r;)s.push(WD(t));if(t.l!==r)throw new Error("MulRK read error");var o=t.read_shift(2);if(s.length!=o-i+1)throw new Error("MulRK length mismatch");return{r:n,c:i,C:o,rkrec:s}}function RW(t,e){for(var r=t.l+e-2,n=t.read_shift(2),i=t.read_shift(2),s=[];t.l<r;)s.push(t.read_shift(2));if(t.l!==r)throw new Error("MulBlank read error");var o=t.read_shift(2);if(s.length!=o-i+1)throw new Error("MulBlank length mismatch");return{r:n,c:i,C:o,ixfe:s}}function TW(t,e,r,n){var i={},s=t.read_shift(4),o=t.read_shift(4),a=t.read_shift(4),l=t.read_shift(2);return i.patternType=b3[a>>26],n.cellStyles&&(i.alc=s&7,i.fWrap=s>>3&1,i.alcV=s>>4&7,i.fJustLast=s>>7&1,i.trot=s>>8&255,i.cIndent=s>>16&15,i.fShrinkToFit=s>>20&1,i.iReadOrder=s>>22&2,i.fAtrNum=s>>26&1,i.fAtrFnt=s>>27&1,i.fAtrAlc=s>>28&1,i.fAtrBdr=s>>29&1,i.fAtrPat=s>>30&1,i.fAtrProt=s>>31&1,i.dgLeft=o&15,i.dgRight=o>>4&15,i.dgTop=o>>8&15,i.dgBottom=o>>12&15,i.icvLeft=o>>16&127,i.icvRight=o>>23&127,i.grbitDiag=o>>30&3,i.icvTop=a&127,i.icvBottom=a>>7&127,i.icvDiag=a>>14&127,i.dgDiag=a>>21&15,i.icvFore=l&127,i.icvBack=l>>7&127,i.fsxButton=l>>14&1),i}function _W(t,e,r){var n={};return n.ifnt=t.read_shift(2),n.numFmtId=t.read_shift(2),n.flags=t.read_shift(2),n.fStyle=n.flags>>2&1,e-=6,n.data=TW(t,e,n.fStyle,r),n}function AW(t){t.l+=4;var e=[t.read_shift(2),t.read_shift(2)];if(e[0]!==0&&e[0]--,e[1]!==0&&e[1]--,e[0]>7||e[1]>7)throw new Error("Bad Gutters: "+e.join("|"));return e}function hR(t,e,r){var n=Qs(t);(r.biff==2||e==9)&&++t.l;var i=G3(t);return n.val=i,n.t=i===!0||i===!1?"b":"e",n}function MW(t,e,r){r.biffguess&&r.biff==2&&(r.biff=5);var n=Qs(t),i=cn(t);return n.val=i,n}var dR=J3;function OW(t,e,r){var n=t.l+e,i=t.read_shift(2),s=t.read_shift(2);if(r.sbcch=s,s==1025||s==14849)return[s,i];if(s<1||s>255)throw new Error("Unexpected SupBook type: "+s);for(var o=Yl(t,s),a=[];n>t.l;)a.push(sf(t));return[s,i,o,a]}function fR(t,e,r){var n=t.read_shift(2),i,s={fBuiltIn:n&1,fWantAdvise:n>>>1&1,fWantPict:n>>>2&1,fOle:n>>>3&1,fOleLink:n>>>4&1,cf:n>>>5&1023,fIcon:n>>>15&1};return r.sbcch===14849&&(i=eW(t,e-2,r)),s.body=i||t.read_shift(e-2),typeof i=="string"&&(s.Name=i),s}var IW=["_xlnm.Consolidate_Area","_xlnm.Auto_Open","_xlnm.Auto_Close","_xlnm.Extract","_xlnm.Database","_xlnm.Criteria","_xlnm.Print_Area","_xlnm.Print_Titles","_xlnm.Recorder","_xlnm.Data_Form","_xlnm.Auto_Activate","_xlnm.Auto_Deactivate","_xlnm.Sheet_Title","_xlnm._FilterDatabase"];function gR(t,e,r){var n=t.l+e,i=t.read_shift(2),s=t.read_shift(1),o=t.read_shift(1),a=t.read_shift(r&&r.biff==2?1:2),l=0;(!r||r.biff>=5)&&(r.biff!=5&&(t.l+=2),l=t.read_shift(2),r.biff==5&&(t.l+=2),t.l+=4);var c=Yl(t,o,r);i&32&&(c=IW[c.charCodeAt(0)]);var u=n-t.l;r&&r.biff==2&&--u;var h=n==t.l||a===0||!(u>0)?[]:dU(t,u,r,a);return{chKey:s,Name:c,itab:l,rgce:h}}function GD(t,e,r){if(r.biff<8)return PW(t,e,r);for(var n=[],i=t.l+e,s=t.read_shift(r.biff>8?4:2);s--!==0;)n.push(Q3(t,r.biff>8?12:6,r));if(t.l!=i)throw new Error("Bad ExternSheet: "+t.l+" != "+i);return n}function PW(t,e,r){t[t.l+1]==3&&t[t.l]++;var n=nf(t,e,r);return n.charCodeAt(0)==3?n.slice(1):n}function DW(t,e,r){if(r.biff<8){t.l+=e;return}var n=t.read_shift(2),i=t.read_shift(2),s=Yl(t,n,r),o=Yl(t,i,r);return[s,o]}function kW(t,e,r){var n=VD(t);t.l++;var i=t.read_shift(1);return e-=8,[fU(t,e,r),i,n]}function mR(t,e,r){var n=tW(t);switch(r.biff){case 2:t.l++,e-=7;break;case 3:case 4:t.l+=2,e-=8;break;default:t.l+=6,e-=12}return[n,uU(t,e,r)]}function NW(t){var e=t.read_shift(4)!==0,r=t.read_shift(4)!==0,n=t.read_shift(4);return[e,r,n]}function HW(t,e,r){if(!(r.biff<8)){var n=t.read_shift(2),i=t.read_shift(2),s=t.read_shift(2),o=t.read_shift(2),a=oc(t,0,r);return r.biff<8&&t.read_shift(1),[{r:n,c:i},a,o,s]}}function FW(t,e,r){return HW(t,e,r)}function LW(t,e){for(var r=[],n=t.read_shift(2);n--;)r.push(rp(t));return r}function $W(t,e,r){if(r&&r.biff<8)return WW(t,e,r);var n=UD(t),i=sW(t,e-22,n[1]);return{cmo:n,ft:i}}var BW={8:function(t,e){var r=t.l+e;t.l+=10;var n=t.read_shift(2);t.l+=4,t.l+=2,t.l+=2,t.l+=2,t.l+=4;var i=t.read_shift(1);return t.l+=i,t.l=r,{fmt:n}}};function WW(t,e,r){t.l+=4;var n=t.read_shift(2),i=t.read_shift(2),s=t.read_shift(2);t.l+=2,t.l+=2,t.l+=2,t.l+=2,t.l+=2,t.l+=2,t.l+=2,t.l+=2,t.l+=2,t.l+=6,e-=36;var o=[];return o.push((BW[n]||fn)(t,e,r)),{cmo:[i,n,s],ft:o}}function VW(t,e,r){var n=t.l,i="";try{t.l+=4;var s=(r.lastobj||{cmo:[0,0]}).cmo[1],o;[0,5,7,11,12,14].indexOf(s)==-1?t.l+=6:o=z3(t,6,r);var a=t.read_shift(2);t.read_shift(2),Tr(t,2);var l=t.read_shift(2);t.l+=l;for(var c=1;c<t.lens.length-1;++c){if(t.l-n!=t.lens[c])throw new Error("TxO: bad continue record");var u=t[t.l],h=Yl(t,t.lens[c+1]-t.lens[c]-1);if(i+=h,i.length>=(u?a:2*a))break}if(i.length!==a&&i.length!==a*2)throw new Error("cchText: "+a+" != "+i.length);return t.l=n+e,{t:i}}catch(d){return t.l=n+e,{t:i}}}function UW(t,e){var r=rp(t);t.l+=16;var n=q3(t,e-24);return[r,n]}function GW(t,e){t.read_shift(2);var r=rp(t),n=t.read_shift((e-10)/2,"dbcs-cont");return n=n.replace(Dn,""),[r,n]}function YW(t){var e=[0,0],r;return r=t.read_shift(2),e[0]=iR[r]||r,r=t.read_shift(2),e[1]=iR[r]||r,e}function zW(t){for(var e=t.read_shift(2),r=[];e-- >0;)r.push(BD(t));return r}function jW(t){for(var e=t.read_shift(2),r=[];e-- >0;)r.push(BD(t));return r}function KW(t){t.l+=2;var e={cxfs:0,crc:0};return e.cxfs=t.read_shift(2),e.crc=t.read_shift(4),e}function YD(t,e,r){if(!r.cellStyles)return fn(t,e);var n=r&&r.biff>=12?4:2,i=t.read_shift(n),s=t.read_shift(n),o=t.read_shift(n),a=t.read_shift(n),l=t.read_shift(2);n==2&&(t.l+=2);var c={s:i,e:s,w:o,ixfe:a,flags:l};return(r.biff>=5||!r.biff)&&(c.level=l>>8&7),c}function XW(t,e){var r={};return e<32||(t.l+=16,r.header=cn(t),r.footer=cn(t),t.l+=2),r}function qW(t,e,r){var n={area:!1};if(r.biff!=5)return t.l+=e,n;var i=t.read_shift(1);return t.l+=3,i&16&&(n.area=!0),n}var ZW=Qs,JW=LD,QW=sf;function eV(t){var e=t.read_shift(2),r=t.read_shift(2),n=t.read_shift(4),i={fmt:e,env:r,len:n,data:t.slice(t.l,t.l+n)};return t.l+=n,i}function tV(t,e,r){r.biffguess&&r.biff==5&&(r.biff=2);var n=Qs(t);++t.l;var i=oc(t,e-7,r);return n.t="str",n.val=i,n}function rV(t){var e=Qs(t);++t.l;var r=cn(t);return e.t="n",e.val=r,e}function nV(t){var e=Qs(t);++t.l;var r=t.read_shift(2);return e.t="n",e.val=r,e}function iV(t){var e=t.read_shift(1);return e===0?(t.l++,""):t.read_shift(e,"sbcs-cont")}function sV(t,e){t.l+=6,t.l+=2,t.l+=1,t.l+=3,t.l+=1,t.l+=e-13}function oV(t,e,r){var n=t.l+e,i=Qs(t),s=t.read_shift(2),o=Yl(t,s,r);return t.l=n,i.t="str",i.val=o,i}var aV=[2,3,48,49,131,139,140,245],pR=function(){var t={1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127,8:865,9:437,10:850,11:437,13:437,14:850,15:437,16:850,17:437,18:850,19:932,20:850,21:437,22:850,23:865,24:437,25:437,26:850,27:437,28:863,29:850,31:852,34:852,35:852,36:860,37:850,38:866,55:850,64:852,77:936,78:949,79:950,80:874,87:1252,88:1252,89:1252,108:863,134:737,135:852,136:857,204:1257,255:16969},e=AS({1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127});function r(a,l){var c=[],u=Na(1);switch(l.type){case"base64":u=os(gi(a));break;case"binary":u=os(a);break;case"buffer":case"array":u=a;break}Kr(u,0);var h=u.read_shift(1),d=!!(h&136),f=!1,g=!1;switch(h){case 2:break;case 3:break;case 48:f=!0,d=!0;break;case 49:f=!0,d=!0;break;case 131:break;case 139:break;case 140:g=!0;break;case 245:break;default:throw new Error("DBF Unsupported Version: "+h.toString(16))}var m=0,w=521;h==2&&(m=u.read_shift(2)),u.l+=3,h!=2&&(m=u.read_shift(4)),m>1048576&&(m=1e6),h!=2&&(w=u.read_shift(2));var C=u.read_shift(2),S=l.codepage||1252;h!=2&&(u.l+=16,u.read_shift(1),u[u.l]!==0&&(S=t[u[u.l]]),u.l+=1,u.l+=2),g&&(u.l+=36);for(var v=[],T={},A=Math.min(u.length,h==2?521:w-10-(f?264:0)),M=g?32:11;u.l<A&&u[u.l]!=13;)switch(T={},T.name=ga.utils.decode(S,u.slice(u.l,u.l+M)).replace(/[\u0000\r\n].*$/g,""),u.l+=M,T.type=String.fromCharCode(u.read_shift(1)),h!=2&&!g&&(T.offset=u.read_shift(4)),T.len=u.read_shift(1),h==2&&(T.offset=u.read_shift(2)),T.dec=u.read_shift(1),T.name.length&&v.push(T),h!=2&&(u.l+=g?13:14),T.type){case"B":(!f||T.len!=8)&&l.WTF&&console.log("Skipping "+T.name+":"+T.type);break;case"G":case"P":l.WTF&&console.log("Skipping "+T.name+":"+T.type);break;case"+":case"0":case"@":case"C":case"D":case"F":case"I":case"L":case"M":case"N":case"O":case"T":case"Y":break;default:throw new Error("Unknown Field Type: "+T.type)}if(u[u.l]!==13&&(u.l=w-1),u.read_shift(1)!==13)throw new Error("DBF Terminator not found "+u.l+" "+u[u.l]);u.l=w;var E=0,Y=0;for(c[0]=[],Y=0;Y!=v.length;++Y)c[0][Y]=v[Y].name;for(;m-- >0;){if(u[u.l]===42){u.l+=C;continue}for(++u.l,c[++E]=[],Y=0,Y=0;Y!=v.length;++Y){var D=u.slice(u.l,u.l+v[Y].len);u.l+=v[Y].len,Kr(D,0);var U=ga.utils.decode(S,D);switch(v[Y].type){case"C":U.trim().length&&(c[E][Y]=U.replace(/\s+$/,""));break;case"D":U.length===8?c[E][Y]=new Date(+U.slice(0,4),+U.slice(4,6)-1,+U.slice(6,8)):c[E][Y]=U;break;case"F":c[E][Y]=parseFloat(U.trim());break;case"+":case"I":c[E][Y]=g?D.read_shift(-4,"i")^2147483648:D.read_shift(4,"i");break;case"L":switch(U.trim().toUpperCase()){case"Y":case"T":c[E][Y]=!0;break;case"N":case"F":c[E][Y]=!1;break;case"":case"?":break;default:throw new Error("DBF Unrecognized L:|"+U+"|")}break;case"M":if(!d)throw new Error("DBF Unexpected MEMO for type "+h.toString(16));c[E][Y]="##MEMO##"+(g?parseInt(U.trim(),10):D.read_shift(4));break;case"N":U=U.replace(/\u0000/g,"").trim(),U&&U!="."&&(c[E][Y]=+U||0);break;case"@":c[E][Y]=new Date(D.read_shift(-8,"f")-621356832e5);break;case"T":c[E][Y]=new Date((D.read_shift(4)-2440588)*864e5+D.read_shift(4));break;case"Y":c[E][Y]=D.read_shift(4,"i")/1e4+D.read_shift(4,"i")/1e4*Math.pow(2,32);break;case"O":c[E][Y]=-D.read_shift(-8,"f");break;case"B":if(f&&v[Y].len==8){c[E][Y]=D.read_shift(8,"f");break}case"G":case"P":D.l+=v[Y].len;break;case"0":if(v[Y].name==="_NullFlags")break;default:throw new Error("DBF Unsupported data type "+v[Y].type)}}}if(h!=2&&u.l<u.length&&u[u.l++]!=26)throw new Error("DBF EOF Marker missing "+(u.l-1)+" of "+u.length+" "+u[u.l-1].toString(16));return l&&l.sheetRows&&(c=c.slice(0,l.sheetRows)),l.DBF=v,c}function n(a,l){var c=l||{};c.dateNF||(c.dateNF="yyyymmdd");var u=Fu(r(a,c),c);return u["!cols"]=c.DBF.map(function(h){return{wch:h.len,DBF:h}}),delete c.DBF,u}function i(a,l){try{return Wa(n(a,l),l)}catch(c){if(l&&l.WTF)throw c}return{SheetNames:[],Sheets:{}}}var s={B:8,C:250,L:1,D:8,"?":0,"":0};function o(a,l){var c=l||{};if(+c.codepage>=0&&as(+c.codepage),c.type=="string")throw new Error("Cannot write DBF to JS string");var u=ZC(),h=a1(a,{header:1,raw:!0,cellDates:!0}),d=h[0],f=h.slice(1),g=a["!cols"]||[],m=0,w=0,C=0,S=1;for(m=0;m<d.length;++m){if(((g[m]||{}).DBF||{}).name){d[m]=g[m].DBF.name,++C;continue}if(d[m]!=null){if(++C,typeof d[m]=="number"&&(d[m]=d[m].toString(10)),typeof d[m]!="string")throw new Error("DBF Invalid column name "+d[m]+" |"+typeof d[m]+"|");if(d.indexOf(d[m])!==m){for(w=0;w<1024;++w)if(d.indexOf(d[m]+"_"+w)==-1){d[m]+="_"+w;break}}}}var v=mr(a["!ref"]),T=[],A=[],M=[];for(m=0;m<=v.e.c-v.s.c;++m){var E="",Y="",D=0,U=[];for(w=0;w<f.length;++w)f[w][m]!=null&&U.push(f[w][m]);if(U.length==0||d[m]==null){T[m]="?";continue}for(w=0;w<U.length;++w){switch(typeof U[w]){case"number":Y="B";break;case"string":Y="C";break;case"boolean":Y="L";break;case"object":Y=U[w]instanceof Date?"D":"C";break;default:Y="C"}D=Math.max(D,String(U[w]).length),E=E&&E!=Y?"C":Y}D>250&&(D=250),Y=((g[m]||{}).DBF||{}).type,Y=="C"&&g[m].DBF.len>D&&(D=g[m].DBF.len),E=="B"&&Y=="N"&&(E="N",M[m]=g[m].DBF.dec,D=g[m].DBF.len),A[m]=E=="C"||Y=="N"?D:s[E]||0,S+=A[m],T[m]=E}var X=u.next(32);for(X.write_shift(4,318902576),X.write_shift(4,f.length),X.write_shift(2,296+32*C),X.write_shift(2,S),m=0;m<4;++m)X.write_shift(4,0);for(X.write_shift(4,0|(+e[U2]||3)<<8),m=0,w=0;m<d.length;++m)if(d[m]!=null){var G=u.next(32),ae=(d[m].slice(-10)+"\0\0\0\0\0\0\0\0\0\0\0").slice(0,11);G.write_shift(1,ae,"sbcs"),G.write_shift(1,T[m]=="?"?"C":T[m],"sbcs"),G.write_shift(4,w),G.write_shift(1,A[m]||s[T[m]]||0),G.write_shift(1,M[m]||0),G.write_shift(1,2),G.write_shift(4,0),G.write_shift(1,0),G.write_shift(4,0),G.write_shift(4,0),w+=A[m]||s[T[m]]||0}var ve=u.next(264);for(ve.write_shift(4,13),m=0;m<65;++m)ve.write_shift(4,0);for(m=0;m<f.length;++m){var me=u.next(S);for(me.write_shift(1,0),w=0;w<d.length;++w)if(d[w]!=null)switch(T[w]){case"L":me.write_shift(1,f[m][w]==null?63:f[m][w]?84:70);break;case"B":me.write_shift(8,f[m][w]||0,"f");break;case"N":var Re="0";for(typeof f[m][w]=="number"&&(Re=f[m][w].toFixed(M[w]||0)),C=0;C<A[w]-Re.length;++C)me.write_shift(1,32);me.write_shift(1,Re,"sbcs");break;case"D":f[m][w]?(me.write_shift(4,("0000"+f[m][w].getFullYear()).slice(-4),"sbcs"),me.write_shift(2,("00"+(f[m][w].getMonth()+1)).slice(-2),"sbcs"),me.write_shift(2,("00"+f[m][w].getDate()).slice(-2),"sbcs")):me.write_shift(8,"00000000","sbcs");break;case"C":var Ce=String(f[m][w]!=null?f[m][w]:"").slice(0,A[w]);for(me.write_shift(1,Ce,"sbcs"),C=0;C<A[w]-Ce.length;++C)me.write_shift(1,32);break}}return u.next(1).write_shift(1,26),u.end()}return{to_workbook:i,to_sheet:n,from_sheet:o}}(),lV=function(){var t={AA:"\xC0",BA:"\xC1",CA:"\xC2",DA:195,HA:"\xC4",JA:197,AE:"\xC8",BE:"\xC9",CE:"\xCA",HE:"\xCB",AI:"\xCC",BI:"\xCD",CI:"\xCE",HI:"\xCF",AO:"\xD2",BO:"\xD3",CO:"\xD4",DO:213,HO:"\xD6",AU:"\xD9",BU:"\xDA",CU:"\xDB",HU:"\xDC",Aa:"\xE0",Ba:"\xE1",Ca:"\xE2",Da:227,Ha:"\xE4",Ja:229,Ae:"\xE8",Be:"\xE9",Ce:"\xEA",He:"\xEB",Ai:"\xEC",Bi:"\xED",Ci:"\xEE",Hi:"\xEF",Ao:"\xF2",Bo:"\xF3",Co:"\xF4",Do:245,Ho:"\xF6",Au:"\xF9",Bu:"\xFA",Cu:"\xFB",Hu:"\xFC",KC:"\xC7",Kc:"\xE7",q:"\xE6",z:"\u0153",a:"\xC6",j:"\u0152",DN:209,Dn:241,Hy:255,S:169,c:170,R:174,"B ":180,0:176,1:177,2:178,3:179,5:181,6:182,7:183,Q:185,k:186,b:208,i:216,l:222,s:240,y:248,"!":161,'"':162,"#":163,"(":164,"%":165,"'":167,"H ":168,"+":171,";":187,"<":188,"=":189,">":190,"?":191,"{":223},e=new RegExp("\x1BN("+Xs(t).join("|").replace(/\|\|\|/,"|\\||").replace(/([?()+])/g,"\\$1")+"|\\|)","gm"),r=function(d,f){var g=t[f];return typeof g=="number"?PE(g):g},n=function(d,f,g){var m=f.charCodeAt(0)-32<<4|g.charCodeAt(0)-48;return m==59?d:PE(m)};t["|"]=254;function i(d,f){switch(f.type){case"base64":return s(gi(d),f);case"binary":return s(d,f);case"buffer":return s(St&&Buffer.isBuffer(d)?d.toString("binary"):rc(d),f);case"array":return s(Gl(d),f)}throw new Error("Unrecognized type "+f.type)}function s(d,f){var g=d.split(/[\n\r]+/),m=-1,w=-1,C=0,S=0,v=[],T=[],A=null,M={},E=[],Y=[],D=[],U=0,X;for(+f.codepage>=0&&as(+f.codepage);C!==g.length;++C){U=0;var G=g[C].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g,n).replace(e,r),ae=G.replace(/;;/g,"\0").split(";").map(function(N){return N.replace(/\u0000/g,";")}),ve=ae[0],me;if(G.length>0)switch(ve){case"ID":break;case"E":break;case"B":break;case"O":break;case"W":break;case"P":ae[1].charAt(0)=="P"&&T.push(G.slice(3).replace(/;;/g,";"));break;case"C":var Re=!1,Ce=!1,_e=!1,p=!1,y=-1,b=-1;for(S=1;S<ae.length;++S)switch(ae[S].charAt(0)){case"A":break;case"X":w=parseInt(ae[S].slice(1))-1,Ce=!0;break;case"Y":for(m=parseInt(ae[S].slice(1))-1,Ce||(w=0),X=v.length;X<=m;++X)v[X]=[];break;case"K":me=ae[S].slice(1),me.charAt(0)==='"'?me=me.slice(1,me.length-1):me==="TRUE"?me=!0:me==="FALSE"?me=!1:isNaN(us(me))?isNaN(Mu(me).getDate())||(me=Vr(me)):(me=us(me),A!==null&&Nu(A)&&(me=tp(me))),Re=!0;break;case"E":p=!0;var x=Cu(ae[S].slice(1),{r:m,c:w});v[m][w]=[v[m][w],x];break;case"S":_e=!0,v[m][w]=[v[m][w],"S5S"];break;case"G":break;case"R":y=parseInt(ae[S].slice(1))-1;break;case"C":b=parseInt(ae[S].slice(1))-1;break;default:if(f&&f.WTF)throw new Error("SYLK bad record "+G)}if(Re&&(v[m][w]&&v[m][w].length==2?v[m][w][0]=me:v[m][w]=me,A=null),_e){if(p)throw new Error("SYLK shared formula cannot have own formula");var O=y>-1&&v[y][b];if(!O||!O[1])throw new Error("SYLK shared formula cannot find base");v[m][w][1]=tk(O[1],{r:m-y,c:w-b})}break;case"F":var _=0;for(S=1;S<ae.length;++S)switch(ae[S].charAt(0)){case"X":w=parseInt(ae[S].slice(1))-1,++_;break;case"Y":for(m=parseInt(ae[S].slice(1))-1,X=v.length;X<=m;++X)v[X]=[];break;case"M":U=parseInt(ae[S].slice(1))/20;break;case"F":break;case"G":break;case"P":A=T[parseInt(ae[S].slice(1))];break;case"S":break;case"D":break;case"N":break;case"W":for(D=ae[S].slice(1).split(" "),X=parseInt(D[0],10);X<=parseInt(D[1],10);++X)U=parseInt(D[2],10),Y[X-1]=U===0?{hidden:!0}:{wch:U},Ou(Y[X-1]);break;case"C":w=parseInt(ae[S].slice(1))-1,Y[w]||(Y[w]={});break;case"R":m=parseInt(ae[S].slice(1))-1,E[m]||(E[m]={}),U>0?(E[m].hpt=U,E[m].hpx=Fd(U)):U===0&&(E[m].hidden=!0);break;default:if(f&&f.WTF)throw new Error("SYLK bad record "+G)}_<1&&(A=null);break;default:if(f&&f.WTF)throw new Error("SYLK bad record "+G)}}return E.length>0&&(M["!rows"]=E),Y.length>0&&(M["!cols"]=Y),f&&f.sheetRows&&(v=v.slice(0,f.sheetRows)),[v,M]}function o(d,f){var g=i(d,f),m=g[0],w=g[1],C=Fu(m,f);return Xs(w).forEach(function(S){C[S]=w[S]}),C}function a(d,f){return Wa(o(d,f),f)}function l(d,f,g,m){var w="C;Y"+(g+1)+";X"+(m+1)+";K";switch(d.t){case"n":w+=d.v||0,d.f&&!d.F&&(w+=";E"+K8(d.f,{r:g,c:m}));break;case"b":w+=d.v?"TRUE":"FALSE";break;case"e":w+=d.w||d.v;break;case"d":w+='"'+(d.w||d.v)+'"';break;case"s":w+='"'+d.v.replace(/"/g,"").replace(/;/g,";;")+'"';break}return w}function c(d,f){f.forEach(function(g,m){var w="F;W"+(m+1)+" "+(m+1)+" ";g.hidden?w+="0":(typeof g.width=="number"&&!g.wpx&&(g.wpx=nm(g.width)),typeof g.wpx=="number"&&!g.wch&&(g.wch=im(g.wpx)),typeof g.wch=="number"&&(w+=Math.round(g.wch))),w.charAt(w.length-1)!=" "&&d.push(w)})}function u(d,f){f.forEach(function(g,m){var w="F;";g.hidden?w+="M0;":g.hpt?w+="M"+20*g.hpt+";":g.hpx&&(w+="M"+20*JD(g.hpx)+";"),w.length>2&&d.push(w+"R"+(m+1))})}function h(d,f){var g=["ID;PWXL;N;E"],m=[],w=mr(d["!ref"]),C,S=Array.isArray(d),v=`\r
  14. `;g.push("P;PGeneral"),g.push("F;P0;DG0G8;M255"),d["!cols"]&&c(g,d["!cols"]),d["!rows"]&&u(g,d["!rows"]),g.push("B;Y"+(w.e.r-w.s.r+1)+";X"+(w.e.c-w.s.c+1)+";D"+[w.s.c,w.s.r,w.e.c,w.e.r].join(" "));for(var T=w.s.r;T<=w.e.r;++T)for(var A=w.s.c;A<=w.e.c;++A){var M=nt({r:T,c:A});C=S?(d[T]||[])[A]:d[M],!(!C||C.v==null&&(!C.f||C.F))&&m.push(l(C,d,T,A))}return g.join(v)+v+m.join(v)+v+"E"+v}return{to_workbook:a,to_sheet:o,from_sheet:h}}(),cV=function(){function t(s,o){switch(o.type){case"base64":return e(gi(s),o);case"binary":return e(s,o);case"buffer":return e(St&&Buffer.isBuffer(s)?s.toString("binary"):rc(s),o);case"array":return e(Gl(s),o)}throw new Error("Unrecognized type "+o.type)}function e(s,o){for(var a=s.split(`
  15. `),l=-1,c=-1,u=0,h=[];u!==a.length;++u){if(a[u].trim()==="BOT"){h[++l]=[],c=0;continue}if(!(l<0)){var d=a[u].trim().split(","),f=d[0],g=d[1];++u;for(var m=a[u]||"";(m.match(/["]/g)||[]).length&1&&u<a.length-1;)m+=`
  16. `+a[++u];switch(m=m.trim(),+f){case-1:if(m==="BOT"){h[++l]=[],c=0;continue}else if(m!=="EOD")throw new Error("Unrecognized DIF special command "+m);break;case 0:m==="TRUE"?h[l][c]=!0:m==="FALSE"?h[l][c]=!1:isNaN(us(g))?isNaN(Mu(g).getDate())?h[l][c]=g:h[l][c]=Vr(g):h[l][c]=us(g),++c;break;case 1:m=m.slice(1,m.length-1),m=m.replace(/""/g,'"'),m&&m.match(/^=".*"$/)&&(m=m.slice(2,-1)),h[l][c++]=m!==""?m:null;break}if(m==="EOD")break}}return o&&o.sheetRows&&(h=h.slice(0,o.sheetRows)),h}function r(s,o){return Fu(t(s,o),o)}function n(s,o){return Wa(r(s,o),o)}var i=function(){var s=function(l,c,u,h,d){l.push(c),l.push(u+","+h),l.push('"'+d.replace(/"/g,'""')+'"')},o=function(l,c,u,h){l.push(c+","+u),l.push(c==1?'"'+h.replace(/"/g,'""')+'"':h)};return function(l){var c=[],u=mr(l["!ref"]),h,d=Array.isArray(l);s(c,"TABLE",0,1,"sheetjs"),s(c,"VECTORS",0,u.e.r-u.s.r+1,""),s(c,"TUPLES",0,u.e.c-u.s.c+1,""),s(c,"DATA",0,0,"");for(var f=u.s.r;f<=u.e.r;++f){o(c,-1,0,"BOT");for(var g=u.s.c;g<=u.e.c;++g){var m=nt({r:f,c:g});if(h=d?(l[f]||[])[g]:l[m],!h){o(c,1,0,"");continue}switch(h.t){case"n":var w=h.w;!w&&h.v!=null&&(w=h.v),w==null?h.f&&!h.F?o(c,1,0,"="+h.f):o(c,1,0,""):o(c,0,w,"V");break;case"b":o(c,0,h.v?1:0,h.v?"TRUE":"FALSE");break;case"s":o(c,1,0,isNaN(h.v)?h.v:'="'+h.v+'"');break;case"d":h.w||(h.w=Di(h.z||ot[14],kn(Vr(h.v)))),o(c,0,h.w,"V");break;default:o(c,1,0,"")}}}o(c,-1,0,"EOD");var C=`\r
  17. `,S=c.join(C);return S}}();return{to_workbook:n,to_sheet:r,from_sheet:i}}(),uV=function(){function t(h){return h.replace(/\\b/g,"\\").replace(/\\c/g,":").replace(/\\n/g,`
  18. `)}function e(h){return h.replace(/\\/g,"\\b").replace(/:/g,"\\c").replace(/\n/g,"\\n")}function r(h,d){for(var f=h.split(`
  19. `),g=-1,m=-1,w=0,C=[];w!==f.length;++w){var S=f[w].trim().split(":");if(S[0]==="cell"){var v=Pn(S[1]);if(C.length<=v.r)for(g=C.length;g<=v.r;++g)C[g]||(C[g]=[]);switch(g=v.r,m=v.c,S[2]){case"t":C[g][m]=t(S[3]);break;case"v":C[g][m]=+S[3];break;case"vtf":var T=S[S.length-1];case"vtc":switch(S[3]){case"nl":C[g][m]=!!+S[4];break;default:C[g][m]=+S[4];break}S[2]=="vtf"&&(C[g][m]=[C[g][m],T])}}}return d&&d.sheetRows&&(C=C.slice(0,d.sheetRows)),C}function n(h,d){return Fu(r(h,d),d)}function i(h,d){return Wa(n(h,d),d)}var s=["socialcalc:version:1.5","MIME-Version: 1.0","Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave"].join(`
  20. `),o=["--SocialCalcSpreadsheetControlSave","Content-type: text/plain; charset=UTF-8"].join(`
  21. `)+`
  22. `,a=["# SocialCalc Spreadsheet Control Save","part:sheet"].join(`
  23. `),l="--SocialCalcSpreadsheetControlSave--";function c(h){if(!h||!h["!ref"])return"";for(var d=[],f=[],g,m="",w=Hu(h["!ref"]),C=Array.isArray(h),S=w.s.r;S<=w.e.r;++S)for(var v=w.s.c;v<=w.e.c;++v)if(m=nt({r:S,c:v}),g=C?(h[S]||[])[v]:h[m],!(!g||g.v==null||g.t==="z")){switch(f=["cell",m,"t"],g.t){case"s":case"str":f.push(e(g.v));break;case"n":g.f?(f[2]="vtf",f[3]="n",f[4]=g.v,f[5]=e(g.f)):(f[2]="v",f[3]=g.v);break;case"b":f[2]="vt"+(g.f?"f":"c"),f[3]="nl",f[4]=g.v?"1":"0",f[5]=e(g.f||(g.v?"TRUE":"FALSE"));break;case"d":var T=kn(Vr(g.v));f[2]="vtc",f[3]="nd",f[4]=""+T,f[5]=g.w||Di(g.z||ot[14],T);break;case"e":continue}d.push(f.join(":"))}return d.push("sheet:c:"+(w.e.c-w.s.c+1)+":r:"+(w.e.r-w.s.r+1)+":tvf:1"),d.push("valueformat:1:text-wiki"),d.join(`
  24. `)}function u(h){return[s,o,a,o,c(h),l].join(`
  25. `)}return{to_workbook:i,to_sheet:n,from_sheet:u}}(),Nd=function(){function t(u,h,d,f,g){g.raw?h[d][f]=u:u===""||(u==="TRUE"?h[d][f]=!0:u==="FALSE"?h[d][f]=!1:isNaN(us(u))?isNaN(Mu(u).getDate())?h[d][f]=u:h[d][f]=Vr(u):h[d][f]=us(u))}function e(u,h){var d=h||{},f=[];if(!u||u.length===0)return f;for(var g=u.split(/[\r\n]/),m=g.length-1;m>=0&&g[m].length===0;)--m;for(var w=10,C=0,S=0;S<=m;++S)C=g[S].indexOf(" "),C==-1?C=g[S].length:C++,w=Math.max(w,C);for(S=0;S<=m;++S){f[S]=[];var v=0;for(t(g[S].slice(0,w).trim(),f,S,v,d),v=1;v<=(g[S].length-w)/10+1;++v)t(g[S].slice(w+(v-1)*10,w+v*10).trim(),f,S,v,d)}return d.sheetRows&&(f=f.slice(0,d.sheetRows)),f}var r={44:",",9:" ",59:";",124:"|"},n={44:3,9:2,59:1,124:0};function i(u){for(var h={},d=!1,f=0,g=0;f<u.length;++f)(g=u.charCodeAt(f))==34?d=!d:!d&&g in r&&(h[g]=(h[g]||0)+1);g=[];for(f in h)Object.prototype.hasOwnProperty.call(h,f)&&g.push([h[f],f]);if(!g.length){h=n;for(f in h)Object.prototype.hasOwnProperty.call(h,f)&&g.push([h[f],f])}return g.sort(function(m,w){return m[0]-w[0]||n[m[1]]-n[w[1]]}),r[g.pop()[1]]||44}function s(u,h){var d=h||{},f="",g=d.dense?[]:{},m={s:{c:0,r:0},e:{c:0,r:0}};u.slice(0,4)=="sep="?u.charCodeAt(5)==13&&u.charCodeAt(6)==10?(f=u.charAt(4),u=u.slice(7)):u.charCodeAt(5)==13||u.charCodeAt(5)==10?(f=u.charAt(4),u=u.slice(6)):f=i(u.slice(0,1024)):d&&d.FS?f=d.FS:f=i(u.slice(0,1024));var w=0,C=0,S=0,v=0,T=0,A=f.charCodeAt(0),M=!1,E=0,Y=u.charCodeAt(0);u=u.replace(/\r\n/mg,`
  26. `);var D=d.dateNF!=null?xB(d.dateNF):null;function U(){var X=u.slice(v,T),G={};if(X.charAt(0)=='"'&&X.charAt(X.length-1)=='"'&&(X=X.slice(1,-1).replace(/""/g,'"')),X.length===0)G.t="z";else if(d.raw)G.t="s",G.v=X;else if(X.trim().length===0)G.t="s",G.v=X;else if(X.charCodeAt(0)==61)X.charCodeAt(1)==34&&X.charCodeAt(X.length-1)==34?(G.t="s",G.v=X.slice(2,-1).replace(/""/g,'"')):q8(X)?(G.t="n",G.f=X.slice(1)):(G.t="s",G.v=X);else if(X=="TRUE")G.t="b",G.v=!0;else if(X=="FALSE")G.t="b",G.v=!1;else if(!isNaN(S=us(X)))G.t="n",d.cellText!==!1&&(G.w=X),G.v=S;else if(!isNaN(Mu(X).getDate())||D&&X.match(D)){G.z=d.dateNF||ot[14];var ae=0;D&&X.match(D)&&(X=bB(X,d.dateNF,X.match(D)||[]),ae=1),d.cellDates?(G.t="d",G.v=Vr(X,ae)):(G.t="n",G.v=kn(Vr(X,ae))),d.cellText!==!1&&(G.w=Di(G.z,G.v instanceof Date?kn(G.v):G.v)),d.cellNF||delete G.z}else G.t="s",G.v=X;if(G.t=="z"||(d.dense?(g[w]||(g[w]=[]),g[w][C]=G):g[nt({c:C,r:w})]=G),v=T+1,Y=u.charCodeAt(v),m.e.c<C&&(m.e.c=C),m.e.r<w&&(m.e.r=w),E==A)++C;else if(C=0,++w,d.sheetRows&&d.sheetRows<=w)return!0}e:for(;T<u.length;++T)switch(E=u.charCodeAt(T)){case 34:Y===34&&(M=!M);break;case A:case 10:case 13:if(!M&&U())break e;break}return T-v>0&&U(),g["!ref"]=bt(m),g}function o(u,h){return!(h&&h.PRN)||h.FS||u.slice(0,4)=="sep="||u.indexOf(" ")>=0||u.indexOf(",")>=0||u.indexOf(";")>=0?s(u,h):Fu(e(u,h),h)}function a(u,h){var d="",f=h.type=="string"?[0,0,0,0]:jS(u,h);switch(h.type){case"base64":d=gi(u);break;case"binary":d=u;break;case"buffer":h.codepage==65001?d=u.toString("utf8"):h.codepage&&typeof ga!="undefined"?d=ga.utils.decode(h.codepage,u):d=St&&Buffer.isBuffer(u)?u.toString("binary"):rc(u);break;case"array":d=Gl(u);break;case"string":d=u;break;default:throw new Error("Unrecognized type "+h.type)}return f[0]==239&&f[1]==187&&f[2]==191?d=Yt(d.slice(3)):h.type!="string"&&h.type!="buffer"&&h.codepage==65001?d=Yt(d):h.type=="binary"&&typeof ga!="undefined"&&h.codepage&&(d=ga.utils.decode(h.codepage,ga.utils.encode(28591,d))),d.slice(0,19)=="socialcalc:version:"?uV.to_sheet(h.type=="string"?d:Yt(d),h):o(d,h)}function l(u,h){return Wa(a(u,h),h)}function c(u){for(var h=[],d=mr(u["!ref"]),f,g=Array.isArray(u),m=d.s.r;m<=d.e.r;++m){for(var w=[],C=d.s.c;C<=d.e.c;++C){var S=nt({r:m,c:C});if(f=g?(u[m]||[])[C]:u[S],!f||f.v==null){w.push(" ");continue}for(var v=(f.w||(Fo(f),f.w)||"").slice(0,10);v.length<10;)v+=" ";w.push(v+(C===0?" ":""))}h.push(w.join(""))}return h.join(`
  27. `)}return{to_workbook:l,to_sheet:a,from_sheet:c}}();function hV(t,e){var r=e||{},n=!!r.WTF;r.WTF=!0;try{var i=lV.to_workbook(t,r);return r.WTF=n,i}catch(s){if(r.WTF=n,!s.message.match(/SYLK bad record ID/)&&n)throw s;return Nd.to_workbook(t,e)}}var ld=function(){function t(x,O,_){if(!!x){Kr(x,x.l||0);for(var N=_.Enum||y;x.l<x.length;){var K=x.read_shift(2),le=N[K]||N[65535],ce=x.read_shift(2),te=x.l+ce,ge=le.f&&le.f(x,ce,_);if(x.l=te,O(ge,le,K))return}}}function e(x,O){switch(O.type){case"base64":return r(os(gi(x)),O);case"binary":return r(os(x),O);case"buffer":case"array":return r(x,O)}throw"Unsupported type "+O.type}function r(x,O){if(!x)return x;var _=O||{},N=_.dense?[]:{},K="Sheet1",le="",ce=0,te={},ge=[],Me=[],L={s:{r:0,c:0},e:{r:0,c:0}},Fe=_.sheetRows||0;if(x[2]==0&&(x[3]==8||x[3]==9)&&x.length>=16&&x[14]==5&&x[15]===108)throw new Error("Unsupported Works 3 for Mac file");if(x[2]==2)_.Enum=y,t(x,function(we,Be,Le){switch(Le){case 0:_.vers=we,we>=4096&&(_.qpro=!0);break;case 6:L=we;break;case 204:we&&(le=we);break;case 222:le=we;break;case 15:case 51:_.qpro||(we[1].v=we[1].v.slice(1));case 13:case 14:case 16:Le==14&&(we[2]&112)==112&&(we[2]&15)>1&&(we[2]&15)<15&&(we[1].z=_.dateNF||ot[14],_.cellDates&&(we[1].t="d",we[1].v=tp(we[1].v))),_.qpro&&we[3]>ce&&(N["!ref"]=bt(L),te[K]=N,ge.push(K),N=_.dense?[]:{},L={s:{r:0,c:0},e:{r:0,c:0}},ce=we[3],K=le||"Sheet"+(ce+1),le="");var I=_.dense?(N[we[0].r]||[])[we[0].c]:N[nt(we[0])];if(I){I.t=we[1].t,I.v=we[1].v,we[1].z!=null&&(I.z=we[1].z),we[1].f!=null&&(I.f=we[1].f);break}_.dense?(N[we[0].r]||(N[we[0].r]=[]),N[we[0].r][we[0].c]=we[1]):N[nt(we[0])]=we[1];break}},_);else if(x[2]==26||x[2]==14)_.Enum=b,x[2]==14&&(_.qpro=!0,x.l=0),t(x,function(we,Be,Le){switch(Le){case 204:K=we;break;case 22:we[1].v=we[1].v.slice(1);case 23:case 24:case 25:case 37:case 39:case 40:if(we[3]>ce&&(N["!ref"]=bt(L),te[K]=N,ge.push(K),N=_.dense?[]:{},L={s:{r:0,c:0},e:{r:0,c:0}},ce=we[3],K="Sheet"+(ce+1)),Fe>0&&we[0].r>=Fe)break;_.dense?(N[we[0].r]||(N[we[0].r]=[]),N[we[0].r][we[0].c]=we[1]):N[nt(we[0])]=we[1],L.e.c<we[0].c&&(L.e.c=we[0].c),L.e.r<we[0].r&&(L.e.r=we[0].r);break;case 27:we[14e3]&&(Me[we[14e3][0]]=we[14e3][1]);break;case 1537:Me[we[0]]=we[1],we[0]==ce&&(K=we[1]);break}},_);else throw new Error("Unrecognized LOTUS BOF "+x[2]);if(N["!ref"]=bt(L),te[le||K]=N,ge.push(le||K),!Me.length)return{SheetNames:ge,Sheets:te};for(var ue={},ze=[],Ie=0;Ie<Me.length;++Ie)te[ge[Ie]]?(ze.push(Me[Ie]||ge[Ie]),ue[Me[Ie]]=te[Me[Ie]]||te[ge[Ie]]):(ze.push(Me[Ie]),ue[Me[Ie]]={"!ref":"A1"});return{SheetNames:ze,Sheets:ue}}function n(x,O){var _=O||{};if(+_.codepage>=0&&as(+_.codepage),_.type=="string")throw new Error("Cannot write WK1 to JS string");var N=ZC(),K=mr(x["!ref"]),le=Array.isArray(x),ce=[];Vi(N,0,s(1030)),Vi(N,6,l(K));for(var te=Math.min(K.e.r,8191),ge=K.s.r;ge<=te;++ge)for(var Me=qr(ge),L=K.s.c;L<=K.e.c;++L){ge===K.s.r&&(ce[L]=Ir(L));var Fe=ce[L]+Me,ue=le?(x[ge]||[])[L]:x[Fe];if(!(!ue||ue.t=="z"))if(ue.t=="n")(ue.v|0)==ue.v&&ue.v>=-32768&&ue.v<=32767?Vi(N,13,f(ge,L,ue.v)):Vi(N,14,m(ge,L,ue.v));else{var ze=Fo(ue);Vi(N,15,h(ge,L,ze.slice(0,239)))}}return Vi(N,1),N.end()}function i(x,O){var _=O||{};if(+_.codepage>=0&&as(+_.codepage),_.type=="string")throw new Error("Cannot write WK3 to JS string");var N=ZC();Vi(N,0,o(x));for(var K=0,le=0;K<x.SheetNames.length;++K)(x.Sheets[x.SheetNames[K]]||{})["!ref"]&&Vi(N,27,p(x.SheetNames[K],le++));var ce=0;for(K=0;K<x.SheetNames.length;++K){var te=x.Sheets[x.SheetNames[K]];if(!(!te||!te["!ref"])){for(var ge=mr(te["!ref"]),Me=Array.isArray(te),L=[],Fe=Math.min(ge.e.r,8191),ue=ge.s.r;ue<=Fe;++ue)for(var ze=qr(ue),Ie=ge.s.c;Ie<=ge.e.c;++Ie){ue===ge.s.r&&(L[Ie]=Ir(Ie));var we=L[Ie]+ze,Be=Me?(te[ue]||[])[Ie]:te[we];if(!(!Be||Be.t=="z"))if(Be.t=="n")Vi(N,23,U(ue,Ie,ce,Be.v));else{var Le=Fo(Be);Vi(N,22,E(ue,Ie,ce,Le.slice(0,239)))}}++ce}}return Vi(N,1),N.end()}function s(x){var O=Or(2);return O.write_shift(2,x),O}function o(x){var O=Or(26);O.write_shift(2,4096),O.write_shift(2,4),O.write_shift(4,0);for(var _=0,N=0,K=0,le=0;le<x.SheetNames.length;++le){var ce=x.SheetNames[le],te=x.Sheets[ce];if(!(!te||!te["!ref"])){++K;var ge=Hu(te["!ref"]);_<ge.e.r&&(_=ge.e.r),N<ge.e.c&&(N=ge.e.c)}}return _>8191&&(_=8191),O.write_shift(2,_),O.write_shift(1,K),O.write_shift(1,N),O.write_shift(2,0),O.write_shift(2,0),O.write_shift(1,1),O.write_shift(1,2),O.write_shift(4,0),O.write_shift(4,0),O}function a(x,O,_){var N={s:{c:0,r:0},e:{c:0,r:0}};return O==8&&_.qpro?(N.s.c=x.read_shift(1),x.l++,N.s.r=x.read_shift(2),N.e.c=x.read_shift(1),x.l++,N.e.r=x.read_shift(2),N):(N.s.c=x.read_shift(2),N.s.r=x.read_shift(2),O==12&&_.qpro&&(x.l+=2),N.e.c=x.read_shift(2),N.e.r=x.read_shift(2),O==12&&_.qpro&&(x.l+=2),N.s.c==65535&&(N.s.c=N.e.c=N.s.r=N.e.r=0),N)}function l(x){var O=Or(8);return O.write_shift(2,x.s.c),O.write_shift(2,x.s.r),O.write_shift(2,x.e.c),O.write_shift(2,x.e.r),O}function c(x,O,_){var N=[{c:0,r:0},{t:"n",v:0},0,0];return _.qpro&&_.vers!=20768?(N[0].c=x.read_shift(1),N[3]=x.read_shift(1),N[0].r=x.read_shift(2),x.l+=2):(N[2]=x.read_shift(1),N[0].c=x.read_shift(2),N[0].r=x.read_shift(2)),N}function u(x,O,_){var N=x.l+O,K=c(x,O,_);if(K[1].t="s",_.vers==20768){x.l++;var le=x.read_shift(1);return K[1].v=x.read_shift(le,"utf8"),K}return _.qpro&&x.l++,K[1].v=x.read_shift(N-x.l,"cstr"),K}function h(x,O,_){var N=Or(7+_.length);N.write_shift(1,255),N.write_shift(2,O),N.write_shift(2,x),N.write_shift(1,39);for(var K=0;K<N.length;++K){var le=_.charCodeAt(K);N.write_shift(1,le>=128?95:le)}return N.write_shift(1,0),N}function d(x,O,_){var N=c(x,O,_);return N[1].v=x.read_shift(2,"i"),N}function f(x,O,_){var N=Or(7);return N.write_shift(1,255),N.write_shift(2,O),N.write_shift(2,x),N.write_shift(2,_,"i"),N}function g(x,O,_){var N=c(x,O,_);return N[1].v=x.read_shift(8,"f"),N}function m(x,O,_){var N=Or(13);return N.write_shift(1,255),N.write_shift(2,O),N.write_shift(2,x),N.write_shift(8,_,"f"),N}function w(x,O,_){var N=x.l+O,K=c(x,O,_);if(K[1].v=x.read_shift(8,"f"),_.qpro)x.l=N;else{var le=x.read_shift(2);T(x.slice(x.l,x.l+le),K),x.l+=le}return K}function C(x,O,_){var N=O&32768;return O&=-32769,O=(N?x:0)+(O>=8192?O-16384:O),(N?"":"$")+(_?Ir(O):qr(O))}var S={51:["FALSE",0],52:["TRUE",0],70:["LEN",1],80:["SUM",69],81:["AVERAGEA",69],82:["COUNTA",69],83:["MINA",69],84:["MAXA",69],111:["T",1]},v=["","","","","","","","","","+","-","*","/","^","=","<>","<=",">=","<",">","","","","","&","","","","","","",""];function T(x,O){Kr(x,0);for(var _=[],N=0,K="",le="",ce="",te="";x.l<x.length;){var ge=x[x.l++];switch(ge){case 0:_.push(x.read_shift(8,"f"));break;case 1:le=C(O[0].c,x.read_shift(2),!0),K=C(O[0].r,x.read_shift(2),!1),_.push(le+K);break;case 2:{var Me=C(O[0].c,x.read_shift(2),!0),L=C(O[0].r,x.read_shift(2),!1);le=C(O[0].c,x.read_shift(2),!0),K=C(O[0].r,x.read_shift(2),!1),_.push(Me+L+":"+le+K)}break;case 3:if(x.l<x.length){console.error("WK1 premature formula end");return}break;case 4:_.push("("+_.pop()+")");break;case 5:_.push(x.read_shift(2));break;case 6:{for(var Fe="";ge=x[x.l++];)Fe+=String.fromCharCode(ge);_.push('"'+Fe.replace(/"/g,'""')+'"')}break;case 8:_.push("-"+_.pop());break;case 23:_.push("+"+_.pop());break;case 22:_.push("NOT("+_.pop()+")");break;case 20:case 21:te=_.pop(),ce=_.pop(),_.push(["AND","OR"][ge-20]+"("+ce+","+te+")");break;default:if(ge<32&&v[ge])te=_.pop(),ce=_.pop(),_.push(ce+v[ge]+te);else if(S[ge]){if(N=S[ge][1],N==69&&(N=x[x.l++]),N>_.length){console.error("WK1 bad formula parse 0x"+ge.toString(16)+":|"+_.join("|")+"|");return}var ue=_.slice(-N);_.length-=N,_.push(S[ge][0]+"("+ue.join(",")+")")}else return ge<=7?console.error("WK1 invalid opcode "+ge.toString(16)):ge<=24?console.error("WK1 unsupported op "+ge.toString(16)):ge<=30?console.error("WK1 invalid opcode "+ge.toString(16)):ge<=115?console.error("WK1 unsupported function opcode "+ge.toString(16)):console.error("WK1 unrecognized opcode "+ge.toString(16))}}_.length==1?O[1].f=""+_[0]:console.error("WK1 bad formula parse |"+_.join("|")+"|")}function A(x){var O=[{c:0,r:0},{t:"n",v:0},0];return O[0].r=x.read_shift(2),O[3]=x[x.l++],O[0].c=x[x.l++],O}function M(x,O){var _=A(x);return _[1].t="s",_[1].v=x.read_shift(O-4,"cstr"),_}function E(x,O,_,N){var K=Or(6+N.length);K.write_shift(2,x),K.write_shift(1,_),K.write_shift(1,O),K.write_shift(1,39);for(var le=0;le<N.length;++le){var ce=N.charCodeAt(le);K.write_shift(1,ce>=128?95:ce)}return K.write_shift(1,0),K}function Y(x,O){var _=A(x);_[1].v=x.read_shift(2);var N=_[1].v>>1;if(_[1].v&1)switch(N&7){case 0:N=(N>>3)*5e3;break;case 1:N=(N>>3)*500;break;case 2:N=(N>>3)/20;break;case 3:N=(N>>3)/200;break;case 4:N=(N>>3)/2e3;break;case 5:N=(N>>3)/2e4;break;case 6:N=(N>>3)/16;break;case 7:N=(N>>3)/64;break}return _[1].v=N,_}function D(x,O){var _=A(x),N=x.read_shift(4),K=x.read_shift(4),le=x.read_shift(2);if(le==65535)return N===0&&K===3221225472?(_[1].t="e",_[1].v=15):N===0&&K===3489660928?(_[1].t="e",_[1].v=42):_[1].v=0,_;var ce=le&32768;return le=(le&32767)-16446,_[1].v=(1-ce*2)*(K*Math.pow(2,le+32)+N*Math.pow(2,le)),_}function U(x,O,_,N){var K=Or(14);if(K.write_shift(2,x),K.write_shift(1,_),K.write_shift(1,O),N==0)return K.write_shift(4,0),K.write_shift(4,0),K.write_shift(2,65535),K;var le=0,ce=0,te=0,ge=0;return N<0&&(le=1,N=-N),ce=Math.log2(N)|0,N/=Math.pow(2,ce-31),ge=N>>>0,(ge&2147483648)==0&&(N/=2,++ce,ge=N>>>0),N-=ge,ge|=2147483648,ge>>>=0,N*=Math.pow(2,32),te=N>>>0,K.write_shift(4,te),K.write_shift(4,ge),ce+=16383+(le?32768:0),K.write_shift(2,ce),K}function X(x,O){var _=D(x);return x.l+=O-14,_}function G(x,O){var _=A(x),N=x.read_shift(4);return _[1].v=N>>6,_}function ae(x,O){var _=A(x),N=x.read_shift(8,"f");return _[1].v=N,_}function ve(x,O){var _=ae(x);return x.l+=O-10,_}function me(x,O){return x[x.l+O-1]==0?x.read_shift(O,"cstr"):""}function Re(x,O){var _=x[x.l++];_>O-1&&(_=O-1);for(var N="";N.length<_;)N+=String.fromCharCode(x[x.l++]);return N}function Ce(x,O,_){if(!(!_.qpro||O<21)){var N=x.read_shift(1);x.l+=17,x.l+=1,x.l+=2;var K=x.read_shift(O-21,"cstr");return[N,K]}}function _e(x,O){for(var _={},N=x.l+O;x.l<N;){var K=x.read_shift(2);if(K==14e3){for(_[K]=[0,""],_[K][0]=x.read_shift(2);x[x.l];)_[K][1]+=String.fromCharCode(x[x.l]),x.l++;x.l++}}return _}function p(x,O){var _=Or(5+x.length);_.write_shift(2,14e3),_.write_shift(2,O);for(var N=0;N<x.length;++N){var K=x.charCodeAt(N);_[_.l++]=K>127?95:K}return _[_.l++]=0,_}var y={0:{n:"BOF",f:Tr},1:{n:"EOF"},2:{n:"CALCMODE"},3:{n:"CALCORDER"},4:{n:"SPLIT"},5:{n:"SYNC"},6:{n:"RANGE",f:a},7:{n:"WINDOW1"},8:{n:"COLW1"},9:{n:"WINTWO"},10:{n:"COLW2"},11:{n:"NAME"},12:{n:"BLANK"},13:{n:"INTEGER",f:d},14:{n:"NUMBER",f:g},15:{n:"LABEL",f:u},16:{n:"FORMULA",f:w},24:{n:"TABLE"},25:{n:"ORANGE"},26:{n:"PRANGE"},27:{n:"SRANGE"},28:{n:"FRANGE"},29:{n:"KRANGE1"},32:{n:"HRANGE"},35:{n:"KRANGE2"},36:{n:"PROTEC"},37:{n:"FOOTER"},38:{n:"HEADER"},39:{n:"SETUP"},40:{n:"MARGINS"},41:{n:"LABELFMT"},42:{n:"TITLES"},43:{n:"SHEETJS"},45:{n:"GRAPH"},46:{n:"NGRAPH"},47:{n:"CALCCOUNT"},48:{n:"UNFORMATTED"},49:{n:"CURSORW12"},50:{n:"WINDOW"},51:{n:"STRING",f:u},55:{n:"PASSWORD"},56:{n:"LOCKED"},60:{n:"QUERY"},61:{n:"QUERYNAME"},62:{n:"PRINT"},63:{n:"PRINTNAME"},64:{n:"GRAPH2"},65:{n:"GRAPHNAME"},66:{n:"ZOOM"},67:{n:"SYMSPLIT"},68:{n:"NSROWS"},69:{n:"NSCOLS"},70:{n:"RULER"},71:{n:"NNAME"},72:{n:"ACOMM"},73:{n:"AMACRO"},74:{n:"PARSE"},102:{n:"PRANGES??"},103:{n:"RRANGES??"},104:{n:"FNAME??"},105:{n:"MRANGES??"},204:{n:"SHEETNAMECS",f:me},222:{n:"SHEETNAMELP",f:Re},65535:{n:""}},b={0:{n:"BOF"},1:{n:"EOF"},2:{n:"PASSWORD"},3:{n:"CALCSET"},4:{n:"WINDOWSET"},5:{n:"SHEETCELLPTR"},6:{n:"SHEETLAYOUT"},7:{n:"COLUMNWIDTH"},8:{n:"HIDDENCOLUMN"},9:{n:"USERRANGE"},10:{n:"SYSTEMRANGE"},11:{n:"ZEROFORCE"},12:{n:"SORTKEYDIR"},13:{n:"FILESEAL"},14:{n:"DATAFILLNUMS"},15:{n:"PRINTMAIN"},16:{n:"PRINTSTRING"},17:{n:"GRAPHMAIN"},18:{n:"GRAPHSTRING"},19:{n:"??"},20:{n:"ERRCELL"},21:{n:"NACELL"},22:{n:"LABEL16",f:M},23:{n:"NUMBER17",f:D},24:{n:"NUMBER18",f:Y},25:{n:"FORMULA19",f:X},26:{n:"FORMULA1A"},27:{n:"XFORMAT",f:_e},28:{n:"DTLABELMISC"},29:{n:"DTLABELCELL"},30:{n:"GRAPHWINDOW"},31:{n:"CPA"},32:{n:"LPLAUTO"},33:{n:"QUERY"},34:{n:"HIDDENSHEET"},35:{n:"??"},37:{n:"NUMBER25",f:G},38:{n:"??"},39:{n:"NUMBER27",f:ae},40:{n:"FORMULA28",f:ve},142:{n:"??"},147:{n:"??"},150:{n:"??"},151:{n:"??"},152:{n:"??"},153:{n:"??"},154:{n:"??"},155:{n:"??"},156:{n:"??"},163:{n:"??"},174:{n:"??"},175:{n:"??"},176:{n:"??"},177:{n:"??"},184:{n:"??"},185:{n:"??"},186:{n:"??"},187:{n:"??"},188:{n:"??"},195:{n:"??"},201:{n:"??"},204:{n:"SHEETNAMECS",f:me},205:{n:"??"},206:{n:"??"},207:{n:"??"},208:{n:"??"},256:{n:"??"},259:{n:"??"},260:{n:"??"},261:{n:"??"},262:{n:"??"},263:{n:"??"},265:{n:"??"},266:{n:"??"},267:{n:"??"},268:{n:"??"},270:{n:"??"},271:{n:"??"},384:{n:"??"},389:{n:"??"},390:{n:"??"},393:{n:"??"},396:{n:"??"},512:{n:"??"},514:{n:"??"},513:{n:"??"},516:{n:"??"},517:{n:"??"},640:{n:"??"},641:{n:"??"},642:{n:"??"},643:{n:"??"},644:{n:"??"},645:{n:"??"},646:{n:"??"},647:{n:"??"},648:{n:"??"},658:{n:"??"},659:{n:"??"},660:{n:"??"},661:{n:"??"},662:{n:"??"},665:{n:"??"},666:{n:"??"},768:{n:"??"},772:{n:"??"},1537:{n:"SHEETINFOQP",f:Ce},1600:{n:"??"},1602:{n:"??"},1793:{n:"??"},1794:{n:"??"},1795:{n:"??"},1796:{n:"??"},1920:{n:"??"},2048:{n:"??"},2049:{n:"??"},2052:{n:"??"},2688:{n:"??"},10998:{n:"??"},12849:{n:"??"},28233:{n:"??"},28484:{n:"??"},65535:{n:""}};return{sheet_to_wk1:n,book_to_wk3:i,to_workbook:e}}();function dV(t){var e={},r=t.match(gn),n=0,i=!1;if(r)for(;n!=r.length;++n){var s=Ze(r[n]);switch(s[0].replace(/\w*:/g,"")){case"<condense":break;case"<extend":break;case"<shadow":if(!s.val)break;case"<shadow>":case"<shadow/>":e.shadow=1;break;case"</shadow>":break;case"<charset":if(s.val=="1")break;e.cp=bS[parseInt(s.val,10)];break;case"<outline":if(!s.val)break;case"<outline>":case"<outline/>":e.outline=1;break;case"</outline>":break;case"<rFont":e.name=s.val;break;case"<sz":e.sz=s.val;break;case"<strike":if(!s.val)break;case"<strike>":case"<strike/>":e.strike=1;break;case"</strike>":break;case"<u":if(!s.val)break;switch(s.val){case"double":e.uval="double";break;case"singleAccounting":e.uval="single-accounting";break;case"doubleAccounting":e.uval="double-accounting";break}case"<u>":case"<u/>":e.u=1;break;case"</u>":break;case"<b":if(s.val=="0")break;case"<b>":case"<b/>":e.b=1;break;case"</b>":break;case"<i":if(s.val=="0")break;case"<i>":case"<i/>":e.i=1;break;case"</i>":break;case"<color":s.rgb&&(e.color=s.rgb.slice(2,8));break;case"<color>":case"<color/>":case"</color>":break;case"<family":e.family=s.val;break;case"<family>":case"<family/>":case"</family>":break;case"<vertAlign":e.valign=s.val;break;case"<vertAlign>":case"<vertAlign/>":case"</vertAlign>":break;case"<scheme":break;case"<scheme>":case"<scheme/>":case"</scheme>":break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":i=!0;break;case"</ext>":i=!1;break;default:if(s[0].charCodeAt(1)!==47&&!i)throw new Error("Unrecognized rich format "+s[0])}}return e}var fV=function(){var t=Dd("t"),e=Dd("rPr");function r(s){var o=s.match(t);if(!o)return{t:"s",v:""};var a={t:"s",v:_t(o[1])},l=s.match(e);return l&&(a.s=dV(l[1])),a}var n=/<(?:\w+:)?r>/g,i=/<\/(?:\w+:)?r>/;return function(o){return o.replace(n,"").split(i).map(r).filter(function(a){return a.v})}}(),gV=function(){var e=/(\r\n|\n)/g;function r(i,s,o){var a=[];i.u&&a.push("text-decoration: underline;"),i.uval&&a.push("text-underline-style:"+i.uval+";"),i.sz&&a.push("font-size:"+i.sz+"pt;"),i.outline&&a.push("text-effect: outline;"),i.shadow&&a.push("text-shadow: auto;"),s.push('<span style="'+a.join("")+'">'),i.b&&(s.push("<b>"),o.push("</b>")),i.i&&(s.push("<i>"),o.push("</i>")),i.strike&&(s.push("<s>"),o.push("</s>"));var l=i.valign||"";return l=="superscript"||l=="super"?l="sup":l=="subscript"&&(l="sub"),l!=""&&(s.push("<"+l+">"),o.push("</"+l+">")),o.push("</span>"),i}function n(i){var s=[[],i.v,[]];return i.v?(i.s&&r(i.s,s[0],s[2]),s[0].join("")+s[1].replace(e,"<br/>")+s[2].join("")):""}return function(s){return s.map(n).join("")}}(),mV=/<(?:\w+:)?t[^>]*>([^<]*)<\/(?:\w+:)?t>/g,pV=/<(?:\w+:)?r>/,wV=/<(?:\w+:)?rPh.*?>([\s\S]*?)<\/(?:\w+:)?rPh>/g;function BS(t,e){var r=e?e.cellHTML:!0,n={};return t?(t.match(/^\s*<(?:\w+:)?t[^>]*>/)?(n.t=_t(Yt(t.slice(t.indexOf(">")+1).split(/<\/(?:\w+:)?t>/)[0]||"")),n.r=Yt(t),r&&(n.h=OS(n.t))):t.match(pV)&&(n.r=Yt(t),n.t=_t(Yt((t.replace(wV,"").match(mV)||[]).join("").replace(gn,""))),r&&(n.h=gV(fV(n.r)))),n):{t:""}}var vV=/<(?:\w+:)?sst([^>]*)>([\s\S]*)<\/(?:\w+:)?sst>/,CV=/<(?:\w+:)?(?:si|sstItem)>/g,SV=/<\/(?:\w+:)?(?:si|sstItem)>/;function yV(t,e){var r=[],n="";if(!t)return r;var i=t.match(vV);if(i){n=i[2].replace(CV,"").split(SV);for(var s=0;s!=n.length;++s){var o=BS(n[s].trim(),e);o!=null&&(r[r.length]=o)}i=Ze(i[1]),r.Count=i.count,r.Unique=i.uniqueCount}return r}function xV(t){return[t.read_shift(4),t.read_shift(4)]}function bV(t,e){var r=[],n=!1;return Wo(t,function(s,o,a){switch(a){case 159:r.Count=s[0],r.Unique=s[1];break;case 19:r.push(s);break;case 160:return!0;case 35:n=!0;break;case 36:n=!1;break;default:if(o.T,!n||e.WTF)throw new Error("Unexpected record 0x"+a.toString(16))}}),r}function zD(t){for(var e=[],r=t.split(""),n=0;n<r.length;++n)e[n]=r[n].charCodeAt(0);return e}function No(t,e){var r={};return r.Major=t.read_shift(2),r.Minor=t.read_shift(2),e>=4&&(t.l+=e-4),r}function EV(t){var e={};return e.id=t.read_shift(0,"lpp4"),e.R=No(t,4),e.U=No(t,4),e.W=No(t,4),e}function RV(t){for(var e=t.read_shift(4),r=t.l+e-4,n={},i=t.read_shift(4),s=[];i-- >0;)s.push({t:t.read_shift(4),v:t.read_shift(0,"lpp4")});if(n.name=t.read_shift(0,"lpp4"),n.comps=s,t.l!=r)throw new Error("Bad DataSpaceMapEntry: "+t.l+" != "+r);return n}function TV(t){var e=[];t.l+=4;for(var r=t.read_shift(4);r-- >0;)e.push(RV(t));return e}function _V(t){var e=[];t.l+=4;for(var r=t.read_shift(4);r-- >0;)e.push(t.read_shift(0,"lpp4"));return e}function AV(t){var e={};return t.read_shift(4),t.l+=4,e.id=t.read_shift(0,"lpp4"),e.name=t.read_shift(0,"lpp4"),e.R=No(t,4),e.U=No(t,4),e.W=No(t,4),e}function MV(t){var e=AV(t);if(e.ename=t.read_shift(0,"8lpp4"),e.blksz=t.read_shift(4),e.cmode=t.read_shift(4),t.read_shift(4)!=4)throw new Error("Bad !Primary record");return e}function jD(t,e){var r=t.l+e,n={};n.Flags=t.read_shift(4)&63,t.l+=4,n.AlgID=t.read_shift(4);var i=!1;switch(n.AlgID){case 26126:case 26127:case 26128:i=n.Flags==36;break;case 26625:i=n.Flags==4;break;case 0:i=n.Flags==16||n.Flags==4||n.Flags==36;break;default:throw"Unrecognized encryption algorithm: "+n.AlgID}if(!i)throw new Error("Encryption Flags/AlgID mismatch");return n.AlgIDHash=t.read_shift(4),n.KeySize=t.read_shift(4),n.ProviderType=t.read_shift(4),t.l+=8,n.CSPName=t.read_shift(r-t.l>>1,"utf16le"),t.l=r,n}function KD(t,e){var r={},n=t.l+e;return t.l+=4,r.Salt=t.slice(t.l,t.l+16),t.l+=16,r.Verifier=t.slice(t.l,t.l+16),t.l+=16,t.read_shift(4),r.VerifierHash=t.slice(t.l,n),t.l=n,r}function OV(t){var e=No(t);switch(e.Minor){case 2:return[e.Minor,IV(t)];case 3:return[e.Minor,PV()];case 4:return[e.Minor,DV(t)]}throw new Error("ECMA-376 Encrypted file unrecognized Version: "+e.Minor)}function IV(t){var e=t.read_shift(4);if((e&63)!=36)throw new Error("EncryptionInfo mismatch");var r=t.read_shift(4),n=jD(t,r),i=KD(t,t.length-t.l);return{t:"Std",h:n,v:i}}function PV(){throw new Error("File is password-protected: ECMA-376 Extensible")}function DV(t){var e=["saltSize","blockSize","keyBits","hashSize","cipherAlgorithm","cipherChaining","hashAlgorithm","saltValue"];t.l+=4;var r=t.read_shift(t.length-t.l,"utf8"),n={};return r.replace(gn,function(s){var o=Ze(s);switch(Js(o[0])){case"<?xml":break;case"<encryption":case"</encryption>":break;case"<keyData":e.forEach(function(a){n[a]=o[a]});break;case"<dataIntegrity":n.encryptedHmacKey=o.encryptedHmacKey,n.encryptedHmacValue=o.encryptedHmacValue;break;case"<keyEncryptors>":case"<keyEncryptors":n.encs=[];break;case"</keyEncryptors>":break;case"<keyEncryptor":n.uri=o.uri;break;case"</keyEncryptor>":break;case"<encryptedKey":n.encs.push(o);break;default:throw o[0]}}),n}function kV(t,e){var r={},n=r.EncryptionVersionInfo=No(t,4);if(e-=4,n.Minor!=2)throw new Error("unrecognized minor version code: "+n.Minor);if(n.Major>4||n.Major<2)throw new Error("unrecognized major version code: "+n.Major);r.Flags=t.read_shift(4),e-=4;var i=t.read_shift(4);return e-=4,r.EncryptionHeader=jD(t,i),e-=i,r.EncryptionVerifier=KD(t,e),r}function NV(t){var e={},r=e.EncryptionVersionInfo=No(t,4);if(r.Major!=1||r.Minor!=1)throw"unrecognized version code "+r.Major+" : "+r.Minor;return e.Salt=t.read_shift(16),e.EncryptedVerifier=t.read_shift(16),e.EncryptedVerifierHash=t.read_shift(16),e}function HV(t){var e=0,r,n=zD(t),i=n.length+1,s,o,a,l,c;for(r=Na(i),r[0]=n.length,s=1;s!=i;++s)r[s]=n[s-1];for(s=i-1;s>=0;--s)o=r[s],a=(e&16384)===0?0:1,l=e<<1&32767,c=a|l,e=c^o;return e^52811}var XD=function(){var t=[187,255,255,186,255,255,185,128,0,190,15,0,191,15,0],e=[57840,7439,52380,33984,4364,3600,61902,12606,6258,57657,54287,34041,10252,43370,20163],r=[44796,19929,39858,10053,20106,40212,10761,31585,63170,64933,60267,50935,40399,11199,17763,35526,1453,2906,5812,11624,23248,885,1770,3540,7080,14160,28320,56640,55369,41139,20807,41614,21821,43642,17621,28485,56970,44341,19019,38038,14605,29210,60195,50791,40175,10751,21502,43004,24537,18387,36774,3949,7898,15796,31592,63184,47201,24803,49606,37805,14203,28406,56812,17824,35648,1697,3394,6788,13576,27152,43601,17539,35078,557,1114,2228,4456,30388,60776,51953,34243,7079,14158,28316,14128,28256,56512,43425,17251,34502,7597,13105,26210,52420,35241,883,1766,3532,4129,8258,16516,33032,4657,9314,18628],n=function(o){return(o/2|o*128)&255},i=function(o,a){return n(o^a)},s=function(o){for(var a=e[o.length-1],l=104,c=o.length-1;c>=0;--c)for(var u=o[c],h=0;h!=7;++h)u&64&&(a^=r[l]),u*=2,--l;return a};return function(o){for(var a=zD(o),l=s(a),c=a.length,u=Na(16),h=0;h!=16;++h)u[h]=0;var d,f,g;for((c&1)===1&&(d=l>>8,u[c]=i(t[0],d),--c,d=l&255,f=a[a.length-1],u[c]=i(f,d));c>0;)--c,d=l>>8,u[c]=i(a[c],d),--c,d=l&255,u[c]=i(a[c],d);for(c=15,g=15-a.length;g>0;)d=l>>8,u[c]=i(t[g],d),--c,--g,d=l&255,u[c]=i(a[c],d),--c,--g;return u}}(),FV=function(t,e,r,n,i){i||(i=e),n||(n=XD(t));var s,o;for(s=0;s!=e.length;++s)o=e[s],o^=n[r],o=(o>>5|o<<3)&255,i[s]=o,++r;return[i,r,n]},LV=function(t){var e=0,r=XD(t);return function(n){var i=FV("",n,e,r);return e=i[1],i[0]}};function $V(t,e,r,n){var i={key:Tr(t),verificationBytes:Tr(t)};return r.password&&(i.verifier=HV(r.password)),n.valid=i.verificationBytes===i.verifier,n.valid&&(n.insitu=LV(r.password)),i}function BV(t,e,r){var n=r||{};return n.Info=t.read_shift(2),t.l-=2,n.Info===1?n.Data=NV(t):n.Data=kV(t,e),n}function WV(t,e,r){var n={Type:r.biff>=8?t.read_shift(2):0};return n.Type?BV(t,e-2,n):$V(t,r.biff>=8?e:e-2,r,n),n}var VV=function(){function t(i,s){switch(s.type){case"base64":return e(gi(i),s);case"binary":return e(i,s);case"buffer":return e(St&&Buffer.isBuffer(i)?i.toString("binary"):rc(i),s);case"array":return e(Gl(i),s)}throw new Error("Unrecognized type "+s.type)}function e(i,s){var o=s||{},a=o.dense?[]:{},l=i.match(/\\trowd.*?\\row\b/g);if(!l.length)throw new Error("RTF missing table");var c={s:{c:0,r:0},e:{c:0,r:l.length-1}};return l.forEach(function(u,h){Array.isArray(a)&&(a[h]=[]);for(var d=/\\\w+\b/g,f=0,g,m=-1;g=d.exec(u);){switch(g[0]){case"\\cell":var w=u.slice(f,d.lastIndex-g[0].length);if(w[0]==" "&&(w=w.slice(1)),++m,w.length){var C={v:w,t:"s"};Array.isArray(a)?a[h][m]=C:a[nt({r:h,c:m})]=C}break}f=d.lastIndex}m>c.e.c&&(c.e.c=m)}),a["!ref"]=bt(c),a}function r(i,s){return Wa(t(i,s),s)}function n(i){for(var s=["{\\rtf1\\ansi"],o=mr(i["!ref"]),a,l=Array.isArray(i),c=o.s.r;c<=o.e.r;++c){s.push("\\trowd\\trautofit1");for(var u=o.s.c;u<=o.e.c;++u)s.push("\\cellx"+(u+1));for(s.push("\\pard\\intbl"),u=o.s.c;u<=o.e.c;++u){var h=nt({r:c,c:u});a=l?(i[c]||[])[u]:i[h],!(!a||a.v==null&&(!a.f||a.F))&&(s.push(" "+(a.w||(Fo(a),a.w))),s.push("\\cell"))}s.push("\\pard\\intbl\\row")}return s.join("")+"}"}return{to_workbook:r,to_sheet:t,from_sheet:n}}();function UV(t){var e=t.slice(t[0]==="#"?1:0).slice(0,6);return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}function Hd(t){for(var e=0,r=1;e!=3;++e)r=r*256+(t[e]>255?255:t[e]<0?0:t[e]);return r.toString(16).toUpperCase().slice(1)}function GV(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.max(e,r,n),s=Math.min(e,r,n),o=i-s;if(o===0)return[0,0,e];var a=0,l=0,c=i+s;switch(l=o/(c>1?2-c:c),i){case e:a=((r-n)/o+6)%6;break;case r:a=(n-e)/o+2;break;case n:a=(e-r)/o+4;break}return[a/6,l,c/2]}function YV(t){var e=t[0],r=t[1],n=t[2],i=r*2*(n<.5?n:1-n),s=n-i/2,o=[s,s,s],a=6*e,l;if(r!==0)switch(a|0){case 0:case 6:l=i*a,o[0]+=i,o[1]+=l;break;case 1:l=i*(2-a),o[0]+=l,o[1]+=i;break;case 2:l=i*(a-2),o[1]+=i,o[2]+=l;break;case 3:l=i*(4-a),o[1]+=l,o[2]+=i;break;case 4:l=i*(a-4),o[2]+=i,o[0]+=l;break;case 5:l=i*(6-a),o[2]+=l,o[0]+=i;break}for(var c=0;c!=3;++c)o[c]=Math.round(o[c]*255);return o}function rm(t,e){if(e===0)return t;var r=GV(UV(t));return e<0?r[2]=r[2]*(1+e):r[2]=1-(1-r[2])*(1-e),Hd(YV(r))}var qD=6,zV=15,jV=1,In=qD;function nm(t){return Math.floor((t+Math.round(128/In)/256)*In)}function im(t){return Math.floor((t-5)/In*100+.5)/100}function t1(t){return Math.round((t*In+5)/In*256)/256}function cw(t){return t1(im(nm(t)))}function WS(t){var e=Math.abs(t-cw(t)),r=In;if(e>.005)for(In=jV;In<zV;++In)Math.abs(t-cw(t))<=e&&(e=Math.abs(t-cw(t)),r=In);In=r}function Ou(t){t.width?(t.wpx=nm(t.width),t.wch=im(t.wpx),t.MDW=In):t.wpx?(t.wch=im(t.wpx),t.width=t1(t.wch),t.MDW=In):typeof t.wch=="number"&&(t.width=t1(t.wch),t.wpx=nm(t.width),t.MDW=In),t.customWidth&&delete t.customWidth}var KV=96,ZD=KV;function JD(t){return t*96/ZD}function Fd(t){return t*ZD/96}var XV={None:"none",Solid:"solid",Gray50:"mediumGray",Gray75:"darkGray",Gray25:"lightGray",HorzStripe:"darkHorizontal",VertStripe:"darkVertical",ReverseDiagStripe:"darkDown",DiagStripe:"darkUp",DiagCross:"darkGrid",ThickDiagCross:"darkTrellis",ThinHorzStripe:"lightHorizontal",ThinVertStripe:"lightVertical",ThinReverseDiagStripe:"lightDown",ThinHorzCross:"lightGrid"};function qV(t,e,r,n){e.Borders=[];var i={},s=!1;(t[0].match(gn)||[]).forEach(function(o){var a=Ze(o);switch(Js(a[0])){case"<borders":case"<borders>":case"</borders>":break;case"<border":case"<border>":case"<border/>":i={},a.diagonalUp&&(i.diagonalUp=er(a.diagonalUp)),a.diagonalDown&&(i.diagonalDown=er(a.diagonalDown)),e.Borders.push(i);break;case"</border>":break;case"<left/>":break;case"<left":case"<left>":break;case"</left>":break;case"<right/>":break;case"<right":case"<right>":break;case"</right>":break;case"<top/>":break;case"<top":case"<top>":break;case"</top>":break;case"<bottom/>":break;case"<bottom":case"<bottom>":break;case"</bottom>":break;case"<diagonal":case"<diagonal>":case"<diagonal/>":break;case"</diagonal>":break;case"<horizontal":case"<horizontal>":case"<horizontal/>":break;case"</horizontal>":break;case"<vertical":case"<vertical>":case"<vertical/>":break;case"</vertical>":break;case"<start":case"<start>":case"<start/>":break;case"</start>":break;case"<end":case"<end>":case"<end/>":break;case"</end>":break;case"<color":case"<color>":break;case"<color/>":case"</color>":break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":s=!0;break;case"</ext>":s=!1;break;default:if(n&&n.WTF&&!s)throw new Error("unrecognized "+a[0]+" in borders")}})}function ZV(t,e,r,n){e.Fills=[];var i={},s=!1;(t[0].match(gn)||[]).forEach(function(o){var a=Ze(o);switch(Js(a[0])){case"<fills":case"<fills>":case"</fills>":break;case"<fill>":case"<fill":case"<fill/>":i={},e.Fills.push(i);break;case"</fill>":break;case"<gradientFill>":break;case"<gradientFill":case"</gradientFill>":e.Fills.push(i),i={};break;case"<patternFill":case"<patternFill>":a.patternType&&(i.patternType=a.patternType);break;case"<patternFill/>":case"</patternFill>":break;case"<bgColor":i.bgColor||(i.bgColor={}),a.indexed&&(i.bgColor.indexed=parseInt(a.indexed,10)),a.theme&&(i.bgColor.theme=parseInt(a.theme,10)),a.tint&&(i.bgColor.tint=parseFloat(a.tint)),a.rgb&&(i.bgColor.rgb=a.rgb.slice(-6));break;case"<bgColor/>":case"</bgColor>":break;case"<fgColor":i.fgColor||(i.fgColor={}),a.theme&&(i.fgColor.theme=parseInt(a.theme,10)),a.tint&&(i.fgColor.tint=parseFloat(a.tint)),a.rgb!=null&&(i.fgColor.rgb=a.rgb.slice(-6));break;case"<fgColor/>":case"</fgColor>":break;case"<stop":case"<stop/>":break;case"</stop>":break;case"<color":case"<color/>":break;case"</color>":break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":s=!0;break;case"</ext>":s=!1;break;default:if(n&&n.WTF&&!s)throw new Error("unrecognized "+a[0]+" in fills")}})}function JV(t,e,r,n){e.Fonts=[];var i={},s=!1;(t[0].match(gn)||[]).forEach(function(o){var a=Ze(o);switch(Js(a[0])){case"<fonts":case"<fonts>":case"</fonts>":break;case"<font":case"<font>":break;case"</font>":case"<font/>":e.Fonts.push(i),i={};break;case"<name":a.val&&(i.name=Yt(a.val));break;case"<name/>":case"</name>":break;case"<b":i.bold=a.val?er(a.val):1;break;case"<b/>":i.bold=1;break;case"<i":i.italic=a.val?er(a.val):1;break;case"<i/>":i.italic=1;break;case"<u":switch(a.val){case"none":i.underline=0;break;case"single":i.underline=1;break;case"double":i.underline=2;break;case"singleAccounting":i.underline=33;break;case"doubleAccounting":i.underline=34;break}break;case"<u/>":i.underline=1;break;case"<strike":i.strike=a.val?er(a.val):1;break;case"<strike/>":i.strike=1;break;case"<outline":i.outline=a.val?er(a.val):1;break;case"<outline/>":i.outline=1;break;case"<shadow":i.shadow=a.val?er(a.val):1;break;case"<shadow/>":i.shadow=1;break;case"<condense":i.condense=a.val?er(a.val):1;break;case"<condense/>":i.condense=1;break;case"<extend":i.extend=a.val?er(a.val):1;break;case"<extend/>":i.extend=1;break;case"<sz":a.val&&(i.sz=+a.val);break;case"<sz/>":case"</sz>":break;case"<vertAlign":a.val&&(i.vertAlign=a.val);break;case"<vertAlign/>":case"</vertAlign>":break;case"<family":a.val&&(i.family=parseInt(a.val,10));break;case"<family/>":case"</family>":break;case"<scheme":a.val&&(i.scheme=a.val);break;case"<scheme/>":case"</scheme>":break;case"<charset":if(a.val=="1")break;a.codepage=bS[parseInt(a.val,10)];break;case"<color":if(i.color||(i.color={}),a.auto&&(i.color.auto=er(a.auto)),a.rgb)i.color.rgb=a.rgb.slice(-6);else if(a.indexed){i.color.index=parseInt(a.indexed,10);var l=Bl[i.color.index];i.color.index==81&&(l=Bl[1]),l||(l=Bl[1]),i.color.rgb=l[0].toString(16)+l[1].toString(16)+l[2].toString(16)}else a.theme&&(i.color.theme=parseInt(a.theme,10),a.tint&&(i.color.tint=parseFloat(a.tint)),a.theme&&r.themeElements&&r.themeElements.clrScheme&&(i.color.rgb=rm(r.themeElements.clrScheme[i.color.theme].rgb,i.color.tint||0)));break;case"<color/>":case"</color>":break;case"<AlternateContent":s=!0;break;case"</AlternateContent>":s=!1;break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":s=!0;break;case"</ext>":s=!1;break;default:if(n&&n.WTF&&!s)throw new Error("unrecognized "+a[0]+" in fonts")}})}function QV(t,e,r){e.NumberFmt=[];for(var n=Xs(ot),i=0;i<n.length;++i)e.NumberFmt[n[i]]=ot[n[i]];var s=t[0].match(gn);if(!!s)for(i=0;i<s.length;++i){var o=Ze(s[i]);switch(Js(o[0])){case"<numFmts":case"</numFmts>":case"<numFmts/>":case"<numFmts>":break;case"<numFmt":{var a=_t(Yt(o.formatCode)),l=parseInt(o.numFmtId,10);if(e.NumberFmt[l]=a,l>0){if(l>392){for(l=392;l>60&&e.NumberFmt[l]!=null;--l);e.NumberFmt[l]=a}$l(a,l)}}break;case"</numFmt>":break;default:if(r.WTF)throw new Error("unrecognized "+o[0]+" in numFmts")}}}var jf=["numFmtId","fillId","fontId","borderId","xfId"],Kf=["applyAlignment","applyBorder","applyFill","applyFont","applyNumberFormat","applyProtection","pivotButton","quotePrefix"];function e8(t,e,r){e.CellXf=[];var n,i=!1;(t[0].match(gn)||[]).forEach(function(s){var o=Ze(s),a=0;switch(Js(o[0])){case"<cellXfs":case"<cellXfs>":case"<cellXfs/>":case"</cellXfs>":break;case"<xf":case"<xf/>":for(n=o,delete n[0],a=0;a<jf.length;++a)n[jf[a]]&&(n[jf[a]]=parseInt(n[jf[a]],10));for(a=0;a<Kf.length;++a)n[Kf[a]]&&(n[Kf[a]]=er(n[Kf[a]]));if(e.NumberFmt&&n.numFmtId>392){for(a=392;a>60;--a)if(e.NumberFmt[n.numFmtId]==e.NumberFmt[a]){n.numFmtId=a;break}}e.CellXf.push(n);break;case"</xf>":break;case"<alignment":case"<alignment/>":var l={};o.vertical&&(l.vertical=o.vertical),o.horizontal&&(l.horizontal=o.horizontal),o.textRotation!=null&&(l.textRotation=o.textRotation),o.indent&&(l.indent=o.indent),o.wrapText&&(l.wrapText=er(o.wrapText)),n.alignment=l;break;case"</alignment>":break;case"<protection":break;case"</protection>":case"<protection/>":break;case"<AlternateContent":i=!0;break;case"</AlternateContent>":i=!1;break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":i=!0;break;case"</ext>":i=!1;break;default:if(r&&r.WTF&&!i)throw new Error("unrecognized "+o[0]+" in cellXfs")}})}var t8=function(){var e=/<(?:\w+:)?numFmts([^>]*)>[\S\s]*?<\/(?:\w+:)?numFmts>/,r=/<(?:\w+:)?cellXfs([^>]*)>[\S\s]*?<\/(?:\w+:)?cellXfs>/,n=/<(?:\w+:)?fills([^>]*)>[\S\s]*?<\/(?:\w+:)?fills>/,i=/<(?:\w+:)?fonts([^>]*)>[\S\s]*?<\/(?:\w+:)?fonts>/,s=/<(?:\w+:)?borders([^>]*)>[\S\s]*?<\/(?:\w+:)?borders>/;return function(a,l,c){var u={};if(!a)return u;a=a.replace(/<!--([\s\S]*?)-->/mg,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");var h;return(h=a.match(e))&&QV(h,u,c),(h=a.match(i))&&JV(h,u,l,c),(h=a.match(n))&&ZV(h,u,l,c),(h=a.match(s))&&qV(h,u,l,c),(h=a.match(r))&&e8(h,u,c),u}}();function r8(t,e){var r=t.read_shift(2),n=hn(t);return[r,n]}function n8(t,e,r){var n={};n.sz=t.read_shift(2)/20;var i=f3(t);i.fItalic&&(n.italic=1),i.fCondense&&(n.condense=1),i.fExtend&&(n.extend=1),i.fShadow&&(n.shadow=1),i.fOutline&&(n.outline=1),i.fStrikeout&&(n.strike=1);var s=t.read_shift(2);switch(s===700&&(n.bold=1),t.read_shift(2)){case 1:n.vertAlign="superscript";break;case 2:n.vertAlign="subscript";break}var o=t.read_shift(1);o!=0&&(n.underline=o);var a=t.read_shift(1);a>0&&(n.family=a);var l=t.read_shift(1);switch(l>0&&(n.charset=l),t.l++,n.color=d3(t),t.read_shift(1)){case 1:n.scheme="major";break;case 2:n.scheme="minor";break}return n.name=hn(t),n}var i8=fn;function s8(t,e){var r=t.l+e,n=t.read_shift(2),i=t.read_shift(2);return t.l=r,{ixfe:n,numFmtId:i}}var o8=fn;function a8(t,e,r){var n={};n.NumberFmt=[];for(var i in ot)n.NumberFmt[i]=ot[i];n.CellXf=[],n.Fonts=[];var s=[],o=!1;return Wo(t,function(l,c,u){switch(u){case 44:n.NumberFmt[l[0]]=l[1],$l(l[1],l[0]);break;case 43:n.Fonts.push(l),l.color.theme!=null&&e&&e.themeElements&&e.themeElements.clrScheme&&(l.color.rgb=rm(e.themeElements.clrScheme[l.color.theme].rgb,l.color.tint||0));break;case 1025:break;case 45:break;case 46:break;case 47:s[s.length-1]==617&&n.CellXf.push(l);break;case 48:case 507:case 572:case 475:break;case 1171:case 2102:case 1130:case 512:case 2095:case 3072:break;case 35:o=!0;break;case 36:o=!1;break;case 37:s.push(u),o=!0;break;case 38:s.pop(),o=!1;break;default:if(c.T>0)s.push(u);else if(c.T<0)s.pop();else if(!o||r.WTF&&s[s.length-1]!=37)throw new Error("Unexpected record 0x"+u.toString(16))}}),n}var l8=["</a:lt1>","</a:dk1>","</a:lt2>","</a:dk2>","</a:accent1>","</a:accent2>","</a:accent3>","</a:accent4>","</a:accent5>","</a:accent6>","</a:hlink>","</a:folHlink>"];function c8(t,e,r){e.themeElements.clrScheme=[];var n={};(t[0].match(gn)||[]).forEach(function(i){var s=Ze(i);switch(s[0]){case"<a:clrScheme":case"</a:clrScheme>":break;case"<a:srgbClr":n.rgb=s.val;break;case"<a:sysClr":n.rgb=s.lastClr;break;case"<a:dk1>":case"</a:dk1>":case"<a:lt1>":case"</a:lt1>":case"<a:dk2>":case"</a:dk2>":case"<a:lt2>":case"</a:lt2>":case"<a:accent1>":case"</a:accent1>":case"<a:accent2>":case"</a:accent2>":case"<a:accent3>":case"</a:accent3>":case"<a:accent4>":case"</a:accent4>":case"<a:accent5>":case"</a:accent5>":case"<a:accent6>":case"</a:accent6>":case"<a:hlink>":case"</a:hlink>":case"<a:folHlink>":case"</a:folHlink>":s[0].charAt(1)==="/"?(e.themeElements.clrScheme[l8.indexOf(s[0])]=n,n={}):n.name=s[0].slice(3,s[0].length-1);break;default:if(r&&r.WTF)throw new Error("Unrecognized "+s[0]+" in clrScheme")}})}function u8(){}function h8(){}var d8=/<a:clrScheme([^>]*)>[\s\S]*<\/a:clrScheme>/,f8=/<a:fontScheme([^>]*)>[\s\S]*<\/a:fontScheme>/,g8=/<a:fmtScheme([^>]*)>[\s\S]*<\/a:fmtScheme>/;function m8(t,e,r){e.themeElements={};var n;[["clrScheme",d8,c8],["fontScheme",f8,u8],["fmtScheme",g8,h8]].forEach(function(i){if(!(n=t.match(i[1])))throw new Error(i[0]+" not found in themeElements");i[2](n,e,r)})}var p8=/<a:themeElements([^>]*)>[\s\S]*<\/a:themeElements>/;function QD(t,e){(!t||t.length===0)&&(t=w8());var r,n={};if(!(r=t.match(p8)))throw new Error("themeElements not found in theme");return m8(r[0],n,e),n.raw=t,n}function w8(t,e){if(e&&e.themeXLSX)return e.themeXLSX;if(t&&typeof t.raw=="string")return t.raw;var r=[uD];return r[r.length]='<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">',r[r.length]="<a:themeElements>",r[r.length]='<a:clrScheme name="Office">',r[r.length]='<a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>',r[r.length]='<a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>',r[r.length]='<a:dk2><a:srgbClr val="1F497D"/></a:dk2>',r[r.length]='<a:lt2><a:srgbClr val="EEECE1"/></a:lt2>',r[r.length]='<a:accent1><a:srgbClr val="4F81BD"/></a:accent1>',r[r.length]='<a:accent2><a:srgbClr val="C0504D"/></a:accent2>',r[r.length]='<a:accent3><a:srgbClr val="9BBB59"/></a:accent3>',r[r.length]='<a:accent4><a:srgbClr val="8064A2"/></a:accent4>',r[r.length]='<a:accent5><a:srgbClr val="4BACC6"/></a:accent5>',r[r.length]='<a:accent6><a:srgbClr val="F79646"/></a:accent6>',r[r.length]='<a:hlink><a:srgbClr val="0000FF"/></a:hlink>',r[r.length]='<a:folHlink><a:srgbClr val="800080"/></a:folHlink>',r[r.length]="</a:clrScheme>",r[r.length]='<a:fontScheme name="Office">',r[r.length]="<a:majorFont>",r[r.length]='<a:latin typeface="Cambria"/>',r[r.length]='<a:ea typeface=""/>',r[r.length]='<a:cs typeface=""/>',r[r.length]='<a:font script="Jpan" typeface="\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF"/>',r[r.length]='<a:font script="Hang" typeface="\uB9D1\uC740 \uACE0\uB515"/>',r[r.length]='<a:font script="Hans" typeface="\u5B8B\u4F53"/>',r[r.length]='<a:font script="Hant" typeface="\u65B0\u7D30\u660E\u9AD4"/>',r[r.length]='<a:font script="Arab" typeface="Times New Roman"/>',r[r.length]='<a:font script="Hebr" typeface="Times New Roman"/>',r[r.length]='<a:font script="Thai" typeface="Tahoma"/>',r[r.length]='<a:font script="Ethi" typeface="Nyala"/>',r[r.length]='<a:font script="Beng" typeface="Vrinda"/>',r[r.length]='<a:font script="Gujr" typeface="Shruti"/>',r[r.length]='<a:font script="Khmr" typeface="MoolBoran"/>',r[r.length]='<a:font script="Knda" typeface="Tunga"/>',r[r.length]='<a:font script="Guru" typeface="Raavi"/>',r[r.length]='<a:font script="Cans" typeface="Euphemia"/>',r[r.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',r[r.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',r[r.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',r[r.length]='<a:font script="Thaa" typeface="MV Boli"/>',r[r.length]='<a:font script="Deva" typeface="Mangal"/>',r[r.length]='<a:font script="Telu" typeface="Gautami"/>',r[r.length]='<a:font script="Taml" typeface="Latha"/>',r[r.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',r[r.length]='<a:font script="Orya" typeface="Kalinga"/>',r[r.length]='<a:font script="Mlym" typeface="Kartika"/>',r[r.length]='<a:font script="Laoo" typeface="DokChampa"/>',r[r.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',r[r.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',r[r.length]='<a:font script="Viet" typeface="Times New Roman"/>',r[r.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',r[r.length]='<a:font script="Geor" typeface="Sylfaen"/>',r[r.length]="</a:majorFont>",r[r.length]="<a:minorFont>",r[r.length]='<a:latin typeface="Calibri"/>',r[r.length]='<a:ea typeface=""/>',r[r.length]='<a:cs typeface=""/>',r[r.length]='<a:font script="Jpan" typeface="\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF"/>',r[r.length]='<a:font script="Hang" typeface="\uB9D1\uC740 \uACE0\uB515"/>',r[r.length]='<a:font script="Hans" typeface="\u5B8B\u4F53"/>',r[r.length]='<a:font script="Hant" typeface="\u65B0\u7D30\u660E\u9AD4"/>',r[r.length]='<a:font script="Arab" typeface="Arial"/>',r[r.length]='<a:font script="Hebr" typeface="Arial"/>',r[r.length]='<a:font script="Thai" typeface="Tahoma"/>',r[r.length]='<a:font script="Ethi" typeface="Nyala"/>',r[r.length]='<a:font script="Beng" typeface="Vrinda"/>',r[r.length]='<a:font script="Gujr" typeface="Shruti"/>',r[r.length]='<a:font script="Khmr" typeface="DaunPenh"/>',r[r.length]='<a:font script="Knda" typeface="Tunga"/>',r[r.length]='<a:font script="Guru" typeface="Raavi"/>',r[r.length]='<a:font script="Cans" typeface="Euphemia"/>',r[r.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',r[r.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',r[r.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',r[r.length]='<a:font script="Thaa" typeface="MV Boli"/>',r[r.length]='<a:font script="Deva" typeface="Mangal"/>',r[r.length]='<a:font script="Telu" typeface="Gautami"/>',r[r.length]='<a:font script="Taml" typeface="Latha"/>',r[r.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',r[r.length]='<a:font script="Orya" typeface="Kalinga"/>',r[r.length]='<a:font script="Mlym" typeface="Kartika"/>',r[r.length]='<a:font script="Laoo" typeface="DokChampa"/>',r[r.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',r[r.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',r[r.length]='<a:font script="Viet" typeface="Arial"/>',r[r.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',r[r.length]='<a:font script="Geor" typeface="Sylfaen"/>',r[r.length]="</a:minorFont>",r[r.length]="</a:fontScheme>",r[r.length]='<a:fmtScheme name="Office">',r[r.length]="<a:fillStyleLst>",r[r.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:lin ang="16200000" scaled="1"/>',r[r.length]="</a:gradFill>",r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:lin ang="16200000" scaled="0"/>',r[r.length]="</a:gradFill>",r[r.length]="</a:fillStyleLst>",r[r.length]="<a:lnStyleLst>",r[r.length]='<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]='<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]='<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]="</a:lnStyleLst>",r[r.length]="<a:effectStyleLst>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]="</a:effectStyle>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]="</a:effectStyle>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]='<a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d>',r[r.length]='<a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d>',r[r.length]="</a:effectStyle>",r[r.length]="</a:effectStyleLst>",r[r.length]="<a:bgFillStyleLst>",r[r.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>',r[r.length]="</a:gradFill>",r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>',r[r.length]="</a:gradFill>",r[r.length]="</a:bgFillStyleLst>",r[r.length]="</a:fmtScheme>",r[r.length]="</a:themeElements>",r[r.length]="<a:objectDefaults>",r[r.length]="<a:spDef>",r[r.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="1"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></a:style>',r[r.length]="</a:spDef>",r[r.length]="<a:lnDef>",r[r.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style>',r[r.length]="</a:lnDef>",r[r.length]="</a:objectDefaults>",r[r.length]="<a:extraClrSchemeLst/>",r[r.length]="</a:theme>",r.join("")}function v8(t,e,r){var n=t.l+e,i=t.read_shift(4);if(i!==124226){if(!r.cellStyles){t.l=n;return}var s=t.slice(t.l);t.l=n;var o;try{o=cD(s,{type:"array"})}catch(l){return}var a=hi(o,"theme/theme/theme1.xml",!0);if(!!a)return QD(a,r)}}function C8(t){return t.read_shift(4)}function S8(t){var e={};switch(e.xclrType=t.read_shift(2),e.nTintShade=t.read_shift(2),e.xclrType){case 0:t.l+=4;break;case 1:e.xclrValue=y8(t,4);break;case 2:e.xclrValue=$D(t);break;case 3:e.xclrValue=C8(t);break;case 4:t.l+=4;break}return t.l+=8,e}function y8(t,e){return fn(t,e)}function x8(t,e){return fn(t,e)}function b8(t){var e=t.read_shift(2),r=t.read_shift(2)-4,n=[e];switch(e){case 4:case 5:case 7:case 8:case 9:case 10:case 11:case 13:n[1]=S8(t);break;case 6:n[1]=x8(t,r);break;case 14:case 15:n[1]=t.read_shift(r===1?1:2);break;default:throw new Error("Unrecognized ExtProp type: "+e+" "+r)}return n}function E8(t,e){var r=t.l+e;t.l+=2;var n=t.read_shift(2);t.l+=2;for(var i=t.read_shift(2),s=[];i-- >0;)s.push(b8(t,r-t.l));return{ixfe:n,ext:s}}function R8(t,e){e.forEach(function(r){switch(r[0]){}})}function T8(t,e){return{flags:t.read_shift(4),version:t.read_shift(4),name:hn(t)}}function _8(t){for(var e=[],r=t.read_shift(4);r-- >0;)e.push([t.read_shift(4),t.read_shift(4)]);return e}function A8(t){return t.l+=4,t.read_shift(4)!=0}function M8(t,e,r){var n={Types:[],Cell:[],Value:[]},i=r||{},s=[],o=!1,a=2;return Wo(t,function(l,c,u){switch(u){case 335:n.Types.push({name:l.name});break;case 51:l.forEach(function(h){a==1?n.Cell.push({type:n.Types[h[0]-1].name,index:h[1]}):a==0&&n.Value.push({type:n.Types[h[0]-1].name,index:h[1]})});break;case 337:a=l?1:0;break;case 338:a=2;break;case 35:s.push(u),o=!0;break;case 36:s.pop(),o=!1;break;default:if(!c.T){if(!o||i.WTF&&s[s.length-1]!=35)throw new Error("Unexpected record 0x"+u.toString(16))}}}),n}function O8(t,e,r){var n={Types:[],Cell:[],Value:[]};if(!t)return n;var i=!1,s=2,o;return t.replace(gn,function(a){var l=Ze(a);switch(Js(l[0])){case"<?xml":break;case"<metadata":case"</metadata>":break;case"<metadataTypes":case"</metadataTypes>":break;case"<metadataType":n.Types.push({name:l.name});break;case"</metadataType>":break;case"<futureMetadata":for(var c=0;c<n.Types.length;++c)n.Types[c].name==l.name&&(o=n.Types[c]);break;case"</futureMetadata>":break;case"<bk>":break;case"</bk>":break;case"<rc":s==1?n.Cell.push({type:n.Types[l.t-1].name,index:+l.v}):s==0&&n.Value.push({type:n.Types[l.t-1].name,index:+l.v});break;case"</rc>":break;case"<cellMetadata":s=1;break;case"</cellMetadata>":s=2;break;case"<valueMetadata":s=0;break;case"</valueMetadata>":s=2;break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":i=!0;break;case"</ext>":i=!1;break;case"<rvb":if(!o)break;o.offsets||(o.offsets=[]),o.offsets.push(+l.i);break;default:if(!i&&r.WTF)throw new Error("unrecognized "+l[0]+" in metadata")}return a}),n}function I8(t){var e=[];if(!t)return e;var r=1;return(t.match(gn)||[]).forEach(function(n){var i=Ze(n);switch(i[0]){case"<?xml":break;case"<calcChain":case"<calcChain>":case"</calcChain>":break;case"<c":delete i[0],i.i?r=i.i:i.i=r,e.push(i);break}}),e}function P8(t){var e={};e.i=t.read_shift(4);var r={};r.r=t.read_shift(4),r.c=t.read_shift(4),e.r=nt(r);var n=t.read_shift(1);return n&2&&(e.l="1"),n&8&&(e.a="1"),e}function D8(t,e,r){var n=[];return Wo(t,function(s,o,a){switch(a){case 63:n.push(s);break;default:if(!o.T)throw new Error("Unexpected record 0x"+a.toString(16))}}),n}function k8(t,e,r,n){if(!t)return t;var i=n||{},s=!1;Wo(t,function(a,l,c){switch(c){case 359:case 363:case 364:case 366:case 367:case 368:case 369:case 370:case 371:case 472:case 577:case 578:case 579:case 580:case 581:case 582:case 583:case 584:case 585:case 586:case 587:break;case 35:s=!0;break;case 36:s=!1;break;default:if(!l.T){if(!s||i.WTF)throw new Error("Unexpected record 0x"+c.toString(16))}}},i)}function N8(t,e){if(!t)return"??";var r=(t.match(/<c:chart [^>]*r:id="([^"]*)"/)||["",""])[1];return e["!id"][r].Target}function wR(t,e,r,n){var i=Array.isArray(t),s;e.forEach(function(o){var a=Pn(o.ref);if(i?(t[a.r]||(t[a.r]=[]),s=t[a.r][a.c]):s=t[o.ref],!s){s={t:"z"},i?t[a.r][a.c]=s:t[o.ref]=s;var l=mr(t["!ref"]||"BDWGO1000001:A1");l.s.r>a.r&&(l.s.r=a.r),l.e.r<a.r&&(l.e.r=a.r),l.s.c>a.c&&(l.s.c=a.c),l.e.c<a.c&&(l.e.c=a.c);var c=bt(l);c!==t["!ref"]&&(t["!ref"]=c)}s.c||(s.c=[]);var u={a:o.author,t:o.t,r:o.r,T:r};o.h&&(u.h=o.h);for(var h=s.c.length-1;h>=0;--h){if(!r&&s.c[h].T)return;r&&!s.c[h].T&&s.c.splice(h,1)}if(r&&n){for(h=0;h<n.length;++h)if(u.a==n[h].id){u.a=n[h].name||u.a;break}}s.c.push(u)})}function H8(t,e){if(t.match(/<(?:\w+:)?comments *\/>/))return[];var r=[],n=[],i=t.match(/<(?:\w+:)?authors>([\s\S]*)<\/(?:\w+:)?authors>/);i&&i[1]&&i[1].split(/<\/\w*:?author>/).forEach(function(o){if(!(o===""||o.trim()==="")){var a=o.match(/<(?:\w+:)?author[^>]*>(.*)/);a&&r.push(a[1])}});var s=t.match(/<(?:\w+:)?commentList>([\s\S]*)<\/(?:\w+:)?commentList>/);return s&&s[1]&&s[1].split(/<\/\w*:?comment>/).forEach(function(o){if(!(o===""||o.trim()==="")){var a=o.match(/<(?:\w+:)?comment[^>]*>/);if(!!a){var l=Ze(a[0]),c={author:l.authorId&&r[l.authorId]||"sheetjsghost",ref:l.ref,guid:l.guid},u=Pn(l.ref);if(!(e.sheetRows&&e.sheetRows<=u.r)){var h=o.match(/<(?:\w+:)?text>([\s\S]*)<\/(?:\w+:)?text>/),d=!!h&&!!h[1]&&BS(h[1])||{r:"",t:"",h:""};c.r=d.r,d.r=="<t></t>"&&(d.t=d.h=""),c.t=(d.t||"").replace(/\r\n/g,`
  28. `).replace(/\r/g,`
  29. `),e.cellHTML&&(c.h=d.h),n.push(c)}}}}),n}function F8(t,e){var r=[],n=!1,i={},s=0;return t.replace(gn,function(a,l){var c=Ze(a);switch(Js(c[0])){case"<?xml":break;case"<ThreadedComments":break;case"</ThreadedComments>":break;case"<threadedComment":i={author:c.personId,guid:c.id,ref:c.ref,T:1};break;case"</threadedComment>":i.t!=null&&r.push(i);break;case"<text>":case"<text":s=l+a.length;break;case"</text>":i.t=t.slice(s,l).replace(/\r\n/g,`
  30. `).replace(/\r/g,`
  31. `);break;case"<mentions":case"<mentions>":n=!0;break;case"</mentions>":n=!1;break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":n=!0;break;case"</ext>":n=!1;break;default:if(!n&&e.WTF)throw new Error("unrecognized "+c[0]+" in threaded comments")}return a}),r}function L8(t,e){var r=[],n=!1;return t.replace(gn,function(s){var o=Ze(s);switch(Js(o[0])){case"<?xml":break;case"<personList":break;case"</personList>":break;case"<person":r.push({name:o.displayname,id:o.id});break;case"</person>":break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":n=!0;break;case"</ext>":n=!1;break;default:if(!n&&e.WTF)throw new Error("unrecognized "+o[0]+" in threaded comments")}return s}),r}function $8(t){var e={};e.iauthor=t.read_shift(4);var r=ic(t);return e.rfx=r.s,e.ref=nt(r.s),t.l+=16,e}var B8=hn;function W8(t,e){var r=[],n=[],i={},s=!1;return Wo(t,function(a,l,c){switch(c){case 632:n.push(a);break;case 635:i=a;break;case 637:i.t=a.t,i.h=a.h,i.r=a.r;break;case 636:if(i.author=n[i.iauthor],delete i.iauthor,e.sheetRows&&i.rfx&&e.sheetRows<=i.rfx.r)break;i.t||(i.t=""),delete i.rfx,r.push(i);break;case 3072:break;case 35:s=!0;break;case 36:s=!1;break;case 37:break;case 38:break;default:if(!l.T){if(!s||e.WTF)throw new Error("Unexpected record 0x"+c.toString(16))}}}),r}var V8="application/vnd.ms-office.vbaProject";function U8(t){var e=xt.utils.cfb_new({root:"R"});return t.FullPaths.forEach(function(r,n){if(!(r.slice(-1)==="/"||!r.match(/_VBA_PROJECT_CUR/))){var i=r.replace(/^[^\/]*/,"R").replace(/\/_VBA_PROJECT_CUR\u0000*/,"");xt.utils.cfb_add(e,i,t.FileIndex[n].content)}}),xt.write(e)}function G8(){return{"!type":"dialog"}}function Y8(){return{"!type":"dialog"}}function z8(){return{"!type":"macro"}}function j8(){return{"!type":"macro"}}var Cu=function(){var t=/(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g,e={r:0,c:0};function r(n,i,s,o){var a=!1,l=!1;s.length==0?l=!0:s.charAt(0)=="["&&(l=!0,s=s.slice(1,-1)),o.length==0?a=!0:o.charAt(0)=="["&&(a=!0,o=o.slice(1,-1));var c=s.length>0?parseInt(s,10)|0:0,u=o.length>0?parseInt(o,10)|0:0;return a?u+=e.c:--u,l?c+=e.r:--c,i+(a?"":"$")+Ir(u)+(l?"":"$")+qr(c)}return function(i,s){return e=s,i.replace(t,r)}}(),ek=/(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g,K8=function(){return function(e,r){return e.replace(ek,function(n,i,s,o,a,l){var c=kS(o)-(s?0:r.c),u=DS(l)-(a?0:r.r),h=u==0?"":a?u+1:"["+u+"]",d=c==0?"":s?c+1:"["+c+"]";return i+"R"+h+"C"+d})}}();function tk(t,e){return t.replace(ek,function(r,n,i,s,o,a){return n+(i=="$"?i+s:Ir(kS(s)+e.c))+(o=="$"?o+a:qr(DS(a)+e.r))})}function X8(t,e,r){var n=Hu(e),i=n.s,s=Pn(r),o={r:s.r-i.r,c:s.c-i.c};return tk(t,o)}function q8(t){return t.length!=1}function vR(t){return t.replace(/_xlfn\./g,"")}function br(t){t.l+=1}function Ha(t,e){var r=t.read_shift(e==1?1:2);return[r&16383,r>>14&1,r>>15&1]}function rk(t,e,r){var n=2;if(r){if(r.biff>=2&&r.biff<=5)return nk(t);r.biff==12&&(n=4)}var i=t.read_shift(n),s=t.read_shift(n),o=Ha(t,2),a=Ha(t,2);return{s:{r:i,c:o[0],cRel:o[1],rRel:o[2]},e:{r:s,c:a[0],cRel:a[1],rRel:a[2]}}}function nk(t){var e=Ha(t,2),r=Ha(t,2),n=t.read_shift(1),i=t.read_shift(1);return{s:{r:e[0],c:n,cRel:e[1],rRel:e[2]},e:{r:r[0],c:i,cRel:r[1],rRel:r[2]}}}function Z8(t,e,r){if(r.biff<8)return nk(t);var n=t.read_shift(r.biff==12?4:2),i=t.read_shift(r.biff==12?4:2),s=Ha(t,2),o=Ha(t,2);return{s:{r:n,c:s[0],cRel:s[1],rRel:s[2]},e:{r:i,c:o[0],cRel:o[1],rRel:o[2]}}}function ik(t,e,r){if(r&&r.biff>=2&&r.biff<=5)return J8(t);var n=t.read_shift(r&&r.biff==12?4:2),i=Ha(t,2);return{r:n,c:i[0],cRel:i[1],rRel:i[2]}}function J8(t){var e=Ha(t,2),r=t.read_shift(1);return{r:e[0],c:r,cRel:e[1],rRel:e[2]}}function Q8(t){var e=t.read_shift(2),r=t.read_shift(2);return{r:e,c:r&255,fQuoted:!!(r&16384),cRel:r>>15,rRel:r>>15}}function e6(t,e,r){var n=r&&r.biff?r.biff:8;if(n>=2&&n<=5)return t6(t);var i=t.read_shift(n>=12?4:2),s=t.read_shift(2),o=(s&16384)>>14,a=(s&32768)>>15;if(s&=16383,a==1)for(;i>524287;)i-=1048576;if(o==1)for(;s>8191;)s=s-16384;return{r:i,c:s,cRel:o,rRel:a}}function t6(t){var e=t.read_shift(2),r=t.read_shift(1),n=(e&32768)>>15,i=(e&16384)>>14;return e&=16383,n==1&&e>=8192&&(e=e-16384),i==1&&r>=128&&(r=r-256),{r:e,c:r,cRel:i,rRel:n}}function r6(t,e,r){var n=(t[t.l++]&96)>>5,i=rk(t,r.biff>=2&&r.biff<=5?6:8,r);return[n,i]}function n6(t,e,r){var n=(t[t.l++]&96)>>5,i=t.read_shift(2,"i"),s=8;if(r)switch(r.biff){case 5:t.l+=12,s=6;break;case 12:s=12;break}var o=rk(t,s,r);return[n,i,o]}function i6(t,e,r){var n=(t[t.l++]&96)>>5;return t.l+=r&&r.biff>8?12:r.biff<8?6:8,[n]}function s6(t,e,r){var n=(t[t.l++]&96)>>5,i=t.read_shift(2),s=8;if(r)switch(r.biff){case 5:t.l+=12,s=6;break;case 12:s=12;break}return t.l+=s,[n,i]}function o6(t,e,r){var n=(t[t.l++]&96)>>5,i=Z8(t,e-1,r);return[n,i]}function a6(t,e,r){var n=(t[t.l++]&96)>>5;return t.l+=r.biff==2?6:r.biff==12?14:7,[n]}function CR(t){var e=t[t.l+1]&1,r=1;return t.l+=4,[e,r]}function l6(t,e,r){t.l+=2;for(var n=t.read_shift(r&&r.biff==2?1:2),i=[],s=0;s<=n;++s)i.push(t.read_shift(r&&r.biff==2?1:2));return i}function c6(t,e,r){var n=t[t.l+1]&255?1:0;return t.l+=2,[n,t.read_shift(r&&r.biff==2?1:2)]}function u6(t,e,r){var n=t[t.l+1]&255?1:0;return t.l+=2,[n,t.read_shift(r&&r.biff==2?1:2)]}function h6(t){var e=t[t.l+1]&255?1:0;return t.l+=2,[e,t.read_shift(2)]}function d6(t,e,r){var n=t[t.l+1]&255?1:0;return t.l+=r&&r.biff==2?3:4,[n]}function sk(t){var e=t.read_shift(1),r=t.read_shift(1);return[e,r]}function f6(t){return t.read_shift(2),sk(t)}function g6(t){return t.read_shift(2),sk(t)}function m6(t,e,r){var n=(t[t.l]&96)>>5;t.l+=1;var i=ik(t,0,r);return[n,i]}function p6(t,e,r){var n=(t[t.l]&96)>>5;t.l+=1;var i=e6(t,0,r);return[n,i]}function w6(t,e,r){var n=(t[t.l]&96)>>5;t.l+=1;var i=t.read_shift(2);r&&r.biff==5&&(t.l+=12);var s=ik(t,0,r);return[n,i,s]}function v6(t,e,r){var n=(t[t.l]&96)>>5;t.l+=1;var i=t.read_shift(r&&r.biff<=3?1:2);return[CU[i],lk[i],n]}function C6(t,e,r){var n=t[t.l++],i=t.read_shift(1),s=r&&r.biff<=3?[n==88?-1:0,t.read_shift(1)]:S6(t);return[i,(s[0]===0?lk:vU)[s[1]]]}function S6(t){return[t[t.l+1]>>7,t.read_shift(2)&32767]}function y6(t,e,r){t.l+=r&&r.biff==2?3:4}function x6(t,e,r){if(t.l++,r&&r.biff==12)return[t.read_shift(4,"i"),0];var n=t.read_shift(2),i=t.read_shift(r&&r.biff==2?1:2);return[n,i]}function b6(t){return t.l++,sc[t.read_shift(1)]}function E6(t){return t.l++,t.read_shift(2)}function R6(t){return t.l++,t.read_shift(1)!==0}function T6(t){return t.l++,cn(t)}function _6(t,e,r){return t.l++,nf(t,e-1,r)}function A6(t,e){var r=[t.read_shift(1)];if(e==12)switch(r[0]){case 2:r[0]=4;break;case 4:r[0]=16;break;case 0:r[0]=1;break;case 1:r[0]=2;break}switch(r[0]){case 4:r[1]=vr(t,1)?"TRUE":"FALSE",e!=12&&(t.l+=7);break;case 37:case 16:r[1]=sc[t[t.l]],t.l+=e==12?4:8;break;case 0:t.l+=8;break;case 1:r[1]=cn(t);break;case 2:r[1]=oc(t,0,{biff:e>0&&e<8?2:e});break;default:throw new Error("Bad SerAr: "+r[0])}return r}function M6(t,e,r){for(var n=t.read_shift(r.biff==12?4:2),i=[],s=0;s!=n;++s)i.push((r.biff==12?ic:rp)(t));return i}function O6(t,e,r){var n=0,i=0;r.biff==12?(n=t.read_shift(4),i=t.read_shift(4)):(i=1+t.read_shift(1),n=1+t.read_shift(2)),r.biff>=2&&r.biff<8&&(--n,--i==0&&(i=256));for(var s=0,o=[];s!=n&&(o[s]=[]);++s)for(var a=0;a!=i;++a)o[s][a]=A6(t,r.biff);return o}function I6(t,e,r){var n=t.read_shift(1)>>>5&3,i=!r||r.biff>=8?4:2,s=t.read_shift(i);switch(r.biff){case 2:t.l+=5;break;case 3:case 4:t.l+=8;break;case 5:t.l+=12;break}return[n,0,s]}function P6(t,e,r){if(r.biff==5)return D6(t);var n=t.read_shift(1)>>>5&3,i=t.read_shift(2),s=t.read_shift(4);return[n,i,s]}function D6(t){var e=t.read_shift(1)>>>5&3,r=t.read_shift(2,"i");t.l+=8;var n=t.read_shift(2);return t.l+=12,[e,r,n]}function k6(t,e,r){var n=t.read_shift(1)>>>5&3;t.l+=r&&r.biff==2?3:4;var i=t.read_shift(r&&r.biff==2?1:2);return[n,i]}function N6(t,e,r){var n=t.read_shift(1)>>>5&3,i=t.read_shift(r&&r.biff==2?1:2);return[n,i]}function H6(t,e,r){var n=t.read_shift(1)>>>5&3;return t.l+=4,r.biff<8&&t.l--,r.biff==12&&(t.l+=2),[n]}function F6(t,e,r){var n=(t[t.l++]&96)>>5,i=t.read_shift(2),s=4;if(r)switch(r.biff){case 5:s=15;break;case 12:s=6;break}return t.l+=s,[n,i]}var L6=fn,$6=fn,B6=fn;function of(t,e,r){return t.l+=2,[Q8(t)]}function VS(t){return t.l+=6,[]}var W6=of,V6=VS,U6=VS,G6=of;function ok(t){return t.l+=2,[Tr(t),t.read_shift(2)&1]}var Y6=of,z6=ok,j6=VS,K6=of,X6=of,q6=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"];function Z6(t){t.l+=2;var e=t.read_shift(2),r=t.read_shift(2),n=t.read_shift(4),i=t.read_shift(2),s=t.read_shift(2),o=q6[r>>2&31];return{ixti:e,coltype:r&3,rt:o,idx:n,c:i,C:s}}function J6(t){return t.l+=2,[t.read_shift(4)]}function Q6(t,e,r){return t.l+=5,t.l+=2,t.l+=r.biff==2?1:4,["PTGSHEET"]}function eU(t,e,r){return t.l+=r.biff==2?4:5,["PTGENDSHEET"]}function tU(t){var e=t.read_shift(1)>>>5&3,r=t.read_shift(2);return[e,r]}function rU(t){var e=t.read_shift(1)>>>5&3,r=t.read_shift(2);return[e,r]}function nU(t){return t.l+=4,[0,0]}var SR={1:{n:"PtgExp",f:x6},2:{n:"PtgTbl",f:B6},3:{n:"PtgAdd",f:br},4:{n:"PtgSub",f:br},5:{n:"PtgMul",f:br},6:{n:"PtgDiv",f:br},7:{n:"PtgPower",f:br},8:{n:"PtgConcat",f:br},9:{n:"PtgLt",f:br},10:{n:"PtgLe",f:br},11:{n:"PtgEq",f:br},12:{n:"PtgGe",f:br},13:{n:"PtgGt",f:br},14:{n:"PtgNe",f:br},15:{n:"PtgIsect",f:br},16:{n:"PtgUnion",f:br},17:{n:"PtgRange",f:br},18:{n:"PtgUplus",f:br},19:{n:"PtgUminus",f:br},20:{n:"PtgPercent",f:br},21:{n:"PtgParen",f:br},22:{n:"PtgMissArg",f:br},23:{n:"PtgStr",f:_6},26:{n:"PtgSheet",f:Q6},27:{n:"PtgEndSheet",f:eU},28:{n:"PtgErr",f:b6},29:{n:"PtgBool",f:R6},30:{n:"PtgInt",f:E6},31:{n:"PtgNum",f:T6},32:{n:"PtgArray",f:a6},33:{n:"PtgFunc",f:v6},34:{n:"PtgFuncVar",f:C6},35:{n:"PtgName",f:I6},36:{n:"PtgRef",f:m6},37:{n:"PtgArea",f:r6},38:{n:"PtgMemArea",f:k6},39:{n:"PtgMemErr",f:L6},40:{n:"PtgMemNoMem",f:$6},41:{n:"PtgMemFunc",f:N6},42:{n:"PtgRefErr",f:H6},43:{n:"PtgAreaErr",f:i6},44:{n:"PtgRefN",f:p6},45:{n:"PtgAreaN",f:o6},46:{n:"PtgMemAreaN",f:tU},47:{n:"PtgMemNoMemN",f:rU},57:{n:"PtgNameX",f:P6},58:{n:"PtgRef3d",f:w6},59:{n:"PtgArea3d",f:n6},60:{n:"PtgRefErr3d",f:F6},61:{n:"PtgAreaErr3d",f:s6},255:{}},iU={64:32,96:32,65:33,97:33,66:34,98:34,67:35,99:35,68:36,100:36,69:37,101:37,70:38,102:38,71:39,103:39,72:40,104:40,73:41,105:41,74:42,106:42,75:43,107:43,76:44,108:44,77:45,109:45,78:46,110:46,79:47,111:47,88:34,120:34,89:57,121:57,90:58,122:58,91:59,123:59,92:60,124:60,93:61,125:61},sU={1:{n:"PtgElfLel",f:ok},2:{n:"PtgElfRw",f:K6},3:{n:"PtgElfCol",f:W6},6:{n:"PtgElfRwV",f:X6},7:{n:"PtgElfColV",f:G6},10:{n:"PtgElfRadical",f:Y6},11:{n:"PtgElfRadicalS",f:j6},13:{n:"PtgElfColS",f:V6},15:{n:"PtgElfColSV",f:U6},16:{n:"PtgElfRadicalLel",f:z6},25:{n:"PtgList",f:Z6},29:{n:"PtgSxName",f:J6},255:{}},oU={0:{n:"PtgAttrNoop",f:nU},1:{n:"PtgAttrSemi",f:d6},2:{n:"PtgAttrIf",f:u6},4:{n:"PtgAttrChoose",f:l6},8:{n:"PtgAttrGoto",f:c6},16:{n:"PtgAttrSum",f:y6},32:{n:"PtgAttrBaxcel",f:CR},33:{n:"PtgAttrBaxcel",f:CR},64:{n:"PtgAttrSpace",f:f6},65:{n:"PtgAttrSpaceSemi",f:g6},128:{n:"PtgAttrIfError",f:h6},255:{}};function af(t,e,r,n){if(n.biff<8)return fn(t,e);for(var i=t.l+e,s=[],o=0;o!==r.length;++o)switch(r[o][0]){case"PtgArray":r[o][1]=O6(t,0,n),s.push(r[o][1]);break;case"PtgMemArea":r[o][2]=M6(t,r[o][1],n),s.push(r[o][2]);break;case"PtgExp":n&&n.biff==12&&(r[o][1][1]=t.read_shift(4),s.push(r[o][1]));break;case"PtgList":case"PtgElfRadicalS":case"PtgElfColS":case"PtgElfColSV":throw"Unsupported "+r[o][0]}return e=i-t.l,e!==0&&s.push(fn(t,e)),s}function lf(t,e,r){for(var n=t.l+e,i,s,o=[];n!=t.l;)e=n-t.l,s=t[t.l],i=SR[s]||SR[iU[s]],(s===24||s===25)&&(i=(s===24?sU:oU)[t[t.l+1]]),!i||!i.f?fn(t,e):o.push([i.n,i.f(t,e,r)]);return o}function aU(t){for(var e=[],r=0;r<t.length;++r){for(var n=t[r],i=[],s=0;s<n.length;++s){var o=n[s];if(o)switch(o[0]){case 2:i.push('"'+o[1].replace(/"/g,'""')+'"');break;default:i.push(o[1])}else i.push("")}e.push(i.join(","))}return e.join(";")}var lU={PtgAdd:"+",PtgConcat:"&",PtgDiv:"/",PtgEq:"=",PtgGe:">=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"};function cU(t,e){if(!t&&!(e&&e.biff<=5&&e.biff>=2))throw new Error("empty sheet name");return/[^\w\u4E00-\u9FFF\u3040-\u30FF]/.test(t)?"'"+t+"'":t}function ak(t,e,r){if(!t)return"SH33TJSERR0";if(r.biff>8&&(!t.XTI||!t.XTI[e]))return t.SheetNames[e];if(!t.XTI)return"SH33TJSERR6";var n=t.XTI[e];if(r.biff<8)return e>1e4&&(e-=65536),e<0&&(e=-e),e==0?"":t.XTI[e-1];if(!n)return"SH33TJSERR1";var i="";if(r.biff>8)switch(t[n[0]][0]){case 357:return i=n[1]==-1?"#REF":t.SheetNames[n[1]],n[1]==n[2]?i:i+":"+t.SheetNames[n[2]];case 358:return r.SID!=null?t.SheetNames[r.SID]:"SH33TJSSAME"+t[n[0]][0];case 355:default:return"SH33TJSSRC"+t[n[0]][0]}switch(t[n[0]][0][0]){case 1025:return i=n[1]==-1?"#REF":t.SheetNames[n[1]]||"SH33TJSERR3",n[1]==n[2]?i:i+":"+t.SheetNames[n[2]];case 14849:return t[n[0]].slice(1).map(function(s){return s.Name}).join(";;");default:return t[n[0]][0][3]?(i=n[1]==-1?"#REF":t[n[0]][0][3][n[1]]||"SH33TJSERR4",n[1]==n[2]?i:i+":"+t[n[0]][0][3][n[2]]):"SH33TJSERR2"}}function yR(t,e,r){var n=ak(t,e,r);return n=="#REF"?n:cU(n,r)}function on(t,e,r,n,i){var s=i&&i.biff||8,o={s:{c:0,r:0},e:{c:0,r:0}},a=[],l,c,u,h=0,d=0,f,g="";if(!t[0]||!t[0][0])return"";for(var m=-1,w="",C=0,S=t[0].length;C<S;++C){var v=t[0][C];switch(v[0]){case"PtgUminus":a.push("-"+a.pop());break;case"PtgUplus":a.push("+"+a.pop());break;case"PtgPercent":a.push(a.pop()+"%");break;case"PtgAdd":case"PtgConcat":case"PtgDiv":case"PtgEq":case"PtgGe":case"PtgGt":case"PtgLe":case"PtgLt":case"PtgMul":case"PtgNe":case"PtgPower":case"PtgSub":if(l=a.pop(),c=a.pop(),m>=0){switch(t[0][m][1][0]){case 0:w=gr(" ",t[0][m][1][1]);break;case 1:w=gr("\r",t[0][m][1][1]);break;default:if(w="",i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+t[0][m][1][0])}c=c+w,m=-1}a.push(c+lU[v[0]]+l);break;case"PtgIsect":l=a.pop(),c=a.pop(),a.push(c+" "+l);break;case"PtgUnion":l=a.pop(),c=a.pop(),a.push(c+","+l);break;case"PtgRange":l=a.pop(),c=a.pop(),a.push(c+":"+l);break;case"PtgAttrChoose":break;case"PtgAttrGoto":break;case"PtgAttrIf":break;case"PtgAttrIfError":break;case"PtgRef":u=id(v[1][1],o,i),a.push(sd(u,s));break;case"PtgRefN":u=r?id(v[1][1],r,i):v[1][1],a.push(sd(u,s));break;case"PtgRef3d":h=v[1][1],u=id(v[1][2],o,i),g=yR(n,h,i),a.push(g+"!"+sd(u,s));break;case"PtgFunc":case"PtgFuncVar":var T=v[1][0],A=v[1][1];T||(T=0),T&=127;var M=T==0?[]:a.slice(-T);a.length-=T,A==="User"&&(A=M.shift()),a.push(A+"("+M.join(",")+")");break;case"PtgBool":a.push(v[1]?"TRUE":"FALSE");break;case"PtgInt":a.push(v[1]);break;case"PtgNum":a.push(String(v[1]));break;case"PtgStr":a.push('"'+v[1].replace(/"/g,'""')+'"');break;case"PtgErr":a.push(v[1]);break;case"PtgAreaN":f=tR(v[1][1],r?{s:r}:o,i),a.push(aw(f,i));break;case"PtgArea":f=tR(v[1][1],o,i),a.push(aw(f,i));break;case"PtgArea3d":h=v[1][1],f=v[1][2],g=yR(n,h,i),a.push(g+"!"+aw(f,i));break;case"PtgAttrSum":a.push("SUM("+a.pop()+")");break;case"PtgAttrBaxcel":case"PtgAttrSemi":break;case"PtgName":d=v[1][2];var E=(n.names||[])[d-1]||(n[0]||[])[d],Y=E?E.Name:"SH33TJSNAME"+String(d);Y&&Y.slice(0,6)=="_xlfn."&&!i.xlfn&&(Y=Y.slice(6)),a.push(Y);break;case"PtgNameX":var D=v[1][1];d=v[1][2];var U;if(i.biff<=5)D<0&&(D=-D),n[D]&&(U=n[D][d]);else{var X="";if(((n[D]||[])[0]||[])[0]==14849||(((n[D]||[])[0]||[])[0]==1025?n[D][d]&&n[D][d].itab>0&&(X=n.SheetNames[n[D][d].itab-1]+"!"):X=n.SheetNames[d-1]+"!"),n[D]&&n[D][d])X+=n[D][d].Name;else if(n[0]&&n[0][d])X+=n[0][d].Name;else{var G=(ak(n,D,i)||"").split(";;");G[d-1]?X=G[d-1]:X+="SH33TJSERRX"}a.push(X);break}U||(U={Name:"SH33TJSERRY"}),a.push(U.Name);break;case"PtgParen":var ae="(",ve=")";if(m>=0){switch(w="",t[0][m][1][0]){case 2:ae=gr(" ",t[0][m][1][1])+ae;break;case 3:ae=gr("\r",t[0][m][1][1])+ae;break;case 4:ve=gr(" ",t[0][m][1][1])+ve;break;case 5:ve=gr("\r",t[0][m][1][1])+ve;break;default:if(i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+t[0][m][1][0])}m=-1}a.push(ae+a.pop()+ve);break;case"PtgRefErr":a.push("#REF!");break;case"PtgRefErr3d":a.push("#REF!");break;case"PtgExp":u={c:v[1][1],r:v[1][0]};var me={c:r.c,r:r.r};if(n.sharedf[nt(u)]){var Re=n.sharedf[nt(u)];a.push(on(Re,o,me,n,i))}else{var Ce=!1;for(l=0;l!=n.arrayf.length;++l)if(c=n.arrayf[l],!(u.c<c[0].s.c||u.c>c[0].e.c)&&!(u.r<c[0].s.r||u.r>c[0].e.r)){a.push(on(c[1],o,me,n,i)),Ce=!0;break}Ce||a.push(v[1])}break;case"PtgArray":a.push("{"+aU(v[1])+"}");break;case"PtgMemArea":break;case"PtgAttrSpace":case"PtgAttrSpaceSemi":m=C;break;case"PtgTbl":break;case"PtgMemErr":break;case"PtgMissArg":a.push("");break;case"PtgAreaErr":a.push("#REF!");break;case"PtgAreaErr3d":a.push("#REF!");break;case"PtgList":a.push("Table"+v[1].idx+"[#"+v[1].rt+"]");break;case"PtgMemAreaN":case"PtgMemNoMemN":case"PtgAttrNoop":case"PtgSheet":case"PtgEndSheet":break;case"PtgMemFunc":break;case"PtgMemNoMem":break;case"PtgElfCol":case"PtgElfColS":case"PtgElfColSV":case"PtgElfColV":case"PtgElfLel":case"PtgElfRadical":case"PtgElfRadicalLel":case"PtgElfRadicalS":case"PtgElfRw":case"PtgElfRwV":throw new Error("Unsupported ELFs");case"PtgSxName":throw new Error("Unrecognized Formula Token: "+String(v));default:throw new Error("Unrecognized Formula Token: "+String(v))}var _e=["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"];if(i.biff!=3&&m>=0&&_e.indexOf(t[0][C][0])==-1){v=t[0][m];var p=!0;switch(v[1][0]){case 4:p=!1;case 0:w=gr(" ",v[1][1]);break;case 5:p=!1;case 1:w=gr("\r",v[1][1]);break;default:if(w="",i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+v[1][0])}a.push((p?w:"")+a.pop()+(p?"":w)),m=-1}}if(a.length>1&&i.WTF)throw new Error("bad formula stack");return a[0]}function uU(t,e,r){var n=t.l+e,i=r.biff==2?1:2,s,o=t.read_shift(i);if(o==65535)return[[],fn(t,e-2)];var a=lf(t,o,r);return e!==o+i&&(s=af(t,e-o-i,a,r)),t.l=n,[a,s]}function hU(t,e,r){var n=t.l+e,i=r.biff==2?1:2,s,o=t.read_shift(i);if(o==65535)return[[],fn(t,e-2)];var a=lf(t,o,r);return e!==o+i&&(s=af(t,e-o-i,a,r)),t.l=n,[a,s]}function dU(t,e,r,n){var i=t.l+e,s=lf(t,n,r),o;return i!==t.l&&(o=af(t,i-t.l,s,r)),[s,o]}function fU(t,e,r){var n=t.l+e,i,s=t.read_shift(2),o=lf(t,s,r);return s==65535?[[],fn(t,e-2)]:(e!==s+2&&(i=af(t,n-s-2,o,r)),[o,i])}function gU(t){var e;if(To(t,t.l+6)!==65535)return[cn(t),"n"];switch(t[t.l]){case 0:return t.l+=8,["String","s"];case 1:return e=t[t.l+2]===1,t.l+=8,[e,"b"];case 2:return e=t[t.l+2],t.l+=8,[e,"e"];case 3:return t.l+=8,["","s"]}return[]}function uw(t,e,r){var n=t.l+e,i=Qs(t);r.biff==2&&++t.l;var s=gU(t),o=t.read_shift(1);r.biff!=2&&(t.read_shift(1),r.biff>=5&&t.read_shift(4));var a=hU(t,n-t.l,r);return{cell:i,val:s[0],formula:a,shared:o>>3&1,tt:s[1]}}function np(t,e,r){var n=t.read_shift(4),i=lf(t,n,r),s=t.read_shift(4),o=s>0?af(t,s,i,r):null;return[i,o]}var mU=np,ip=np,pU=np,wU=np,vU={0:"BEEP",1:"OPEN",2:"OPEN.LINKS",3:"CLOSE.ALL",4:"SAVE",5:"SAVE.AS",6:"FILE.DELETE",7:"PAGE.SETUP",8:"PRINT",9:"PRINTER.SETUP",10:"QUIT",11:"NEW.WINDOW",12:"ARRANGE.ALL",13:"WINDOW.SIZE",14:"WINDOW.MOVE",15:"FULL",16:"CLOSE",17:"RUN",22:"SET.PRINT.AREA",23:"SET.PRINT.TITLES",24:"SET.PAGE.BREAK",25:"REMOVE.PAGE.BREAK",26:"FONT",27:"DISPLAY",28:"PROTECT.DOCUMENT",29:"PRECISION",30:"A1.R1C1",31:"CALCULATE.NOW",32:"CALCULATION",34:"DATA.FIND",35:"EXTRACT",36:"DATA.DELETE",37:"SET.DATABASE",38:"SET.CRITERIA",39:"SORT",40:"DATA.SERIES",41:"TABLE",42:"FORMAT.NUMBER",43:"ALIGNMENT",44:"STYLE",45:"BORDER",46:"CELL.PROTECTION",47:"COLUMN.WIDTH",48:"UNDO",49:"CUT",50:"COPY",51:"PASTE",52:"CLEAR",53:"PASTE.SPECIAL",54:"EDIT.DELETE",55:"INSERT",56:"FILL.RIGHT",57:"FILL.DOWN",61:"DEFINE.NAME",62:"CREATE.NAMES",63:"FORMULA.GOTO",64:"FORMULA.FIND",65:"SELECT.LAST.CELL",66:"SHOW.ACTIVE.CELL",67:"GALLERY.AREA",68:"GALLERY.BAR",69:"GALLERY.COLUMN",70:"GALLERY.LINE",71:"GALLERY.PIE",72:"GALLERY.SCATTER",73:"COMBINATION",74:"PREFERRED",75:"ADD.OVERLAY",76:"GRIDLINES",77:"SET.PREFERRED",78:"AXES",79:"LEGEND",80:"ATTACH.TEXT",81:"ADD.ARROW",82:"SELECT.CHART",83:"SELECT.PLOT.AREA",84:"PATTERNS",85:"MAIN.CHART",86:"OVERLAY",87:"SCALE",88:"FORMAT.LEGEND",89:"FORMAT.TEXT",90:"EDIT.REPEAT",91:"PARSE",92:"JUSTIFY",93:"HIDE",94:"UNHIDE",95:"WORKSPACE",96:"FORMULA",97:"FORMULA.FILL",98:"FORMULA.ARRAY",99:"DATA.FIND.NEXT",100:"DATA.FIND.PREV",101:"FORMULA.FIND.NEXT",102:"FORMULA.FIND.PREV",103:"ACTIVATE",104:"ACTIVATE.NEXT",105:"ACTIVATE.PREV",106:"UNLOCKED.NEXT",107:"UNLOCKED.PREV",108:"COPY.PICTURE",109:"SELECT",110:"DELETE.NAME",111:"DELETE.FORMAT",112:"VLINE",113:"HLINE",114:"VPAGE",115:"HPAGE",116:"VSCROLL",117:"HSCROLL",118:"ALERT",119:"NEW",120:"CANCEL.COPY",121:"SHOW.CLIPBOARD",122:"MESSAGE",124:"PASTE.LINK",125:"APP.ACTIVATE",126:"DELETE.ARROW",127:"ROW.HEIGHT",128:"FORMAT.MOVE",129:"FORMAT.SIZE",130:"FORMULA.REPLACE",131:"SEND.KEYS",132:"SELECT.SPECIAL",133:"APPLY.NAMES",134:"REPLACE.FONT",135:"FREEZE.PANES",136:"SHOW.INFO",137:"SPLIT",138:"ON.WINDOW",139:"ON.DATA",140:"DISABLE.INPUT",142:"OUTLINE",143:"LIST.NAMES",144:"FILE.CLOSE",145:"SAVE.WORKBOOK",146:"DATA.FORM",147:"COPY.CHART",148:"ON.TIME",149:"WAIT",150:"FORMAT.FONT",151:"FILL.UP",152:"FILL.LEFT",153:"DELETE.OVERLAY",155:"SHORT.MENUS",159:"SET.UPDATE.STATUS",161:"COLOR.PALETTE",162:"DELETE.STYLE",163:"WINDOW.RESTORE",164:"WINDOW.MAXIMIZE",166:"CHANGE.LINK",167:"CALCULATE.DOCUMENT",168:"ON.KEY",169:"APP.RESTORE",170:"APP.MOVE",171:"APP.SIZE",172:"APP.MINIMIZE",173:"APP.MAXIMIZE",174:"BRING.TO.FRONT",175:"SEND.TO.BACK",185:"MAIN.CHART.TYPE",186:"OVERLAY.CHART.TYPE",187:"SELECT.END",188:"OPEN.MAIL",189:"SEND.MAIL",190:"STANDARD.FONT",191:"CONSOLIDATE",192:"SORT.SPECIAL",193:"GALLERY.3D.AREA",194:"GALLERY.3D.COLUMN",195:"GALLERY.3D.LINE",196:"GALLERY.3D.PIE",197:"VIEW.3D",198:"GOAL.SEEK",199:"WORKGROUP",200:"FILL.GROUP",201:"UPDATE.LINK",202:"PROMOTE",203:"DEMOTE",204:"SHOW.DETAIL",206:"UNGROUP",207:"OBJECT.PROPERTIES",208:"SAVE.NEW.OBJECT",209:"SHARE",210:"SHARE.NAME",211:"DUPLICATE",212:"APPLY.STYLE",213:"ASSIGN.TO.OBJECT",214:"OBJECT.PROTECTION",215:"HIDE.OBJECT",216:"SET.EXTRACT",217:"CREATE.PUBLISHER",218:"SUBSCRIBE.TO",219:"ATTRIBUTES",220:"SHOW.TOOLBAR",222:"PRINT.PREVIEW",223:"EDIT.COLOR",224:"SHOW.LEVELS",225:"FORMAT.MAIN",226:"FORMAT.OVERLAY",227:"ON.RECALC",228:"EDIT.SERIES",229:"DEFINE.STYLE",240:"LINE.PRINT",243:"ENTER.DATA",249:"GALLERY.RADAR",250:"MERGE.STYLES",251:"EDITION.OPTIONS",252:"PASTE.PICTURE",253:"PASTE.PICTURE.LINK",254:"SPELLING",256:"ZOOM",259:"INSERT.OBJECT",260:"WINDOW.MINIMIZE",265:"SOUND.NOTE",266:"SOUND.PLAY",267:"FORMAT.SHAPE",268:"EXTEND.POLYGON",269:"FORMAT.AUTO",272:"GALLERY.3D.BAR",273:"GALLERY.3D.SURFACE",274:"FILL.AUTO",276:"CUSTOMIZE.TOOLBAR",277:"ADD.TOOL",278:"EDIT.OBJECT",279:"ON.DOUBLECLICK",280:"ON.ENTRY",281:"WORKBOOK.ADD",282:"WORKBOOK.MOVE",283:"WORKBOOK.COPY",284:"WORKBOOK.OPTIONS",285:"SAVE.WORKSPACE",288:"CHART.WIZARD",289:"DELETE.TOOL",290:"MOVE.TOOL",291:"WORKBOOK.SELECT",292:"WORKBOOK.ACTIVATE",293:"ASSIGN.TO.TOOL",295:"COPY.TOOL",296:"RESET.TOOL",297:"CONSTRAIN.NUMERIC",298:"PASTE.TOOL",302:"WORKBOOK.NEW",305:"SCENARIO.CELLS",306:"SCENARIO.DELETE",307:"SCENARIO.ADD",308:"SCENARIO.EDIT",309:"SCENARIO.SHOW",310:"SCENARIO.SHOW.NEXT",311:"SCENARIO.SUMMARY",312:"PIVOT.TABLE.WIZARD",313:"PIVOT.FIELD.PROPERTIES",314:"PIVOT.FIELD",315:"PIVOT.ITEM",316:"PIVOT.ADD.FIELDS",318:"OPTIONS.CALCULATION",319:"OPTIONS.EDIT",320:"OPTIONS.VIEW",321:"ADDIN.MANAGER",322:"MENU.EDITOR",323:"ATTACH.TOOLBARS",324:"VBAActivate",325:"OPTIONS.CHART",328:"VBA.INSERT.FILE",330:"VBA.PROCEDURE.DEFINITION",336:"ROUTING.SLIP",338:"ROUTE.DOCUMENT",339:"MAIL.LOGON",342:"INSERT.PICTURE",343:"EDIT.TOOL",344:"GALLERY.DOUGHNUT",350:"CHART.TREND",352:"PIVOT.ITEM.PROPERTIES",354:"WORKBOOK.INSERT",355:"OPTIONS.TRANSITION",356:"OPTIONS.GENERAL",370:"FILTER.ADVANCED",373:"MAIL.ADD.MAILER",374:"MAIL.DELETE.MAILER",375:"MAIL.REPLY",376:"MAIL.REPLY.ALL",377:"MAIL.FORWARD",378:"MAIL.NEXT.LETTER",379:"DATA.LABEL",380:"INSERT.TITLE",381:"FONT.PROPERTIES",382:"MACRO.OPTIONS",383:"WORKBOOK.HIDE",384:"WORKBOOK.UNHIDE",385:"WORKBOOK.DELETE",386:"WORKBOOK.NAME",388:"GALLERY.CUSTOM",390:"ADD.CHART.AUTOFORMAT",391:"DELETE.CHART.AUTOFORMAT",392:"CHART.ADD.DATA",393:"AUTO.OUTLINE",394:"TAB.ORDER",395:"SHOW.DIALOG",396:"SELECT.ALL",397:"UNGROUP.SHEETS",398:"SUBTOTAL.CREATE",399:"SUBTOTAL.REMOVE",400:"RENAME.OBJECT",412:"WORKBOOK.SCROLL",413:"WORKBOOK.NEXT",414:"WORKBOOK.PREV",415:"WORKBOOK.TAB.SPLIT",416:"FULL.SCREEN",417:"WORKBOOK.PROTECT",420:"SCROLLBAR.PROPERTIES",421:"PIVOT.SHOW.PAGES",422:"TEXT.TO.COLUMNS",423:"FORMAT.CHARTTYPE",424:"LINK.FORMAT",425:"TRACER.DISPLAY",430:"TRACER.NAVIGATE",431:"TRACER.CLEAR",432:"TRACER.ERROR",433:"PIVOT.FIELD.GROUP",434:"PIVOT.FIELD.UNGROUP",435:"CHECKBOX.PROPERTIES",436:"LABEL.PROPERTIES",437:"LISTBOX.PROPERTIES",438:"EDITBOX.PROPERTIES",439:"PIVOT.REFRESH",440:"LINK.COMBO",441:"OPEN.TEXT",442:"HIDE.DIALOG",443:"SET.DIALOG.FOCUS",444:"ENABLE.OBJECT",445:"PUSHBUTTON.PROPERTIES",446:"SET.DIALOG.DEFAULT",447:"FILTER",448:"FILTER.SHOW.ALL",449:"CLEAR.OUTLINE",450:"FUNCTION.WIZARD",451:"ADD.LIST.ITEM",452:"SET.LIST.ITEM",453:"REMOVE.LIST.ITEM",454:"SELECT.LIST.ITEM",455:"SET.CONTROL.VALUE",456:"SAVE.COPY.AS",458:"OPTIONS.LISTS.ADD",459:"OPTIONS.LISTS.DELETE",460:"SERIES.AXES",461:"SERIES.X",462:"SERIES.Y",463:"ERRORBAR.X",464:"ERRORBAR.Y",465:"FORMAT.CHART",466:"SERIES.ORDER",467:"MAIL.LOGOFF",468:"CLEAR.ROUTING.SLIP",469:"APP.ACTIVATE.MICROSOFT",470:"MAIL.EDIT.MAILER",471:"ON.SHEET",472:"STANDARD.WIDTH",473:"SCENARIO.MERGE",474:"SUMMARY.INFO",475:"FIND.FILE",476:"ACTIVE.CELL.FONT",477:"ENABLE.TIPWIZARD",478:"VBA.MAKE.ADDIN",480:"INSERTDATATABLE",481:"WORKGROUP.OPTIONS",482:"MAIL.SEND.MAILER",485:"AUTOCORRECT",489:"POST.DOCUMENT",491:"PICKLIST",493:"VIEW.SHOW",494:"VIEW.DEFINE",495:"VIEW.DELETE",509:"SHEET.BACKGROUND",510:"INSERT.MAP.OBJECT",511:"OPTIONS.MENONO",517:"MSOCHECKS",518:"NORMAL",519:"LAYOUT",520:"RM.PRINT.AREA",521:"CLEAR.PRINT.AREA",522:"ADD.PRINT.AREA",523:"MOVE.BRK",545:"HIDECURR.NOTE",546:"HIDEALL.NOTES",547:"DELETE.NOTE",548:"TRAVERSE.NOTES",549:"ACTIVATE.NOTES",620:"PROTECT.REVISIONS",621:"UNPROTECT.REVISIONS",647:"OPTIONS.ME",653:"WEB.PUBLISH",667:"NEWWEBQUERY",673:"PIVOT.TABLE.CHART",753:"OPTIONS.SAVE",755:"OPTIONS.SPELL",808:"HIDEALL.INKANNOTS"},lk={0:"COUNT",1:"IF",2:"ISNA",3:"ISERROR",4:"SUM",5:"AVERAGE",6:"MIN",7:"MAX",8:"ROW",9:"COLUMN",10:"NA",11:"NPV",12:"STDEV",13:"DOLLAR",14:"FIXED",15:"SIN",16:"COS",17:"TAN",18:"ATAN",19:"PI",20:"SQRT",21:"EXP",22:"LN",23:"LOG10",24:"ABS",25:"INT",26:"SIGN",27:"ROUND",28:"LOOKUP",29:"INDEX",30:"REPT",31:"MID",32:"LEN",33:"VALUE",34:"TRUE",35:"FALSE",36:"AND",37:"OR",38:"NOT",39:"MOD",40:"DCOUNT",41:"DSUM",42:"DAVERAGE",43:"DMIN",44:"DMAX",45:"DSTDEV",46:"VAR",47:"DVAR",48:"TEXT",49:"LINEST",50:"TREND",51:"LOGEST",52:"GROWTH",53:"GOTO",54:"HALT",55:"RETURN",56:"PV",57:"FV",58:"NPER",59:"PMT",60:"RATE",61:"MIRR",62:"IRR",63:"RAND",64:"MATCH",65:"DATE",66:"TIME",67:"DAY",68:"MONTH",69:"YEAR",70:"WEEKDAY",71:"HOUR",72:"MINUTE",73:"SECOND",74:"NOW",75:"AREAS",76:"ROWS",77:"COLUMNS",78:"OFFSET",79:"ABSREF",80:"RELREF",81:"ARGUMENT",82:"SEARCH",83:"TRANSPOSE",84:"ERROR",85:"STEP",86:"TYPE",87:"ECHO",88:"SET.NAME",89:"CALLER",90:"DEREF",91:"WINDOWS",92:"SERIES",93:"DOCUMENTS",94:"ACTIVE.CELL",95:"SELECTION",96:"RESULT",97:"ATAN2",98:"ASIN",99:"ACOS",100:"CHOOSE",101:"HLOOKUP",102:"VLOOKUP",103:"LINKS",104:"INPUT",105:"ISREF",106:"GET.FORMULA",107:"GET.NAME",108:"SET.VALUE",109:"LOG",110:"EXEC",111:"CHAR",112:"LOWER",113:"UPPER",114:"PROPER",115:"LEFT",116:"RIGHT",117:"EXACT",118:"TRIM",119:"REPLACE",120:"SUBSTITUTE",121:"CODE",122:"NAMES",123:"DIRECTORY",124:"FIND",125:"CELL",126:"ISERR",127:"ISTEXT",128:"ISNUMBER",129:"ISBLANK",130:"T",131:"N",132:"FOPEN",133:"FCLOSE",134:"FSIZE",135:"FREADLN",136:"FREAD",137:"FWRITELN",138:"FWRITE",139:"FPOS",140:"DATEVALUE",141:"TIMEVALUE",142:"SLN",143:"SYD",144:"DDB",145:"GET.DEF",146:"REFTEXT",147:"TEXTREF",148:"INDIRECT",149:"REGISTER",150:"CALL",151:"ADD.BAR",152:"ADD.MENU",153:"ADD.COMMAND",154:"ENABLE.COMMAND",155:"CHECK.COMMAND",156:"RENAME.COMMAND",157:"SHOW.BAR",158:"DELETE.MENU",159:"DELETE.COMMAND",160:"GET.CHART.ITEM",161:"DIALOG.BOX",162:"CLEAN",163:"MDETERM",164:"MINVERSE",165:"MMULT",166:"FILES",167:"IPMT",168:"PPMT",169:"COUNTA",170:"CANCEL.KEY",171:"FOR",172:"WHILE",173:"BREAK",174:"NEXT",175:"INITIATE",176:"REQUEST",177:"POKE",178:"EXECUTE",179:"TERMINATE",180:"RESTART",181:"HELP",182:"GET.BAR",183:"PRODUCT",184:"FACT",185:"GET.CELL",186:"GET.WORKSPACE",187:"GET.WINDOW",188:"GET.DOCUMENT",189:"DPRODUCT",190:"ISNONTEXT",191:"GET.NOTE",192:"NOTE",193:"STDEVP",194:"VARP",195:"DSTDEVP",196:"DVARP",197:"TRUNC",198:"ISLOGICAL",199:"DCOUNTA",200:"DELETE.BAR",201:"UNREGISTER",204:"USDOLLAR",205:"FINDB",206:"SEARCHB",207:"REPLACEB",208:"LEFTB",209:"RIGHTB",210:"MIDB",211:"LENB",212:"ROUNDUP",213:"ROUNDDOWN",214:"ASC",215:"DBCS",216:"RANK",219:"ADDRESS",220:"DAYS360",221:"TODAY",222:"VDB",223:"ELSE",224:"ELSE.IF",225:"END.IF",226:"FOR.CELL",227:"MEDIAN",228:"SUMPRODUCT",229:"SINH",230:"COSH",231:"TANH",232:"ASINH",233:"ACOSH",234:"ATANH",235:"DGET",236:"CREATE.OBJECT",237:"VOLATILE",238:"LAST.ERROR",239:"CUSTOM.UNDO",240:"CUSTOM.REPEAT",241:"FORMULA.CONVERT",242:"GET.LINK.INFO",243:"TEXT.BOX",244:"INFO",245:"GROUP",246:"GET.OBJECT",247:"DB",248:"PAUSE",251:"RESUME",252:"FREQUENCY",253:"ADD.TOOLBAR",254:"DELETE.TOOLBAR",255:"User",256:"RESET.TOOLBAR",257:"EVALUATE",258:"GET.TOOLBAR",259:"GET.TOOL",260:"SPELLING.CHECK",261:"ERROR.TYPE",262:"APP.TITLE",263:"WINDOW.TITLE",264:"SAVE.TOOLBAR",265:"ENABLE.TOOL",266:"PRESS.TOOL",267:"REGISTER.ID",268:"GET.WORKBOOK",269:"AVEDEV",270:"BETADIST",271:"GAMMALN",272:"BETAINV",273:"BINOMDIST",274:"CHIDIST",275:"CHIINV",276:"COMBIN",277:"CONFIDENCE",278:"CRITBINOM",279:"EVEN",280:"EXPONDIST",281:"FDIST",282:"FINV",283:"FISHER",284:"FISHERINV",285:"FLOOR",286:"GAMMADIST",287:"GAMMAINV",288:"CEILING",289:"HYPGEOMDIST",290:"LOGNORMDIST",291:"LOGINV",292:"NEGBINOMDIST",293:"NORMDIST",294:"NORMSDIST",295:"NORMINV",296:"NORMSINV",297:"STANDARDIZE",298:"ODD",299:"PERMUT",300:"POISSON",301:"TDIST",302:"WEIBULL",303:"SUMXMY2",304:"SUMX2MY2",305:"SUMX2PY2",306:"CHITEST",307:"CORREL",308:"COVAR",309:"FORECAST",310:"FTEST",311:"INTERCEPT",312:"PEARSON",313:"RSQ",314:"STEYX",315:"SLOPE",316:"TTEST",317:"PROB",318:"DEVSQ",319:"GEOMEAN",320:"HARMEAN",321:"SUMSQ",322:"KURT",323:"SKEW",324:"ZTEST",325:"LARGE",326:"SMALL",327:"QUARTILE",328:"PERCENTILE",329:"PERCENTRANK",330:"MODE",331:"TRIMMEAN",332:"TINV",334:"MOVIE.COMMAND",335:"GET.MOVIE",336:"CONCATENATE",337:"POWER",338:"PIVOT.ADD.DATA",339:"GET.PIVOT.TABLE",340:"GET.PIVOT.FIELD",341:"GET.PIVOT.ITEM",342:"RADIANS",343:"DEGREES",344:"SUBTOTAL",345:"SUMIF",346:"COUNTIF",347:"COUNTBLANK",348:"SCENARIO.GET",349:"OPTIONS.LISTS.GET",350:"ISPMT",351:"DATEDIF",352:"DATESTRING",353:"NUMBERSTRING",354:"ROMAN",355:"OPEN.DIALOG",356:"SAVE.DIALOG",357:"VIEW.GET",358:"GETPIVOTDATA",359:"HYPERLINK",360:"PHONETIC",361:"AVERAGEA",362:"MAXA",363:"MINA",364:"STDEVPA",365:"VARPA",366:"STDEVA",367:"VARA",368:"BAHTTEXT",369:"THAIDAYOFWEEK",370:"THAIDIGIT",371:"THAIMONTHOFYEAR",372:"THAINUMSOUND",373:"THAINUMSTRING",374:"THAISTRINGLENGTH",375:"ISTHAIDIGIT",376:"ROUNDBAHTDOWN",377:"ROUNDBAHTUP",378:"THAIYEAR",379:"RTD",380:"CUBEVALUE",381:"CUBEMEMBER",382:"CUBEMEMBERPROPERTY",383:"CUBERANKEDMEMBER",384:"HEX2BIN",385:"HEX2DEC",386:"HEX2OCT",387:"DEC2BIN",388:"DEC2HEX",389:"DEC2OCT",390:"OCT2BIN",391:"OCT2HEX",392:"OCT2DEC",393:"BIN2DEC",394:"BIN2OCT",395:"BIN2HEX",396:"IMSUB",397:"IMDIV",398:"IMPOWER",399:"IMABS",400:"IMSQRT",401:"IMLN",402:"IMLOG2",403:"IMLOG10",404:"IMSIN",405:"IMCOS",406:"IMEXP",407:"IMARGUMENT",408:"IMCONJUGATE",409:"IMAGINARY",410:"IMREAL",411:"COMPLEX",412:"IMSUM",413:"IMPRODUCT",414:"SERIESSUM",415:"FACTDOUBLE",416:"SQRTPI",417:"QUOTIENT",418:"DELTA",419:"GESTEP",420:"ISEVEN",421:"ISODD",422:"MROUND",423:"ERF",424:"ERFC",425:"BESSELJ",426:"BESSELK",427:"BESSELY",428:"BESSELI",429:"XIRR",430:"XNPV",431:"PRICEMAT",432:"YIELDMAT",433:"INTRATE",434:"RECEIVED",435:"DISC",436:"PRICEDISC",437:"YIELDDISC",438:"TBILLEQ",439:"TBILLPRICE",440:"TBILLYIELD",441:"PRICE",442:"YIELD",443:"DOLLARDE",444:"DOLLARFR",445:"NOMINAL",446:"EFFECT",447:"CUMPRINC",448:"CUMIPMT",449:"EDATE",450:"EOMONTH",451:"YEARFRAC",452:"COUPDAYBS",453:"COUPDAYS",454:"COUPDAYSNC",455:"COUPNCD",456:"COUPNUM",457:"COUPPCD",458:"DURATION",459:"MDURATION",460:"ODDLPRICE",461:"ODDLYIELD",462:"ODDFPRICE",463:"ODDFYIELD",464:"RANDBETWEEN",465:"WEEKNUM",466:"AMORDEGRC",467:"AMORLINC",468:"CONVERT",724:"SHEETJS",469:"ACCRINT",470:"ACCRINTM",471:"WORKDAY",472:"NETWORKDAYS",473:"GCD",474:"MULTINOMIAL",475:"LCM",476:"FVSCHEDULE",477:"CUBEKPIMEMBER",478:"CUBESET",479:"CUBESETCOUNT",480:"IFERROR",481:"COUNTIFS",482:"SUMIFS",483:"AVERAGEIF",484:"AVERAGEIFS"},CU={2:1,3:1,10:0,15:1,16:1,17:1,18:1,19:0,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:2,30:2,31:3,32:1,33:1,34:0,35:0,38:1,39:2,40:3,41:3,42:3,43:3,44:3,45:3,47:3,48:2,53:1,61:3,63:0,65:3,66:3,67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:0,75:1,76:1,77:1,79:2,80:2,83:1,85:0,86:1,89:0,90:1,94:0,95:0,97:2,98:1,99:1,101:3,102:3,105:1,106:1,108:2,111:1,112:1,113:1,114:1,117:2,118:1,119:4,121:1,126:1,127:1,128:1,129:1,130:1,131:1,133:1,134:1,135:1,136:2,137:2,138:2,140:1,141:1,142:3,143:4,144:4,161:1,162:1,163:1,164:1,165:2,172:1,175:2,176:2,177:3,178:2,179:1,184:1,186:1,189:3,190:1,195:3,196:3,197:1,198:1,199:3,201:1,207:4,210:3,211:1,212:2,213:2,214:1,215:1,225:0,229:1,230:1,231:1,232:1,233:1,234:1,235:3,244:1,247:4,252:2,257:1,261:1,271:1,273:4,274:2,275:2,276:2,277:3,278:3,279:1,280:3,281:3,282:3,283:1,284:1,285:2,286:4,287:3,288:2,289:4,290:3,291:3,292:3,293:4,294:1,295:3,296:1,297:3,298:1,299:2,300:3,301:3,302:4,303:2,304:2,305:2,306:2,307:2,308:2,309:3,310:2,311:2,312:2,313:2,314:2,315:2,316:4,325:2,326:2,327:2,328:2,331:2,332:2,337:2,342:1,343:1,346:2,347:1,350:4,351:3,352:1,353:2,360:1,368:1,369:1,370:1,371:1,372:1,373:1,374:1,375:1,376:1,377:1,378:1,382:3,385:1,392:1,393:1,396:2,397:2,398:2,399:1,400:1,401:1,402:1,403:1,404:1,405:1,406:1,407:1,408:1,409:1,410:1,414:4,415:1,416:1,417:2,420:1,421:1,422:2,424:1,425:2,426:2,427:2,428:2,430:3,438:3,439:3,440:3,443:2,444:2,445:2,446:2,447:6,448:6,449:2,450:2,464:2,468:3,476:2,479:1,480:2,65535:0};function xR(t){return t.slice(0,3)=="of:"&&(t=t.slice(3)),t.charCodeAt(0)==61&&(t=t.slice(1),t.charCodeAt(0)==61&&(t=t.slice(1))),t=t.replace(/COM\.MICROSOFT\./g,""),t=t.replace(/\[((?:\.[A-Z]+[0-9]+)(?::\.[A-Z]+[0-9]+)?)\]/g,function(e,r){return r.replace(/\./g,"")}),t=t.replace(/\[.(#[A-Z]*[?!])\]/g,"$1"),t.replace(/[;~]/g,",").replace(/\|/g,";")}function hw(t){var e=t.split(":"),r=e[0].split(".")[0];return[r,e[0].split(".")[1]+(e.length>1?":"+(e[1].split(".")[1]||e[1].split(".")[0]):"")]}var cd={},Su={};function ud(t,e){if(!!t){var r=[.7,.7,.75,.75,.3,.3];e=="xlml"&&(r=[1,1,1,1,.5,.5]),t.left==null&&(t.left=r[0]),t.right==null&&(t.right=r[1]),t.top==null&&(t.top=r[2]),t.bottom==null&&(t.bottom=r[3]),t.header==null&&(t.header=r[4]),t.footer==null&&(t.footer=r[5])}}function ck(t,e,r,n,i,s){try{n.cellNF&&(t.z=ot[e])}catch(a){if(n.WTF)throw a}if(!(t.t==="z"&&!n.cellStyles)){if(t.t==="d"&&typeof t.v=="string"&&(t.v=Vr(t.v)),(!n||n.cellText!==!1)&&t.t!=="z")try{if(ot[e]==null&&$l(yB[e]||"General",e),t.t==="e")t.w=t.w||sc[t.v];else if(e===0)if(t.t==="n")(t.v|0)===t.v?t.w=t.v.toString(10):t.w=Pd(t.v);else if(t.t==="d"){var o=kn(t.v);(o|0)===o?t.w=o.toString(10):t.w=Pd(o)}else{if(t.v===void 0)return"";t.w=Ul(t.v,Su)}else t.t==="d"?t.w=Di(e,kn(t.v),Su):t.w=Di(e,t.v,Su)}catch(a){if(n.WTF)throw a}if(!!n.cellStyles&&r!=null)try{t.s=s.Fills[r],t.s.fgColor&&t.s.fgColor.theme&&!t.s.fgColor.rgb&&(t.s.fgColor.rgb=rm(i.themeElements.clrScheme[t.s.fgColor.theme].rgb,t.s.fgColor.tint||0),n.WTF&&(t.s.fgColor.raw_rgb=i.themeElements.clrScheme[t.s.fgColor.theme].rgb)),t.s.bgColor&&t.s.bgColor.theme&&(t.s.bgColor.rgb=rm(i.themeElements.clrScheme[t.s.bgColor.theme].rgb,t.s.bgColor.tint||0),n.WTF&&(t.s.bgColor.raw_rgb=i.themeElements.clrScheme[t.s.bgColor.theme].rgb))}catch(a){if(n.WTF&&s.Fills)throw a}}}function SU(t,e){var r=mr(e);r.s.r<=r.e.r&&r.s.c<=r.e.c&&r.s.r>=0&&r.s.c>=0&&(t["!ref"]=bt(r))}var yU=/<(?:\w:)?mergeCell ref="[A-Z0-9:]+"\s*[\/]?>/g,xU=/<(?:\w+:)?sheetData[^>]*>([\s\S]*)<\/(?:\w+:)?sheetData>/,bU=/<(?:\w:)?hyperlink [^>]*>/mg,EU=/"(\w*:\w*)"/,RU=/<(?:\w:)?col\b[^>]*[\/]?>/g,TU=/<(?:\w:)?autoFilter[^>]*([\/]|>([\s\S]*)<\/(?:\w:)?autoFilter)>/g,_U=/<(?:\w:)?pageMargins[^>]*\/>/g,uk=/<(?:\w:)?sheetPr\b(?:[^>a-z][^>]*)?\/>/,AU=/<(?:\w:)?sheetPr[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetPr)>/,MU=/<(?:\w:)?sheetViews[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetViews)>/;function OU(t,e,r,n,i,s,o){if(!t)return t;n||(n={"!id":{}});var a=e.dense?[]:{},l={s:{r:2e6,c:2e6},e:{r:0,c:0}},c="",u="",h=t.match(xU);h?(c=t.slice(0,h.index),u=t.slice(h.index+h[0].length)):c=u=t;var d=c.match(uk);d?US(d[0],a,i,r):(d=c.match(AU))&&IU(d[0],d[1]||"",a,i,r);var f=(c.match(/<(?:\w*:)?dimension/)||{index:-1}).index;if(f>0){var g=c.slice(f,f+50).match(EU);g&&SU(a,g[1])}var m=c.match(MU);m&&m[1]&&FU(m[1],i);var w=[];if(e.cellStyles){var C=c.match(RU);C&&kU(w,C)}h&&LU(h[1],a,e,l,s,o);var S=u.match(TU);S&&(a["!autofilter"]=NU(S[0]));var v=[],T=u.match(yU);if(T)for(f=0;f!=T.length;++f)v[f]=mr(T[f].slice(T[f].indexOf('"')+1));var A=u.match(bU);A&&PU(a,A,n);var M=u.match(_U);if(M&&(a["!margins"]=DU(Ze(M[0]))),!a["!ref"]&&l.e.c>=l.s.c&&l.e.r>=l.s.r&&(a["!ref"]=bt(l)),e.sheetRows>0&&a["!ref"]){var E=mr(a["!ref"]);e.sheetRows<=+E.e.r&&(E.e.r=e.sheetRows-1,E.e.r>l.e.r&&(E.e.r=l.e.r),E.e.r<E.s.r&&(E.s.r=E.e.r),E.e.c>l.e.c&&(E.e.c=l.e.c),E.e.c<E.s.c&&(E.s.c=E.e.c),a["!fullref"]=a["!ref"],a["!ref"]=bt(E))}return w.length>0&&(a["!cols"]=w),v.length>0&&(a["!merges"]=v),a}function US(t,e,r,n){var i=Ze(t);r.Sheets[n]||(r.Sheets[n]={}),i.codeName&&(r.Sheets[n].CodeName=_t(Yt(i.codeName)))}function IU(t,e,r,n,i){US(t.slice(0,t.indexOf(">")),r,n,i)}function PU(t,e,r){for(var n=Array.isArray(t),i=0;i!=e.length;++i){var s=Ze(Yt(e[i]),!0);if(!s.ref)return;var o=((r||{})["!id"]||[])[s.id];o?(s.Target=o.Target,s.location&&(s.Target+="#"+_t(s.location))):(s.Target="#"+_t(s.location),o={Target:s.Target,TargetMode:"Internal"}),s.Rel=o,s.tooltip&&(s.Tooltip=s.tooltip,delete s.tooltip);for(var a=mr(s.ref),l=a.s.r;l<=a.e.r;++l)for(var c=a.s.c;c<=a.e.c;++c){var u=nt({c,r:l});n?(t[l]||(t[l]=[]),t[l][c]||(t[l][c]={t:"z",v:void 0}),t[l][c].l=s):(t[u]||(t[u]={t:"z",v:void 0}),t[u].l=s)}}}function DU(t){var e={};return["left","right","top","bottom","header","footer"].forEach(function(r){t[r]&&(e[r]=parseFloat(t[r]))}),e}function kU(t,e){for(var r=!1,n=0;n!=e.length;++n){var i=Ze(e[n],!0);i.hidden&&(i.hidden=er(i.hidden));var s=parseInt(i.min,10)-1,o=parseInt(i.max,10)-1;for(i.outlineLevel&&(i.level=+i.outlineLevel||0),delete i.min,delete i.max,i.width=+i.width,!r&&i.width&&(r=!0,WS(i.width)),Ou(i);s<=o;)t[s++]=Xr(i)}}function NU(t){var e={ref:(t.match(/ref="([^"]*)"/)||[])[1]};return e}var HU=/<(?:\w:)?sheetView(?:[^>a-z][^>]*)?\/?>/;function FU(t,e){e.Views||(e.Views=[{}]),(t.match(HU)||[]).forEach(function(r,n){var i=Ze(r);e.Views[n]||(e.Views[n]={}),+i.zoomScale&&(e.Views[n].zoom=+i.zoomScale),er(i.rightToLeft)&&(e.Views[n].RTL=!0)})}var LU=function(){var t=/<(?:\w+:)?c[ \/>]/,e=/<\/(?:\w+:)?row>/,r=/r=["']([^"']*)["']/,n=/<(?:\w+:)?is>([\S\s]*?)<\/(?:\w+:)?is>/,i=/ref=["']([^"']*)["']/,s=Dd("v"),o=Dd("f");return function(l,c,u,h,d,f){for(var g=0,m="",w=[],C=[],S=0,v=0,T=0,A="",M,E,Y=0,D=0,U,X,G=0,ae=0,ve=Array.isArray(f.CellXf),me,Re=[],Ce=[],_e=Array.isArray(c),p=[],y={},b=!1,x=!!u.sheetStubs,O=l.split(e),_=0,N=O.length;_!=N;++_){m=O[_].trim();var K=m.length;if(K===0)continue;var le=0;e:for(g=0;g<K;++g)switch(m[g]){case">":if(m[g-1]!="/"){++g;break e}if(u&&u.cellStyles){if(E=Ze(m.slice(le,g),!0),Y=E.r!=null?parseInt(E.r,10):Y+1,D=-1,u.sheetRows&&u.sheetRows<Y)continue;y={},b=!1,E.ht&&(b=!0,y.hpt=parseFloat(E.ht),y.hpx=Fd(y.hpt)),E.hidden=="1"&&(b=!0,y.hidden=!0),E.outlineLevel!=null&&(b=!0,y.level=+E.outlineLevel),b&&(p[Y-1]=y)}break;case"<":le=g;break}if(le>=g)break;if(E=Ze(m.slice(le,g),!0),Y=E.r!=null?parseInt(E.r,10):Y+1,D=-1,!(u.sheetRows&&u.sheetRows<Y)){h.s.r>Y-1&&(h.s.r=Y-1),h.e.r<Y-1&&(h.e.r=Y-1),u&&u.cellStyles&&(y={},b=!1,E.ht&&(b=!0,y.hpt=parseFloat(E.ht),y.hpx=Fd(y.hpt)),E.hidden=="1"&&(b=!0,y.hidden=!0),E.outlineLevel!=null&&(b=!0,y.level=+E.outlineLevel),b&&(p[Y-1]=y)),w=m.slice(g).split(t);for(var ce=0;ce!=w.length&&w[ce].trim().charAt(0)=="<";++ce);for(w=w.slice(ce),g=0;g!=w.length;++g)if(m=w[g].trim(),m.length!==0){if(C=m.match(r),S=g,v=0,T=0,m="<c "+(m.slice(0,1)=="<"?">":"")+m,C!=null&&C.length===2){for(S=0,A=C[1],v=0;v!=A.length&&!((T=A.charCodeAt(v)-64)<1||T>26);++v)S=26*S+T;--S,D=S}else++D;for(v=0;v!=m.length&&m.charCodeAt(v)!==62;++v);if(++v,E=Ze(m.slice(0,v),!0),E.r||(E.r=nt({r:Y-1,c:D})),A=m.slice(v),M={t:""},(C=A.match(s))!=null&&C[1]!==""&&(M.v=_t(C[1])),u.cellFormula){if((C=A.match(o))!=null&&C[1]!==""){if(M.f=_t(Yt(C[1])).replace(/\r\n/g,`
  32. `),u.xlfn||(M.f=vR(M.f)),C[0].indexOf('t="array"')>-1)M.F=(A.match(i)||[])[1],M.F.indexOf(":")>-1&&Re.push([mr(M.F),M.F]);else if(C[0].indexOf('t="shared"')>-1){X=Ze(C[0]);var te=_t(Yt(C[1]));u.xlfn||(te=vR(te)),Ce[parseInt(X.si,10)]=[X,te,E.r]}}else(C=A.match(/<f[^>]*\/>/))&&(X=Ze(C[0]),Ce[X.si]&&(M.f=X8(Ce[X.si][1],Ce[X.si][2],E.r)));var ge=Pn(E.r);for(v=0;v<Re.length;++v)ge.r>=Re[v][0].s.r&&ge.r<=Re[v][0].e.r&&ge.c>=Re[v][0].s.c&&ge.c<=Re[v][0].e.c&&(M.F=Re[v][1])}if(E.t==null&&M.v===void 0)if(M.f||M.F)M.v=0,M.t="n";else if(x)M.t="z";else continue;else M.t=E.t||"n";switch(h.s.c>D&&(h.s.c=D),h.e.c<D&&(h.e.c=D),M.t){case"n":if(M.v==""||M.v==null){if(!x)continue;M.t="z"}else M.v=parseFloat(M.v);break;case"s":if(typeof M.v=="undefined"){if(!x)continue;M.t="z"}else U=cd[parseInt(M.v,10)],M.v=U.t,M.r=U.r,u.cellHTML&&(M.h=U.h);break;case"str":M.t="s",M.v=M.v!=null?Yt(M.v):"",u.cellHTML&&(M.h=OS(M.v));break;case"inlineStr":C=A.match(n),M.t="s",C!=null&&(U=BS(C[1]))?(M.v=U.t,u.cellHTML&&(M.h=U.h)):M.v="";break;case"b":M.v=er(M.v);break;case"d":u.cellDates?M.v=Vr(M.v,1):(M.v=kn(Vr(M.v,1)),M.t="n");break;case"e":(!u||u.cellText!==!1)&&(M.w=M.v),M.v=ID[M.v];break}if(G=ae=0,me=null,ve&&E.s!==void 0&&(me=f.CellXf[E.s],me!=null&&(me.numFmtId!=null&&(G=me.numFmtId),u.cellStyles&&me.fillId!=null&&(ae=me.fillId))),ck(M,G,ae,u,d,f),u.cellDates&&ve&&M.t=="n"&&Nu(ot[G])&&(M.t="d",M.v=tp(M.v)),E.cm&&u.xlmeta){var Me=(u.xlmeta.Cell||[])[+E.cm-1];Me&&Me.type=="XLDAPR"&&(M.D=!0)}if(_e){var L=Pn(E.r);c[L.r]||(c[L.r]=[]),c[L.r][L.c]=M}else c[E.r]=M}}}p.length>0&&(c["!rows"]=p)}}();function $U(t,e){var r={},n=t.l+e;r.r=t.read_shift(4),t.l+=4;var i=t.read_shift(2);t.l+=1;var s=t.read_shift(1);return t.l=n,s&7&&(r.level=s&7),s&16&&(r.hidden=!0),s&32&&(r.hpt=i/20),r}var BU=ic;function WU(){}function VU(t,e){var r={},n=t[t.l];return++t.l,r.above=!(n&64),r.left=!(n&128),t.l+=18,r.name=u3(t),r}function UU(t){var e=Hi(t);return[e]}function GU(t){var e=nc(t);return[e]}function YU(t){var e=Hi(t),r=t.read_shift(1);return[e,r,"b"]}function zU(t){var e=nc(t),r=t.read_shift(1);return[e,r,"b"]}function jU(t){var e=Hi(t),r=t.read_shift(1);return[e,r,"e"]}function KU(t){var e=nc(t),r=t.read_shift(1);return[e,r,"e"]}function XU(t){var e=Hi(t),r=t.read_shift(4);return[e,r,"s"]}function qU(t){var e=nc(t),r=t.read_shift(4);return[e,r,"s"]}function ZU(t){var e=Hi(t),r=cn(t);return[e,r,"n"]}function hk(t){var e=nc(t),r=cn(t);return[e,r,"n"]}function JU(t){var e=Hi(t),r=FS(t);return[e,r,"n"]}function QU(t){var e=nc(t),r=FS(t);return[e,r,"n"]}function e5(t){var e=Hi(t),r=NS(t);return[e,r,"is"]}function t5(t){var e=Hi(t),r=hn(t);return[e,r,"str"]}function r5(t){var e=nc(t),r=hn(t);return[e,r,"str"]}function n5(t,e,r){var n=t.l+e,i=Hi(t);i.r=r["!row"];var s=t.read_shift(1),o=[i,s,"b"];if(r.cellFormula){t.l+=2;var a=ip(t,n-t.l,r);o[3]=on(a,null,i,r.supbooks,r)}else t.l=n;return o}function i5(t,e,r){var n=t.l+e,i=Hi(t);i.r=r["!row"];var s=t.read_shift(1),o=[i,s,"e"];if(r.cellFormula){t.l+=2;var a=ip(t,n-t.l,r);o[3]=on(a,null,i,r.supbooks,r)}else t.l=n;return o}function s5(t,e,r){var n=t.l+e,i=Hi(t);i.r=r["!row"];var s=cn(t),o=[i,s,"n"];if(r.cellFormula){t.l+=2;var a=ip(t,n-t.l,r);o[3]=on(a,null,i,r.supbooks,r)}else t.l=n;return o}function o5(t,e,r){var n=t.l+e,i=Hi(t);i.r=r["!row"];var s=hn(t),o=[i,s,"str"];if(r.cellFormula){t.l+=2;var a=ip(t,n-t.l,r);o[3]=on(a,null,i,r.supbooks,r)}else t.l=n;return o}var a5=ic;function l5(t,e){var r=t.l+e,n=ic(t),i=HS(t),s=hn(t),o=hn(t),a=hn(t);t.l=r;var l={rfx:n,relId:i,loc:s,display:a};return o&&(l.Tooltip=o),l}function c5(){}function u5(t,e,r){var n=t.l+e,i=AD(t),s=t.read_shift(1),o=[i];if(o[2]=s,r.cellFormula){var a=mU(t,n-t.l,r);o[1]=a}else t.l=n;return o}function h5(t,e,r){var n=t.l+e,i=ic(t),s=[i];if(r.cellFormula){var o=wU(t,n-t.l,r);s[1]=o,t.l=n}else t.l=n;return s}var d5=["left","right","top","bottom","header","footer"];function f5(t){var e={};return d5.forEach(function(r){e[r]=cn(t)}),e}function g5(t){var e=t.read_shift(2);return t.l+=28,{RTL:e&32}}function m5(){}function p5(){}function w5(t,e,r,n,i,s,o){if(!t)return t;var a=e||{};n||(n={"!id":{}});var l=a.dense?[]:{},c,u={s:{r:2e6,c:2e6},e:{r:0,c:0}},h=!1,d=!1,f,g,m,w,C,S,v,T,A,M=[];a.biff=12,a["!row"]=0;var E=0,Y=!1,D=[],U={},X=a.supbooks||i.supbooks||[[]];if(X.sharedf=U,X.arrayf=D,X.SheetNames=i.SheetNames||i.Sheets.map(function(_e){return _e.name}),!a.supbooks&&(a.supbooks=X,i.Names))for(var G=0;G<i.Names.length;++G)X[0][G+1]=i.Names[G];var ae=[],ve=[],me=!1;sm[16]={n:"BrtShortReal",f:hk};var Re;if(Wo(t,function(p,y,b){if(!d)switch(b){case 148:c=p;break;case 0:f=p,a.sheetRows&&a.sheetRows<=f.r&&(d=!0),T=qr(w=f.r),a["!row"]=f.r,(p.hidden||p.hpt||p.level!=null)&&(p.hpt&&(p.hpx=Fd(p.hpt)),ve[p.r]=p);break;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 13:case 14:case 15:case 16:case 17:case 18:case 62:switch(g={t:p[2]},p[2]){case"n":g.v=p[1];break;case"s":v=cd[p[1]],g.v=v.t,g.r=v.r;break;case"b":g.v=!!p[1];break;case"e":g.v=p[1],a.cellText!==!1&&(g.w=sc[g.v]);break;case"str":g.t="s",g.v=p[1];break;case"is":g.t="s",g.v=p[1].t;break}if((m=o.CellXf[p[0].iStyleRef])&&ck(g,m.numFmtId,null,a,s,o),C=p[0].c==-1?C+1:p[0].c,a.dense?(l[w]||(l[w]=[]),l[w][C]=g):l[Ir(C)+T]=g,a.cellFormula){for(Y=!1,E=0;E<D.length;++E){var x=D[E];f.r>=x[0].s.r&&f.r<=x[0].e.r&&C>=x[0].s.c&&C<=x[0].e.c&&(g.F=bt(x[0]),Y=!0)}!Y&&p.length>3&&(g.f=p[3])}if(u.s.r>f.r&&(u.s.r=f.r),u.s.c>C&&(u.s.c=C),u.e.r<f.r&&(u.e.r=f.r),u.e.c<C&&(u.e.c=C),a.cellDates&&m&&g.t=="n"&&Nu(ot[m.numFmtId])){var O=Pl(g.v);O&&(g.t="d",g.v=new Date(O.y,O.m-1,O.d,O.H,O.M,O.S,O.u))}Re&&(Re.type=="XLDAPR"&&(g.D=!0),Re=void 0);break;case 1:case 12:if(!a.sheetStubs||h)break;g={t:"z",v:void 0},C=p[0].c==-1?C+1:p[0].c,a.dense?(l[w]||(l[w]=[]),l[w][C]=g):l[Ir(C)+T]=g,u.s.r>f.r&&(u.s.r=f.r),u.s.c>C&&(u.s.c=C),u.e.r<f.r&&(u.e.r=f.r),u.e.c<C&&(u.e.c=C),Re&&(Re.type=="XLDAPR"&&(g.D=!0),Re=void 0);break;case 176:M.push(p);break;case 49:Re=((a.xlmeta||{}).Cell||[])[p-1];break;case 494:var _=n["!id"][p.relId];for(_?(p.Target=_.Target,p.loc&&(p.Target+="#"+p.loc),p.Rel=_):p.relId==""&&(p.Target="#"+p.loc),w=p.rfx.s.r;w<=p.rfx.e.r;++w)for(C=p.rfx.s.c;C<=p.rfx.e.c;++C)a.dense?(l[w]||(l[w]=[]),l[w][C]||(l[w][C]={t:"z",v:void 0}),l[w][C].l=p):(S=nt({c:C,r:w}),l[S]||(l[S]={t:"z",v:void 0}),l[S].l=p);break;case 426:if(!a.cellFormula)break;D.push(p),A=a.dense?l[w][C]:l[Ir(C)+T],A.f=on(p[1],u,{r:f.r,c:C},X,a),A.F=bt(p[0]);break;case 427:if(!a.cellFormula)break;U[nt(p[0].s)]=p[1],A=a.dense?l[w][C]:l[Ir(C)+T],A.f=on(p[1],u,{r:f.r,c:C},X,a);break;case 60:if(!a.cellStyles)break;for(;p.e>=p.s;)ae[p.e--]={width:p.w/256,hidden:!!(p.flags&1),level:p.level},me||(me=!0,WS(p.w/256)),Ou(ae[p.e+1]);break;case 161:l["!autofilter"]={ref:bt(p)};break;case 476:l["!margins"]=p;break;case 147:i.Sheets[r]||(i.Sheets[r]={}),p.name&&(i.Sheets[r].CodeName=p.name),(p.above||p.left)&&(l["!outline"]={above:p.above,left:p.left});break;case 137:i.Views||(i.Views=[{}]),i.Views[0]||(i.Views[0]={}),p.RTL&&(i.Views[0].RTL=!0);break;case 485:break;case 64:case 1053:break;case 151:break;case 152:case 175:case 644:case 625:case 562:case 396:case 1112:case 1146:case 471:case 1050:case 649:case 1105:case 589:case 607:case 564:case 1055:case 168:case 174:case 1180:case 499:case 507:case 550:case 171:case 167:case 1177:case 169:case 1181:case 551:case 552:case 661:case 639:case 478:case 537:case 477:case 536:case 1103:case 680:case 1104:case 1024:case 663:case 535:case 678:case 504:case 1043:case 428:case 170:case 3072:case 50:case 2070:case 1045:break;case 35:h=!0;break;case 36:h=!1;break;case 37:h=!0;break;case 38:h=!1;break;default:if(!y.T){if(!h||a.WTF)throw new Error("Unexpected record 0x"+b.toString(16))}}},a),delete a.supbooks,delete a["!row"],!l["!ref"]&&(u.s.r<2e6||c&&(c.e.r>0||c.e.c>0||c.s.r>0||c.s.c>0))&&(l["!ref"]=bt(c||u)),a.sheetRows&&l["!ref"]){var Ce=mr(l["!ref"]);a.sheetRows<=+Ce.e.r&&(Ce.e.r=a.sheetRows-1,Ce.e.r>u.e.r&&(Ce.e.r=u.e.r),Ce.e.r<Ce.s.r&&(Ce.s.r=Ce.e.r),Ce.e.c>u.e.c&&(Ce.e.c=u.e.c),Ce.e.c<Ce.s.c&&(Ce.s.c=Ce.e.c),l["!fullref"]=l["!ref"],l["!ref"]=bt(Ce))}return M.length>0&&(l["!merges"]=M),ae.length>0&&(l["!cols"]=ae),ve.length>0&&(l["!rows"]=ve),l}function v5(t){var e=[],r=t.match(/^<c:numCache>/),n;(t.match(/<c:pt idx="(\d*)">(.*?)<\/c:pt>/mg)||[]).forEach(function(s){var o=s.match(/<c:pt idx="(\d*?)"><c:v>(.*)<\/c:v><\/c:pt>/);!o||(e[+o[1]]=r?+o[2]:o[2])});var i=_t((t.match(/<c:formatCode>([\s\S]*?)<\/c:formatCode>/)||["","General"])[1]);return(t.match(/<c:f>(.*?)<\/c:f>/mg)||[]).forEach(function(s){n=s.replace(/<.*?>/g,"")}),[e,i,n]}function C5(t,e,r,n,i,s){var o=s||{"!type":"chart"};if(!t)return s;var a=0,l=0,c="A",u={s:{r:2e6,c:2e6},e:{r:0,c:0}};return(t.match(/<c:numCache>[\s\S]*?<\/c:numCache>/gm)||[]).forEach(function(h){var d=v5(h);u.s.r=u.s.c=0,u.e.c=a,c=Ir(a),d[0].forEach(function(f,g){o[c+qr(g)]={t:"n",v:f,z:d[1]},l=g}),u.e.r<l&&(u.e.r=l),++a}),a>0&&(o["!ref"]=bt(u)),o}function S5(t,e,r,n,i){if(!t)return t;n||(n={"!id":{}});var s={"!type":"chart","!drawel":null,"!rel":""},o,a=t.match(uk);return a&&US(a[0],s,i,r),(o=t.match(/drawing r:id="(.*?)"/))&&(s["!rel"]=o[1]),n["!id"][s["!rel"]]&&(s["!drawel"]=n["!id"][s["!rel"]]),s}function y5(t,e){t.l+=10;var r=hn(t);return{name:r}}function x5(t,e,r,n,i){if(!t)return t;n||(n={"!id":{}});var s={"!type":"chart","!drawel":null,"!rel":""},o=!1;return Wo(t,function(l,c,u){switch(u){case 550:s["!rel"]=l;break;case 651:i.Sheets[r]||(i.Sheets[r]={}),l.name&&(i.Sheets[r].CodeName=l.name);break;case 562:case 652:case 669:case 679:case 551:case 552:case 476:case 3072:break;case 35:o=!0;break;case 36:o=!1;break;case 37:break;case 38:break;default:if(!(c.T>0)){if(!(c.T<0)){if(!o||e.WTF)throw new Error("Unexpected record 0x"+u.toString(16))}}}},e),n["!id"][s["!rel"]]&&(s["!drawel"]=n["!id"][s["!rel"]]),s}var dk=[["allowRefreshQuery",!1,"bool"],["autoCompressPictures",!0,"bool"],["backupFile",!1,"bool"],["checkCompatibility",!1,"bool"],["CodeName",""],["date1904",!1,"bool"],["defaultThemeVersion",0,"int"],["filterPrivacy",!1,"bool"],["hidePivotFieldList",!1,"bool"],["promptedSolutions",!1,"bool"],["publishItems",!1,"bool"],["refreshAllConnections",!1,"bool"],["saveExternalLinkValues",!0,"bool"],["showBorderUnselectedTables",!0,"bool"],["showInkAnnotation",!0,"bool"],["showObjects","all"],["showPivotChartFilter",!1,"bool"],["updateLinks","userSet"]],b5=[["activeTab",0,"int"],["autoFilterDateGrouping",!0,"bool"],["firstSheet",0,"int"],["minimized",!1,"bool"],["showHorizontalScroll",!0,"bool"],["showSheetTabs",!0,"bool"],["showVerticalScroll",!0,"bool"],["tabRatio",600,"int"],["visibility","visible"]],E5=[],R5=[["calcCompleted","true"],["calcMode","auto"],["calcOnSave","true"],["concurrentCalc","true"],["fullCalcOnLoad","false"],["fullPrecision","true"],["iterate","false"],["iterateCount","100"],["iterateDelta","0.001"],["refMode","A1"]];function bR(t,e){for(var r=0;r!=t.length;++r)for(var n=t[r],i=0;i!=e.length;++i){var s=e[i];if(n[s[0]]==null)n[s[0]]=s[1];else switch(s[2]){case"bool":typeof n[s[0]]=="string"&&(n[s[0]]=er(n[s[0]]));break;case"int":typeof n[s[0]]=="string"&&(n[s[0]]=parseInt(n[s[0]],10));break}}}function ER(t,e){for(var r=0;r!=e.length;++r){var n=e[r];if(t[n[0]]==null)t[n[0]]=n[1];else switch(n[2]){case"bool":typeof t[n[0]]=="string"&&(t[n[0]]=er(t[n[0]]));break;case"int":typeof t[n[0]]=="string"&&(t[n[0]]=parseInt(t[n[0]],10));break}}}function fk(t){ER(t.WBProps,dk),ER(t.CalcPr,R5),bR(t.WBView,b5),bR(t.Sheets,E5),Su.date1904=er(t.WBProps.date1904)}var T5="][*?/\\".split("");function _5(t,e){if(t.length>31){if(e)return!1;throw new Error("Sheet names cannot exceed 31 chars")}var r=!0;return T5.forEach(function(n){if(t.indexOf(n)!=-1){if(!e)throw new Error("Sheet name cannot contain : \\ / ? * [ ]");r=!1}}),r}var A5=/<\w+:workbook/;function M5(t,e){if(!t)throw new Error("Could not find file");var r={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},Names:[],xmlns:""},n=!1,i="xmlns",s={},o=0;if(t.replace(gn,function(l,c){var u=Ze(l);switch(Js(u[0])){case"<?xml":break;case"<workbook":l.match(A5)&&(i="xmlns"+l.match(/<(\w+):/)[1]),r.xmlns=u[i];break;case"</workbook>":break;case"<fileVersion":delete u[0],r.AppVersion=u;break;case"<fileVersion/>":case"</fileVersion>":break;case"<fileSharing":break;case"<fileSharing/>":break;case"<workbookPr":case"<workbookPr/>":dk.forEach(function(h){if(u[h[0]]!=null)switch(h[2]){case"bool":r.WBProps[h[0]]=er(u[h[0]]);break;case"int":r.WBProps[h[0]]=parseInt(u[h[0]],10);break;default:r.WBProps[h[0]]=u[h[0]]}}),u.codeName&&(r.WBProps.CodeName=Yt(u.codeName));break;case"</workbookPr>":break;case"<workbookProtection":break;case"<workbookProtection/>":break;case"<bookViews":case"<bookViews>":case"</bookViews>":break;case"<workbookView":case"<workbookView/>":delete u[0],r.WBView.push(u);break;case"</workbookView>":break;case"<sheets":case"<sheets>":case"</sheets>":break;case"<sheet":switch(u.state){case"hidden":u.Hidden=1;break;case"veryHidden":u.Hidden=2;break;default:u.Hidden=0}delete u.state,u.name=_t(Yt(u.name)),delete u[0],r.Sheets.push(u);break;case"</sheet>":break;case"<functionGroups":case"<functionGroups/>":break;case"<functionGroup":break;case"<externalReferences":case"</externalReferences>":case"<externalReferences>":break;case"<externalReference":break;case"<definedNames/>":break;case"<definedNames>":case"<definedNames":n=!0;break;case"</definedNames>":n=!1;break;case"<definedName":s={},s.Name=Yt(u.name),u.comment&&(s.Comment=u.comment),u.localSheetId&&(s.Sheet=+u.localSheetId),er(u.hidden||"0")&&(s.Hidden=!0),o=c+l.length;break;case"</definedName>":s.Ref=_t(Yt(t.slice(o,c))),r.Names.push(s);break;case"<definedName/>":break;case"<calcPr":delete u[0],r.CalcPr=u;break;case"<calcPr/>":delete u[0],r.CalcPr=u;break;case"</calcPr>":break;case"<oleSize":break;case"<customWorkbookViews>":case"</customWorkbookViews>":case"<customWorkbookViews":break;case"<customWorkbookView":case"</customWorkbookView>":break;case"<pivotCaches>":case"</pivotCaches>":case"<pivotCaches":break;case"<pivotCache":break;case"<smartTagPr":case"<smartTagPr/>":break;case"<smartTagTypes":case"<smartTagTypes>":case"</smartTagTypes>":break;case"<smartTagType":break;case"<webPublishing":case"<webPublishing/>":break;case"<fileRecoveryPr":case"<fileRecoveryPr/>":break;case"<webPublishObjects>":case"<webPublishObjects":case"</webPublishObjects>":break;case"<webPublishObject":break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":n=!0;break;case"</ext>":n=!1;break;case"<ArchID":break;case"<AlternateContent":case"<AlternateContent>":n=!0;break;case"</AlternateContent>":n=!1;break;case"<revisionPtr":break;default:if(!n&&e.WTF)throw new Error("unrecognized "+u[0]+" in workbook")}return l}),jB.indexOf(r.xmlns)===-1)throw new Error("Unknown Namespace: "+r.xmlns);return fk(r),r}function O5(t,e){var r={};return r.Hidden=t.read_shift(4),r.iTabID=t.read_shift(4),r.strRelID=JC(t),r.name=hn(t),r}function I5(t,e){var r={},n=t.read_shift(4);r.defaultThemeVersion=t.read_shift(4);var i=e>8?hn(t):"";return i.length>0&&(r.CodeName=i),r.autoCompressPictures=!!(n&65536),r.backupFile=!!(n&64),r.checkCompatibility=!!(n&4096),r.date1904=!!(n&1),r.filterPrivacy=!!(n&8),r.hidePivotFieldList=!!(n&1024),r.promptedSolutions=!!(n&16),r.publishItems=!!(n&2048),r.refreshAllConnections=!!(n&262144),r.saveExternalLinkValues=!!(n&128),r.showBorderUnselectedTables=!!(n&4),r.showInkAnnotation=!!(n&32),r.showObjects=["all","placeholders","none"][n>>13&3],r.showPivotChartFilter=!!(n&32768),r.updateLinks=["userSet","never","always"][n>>8&3],r}function P5(t,e){var r={};return t.read_shift(4),r.ArchID=t.read_shift(4),t.l+=e-8,r}function D5(t,e,r){var n=t.l+e;t.l+=4,t.l+=1;var i=t.read_shift(4),s=h3(t),o=pU(t,0,r),a=HS(t);t.l=n;var l={Name:s,Ptg:o};return i<268435455&&(l.Sheet=i),a&&(l.Comment=a),l}function k5(t,e){var r={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},xmlns:""},n=[],i=!1;e||(e={}),e.biff=12;var s=[],o=[[]];return o.SheetNames=[],o.XTI=[],sm[16]={n:"BrtFRTArchID$",f:P5},Wo(t,function(l,c,u){switch(u){case 156:o.SheetNames.push(l.name),r.Sheets.push(l);break;case 153:r.WBProps=l;break;case 39:l.Sheet!=null&&(e.SID=l.Sheet),l.Ref=on(l.Ptg,null,null,o,e),delete e.SID,delete l.Ptg,s.push(l);break;case 1036:break;case 357:case 358:case 355:case 667:o[0].length?o.push([u,l]):o[0]=[u,l],o[o.length-1].XTI=[];break;case 362:o.length===0&&(o[0]=[],o[0].XTI=[]),o[o.length-1].XTI=o[o.length-1].XTI.concat(l),o.XTI=o.XTI.concat(l);break;case 361:break;case 2071:case 158:case 143:case 664:case 353:break;case 3072:case 3073:case 534:case 677:case 157:case 610:case 2050:case 155:case 548:case 676:case 128:case 665:case 2128:case 2125:case 549:case 2053:case 596:case 2076:case 2075:case 2082:case 397:case 154:case 1117:case 553:case 2091:break;case 35:n.push(u),i=!0;break;case 36:n.pop(),i=!1;break;case 37:n.push(u),i=!0;break;case 38:n.pop(),i=!1;break;case 16:break;default:if(!c.T){if(!i||e.WTF&&n[n.length-1]!=37&&n[n.length-1]!=35)throw new Error("Unexpected record 0x"+u.toString(16))}}},e),fk(r),r.Names=s,r.supbooks=o,r}function N5(t,e,r){return e.slice(-4)===".bin"?k5(t,r):M5(t,r)}function H5(t,e,r,n,i,s,o,a){return e.slice(-4)===".bin"?w5(t,n,r,i,s,o,a):OU(t,n,r,i,s,o,a)}function F5(t,e,r,n,i,s,o,a){return e.slice(-4)===".bin"?x5(t,n,r,i,s):S5(t,n,r,i,s)}function L5(t,e,r,n,i,s,o,a){return e.slice(-4)===".bin"?z8():j8()}function $5(t,e,r,n,i,s,o,a){return e.slice(-4)===".bin"?G8():Y8()}function B5(t,e,r,n){return e.slice(-4)===".bin"?a8(t,r,n):t8(t,r,n)}function W5(t,e,r){return QD(t,r)}function V5(t,e,r){return e.slice(-4)===".bin"?bV(t,r):yV(t,r)}function U5(t,e,r){return e.slice(-4)===".bin"?W8(t,r):H8(t,r)}function G5(t,e,r){return e.slice(-4)===".bin"?D8(t):I8(t)}function Y5(t,e,r,n){return r.slice(-4)===".bin"?k8(t,e,r,n):void 0}function z5(t,e,r){return e.slice(-4)===".bin"?M8(t,e,r):O8(t,e,r)}var gk=/([\w:]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:'))/g,mk=/([\w:]+)=((?:")(?:[^"]*)(?:")|(?:')(?:[^']*)(?:'))/;function Wi(t,e){var r=t.split(/\s+/),n=[];if(e||(n[0]=r[0]),r.length===1)return n;var i=t.match(gk),s,o,a,l;if(i)for(l=0;l!=i.length;++l)s=i[l].match(mk),(o=s[1].indexOf(":"))===-1?n[s[1]]=s[2].slice(1,s[2].length-1):(s[1].slice(0,6)==="xmlns:"?a="xmlns"+s[1].slice(6):a=s[1].slice(o+1),n[a]=s[2].slice(1,s[2].length-1));return n}function j5(t){var e=t.split(/\s+/),r={};if(e.length===1)return r;var n=t.match(gk),i,s,o,a;if(n)for(a=0;a!=n.length;++a)i=n[a].match(mk),(s=i[1].indexOf(":"))===-1?r[i[1]]=i[2].slice(1,i[2].length-1):(i[1].slice(0,6)==="xmlns:"?o="xmlns"+i[1].slice(6):o=i[1].slice(s+1),r[o]=i[2].slice(1,i[2].length-1));return r}var hd;function K5(t,e){var r=hd[t]||_t(t);return r==="General"?Ul(e):Di(r,e)}function X5(t,e,r,n){var i=n;switch((r[0].match(/dt:dt="([\w.]+)"/)||["",""])[1]){case"boolean":i=er(n);break;case"i2":case"int":i=parseInt(n,10);break;case"r4":case"float":i=parseFloat(n);break;case"date":case"dateTime.tz":i=Vr(n);break;case"i8":case"string":case"fixed":case"uuid":case"bin.base64":break;default:throw new Error("bad custprop:"+r[0])}t[_t(e)]=i}function q5(t,e,r){if(t.t!=="z"){if(!r||r.cellText!==!1)try{t.t==="e"?t.w=t.w||sc[t.v]:e==="General"?t.t==="n"?(t.v|0)===t.v?t.w=t.v.toString(10):t.w=Pd(t.v):t.w=Ul(t.v):t.w=K5(e||"General",t.v)}catch(s){if(r.WTF)throw s}try{var n=hd[e]||e||"General";if(r.cellNF&&(t.z=n),r.cellDates&&t.t=="n"&&Nu(n)){var i=Pl(t.v);i&&(t.t="d",t.v=new Date(i.y,i.m-1,i.d,i.H,i.M,i.S,i.u))}}catch(s){if(r.WTF)throw s}}}function Z5(t,e,r){if(r.cellStyles&&e.Interior){var n=e.Interior;n.Pattern&&(n.patternType=XV[n.Pattern]||n.Pattern)}t[e.ID]=e}function J5(t,e,r,n,i,s,o,a,l,c){var u="General",h=n.StyleID,d={};c=c||{};var f=[],g=0;for(h===void 0&&a&&(h=a.StyleID),h===void 0&&o&&(h=o.StyleID);s[h]!==void 0&&(s[h].nf&&(u=s[h].nf),s[h].Interior&&f.push(s[h].Interior),!!s[h].Parent);)h=s[h].Parent;switch(r.Type){case"Boolean":n.t="b",n.v=er(t);break;case"String":n.t="s",n.r=zE(_t(t)),n.v=t.indexOf("<")>-1?_t(e||t).replace(/<.*?>/g,""):n.r;break;case"DateTime":t.slice(-1)!="Z"&&(t+="Z"),n.v=(Vr(t)-new Date(Date.UTC(1899,11,30)))/(24*60*60*1e3),n.v!==n.v?n.v=_t(t):n.v<60&&(n.v=n.v-1),(!u||u=="General")&&(u="yyyy-mm-dd");case"Number":n.v===void 0&&(n.v=+t),n.t||(n.t="n");break;case"Error":n.t="e",n.v=ID[t],c.cellText!==!1&&(n.w=t);break;default:t==""&&e==""?n.t="z":(n.t="s",n.v=zE(e||t));break}if(q5(n,u,c),c.cellFormula!==!1)if(n.Formula){var m=_t(n.Formula);m.charCodeAt(0)==61&&(m=m.slice(1)),n.f=Cu(m,i),delete n.Formula,n.ArrayRange=="RC"?n.F=Cu("RC:RC",i):n.ArrayRange&&(n.F=Cu(n.ArrayRange,i),l.push([mr(n.F),n.F]))}else for(g=0;g<l.length;++g)i.r>=l[g][0].s.r&&i.r<=l[g][0].e.r&&i.c>=l[g][0].s.c&&i.c<=l[g][0].e.c&&(n.F=l[g][1]);c.cellStyles&&(f.forEach(function(w){!d.patternType&&w.patternType&&(d.patternType=w.patternType)}),n.s=d),n.StyleID!==void 0&&(n.ixfe=n.StyleID)}function Q5(t){t.t=t.v||"",t.t=t.t.replace(/\r\n/g,`
  33. `).replace(/\r/g,`
  34. `),t.v=t.w=t.ixfe=void 0}function dw(t,e){var r=e||{};rD();var n=Kh(IS(t));(r.type=="binary"||r.type=="array"||r.type=="base64")&&(n=Yt(n));var i=n.slice(0,1024).toLowerCase(),s=!1;if(i=i.replace(/".*?"/g,""),(i.indexOf(">")&1023)>Math.min(i.indexOf(",")&1023,i.indexOf(";")&1023)){var o=Xr(r);return o.type="string",Nd.to_workbook(n,o)}if(i.indexOf("<?xml")==-1&&["html","table","head","meta","script","style","div"].forEach(function(Be){i.indexOf("<"+Be)>=0&&(s=!0)}),s)return l9(n,r);hd={"General Number":"General","General Date":ot[22],"Long Date":"dddd, mmmm dd, yyyy","Medium Date":ot[15],"Short Date":ot[14],"Long Time":ot[19],"Medium Time":ot[18],"Short Time":ot[20],Currency:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',Fixed:ot[2],Standard:ot[4],Percent:ot[10],Scientific:ot[11],"Yes/No":'"Yes";"Yes";"No";@',"True/False":'"True";"True";"False";@',"On/Off":'"Yes";"Yes";"No";@'};var a,l=[],c,u={},h=[],d=r.dense?[]:{},f="",g={},m={},w=Wi('<Data ss:Type="String">'),C=0,S=0,v=0,T={s:{r:2e6,c:2e6},e:{r:0,c:0}},A={},M={},E="",Y=0,D=[],U={},X={},G=0,ae=[],ve=[],me={},Re=[],Ce,_e=!1,p=[],y=[],b={},x=0,O=0,_={Sheets:[],WBProps:{date1904:!1}},N={};kd.lastIndex=0,n=n.replace(/<!--([\s\S]*?)-->/mg,"");for(var K="";a=kd.exec(n);)switch(a[3]=(K=a[3]).toLowerCase()){case"data":if(K=="data"){if(a[1]==="/"){if((c=l.pop())[0]!==a[3])throw new Error("Bad state: "+c.join("|"))}else a[0].charAt(a[0].length-2)!=="/"&&l.push([a[3],!0]);break}if(l[l.length-1][1])break;a[1]==="/"?J5(n.slice(C,a.index),E,w,l[l.length-1][0]=="comment"?me:g,{c:S,r:v},A,Re[S],m,p,r):(E="",w=Wi(a[0]),C=a.index+a[0].length);break;case"cell":if(a[1]==="/")if(ve.length>0&&(g.c=ve),(!r.sheetRows||r.sheetRows>v)&&g.v!==void 0&&(r.dense?(d[v]||(d[v]=[]),d[v][S]=g):d[Ir(S)+qr(v)]=g),g.HRef&&(g.l={Target:_t(g.HRef)},g.HRefScreenTip&&(g.l.Tooltip=g.HRefScreenTip),delete g.HRef,delete g.HRefScreenTip),(g.MergeAcross||g.MergeDown)&&(x=S+(parseInt(g.MergeAcross,10)|0),O=v+(parseInt(g.MergeDown,10)|0),D.push({s:{c:S,r:v},e:{c:x,r:O}})),!r.sheetStubs)g.MergeAcross?S=x+1:++S;else if(g.MergeAcross||g.MergeDown){for(var le=S;le<=x;++le)for(var ce=v;ce<=O;++ce)(le>S||ce>v)&&(r.dense?(d[ce]||(d[ce]=[]),d[ce][le]={t:"z"}):d[Ir(le)+qr(ce)]={t:"z"});S=x+1}else++S;else g=j5(a[0]),g.Index&&(S=+g.Index-1),S<T.s.c&&(T.s.c=S),S>T.e.c&&(T.e.c=S),a[0].slice(-2)==="/>"&&++S,ve=[];break;case"row":a[1]==="/"||a[0].slice(-2)==="/>"?(v<T.s.r&&(T.s.r=v),v>T.e.r&&(T.e.r=v),a[0].slice(-2)==="/>"&&(m=Wi(a[0]),m.Index&&(v=+m.Index-1)),S=0,++v):(m=Wi(a[0]),m.Index&&(v=+m.Index-1),b={},(m.AutoFitHeight=="0"||m.Height)&&(b.hpx=parseInt(m.Height,10),b.hpt=JD(b.hpx),y[v]=b),m.Hidden=="1"&&(b.hidden=!0,y[v]=b));break;case"worksheet":if(a[1]==="/"){if((c=l.pop())[0]!==a[3])throw new Error("Bad state: "+c.join("|"));h.push(f),T.s.r<=T.e.r&&T.s.c<=T.e.c&&(d["!ref"]=bt(T),r.sheetRows&&r.sheetRows<=T.e.r&&(d["!fullref"]=d["!ref"],T.e.r=r.sheetRows-1,d["!ref"]=bt(T))),D.length&&(d["!merges"]=D),Re.length>0&&(d["!cols"]=Re),y.length>0&&(d["!rows"]=y),u[f]=d}else T={s:{r:2e6,c:2e6},e:{r:0,c:0}},v=S=0,l.push([a[3],!1]),c=Wi(a[0]),f=_t(c.Name),d=r.dense?[]:{},D=[],p=[],y=[],N={name:f,Hidden:0},_.Sheets.push(N);break;case"table":if(a[1]==="/"){if((c=l.pop())[0]!==a[3])throw new Error("Bad state: "+c.join("|"))}else{if(a[0].slice(-2)=="/>")break;l.push([a[3],!1]),Re=[],_e=!1}break;case"style":a[1]==="/"?Z5(A,M,r):M=Wi(a[0]);break;case"numberformat":M.nf=_t(Wi(a[0]).Format||"General"),hd[M.nf]&&(M.nf=hd[M.nf]);for(var te=0;te!=392&&ot[te]!=M.nf;++te);if(te==392){for(te=57;te!=392;++te)if(ot[te]==null){$l(M.nf,te);break}}break;case"column":if(l[l.length-1][0]!=="table")break;if(Ce=Wi(a[0]),Ce.Hidden&&(Ce.hidden=!0,delete Ce.Hidden),Ce.Width&&(Ce.wpx=parseInt(Ce.Width,10)),!_e&&Ce.wpx>10){_e=!0,In=qD;for(var ge=0;ge<Re.length;++ge)Re[ge]&&Ou(Re[ge])}_e&&Ou(Ce),Re[Ce.Index-1||Re.length]=Ce;for(var Me=0;Me<+Ce.Span;++Me)Re[Re.length]=Xr(Ce);break;case"namedrange":if(a[1]==="/")break;_.Names||(_.Names=[]);var L=Ze(a[0]),Fe={Name:L.Name,Ref:Cu(L.RefersTo.slice(1),{r:0,c:0})};_.Sheets.length>0&&(Fe.Sheet=_.Sheets.length-1),_.Names.push(Fe);break;case"namedcell":break;case"b":break;case"i":break;case"u":break;case"s":break;case"em":break;case"h2":break;case"h3":break;case"sub":break;case"sup":break;case"span":break;case"alignment":break;case"borders":break;case"border":break;case"font":if(a[0].slice(-2)==="/>")break;a[1]==="/"?E+=n.slice(Y,a.index):Y=a.index+a[0].length;break;case"interior":if(!r.cellStyles)break;M.Interior=Wi(a[0]);break;case"protection":break;case"author":case"title":case"description":case"created":case"keywords":case"subject":case"category":case"company":case"lastauthor":case"lastsaved":case"lastprinted":case"version":case"revision":case"totaltime":case"hyperlinkbase":case"manager":case"contentstatus":case"identifier":case"language":case"appname":if(a[0].slice(-2)==="/>")break;a[1]==="/"?H3(U,K,n.slice(G,a.index)):G=a.index+a[0].length;break;case"paragraphs":break;case"styles":case"workbook":if(a[1]==="/"){if((c=l.pop())[0]!==a[3])throw new Error("Bad state: "+c.join("|"))}else l.push([a[3],!1]);break;case"comment":if(a[1]==="/"){if((c=l.pop())[0]!==a[3])throw new Error("Bad state: "+c.join("|"));Q5(me),ve.push(me)}else l.push([a[3],!1]),c=Wi(a[0]),me={a:c.Author};break;case"autofilter":if(a[1]==="/"){if((c=l.pop())[0]!==a[3])throw new Error("Bad state: "+c.join("|"))}else if(a[0].charAt(a[0].length-2)!=="/"){var ue=Wi(a[0]);d["!autofilter"]={ref:Cu(ue.Range).replace(/\$/g,"")},l.push([a[3],!0])}break;case"name":break;case"datavalidation":if(a[1]==="/"){if((c=l.pop())[0]!==a[3])throw new Error("Bad state: "+c.join("|"))}else a[0].charAt(a[0].length-2)!=="/"&&l.push([a[3],!0]);break;case"pixelsperinch":break;case"componentoptions":case"documentproperties":case"customdocumentproperties":case"officedocumentsettings":case"pivottable":case"pivotcache":case"names":case"mapinfo":case"pagebreaks":case"querytable":case"sorting":case"schema":case"conditionalformatting":case"smarttagtype":case"smarttags":case"excelworkbook":case"workbookoptions":case"worksheetoptions":if(a[1]==="/"){if((c=l.pop())[0]!==a[3])throw new Error("Bad state: "+c.join("|"))}else a[0].charAt(a[0].length-2)!=="/"&&l.push([a[3],!0]);break;case"null":break;default:if(l.length==0&&a[3]=="document"||l.length==0&&a[3]=="uof")return OR(n,r);var ze=!0;switch(l[l.length-1][0]){case"officedocumentsettings":switch(a[3]){case"allowpng":break;case"removepersonalinformation":break;case"downloadcomponents":break;case"locationofcomponents":break;case"colors":break;case"color":break;case"index":break;case"rgb":break;case"targetscreensize":break;case"readonlyrecommended":break;default:ze=!1}break;case"componentoptions":switch(a[3]){case"toolbar":break;case"hideofficelogo":break;case"spreadsheetautofit":break;case"label":break;case"caption":break;case"maxheight":break;case"maxwidth":break;case"nextsheetnumber":break;default:ze=!1}break;case"excelworkbook":switch(a[3]){case"date1904":_.WBProps.date1904=!0;break;case"windowheight":break;case"windowwidth":break;case"windowtopx":break;case"windowtopy":break;case"tabratio":break;case"protectstructure":break;case"protectwindow":break;case"protectwindows":break;case"activesheet":break;case"displayinknotes":break;case"firstvisiblesheet":break;case"supbook":break;case"sheetname":break;case"sheetindex":break;case"sheetindexfirst":break;case"sheetindexlast":break;case"dll":break;case"acceptlabelsinformulas":break;case"donotsavelinkvalues":break;case"iteration":break;case"maxiterations":break;case"maxchange":break;case"path":break;case"xct":break;case"count":break;case"selectedsheets":break;case"calculation":break;case"uncalced":break;case"startupprompt":break;case"crn":break;case"externname":break;case"formula":break;case"colfirst":break;case"collast":break;case"wantadvise":break;case"boolean":break;case"error":break;case"text":break;case"ole":break;case"noautorecover":break;case"publishobjects":break;case"donotcalculatebeforesave":break;case"number":break;case"refmoder1c1":break;case"embedsavesmarttags":break;default:ze=!1}break;case"workbookoptions":switch(a[3]){case"owcversion":break;case"height":break;case"width":break;default:ze=!1}break;case"worksheetoptions":switch(a[3]){case"visible":if(a[0].slice(-2)!=="/>")if(a[1]==="/")switch(n.slice(G,a.index)){case"SheetHidden":N.Hidden=1;break;case"SheetVeryHidden":N.Hidden=2;break}else G=a.index+a[0].length;break;case"header":d["!margins"]||ud(d["!margins"]={},"xlml"),isNaN(+Ze(a[0]).Margin)||(d["!margins"].header=+Ze(a[0]).Margin);break;case"footer":d["!margins"]||ud(d["!margins"]={},"xlml"),isNaN(+Ze(a[0]).Margin)||(d["!margins"].footer=+Ze(a[0]).Margin);break;case"pagemargins":var Ie=Ze(a[0]);d["!margins"]||ud(d["!margins"]={},"xlml"),isNaN(+Ie.Top)||(d["!margins"].top=+Ie.Top),isNaN(+Ie.Left)||(d["!margins"].left=+Ie.Left),isNaN(+Ie.Right)||(d["!margins"].right=+Ie.Right),isNaN(+Ie.Bottom)||(d["!margins"].bottom=+Ie.Bottom);break;case"displayrighttoleft":_.Views||(_.Views=[]),_.Views[0]||(_.Views[0]={}),_.Views[0].RTL=!0;break;case"freezepanes":break;case"frozennosplit":break;case"splithorizontal":case"splitvertical":break;case"donotdisplaygridlines":break;case"activerow":break;case"activecol":break;case"toprowbottompane":break;case"leftcolumnrightpane":break;case"unsynced":break;case"print":break;case"printerrors":break;case"panes":break;case"scale":break;case"pane":break;case"number":break;case"layout":break;case"pagesetup":break;case"selected":break;case"protectobjects":break;case"enableselection":break;case"protectscenarios":break;case"validprinterinfo":break;case"horizontalresolution":break;case"verticalresolution":break;case"numberofcopies":break;case"activepane":break;case"toprowvisible":break;case"leftcolumnvisible":break;case"fittopage":break;case"rangeselection":break;case"papersizeindex":break;case"pagelayoutzoom":break;case"pagebreakzoom":break;case"filteron":break;case"fitwidth":break;case"fitheight":break;case"commentslayout":break;case"zoom":break;case"lefttoright":break;case"gridlines":break;case"allowsort":break;case"allowfilter":break;case"allowinsertrows":break;case"allowdeleterows":break;case"allowinsertcols":break;case"allowdeletecols":break;case"allowinserthyperlinks":break;case"allowformatcells":break;case"allowsizecols":break;case"allowsizerows":break;case"nosummaryrowsbelowdetail":d["!outline"]||(d["!outline"]={}),d["!outline"].above=!0;break;case"tabcolorindex":break;case"donotdisplayheadings":break;case"showpagelayoutzoom":break;case"nosummarycolumnsrightdetail":d["!outline"]||(d["!outline"]={}),d["!outline"].left=!0;break;case"blackandwhite":break;case"donotdisplayzeros":break;case"displaypagebreak":break;case"rowcolheadings":break;case"donotdisplayoutline":break;case"noorientation":break;case"allowusepivottables":break;case"zeroheight":break;case"viewablerange":break;case"selection":break;case"protectcontents":break;default:ze=!1}break;case"pivottable":case"pivotcache":switch(a[3]){case"immediateitemsondrop":break;case"showpagemultipleitemlabel":break;case"compactrowindent":break;case"location":break;case"pivotfield":break;case"orientation":break;case"layoutform":break;case"layoutsubtotallocation":break;case"layoutcompactrow":break;case"position":break;case"pivotitem":break;case"datatype":break;case"datafield":break;case"sourcename":break;case"parentfield":break;case"ptlineitems":break;case"ptlineitem":break;case"countofsameitems":break;case"item":break;case"itemtype":break;case"ptsource":break;case"cacheindex":break;case"consolidationreference":break;case"filename":break;case"reference":break;case"nocolumngrand":break;case"norowgrand":break;case"blanklineafteritems":break;case"hidden":break;case"subtotal":break;case"basefield":break;case"mapchilditems":break;case"function":break;case"refreshonfileopen":break;case"printsettitles":break;case"mergelabels":break;case"defaultversion":break;case"refreshname":break;case"refreshdate":break;case"refreshdatecopy":break;case"versionlastrefresh":break;case"versionlastupdate":break;case"versionupdateablemin":break;case"versionrefreshablemin":break;case"calculation":break;default:ze=!1}break;case"pagebreaks":switch(a[3]){case"colbreaks":break;case"colbreak":break;case"rowbreaks":break;case"rowbreak":break;case"colstart":break;case"colend":break;case"rowend":break;default:ze=!1}break;case"autofilter":switch(a[3]){case"autofiltercolumn":break;case"autofiltercondition":break;case"autofilterand":break;case"autofilteror":break;default:ze=!1}break;case"querytable":switch(a[3]){case"id":break;case"autoformatfont":break;case"autoformatpattern":break;case"querysource":break;case"querytype":break;case"enableredirections":break;case"refreshedinxl9":break;case"urlstring":break;case"htmltables":break;case"connection":break;case"commandtext":break;case"refreshinfo":break;case"notitles":break;case"nextid":break;case"columninfo":break;case"overwritecells":break;case"donotpromptforfile":break;case"textwizardsettings":break;case"source":break;case"number":break;case"decimal":break;case"thousandseparator":break;case"trailingminusnumbers":break;case"formatsettings":break;case"fieldtype":break;case"delimiters":break;case"tab":break;case"comma":break;case"autoformatname":break;case"versionlastedit":break;case"versionlastrefresh":break;default:ze=!1}break;case"datavalidation":switch(a[3]){case"range":break;case"type":break;case"min":break;case"max":break;case"sort":break;case"descending":break;case"order":break;case"casesensitive":break;case"value":break;case"errorstyle":break;case"errormessage":break;case"errortitle":break;case"inputmessage":break;case"inputtitle":break;case"combohide":break;case"inputhide":break;case"condition":break;case"qualifier":break;case"useblank":break;case"value1":break;case"value2":break;case"format":break;case"cellrangelist":break;default:ze=!1}break;case"sorting":case"conditionalformatting":switch(a[3]){case"range":break;case"type":break;case"min":break;case"max":break;case"sort":break;case"descending":break;case"order":break;case"casesensitive":break;case"value":break;case"errorstyle":break;case"errormessage":break;case"errortitle":break;case"cellrangelist":break;case"inputmessage":break;case"inputtitle":break;case"combohide":break;case"inputhide":break;case"condition":break;case"qualifier":break;case"useblank":break;case"value1":break;case"value2":break;case"format":break;default:ze=!1}break;case"mapinfo":case"schema":case"data":switch(a[3]){case"map":break;case"entry":break;case"range":break;case"xpath":break;case"field":break;case"xsdtype":break;case"filteron":break;case"aggregate":break;case"elementtype":break;case"attributetype":break;case"schema":case"element":case"complextype":case"datatype":case"all":case"attribute":case"extends":break;case"row":break;default:ze=!1}break;case"smarttags":break;default:ze=!1;break}if(ze||a[3].match(/!\[CDATA/))break;if(!l[l.length-1][1])throw"Unrecognized tag: "+a[3]+"|"+l.join("|");if(l[l.length-1][0]==="customdocumentproperties"){if(a[0].slice(-2)==="/>")break;a[1]==="/"?X5(X,K,ae,n.slice(G,a.index)):(ae=a,G=a.index+a[0].length);break}if(r.WTF)throw"Unrecognized tag: "+a[3]+"|"+l.join("|")}var we={};return!r.bookSheets&&!r.bookProps&&(we.Sheets=u),we.SheetNames=h,we.Workbook=_,we.SSF=Xr(ot),we.Props=U,we.Custprops=X,we}function r1(t,e){switch(zS(e=e||{}),e.type||"base64"){case"base64":return dw(gi(t),e);case"binary":case"buffer":case"file":return dw(t,e);case"array":return dw(rc(t),e)}}function e9(t){var e={},r=t.content;if(r.l=28,e.AnsiUserType=r.read_shift(0,"lpstr-ansi"),e.AnsiClipboardFormat=g3(r),r.length-r.l<=4)return e;var n=r.read_shift(4);if(n==0||n>40||(r.l-=4,e.Reserved1=r.read_shift(0,"lpstr-ansi"),r.length-r.l<=4)||(n=r.read_shift(4),n!==1907505652)||(e.UnicodeClipboardFormat=m3(r),n=r.read_shift(4),n==0||n>40))return e;r.l-=4,e.Reserved2=r.read_shift(0,"lpwstr")}var t9=[60,1084,2066,2165,2175];function r9(t,e,r,n,i){var s=n,o=[],a=r.slice(r.l,r.l+s);if(i&&i.enc&&i.enc.insitu&&a.length>0)switch(t){case 9:case 521:case 1033:case 2057:case 47:case 405:case 225:case 406:case 312:case 404:case 10:break;case 133:break;default:i.enc.insitu(a)}o.push(a),r.l+=s;for(var l=To(r,r.l),c=n1[l],u=0;c!=null&&t9.indexOf(l)>-1;)s=To(r,r.l+2),u=r.l+4,l==2066?u+=4:(l==2165||l==2175)&&(u+=12),a=r.slice(u,r.l+4+s),o.push(a),r.l+=4+s,c=n1[l=To(r,r.l)];var h=ma(o);Kr(h,0);var d=0;h.lens=[];for(var f=0;f<o.length;++f)h.lens.push(d),d+=o[f].length;if(h.length<n)throw"XLS Record 0x"+t.toString(16)+" Truncated: "+h.length+" < "+n;return e.f(h,h.length,i)}function Ss(t,e,r){if(t.t!=="z"&&!!t.XF){var n=0;try{n=t.z||t.XF.numFmtId||0,e.cellNF&&(t.z=ot[n])}catch(s){if(e.WTF)throw s}if(!e||e.cellText!==!1)try{t.t==="e"?t.w=t.w||sc[t.v]:n===0||n=="General"?t.t==="n"?(t.v|0)===t.v?t.w=t.v.toString(10):t.w=Pd(t.v):t.w=Ul(t.v):t.w=Di(n,t.v,{date1904:!!r,dateNF:e&&e.dateNF})}catch(s){if(e.WTF)throw s}if(e.cellDates&&n&&t.t=="n"&&Nu(ot[n]||String(n))){var i=Pl(t.v);i&&(t.t="d",t.v=new Date(i.y,i.m-1,i.d,i.H,i.M,i.S,i.u))}}}function Xf(t,e,r){return{v:t,ixfe:e,t:r}}function n9(t,e){var r={opts:{}},n={},i=e.dense?[]:{},s={},o={},a=null,l=[],c="",u={},h,d="",f,g,m,w,C={},S=[],v,T,A=[],M=[],E={Sheets:[],WBProps:{date1904:!1},Views:[{}]},Y={},D=function(J){return J<8?Bl[J]:J<64&&M[J-8]||Bl[J]},U=function(J,Se,Oe){var Pe=Se.XF.data;if(!(!Pe||!Pe.patternType||!Oe||!Oe.cellStyles)){Se.s={},Se.s.patternType=Pe.patternType;var je;(je=Hd(D(Pe.icvFore)))&&(Se.s.fgColor={rgb:je}),(je=Hd(D(Pe.icvBack)))&&(Se.s.bgColor={rgb:je})}},X=function(J,Se,Oe){if(!(b>1)&&!(Oe.sheetRows&&J.r>=Oe.sheetRows)){if(Oe.cellStyles&&Se.XF&&Se.XF.data&&U(J,Se,Oe),delete Se.ixfe,delete Se.XF,h=J,d=nt(J),(!o||!o.s||!o.e)&&(o={s:{r:0,c:0},e:{r:0,c:0}}),J.r<o.s.r&&(o.s.r=J.r),J.c<o.s.c&&(o.s.c=J.c),J.r+1>o.e.r&&(o.e.r=J.r+1),J.c+1>o.e.c&&(o.e.c=J.c+1),Oe.cellFormula&&Se.f){for(var Pe=0;Pe<S.length;++Pe)if(!(S[Pe][0].s.c>J.c||S[Pe][0].s.r>J.r)&&!(S[Pe][0].e.c<J.c||S[Pe][0].e.r<J.r)){Se.F=bt(S[Pe][0]),(S[Pe][0].s.c!=J.c||S[Pe][0].s.r!=J.r)&&delete Se.f,Se.f&&(Se.f=""+on(S[Pe][1],o,J,p,G));break}}Oe.dense?(i[J.r]||(i[J.r]=[]),i[J.r][J.c]=Se):i[d]=Se}},G={enc:!1,sbcch:0,snames:[],sharedf:C,arrayf:S,rrtabid:[],lastuser:"",biff:8,codepage:0,winlocked:0,cellStyles:!!e&&!!e.cellStyles,WTF:!!e&&!!e.wtf};e.password&&(G.password=e.password);var ae,ve=[],me=[],Re=[],Ce=[],_e=!1,p=[];p.SheetNames=G.snames,p.sharedf=G.sharedf,p.arrayf=G.arrayf,p.names=[],p.XTI=[];var y=0,b=0,x=0,O=[],_=[],N;G.codepage=1200,as(1200);for(var K=!1;t.l<t.length-1;){var le=t.l,ce=t.read_shift(2);if(ce===0&&y===10)break;var te=t.l===t.length?0:t.read_shift(2),ge=n1[ce];if(ge&&ge.f){if(e.bookSheets&&y===133&&ce!==133)break;if(y=ce,ge.r===2||ge.r==12){var Me=t.read_shift(2);if(te-=2,!G.enc&&Me!==ce&&((Me&255)<<8|Me>>8)!==ce)throw new Error("rt mismatch: "+Me+"!="+ce);ge.r==12&&(t.l+=10,te-=10)}var L={};if(ce===10?L=ge.f(t,te,G):L=r9(ce,ge,t,te,G),b==0&&[9,521,1033,2057].indexOf(y)===-1)continue;switch(ce){case 34:r.opts.Date1904=E.WBProps.date1904=L;break;case 134:r.opts.WriteProtect=!0;break;case 47:if(G.enc||(t.l=0),G.enc=L,!e.password)throw new Error("File is password-protected");if(L.valid==null)throw new Error("Encryption scheme unsupported");if(!L.valid)throw new Error("Password is incorrect");break;case 92:G.lastuser=L;break;case 66:var Fe=Number(L);switch(Fe){case 21010:Fe=1200;break;case 32768:Fe=1e4;break;case 32769:Fe=1252;break}as(G.codepage=Fe),K=!0;break;case 317:G.rrtabid=L;break;case 25:G.winlocked=L;break;case 439:r.opts.RefreshAll=L;break;case 12:r.opts.CalcCount=L;break;case 16:r.opts.CalcDelta=L;break;case 17:r.opts.CalcIter=L;break;case 13:r.opts.CalcMode=L;break;case 14:r.opts.CalcPrecision=L;break;case 95:r.opts.CalcSaveRecalc=L;break;case 15:G.CalcRefMode=L;break;case 2211:r.opts.FullCalc=L;break;case 129:L.fDialog&&(i["!type"]="dialog"),L.fBelow||((i["!outline"]||(i["!outline"]={})).above=!0),L.fRight||((i["!outline"]||(i["!outline"]={})).left=!0);break;case 224:A.push(L);break;case 430:p.push([L]),p[p.length-1].XTI=[];break;case 35:case 547:p[p.length-1].push(L);break;case 24:case 536:N={Name:L.Name,Ref:on(L.rgce,o,null,p,G)},L.itab>0&&(N.Sheet=L.itab-1),p.names.push(N),p[0]||(p[0]=[],p[0].XTI=[]),p[p.length-1].push(L),L.Name=="_xlnm._FilterDatabase"&&L.itab>0&&L.rgce&&L.rgce[0]&&L.rgce[0][0]&&L.rgce[0][0][0]=="PtgArea3d"&&(_[L.itab-1]={ref:bt(L.rgce[0][0][1][2])});break;case 22:G.ExternCount=L;break;case 23:p.length==0&&(p[0]=[],p[0].XTI=[]),p[p.length-1].XTI=p[p.length-1].XTI.concat(L),p.XTI=p.XTI.concat(L);break;case 2196:if(G.biff<8)break;N!=null&&(N.Comment=L[1]);break;case 18:i["!protect"]=L;break;case 19:L!==0&&G.WTF&&console.error("Password verifier: "+L);break;case 133:s[L.pos]=L,G.snames.push(L.name);break;case 10:{if(--b)break;if(o.e){if(o.e.r>0&&o.e.c>0){if(o.e.r--,o.e.c--,i["!ref"]=bt(o),e.sheetRows&&e.sheetRows<=o.e.r){var ue=o.e.r;o.e.r=e.sheetRows-1,i["!fullref"]=i["!ref"],i["!ref"]=bt(o),o.e.r=ue}o.e.r++,o.e.c++}ve.length>0&&(i["!merges"]=ve),me.length>0&&(i["!objects"]=me),Re.length>0&&(i["!cols"]=Re),Ce.length>0&&(i["!rows"]=Ce),E.Sheets.push(Y)}c===""?u=i:n[c]=i,i=e.dense?[]:{}}break;case 9:case 521:case 1033:case 2057:{if(G.biff===8&&(G.biff={9:2,521:3,1033:4}[ce]||{512:2,768:3,1024:4,1280:5,1536:8,2:2,7:2}[L.BIFFVer]||8),G.biffguess=L.BIFFVer==0,L.BIFFVer==0&&L.dt==4096&&(G.biff=5,K=!0,as(G.codepage=28591)),G.biff==8&&L.BIFFVer==0&&L.dt==16&&(G.biff=2),b++)break;if(i=e.dense?[]:{},G.biff<8&&!K&&(K=!0,as(G.codepage=e.codepage||1252)),G.biff<5||L.BIFFVer==0&&L.dt==4096){c===""&&(c="Sheet1"),o={s:{r:0,c:0},e:{r:0,c:0}};var ze={pos:t.l-te,name:c};s[ze.pos]=ze,G.snames.push(c)}else c=(s[le]||{name:""}).name;L.dt==32&&(i["!type"]="chart"),L.dt==64&&(i["!type"]="macro"),ve=[],me=[],G.arrayf=S=[],Re=[],Ce=[],_e=!1,Y={Hidden:(s[le]||{hs:0}).hs,name:c}}break;case 515:case 3:case 2:i["!type"]=="chart"&&(e.dense?(i[L.r]||[])[L.c]:i[nt({c:L.c,r:L.r})])&&++L.c,v={ixfe:L.ixfe,XF:A[L.ixfe]||{},v:L.val,t:"n"},x>0&&(v.z=O[v.ixfe>>8&63]),Ss(v,e,r.opts.Date1904),X({c:L.c,r:L.r},v,e);break;case 5:case 517:v={ixfe:L.ixfe,XF:A[L.ixfe],v:L.val,t:L.t},x>0&&(v.z=O[v.ixfe>>8&63]),Ss(v,e,r.opts.Date1904),X({c:L.c,r:L.r},v,e);break;case 638:v={ixfe:L.ixfe,XF:A[L.ixfe],v:L.rknum,t:"n"},x>0&&(v.z=O[v.ixfe>>8&63]),Ss(v,e,r.opts.Date1904),X({c:L.c,r:L.r},v,e);break;case 189:for(var Ie=L.c;Ie<=L.C;++Ie){var we=L.rkrec[Ie-L.c][0];v={ixfe:we,XF:A[we],v:L.rkrec[Ie-L.c][1],t:"n"},x>0&&(v.z=O[v.ixfe>>8&63]),Ss(v,e,r.opts.Date1904),X({c:Ie,r:L.r},v,e)}break;case 6:case 518:case 1030:{if(L.val=="String"){a=L;break}if(v=Xf(L.val,L.cell.ixfe,L.tt),v.XF=A[v.ixfe],e.cellFormula){var Be=L.formula;if(Be&&Be[0]&&Be[0][0]&&Be[0][0][0]=="PtgExp"){var Le=Be[0][0][1][0],I=Be[0][0][1][1],F=nt({r:Le,c:I});C[F]?v.f=""+on(L.formula,o,L.cell,p,G):v.F=((e.dense?(i[Le]||[])[I]:i[F])||{}).F}else v.f=""+on(L.formula,o,L.cell,p,G)}x>0&&(v.z=O[v.ixfe>>8&63]),Ss(v,e,r.opts.Date1904),X(L.cell,v,e),a=L}break;case 7:case 519:if(a)a.val=L,v=Xf(L,a.cell.ixfe,"s"),v.XF=A[v.ixfe],e.cellFormula&&(v.f=""+on(a.formula,o,a.cell,p,G)),x>0&&(v.z=O[v.ixfe>>8&63]),Ss(v,e,r.opts.Date1904),X(a.cell,v,e),a=null;else throw new Error("String record expects Formula");break;case 33:case 545:{S.push(L);var z=nt(L[0].s);if(f=e.dense?(i[L[0].s.r]||[])[L[0].s.c]:i[z],e.cellFormula&&f){if(!a||!z||!f)break;f.f=""+on(L[1],o,L[0],p,G),f.F=bt(L[0])}}break;case 1212:{if(!e.cellFormula)break;if(d){if(!a)break;C[nt(a.cell)]=L[0],f=e.dense?(i[a.cell.r]||[])[a.cell.c]:i[nt(a.cell)],(f||{}).f=""+on(L[0],o,h,p,G)}}break;case 253:v=Xf(l[L.isst].t,L.ixfe,"s"),l[L.isst].h&&(v.h=l[L.isst].h),v.XF=A[v.ixfe],x>0&&(v.z=O[v.ixfe>>8&63]),Ss(v,e,r.opts.Date1904),X({c:L.c,r:L.r},v,e);break;case 513:e.sheetStubs&&(v={ixfe:L.ixfe,XF:A[L.ixfe],t:"z"},x>0&&(v.z=O[v.ixfe>>8&63]),Ss(v,e,r.opts.Date1904),X({c:L.c,r:L.r},v,e));break;case 190:if(e.sheetStubs)for(var se=L.c;se<=L.C;++se){var q=L.ixfe[se-L.c];v={ixfe:q,XF:A[q],t:"z"},x>0&&(v.z=O[v.ixfe>>8&63]),Ss(v,e,r.opts.Date1904),X({c:se,r:L.r},v,e)}break;case 214:case 516:case 4:v=Xf(L.val,L.ixfe,"s"),v.XF=A[v.ixfe],x>0&&(v.z=O[v.ixfe>>8&63]),Ss(v,e,r.opts.Date1904),X({c:L.c,r:L.r},v,e);break;case 0:case 512:b===1&&(o=L);break;case 252:l=L;break;case 1054:if(G.biff==4){O[x++]=L[1];for(var ie=0;ie<x+163&&ot[ie]!=L[1];++ie);ie>=163&&$l(L[1],x+163)}else $l(L[1],L[0]);break;case 30:{O[x++]=L;for(var Q=0;Q<x+163&&ot[Q]!=L;++Q);Q>=163&&$l(L,x+163)}break;case 229:ve=ve.concat(L);break;case 93:me[L.cmo[0]]=G.lastobj=L;break;case 438:G.lastobj.TxO=L;break;case 127:G.lastobj.ImData=L;break;case 440:for(w=L[0].s.r;w<=L[0].e.r;++w)for(m=L[0].s.c;m<=L[0].e.c;++m)f=e.dense?(i[w]||[])[m]:i[nt({c:m,r:w})],f&&(f.l=L[1]);break;case 2048:for(w=L[0].s.r;w<=L[0].e.r;++w)for(m=L[0].s.c;m<=L[0].e.c;++m)f=e.dense?(i[w]||[])[m]:i[nt({c:m,r:w})],f&&f.l&&(f.l.Tooltip=L[1]);break;case 28:{if(G.biff<=5&&G.biff>=2)break;f=e.dense?(i[L[0].r]||[])[L[0].c]:i[nt(L[0])];var ee=me[L[2]];f||(e.dense?(i[L[0].r]||(i[L[0].r]=[]),f=i[L[0].r][L[0].c]={t:"z"}):f=i[nt(L[0])]={t:"z"},o.e.r=Math.max(o.e.r,L[0].r),o.s.r=Math.min(o.s.r,L[0].r),o.e.c=Math.max(o.e.c,L[0].c),o.s.c=Math.min(o.s.c,L[0].c)),f.c||(f.c=[]),g={a:L[1],t:ee.TxO.t},f.c.push(g)}break;case 2173:R8(A[L.ixfe],L.ext);break;case 125:{if(!G.cellStyles)break;for(;L.e>=L.s;)Re[L.e--]={width:L.w/256,level:L.level||0,hidden:!!(L.flags&1)},_e||(_e=!0,WS(L.w/256)),Ou(Re[L.e+1])}break;case 520:{var oe={};L.level!=null&&(Ce[L.r]=oe,oe.level=L.level),L.hidden&&(Ce[L.r]=oe,oe.hidden=!0),L.hpt&&(Ce[L.r]=oe,oe.hpt=L.hpt,oe.hpx=Fd(L.hpt))}break;case 38:case 39:case 40:case 41:i["!margins"]||ud(i["!margins"]={}),i["!margins"][{38:"left",39:"right",40:"top",41:"bottom"}[ce]]=L;break;case 161:i["!margins"]||ud(i["!margins"]={}),i["!margins"].header=L.header,i["!margins"].footer=L.footer;break;case 574:L.RTL&&(E.Views[0].RTL=!0);break;case 146:M=L;break;case 2198:ae=L;break;case 140:T=L;break;case 442:c?Y.CodeName=L||Y.name:E.WBProps.CodeName=L||"ThisWorkbook";break}}else ge||console.error("Missing Info for XLS Record 0x"+ce.toString(16)),t.l+=te}return r.SheetNames=Xs(s).sort(function(ne,J){return Number(ne)-Number(J)}).map(function(ne){return s[ne].name}),e.bookSheets||(r.Sheets=n),!r.SheetNames.length&&u["!ref"]?(r.SheetNames.push("Sheet1"),r.Sheets&&(r.Sheets.Sheet1=u)):r.Preamble=u,r.Sheets&&_.forEach(function(ne,J){r.Sheets[r.SheetNames[J]]["!autofilter"]=ne}),r.Strings=l,r.SSF=Xr(ot),G.enc&&(r.Encryption=G.enc),ae&&(r.Themes=ae),r.Metadata={},T!==void 0&&(r.Metadata.Country=T),p.names.length>0&&(E.Names=p.names),r.Workbook=E,r}var RR={SI:"e0859ff2f94f6810ab9108002b27b3d9",DSI:"02d5cdd59c2e1b10939708002b2cf9ae",UDI:"05d5cdd59c2e1b10939708002b2cf9ae"};function i9(t,e,r){var n=xt.find(t,"/!DocumentSummaryInformation");if(n&&n.size>0)try{var i=lR(n,y3,RR.DSI);for(var s in i)e[s]=i[s]}catch(c){if(r.WTF)throw c}var o=xt.find(t,"/!SummaryInformation");if(o&&o.size>0)try{var a=lR(o,x3,RR.SI);for(var l in a)e[l]==null&&(e[l]=a[l])}catch(c){if(r.WTF)throw c}e.HeadingPairs&&e.TitlesOfParts&&(DD(e.HeadingPairs,e.TitlesOfParts,e,r),delete e.HeadingPairs,delete e.TitlesOfParts)}function pk(t,e){e||(e={}),zS(e),G2(),e.codepage&&ES(e.codepage);var r,n;if(t.FullPaths){if(xt.find(t,"/encryption"))throw new Error("File is password-protected");r=xt.find(t,"!CompObj"),n=xt.find(t,"/Workbook")||xt.find(t,"/Book")}else{switch(e.type){case"base64":t=os(gi(t));break;case"binary":t=os(t);break;case"buffer":break;case"array":Array.isArray(t)||(t=Array.prototype.slice.call(t));break}Kr(t,0),n={content:t}}var i,s;if(r&&e9(r),e.bookProps&&!e.bookSheets)i={};else{var o=St?"buffer":"array";if(n&&n.content)i=n9(n.content,e);else if((s=xt.find(t,"PerfectOffice_MAIN"))&&s.content)i=ld.to_workbook(s.content,(e.type=o,e));else if((s=xt.find(t,"NativeContent_MAIN"))&&s.content)i=ld.to_workbook(s.content,(e.type=o,e));else throw(s=xt.find(t,"MN0"))&&s.content?new Error("Unsupported Works 4 for Mac file"):new Error("Cannot find Workbook stream");e.bookVBA&&t.FullPaths&&xt.find(t,"/_VBA_PROJECT_CUR/VBA/dir")&&(i.vbaraw=U8(t))}var a={};return t.FullPaths&&i9(t,a,e),i.Props=i.Custprops=a,e.bookFiles&&(i.cfb=t),i}var sm={0:{f:$U},1:{f:UU},2:{f:JU},3:{f:jU},4:{f:YU},5:{f:ZU},6:{f:t5},7:{f:XU},8:{f:o5},9:{f:s5},10:{f:n5},11:{f:i5},12:{f:GU},13:{f:QU},14:{f:KU},15:{f:zU},16:{f:hk},17:{f:r5},18:{f:qU},19:{f:NS},20:{},21:{},22:{},23:{},24:{},25:{},26:{},27:{},28:{},29:{},30:{},31:{},32:{},33:{},34:{},35:{T:1},36:{T:-1},37:{T:1},38:{T:-1},39:{f:D5},40:{},42:{},43:{f:n8},44:{f:r8},45:{f:i8},46:{f:o8},47:{f:s8},48:{},49:{f:a3},50:{},51:{f:_8},52:{T:1},53:{T:-1},54:{T:1},55:{T:-1},56:{T:1},57:{T:-1},58:{},59:{},60:{f:YD},62:{f:e5},63:{f:P8},64:{f:m5},65:{},66:{},67:{},68:{},69:{},70:{},128:{},129:{T:1},130:{T:-1},131:{T:1,f:fn,p:0},132:{T:-1},133:{T:1},134:{T:-1},135:{T:1},136:{T:-1},137:{T:1,f:g5},138:{T:-1},139:{T:1},140:{T:-1},141:{T:1},142:{T:-1},143:{T:1},144:{T:-1},145:{T:1},146:{T:-1},147:{f:VU},148:{f:BU,p:16},151:{f:c5},152:{},153:{f:I5},154:{},155:{},156:{f:O5},157:{},158:{},159:{T:1,f:xV},160:{T:-1},161:{T:1,f:ic},162:{T:-1},163:{T:1},164:{T:-1},165:{T:1},166:{T:-1},167:{},168:{},169:{},170:{},171:{},172:{T:1},173:{T:-1},174:{},175:{},176:{f:a5},177:{T:1},178:{T:-1},179:{T:1},180:{T:-1},181:{T:1},182:{T:-1},183:{T:1},184:{T:-1},185:{T:1},186:{T:-1},187:{T:1},188:{T:-1},189:{T:1},190:{T:-1},191:{T:1},192:{T:-1},193:{T:1},194:{T:-1},195:{T:1},196:{T:-1},197:{T:1},198:{T:-1},199:{T:1},200:{T:-1},201:{T:1},202:{T:-1},203:{T:1},204:{T:-1},205:{T:1},206:{T:-1},207:{T:1},208:{T:-1},209:{T:1},210:{T:-1},211:{T:1},212:{T:-1},213:{T:1},214:{T:-1},215:{T:1},216:{T:-1},217:{T:1},218:{T:-1},219:{T:1},220:{T:-1},221:{T:1},222:{T:-1},223:{T:1},224:{T:-1},225:{T:1},226:{T:-1},227:{T:1},228:{T:-1},229:{T:1},230:{T:-1},231:{T:1},232:{T:-1},233:{T:1},234:{T:-1},235:{T:1},236:{T:-1},237:{T:1},238:{T:-1},239:{T:1},240:{T:-1},241:{T:1},242:{T:-1},243:{T:1},244:{T:-1},245:{T:1},246:{T:-1},247:{T:1},248:{T:-1},249:{T:1},250:{T:-1},251:{T:1},252:{T:-1},253:{T:1},254:{T:-1},255:{T:1},256:{T:-1},257:{T:1},258:{T:-1},259:{T:1},260:{T:-1},261:{T:1},262:{T:-1},263:{T:1},264:{T:-1},265:{T:1},266:{T:-1},267:{T:1},268:{T:-1},269:{T:1},270:{T:-1},271:{T:1},272:{T:-1},273:{T:1},274:{T:-1},275:{T:1},276:{T:-1},277:{},278:{T:1},279:{T:-1},280:{T:1},281:{T:-1},282:{T:1},283:{T:1},284:{T:-1},285:{T:1},286:{T:-1},287:{T:1},288:{T:-1},289:{T:1},290:{T:-1},291:{T:1},292:{T:-1},293:{T:1},294:{T:-1},295:{T:1},296:{T:-1},297:{T:1},298:{T:-1},299:{T:1},300:{T:-1},301:{T:1},302:{T:-1},303:{T:1},304:{T:-1},305:{T:1},306:{T:-1},307:{T:1},308:{T:-1},309:{T:1},310:{T:-1},311:{T:1},312:{T:-1},313:{T:-1},314:{T:1},315:{T:-1},316:{T:1},317:{T:-1},318:{T:1},319:{T:-1},320:{T:1},321:{T:-1},322:{T:1},323:{T:-1},324:{T:1},325:{T:-1},326:{T:1},327:{T:-1},328:{T:1},329:{T:-1},330:{T:1},331:{T:-1},332:{T:1},333:{T:-1},334:{T:1},335:{f:T8},336:{T:-1},337:{f:A8,T:1},338:{T:-1},339:{T:1},340:{T:-1},341:{T:1},342:{T:-1},343:{T:1},344:{T:-1},345:{T:1},346:{T:-1},347:{T:1},348:{T:-1},349:{T:1},350:{T:-1},351:{},352:{},353:{T:1},354:{T:-1},355:{f:JC},357:{},358:{},359:{},360:{T:1},361:{},362:{f:GD},363:{},364:{},366:{},367:{},368:{},369:{},370:{},371:{},372:{T:1},373:{T:-1},374:{T:1},375:{T:-1},376:{T:1},377:{T:-1},378:{T:1},379:{T:-1},380:{T:1},381:{T:-1},382:{T:1},383:{T:-1},384:{T:1},385:{T:-1},386:{T:1},387:{T:-1},388:{T:1},389:{T:-1},390:{T:1},391:{T:-1},392:{T:1},393:{T:-1},394:{T:1},395:{T:-1},396:{},397:{},398:{},399:{},400:{},401:{T:1},403:{},404:{},405:{},406:{},407:{},408:{},409:{},410:{},411:{},412:{},413:{},414:{},415:{},416:{},417:{},418:{},419:{},420:{},421:{},422:{T:1},423:{T:1},424:{T:-1},425:{T:-1},426:{f:u5},427:{f:h5},428:{},429:{T:1},430:{T:-1},431:{T:1},432:{T:-1},433:{T:1},434:{T:-1},435:{T:1},436:{T:-1},437:{T:1},438:{T:-1},439:{T:1},440:{T:-1},441:{T:1},442:{T:-1},443:{T:1},444:{T:-1},445:{T:1},446:{T:-1},447:{T:1},448:{T:-1},449:{T:1},450:{T:-1},451:{T:1},452:{T:-1},453:{T:1},454:{T:-1},455:{T:1},456:{T:-1},457:{T:1},458:{T:-1},459:{T:1},460:{T:-1},461:{T:1},462:{T:-1},463:{T:1},464:{T:-1},465:{T:1},466:{T:-1},467:{T:1},468:{T:-1},469:{T:1},470:{T:-1},471:{},472:{},473:{T:1},474:{T:-1},475:{},476:{f:f5},477:{},478:{},479:{T:1},480:{T:-1},481:{T:1},482:{T:-1},483:{T:1},484:{T:-1},485:{f:WU},486:{T:1},487:{T:-1},488:{T:1},489:{T:-1},490:{T:1},491:{T:-1},492:{T:1},493:{T:-1},494:{f:l5},495:{T:1},496:{T:-1},497:{T:1},498:{T:-1},499:{},500:{T:1},501:{T:-1},502:{T:1},503:{T:-1},504:{},505:{T:1},506:{T:-1},507:{},508:{T:1},509:{T:-1},510:{T:1},511:{T:-1},512:{},513:{},514:{T:1},515:{T:-1},516:{T:1},517:{T:-1},518:{T:1},519:{T:-1},520:{T:1},521:{T:-1},522:{},523:{},524:{},525:{},526:{},527:{},528:{T:1},529:{T:-1},530:{T:1},531:{T:-1},532:{T:1},533:{T:-1},534:{},535:{},536:{},537:{},538:{T:1},539:{T:-1},540:{T:1},541:{T:-1},542:{T:1},548:{},549:{},550:{f:JC},551:{},552:{},553:{},554:{T:1},555:{T:-1},556:{T:1},557:{T:-1},558:{T:1},559:{T:-1},560:{T:1},561:{T:-1},562:{},564:{},565:{T:1},566:{T:-1},569:{T:1},570:{T:-1},572:{},573:{T:1},574:{T:-1},577:{},578:{},579:{},580:{},581:{},582:{},583:{},584:{},585:{},586:{},587:{},588:{T:-1},589:{},590:{T:1},591:{T:-1},592:{T:1},593:{T:-1},594:{T:1},595:{T:-1},596:{},597:{T:1},598:{T:-1},599:{T:1},600:{T:-1},601:{T:1},602:{T:-1},603:{T:1},604:{T:-1},605:{T:1},606:{T:-1},607:{},608:{T:1},609:{T:-1},610:{},611:{T:1},612:{T:-1},613:{T:1},614:{T:-1},615:{T:1},616:{T:-1},617:{T:1},618:{T:-1},619:{T:1},620:{T:-1},625:{},626:{T:1},627:{T:-1},628:{T:1},629:{T:-1},630:{T:1},631:{T:-1},632:{f:B8},633:{T:1},634:{T:-1},635:{T:1,f:$8},636:{T:-1},637:{f:c3},638:{T:1},639:{},640:{T:-1},641:{T:1},642:{T:-1},643:{T:1},644:{},645:{T:-1},646:{T:1},648:{T:1},649:{},650:{T:-1},651:{f:y5},652:{},653:{T:1},654:{T:-1},655:{T:1},656:{T:-1},657:{T:1},658:{T:-1},659:{},660:{T:1},661:{},662:{T:-1},663:{},664:{T:1},665:{},666:{T:-1},667:{},668:{},669:{},671:{T:1},672:{T:-1},673:{T:1},674:{T:-1},675:{},676:{},677:{},678:{},679:{},680:{},681:{},1024:{},1025:{},1026:{T:1},1027:{T:-1},1028:{T:1},1029:{T:-1},1030:{},1031:{T:1},1032:{T:-1},1033:{T:1},1034:{T:-1},1035:{},1036:{},1037:{},1038:{T:1},1039:{T:-1},1040:{},1041:{T:1},1042:{T:-1},1043:{},1044:{},1045:{},1046:{T:1},1047:{T:-1},1048:{T:1},1049:{T:-1},1050:{},1051:{T:1},1052:{T:1},1053:{f:p5},1054:{T:1},1055:{},1056:{T:1},1057:{T:-1},1058:{T:1},1059:{T:-1},1061:{},1062:{T:1},1063:{T:-1},1064:{T:1},1065:{T:-1},1066:{T:1},1067:{T:-1},1068:{T:1},1069:{T:-1},1070:{T:1},1071:{T:-1},1072:{T:1},1073:{T:-1},1075:{T:1},1076:{T:-1},1077:{T:1},1078:{T:-1},1079:{T:1},1080:{T:-1},1081:{T:1},1082:{T:-1},1083:{T:1},1084:{T:-1},1085:{},1086:{T:1},1087:{T:-1},1088:{T:1},1089:{T:-1},1090:{T:1},1091:{T:-1},1092:{T:1},1093:{T:-1},1094:{T:1},1095:{T:-1},1096:{},1097:{T:1},1098:{},1099:{T:-1},1100:{T:1},1101:{T:-1},1102:{},1103:{},1104:{},1105:{},1111:{},1112:{},1113:{T:1},1114:{T:-1},1115:{T:1},1116:{T:-1},1117:{},1118:{T:1},1119:{T:-1},1120:{T:1},1121:{T:-1},1122:{T:1},1123:{T:-1},1124:{T:1},1125:{T:-1},1126:{},1128:{T:1},1129:{T:-1},1130:{},1131:{T:1},1132:{T:-1},1133:{T:1},1134:{T:-1},1135:{T:1},1136:{T:-1},1137:{T:1},1138:{T:-1},1139:{T:1},1140:{T:-1},1141:{},1142:{T:1},1143:{T:-1},1144:{T:1},1145:{T:-1},1146:{},1147:{T:1},1148:{T:-1},1149:{T:1},1150:{T:-1},1152:{T:1},1153:{T:-1},1154:{T:-1},1155:{T:-1},1156:{T:-1},1157:{T:1},1158:{T:-1},1159:{T:1},1160:{T:-1},1161:{T:1},1162:{T:-1},1163:{T:1},1164:{T:-1},1165:{T:1},1166:{T:-1},1167:{T:1},1168:{T:-1},1169:{T:1},1170:{T:-1},1171:{},1172:{T:1},1173:{T:-1},1177:{},1178:{T:1},1180:{},1181:{},1182:{},2048:{T:1},2049:{T:-1},2050:{},2051:{T:1},2052:{T:-1},2053:{},2054:{},2055:{T:1},2056:{T:-1},2057:{T:1},2058:{T:-1},2060:{},2067:{},2068:{T:1},2069:{T:-1},2070:{},2071:{},2072:{T:1},2073:{T:-1},2075:{},2076:{},2077:{T:1},2078:{T:-1},2079:{},2080:{T:1},2081:{T:-1},2082:{},2083:{T:1},2084:{T:-1},2085:{T:1},2086:{T:-1},2087:{T:1},2088:{T:-1},2089:{T:1},2090:{T:-1},2091:{},2092:{},2093:{T:1},2094:{T:-1},2095:{},2096:{T:1},2097:{T:-1},2098:{T:1},2099:{T:-1},2100:{T:1},2101:{T:-1},2102:{},2103:{T:1},2104:{T:-1},2105:{},2106:{T:1},2107:{T:-1},2108:{},2109:{T:1},2110:{T:-1},2111:{T:1},2112:{T:-1},2113:{T:1},2114:{T:-1},2115:{},2116:{},2117:{},2118:{T:1},2119:{T:-1},2120:{},2121:{T:1},2122:{T:-1},2123:{T:1},2124:{T:-1},2125:{},2126:{T:1},2127:{T:-1},2128:{},2129:{T:1},2130:{T:-1},2131:{T:1},2132:{T:-1},2133:{T:1},2134:{},2135:{},2136:{},2137:{T:1},2138:{T:-1},2139:{T:1},2140:{T:-1},2141:{},3072:{},3073:{},4096:{T:1},4097:{T:-1},5002:{T:1},5003:{T:-1},5081:{T:1},5082:{T:-1},5083:{},5084:{T:1},5085:{T:-1},5086:{T:1},5087:{T:-1},5088:{},5089:{},5090:{},5092:{T:1},5093:{T:-1},5094:{},5095:{T:1},5096:{T:-1},5097:{},5099:{},65535:{n:""}},n1={6:{f:uw},10:{f:qo},12:{f:Tr},13:{f:Tr},14:{f:vr},15:{f:vr},16:{f:cn},17:{f:vr},18:{f:vr},19:{f:Tr},20:{f:dR},21:{f:dR},23:{f:GD},24:{f:gR},25:{f:vr},26:{},27:{},28:{f:FW},29:{},34:{f:vr},35:{f:fR},38:{f:cn},39:{f:cn},40:{f:cn},41:{f:cn},42:{f:vr},43:{f:vr},47:{f:WV},49:{f:vW},51:{f:Tr},60:{},61:{f:mW},64:{f:vr},65:{f:wW},66:{f:Tr},77:{},80:{},81:{},82:{},85:{f:Tr},89:{},90:{},91:{},92:{f:aW},93:{f:$W},94:{},95:{f:vr},96:{},97:{},99:{f:vr},125:{f:YD},128:{f:AW},129:{f:lW},130:{f:Tr},131:{f:vr},132:{f:vr},133:{f:cW},134:{},140:{f:YW},141:{f:Tr},144:{},146:{f:jW},151:{},152:{},153:{},154:{},155:{},156:{f:Tr},157:{},158:{},160:{f:JW},161:{f:XW},174:{},175:{},176:{},177:{},178:{},180:{},181:{},182:{},184:{},185:{},189:{f:EW},190:{f:RW},193:{f:qo},197:{},198:{},199:{},200:{},201:{},202:{f:vr},203:{},204:{},205:{},206:{},207:{},208:{},209:{},210:{},211:{},213:{},215:{},216:{},217:{},218:{f:Tr},220:{},221:{f:vr},222:{},224:{f:_W},225:{f:oW},226:{f:qo},227:{},229:{f:LW},233:{},235:{},236:{},237:{},239:{},240:{},241:{},242:{},244:{},245:{},246:{},247:{},248:{},249:{},251:{},252:{f:uW},253:{f:CW},255:{f:hW},256:{},259:{},290:{},311:{},312:{},315:{},317:{f:LD},318:{},319:{},320:{},330:{},331:{},333:{},334:{},335:{},336:{},337:{},338:{},339:{},340:{},351:{},352:{f:vr},353:{f:qo},401:{},402:{},403:{},404:{},405:{},406:{},407:{},408:{},425:{},426:{},427:{},428:{},429:{},430:{f:OW},431:{f:vr},432:{},433:{},434:{},437:{},438:{f:VW},439:{f:vr},440:{f:UW},441:{},442:{f:sf},443:{},444:{f:Tr},445:{},446:{},448:{f:qo},449:{f:gW,r:2},450:{f:qo},512:{f:uR},513:{f:ZW},515:{f:MW},516:{f:SW},517:{f:hR},519:{f:QW},520:{f:dW},523:{},545:{f:mR},549:{f:cR},566:{},574:{f:pW},638:{f:bW},659:{},1048:{},1054:{f:yW},1084:{},1212:{f:kW},2048:{f:GW},2049:{},2050:{},2051:{},2052:{},2053:{},2054:{},2055:{},2056:{},2057:{f:zf},2058:{},2059:{},2060:{},2061:{},2062:{},2063:{},2064:{},2066:{},2067:{},2128:{},2129:{},2130:{},2131:{},2132:{},2133:{},2134:{},2135:{},2136:{},2137:{},2138:{},2146:{},2147:{r:12},2148:{},2149:{},2150:{},2151:{f:qo},2152:{},2154:{},2155:{},2156:{},2161:{},2162:{},2164:{},2165:{},2166:{},2167:{},2168:{},2169:{},2170:{},2171:{},2172:{f:KW,r:12},2173:{f:E8,r:12},2174:{},2175:{},2180:{},2181:{},2182:{},2183:{},2184:{},2185:{},2186:{},2187:{},2188:{f:vr,r:12},2189:{},2190:{r:12},2191:{},2192:{},2194:{},2195:{},2196:{f:DW,r:12},2197:{},2198:{f:v8,r:12},2199:{},2200:{},2201:{},2202:{f:NW,r:12},2203:{f:qo},2204:{},2205:{},2206:{},2207:{},2211:{f:fW},2212:{},2213:{},2214:{},2215:{},4097:{},4098:{},4099:{},4102:{},4103:{},4105:{},4106:{},4107:{},4108:{},4109:{},4116:{},4117:{},4118:{},4119:{},4120:{},4121:{},4122:{},4123:{},4124:{},4125:{},4126:{},4127:{},4128:{},4129:{},4130:{},4132:{},4133:{},4134:{f:Tr},4135:{},4146:{},4147:{},4148:{},4149:{},4154:{},4156:{},4157:{},4158:{},4159:{},4160:{},4161:{},4163:{},4164:{f:qW},4165:{},4166:{},4168:{},4170:{},4171:{},4174:{},4175:{},4176:{},4177:{},4187:{},4188:{f:zW},4189:{},4191:{},4192:{},4193:{},4194:{},4195:{},4196:{},4197:{},4198:{},4199:{},4200:{},0:{f:uR},1:{},2:{f:nV},3:{f:rV},4:{f:tV},5:{f:hR},7:{f:iV},8:{},9:{f:zf},11:{},22:{f:Tr},30:{f:xW},31:{},32:{},33:{f:mR},36:{},37:{f:cR},50:{f:sV},62:{},52:{},67:{},68:{f:Tr},69:{},86:{},126:{},127:{f:eV},135:{},136:{},137:{},145:{},148:{},149:{},150:{},169:{},171:{},188:{},191:{},192:{},194:{},195:{},214:{f:oV},223:{},234:{},354:{},421:{},518:{f:uw},521:{f:zf},536:{f:gR},547:{f:fR},561:{},579:{},1030:{f:uw},1033:{f:zf},1091:{},2157:{},2163:{},2177:{},2240:{},2241:{},2242:{},2243:{},2244:{},2245:{},2246:{},2247:{},2248:{},2249:{},2250:{},2251:{},2262:{r:12},29282:{}};function Vi(t,e,r,n){var i=e;if(!isNaN(i)){var s=n||(r||[]).length||0,o=t.next(4);o.write_shift(2,i),o.write_shift(2,s),s>0&&RD(r)&&t.push(r)}}function TR(t,e){var r=e||{},n=r.dense?[]:{};t=t.replace(/<!--.*?-->/g,"");var i=t.match(/<table/i);if(!i)throw new Error("Invalid HTML: could not find <table>");var s=t.match(/<\/table/i),o=i.index,a=s&&s.index||t.length,l=OB(t.slice(o,a),/(:?<tr[^>]*>)/i,"<tr>"),c=-1,u=0,h=0,d=0,f={s:{r:1e7,c:1e7},e:{r:0,c:0}},g=[];for(o=0;o<l.length;++o){var m=l[o].trim(),w=m.slice(0,3).toLowerCase();if(w=="<tr"){if(++c,r.sheetRows&&r.sheetRows<=c){--c;break}u=0;continue}if(!(w!="<td"&&w!="<th")){var C=m.split(/<\/t[dh]>/i);for(a=0;a<C.length;++a){var S=C[a].trim();if(!!S.match(/<t[dh]/i)){for(var v=S,T=0;v.charAt(0)=="<"&&(T=v.indexOf(">"))>-1;)v=v.slice(T+1);for(var A=0;A<g.length;++A){var M=g[A];M.s.c==u&&M.s.r<c&&c<=M.e.r&&(u=M.e.c+1,A=-1)}var E=Ze(S.slice(0,S.indexOf(">")));d=E.colspan?+E.colspan:1,((h=+E.rowspan)>1||d>1)&&g.push({s:{r:c,c:u},e:{r:c+(h||1)-1,c:u+d-1}});var Y=E.t||E["data-t"]||"";if(!v.length){u+=d;continue}if(v=dD(v),f.s.r>c&&(f.s.r=c),f.e.r<c&&(f.e.r=c),f.s.c>u&&(f.s.c=u),f.e.c<u&&(f.e.c=u),!v.length){u+=d;continue}var D={t:"s",v};r.raw||!v.trim().length||Y=="s"||(v==="TRUE"?D={t:"b",v:!0}:v==="FALSE"?D={t:"b",v:!1}:isNaN(us(v))?isNaN(Mu(v).getDate())||(D={t:"d",v:Vr(v)},r.cellDates||(D={t:"n",v:kn(D.v)}),D.z=r.dateNF||ot[14]):D={t:"n",v:us(v)}),r.dense?(n[c]||(n[c]=[]),n[c][u]=D):n[nt({r:c,c:u})]=D,u+=d}}}}return n["!ref"]=bt(f),g.length&&(n["!merges"]=g),n}function s9(t,e,r,n){for(var i=t["!merges"]||[],s=[],o=e.s.c;o<=e.e.c;++o){for(var a=0,l=0,c=0;c<i.length;++c)if(!(i[c].s.r>r||i[c].s.c>o)&&!(i[c].e.r<r||i[c].e.c<o)){if(i[c].s.r<r||i[c].s.c<o){a=-1;break}a=i[c].e.r-i[c].s.r+1,l=i[c].e.c-i[c].s.c+1;break}if(!(a<0)){var u=nt({r,c:o}),h=n.dense?(t[r]||[])[o]:t[u],d=h&&h.v!=null&&(h.h||OS(h.w||(Fo(h),h.w)||""))||"",f={};a>1&&(f.rowspan=a),l>1&&(f.colspan=l),n.editable?d='<span contenteditable="true">'+d+"</span>":h&&(f["data-t"]=h&&h.t||"z",h.v!=null&&(f["data-v"]=h.v),h.z!=null&&(f["data-z"]=h.z),h.l&&(h.l.Target||"#").charAt(0)!="#"&&(d='<a href="'+h.l.Target+'">'+d+"</a>")),f.id=(n.id||"sjs")+"-"+u,s.push(YB("td",d,f))}}var g="<tr>";return g+s.join("")+"</tr>"}var o9='<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>',a9="</body></html>";function l9(t,e){var r=t.match(/<table[\s\S]*?>[\s\S]*?<\/table>/gi);if(!r||r.length==0)throw new Error("Invalid HTML: could not find <table>");if(r.length==1)return Wa(TR(r[0],e),e);var n=KS();return r.forEach(function(i,s){XS(n,TR(i,e),"Sheet"+(s+1))}),n}function c9(t,e,r){var n=[];return n.join("")+"<table"+(r&&r.id?' id="'+r.id+'"':"")+">"}function u9(t,e){var r=e||{},n=r.header!=null?r.header:o9,i=r.footer!=null?r.footer:a9,s=[n],o=Hu(t["!ref"]);r.dense=Array.isArray(t),s.push(c9(t,o,r));for(var a=o.s.r;a<=o.e.r;++a)s.push(s9(t,o,a,r));return s.push("</table>"+i),s.join("")}function wk(t,e,r){var n=r||{},i=0,s=0;if(n.origin!=null)if(typeof n.origin=="number")i=n.origin;else{var o=typeof n.origin=="string"?Pn(n.origin):n.origin;i=o.r,s=o.c}var a=e.getElementsByTagName("tr"),l=Math.min(n.sheetRows||1e7,a.length),c={s:{r:0,c:0},e:{r:i,c:s}};if(t["!ref"]){var u=Hu(t["!ref"]);c.s.r=Math.min(c.s.r,u.s.r),c.s.c=Math.min(c.s.c,u.s.c),c.e.r=Math.max(c.e.r,u.e.r),c.e.c=Math.max(c.e.c,u.e.c),i==-1&&(c.e.r=i=u.e.r+1)}var h=[],d=0,f=t["!rows"]||(t["!rows"]=[]),g=0,m=0,w=0,C=0,S=0,v=0;for(t["!cols"]||(t["!cols"]=[]);g<a.length&&m<l;++g){var T=a[g];if(_R(T)){if(n.display)continue;f[m]={hidden:!0}}var A=T.children;for(w=C=0;w<A.length;++w){var M=A[w];if(!(n.display&&_R(M))){var E=M.hasAttribute("data-v")?M.getAttribute("data-v"):M.hasAttribute("v")?M.getAttribute("v"):dD(M.innerHTML),Y=M.getAttribute("data-z")||M.getAttribute("z");for(d=0;d<h.length;++d){var D=h[d];D.s.c==C+s&&D.s.r<m+i&&m+i<=D.e.r&&(C=D.e.c+1-s,d=-1)}v=+M.getAttribute("colspan")||1,((S=+M.getAttribute("rowspan")||1)>1||v>1)&&h.push({s:{r:m+i,c:C+s},e:{r:m+i+(S||1)-1,c:C+s+(v||1)-1}});var U={t:"s",v:E},X=M.getAttribute("data-t")||M.getAttribute("t")||"";E!=null&&(E.length==0?U.t=X||"z":n.raw||E.trim().length==0||X=="s"||(E==="TRUE"?U={t:"b",v:!0}:E==="FALSE"?U={t:"b",v:!1}:isNaN(us(E))?isNaN(Mu(E).getDate())||(U={t:"d",v:Vr(E)},n.cellDates||(U={t:"n",v:kn(U.v)}),U.z=n.dateNF||ot[14]):U={t:"n",v:us(E)})),U.z===void 0&&Y!=null&&(U.z=Y);var G="",ae=M.getElementsByTagName("A");if(ae&&ae.length)for(var ve=0;ve<ae.length&&!(ae[ve].hasAttribute("href")&&(G=ae[ve].getAttribute("href"),G.charAt(0)!="#"));++ve);G&&G.charAt(0)!="#"&&(U.l={Target:G}),n.dense?(t[m+i]||(t[m+i]=[]),t[m+i][C+s]=U):t[nt({c:C+s,r:m+i})]=U,c.e.c<C+s&&(c.e.c=C+s),C+=v}}++m}return h.length&&(t["!merges"]=(t["!merges"]||[]).concat(h)),c.e.r=Math.max(c.e.r,m-1+i),t["!ref"]=bt(c),m>=l&&(t["!fullref"]=bt((c.e.r=a.length-g+m-1+i,c))),t}function vk(t,e){var r=e||{},n=r.dense?[]:{};return wk(n,t,e)}function h9(t,e){return Wa(vk(t,e),e)}function _R(t){var e="",r=d9(t);return r&&(e=r(t).getPropertyValue("display")),e||(e=t.style&&t.style.display),e==="none"}function d9(t){return t.ownerDocument.defaultView&&typeof t.ownerDocument.defaultView.getComputedStyle=="function"?t.ownerDocument.defaultView.getComputedStyle:typeof getComputedStyle=="function"?getComputedStyle:null}function f9(t){var e=t.replace(/[\t\r\n]/g," ").trim().replace(/ +/g," ").replace(/<text:s\/>/g," ").replace(/<text:s text:c="(\d+)"\/>/g,function(n,i){return Array(parseInt(i,10)+1).join(" ")}).replace(/<text:tab[^>]*\/>/g," ").replace(/<text:line-break\/>/g,`
  35. `),r=_t(e.replace(/<[^>]*>/g,""));return[r]}var AR={day:["d","dd"],month:["m","mm"],year:["y","yy"],hours:["h","hh"],minutes:["m","mm"],seconds:["s","ss"],"am-pm":["A/P","AM/PM"],"day-of-week":["ddd","dddd"],era:["e","ee"],quarter:["\\Qm",'m\\"th quarter"']};function Ck(t,e){var r=e||{},n=IS(t),i=[],s,o,a={name:""},l="",c=0,u,h,d={},f=[],g=r.dense?[]:{},m,w,C={value:""},S="",v=0,T=[],A=-1,M=-1,E={s:{r:1e6,c:1e7},e:{r:0,c:0}},Y=0,D={},U=[],X={},G=0,ae=0,ve=[],me=1,Re=1,Ce=[],_e={Names:[]},p={},y=["",""],b=[],x={},O="",_=0,N=!1,K=!1,le=0;for(kd.lastIndex=0,n=n.replace(/<!--([\s\S]*?)-->/mg,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");m=kd.exec(n);)switch(m[3]=m[3].replace(/_.*$/,"")){case"table":case"\u5DE5\u4F5C\u8868":m[1]==="/"?(E.e.c>=E.s.c&&E.e.r>=E.s.r?g["!ref"]=bt(E):g["!ref"]="A1:A1",r.sheetRows>0&&r.sheetRows<=E.e.r&&(g["!fullref"]=g["!ref"],E.e.r=r.sheetRows-1,g["!ref"]=bt(E)),U.length&&(g["!merges"]=U),ve.length&&(g["!rows"]=ve),u.name=u.\u540D\u79F0||u.name,typeof JSON!="undefined"&&JSON.stringify(u),f.push(u.name),d[u.name]=g,K=!1):m[0].charAt(m[0].length-2)!=="/"&&(u=Ze(m[0],!1),A=M=-1,E.s.r=E.s.c=1e7,E.e.r=E.e.c=0,g=r.dense?[]:{},U=[],ve=[],K=!0);break;case"table-row-group":m[1]==="/"?--Y:++Y;break;case"table-row":case"\u884C":if(m[1]==="/"){A+=me,me=1;break}if(h=Ze(m[0],!1),h.\u884C\u53F7?A=h.\u884C\u53F7-1:A==-1&&(A=0),me=+h["number-rows-repeated"]||1,me<10)for(le=0;le<me;++le)Y>0&&(ve[A+le]={level:Y});M=-1;break;case"covered-table-cell":m[1]!=="/"&&++M,r.sheetStubs&&(r.dense?(g[A]||(g[A]=[]),g[A][M]={t:"z"}):g[nt({r:A,c:M})]={t:"z"}),S="",T=[];break;case"table-cell":case"\u6570\u636E":if(m[0].charAt(m[0].length-2)==="/")++M,C=Ze(m[0],!1),Re=parseInt(C["number-columns-repeated"]||"1",10),w={t:"z",v:null},C.formula&&r.cellFormula!=!1&&(w.f=xR(_t(C.formula))),(C.\u6570\u636E\u7C7B\u578B||C["value-type"])=="string"&&(w.t="s",w.v=_t(C["string-value"]||""),r.dense?(g[A]||(g[A]=[]),g[A][M]=w):g[nt({r:A,c:M})]=w),M+=Re-1;else if(m[1]!=="/"){++M,S="",v=0,T=[],Re=1;var ce=me?A+me-1:A;if(M>E.e.c&&(E.e.c=M),M<E.s.c&&(E.s.c=M),A<E.s.r&&(E.s.r=A),ce>E.e.r&&(E.e.r=ce),C=Ze(m[0],!1),b=[],x={},w={t:C.\u6570\u636E\u7C7B\u578B||C["value-type"],v:null},r.cellFormula)if(C.formula&&(C.formula=_t(C.formula)),C["number-matrix-columns-spanned"]&&C["number-matrix-rows-spanned"]&&(G=parseInt(C["number-matrix-rows-spanned"],10)||0,ae=parseInt(C["number-matrix-columns-spanned"],10)||0,X={s:{r:A,c:M},e:{r:A+G-1,c:M+ae-1}},w.F=bt(X),Ce.push([X,w.F])),C.formula)w.f=xR(C.formula);else for(le=0;le<Ce.length;++le)A>=Ce[le][0].s.r&&A<=Ce[le][0].e.r&&M>=Ce[le][0].s.c&&M<=Ce[le][0].e.c&&(w.F=Ce[le][1]);switch((C["number-columns-spanned"]||C["number-rows-spanned"])&&(G=parseInt(C["number-rows-spanned"],10)||0,ae=parseInt(C["number-columns-spanned"],10)||0,X={s:{r:A,c:M},e:{r:A+G-1,c:M+ae-1}},U.push(X)),C["number-columns-repeated"]&&(Re=parseInt(C["number-columns-repeated"],10)),w.t){case"boolean":w.t="b",w.v=er(C["boolean-value"]);break;case"float":w.t="n",w.v=parseFloat(C.value);break;case"percentage":w.t="n",w.v=parseFloat(C.value);break;case"currency":w.t="n",w.v=parseFloat(C.value);break;case"date":w.t="d",w.v=Vr(C["date-value"]),r.cellDates||(w.t="n",w.v=kn(w.v)),w.z="m/d/yy";break;case"time":w.t="n",w.v=_B(C["time-value"])/86400,r.cellDates&&(w.t="d",w.v=tp(w.v)),w.z="HH:MM:SS";break;case"number":w.t="n",w.v=parseFloat(C.\u6570\u636E\u6570\u503C);break;default:if(w.t==="string"||w.t==="text"||!w.t)w.t="s",C["string-value"]!=null&&(S=_t(C["string-value"]),T=[]);else throw new Error("Unsupported value type "+w.t)}}else{if(N=!1,w.t==="s"&&(w.v=S||"",T.length&&(w.R=T),N=v==0),p.Target&&(w.l=p),b.length>0&&(w.c=b,b=[]),S&&r.cellText!==!1&&(w.w=S),N&&(w.t="z",delete w.v),(!N||r.sheetStubs)&&!(r.sheetRows&&r.sheetRows<=A))for(var te=0;te<me;++te){if(Re=parseInt(C["number-columns-repeated"]||"1",10),r.dense)for(g[A+te]||(g[A+te]=[]),g[A+te][M]=te==0?w:Xr(w);--Re>0;)g[A+te][M+Re]=Xr(w);else for(g[nt({r:A+te,c:M})]=w;--Re>0;)g[nt({r:A+te,c:M+Re})]=Xr(w);E.e.c<=M&&(E.e.c=M)}Re=parseInt(C["number-columns-repeated"]||"1",10),M+=Re-1,Re=0,w={},S="",T=[]}p={};break;case"document":case"document-content":case"\u7535\u5B50\u8868\u683C\u6587\u6863":case"spreadsheet":case"\u4E3B\u4F53":case"scripts":case"styles":case"font-face-decls":case"master-styles":if(m[1]==="/"){if((s=i.pop())[0]!==m[3])throw"Bad state: "+s}else m[0].charAt(m[0].length-2)!=="/"&&i.push([m[3],!0]);break;case"annotation":if(m[1]==="/"){if((s=i.pop())[0]!==m[3])throw"Bad state: "+s;x.t=S,T.length&&(x.R=T),x.a=O,b.push(x)}else m[0].charAt(m[0].length-2)!=="/"&&i.push([m[3],!1]);O="",_=0,S="",v=0,T=[];break;case"creator":m[1]==="/"?O=n.slice(_,m.index):_=m.index+m[0].length;break;case"meta":case"\u5143\u6570\u636E":case"settings":case"config-item-set":case"config-item-map-indexed":case"config-item-map-entry":case"config-item-map-named":case"shapes":case"frame":case"text-box":case"image":case"data-pilot-tables":case"list-style":case"form":case"dde-links":case"event-listeners":case"chart":if(m[1]==="/"){if((s=i.pop())[0]!==m[3])throw"Bad state: "+s}else m[0].charAt(m[0].length-2)!=="/"&&i.push([m[3],!1]);S="",v=0,T=[];break;case"scientific-number":break;case"currency-symbol":break;case"currency-style":break;case"number-style":case"percentage-style":case"date-style":case"time-style":if(m[1]==="/"){if(D[a.name]=l,(s=i.pop())[0]!==m[3])throw"Bad state: "+s}else m[0].charAt(m[0].length-2)!=="/"&&(l="",a=Ze(m[0],!1),i.push([m[3],!0]));break;case"script":break;case"libraries":break;case"automatic-styles":break;case"default-style":case"page-layout":break;case"style":break;case"map":break;case"font-face":break;case"paragraph-properties":break;case"table-properties":break;case"table-column-properties":break;case"table-row-properties":break;case"table-cell-properties":break;case"number":switch(i[i.length-1][0]){case"time-style":case"date-style":o=Ze(m[0],!1),l+=AR[m[3]][o.style==="long"?1:0];break}break;case"fraction":break;case"day":case"month":case"year":case"era":case"day-of-week":case"week-of-year":case"quarter":case"hours":case"minutes":case"seconds":case"am-pm":switch(i[i.length-1][0]){case"time-style":case"date-style":o=Ze(m[0],!1),l+=AR[m[3]][o.style==="long"?1:0];break}break;case"boolean-style":break;case"boolean":break;case"text-style":break;case"text":if(m[0].slice(-2)==="/>")break;if(m[1]==="/")switch(i[i.length-1][0]){case"number-style":case"date-style":case"time-style":l+=n.slice(c,m.index);break}else c=m.index+m[0].length;break;case"named-range":o=Ze(m[0],!1),y=hw(o["cell-range-address"]);var ge={Name:o.name,Ref:y[0]+"!"+y[1]};K&&(ge.Sheet=f.length),_e.Names.push(ge);break;case"text-content":break;case"text-properties":break;case"embedded-text":break;case"body":case"\u7535\u5B50\u8868\u683C":break;case"forms":break;case"table-column":break;case"table-header-rows":break;case"table-rows":break;case"table-column-group":break;case"table-header-columns":break;case"table-columns":break;case"null-date":break;case"graphic-properties":break;case"calculation-settings":break;case"named-expressions":break;case"label-range":break;case"label-ranges":break;case"named-expression":break;case"sort":break;case"sort-by":break;case"sort-groups":break;case"tab":break;case"line-break":break;case"span":break;case"p":case"\u6587\u672C\u4E32":if(["master-styles"].indexOf(i[i.length-1][0])>-1)break;if(m[1]==="/"&&(!C||!C["string-value"])){var Me=f9(n.slice(v,m.index));S=(S.length>0?S+`
  36. `:"")+Me[0]}else Ze(m[0],!1),v=m.index+m[0].length;break;case"s":break;case"database-range":if(m[1]==="/")break;try{y=hw(Ze(m[0])["target-range-address"]),d[y[0]]["!autofilter"]={ref:y[1]}}catch(Fe){}break;case"date":break;case"object":break;case"title":case"\u6807\u9898":break;case"desc":break;case"binary-data":break;case"table-source":break;case"scenario":break;case"iteration":break;case"content-validations":break;case"content-validation":break;case"help-message":break;case"error-message":break;case"database-ranges":break;case"filter":break;case"filter-and":break;case"filter-or":break;case"filter-condition":break;case"list-level-style-bullet":break;case"list-level-style-number":break;case"list-level-properties":break;case"sender-firstname":case"sender-lastname":case"sender-initials":case"sender-title":case"sender-position":case"sender-email":case"sender-phone-private":case"sender-fax":case"sender-company":case"sender-phone-work":case"sender-street":case"sender-city":case"sender-postal-code":case"sender-country":case"sender-state-or-province":case"author-name":case"author-initials":case"chapter":case"file-name":case"template-name":case"sheet-name":break;case"event-listener":break;case"initial-creator":case"creation-date":case"print-date":case"generator":case"document-statistic":case"user-defined":case"editing-duration":case"editing-cycles":break;case"config-item":break;case"page-number":break;case"page-count":break;case"time":break;case"cell-range-source":break;case"detective":break;case"operation":break;case"highlighted-range":break;case"data-pilot-table":case"source-cell-range":case"source-service":case"data-pilot-field":case"data-pilot-level":case"data-pilot-subtotals":case"data-pilot-subtotal":case"data-pilot-members":case"data-pilot-member":case"data-pilot-display-info":case"data-pilot-sort-info":case"data-pilot-layout-info":case"data-pilot-field-reference":case"data-pilot-groups":case"data-pilot-group":case"data-pilot-group-member":break;case"rect":break;case"dde-connection-decls":case"dde-connection-decl":case"dde-link":case"dde-source":break;case"properties":break;case"property":break;case"a":if(m[1]!=="/"){if(p=Ze(m[0],!1),!p.href)break;p.Target=_t(p.href),delete p.href,p.Target.charAt(0)=="#"&&p.Target.indexOf(".")>-1?(y=hw(p.Target.slice(1)),p.Target="#"+y[0]+"!"+y[1]):p.Target.match(/^\.\.[\\\/]/)&&(p.Target=p.Target.slice(3))}break;case"table-protection":break;case"data-pilot-grand-total":break;case"office-document-common-attrs":break;default:switch(m[2]){case"dc:":case"calcext:":case"loext:":case"ooo:":case"chartooo:":case"draw:":case"style:":case"chart:":case"form:":case"uof:":case"\u8868:":case"\u5B57:":break;default:if(r.WTF)throw new Error(m)}}var L={Sheets:d,SheetNames:f,Workbook:_e};return r.bookSheets&&delete L.Sheets,L}function MR(t,e){e=e||{},Ei(t,"META-INF/manifest.xml")&&M3(Rr(t,"META-INF/manifest.xml"),e);var r=hi(t,"content.xml");if(!r)throw new Error("Missing content.xml in ODS / UOF file");var n=Ck(Yt(r),e);return Ei(t,"meta.xml")&&(n.Props=PD(Rr(t,"meta.xml"))),n}function OR(t,e){return Ck(t,e)}/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */function GS(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function i1(t){return typeof TextDecoder!="undefined"?new TextDecoder().decode(t):Yt(rc(t))}function s1(t){var e=t.reduce(function(i,s){return i+s.length},0),r=new Uint8Array(e),n=0;return t.forEach(function(i){r.set(i,n),n+=i.length}),r}function IR(t){return t-=t>>1&1431655765,t=(t&858993459)+(t>>2&858993459),(t+(t>>4)&252645135)*16843009>>>24}function g9(t,e){for(var r=(t[e+15]&127)<<7|t[e+14]>>1,n=t[e+14]&1,i=e+13;i>=e;--i)n=n*256+t[i];return(t[e+15]&128?-n:n)*Math.pow(10,r-6176)}function Ld(t,e){var r=e?e[0]:0,n=t[r]&127;e:if(t[r++]>=128&&(n|=(t[r]&127)<<7,t[r++]<128||(n|=(t[r]&127)<<14,t[r++]<128)||(n|=(t[r]&127)<<21,t[r++]<128)||(n+=(t[r]&127)*Math.pow(2,28),++r,t[r++]<128)||(n+=(t[r]&127)*Math.pow(2,35),++r,t[r++]<128)||(n+=(t[r]&127)*Math.pow(2,42),++r,t[r++]<128)))break e;return e&&(e[0]=r),n}function Dr(t){var e=0,r=t[e]&127;e:if(t[e++]>=128){if(r|=(t[e]&127)<<7,t[e++]<128||(r|=(t[e]&127)<<14,t[e++]<128)||(r|=(t[e]&127)<<21,t[e++]<128))break e;r|=(t[e]&127)<<28}return r}function un(t){for(var e=[],r=[0];r[0]<t.length;){var n=r[0],i=Ld(t,r),s=i&7;i=Math.floor(i/8);var o=0,a;if(i==0)break;switch(s){case 0:{for(var l=r[0];t[r[0]++]>=128;);a=t.slice(l,r[0])}break;case 5:o=4,a=t.slice(r[0],r[0]+o),r[0]+=o;break;case 1:o=8,a=t.slice(r[0],r[0]+o),r[0]+=o;break;case 2:o=Ld(t,r),a=t.slice(r[0],r[0]+o),r[0]+=o;break;case 3:case 4:default:throw new Error("PB Type ".concat(s," for Field ").concat(i," at offset ").concat(n))}var c={data:a,type:s};e[i]==null?e[i]=[c]:e[i].push(c)}return e}function YS(t,e){return(t==null?void 0:t.map(function(r){return e(r.data)}))||[]}function m9(t){for(var e,r=[],n=[0];n[0]<t.length;){var i=Ld(t,n),s=un(t.slice(n[0],n[0]+i));n[0]+=i;var o={id:Dr(s[1][0].data),messages:[]};s[2].forEach(function(a){var l=un(a.data),c=Dr(l[3][0].data);o.messages.push({meta:l,data:t.slice(n[0],n[0]+c)}),n[0]+=c}),(e=s[3])!=null&&e[0]&&(o.merge=Dr(s[3][0].data)>>>0>0),r.push(o)}return r}function p9(t,e){if(t!=0)throw new Error("Unexpected Snappy chunk type ".concat(t));for(var r=[0],n=Ld(e,r),i=[];r[0]<e.length;){var s=e[r[0]]&3;if(s==0){var o=e[r[0]++]>>2;if(o<60)++o;else{var a=o-59;o=e[r[0]],a>1&&(o|=e[r[0]+1]<<8),a>2&&(o|=e[r[0]+2]<<16),a>3&&(o|=e[r[0]+3]<<24),o>>>=0,o++,r[0]+=a}i.push(e.slice(r[0],r[0]+o)),r[0]+=o;continue}else{var l=0,c=0;if(s==1?(c=(e[r[0]]>>2&7)+4,l=(e[r[0]++]&224)<<3,l|=e[r[0]++]):(c=(e[r[0]++]>>2)+1,s==2?(l=e[r[0]]|e[r[0]+1]<<8,r[0]+=2):(l=(e[r[0]]|e[r[0]+1]<<8|e[r[0]+2]<<16|e[r[0]+3]<<24)>>>0,r[0]+=4)),i=[s1(i)],l==0)throw new Error("Invalid offset 0");if(l>i[0].length)throw new Error("Invalid offset beyond length");if(c>=l)for(i.push(i[0].slice(-l)),c-=l;c>=i[i.length-1].length;)i.push(i[i.length-1]),c-=i[i.length-1].length;i.push(i[0].slice(-l,-l+c))}}var u=s1(i);if(u.length!=n)throw new Error("Unexpected length: ".concat(u.length," != ").concat(n));return u}function w9(t){for(var e=[],r=0;r<t.length;){var n=t[r++],i=t[r]|t[r+1]<<8|t[r+2]<<16;r+=3,e.push(p9(n,t.slice(r,r+i))),r+=i}if(r!==t.length)throw new Error("data is not a valid framed stream!");return s1(e)}function v9(t,e,r,n){var i=GS(t),s=i.getUint32(4,!0),o=(n>1?12:8)+IR(s&(n>1?3470:398))*4,a=-1,l=-1,c=NaN,u=new Date(2001,0,1);s&512&&(a=i.getUint32(o,!0),o+=4),o+=IR(s&(n>1?12288:4096))*4,s&16&&(l=i.getUint32(o,!0),o+=4),s&32&&(c=i.getFloat64(o,!0),o+=8),s&64&&(u.setTime(u.getTime()+i.getFloat64(o,!0)*1e3),o+=8);var h;switch(t[2]){case 0:break;case 2:h={t:"n",v:c};break;case 3:h={t:"s",v:e[l]};break;case 5:h={t:"d",v:u};break;case 6:h={t:"b",v:c>0};break;case 7:h={t:"n",v:c/86400};break;case 8:h={t:"e",v:0};break;case 9:if(a>-1)h={t:"s",v:r[a]};else if(l>-1)h={t:"s",v:e[l]};else if(!isNaN(c))h={t:"n",v:c};else throw new Error("Unsupported cell type ".concat(t.slice(0,4)));break;default:throw new Error("Unsupported cell type ".concat(t.slice(0,4)))}return h}function C9(t,e,r){var n=GS(t),i=n.getUint32(8,!0),s=12,o=-1,a=-1,l=NaN,c=NaN,u=new Date(2001,0,1);i&1&&(l=g9(t,s),s+=16),i&2&&(c=n.getFloat64(s,!0),s+=8),i&4&&(u.setTime(u.getTime()+n.getFloat64(s,!0)*1e3),s+=8),i&8&&(a=n.getUint32(s,!0),s+=4),i&16&&(o=n.getUint32(s,!0),s+=4);var h;switch(t[1]){case 0:break;case 2:h={t:"n",v:l};break;case 3:h={t:"s",v:e[a]};break;case 5:h={t:"d",v:u};break;case 6:h={t:"b",v:c>0};break;case 7:h={t:"n",v:c/86400};break;case 8:h={t:"e",v:0};break;case 9:if(o>-1)h={t:"s",v:r[o]};else throw new Error("Unsupported cell type ".concat(t[1]," : ").concat(i&31," : ").concat(t.slice(0,4)));break;case 10:h={t:"n",v:l};break;default:throw new Error("Unsupported cell type ".concat(t[1]," : ").concat(i&31," : ").concat(t.slice(0,4)))}return h}function S9(t,e,r){switch(t[0]){case 0:case 1:case 2:case 3:return v9(t,e,r,t[0]);case 5:return C9(t,e,r);default:throw new Error("Unsupported payload version ".concat(t[0]))}}function Ma(t){var e=un(t);return Ld(e[1][0].data)}function PR(t,e){var r=un(e.data),n=Dr(r[1][0].data),i=r[3],s=[];return(i||[]).forEach(function(o){var a=un(o.data),l=Dr(a[1][0].data)>>>0;switch(n){case 1:s[l]=i1(a[3][0].data);break;case 8:{var c=t[Ma(a[9][0].data)][0],u=un(c.data),h=t[Ma(u[1][0].data)][0],d=Dr(h.meta[1][0].data);if(d!=2001)throw new Error("2000 unexpected reference to ".concat(d));var f=un(h.data);s[l]=f[3].map(function(g){return i1(g.data)}).join("")}break}}),s}function y9(t,e){var r,n,i,s,o,a,l,c,u,h,d,f,g,m,w=un(t),C=Dr(w[1][0].data)>>>0,S=Dr(w[2][0].data)>>>0,v=((n=(r=w[8])==null?void 0:r[0])==null?void 0:n.data)&&Dr(w[8][0].data)>0||!1,T,A;if(((s=(i=w[7])==null?void 0:i[0])==null?void 0:s.data)&&e!=0)T=(a=(o=w[7])==null?void 0:o[0])==null?void 0:a.data,A=(c=(l=w[6])==null?void 0:l[0])==null?void 0:c.data;else if(((h=(u=w[4])==null?void 0:u[0])==null?void 0:h.data)&&e!=1)T=(f=(d=w[4])==null?void 0:d[0])==null?void 0:f.data,A=(m=(g=w[3])==null?void 0:g[0])==null?void 0:m.data;else throw"NUMBERS Tile missing ".concat(e," cell storage");for(var M=v?4:1,E=GS(T),Y=[],D=0;D<T.length/2;++D){var U=E.getUint16(D*2,!0);U<65535&&Y.push([D,U])}if(Y.length!=S)throw"Expected ".concat(S," cells, found ").concat(Y.length);var X=[];for(D=0;D<Y.length-1;++D)X[Y[D][0]]=A.subarray(Y[D][1]*M,Y[D+1][1]*M);return Y.length>=1&&(X[Y[Y.length-1][0]]=A.subarray(Y[Y.length-1][1]*M)),{R:C,cells:X}}function x9(t,e){var r,n=un(e.data),i=(r=n==null?void 0:n[7])!=null&&r[0]?Dr(n[7][0].data)>>>0>0?1:0:-1,s=YS(n[5],function(o){return y9(o,i)});return{nrows:Dr(n[4][0].data)>>>0,data:s.reduce(function(o,a){return o[a.R]||(o[a.R]=[]),a.cells.forEach(function(l,c){if(o[a.R][c])throw new Error("Duplicate cell r=".concat(a.R," c=").concat(c));o[a.R][c]=l}),o},[])}}function b9(t,e,r){var n,i=un(e.data),s={s:{r:0,c:0},e:{r:0,c:0}};if(s.e.r=(Dr(i[6][0].data)>>>0)-1,s.e.r<0)throw new Error("Invalid row varint ".concat(i[6][0].data));if(s.e.c=(Dr(i[7][0].data)>>>0)-1,s.e.c<0)throw new Error("Invalid col varint ".concat(i[7][0].data));r["!ref"]=bt(s);var o=un(i[4][0].data),a=PR(t,t[Ma(o[4][0].data)][0]),l=(n=o[17])!=null&&n[0]?PR(t,t[Ma(o[17][0].data)][0]):[],c=un(o[3][0].data),u=0;c[1].forEach(function(h){var d=un(h.data),f=t[Ma(d[2][0].data)][0],g=Dr(f.meta[1][0].data);if(g!=6002)throw new Error("6001 unexpected reference to ".concat(g));var m=x9(t,f);m.data.forEach(function(w,C){w.forEach(function(S,v){var T=nt({r:u+C,c:v}),A=S9(S,a,l);A&&(r[T]=A)})}),u+=m.nrows})}function E9(t,e){var r=un(e.data),n={"!ref":"A1"},i=t[Ma(r[2][0].data)],s=Dr(i[0].meta[1][0].data);if(s!=6001)throw new Error("6000 unexpected reference to ".concat(s));return b9(t,i[0],n),n}function R9(t,e){var r,n=un(e.data),i={name:(r=n[1])!=null&&r[0]?i1(n[1][0].data):"",sheets:[]},s=YS(n[2],Ma);return s.forEach(function(o){t[o].forEach(function(a){var l=Dr(a.meta[1][0].data);l==6e3&&i.sheets.push(E9(t,a))})}),i}function T9(t,e){var r=KS(),n=un(e.data),i=YS(n[1],Ma);if(i.forEach(function(s){t[s].forEach(function(o){var a=Dr(o.meta[1][0].data);if(a==2){var l=R9(t,o);l.sheets.forEach(function(c,u){XS(r,c,u==0?l.name:l.name+"_"+u,!0)})}})}),r.SheetNames.length==0)throw new Error("Empty NUMBERS file");return r}function fw(t){var e,r,n,i,s={},o=[];if(t.FullPaths.forEach(function(l){if(l.match(/\.iwpv2/))throw new Error("Unsupported password protection")}),t.FileIndex.forEach(function(l){if(!!l.name.match(/\.iwa$/)){var c;try{c=w9(l.content)}catch(h){return console.log("?? "+l.content.length+" "+(h.message||h))}var u;try{u=m9(c)}catch(h){return console.log("## "+(h.message||h))}u.forEach(function(h){s[h.id]=h.messages,o.push(h.id)})}}),!o.length)throw new Error("File has no messages");var a=((i=(n=(r=(e=s==null?void 0:s[1])==null?void 0:e[0])==null?void 0:r.meta)==null?void 0:n[1])==null?void 0:i[0].data)&&Dr(s[1][0].meta[1][0].data)==1&&s[1][0];if(a||o.forEach(function(l){s[l].forEach(function(c){var u=Dr(c.meta[1][0].data)>>>0;if(u==1)if(!a)a=c;else throw new Error("Document has multiple roots")})}),!a)throw new Error("Cannot find Document root");return T9(s,a)}function _9(t){return function(r){for(var n=0;n!=t.length;++n){var i=t[n];r[i[0]]===void 0&&(r[i[0]]=i[1]),i[2]==="n"&&(r[i[0]]=Number(r[i[0]]))}}}function zS(t){_9([["cellNF",!1],["cellHTML",!0],["cellFormula",!0],["cellStyles",!1],["cellText",!0],["cellDates",!1],["sheetStubs",!1],["sheetRows",0,"n"],["bookDeps",!1],["bookSheets",!1],["bookProps",!1],["bookFiles",!1],["bookVBA",!1],["password",""],["WTF",!1]])(t)}function A9(t){return hu.WS.indexOf(t)>-1?"sheet":t==hu.CS?"chart":t==hu.DS?"dialog":t==hu.MS?"macro":t&&t.length?t:"sheet"}function M9(t,e){if(!t)return 0;try{t=e.map(function(n){return n.id||(n.id=n.strRelID),[n.name,t["!id"][n.id].Target,A9(t["!id"][n.id].Type)]})}catch(r){return null}return!t||t.length===0?null:t}function O9(t,e,r,n,i,s,o,a,l,c,u,h){try{s[n]=od(hi(t,r,!0),e);var d=Rr(t,e),f;switch(a){case"sheet":f=H5(d,e,i,l,s[n],c,u,h);break;case"chart":if(f=F5(d,e,i,l,s[n],c,u,h),!f||!f["!drawel"])break;var g=qh(f["!drawel"].Target,e),m=QC(g),w=N8(hi(t,g,!0),od(hi(t,m,!0),g)),C=qh(w,g),S=QC(C);f=C5(hi(t,C,!0),C,l,od(hi(t,S,!0),C),c,f);break;case"macro":f=L5(d,e,i,l,s[n],c,u,h);break;case"dialog":f=$5(d,e,i,l,s[n],c,u,h);break;default:throw new Error("Unrecognized sheet type "+a)}o[n]=f;var v=[];s&&s[n]&&Xs(s[n]).forEach(function(T){var A="";if(s[n][T].Type==hu.CMNT){A=qh(s[n][T].Target,e);var M=U5(Rr(t,A,!0),A,l);if(!M||!M.length)return;wR(f,M,!1)}s[n][T].Type==hu.TCMNT&&(A=qh(s[n][T].Target,e),v=v.concat(F8(Rr(t,A,!0),l)))}),v&&v.length&&wR(f,v,!0,l.people||[])}catch(T){if(l.WTF)throw T}}function wi(t){return t.charAt(0)=="/"?t.slice(1):t}function I9(t,e){if(rD(),e=e||{},zS(e),Ei(t,"META-INF/manifest.xml")||Ei(t,"objectdata.xml"))return MR(t,e);if(Ei(t,"Index/Document.iwa")){if(typeof Uint8Array=="undefined")throw new Error("NUMBERS file parsing requires Uint8Array support");if(typeof fw!="undefined"){if(t.FileIndex)return fw(t);var r=xt.utils.cfb_new();return GE(t).forEach(function(ve){PB(r,ve,lD(t,ve))}),fw(r)}throw new Error("Unsupported NUMBERS file")}if(!Ei(t,"[Content_Types].xml"))throw Ei(t,"index.xml.gz")?new Error("Unsupported NUMBERS 08 file"):Ei(t,"index.xml")?new Error("Unsupported NUMBERS 09 file"):new Error("Unsupported ZIP file");var n=GE(t),i=_3(hi(t,"[Content_Types].xml")),s=!1,o,a;if(i.workbooks.length===0&&(a="xl/workbook.xml",Rr(t,a,!0)&&i.workbooks.push(a)),i.workbooks.length===0){if(a="xl/workbook.bin",!Rr(t,a,!0))throw new Error("Could not find workbook");i.workbooks.push(a),s=!0}i.workbooks[0].slice(-3)=="bin"&&(s=!0);var l={},c={};if(!e.bookSheets&&!e.bookProps){if(cd=[],i.sst)try{cd=V5(Rr(t,wi(i.sst)),i.sst,e)}catch(ve){if(e.WTF)throw ve}e.cellStyles&&i.themes.length&&(l=W5(hi(t,i.themes[0].replace(/^\//,""),!0)||"",i.themes[0],e)),i.style&&(c=B5(Rr(t,wi(i.style)),i.style,l,e))}i.links.map(function(ve){try{var me=od(hi(t,QC(wi(ve))),ve);return Y5(Rr(t,wi(ve)),me,ve,e)}catch(Re){}});var u=N5(Rr(t,wi(i.workbooks[0])),i.workbooks[0],e),h={},d="";i.coreprops.length&&(d=Rr(t,wi(i.coreprops[0]),!0),d&&(h=PD(d)),i.extprops.length!==0&&(d=Rr(t,wi(i.extprops[0]),!0),d&&P3(d,h,e)));var f={};(!e.bookSheets||e.bookProps)&&i.custprops.length!==0&&(d=hi(t,wi(i.custprops[0]),!0),d&&(f=k3(d,e)));var g={};if((e.bookSheets||e.bookProps)&&(u.Sheets?o=u.Sheets.map(function(me){return me.name}):h.Worksheets&&h.SheetNames.length>0&&(o=h.SheetNames),e.bookProps&&(g.Props=h,g.Custprops=f),e.bookSheets&&typeof o!="undefined"&&(g.SheetNames=o),e.bookSheets?g.SheetNames:e.bookProps))return g;o={};var m={};e.bookDeps&&i.calcchain&&(m=G5(Rr(t,wi(i.calcchain)),i.calcchain));var w=0,C={},S,v;{var T=u.Sheets;h.Worksheets=T.length,h.SheetNames=[];for(var A=0;A!=T.length;++A)h.SheetNames[A]=T[A].name}var M=s?"bin":"xml",E=i.workbooks[0].lastIndexOf("/"),Y=(i.workbooks[0].slice(0,E+1)+"_rels/"+i.workbooks[0].slice(E+1)+".rels").replace(/^\//,"");Ei(t,Y)||(Y="xl/_rels/workbook."+M+".rels");var D=od(hi(t,Y,!0),Y.replace(/_rels.*/,"s5s"));(i.metadata||[]).length>=1&&(e.xlmeta=z5(Rr(t,wi(i.metadata[0])),i.metadata[0],e)),(i.people||[]).length>=1&&(e.people=L8(Rr(t,wi(i.people[0])),e)),D&&(D=M9(D,u.Sheets));var U=Rr(t,"xl/worksheets/sheet.xml",!0)?1:0;e:for(w=0;w!=h.Worksheets;++w){var X="sheet";if(D&&D[w]?(S="xl/"+D[w][1].replace(/[\/]?xl\//,""),Ei(t,S)||(S=D[w][1]),Ei(t,S)||(S=Y.replace(/_rels\/.*$/,"")+D[w][1]),X=D[w][2]):(S="xl/worksheets/sheet"+(w+1-U)+"."+M,S=S.replace(/sheet0\./,"sheet.")),v=S.replace(/^(.*)(\/)([^\/]*)$/,"$1/_rels/$3.rels"),e&&e.sheets!=null)switch(typeof e.sheets){case"number":if(w!=e.sheets)continue e;break;case"string":if(h.SheetNames[w].toLowerCase()!=e.sheets.toLowerCase())continue e;break;default:if(Array.isArray&&Array.isArray(e.sheets)){for(var G=!1,ae=0;ae!=e.sheets.length;++ae)typeof e.sheets[ae]=="number"&&e.sheets[ae]==w&&(G=1),typeof e.sheets[ae]=="string"&&e.sheets[ae].toLowerCase()==h.SheetNames[w].toLowerCase()&&(G=1);if(!G)continue e}}O9(t,S,v,h.SheetNames[w],w,C,o,X,e,u,l,c)}return g={Directory:i,Workbook:u,Props:h,Custprops:f,Deps:m,Sheets:o,SheetNames:h.SheetNames,Strings:cd,Styles:c,Themes:l,SSF:Xr(ot)},e&&e.bookFiles&&(t.files?(g.keys=n,g.files=t.files):(g.keys=[],g.files={},t.FullPaths.forEach(function(ve,me){ve=ve.replace(/^Root Entry[\/]/,""),g.keys.push(ve),g.files[ve]=t.FileIndex[me]}))),e&&e.bookVBA&&(i.vba.length>0?g.vbaraw=Rr(t,wi(i.vba[0]),!0):i.defaults&&i.defaults.bin===V8&&(g.vbaraw=Rr(t,"xl/vbaProject.bin",!0))),g}function P9(t,e){var r=e||{},n="Workbook",i=xt.find(t,n);try{if(n="/!DataSpaces/Version",i=xt.find(t,n),!i||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);if(EV(i.content),n="/!DataSpaces/DataSpaceMap",i=xt.find(t,n),!i||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);var s=TV(i.content);if(s.length!==1||s[0].comps.length!==1||s[0].comps[0].t!==0||s[0].name!=="StrongEncryptionDataSpace"||s[0].comps[0].v!=="EncryptedPackage")throw new Error("ECMA-376 Encrypted file bad "+n);if(n="/!DataSpaces/DataSpaceInfo/StrongEncryptionDataSpace",i=xt.find(t,n),!i||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);var o=_V(i.content);if(o.length!=1||o[0]!="StrongEncryptionTransform")throw new Error("ECMA-376 Encrypted file bad "+n);if(n="/!DataSpaces/TransformInfo/StrongEncryptionTransform/!Primary",i=xt.find(t,n),!i||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);MV(i.content)}catch(l){}if(n="/EncryptionInfo",i=xt.find(t,n),!i||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);var a=OV(i.content);if(n="/EncryptedPackage",i=xt.find(t,n),!i||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);if(a[0]==4&&typeof decrypt_agile!="undefined")return decrypt_agile(a[1],i.content,r.password||"",r);if(a[0]==2&&typeof decrypt_std76!="undefined")return decrypt_std76(a[1],i.content,r.password||"",r);throw new Error("File is password-protected")}function jS(t,e){var r="";switch((e||{}).type||"base64"){case"buffer":return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]];case"base64":r=gi(t.slice(0,12));break;case"binary":r=t;break;case"array":return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]];default:throw new Error("Unrecognized type "+(e&&e.type||"undefined"))}return[r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2),r.charCodeAt(3),r.charCodeAt(4),r.charCodeAt(5),r.charCodeAt(6),r.charCodeAt(7)]}function D9(t,e){return xt.find(t,"EncryptedPackage")?P9(t,e):pk(t,e)}function k9(t,e){var r,n=t,i=e||{};return i.type||(i.type=St&&Buffer.isBuffer(t)?"buffer":"base64"),r=cD(n,i),I9(r,i)}function Sk(t,e){var r=0;e:for(;r<t.length;)switch(t.charCodeAt(r)){case 10:case 13:case 32:++r;break;case 60:return r1(t.slice(r),e);default:break e}return Nd.to_workbook(t,e)}function N9(t,e){var r="",n=jS(t,e);switch(e.type){case"base64":r=gi(t);break;case"binary":r=t;break;case"buffer":r=t.toString("binary");break;case"array":r=Gl(t);break;default:throw new Error("Unrecognized type "+e.type)}return n[0]==239&&n[1]==187&&n[2]==191&&(r=Yt(r)),e.type="binary",Sk(r,e)}function H9(t,e){var r=t;return e.type=="base64"&&(r=gi(r)),r=ga.utils.decode(1200,r.slice(2),"str"),e.type="binary",Sk(r,e)}function F9(t){return t.match(/[^\x00-\x7F]/)?Zh(t):t}function gw(t,e,r,n){return n?(r.type="string",Nd.to_workbook(t,r)):Nd.to_workbook(e,r)}function o1(t,e){G2();var r=e||{};if(typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer)return o1(new Uint8Array(t),(r=Xr(r),r.type="array",r));typeof Uint8Array!="undefined"&&t instanceof Uint8Array&&!r.type&&(r.type=typeof Deno!="undefined"?"buffer":"array");var n=t,i=[0,0,0,0],s=!1;if(r.cellStyles&&(r.cellNF=!0,r.sheetStubs=!0),Su={},r.dateNF&&(Su.dateNF=r.dateNF),r.type||(r.type=St&&Buffer.isBuffer(t)?"buffer":"base64"),r.type=="file"&&(r.type=St?"buffer":"binary",n=RB(t),typeof Uint8Array!="undefined"&&!St&&(r.type="array")),r.type=="string"&&(s=!0,r.type="binary",r.codepage=65001,n=F9(t)),r.type=="array"&&typeof Uint8Array!="undefined"&&t instanceof Uint8Array&&typeof ArrayBuffer!="undefined"){var o=new ArrayBuffer(3),a=new Uint8Array(o);if(a.foo="bar",!a.foo)return r=Xr(r),r.type="array",o1(RS(n),r)}switch((i=jS(n,r))[0]){case 208:if(i[1]===207&&i[2]===17&&i[3]===224&&i[4]===161&&i[5]===177&&i[6]===26&&i[7]===225)return D9(xt.read(n,r),r);break;case 9:if(i[1]<=8)return pk(n,r);break;case 60:return r1(n,r);case 73:if(i[1]===73&&i[2]===42&&i[3]===0)throw new Error("TIFF Image File is not a spreadsheet");if(i[1]===68)return hV(n,r);break;case 84:if(i[1]===65&&i[2]===66&&i[3]===76)return cV.to_workbook(n,r);break;case 80:return i[1]===75&&i[2]<9&&i[3]<9?k9(n,r):gw(t,n,r,s);case 239:return i[3]===60?r1(n,r):gw(t,n,r,s);case 255:if(i[1]===254)return H9(n,r);if(i[1]===0&&i[2]===2&&i[3]===0)return ld.to_workbook(n,r);break;case 0:if(i[1]===0&&(i[2]>=2&&i[3]===0||i[2]===0&&(i[3]===8||i[3]===9)))return ld.to_workbook(n,r);break;case 3:case 131:case 139:case 140:return pR.to_workbook(n,r);case 123:if(i[1]===92&&i[2]===114&&i[3]===116)return VV.to_workbook(n,r);break;case 10:case 13:case 32:return N9(n,r);case 137:if(i[1]===80&&i[2]===78&&i[3]===71)throw new Error("PNG Image File is not a spreadsheet");break}return aV.indexOf(i[0])>-1&&i[2]<=12&&i[3]<=31?pR.to_workbook(n,r):gw(t,n,r,s)}function L9(t,e,r,n,i,s,o,a){var l=qr(r),c=a.defval,u=a.raw||!Object.prototype.hasOwnProperty.call(a,"raw"),h=!0,d=i===1?[]:{};if(i!==1)if(Object.defineProperty)try{Object.defineProperty(d,"__rowNum__",{value:r,enumerable:!1})}catch(w){d.__rowNum__=r}else d.__rowNum__=r;if(!o||t[r])for(var f=e.s.c;f<=e.e.c;++f){var g=o?t[r][f]:t[n[f]+l];if(g===void 0||g.t===void 0){if(c===void 0)continue;s[f]!=null&&(d[s[f]]=c);continue}var m=g.v;switch(g.t){case"z":if(m==null)break;continue;case"e":m=m==0?null:void 0;break;case"s":case"d":case"b":case"n":break;default:throw new Error("unrecognized type "+g.t)}if(s[f]!=null){if(m==null)if(g.t=="e"&&m===null)d[s[f]]=null;else if(c!==void 0)d[s[f]]=c;else if(u&&m===null)d[s[f]]=null;else continue;else d[s[f]]=u&&(g.t!=="n"||g.t==="n"&&a.rawNumbers!==!1)?m:Fo(g,m,a);m!=null&&(h=!1)}}return{row:d,isempty:h}}function a1(t,e){if(t==null||t["!ref"]==null)return[];var r={t:"n",v:0},n=0,i=1,s=[],o=0,a="",l={s:{r:0,c:0},e:{r:0,c:0}},c=e||{},u=c.range!=null?c.range:t["!ref"];switch(c.header===1?n=1:c.header==="A"?n=2:Array.isArray(c.header)?n=3:c.header==null&&(n=0),typeof u){case"string":l=mr(u);break;case"number":l=mr(t["!ref"]),l.s.r=u;break;default:l=u}n>0&&(i=0);var h=qr(l.s.r),d=[],f=[],g=0,m=0,w=Array.isArray(t),C=l.s.r,S=0,v={};w&&!t[C]&&(t[C]=[]);var T=c.skipHidden&&t["!cols"]||[],A=c.skipHidden&&t["!rows"]||[];for(S=l.s.c;S<=l.e.c;++S)if(!(T[S]||{}).hidden)switch(d[S]=Ir(S),r=w?t[C][S]:t[d[S]+h],n){case 1:s[S]=S-l.s.c;break;case 2:s[S]=d[S];break;case 3:s[S]=c.header[S-l.s.c];break;default:if(r==null&&(r={w:"__EMPTY",t:"s"}),a=o=Fo(r,null,c),m=v[o]||0,!m)v[o]=1;else{do a=o+"_"+m++;while(v[a]);v[o]=m,v[a]=1}s[S]=a}for(C=l.s.r+i;C<=l.e.r;++C)if(!(A[C]||{}).hidden){var M=L9(t,l,C,d,n,s,w,c);(M.isempty===!1||(n===1?c.blankrows!==!1:!!c.blankrows))&&(f[g++]=M.row)}return f.length=g,f}var DR=/"/g;function $9(t,e,r,n,i,s,o,a){for(var l=!0,c=[],u="",h=qr(r),d=e.s.c;d<=e.e.c;++d)if(!!n[d]){var f=a.dense?(t[r]||[])[d]:t[n[d]+h];if(f==null)u="";else if(f.v!=null){l=!1,u=""+(a.rawNumbers&&f.t=="n"?f.v:Fo(f,null,a));for(var g=0,m=0;g!==u.length;++g)if((m=u.charCodeAt(g))===i||m===s||m===34||a.forceQuotes){u='"'+u.replace(DR,'""')+'"';break}u=="ID"&&(u='"ID"')}else f.f!=null&&!f.F?(l=!1,u="="+f.f,u.indexOf(",")>=0&&(u='"'+u.replace(DR,'""')+'"')):u="";c.push(u)}return a.blankrows===!1&&l?null:c.join(o)}function yk(t,e){var r=[],n=e==null?{}:e;if(t==null||t["!ref"]==null)return"";var i=mr(t["!ref"]),s=n.FS!==void 0?n.FS:",",o=s.charCodeAt(0),a=n.RS!==void 0?n.RS:`
  37. `,l=a.charCodeAt(0),c=new RegExp((s=="|"?"\\|":s)+"+$"),u="",h=[];n.dense=Array.isArray(t);for(var d=n.skipHidden&&t["!cols"]||[],f=n.skipHidden&&t["!rows"]||[],g=i.s.c;g<=i.e.c;++g)(d[g]||{}).hidden||(h[g]=Ir(g));for(var m=0,w=i.s.r;w<=i.e.r;++w)(f[w]||{}).hidden||(u=$9(t,i,w,h,o,l,s,n),u!=null&&(n.strip&&(u=u.replace(c,"")),(u||n.blankrows!==!1)&&r.push((m++?a:"")+u)));return delete n.dense,r.join("")}function B9(t,e){e||(e={}),e.FS=" ",e.RS=`
  38. `;var r=yk(t,e);return r}function W9(t){var e="",r,n="";if(t==null||t["!ref"]==null)return[];var i=mr(t["!ref"]),s="",o=[],a,l=[],c=Array.isArray(t);for(a=i.s.c;a<=i.e.c;++a)o[a]=Ir(a);for(var u=i.s.r;u<=i.e.r;++u)for(s=qr(u),a=i.s.c;a<=i.e.c;++a)if(e=o[a]+s,r=c?(t[u]||[])[a]:t[e],n="",r!==void 0){if(r.F!=null){if(e=r.F,!r.f)continue;n=r.f,e.indexOf(":")==-1&&(e=e+":"+e)}if(r.f!=null)n=r.f;else{if(r.t=="z")continue;if(r.t=="n"&&r.v!=null)n=""+r.v;else if(r.t=="b")n=r.v?"TRUE":"FALSE";else if(r.w!==void 0)n="'"+r.w;else{if(r.v===void 0)continue;r.t=="s"?n="'"+r.v:n=""+r.v}}l[l.length]=e+"="+n}return l}function xk(t,e,r){var n=r||{},i=+!n.skipHeader,s=t||{},o=0,a=0;if(s&&n.origin!=null)if(typeof n.origin=="number")o=n.origin;else{var l=typeof n.origin=="string"?Pn(n.origin):n.origin;o=l.r,a=l.c}var c,u={s:{c:0,r:0},e:{c:a,r:o+e.length-1+i}};if(s["!ref"]){var h=mr(s["!ref"]);u.e.c=Math.max(u.e.c,h.e.c),u.e.r=Math.max(u.e.r,h.e.r),o==-1&&(o=h.e.r+1,u.e.r=o+e.length-1+i)}else o==-1&&(o=0,u.e.r=e.length-1+i);var d=n.header||[],f=0;e.forEach(function(m,w){Xs(m).forEach(function(C){(f=d.indexOf(C))==-1&&(d[f=d.length]=C);var S=m[C],v="z",T="",A=nt({c:a+f,r:o+w+i});c=$d(s,A),S&&typeof S=="object"&&!(S instanceof Date)?s[A]=S:(typeof S=="number"?v="n":typeof S=="boolean"?v="b":typeof S=="string"?v="s":S instanceof Date?(v="d",n.cellDates||(v="n",S=kn(S)),T=n.dateNF||ot[14]):S===null&&n.nullError&&(v="e",S=0),c?(c.t=v,c.v=S,delete c.w,delete c.R,T&&(c.z=T)):s[A]=c={t:v,v:S},T&&(c.z=T))})}),u.e.c=Math.max(u.e.c,a+d.length-1);var g=qr(o);if(i)for(f=0;f<d.length;++f)s[Ir(f+a)+g]={t:"s",v:d[f]};return s["!ref"]=bt(u),s}function V9(t,e){return xk(null,t,e)}function $d(t,e,r){if(typeof e=="string"){if(Array.isArray(t)){var n=Pn(e);return t[n.r]||(t[n.r]=[]),t[n.r][n.c]||(t[n.r][n.c]={t:"z"})}return t[e]||(t[e]={t:"z"})}return typeof e!="number"?$d(t,nt(e)):$d(t,nt({r:e,c:r||0}))}function U9(t,e){if(typeof e=="number"){if(e>=0&&t.SheetNames.length>e)return e;throw new Error("Cannot find sheet # "+e)}else if(typeof e=="string"){var r=t.SheetNames.indexOf(e);if(r>-1)return r;throw new Error("Cannot find sheet name |"+e+"|")}else throw new Error("Cannot find sheet |"+e+"|")}function KS(){return{SheetNames:[],Sheets:{}}}function XS(t,e,r,n){var i=1;if(!r)for(;i<=65535&&t.SheetNames.indexOf(r="Sheet"+i)!=-1;++i,r=void 0);if(!r||t.SheetNames.length>=65535)throw new Error("Too many worksheets");if(n&&t.SheetNames.indexOf(r)>=0){var s=r.match(/(^.*?)(\d+)$/);i=s&&+s[2]||0;var o=s&&s[1]||r;for(++i;i<=65535&&t.SheetNames.indexOf(r=o+i)!=-1;++i);}if(_5(r),t.SheetNames.indexOf(r)>=0)throw new Error("Worksheet with name |"+r+"| already exists!");return t.SheetNames.push(r),t.Sheets[r]=e,r}function G9(t,e,r){t.Workbook||(t.Workbook={}),t.Workbook.Sheets||(t.Workbook.Sheets=[]);var n=U9(t,e);switch(t.Workbook.Sheets[n]||(t.Workbook.Sheets[n]={}),r){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+r)}t.Workbook.Sheets[n].Hidden=r}function Y9(t,e){return t.z=e,t}function bk(t,e,r){return e?(t.l={Target:e},r&&(t.l.Tooltip=r)):delete t.l,t}function z9(t,e,r){return bk(t,"#"+e,r)}function j9(t,e,r){t.c||(t.c=[]),t.c.push({t:e,a:r||"SheetJS"})}function K9(t,e,r,n){for(var i=typeof e!="string"?e:mr(e),s=typeof e=="string"?e:bt(e),o=i.s.r;o<=i.e.r;++o)for(var a=i.s.c;a<=i.e.c;++a){var l=$d(t,o,a);l.t="n",l.F=s,delete l.v,o==i.s.r&&a==i.s.c&&(l.f=r,n&&(l.D=!0))}return t}var X9={encode_col:Ir,encode_row:qr,encode_cell:nt,encode_range:bt,decode_col:kS,decode_row:DS,split_cell:o3,decode_cell:Pn,decode_range:Hu,format_cell:Fo,sheet_add_aoa:_D,sheet_add_json:xk,sheet_add_dom:wk,aoa_to_sheet:Fu,json_to_sheet:V9,table_to_sheet:vk,table_to_book:h9,sheet_to_csv:yk,sheet_to_txt:B9,sheet_to_json:a1,sheet_to_html:u9,sheet_to_formulae:W9,sheet_to_row_object_array:a1,sheet_get_cell:$d,book_new:KS,book_append_sheet:XS,book_set_sheet_visibility:G9,cell_set_number_format:Y9,cell_set_hyperlink:bk,cell_set_internal_link:z9,cell_add_comment:j9,sheet_set_array_formula:K9,consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}},th=function(t){return t&&t.Math===Math&&t},mn=th(typeof globalThis=="object"&&globalThis)||th(typeof window=="object"&&window)||th(typeof self=="object"&&self)||th(typeof Nf=="object"&&Nf)||th(typeof Nf=="object"&&Nf)||function(){return this}()||Function("return this")(),qS={},Fi=function(t){try{return!!t()}catch(e){return!0}},q9=Fi,ps=!q9(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Z9=Fi,sp=!Z9(function(){var t=function(){}.bind();return typeof t!="function"||t.hasOwnProperty("prototype")}),J9=sp,qf=Function.prototype.call,ac=J9?qf.bind(qf):function(){return qf.apply(qf,arguments)},Ek={},Rk={}.propertyIsEnumerable,Tk=Object.getOwnPropertyDescriptor,Q9=Tk&&!Rk.call({1:2},1);Ek.f=Q9?function(e){var r=Tk(this,e);return!!r&&r.enumerable}:Rk;var op=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}},_k=sp,Ak=Function.prototype,l1=Ak.call,e7=_k&&Ak.bind.bind(l1,l1),Fn=_k?e7:function(t){return function(){return l1.apply(t,arguments)}},Mk=Fn,t7=Mk({}.toString),r7=Mk("".slice),Lu=function(t){return r7(t7(t),8,-1)},n7=Fn,i7=Fi,s7=Lu,mw=Object,o7=n7("".split),a7=i7(function(){return!mw("z").propertyIsEnumerable(0)})?function(t){return s7(t)==="String"?o7(t,""):mw(t)}:mw,ZS=function(t){return t==null},l7=ZS,c7=TypeError,Ok=function(t){if(l7(t))throw new c7("Can't call method on "+t);return t},u7=a7,h7=Ok,ap=function(t){return u7(h7(t))},pw=typeof document=="object"&&document.all,pn=typeof pw=="undefined"&&pw!==void 0?function(t){return typeof t=="function"||t===pw}:function(t){return typeof t=="function"},d7=pn,Va=function(t){return typeof t=="object"?t!==null:d7(t)},ww=mn,f7=pn,g7=function(t){return f7(t)?t:void 0},cf=function(t,e){return arguments.length<2?g7(ww[t]):ww[t]&&ww[t][e]},m7=Fn,JS=m7({}.isPrototypeOf),QS=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Ik=mn,vw=QS,kR=Ik.process,NR=Ik.Deno,HR=kR&&kR.versions||NR&&NR.version,FR=HR&&HR.v8,ss,om;FR&&(ss=FR.split("."),om=ss[0]>0&&ss[0]<4?1:+(ss[0]+ss[1]));!om&&vw&&(ss=vw.match(/Edge\/(\d+)/),(!ss||ss[1]>=74)&&(ss=vw.match(/Chrome\/(\d+)/),ss&&(om=+ss[1])));var p7=om,LR=p7,w7=Fi,v7=mn,C7=v7.String,ey=!!Object.getOwnPropertySymbols&&!w7(function(){var t=Symbol("symbol detection");return!C7(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&LR&&LR<41}),S7=ey,Pk=S7&&!Symbol.sham&&typeof Symbol.iterator=="symbol",y7=cf,x7=pn,b7=JS,E7=Pk,R7=Object,ty=E7?function(t){return typeof t=="symbol"}:function(t){var e=y7("Symbol");return x7(e)&&b7(e.prototype,R7(t))},T7=String,lp=function(t){try{return T7(t)}catch(e){return"Object"}},_7=pn,A7=lp,M7=TypeError,cp=function(t){if(_7(t))return t;throw new M7(A7(t)+" is not a function")},O7=cp,I7=ZS,ry=function(t,e){var r=t[e];return I7(r)?void 0:O7(r)},Cw=ac,Sw=pn,yw=Va,P7=TypeError,D7=function(t,e){var r,n;if(e==="string"&&Sw(r=t.toString)&&!yw(n=Cw(r,t))||Sw(r=t.valueOf)&&!yw(n=Cw(r,t))||e!=="string"&&Sw(r=t.toString)&&!yw(n=Cw(r,t)))return n;throw new P7("Can't convert object to primitive value")},up={exports:{}},$R=mn,k7=Object.defineProperty,ny=function(t,e){try{k7($R,t,{value:e,configurable:!0,writable:!0})}catch(r){$R[t]=e}return e},N7=mn,H7=ny,BR="__core-js_shared__",WR=up.exports=N7[BR]||H7(BR,{});(WR.versions||(WR.versions=[])).push({version:"3.36.0",mode:"global",copyright:"\xA9 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.36.0/LICENSE",source:"https://github.com/zloirock/core-js"});var VR=up.exports,Dk=function(t,e){return VR[t]||(VR[t]=e||{})},F7=Ok,L7=Object,hp=function(t){return L7(F7(t))},$7=Fn,B7=hp,W7=$7({}.hasOwnProperty),Vo=Object.hasOwn||function(e,r){return W7(B7(e),r)},V7=Fn,U7=0,G7=Math.random(),Y7=V7(1 .toString),kk=function(t){return"Symbol("+(t===void 0?"":t)+")_"+Y7(++U7+G7,36)},z7=mn,j7=Dk,UR=Vo,K7=kk,X7=ey,q7=Pk,du=z7.Symbol,xw=j7("wks"),Z7=q7?du.for||du:du&&du.withoutSetter||K7,$u=function(t){return UR(xw,t)||(xw[t]=X7&&UR(du,t)?du[t]:Z7("Symbol."+t)),xw[t]},J7=ac,GR=Va,YR=ty,Q7=ry,eG=D7,tG=$u,rG=TypeError,nG=tG("toPrimitive"),iG=function(t,e){if(!GR(t)||YR(t))return t;var r=Q7(t,nG),n;if(r){if(e===void 0&&(e="default"),n=J7(r,t,e),!GR(n)||YR(n))return n;throw new rG("Can't convert object to primitive value")}return e===void 0&&(e="number"),eG(t,e)},sG=iG,oG=ty,Nk=function(t){var e=sG(t,"string");return oG(e)?e:e+""},aG=mn,zR=Va,c1=aG.document,lG=zR(c1)&&zR(c1.createElement),iy=function(t){return lG?c1.createElement(t):{}},cG=ps,uG=Fi,hG=iy,Hk=!cG&&!uG(function(){return Object.defineProperty(hG("div"),"a",{get:function(){return 7}}).a!==7}),dG=ps,fG=ac,gG=Ek,mG=op,pG=ap,wG=Nk,vG=Vo,CG=Hk,jR=Object.getOwnPropertyDescriptor;qS.f=dG?jR:function(e,r){if(e=pG(e),r=wG(r),CG)try{return jR(e,r)}catch(n){}if(vG(e,r))return mG(!fG(gG.f,e,r),e[r])};var Ua={},SG=ps,yG=Fi,Fk=SG&&yG(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),xG=Va,bG=String,EG=TypeError,Ga=function(t){if(xG(t))return t;throw new EG(bG(t)+" is not an object")},RG=ps,TG=Hk,_G=Fk,Zf=Ga,KR=Nk,AG=TypeError,bw=Object.defineProperty,MG=Object.getOwnPropertyDescriptor,Ew="enumerable",Rw="configurable",Tw="writable";Ua.f=RG?_G?function(e,r,n){if(Zf(e),r=KR(r),Zf(n),typeof e=="function"&&r==="prototype"&&"value"in n&&Tw in n&&!n[Tw]){var i=MG(e,r);i&&i[Tw]&&(e[r]=n.value,n={configurable:Rw in n?n[Rw]:i[Rw],enumerable:Ew in n?n[Ew]:i[Ew],writable:!1})}return bw(e,r,n)}:bw:function(e,r,n){if(Zf(e),r=KR(r),Zf(n),TG)try{return bw(e,r,n)}catch(i){}if("get"in n||"set"in n)throw new AG("Accessors not supported");return"value"in n&&(e[r]=n.value),e};var OG=ps,IG=Ua,PG=op,uf=OG?function(t,e,r){return IG.f(t,e,PG(1,r))}:function(t,e,r){return t[e]=r,t},Lk={exports:{}},u1=ps,DG=Vo,$k=Function.prototype,kG=u1&&Object.getOwnPropertyDescriptor,sy=DG($k,"name"),NG=sy&&function(){}.name==="something",HG=sy&&(!u1||u1&&kG($k,"name").configurable),FG={EXISTS:sy,PROPER:NG,CONFIGURABLE:HG},LG=Fn,$G=pn,h1=up.exports,BG=LG(Function.toString);$G(h1.inspectSource)||(h1.inspectSource=function(t){return BG(t)});var WG=h1.inspectSource,VG=mn,UG=pn,XR=VG.WeakMap,GG=UG(XR)&&/native code/.test(String(XR)),YG=Dk,zG=kk,qR=YG("keys"),Bk=function(t){return qR[t]||(qR[t]=zG(t))},oy={},jG=GG,Wk=mn,KG=Va,XG=uf,_w=Vo,Aw=up.exports,qG=Bk,ZG=oy,ZR="Object already initialized",d1=Wk.TypeError,JG=Wk.WeakMap,am,Bd,lm,QG=function(t){return lm(t)?Bd(t):am(t,{})},eY=function(t){return function(e){var r;if(!KG(e)||(r=Bd(e)).type!==t)throw new d1("Incompatible receiver, "+t+" required");return r}};if(jG||Aw.state){var ys=Aw.state||(Aw.state=new JG);ys.get=ys.get,ys.has=ys.has,ys.set=ys.set,am=function(t,e){if(ys.has(t))throw new d1(ZR);return e.facade=t,ys.set(t,e),e},Bd=function(t){return ys.get(t)||{}},lm=function(t){return ys.has(t)}}else{var mc=qG("state");ZG[mc]=!0,am=function(t,e){if(_w(t,mc))throw new d1(ZR);return e.facade=t,XG(t,mc,e),e},Bd=function(t){return _w(t,mc)?t[mc]:{}},lm=function(t){return _w(t,mc)}}var tY={set:am,get:Bd,has:lm,enforce:QG,getterFor:eY},ay=Fn,rY=Fi,nY=pn,Jf=Vo,f1=ps,iY=FG.CONFIGURABLE,sY=WG,Vk=tY,oY=Vk.enforce,aY=Vk.get,JR=String,b0=Object.defineProperty,lY=ay("".slice),cY=ay("".replace),uY=ay([].join),hY=f1&&!rY(function(){return b0(function(){},"length",{value:8}).length!==8}),dY=String(String).split("String"),fY=Lk.exports=function(t,e,r){lY(JR(e),0,7)==="Symbol("&&(e="["+cY(JR(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!Jf(t,"name")||iY&&t.name!==e)&&(f1?b0(t,"name",{value:e,configurable:!0}):t.name=e),hY&&r&&Jf(r,"arity")&&t.length!==r.arity&&b0(t,"length",{value:r.arity});try{r&&Jf(r,"constructor")&&r.constructor?f1&&b0(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(i){}var n=oY(t);return Jf(n,"source")||(n.source=uY(dY,typeof e=="string"?e:"")),t};Function.prototype.toString=fY(function(){return nY(this)&&aY(this).source||sY(this)},"toString");var gY=pn,mY=Ua,pY=Lk.exports,wY=ny,vY=function(t,e,r,n){n||(n={});var i=n.enumerable,s=n.name!==void 0?n.name:e;if(gY(r)&&pY(r,s,n),n.global)i?t[e]=r:wY(e,r);else{try{n.unsafe?t[e]&&(i=!0):delete t[e]}catch(o){}i?t[e]=r:mY.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},Uk={},CY=Math.ceil,SY=Math.floor,yY=Math.trunc||function(e){var r=+e;return(r>0?SY:CY)(r)},xY=yY,ly=function(t){var e=+t;return e!==e||e===0?0:xY(e)},bY=ly,EY=Math.max,RY=Math.min,TY=function(t,e){var r=bY(t);return r<0?EY(r+e,0):RY(r,e)},_Y=ly,AY=Math.min,MY=function(t){var e=_Y(t);return e>0?AY(e,9007199254740991):0},OY=MY,hf=function(t){return OY(t.length)},IY=ap,PY=TY,DY=hf,QR=function(t){return function(e,r,n){var i=IY(e),s=DY(i);if(s===0)return!t&&-1;var o=PY(n,s),a;if(t&&r!==r){for(;s>o;)if(a=i[o++],a!==a)return!0}else for(;s>o;o++)if((t||o in i)&&i[o]===r)return t||o||0;return!t&&-1}},kY={includes:QR(!0),indexOf:QR(!1)},NY=Fn,Mw=Vo,HY=ap,FY=kY.indexOf,LY=oy,eT=NY([].push),Gk=function(t,e){var r=HY(t),n=0,i=[],s;for(s in r)!Mw(LY,s)&&Mw(r,s)&&eT(i,s);for(;e.length>n;)Mw(r,s=e[n++])&&(~FY(i,s)||eT(i,s));return i},cy=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],$Y=Gk,BY=cy,WY=BY.concat("length","prototype");Uk.f=Object.getOwnPropertyNames||function(e){return $Y(e,WY)};var Yk={};Yk.f=Object.getOwnPropertySymbols;var VY=cf,UY=Fn,GY=Uk,YY=Yk,zY=Ga,jY=UY([].concat),KY=VY("Reflect","ownKeys")||function(e){var r=GY.f(zY(e)),n=YY.f;return n?jY(r,n(e)):r},tT=Vo,XY=KY,qY=qS,ZY=Ua,zk=function(t,e,r){for(var n=XY(e),i=ZY.f,s=qY.f,o=0;o<n.length;o++){var a=n[o];!tT(t,a)&&!(r&&tT(r,a))&&i(t,a,s(e,a))}},JY=Fi,QY=pn,ez=/#|\.prototype\./,df=function(t,e){var r=rz[tz(t)];return r===iz?!0:r===nz?!1:QY(e)?JY(e):!!e},tz=df.normalize=function(t){return String(t).replace(ez,".").toLowerCase()},rz=df.data={},nz=df.NATIVE="N",iz=df.POLYFILL="P",sz=df,Qf=mn,oz=qS.f,az=uf,lz=vY,cz=ny,uz=zk,hz=sz,Ya=function(t,e){var r=t.target,n=t.global,i=t.stat,s,o,a,l,c,u;if(n?o=Qf:i?o=Qf[r]||cz(r,{}):o=Qf[r]&&Qf[r].prototype,o)for(a in e){if(c=e[a],t.dontCallGetSet?(u=oz(o,a),l=u&&u.value):l=o[a],s=hz(n?a:r+(i?".":"#")+a,t.forced),!s&&l!==void 0){if(typeof c==typeof l)continue;uz(c,l)}(t.sham||l&&l.sham)&&az(c,"sham",!0),lz(o,a,c,t)}},dz=Lu,jk=Array.isArray||function(e){return dz(e)==="Array"},fz=ps,gz=jk,mz=TypeError,pz=Object.getOwnPropertyDescriptor,wz=fz&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}(),Kk=wz?function(t,e){if(gz(t)&&!pz(t,"length").writable)throw new mz("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e},vz=TypeError,Cz=9007199254740991,Xk=function(t){if(t>Cz)throw vz("Maximum allowed index exceeded");return t},Sz=Ya,yz=hp,xz=hf,bz=Kk,Ez=Xk,Rz=Fi,Tz=Rz(function(){return[].push.call({length:4294967296},1)!==4294967297}),_z=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}},Az=Tz||!_z();Sz({target:"Array",proto:!0,arity:1,forced:Az},{push:function(e){var r=yz(this),n=xz(r),i=arguments.length;Ez(n+i);for(var s=0;s<i;s++)r[n]=arguments[s],n++;return bz(r,n),n}});var Mz=sp,qk=Function.prototype,rT=qk.apply,nT=qk.call,dp=typeof Reflect=="object"&&Reflect.apply||(Mz?nT.bind(rT):function(){return nT.apply(rT,arguments)}),Oz=Fn,Iz=cp,Pz=function(t,e,r){try{return Oz(Iz(Object.getOwnPropertyDescriptor(t,e)[r]))}catch(n){}},Dz=Va,kz=function(t){return Dz(t)||t===null},Nz=kz,Hz=String,Fz=TypeError,Lz=function(t){if(Nz(t))return t;throw new Fz("Can't set "+Hz(t)+" as a prototype")},$z=Pz,Bz=Ga,Wz=Lz,Zk=Object.setPrototypeOf||("__proto__"in{}?function(){var t=!1,e={},r;try{r=$z(Object.prototype,"__proto__","set"),r(e,[]),t=e instanceof Array}catch(n){}return function(i,s){return Bz(i),Wz(s),t?r(i,s):i.__proto__=s,i}}():void 0),Vz=Ua.f,Uz=function(t,e,r){r in t||Vz(t,r,{configurable:!0,get:function(){return e[r]},set:function(n){e[r]=n}})},Gz=pn,Yz=Va,iT=Zk,zz=function(t,e,r){var n,i;return iT&&Gz(n=e.constructor)&&n!==r&&Yz(i=n.prototype)&&i!==r.prototype&&iT(t,i),t},jz=$u,Kz=jz("toStringTag"),Jk={};Jk[Kz]="z";var Xz=String(Jk)==="[object z]",qz=Xz,Zz=pn,E0=Lu,Jz=$u,Qz=Jz("toStringTag"),ej=Object,tj=E0(function(){return arguments}())==="Arguments",rj=function(t,e){try{return t[e]}catch(r){}},Qk=qz?E0:function(t){var e,r,n;return t===void 0?"Undefined":t===null?"Null":typeof(r=rj(e=ej(t),Qz))=="string"?r:tj?E0(e):(n=E0(e))==="Object"&&Zz(e.callee)?"Arguments":n},nj=Qk,ij=String,eN=function(t){if(nj(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return ij(t)},sj=eN,oj=function(t,e){return t===void 0?arguments.length<2?"":e:sj(t)},aj=Va,lj=uf,cj=function(t,e){aj(e)&&"cause"in e&&lj(t,"cause",e.cause)},uj=Fn,tN=Error,hj=uj("".replace),dj=function(t){return String(new tN(t).stack)}("zxcasd"),rN=/\n\s*at [^:]*:[^\n]*/,fj=rN.test(dj),gj=function(t,e){if(fj&&typeof t=="string"&&!tN.prepareStackTrace)for(;e--;)t=hj(t,rN,"");return t},mj=Fi,pj=op,wj=!mj(function(){var t=new Error("a");return"stack"in t?(Object.defineProperty(t,"stack",pj(1,7)),t.stack!==7):!0}),vj=uf,Cj=gj,Sj=wj,sT=Error.captureStackTrace,yj=function(t,e,r,n){Sj&&(sT?sT(t,e):vj(t,"stack",Cj(r,n)))},oT=cf,xj=Vo,aT=uf,bj=JS,lT=Zk,cT=zk,uT=Uz,Ej=zz,Rj=oj,Tj=cj,_j=yj,Aj=ps,Mj=function(t,e,r,n){var i="stackTraceLimit",s=n?2:1,o=t.split("."),a=o[o.length-1],l=oT.apply(null,o);if(!!l){var c=l.prototype;if(xj(c,"cause")&&delete c.cause,!r)return l;var u=oT("Error"),h=e(function(d,f){var g=Rj(n?f:d,void 0),m=n?new l(d):new l;return g!==void 0&&aT(m,"message",g),_j(m,h,m.stack,2),this&&bj(c,this)&&Ej(m,this,h),arguments.length>s&&Tj(m,arguments[s]),m});h.prototype=c,a!=="Error"?lT?lT(h,u):cT(h,u,{name:!0}):Aj&&i in l&&(uT(h,l,i),uT(h,l,"prepareStackTrace")),cT(h,l);try{c.name!==a&&aT(c,"name",a),c.constructor=h}catch(d){}return h}},nN=Ya,Oj=mn,eo=dp,iN=Mj,g1="WebAssembly",hT=Oj[g1],cm=new Error("e",{cause:7}).cause!==7,lc=function(t,e){var r={};r[t]=iN(t,e,cm),nN({global:!0,constructor:!0,arity:1,forced:cm},r)},uy=function(t,e){if(hT&&hT[t]){var r={};r[t]=iN(g1+"."+t,e,cm),nN({target:g1,stat:!0,constructor:!0,arity:1,forced:cm},r)}};lc("Error",function(t){return function(r){return eo(t,this,arguments)}});lc("EvalError",function(t){return function(r){return eo(t,this,arguments)}});lc("RangeError",function(t){return function(r){return eo(t,this,arguments)}});lc("ReferenceError",function(t){return function(r){return eo(t,this,arguments)}});lc("SyntaxError",function(t){return function(r){return eo(t,this,arguments)}});lc("TypeError",function(t){return function(r){return eo(t,this,arguments)}});lc("URIError",function(t){return function(r){return eo(t,this,arguments)}});uy("CompileError",function(t){return function(r){return eo(t,this,arguments)}});uy("LinkError",function(t){return function(r){return eo(t,this,arguments)}});uy("RuntimeError",function(t){return function(r){return eo(t,this,arguments)}});var Ij=Lu,Pj=Fn,Dj=function(t){if(Ij(t)==="Function")return Pj(t)},dT=Dj,kj=cp,Nj=sp,Hj=dT(dT.bind),sN=function(t,e){return kj(t),e===void 0?t:Nj?Hj(t,e):function(){return t.apply(e,arguments)}},Fj=cf,oN=Fj("document","documentElement"),Lj=Fn,hy=Lj([].slice),$j=TypeError,aN=function(t,e){if(t<e)throw new $j("Not enough arguments");return t},Bj=QS,Wj=/(?:ipad|iphone|ipod).*applewebkit/i.test(Bj),Vj=mn,Uj=Lu,Gj=Uj(Vj.process)==="process",di=mn,Yj=dp,zj=sN,fT=pn,jj=Vo,lN=Fi,gT=oN,Kj=hy,mT=iy,Xj=aN,qj=Wj,Zj=Gj,m1=di.setImmediate,p1=di.clearImmediate,Jj=di.process,Ow=di.Dispatch,Qj=di.Function,pT=di.MessageChannel,eK=di.String,Iw=0,dd={},wT="onreadystatechange",Wd,Za,Pw,Dw;lN(function(){Wd=di.location});var dy=function(t){if(jj(dd,t)){var e=dd[t];delete dd[t],e()}},kw=function(t){return function(){dy(t)}},vT=function(t){dy(t.data)},CT=function(t){di.postMessage(eK(t),Wd.protocol+"//"+Wd.host)};(!m1||!p1)&&(m1=function(e){Xj(arguments.length,1);var r=fT(e)?e:Qj(e),n=Kj(arguments,1);return dd[++Iw]=function(){Yj(r,void 0,n)},Za(Iw),Iw},p1=function(e){delete dd[e]},Zj?Za=function(t){Jj.nextTick(kw(t))}:Ow&&Ow.now?Za=function(t){Ow.now(kw(t))}:pT&&!qj?(Pw=new pT,Dw=Pw.port2,Pw.port1.onmessage=vT,Za=zj(Dw.postMessage,Dw)):di.addEventListener&&fT(di.postMessage)&&!di.importScripts&&Wd&&Wd.protocol!=="file:"&&!lN(CT)?(Za=CT,di.addEventListener("message",vT,!1)):wT in mT("script")?Za=function(t){gT.appendChild(mT("script"))[wT]=function(){gT.removeChild(this),dy(t)}}:Za=function(t){setTimeout(kw(t),0)});var cN={set:m1,clear:p1},tK=Ya,rK=mn,ST=cN.clear;tK({global:!0,bind:!0,enumerable:!0,forced:rK.clearImmediate!==ST},{clearImmediate:ST});var nK=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",uN=mn,iK=dp,sK=pn,oK=nK,aK=QS,lK=hy,cK=aN,uK=uN.Function,hK=/MSIE .\./.test(aK)||oK&&function(){var t=uN.Bun.version.split(".");return t.length<3||t[0]==="0"&&(t[1]<3||t[1]==="3"&&t[2]==="0")}(),dK=function(t,e){var r=e?2:1;return hK?function(n,i){var s=cK(arguments.length,1)>r,o=sK(n)?n:uK(n),a=s?lK(arguments,r):[],l=s?function(){iK(o,this,a)}:o;return e?t(l,i):t(l)}:t},fK=Ya,hN=mn,yT=cN.set,gK=dK,xT=hN.setImmediate?gK(yT,!1):yT;fK({global:!0,bind:!0,enumerable:!0,forced:hN.setImmediate!==xT},{setImmediate:xT});/*! @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 pa(t){return pa=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},pa(t)}function w1(t,e){return w1=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},w1(t,e)}function mK(){if(typeof Reflect=="undefined"||!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(t){return!1}}function R0(t,e,r){return mK()?R0=Reflect.construct:R0=function(i,s,o){var a=[null];a.push.apply(a,s);var l=Function.bind.apply(i,a),c=new l;return o&&w1(c,o.prototype),c},R0.apply(null,arguments)}function Qi(t){return pK(t)||wK(t)||vK(t)||CK()}function pK(t){if(Array.isArray(t))return v1(t)}function wK(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function vK(t,e){if(!!t){if(typeof t=="string")return v1(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v1(t,e)}}function v1(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function CK(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
  39. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var SK=Object.hasOwnProperty,bT=Object.setPrototypeOf,yK=Object.isFrozen,xK=Object.getPrototypeOf,bK=Object.getOwnPropertyDescriptor,Nn=Object.freeze,hs=Object.seal,EK=Object.create,dN=typeof Reflect!="undefined"&&Reflect,um=dN.apply,C1=dN.construct;um||(um=function(e,r,n){return e.apply(r,n)});Nn||(Nn=function(e){return e});hs||(hs=function(e){return e});C1||(C1=function(e,r){return R0(e,Qi(r))});var RK=ki(Array.prototype.forEach),ET=ki(Array.prototype.pop),rh=ki(Array.prototype.push),T0=ki(String.prototype.toLowerCase),Nw=ki(String.prototype.toString),TK=ki(String.prototype.match),Ui=ki(String.prototype.replace),_K=ki(String.prototype.indexOf),AK=ki(String.prototype.trim),yn=ki(RegExp.prototype.test),Hw=MK(TypeError);function ki(t){return function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return um(t,e,n)}}function MK(t){return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return C1(t,r)}}function ft(t,e,r){var n;r=(n=r)!==null&&n!==void 0?n:T0,bT&&bT(t,null);for(var i=e.length;i--;){var s=e[i];if(typeof s=="string"){var o=r(s);o!==s&&(yK(e)||(e[i]=o),s=o)}t[s]=!0}return t}function Ja(t){var e=EK(null),r;for(r in t)um(SK,t,[r])===!0&&(e[r]=t[r]);return e}function eg(t,e){for(;t!==null;){var r=bK(t,e);if(r){if(r.get)return ki(r.get);if(typeof r.value=="function")return ki(r.value)}t=xK(t)}function n(i){return console.warn("fallback value for",i),null}return n}var RT=Nn(["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"]),Fw=Nn(["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"]),Lw=Nn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),OK=Nn(["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"]),$w=Nn(["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"]),IK=Nn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),TT=Nn(["#text"]),_T=Nn(["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"]),Bw=Nn(["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"]),AT=Nn(["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"]),tg=Nn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),PK=hs(/\{\{[\w\W]*|[\w\W]*\}\}/gm),DK=hs(/<%[\w\W]*|[\w\W]*%>/gm),kK=hs(/\${[\w\W]*}/gm),NK=hs(/^data-[\-\w.\u00B7-\uFFFF]/),HK=hs(/^aria-[\-\w]+$/),FK=hs(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),LK=hs(/^(?:\w+script|data):/i),$K=hs(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),BK=hs(/^html$/i),WK=function(){return typeof window=="undefined"?null:window},VK=function(e,r){if(pa(e)!=="object"||typeof e.createPolicy!="function")return null;var n=null,i="data-tt-policy-suffix";r.currentScript&&r.currentScript.hasAttribute(i)&&(n=r.currentScript.getAttribute(i));var s="dompurify"+(n?"#"+n:"");try{return e.createPolicy(s,{createHTML:function(a){return a},createScriptURL:function(a){return a}})}catch(o){return console.warn("TrustedTypes policy "+s+" could not be created."),null}};function fN(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:WK(),e=function(P){return fN(P)};if(e.version="2.4.7",e.removed=[],!t||!t.document||t.document.nodeType!==9)return e.isSupported=!1,e;var r=t.document,n=t.document,i=t.DocumentFragment,s=t.HTMLTemplateElement,o=t.Node,a=t.Element,l=t.NodeFilter,c=t.NamedNodeMap,u=c===void 0?t.NamedNodeMap||t.MozNamedAttrMap:c,h=t.HTMLFormElement,d=t.DOMParser,f=t.trustedTypes,g=a.prototype,m=eg(g,"cloneNode"),w=eg(g,"nextSibling"),C=eg(g,"childNodes"),S=eg(g,"parentNode");if(typeof s=="function"){var v=n.createElement("template");v.content&&v.content.ownerDocument&&(n=v.content.ownerDocument)}var T=VK(f,r),A=T?T.createHTML(""):"",M=n,E=M.implementation,Y=M.createNodeIterator,D=M.createDocumentFragment,U=M.getElementsByTagName,X=r.importNode,G={};try{G=Ja(n).documentMode?n.documentMode:{}}catch(Z){}var ae={};e.isSupported=typeof S=="function"&&E&&E.createHTMLDocument!==void 0&&G!==9;var ve=PK,me=DK,Re=kK,Ce=NK,_e=HK,p=LK,y=$K,b=FK,x=null,O=ft({},[].concat(Qi(RT),Qi(Fw),Qi(Lw),Qi($w),Qi(TT))),_=null,N=ft({},[].concat(Qi(_T),Qi(Bw),Qi(AT),Qi(tg))),K=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}})),le=null,ce=null,te=!0,ge=!0,Me=!1,L=!0,Fe=!1,ue=!1,ze=!1,Ie=!1,we=!1,Be=!1,Le=!1,I=!0,F=!1,z="user-content-",se=!0,q=!1,ie={},Q=null,ee=ft({},["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"]),oe=null,ne=ft({},["audio","video","img","source","image","track"]),J=null,Se=ft({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Oe="http://www.w3.org/1998/Math/MathML",Pe="http://www.w3.org/2000/svg",je="http://www.w3.org/1999/xhtml",Qe=je,kt=!1,lt=null,Rt=ft({},[Oe,Pe,je],Nw),$t,no=["application/xhtml+xml","text/html"],Xa="text/html",qt,hr=null,io=n.createElement("form"),Gr=function(P){return P instanceof RegExp||P instanceof Function},pr=function(P){hr&&hr===P||((!P||pa(P)!=="object")&&(P={}),P=Ja(P),$t=no.indexOf(P.PARSER_MEDIA_TYPE)===-1?$t=Xa:$t=P.PARSER_MEDIA_TYPE,qt=$t==="application/xhtml+xml"?Nw:T0,x="ALLOWED_TAGS"in P?ft({},P.ALLOWED_TAGS,qt):O,_="ALLOWED_ATTR"in P?ft({},P.ALLOWED_ATTR,qt):N,lt="ALLOWED_NAMESPACES"in P?ft({},P.ALLOWED_NAMESPACES,Nw):Rt,J="ADD_URI_SAFE_ATTR"in P?ft(Ja(Se),P.ADD_URI_SAFE_ATTR,qt):Se,oe="ADD_DATA_URI_TAGS"in P?ft(Ja(ne),P.ADD_DATA_URI_TAGS,qt):ne,Q="FORBID_CONTENTS"in P?ft({},P.FORBID_CONTENTS,qt):ee,le="FORBID_TAGS"in P?ft({},P.FORBID_TAGS,qt):{},ce="FORBID_ATTR"in P?ft({},P.FORBID_ATTR,qt):{},ie="USE_PROFILES"in P?P.USE_PROFILES:!1,te=P.ALLOW_ARIA_ATTR!==!1,ge=P.ALLOW_DATA_ATTR!==!1,Me=P.ALLOW_UNKNOWN_PROTOCOLS||!1,L=P.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Fe=P.SAFE_FOR_TEMPLATES||!1,ue=P.WHOLE_DOCUMENT||!1,we=P.RETURN_DOM||!1,Be=P.RETURN_DOM_FRAGMENT||!1,Le=P.RETURN_TRUSTED_TYPE||!1,Ie=P.FORCE_BODY||!1,I=P.SANITIZE_DOM!==!1,F=P.SANITIZE_NAMED_PROPS||!1,se=P.KEEP_CONTENT!==!1,q=P.IN_PLACE||!1,b=P.ALLOWED_URI_REGEXP||b,Qe=P.NAMESPACE||je,K=P.CUSTOM_ELEMENT_HANDLING||{},P.CUSTOM_ELEMENT_HANDLING&&Gr(P.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(K.tagNameCheck=P.CUSTOM_ELEMENT_HANDLING.tagNameCheck),P.CUSTOM_ELEMENT_HANDLING&&Gr(P.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(K.attributeNameCheck=P.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),P.CUSTOM_ELEMENT_HANDLING&&typeof P.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(K.allowCustomizedBuiltInElements=P.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Fe&&(ge=!1),Be&&(we=!0),ie&&(x=ft({},Qi(TT)),_=[],ie.html===!0&&(ft(x,RT),ft(_,_T)),ie.svg===!0&&(ft(x,Fw),ft(_,Bw),ft(_,tg)),ie.svgFilters===!0&&(ft(x,Lw),ft(_,Bw),ft(_,tg)),ie.mathMl===!0&&(ft(x,$w),ft(_,AT),ft(_,tg))),P.ADD_TAGS&&(x===O&&(x=Ja(x)),ft(x,P.ADD_TAGS,qt)),P.ADD_ATTR&&(_===N&&(_=Ja(_)),ft(_,P.ADD_ATTR,qt)),P.ADD_URI_SAFE_ATTR&&ft(J,P.ADD_URI_SAFE_ATTR,qt),P.FORBID_CONTENTS&&(Q===ee&&(Q=Ja(Q)),ft(Q,P.FORBID_CONTENTS,qt)),se&&(x["#text"]=!0),ue&&ft(x,["html","head","body"]),x.table&&(ft(x,["tbody"]),delete le.tbody),Nn&&Nn(P),hr=P)},Bt=ft({},["mi","mo","mn","ms","mtext"]),Pf=ft({},["foreignobject","desc","title","annotation-xml"]),tw=ft({},["title","style","font","a","script"]),dc=ft({},Fw);ft(dc,Lw),ft(dc,OK);var qu=ft({},$w);ft(qu,IK);var Zu=function(P){var re=S(P);(!re||!re.tagName)&&(re={namespaceURI:Qe,tagName:"template"});var fe=T0(P.tagName),Ee=T0(re.tagName);return lt[P.namespaceURI]?P.namespaceURI===Pe?re.namespaceURI===je?fe==="svg":re.namespaceURI===Oe?fe==="svg"&&(Ee==="annotation-xml"||Bt[Ee]):Boolean(dc[fe]):P.namespaceURI===Oe?re.namespaceURI===je?fe==="math":re.namespaceURI===Pe?fe==="math"&&Pf[Ee]:Boolean(qu[fe]):P.namespaceURI===je?re.namespaceURI===Pe&&!Pf[Ee]||re.namespaceURI===Oe&&!Bt[Ee]?!1:!qu[fe]&&(tw[fe]||!dc[fe]):!!($t==="application/xhtml+xml"&&lt[P.namespaceURI]):!1},Bi=function(P){rh(e.removed,{element:P});try{P.parentNode.removeChild(P)}catch(re){try{P.outerHTML=A}catch(fe){P.remove()}}},Ju=function(P,re){try{rh(e.removed,{attribute:re.getAttributeNode(P),from:re})}catch(fe){rh(e.removed,{attribute:null,from:re})}if(re.removeAttribute(P),P==="is"&&!_[P])if(we||Be)try{Bi(re)}catch(fe){}else try{re.setAttribute(P,"")}catch(fe){}},Df=function(P){var re,fe;if(Ie)P="<remove></remove>"+P;else{var Ee=TK(P,/^[\r\n\t ]+/);fe=Ee&&Ee[0]}$t==="application/xhtml+xml"&&Qe===je&&(P='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+P+"</body></html>");var xe=T?T.createHTML(P):P;if(Qe===je)try{re=new d().parseFromString(xe,$t)}catch(Ge){}if(!re||!re.documentElement){re=E.createDocument(Qe,"template",null);try{re.documentElement.innerHTML=kt?A:xe}catch(Ge){}}var Ae=re.body||re.documentElement;return P&&fe&&Ae.insertBefore(n.createTextNode(fe),Ae.childNodes[0]||null),Qe===je?U.call(re,ue?"html":"body")[0]:ue?re.documentElement:Ae},R=function(P){return Y.call(P.ownerDocument||P,P,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,null,!1)},B=function(P){return P instanceof h&&(typeof P.nodeName!="string"||typeof P.textContent!="string"||typeof P.removeChild!="function"||!(P.attributes instanceof u)||typeof P.removeAttribute!="function"||typeof P.setAttribute!="function"||typeof P.namespaceURI!="string"||typeof P.insertBefore!="function"||typeof P.hasChildNodes!="function")},k=function(P){return pa(o)==="object"?P instanceof o:P&&pa(P)==="object"&&typeof P.nodeType=="number"&&typeof P.nodeName=="string"},H=function(P,re,fe){!ae[P]||RK(ae[P],function(Ee){Ee.call(e,re,fe,hr)})},W=function(P){var re;if(H("beforeSanitizeElements",P,null),B(P)||yn(/[\u0080-\uFFFF]/,P.nodeName))return Bi(P),!0;var fe=qt(P.nodeName);if(H("uponSanitizeElement",P,{tagName:fe,allowedTags:x}),P.hasChildNodes()&&!k(P.firstElementChild)&&(!k(P.content)||!k(P.content.firstElementChild))&&yn(/<[/\w]/g,P.innerHTML)&&yn(/<[/\w]/g,P.textContent)||fe==="select"&&yn(/<template/i,P.innerHTML))return Bi(P),!0;if(!x[fe]||le[fe]){if(!le[fe]&&de(fe)&&(K.tagNameCheck instanceof RegExp&&yn(K.tagNameCheck,fe)||K.tagNameCheck instanceof Function&&K.tagNameCheck(fe)))return!1;if(se&&!Q[fe]){var Ee=S(P)||P.parentNode,xe=C(P)||P.childNodes;if(xe&&Ee)for(var Ae=xe.length,Ge=Ae-1;Ge>=0;--Ge)Ee.insertBefore(m(xe[Ge],!0),w(P))}return Bi(P),!0}return P instanceof a&&!Zu(P)||(fe==="noscript"||fe==="noembed"||fe==="noframes")&&yn(/<\/no(script|embed|frames)/i,P.innerHTML)?(Bi(P),!0):(Fe&&P.nodeType===3&&(re=P.textContent,re=Ui(re,ve," "),re=Ui(re,me," "),re=Ui(re,Re," "),P.textContent!==re&&(rh(e.removed,{element:P.cloneNode()}),P.textContent=re)),H("afterSanitizeElements",P,null),!1)},V=function(P,re,fe){if(I&&(re==="id"||re==="name")&&(fe in n||fe in io))return!1;if(!(ge&&!ce[re]&&yn(Ce,re))){if(!(te&&yn(_e,re))){if(!_[re]||ce[re]){if(!(de(P)&&(K.tagNameCheck instanceof RegExp&&yn(K.tagNameCheck,P)||K.tagNameCheck instanceof Function&&K.tagNameCheck(P))&&(K.attributeNameCheck instanceof RegExp&&yn(K.attributeNameCheck,re)||K.attributeNameCheck instanceof Function&&K.attributeNameCheck(re))||re==="is"&&K.allowCustomizedBuiltInElements&&(K.tagNameCheck instanceof RegExp&&yn(K.tagNameCheck,fe)||K.tagNameCheck instanceof Function&&K.tagNameCheck(fe))))return!1}else if(!J[re]){if(!yn(b,Ui(fe,y,""))){if(!((re==="src"||re==="xlink:href"||re==="href")&&P!=="script"&&_K(fe,"data:")===0&&oe[P])){if(!(Me&&!yn(p,Ui(fe,y,"")))){if(fe)return!1}}}}}}return!0},de=function(P){return P.indexOf("-")>0},pe=function(P){var re,fe,Ee,xe;H("beforeSanitizeAttributes",P,null);var Ae=P.attributes;if(!!Ae){var Ge={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:_};for(xe=Ae.length;xe--;){re=Ae[xe];var Nt=re,st=Nt.name,xr=Nt.namespaceURI;if(fe=st==="value"?re.value:AK(re.value),Ee=qt(st),Ge.attrName=Ee,Ge.attrValue=fe,Ge.keepAttr=!0,Ge.forceKeepAttr=void 0,H("uponSanitizeAttribute",P,Ge),fe=Ge.attrValue,!Ge.forceKeepAttr&&(Ju(st,P),!!Ge.keepAttr)){if(!L&&yn(/\/>/i,fe)){Ju(st,P);continue}Fe&&(fe=Ui(fe,ve," "),fe=Ui(fe,me," "),fe=Ui(fe,Re," "));var Xo=qt(P.nodeName);if(!!V(Xo,Ee,fe)){if(F&&(Ee==="id"||Ee==="name")&&(Ju(st,P),fe=z+fe),T&&pa(f)==="object"&&typeof f.getAttributeType=="function"&&!xr)switch(f.getAttributeType(Xo,Ee)){case"TrustedHTML":{fe=T.createHTML(fe);break}case"TrustedScriptURL":{fe=T.createScriptURL(fe);break}}try{xr?P.setAttributeNS(xr,st,fe):P.setAttribute(st,fe),ET(e.removed)}catch(fc){}}}}H("afterSanitizeAttributes",P,null)}},he=function Z(P){var re,fe=R(P);for(H("beforeSanitizeShadowDOM",P,null);re=fe.nextNode();)H("uponSanitizeShadowNode",re,null),!W(re)&&(re.content instanceof i&&Z(re.content),pe(re));H("afterSanitizeShadowDOM",P,null)};return e.sanitize=function(Z){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},re,fe,Ee,xe,Ae;if(kt=!Z,kt&&(Z="<!-->"),typeof Z!="string"&&!k(Z))if(typeof Z.toString=="function"){if(Z=Z.toString(),typeof Z!="string")throw Hw("dirty is not a string, aborting")}else throw Hw("toString is not a function");if(!e.isSupported){if(pa(t.toStaticHTML)==="object"||typeof t.toStaticHTML=="function"){if(typeof Z=="string")return t.toStaticHTML(Z);if(k(Z))return t.toStaticHTML(Z.outerHTML)}return Z}if(ze||pr(P),e.removed=[],typeof Z=="string"&&(q=!1),q){if(Z.nodeName){var Ge=qt(Z.nodeName);if(!x[Ge]||le[Ge])throw Hw("root node is forbidden and cannot be sanitized in-place")}}else if(Z instanceof o)re=Df("<!---->"),fe=re.ownerDocument.importNode(Z,!0),fe.nodeType===1&&fe.nodeName==="BODY"||fe.nodeName==="HTML"?re=fe:re.appendChild(fe);else{if(!we&&!Fe&&!ue&&Z.indexOf("<")===-1)return T&&Le?T.createHTML(Z):Z;if(re=Df(Z),!re)return we?null:Le?A:""}re&&Ie&&Bi(re.firstChild);for(var Nt=R(q?Z:re);Ee=Nt.nextNode();)Ee.nodeType===3&&Ee===xe||W(Ee)||(Ee.content instanceof i&&he(Ee.content),pe(Ee),xe=Ee);if(xe=null,q)return Z;if(we){if(Be)for(Ae=D.call(re.ownerDocument);re.firstChild;)Ae.appendChild(re.firstChild);else Ae=re;return(_.shadowroot||_.shadowrootmod)&&(Ae=X.call(r,Ae,!0)),Ae}var st=ue?re.outerHTML:re.innerHTML;return ue&&x["!doctype"]&&re.ownerDocument&&re.ownerDocument.doctype&&re.ownerDocument.doctype.name&&yn(BK,re.ownerDocument.doctype.name)&&(st="<!DOCTYPE "+re.ownerDocument.doctype.name+`>
  40. `+st),Fe&&(st=Ui(st,ve," "),st=Ui(st,me," "),st=Ui(st,Re," ")),T&&Le?T.createHTML(st):st},e.setConfig=function(Z){pr(Z),ze=!0},e.clearConfig=function(){hr=null,ze=!1},e.isValidAttribute=function(Z,P,re){hr||pr({});var fe=qt(Z),Ee=qt(P);return V(fe,Ee,re)},e.addHook=function(Z,P){typeof P=="function"&&(ae[Z]=ae[Z]||[],rh(ae[Z],P))},e.removeHook=function(Z){if(ae[Z])return ET(ae[Z])},e.removeHooks=function(Z){ae[Z]&&(ae[Z]=[])},e.removeAllHooks=function(){ae={}},e}var UK=fN();//! moment.js
  41. //! version : 2.29.4
  42. //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
  43. //! license : MIT
  44. //! momentjs.com
  45. var gN;function ye(){return gN.apply(null,arguments)}function GK(t){gN=t}function ds(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function Wl(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function Mt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function fy(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var e;for(e in t)if(Mt(t,e))return!1;return!0}function Yn(t){return t===void 0}function Lo(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function ff(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function mN(t,e){var r=[],n,i=t.length;for(n=0;n<i;++n)r.push(e(t[n],n));return r}function xa(t,e){for(var r in e)Mt(e,r)&&(t[r]=e[r]);return Mt(e,"toString")&&(t.toString=e.toString),Mt(e,"valueOf")&&(t.valueOf=e.valueOf),t}function to(t,e,r,n){return $N(t,e,r,n,!0).utc()}function YK(){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 ct(t){return t._pf==null&&(t._pf=YK()),t._pf}var S1;Array.prototype.some?S1=Array.prototype.some:S1=function(t){var e=Object(this),r=e.length>>>0,n;for(n=0;n<r;n++)if(n in e&&t.call(this,e[n],n,e))return!0;return!1};function gy(t){if(t._isValid==null){var e=ct(t),r=S1.call(e.parsedDateParts,function(i){return i!=null}),n=!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&&r);if(t._strict&&(n=n&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0),Object.isFrozen==null||!Object.isFrozen(t))t._isValid=n;else return n}return t._isValid}function fp(t){var e=to(NaN);return t!=null?xa(ct(e),t):ct(e).userInvalidated=!0,e}var MT=ye.momentProperties=[],Ww=!1;function my(t,e){var r,n,i,s=MT.length;if(Yn(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),Yn(e._i)||(t._i=e._i),Yn(e._f)||(t._f=e._f),Yn(e._l)||(t._l=e._l),Yn(e._strict)||(t._strict=e._strict),Yn(e._tzm)||(t._tzm=e._tzm),Yn(e._isUTC)||(t._isUTC=e._isUTC),Yn(e._offset)||(t._offset=e._offset),Yn(e._pf)||(t._pf=ct(e)),Yn(e._locale)||(t._locale=e._locale),s>0)for(r=0;r<s;r++)n=MT[r],i=e[n],Yn(i)||(t[n]=i);return t}function gf(t){my(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Ww===!1&&(Ww=!0,ye.updateOffset(this),Ww=!1)}function fs(t){return t instanceof gf||t!=null&&t._isAMomentObject!=null}function pN(t){ye.suppressDeprecationWarnings===!1&&typeof console!="undefined"&&console.warn&&console.warn("Deprecation warning: "+t)}function Li(t,e){var r=!0;return xa(function(){if(ye.deprecationHandler!=null&&ye.deprecationHandler(null,t),r){var n=[],i,s,o,a=arguments.length;for(s=0;s<a;s++){if(i="",typeof arguments[s]=="object"){i+=`
  46. [`+s+"] ";for(o in arguments[0])Mt(arguments[0],o)&&(i+=o+": "+arguments[0][o]+", ");i=i.slice(0,-2)}else i=arguments[s];n.push(i)}pN(t+`
  47. Arguments: `+Array.prototype.slice.call(n).join("")+`
  48. `+new Error().stack),r=!1}return e.apply(this,arguments)},e)}var OT={};function wN(t,e){ye.deprecationHandler!=null&&ye.deprecationHandler(t,e),OT[t]||(pN(e),OT[t]=!0)}ye.suppressDeprecationWarnings=!1;ye.deprecationHandler=null;function ro(t){return typeof Function!="undefined"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function zK(t){var e,r;for(r in t)Mt(t,r)&&(e=t[r],ro(e)?this[r]=e:this["_"+r]=e);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function y1(t,e){var r=xa({},t),n;for(n in e)Mt(e,n)&&(Wl(t[n])&&Wl(e[n])?(r[n]={},xa(r[n],t[n]),xa(r[n],e[n])):e[n]!=null?r[n]=e[n]:delete r[n]);for(n in t)Mt(t,n)&&!Mt(e,n)&&Wl(t[n])&&(r[n]=xa({},r[n]));return r}function py(t){t!=null&&this.set(t)}var x1;Object.keys?x1=Object.keys:x1=function(t){var e,r=[];for(e in t)Mt(t,e)&&r.push(e);return r};var jK={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function KK(t,e,r){var n=this._calendar[t]||this._calendar.sameElse;return ro(n)?n.call(e,r):n}function qs(t,e,r){var n=""+Math.abs(t),i=e-n.length,s=t>=0;return(s?r?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+n}var wy=/(\[[^\[]*\])|(\\)?([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,rg=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Vw={},yu={};function Xe(t,e,r,n){var i=n;typeof n=="string"&&(i=function(){return this[n]()}),t&&(yu[t]=i),e&&(yu[e[0]]=function(){return qs(i.apply(this,arguments),e[1],e[2])}),r&&(yu[r]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function XK(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function qK(t){var e=t.match(wy),r,n;for(r=0,n=e.length;r<n;r++)yu[e[r]]?e[r]=yu[e[r]]:e[r]=XK(e[r]);return function(i){var s="",o;for(o=0;o<n;o++)s+=ro(e[o])?e[o].call(i,t):e[o];return s}}function _0(t,e){return t.isValid()?(e=vN(e,t.localeData()),Vw[e]=Vw[e]||qK(e),Vw[e](t)):t.localeData().invalidDate()}function vN(t,e){var r=5;function n(i){return e.longDateFormat(i)||i}for(rg.lastIndex=0;r>=0&&rg.test(t);)t=t.replace(rg,n),rg.lastIndex=0,r-=1;return t}var ZK={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 JK(t){var e=this._longDateFormat[t],r=this._longDateFormat[t.toUpperCase()];return e||!r?e:(this._longDateFormat[t]=r.match(wy).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[t])}var QK="Invalid date";function eX(){return this._invalidDate}var tX="%d",rX=/\d{1,2}/;function nX(t){return this._ordinal.replace("%d",t)}var iX={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 sX(t,e,r,n){var i=this._relativeTime[r];return ro(i)?i(t,e,r,n):i.replace(/%d/i,t)}function oX(t,e){var r=this._relativeTime[t>0?"future":"past"];return ro(r)?r(e):r.replace(/%s/i,e)}var fd={};function wn(t,e){var r=t.toLowerCase();fd[r]=fd[r+"s"]=fd[e]=t}function $i(t){return typeof t=="string"?fd[t]||fd[t.toLowerCase()]:void 0}function vy(t){var e={},r,n;for(n in t)Mt(t,n)&&(r=$i(n),r&&(e[r]=t[n]));return e}var CN={};function vn(t,e){CN[t]=e}function aX(t){var e=[],r;for(r in t)Mt(t,r)&&e.push({unit:r,priority:CN[r]});return e.sort(function(n,i){return n.priority-i.priority}),e}function gp(t){return t%4===0&&t%100!==0||t%400===0}function Ii(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function vt(t){var e=+t,r=0;return e!==0&&isFinite(e)&&(r=Ii(e)),r}function Bu(t,e){return function(r){return r!=null?(SN(this,t,r),ye.updateOffset(this,e),this):hm(this,t)}}function hm(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function SN(t,e,r){t.isValid()&&!isNaN(r)&&(e==="FullYear"&&gp(t.year())&&t.month()===1&&t.date()===29?(r=vt(r),t._d["set"+(t._isUTC?"UTC":"")+e](r,t.month(),Sp(r,t.month()))):t._d["set"+(t._isUTC?"UTC":"")+e](r))}function lX(t){return t=$i(t),ro(this[t])?this[t]():this}function cX(t,e){if(typeof t=="object"){t=vy(t);var r=aX(t),n,i=r.length;for(n=0;n<i;n++)this[r[n].unit](t[r[n].unit])}else if(t=$i(t),ro(this[t]))return this[t](e);return this}var yN=/\d/,pi=/\d\d/,xN=/\d{3}/,Cy=/\d{4}/,mp=/[+-]?\d{6}/,Xt=/\d\d?/,bN=/\d\d\d\d?/,EN=/\d\d\d\d\d\d?/,pp=/\d{1,3}/,Sy=/\d{1,4}/,wp=/[+-]?\d{1,6}/,Wu=/\d+/,vp=/[+-]?\d+/,uX=/Z|[+-]\d\d:?\d\d/gi,Cp=/Z|[+-]\d\d(?::?\d\d)?/gi,hX=/[+-]?\d+(\.\d{1,3})?/,mf=/[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,dm;dm={};function We(t,e,r){dm[t]=ro(e)?e:function(n,i){return n&&r?r:e}}function dX(t,e){return Mt(dm,t)?dm[t](e._strict,e._locale):new RegExp(fX(t))}function fX(t){return ci(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,r,n,i,s){return r||n||i||s}))}function ci(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var b1={};function Lt(t,e){var r,n=e,i;for(typeof t=="string"&&(t=[t]),Lo(e)&&(n=function(s,o){o[e]=vt(s)}),i=t.length,r=0;r<i;r++)b1[t[r]]=n}function pf(t,e){Lt(t,function(r,n,i,s){i._w=i._w||{},e(r,i._w,i,s)})}function gX(t,e,r){e!=null&&Mt(b1,t)&&b1[t](e,r._a,r,t)}var dn=0,_o=1,Vs=2,Pr=3,cs=4,Ao=5,Dl=6,mX=7,pX=8;function wX(t,e){return(t%e+e)%e}var Cr;Array.prototype.indexOf?Cr=Array.prototype.indexOf:Cr=function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};function Sp(t,e){if(isNaN(t)||isNaN(e))return NaN;var r=wX(e,12);return t+=(e-r)/12,r===1?gp(t)?29:28:31-r%7%2}Xe("M",["MM",2],"Mo",function(){return this.month()+1});Xe("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)});Xe("MMMM",0,0,function(t){return this.localeData().months(this,t)});wn("month","M");vn("month",8);We("M",Xt);We("MM",Xt,pi);We("MMM",function(t,e){return e.monthsShortRegex(t)});We("MMMM",function(t,e){return e.monthsRegex(t)});Lt(["M","MM"],function(t,e){e[_o]=vt(t)-1});Lt(["MMM","MMMM"],function(t,e,r,n){var i=r._locale.monthsParse(t,n,r._strict);i!=null?e[_o]=i:ct(r).invalidMonth=t});var vX="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),RN="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),TN=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,CX=mf,SX=mf;function yX(t,e){return t?ds(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||TN).test(e)?"format":"standalone"][t.month()]:ds(this._months)?this._months:this._months.standalone}function xX(t,e){return t?ds(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[TN.test(e)?"format":"standalone"][t.month()]:ds(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function bX(t,e,r){var n,i,s,o=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)s=to([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(s,"").toLocaleLowerCase();return r?e==="MMM"?(i=Cr.call(this._shortMonthsParse,o),i!==-1?i:null):(i=Cr.call(this._longMonthsParse,o),i!==-1?i:null):e==="MMM"?(i=Cr.call(this._shortMonthsParse,o),i!==-1?i:(i=Cr.call(this._longMonthsParse,o),i!==-1?i:null)):(i=Cr.call(this._longMonthsParse,o),i!==-1?i:(i=Cr.call(this._shortMonthsParse,o),i!==-1?i:null))}function EX(t,e,r){var n,i,s;if(this._monthsParseExact)return bX.call(this,t,e,r);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(i=to([2e3,n]),r&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!r&&!this._monthsParse[n]&&(s="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[n]=new RegExp(s.replace(".",""),"i")),r&&e==="MMMM"&&this._longMonthsParse[n].test(t))return n;if(r&&e==="MMM"&&this._shortMonthsParse[n].test(t))return n;if(!r&&this._monthsParse[n].test(t))return n}}function _N(t,e){var r;if(!t.isValid())return t;if(typeof e=="string"){if(/^\d+$/.test(e))e=vt(e);else if(e=t.localeData().monthsParse(e),!Lo(e))return t}return r=Math.min(t.date(),Sp(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,r),t}function AN(t){return t!=null?(_N(this,t),ye.updateOffset(this,!0),this):hm(this,"Month")}function RX(){return Sp(this.year(),this.month())}function TX(t){return this._monthsParseExact?(Mt(this,"_monthsRegex")||MN.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(Mt(this,"_monthsShortRegex")||(this._monthsShortRegex=CX),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function _X(t){return this._monthsParseExact?(Mt(this,"_monthsRegex")||MN.call(this),t?this._monthsStrictRegex:this._monthsRegex):(Mt(this,"_monthsRegex")||(this._monthsRegex=SX),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function MN(){function t(o,a){return a.length-o.length}var e=[],r=[],n=[],i,s;for(i=0;i<12;i++)s=to([2e3,i]),e.push(this.monthsShort(s,"")),r.push(this.months(s,"")),n.push(this.months(s,"")),n.push(this.monthsShort(s,""));for(e.sort(t),r.sort(t),n.sort(t),i=0;i<12;i++)e[i]=ci(e[i]),r[i]=ci(r[i]);for(i=0;i<24;i++)n[i]=ci(n[i]);this._monthsRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}Xe("Y",0,0,function(){var t=this.year();return t<=9999?qs(t,4):"+"+t});Xe(0,["YY",2],0,function(){return this.year()%100});Xe(0,["YYYY",4],0,"year");Xe(0,["YYYYY",5],0,"year");Xe(0,["YYYYYY",6,!0],0,"year");wn("year","y");vn("year",1);We("Y",vp);We("YY",Xt,pi);We("YYYY",Sy,Cy);We("YYYYY",wp,mp);We("YYYYYY",wp,mp);Lt(["YYYYY","YYYYYY"],dn);Lt("YYYY",function(t,e){e[dn]=t.length===2?ye.parseTwoDigitYear(t):vt(t)});Lt("YY",function(t,e){e[dn]=ye.parseTwoDigitYear(t)});Lt("Y",function(t,e){e[dn]=parseInt(t,10)});function gd(t){return gp(t)?366:365}ye.parseTwoDigitYear=function(t){return vt(t)+(vt(t)>68?1900:2e3)};var ON=Bu("FullYear",!0);function AX(){return gp(this.year())}function MX(t,e,r,n,i,s,o){var a;return t<100&&t>=0?(a=new Date(t+400,e,r,n,i,s,o),isFinite(a.getFullYear())&&a.setFullYear(t)):a=new Date(t,e,r,n,i,s,o),a}function Vd(t){var e,r;return t<100&&t>=0?(r=Array.prototype.slice.call(arguments),r[0]=t+400,e=new Date(Date.UTC.apply(null,r)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function fm(t,e,r){var n=7+e-r,i=(7+Vd(t,0,n).getUTCDay()-e)%7;return-i+n-1}function IN(t,e,r,n,i){var s=(7+r-n)%7,o=fm(t,n,i),a=1+7*(e-1)+s+o,l,c;return a<=0?(l=t-1,c=gd(l)+a):a>gd(t)?(l=t+1,c=a-gd(t)):(l=t,c=a),{year:l,dayOfYear:c}}function Ud(t,e,r){var n=fm(t.year(),e,r),i=Math.floor((t.dayOfYear()-n-1)/7)+1,s,o;return i<1?(o=t.year()-1,s=i+Ho(o,e,r)):i>Ho(t.year(),e,r)?(s=i-Ho(t.year(),e,r),o=t.year()+1):(o=t.year(),s=i),{week:s,year:o}}function Ho(t,e,r){var n=fm(t,e,r),i=fm(t+1,e,r);return(gd(t)-n+i)/7}Xe("w",["ww",2],"wo","week");Xe("W",["WW",2],"Wo","isoWeek");wn("week","w");wn("isoWeek","W");vn("week",5);vn("isoWeek",5);We("w",Xt);We("ww",Xt,pi);We("W",Xt);We("WW",Xt,pi);pf(["w","ww","W","WW"],function(t,e,r,n){e[n.substr(0,1)]=vt(t)});function OX(t){return Ud(t,this._week.dow,this._week.doy).week}var IX={dow:0,doy:6};function PX(){return this._week.dow}function DX(){return this._week.doy}function kX(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function NX(t){var e=Ud(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}Xe("d",0,"do","day");Xe("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)});Xe("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)});Xe("dddd",0,0,function(t){return this.localeData().weekdays(this,t)});Xe("e",0,0,"weekday");Xe("E",0,0,"isoWeekday");wn("day","d");wn("weekday","e");wn("isoWeekday","E");vn("day",11);vn("weekday",11);vn("isoWeekday",11);We("d",Xt);We("e",Xt);We("E",Xt);We("dd",function(t,e){return e.weekdaysMinRegex(t)});We("ddd",function(t,e){return e.weekdaysShortRegex(t)});We("dddd",function(t,e){return e.weekdaysRegex(t)});pf(["dd","ddd","dddd"],function(t,e,r,n){var i=r._locale.weekdaysParse(t,n,r._strict);i!=null?e.d=i:ct(r).invalidWeekday=t});pf(["d","e","E"],function(t,e,r,n){e[n]=vt(t)});function HX(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function FX(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function yy(t,e){return t.slice(e,7).concat(t.slice(0,e))}var LX="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),PN="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),$X="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),BX=mf,WX=mf,VX=mf;function UX(t,e){var r=ds(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?yy(r,this._week.dow):t?r[t.day()]:r}function GX(t){return t===!0?yy(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function YX(t){return t===!0?yy(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function zX(t,e,r){var n,i,s,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)s=to([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(s,"").toLocaleLowerCase();return r?e==="dddd"?(i=Cr.call(this._weekdaysParse,o),i!==-1?i:null):e==="ddd"?(i=Cr.call(this._shortWeekdaysParse,o),i!==-1?i:null):(i=Cr.call(this._minWeekdaysParse,o),i!==-1?i:null):e==="dddd"?(i=Cr.call(this._weekdaysParse,o),i!==-1||(i=Cr.call(this._shortWeekdaysParse,o),i!==-1)?i:(i=Cr.call(this._minWeekdaysParse,o),i!==-1?i:null)):e==="ddd"?(i=Cr.call(this._shortWeekdaysParse,o),i!==-1||(i=Cr.call(this._weekdaysParse,o),i!==-1)?i:(i=Cr.call(this._minWeekdaysParse,o),i!==-1?i:null)):(i=Cr.call(this._minWeekdaysParse,o),i!==-1||(i=Cr.call(this._weekdaysParse,o),i!==-1)?i:(i=Cr.call(this._shortWeekdaysParse,o),i!==-1?i:null))}function jX(t,e,r){var n,i,s;if(this._weekdaysParseExact)return zX.call(this,t,e,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(i=to([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(s="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[n]=new RegExp(s.replace(".",""),"i")),r&&e==="dddd"&&this._fullWeekdaysParse[n].test(t))return n;if(r&&e==="ddd"&&this._shortWeekdaysParse[n].test(t))return n;if(r&&e==="dd"&&this._minWeekdaysParse[n].test(t))return n;if(!r&&this._weekdaysParse[n].test(t))return n}}function KX(t){if(!this.isValid())return t!=null?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return t!=null?(t=HX(t,this.localeData()),this.add(t-e,"d")):e}function XX(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 qX(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=FX(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function ZX(t){return this._weekdaysParseExact?(Mt(this,"_weekdaysRegex")||xy.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(Mt(this,"_weekdaysRegex")||(this._weekdaysRegex=BX),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function JX(t){return this._weekdaysParseExact?(Mt(this,"_weekdaysRegex")||xy.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Mt(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=WX),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function QX(t){return this._weekdaysParseExact?(Mt(this,"_weekdaysRegex")||xy.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Mt(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=VX),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function xy(){function t(u,h){return h.length-u.length}var e=[],r=[],n=[],i=[],s,o,a,l,c;for(s=0;s<7;s++)o=to([2e3,1]).day(s),a=ci(this.weekdaysMin(o,"")),l=ci(this.weekdaysShort(o,"")),c=ci(this.weekdays(o,"")),e.push(a),r.push(l),n.push(c),i.push(a),i.push(l),i.push(c);e.sort(t),r.sort(t),n.sort(t),i.sort(t),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function by(){return this.hours()%12||12}function eq(){return this.hours()||24}Xe("H",["HH",2],0,"hour");Xe("h",["hh",2],0,by);Xe("k",["kk",2],0,eq);Xe("hmm",0,0,function(){return""+by.apply(this)+qs(this.minutes(),2)});Xe("hmmss",0,0,function(){return""+by.apply(this)+qs(this.minutes(),2)+qs(this.seconds(),2)});Xe("Hmm",0,0,function(){return""+this.hours()+qs(this.minutes(),2)});Xe("Hmmss",0,0,function(){return""+this.hours()+qs(this.minutes(),2)+qs(this.seconds(),2)});function DN(t,e){Xe(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}DN("a",!0);DN("A",!1);wn("hour","h");vn("hour",13);function kN(t,e){return e._meridiemParse}We("a",kN);We("A",kN);We("H",Xt);We("h",Xt);We("k",Xt);We("HH",Xt,pi);We("hh",Xt,pi);We("kk",Xt,pi);We("hmm",bN);We("hmmss",EN);We("Hmm",bN);We("Hmmss",EN);Lt(["H","HH"],Pr);Lt(["k","kk"],function(t,e,r){var n=vt(t);e[Pr]=n===24?0:n});Lt(["a","A"],function(t,e,r){r._isPm=r._locale.isPM(t),r._meridiem=t});Lt(["h","hh"],function(t,e,r){e[Pr]=vt(t),ct(r).bigHour=!0});Lt("hmm",function(t,e,r){var n=t.length-2;e[Pr]=vt(t.substr(0,n)),e[cs]=vt(t.substr(n)),ct(r).bigHour=!0});Lt("hmmss",function(t,e,r){var n=t.length-4,i=t.length-2;e[Pr]=vt(t.substr(0,n)),e[cs]=vt(t.substr(n,2)),e[Ao]=vt(t.substr(i)),ct(r).bigHour=!0});Lt("Hmm",function(t,e,r){var n=t.length-2;e[Pr]=vt(t.substr(0,n)),e[cs]=vt(t.substr(n))});Lt("Hmmss",function(t,e,r){var n=t.length-4,i=t.length-2;e[Pr]=vt(t.substr(0,n)),e[cs]=vt(t.substr(n,2)),e[Ao]=vt(t.substr(i))});function tq(t){return(t+"").toLowerCase().charAt(0)==="p"}var rq=/[ap]\.?m?\.?/i,nq=Bu("Hours",!0);function iq(t,e,r){return t>11?r?"pm":"PM":r?"am":"AM"}var NN={calendar:jK,longDateFormat:ZK,invalidDate:QK,ordinal:tX,dayOfMonthOrdinalParse:rX,relativeTime:iX,months:vX,monthsShort:RN,week:IX,weekdays:LX,weekdaysMin:$X,weekdaysShort:PN,meridiemParse:rq},Qt={},nh={},Gd;function sq(t,e){var r,n=Math.min(t.length,e.length);for(r=0;r<n;r+=1)if(t[r]!==e[r])return r;return n}function IT(t){return t&&t.toLowerCase().replace("_","-")}function oq(t){for(var e=0,r,n,i,s;e<t.length;){for(s=IT(t[e]).split("-"),r=s.length,n=IT(t[e+1]),n=n?n.split("-"):null;r>0;){if(i=yp(s.slice(0,r).join("-")),i)return i;if(n&&n.length>=r&&sq(s,n)>=r-1)break;r--}e++}return Gd}function aq(t){return t.match("^[^/\\\\]*$")!=null}function yp(t){var e=null,r;if(Qt[t]===void 0&&typeof module!="undefined"&&module&&module.exports&&aq(t))try{e=Gd._abbr,r=jh,r("./locale/"+t),Oa(e)}catch(n){Qt[t]=null}return Qt[t]}function Oa(t,e){var r;return t&&(Yn(e)?r=Uo(t):r=Ey(t,e),r?Gd=r:typeof console!="undefined"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),Gd._abbr}function Ey(t,e){if(e!==null){var r,n=NN;if(e.abbr=t,Qt[t]!=null)wN("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."),n=Qt[t]._config;else if(e.parentLocale!=null)if(Qt[e.parentLocale]!=null)n=Qt[e.parentLocale]._config;else if(r=yp(e.parentLocale),r!=null)n=r._config;else return nh[e.parentLocale]||(nh[e.parentLocale]=[]),nh[e.parentLocale].push({name:t,config:e}),null;return Qt[t]=new py(y1(n,e)),nh[t]&&nh[t].forEach(function(i){Ey(i.name,i.config)}),Oa(t),Qt[t]}else return delete Qt[t],null}function lq(t,e){if(e!=null){var r,n,i=NN;Qt[t]!=null&&Qt[t].parentLocale!=null?Qt[t].set(y1(Qt[t]._config,e)):(n=yp(t),n!=null&&(i=n._config),e=y1(i,e),n==null&&(e.abbr=t),r=new py(e),r.parentLocale=Qt[t],Qt[t]=r),Oa(t)}else Qt[t]!=null&&(Qt[t].parentLocale!=null?(Qt[t]=Qt[t].parentLocale,t===Oa()&&Oa(t)):Qt[t]!=null&&delete Qt[t]);return Qt[t]}function Uo(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Gd;if(!ds(t)){if(e=yp(t),e)return e;t=[t]}return oq(t)}function cq(){return x1(Qt)}function Ry(t){var e,r=t._a;return r&&ct(t).overflow===-2&&(e=r[_o]<0||r[_o]>11?_o:r[Vs]<1||r[Vs]>Sp(r[dn],r[_o])?Vs:r[Pr]<0||r[Pr]>24||r[Pr]===24&&(r[cs]!==0||r[Ao]!==0||r[Dl]!==0)?Pr:r[cs]<0||r[cs]>59?cs:r[Ao]<0||r[Ao]>59?Ao:r[Dl]<0||r[Dl]>999?Dl:-1,ct(t)._overflowDayOfYear&&(e<dn||e>Vs)&&(e=Vs),ct(t)._overflowWeeks&&e===-1&&(e=mX),ct(t)._overflowWeekday&&e===-1&&(e=pX),ct(t).overflow=e),t}var uq=/^\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)?)?$/,hq=/^\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)?)?$/,dq=/Z|[+-]\d\d(?::?\d\d)?/,ng=[["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]],Uw=[["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/]],fq=/^\/?Date\((-?\d+)/i,gq=/^(?:(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}))$/,mq={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 HN(t){var e,r,n=t._i,i=uq.exec(n)||hq.exec(n),s,o,a,l,c=ng.length,u=Uw.length;if(i){for(ct(t).iso=!0,e=0,r=c;e<r;e++)if(ng[e][1].exec(i[1])){o=ng[e][0],s=ng[e][2]!==!1;break}if(o==null){t._isValid=!1;return}if(i[3]){for(e=0,r=u;e<r;e++)if(Uw[e][1].exec(i[3])){a=(i[2]||" ")+Uw[e][0];break}if(a==null){t._isValid=!1;return}}if(!s&&a!=null){t._isValid=!1;return}if(i[4])if(dq.exec(i[4]))l="Z";else{t._isValid=!1;return}t._f=o+(a||"")+(l||""),_y(t)}else t._isValid=!1}function pq(t,e,r,n,i,s){var o=[wq(t),RN.indexOf(e),parseInt(r,10),parseInt(n,10),parseInt(i,10)];return s&&o.push(parseInt(s,10)),o}function wq(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function vq(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Cq(t,e,r){if(t){var n=PN.indexOf(t),i=new Date(e[0],e[1],e[2]).getDay();if(n!==i)return ct(r).weekdayMismatch=!0,r._isValid=!1,!1}return!0}function Sq(t,e,r){if(t)return mq[t];if(e)return 0;var n=parseInt(r,10),i=n%100,s=(n-i)/100;return s*60+i}function FN(t){var e=gq.exec(vq(t._i)),r;if(e){if(r=pq(e[4],e[3],e[2],e[5],e[6],e[7]),!Cq(e[1],r,t))return;t._a=r,t._tzm=Sq(e[8],e[9],e[10]),t._d=Vd.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),ct(t).rfc2822=!0}else t._isValid=!1}function yq(t){var e=fq.exec(t._i);if(e!==null){t._d=new Date(+e[1]);return}if(HN(t),t._isValid===!1)delete t._isValid;else return;if(FN(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:ye.createFromInputFallback(t)}ye.createFromInputFallback=Li("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 ou(t,e,r){return t!=null?t:e!=null?e:r}function xq(t){var e=new Date(ye.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function Ty(t){var e,r,n=[],i,s,o;if(!t._d){for(i=xq(t),t._w&&t._a[Vs]==null&&t._a[_o]==null&&bq(t),t._dayOfYear!=null&&(o=ou(t._a[dn],i[dn]),(t._dayOfYear>gd(o)||t._dayOfYear===0)&&(ct(t)._overflowDayOfYear=!0),r=Vd(o,0,t._dayOfYear),t._a[_o]=r.getUTCMonth(),t._a[Vs]=r.getUTCDate()),e=0;e<3&&t._a[e]==null;++e)t._a[e]=n[e]=i[e];for(;e<7;e++)t._a[e]=n[e]=t._a[e]==null?e===2?1:0:t._a[e];t._a[Pr]===24&&t._a[cs]===0&&t._a[Ao]===0&&t._a[Dl]===0&&(t._nextDay=!0,t._a[Pr]=0),t._d=(t._useUTC?Vd:MX).apply(null,n),s=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Pr]=24),t._w&&typeof t._w.d!="undefined"&&t._w.d!==s&&(ct(t).weekdayMismatch=!0)}}function bq(t){var e,r,n,i,s,o,a,l,c;e=t._w,e.GG!=null||e.W!=null||e.E!=null?(s=1,o=4,r=ou(e.GG,t._a[dn],Ud(Kt(),1,4).year),n=ou(e.W,1),i=ou(e.E,1),(i<1||i>7)&&(l=!0)):(s=t._locale._week.dow,o=t._locale._week.doy,c=Ud(Kt(),s,o),r=ou(e.gg,t._a[dn],c.year),n=ou(e.w,c.week),e.d!=null?(i=e.d,(i<0||i>6)&&(l=!0)):e.e!=null?(i=e.e+s,(e.e<0||e.e>6)&&(l=!0)):i=s),n<1||n>Ho(r,s,o)?ct(t)._overflowWeeks=!0:l!=null?ct(t)._overflowWeekday=!0:(a=IN(r,n,i,s,o),t._a[dn]=a.year,t._dayOfYear=a.dayOfYear)}ye.ISO_8601=function(){};ye.RFC_2822=function(){};function _y(t){if(t._f===ye.ISO_8601){HN(t);return}if(t._f===ye.RFC_2822){FN(t);return}t._a=[],ct(t).empty=!0;var e=""+t._i,r,n,i,s,o,a=e.length,l=0,c,u;for(i=vN(t._f,t._locale).match(wy)||[],u=i.length,r=0;r<u;r++)s=i[r],n=(e.match(dX(s,t))||[])[0],n&&(o=e.substr(0,e.indexOf(n)),o.length>0&&ct(t).unusedInput.push(o),e=e.slice(e.indexOf(n)+n.length),l+=n.length),yu[s]?(n?ct(t).empty=!1:ct(t).unusedTokens.push(s),gX(s,n,t)):t._strict&&!n&&ct(t).unusedTokens.push(s);ct(t).charsLeftOver=a-l,e.length>0&&ct(t).unusedInput.push(e),t._a[Pr]<=12&&ct(t).bigHour===!0&&t._a[Pr]>0&&(ct(t).bigHour=void 0),ct(t).parsedDateParts=t._a.slice(0),ct(t).meridiem=t._meridiem,t._a[Pr]=Eq(t._locale,t._a[Pr],t._meridiem),c=ct(t).era,c!==null&&(t._a[dn]=t._locale.erasConvertYear(c,t._a[dn])),Ty(t),Ry(t)}function Eq(t,e,r){var n;return r==null?e:t.meridiemHour!=null?t.meridiemHour(e,r):(t.isPM!=null&&(n=t.isPM(r),n&&e<12&&(e+=12),!n&&e===12&&(e=0)),e)}function Rq(t){var e,r,n,i,s,o,a=!1,l=t._f.length;if(l===0){ct(t).invalidFormat=!0,t._d=new Date(NaN);return}for(i=0;i<l;i++)s=0,o=!1,e=my({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[i],_y(e),gy(e)&&(o=!0),s+=ct(e).charsLeftOver,s+=ct(e).unusedTokens.length*10,ct(e).score=s,a?s<n&&(n=s,r=e):(n==null||s<n||o)&&(n=s,r=e,o&&(a=!0));xa(t,r||e)}function Tq(t){if(!t._d){var e=vy(t._i),r=e.day===void 0?e.date:e.day;t._a=mN([e.year,e.month,r,e.hour,e.minute,e.second,e.millisecond],function(n){return n&&parseInt(n,10)}),Ty(t)}}function _q(t){var e=new gf(Ry(LN(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function LN(t){var e=t._i,r=t._f;return t._locale=t._locale||Uo(t._l),e===null||r===void 0&&e===""?fp({nullInput:!0}):(typeof e=="string"&&(t._i=e=t._locale.preparse(e)),fs(e)?new gf(Ry(e)):(ff(e)?t._d=e:ds(r)?Rq(t):r?_y(t):Aq(t),gy(t)||(t._d=null),t))}function Aq(t){var e=t._i;Yn(e)?t._d=new Date(ye.now()):ff(e)?t._d=new Date(e.valueOf()):typeof e=="string"?yq(t):ds(e)?(t._a=mN(e.slice(0),function(r){return parseInt(r,10)}),Ty(t)):Wl(e)?Tq(t):Lo(e)?t._d=new Date(e):ye.createFromInputFallback(t)}function $N(t,e,r,n,i){var s={};return(e===!0||e===!1)&&(n=e,e=void 0),(r===!0||r===!1)&&(n=r,r=void 0),(Wl(t)&&fy(t)||ds(t)&&t.length===0)&&(t=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=i,s._l=r,s._i=t,s._f=e,s._strict=n,_q(s)}function Kt(t,e,r,n){return $N(t,e,r,n,!1)}var Mq=Li("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Kt.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:fp()}),Oq=Li("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Kt.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:fp()});function BN(t,e){var r,n;if(e.length===1&&ds(e[0])&&(e=e[0]),!e.length)return Kt();for(r=e[0],n=1;n<e.length;++n)(!e[n].isValid()||e[n][t](r))&&(r=e[n]);return r}function Iq(){var t=[].slice.call(arguments,0);return BN("isBefore",t)}function Pq(){var t=[].slice.call(arguments,0);return BN("isAfter",t)}var Dq=function(){return Date.now?Date.now():+new Date},ih=["year","quarter","month","week","day","hour","minute","second","millisecond"];function kq(t){var e,r=!1,n,i=ih.length;for(e in t)if(Mt(t,e)&&!(Cr.call(ih,e)!==-1&&(t[e]==null||!isNaN(t[e]))))return!1;for(n=0;n<i;++n)if(t[ih[n]]){if(r)return!1;parseFloat(t[ih[n]])!==vt(t[ih[n]])&&(r=!0)}return!0}function Nq(){return this._isValid}function Hq(){return ws(NaN)}function xp(t){var e=vy(t),r=e.year||0,n=e.quarter||0,i=e.month||0,s=e.week||e.isoWeek||0,o=e.day||0,a=e.hour||0,l=e.minute||0,c=e.second||0,u=e.millisecond||0;this._isValid=kq(e),this._milliseconds=+u+c*1e3+l*6e4+a*1e3*60*60,this._days=+o+s*7,this._months=+i+n*3+r*12,this._data={},this._locale=Uo(),this._bubble()}function A0(t){return t instanceof xp}function E1(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function Fq(t,e,r){var n=Math.min(t.length,e.length),i=Math.abs(t.length-e.length),s=0,o;for(o=0;o<n;o++)(r&&t[o]!==e[o]||!r&&vt(t[o])!==vt(e[o]))&&s++;return s+i}function WN(t,e){Xe(t,0,0,function(){var r=this.utcOffset(),n="+";return r<0&&(r=-r,n="-"),n+qs(~~(r/60),2)+e+qs(~~r%60,2)})}WN("Z",":");WN("ZZ","");We("Z",Cp);We("ZZ",Cp);Lt(["Z","ZZ"],function(t,e,r){r._useUTC=!0,r._tzm=Ay(Cp,t)});var Lq=/([\+\-]|\d\d)/gi;function Ay(t,e){var r=(e||"").match(t),n,i,s;return r===null?null:(n=r[r.length-1]||[],i=(n+"").match(Lq)||["-",0,0],s=+(i[1]*60)+vt(i[2]),s===0?0:i[0]==="+"?s:-s)}function My(t,e){var r,n;return e._isUTC?(r=e.clone(),n=(fs(t)||ff(t)?t.valueOf():Kt(t).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+n),ye.updateOffset(r,!1),r):Kt(t).local()}function R1(t){return-Math.round(t._d.getTimezoneOffset())}ye.updateOffset=function(){};function $q(t,e,r){var n=this._offset||0,i;if(!this.isValid())return t!=null?this:NaN;if(t!=null){if(typeof t=="string"){if(t=Ay(Cp,t),t===null)return this}else Math.abs(t)<16&&!r&&(t=t*60);return!this._isUTC&&e&&(i=R1(this)),this._offset=t,this._isUTC=!0,i!=null&&this.add(i,"m"),n!==t&&(!e||this._changeInProgress?GN(this,ws(t-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,ye.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?n:R1(this)}function Bq(t,e){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Wq(t){return this.utcOffset(0,t)}function Vq(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(R1(this),"m")),this}function Uq(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=Ay(uX,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function Gq(t){return this.isValid()?(t=t?Kt(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function Yq(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function zq(){if(!Yn(this._isDSTShifted))return this._isDSTShifted;var t={},e;return my(t,this),t=LN(t),t._a?(e=t._isUTC?to(t._a):Kt(t._a),this._isDSTShifted=this.isValid()&&Fq(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function jq(){return this.isValid()?!this._isUTC:!1}function Kq(){return this.isValid()?this._isUTC:!1}function VN(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Xq=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,qq=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ws(t,e){var r=t,n=null,i,s,o;return A0(t)?r={ms:t._milliseconds,d:t._days,M:t._months}:Lo(t)||!isNaN(+t)?(r={},e?r[e]=+t:r.milliseconds=+t):(n=Xq.exec(t))?(i=n[1]==="-"?-1:1,r={y:0,d:vt(n[Vs])*i,h:vt(n[Pr])*i,m:vt(n[cs])*i,s:vt(n[Ao])*i,ms:vt(E1(n[Dl]*1e3))*i}):(n=qq.exec(t))?(i=n[1]==="-"?-1:1,r={y:Qa(n[2],i),M:Qa(n[3],i),w:Qa(n[4],i),d:Qa(n[5],i),h:Qa(n[6],i),m:Qa(n[7],i),s:Qa(n[8],i)}):r==null?r={}:typeof r=="object"&&("from"in r||"to"in r)&&(o=Zq(Kt(r.from),Kt(r.to)),r={},r.ms=o.milliseconds,r.M=o.months),s=new xp(r),A0(t)&&Mt(t,"_locale")&&(s._locale=t._locale),A0(t)&&Mt(t,"_isValid")&&(s._isValid=t._isValid),s}ws.fn=xp.prototype;ws.invalid=Hq;function Qa(t,e){var r=t&&parseFloat(t.replace(",","."));return(isNaN(r)?0:r)*e}function PT(t,e){var r={};return r.months=e.month()-t.month()+(e.year()-t.year())*12,t.clone().add(r.months,"M").isAfter(e)&&--r.months,r.milliseconds=+e-+t.clone().add(r.months,"M"),r}function Zq(t,e){var r;return t.isValid()&&e.isValid()?(e=My(e,t),t.isBefore(e)?r=PT(t,e):(r=PT(e,t),r.milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function UN(t,e){return function(r,n){var i,s;return n!==null&&!isNaN(+n)&&(wN(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."),s=r,r=n,n=s),i=ws(r,n),GN(this,i,t),this}}function GN(t,e,r,n){var i=e._milliseconds,s=E1(e._days),o=E1(e._months);!t.isValid()||(n=n==null?!0:n,o&&_N(t,hm(t,"Month")+o*r),s&&SN(t,"Date",hm(t,"Date")+s*r),i&&t._d.setTime(t._d.valueOf()+i*r),n&&ye.updateOffset(t,s||o))}var Jq=UN(1,"add"),Qq=UN(-1,"subtract");function YN(t){return typeof t=="string"||t instanceof String}function eZ(t){return fs(t)||ff(t)||YN(t)||Lo(t)||rZ(t)||tZ(t)||t===null||t===void 0}function tZ(t){var e=Wl(t)&&!fy(t),r=!1,n=["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,s,o=n.length;for(i=0;i<o;i+=1)s=n[i],r=r||Mt(t,s);return e&&r}function rZ(t){var e=ds(t),r=!1;return e&&(r=t.filter(function(n){return!Lo(n)&&YN(t)}).length===0),e&&r}function nZ(t){var e=Wl(t)&&!fy(t),r=!1,n=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,s;for(i=0;i<n.length;i+=1)s=n[i],r=r||Mt(t,s);return e&&r}function iZ(t,e){var r=t.diff(e,"days",!0);return r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse"}function sZ(t,e){arguments.length===1&&(arguments[0]?eZ(arguments[0])?(t=arguments[0],e=void 0):nZ(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var r=t||Kt(),n=My(r,this).startOf("day"),i=ye.calendarFormat(this,n)||"sameElse",s=e&&(ro(e[i])?e[i].call(this,r):e[i]);return this.format(s||this.localeData().calendar(i,this,Kt(r)))}function oZ(){return new gf(this)}function aZ(t,e){var r=fs(t)?t:Kt(t);return this.isValid()&&r.isValid()?(e=$i(e)||"millisecond",e==="millisecond"?this.valueOf()>r.valueOf():r.valueOf()<this.clone().startOf(e).valueOf()):!1}function lZ(t,e){var r=fs(t)?t:Kt(t);return this.isValid()&&r.isValid()?(e=$i(e)||"millisecond",e==="millisecond"?this.valueOf()<r.valueOf():this.clone().endOf(e).valueOf()<r.valueOf()):!1}function cZ(t,e,r,n){var i=fs(t)?t:Kt(t),s=fs(e)?e:Kt(e);return this.isValid()&&i.isValid()&&s.isValid()?(n=n||"()",(n[0]==="("?this.isAfter(i,r):!this.isBefore(i,r))&&(n[1]===")"?this.isBefore(s,r):!this.isAfter(s,r))):!1}function uZ(t,e){var r=fs(t)?t:Kt(t),n;return this.isValid()&&r.isValid()?(e=$i(e)||"millisecond",e==="millisecond"?this.valueOf()===r.valueOf():(n=r.valueOf(),this.clone().startOf(e).valueOf()<=n&&n<=this.clone().endOf(e).valueOf())):!1}function hZ(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function dZ(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function fZ(t,e,r){var n,i,s;if(!this.isValid())return NaN;if(n=My(t,this),!n.isValid())return NaN;switch(i=(n.utcOffset()-this.utcOffset())*6e4,e=$i(e),e){case"year":s=M0(this,n)/12;break;case"month":s=M0(this,n);break;case"quarter":s=M0(this,n)/3;break;case"second":s=(this-n)/1e3;break;case"minute":s=(this-n)/6e4;break;case"hour":s=(this-n)/36e5;break;case"day":s=(this-n-i)/864e5;break;case"week":s=(this-n-i)/6048e5;break;default:s=this-n}return r?s:Ii(s)}function M0(t,e){if(t.date()<e.date())return-M0(e,t);var r=(e.year()-t.year())*12+(e.month()-t.month()),n=t.clone().add(r,"months"),i,s;return e-n<0?(i=t.clone().add(r-1,"months"),s=(e-n)/(n-i)):(i=t.clone().add(r+1,"months"),s=(e-n)/(i-n)),-(r+s)||0}ye.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";ye.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function gZ(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function mZ(t){if(!this.isValid())return null;var e=t!==!0,r=e?this.clone().utc():this;return r.year()<0||r.year()>9999?_0(r,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):ro(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",_0(r,"Z")):_0(r,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function pZ(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="",r,n,i,s;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),r="["+t+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",s=e+'[")]',this.format(r+n+i+s)}function wZ(t){t||(t=this.isUtc()?ye.defaultFormatUtc:ye.defaultFormat);var e=_0(this,t);return this.localeData().postformat(e)}function vZ(t,e){return this.isValid()&&(fs(t)&&t.isValid()||Kt(t).isValid())?ws({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function CZ(t){return this.from(Kt(),t)}function SZ(t,e){return this.isValid()&&(fs(t)&&t.isValid()||Kt(t).isValid())?ws({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function yZ(t){return this.to(Kt(),t)}function zN(t){var e;return t===void 0?this._locale._abbr:(e=Uo(t),e!=null&&(this._locale=e),this)}var jN=Li("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 KN(){return this._locale}var gm=1e3,xu=60*gm,mm=60*xu,XN=(365*400+97)*24*mm;function bu(t,e){return(t%e+e)%e}function qN(t,e,r){return t<100&&t>=0?new Date(t+400,e,r)-XN:new Date(t,e,r).valueOf()}function ZN(t,e,r){return t<100&&t>=0?Date.UTC(t+400,e,r)-XN:Date.UTC(t,e,r)}function xZ(t){var e,r;if(t=$i(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?ZN:qN,t){case"year":e=r(this.year(),0,1);break;case"quarter":e=r(this.year(),this.month()-this.month()%3,1);break;case"month":e=r(this.year(),this.month(),1);break;case"week":e=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=r(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=bu(e+(this._isUTC?0:this.utcOffset()*xu),mm);break;case"minute":e=this._d.valueOf(),e-=bu(e,xu);break;case"second":e=this._d.valueOf(),e-=bu(e,gm);break}return this._d.setTime(e),ye.updateOffset(this,!0),this}function bZ(t){var e,r;if(t=$i(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?ZN:qN,t){case"year":e=r(this.year()+1,0,1)-1;break;case"quarter":e=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=r(this.year(),this.month()+1,1)-1;break;case"week":e=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=mm-bu(e+(this._isUTC?0:this.utcOffset()*xu),mm)-1;break;case"minute":e=this._d.valueOf(),e+=xu-bu(e,xu)-1;break;case"second":e=this._d.valueOf(),e+=gm-bu(e,gm)-1;break}return this._d.setTime(e),ye.updateOffset(this,!0),this}function EZ(){return this._d.valueOf()-(this._offset||0)*6e4}function RZ(){return Math.floor(this.valueOf()/1e3)}function TZ(){return new Date(this.valueOf())}function _Z(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function AZ(){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 MZ(){return this.isValid()?this.toISOString():null}function OZ(){return gy(this)}function IZ(){return xa({},ct(this))}function PZ(){return ct(this).overflow}function DZ(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Xe("N",0,0,"eraAbbr");Xe("NN",0,0,"eraAbbr");Xe("NNN",0,0,"eraAbbr");Xe("NNNN",0,0,"eraName");Xe("NNNNN",0,0,"eraNarrow");Xe("y",["y",1],"yo","eraYear");Xe("y",["yy",2],0,"eraYear");Xe("y",["yyy",3],0,"eraYear");Xe("y",["yyyy",4],0,"eraYear");We("N",Oy);We("NN",Oy);We("NNN",Oy);We("NNNN",GZ);We("NNNNN",YZ);Lt(["N","NN","NNN","NNNN","NNNNN"],function(t,e,r,n){var i=r._locale.erasParse(t,n,r._strict);i?ct(r).era=i:ct(r).invalidEra=t});We("y",Wu);We("yy",Wu);We("yyy",Wu);We("yyyy",Wu);We("yo",zZ);Lt(["y","yy","yyy","yyyy"],dn);Lt(["yo"],function(t,e,r,n){var i;r._locale._eraYearOrdinalRegex&&(i=t.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?e[dn]=r._locale.eraYearOrdinalParse(t,i):e[dn]=parseInt(t,10)});function kZ(t,e){var r,n,i,s=this._eras||Uo("en")._eras;for(r=0,n=s.length;r<n;++r){switch(typeof s[r].since){case"string":i=ye(s[r].since).startOf("day"),s[r].since=i.valueOf();break}switch(typeof s[r].until){case"undefined":s[r].until=1/0;break;case"string":i=ye(s[r].until).startOf("day").valueOf(),s[r].until=i.valueOf();break}}return s}function NZ(t,e,r){var n,i,s=this.eras(),o,a,l;for(t=t.toUpperCase(),n=0,i=s.length;n<i;++n)if(o=s[n].name.toUpperCase(),a=s[n].abbr.toUpperCase(),l=s[n].narrow.toUpperCase(),r)switch(e){case"N":case"NN":case"NNN":if(a===t)return s[n];break;case"NNNN":if(o===t)return s[n];break;case"NNNNN":if(l===t)return s[n];break}else if([o,a,l].indexOf(t)>=0)return s[n]}function HZ(t,e){var r=t.since<=t.until?1:-1;return e===void 0?ye(t.since).year():ye(t.since).year()+(e-t.offset)*r}function FZ(){var t,e,r,n=this.localeData().eras();for(t=0,e=n.length;t<e;++t)if(r=this.clone().startOf("day").valueOf(),n[t].since<=r&&r<=n[t].until||n[t].until<=r&&r<=n[t].since)return n[t].name;return""}function LZ(){var t,e,r,n=this.localeData().eras();for(t=0,e=n.length;t<e;++t)if(r=this.clone().startOf("day").valueOf(),n[t].since<=r&&r<=n[t].until||n[t].until<=r&&r<=n[t].since)return n[t].narrow;return""}function $Z(){var t,e,r,n=this.localeData().eras();for(t=0,e=n.length;t<e;++t)if(r=this.clone().startOf("day").valueOf(),n[t].since<=r&&r<=n[t].until||n[t].until<=r&&r<=n[t].since)return n[t].abbr;return""}function BZ(){var t,e,r,n,i=this.localeData().eras();for(t=0,e=i.length;t<e;++t)if(r=i[t].since<=i[t].until?1:-1,n=this.clone().startOf("day").valueOf(),i[t].since<=n&&n<=i[t].until||i[t].until<=n&&n<=i[t].since)return(this.year()-ye(i[t].since).year())*r+i[t].offset;return this.year()}function WZ(t){return Mt(this,"_erasNameRegex")||Iy.call(this),t?this._erasNameRegex:this._erasRegex}function VZ(t){return Mt(this,"_erasAbbrRegex")||Iy.call(this),t?this._erasAbbrRegex:this._erasRegex}function UZ(t){return Mt(this,"_erasNarrowRegex")||Iy.call(this),t?this._erasNarrowRegex:this._erasRegex}function Oy(t,e){return e.erasAbbrRegex(t)}function GZ(t,e){return e.erasNameRegex(t)}function YZ(t,e){return e.erasNarrowRegex(t)}function zZ(t,e){return e._eraYearOrdinalRegex||Wu}function Iy(){var t=[],e=[],r=[],n=[],i,s,o=this.eras();for(i=0,s=o.length;i<s;++i)e.push(ci(o[i].name)),t.push(ci(o[i].abbr)),r.push(ci(o[i].narrow)),n.push(ci(o[i].name)),n.push(ci(o[i].abbr)),n.push(ci(o[i].narrow));this._erasRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+t.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+r.join("|")+")","i")}Xe(0,["gg",2],0,function(){return this.weekYear()%100});Xe(0,["GG",2],0,function(){return this.isoWeekYear()%100});function bp(t,e){Xe(0,[t,t.length],0,e)}bp("gggg","weekYear");bp("ggggg","weekYear");bp("GGGG","isoWeekYear");bp("GGGGG","isoWeekYear");wn("weekYear","gg");wn("isoWeekYear","GG");vn("weekYear",1);vn("isoWeekYear",1);We("G",vp);We("g",vp);We("GG",Xt,pi);We("gg",Xt,pi);We("GGGG",Sy,Cy);We("gggg",Sy,Cy);We("GGGGG",wp,mp);We("ggggg",wp,mp);pf(["gggg","ggggg","GGGG","GGGGG"],function(t,e,r,n){e[n.substr(0,2)]=vt(t)});pf(["gg","GG"],function(t,e,r,n){e[n]=ye.parseTwoDigitYear(t)});function jZ(t){return JN.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function KZ(t){return JN.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function XZ(){return Ho(this.year(),1,4)}function qZ(){return Ho(this.isoWeekYear(),1,4)}function ZZ(){var t=this.localeData()._week;return Ho(this.year(),t.dow,t.doy)}function JZ(){var t=this.localeData()._week;return Ho(this.weekYear(),t.dow,t.doy)}function JN(t,e,r,n,i){var s;return t==null?Ud(this,n,i).year:(s=Ho(t,n,i),e>s&&(e=s),QZ.call(this,t,e,r,n,i))}function QZ(t,e,r,n,i){var s=IN(t,e,r,n,i),o=Vd(s.year,0,s.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}Xe("Q",0,"Qo","quarter");wn("quarter","Q");vn("quarter",7);We("Q",yN);Lt("Q",function(t,e){e[_o]=(vt(t)-1)*3});function eJ(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}Xe("D",["DD",2],"Do","date");wn("date","D");vn("date",9);We("D",Xt);We("DD",Xt,pi);We("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient});Lt(["D","DD"],Vs);Lt("Do",function(t,e){e[Vs]=vt(t.match(Xt)[0])});var QN=Bu("Date",!0);Xe("DDD",["DDDD",3],"DDDo","dayOfYear");wn("dayOfYear","DDD");vn("dayOfYear",4);We("DDD",pp);We("DDDD",xN);Lt(["DDD","DDDD"],function(t,e,r){r._dayOfYear=vt(t)});function tJ(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}Xe("m",["mm",2],0,"minute");wn("minute","m");vn("minute",14);We("m",Xt);We("mm",Xt,pi);Lt(["m","mm"],cs);var rJ=Bu("Minutes",!1);Xe("s",["ss",2],0,"second");wn("second","s");vn("second",15);We("s",Xt);We("ss",Xt,pi);Lt(["s","ss"],Ao);var nJ=Bu("Seconds",!1);Xe("S",0,0,function(){return~~(this.millisecond()/100)});Xe(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Xe(0,["SSS",3],0,"millisecond");Xe(0,["SSSS",4],0,function(){return this.millisecond()*10});Xe(0,["SSSSS",5],0,function(){return this.millisecond()*100});Xe(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Xe(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Xe(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Xe(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});wn("millisecond","ms");vn("millisecond",16);We("S",pp,yN);We("SS",pp,pi);We("SSS",pp,xN);var ba,eH;for(ba="SSSS";ba.length<=9;ba+="S")We(ba,Wu);function iJ(t,e){e[Dl]=vt(("0."+t)*1e3)}for(ba="S";ba.length<=9;ba+="S")Lt(ba,iJ);eH=Bu("Milliseconds",!1);Xe("z",0,0,"zoneAbbr");Xe("zz",0,0,"zoneName");function sJ(){return this._isUTC?"UTC":""}function oJ(){return this._isUTC?"Coordinated Universal Time":""}var Te=gf.prototype;Te.add=Jq;Te.calendar=sZ;Te.clone=oZ;Te.diff=fZ;Te.endOf=bZ;Te.format=wZ;Te.from=vZ;Te.fromNow=CZ;Te.to=SZ;Te.toNow=yZ;Te.get=lX;Te.invalidAt=PZ;Te.isAfter=aZ;Te.isBefore=lZ;Te.isBetween=cZ;Te.isSame=uZ;Te.isSameOrAfter=hZ;Te.isSameOrBefore=dZ;Te.isValid=OZ;Te.lang=jN;Te.locale=zN;Te.localeData=KN;Te.max=Oq;Te.min=Mq;Te.parsingFlags=IZ;Te.set=cX;Te.startOf=xZ;Te.subtract=Qq;Te.toArray=_Z;Te.toObject=AZ;Te.toDate=TZ;Te.toISOString=mZ;Te.inspect=pZ;typeof Symbol!="undefined"&&Symbol.for!=null&&(Te[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});Te.toJSON=MZ;Te.toString=gZ;Te.unix=RZ;Te.valueOf=EZ;Te.creationData=DZ;Te.eraName=FZ;Te.eraNarrow=LZ;Te.eraAbbr=$Z;Te.eraYear=BZ;Te.year=ON;Te.isLeapYear=AX;Te.weekYear=jZ;Te.isoWeekYear=KZ;Te.quarter=Te.quarters=eJ;Te.month=AN;Te.daysInMonth=RX;Te.week=Te.weeks=kX;Te.isoWeek=Te.isoWeeks=NX;Te.weeksInYear=ZZ;Te.weeksInWeekYear=JZ;Te.isoWeeksInYear=XZ;Te.isoWeeksInISOWeekYear=qZ;Te.date=QN;Te.day=Te.days=KX;Te.weekday=XX;Te.isoWeekday=qX;Te.dayOfYear=tJ;Te.hour=Te.hours=nq;Te.minute=Te.minutes=rJ;Te.second=Te.seconds=nJ;Te.millisecond=Te.milliseconds=eH;Te.utcOffset=$q;Te.utc=Wq;Te.local=Vq;Te.parseZone=Uq;Te.hasAlignedHourOffset=Gq;Te.isDST=Yq;Te.isLocal=jq;Te.isUtcOffset=Kq;Te.isUtc=VN;Te.isUTC=VN;Te.zoneAbbr=sJ;Te.zoneName=oJ;Te.dates=Li("dates accessor is deprecated. Use date instead.",QN);Te.months=Li("months accessor is deprecated. Use month instead",AN);Te.years=Li("years accessor is deprecated. Use year instead",ON);Te.zone=Li("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Bq);Te.isDSTShifted=Li("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",zq);function aJ(t){return Kt(t*1e3)}function lJ(){return Kt.apply(null,arguments).parseZone()}function tH(t){return t}var Ot=py.prototype;Ot.calendar=KK;Ot.longDateFormat=JK;Ot.invalidDate=eX;Ot.ordinal=nX;Ot.preparse=tH;Ot.postformat=tH;Ot.relativeTime=sX;Ot.pastFuture=oX;Ot.set=zK;Ot.eras=kZ;Ot.erasParse=NZ;Ot.erasConvertYear=HZ;Ot.erasAbbrRegex=VZ;Ot.erasNameRegex=WZ;Ot.erasNarrowRegex=UZ;Ot.months=yX;Ot.monthsShort=xX;Ot.monthsParse=EX;Ot.monthsRegex=_X;Ot.monthsShortRegex=TX;Ot.week=OX;Ot.firstDayOfYear=DX;Ot.firstDayOfWeek=PX;Ot.weekdays=UX;Ot.weekdaysMin=YX;Ot.weekdaysShort=GX;Ot.weekdaysParse=jX;Ot.weekdaysRegex=ZX;Ot.weekdaysShortRegex=JX;Ot.weekdaysMinRegex=QX;Ot.isPM=tq;Ot.meridiem=iq;function pm(t,e,r,n){var i=Uo(),s=to().set(n,e);return i[r](s,t)}function rH(t,e,r){if(Lo(t)&&(e=t,t=void 0),t=t||"",e!=null)return pm(t,e,r,"month");var n,i=[];for(n=0;n<12;n++)i[n]=pm(t,n,r,"month");return i}function Py(t,e,r,n){typeof t=="boolean"?(Lo(e)&&(r=e,e=void 0),e=e||""):(e=t,r=e,t=!1,Lo(e)&&(r=e,e=void 0),e=e||"");var i=Uo(),s=t?i._week.dow:0,o,a=[];if(r!=null)return pm(e,(r+s)%7,n,"day");for(o=0;o<7;o++)a[o]=pm(e,(o+s)%7,n,"day");return a}function cJ(t,e){return rH(t,e,"months")}function uJ(t,e){return rH(t,e,"monthsShort")}function hJ(t,e,r){return Py(t,e,r,"weekdays")}function dJ(t,e,r){return Py(t,e,r,"weekdaysShort")}function fJ(t,e,r){return Py(t,e,r,"weekdaysMin")}Oa("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,r=vt(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+r}});ye.lang=Li("moment.lang is deprecated. Use moment.locale instead.",Oa);ye.langData=Li("moment.langData is deprecated. Use moment.localeData instead.",Uo);var oo=Math.abs;function gJ(){var t=this._data;return this._milliseconds=oo(this._milliseconds),this._days=oo(this._days),this._months=oo(this._months),t.milliseconds=oo(t.milliseconds),t.seconds=oo(t.seconds),t.minutes=oo(t.minutes),t.hours=oo(t.hours),t.months=oo(t.months),t.years=oo(t.years),this}function nH(t,e,r,n){var i=ws(e,r);return t._milliseconds+=n*i._milliseconds,t._days+=n*i._days,t._months+=n*i._months,t._bubble()}function mJ(t,e){return nH(this,t,e,1)}function pJ(t,e){return nH(this,t,e,-1)}function DT(t){return t<0?Math.floor(t):Math.ceil(t)}function wJ(){var t=this._milliseconds,e=this._days,r=this._months,n=this._data,i,s,o,a,l;return t>=0&&e>=0&&r>=0||t<=0&&e<=0&&r<=0||(t+=DT(T1(r)+e)*864e5,e=0,r=0),n.milliseconds=t%1e3,i=Ii(t/1e3),n.seconds=i%60,s=Ii(i/60),n.minutes=s%60,o=Ii(s/60),n.hours=o%24,e+=Ii(o/24),l=Ii(iH(e)),r+=l,e-=DT(T1(l)),a=Ii(r/12),r%=12,n.days=e,n.months=r,n.years=a,this}function iH(t){return t*4800/146097}function T1(t){return t*146097/4800}function vJ(t){if(!this.isValid())return NaN;var e,r,n=this._milliseconds;if(t=$i(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+n/864e5,r=this._months+iH(e),t){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(e=this._days+Math.round(T1(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return e*24+n/36e5;case"minute":return e*1440+n/6e4;case"second":return e*86400+n/1e3;case"millisecond":return Math.floor(e*864e5)+n;default:throw new Error("Unknown unit "+t)}}function CJ(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+vt(this._months/12)*31536e6:NaN}function Go(t){return function(){return this.as(t)}}var SJ=Go("ms"),yJ=Go("s"),xJ=Go("m"),bJ=Go("h"),EJ=Go("d"),RJ=Go("w"),TJ=Go("M"),_J=Go("Q"),AJ=Go("y");function MJ(){return ws(this)}function OJ(t){return t=$i(t),this.isValid()?this[t+"s"]():NaN}function cc(t){return function(){return this.isValid()?this._data[t]:NaN}}var IJ=cc("milliseconds"),PJ=cc("seconds"),DJ=cc("minutes"),kJ=cc("hours"),NJ=cc("days"),HJ=cc("months"),FJ=cc("years");function LJ(){return Ii(this.days()/7)}var yo=Math.round,fu={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function $J(t,e,r,n,i){return i.relativeTime(e||1,!!r,t,n)}function BJ(t,e,r,n){var i=ws(t).abs(),s=yo(i.as("s")),o=yo(i.as("m")),a=yo(i.as("h")),l=yo(i.as("d")),c=yo(i.as("M")),u=yo(i.as("w")),h=yo(i.as("y")),d=s<=r.ss&&["s",s]||s<r.s&&["ss",s]||o<=1&&["m"]||o<r.m&&["mm",o]||a<=1&&["h"]||a<r.h&&["hh",a]||l<=1&&["d"]||l<r.d&&["dd",l];return r.w!=null&&(d=d||u<=1&&["w"]||u<r.w&&["ww",u]),d=d||c<=1&&["M"]||c<r.M&&["MM",c]||h<=1&&["y"]||["yy",h],d[2]=e,d[3]=+t>0,d[4]=n,$J.apply(null,d)}function WJ(t){return t===void 0?yo:typeof t=="function"?(yo=t,!0):!1}function VJ(t,e){return fu[t]===void 0?!1:e===void 0?fu[t]:(fu[t]=e,t==="s"&&(fu.ss=e-1),!0)}function UJ(t,e){if(!this.isValid())return this.localeData().invalidDate();var r=!1,n=fu,i,s;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(r=t),typeof e=="object"&&(n=Object.assign({},fu,e),e.s!=null&&e.ss==null&&(n.ss=e.s-1)),i=this.localeData(),s=BJ(this,!r,n,i),r&&(s=i.pastFuture(+this,s)),i.postformat(s)}var Gw=Math.abs;function pc(t){return(t>0)-(t<0)||+t}function Ep(){if(!this.isValid())return this.localeData().invalidDate();var t=Gw(this._milliseconds)/1e3,e=Gw(this._days),r=Gw(this._months),n,i,s,o,a=this.asSeconds(),l,c,u,h;return a?(n=Ii(t/60),i=Ii(n/60),t%=60,n%=60,s=Ii(r/12),r%=12,o=t?t.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",c=pc(this._months)!==pc(a)?"-":"",u=pc(this._days)!==pc(a)?"-":"",h=pc(this._milliseconds)!==pc(a)?"-":"",l+"P"+(s?c+s+"Y":"")+(r?c+r+"M":"")+(e?u+e+"D":"")+(i||n||t?"T":"")+(i?h+i+"H":"")+(n?h+n+"M":"")+(t?h+o+"S":"")):"P0D"}var Et=xp.prototype;Et.isValid=Nq;Et.abs=gJ;Et.add=mJ;Et.subtract=pJ;Et.as=vJ;Et.asMilliseconds=SJ;Et.asSeconds=yJ;Et.asMinutes=xJ;Et.asHours=bJ;Et.asDays=EJ;Et.asWeeks=RJ;Et.asMonths=TJ;Et.asQuarters=_J;Et.asYears=AJ;Et.valueOf=CJ;Et._bubble=wJ;Et.clone=MJ;Et.get=OJ;Et.milliseconds=IJ;Et.seconds=PJ;Et.minutes=DJ;Et.hours=kJ;Et.days=NJ;Et.weeks=LJ;Et.months=HJ;Et.years=FJ;Et.humanize=UJ;Et.toISOString=Ep;Et.toString=Ep;Et.toJSON=Ep;Et.locale=zN;Et.localeData=KN;Et.toIsoString=Li("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ep);Et.lang=jN;Xe("X",0,0,"unix");Xe("x",0,0,"valueOf");We("x",vp);We("X",hX);Lt("X",function(t,e,r){r._d=new Date(parseFloat(t)*1e3)});Lt("x",function(t,e,r){r._d=new Date(vt(t))});//! moment.js
  49. ye.version="2.29.4";GK(Kt);ye.fn=Te;ye.min=Iq;ye.max=Pq;ye.now=Dq;ye.utc=to;ye.unix=aJ;ye.months=cJ;ye.isDate=ff;ye.locale=Oa;ye.invalid=fp;ye.duration=ws;ye.isMoment=fs;ye.weekdays=hJ;ye.parseZone=lJ;ye.localeData=Uo;ye.isDuration=A0;ye.monthsShort=uJ;ye.weekdaysMin=fJ;ye.defineLocale=Ey;ye.updateLocale=lq;ye.locales=cq;ye.weekdaysShort=dJ;ye.normalizeUnits=$i;ye.relativeTimeRounding=WJ;ye.relativeTimeThreshold=VJ;ye.calendarFormat=iZ;ye.prototype=Te;ye.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 GJ(t){const e=t.length;let r=0;for(;r<e;)t[r]=[t[r]],r+=1}function kT(t,e){const r=e.length;let n=0;for(;n<r;)t.push(e[n]),n+=1}function O0(t){const e=[];if(!t||t.length===0||!t[0]||t[0].length===0)return e;const r=t.length,n=t[0].length;for(let i=0;i<r;i++)for(let s=0;s<n;s++)e[s]||(e[s]=[]),e[s][i]=t[i][s];return e}function Cn(t,e,r,n){let i=-1,s=t,o=r;Array.isArray(t)||(s=Array.from(t));const a=s.length;for(n&&a&&(i+=1,o=s[i]),i+=1;i<a;)o=e(o,s[i],i,s),i+=1;return o}function Ni(t,e){let r=0,n=t;Array.isArray(t)||(n=Array.from(t));const i=n.length,s=[];let o=-1;for(;r<i;){const a=n[r];e(a,r,n)&&(o+=1,s[o]=a),r+=1}return s}function ht(t,e){let r=0,n=t;Array.isArray(t)||(n=Array.from(t));const i=n.length,s=[];let o=-1;for(;r<i;){const a=n[r];o+=1,s[o]=e(a,r,n),r+=1}return s}function j(t,e){let r=0,n=t;Array.isArray(t)||(n=Array.from(t));const i=n.length;for(;r<i&&e(n[r],r,n)!==!1;)r+=1;return t}function sH(t){const e=[];return j(t,r=>{e.indexOf(r)===-1&&e.push(r)}),e}function NT(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const[n,...i]=[...e];let s=n;return j(i,o=>{s=s.filter(a=>!o.includes(a))}),s}function HT(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:" ";return t.split(e)}function Pt(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return Cn(t,(s,o,a)=>{const l=o.replace(/\r?\n\s*/g,""),c=r[a]?r[a]:"";return s+l+c},"").trim()}function Sr(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 He(t){return typeof t!="undefined"}function Gt(t){return typeof t=="undefined"}function kr(t){return t===null||t===""||Gt(t)}function YJ(t){return Object.prototype.toString.call(t)==="[object RegExp]"}const Jh="length",md=t=>parseInt(t,16),FT=t=>parseInt(t,10),wm=(t,e,r)=>t.substr(e,r),pd=t=>t.codePointAt(0)-65,_1=t=>`${t}`.replace(/\-/g,""),zJ=t=>md(wm(_1(t),md("12"),pd("F")))/(md(wm(_1(t),pd("B"),~~![][Jh]))||9),jJ=()=>typeof location!="undefined"&&/^([a-z0-9\-]+\.)?\x68\x61\x6E\x64\x73\x6F\x6E\x74\x61\x62\x6C\x65\x2E\x63\x6F\x6D$/i.test(location.host);let LT=!1;const $T={invalid:()=>Pt`
  50. The license key for Handsontable is invalid.\x20
  51. If you need any help, contact us at support@handsontable.com.`,expired:t=>{let{keyValidityDate:e,hotVersion:r}=t;return Pt`
  52. The license key for Handsontable expired on ${e}, and is not valid for the installed\x20
  53. version ${r}. Renew your license key at handsontable.com or downgrade to a version released prior\x20
  54. to ${e}. If you need any help, contact us at sales@handsontable.com.`},missing:()=>Pt`
  55. The license key for Handsontable is missing. Use your purchased key to activate the product.\x20
  56. Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20
  57. passing the key: 'non-commercial-and-evaluation'. If you need any help, contact\x20
  58. us at support@handsontable.com.`,non_commercial:()=>""},BT={invalid:()=>Pt`
  59. The license key for Handsontable is invalid.\x20
  60. <a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> on how to\x20
  61. install it properly or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,expired:t=>{let{keyValidityDate:e,hotVersion:r}=t;return Pt`
  62. The license key for Handsontable expired on ${e}, and is not valid for the installed\x20
  63. version ${r}. <a href="https://handsontable.com/pricing" target="_blank">Renew</a> your\x20
  64. license key or downgrade to a version released prior to ${e}. If you need any\x20
  65. help, contact us at <a href="mailto:sales@handsontable.com">sales@handsontable.com</a>.`},missing:()=>Pt`
  66. The license key for Handsontable is missing. Use your purchased key to activate the product.\x20
  67. Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20
  68. passing the key: 'non-commercial-and-evaluation'.\x20
  69. <a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> about it in\x20
  70. the documentation or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,non_commercial:()=>""};function KJ(t,e){const r=!kr(t),n=typeof t=="string"&&t.toLowerCase()==="non-commercial-and-evaluation",i="14.1.0";let s,o="invalid",a="invalid";t=_1(t||"");const l=XJ(t);if(r||n||l)if(l){const c=ye("16/01/2024","DD/MM/YYYY"),u=Math.floor(c.toDate().getTime()/864e5),h=zJ(t);s=ye((h+1)*864e5,"x").format("MMMM DD, YYYY"),u>h?(o="expired",a="expired"):(o="valid",a="valid")}else n?(o="non_commercial",a="valid"):(o="invalid",a="invalid");else o="missing",a="missing";if(jJ()&&(o="valid",a="valid"),!LT&&o!=="valid"&&($T[o]({keyValidityDate:s,hotVersion:i})&&console[o==="non_commercial"?"info":"warn"]($T[o]({keyValidityDate:s,hotVersion:i})),LT=!0),a!=="valid"&&e.parentNode&&BT[a]({keyValidityDate:s,hotVersion:i})){const u=document.createElement("div");u.className="hot-display-license-info",u.innerHTML=BT[a]({keyValidityDate:s,hotVersion:i}),e.parentNode.insertBefore(u,e.nextSibling)}}function XJ(t){let e=[][Jh],r=e;if(t[Jh]!==pd("Z"))return!1;for(let n="",i="B<H4P+".split(""),s=pd(i.shift());s;s=pd(i.shift()||"A"))--s<""[Jh]?r=r|(FT(`${FT(md(n)+(md(wm(t,Math.abs(s),2))+[]).padStart(2,"0"))}`)%97||2)>>1:n=wm(t,s,s?i[Jh]===1?9:8:6);return r===e}function gs(t){return t[0].toUpperCase()+t.substr(1)}function oH(){function t(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return t()+t()+t()+t()}function aH(t){return/^([0-9][0-9]?%$)|(^100%$)/.test(t)}function lH(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return`${t}`.replace(/(?:\\)?\[([^[\]]+)]/g,(r,n)=>r.charAt(0)==="\\"?r.substr(1,r.length-1):e[n]===void 0?"":e[n])}function WT(t){return Dy(`${t}`,{ALLOWED_TAGS:[]})}function Dy(t,e){return UK.sanitize(t,e)}const Vu=t=>["tabindex",t],qJ=()=>["role","treegrid"],Ys=()=>["role","presentation"],ZJ=()=>["role","gridcell"],JJ=()=>["role","rowheader"],cH=()=>["role","rowgroup"],QJ=()=>["role","columnheader"],A1=()=>["role","row"],eQ=()=>["role","menu"],tQ=()=>["role","menuitem"],rQ=()=>["role","combobox"],uH=()=>["role","listbox"],nQ=()=>["role","option"],iQ=()=>["role","checkbox"],sQ=()=>["scope","col"],oQ=()=>["scope","row"],aQ=()=>["type","text"],ky=t=>["aria-label",t],Yo=()=>["aria-hidden","true"],lQ=()=>["aria-disabled","true"],cQ=()=>["aria-multiselectable","true"],hH=t=>["aria-haspopup",t],dH=t=>["aria-rowcount",t],Rp=t=>["aria-colcount",t],fH=t=>["aria-rowindex",t],Ny=t=>["aria-colindex",t],Pi=t=>["aria-expanded",t],uQ=t=>["aria-sort",t],VT=()=>["aria-readonly","true"],UT=()=>["aria-invalid","true"],hQ=t=>["aria-checked",t],Hy=()=>["aria-selected","true"],dQ=()=>["aria-autocomplete","list"],fQ=t=>["aria-controls",t],gQ=t=>["aria-activedescendant",t],mQ=t=>["aria-live",t],pQ=t=>["aria-relevant",t],wQ=t=>["aria-setsize",t],vQ=t=>["aria-posinset",t];function CQ(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=null,i=t;for(;i!==null;){if(r===e){n=i;break}i.host&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE?i=i.host:(r+=1,i=i.parentNode)}return n}function SQ(t,e){const r=t.closest(".handsontable");return!!r&&(r.parentNode===e||r===e)}function yQ(t){return Object.getPrototypeOf(t.parent)&&t.frameElement}function vm(t){return yQ(t)&&t.parent}function zl(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;const{ELEMENT_NODE:n,DOCUMENT_FRAGMENT_NODE:i}=Node;let s=t;for(;s!=null&&s!==r;){const{nodeType:o,nodeName:a}=s;if(o===n&&(e.includes(a)||e.includes(s)))return s;const{host:l}=s;l&&o===i?s=l:s=s.parentNode}return null}function ig(t,e,r){const n=[];let i=t;for(;i&&(i=zl(i,e,r),!(!i||r&&!r.contains(i)));)n.push(i),i.host&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE?i=i.host:i=i.parentNode;const s=n.length;return s?n[s-1]:null}function Vl(t,e){let r=t.parentNode,n=[];for(typeof e=="string"?t.defaultView?n=Array.prototype.slice.call(t.querySelectorAll(e),0):n=Array.prototype.slice.call(t.ownerDocument.querySelectorAll(e),0):n.push(e);r!==null;){if(n.indexOf(r)>-1)return!0;r=r.parentNode}return!1}function xQ(t){let e=0,r=t;if(r.previousSibling)for(;r=r.previousSibling;)e+=1;return e}function el(t,e,r){const n=r.parentElement.querySelector(`.ht_clone_${t}`);return n?n.contains(e):null}function gH(t){return!t||!t.length?[]:t.filter(e=>!!e)}function mH(t,e){if(!t||!t.length)return e?{regexFree:[],regexes:[]}:[];const r=[],n=[];return n.push(...t.filter(i=>{const s=i instanceof RegExp;return s&&e&&r.push(i),!s})),e?{regexFree:n,regexes:r}:n}function Je(t,e){return t.classList===void 0||typeof e!="string"||e===""?!1:t.classList.contains(e)}function be(t,e){typeof e=="string"&&(e=e.split(" ")),e=gH(e),e.length>0&&t.classList.add(...e)}function rt(t,e){typeof e=="string"?e=e.split(" "):e instanceof RegExp&&(e=[e]);let{regexFree:r,regexes:n}=mH(e,!0);r=gH(r),r.length>0&&t.classList.remove(...r),n.forEach(i=>{t.classList.forEach(s=>{i.test(s)&&t.classList.remove(s)})})}function qe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;Array.isArray(e)||(e=[[e,r]]),e.forEach(n=>{Array.isArray(n)&&n[0]!==""&&t.setAttribute(...n)})}function Uu(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:r,regexes:n}=mH(e,!0);r.forEach(i=>{i!==""&&t.removeAttribute(i)}),n.forEach(i=>{t.getAttributeNames().forEach(s=>{i.test(s)&&t.removeAttribute(s)})})}function pH(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 r=e.length-1;r>=0;r--)pH(e[r])}}function Zs(t){let e;for(;e=t.lastChild;)t.removeChild(e)}const bQ=/(<(.*)>|&(.*);)/;function Gu(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;bQ.test(e)?t.innerHTML=r?Dy(e):e:jl(t,e)}function jl(t,e){const r=t.firstChild;r&&r.nodeType===3&&r.nextSibling===null?r.textContent=e:(Zs(t),t.appendChild(t.ownerDocument.createTextNode(e)))}function Kl(t){const e=t.ownerDocument.documentElement;let r=t;for(;r!==e;){if(r===null)return!1;if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE)if(r.host){if(r.host.impl)return Kl(r.host.impl);if(r.host)return Kl(r.host);throw new Error("Lost in Web Components world")}else return!1;else if(Fa(r).display==="none")return!1;r=r.parentNode}return!0}function Wr(t){const e=t.ownerDocument,r=e.defaultView,n=e.documentElement;let i=t,s,o,a;for(s=i.offsetLeft,o=i.offsetTop,a=i;(i=i.offsetParent)&&!(i===e.body||!("offsetLeft"in i));)s+=i.offsetLeft,o+=i.offsetTop,a=i;return a&&a.style.position==="fixed"&&(s+=r.pageXOffset||n.scrollLeft,o+=r.pageYOffset||n.scrollTop),{left:s,top:o}}function wH(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollY}function Fy(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollX}function Ly(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?wH(e):t.scrollTop}function vH(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?Fy(e):t.scrollLeft}function Cm(t){let e=t.ownerDocument,r=e?e.defaultView:void 0;e||(e=t.document?t.document:t,r=e.defaultView);const n=["auto","scroll"];let i=t.parentNode;for(;i&&i.style&&e.body!==i;){let{overflow:s,overflowX:o,overflowY:a}=i.style;if([s,o,a].includes("scroll"))return i;if({overflow:s,overflowX:o,overflowY:a}=r.getComputedStyle(i),n.includes(s)||n.includes(o)||n.includes(a)||i.clientHeight<=i.scrollHeight+1&&(n.includes(a)||n.includes(s))||i.clientWidth<=i.scrollWidth+1&&(n.includes(o)||n.includes(s)))return i;i=i.parentNode}return r}function Iu(t){const e=t.ownerDocument,r=e.defaultView;let n=t.parentNode;for(;n&&n.style&&e.body!==n;){if(n.style.overflow!=="visible"&&n.style.overflow!=="")return n;const i=Fa(n,r),s=["scroll","hidden","auto"],o=i.getPropertyValue("overflow"),a=i.getPropertyValue("overflow-y"),l=i.getPropertyValue("overflow-x");if(s.includes(o)||s.includes(a)||s.includes(l))return n;n=n.parentNode}return r}function Yd(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:window;if(t){if(t===r)return e==="width"?`${r.innerWidth}px`:e==="height"?`${r.innerHeight}px`:void 0}else return;const n=t.style[e];if(n!==""&&n!==void 0)return n;const i=Fa(t,r);if(i[e]!==""&&i[e]!==void 0)return i[e]}function Fa(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t.currentStyle||e.getComputedStyle(t)}function Ht(t){return t.offsetWidth}function cr(t){return t.offsetHeight}function gu(t){return t.clientHeight||t.innerHeight}function CH(t){return t.clientWidth||t.innerWidth}function SH(t){return t.selectionStart?t.selectionStart:0}function EQ(t){return t.selectionEnd?t.selectionEnd:0}function GT(){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 Tp(t,e,r){if(r===void 0&&(r=e),t.setSelectionRange){t.focus();try{t.setSelectionRange(e,r)}catch(n){const i=t.parentNode,s=i.style.display;i.style.display="block",t.setSelectionRange(e,r),i.style.display=s}}}let Yw;function RQ(){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 r=t.createElement("div");r.style.boxSizing="content-box",r.style.height="150px",r.style.left="0px",r.style.overflow="hidden",r.style.position="absolute",r.style.top="0px",r.style.width="200px",r.style.visibility="hidden",r.appendChild(e),(t.body||t.documentElement).appendChild(r);const n=e.offsetWidth;r.style.overflow="scroll";let i=e.offsetWidth;return n===i&&(i=r.clientWidth),(t.body||t.documentElement).removeChild(r),n-i}function Ur(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return Yw===void 0&&(Yw=RQ(t)),Yw}function TQ(t){return t.offsetWidth!==t.clientWidth}function _Q(t){return t.offsetHeight!==t.clientHeight}function $y(t,e,r){t.style.transform=`translate3d(${e},${r},0)`}function _p(t){t.style.transform&&t.style.transform!==""&&(t.style.transform="")}function I0(t){return t&&(["INPUT","SELECT","TEXTAREA"].indexOf(t.nodeName)>-1||t.contentEditable==="true")}function yH(t){return I0(t)&&t.hasAttribute("data-hot-input")===!1}function xH(t){return!t.parentNode}function AQ(t,e){new IntersectionObserver((n,i)=>{n.forEach(s=>{s.isIntersecting&&t.offsetParent!==null&&(e(),i.unobserve(t))})},{root:t.ownerDocument.body}).observe(t)}function bH(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const n=t.ownerDocument,i=n.createRange(),s=n.defaultView.getSelection();qe(t,"contenteditable",!0),r&&qe(t,...Yo()),e&&be(t,"invisibleSelection"),i.selectNodeContents(t),s.removeAllRanges(),s.addRange(i)}function EH(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const r=t.ownerDocument.defaultView.getSelection();t.hasAttribute("aria-hidden")&&t.removeAttribute("aria-hidden"),r.removeAllRanges(),e&&rt(t,"invisibleSelection"),t.removeAttribute("contenteditable")}function MQ(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;bH(t,r),e(),EH(t,r)}function Ut(t){return typeof t=="function"}function By(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:200,r=null,n;function i(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return r&&clearTimeout(r),r=setTimeout(()=>{n=t.apply(this,o)},e),n}return i}function RH(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return t.apply(this,r.concat(o))}}function OQ(t){const e=t.length;function r(n){return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];const l=n.concat(o);let c;return l.length>=e?c=t.apply(this,l):c=r(l),c}}return r([])}function M1(t,e,r,n,i,s,o,a){return He(a)?t.call(e,r,n,i,s,o,a):He(o)?t.call(e,r,n,i,s,o):He(s)?t.call(e,r,n,i,s):He(i)?t.call(e,r,n,i):He(n)?t.call(e,r,n):He(r)?t.call(e,r):t.call(e)}var IQ=Fn,YT=jk,PQ=pn,zT=Lu,DQ=eN,jT=IQ([].push),kQ=function(t){if(PQ(t))return t;if(!!YT(t)){for(var e=t.length,r=[],n=0;n<e;n++){var i=t[n];typeof i=="string"?jT(r,i):(typeof i=="number"||zT(i)==="Number"||zT(i)==="String")&&jT(r,DQ(i))}var s=r.length,o=!0;return function(a,l){if(o)return o=!1,l;if(YT(this))return l;for(var c=0;c<s;c++)if(r[c]===a)return l}}},NQ=Ya,TH=cf,_H=dp,HQ=ac,wf=Fn,AH=Fi,KT=pn,XT=ty,MH=hy,FQ=kQ,LQ=ey,$Q=String,Ia=TH("JSON","stringify"),sg=wf(/./.exec),qT=wf("".charAt),BQ=wf("".charCodeAt),WQ=wf("".replace),VQ=wf(1 .toString),UQ=/[\uD800-\uDFFF]/g,ZT=/^[\uD800-\uDBFF]$/,JT=/^[\uDC00-\uDFFF]$/,QT=!LQ||AH(function(){var t=TH("Symbol")("stringify detection");return Ia([t])!=="[null]"||Ia({a:t})!=="{}"||Ia(Object(t))!=="{}"}),e_=AH(function(){return Ia("\uDF06\uD834")!=='"\\udf06\\ud834"'||Ia("\uDEAD")!=='"\\udead"'}),GQ=function(t,e){var r=MH(arguments),n=FQ(e);if(!(!KT(n)&&(t===void 0||XT(t))))return r[1]=function(i,s){if(KT(n)&&(s=HQ(n,this,$Q(i),s)),!XT(s))return s},_H(Ia,null,r)},YQ=function(t,e,r){var n=qT(r,e-1),i=qT(r,e+1);return sg(ZT,t)&&!sg(JT,i)||sg(JT,t)&&!sg(ZT,n)?"\\u"+VQ(BQ(t,0),16):t};Ia&&NQ({target:"JSON",stat:!0,arity:3,forced:QT||e_},{stringify:function(e,r,n){var i=MH(arguments),s=_H(QT?GQ:Ia,null,i);return e_&&typeof s=="string"?WQ(s,UQ,YQ):s}});function zd(t){let e;return Array.isArray(t)?e=t.length?new Array(t.length).fill(null):[]:(e={},dt(t,(r,n)=>{n!=="__children"&&(r&&typeof r=="object"&&!Array.isArray(r)?e[n]=zd(r):Array.isArray(r)?r.length&&typeof r[0]=="object"&&!Array.isArray(r[0])?e[n]=[zd(r[0])]:e[n]=[]:e[n]=null)})),e}function za(t,e){return e.prototype.constructor=e,t.prototype=new e,t.prototype.constructor=t,t}function Ar(t,e,r){const n=Array.isArray(r);return dt(e,(i,s)=>{(n===!1||r.includes(s))&&(t[s]=i)}),t}function Ap(t,e){dt(e,(r,n)=>{e[n]&&typeof e[n]=="object"?(t[n]||(Array.isArray(e[n])?t[n]=[]:Object.prototype.toString.call(e[n])==="[object Date]"?t[n]=e[n]:t[n]={}),Ap(t[n],e[n])):t[n]=e[n]})}function Hn(t){return typeof t=="object"?JSON.parse(JSON.stringify(t)):t}function Jn(t){const e={};return dt(t,(r,n)=>{e[n]=r}),e}function Vt(t){t.MIXINS||(t.MIXINS=[]);for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return j(r,i=>{t.MIXINS.push(i.MIXIN_NAME),dt(i,(s,o)=>{if(t.prototype[o]!==void 0)throw new Error(`Mixin conflict. Property '${o}' already exist and cannot be overwritten.`);if(typeof s=="function")t.prototype[o]=s;else{const a=function(u,h){const d=`_${u}`,f=g=>{let m=g;return(Array.isArray(m)||at(m))&&(m=Hn(m)),m};return function(){return this[d]===void 0&&(this[d]=f(h)),this[d]}},l=function(u){const h=`_${u}`;return function(d){this[h]=d}};Object.defineProperty(t.prototype,o,{get:a(o,s),set:l(o),configurable:!0})}})}),t}function Wy(t,e){return JSON.stringify(t)===JSON.stringify(e)}function at(t){return Object.prototype.toString.call(t)==="[object Object]"}function zo(t,e,r,n){n.value=r,n.writable=n.writable!==!1,n.enumerable=n.enumerable!==!1,n.configurable=n.configurable!==!1,Object.defineProperty(t,e,n)}function dt(t,e){for(const r in t)if((!t.hasOwnProperty||t.hasOwnProperty&&Object.prototype.hasOwnProperty.call(t,r))&&e(t[r],r,t)===!1)break;return t}function zQ(t,e){const r=e.split(".");let n=t;return dt(r,i=>{if(n=n[i],n===void 0)return n=void 0,!1}),n}function zw(t,e,r){const n=e.split(".");let i=t;n.forEach((s,o)=>{o!==n.length-1?(lr(i,s)||(i[s]={}),i=i[s]):i[s]=r})}function Vy(t){if(!at(t))return 0;const e=function(r){let n=0;return at(r)?dt(r,(i,s)=>{s!=="__children"&&(n+=e(i))}):n+=1,n};return e(t)}function zs(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"value";const r=`_${e}`,n={_touched:!1,[r]:t,isTouched(){return this._touched}};return Object.defineProperty(n,e,{get(){return this[r]},set(i){this._touched=!0,this[r]=i},enumerable:!0,configurable:!0}),n}function lr(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Uy(t){return window.requestAnimationFrame(t)}function Sm(t){window.cancelAnimationFrame(t)}function OH(){return"ontouchstart"in window}function jQ(){return typeof window!="undefined"}let wc;function KQ(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return wc||(typeof Intl=="object"?wc=new Intl.Collator(t,e).compare:typeof String.prototype.localeCompare=="function"?wc=(r,n)=>`${r}`.localeCompare(n):wc=(r,n)=>r===n?0:r>n?-1:1,wc)}const _i=t=>{const e={value:!1};return e.test=(r,n)=>{e.value=t(r,n)},e},ja={chrome:_i((t,e)=>/Chrome/.test(t)&&/Google/.test(e)),chromeWebKit:_i(t=>/CriOS/.test(t)),edge:_i(t=>/Edge/.test(t)),edgeWebKit:_i(t=>/EdgiOS/.test(t)),firefox:_i(t=>/Firefox/.test(t)),firefoxWebKit:_i(t=>/FxiOS/.test(t)),mobile:_i(t=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t)),safari:_i((t,e)=>/Safari/.test(t)&&/Apple Computer/.test(e))},vf={mac:_i(t=>/^Mac/.test(t)),win:_i(t=>/^Win/.test(t)),linux:_i(t=>/^Linux/.test(t)),ios:_i(t=>/iPhone|iPad|iPod/i.test(t))};function XQ(){let{userAgent:t=navigator.userAgent,vendor:e=navigator.vendor}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dt(ja,r=>{let{test:n}=r;return void n(t,e)})}function qQ(){let{platform:t=navigator.platform}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dt(vf,e=>{let{test:r}=e;return void r(t)})}jQ()&&(XQ(),qQ());function IH(){return ja.chrome.value}function ZQ(){return ja.chromeWebKit.value}function jw(){return ja.firefox.value}function JQ(){return ja.firefoxWebKit.value}function PH(){return ja.safari.value}function QQ(){return ja.edge.value}function Ea(){return ja.mobile.value}function DH(){return vf.ios.value}function kH(){let{maxTouchPoints:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:navigator;return t>2&&vf.mac.value}function t_(){return vf.win.value}function O1(){return vf.mac.value}const Ke={ALT:18,ARROW_DOWN:40,ARROW_LEFT:37,ARROW_RIGHT:39,ARROW_UP:38,AUDIO_DOWN:jw()?182:174,AUDIO_MUTE:jw()?181:173,AUDIO_UP:jw()?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},eee=[Ke.ALT,Ke.ARROW_DOWN,Ke.ARROW_LEFT,Ke.ARROW_RIGHT,Ke.ARROW_UP,Ke.AUDIO_DOWN,Ke.AUDIO_MUTE,Ke.AUDIO_UP,Ke.BACKSPACE,Ke.CAPS_LOCK,Ke.DELETE,Ke.END,Ke.ENTER,Ke.ESCAPE,Ke.F1,Ke.F2,Ke.F3,Ke.F4,Ke.F5,Ke.F6,Ke.F7,Ke.F8,Ke.F9,Ke.F10,Ke.F11,Ke.F12,Ke.F13,Ke.F14,Ke.F15,Ke.F16,Ke.F17,Ke.F18,Ke.F19,Ke.HOME,Ke.INSERT,Ke.MEDIA_NEXT,Ke.MEDIA_PLAY_PAUSE,Ke.MEDIA_PREV,Ke.MEDIA_STOP,Ke.NULL,Ke.NUM_LOCK,Ke.PAGE_DOWN,Ke.PAGE_UP,Ke.PAUSE,Ke.SCROLL_LOCK,Ke.SHIFT,Ke.TAB];function tee(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 NH(t){return eee.includes(t)}function ree(t){return[Ke.CONTROL,Ke.COMMAND_LEFT,Ke.COMMAND_RIGHT,Ke.COMMAND_FIREFOX].includes(t)}function Cf(t,e){const r=e.split("|");let n=!1;return j(r,i=>{if(t===Ke[i])return n=!0,!1}),n}function vs(t){t.isImmediatePropagationEnabled=!1,t.cancelBubble=!0}function Il(t){return t.isImmediatePropagationEnabled===!1}function Xl(t){return t.button===2}function Gy(t){return t.button===0}function nee(t,e){const r={x:t.offsetX,y:t.offsetY};let n=t.target;if(!(e instanceof HTMLElement)||n!==e&&n.contains(e))return r;for(;n!==e;)r.x+=n.offsetLeft,r.y+=n.offsetTop,n=n.offsetParent;return r}function Ft(){He(console)&&console.warn(...arguments)}function Yy(){He(console)&&console.error(...arguments)}function iee(t,e,r){return e=see(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function see(t){var e=oee(t,"string");return typeof e=="symbol"?e:String(e)}function oee(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const vc=["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"],aee=Pt`The plugin hook "[hookName]" was removed in Handsontable [removedInVersion].\x20
  71. Please consult release notes https://github.com/handsontable/handsontable/releases/tag/[removedInVersion] to\x20
  72. learn about the migration path.`,Kw=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"]]),Xw=new Map([[]]);class HH{static getSingleton(){return cee()}constructor(){iee(this,"globalBucket",void 0),this.globalBucket=this.createEmptyBucket()}createEmptyBucket(){const e=Object.create(null);return j(vc,r=>e[r]=[]),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,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(Array.isArray(r))j(r,i=>this.add(e,i,n));else{Kw.has(e)&&Ft(lH(aee,{hookName:e,removedInVersion:Kw.get(e)})),Xw.has(e)&&Ft(Xw.get(e));const i=this.getBucket(n);if(typeof i[e]=="undefined"&&(this.register(e),i[e]=[]),r.skip=!1,i[e].indexOf(r)===-1){let s=!1;r.initialHook&&j(i[e],(o,a)=>{if(o.initialHook)return i[e][a]=r,s=!0,!1}),s||i[e].push(r)}}return this}once(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;Array.isArray(r)?j(r,i=>this.once(e,i,n)):(r.runOnce=!0,this.add(e,r,n))}remove(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;const i=this.getBucket(n);return typeof i[e]!="undefined"&&i[e].indexOf(r)>=0?(r.skip=!0,!0):!1}has(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const n=this.getBucket(r);return!!(n[e]!==void 0&&n[e].length)}run(e,r,n,i,s,o,a,l){{const c=this.globalBucket[r],u=c?c.length:0;let h=0;if(u)for(;h<u;){if(!c[h]||c[h].skip){h+=1;continue}const d=M1(c[h],e,n,i,s,o,a,l);d!==void 0&&(n=d),c[h]&&c[h].runOnce&&this.remove(r,c[h]),h+=1}}{const c=this.getBucket(e)[r],u=c?c.length:0;let h=0;if(u)for(;h<u;){if(!c[h]||c[h].skip){h+=1;continue}const d=M1(c[h],e,n,i,s,o,a,l);d!==void 0&&(n=d),c[h]&&c[h].runOnce&&this.remove(r,c[h],e),h+=1}}return n}destroy(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;dt(this.getBucket(e),(r,n,i)=>i[n].length=0)}register(e){this.isRegistered(e)||vc.push(e)}deregister(e){this.isRegistered(e)&&vc.splice(vc.indexOf(e),1)}isDeprecated(e){return Xw.has(e)||Kw.has(e)}isRegistered(e){return vc.indexOf(e)>=0}getRegistered(){return vc}}const lee=new HH;function cee(){return lee}const $e=HH,qw=new Map;function Cs(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"common";qw.has(t)||qw.set(t,new Map);const e=qw.get(t);function r(a,l){e.set(a,l)}function n(a){return e.get(a)}function i(a){return e.has(a)}function s(){return[...e.keys()]}function o(){return[...e.values()]}return{register:r,getItem:n,hasItem:i,getNames:s,getValues:o}}const I1=new WeakMap,{register:uee,getItem:FH,hasItem:LH,getNames:vxe,getValues:Cxe}=Cs("editors");function hee(t){const e={},r=t;this.getConstructor=function(){return t},this.getInstance=function(n){return n.guid in e||(e[n.guid]=new r(n)),e[n.guid]},$e.getSingleton().add("afterDestroy",function(){e[this.guid]=null})}function $H(t,e){let r;if(typeof t=="function")I1.get(t)||ri(null,t),r=I1.get(t);else if(typeof t=="string")r=FH(t);else throw Error('Only strings and functions can be passed as "editor" parameter');if(!r)throw Error(`No editor registered under name "${t}"`);return r.getInstance(e)}function r_(t){if(typeof t=="function")return t;if(!LH(t))throw Error(`No registered editor found under "${t}" name`);return FH(t).getConstructor()}function ri(t,e){t&&typeof t!="string"&&(e=t,t=e.EDITOR_TYPE);const r=new hee(e);typeof t=="string"&&uee(t,r),I1.set(e,r)}function dee(t,e,r){return e=fee(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fee(t){var e=gee(t,"string");return typeof e=="symbol"?e:String(e)}function gee(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class mee{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;dee(this,"context",void 0),this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])}addEventListener(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;function s(o){n.call(this,pee(o))}return this.context.eventListeners.push({element:e,event:r,callback:n,callbackProxy:s,options:i,eventManager:this}),e.addEventListener(r,s,i),()=>{this.removeEventListener(e,r,n)}}removeEventListener(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s=this.context.eventListeners.length,o;for(;s;)if(s-=1,o=this.context.eventListeners[s],o.event===r&&o.element===e){if(n&&n!==o.callback||i&&o.eventManager!==this)continue;this.context.eventListeners.splice(s,1),o.element.removeEventListener(o.event,o.callbackProxy,o.options)}}clearEvents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.context)return;let r=this.context.eventListeners.length;for(;r;){r-=1;const n=this.context.eventListeners[r];e&&n.eventManager!==this||(this.context.eventListeners.splice(r,1),n.element.removeEventListener(n.event,n.callbackProxy,n.options))}}clear(){this.clearEvents()}destroy(){this.clearEvents(),this.context=null}destroyWithOwnEventsOnly(){this.clearEvents(!0),this.context=null}fireEvent(e,r){let n=e.document,i=e;n||(n=e.ownerDocument?e.ownerDocument:e,i=n.defaultView);const s={bubbles:!0,cancelable:r!=="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 o;n.createEvent?(o=n.createEvent("MouseEvents"),o.initMouseEvent(r,s.bubbles,s.cancelable,s.view,s.detail,s.screenX,s.screenY,s.clientX,s.clientY,s.ctrlKey,s.altKey,s.shiftKey,s.metaKey,s.button,n.body.parentNode)):o=n.createEventObject(),e.dispatchEvent?e.dispatchEvent(o):e.fireEvent(`on${r}`,o)}}function pee(t){const e=t.stopImmediatePropagation;return t.stopImmediatePropagation=function(){e.apply(this),vs(this)},t}const ms=mee;function n_(t,e){wee(t,e),e.add(t)}function wee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Zo(t,e,r){return e=vee(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vee(t){var e=Cee(t,"string");return typeof e=="symbol"?e:String(e)}function Cee(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function i_(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}const Mp="editorManager.navigation";var s_=new WeakSet,o_=new WeakSet;class P1{constructor(e,r,n){n_(this,o_),n_(this,s_),Zo(this,"hot",void 0),Zo(this,"tableMeta",void 0),Zo(this,"selection",void 0),Zo(this,"eventManager",void 0),Zo(this,"destroyed",!1),Zo(this,"lock",!1),Zo(this,"activeEditor",void 0),Zo(this,"cellProperties",void 0),this.hot=e,this.tableMeta=r,this.selection=n,this.eventManager=new ms(e),this.hot.addHook("afterDocumentKeyDown",i=>i_(this,s_,See).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,s,o)=>i_(this,o_,yee).call(this,i,s,o))}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,c=>{c&&this.prepareEditor()});return}const r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;if(!r||r.isHeader())return;const{row:n,col:i}=r,s=this.hot.runHooks("modifyGetCellCoords",n,i);let o=n,a=i;if(Array.isArray(s)&&([o,a]=s),this.cellProperties=this.hot.getCellMeta(o,a),!this.isCellEditable()){this.clearActiveEditor();return}const l=this.hot.getCell(n,i,!0);if(l){const c=this.hot.getCellEditor(this.cellProperties),u=this.hot.colToProp(a),h=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(o),a);this.activeEditor=$H(c,this.hot),this.activeEditor.prepare(n,i,u,l,h,this.cellProperties)}}isEditorOpened(){return this.activeEditor&&this.activeEditor.isOpened()}openEditor(e,r){let n=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&&(n&&this.activeEditor.enableFullEditMode(),this.activeEditor.beginEditing(e,r))}closeEditor(e,r,n){this.activeEditor?this.activeEditor.finishEditing(e,r,n):n&&n(!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 r=this.hot.getCellEditor(this.cellProperties),{row:n,col:i}=e.highlight,{rowIndexMapper:s,columnIndexMapper:o}=this.hot,a=s.isHidden(this.hot.toPhysicalRow(n))||o.isHidden(this.hot.toPhysicalColumn(i));return!(this.cellProperties.readOnly||!r||a)}moveSelectionAfterEnter(e){const r=typeof this.tableMeta.enterMoves=="function"?this.tableMeta.enterMoves(event):this.tableMeta.enterMoves;e?this.selection.transformStart(-r.row,-r.col):this.selection.transformStart(r.row,r.col,!0)}destroy(){this.destroyed=!0,this.eventManager.destroy()}}function See(t){const e=this.hot.getSelectedRangeLast();if(!this.hot.isListening()||!e||e.highlight.isHeader()||Il(t))return;const{keyCode:r}=t,n=(t.ctrlKey||t.metaKey)&&!t.altKey;if((!this.activeEditor||this.activeEditor&&!this.activeEditor.isWaiting())&&!NH(r)&&!ree(r)&&!n&&!this.isEditorOpened()){const s=this.hot.getShortcutManager().getContext("editor"),o={runOnlyIf:()=>He(this.hot.getSelected()),group:Mp};s.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())}}],o),this.openEditor("",t)}}function yee(t,e,r){r.nodeName==="TD"&&this.openEditor(null,t,!0)}const a_=new WeakMap;P1.getInstance=function(t,e,r){let n=a_.get(t);return n||(n=new P1(t,e,r),a_.set(t,n)),n};const xee=P1;function og(t,e){BH(t,e),e.add(t)}function sh(t,e,r){BH(t,e),e.set(t,r)}function BH(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function mu(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function ir(t,e){var r=WH(t,e,"get");return bee(t,r)}function bee(t,e){return e.get?e.get.call(t):e.value}function oh(t,e,r){var n=WH(t,e,"set");return Eee(t,n,r),r}function WH(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function Eee(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}const Ra=Object.freeze({CELL:"cell",MIXED:"mixed"});var jr=new WeakMap,ag=new WeakMap,lg=new WeakMap,cg=new WeakMap,ug=new WeakMap,ym=new WeakSet,l_=new WeakSet,c_=new WeakSet,u_=new WeakSet;class Ree{constructor(e){var r=this;og(this,u_),og(this,c_),og(this,l_),og(this,ym),sh(this,jr,{writable:!0,value:void 0}),sh(this,ag,{writable:!0,value:void 0}),sh(this,lg,{writable:!0,value:50}),sh(this,cg,{writable:!0,value:null}),sh(this,ug,{writable:!0,value:new Map});const n=e.getSettings();oh(this,jr,e),oh(this,ag,n.imeFastEdit?Ra.MIXED:Ra.CELL),ir(this,jr).addHook("afterUpdateSettings",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return mu(r,u_,Aee).call(r,...s)}),ir(this,jr).addHook("afterSelection",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return mu(r,l_,Tee).call(r,...s)}),ir(this,jr).addHook("afterSelectionEnd",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return mu(r,c_,_ee).call(r,...s)})}getFocusMode(){return ir(this,ag)}setFocusMode(e){Object.values(Ra).includes(e)?oh(this,ag,e):Ft(`"${e}" is not a valid focus mode.`)}getRefocusDelay(){return ir(this,lg)}setRefocusDelay(e){oh(this,lg,e)}setRefocusElementGetter(e){oh(this,cg,e)}getRefocusElement(){if(typeof ir(this,cg)=="function")return ir(this,cg).call(this);var e;return(e=ir(this,jr).getActiveEditor())===null||e===void 0?void 0:e.TEXTAREA}focusOnHighlightedCell(e){const r=n=>{var i,s;const o=(i=ir(this,jr).getSelectedRangeLast())===null||i===void 0?void 0:i.highlight;if(!o)return;let a=ir(this,jr).runHooks("modifyFocusedElement",o.row,o.col,n);a instanceof HTMLElement||(a=n),a&&!((s=ir(this,jr).getActiveEditor())!==null&&s!==void 0&&s.isOpened())&&a.focus({preventScroll:!0})};e?r(e):mu(this,ym,zy).call(this,n=>r(n))}refocusToEditorTextarea(){var e;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ir(this,lg);const n=this.getRefocusElement();ir(this,jr).getSettings().imeFastEdit&&!((e=ir(this,jr).getActiveEditor())!==null&&e!==void 0&&e.isOpened())&&!!n&&(ir(this,ug).has(r)||ir(this,ug).set(r,By(()=>{n.select()},r)),ir(this,ug).get(r)())}}function zy(t){var e;const r=(e=ir(this,jr).getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;if(!r||!ir(this,jr).selection.isCellVisible(r)){t(null);return}const n=ir(this,jr).getCell(r.row,r.col,!0);n===null?ir(this,jr).addHookOnce("afterScroll",()=>{t(ir(this,jr).getCell(r.row,r.col,!0))}):t(n)}function Tee(){mu(this,ym,zy).call(this,t=>{const{activeElement:e}=ir(this,jr).rootDocument;e&&yH(e)&&e.blur(),this.focusOnHighlightedCell(t)})}function _ee(){mu(this,ym,zy).call(this,t=>{this.getFocusMode()===Ra.MIXED&&t.nodeName==="TD"&&this.refocusToEditorTextarea()})}function Aee(t){t.imeFastEdit&&this.getFocusMode()!==Ra.MIXED?this.setFocusMode(Ra.MIXED):!t.imeFastEdit&&this.getFocusMode()!==Ra.CELL&&this.setFocusMode(Ra.CELL)}const VH={"&nbsp;":" ","&amp;":"&","&lt;":"<","&gt;":">"},Mee=new RegExp(Object.keys(VH).map(t=>`(${t})`).join("|"),"gi");function Oee(t){return(t&&t.nodeName||"")==="TABLE"}function h_(t){const e=t.hasColHeaders(),r=t.hasRowHeaders(),n=[e?-1:0,r?-1:0,t.countRows()-1,t.countCols()-1],i=t.getData(...n),s=i.length,o=s>0?i[0].length:0,a=["<table>","</table>"],l=e?["<thead>","</thead>"]:[],c=["<tbody>","</tbody>"],u=r?1:0,h=e?1:0;for(let d=0;d<s;d+=1){const f=e&&d===0,g=[];for(let w=0;w<o;w+=1){const C=!f&&r&&w===0;let S="";if(f)S=`<th>${t.getColHeader(w-u)}</th>`;else if(C)S=`<th>${t.getRowHeader(d-h)}</th>`;else{const v=i[d][w],{hidden:T,rowspan:A,colspan:M}=t.getCellMeta(d-h,w-u);if(!T){const E=[];if(A&&E.push(`rowspan="${A}"`),M&&E.push(`colspan="${M}"`),kr(v))S=`<td ${E.join(" ")}></td>`;else{const Y=v.toString().replace("<","&lt;").replace(">","&gt;").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
  73. `).replace(/\x20/gi,"&nbsp;").replace(/\t/gi,"&#9;");S=`<td ${E.join(" ")}>${Y}</td>`}}}g.push(S)}const m=["<tr>",...g,"</tr>"].join("");f?l.splice(1,0,m):c.splice(-1,0,m)}return a.splice(1,0,l.join(""),c.join("")),a.join("")}function d_(t){const e=t.length,r=["<table>"];for(let n=0;n<e;n+=1){const i=t[n],s=i.length,o=[];n===0&&r.push("<tbody>");for(let a=0;a<s;a+=1){const l=i[a],c=kr(l)?"":l.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
  74. `).replace(/\x20{2,}/gi,u=>`<span style="mso-spacerun: yes">${"&nbsp;".repeat(u.length-1)} </span>`).replace(/\t/gi,"&#9;");o.push(`<td>${c}</td>`)}r.push("<tr>",...o,"</tr>"),n+1===e&&r.push("</tbody>")}return r.push("</table>"),r.join("")}function Iee(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;const r={},n=e.createDocumentFragment(),i=e.createElement("div");n.appendChild(i);let s=t;if(typeof s=="string"){const v=s.replace(/<td\b[^>]*?>([\s\S]*?)<\/\s*td>/g,T=>{const A=T.match(/<td\b[^>]*?>/g)[0],M=T.substring(A.length,T.lastIndexOf("<")).replace(/(<(?!br)([^>]+)>)/gi,"");return`${A}${M}</td>`});i.insertAdjacentHTML("afterbegin",`${v}`),s=i.querySelector("table")}if(!s||!Oee(s))return;const o=i.querySelector('meta[name$="enerator"]'),a=s.querySelector("tbody th")!==null,l=s.querySelector("tr"),c=l?Array.from(l.cells).reduce((v,T)=>v+T.colSpan,0)-(a?1:0):0,u=s.tFoot&&Array.from(s.tFoot.rows)||[],h=[];let d=!1,f=0,g=0;if(s.tHead){const v=Array.from(s.tHead.rows).filter(T=>{const A=T.querySelector("td")!==null;return A&&h.push(T),!A});f=v.length,d=f>0,f>1?r.nestedHeaders=Array.from(v).reduce((T,A)=>{const M=Array.from(A.cells).reduce((E,Y,D)=>{if(a&&D===0)return E;const{colSpan:U,innerHTML:X}=Y,G=U>1?{label:X,colspan:U}:X;return E.push(G),E},[]);return T.push(M),T},[]):d&&(r.colHeaders=Array.from(v[0].children).reduce((T,A,M)=>(a&&M===0||T.push(A.innerHTML),T),[]))}h.length&&(r.fixedRowsTop=h.length),u.length&&(r.fixedRowsBottom=u.length);const m=[...h,...Array.from(s.tBodies).reduce((v,T)=>(v.push(...Array.from(T.rows)),v),[]),...u];g=m.length;const w=new Array(g);for(let v=0;v<g;v++)w[v]=new Array(c);const C=[],S=[];for(let v=0;v<g;v++){const T=m[v],A=Array.from(T.cells),M=A.length;for(let E=0;E<M;E++){const Y=A[E],{nodeName:D,innerHTML:U,rowSpan:X,colSpan:G}=Y,ae=w[v].findIndex(ve=>ve===void 0);if(D==="TD"){if(X>1||G>1){for(let Ce=v;Ce<v+X;Ce++)if(Ce<g)for(let _e=ae;_e<ae+G;_e++)w[Ce][_e]=null;const me=Y.getAttribute("style");me&&me.includes("mso-ignore:colspan")||C.push({col:ae,row:v,rowspan:X,colspan:G})}let ve="";o&&/excel/gi.test(o.content)?ve=U.replace(/[\r\n][\x20]{0,2}/g," ").replace(/<br(\s*|\/)>[\r\n]?[\x20]{0,3}/gim,`\r
  75. `):ve=U.replace(/<br(\s*|\/)>[\r\n]?/gim,`\r
  76. `),w[v][ae]=ve.replace(Mee,me=>VH[me])}else S.push(U)}}return C.length&&(r.mergeCells=C),S.length&&(r.rowHeaders=S),w.length&&(r.data=w),r}function Zn(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=typeof t;if(r==="number")return!isNaN(t)&&isFinite(t);if(r==="string"){if(t.length===0)return!1;if(t.length===1)return/\d/.test(t);const n=Array.from(new Set([".",...e])).map(i=>`\\${i}`).join("|");return new RegExp(`^[+-]?\\s*(((${n})?\\d+((${n})\\d+)?(e[+-]?\\d+)?)|(0x[a-f\\d]+))$`,"i").test(t.trim())}else if(r==="object")return!!t&&typeof t.valueOf()=="number"&&!(t instanceof Date);return!1}function Pee(t){return Zn(t,[","])}function Ue(t,e,r){let n=-1;for(typeof e=="function"?(r=e,e=t):n=t-1;++n<=e&&r(n)!==!1;);}function D1(t,e,r){let n=t+1;for(typeof e=="function"&&(r=e,e=0);--n>=e&&r(n)!==!1;);}function UH(t,e){return e=parseInt(e.toString().replace("%",""),10),e=isNaN(e)?0:e,parseInt(t*e/100,10)}function ui(t,e,r){return Math.min(t,e)===t?e:Math.max(t,r)===t?r:t}const k1="asc",Dee="desc",f_=new Map([[k1,[-1,1]],[Dee,[1,-1]]]),kee=t=>`The priority '${t}' is already declared in a map.`,Nee=t=>`The priority '${t}' is not a number.`;function Hee(){let{errorPriorityExists:t,errorPriorityNaN:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const r=new Map;t=Ut(t)?t:kee,e=Ut(e)?e:Nee;function n(s,o){if(!Zn(s))throw new Error(e(s));if(r.has(s))throw new Error(t(s));r.set(s,o)}function i(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:k1;const[o,a]=f_.get(s)||f_.get(k1);return[...r].sort((l,c)=>l[0]<c[0]?o:a).map(l=>l[1])}return{addItem:n,getItems:i}}const Fee=t=>`The id '${t}' is already declared in a map.`;function Op(){let{errorIdExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Map;t=Ut(t)?t:Fee;function r(c,u){if(l(c))throw new Error(t(c));e.set(c,u)}function n(c){return e.delete(c)}function i(){e.clear()}function s(c){const[u]=a().find(h=>{let[d,f]=h;return c===f?d:!1})||[null];return u}function o(c){return e.get(c)}function a(){return[...e]}function l(c){return e.has(c)}return{addItem:r,clear:i,getId:s,getItem:o,getItems:a,hasItem:l,removeItem:n}}const Lee=t=>`'${t}' value is already declared in a unique set.`;function $ee(){let{errorItemExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Set;t=Ut(t)?t:Lee;function r(s){if(e.has(s))throw new Error(t(s));e.add(s)}function n(){return[...e]}function i(){e.clear()}return{addItem:r,clear:i,getItems:n}}const jy=t=>`There is already registered "${t}" plugin.`,Bee=t=>`There is already registered plugin on priority "${t}".`,Wee=t=>`The priority "${t}" is not a number.`,GH=Hee({errorPriorityExists:Bee,errorPriorityNaN:Wee}),YH=$ee({errorItemExists:jy}),N1=Op({errorIdExists:jy});function zH(){return[...GH.getItems(),...YH.getItems()]}function Ky(t){const e=gs(t);return N1.getItem(e)}function Vee(t){return!!Ky(t)}function Tt(t,e,r){[t,e,r]=Gee(t,e,r),Ky(t)===void 0&&Uee(t,e,r)}function Uee(t,e,r){const n=gs(t);if(N1.hasItem(n))throw new Error(jy(n));r===void 0?YH.addItem(n):GH.addItem(r,n),N1.addItem(n,e)}function Gee(t,e,r){return typeof t=="function"&&(e=t,t=e.PLUGIN_KEY,r=e.PLUGIN_PRIORITY),[t,e,r]}const{register:Yee,getItem:zee,hasItem:jH,getNames:Sxe,getValues:yxe}=Cs("renderers");function g_(t){if(typeof t=="function")return t;if(!jH(t))throw Error(`No registered renderer found under "${t}" name`);return zee(t)}function bi(t,e){typeof t!="string"&&(e=t,t=e.RENDERER_TYPE),Yee(t,e)}const{register:jee,getItem:Kee,hasItem:KH,getNames:xxe,getValues:bxe}=Cs("validators");function Xee(t){if(typeof t=="function")return t;if(!KH(t))throw Error(`No registered validator found under "${t}" name`);return Kee(t)}function au(t,e){typeof t!="string"&&(e=t,t=e.VALIDATOR_TYPE),jee(t,e)}function hg(t,e,r){return e=qee(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qee(t){var e=Zee(t,"string");return typeof e=="symbol"?e:String(e)}function Zee(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Jee{constructor(e){hg(this,"count",0),hg(this,"startColumn",0),hg(this,"endColumn",0),hg(this,"startPosition",0),this.count=e.totalColumns,this.endColumn=this.count-1}}function dg(t,e,r){return e=Qee(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qee(t){var e=ete(t,"string");return typeof e=="symbol"?e:String(e)}function ete(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class tte{constructor(e){dg(this,"count",0),dg(this,"startRow",0),dg(this,"endRow",0),dg(this,"startPosition",0),this.count=e.totalRows,this.endRow=this.count-1}}var XH={},rte=Gk,nte=cy,ite=Object.keys||function(e){return rte(e,nte)},ste=ps,ote=Fk,ate=Ua,lte=Ga,cte=ap,ute=ite;XH.f=ste&&!ote?Object.defineProperties:function(e,r){lte(e);for(var n=cte(r),i=ute(r),s=i.length,o=0,a;s>o;)ate.f(e,a=i[o++],n[a]);return e};var hte=Ga,dte=XH,m_=cy,fte=oy,gte=oN,mte=iy,pte=Bk,p_=">",w_="<",H1="prototype",F1="script",qH=pte("IE_PROTO"),Zw=function(){},ZH=function(t){return w_+F1+p_+t+w_+"/"+F1+p_},v_=function(t){t.write(ZH("")),t.close();var e=t.parentWindow.Object;return t=null,e},wte=function(){var t=mte("iframe"),e="java"+F1+":",r;return t.style.display="none",gte.appendChild(t),t.src=String(e),r=t.contentWindow.document,r.open(),r.write(ZH("document.F=Object")),r.close(),r.F},fg,P0=function(){try{fg=new ActiveXObject("htmlfile")}catch(e){}P0=typeof document!="undefined"?document.domain&&fg?v_(fg):wte():v_(fg);for(var t=m_.length;t--;)delete P0[H1][m_[t]];return P0()};fte[qH]=!0;var vte=Object.create||function(e,r){var n;return e!==null?(Zw[H1]=hte(e),n=new Zw,Zw[H1]=null,n[qH]=e):n=P0(),r===void 0?n:dte.f(n,r)},Cte=$u,Ste=vte,yte=Ua.f,L1=Cte("unscopables"),$1=Array.prototype;$1[L1]===void 0&&yte($1,L1,{configurable:!0,value:Ste(null)});var JH=function(t){$1[L1][t]=!0},xte=Ya,bte=hp,Ete=hf,Rte=ly,Tte=JH;xte({target:"Array",proto:!0},{at:function(e){var r=bte(this),n=Ete(r),i=Rte(e),s=i>=0?i:n+i;return s<0||s>=n?void 0:r[s]}});Tte("at");const da=1,an=2;function _te(t,e,r){Ate(t,e),e.set(t,r)}function Ate(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ah(t,e,r){return e=Mte(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Mte(t){var e=Ote(t,"string");return typeof e=="symbol"?e:String(e)}function Ote(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Cc(t,e){var r=QH(t,e,"get");return Ite(t,r)}function Ite(t,e){return e.get?e.get.call(t):e.value}function Pte(t,e,r){var n=QH(t,e,"set");return Dte(t,n,r),r}function QH(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function Dte(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}var Jo=new WeakMap;class Sf{static get DEFAULT_WIDTH(){return 50}constructor(e){ah(this,"count",0),ah(this,"startColumn",null),ah(this,"endColumn",null),ah(this,"startPosition",null),ah(this,"isVisibleInTrimmingContainer",!1),_te(this,Jo,{writable:!0,value:void 0}),Pte(this,Jo,e),this.calculate()}calculate(){const{calculationType:e,overrideFn:r,scrollOffset:n,totalColumns:i,viewportWidth:s}=Cc(this,Jo),o=Math.max(Cc(this,Jo).scrollOffset,0),a=o>0?s+1:s;let l=0,c=!0;const u=[];let h,d=0,f=0;for(let C=0;C<i;C++)if(h=this._getColumnWidth(C),l<=o&&e!==an&&(this.startColumn=C,d=h),l>=o&&l+(e===an?h:0)<=o+a&&((this.startColumn===null||this.startColumn===void 0)&&(this.startColumn=C,d=h),this.endColumn=C),u.push(l),l+=h,f=h,e!==an&&(this.endColumn=C),l>=o+s){c=!1;break}const g=n+s-a,m=e===an?0:f,w=e===an?d:0;if(g<-1*Cc(this,Jo).inlineStartOffset||n>u.at(-1)+m||-1*Cc(this,Jo).scrollOffset-Cc(this,Jo).viewportWidth>-1*w?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,this.endColumn===i-1&&c)for(this.startColumn=this.endColumn;this.startColumn>0;){const C=u[this.endColumn]+h-u[this.startColumn-1];if((C<=s||e!==an)&&(this.startColumn-=1),C>s)break}e===da&&this.startColumn!==null&&r&&r(this),this.startPosition=u[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 r=Cc(this,Jo).columnWidthFn(e);return isNaN(r)&&(r=Sf.DEFAULT_WIDTH),r}}function kte(t,e,r){Nte(t,e),e.set(t,r)}function Nte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function lh(t,e,r){return e=Hte(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Hte(t){var e=Fte(t,"string");return typeof e=="symbol"?e:String(e)}function Fte(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Jw(t,e){var r=eF(t,e,"get");return Lte(t,r)}function Lte(t,e){return e.get?e.get.call(t):e.value}function $te(t,e,r){var n=eF(t,e,"set");return Bte(t,n,r),r}function eF(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function Bte(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}var ch=new WeakMap;class Ip{static get DEFAULT_HEIGHT(){return 23}constructor(e){lh(this,"count",0),lh(this,"startRow",null),lh(this,"endRow",null),lh(this,"startPosition",null),lh(this,"isVisibleInTrimmingContainer",!1),kte(this,ch,{writable:!0,value:void 0}),$te(this,ch,e),this.calculate()}calculate(){const{calculationType:e,overrideFn:r,rowHeightFn:n,scrollOffset:i,totalRows:s,viewportHeight:o}=Jw(this,ch),a=Math.max(Jw(this,ch).scrollOffset,0),l=Jw(this,ch).horizontalScrollbarHeight||0;let c=0,u=!0;const h=[];let d,f=0,g=0;for(let S=0;S<s;S++)if(d=n(S),isNaN(d)&&(d=Ip.DEFAULT_HEIGHT),c<=a&&e!==an&&(this.startRow=S,f=d),c>=a&&c+(e===an?d:0)<=a+o-l&&(this.startRow===null&&(this.startRow=S,f=d),this.endRow=S),h.push(c),c+=d,g=d,e!==an&&(this.endRow=S),c>=a+o-l){u=!1;break}const m=i+o-l,w=e===an?f:0,C=e===an?0:g;if(m<w||i>h.at(-1)+C?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,this.endRow===s-1&&u)for(this.startRow=this.endRow;this.startRow>0;){const S=h[this.endRow]+d-h[this.startRow-1];if((S<=o-l||e!==an)&&(this.startRow-=1),S>=o-l)break}e===da&&this.startRow!==null&&r&&r(this),this.startPosition=h[this.startRow],this.startPosition===void 0&&(this.startPosition=null),s<this.endRow&&(this.endRow=s-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}}function Wte(t,e,r){Vte(t,e),e.set(t,r)}function Vte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function C_(t,e,r){return e=Ute(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ute(t){var e=Gte(t,"string");return typeof e=="symbol"?e:String(e)}function Gte(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Sc(t,e){var r=tF(t,e,"get");return Yte(t,r)}function Yte(t,e){return e.get?e.get.call(t):e.value}function S_(t,e,r){var n=tF(t,e,"set");return zte(t,n,r),r}function tF(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function zte(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}var ao=new WeakMap;class xm{constructor(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;C_(this,"row",null),C_(this,"col",null),Wte(this,ao,{writable:!0,value:!1}),S_(this,ao,n),typeof e!="undefined"&&typeof r!="undefined"&&(this.row=e,this.col=r)}isValid(e){const{countRows:r,countCols:n,countRowHeaders:i,countColHeaders:s}=yt({countRows:0,countCols:0,countRowHeaders:0,countColHeaders:0},e);return!(!Number.isInteger(this.row)||!Number.isInteger(this.col)||this.row<-s||this.col<-i||this.row>=r||this.col>=n)}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 Sc(this,ao)}isSouthEastOf(e){return this.row>=e.row&&(Sc(this,ao)?this.col<=e.col:this.col>=e.col)}isNorthWestOf(e){return this.row<=e.row&&(Sc(this,ao)?this.col>=e.col:this.col<=e.col)}isSouthWestOf(e){return this.row>=e.row&&(Sc(this,ao)?this.col>=e.col:this.col<=e.col)}isNorthEastOf(e){return this.row<=e.row&&(Sc(this,ao)?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 xm&&S_(this,ao,e.isRtl()),this}clone(){return new xm(this.row,this.col,Sc(this,ao))}toObject(){return{row:this.row,col:this.col}}}const bm=xm;function jte(t,e,r){Kte(t,e),e.set(t,r)}function Kte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Qw(t,e,r){return e=Xte(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xte(t){var e=qte(t,"string");return typeof e=="symbol"?e:String(e)}function qte(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function vi(t,e){var r=rF(t,e,"get");return Zte(t,r)}function Zte(t,e){return e.get?e.get.call(t):e.value}function Jte(t,e,r){var n=rF(t,e,"set");return Qte(t,n,r),r}function rF(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function Qte(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}var $n=new WeakMap;class Xy{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;Qw(this,"highlight",null),Qw(this,"from",null),Qw(this,"to",null),jte(this,$n,{writable:!0,value:!1}),this.highlight=e.clone(),this.from=r.clone(),this.to=n.clone(),Jte(this,$n,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),r=Math.max(this.to.row,0);return Math.max(e,r)-Math.min(e,r)+1}getWidth(){if(this.from.col<0&&this.to.col<0)return 0;const e=Math.max(this.from.col,0),r=Math.max(this.to.col,0);return Math.max(e,r)-Math.min(e,r)+1}getCellsCount(){return this.getWidth()*this.getHeight()}includes(e){const{row:r,col:n}=e,i=this.getOuterTopStartCorner(),s=this.getOuterBottomEndCorner();return i.row<=r&&s.row>=r&&i.col<=n&&s.col>=n}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 r=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner();return e.row<r.row||e.col<r.col||e.row>n.row||e.col>n.col?(this.from=this._createCellCoords(Math.min(r.row,e.row),Math.min(r.col,e.col)),this.to=this._createCellCoords(Math.max(n.row,e.row),Math.max(n.col,e.col)),!0):!1}expandByRange(e){if(this.includesRange(e)||!this.overlaps(e))return!1;const r=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner(),i=this.getDirection(),s=e.getOuterTopStartCorner(),o=e.getOuterBottomEndCorner(),a=Math.min(r.row,s.row),l=Math.min(r.col,s.col),c=Math.max(n.row,o.row),u=Math.max(n.col,o.col),h=this._createCellCoords(a,l),d=this._createCellCoords(c,u);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 vi(this,$n)?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 vi(this,$n)?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 vi(this,$n)?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 vi(this,$n)?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 vi(this,$n)?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 vi(this,$n)?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 vi(this,$n)?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 vi(this,$n)?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 bm))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 r={top:Math.min(this.from.row,this.to.row),bottom:Math.max(this.from.row,this.to.row),left:Math.min(this.from.col,this.to.col),right:Math.max(this.from.col,this.to.col)},n={top:Math.min(e.from.row,e.to.row),bottom:Math.max(e.from.row,e.to.row),left:Math.min(e.from.col,e.to.col),right:Math.max(e.from.col,e.to.col)},i=[];return r.top===n.top&&i.push("top"),r.right===n.right&&i.push(vi(this,$n)?"left":"right"),r.bottom===n.bottom&&i.push("bottom"),r.left===n.left&&i.push(vi(this,$n)?"right":"left"),i}getInner(){const e=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner(),n=[];for(let i=e.row;i<=r.row;i++)for(let s=e.col;s<=r.col;s++)!(this.from.row===i&&this.from.col===s)&&!(this.to.row===i&&this.to.col===s)&&n.push(this._createCellCoords(i,s));return n}getAll(){const e=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner(),n=[];for(let i=e.row;i<=r.row;i++)for(let s=e.col;s<=r.col;s++)e.row===i&&e.col===s?n.push(e):r.row===i&&r.col===s?n.push(r):n.push(this._createCellCoords(i,s));return n}forAll(e){const r=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner();for(let i=r.row;i<=n.row;i++)for(let s=r.col;s<=n.col;s++)if(e(i,s)===!1)return}clone(){return new Xy(this.highlight,this.from,this.to,vi(this,$n))}toObject(){return{from:this.from.toObject(),to:this.to.toObject()}}_createCellCoords(e,r){return new bm(e,r,vi(this,$n))}}const qy=Xy;function xs(t,e,r){ere(t,e),e.set(t,r)}function ere(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ye(t,e){var r=nF(t,e,"get");return tre(t,r)}function tre(t,e){return e.get?e.get.call(t):e.value}function Qo(t,e,r){var n=nF(t,e,"set");return rre(t,n,r),r}function nF(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function rre(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}var Ci=new WeakMap,ev=new WeakMap,Nr=new WeakMap,yc=new WeakMap,gg=new WeakMap,Gi=new WeakMap,tv=new WeakMap,uh=new WeakMap,tl=new WeakMap,bs=new WeakMap;class nre{constructor(e,r,n,i,s,o){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null;xs(this,Ci,{writable:!0,value:void 0}),xs(this,ev,{writable:!0,value:void 0}),xs(this,Nr,{writable:!0,value:void 0}),xs(this,yc,{writable:!0,value:void 0}),xs(this,gg,{writable:!0,value:void 0}),xs(this,Gi,{writable:!0,value:void 0}),xs(this,tv,{writable:!0,value:void 0}),xs(this,uh,{writable:!0,value:void 0}),xs(this,tl,{writable:!0,value:[null,null]}),xs(this,bs,{writable:!0,value:[null,null]}),Qo(this,Ci,n),Qo(this,ev,r),Qo(this,Nr,s),Qo(this,yc,o),Qo(this,gg,a),Qo(this,Gi,i),Qo(this,tv,e),this.registerEvents()}registerEvents(){Ye(this,Gi).addEventListener(Ye(this,Nr).holder,"contextmenu",n=>this.onContextMenu(n)),Ye(this,Gi).addEventListener(Ye(this,Nr).TABLE,"mouseover",n=>this.onMouseOver(n)),Ye(this,Gi).addEventListener(Ye(this,Nr).TABLE,"mouseout",n=>this.onMouseOut(n));const e=()=>{Ye(this,Gi).addEventListener(Ye(this,Nr).holder,"touchstart",n=>this.onTouchStart(n)),Ye(this,Gi).addEventListener(Ye(this,Nr).holder,"touchend",n=>this.onTouchEnd(n)),this.momentumScrolling||(this.momentumScrolling={}),Ye(this,Gi).addEventListener(Ye(this,Nr).holder,"scroll",()=>{clearTimeout(this.momentumScrolling._timeout),this.momentumScrolling.ongoing||Ye(this,Ci).getSetting("onBeforeTouchScroll"),this.momentumScrolling.ongoing=!0,this.momentumScrolling._timeout=setTimeout(()=>{this.touchApplied||(this.momentumScrolling.ongoing=!1,Ye(this,Ci).getSetting("onAfterMomentumScroll"))},200)})},r=()=>{Ye(this,Gi).addEventListener(Ye(this,Nr).holder,"mouseup",n=>this.onMouseUp(n)),Ye(this,Gi).addEventListener(Ye(this,Nr).holder,"mousedown",n=>this.onMouseDown(n))};Ea()?e():(OH()&&e(),r())}selectedCellWasTouched(e){const n=this.parentCell(e).coords;if(Ye(this,uh)&&n){const[i,s]=[n.row,Ye(this,uh).from.row],[o,a]=[n.col,Ye(this,uh).from.col];return i===s&&o===a}return!1}parentCell(e){const r={},n=Ye(this,Nr).TABLE,i=ig(e,["TD","TH"],n);return i?(r.coords=Ye(this,Nr).getCoords(i),r.TD=i):Je(e,"wtBorder")&&Je(e,"current")?(r.coords=Ye(this,yc).getFocusSelection().cellRange.highlight,r.TD=Ye(this,Nr).getCell(r.coords)):Je(e,"wtBorder")&&Je(e,"area")&&Ye(this,yc).getAreaSelection().cellRange&&(r.coords=Ye(this,yc).getAreaSelection().cellRange.to,r.TD=Ye(this,Nr).getCell(r.coords)),r}onMouseDown(e){const r=Ye(this,ev).rootDocument.activeElement,n=RH(CQ,e.target),i=e.target;if(!["TD","TH"].includes(r.nodeName)&&(i===r||n(0)===r||n(1)===r))return;const s=this.parentCell(i);Je(i,"corner")?Ye(this,Ci).getSetting("onCellCornerMouseDown",e,i):s.TD&&Ye(this,Ci).has("onCellMouseDown")&&this.callListener("onCellMouseDown",e,s.coords,s.TD),(e.button===0||this.touchApplied)&&s.TD&&(Ye(this,bs)[0]=s.TD,clearTimeout(Ye(this,tl)[0]),Ye(this,tl)[0]=setTimeout(()=>{Ye(this,bs)[0]=null},1e3))}onContextMenu(e){if(Ye(this,Ci).has("onCellContextMenu")){const r=this.parentCell(e.target);r.TD&&this.callListener("onCellContextMenu",e,r.coords,r.TD)}}onMouseOver(e){if(!Ye(this,Ci).has("onCellMouseOver"))return;const r=Ye(this,Nr).TABLE,n=ig(e.target,["TD","TH"],r),i=Ye(this,gg)||this;n&&n!==i.lastMouseOver&&Vl(n,r)&&(i.lastMouseOver=n,this.callListener("onCellMouseOver",e,Ye(this,Nr).getCoords(n),n))}onMouseOut(e){if(!Ye(this,Ci).has("onCellMouseOut"))return;const r=Ye(this,Nr).TABLE,n=ig(e.target,["TD","TH"],r),i=ig(e.relatedTarget,["TD","TH"],r),s=Ye(this,gg)||this;n&&n!==i&&Vl(n,r)&&(this.callListener("onCellMouseOut",e,Ye(this,Nr).getCoords(n),n),i===null&&(s.lastMouseOver=null))}onMouseUp(e){const r=this.parentCell(e.target);r.TD&&Ye(this,Ci).has("onCellMouseUp")&&this.callListener("onCellMouseUp",e,r.coords,r.TD),!(e.button!==0&&!this.touchApplied)&&(r.TD===Ye(this,bs)[0]&&r.TD===Ye(this,bs)[1]?(Je(e.target,"corner")?this.callListener("onCellCornerDblClick",e,r.coords,r.TD):this.callListener("onCellDblClick",e,r.coords,r.TD),Ye(this,bs)[0]=null,Ye(this,bs)[1]=null):r.TD===Ye(this,bs)[0]&&(Ye(this,bs)[1]=r.TD,clearTimeout(Ye(this,tl)[1]),Ye(this,tl)[1]=setTimeout(()=>{Ye(this,bs)[1]=null},500)))}onTouchStart(e){Qo(this,uh,Ye(this,yc).getFocusSelection().cellRange),this.touchApplied=!0,this.onMouseDown(e)}onTouchEnd(e){var r;const n=e.target,i=(r=this.parentCell(n))===null||r===void 0?void 0:r.coords,s=He(i)&&i.row>=0&&i.col>=0;if(e.cancelable&&s&&Ye(this,Ci).getSetting("isDataViewInstance")){const a=["A","BUTTON","INPUT"];DH()&&(ZQ()||JQ())&&this.selectedCellWasTouched(n)&&!a.includes(n.tagName)?e.preventDefault():this.selectedCellWasTouched(n)||e.preventDefault()}this.onMouseUp(e),this.touchApplied=!1}callListener(e,r,n,i){const s=Ye(this,Ci).getSettingPure(e);s&&s(r,n,i,Ye(this,tv).call(this))}destroy(){clearTimeout(Ye(this,tl)[0]),clearTimeout(Ye(this,tl)[1]),Ye(this,Gi).destroy()}}const iF=nre;function rv(t,e,r){return e=ire(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ire(t){var e=sre(t,"string");return typeof e=="symbol"?e:String(e)}function sre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ore{constructor(e,r,n){rv(this,"offset",void 0),rv(this,"total",void 0),rv(this,"countTH",void 0),this.offset=e,this.total=r,this.countTH=n}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 are=ore;function nv(t,e,r){return e=lre(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lre(t){var e=cre(t,"string");return typeof e=="symbol"?e:String(e)}function cre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ure{constructor(e,r,n){nv(this,"offset",void 0),nv(this,"total",void 0),nv(this,"countTH",void 0),this.offset=e,this.total=r,this.countTH=n}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 hre=ure,dre=0,Em=1,Rm=2;function mg(t,e,r){return e=fre(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fre(t){var e=gre(t,"string");return typeof e=="symbol"?e:String(e)}function gre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class y_{constructor(){mg(this,"currentSize",0),mg(this,"nextSize",0),mg(this,"currentOffset",0),mg(this,"nextOffset",0)}setSize(e){this.currentSize=this.nextSize,this.nextSize=e}setOffset(e){this.currentOffset=this.nextOffset,this.nextOffset=e}}function iv(t,e,r){return e=mre(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mre(t){var e=pre(t,"string");return typeof e=="symbol"?e:String(e)}function pre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class wre{constructor(){iv(this,"size",new y_),iv(this,"workingSpace",dre),iv(this,"sharedSize",null)}setSize(e){this.size.setSize(e)}setOffset(e){this.size.setOffset(e)}getViewSize(){return this.size}isShared(){return this.sharedSize instanceof y_}isPlaceOn(e){return this.workingSpace===e}append(e){this.workingSpace=Em,e.workingSpace=Rm,this.sharedSize=e.getViewSize()}prepend(e){this.workingSpace=Rm,e.workingSpace=Em,this.sharedSize=e.getViewSize()}}function xc(t,e,r){return e=vre(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vre(t){var e=Cre(t,"string");return typeof e=="symbol"?e:String(e)}function Cre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class sF{constructor(e,r,n){xc(this,"rootNode",void 0),xc(this,"nodesPool",void 0),xc(this,"sizeSet",new wre),xc(this,"childNodeType",void 0),xc(this,"visualIndex",0),xc(this,"collectedNodes",[]),this.rootNode=e,this.nodesPool=r,this.childNodeType=n.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:r}=this;let n=0;if(this.isSharedViewSet()){let i=e.firstElementChild;for(;i;){if(i.tagName===this.childNodeType)n+=1;else if(r.isPlaceOn(Em))break;i=i.nextElementSibling}}else n=e.childElementCount;return n}start(){this.collectedNodes.length=0,this.visualIndex=0;const{rootNode:e,sizeSet:r}=this,n=this.isSharedViewSet(),{nextSize:i}=r.getViewSize();let s=this.getRenderedChildCount();for(;s<i;){const a=this.nodesPool();!n||n&&r.isPlaceOn(Rm)?e.appendChild(a):e.insertBefore(a,e.firstChild),s+=1}const o=n&&r.isPlaceOn(Em);for(;s>i;)e.removeChild(o?e.firstChild:e.lastChild),s-=1}render(){const{rootNode:e,sizeSet:r}=this;let n=this.visualIndex;this.isSharedViewSet()&&r.isPlaceOn(Rm)&&(n+=r.sharedSize.nextSize);let i=e.childNodes[n];if(i.tagName!==this.childNodeType){const s=this.nodesPool();e.replaceChild(s,i),i=s}this.collectedNodes.push(i),this.visualIndex+=1}end(){}}class oF extends sF{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 Sre(t,e,r){return e=yre(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yre(t){var e=xre(t,"string");return typeof e=="symbol"?e:String(e)}function xre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class bre{constructor(e){Sre(this,"nodeType",void 0),this.nodeType=e.toUpperCase()}setRootDocument(e){this.rootDocument=e}obtain(){return this.rootDocument.createElement(this.nodeType)}}function hh(t,e,r){return e=Ere(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ere(t){var e=Rre(t,"string");return typeof e=="symbol"?e:String(e)}function Rre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class yf{constructor(e,r){hh(this,"nodesPool",null),hh(this,"nodeType",void 0),hh(this,"rootNode",void 0),hh(this,"table",null),hh(this,"renderedNodes",0),this.nodesPool=typeof e=="string"?new bre(e):null,this.nodeType=e,this.rootNode=r}setTable(e){this.nodesPool&&this.nodesPool.setRootDocument(e.rootDocument),this.table=e}adjust(){}render(){}}function x_(t,e,r){return e=Tre(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Tre(t){var e=_re(t,"string");return typeof e=="symbol"?e:String(e)}function _re(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Are extends yf{constructor(){super("TH"),x_(this,"orderViews",new WeakMap),x_(this,"sourceRowIndex",0)}obtainOrderView(e){let r;return this.orderViews.has(e)?r=this.orderViews.get(e):(r=new oF(e,n=>this.nodesPool.obtain(this.sourceRowIndex,n),this.nodeType),this.orderViews.set(e,r)),r}render(){const{rowsToRender:e,rowHeaderFunctions:r,rowHeadersCount:n,rows:i,cells:s}=this.table;for(let o=0;o<e;o++){const a=this.table.renderedRowToSource(o),l=i.getRenderedNode(o);this.sourceRowIndex=a;const c=this.obtainOrderView(l),u=s.obtainOrderView(l);c.appendView(u).setSize(n).setOffset(this.table.renderedColumnToSource(0)).start();for(let h=0;h<n;h++){c.render();const d=c.getCurrentNode();d.className="",d.removeAttribute("style"),Uu(d,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&qe(d,[JJ(),oQ(),Ny(h+1),Vu(-1)]),r[h](a,d,h)}c.end()}}}class Mre extends yf{constructor(e){super(null,e)}adjust(){const{columnHeadersCount:e,rowHeadersCount:r}=this.table;let n=this.rootNode.firstChild;if(e){const{columnsToRender:i}=this.table,s=i+r;for(let a=0,l=e;a<l;a++){for(n=this.rootNode.childNodes[a],n||(n=this.table.rootDocument.createElement("tr"),this.rootNode.appendChild(n)),this.renderedNodes=n.childNodes.length;this.renderedNodes<s;)n.appendChild(this.table.rootDocument.createElement("th")),this.renderedNodes+=1;for(;this.renderedNodes>s;)n.removeChild(n.lastChild),this.renderedNodes-=1}const o=this.rootNode.childNodes.length;if(o>e)for(let a=e;a<o;a++)this.rootNode.removeChild(this.rootNode.lastChild)}else n&&Zs(n)}render(){const{columnHeadersCount:e}=this.table;this.table.isAriaEnabled()&&qe(this.rootNode,[cH()]);for(let r=0;r<e;r+=1){const{columnHeaderFunctions:n,columnsToRender:i,rowHeadersCount:s}=this.table,o=this.rootNode.childNodes[r];this.table.isAriaEnabled()&&qe(o,[A1(),fH(r+1)]);for(let a=-1*s;a<i;a+=1){const l=this.table.renderedColumnToSource(a),c=o.childNodes[a+s];c.className="",c.removeAttribute("style"),Uu(c,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&qe(c,[Ny(a+1+this.table.rowHeadersCount),Vu(-1),QJ(),...a>=0?[sQ()]:[A1()]]),n[r](l,c,r)}}}}let b_=!1;class Ore extends yf{constructor(e){super(null,e)}adjust(){const{columnsToRender:e,rowHeadersCount:r}=this.table,n=e+r;for(;this.renderedNodes<n;)this.rootNode.appendChild(this.table.rootDocument.createElement("col")),this.renderedNodes+=1;for(;this.renderedNodes>n;)this.rootNode.removeChild(this.rootNode.lastChild),this.renderedNodes-=1}render(){this.adjust();const{columnsToRender:e,rowHeadersCount:r}=this.table;!b_&&e>1e3&&(b_=!0,Ft(Pt`Performance tip: Handsontable rendered more than 1000 visible columns.\x20
  77. Consider limiting the number of rendered columns by specifying the table width and/or\x20
  78. turning off the "renderAllColumns" option.`));for(let i=0;i<r;i++){const s=this.table.renderedColumnToSource(i),o=this.table.columnUtils.getHeaderWidth(s);this.rootNode.childNodes[i].style.width=`${o}px`}for(let i=0;i<e;i++){const s=this.table.renderedColumnToSource(i),o=this.table.columnUtils.getStretchedColumnWidth(s);this.rootNode.childNodes[i+r].style.width=`${o}px`}const n=this.rootNode.firstChild;n&&be(n,"rowHeader")}}function Ire(t,e,r){return e=Pre(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Pre(t){var e=Dre(t,"string");return typeof e=="symbol"?e:String(e)}function Dre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}let E_=!1;class kre extends yf{constructor(e){super("TR",e),Ire(this,"orderView",void 0),this.orderView=new sF(e,r=>this.nodesPool.obtain(r),this.nodeType)}getRenderedNode(e){return this.orderView.getNode(e)}render(){const{rowsToRender:e}=this.table;!E_&&e>1e3&&(E_=!0,Ft(Pt`Performance tip: Handsontable rendered more than 1000 visible rows.\x20
  79. Consider limiting the number of rendered rows by specifying the table height and/or\x20
  80. turning off the "renderAllRows" option.`)),this.table.isAriaEnabled()&&qe(this.rootNode,[cH()]),this.orderView.setSize(e).setOffset(this.table.renderedRowToSource(0)).start();for(let i=0;i<e;i++){this.orderView.render();const s=this.orderView.getCurrentNode(),o=this.table.renderedRowToSource(i);if(this.table.isAriaEnabled()){var r,n;qe(s,[A1(),fH(o+((r=(n=this.table.rowUtils)===null||n===void 0||(n=n.dataAccessObject)===null||n===void 0?void 0:n.columnHeaders.length)!==null&&r!==void 0?r:0)+1)])}}this.orderView.end()}}function R_(t,e,r){return e=Nre(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nre(t){var e=Hre(t,"string");return typeof e=="symbol"?e:String(e)}function Hre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Fre extends yf{constructor(){super("TD"),R_(this,"orderViews",new WeakMap),R_(this,"sourceRowIndex",0)}obtainOrderView(e){let r;return this.orderViews.has(e)?r=this.orderViews.get(e):(r=new oF(e,n=>this.nodesPool.obtain(this.sourceRowIndex,n),this.nodeType),this.orderViews.set(e,r)),r}render(){const{rowsToRender:e,columnsToRender:r,rows:n,rowHeaders:i}=this.table;for(let a=0;a<e;a++){const l=this.table.renderedRowToSource(a),c=n.getRenderedNode(a);this.sourceRowIndex=l;const u=this.obtainOrderView(c),h=i.obtainOrderView(c);u.prependView(h).setSize(r).setOffset(this.table.renderedColumnToSource(0)).start();for(let d=0;d<r;d++){u.render();const f=u.getCurrentNode(),g=this.table.renderedColumnToSource(d);if(Je(f,"hide")||(f.className=""),f.removeAttribute("style"),f.removeAttribute("dir"),Uu(f,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.cellRenderer(l,g,f),this.table.isAriaEnabled()){var s,o;qe(f,[...f.hasAttribute("role")?[]:[ZJ()],Vu(-1),Ny(g+((s=(o=this.table.rowUtils)===null||o===void 0||(o=o.dataAccessObject)===null||o===void 0?void 0:o.rowHeaders.length)!==null&&s!==void 0?s:0)+1)])}}u.end()}}}function Hr(t,e,r){return e=Lre(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Lre(t){var e=$re(t,"string");return typeof e=="symbol"?e:String(e)}function $re(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Bre{constructor(e){let{cellRenderer:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Hr(this,"rootNode",void 0),Hr(this,"rootDocument",void 0),Hr(this,"rowHeaders",null),Hr(this,"columnHeaders",null),Hr(this,"colGroup",null),Hr(this,"rows",null),Hr(this,"cells",null),Hr(this,"rowFilter",null),Hr(this,"columnFilter",null),Hr(this,"rowUtils",null),Hr(this,"columnUtils",null),Hr(this,"rowsToRender",0),Hr(this,"columnsToRender",0),Hr(this,"rowHeaderFunctions",[]),Hr(this,"rowHeadersCount",0),Hr(this,"columnHeaderFunctions",[]),Hr(this,"columnHeadersCount",0),Hr(this,"cellRenderer",void 0),this.rootNode=e,this.rootDocument=this.rootNode.ownerDocument,this.cellRenderer=r}setAxisUtils(e,r){this.rowUtils=e,this.columnUtils=r}setViewportSize(e,r){this.rowsToRender=e,this.columnsToRender=r}setFilters(e,r){this.rowFilter=e,this.columnFilter=r}setHeaderContentRenderers(e,r){this.rowHeaderFunctions=e,this.rowHeadersCount=e.length,this.columnHeaderFunctions=r,this.columnHeadersCount=r.length}setRenderers(){let{rowHeaders:e,columnHeaders:r,colGroup:n,rows:i,cells:s}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.setTable(this),r.setTable(this),n.setTable(this),i.setTable(this),s.setTable(this),this.rowHeaders=e,this.columnHeaders=r,this.colGroup=n,this.rows=i,this.cells=s}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:r}=this;for(let n=0;n<e;n++){const i=r.getRenderedNode(n);if(i.firstChild){const s=this.renderedRowToSource(n),o=this.rowUtils.getHeight(s);o?i.firstChild.style.height=`${o-1}px`:i.firstChild.style.height=""}}}}class Wre{constructor(){let{TABLE:e,THEAD:r,COLGROUP:n,TBODY:i,rowUtils:s,columnUtils:o,cellRenderer:a}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.renderer=new Bre(e,{cellRenderer:a}),this.renderer.setRenderers({rowHeaders:new Are,columnHeaders:new Mre(r),colGroup:new Ore(n),rows:new kre(i),cells:new Fre}),this.renderer.setAxisUtils(s,o)}setFilters(e,r){return this.renderer.setFilters(e,r),this}setViewportSize(e,r){return this.renderer.setViewportSize(e,r),this}setHeaderContentRenderers(e,r){return this.renderer.setHeaderContentRenderers(e,r),this}adjust(){this.renderer.adjust()}render(){this.renderer.render()}}function dh(t,e,r){Vre(t,e),e.set(t,r)}function Vre(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function pg(t,e,r){return e=Ure(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ure(t){var e=Gre(t,"string");return typeof e=="symbol"?e:String(e)}function Gre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function en(t,e){var r=aF(t,e,"get");return Yre(t,r)}function Yre(t,e){return e.get?e.get.call(t):e.value}function fh(t,e,r){var n=aF(t,e,"set");return zre(t,n,r),r}function aF(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function zre(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}var wg=new WeakMap,bc=new WeakMap,gh=new WeakMap,vg=new WeakMap,rl=new WeakMap;class Zy{static get DEFAULT_WIDTH(){return 50}constructor(e){let{totalColumns:r,stretchMode:n,stretchingColumnWidthFn:i,columnWidthFn:s}=e;pg(this,"stretchAllRatio",0),pg(this,"stretchLastWidth",0),pg(this,"stretchAllColumnsWidth",[]),dh(this,wg,{writable:!0,value:0}),pg(this,"needVerifyLastColumnWidth",!0),dh(this,bc,{writable:!0,value:()=>0}),dh(this,gh,{writable:!0,value:o=>o}),dh(this,vg,{writable:!0,value:o=>o}),dh(this,rl,{writable:!0,value:()=>"none"}),fh(this,bc,r),fh(this,rl,n),fh(this,gh,i!=null?i:en(this,gh)),fh(this,vg,s!=null?s:en(this,vg))}refreshStretching(e){if(en(this,rl).call(this)==="none")return;fh(this,wg,e);let r=0;for(let i=0;i<en(this,bc).call(this);i++){const s=this._getColumnWidth(i),o=en(this,gh).call(this,void 0,i);typeof o=="number"?e-=o:r+=s}const n=e-r;if(en(this,rl).call(this)==="all"&&n>0)this.stretchAllRatio=e/r,this.stretchAllColumnsWidth=[],this.needVerifyLastColumnWidth=!0;else if(en(this,rl).call(this)==="last"&&e!==1/0){const i=this._getColumnWidth(en(this,bc).call(this)-1),s=n+i;this.stretchLastWidth=s>=0?s:i}}getStretchedColumnWidth(e,r){let n=null;return en(this,rl).call(this)==="all"&&this.stretchAllRatio!==0?n=this._getStretchedAllColumnWidth(e,r):en(this,rl).call(this)==="last"&&this.stretchLastWidth!==0&&(n=this._getStretchedLastColumnWidth(e)),n}_getStretchedAllColumnWidth(e,r){let n=0;if(!this.stretchAllColumnsWidth[e]){const i=Math.round(r*this.stretchAllRatio),s=en(this,gh).call(this,i,e);s===void 0?this.stretchAllColumnsWidth[e]=i:this.stretchAllColumnsWidth[e]=isNaN(s)?this._getColumnWidth(e):s}if(this.stretchAllColumnsWidth.length===en(this,bc).call(this)&&this.needVerifyLastColumnWidth){this.needVerifyLastColumnWidth=!1;for(let i=0;i<this.stretchAllColumnsWidth.length;i++)n+=this.stretchAllColumnsWidth[i];n!==en(this,wg)&&(this.stretchAllColumnsWidth[this.stretchAllColumnsWidth.length-1]+=en(this,wg)-n)}return this.stretchAllColumnsWidth[e]}_getStretchedLastColumnWidth(e){return e===en(this,bc).call(this)-1?this.stretchLastWidth:null}_getColumnWidth(e){let r=en(this,vg).call(this,e);return isNaN(r)&&(r=Zy.DEFAULT_WIDTH),r}}function Cg(t,e,r){return e=jre(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function jre(t){var e=Kre(t,"string");return typeof e=="symbol"?e:String(e)}function Kre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Xre{constructor(e,r){Cg(this,"dataAccessObject",void 0),Cg(this,"wtSettings",void 0),Cg(this,"headerWidths",new Map),Cg(this,"stretching",void 0),this.dataAccessObject=e,this.wtSettings=r,this.stretching=new Zy({totalColumns:()=>this.wtSettings.getSetting("totalColumns"),stretchMode:()=>this.wtSettings.getSetting("stretchH"),stretchingColumnWidthFn:(n,i)=>this.wtSettings.getSetting("onBeforeStretchingColumnWidth",n,i),columnWidthFn:n=>this.dataAccessObject.wtTable.getColumnWidth(n)})}getWidth(e){return this.wtSettings.getSetting("columnWidth",e)||this.wtSettings.getSetting("defaultColumnWidth")}getStretchedColumnWidth(e){let r=this.getWidth(e);const n=this.stretching.getStretchedColumnWidth(e,r);return n&&(r=n),r}getHeaderHeight(e){let r=this.wtSettings.getSetting("defaultRowHeight");const n=this.dataAccessObject.wtViewport.oversizedColumnHeaders[e];return n!==void 0&&(r=r?Math.max(r,n):n),r}getHeaderWidth(e){return this.headerWidths.get(this.dataAccessObject.wtTable.columnFilter.sourceToRendered(e))}refreshStretching(){const{wtTable:e,wtViewport:r,cloneSource:n}=this.dataAccessObject,i=n?n.wtTable.holder:e.holder,s=i.offsetHeight<i.scrollHeight?Ur():0;this.stretching.refreshStretching(r.getViewportWidth()-s)}calculateWidths(){const{wtSettings:e}=this;let r=e.getSetting("rowHeaderWidth");if(this.refreshStretching(),r=e.getSetting("onModifyRowHeaderWidth",r),r!=null){const n=e.getSetting("rowHeaders").length,i=e.getSetting("defaultColumnWidth");for(let s=0;s<n;s++){let o=Array.isArray(r)?r[s]:r;o=o==null?i:o,this.headerWidths.set(s,o)}}}}function T_(t,e,r){return e=qre(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qre(t){var e=Zre(t,"string");return typeof e=="symbol"?e:String(e)}function Zre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Jre{constructor(e,r){T_(this,"dataAccessObject",void 0),T_(this,"wtSettings",void 0),this.dataAccessObject=e,this.wtSettings=r}getHeight(e){let r=this.wtSettings.getSetting("rowHeight",e);const n=this.dataAccessObject.wtViewport.oversizedRows[e];return n!==void 0&&(r=r===void 0?n:Math.max(r,n)),r}}function Es(t,e,r){return e=Qre(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qre(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 r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class tne{constructor(e,r,n,i,s){Es(this,"wtSettings",null),Es(this,"domBindings",void 0),Es(this,"TBODY",null),Es(this,"THEAD",null),Es(this,"COLGROUP",null),Es(this,"hasTableHeight",!0),Es(this,"hasTableWidth",!0),Es(this,"isTableVisible",!1),Es(this,"tableOffset",0),Es(this,"holderOffset",0),this.domBindings=n,this.isMaster=s==="master",this.name=s,this.dataAccessObject=e,this.facadeGetter=r,this.wtSettings=i,this.instance=this.dataAccessObject.wot,this.wot=this.dataAccessObject.wot,this.TABLE=n.rootTable,pH(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 o=this.wtSettings.getSettingPure("rowHeaderWidth");this.wtSettings.update("rowHeaderWidth",()=>this._modifyRowHeaderWidth(o)),this.rowUtils=new Jre(this.dataAccessObject,this.wtSettings),this.columnUtils=new Xre(this.dataAccessObject,this.wtSettings),this.tableRenderer=new Wre({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 r=e.parentNode;let n;return(!r||r.nodeType!==Node.ELEMENT_NODE||!Je(r,"wtHolder"))&&(n=this.domBindings.rootDocument.createElement("div"),n.className="wtSpreader",r&&r.insertBefore(n,e),n.appendChild(e)),n.style.position="relative",this.wtSettings.getSetting("ariaTags")&&qe(n,[Ys()]),n}createHider(e){const r=e.parentNode;let n;return(!r||r.nodeType!==Node.ELEMENT_NODE||!Je(r,"wtHolder"))&&(n=this.domBindings.rootDocument.createElement("div"),n.className="wtHider",r&&r.insertBefore(n,e),n.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&qe(n,[Ys()]),n}createHolder(e){const r=e.parentNode;let n;return(!r||r.nodeType!==Node.ELEMENT_NODE||!Je(r,"wtHolder"))&&(n=this.domBindings.rootDocument.createElement("div"),n.style.position="relative",n.className="wtHolder",r&&r.insertBefore(n,e),this.isMaster&&(n.parentNode.className+="ht_master handsontable",n.parentNode.setAttribute("dir",this.wtSettings.getSettingPure("rtlMode")?"rtl":"ltr"),this.wtSettings.getSetting("ariaTags")&&qe(n.parentNode,[Ys()])),n.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&qe(n,[Ys()]),n}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{wtSettings:r}=this,{wtOverlays:n,wtViewport:i}=this.dataAccessObject,s=r.getSetting("totalRows"),o=r.getSetting("totalColumns"),a=r.getSetting("rowHeaders"),l=a.length,c=r.getSetting("columnHeaders"),u=c.length;let h=!1,d=e;if(this.isMaster&&(this.holderOffset=Wr(this.holder),d=i.createRenderCalculators(d),l&&!r.getSetting("fixedColumnsStart"))){const g=n.inlineStartOverlay.getScrollPosition(),m=this.correctHeaderWidth;this.correctHeaderWidth=g!==0,m!==this.correctHeaderWidth&&(d=!1)}if(this.isMaster&&(h=n.updateStateOfRendering()),d)this.isMaster&&i.createVisibleCalculators(),n&&n.refresh(!0);else{this.isMaster?this.tableOffset=Wr(this.TABLE):this.tableOffset=this.dataAccessObject.parentTableOffset;const g=s>0?this.getFirstRenderedRow():0,m=o>0?this.getFirstRenderedColumn():0;this.rowFilter=new hre(g,s,u),this.columnFilter=new are(m,o,l);let w=!0;if(this.isMaster){this.alignOverlaysWithTrimmingContainer();const C={};this.wtSettings.getSetting("beforeDraw",!0,C),w=C.skipRender!==!0}if(w){this.tableRenderer.setHeaderContentRenderers(a,c),(this.is(Us)||this.is(Pa))&&this.tableRenderer.setHeaderContentRenderers(a,[]),this.resetOversizedRows(),this.tableRenderer.setViewportSize(this.getRenderedRowsCount(),this.getRenderedColumnsCount()).setFilters(this.rowFilter,this.columnFilter).render();let C;if(this.isMaster&&(C=this.dataAccessObject.workspaceWidth,this.dataAccessObject.wtViewport.containerWidth=null,this.markOversizedColumnHeaders()),this.adjustColumnHeaderHeights(),(this.isMaster||this.is(Us))&&this.markOversizedRows(),this.isMaster){this.dataAccessObject.wtViewport.createVisibleCalculators(),this.dataAccessObject.wtOverlays.refresh(!1),this.dataAccessObject.wtOverlays.applyToDOM();const S=Ht(this.hider),v=Ht(this.TABLE);S!==0&&v!==S&&(this.columnUtils.calculateWidths(),this.tableRenderer.renderer.colGroup.render()),C!==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(Us)&&this.dataAccessObject.cloneSource.wtOverlays.adjustElementsSize()}}let f=!1;return this.isMaster&&(f=n.topOverlay.resetFixedPosition(),n.bottomOverlay.clone&&(f=n.bottomOverlay.resetFixedPosition()||f),f=n.inlineStartOverlay.resetFixedPosition()||f,n.topInlineStartCornerOverlay&&n.topInlineStartCornerOverlay.resetFixedPosition(),n.bottomInlineStartCornerOverlay&&n.bottomInlineStartCornerOverlay.clone&&n.bottomInlineStartCornerOverlay.resetFixedPosition()),f?(n.refreshAll(),n.adjustElementsSize()):this.dataAccessObject.selectionManager.setActiveOverlay(this.facadeGetter()).render(d),h&&n.syncScrollWithMaster(),this.dataAccessObject.drawn=!0,this}markIfOversizedColumnHeader(e){const r=this.columnFilter.renderedToSource(e);let n=this.wtSettings.getSetting("columnHeaders").length;const i=this.wtSettings.getSetting("defaultRowHeight");let s,o,a;const l=this.wtSettings.getSetting("columnHeaderHeight")||[];for(;n;)n-=1,s=this.getColumnHeaderHeight(n),o=this.getColumnHeader(r,n),o&&(a=gu(o),(!s&&i<a||s<a)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]=a),Array.isArray(l)?l[n]!==null&&l[n]!==void 0&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]=l[n]):isNaN(l)||(this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]=l),this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]<(l[n]||l)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]=l[n]||l))}adjustColumnHeaderHeights(){const{wtSettings:e}=this,r=this.THEAD.childNodes,n=this.dataAccessObject.wtViewport.oversizedColumnHeaders,i=e.getSetting("columnHeaders");for(let s=0,o=i.length;s<o;s++)if(n[s]){if(!r[s]||r[s].childNodes.length===0)return;r[s].childNodes[0].style.height=`${n[s]}px`}}resetOversizedRows(){const{wtSettings:e}=this,{wtViewport:r}=this.dataAccessObject;if(!(!this.isMaster&&!this.is(Us))&&!e.getSetting("externalRowCalculator")){const n=this.getRenderedRowsCount();for(let i=0;i<n;i++){const s=this.rowFilter.renderedToSource(i);r.oversizedRows&&r.oversizedRows[s]&&(r.oversizedRows[s]=void 0)}}}getCell(e){let r=e.row,n=e.col;const i=this.wtSettings.getSetting("onModifyGetCellCoords",r,n);if(i&&Array.isArray(i)&&([r,n]=i),this.isRowBeforeRenderedRows(r))return-1;if(this.isRowAfterRenderedRows(r))return-2;if(this.isColumnBeforeRenderedColumns(n))return-3;if(this.isColumnAfterRenderedColumns(n))return-4;const s=this.getRow(r);if(!s&&r>=0)throw new Error("TR was expected to be rendered but is not");const o=s.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(n)];if(!o&&n>=0)throw new Error("TD or TH was expected to be rendered but is not");return o}getRow(e){let r=null,n=null;if(e<0){var i;r=(i=this.rowFilter)===null||i===void 0?void 0:i.sourceRowToVisibleColHeadedRow(e),n=this.THEAD}else{var s;r=(s=this.rowFilter)===null||s===void 0?void 0:s.sourceToRendered(e),n=this.TBODY}return r!==void 0&&n!==void 0?n.childNodes.length<r+1?!1:n.childNodes[r]:!1}getColumnHeader(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const n=this.THEAD.childNodes[r];return n==null?void 0:n.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]}getColumnHeaders(e){const r=[],n=this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e);return this.THEAD.childNodes.forEach(i=>{const s=i.childNodes[n];s&&r.push(s)}),r}getRowHeader(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const n=this.wtSettings.getSetting("rowHeaders").length;if(r>=n)return;const i=this.rowFilter.sourceToRendered(e),s=i<0?this.rowFilter.sourceRowToVisibleColHeadedRow(e):i,a=(i<0?this.THEAD:this.TBODY).childNodes[s];return a==null?void 0:a.childNodes[r]}getRowHeaders(e){const r=[],n=this.wtSettings.getSetting("rowHeaders").length;for(let i=0;i<n;i++){const s=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)],o=s==null?void 0:s.childNodes[i];o&&r.push(o)}return r}getCoords(e){let r=e;if(r.nodeName!=="TD"&&r.nodeName!=="TH"&&(r=zl(r,["TD","TH"])),r===null)return null;const n=r.parentNode,i=n.parentNode;let s=xQ(n),o=r.cellIndex;return el(Jl,r,this.wtRootElement)||el(ql,r,this.wtRootElement)?i.nodeName==="THEAD"&&(s-=i.childNodes.length):el(Pa,r,this.wtRootElement)||el(Us,r,this.wtRootElement)?s=this.wtSettings.getSetting("totalRows")-i.childNodes.length+s:i===this.THEAD?s=this.rowFilter.visibleColHeadedRowToSourceRow(s):s=this.rowFilter.renderedToSource(s),el(Jl,r,this.wtRootElement)||el(Zl,r,this.wtRootElement)||el(Pa,r,this.wtRootElement)?o=this.columnFilter.offsettedTH(o):o=this.columnFilter.visibleRowHeadedColumnToSourceColumn(o),this.wot.createCellCoords(s,o)}markOversizedRows(){if(this.wtSettings.getSetting("externalRowCalculator"))return;let e=this.TBODY.childNodes.length;const r=e*this.wtSettings.getSetting("defaultRowHeight"),n=gu(this.TBODY)-1;let i,s,o,a,l;if(!(r===n&&!this.wtSettings.getSetting("fixedRowsBottom")))for(;e;)e-=1,o=this.rowFilter.renderedToSource(e),i=this.getRowHeight(o),a=this.getTrForRow(o),l=a.querySelector("th"),l?s=gu(l):s=gu(a)-1,(!i&&this.wtSettings.getSetting("defaultRowHeight")<s||i<s)&&(s+=1,this.dataAccessObject.wtViewport.oversizedRows[o]=s)}getTrForRow(e){return this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]}isColumnHeaderRendered(e){if(e>=0)return!1;const n=this.wtSettings.getSetting("rowHeaders").length;return Math.abs(e)<=n}isRowHeaderRendered(e){if(e>=0)return!1;const n=this.wtSettings.getSetting("columnHeaders").length;return Math.abs(e)<=n}isRowBeforeRenderedRows(e){const r=this.getFirstRenderedRow();return e<0&&r<=0?!this.isRowHeaderRendered(e):e<r}isRowAfterRenderedRows(e){return e>this.getLastRenderedRow()}isColumnBeforeRenderedColumns(e){const r=this.getFirstRenderedColumn();return e<0&&r<=0?!this.isColumnHeaderRendered(e):e<r}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 Ht(this.TABLE)}getHeight(){return cr(this.TABLE)}getTotalWidth(){const e=Ht(this.hider);return e!==0?e:this.getWidth()}getTotalHeight(){const e=cr(this.hider);return e!==0?e:this.getHeight()}isVisible(){return Kl(this.TABLE)}_modifyRowHeaderWidth(e){let r=Ut(e)?e():null;return Array.isArray(r)?(r=[...r],r[r.length-1]=this._correctRowHeaderWidth(r[r.length-1])):r=this._correctRowHeaderWidth(r),r}_correctRowHeaderWidth(e){let r=e;return typeof e!="number"&&(r=this.wtSettings.getSetting("defaultColumnWidth")),this.correctHeaderWidth&&(r+=1),r}}const Yu=tne,rne="stickyRowsBottom",lF={getFirstRenderedRow(){const t=this.wtSettings.getSetting("totalRows"),e=this.wtSettings.getSetting("fixedRowsBottom"),r=t-e;return t===0||e===0?-1:r<0?0:r},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}};zo(lF,"MIXIN_NAME",rne,{writable:!1,enumerable:!1});const cF=lF,nne="stickyColumnsStart",uF={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}};zo(uF,"MIXIN_NAME",nne,{writable:!1,enumerable:!1});const Jy=uF;class Qy extends Yu{constructor(e,r,n,i){super(e,r,n,i,Pa)}}Vt(Qy,cF);Vt(Qy,Jy);const ine=Qy,ql="top",Us="bottom",Zl="inline_start",Jl="top_inline_start_corner",Pa="bottom_inline_start_corner",sne=[ql,Us,Zl,Jl,Pa],one=new Map([[ql,`ht_clone_${ql}`],[Us,`ht_clone_${Us}`],[Zl,`ht_clone_${Zl} ht_clone_left`],[Jl,`ht_clone_${Jl} ht_clone_top_left_corner`],[Pa,`ht_clone_${Pa} ht_clone_bottom_left_corner`]]);function sv(t,e,r){return e=ane(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,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 r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class cne{constructor(e){sv(this,"dataAccessObject",void 0),sv(this,"lastScrolledColumnPos",-1),sv(this,"lastScrolledRowPos",-1),this.dataAccessObject=e}scrollViewport(e,r,n,i,s){const o=this.scrollViewportHorizontally(e.col,n,s),a=this.scrollViewportVertically(e.row,r,i);return o||a}scrollViewportHorizontally(e,r,n){const{drawn:i,totalColumns:s}=this.dataAccessObject;if(!i||!Number.isInteger(e)||e<0||e>s)return!1;const o=this.getFirstVisibleColumn(),a=this.getLastVisibleColumn(),l=r===void 0&&n===void 0,{fixedColumnsStart:c,inlineStartOverlay:u}=this.dataAccessObject;if(l&&e<c)return!1;let h=!1;return e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollHorizontally",e),o===-1?h=u.scrollTo(e,l?e>this.lastScrolledColumnPos:r):(l&&(e<o||e>a)||!l)&&(h=u.scrollTo(e,l?e>a:r)),h&&(this.lastScrolledColumnPos=e),h}scrollViewportVertically(e,r,n){const{drawn:i,totalRows:s}=this.dataAccessObject;if(!i||!Number.isInteger(e)||e<0||e>s)return!1;const o=this.getFirstVisibleRow(),a=this.getLastVisibleRow(),l=r===void 0&&n===void 0,{fixedRowsBottom:c,fixedRowsTop:u,topOverlay:h}=this.dataAccessObject;if(l&&(e<u||e>s-c-1))return!1;let d=!1;return e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollVertically",e),o===-1?d=h.scrollTo(e,l?e>this.lastScrolledRowPos:n):(l&&(e<o||e>a)||!l)&&(d=h.scrollTo(e,l?e>a:n)),d&&(this.lastScrolledRowPos=e),d}getFirstVisibleRow(){return this.dataAccessObject.wtTable.getFirstVisibleRow()}getLastVisibleRow(){const{topOverlay:e,wtTable:r,wtViewport:n,totalRows:i,rootWindow:s}=this.dataAccessObject;let o=r.getLastVisibleRow();if(e.mainTableScrollableElement===s){const a=Wr(r.wtRootElement),l=Ly(s,s);if(a.top>l){const c=gu(s);let u=n.getColumnHeaderHeight();for(let h=1;h<=i;h++)if(u+=e.sumCellSizes(h-1,h),a.top+u-l>=c){o=h-2;break}}}return o}getFirstVisibleColumn(){return this.dataAccessObject.wtTable.getFirstVisibleColumn()}getLastVisibleColumn(){const{wtSettings:e,inlineStartOverlay:r,wtTable:n,wtViewport:i,totalColumns:s,rootWindow:o}=this.dataAccessObject;let a=n.getLastVisibleColumn();if(r.mainTableScrollableElement===o){const l=e.getSetting("rtlMode");let c=null;if(l){const h=n.TABLE.getBoundingClientRect(),f=this.dataAccessObject.rootWindow.document.documentElement.offsetWidth;c=Math.abs(h.right-f)}else c=Wr(n.wtRootElement).left;const u=Math.abs(vH(o,o));if(c>u){const h=CH(o);let d=i.getRowHeaderWidth();for(let f=1;f<=s;f++)if(d+=r.sumCellSizes(f-1,f),c+d-u>=h){a=f-2;break}}}return a}}const une=cne;function Yi(t,e,r){return e=hne(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,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 r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ex{get eventManager(){return new ms(this)}constructor(e,r){Yi(this,"wtTable",void 0),Yi(this,"wtScroll",void 0),Yi(this,"wtViewport",void 0),Yi(this,"wtOverlays",void 0),Yi(this,"selectionManager",void 0),Yi(this,"wtEvent",void 0),Yi(this,"guid",`wt_${oH()}`),Yi(this,"drawInterrupted",!1),Yi(this,"drawn",!1),Yi(this,"domBindings",void 0),Yi(this,"wtSettings",void 0),this.domBindings={rootTable:e,rootDocument:e.ownerDocument,rootWindow:e.ownerDocument.defaultView},this.wtSettings=r,this.wtScroll=new une(this.createScrollDao())}findOriginalHeaders(){const e=[];if(this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(let r=0,n=this.wtTable.THEAD.childNodes[0].childNodes.length;r<n;r++)e.push(this.wtTable.THEAD.childNodes[0].childNodes[r].innerHTML);this.wtSettings.getSetting("columnHeaders").length||this.wtSettings.update("columnHeaders",[function(r,n){jl(n,e[r])}])}}createCellCoords(e,r){return new bm(e,r,this.wtSettings.getSetting("rtlMode"))}createCellRange(e,r,n){return new qy(e,r,n,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 n=this.wtSettings.getSetting("totalRows"),i=this.wtSettings.getSetting("fixedRowsTop"),s=this.wtSettings.getSetting("fixedRowsBottom"),o=this.wtSettings.getSetting("fixedColumnsStart");if(e.row<i&&e.col<o)return this.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.getCell(e);if(e.row<i)return this.wtOverlays.topOverlay.clone.wtTable.getCell(e);if(e.col<o&&e.row>=n-s){if(this.wtOverlays.bottomInlineStartCornerOverlay&&this.wtOverlays.bottomInlineStartCornerOverlay.clone)return this.wtOverlays.bottomInlineStartCornerOverlay.clone.wtTable.getCell(e)}else{if(e.col<o)return this.wtOverlays.inlineStartOverlay.clone.wtTable.getCell(e);if(e.row<n&&e.row>=n-s&&this.wtOverlays.bottomOverlay&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)}scrollViewport(e,r,n,i,s){return e.col<0||e.row<0?!1:this.wtScroll.scrollViewport(e,r,n,i,s)}scrollViewportHorizontally(e,r,n){return e<0?!1:this.wtScroll.scrollViewportHorizontally(e,r,n)}scrollViewportVertically(e,r,n){return e<0?!1:this.wtScroll.scrollViewportVertically(e,r,n)}getViewport(){return[this.wtTable.getFirstVisibleRow(),this.wtTable.getFirstVisibleColumn(),this.wtTable.getLastVisibleRow(),this.wtTable.getLastVisibleColumn()]}destroy(){this.wtOverlays.destroy(),this.wtEvent.destroy()}createScrollDao(){const e=this;return{get drawn(){return e.drawn},get topOverlay(){return e.wtOverlays.topOverlay},get inlineStartOverlay(){return e.wtOverlays.inlineStartOverlay},get wtTable(){return e.wtTable},get wtViewport(){return e.wtViewport},get wtSettings(){return e.wtSettings},get rootWindow(){return e.domBindings.rootWindow},get totalRows(){return e.wtSettings.getSetting("totalRows")},get totalColumns(){return e.wtSettings.getSetting("totalColumns")},get fixedRowsTop(){return e.wtSettings.getSetting("fixedRowsTop")},get fixedRowsBottom(){return e.wtSettings.getSetting("fixedRowsBottom")},get fixedColumnsStart(){return e.wtSettings.getSetting("fixedColumnsStart")}}}getTableDao(){const e=this;return{get wot(){return e},get parentTableOffset(){return e.cloneSource.wtTable.tableOffset},get cloneSource(){return e.cloneSource},get workspaceWidth(){return e.wtViewport.getWorkspaceWidth()},get wtViewport(){return e.wtViewport},get wtOverlays(){return e.wtOverlays},get selectionManager(){return e.selectionManager},get drawn(){return e.drawn},set drawn(r){e.drawn=r},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 __(t,e,r){return e=fne(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,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 r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class mne extends ex{constructor(e,r,n){super(e,r),__(this,"cloneSource",void 0),__(this,"cloneOverlay",void 0);const i=this.wtSettings.getSetting("facade",this);this.cloneSource=n.source,this.cloneOverlay=n.overlay,this.wtTable=this.cloneOverlay.createTable(this.getTableDao(),i,this.domBindings,this.wtSettings),this.wtViewport=n.viewport,this.selectionManager=n.selectionManager,this.wtEvent=new iF(i,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager,n.event),this.findOriginalHeaders()}}function pne(t,e,r){return e=wne(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,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 r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class xf{constructor(e,r,n,i,s){pne(this,"wtSettings",null),zo(this,"wot",e,{writable:!1}),this.domBindings=s,this.facadeGetter=r,this.wtSettings=i;const{TABLE:o,hider:a,spreader:l,holder:c,wtRootElement:u}=this.wot.wtTable;this.instance=this.wot,this.type=n,this.mainTableScrollableElement=null,this.TABLE=o,this.hider=a,this.spreader=l,this.holder=c,this.wtRootElement=u,this.trimmingContainer=Iu(this.hider.parentNode.parentNode),this.updateStateOfRendering(),this.clone=this.makeClone()}updateStateOfRendering(){const e=this.needFullRender;this.needFullRender=this.shouldBeRendered();const r=e!==this.needFullRender;return r&&!this.needFullRender&&this.reset(),r}shouldBeRendered(){return!0}updateTrimmingContainer(){this.trimmingContainer=Iu(this.hider.parentNode.parentNode)}updateMainScrollableElement(){const{wtTable:e}=this.wot,{rootWindow:r}=this.domBindings;r.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden"?this.mainTableScrollableElement=this.wot.wtTable.holder:this.mainTableScrollableElement=Cm(e.TABLE)}getRelativeCellPosition(e,r,n){if(this.clone.wtTable.holder.contains(e)===!1){Ft(`The provided element is not a child of the ${this.type} overlay`);return}const i=this.mainTableScrollableElement===this.domBindings.rootWindow,s=n<this.wtSettings.getSetting("fixedColumnsStart"),o=r<this.wtSettings.getSetting("fixedRowsTop"),a=r>=this.wtSettings.getSetting("totalRows")-this.wtSettings.getSetting("fixedRowsBottom"),l=this.clone.wtTable.spreader,c={start:this.getRelativeStartPosition(l),top:l.offsetTop},u={start:this.getRelativeStartPosition(e),top:e.offsetTop};let h=null;return i?h=this.getRelativeCellPositionWithinWindow(o,s,u,c):h=this.getRelativeCellPositionWithinHolder(o,a,s,u,c),h}getRelativeStartPosition(e){return this.isRtl()?e.offsetParent.offsetWidth-e.offsetLeft-e.offsetWidth:e.offsetLeft}getRelativeCellPositionWithinWindow(e,r,n,i){const s=this.wot.wtTable.wtRootElement.getBoundingClientRect();let o=0,a=0;if(!r)o=i.start;else{let l=s.left;this.isRtl()&&(l=this.domBindings.rootWindow.innerWidth-(s.left+s.width+Ur())),o=l<=0?-1*l:0}return e?a=this.clone.wtTable.TABLE.getBoundingClientRect().top-s.top:a=i.top,{start:n.start+o,top:n.top+a}}getRelativeCellPositionWithinHolder(e,r,n,i,s){const o={horizontal:this.wot.wtOverlays.inlineStartOverlay.getScrollPosition(),vertical:this.wot.wtOverlays.topOverlay.getScrollPosition()};let a=0,l=0;if(n||(a=o.horizontal-s.start),r){const c=this.wot.wtTable.wtRootElement.getBoundingClientRect();l=this.clone.wtTable.TABLE.getBoundingClientRect().top*-1+c.top}else e||(l=o.vertical-s.top);return{start:i.start-a,top:i.top-l}}makeClone(){if(sne.indexOf(this.type)===-1)throw new Error(`Clone type "${this.type}" is not supported.`);const{wtTable:e,wtSettings:r}=this.wot,{rootDocument:n,rootWindow:i}=this.domBindings,s=n.createElement("div"),o=n.createElement("table"),a=e.wtRootElement.parentNode;s.className=`${one.get(this.type)} handsontable`,s.setAttribute("dir",this.isRtl()?"rtl":"ltr"),s.style.position="absolute",s.style.top=0,s.style.overflow="visible",this.isRtl()?s.style.right=0:s.style.left=0,r.getSetting("ariaTags")&&qe(s,[Ys()]),o.className=e.TABLE.className,e.TABLE.getAttribute("role")&&o.setAttribute("role",e.TABLE.getAttribute("role")),s.appendChild(o),a.appendChild(s);const c=this.wtSettings.getSetting("preventOverflow");return c===!0||c==="horizontal"&&this.type===ql||c==="vertical"&&this.type===Zl?this.mainTableScrollableElement=i:i.getComputedStyle(a).getPropertyValue("overflow")==="hidden"?this.mainTableScrollableElement=e.holder:this.mainTableScrollableElement=Cm(e.TABLE),new mne(o,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 r=this.shouldBeRendered();this.clone&&(this.needFullRender||r)&&this.clone.draw(e),this.needFullRender=r}reset(){if(!this.clone)return;const e=this.clone.wtTable.holder,r=this.clone.wtTable.hider,n=e.style,i=r.style,s=e.parentNode.style;j([n,i,s],o=>{o.width="",o.height=""})}isRtl(){return this.wtSettings.getSetting("rtlMode")}destroy(){this.clone.eventManager.destroy()}}class Cne extends xf{constructor(e,r,n,i,s,o){super(e,r,Pa,n,i),this.bottomOverlay=s,this.inlineStartOverlay=o}createTable(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return new ine(...r)}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 r=this.clone.wtTable.holder.parentNode;if(r.style.top="",this.trimmingContainer===this.domBindings.rootWindow){const s=this.inlineStartOverlay.getOverlayOffset(),o=this.bottomOverlay.getOverlayOffset();r.style[this.isRtl()?"right":"left"]=`${s}px`,r.style.bottom=`${o}px`}else _p(r),this.repositionOverlay();let n=cr(this.clone.wtTable.TABLE);const i=Ht(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(n=0),r.style.height=`${n}px`,r.style.width=`${i}px`,!1}repositionOverlay(){const{wtTable:e,wtViewport:r}=this.wot,{rootDocument:n}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let s=0;r.hasVerticalScroll()||(s+=r.getWorkspaceHeight()-e.getTotalHeight()),r.hasVerticalScroll()&&r.hasHorizontalScroll()&&(s+=Ur(n)),i.style.bottom=`${s}px`}}const Sne="calculatedColumns",hF={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}};zo(hF,"MIXIN_NAME",Sne,{writable:!1,enumerable:!1});const tx=hF;class rx extends Yu{constructor(e,r,n,i){super(e,r,n,i,Us)}}Vt(rx,cF);Vt(rx,tx);const yne=rx;function xne(t,e,r){return e=bne(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bne(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 r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Rne extends xf{constructor(e,r,n,i){super(e,r,Us,n,i),xne(this,"cachedFixedRowsBottom",-1),this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom")}createTable(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return new yne(...r)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderBottomOverlay")}resetFixedPosition(){if(!this.needFullRender||!this.wot.wtTable.holder.parentNode)return!1;const{rootWindow:e}=this.domBindings,r=this.clone.wtTable.holder.parentNode;r.style.top="";let n=0;const i=this.wtSettings.getSetting("preventOverflow");this.trimmingContainer===e&&(!i||i!=="vertical")?(n=this.getOverlayOffset(),r.style.bottom=`${n}px`):(n=this.getScrollPosition(),this.repositionOverlay());const s=this.adjustHeaderBordersPosition(n);return this.adjustElementsSize(),s}repositionOverlay(){const{wtTable:e,wtViewport:r}=this.wot,{rootDocument:n}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let s=0;r.hasVerticalScroll()||(s+=r.getWorkspaceHeight()-e.getTotalHeight()),r.hasVerticalScroll()&&r.hasHorizontalScroll()&&(s+=Ur(n)),i.style.bottom=`${s}px`}setScrollPosition(e){const{rootWindow:r}=this.domBindings;let n=!1;return this.mainTableScrollableElement===r?(r.scrollTo(Fy(r),e),n=!0):this.mainTableScrollableElement.scrollTop!==e&&(this.mainTableScrollableElement.scrollTop=e,n=!0),n}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,r){const{wtTable:n,wtSettings:i}=this.wot,s=i.getSetting("defaultRowHeight");let o=e,a=0;for(;o<r;){const l=n.getRowHeight(o);a+=l===void 0?s:l,o+=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:r}=this.wot,{rootDocument:n,rootWindow:i}=this.domBindings,s=Ur(n),a=this.clone.wtTable.holder.parentNode.style,l=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||l==="horizontal"){let u=r.getWorkspaceWidth();this.wot.wtOverlays.hasScrollbarRight&&(u-=s),u=Math.min(u,e.wtRootElement.scrollWidth),a.width=`${u}px`}else a.width="";this.clone.wtTable.holder.style.width=a.width;let c=cr(this.clone.wtTable.TABLE);this.wot.wtTable.hasDefinedSize()||(c=0),a.height=`${c}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:r}=this.clone.wtTable;typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number"?r.style[e]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:r.style[e]=""}scrollTo(e,r){let n=this.getTableParentOffset();const s=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder;let o=0;r&&s.offsetHeight!==s.clientHeight&&(o=Ur(this.domBindings.rootDocument)),r?(n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportHeight(),n+=1):n+=this.sumCellSizes(this.wtSettings.getSetting("fixedRowsBottom"),e),n+=o,this.setScrollPosition(n)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return Ly(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,r=this.wtSettings.getSetting("preventOverflow");let n=0;if(this.trimmingContainer===e&&(!r||r!=="vertical")){const i=this.wot.wtTable.getTotalHeight(),s=this.clone.wtTable.getTotalHeight(),o=i-s,a=this.domBindings.rootDocument.documentElement.clientHeight;n=Math.max(this.getTableParentOffset()-this.getScrollPosition()-a+i,0),n>o&&(n=0)}return n}adjustHeaderBordersPosition(e){const r=this.wtSettings.getSetting("fixedRowsBottom"),n=this.cachedFixedRowsBottom!==r,i=this.wtSettings.getSetting("columnHeaders");let s=!1;if((n||r===0)&&i.length>0){const o=this.wot.wtTable.holder.parentNode,a=Je(o,"innerBorderBottom");this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom"),e||this.wtSettings.getSetting("totalRows")===0?(be(o,"innerBorderBottom"),s=!a):(rt(o,"innerBorderBottom"),s=a)}return s}}const Tne="calculatedRows",dF={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}};zo(dF,"MIXIN_NAME",Tne,{writable:!1,enumerable:!1});const fF=dF;class nx extends Yu{constructor(e,r,n,i){super(e,r,n,i,Zl)}}Vt(nx,fF);Vt(nx,Jy);const _ne=nx,Ane="localHooks",gF={_localHooks:Object.create(null),addLocalHook(t,e){return this._localHooks[t]||(this._localHooks[t]=[]),this._localHooks[t].push(e),this},runLocalHooks(t,e,r,n,i,s,o){if(this._localHooks[t]){const a=this._localHooks[t].length;for(let l=0;l<a;l++)M1(this._localHooks[t][l],this,e,r,n,i,s,o)}},clearLocalHooks(){return this._localHooks={},this}};zo(gF,"MIXIN_NAME",Ane,{writable:!1,enumerable:!1});const Qn=gF;class mF{constructor(e,r){this.settings=e,this.cellRange=r||null}isEmpty(){return this.cellRange===null}add(e){return this.isEmpty()?this.cellRange=this.settings.createCellRange(e):this.cellRange.expand(e),this}replace(e,r){if(!this.isEmpty()){if(this.cellRange.from.isEqual(e))return this.cellRange.from=r,!0;if(this.cellRange.to.isEqual(e))return this.cellRange.to=r,!0}return!1}clear(){return this.cellRange=null,this}getCorners(){const e=this.cellRange.getOuterTopStartCorner(),r=this.cellRange.getOuterBottomEndCorner();return[e.row,e.col,r.row,r.col]}destroy(){this.runLocalHooks("destroy")}}Vt(mF,Qn);const Mne=mF,pF="active-header",ix="header",sx="area",ox="focus",One="fill",Ine="row",Pne="column",Dne="custom-selection",ax=Object.freeze({width:"6px",height:"6px",borderWidth:"1px",borderStyle:"solid",borderColor:"#FFF"});var kne=JH;kne("flat");function Nne(t,e){wF(t,e),e.add(t)}function A_(t,e,r){wF(t,e),e.set(t,r)}function wF(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ov(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function wr(t,e){var r=vF(t,e,"get");return Hne(t,r)}function Hne(t,e){return e.get?e.get.call(t):e.value}function M_(t,e,r){var n=vF(t,e,"set");return Fne(t,n,r),r}function vF(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function Fne(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}var zi=new WeakMap,Vn=new WeakMap,Sg=new WeakSet;class Lne{constructor(){Nne(this,Sg),A_(this,zi,{writable:!0,value:void 0}),A_(this,Vn,{writable:!0,value:void 0})}setActiveOverlay(e){return M_(this,Vn,e),this}setActiveSelection(e){return M_(this,zi,e),this}scan(){const e=wr(this,zi).settings.selectionType,r=new Set;return e==="active-header"?(this.scanColumnsInHeadersRange(n=>r.add(n)),this.scanRowsInHeadersRange(n=>r.add(n))):e==="area"?this.scanCellsRange(n=>r.add(n)):e==="focus"?(this.scanColumnsInHeadersRange(n=>r.add(n)),this.scanRowsInHeadersRange(n=>r.add(n)),this.scanCellsRange(n=>r.add(n))):e==="fill"?this.scanCellsRange(n=>r.add(n)):e==="header"?(this.scanColumnsInHeadersRange(n=>r.add(n)),this.scanRowsInHeadersRange(n=>r.add(n))):e==="row"?(this.scanRowsInHeadersRange(n=>r.add(n)),this.scanRowsInCellsRange(n=>r.add(n))):e==="column"&&(this.scanColumnsInHeadersRange(n=>r.add(n)),this.scanColumnsInCellsRange(n=>r.add(n))),r}scanColumnsInHeadersRange(e){const[r,n,i,s]=wr(this,zi).getCorners(),{wtTable:o}=wr(this,Vn),a=o.getRenderedColumnsCount(),l=o.getColumnHeadersCount();let c=0;for(let u=-o.getRowHeadersCount();u<a;u++){const h=o.columnFilter.renderedToSource(u);if(!(h<n||h>s)){for(let d=-l;d<0;d++){if(d<r||d>i)continue;const f=d+l;let g=o.getColumnHeader(h,f);const m=wr(this,Vn).getSetting("onBeforeHighlightingColumnHeader",h,f,{selectionType:wr(this,zi).settings.selectionType,columnCursor:c,selectionWidth:s-n+1});m!==null&&(m!==h&&(g=o.getColumnHeader(m,f)),e(g))}c+=1}}}scanRowsInHeadersRange(e){const[r,n,i,s]=wr(this,zi).getCorners(),{wtTable:o}=wr(this,Vn),a=o.getRenderedRowsCount(),l=o.getRowHeadersCount();let c=0;for(let u=-o.getColumnHeadersCount();u<a;u++){const h=o.rowFilter.renderedToSource(u);if(!(h<r||h>i)){for(let d=-l;d<0;d++){if(d<n||d>s)continue;const f=d+l;let g=o.getRowHeader(h,f);const m=wr(this,Vn).getSetting("onBeforeHighlightingRowHeader",h,f,{selectionType:wr(this,zi).settings.selectionType,rowCursor:c,selectionHeight:i-r+1});m!==null&&(m!==h&&(g=o.getRowHeader(m,f)),e(g))}c+=1}}}scanCellsRange(e){const[r,n,i,s]=wr(this,zi).getCorners(),{wtTable:o}=wr(this,Vn);ov(this,Sg,av).call(this,(a,l)=>{if(a>=r&&a<=i&&l>=n&&l<=s){const c=o.getCell(wr(this,Vn).createCellCoords(a,l)),u=wr(this,Vn).getSetting("onAfterDrawSelection",a,l,wr(this,zi).settings.layerLevel);typeof u=="string"&&be(c,u),e(c)}})}scanRowsInCellsRange(e){const[r,,n]=wr(this,zi).getCorners(),{wtTable:i}=wr(this,Vn);ov(this,Sg,av).call(this,(s,o)=>{if(s>=r&&s<=n){const a=i.getCell(wr(this,Vn).createCellCoords(s,o));e(a)}})}scanColumnsInCellsRange(e){const[,r,,n]=wr(this,zi).getCorners(),{wtTable:i}=wr(this,Vn);ov(this,Sg,av).call(this,(s,o)=>{if(o>=r&&o<=n){const a=i.getCell(wr(this,Vn).createCellCoords(s,o));e(a)}})}}function av(t){const{wtTable:e}=wr(this,Vn),r=e.getRenderedRowsCount(),n=e.getRenderedColumnsCount();for(let i=0;i<r;i+=1){const s=e.rowFilter.renderedToSource(i);for(let o=0;o<n;o+=1)t(s,e.columnFilter.renderedToSource(o))}}class $ne{constructor(e,r){!r||(this.eventManager=e.eventManager,this.instance=e,this.wot=e,this.settings=r,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=ax,this.cornerCenterPointOffset=-(parseInt(this.cornerDefaultStyle.width,10)/2),this.corner=null,this.cornerStyle=null,this.createBorders(r),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 r=0,n=this.main.childNodes.length;r<n;r++){const i=this.main.childNodes[r];this.eventManager.addEventListener(i,"mouseenter",s=>this.onMouseEnter(s,this.main.childNodes[r]))}}onMouseDown(){this.mouseDown=!0}onMouseUp(){this.mouseDown=!1}onMouseEnter(e,r){if(!this.mouseDown||!this.wot.getSetting("hideBorderOnMouseDownOver"))return;e.preventDefault(),vs(e);const n=this,i=this.wot.rootDocument.body,s=r.getBoundingClientRect();r.style.display="none";function o(l){if(l.clientY<Math.floor(s.top)||l.clientY>Math.ceil(s.top+s.height)||l.clientX<Math.floor(s.left)||l.clientX>Math.ceil(s.left+s.width))return!0}function a(l){o(l)&&(n.eventManager.removeEventListener(i,"mousemove",a),r.style.display="block")}this.eventManager.addEventListener(i,"mousemove",a)}createBorders(e){const{rootDocument:r}=this.wot;this.main=r.createElement("div");const n=["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=n[a],c=r.createElement("div");c.className=`wtBorder ${this.settings.className||""}`,this.settings[l]&&this.settings[l].hide&&(c.className+=" hidden"),i=c.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(c)}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(" "),Ea()&&this.createMultipleSelectorHandles(),this.disappear();const{wtTable:s}=this.wot;let o=s.bordersHolder;o||(o=r.createElement("div"),o.className="htBorders",s.bordersHolder=o,s.spreader.appendChild(o)),o.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 r=10,n=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:`${n}px`,width:`${n}px`,"border-radius":`${parseInt(n/1.5,10)}px`};dt(i,(o,a)=>{this.selectionHandles.styles.bottomHitArea[a]=o,this.selectionHandles.styles.topHitArea[a]=o});const s={position:"absolute",height:`${r}px`,width:`${r}px`,"border-radius":`${parseInt(r/1.5,10)}px`,background:"#F5F5FF",border:"1px solid #4285c8"};dt(s,(o,a)=>{this.selectionHandles.styles.bottom[a]=o,this.selectionHandles.styles.top[a]=o}),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,r){const n=this.wot.selectionManager.getAreaSelection();return!!(n.cellRange&&(e!==n.cellRange.to.row||r!==n.cellRange.to.col))}updateMultipleSelectionHandlesPosition(e,r,n,i,s,o){const l=this.wot.wtSettings.getSetting("rtlMode")?"right":"left",{top:c,topHitArea:u,bottom:h,bottomHitArea:d}=this.selectionHandles.styles,f=parseInt(c.borderWidth,10),g=parseInt(c.width,10),m=parseInt(u.width,10),w=this.wot.wtTable.getWidth(),C=this.wot.wtTable.getHeight();c.top=`${parseInt(n-g-1,10)}px`,c[l]=`${parseInt(i-g-1,10)}px`,u.top=`${parseInt(n-m/4*3,10)}px`,u[l]=`${parseInt(i-m/4*3,10)}px`;const S=Math.min(parseInt(i+s,10),w-g-f*2),v=Math.min(parseInt(i+s-m/4,10),w-m-f*2);h[l]=`${S}px`,d[l]=`${v}px`;const T=Math.min(parseInt(n+o,10),C-g-f*2),A=Math.min(parseInt(n+o-m/4,10),C-m-f*2);h.top=`${T}px`,d.top=`${A}px`,this.settings.border.cornerVisible&&this.settings.border.cornerVisible()?(c.display="block",u.display="block",this.isPartRange(e,r)?(h.display="none",d.display="none"):(h.display="block",d.display="block")):(c.display="none",h.display="none",u.display="none",d.display="none"),e===this.wot.wtSettings.getSetting("fixedRowsTop")||r===this.wot.wtSettings.getSetting("fixedColumnsStart")?(c.zIndex="9999",u.zIndex="9999"):(c.zIndex="",u.zIndex="")}appear(e){if(this.disabled)return;const{wtTable:r,rootDocument:n,rootWindow:i}=this.wot;let s,o,a,l,c,u;const h=r.getRenderedRowsCount();for(let _e=0;_e<h;_e+=1){const p=r.rowFilter.renderedToSource(_e);if(p>=e[0]&&p<=e[2]){s=p,c=e[0];break}}for(let _e=h-1;_e>=0;_e-=1){const p=r.rowFilter.renderedToSource(_e);if(p>=e[0]&&p<=e[2]){o=p;break}}const d=r.getRenderedColumnsCount();for(let _e=0;_e<d;_e+=1){const p=r.columnFilter.renderedToSource(_e);if(p>=e[1]&&p<=e[3]){a=p,u=e[1];break}}for(let _e=d-1;_e>=0;_e-=1){const p=r.columnFilter.renderedToSource(_e);if(p>=e[1]&&p<=e[3]){l=p;break}}if(s===void 0||a===void 0){this.disappear();return}let f=r.getCell(this.wot.createCellCoords(s,a));const g=s!==o||a!==l,m=g?r.getCell(this.wot.createCellCoords(o,l)):f,w=Wr(f),C=g?Wr(m):w,S=Wr(r.TABLE),v=Ht(r.TABLE),T=w.top,A=w.left,M=this.wot.wtSettings.getSetting("rtlMode");let E=0,Y=0;if(M){const _e=Ht(f),p=i.innerWidth-S.left-v;Y=A+_e-C.left,E=i.innerWidth-A-_e-p-1}else Y=C.left+Ht(m)-A,E=A-S.left-1;if(this.isEntireColumnSelected(s,o)){const _e=this.getDimensionsFromHeader("columns",a,l,c,S);let p=null;_e&&([p,E,Y]=_e),p&&(f=p)}let D=T-S.top-1,U=C.top+cr(m)-T;if(this.isEntireRowSelected(a,l)){const _e=this.getDimensionsFromHeader("rows",s,o,u,S);let p=null;_e&&([p,D,U]=_e),p&&(f=p)}const X=Fa(f,i);parseInt(X.borderTopWidth,10)>0&&(D+=1,U=U>0?U-1:0),parseInt(X[M?"borderRightWidth":"borderLeftWidth"],10)>0&&(E+=1,Y=Y>0?Y-1:0);const G=M?"right":"left";this.topStyle.top=`${D}px`,this.topStyle[G]=`${E}px`,this.topStyle.width=`${Y}px`,this.topStyle.display="block",this.startStyle.top=`${D}px`,this.startStyle[G]=`${E}px`,this.startStyle.height=`${U}px`,this.startStyle.display="block";const ae=Math.floor(this.settings.border.width/2);this.bottomStyle.top=`${D+U-ae}px`,this.bottomStyle[G]=`${E}px`,this.bottomStyle.width=`${Y}px`,this.bottomStyle.display="block",this.endStyle.top=`${D}px`,this.endStyle[G]=`${E+Y-ae}px`,this.endStyle.height=`${U+1}px`,this.endStyle.display="block";let ve=this.settings.border.cornerVisible;ve=typeof ve=="function"?ve(this.settings.layerLevel):ve;const me=this.wot.getSetting("onModifyGetCellCoords",o,l);let[Re,Ce]=[o,l];if(me&&Array.isArray(me)&&([,,Re,Ce]=me),Ea()||!ve||this.isPartRange(Re,Ce))this.cornerStyle.display="none";else{this.cornerStyle.top=`${D+U+this.cornerCenterPointOffset-1}px`,this.cornerStyle[G]=`${E+Y+this.cornerCenterPointOffset-1}px`,this.cornerStyle.borderRightWidth=this.cornerDefaultStyle.borderWidth,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.display="none";let _e=Iu(r.TABLE);const p=_e===i;p&&(_e=n.documentElement);const y=parseInt(this.cornerDefaultStyle.width,10)/2,b=parseInt(this.cornerDefaultStyle.height,10)/2;if(l===this.wot.getSetting("totalColumns")-1){const x=p?m.getBoundingClientRect().left:m.offsetLeft;let O=!1,_=0;M?(_=x-parseInt(this.cornerDefaultStyle.width,10)/2,O=_<0):(_=x+Ht(m)+parseInt(this.cornerDefaultStyle.width,10)/2,O=_>=CH(_e)),O&&(this.cornerStyle[G]=`${Math.floor(E+Y+this.cornerCenterPointOffset-y)}px`,this.cornerStyle[M?"borderLeftWidth":"borderRightWidth"]=0)}o===this.wot.getSetting("totalRows")-1&&(p?m.getBoundingClientRect().top:m.offsetTop)+cr(m)+parseInt(this.cornerDefaultStyle.height,10)/2>=gu(_e)&&(this.cornerStyle.top=`${Math.floor(D+U+this.cornerCenterPointOffset-b)}px`,this.cornerStyle.borderBottomWidth=0),this.cornerStyle.display="block"}Ea()&&this.updateMultipleSelectionHandlesPosition(o,l,D,E,Y,U)}isEntireColumnSelected(e,r){return e===this.wot.wtTable.getFirstRenderedRow()&&r===this.wot.wtTable.getLastRenderedRow()}isEntireRowSelected(e,r){return e===this.wot.wtTable.getFirstRenderedColumn()&&r===this.wot.wtTable.getLastRenderedColumn()}getDimensionsFromHeader(e,r,n,i,s){const{wtTable:o}=this.wot,a=o.wtRootElement.parentNode;let l=null,c=null,u=null,h=null,d=null,f=null,g=null,m=null;switch(e){case"rows":l=function(){return o.getRowHeader(...arguments)},c=function(){return cr(...arguments)},u="ht__selection--rows",f="top";break;case"columns":l=function(){return o.getColumnHeader(...arguments)},c=function(){return Ht(...arguments)},u="ht__selection--columns",f="left";break}if(a.classList.contains(u)){const w=this.wot.getSetting("columnHeaders").length;if(g=l(r,w-i),m=l(n,w-i),!g||!m)return!1;const C=Wr(g),S=Wr(m);return g&&m&&(h=C[f]-s[f]-1,d=S[f]+c(m)-C[f]),[g,h,d]}return!1}changeBorderStyle(e,r){const n=this[e].style,i=r[e];!i||i.hide?be(this[e],"hidden"):(Je(this[e],"hidden")&&rt(this[e],"hidden"),n.backgroundColor=i.color,(e==="top"||e==="bottom")&&(n.height=`${i.width}px`),(e==="start"||e==="end")&&(n.width=`${i.width}px`))}changeBorderToDefaultStyle(e){const r={width:1,color:"#000"},n=this[e].style;n.backgroundColor=r.color,n.width=`${r.width}px`,n.height=`${r.width}px`}toggleHiddenClass(e,r){this.changeBorderToDefaultStyle(e),r?be(this[e],"hidden"):rt(this[e],"hidden")}disappear(){this.topStyle.display="none",this.bottomStyle.display="none",this.startStyle.display="none",this.endStyle.display="none",this.cornerStyle.display="none",Ea()&&(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 O_=$ne;function Bne(t,e){CF(t,e),e.add(t)}function Ec(t,e,r){CF(t,e),e.set(t,r)}function CF(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Wne(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function mt(t,e){var r=SF(t,e,"get");return Vne(t,r)}function Vne(t,e){return e.get?e.get.call(t):e.value}function I_(t,e,r){var n=SF(t,e,"set");return Une(t,n,r),r}function SF(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function Une(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}var sn=new WeakMap,zn=new WeakMap,lv=new WeakMap,Qh=new WeakMap,cv=new WeakMap,nl=new WeakMap,P_=new WeakSet;class Gne{constructor(e){Bne(this,P_),Ec(this,sn,{writable:!0,value:void 0}),Ec(this,zn,{writable:!0,value:void 0}),Ec(this,lv,{writable:!0,value:new Lne}),Ec(this,Qh,{writable:!0,value:new WeakMap}),Ec(this,cv,{writable:!0,value:new WeakSet}),Ec(this,nl,{writable:!0,value:new Map}),I_(this,zn,e)}setActiveOverlay(e){return I_(this,sn,e),mt(this,lv).setActiveOverlay(mt(this,sn)),mt(this,Qh).has(mt(this,sn))||mt(this,Qh).set(mt(this,sn),new Set),this}getFocusSelection(){return mt(this,zn)!==null?mt(this,zn).getFocus():null}getAreaSelection(){return mt(this,zn)!==null?mt(this,zn).createLayeredArea():null}getBorderInstance(e){if(!e.settings.border)return null;if(mt(this,nl).has(e)){const n=mt(this,nl).get(e);if(n.has(mt(this,sn)))return n.get(mt(this,sn));const i=new O_(mt(this,sn),e.settings);return n.set(mt(this,sn),i),i}const r=new O_(mt(this,sn),e.settings);return mt(this,nl).set(e,new Map([[mt(this,sn),r]])),r}getBorderInstances(e){var r,n;return Array.from((r=(n=mt(this,nl).get(e))===null||n===void 0?void 0:n.values())!==null&&r!==void 0?r:[])}destroyBorders(e){mt(this,nl).get(e).forEach(r=>r.destroy()),mt(this,nl).delete(e)}render(e){if(mt(this,zn)===null)return;e&&Wne(this,P_,Yne).call(this);const r=Array.from(mt(this,zn)),n=new Map,i=new Map;for(let s=0;s<r.length;s++){const o=r[s],{className:a,headerAttributes:l,createLayers:c,selectionType:u}=o.settings;mt(this,cv).has(o)||(mt(this,cv).add(o),o.addLocalHook("destroy",()=>this.destroyBorders(o)));const h=this.getBorderInstance(o);if(o.isEmpty()){h==null||h.disappear();continue}a&&mt(this,lv).setActiveSelection(o).scan().forEach(g=>{if(n.has(g)){const m=n.get(g);m.has(a)&&c===!0?m.set(a,m.get(a)+1):m.set(a,1)}else n.set(g,new Map([[a,1]]));l&&(i.has(g)||i.set(g,[]),g.nodeName==="TH"&&i.get(g).push(...l))});const d=o.getCorners();mt(this,sn).getSetting("onBeforeDrawBorders",d,u),h==null||h.appear(d)}n.forEach((s,o)=>{var a;const l=Array.from(s).map(c=>{let[u,h]=c;return h===1?u:[u,...Array.from({length:h-1},(d,f)=>`${u}-${f+1}`)]}).flat();l.forEach(c=>mt(this,Qh).get(mt(this,sn)).add(c)),be(o,l),o.nodeName==="TD"&&Array.isArray((a=mt(this,zn).options)===null||a===void 0?void 0:a.cellAttributes)&&qe(o,mt(this,zn).options.cellAttributes)}),Array.from(i.keys()).forEach(s=>{qe(s,[...i.get(s)])})}}function Yne(){const t=mt(this,Qh).get(mt(this,sn)),e=mt(this,sn).wtSettings.getSetting("onBeforeRemoveCellClassNames");if(Array.isArray(e))for(let r=0;r<e.length;r++)t.add(e[r]);t.forEach(r=>{var n,i;const s=mt(this,sn).wtTable.TABLE.querySelectorAll(`.${r}`);let o=[];Array.isArray((n=mt(this,zn).options)===null||n===void 0?void 0:n.cellAttributes)&&(o=mt(this,zn).options.cellAttributes.map(a=>a[0])),Array.isArray((i=mt(this,zn).options)===null||i===void 0?void 0:i.headerAttributes)&&(o=[...o,...mt(this,zn).options.headerAttributes.map(a=>a[0])]);for(let a=0,l=s.length;a<l;a++)rt(s[a],r),Uu(s[a],o)}),t.clear()}class zne extends xf{constructor(e,r,n,i){super(e,r,Zl,n,i)}createTable(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return new _ne(...r)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){const{wtTable:e}=this.wot;if(!this.needFullRender||!e.holder.parentNode)return!1;const{rootWindow:r}=this.domBindings,n=this.clone.wtTable.holder.parentNode,i=this.wtSettings.getSetting("preventOverflow");let s=0;this.trimmingContainer===r&&(!i||i!=="horizontal")?(s=this.getOverlayOffset()*(this.isRtl()?-1:1),$y(n,`${s}px`,"0px")):(s=this.getScrollPosition(),_p(n));const o=this.adjustHeaderBordersPosition(s);return this.adjustElementsSize(),o}setScrollPosition(e){const{rootWindow:r}=this.domBindings;let n=!1;return this.isRtl()&&(e=-e),this.mainTableScrollableElement===r&&r.scrollX!==e?(r.scrollTo(e,wH(r)),n=!0):this.mainTableScrollableElement.scrollLeft!==e&&(this.mainTableScrollableElement.scrollLeft=e,n=!0),n}onScroll(){this.wtSettings.getSetting("onScrollVertically")}sumCellSizes(e,r){const n=this.wtSettings.getSetting("defaultColumnWidth");let i=e,s=0;for(;i<r;)s+=this.wot.wtTable.getStretchedColumnWidth(i)||n,i+=1;return s}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:r,rootWindow:n}=this.domBindings,i=Ur(r),o=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==n||a==="vertical"){let c=this.wot.wtViewport.getWorkspaceHeight();this.wot.wtOverlays.hasScrollbarBottom&&(c-=i),c=Math.min(c,e.wtRootElement.scrollHeight),o.height=`${c}px`}else o.height="";this.clone.wtTable.holder.style.height=o.height;const l=Ht(this.clone.wtTable.TABLE);o.width=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,r=this.wot.selectionManager.getFocusSelection()?parseInt(ax.width,10)/2:0;this.clone.wtTable.hider.style.height=this.hider.style.height,e.style.height=e.parentNode.style.height,e.style.width=`${parseInt(e.parentNode.style.width,10)+r}px`}applyToDOM(){const e=this.wtSettings.getSetting("totalColumns"),r=this.isRtl()?"right":"left";if(typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number")this.spreader.style[r]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style[r]="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,r){let n=this.getTableParentOffset();const s=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder;let o=0;if(r){const a=this.wot.wtTable.getColumnWidth(e),l=this.wot.wtViewport.getViewportWidth();a>l&&(r=!1)}return r&&s.offsetWidth!==s.clientWidth&&(o=Ur(this.domBindings.rootDocument)),r?(n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportWidth()):n+=this.sumCellSizes(this.wtSettings.getSetting("fixedColumnsStart"),e),n+=o,this.setScrollPosition(n)}getTableParentOffset(){const e=this.wtSettings.getSetting("preventOverflow");let r=0;return!e&&this.trimmingContainer===this.domBindings.rootWindow&&(r=this.wot.wtTable.holderOffset.left),r}getScrollPosition(){return Math.abs(vH(this.mainTableScrollableElement,this.domBindings.rootWindow))}getOverlayOffset(){const{rootWindow:e}=this.domBindings,r=this.wtSettings.getSetting("preventOverflow");let n=0;if(this.trimmingContainer===e&&(!r||r!=="horizontal")){this.isRtl()?n=Math.abs(Math.min(this.getTableParentOffset()-this.getScrollPosition(),0)):n=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0);const i=this.wot.wtTable.getTotalWidth(),s=this.clone.wtTable.getTotalWidth(),o=i-s;n>o&&(n=0)}return n}adjustHeaderBordersPosition(e){const r=this.wot.wtTable.holder.parentNode,n=this.wtSettings.getSetting("rowHeaders"),i=this.wtSettings.getSetting("fixedColumnsStart");this.wtSettings.getSetting("totalRows")?rt(r,"emptyRows"):be(r,"emptyRows");let o=!1;if(i&&!n.length)be(r,"innerBorderLeft innerBorderInlineStart");else if(!i&&n.length){const a=Je(r,"innerBorderInlineStart");e?(be(r,"innerBorderLeft innerBorderInlineStart"),o=!a):(rt(r,"innerBorderLeft innerBorderInlineStart"),o=a)}return o}}const jne="stickyRowsTop",yF={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}};zo(yF,"MIXIN_NAME",jne,{writable:!1,enumerable:!1});const xF=yF;class lx extends Yu{constructor(e,r,n,i){super(e,r,n,i,Jl)}}Vt(lx,xF);Vt(lx,Jy);const Kne=lx;function D_(t,e,r){return e=Xne(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xne(t){var e=qne(t,"string");return typeof e=="symbol"?e:String(e)}function qne(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Zne extends xf{constructor(e,r,n,i,s,o){super(e,r,Jl,n,i),D_(this,"topOverlay",void 0),D_(this,"inlineStartOverlay",void 0),this.topOverlay=s,this.inlineStartOverlay=o}createTable(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return new Kne(...r)}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),s=this.topOverlay.getOverlayOffset();$y(e,`${i}px`,`${s}px`)}else _p(e);let r=cr(this.clone.wtTable.TABLE);const n=Ht(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(r=0),e.style.height=`${r}px`,e.style.width=`${n}px`,!1}}class cx extends Yu{constructor(e,r,n,i){super(e,r,n,i,ql)}}Vt(cx,xF);Vt(cx,tx);const Jne=cx;function Qne(t,e,r){return e=eie(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function eie(t){var e=tie(t,"string");return typeof e=="symbol"?e:String(e)}function tie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class rie extends xf{constructor(e,r,n,i){super(e,r,ql,n,i),Qne(this,"cachedFixedRowsTop",-1),this.cachedFixedRowsTop=this.wtSettings.getSetting("fixedRowsTop")}createTable(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return new Jne(...r)}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:r}=this.domBindings,n=this.wtSettings.getSetting("preventOverflow");let i=0,s=!1;if(this.trimmingContainer===r&&(!n||n!=="vertical")){const{wtTable:a}=this.wot,l=a.hider.getBoundingClientRect(),c=Math.ceil(l.bottom),u=e.offsetHeight;s=c===u,i=this.getOverlayOffset(),$y(e,"0px",`${i}px`)}else i=this.getScrollPosition(),_p(e);const o=this.adjustHeaderBordersPosition(i,s);return this.adjustElementsSize(),o}setScrollPosition(e){const r=this.domBindings.rootWindow;let n=!1;return this.mainTableScrollableElement===r&&r.scrollY!==e?(r.scrollTo(Fy(r),e),n=!0):this.mainTableScrollableElement.scrollTop!==e&&(this.mainTableScrollableElement.scrollTop=e,n=!0),n}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,r){const n=this.wtSettings.getSetting("defaultRowHeight");let i=e,s=0;for(;i<r;){const o=this.wot.wtTable.getRowHeight(i);s+=o===void 0?n:o,i+=1}return s}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:r,rootWindow:n}=this.domBindings,i=Ur(r),o=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==n||a==="horizontal"){let c=this.wot.wtViewport.getWorkspaceWidth();this.wot.wtOverlays.hasScrollbarRight&&(c-=i),c=Math.min(c,e.wtRootElement.scrollWidth),o.width=`${c}px`}else o.width="";this.clone.wtTable.holder.style.width=o.width;let l=cr(this.clone.wtTable.TABLE);this.wot.wtTable.hasDefinedSize()||(l=0),o.height=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,r=this.wot.selectionManager.getFocusSelection()?parseInt(ax.height,10)/2:0;this.clone.wtTable.hider.style.width=this.hider.style.width,e.style.width=e.parentNode.style.width,e.style.height=`${parseInt(e.parentNode.style.height,10)+r}px`}applyToDOM(){const e=this.wtSettings.getSetting("totalRows");if(typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number")this.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style.top="0";else throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){const e=this.isRtl()?"right":"left",{spreader:r}=this.clone.wtTable;typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number"?r.style[e]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:r.style[e]=""}scrollTo(e,r){const{wot:n,wtSettings:i}=this,o=(n.cloneSource?n.cloneSource:n).wtTable.holder;let a=this.getTableParentOffset(),l=0;if(r){const c=this.wot.wtTable.getRowHeight(e),u=this.wot.wtViewport.getViewportHeight();c>u&&(r=!1)}if(r&&o.offsetHeight!==o.clientHeight&&(l=Ur(this.domBindings.rootDocument)),r){const c=i.getSetting("fixedRowsBottom"),u=i.getSetting("totalRows");a+=this.sumCellSizes(0,e+1),a-=n.wtViewport.getViewportHeight()-this.sumCellSizes(u-c,u),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 Ly(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,r=this.wtSettings.getSetting("preventOverflow");let n=0;if(this.trimmingContainer===e&&(!r||r!=="vertical")){const i=this.wot.wtTable.getTotalHeight(),s=this.clone.wtTable.getTotalHeight(),o=i-s;n=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0),n>o&&(n=0)}return n}adjustHeaderBordersPosition(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const n=this.wot.wtTable.holder.parentNode;this.wtSettings.getSetting("totalColumns")?rt(n,"emptyColumns"):be(n,"emptyColumns");let s=!1;if(!r){const o=this.wtSettings.getSetting("fixedRowsTop"),a=this.cachedFixedRowsTop!==o,l=this.wtSettings.getSetting("columnHeaders");if((a||o===0)&&l.length>0){const c=Je(n,"innerBorderTop");this.cachedFixedRowsTop=this.wtSettings.getSetting("fixedRowsTop"),e||this.wtSettings.getSetting("totalRows")===0?(be(n,"innerBorderTop"),s=!c):(rt(n,"innerBorderTop"),s=c)}}return s}}function lo(t,e,r){return e=nie(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function nie(t){var e=iie(t,"string");return typeof e=="symbol"?e:String(e)}function iie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class sie{constructor(e,r,n,i,s,o){lo(this,"wot",null),lo(this,"topOverlay",null),lo(this,"bottomOverlay",null),lo(this,"inlineStartOverlay",null),lo(this,"topInlineStartCornerOverlay",null),lo(this,"bottomInlineStartCornerOverlay",null),lo(this,"browserLineHeight",void 0),lo(this,"wtSettings",null),lo(this,"resizeObserver",new ResizeObserver(u=>{Uy(()=>{!Array.isArray(u)||!u.length||this.wtSettings.getSetting("onContainerElementResize")})})),this.wot=e,this.wtSettings=i,this.domBindings=n,this.facadeGetter=r,this.wtTable=o;const{rootDocument:a,rootWindow:l}=this.domBindings;this.instance=this.wot,this.eventManager=s,this.scrollbarSize=Ur(a);const c=l.getComputedStyle(o.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden";this.scrollableElement=c?o.holder:Cm(o.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 r=[this.topOverlay,this.topInlineStartCornerOverlay,this.inlineStartOverlay,this.bottomOverlay,this.bottomInlineStartCornerOverlay];return e&&r.push(this.wtTable),r}initBrowserLineHeight(){const{rootWindow:e,rootDocument:r}=this.domBindings,n=e.getComputedStyle(r.body),i=parseInt(n.lineHeight,10),s=parseInt(n.fontSize,10)*1.2;this.browserLineHeight=i||s}initOverlays(){const e=[this.wot,this.facadeGetter,this.wtSettings,this.domBindings];this.topOverlay=new rie(...e),this.bottomOverlay=new Rne(...e),this.inlineStartOverlay=new zne(...e),this.topInlineStartCornerOverlay=new Zne(...e,this.topOverlay,this.inlineStartOverlay),this.bottomInlineStartCornerOverlay=new Cne(...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:r}=this.domBindings,{mainTableScrollableElement:n}=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(n,"scroll",h=>this.onTableScroll(h),{passive:!0}),n!==i&&this.eventManager.addEventListener(i,"scroll",h=>this.onTableScroll(h),{passive:!0});const s=r.devicePixelRatio&&r.devicePixelRatio>1,o=this.scrollableElement===r,a=this.wtSettings.getSetting("preventWheel"),l={passive:o};(a||s||!IH())&&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",f=>this.onCloneWheel(f,a),l)}});let u;this.eventManager.addEventListener(r,"resize",()=>{clearTimeout(u),u=setTimeout(()=>{this.wtSettings.getSetting("onWindowResize")},200)}),o||this.resizeObserver.observe(this.wtTable.wtRootElement.parentElement)}deregisterListeners(){this.eventManager.clearEvents(!0)}onTableScroll(e){const r=this.domBindings.rootWindow,n=this.inlineStartOverlay.mainTableScrollableElement,i=this.topOverlay.mainTableScrollableElement,s=e.target;this.keyPressed&&(i!==r&&s!==r&&!e.target.contains(i)||n!==r&&s!==r&&!e.target.contains(n))||this.syncScrollPositions(e)}onCloneWheel(e,r){const{rootWindow:n}=this.domBindings,i=this.inlineStartOverlay.mainTableScrollableElement,s=this.topOverlay.mainTableScrollableElement,o=e.target,a=s!==n&&o!==n&&!o.contains(s),l=i!==n&&o!==n&&!o.contains(i);if(this.keyPressed&&(a||l))return;const c=this.translateMouseWheelToScroll(e);(r||this.scrollableElement!==n&&c)&&e.preventDefault()}onKeyDown(e){this.keyPressed=Cf(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")}onKeyUp(){this.keyPressed=!1}translateMouseWheelToScroll(e){let r=isNaN(e.deltaY)?-1*e.wheelDeltaY:e.deltaY,n=isNaN(e.deltaX)?-1*e.wheelDeltaX:e.deltaX;e.deltaMode===1&&(n+=n*this.browserLineHeight,r+=r*this.browserLineHeight);const i=this.scrollVertically(r),s=this.scrollHorizontally(n);return i||s}scrollVertically(e){const r=this.scrollableElement.scrollTop;return this.scrollableElement.scrollTop+=e,r!==this.scrollableElement.scrollTop}scrollHorizontally(e){const r=this.scrollableElement.scrollLeft;return this.scrollableElement.scrollLeft+=e,r!==this.scrollableElement.scrollLeft}syncScrollPositions(){if(this.destroyed)return;const{rootWindow:e}=this.domBindings,r=this.topOverlay.clone.wtTable.holder,n=this.inlineStartOverlay.clone.wtTable.holder,[i,s]=[this.scrollableElement.scrollLeft,this.scrollableElement.scrollTop];if(this.horizontalScrolling=r.scrollLeft!==i||this.lastScrollX!==e.scrollX,this.verticalScrolling=n.scrollTop!==s||this.lastScrollY!==e.scrollY,this.lastScrollX=e.scrollX,this.lastScrollY=e.scrollY,this.horizontalScrolling){r.scrollLeft=i;const o=this.bottomOverlay.needFullRender?this.bottomOverlay.clone.wtTable.holder:null;o&&(o.scrollLeft=i)}this.verticalScrolling&&(n.scrollTop=s),this.refreshAll()}syncScrollWithMaster(){const e=this.topOverlay.mainTableScrollableElement,{scrollLeft:r,scrollTop:n}=e;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=r),this.bottomOverlay.needFullRender&&(this.bottomOverlay.clone.wtTable.holder.scrollLeft=r),this.inlineStartOverlay.needFullRender&&(this.inlineStartOverlay.clone.wtTable.holder.scrollTop=n)}updateMainScrollableElements(){this.deregisterListeners(),this.inlineStartOverlay.updateMainScrollableElement(),this.topOverlay.updateMainScrollableElement(),this.bottomOverlay.needFullRender&&this.bottomOverlay.updateMainScrollableElement();const{wtTable:e}=this,{rootWindow:r}=this.domBindings;r.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden"?this.scrollableElement=e.holder:this.scrollableElement=Cm(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,r=e.clientWidth,n=e.clientHeight,i=r!==this.spreaderLastSize.width||n!==this.spreaderLastSize.height;return i&&(this.spreaderLastSize.width=r,this.spreaderLastSize.height=n),i}adjustElementsSize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{wtViewport:r}=this.wot,{wtTable:n}=this,i=this.wtSettings.getSetting("totalColumns"),s=this.wtSettings.getSetting("totalRows"),o=r.getRowHeaderWidth(),a=r.getColumnHeaderHeight(),l=n.hider.style;if(l.width=`${o+this.inlineStartOverlay.sumCellSizes(0,i)}px`,l.height=`${a+this.topOverlay.sumCellSizes(0,s)+1}px`,this.scrollbarSize>0){const{scrollHeight:c,scrollWidth:u}=n.wtRootElement,{scrollHeight:h,scrollWidth:d}=n.holder;this.hasScrollbarRight=c<h,this.hasScrollbarBottom=u<d,this.hasScrollbarRight&&n.hider.scrollWidth+this.scrollbarSize>u?this.hasScrollbarBottom=!0:this.hasScrollbarBottom&&n.hider.scrollHeight+this.scrollbarSize>c&&(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 r=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];let n=null;return j(r,i=>{!i||i.clone&&i.clone.wtTable.TABLE.contains(e)&&(n=i.clone)}),n}syncOverlayTableClassNames(){const e=this.wtTable.TABLE,r=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];j(r,n=>{!n||(n.clone.wtTable.TABLE.className=e.className)})}}const oie=sie;function k_(t,e,r){return e=aie(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function aie(t){var e=lie(t,"string");return typeof e=="symbol"?e:String(e)}function lie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class cie{constructor(e){k_(this,"settings",{}),k_(this,"defaults",Object.freeze(this.getDefaults())),dt(this.defaults,(r,n)=>{if(e[n]!==void 0)this.settings[n]=e[n];else{if(r===void 0)throw new Error(`A required setting "${n}" was not provided`);this.settings[n]=r}})}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,r,n)=>{const i=this.getSetting("data",e,r);jl(n,i==null?"":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,r){return r===void 0?dt(e,(n,i)=>{this.settings[i]=n}):this.settings[e]=r,this}getSetting(e,r,n,i,s){return typeof this.settings[e]=="function"?this.settings[e](r,n,i,s):r!==void 0&&Array.isArray(this.settings[e])?this.settings[e][r]:this.settings[e]}getSettingPure(e){return this.settings[e]}has(e){return!!this.settings[e]}}class ux extends Yu{constructor(e,r,n,i){super(e,r,n,i,"master")}alignOverlaysWithTrimmingContainer(){const e=Iu(this.wtRootElement),{rootWindow:r}=this.domBindings;if(e===r)this.wtSettings.getSetting("preventOverflow")||(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible");else{const n=e.parentElement,i=Yd(e,"height",r),s=Yd(e,"overflow",r),o=this.holder.style,{scrollWidth:a,scrollHeight:l}=e;let c=e.offsetWidth,u=e.offsetHeight;if(n&&["auto","hidden","scroll"].includes(s)){const d=e.cloneNode(!1);d.style.overflow="auto",d.style.position="absolute",e.nextElementSibling?n.insertBefore(d,e.nextElementSibling):n.appendChild(d);const f=parseInt(Fa(d,r).height,10);n.removeChild(d),f===0&&(u=0)}u=Math.min(u,l),o.height=i==="auto"?"auto":`${u}px`,c=Math.min(c,a),o.width=`${c}px`,o.overflow="",this.hasTableHeight=o.height==="auto"?!0:u>0,this.hasTableWidth=c>0}this.isTableVisible=Kl(this.TABLE)}markOversizedColumnHeaders(){const{wtSettings:e}=this,{wtViewport:r}=this.dataAccessObject,n="master",s=e.getSetting("columnHeaders").length;if(s&&!r.hasOversizedColumnHeadersMarked[n]){const a=e.getSetting("rowHeaders").length,l=this.getRenderedColumnsCount();for(let c=0;c<s;c++)for(let u=-1*a;u<l;u++)this.markIfOversizedColumnHeader(u);r.hasOversizedColumnHeadersMarked[n]=!0}}}Vt(ux,fF);Vt(ux,tx);const uie=ux;class hie{constructor(e,r,n,i,s){this.dataAccessObject=e,this.wot=e.wot,this.instance=this.wot,this.domBindings=r,this.wtSettings=n,this.wtTable=s,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,r=this.dataAccessObject.topOverlayTrimmingContainer;let n=0;return r===this.domBindings.rootWindow?n=e.documentElement.clientHeight:n=cr(r)>0&&r.clientHeight>0?r.clientHeight:1/0,n}getWorkspaceWidth(){const{wtSettings:e}=this,{rootDocument:r,rootWindow:n}=this.domBindings,i=this.dataAccessObject.inlineStartOverlayTrimmingContainer,s=r.documentElement.offsetWidth,o=e.getSetting("totalColumns"),a=e.getSetting("preventOverflow"),l=e.getSetting("rtlMode"),c=this.wtTable.TABLE.getBoundingClientRect(),u=l?c.right-s:c.left,h=s-u;let d,f;if(a)return Ht(this.wtTable.wtRootElement);if(e.getSetting("freezeOverlays")?d=Math.min(h,s):d=Math.min(this.getContainerFillWidth(),h,s),i===n&&o>0&&this.sumColumnWidths(0,o-1)>d)return r.documentElement.clientWidth;if(i!==n&&(f=Yd(this.dataAccessObject.inlineStartOverlayTrimmingContainer,"overflow",n),f==="scroll"||f==="hidden"||f==="auto"))return Math.max(d,i.clientWidth);const g=e.getSetting("stretchH");return g==="none"||!g?Math.max(d,Ht(this.wtTable.TABLE)):d}hasVerticalScroll(){return this.wtTable.hider.offsetHeight>this.getWorkspaceHeight()}hasHorizontalScroll(){return this.wtTable.hider.offsetWidth>this.getWorkspaceWidth()}sumColumnWidths(e,r){let n=0,i=e;for(;i<r;)n+=this.wtTable.getColumnWidth(i),i+=1;return n}getContainerFillWidth(){if(this.containerWidth)return this.containerWidth;const e=this.wtTable.holder,r=this.domBindings.rootDocument.createElement("div");r.style.width="100%",r.style.height="1px",e.appendChild(r);const n=r.offsetWidth;return this.containerWidth=n,e.removeChild(r),n}getWorkspaceOffset(){return Wr(this.wtTable.TABLE)}getColumnHeaderHeight(){return this.wtSettings.getSetting("columnHeaders").length?isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=cr(this.wtTable.THEAD)):this.columnHeaderHeight=0,this.columnHeaderHeight}getViewportHeight(){let e=this.getWorkspaceHeight();if(e===1/0)return e;const r=this.getColumnHeaderHeight();return r>0&&(e-=r),e}getRowHeaderWidth(){const e=this.wtSettings.getSetting("rowHeaderWidth"),r=this.wtSettings.getSetting("rowHeaders");if(e){this.rowHeaderWidth=0;for(let n=0,i=r.length;n<i;n++)this.rowHeaderWidth+=e[n]||e}if(isNaN(this.rowHeaderWidth))if(r.length){let n=this.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(let i=0,s=r.length;i<s;i++)n?(this.rowHeaderWidth+=Ht(n),n=n.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 r=this.getRowHeaderWidth();return r>0?e-r:e}createRowsCalculator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:da;const{wtSettings:r,wtTable:n}=this;if(r.getSetting("renderAllRows")&&e===da)return new tte({totalRows:r.getSetting("totalRows")});let i=this.getViewportHeight(),s,o;this.rowHeaderWidth=NaN;let a=this.dataAccessObject.topScrollPosition-this.dataAccessObject.topParentOffset;const l=r.getSetting("fixedRowsTop"),c=r.getSetting("fixedRowsBottom"),u=r.getSetting("totalRows");return l&&a>=0&&(o=this.dataAccessObject.topOverlay.sumCellSizes(0,l),a+=o,i-=o),c&&this.dataAccessObject.bottomOverlay.clone&&(o=this.dataAccessObject.bottomOverlay.sumCellSizes(u-c,u),i-=o),n.holder.clientHeight===n.holder.offsetHeight?s=0:s=Ur(this.domBindings.rootDocument),new Ip({viewportHeight:i,scrollOffset:a,totalRows:r.getSetting("totalRows"),rowHeightFn:h=>n.getRowHeight(h),overrideFn:r.getSettingPure("viewportRowCalculatorOverride"),calculationType:e,horizontalScrollbarHeight:s})}createColumnsCalculator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:da;const{wtSettings:r,wtTable:n}=this;if(r.getSetting("renderAllColumns")&&e===da)return new Jee({totalColumns:r.getSetting("totalColumns")});let i=this.getViewportWidth(),s=Math.abs(this.dataAccessObject.inlineStartScrollPosition)-this.dataAccessObject.inlineStartParentOffset;this.columnHeaderHeight=NaN;const o=r.getSetting("fixedColumnsStart");if(o&&s>=0){const a=this.dataAccessObject.inlineStartOverlay.sumCellSizes(0,o);s+=a,i-=a}return n.holder.clientWidth!==n.holder.offsetWidth&&(i-=Ur(this.domBindings.rootDocument)),new Sf({viewportWidth:i,scrollOffset:s,totalColumns:r.getSetting("totalColumns"),columnWidthFn:a=>n.getColumnWidth(a),overrideFn:r.getSettingPure("viewportColumnCalculatorOverride"),calculationType:e,inlineStartOffset:this.dataAccessObject.inlineStartParentOffset})}createRenderCalculators(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{wtSettings:r}=this;if(e&&!r.getSetting("renderAllRows")){const n=this.createRowsCalculator(an);e=this.areAllProposedVisibleRowsAlreadyRendered(n)}if(e&&!r.getSetting("renderAllColumns")){const n=this.createColumnsCalculator(an);e=this.areAllProposedVisibleColumnsAlreadyRendered(n)}return e||(this.rowsRenderCalculator=this.createRowsCalculator(da),this.columnsRenderCalculator=this.createColumnsCalculator(da)),this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,e}createVisibleCalculators(){this.rowsVisibleCalculator=this.createRowsCalculator(an),this.columnsVisibleCalculator=this.createColumnsCalculator(an)}areAllProposedVisibleRowsAlreadyRendered(e){if(!this.rowsVisibleCalculator)return!1;const{startRow:r,endRow:n,isVisibleInTrimmingContainer:i}=e;if(r===null&&n===null)return!i;const{startRow:s,endRow:o}=this.rowsRenderCalculator;return r<s||r===s&&r>0?!1:!(n>o||n===o&&n<this.wtSettings.getSetting("totalRows")-1)}areAllProposedVisibleColumnsAlreadyRendered(e){if(!this.columnsVisibleCalculator)return!1;const{startColumn:r,endColumn:n,isVisibleInTrimmingContainer:i}=e;if(r===null&&n===null)return!i;const{startColumn:s,endColumn:o}=this.columnsRenderCalculator;return r<s||r===s&&r>0?!1:!(n>o||n===o&&n<this.wtSettings.getSetting("totalColumns")-1)}resetHasOversizedColumnHeadersMarked(){dt(this.hasOversizedColumnHeadersMarked,(e,r,n)=>{n[r]=void 0})}}const die=hie;class fie extends ex{constructor(e,r){super(e,new cie(r));const n=this.wtSettings.getSetting("facade",this);this.wtTable=new uie(this.getTableDao(),n,this.domBindings,this.wtSettings),this.wtViewport=new die(this.getViewportDao(),this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.selectionManager=new Gne(this.wtSettings.getSetting("selections")),this.wtEvent=new iF(n,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager),this.wtOverlays=new oie(this,n,this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.exportSettingsAsClassNames(),this.findOriginalHeaders()}exportSettingsAsClassNames(){const e={rowHeaders:"htRowHeaders",columnHeaders:"htColumnHeaders"},r=[],n=[];dt(e,(i,s)=>{this.wtSettings.getSetting(s).length&&n.push(i),r.push(i)}),rt(this.wtTable.wtRootElement.parentNode,r),be(this.wtTable.wtRootElement.parentNode,n)}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 hx{constructor(e){e instanceof ex?this._wot=e:this._initFromSettings(e)}_initFromSettings(e){e.facade=r=>{const n=new hx(r);return()=>n},this._wot=new fie(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,r){return this._wot.createCellCoords(e,r)}createCellRange(e,r,n){return this._wot.createCellRange(e,r,n)}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this._wot.draw(e),this}getCell(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this._wot.getCell(e,r)}scrollViewport(e,r,n,i,s){return this._wot.scrollViewport(e,r,n,i,s)}scrollViewportHorizontally(e,r,n){return this._wot.scrollViewportHorizontally(e,r,n)}scrollViewportVertically(e,r,n){return this._wot.scrollViewportVertically(e,r,n)}getViewport(){return this._wot.getViewport()}getOverlayName(){return this._wot.cloneOverlay?this._wot.cloneOverlay.type:"master"}exportSettingsAsClassNames(){return this._wot.exportSettingsAsClassNames()}update(e,r){return this._wot.wtSettings.update(e,r),this}getSetting(e,r,n,i,s){return this._wot.wtSettings.getSetting(e,r,n,i,s)}hasSetting(e){return this._wot.wtSettings.hasSetting(e)}destroy(){this._wot.destroy()}}function N_(t){let{isShiftKey:e,isLeftClick:r,isRightClick:n,coords:i,selection:s,controller:o,cellCoordsFactory:a}=t;const l=s.isSelected()?s.getSelectedRange().current():null,c=s.isSelectedByCorner(),u=s.isSelectedByRowHeader();if(e&&l)i.row>=0&&i.col>=0&&!o.cell?s.setRangeEnd(i):(c||u)&&i.row>=0&&i.col>=0&&!o.cell?s.setRangeEnd(a(i.row,i.col)):c&&i.row<0&&!o.column?s.setRangeEnd(a(l.to.row,i.col)):u&&i.col<0&&!o.row?s.setRangeEnd(a(i.row,l.to.col)):(!c&&!u&&i.col<0||c&&i.col<0)&&!o.row?s.selectRows(Math.max(l.from.row,0),i.row,i.col):(!c&&!u&&i.row<0||u&&i.row<0)&&!o.column&&s.selectColumns(Math.max(l.from.col,0),i.col,i.row);else{const h=!s.inInSelection(i),d=r||n&&h;i.row<0&&i.col>=0&&!o.column?d&&s.selectColumns(i.col,i.col,i.row):i.col<0&&i.row>=0&&!o.row?d&&s.selectRows(i.row,i.row,i.col):i.col>=0&&i.row>=0&&!o.cell?d&&s.setRangeStart(i):i.col<0&&i.row<0&&s.selectAll(!0,!0,{disableHeadersHighlight:!0,focusPosition:{row:0,col:0}})}}function gie(t){let{isLeftClick:e,coords:r,selection:n,controller:i,cellCoordsFactory:s}=t;if(!e)return;const o=n.isSelectedByRowHeader(),a=n.isSelectedByColumnHeader(),l=n.tableProps.countCols(),c=n.tableProps.countRows();a&&!i.column?n.setRangeEnd(s(c-1,r.col)):o&&!i.row?n.setRangeEnd(s(r.row,l-1)):i.cell||n.setRangeEnd(r)}const mie=new Map([["mousedown",N_],["mouseover",gie],["touchstart",N_]]);function H_(t,e){let{coords:r,selection:n,controller:i,cellCoordsFactory:s}=e;mie.get(t.type)({coords:r,selection:n,controller:i,cellCoordsFactory:s,isShiftKey:t.shiftKey,isLeftClick:Gy(t)||t.type==="touchstart",isRightClick:Xl(t)})}const bF=new WeakMap,dx=Symbol("rootInstance");function pie(t){bF.set(t,!0)}function wie(t){return t===dx}function D0(t){return bF.has(t)}function F_(t,e){EF(t,e),e.add(t)}function il(t,e,r){EF(t,e),e.set(t,r)}function EF(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ea(t,e,r){return e=vie(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vie(t){var e=Cie(t,"string");return typeof e=="symbol"?e:String(e)}function Cie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function B1(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function Fr(t,e){var r=RF(t,e,"get");return Sie(t,r)}function Sie(t,e){return e.get?e.get.call(t):e.value}function Si(t,e,r){var n=RF(t,e,"set");return yie(t,n,r),r}function RF(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function yie(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}var uv=new WeakMap,yg=new WeakMap,xg=new WeakMap,co=new WeakMap,ji=new WeakMap,hv=new WeakMap,dv=new WeakMap,W1=new WeakSet,L_=new WeakSet;class xie{constructor(e){F_(this,L_),F_(this,W1),ea(this,"hot",void 0),ea(this,"eventManager",void 0),ea(this,"settings",void 0),ea(this,"THEAD",void 0),ea(this,"TBODY",void 0),ea(this,"_wt",void 0),ea(this,"activeWt",void 0),il(this,uv,{writable:!0,value:0}),il(this,yg,{writable:!0,value:0}),ea(this,"postponedAdjustElementsSize",!1),il(this,xg,{writable:!0,value:!1}),il(this,co,{writable:!0,value:void 0}),il(this,ji,{writable:!0,value:void 0}),il(this,hv,{writable:!0,value:0}),il(this,dv,{writable:!0,value:0}),this.hot=e,this.eventManager=new ms(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,r){const n=this._wt.getCell(e,r);return n<0?null:n}scrollViewport(e,r,n,i,s){return this._wt.scrollViewport(e,r,n,i,s)}scrollViewportHorizontally(e,r,n){return this._wt.scrollViewportHorizontally(e,r,n)}scrollViewportVertically(e,r,n){return this._wt.scrollViewportVertically(e,r,n)}createElements(){const{rootElement:e,rootDocument:r}=this.hot,n=e.getAttribute("style");n&&e.setAttribute("data-originalstyle",n),be(e,"handsontable"),Si(this,ji,r.createElement("TABLE")),be(Fr(this,ji),"htCore"),this.hot.getSettings().tableClassName&&be(Fr(this,ji),this.hot.getSettings().tableClassName),this.settings.ariaTags&&(qe(Fr(this,ji),[Ys()]),qe(e,[qJ(),dH(-1),Rp(this.hot.countCols()),cQ()])),this.THEAD=r.createElement("THEAD"),Fr(this,ji).appendChild(this.THEAD),this.TBODY=r.createElement("TBODY"),Fr(this,ji).appendChild(this.TBODY),this.hot.table=Fr(this,ji),this.hot.container.insertBefore(Fr(this,ji),this.hot.container.firstChild)}registerEvents(){const{rootElement:e,rootDocument:r,selection:n}=this.hot,i=r.documentElement;this.eventManager.addEventListener(e,"mousedown",s=>{if(Si(this,xg,!0),!this.isTextSelectionAllowed(s.target)){const{rootWindow:o}=this.hot;GT(o),s.preventDefault(),o.focus()}}),this.eventManager.addEventListener(e,"mouseup",()=>{Si(this,xg,!1)}),this.eventManager.addEventListener(e,"mousemove",s=>{Fr(this,xg)&&!this.isTextSelectionAllowed(s.target)&&(this.settings.fragmentSelection&&GT(this.hot.rootWindow),s.preventDefault())}),this.eventManager.addEventListener(i,"keyup",s=>{n.isInProgress()&&!s.shiftKey&&n.finish()}),this.eventManager.addEventListener(i,"mouseup",s=>{n.isInProgress()&&Gy(s)&&n.finish(),Si(this,co,!1);const o=yH(r.activeElement);I0(r.activeElement)&&!o||(o||!n.isSelected()&&!n.isSelectedByAnyHeader()&&!e.contains(s.target)&&!Xl(s))&&this.hot.unlisten()}),this.eventManager.addEventListener(i,"contextmenu",s=>{n.isInProgress()&&Xl(s)&&(n.finish(),Si(this,co,!1))}),this.eventManager.addEventListener(i,"touchend",()=>{n.isInProgress()&&n.finish(),Si(this,co,!1)}),this.eventManager.addEventListener(i,"mousedown",s=>{const o=s.target,a=s.x||s.clientX,l=s.y||s.clientY;let c=s.target;if(Fr(this,co)||!e||!this.hot.view)return;const{holder:u}=this.hot.view._wt.wtTable;if(c===u){const d=Ur(r);if(r.elementFromPoint(a+d,l)!==u||r.elementFromPoint(a,l+d)!==u)return}else for(;c!==i;){if(c===null){if(s.isTargetWebComponent)break;return}if(c===e)return;c=c.parentNode}(typeof this.settings.outsideClickDeselects=="function"?this.settings.outsideClickDeselects(o):this.settings.outsideClickDeselects)?this.hot.deselectCell():this.hot.destroyEditor(!1,!1)}),this.eventManager.addEventListener(Fr(this,ji),"selectstart",s=>{this.settings.fragmentSelection||I0(s.target)||s.preventDefault()})}translateFromRenderableToVisualCoords(e){let{row:r,col:n}=e;return this.hot._createCellCoords(...this.translateFromRenderableToVisualIndex(r,n))}translateFromRenderableToVisualIndex(e,r){let n=e>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(e):e,i=r>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(r):r;return n===null&&(n=e),i===null&&(i=r),[n,i]}countRenderableIndexes(e,r){const n=Math.min(e.getNotTrimmedIndexesLength(),r),i=e.getNearestNotHiddenIndex(n-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,r){return this.countNotHiddenIndexes(e,r,this.hot.rowIndexMapper,this.countRenderableRows())}countNotHiddenColumnIndexes(e,r){return this.countNotHiddenIndexes(e,r,this.hot.columnIndexMapper,this.countRenderableColumns())}countNotHiddenIndexes(e,r,n,i){if(isNaN(e)||e<0)return 0;const s=n.getNearestNotHiddenIndex(e,r),o=n.getRenderableFromVisualIndex(s);if(!Number.isInteger(o))return 0;let a=0;return r<0?a=o+1:r>0&&(a=i-o),a}countNotHiddenFixedColumnsStart(){const e=this.hot.countCols(),r=Math.min(parseInt(this.settings.fixedColumnsStart,10),e)-1;return this.countNotHiddenColumnIndexes(r,-1)}countNotHiddenFixedRowsTop(){const e=this.hot.countRows(),r=Math.min(parseInt(this.settings.fixedRowsTop,10),e)-1;return this.countNotHiddenRowIndexes(r,-1)}countNotHiddenFixedRowsBottom(){const e=this.hot.countRows(),r=Math.max(e-parseInt(this.settings.fixedRowsBottom,10),0);return this.countNotHiddenRowIndexes(r,1)}countRenderableColumnsInRange(e,r){let n=0;for(let i=e;i<=r;i++)this.hot.columnIndexMapper.getRenderableFromVisualIndex(i)!==null&&(n+=1);return n}countRenderableRowsInRange(e,r){let n=0;for(let i=e;i<=r;i++)this.hot.rowIndexMapper.getRenderableFromVisualIndex(i)!==null&&(n+=1);return n}isMainTableNotFullyCoveredByOverlays(){const e=this.countNotHiddenFixedRowsTop()+this.countNotHiddenFixedRowsBottom(),r=this.countNotHiddenFixedColumnsStart();return this.hot.countRenderedRows()>e&&this.hot.countRenderedCols()>r}initializeWalkontable(){const e={ariaTags:this.settings.ariaTags,rtlMode:this.hot.isRtl(),externalRowCalculator:this.hot.getPlugin("autoRowSize")&&this.hot.getPlugin("autoRowSize").isEnabled(),table:Fr(this,ji),isDataViewInstance:()=>D0(this.hot),preventOverflow:()=>this.settings.preventOverflow,preventWheel:()=>this.settings.preventWheel,stretchH:()=>this.settings.stretchH,data:(s,o)=>this.hot.getDataAtCell(...this.translateFromRenderableToVisualIndex(s,o)),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 s=[];return this.hot.hasRowHeaders()&&s.push((o,a)=>{const l=o>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(o):o;this.appendRowHeader(l,a)}),this.hot.runHooks("afterGetRowHeaderRenderers",s),Si(this,yg,s.length),this.hot.getSettings().ariaTags&&B1(this,W1,TF).call(this)===this.hot.countCols()&&B1(this,L_,bie).call(this,Fr(this,yg)),s},columnHeaders:()=>{const s=[];return this.hot.hasColHeaders()&&s.push((o,a)=>{const l=o>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(o):o;this.appendColHeader(l,a)}),this.hot.runHooks("afterGetColumnHeaderRenderers",s),Si(this,uv,s.length),s},columnWidth:s=>{const o=this.hot.columnIndexMapper.getVisualFromRenderableIndex(s);return this.hot.getColWidth(o===null?s:o)},rowHeight:s=>{const o=this.hot.rowIndexMapper.getVisualFromRenderableIndex(s);return this.hot.getRowHeight(o===null?s:o)},cellRenderer:(s,o,a)=>{const[l,c]=this.translateFromRenderableToVisualIndex(s,o),u=this.hot.runHooks("modifyGetCellCoords",l,c);let h=l,d=c;Array.isArray(u)&&([h,d]=u);const f=this.hot.getCellMeta(h,d),g=this.hot.colToProp(d);let m=this.hot.getDataAtRowProp(h,g);this.hot.hasHook("beforeValueRender")&&(m=this.hot.runHooks("beforeValueRender",m,f)),this.hot.runHooks("beforeRenderer",a,l,c,g,m,f),this.hot.getCellRenderer(f)(this.hot,a,l,c,g,m,f),this.hot.runHooks("afterRenderer",a,l,c,g,m,f)},selections:this.hot.selection.highlight,hideBorderOnMouseDownOver:()=>this.settings.fragmentSelection,onWindowResize:()=>{this.hot&&!this.hot.isDestroyed&&this.hot.refreshDimensions()},onContainerElementResize:()=>{this.hot&&!this.hot.isDestroyed&&Kl(this.hot.rootElement)&&this.hot.refreshDimensions()},onCellMouseDown:(s,o,a,l)=>{const c=this.translateFromRenderableToVisualCoords(o),u={row:!1,column:!1,cell:!1};this.hot.listen(),this.activeWt=l,Si(this,co,!0),this.hot.runHooks("beforeOnCellMouseDown",s,c,a,u),!Il(s)&&(H_(s,{coords:c,selection:this.hot.selection,controller:u,cellCoordsFactory:(h,d)=>this.hot._createCellCoords(h,d)}),this.hot.runHooks("afterOnCellMouseDown",s,c,a),this.activeWt=this._wt)},onCellContextMenu:(s,o,a,l)=>{const c=this.translateFromRenderableToVisualCoords(o);this.activeWt=l,Si(this,co,!1),this.hot.selection.isInProgress()&&this.hot.selection.finish(),this.hot.runHooks("beforeOnCellContextMenu",s,c,a),!Il(s)&&(this.hot.runHooks("afterOnCellContextMenu",s,c,a),this.activeWt=this._wt)},onCellMouseOut:(s,o,a,l)=>{const c=this.translateFromRenderableToVisualCoords(o);this.activeWt=l,this.hot.runHooks("beforeOnCellMouseOut",s,c,a),!Il(s)&&(this.hot.runHooks("afterOnCellMouseOut",s,c,a),this.activeWt=this._wt)},onCellMouseOver:(s,o,a,l)=>{const c=this.translateFromRenderableToVisualCoords(o),u={row:!1,column:!1,cell:!1};this.activeWt=l,this.hot.runHooks("beforeOnCellMouseOver",s,c,a,u),!Il(s)&&(Fr(this,co)&&H_(s,{coords:c,selection:this.hot.selection,controller:u,cellCoordsFactory:(h,d)=>this.hot._createCellCoords(h,d)}),this.hot.runHooks("afterOnCellMouseOver",s,c,a),this.activeWt=this._wt)},onCellMouseUp:(s,o,a,l)=>{const c=this.translateFromRenderableToVisualCoords(o);this.activeWt=l,this.hot.runHooks("beforeOnCellMouseUp",s,c,a),!(Il(s)||this.hot.isDestroyed)&&(this.hot.runHooks("afterOnCellMouseUp",s,c,a),this.activeWt=this._wt)},onCellCornerMouseDown:s=>{s.preventDefault(),this.hot.runHooks("afterOnCellCornerMouseDown",s)},onCellCornerDblClick:s=>{s.preventDefault(),this.hot.runHooks("afterOnCellCornerDblClick",s)},beforeDraw:(s,o)=>this.beforeRender(s,o),onDraw:s=>this.afterRender(s),onBeforeViewportScrollVertically:s=>{const o=this.hot.rowIndexMapper,a=s<0;let l=s;return!a&&(l=o.getVisualFromRenderableIndex(s),l===null)?s:(l=this.hot.runHooks("beforeViewportScrollVertically",l),this.hot.runHooks("beforeViewportScroll"),a?l:o.getRenderableFromVisualIndex(l))},onBeforeViewportScrollHorizontally:s=>{const o=this.hot.columnIndexMapper,a=s<0;let l=s;return!a&&(l=o.getVisualFromRenderableIndex(s),l===null)?s:(l=this.hot.runHooks("beforeViewportScrollHorizontally",l),this.hot.runHooks("beforeViewportScroll"),a?l:o.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:(s,o,a)=>{const l=this.hot.rowIndexMapper,c=s<0;let u=s;c||(u=l.getVisualFromRenderableIndex(s));const h=this.hot.runHooks("beforeHighlightingRowHeader",u,o,a);return c?h:l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(h,1))},onBeforeHighlightingColumnHeader:(s,o,a)=>{const l=this.hot.columnIndexMapper,c=s<0;let u=s;c||(u=l.getVisualFromRenderableIndex(s));const h=this.hot.runHooks("beforeHighlightingColumnHeader",u,o,a);return c?h:l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(h,1))},onAfterDrawSelection:(s,o,a)=>{let l;const[c,u]=this.translateFromRenderableToVisualIndex(s,o),h=this.hot.selection.getSelectedRange();if(h.size()>0){const f=h.peekByIndex(a!=null?a:0);l=[f.from.row,f.from.col,f.to.row,f.to.col]}return this.hot.runHooks("afterDrawSelection",c,u,l,a)},onBeforeDrawBorders:(s,o)=>{const[a,l,c,u]=s,h=[this.hot.rowIndexMapper.getVisualFromRenderableIndex(a),this.hot.columnIndexMapper.getVisualFromRenderableIndex(l),this.hot.rowIndexMapper.getVisualFromRenderableIndex(c),this.hot.columnIndexMapper.getVisualFromRenderableIndex(u)];return this.hot.runHooks("beforeDrawBorders",h,o)},onBeforeTouchScroll:()=>this.hot.runHooks("beforeTouchScroll"),onAfterMomentumScroll:()=>this.hot.runHooks("afterMomentumScroll"),onBeforeStretchingColumnWidth:(s,o)=>{const a=this.hot.columnIndexMapper.getVisualFromRenderableIndex(o);return this.hot.runHooks("beforeStretchingColumnWidth",s,a)},onModifyRowHeaderWidth:s=>this.hot.runHooks("modifyRowHeaderWidth",s),onModifyGetCellCoords:(s,o,a)=>{const l=this.hot.rowIndexMapper,c=this.hot.columnIndexMapper,u=o>=0?c.getVisualFromRenderableIndex(o):o,h=s>=0?l.getVisualFromRenderableIndex(s):s,d=this.hot.runHooks("modifyGetCellCoords",h,u,a);if(Array.isArray(d)){const[f,g,m,w]=d;return[f>=0?l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(f,1)):f,g>=0?c.getRenderableFromVisualIndex(c.getNearestNotHiddenIndex(g,1)):g,m>=0?l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(m,-1)):m,w>=0?c.getRenderableFromVisualIndex(c.getNearestNotHiddenIndex(w,-1)):w]}},viewportRowCalculatorOverride:s=>{let o=this.settings.viewportRowRenderingOffset;if(o==="auto"&&this.settings.fixedRowsTop&&(o=10),o>0||o==="auto"){const a=this.countRenderableRows(),l=s.startRow,c=s.endRow;if(typeof o=="number")s.startRow=Math.max(l-o,0),s.endRow=Math.min(c+o,a-1);else if(o==="auto"){const u=Math.ceil(c/a*12);s.startRow=Math.max(l-u,0),s.endRow=Math.min(c+u,a-1)}}this.hot.runHooks("afterViewportRowCalculatorOverride",s)},viewportColumnCalculatorOverride:s=>{let o=this.settings.viewportColumnRenderingOffset;if(o==="auto"&&this.settings.fixedColumnsStart&&(o=10),o>0||o==="auto"){const a=this.countRenderableColumns(),l=s.startColumn,c=s.endColumn;if(typeof o=="number"&&(s.startColumn=Math.max(l-o,0),s.endColumn=Math.min(c+o,a-1)),o==="auto"){const u=Math.ceil(c/a*6);s.startColumn=Math.max(l-u,0),s.endColumn=Math.min(c+u,a-1)}}this.hot.runHooks("afterViewportColumnCalculatorOverride",s)},rowHeaderWidth:()=>this.settings.rowHeaderWidth,columnHeaderHeight:()=>{const s=this.hot.runHooks("modifyColumnHeaderHeight");return this.settings.columnHeaderHeight||s}};this.hot.runHooks("beforeInitWalkontable",e),this._wt=new hx(e),this.activeWt=this._wt;const r=this._wt.wtTable.spreader,{width:n,height:i}=this.hot.rootElement.getBoundingClientRect();this.setLastSize(n,i),this.eventManager.addEventListener(r,"mousedown",s=>{s.target===r&&s.which===3&&s.stopPropagation()}),this.eventManager.addEventListener(r,"contextmenu",s=>{s.target===r&&s.which===3&&s.stopPropagation()}),this.eventManager.addEventListener(this.hot.rootDocument.documentElement,"click",()=>{this.settings.observeDOMVisibility&&this._wt.drawInterrupted&&(this.hot.forceFullRender=!0,this.render())})}isTextSelectionAllowed(e){if(I0(e))return!0;const r=Vl(e,this.hot.view._wt.wtTable.spreader);return!!(this.settings.fragmentSelection===!0&&r||this.settings.fragmentSelection==="cell"&&this.isSelectedOnlyCell()&&r||!this.settings.fragmentSelection&&this.isCellEdited()&&this.isSelectedOnlyCell())}isMouseDown(){return Fr(this,co)}isSelectedOnlyCell(){var e,r;return(e=(r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.isSingleCell())!==null&&e!==void 0?e:!1}isCellEdited(){const e=this.hot.getActiveEditor();return e&&e.isOpened()}beforeRender(e,r){e&&this.hot.runHooks("beforeViewRender",this.hot.forceFullRender,r)}afterRender(e){e&&this.hot.runHooks("afterViewRender",this.hot.forceFullRender)}appendRowHeader(e,r){if(r.firstChild){const n=r.firstChild;if(!Je(n,"relative")){Zs(r),this.appendRowHeader(e,r);return}this.updateCellHeader(n.querySelector(".rowHeader"),e,this.hot.getRowHeader)}else{const{rootDocument:n,getRowHeader:i}=this.hot,s=n.createElement("div"),o=n.createElement("span");s.className="relative",o.className="rowHeader",this.updateCellHeader(o,e,i),s.appendChild(o),r.appendChild(s)}this.hot.runHooks("afterGetRowHeader",e,r)}appendColHeader(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hot.getColHeader,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(r.firstChild){const s=r.firstChild;Je(s,"relative")?this.updateCellHeader(s.querySelector(".colHeader"),e,n,i):(Zs(r),this.appendColHeader(e,r,n,i))}else{const{rootDocument:s}=this.hot,o=s.createElement("div"),a=s.createElement("span");o.className="relative",a.className="colHeader",this.settings.ariaTags&&(qe(o,...Ys()),qe(a,...Ys())),this.updateCellHeader(a,e,n,i),o.appendChild(a),r.appendChild(o)}this.hot.runHooks("afterGetColHeader",e,r,i)}updateCellHeader(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=r;const o=this._wt.wtOverlays.getParentOverlay(e)||this._wt;e.parentNode&&(Je(e,"colHeader")?s=o.wtTable.columnFilter.sourceToRendered(r):Je(e,"rowHeader")&&(s=o.wtTable.rowFilter.sourceToRendered(r))),s>-1?Gu(e,n(r,i)):(jl(e,String.fromCharCode(160)),be(e,"cornerHeader"))}maximumVisibleElementWidth(e){const n=this._wt.wtViewport.getWorkspaceWidth()-e;return n>0?n:0}maximumVisibleElementHeight(e){const n=this._wt.wtViewport.getWorkspaceHeight()-e;return n>0?n:0}setLastSize(e,r){Si(this,hv,e),Si(this,dv,r)}getLastSize(){return{width:Fr(this,hv),height:Fr(this,dv)}}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 Fr(this,uv)}getRowHeadersCount(){return Fr(this,yg)}destroy(){this._wt.destroy(),this.eventManager.destroy()}}function TF(){return parseInt(this.hot.rootElement.getAttribute(Rp()[0]),10)}function bie(t){const e=B1(this,W1,TF).call(this)+t;qe(this.hot.rootElement,...Rp(e))}const Eie=xie,Rie="ABCDEFGHIJKLMNOPQRSTUVWXYZ",$_=Rie.length;function Tie(t){let e=t+1,r="",n;for(;e>0;)n=(e-1)%$_,r=String.fromCharCode(65+n)+r,e=parseInt((e-n)/$_,10);return r}function _F(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=t;const n=[];return(!Array.isArray(t)||!Array.isArray(t[0]))&&(r=[t]),r.forEach((i,s)=>{Array.isArray(i)?i.forEach((o,a)=>{n.push([s+e,a,o])}):Object.keys(i).forEach(o=>{n.push([s+e,o,i[o]])})}),n}function AF(t){let e=0;return Array.isArray(t)&&(t[0]&&Array.isArray(t[0])?e=t[0].length:t[0]&&at(t[0])&&(e=Vy(t[0]))),e}function _ie(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>Array.isArray(e)))}function Aie(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>typeof e=="object"&&!Array.isArray(e)&&e!==null))}function mh(t,e,r){return e=Mie(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Mie(t){var e=Oie(t,"string");return typeof e=="symbol"?e:String(e)}function Oie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Iie{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];mh(this,"hot",void 0),mh(this,"data",void 0),mh(this,"dataType","array"),mh(this,"colToProp",()=>{}),mh(this,"propToCol",()=>{}),this.hot=e,this.data=r}modifyRowData(e){let r;return this.hot.hasHook("modifyRowData")&&(r=this.hot.runHooks("modifyRowData",e)),r!==void 0&&!Number.isInteger(r)?r: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 r=[];return j(this.data,(n,i)=>{const s=this.getAtCell(i,e);r.push(s)}),r}getAtRow(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;const s=r===void 0&&n===void 0;let o=null,a=null;if(o=this.modifyRowData(e),Array.isArray(o))a=[],s?o.forEach((l,c)=>{a[c]=this.getAtPhysicalCell(e,c,o)}):Ue(r,n,l=>{a[l-r]=this.getAtPhysicalCell(e,l,o)});else if(at(o)||Ut(o))if(i?a=[]:a={},!s||i){const c=this.countFirstRowKeys()-1;Ue(0,c,u=>{const h=this.colToProp(u);if(u>=(r||0)&&u<=(n||c)&&!Number.isInteger(h)){const d=this.getAtPhysicalCell(e,h,o);i?a.push(d):zw(a,h,d)}})}else dt(o,(l,c)=>{zw(a,c,this.getAtPhysicalCell(e,c,o))});return a}setAtCell(e,r,n){if(!(e>=this.countRows()||r>=this.countFirstRowKeys())){if(this.hot.hasHook("modifySourceData")){const i=zs(n);this.hot.runHooks("modifySourceData",e,r,i,"set"),i.isTouched()&&(n=i.value)}Number.isInteger(r)?this.data[e][r]=n:zw(this.data[e],r,n)}}getAtPhysicalCell(e,r,n){let i=null;if(n&&(typeof r=="string"?i=zQ(n,r):typeof r=="function"?i=r(n):i=n[r]),this.hot.hasHook("modifySourceData")){const s=zs(i);this.hot.runHooks("modifySourceData",e,r,s,"get"),s.isTouched()&&(i=s.value)}return i}getAtCell(e,r){const n=this.modifyRowData(e);return this.getAtPhysicalCell(e,this.colToProp(r),n)}getByRange(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=!1,s=null,o=null,a=null,l=null;e===null||r===null?(i=!0,s=0,a=this.countRows()-1):(s=Math.min(e.row,r.row),o=Math.min(e.col,r.col),a=Math.max(e.row,r.row),l=Math.max(e.col,r.col));const c=[];return Ue(s,a,u=>{c.push(i?this.getAtRow(u,void 0,void 0,n):this.getAtRow(u,o,l,n))}),c}countRows(){if(this.hot.hasHook("modifySourceLength")){const e=this.hot.runHooks("modifySourceLength");if(Number.isInteger(e))return e}return this.data.length}countFirstRowKeys(){return AF(this.data)}destroy(){this.data=null,this.hot=null}}const Pie=Iie;function B_(t,e,r){return e=Die(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Die(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 r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class uc{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;B_(this,"indexedValues",[]),B_(this,"initValueOrFn",void 0),this.initValueOrFn=e}getValues(){return this.indexedValues}getValueAtIndex(e){const r=this.indexedValues;if(e<r.length)return r[e]}setValues(e){this.indexedValues=e.slice(),this.runLocalHooks("change")}setValueAtIndex(e,r){return e<this.indexedValues.length?(this.indexedValues[e]=r,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,Ut(this.initValueOrFn)?Ue(e-1,r=>this.indexedValues.push(this.initValueOrFn(r))):Ue(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}}Vt(uc,Qn);function fx(t,e,r,n){const i=r.length?r[0]:void 0;return[...t.slice(0,i),...r.map((s,o)=>Ut(n)?n(s,o):n),...i===void 0?[]:t.slice(i)]}function gx(t,e){return Ni(t,(r,n)=>e.includes(n)===!1)}class Ka extends uc{insert(e,r){this.indexedValues=fx(this.indexedValues,e,r,this.initValueOrFn),super.insert(e,r)}remove(e){this.indexedValues=gx(this.indexedValues,e),super.remove(e)}}class Pp extends Ka{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getHiddenIndexes(){return Cn(this.getValues(),(e,r,n)=>(r&&e.push(n),e),[])}}function mx(t,e,r){return[...t.slice(0,e),...r,...t.slice(e)]}function jd(t,e){return Ni(t,r=>e.includes(r)===!1)}function px(t,e){return ht(t,r=>r-e.filter(n=>n<r).length)}function wx(t,e){const r=e[0],n=e.length;return ht(t,i=>i>=r?i+n:i)}function Nie(t,e,r){return e=Hie(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Hie(t){var e=Fie(t,"string");return typeof e=="symbol"?e:String(e)}function Fie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Dp extends uc{constructor(){super(...arguments),Nie(this,"orderOfIndexes",[])}getValues(){return this.orderOfIndexes.map(e=>this.indexedValues[e])}setValues(e){this.orderOfIndexes=[...Array(e.length).keys()],super.setValues(e)}setValueAtIndex(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.orderOfIndexes.length;return e<this.indexedValues.length?(this.indexedValues[e]=r,this.orderOfIndexes.includes(e)===!1&&this.orderOfIndexes.splice(n,0,e),this.runLocalHooks("change"),!0):!1}clearValue(e){this.orderOfIndexes=jd(this.orderOfIndexes,[e]),Ut(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,r){this.indexedValues=fx(this.indexedValues,e,r,this.initValueOrFn),this.orderOfIndexes=wx(this.orderOfIndexes,r),super.insert(e,r)}remove(e){this.indexedValues=gx(this.indexedValues,e),this.orderOfIndexes=jd(this.orderOfIndexes,e),this.orderOfIndexes=px(this.orderOfIndexes,e),super.remove(e)}getEntries(){return this.orderOfIndexes.map(e=>[e,this.getValueAtIndex(e)])}}class bf extends Ka{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getTrimmedIndexes(){return Cn(this.getValues(),(e,r,n)=>(r&&e.push(n),e),[])}}const W_=new Map([["indexesSequence",{getListWithInsertedItems:mx,getListWithRemovedItems:jd}],["physicallyIndexed",{getListWithInsertedItems:fx,getListWithRemovedItems:gx}]]),MF=t=>{if(W_.has(t)===!1)throw new Error(`Alter strategy with ID '${t}' does not exist.`);return W_.get(t)};class OF extends uc{constructor(){super(e=>e)}insert(e,r){const n=wx(this.indexedValues,r);this.indexedValues=mx(n,e,r),super.insert(e,r)}remove(e){const r=jd(this.indexedValues,e);this.indexedValues=px(r,e),super.remove(e)}}const V_=new Map([["hiding",Pp],["index",uc],["linkedPhysicalIndexToValue",Dp],["physicalIndexToValue",Ka],["trimming",bf]]);function Lie(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!V_.has(t))throw new Error(`The provided map type ("${t}") does not exist.`);return new(V_.get(t))(e)}function $ie(t,e,r){return e=Bie(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Bie(t){var e=Wie(t,"string");return typeof e=="symbol"?e:String(e)}function Wie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class vx{constructor(){$ie(this,"collection",new Map)}register(e,r){this.collection.has(e)===!1&&(this.collection.set(e,r),r.addLocalHook("change",()=>this.runLocalHooks("change",r)))}unregister(e){const r=this.collection.get(e);He(r)&&(r.destroy(),this.collection.delete(e),this.runLocalHooks("change",r))}unregisterAll(){this.collection.forEach((e,r)=>this.unregister(r)),this.collection.clear()}get(e){return Gt(e)?Array.from(this.collection.values()):this.collection.get(e)}getLength(){return this.collection.size}removeFromEvery(e){this.collection.forEach(r=>{r.remove(e)})}insertToEvery(e,r){this.collection.forEach(n=>{n.insert(e,r)})}initEvery(e){this.collection.forEach(r=>{r.init(e)})}}Vt(vx,Qn);function fv(t,e,r){return e=Vie(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Vie(t){var e=Uie(t,"string");return typeof e=="symbol"?e:String(e)}function Uie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class U_ extends vx{constructor(e,r){super(),fv(this,"mergedValuesCache",[]),fv(this,"aggregationFunction",void 0),fv(this,"fallbackValue",void 0),this.aggregationFunction=e,this.fallbackValue=r}getMergedValues(){if((arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0)return this.mergedValuesCache;if(this.getLength()===0)return[];const r=ht(this.get(),s=>s.getValues()),n=[],i=He(r[0])&&r[0].length||0;for(let s=0;s<i;s+=1){const o=[];for(let a=0;a<this.getLength();a+=1)o.push(r[a][s]);n.push(o)}return ht(n,this.aggregationFunction)}getMergedValueAtIndex(e,r){const n=this.getMergedValues(r)[e];return He(n)?n:this.fallbackValue}updateCache(){this.mergedValuesCache=this.getMergedValues(!1)}}function Gie(t,e,r){Yie(t,e),e.set(t,r)}function Yie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function zie(t,e,r){var n=IF(t,e,"set");return jie(t,n,r),r}function jie(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function Kie(t,e){var r=IF(t,e,"get");return Xie(t,r)}function IF(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function Xie(t,e){return e.get?e.get.call(t):e.value}var gv=new WeakMap;class PF{constructor(){Gie(this,gv,{writable:!0,value:[]})}subscribe(e){return this.addLocalHook("change",e),this._write(Kie(this,gv)),this}unsubscribe(){return this.runLocalHooks("unsubscribe"),this.clearLocalHooks(),this}_write(e){return e.length>0&&this.runLocalHooks("change",e),this}_writeInitialChanges(e){zie(this,gv,e)}}Vt(PF,Qn);function G_(t,e){const r=[];let n=0,i=0;for(;n<t.length&&i<e.length;n++,i++)t[n]!==e[i]&&r.push({op:"replace",index:i,oldValue:t[n],newValue:e[i]});for(;n<e.length;n++)r.push({op:"insert",index:n,oldValue:void 0,newValue:e[n]});for(;i<t.length;i++)r.push({op:"remove",index:i,oldValue:t[i],newValue:void 0});return r}function ph(t,e,r){qie(t,e),e.set(t,r)}function qie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yi(t,e){var r=DF(t,e,"get");return Zie(t,r)}function Zie(t,e){return e.get?e.get.call(t):e.value}function bg(t,e,r){var n=DF(t,e,"set");return Jie(t,n,r),r}function DF(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function Jie(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}var Eg=new WeakMap,wh=new WeakMap,Rg=new WeakMap,Tg=new WeakMap,_g=new WeakMap;class Qie{constructor(){let{initialIndexValue:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ph(this,Eg,{writable:!0,value:new Set}),ph(this,wh,{writable:!0,value:[]}),ph(this,Rg,{writable:!0,value:[]}),ph(this,Tg,{writable:!0,value:!1}),ph(this,_g,{writable:!0,value:!1}),bg(this,_g,e!=null?e:!1)}createObserver(){const e=new PF;return yi(this,Eg).add(e),e.addLocalHook("unsubscribe",()=>{yi(this,Eg).delete(e)}),e._writeInitialChanges(G_(yi(this,wh),yi(this,Rg))),e}emit(e){let r=yi(this,Rg);(!yi(this,Tg)||yi(this,wh).length!==e.length)&&(e.length===0?e=new Array(r.length).fill(yi(this,_g)):bg(this,wh,new Array(e.length).fill(yi(this,_g))),yi(this,Tg)||(bg(this,Tg,!0),r=yi(this,wh)));const n=G_(r,e);yi(this,Eg).forEach(i=>i._write(n)),bg(this,Rg,e)}}function xn(t,e,r){return e=ese(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ese(t){var e=tse(t,"string");return typeof e=="symbol"?e:String(e)}function tse(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class V1{constructor(){xn(this,"indexesSequence",new OF),xn(this,"trimmingMapsCollection",new U_(e=>e.some(r=>r===!0),!1)),xn(this,"hidingMapsCollection",new U_(e=>e.some(r=>r===!0),!1)),xn(this,"variousMapsCollection",new vx),xn(this,"hidingChangesObservable",new Qie({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,r,n){return this.registerMap(e,Lie(r,n))}registerMap(e,r){if(this.trimmingMapsCollection.get(e)||this.hidingMapsCollection.get(e)||this.variousMapsCollection.get(e))throw Error(`Map with name "${e}" has been already registered.`);r instanceof bf?this.trimmingMapsCollection.register(e,r):r instanceof Pp?this.hidingMapsCollection.register(e,r):this.variousMapsCollection.register(e,r);const n=this.getNumberOfIndexes();return n>0&&r.init(n),r}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 r=this.notTrimmedIndexesCache[e];return He(r)?r:null}getPhysicalFromRenderableIndex(e){const r=this.renderablePhysicalIndexesCache[e];return He(r)?r:null}getVisualFromPhysicalIndex(e){const r=this.fromPhysicalToVisualIndexesCache.get(e);return He(r)?r:null}getVisualFromRenderableIndex(e){return this.getVisualFromPhysicalIndex(this.getPhysicalFromRenderableIndex(e))}getRenderableFromVisualIndex(e){const r=this.fromVisualToRenderableIndexesCache.get(e);return He(r)?r:null}getNearestNotHiddenIndex(e,r){let n=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 s=Array.from(this.fromVisualToRenderableIndexesCache.keys());let o=-1;return r>0?o=s.findIndex(a=>a>e):o=s.reverse().findIndex(a=>a<e),o===-1?n?this.getNearestNotHiddenIndex(e,-r,!1):null:s[o]}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 r=this.getNumberOfIndexes();if(e<r){const n=[...Array(this.getNumberOfIndexes()-e).keys()].map(i=>i+e);this.removeIndexes(n)}else this.insertIndexes(r,e-r)}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(n=>this.isTrimmed(n)===!1)}getNotTrimmedIndexesLength(){return this.getNotTrimmedIndexes().length}getNotHiddenIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.notHiddenIndexesCache:this.getIndexesSequence().filter(n=>this.isHidden(n)===!1)}getNotHiddenIndexesLength(){return this.getNotHiddenIndexes().length}getRenderableIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.renderablePhysicalIndexesCache:this.getNotTrimmedIndexes().filter(n=>this.isHidden(n)===!1)}getRenderableIndexesLength(){return this.getRenderableIndexes().length}getNumberOfIndexes(){return this.getIndexesSequence().length}moveIndexes(e,r){typeof e=="number"&&(e=[e]);const n=ht(e,c=>this.getPhysicalFromVisualIndex(c)),i=this.getNotTrimmedIndexesLength(),s=e.length,o=jd(this.getIndexesSequence(),n),a=o.filter(c=>this.isTrimmed(c)===!1);let l=o.indexOf(a[a.length-1])+1;if(r+s<i){const c=a[r];l=o.indexOf(c)}this.indexesChangeSource="move",this.setIndexesSequence(mx(o,l,n)),this.indexesChangeSource=void 0}isTrimmed(e){return this.trimmingMapsCollection.getMergedValueAtIndex(e)}isHidden(e){return this.hidingMapsCollection.getMergedValueAtIndex(e)}insertIndexes(e,r){const n=this.getNotTrimmedIndexes()[e],i=He(n)?n:this.getNumberOfIndexes(),s=this.getIndexesSequence().includes(n)?this.getIndexesSequence().indexOf(n):this.getNumberOfIndexes(),o=ht(new Array(r).fill(i),(a,l)=>a+l);this.suspendOperations(),this.indexesChangeSource="insert",this.indexesSequence.insert(s,o),this.indexesChangeSource=void 0,this.trimmingMapsCollection.insertToEvery(s,o),this.hidingMapsCollection.insertToEvery(s,o),this.variousMapsCollection.insertToEvery(s,o),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 r=this.indexesSequenceChanged||this.trimmedIndexesChanged||this.hiddenIndexesChanged;(e===!0||this.isBatched===!1&&r===!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 r=0;r<e;r+=1){const n=this.getPhysicalFromVisualIndex(r);this.fromPhysicalToVisualIndexesCache.set(n,r)}}cacheFromVisualToRenderableIndexes(){const e=this.getRenderableIndexesLength();this.fromVisualToRenderableIndexesCache.clear();for(let r=0;r<e;r+=1){const n=this.getPhysicalFromRenderableIndex(r),i=this.getVisualFromPhysicalIndex(n);this.fromVisualToRenderableIndexesCache.set(i,r)}}}Vt(V1,Qn);function rse(t,e){return dt(e,(r,n)=>{Gt(t[n])&&(t[n]=r)}),t}function kF(t){const r=/^([a-zA-Z]{2})-([a-zA-Z]{2})$/.exec(t);return r?`${r[1].toLowerCase()}-${r[2].toUpperCase()}`:t}function NF(t){He(t)&&Yy(Pt`Language with code "${t}" was not found. You should register particular language\x20
  81. before using it. Read more about this issue at: https://docs.handsontable.com/i18n/missing-language-code.`)}function nse(t,e){return Array.isArray(t)&&Number.isInteger(e)?t[e]:t}const{register:ise,getValues:sse}=Cs("phraseFormatters");function ose(t,e){ise(t,e)}function ase(){return sse()}ose("pluralize",nse);const HF="ContextMenu:items",it=HF,Cx=`${it}.noItems`,Sx=`${it}.insertRowAbove`,yx=`${it}.insertRowBelow`,xx=`${it}.insertColumnOnTheLeft`,bx=`${it}.insertColumnOnTheRight`,Ex=`${it}.removeRow`,Rx=`${it}.removeColumn`,Tx=`${it}.undo`,_x=`${it}.redo`,Ax=`${it}.readOnly`,Mx=`${it}.clearColumn`,Ox=`${it}.copy`,Ix=`${it}.copyWithHeaders`,Px=`${it}.copyWithGroupHeaders`,Dx=`${it}.copyHeadersOnly`,kx=`${it}.cut`,Nx=`${it}.freezeColumn`,Hx=`${it}.unfreezeColumn`,Fx=`${it}.mergeCells`,Lx=`${it}.unmergeCells`,$x=`${it}.addComment`,Bx=`${it}.editComment`,Wx=`${it}.removeComment`,Vx=`${it}.readOnlyComment`,Ux=`${it}.align`,Gx=`${it}.align.left`,Yx=`${it}.align.center`,zx=`${it}.align.right`,jx=`${it}.align.justify`,Kx=`${it}.align.top`,Xx=`${it}.align.middle`,qx=`${it}.align.bottom`,Zx=`${it}.borders`,Jx=`${it}.borders.top`,Qx=`${it}.borders.right`,eb=`${it}.borders.bottom`,tb=`${it}.borders.left`,rb=`${it}.borders.remove`,nb=`${it}.nestedHeaders.insertChildRow`,ib=`${it}.nestedHeaders.detachFromParent`,sb=`${it}.hideColumn`,ob=`${it}.showColumn`,ab=`${it}.hideRow`,lb=`${it}.showRow`,Ln="Filters:",ur=`${Ln}conditions`,kp=`${ur}.none`,cb=`${ur}.isEmpty`,ub=`${ur}.isNotEmpty`,hb=`${ur}.isEqualTo`,db=`${ur}.isNotEqualTo`,fb=`${ur}.beginsWith`,gb=`${ur}.endsWith`,mb=`${ur}.contains`,pb=`${ur}.doesNotContain`,lse=`${ur}.byValue`,wb=`${ur}.greaterThan`,vb=`${ur}.greaterThanOrEqualTo`,Cb=`${ur}.lessThan`,Sb=`${ur}.lessThanOrEqualTo`,yb=`${ur}.isBetween`,xb=`${ur}.isNotBetween`,bb=`${ur}.after`,Eb=`${ur}.before`,Rb=`${ur}.today`,Tb=`${ur}.tomorrow`,_b=`${ur}.yesterday`,Ab=`${Ln}labels.filterByCondition`,Mb=`${Ln}labels.filterByValue`,Ob=`${Ln}labels.conjunction`,Np=`${Ln}labels.disjunction`,Tm=`${Ln}values.blankCells`,Ib=`${Ln}buttons.selectAll`,Pb=`${Ln}buttons.clear`,Db=`${Ln}buttons.ok`,kb=`${Ln}buttons.cancel`,Nb=`${Ln}buttons.placeholder.search`,Hb=`${Ln}buttons.placeholder.value`,Fb=`${Ln}buttons.placeholder.secondValue`,Lb="CheckboxRenderer:",$b=`${Lb}checked`,Bb=`${Lb}unchecked`,cse=Object.freeze(Object.defineProperty({__proto__:null,CONTEXT_MENU_ITEMS_NAMESPACE:HF,CONTEXTMENU_ITEMS_NO_ITEMS:Cx,CONTEXTMENU_ITEMS_ROW_ABOVE:Sx,CONTEXTMENU_ITEMS_ROW_BELOW:yx,CONTEXTMENU_ITEMS_INSERT_LEFT:xx,CONTEXTMENU_ITEMS_INSERT_RIGHT:bx,CONTEXTMENU_ITEMS_REMOVE_ROW:Ex,CONTEXTMENU_ITEMS_REMOVE_COLUMN:Rx,CONTEXTMENU_ITEMS_UNDO:Tx,CONTEXTMENU_ITEMS_REDO:_x,CONTEXTMENU_ITEMS_READ_ONLY:Ax,CONTEXTMENU_ITEMS_CLEAR_COLUMN:Mx,CONTEXTMENU_ITEMS_COPY:Ox,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS:Ix,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS:Px,CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY:Dx,CONTEXTMENU_ITEMS_CUT:kx,CONTEXTMENU_ITEMS_FREEZE_COLUMN:Nx,CONTEXTMENU_ITEMS_UNFREEZE_COLUMN:Hx,CONTEXTMENU_ITEMS_MERGE_CELLS:Fx,CONTEXTMENU_ITEMS_UNMERGE_CELLS:Lx,CONTEXTMENU_ITEMS_ADD_COMMENT:$x,CONTEXTMENU_ITEMS_EDIT_COMMENT:Bx,CONTEXTMENU_ITEMS_REMOVE_COMMENT:Wx,CONTEXTMENU_ITEMS_READ_ONLY_COMMENT:Vx,CONTEXTMENU_ITEMS_ALIGNMENT:Ux,CONTEXTMENU_ITEMS_ALIGNMENT_LEFT:Gx,CONTEXTMENU_ITEMS_ALIGNMENT_CENTER:Yx,CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT:zx,CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY:jx,CONTEXTMENU_ITEMS_ALIGNMENT_TOP:Kx,CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE:Xx,CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM:qx,CONTEXTMENU_ITEMS_BORDERS:Zx,CONTEXTMENU_ITEMS_BORDERS_TOP:Jx,CONTEXTMENU_ITEMS_BORDERS_RIGHT:Qx,CONTEXTMENU_ITEMS_BORDERS_BOTTOM:eb,CONTEXTMENU_ITEMS_BORDERS_LEFT:tb,CONTEXTMENU_ITEMS_REMOVE_BORDERS:rb,CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD:nb,CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD:ib,CONTEXTMENU_ITEMS_HIDE_COLUMN:sb,CONTEXTMENU_ITEMS_SHOW_COLUMN:ob,CONTEXTMENU_ITEMS_HIDE_ROW:ab,CONTEXTMENU_ITEMS_SHOW_ROW:lb,FILTERS_NAMESPACE:Ln,FILTERS_CONDITIONS_NAMESPACE:ur,FILTERS_CONDITIONS_NONE:kp,FILTERS_CONDITIONS_EMPTY:cb,FILTERS_CONDITIONS_NOT_EMPTY:ub,FILTERS_CONDITIONS_EQUAL:hb,FILTERS_CONDITIONS_NOT_EQUAL:db,FILTERS_CONDITIONS_BEGINS_WITH:fb,FILTERS_CONDITIONS_ENDS_WITH:gb,FILTERS_CONDITIONS_CONTAINS:mb,FILTERS_CONDITIONS_NOT_CONTAIN:pb,FILTERS_CONDITIONS_BY_VALUE:lse,FILTERS_CONDITIONS_GREATER_THAN:wb,FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL:vb,FILTERS_CONDITIONS_LESS_THAN:Cb,FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL:Sb,FILTERS_CONDITIONS_BETWEEN:yb,FILTERS_CONDITIONS_NOT_BETWEEN:xb,FILTERS_CONDITIONS_AFTER:bb,FILTERS_CONDITIONS_BEFORE:Eb,FILTERS_CONDITIONS_TODAY:Rb,FILTERS_CONDITIONS_TOMORROW:Tb,FILTERS_CONDITIONS_YESTERDAY:_b,FILTERS_DIVS_FILTER_BY_CONDITION:Ab,FILTERS_DIVS_FILTER_BY_VALUE:Mb,FILTERS_LABELS_CONJUNCTION:Ob,FILTERS_LABELS_DISJUNCTION:Np,FILTERS_VALUES_BLANK_CELLS:Tm,FILTERS_BUTTONS_SELECT_ALL:Ib,FILTERS_BUTTONS_CLEAR:Pb,FILTERS_BUTTONS_OK:Db,FILTERS_BUTTONS_CANCEL:kb,FILTERS_BUTTONS_PLACEHOLDER_SEARCH:Nb,FILTERS_BUTTONS_PLACEHOLDER_VALUE:Hb,FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE:Fb,CHECKBOX_RENDERER_NAMESPACE:Lb,CHECKBOX_CHECKED:$b,CHECKBOX_UNCHECKED:Bb},Symbol.toStringTag,{value:"Module"}));/**
  82. * @preserve
  83. * Authors: Handsoncode
  84. * Last updated: Nov 15, 2017
  85. *
  86. * Description: Definition file for English - United States language-country.
  87. */const use={languageCode:"en-US",[Cx]:"No available options",[Sx]:"Insert row above",[yx]:"Insert row below",[xx]:"Insert column left",[bx]:"Insert column right",[Ex]:["Remove row","Remove rows"],[Rx]:["Remove column","Remove columns"],[Tx]:"Undo",[_x]:"Redo",[Ax]:"Read only",[Mx]:"Clear column",[Ux]:"Alignment",[Gx]:"Left",[Yx]:"Center",[zx]:"Right",[jx]:"Justify",[Kx]:"Top",[Xx]:"Middle",[qx]:"Bottom",[Nx]:"Freeze column",[Hx]:"Unfreeze column",[Zx]:"Borders",[Jx]:"Top",[Qx]:"Right",[eb]:"Bottom",[tb]:"Left",[rb]:"Remove border(s)",[$x]:"Add comment",[Bx]:"Edit comment",[Wx]:"Delete comment",[Vx]:"Read-only comment",[Fx]:"Merge cells",[Lx]:"Unmerge cells",[Ox]:"Copy",[Ix]:["Copy with header","Copy with headers"],[Px]:["Copy with group header","Copy with group headers"],[Dx]:["Copy header only","Copy headers only"],[kx]:"Cut",[nb]:"Insert child row",[ib]:"Detach from parent",[sb]:["Hide column","Hide columns"],[ob]:["Show column","Show columns"],[ab]:["Hide row","Hide rows"],[lb]:["Show row","Show rows"],[kp]:"None",[cb]:"Is empty",[ub]:"Is not empty",[hb]:"Is equal to",[db]:"Is not equal to",[fb]:"Begins with",[gb]:"Ends with",[mb]:"Contains",[pb]:"Does not contain",[wb]:"Greater than",[vb]:"Greater than or equal to",[Cb]:"Less than",[Sb]:"Less than or equal to",[yb]:"Is between",[xb]:"Is not between",[bb]:"After",[Eb]:"Before",[Rb]:"Today",[Tb]:"Tomorrow",[_b]:"Yesterday",[Tm]:"Blank cells",[Ab]:"Filter by condition",[Mb]:"Filter by value",[Ob]:"And",[Np]:"Or",[Ib]:"Select all",[Pb]:"Clear",[Db]:"OK",[kb]:"Cancel",[Nb]:"Search",[Hb]:"Value",[Fb]:"Second value",[$b]:"Checked",[Bb]:"Unchecked"},FF=use,hse=cse,U1=FF.languageCode,{register:dse,getItem:LF,hasItem:fse,getValues:gse}=Cs("languagesDictionaries");$F(FF);function $F(t,e){let r=t,n=e;return at(t)&&(n=t,r=n.languageCode),mse(r,n),dse(r,Hn(n)),Hn(n)}function mse(t,e){t!==U1&&rse(e,LF(U1))}function BF(t){return Wb(t)?Hn(LF(t)):null}function Wb(t){return fse(t)}function pse(){return gse()}function WF(t,e,r){const n=BF(t);if(n===null)return null;const i=n[e];if(Gt(i))return null;const s=wse(i,r);return Array.isArray(s)?s[0]:s}function wse(t,e){let r=t;return j(ase(),n=>{r=n(t,e)}),r}function vse(t){let e=kF(t);return Wb(e)||(e=U1,NF(t)),e}function Cse(t,e,r){return e=Sse(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,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 r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class xse extends Mne{constructor(e,r){super(e,null),Cse(this,"visualCellRange",null),this.visualCellRange=r||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:r,to:n}=e,i=this.getNearestNotHiddenCoords(r,1),s=this.getNearestNotHiddenCoords(n,-1);return i===null||s===null?null:((i.row>s.row||i.col>s.col)&&(i=r,s=n),this.settings.createCellRange(i,i,s))}getNearestNotHiddenCoords(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r;const i=this.getNearestNotHiddenIndex(this.settings.rowIndexMapper,e.row,r);if(i===null)return null;const s=this.getNearestNotHiddenIndex(this.settings.columnIndexMapper,e.col,n);return s===null?null:this.settings.createCellCoords(i,s)}getNearestNotHiddenIndex(e,r,n){return r<0?r:e.getNearestNotHiddenIndex(r,n)}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 r=e.from.clone().normalize(),n=e.getVerticalDirection()==="N-S"?1:-1,i=e.getHorizontalDirection()==="W-E"?1:-1,s=this.settings.visualToRenderableCoords(this.visualCellRange.highlight);let o=null;if((s===null||s.col===null||s.row===null)&&(o=this.getNearestNotHiddenCoords(r,n,i)),o!==null&&e.overlaps(o)){const a=e.highlight.clone();if(a.row>=0&&(a.row=o.row),a.col>=0&&(a.col=o.col),this.cellRange===null){const l=this.settings.visualToRenderableCoords(a);this.cellRange=this.settings.createCellRange(l)}e.setHighlight(a)}return this.settings.selectionType==="focus"&&s!==null&&o===null&&e.setHighlight(this.visualCellRange.highlight),this}getCorners(){const{from:e,to:r}=this.cellRange;return[Math.min(e.row,r.row),Math.min(e.col,r.col),Math.max(e.row,r.row),Math.max(e.col,r.col)]}getVisualCorners(){const e=this.settings.renderableToVisualCoords(this.cellRange.getTopStartCorner()),r=this.settings.renderableToVisualCoords(this.cellRange.getBottomEndCorner());return[e.row,e.col,r.row,r.col]}createRenderableCellRange(e,r){const n=this.settings.visualToRenderableCoords(e),i=this.settings.visualToRenderableCoords(r);return n.row===null||n.col===null||i.row===null||i.col===null?null:this.settings.createCellRange(n,n,i)}}const jo=xse;function mv(t){let n=t,{activeHeaderClassName:e}=n,r=Sn(n,["activeHeaderClassName"]);return new jo(Zr(yt({className:e},r),{selectionType:pF}))}function bse(t){let n=t,{areaCornerVisible:e}=n,r=Sn(n,["areaCornerVisible"]);return new jo(Zr(yt({className:"area",createLayers:!0,border:{width:1,color:"#4b89ff",cornerVisible:e}},r),{selectionType:sx}))}function Ese(t){let e=Sn(t,[]);return new jo(Zr(yt({className:"highlight"},e),{selectionType:sx}))}function Rse(t){let n=t,{columnClassName:e}=n,r=Sn(n,["columnClassName"]);return new jo(Zr(yt({className:e},r),{selectionType:Pne}))}function Tse(t){let n=t,{cellCornerVisible:e}=n,r=Sn(n,["cellCornerVisible"]);return new jo(Zr(yt({className:"current",headerAttributes:[Hy()],border:{width:2,color:"#4b89ff",cornerVisible:e}},r),{selectionType:ox}))}function _se(t){let i=t,{border:e,visualCellRange:r}=i,n=Sn(i,["border","visualCellRange"]);return new jo(Zr(yt(yt({},e),n),{selectionType:Dne}),r)}function Ase(t){let e=Sn(t,[]);return new jo(Zr(yt({className:"fill",border:{width:1,color:"#ff0000"}},e),{selectionType:One}))}function Y_(t){let n=t,{headerClassName:e}=n,r=Sn(n,["headerClassName"]);return new jo(Zr(yt({className:e},r),{selectionType:ix}))}function Mse(t){let n=t,{rowClassName:e}=n,r=Sn(n,["rowClassName"]);return new jo(Zr(yt({className:e},r),{selectionType:Ine}))}let VF;function Ose(t,e){Ise(t,e),e.add(t)}function Ise(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Bn(t,e,r){return e=Pse(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Pse(t){var e=Dse(t,"string");return typeof e=="symbol"?e:String(e)}function Dse(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function uo(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}var Rs=new WeakSet;VF=Symbol.iterator;class kse{constructor(e){Ose(this,Rs),Bn(this,"options",void 0),Bn(this,"layerLevel",0),Bn(this,"focus",void 0),Bn(this,"fill",void 0),Bn(this,"layeredAreas",new Map),Bn(this,"areas",new Map),Bn(this,"rowHeaders",new Map),Bn(this,"columnHeaders",new Map),Bn(this,"activeRowHeaders",new Map),Bn(this,"activeColumnHeaders",new Map),Bn(this,"activeCornerHeaders",new Map),Bn(this,"rowHighlights",new Map),Bn(this,"columnHighlights",new Map),Bn(this,"customSelections",[]),this.options=e,this.focus=Tse(e),this.fill=Ase(e)}isEnabledFor(e,r){let n=e;e===ox&&(n="current");let i=this.options.disabledCellSelection(r.row,r.col);return typeof i=="string"&&(i=[i]),i===!1||Array.isArray(i)&&!i.includes(n)}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 uo(this,Rs,ho).call(this,this.layeredAreas,bse)}getLayeredAreas(){return[...this.layeredAreas.values()]}createArea(){return uo(this,Rs,ho).call(this,this.areas,Ese)}getAreas(){return[...this.areas.values()]}createRowHeader(){return uo(this,Rs,ho).call(this,this.rowHeaders,Y_)}getRowHeaders(){return[...this.rowHeaders.values()]}createColumnHeader(){return uo(this,Rs,ho).call(this,this.columnHeaders,Y_)}getColumnHeaders(){return[...this.columnHeaders.values()]}createActiveRowHeader(){return uo(this,Rs,ho).call(this,this.activeRowHeaders,mv)}getActiveRowHeaders(){return[...this.activeRowHeaders.values()]}createActiveColumnHeader(){return uo(this,Rs,ho).call(this,this.activeColumnHeaders,mv)}getActiveColumnHeaders(){return[...this.activeColumnHeaders.values()]}createActiveCornerHeader(){return uo(this,Rs,ho).call(this,this.activeCornerHeaders,mv)}getActiveCornerHeaders(){return[...this.activeCornerHeaders.values()]}createRowHighlight(){return uo(this,Rs,ho).call(this,this.rowHighlights,Mse)}getRowHighlights(){return[...this.rowHighlights.values()]}createColumnHighlight(){return uo(this,Rs,ho).call(this,this.columnHighlights,Rse)}getColumnHighlights(){return[...this.columnHighlights.values()]}getCustomSelections(){return[...this.customSelections.values()]}addCustomSelection(e){this.customSelections.push(_se(yt(yt({},this.options),e)))}clear(){this.focus.clear(),this.fill.clear(),j(this.areas.values(),e=>void e.clear()),j(this.layeredAreas.values(),e=>void e.clear()),j(this.rowHeaders.values(),e=>void e.clear()),j(this.columnHeaders.values(),e=>void e.clear()),j(this.activeRowHeaders.values(),e=>void e.clear()),j(this.activeColumnHeaders.values(),e=>void e.clear()),j(this.activeCornerHeaders.values(),e=>void e.clear()),j(this.rowHighlights.values(),e=>void e.clear()),j(this.columnHighlights.values(),e=>void e.clear())}[VF](){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 ho(t,e){const r=this.layerLevel;if(t.has(r))return t.get(r);const n=e(yt({layerLevel:r},this.options));return t.set(r,n),n}const Nse=kse;let UF;function z_(t,e,r){return e=Hse(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Hse(t){var e=Fse(t,"string");return typeof e=="symbol"?e:String(e)}function Fse(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}UF=Symbol.iterator;class Lse{constructor(e){z_(this,"ranges",[]),z_(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(r=>r.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,r;return e>=0&&e<this.size()&&(r=this.ranges[e]),r}[UF](){return this.ranges[Symbol.iterator]()}}const $se=Lse;function vh(t,e){GF(t,e),e.add(t)}function pv(t,e,r){GF(t,e),e.set(t,r)}function GF(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function wt(t,e){var r=YF(t,e,"get");return Bse(t,r)}function Bse(t,e){return e.get?e.get.call(t):e.value}function Un(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function G1(t,e,r){var n=YF(t,e,"set");return Wse(t,n,r),r}function YF(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function Wse(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}var Ag=new WeakMap,At=new WeakMap,La=new WeakMap,wv=new WeakSet,vv=new WeakSet,Y1=new WeakSet,Cv=new WeakSet,sl=new WeakSet;class zF{constructor(e,r){vh(this,sl),vh(this,Cv),vh(this,Y1),vh(this,vv),vh(this,wv),pv(this,Ag,{writable:!0,value:void 0}),pv(this,At,{writable:!0,value:void 0}),pv(this,La,{writable:!0,value:{x:0,y:0}}),G1(this,Ag,e),G1(this,At,r)}transformStart(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;Un(this,wv,j_).call(this,{x:wt(this,At).navigableHeaders()?wt(this,At).countRowHeaders():0,y:wt(this,At).navigableHeaders()?wt(this,At).countColHeaders():0});const i=wt(this,At).createCellCoords(e,r);let s=wt(this,Ag).current().highlight;const o=wt(this,At).visualToRenderableCoords(s);let a=0,l=0;if(this.runLocalHooks("beforeTransformStart",i),o.row!==null&&o.col!==null){const{width:c,height:u}=Un(this,Y1,jF).call(this),{row:h,col:d}=Un(this,Cv,X_).call(this,s),f=wt(this,At).fixedRowsBottom(),g=wt(this,At).minSpareRows(),m=wt(this,At).minSpareCols(),w=wt(this,At).autoWrapRow(),C=wt(this,At).autoWrapCol(),S=wt(this,At).createCellCoords(h+i.row,d+i.col);if(S.row>=u){const A=zs(n&&g>0&&f===0),M=S.col+1,E=wt(this,At).createCellCoords(S.row-u,M>=c?M-c:M);this.runLocalHooks("beforeColumnWrap",A,Un(this,sl,Rc).call(this,E),M>=c),A.value?this.runLocalHooks("insertRowRequire",wt(this,At).countRenderableRows()):C&&S.assign(E)}else if(S.row<0){const A=zs(C),M=S.col-1,E=wt(this,At).createCellCoords(u+S.row,M<0?c+M:M);this.runLocalHooks("beforeColumnWrap",A,Un(this,sl,Rc).call(this,E),M<0),C&&S.assign(E)}if(S.col>=c){const A=zs(n&&m>0),M=S.row+1,E=wt(this,At).createCellCoords(M>=u?M-u:M,S.col-c);this.runLocalHooks("beforeRowWrap",A,Un(this,sl,Rc).call(this,E),M>=u),A.value?this.runLocalHooks("insertColRequire",wt(this,At).countRenderableColumns()):w&&S.assign(E)}else if(S.col<0){const A=zs(w),M=S.row-1,E=wt(this,At).createCellCoords(M<0?u+M:M,c+S.col);this.runLocalHooks("beforeRowWrap",A,Un(this,sl,Rc).call(this,E),M<0),w&&S.assign(E)}const{rowDir:v,colDir:T}=Un(this,vv,K_).call(this,S);a=v,l=T,s=Un(this,sl,Rc).call(this,S)}return this.runLocalHooks("afterTransformStart",s,a,l),s}transformEnd(e,r){Un(this,wv,j_).call(this,{x:wt(this,At).navigableHeaders()?wt(this,At).countRowHeaders():0,y:wt(this,At).navigableHeaders()?wt(this,At).countColHeaders():0});const n=wt(this,At).createCellCoords(e,r),i=wt(this,Ag).current(),s=wt(this,At).visualToRenderableCoords(i.highlight),o=i.to.clone();let a=0,l=0;if(this.runLocalHooks("beforeTransformEnd",n),s.row!==null&&s.col!==null){const{row:c,col:u}=Un(this,Cv,X_).call(this,i.to),h=wt(this,At).createCellCoords(c+n.row,u+n.col),{rowDir:d,colDir:f}=Un(this,vv,K_).call(this,h);a=d,l=f;const g=Un(this,sl,Rc).call(this,h);n.row===0&&n.col!==0?o.col=g.col:n.row!==0&&n.col===0?o.row=g.row:(o.row=g.row,o.col=g.col)}return this.runLocalHooks("afterTransformEnd",o,a,l),o}}function j_(t){let{x:e,y:r}=t;G1(this,La,{x:e,y:r})}function K_(t){const{width:e,height:r}=Un(this,Y1,jF).call(this);let n=0,i=0;return t.row<0?(n=-1,t.row=0):t.row>0&&t.row>=r&&(n=1,t.row=r-1),t.col<0?(i=-1,t.col=0):t.col>0&&t.col>=e&&(i=1,t.col=e-1),{rowDir:n,colDir:i}}function jF(){return{width:wt(this,La).x+wt(this,At).countRenderableColumns(),height:wt(this,La).y+wt(this,At).countRenderableRows()}}function X_(t){const{row:e,col:r}=wt(this,At).visualToRenderableCoords(t);return wt(this,At).createCellCoords(wt(this,La).y+e,wt(this,La).x+r)}function Rc(t){const e=t.clone();return e.col=t.col-wt(this,La).x,e.row=t.row-wt(this,La).y,wt(this,At).renderableToVisualCoords(e)}Vt(zF,Qn);const Vse=zF,Hp=0,Fp=1,KF=2,Vb=3,Use=[Vb,KF],Gse=[["number"],["number","string"],["number","undefined"],["number","string","undefined"]],Sv=Symbol("root"),q_=Symbol("child");function Pu(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Sv;if(e!==Sv&&e!==q_)throw new Error("The second argument is used internally only and cannot be overwritten.");const r=Array.isArray(t),n=e===Sv;let i=Hp;if(r){const s=t[0];t.length===0?i=Fp:n&&s instanceof qy?i=Vb:n&&Array.isArray(s)?i=Pu(s,q_):t.length>=2&&t.length<=4&&!t.some((a,l)=>!Gse[l].includes(typeof a))&&(i=KF)}return i}function Kd(t){let{createCellCoords:e,createCellRange:r,keepDirection:n=!1,propToCol:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Use.includes(t))throw new Error("Unsupported selection ranges schema type was provided.");return function(s){const o=t===Vb;let a=o?s.from.row:s[0],l=o?s.from.col:s[1],c=o?s.to.row:s[2],u=o?s.to.col:s[3];if(typeof i=="function"&&(typeof l=="string"&&(l=i(l)),typeof u=="string"&&(u=i(u))),Gt(c)&&(c=a),Gt(u)&&(u=l),!n){const f=a,g=l,m=c,w=u;a=Math.min(f,m),l=Math.min(g,w),c=Math.max(f,m),u=Math.max(g,w)}const h=e(a,l),d=e(c,u);return r(h,h,d)}}function Yse(t){const e=Pu(t.getSelected());if(e===Hp||e===Fp)return[];const r=Kd(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),n=new Set;j(t.getSelected(),o=>{const{from:a,to:l}=r(o),c=Math.max(a.col,0),u=l.col-c+1;j(Array.from(new Array(u),(h,d)=>c+d),h=>{n.has(h)||n.add(h)})});const i=Array.from(n).sort((o,a)=>o-a);return Cn(i,(o,a,l,c)=>(l!==0&&a===c[l-1]+1?o[o.length-1][1]+=1:o.push([a,1]),o),[])}function zse(t){const e=Pu(t.getSelected());if(e===Hp||e===Fp)return[];const r=Kd(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),n=new Set;j(t.getSelected(),o=>{const{from:a,to:l}=r(o),c=Math.max(a.row,0),u=l.row-c+1;j(Array.from(new Array(u),(h,d)=>c+d),h=>{n.has(h)||n.add(h)})});const i=Array.from(n).sort((o,a)=>o-a);return Cn(i,(o,a,l,c)=>(l!==0&&a===c[l-1]+1?o[o.length-1][1]+=1:o.push([a,1]),o),[])}function jse(t,e,r){Kse(t,e),e.set(t,r)}function Kse(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ta(t,e,r){return e=Xse(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,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 r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Z_(t,e,r){var n=XF(t,e,"set");return Zse(t,n,r),r}function Zse(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function J_(t,e){var r=XF(t,e,"get");return Jse(t,r)}function XF(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function Jse(t,e){return e.get?e.get.call(t):e.value}var Ch=new WeakMap;class qF{constructor(e,r){var n=this;ta(this,"settings",void 0),ta(this,"tableProps",void 0),ta(this,"inProgress",!1),ta(this,"selectedRange",new $se((i,s,o)=>this.tableProps.createCellRange(i,s,o))),ta(this,"highlight",void 0),ta(this,"transformation",void 0),ta(this,"selectedByRowHeader",new Set),ta(this,"selectedByColumnHeader",new Set),jse(this,Ch,{writable:!0,value:!1}),this.settings=e,this.tableProps=r,this.highlight=new Nse({headerClassName:e.currentHeaderClassName,activeHeaderClassName:e.activeHeaderClassName,rowClassName:e.currentRowClassName,columnClassName:e.currentColClassName,cellAttributes:[Hy()],rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,disabledCellSelection:(i,s)=>this.tableProps.isDisabledCellSelection(i,s),cellCornerVisible:function(){return n.isCellCornerVisible(...arguments)},areaCornerVisible:function(){return n.isAreaCornerVisible(...arguments)},visualToRenderableCoords:i=>this.tableProps.visualToRenderableCoords(i),renderableToVisualCoords:i=>this.tableProps.renderableToVisualCoords(i),createCellCoords:(i,s)=>this.tableProps.createCellCoords(i,s),createCellRange:(i,s,o)=>this.tableProps.createCellRange(i,s,o)}),this.transformation=new Vse(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,s)=>this.tableProps.createCellCoords(i,s),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,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return n.runLocalHooks("beforeModifyTransformStart",...s)}),this.transformation.addLocalHook("afterTransformStart",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return n.runLocalHooks("afterModifyTransformStart",...s)}),this.transformation.addLocalHook("beforeTransformEnd",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return n.runLocalHooks("beforeModifyTransformEnd",...s)}),this.transformation.addLocalHook("afterTransformEnd",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return n.runLocalHooks("afterModifyTransformEnd",...s)}),this.transformation.addLocalHook("insertRowRequire",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return n.runLocalHooks("insertRowRequire",...s)}),this.transformation.addLocalHook("insertColRequire",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return n.runLocalHooks("insertColRequire",...s)}),this.transformation.addLocalHook("beforeRowWrap",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return n.runLocalHooks("beforeRowWrap",...s)}),this.transformation.addLocalHook("beforeColumnWrap",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return n.runLocalHooks("beforeColumnWrap",...s)})}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,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e;const s=this.settings.selectionMode==="multiple",o=Gt(r)?this.tableProps.getShortcutManager().isCtrlPressed():r,a=e.clone();this.runLocalHooks(`beforeSetRangeStart${n?"Only":""}`,a),(!s||s&&!o&&Gt(r))&&this.selectedRange.clear(),this.selectedRange.add(a).current().setHighlight(i.clone()),this.getLayerLevel()===0&&(this.selectedByRowHeader.clear(),this.selectedByColumnHeader.clear()),n||this.setRangeEnd(e)}setRangeStartOnly(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e;this.setRangeStart(e,r,!0,n)}setRangeEnd(e){if(this.selectedRange.isEmpty())return;const r=e.clone(),n=this.tableProps.countRows(),i=this.tableProps.countCols(),s=this.selectedRange.current().clone().setTo(e).isSingleHeader();if((n>0||i>0)&&(n===0&&r.col<0&&!s||i===0&&r.row<0&&!s))return;this.runLocalHooks("beforeSetRangeEnd",r),this.begin();const o=this.selectedRange.current();this.settings.navigableHeaders||o.highlight.normalize(),this.settings.selectionMode==="single"?(o.setFrom(o.highlight),o.setTo(o.highlight)):o.setTo(r),n>0&&i>0&&(!this.settings.navigableHeaders||this.settings.navigableHeaders&&!o.isSingleHeader())&&o.to.normalize(),this.runLocalHooks("beforeHighlightSet");const a=this.highlight.getFocus();a.clear(),this.highlight.isEnabledFor(ox,o.highlight)&&a.add(this.selectedRange.current().highlight).commit().syncWith(o);const l=this.getLayerLevel();l<this.highlight.layerLevel&&(j(this.highlight.getAreas(),S=>void S.clear()),j(this.highlight.getLayeredAreas(),S=>void S.clear()),j(this.highlight.getRowHeaders(),S=>void S.clear()),j(this.highlight.getColumnHeaders(),S=>void S.clear()),j(this.highlight.getActiveRowHeaders(),S=>void S.clear()),j(this.highlight.getActiveColumnHeaders(),S=>void S.clear()),j(this.highlight.getActiveCornerHeaders(),S=>void S.clear()),j(this.highlight.getRowHighlights(),S=>void S.clear()),j(this.highlight.getColumnHighlights(),S=>void S.clear())),this.highlight.useLayerLevel(l);const c=this.highlight.createArea(),u=this.highlight.createLayeredArea(),h=this.highlight.createRowHeader(),d=this.highlight.createColumnHeader(),f=this.highlight.createActiveRowHeader(),g=this.highlight.createActiveColumnHeader(),m=this.highlight.createActiveCornerHeader(),w=this.highlight.createRowHighlight(),C=this.highlight.createColumnHighlight();if(c.clear(),u.clear(),h.clear(),d.clear(),f.clear(),g.clear(),m.clear(),w.clear(),C.clear(),this.highlight.isEnabledFor(sx,o.highlight)&&(this.isMultiple()||l>=1)&&(c.add(o.from).add(o.to).commit(),u.add(o.from).add(o.to).commit(),l===1)){const S=this.selectedRange.previous();this.highlight.useLayerLevel(l-1),this.highlight.createArea().add(S.from).commit().syncWith(S),this.highlight.createLayeredArea().add(S.from).commit().syncWith(S),this.highlight.useLayerLevel(l)}if(this.highlight.isEnabledFor(ix,o.highlight)){if(!o.isSingleHeader()){const T=this.tableProps.createCellCoords(Math.max(o.from.row,0),-1),A=this.tableProps.createCellCoords(o.to.row,-1),M=this.tableProps.createCellCoords(-1,Math.max(o.from.col,0)),E=this.tableProps.createCellCoords(-1,o.to.col);this.settings.selectionMode==="single"?(h.add(T).commit(),d.add(M).commit(),w.add(T).commit(),C.add(M).commit()):(h.add(T).add(A).commit(),d.add(M).add(E).commit(),w.add(T).add(A).commit(),C.add(M).add(E).commit())}const S=!J_(this,Ch)&&this.isEntireRowSelected()&&(i>0&&i===o.getWidth()||i===0&&this.isSelectedByRowHeader()),v=!J_(this,Ch)&&this.isEntireColumnSelected()&&(n>0&&n===o.getHeight()||n===0&&this.isSelectedByColumnHeader());S&&f.add(this.tableProps.createCellCoords(Math.max(o.from.row,0),Math.min(-this.tableProps.countRowHeaders(),-1))).add(this.tableProps.createCellCoords(Math.max(o.to.row,0),-1)).commit(),v&&g.add(this.tableProps.createCellCoords(Math.min(-this.tableProps.countColHeaders(),-1),Math.max(o.from.col,0))).add(this.tableProps.createCellCoords(-1,Math.max(o.to.col,0))).commit(),S&&v&&m.add(this.tableProps.createCellCoords(-this.tableProps.countColHeaders(),-this.tableProps.countRowHeaders())).add(this.tableProps.createCellCoords(-1,-1)).commit()}this.runLocalHooks("afterSetRangeEnd",e)}isMultiple(){const e=zs(!this.selectedRange.current().isSingle());return this.runLocalHooks("afterIsMultipleSelection",e),e.value}transformStart(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.setRangeStart(this.transformation.transformStart(e,r,n))}transformEnd(e,r){this.setRangeEnd(this.transformation.transformEnd(e,r))}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 r=i=>{const{col:s}=i.getOuterTopStartCorner(),o=this.tableProps.countRowHeaders(),a=this.tableProps.countCols();return(o>0&&s<0||o===0)&&i.getWidth()===a};if(e===-1)return Array.from(this.selectedRange).some(i=>r(i));const n=this.selectedRange.peekByIndex(e);return n?r(n):!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 r=i=>{const{row:s}=i.getOuterTopStartCorner(),o=this.tableProps.countColHeaders(),a=this.tableProps.countRows();return(o>0&&s<0||o===0)&&i.getHeight()===a};if(e===-1)return Array.from(this.selectedRange).some(i=>r(i));const n=this.selectedRange.peekByIndex(e);return n?r(n):!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 r=this.tableProps.visualToRenderableCoords(e);return r.row!==null&&r.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 r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=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 s=this.tableProps.countRows(),o=this.tableProps.countCols(),a=this.tableProps.countRowHeaders(),l=this.tableProps.countColHeaders(),c=n?-l:0,u=r?-a:0;if(c===0&&u===0&&(s===0||o===0))return;let h=(e=this.getSelectedRange().current())===null||e===void 0?void 0:e.highlight;const{focusPosition:d,disableHeadersHighlight:f}=i;Z_(this,Ch,f),d&&Number.isInteger(d==null?void 0:d.row)&&Number.isInteger(d==null?void 0:d.col)&&(h=this.tableProps.createCellCoords(ui(d.row,c,s-1),ui(d.col,u,o-1)));const g=this.tableProps.createCellCoords(c,u),m=this.tableProps.createCellCoords(s-1,o-1);this.clear(),this.setRangeStartOnly(g,void 0,h),u<0&&this.selectedByRowHeader.add(this.getLayerLevel()),c<0&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(m),this.finish(),Z_(this,Ch,!1)}selectCells(e){var r=this;const n=Pu(e);if(n===Fp)return!1;if(n===Hp)throw new Error(Pt`Unsupported format of the selection ranges was passed. To select cells pass\x20
  88. the coordinates as an array of arrays ([[rowStart, columnStart/columnPropStart, rowEnd,\x20
  89. columnEnd/columnPropEnd]]) or as an array of CellRange objects.`);const i=Kd(n,{createCellCoords:function(){return r.tableProps.createCellCoords(...arguments)},createCellRange:function(){return r.tableProps.createCellRange(...arguments)},propToCol:l=>this.tableProps.propToCol(l),keepDirection:!0}),s=this.settings.navigableHeaders,o={countRows:this.tableProps.countRows(),countCols:this.tableProps.countCols(),countRowHeaders:s?this.tableProps.countRowHeaders():0,countColHeaders:s?this.tableProps.countColHeaders():0},a=!e.some(l=>{const c=i(l),u=c.isValid(o);return!(u&&!c.containsHeaders()||u&&c.containsHeaders()&&c.isSingleHeader())});return a&&(this.clear(),j(e,l=>{const{from:c,to:u}=i(l);this.setRangeStartOnly(c.clone(),!1),this.setRangeEnd(u.clone()),this.finish()})),a}selectColumns(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const i=typeof e=="string"?this.tableProps.propToCol(e):e,s=typeof r=="string"?this.tableProps.propToCol(r):r,o=this.tableProps.countRows(),a=this.tableProps.countCols(),l=this.tableProps.countColHeaders(),c=l===0?0:-l,u=this.tableProps.createCellCoords(c,i),h=this.tableProps.createCellCoords(o-1,s),d=this.tableProps.createCellRange(u,u,h).isValid({countRows:o,countCols:a,countRowHeaders:0,countColHeaders:l});if(d){const f=l===0?0:ui(n,c,-1),g=o-1,m=this.tableProps.createCellCoords(f,i),w=this.tableProps.createCellCoords(g,s),C=this.tableProps.createCellCoords(ui(n,c,o-1),i);this.runLocalHooks("beforeSelectColumns",m,w,C),m.row=f,w.row=g,this.setRangeStartOnly(m,void 0,C),this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(w),this.runLocalHooks("afterSelectColumns",m,w,C),this.finish()}return d}selectRows(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const i=this.tableProps.countRows(),s=this.tableProps.countCols(),o=this.tableProps.countRowHeaders(),a=o===0?0:-o,l=this.tableProps.createCellCoords(e,a),c=this.tableProps.createCellCoords(r,s-1),u=this.tableProps.createCellRange(l,l,c).isValid({countRows:i,countCols:s,countRowHeaders:o,countColHeaders:0});if(u){const h=o===0?0:ui(n,a,-1),d=s-1,f=this.tableProps.createCellCoords(e,h),g=this.tableProps.createCellCoords(r,d),m=this.tableProps.createCellCoords(e,ui(n,a,s-1));this.runLocalHooks("beforeSelectRows",f,g,m),f.col=h,g.col=d,this.setRangeStartOnly(f,void 0,m),this.selectedByRowHeader.add(this.getLayerLevel()),this.setRangeEnd(g),this.runLocalHooks("afterSelectRows",f,g,m),this.finish()}return u}refresh(){if(this.highlight.getCustomSelections().forEach(i=>{i.commit()}),!this.isSelected())return;const r=this.highlight.getFocus(),n=this.getLayerLevel();r.commit().syncWith(this.selectedRange.current());for(let i=0;i<this.selectedRange.size();i+=1){this.highlight.useLayerLevel(i);const s=this.highlight.createArea(),o=this.highlight.createLayeredArea(),a=this.highlight.createRowHeader(),l=this.highlight.createColumnHeader(),c=this.highlight.createActiveRowHeader(),u=this.highlight.createActiveColumnHeader(),h=this.highlight.createActiveCornerHeader(),d=this.highlight.createRowHighlight(),f=this.highlight.createColumnHighlight();s.commit(),o.commit(),a.commit(),l.commit(),c.commit(),u.commit(),h.commit(),d.commit(),f.commit()}this.highlight.useLayerLevel(n)}}Vt(qF,Qn);const Qse=qF,Q_=/^(\r\n|\n\r|\r|\n)/,eoe=/^[^\t\r\n]+/,eA=/^\t/;function toe(t){const e=[[""]];if(t.length===0)return e;let r=0,n=0,i;for(;t.length>0&&i!==t.length;)if(i=t.length,t.match(eA))t=t.replace(eA,""),r+=1,e[n][r]="";else if(t.match(Q_))t=t.replace(Q_,""),r=0,n+=1,e[n]=[""];else{let s="";if(t.startsWith('"')){let o=0,a=!0;for(;a;){const l=t.slice(0,1);l==='"'&&(o+=1),s+=l,t=t.slice(1),(t.length===0||t.match(/^[\t\r\n]/)&&o%2===0)&&(a=!1)}s=s.replace(/^"/,"").replace(/"$/,"").replace(/["]*/g,l=>new Array(Math.floor(l.length/2)).fill('"').join(""))}else{const o=t.match(eoe);s=o?o[0]:"",t=t.slice(s.length)}e[n][r]=s}return e}function wd(t){let e,r,n,i,s="",o;for(e=0,r=t.length;e<r;e+=1){for(i=t[e].length,n=0;n<i;n+=1)n>0&&(s+=" "),o=t[e][n],typeof o=="string"?o.indexOf(`
  90. `)>-1?s+=`"${o.replace(/"/g,'""')}"`:s+=o:o==null?s+="":s+=o;e!==r-1&&(s+=`
  91. `)}return s}function ol(t,e,r){return e=roe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function roe(t){var e=noe(t,"string");return typeof e=="symbol"?e:String(e)}function noe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class pu{static get DESTINATION_RENDERER(){return 1}static get DESTINATION_CLIPBOARD_GENERATOR(){return 2}constructor(e,r,n){ol(this,"hot",void 0),ol(this,"metaManager",void 0),ol(this,"tableMeta",void 0),ol(this,"dataSource",void 0),ol(this,"duckSchema",void 0),ol(this,"colToPropCache",void 0),ol(this,"propToColCache",void 0),this.hot=e,this.metaManager=n,this.tableMeta=n.getTableMeta(),this.dataSource=r,this.duckSchema=this.createDuckSchema(),this.createMap()}createMap(){const e=this.getSchema();if(typeof e=="undefined")throw new Error("trying to create `columns` definition but you didn't provide `schema` nor `data`");const r=this.tableMeta.columns;let n;if(this.colToPropCache=[],this.propToColCache=new Map,r){let i=0,s=0,o=!1;if(typeof r=="function"){const a=Vy(e);i=a>0?a:this.countFirstRowKeys(),o=!0}else{const a=this.tableMeta.maxCols;i=Math.min(a,r.length)}for(n=0;n<i;n++){const a=o?r(n):r[n];if(at(a)){if(typeof a.data!="undefined"){const l=o?s:n;this.colToPropCache[l]=a.data,this.propToColCache.set(a.data,l)}s+=1}}}else this.recursiveDuckColumns(e)}countFirstRowKeys(){return AF(this.dataSource)}recursiveDuckColumns(e,r,n){let i=r,s=n,o;return typeof i=="undefined"&&(i=0,s=""),typeof e=="object"&&!Array.isArray(e)&&dt(e,(a,l)=>{a===null?(o=s+l,this.colToPropCache.push(o),this.propToColCache.set(o,i),i+=1):i=this.recursiveDuckColumns(a,i,`${l}.`)}),i}colToProp(e){if(Number.isInteger(e)===!1)return e;const r=this.hot.toPhysicalColumn(e);return r===null?e:this.colToPropCache&&He(this.colToPropCache[r])?this.colToPropCache[r]:r}propToCol(e){const r=this.propToColCache.get(e);if(He(r))return this.hot.toVisualColumn(r);const n=this.hot.toVisualColumn(e);return n===null?e:n}getSchema(){const e=this.tableMeta.dataSchema;return e?typeof e=="function"?e():e:this.duckSchema}createDuckSchema(){return this.dataSource&&this.dataSource[0]?zd(this.dataSource[0]):{}}refreshDuckSchema(){this.duckSchema=this.createDuckSchema()}createRow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,{source:n,mode:i="above"}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.hot.countSourceRows();let o=s,a=0,l=e;if((typeof l!="number"||l>=s)&&(l=s),l<this.hot.countRows()&&(o=this.hot.toPhysicalRow(l)),this.hot.runHooks("beforeCreateRow",l,r,n)===!1||o===null)return{delta:0};const u=this.tableMeta.maxRows,h=this.getSchema().length,d=[];for(;a<r&&s+a<u;){let g=null;this.hot.dataType==="array"?this.tableMeta.dataSchema?g=Hn(this.getSchema()):(g=[],Ue(h-1,()=>g.push(null))):this.hot.dataType==="function"?g=this.tableMeta.dataSchema(l+a):(g={},Ap(g,this.getSchema())),d.push(g),a+=1}this.hot.rowIndexMapper.insertIndexes(l,a),i==="below"&&(o=Math.min(o+1,s)),this.spliceData(o,0,d);const f=this.hot.toVisualRow(o);return this.hot.countSourceRows()===d.length&&this.hot.columnIndexMapper.initToLength(this.hot.getInitialColumnCount()),a>0&&(e==null?this.metaManager.createRow(null,a):n!=="auto"&&this.metaManager.createRow(o,r)),this.hot.runHooks("afterCreateRow",f,a,n),this.hot.forceFullRender=!0,{delta:a,startPhysicalIndex:o}}createCol(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,{source:n,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 s=this.dataSource,o=this.tableMeta.maxCols,a=this.hot.countSourceCols();let l=e;if((typeof l!="number"||l>=a)&&(l=a),this.hot.runHooks("beforeCreateCol",l,r,n)===!1)return{delta:0};let u=a;l<this.hot.countCols()&&(u=this.hot.toPhysicalColumn(l));const h=this.hot.countSourceRows();let d=this.hot.countCols(),f=0,g=u;i==="end"&&(g=Math.min(g+1,a));const m=g;for(;f<r&&d<o;){if(typeof l!="number"||l>=d)if(h>0)for(let C=0;C<h;C+=1)typeof s[C]=="undefined"&&(s[C]=[]),s[C].push(null);else s.push([null]);else for(let C=0;C<h;C++)s[C].splice(g,0,null);f+=1,g+=1,d+=1}this.hot.columnIndexMapper.insertIndexes(l,f),f>0&&(e==null?this.metaManager.createColumn(null,f):n!=="auto"&&this.metaManager.createColumn(m,r));const w=this.hot.toVisualColumn(m);return this.hot.runHooks("afterCreateCol",w,f,n),this.hot.forceFullRender=!0,this.refreshDuckSchema(),{delta:f,startPhysicalIndex:m}}removeRow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=arguments.length>2?arguments[2]:void 0,i=Number.isInteger(e)?e:-r;const s=this.visualRowsToPhysical(i,r),o=this.hot.countSourceRows();if(i=(o+i)%o,this.hot.runHooks("beforeRemoveRow",i,s.length,s,n)===!1)return!1;const l=s.length;if(this.filterData(i,l,s),i<this.hot.countRows()){this.hot.rowIndexMapper.removeIndexes(s);const u=He(this.tableMeta.columns)||He(this.tableMeta.dataSchema);this.hot.rowIndexMapper.getNotTrimmedIndexesLength()===0&&u===!1&&this.hot.columnIndexMapper.setIndexesSequence([])}return s.slice(0).sort((u,h)=>h-u).forEach(u=>{this.metaManager.removeRow(u,1)}),this.hot.runHooks("afterRemoveRow",i,l,s,n),this.hot.forceFullRender=!0,!0}removeCol(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=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"?-r:e;i=(this.hot.countCols()+i)%this.hot.countCols();const s=this.visualColumnsToPhysical(i,r),o=s.slice(0).sort((h,d)=>d-h);if(this.hot.runHooks("beforeRemoveCol",i,r,s,n)===!1)return!1;let l=!0;const c=o.length,u=this.dataSource;for(let h=0;h<c;h++)l&&s[0]!==s[h]-h&&(l=!1);if(l)for(let h=0,d=this.hot.countSourceRows();h<d;h++)u[h].splice(s[0],r),h===0&&this.metaManager.removeColumn(s[0],r);else for(let h=0,d=this.hot.countSourceRows();h<d;h++)for(let f=0;f<c;f++)u[h].splice(o[f],1),h===0&&this.metaManager.removeColumn(o[f],1);return i<this.hot.countCols()&&(this.hot.columnIndexMapper.removeIndexes(s),this.hot.columnIndexMapper.getNotTrimmedIndexesLength()===0&&this.hot.rowIndexMapper.setIndexesSequence([])),this.hot.runHooks("afterRemoveCol",i,r,s,n),this.hot.forceFullRender=!0,this.refreshDuckSchema(),!0}spliceCol(e,r,n){const i=this.hot.getDataAtCol(e),s=i.slice(r,r+n),o=i.slice(r+n);for(var a=arguments.length,l=new Array(a>3?a-3:0),c=3;c<a;c++)l[c-3]=arguments[c];kT(l,o);let u=0;for(;u<n;)l.push(null),u+=1;return GJ(l),this.hot.populateFromArray(r,e,l,null,null,"spliceCol"),s}spliceRow(e,r,n){const i=this.hot.getSourceDataAtRow(e),s=i.slice(r,r+n),o=i.slice(r+n);for(var a=arguments.length,l=new Array(a>3?a-3:0),c=3;c<a;c++)l[c-3]=arguments[c];kT(l,o);let u=0;for(;u<n;)l.push(null),u+=1;return this.hot.populateFromArray(e,r,[l],null,null,"spliceRow"),s}spliceData(e,r,n){if(this.hot.runHooks("beforeDataSplice",e,r,n)!==!1){const s=[...this.dataSource.slice(0,e),...n,...this.dataSource.slice(e)];this.dataSource.length=0,s.forEach(o=>this.dataSource.push(o))}}filterData(e,r,n){let i=this.hot.runHooks("filterData",e,r,n);Array.isArray(i)===!1&&(i=this.dataSource.filter((s,o)=>n.indexOf(o)===-1)),this.dataSource.length=0,Array.prototype.push.apply(this.dataSource,i)}get(e,r){const n=this.hot.toPhysicalRow(e);let i=this.dataSource[n];const s=this.hot.runHooks("modifyRowData",n);i=isNaN(s)?s:i;let o=null;if(i&&i.hasOwnProperty&&lr(i,r))o=i[r];else if(typeof r=="string"&&r.indexOf(".")>-1){const a=r.split(".");let l=i;if(!l)return null;for(let c=0,u=a.length;c<u;c++)if(l=l[a[c]],typeof l=="undefined")return null;o=l}else typeof r=="function"&&(o=r(this.dataSource.slice(n,n+1)[0]));if(this.hot.hasHook("modifyData")){const a=zs(o);this.hot.runHooks("modifyData",n,this.propToCol(r),a,"get"),a.isTouched()&&(o=a.value)}return o}getCopyable(e,r){return this.hot.getCellMeta(e,this.propToCol(r)).copyable?this.get(e,r):""}set(e,r,n){const i=this.hot.toPhysicalRow(e);let s=n,o=this.dataSource[i];const a=this.hot.runHooks("modifyRowData",i);if(o=isNaN(a)?a:o,this.hot.hasHook("modifyData")){const l=zs(s);this.hot.runHooks("modifyData",i,this.propToCol(r),l,"set"),l.isTouched()&&(s=l.value)}if(o&&o.hasOwnProperty&&lr(o,r))o[r]=s;else if(typeof r=="string"&&r.indexOf(".")>-1){const l=r.split(".");let c=o,u=0,h;for(u=0,h=l.length-1;u<h;u++)typeof c[l[u]]=="undefined"&&(c[l[u]]={}),c=c[l[u]];c[l[u]]=s}else typeof r=="function"?r(this.dataSource.slice(i,i+1)[0],s):o[r]=s}visualRowsToPhysical(e,r){const n=this.hot.countSourceRows(),i=[];let s=(n+e)%n,o=r,a;for(;s<n&&o;)a=this.hot.toPhysicalRow(s),i.push(a),o-=1,s+=1;return i}visualColumnsToPhysical(e,r){const n=this.hot.countCols(),i=[];let s=(n+e)%n,o=r;for(;s<n&&o;){const a=this.hot.toPhysicalColumn(s);i.push(a),o-=1,s+=1}return i}clear(){for(let e=0;e<this.hot.countSourceRows();e++)for(let r=0;r<this.hot.countCols();r++)this.set(e,this.colToProp(r),"")}getLength(){const e=this.tableMeta.maxRows;let r;e<0||e===0?r=0:r=e||1/0;const n=this.hot.rowIndexMapper.getNotTrimmedIndexesLength();return Math.min(n,r)}getAll(){const e={row:0,col:0},r={row:Math.max(this.hot.countRows()-1,0),col:Math.max(this.hot.countCols()-1,0)};return e.row-r.row===0&&!this.hot.countSourceRows()?[]:this.getRange(e,r,pu.DESTINATION_RENDERER)}countCachedColumns(){return this.colToPropCache.length}getRange(e,r,n){const i=[];let s,o,a;const l=this.tableMeta.maxRows,c=this.tableMeta.maxCols;if(l===0||c===0)return[];const u=n===pu.DESTINATION_CLIPBOARD_GENERATOR?this.getCopyable:this.get,h=Math.min(Math.max(l-1,0),Math.max(e.row,r.row)),d=Math.min(Math.max(c-1,0),Math.max(e.col,r.col));for(s=Math.min(e.row,r.row);s<=h;s++){a=[];const f=s>=0?this.hot.toPhysicalRow(s):s;for(o=Math.min(e.col,r.col);o<=d&&f!==null;o++)a.push(u.call(this,s,this.colToProp(o)));f!==null&&i.push(a)}return i}getText(e,r){return wd(this.getRange(e,r,pu.DESTINATION_RENDERER))}getCopyableText(e,r){return wd(this.getRange(e,r,pu.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 ioe=pu,{register:soe,getItem:ooe,hasItem:ZF,getNames:Exe,getValues:Rxe}=Cs("cellTypes");function aoe(t){if(!ZF(t))throw Error(`You declared cell type "${t}" as a string that is not mapped to a known object.
  92. Cell type must be an object or a string mapped to an object registered by
  93. "Handsontable.cellTypes.registerCellType" method`);return ooe(t)}function es(t,e){typeof t!="string"&&(e=t,t=e.CELL_TYPE);const{editor:r,renderer:n,validator:i}=e;r&&ri(t,r),n&&bi(t,n),i&&au(t,i),soe(t,e)}function loe(t,e){var r;return t==="CELL_TYPE"?!1:((r=e._automaticallyAssignedMetaProps)===null||r===void 0?void 0:r.has(t))||!lr(e,t)}function Lp(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;const n=typeof e.type=="string"?aoe(e.type):e.type;if(t._automaticallyAssignedMetaProps&&dt(e,(s,o)=>void t._automaticallyAssignedMetaProps.delete(o)),!at(n))return;r===t&&!t._automaticallyAssignedMetaProps&&(t._automaticallyAssignedMetaProps=new Set);const i={};dt(n,(s,o)=>{if(loe(o,r)){var a;i[o]=s,(a=t._automaticallyAssignedMetaProps)===null||a===void 0||a.add(o)}}),Ar(t,i)}function coe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];function r(){}za(r,t);for(let n=0;n<e.length;n++)r.prototype[e[n]]=void 0;return r}function k0(t){return Number.isInteger(t)&&t>=0}function N0(t,e){if(!t())throw new Error(`Assertion failed: ${e}`)}function Mg(t){return t==null}const JF=()=>({_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,r,n;for(e=0,r=this.countRows();e<r;e++)if(n=this.getDataAtCell(e,t),kr(n)===!1)return!1;return!0},isEmptyRow(t){let e,r,n,i;for(e=0,r=this.countCols();e<r;e++)if(n=this.getDataAtCell(t,e),kr(n)===!1)return typeof n=="object"?(i=this.getCellMeta(t,e),Wy(this.getSchema()[i.prop],n)):!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 tA(t,e,r){return e=uoe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function uoe(t){var e=hoe(t,"string");return typeof e=="symbol"?e:String(e)}function hoe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function doe(){return class{}}class foe{constructor(e){tA(this,"metaCtor",doe()),tA(this,"meta",void 0),this.meta=this.metaCtor.prototype,Ar(this.meta,JF()),this.meta.instance=e}getMetaConstructor(){return this.metaCtor}getMeta(){return this.meta}updateMeta(e){var r;Ar(this.meta,e),Lp(this.meta,Zr(yt({},e),{type:(r=e.type)!==null&&r!==void 0?r:this.meta.type}),e)}}function goe(t,e,r){return e=moe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function moe(t){var e=poe(t,"string");return typeof e=="symbol"?e:String(e)}function poe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class woe{constructor(e){goe(this,"meta",void 0);const r=e.getMetaConstructor();this.meta=new r}getMeta(){return this.meta}updateMeta(e){Ar(this.meta,e),Lp(this.meta,e,e)}}let QF;function Og(t,e,r){return e=voe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function voe(t){var e=Coe(t,"string");return typeof e=="symbol"?e:String(e)}function Coe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}QF=Symbol.iterator;class _m{constructor(e){Og(this,"valueFactory",void 0),Og(this,"data",[]),Og(this,"index",[]),Og(this,"holes",new Set),this.valueFactory=e}obtain(e){N0(()=>k0(e),"Expecting an unsigned number.");const r=this._getStorageIndexByKey(e);let n;if(r>=0)n=this.data[r],n===void 0&&(n=this.valueFactory(e),this.data[r]=n);else if(n=this.valueFactory(e),this.holes.size>0){const i=this.holes.values().next().value;this.holes.delete(i),this.data[i]=n,this.index[e]=i}else this.data.push(n),this.index[e]=this.data.length-1;return n}insert(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;N0(()=>k0(e)||Mg(e),"Expecting an unsigned number or null/undefined argument.");const n=[],i=this.data.length;for(let o=0;o<r;o++)n.push(i+o),this.data.push(void 0);const s=Mg(e)?this.index.length:e;this.index=[...this.index.slice(0,s),...n,...this.index.slice(s)]}remove(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;N0(()=>k0(e)||Mg(e),"Expecting an unsigned number or null/undefined argument.");const n=this.index.splice(Mg(e)?this.index.length-r:e,r);for(let i=0;i<n.length;i++){const s=n[i];typeof s=="number"&&this.holes.add(s)}}size(){return this.data.length-this.holes.size}values(){return Ni(this.data,(e,r)=>!this.holes.has(r))[Symbol.iterator]()}entries(){const e=[];for(let n=0;n<this.data.length;n++){const i=this._getKeyByStorageIndex(n);i!==-1&&e.push([i,this.data[n]])}let r=0;return{next:()=>{if(r<e.length){const n=e[r];return r+=1,{value:n,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)}[QF](){return this.entries()}}function rA(t,e,r){return e=Soe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Soe(t){var e=yoe(t,"string");return typeof e=="symbol"?e:String(e)}function yoe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const xoe=["data","width"];class boe{constructor(e){rA(this,"globalMeta",void 0),rA(this,"metas",new _m(()=>this._createMeta())),this.globalMeta=e,this.metas=new _m(()=>this._createMeta())}updateMeta(e,r){const n=this.getMeta(e);Ar(n,r),Lp(n,r)}createColumn(e,r){this.metas.insert(e,r)}removeColumn(e,r){this.metas.remove(e,r)}getMeta(e){return this.metas.obtain(e)}getMetaConstructor(e){return this.metas.obtain(e).constructor}clearCache(){this.metas.clear()}_createMeta(){return coe(this.globalMeta.getMetaConstructor(),xoe).prototype}}function nA(t,e,r){return e=Eoe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Eoe(t){var e=Roe(t,"string");return typeof e=="symbol"?e:String(e)}function Roe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Toe{constructor(e){nA(this,"columnMeta",void 0),nA(this,"metas",new _m(()=>this._createRow())),this.columnMeta=e}updateMeta(e,r,n){const i=this.getMeta(e,r);Ar(i,n),Lp(i,n)}createRow(e,r){this.metas.insert(e,r)}createColumn(e,r){for(let n=0;n<this.metas.size();n++)this.metas.obtain(n).insert(e,r)}removeRow(e,r){this.metas.remove(e,r)}removeColumn(e,r){for(let n=0;n<this.metas.size();n++)this.metas.obtain(n).remove(e,r)}getMeta(e,r,n){const i=this.metas.obtain(e).obtain(r);return n===void 0?i:i[n]}setMeta(e,r,n,i){var s;const o=this.metas.obtain(e).obtain(r);(s=o._automaticallyAssignedMetaProps)===null||s===void 0||s.delete(n),o[n]=i}removeMeta(e,r,n){const i=this.metas.obtain(e).obtain(r);delete i[n]}getMetas(){const e=[],r=Array.from(this.metas.values());for(let n=0;n<r.length;n++)e.push(...r[n].values());return e}getMetasAtRow(e){N0(()=>k0(e),"Expecting an unsigned number.");const r=new Map(this.metas);return r.has(e)?Array.from(r.get(e).values()):[]}clearCache(){this.metas.clear()}_createRow(){return new _m(e=>this._createMeta(e))}_createMeta(e){const r=this.columnMeta.getMetaConstructor(e);return new r}}class eL{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];this.hot=e,this.globalMeta=new foe(e),this.tableMeta=new woe(this.globalMeta),this.columnMeta=new boe(this.globalMeta),this.cellMeta=new Toe(this.columnMeta),n.forEach(i=>new i(this)),this.globalMeta.updateMeta(r)}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,r){this.columnMeta.updateMeta(e,r)}getCellMeta(e,r,n){let{visualRow:i,visualColumn:s}=n;const o=this.cellMeta.getMeta(e,r);return o.visualRow=i,o.visualCol=s,o.row=e,o.col=r,this.runLocalHooks("afterGetCellMeta",o),o}getCellMetaKeyValue(e,r,n){if(typeof n!="string")throw new Error("The passed cell meta object key is not a string");return this.cellMeta.getMeta(e,r,n)}setCellMeta(e,r,n,i){this.cellMeta.setMeta(e,r,n,i)}updateCellMeta(e,r,n){this.cellMeta.updateMeta(e,r,n)}removeCellMeta(e,r,n){this.cellMeta.removeMeta(e,r,n)}getCellsMeta(){return this.cellMeta.getMetas()}getCellsMetaAtRow(e){return this.cellMeta.getMetasAtRow(e)}createRow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.createRow(e,r)}removeRow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.removeRow(e,r)}createColumn(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.createColumn(e,r),this.columnMeta.createColumn(e,r)}removeColumn(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.removeColumn(e,r),this.columnMeta.removeColumn(e,r)}clearCellsCache(){this.cellMeta.clearCache()}clearCache(){this.cellMeta.clearCache(),this.columnMeta.clearCache()}}Vt(eL,Qn);function iA(t,e,r,n){const{hotInstance:i,dataMap:s,dataSource:o,internalSource:a,source:l,metaManager:c,firstRun:u}=n,h=gs(a),d=i.getSettings();Array.isArray(d.dataSchema)?i.dataType="array":Ut(d.dataSchema)?i.dataType="function":i.dataType="object",s&&s.destroy(),t=i.runHooks(`before${h}`,t,u,l);const f=new ioe(i,t,c);if(e(f),typeof t=="object"&&t!==null)t.push&&t.splice||(t=[t]);else if(t===null){const g=f.getSchema();t=[];let m,w=0,C=0;for(w=0,C=d.startRows;w<C;w++)if((i.dataType==="object"||i.dataType==="function")&&d.dataSchema)m=Hn(g),t.push(m);else if(i.dataType==="array")m=Hn(g[0]),t.push(m);else{m=[];for(let S=0,v=d.startCols;S<v;S++)m.push(null);t.push(m)}}else throw new Error(`${a} only accepts array of objects or array of arrays (${typeof t} given)`);Array.isArray(t[0])&&(i.dataType="array"),d.data=t,f.dataSource=t,o.data=t,o.dataType=i.dataType,o.colToProp=f.colToProp.bind(f),o.propToCol=f.propToCol.bind(f),o.countCachedColumns=f.countCachedColumns.bind(f),r(f),i.runHooks(`after${h}`,t,u,l),u||(i.runHooks("afterChange",null,a),i.render()),i.getSettings().ariaTags&&qe(i.rootElement,[dH(-1),Rp(i.countCols()+(i.view?i.countRowHeaders():0))])}function sA(t,e,r){return e=_oe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _oe(t){var e=Aoe(t,"string");return typeof e=="symbol"?e:String(e)}function Aoe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Moe{constructor(e){sA(this,"metaManager",void 0),sA(this,"metaSyncMemo",new Map),this.metaManager=e,e.addLocalHook("afterGetCellMeta",r=>this.extendCellMeta(r)),$e.getSingleton().add("beforeRender",r=>{r&&this.metaSyncMemo.clear()},this.metaManager.hot)}extendCellMeta(e){var r;const{row:n,col:i}=e;if((r=this.metaSyncMemo.get(n))!==null&&r!==void 0&&r.has(i))return;const{visualRow:s,visualCol:o}=e,a=this.metaManager.hot,l=a.colToProp(o);e.prop=l,a.runHooks("beforeGetCellMeta",s,o,e);const c=lr(e,"type")?e.type:null;let u=Ut(e.cells)?e.cells(n,i,l):null;if(c)if(u){var h;u.type=(h=u.type)!==null&&h!==void 0?h:c}else u={type:c};u&&this.metaManager.updateCellMeta(n,i,u),a.runHooks("afterGetCellMeta",s,o,e),this.metaSyncMemo.has(n)||this.metaSyncMemo.set(n,new Set),this.metaSyncMemo.get(n).add(i)}}function yv(t,e,r){return e=Ooe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,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 r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Poe{constructor(e){yv(this,"metaManager",void 0),yv(this,"usageTracker",new Set),yv(this,"propDescriptors",new Map([["ariaTags",{onChange(r,n,i){if(!i)throw new Error(`The \`${r}\` option can not be updated after the Handsontable instance was initialized.`)}}],["fixedColumnsLeft",{target:"fixedColumnsStart",onChange(r){if(this.metaManager.hot.isRtl()&&r==="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(r,n,i){if(!i)throw new Error(`The \`${r}\` option can not be updated after the Handsontable is initialized.`)}}]])),this.metaManager=e,this.extendMetaProps()}extendMetaProps(){this.propDescriptors.forEach((e,r)=>{const{target:n,onChange:i=()=>{}}=e,s=typeof n=="string",o=s?n:r,a=`_${o}`;this.metaManager.globalMeta.meta[a]=this.metaManager.globalMeta.meta[o],this.installPropWatcher(r,a,i),s&&this.installPropWatcher(n,a,i)})}installPropWatcher(e,r,n){const i=this;Object.defineProperty(this.metaManager.globalMeta.meta,e,{get(){return this[r]},set(s){const o=!i.usageTracker.has(e);i.usageTracker.add(e),n.call(i,e,s,o),this[r]=s},enumerable:!0,configurable:!0})}}const tL="gridDefault",Ub="editorManager.handlingEditor",Doe={name:"editorCloseAndSave",callback(t,e,r){const n=t._getEditorManager();n.closeEditorAndSaveChanges(e.ctrlKey||e.metaKey),n.moveSelectionAfterEnter(r.includes("shift"))}},koe={name:"editorCloseWithoutSaving",callback(t){const e=t._getEditorManager();e.closeEditorAndRestoreOriginalValue(t.getShortcutManager().isCtrlPressed()),e.activeEditor.focus()}},Noe={name:"editorFastOpen",callback(t,e){const{highlight:r}=t.getSelectedRangeLast();r.isHeader()||t._getEditorManager().openEditor(null,e,!0)}},Hoe={name:"editorOpen",callback(t,e,r){const n=t._getEditorManager(),{highlight:i}=t.getSelectedRangeLast();i.isHeader()||(t.getSettings().enterBeginsEditing?n.cellProperties.readOnly?n.moveSelectionAfterEnter():n.openEditor(null,e,!0):n.moveSelectionAfterEnter(r.includes("shift")),vs(e))}};function Foe(){return[Doe,koe,Noe,Hoe]}const Loe={name:"extendCellsSelectionDown",callback(t){const{highlight:e}=t.getSelectedRangeLast();(e.isCell()||e.isHeader()&&t.selection.isSelectedByRowHeader())&&t.selection.transformEnd(1,0)}},$oe={name:"extendCellsSelectionDownByViewportHeight",callback(t){const{to:e}=t.getSelectedRangeLast(),r=Math.min(e.row+t.countVisibleRows(),t.countRows()-1),n=t.rowIndexMapper.getNearestNotHiddenIndex(r,-1);if(n!==null){const i=t._createCellCoords(n,e.col),s=e.row-t.view.getFirstFullyVisibleRow(),o=Math.min(i.row-s,t.countRows()-1);t.selection.setRangeEnd(i),t.scrollViewportTo({row:o,verticalSnap:"top",horizontalSnap:"start"})}}},Boe={name:"extendCellsSelectionLeft",callback(t){const{highlight:e}=t.getSelectedRangeLast();(e.isCell()||e.isHeader()&&t.selection.isSelectedByColumnHeader())&&t.selection.transformEnd(0,-1*t.getDirectionFactor())}},Woe={name:"extendCellsSelectionRight",callback(t){const{highlight:e}=t.getSelectedRangeLast();(e.isCell()||e.isHeader()&&t.selection.isSelectedByColumnHeader())&&t.selection.transformEnd(0,t.getDirectionFactor())}},Voe={name:"extendCellsSelectionToColumns",callback(t){const{highlight:e,from:r,to:n}=t.getSelectedRangeLast();t.selection.isSelectedByRowHeader()?t.selection.selectAll(!0,!0):t.selectColumns(r.col,n.col,e.row)}},Uoe={name:"extendCellsSelectionToMostBottom",callback(t){const{selection:e,rowIndexMapper:r}=t,{highlight:n,from:i,to:s}=t.getSelectedRangeLast(),o=n.isHeader()&&t.selection.isSelectedByRowHeader();if(n.isCell()||o){const a=r.getNearestNotHiddenIndex(t.countRows()-1,-1);e.setRangeStart(i.clone()),o&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(a,s.col))}}},Goe={name:"extendCellsSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:r}=t,{highlight:n}=t.getSelectedRangeLast();n.isCell()&&e.setRangeEnd(t._createCellCoords(e.selectedRange.current().from.row,r.getNearestNotHiddenIndex(t.countCols()-1,-1)))}},Yoe={name:"extendCellsSelectionToMostInlineStart",callback(t){const{selection:e,columnIndexMapper:r}=t,{highlight:n}=t.getSelectedRangeLast();n.isCell()&&e.setRangeEnd(t._createCellCoords(e.selectedRange.current().from.row,r.getNearestNotHiddenIndex(0,1)))}},zoe={name:"extendCellsSelectionToMostLeft",callback(t){const{selection:e,columnIndexMapper:r}=t,{highlight:n,from:i,to:s}=t.getSelectedRangeLast(),o=n.isHeader()&&t.selection.isSelectedByColumnHeader();if(n.isCell()||o){const a=r.getNearestNotHiddenIndex(...t.isRtl()?[t.countCols()-1,-1]:[0,1]);e.setRangeStart(i.clone()),o&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(s.row,a))}}},joe={name:"extendCellsSelectionToMostRight",callback(t){const{selection:e,columnIndexMapper:r}=t,{highlight:n,from:i,to:s}=t.getSelectedRangeLast(),o=n.isHeader()&&t.selection.isSelectedByColumnHeader();if(n.isCell()||o){const a=r.getNearestNotHiddenIndex(...t.isRtl()?[0,1]:[t.countCols()-1,-1]);e.setRangeStart(i.clone()),o&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(s.row,a))}}},Koe={name:"extendCellsSelectionToMostTop",callback(t){const{selection:e,rowIndexMapper:r}=t,{highlight:n,from:i,to:s}=t.getSelectedRangeLast(),o=n.isHeader()&&t.selection.isSelectedByRowHeader();if(n.isCell()||o){const a=r.getNearestNotHiddenIndex(0,1);e.setRangeStart(i.clone()),o&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(a,s.col))}}},Xoe={name:"extendCellsSelectionToRows",callback(t){const{highlight:e,from:r,to:n}=t.getSelectedRangeLast();t.selection.isSelectedByColumnHeader()?t.selection.selectAll(!0,!0):t.selectRows(r.row,n.row,e.col)}},qoe={name:"extendCellsSelectionUp",callback(t){const{highlight:e}=t.getSelectedRangeLast();(e.isCell()||e.isHeader()&&t.selection.isSelectedByRowHeader())&&t.selection.transformEnd(-1,0)}},Zoe={name:"extendCellsSelectionUpByViewportHeight",callback(t){const{to:e}=t.getSelectedRangeLast(),r=Math.max(e.row-t.countVisibleRows(),0),n=t.rowIndexMapper.getNearestNotHiddenIndex(r,1);if(n!==null){const i=t._createCellCoords(n,e.col),s=e.row-t.view.getFirstFullyVisibleRow(),o=Math.max(i.row-s,0);t.selection.setRangeEnd(i),t.scrollViewportTo({row:o,verticalSnap:"top",horizontalSnap:"start"})}}};function Joe(){return[Loe,$oe,Boe,Woe,Voe,Uoe,Goe,Yoe,zoe,joe,Koe,Xoe,qoe,Zoe]}const Qoe={name:"moveCellSelectionDown",callback(t){let{selection:e}=t;e.transformStart(1,0)}},eae={name:"moveCellSelectionDownByViewportHeight",callback(t){const{navigableHeaders:e}=t.getSettings(),r=e?t.countColHeaders():0,{row:n}=t.getSelectedRangeLast().highlight;let i=t.countVisibleRows()+r;n===t.countRows()-1?i=1:n+i>t.countRows()&&(i=t.countRows()-n-1),t.selection.transformStart(i,0),t.getSelectedRangeLast().highlight.row<0&&t.scrollViewportTo({row:0})}},tae={name:"moveCellSelectionInlineEnd",callback(t,e){const r=t.getSettings(),n=typeof r.tabMoves=="function"?r.tabMoves(e):r.tabMoves;t.selection.transformStart(-n.row,-n.col)}},rae={name:"moveCellSelectionInlineStart",callback(t,e){const r=t.getSettings(),n=typeof r.tabMoves=="function"?r.tabMoves(e):r.tabMoves;t.selection.transformStart(n.row,n.col)}},nae={name:"moveCellSelectionLeft",callback(t){t.selection.transformStart(0,-1*t.getDirectionFactor())}},iae={name:"moveCellSelectionRight",callback(t){t.selection.transformStart(0,t.getDirectionFactor())}},sae={name:"moveCellSelectionToMostBottom",callback(t){const{col:e}=t.getSelectedRangeLast().highlight;let r=t.rowIndexMapper.getNearestNotHiddenIndex(t.countRows()-1,-1);r===null&&(r=-1),t.selection.setRangeStart(t._createCellCoords(r,e))}},oae={name:"moveCellSelectionToMostBottomInlineEnd",callback(t){const{selection:e,rowIndexMapper:r,columnIndexMapper:n}=t,i=parseInt(t.getSettings().fixedRowsBottom,10),s=r.getNearestNotHiddenIndex(t.countRows()-i-1,-1),o=n.getNearestNotHiddenIndex(t.countCols()-1,-1);e.setRangeStart(t._createCellCoords(s,o))}},aae={name:"moveCellSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:r}=t;e.setRangeStart(t._createCellCoords(t.getSelectedRangeLast().highlight.row,r.getNearestNotHiddenIndex(t.countCols()-1,-1)))}},lae={name:"moveCellSelectionToMostInlineStart",callback(t){const{selection:e,columnIndexMapper:r}=t,n=parseInt(t.getSettings().fixedColumnsStart,10),i=t.getSelectedRangeLast().highlight.row,s=r.getNearestNotHiddenIndex(n,1);e.setRangeStart(t._createCellCoords(i,s))}},cae={name:"moveCellSelectionToMostLeft",callback(t){const{selection:e,columnIndexMapper:r}=t,n=t.getSelectedRangeLast().highlight.row;let i=r.getNearestNotHiddenIndex(...t.isRtl()?[t.countCols()-1,-1]:[0,1]);i===null&&(i=t.isRtl()?-1:-t.countRowHeaders()),e.setRangeStart(t._createCellCoords(n,i))}},uae={name:"moveCellSelectionToMostRight",callback(t){const{selection:e,columnIndexMapper:r}=t,{row:n}=t.getSelectedRangeLast().highlight;let i=r.getNearestNotHiddenIndex(...t.isRtl()?[0,1]:[t.countCols()-1,-1]);i===null&&(i=t.isRtl()?-t.countRowHeaders():-1),e.setRangeStart(t._createCellCoords(n,i))}},hae={name:"moveCellSelectionToMostTop",callback(t){const{col:e}=t.getSelectedRangeLast().highlight;let r=t.rowIndexMapper.getNearestNotHiddenIndex(0,1);r===null&&(r=-t.countColHeaders()),t.selection.setRangeStart(t._createCellCoords(r,e))}},dae={name:"moveCellSelectionToMostTopInlineStart",callback(t){const{selection:e,rowIndexMapper:r,columnIndexMapper:n}=t,i=parseInt(t.getSettings().fixedRowsTop,10),s=parseInt(t.getSettings().fixedColumnsStart,10),o=r.getNearestNotHiddenIndex(i,1),a=n.getNearestNotHiddenIndex(s,1);e.setRangeStart(t._createCellCoords(o,a))}},fae={name:"moveCellSelectionUp",callback(t){let{selection:e}=t;e.transformStart(-1,0)}},gae={name:"moveCellSelectionUpByViewportHight",callback(t){const{navigableHeaders:e}=t.getSettings(),r=e?t.countColHeaders():0,{row:n}=t.getSelectedRangeLast().highlight;let i=-(t.countVisibleRows()+r);n===-r?i=-1:n+i<r&&(i=-(n+r)),t.selection.transformStart(i,0),t.getSelectedRangeLast().highlight.row<0&&t.scrollViewportTo({row:0})}};function mae(){return[Qoe,eae,tae,rae,nae,iae,sae,oae,aae,lae,cae,uae,hae,dae,fae,gae]}const pae={name:"emptySelectedCells",callback(t){t.emptySelectedCells(),t._getEditorManager().prepareEditor()}},wae={name:"scrollToFocusedCell",callback(t){const{highlight:e}=t.getSelectedRangeLast(),r=t.view.getFirstFullyVisibleRow()-1,n=t.view.getFirstFullyVisibleColumn()-1,i=t.view.getLastFullyVisibleRow()+1,s=t.view.getLastFullyVisibleColumn()+1,o=t._createCellCoords(r,n),a=t._createCellCoords(i,s);if(!t._createCellRange(o,o,a).includes(e)&&(e.row>=0||e.col>=0)){const c={};if(e.col>=0){const u=Math.floor(t.countVisibleCols()/2);c.col=Math.max(e.col-u,0)}if(e.row>=0){const u=Math.floor(t.countVisibleRows()/2);c.row=Math.max(e.row-u,0)}t.scrollViewportTo(Zr(yt({},c),{verticalSnap:"top",horizontalSnap:"start"}))}}},vae={name:"selectAllCells",callback(t){t.selection.selectAll(!0,!0,{disableHeadersHighlight:!0})}},Cae={name:"selectAllCellsAndHeaders",callback(t){t.selection.selectAll(!0,!0,{disableHeadersHighlight:!1})}},Sae={name:"populateSelectedCellsData",callback(t){const e=t.getSelectedRange(),{row:r,col:n}=e[e.length-1].highlight.normalize(),i=t.getDataAtCell(r,n),s=new Map;for(let o=0;o<e.length;o++)e[o].forAll((a,l)=>{if(a>=0&&l>=0&&(a!==r||l!==n)){const{readOnly:c}=t.getCellMeta(a,l);c||s.set(`${a}x${l}`,[a,l,i])}});t.setDataAtCell(Array.from(s.values()))}},yae=[...Foe(),...Joe(),...mae(),pae,wae,vae,Cae,Sae];function rL(t){const e={};return yae.forEach(r=>{let{name:n,callback:i}=r;e[n]=function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return i(t,...o)}}),e}function xae(t){const e=t.getShortcutManager().addContext("editor"),r=rL(t),n={group:Ub};e.addShortcuts([{keys:[["Enter"],["Enter","Shift"]],callback:(i,s)=>r.editorCloseAndSave(i,s)},{keys:[["Enter","Control/Meta"],["Enter","Control/Meta","Shift"]],captureCtrl:!0,callback:(i,s)=>r.editorCloseAndSave(i,s)},{keys:[["Escape"],["Escape","Control/Meta"]],callback:()=>r.editorCloseWithoutSaving()}],n)}function bae(t){const e=t.getShortcutManager().addContext("grid"),r=rL(t),n={runOnlyIf:()=>{const{navigableHeaders:i}=t.getSettings();return He(t.getSelected())&&(i||!i&&t.countRenderedRows()>0&&t.countRenderedCols()>0)},group:tL};e.addShortcuts([{keys:[["F2"]],callback:i=>r.editorFastOpen(i)},{keys:[["Enter"],["Enter","Shift"]],callback:(i,s)=>r.editorOpen(i,s)},{keys:[["Backspace"],["Delete"]],callback:()=>r.emptySelectedCells()}],{group:Ub,runOnlyIf:()=>He(t.getSelected())}),e.addShortcuts([{keys:[["Control/Meta","A"]],callback:()=>r.selectAllCells()},{keys:[["Control/Meta","Shift","Space"]],callback:()=>r.selectAllCellsAndHeaders()},{keys:[["Control/Meta","Enter"]],callback:()=>r.populateSelectedCellsData(),runOnlyIf:()=>!t.getSelectedRangeLast().highlight.isHeader()&&t.getSelectedRangeLast().getCellsCount()>1},{keys:[["Control","Space"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToColumns()},{keys:[["Shift","Space"]],stopPropagation:!0,callback:()=>r.extendCellsSelectionToRows()},{keys:[["ArrowUp"]],callback:()=>r.moveCellSelectionUp()},{keys:[["ArrowUp","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostTop()},{keys:[["ArrowUp","Shift"]],callback:()=>r.extendCellsSelectionUp()},{keys:[["ArrowUp","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToMostTop(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByColumnHeader())},{keys:[["ArrowDown"]],callback:()=>r.moveCellSelectionDown()},{keys:[["ArrowDown","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostBottom()},{keys:[["ArrowDown","Shift"]],callback:()=>r.extendCellsSelectionDown()},{keys:[["ArrowDown","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToMostBottom(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByColumnHeader())},{keys:[["ArrowLeft"]],callback:()=>r.moveCellSelectionLeft()},{keys:[["ArrowLeft","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostLeft()},{keys:[["ArrowLeft","Shift"]],callback:()=>r.extendCellsSelectionLeft()},{keys:[["ArrowLeft","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToMostLeft(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByRowHeader())},{keys:[["ArrowRight"]],callback:()=>r.moveCellSelectionRight()},{keys:[["ArrowRight","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostRight()},{keys:[["ArrowRight","Shift"]],callback:()=>r.extendCellsSelectionRight()},{keys:[["ArrowRight","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToMostRight(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByRowHeader())},{keys:[["Home"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostInlineStart(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["Home","Shift"]],callback:()=>r.extendCellsSelectionToMostInlineStart()},{keys:[["Home","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostTopInlineStart(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostInlineEnd(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End","Shift"]],callback:()=>r.extendCellsSelectionToMostInlineEnd()},{keys:[["End","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostBottomInlineEnd(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["PageUp"]],callback:()=>r.moveCellSelectionUpByViewportHight()},{keys:[["PageUp","Shift"]],callback:()=>r.extendCellsSelectionUpByViewportHeight()},{keys:[["PageDown"]],callback:()=>r.moveCellSelectionDownByViewportHeight()},{keys:[["PageDown","Shift"]],callback:()=>r.extendCellsSelectionDownByViewportHeight()},{keys:[["Tab"]],preventDefault:!1,callback:()=>r.moveCellSelectionInlineStart()},{keys:[["Shift","Tab"]],preventDefault:!1,callback:()=>r.moveCellSelectionInlineEnd()},{keys:[["Control/Meta","Backspace"]],callback:()=>r.scrollToFocusedCell()}],n)}function Eae(t){[xae,bae].forEach(e=>e(t))}function Rae(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=t.rootElement,n=oA(t),i=oA(t);return n.addEventListener("focus",()=>e==null?void 0:e.onFocusFromTop()),i.addEventListener("focus",()=>e==null?void 0:e.onFocusFromBottom()),r.firstChild.before(n),r.lastChild.after(i),{activate(){t._registerTimeout(()=>{n.tabIndex=0,i.tabIndex=0},10)},deactivate(){t._registerTimeout(()=>{n.tabIndex=-1,i.tabIndex=-1},10)}}}function oA(t){const r=t.rootDocument.createElement("input");return r.type="text",r.classList.add("htFocusCatcher"),t.getSettings().ariaTags&&qe(r,[Ys(),Yo()]),r}function Tae(t){const e=_ae(t);let r;const{activate:n,deactivate:i}=Rae(t,{onFocusFromTop(){var h;const d=(h=e(r))!==null&&h!==void 0?h:z1(t);d&&(t.runHooks("modifyFocusOnTabNavigation","from_above",d),t.selectCell(d.row,d.col)),t.listen()},onFocusFromBottom(){var h;const d=(h=e(r))!==null&&h!==void 0?h:j1(t);d&&(t.runHooks("modifyFocusOnTabNavigation","from_below",d),t.selectCell(d.row,d.col)),t.listen()}}),s={wrapped:!1,flipped:!1};let o=!0,a=!1,l=!1;t.addHook("afterListen",()=>i()),t.addHook("afterUnlisten",()=>n()),t.addHook("afterSelection",(h,d,f,g,m)=>{if(a&&(s.wrapped&&s.flipped||l)&&(l=!1,m.value=!0),o){var w;r=(w=t.getSelectedRangeLast())===null||w===void 0?void 0:w.highlight}}),t.addHook("beforeRowWrap",(h,d,f)=>{s.wrapped=!0,s.flipped=f});function c(){s.wrapped=!1,s.flipped=!1,t.deselectCell(),t.unlisten()}const u={keys:[["Tab"],["Shift","Tab"]],preventDefault:!1,stopPropagation:!1,relativeToGroup:tL,group:"focusCatcher"};t.getShortcutManager().getContext("grid").addShortcuts([Zr(yt({},u),{callback:()=>{const{tabNavigation:h}=t.getSettings();a=!0,t.getSelectedRangeLast()&&!h&&(o=!1),h||(l=!0)},position:"before"}),Zr(yt({},u),{callback:h=>{const{tabNavigation:d,autoWrapRow:f}=t.getSettings();if(a=!1,o=!0,!d||!t.selection.isSelected()||f&&s.wrapped&&s.flipped||!f&&s.wrapped)return f&&s.wrapped&&s.flipped&&(r=h.shiftKey?z1(t):j1(t)),c(),!1;h.preventDefault()},position:"after"})])}function z1(t){const{rowIndexMapper:e,columnIndexMapper:r}=t,{navigableHeaders:n}=t.getSettings();let i=n&&t.countColHeaders()>0?-t.countColHeaders():0,s=n&&t.countRowHeaders()>0?-t.countRowHeaders():0;return i===0&&(i=e.getVisualFromRenderableIndex(i)),s===0&&(s=r.getVisualFromRenderableIndex(s)),i===null||s===null?null:t._createCellCoords(i,s)}function j1(t){var e,r;const{rowIndexMapper:n,columnIndexMapper:i}=t,{navigableHeaders:s}=t.getSettings();let o=n.getRenderableIndexesLength()-1,a=i.getRenderableIndexesLength()-1;if(o<0){if(!s||t.countColHeaders()===0)return null;o=-1}if(a<0){if(!s||t.countColHeaders()===0)return null;a=-1}return t._createCellCoords((e=n.getVisualFromRenderableIndex(o))!==null&&e!==void 0?e:o,(r=i.getVisualFromRenderableIndex(a))!==null&&r!==void 0?r:a)}function _ae(t){return e=>{if(!e)return null;const r=z1(t),n=j1(t);return e.col<r.col&&(e.col=r.col),e.col>n.col&&(e.col=n.col),e.row<r.row&&(e.row=r.row),e.row>n.row&&(e.row=n.row),e}}const aA=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"]]),Ig=t=>t.map(e=>{const r=e.toLowerCase();return aA.has(r)?aA.get(r):r}).sort().join("+"),Aae=t=>t.split("+"),lA=new RegExp("^(?:Key|Digit)([A-Z0-9])$"),Mae=new Set(["Backquote","Minus","Equal","BracketLeft","BracketRight","Backslash","Semicolon","Quote","Comma","Period","Slash"]),xv=t=>{let{key:e,code:r}=t,n=e;return lA.test(r)?n=r.replace(lA,"$1"):Mae.has(r)&&(n=r),n.toLowerCase()},nL=Symbol("shortcut-context");function iL(t){return at(t)&&t.__kindOf===nL}const Oae=t=>{const e=Op({errorIdExists:l=>`The "${l}" shortcut is already registered in the "${t}" context.`}),r=function(){let{keys:l,callback:c,group:u,runOnlyIf:h=()=>!0,captureCtrl:d=!1,preventDefault:f=!0,stopPropagation:g=!1,relativeToGroup:m,position:w,forwardToContext:C}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Gt(u))throw new Error("You need to define the shortcut's group.");if(Ut(c)===!1)throw new Error("The shortcut's callback needs to be a function.");if(Array.isArray(l)===!1)throw new Error(Pt`Pass the shortcut\'s keys as an array of arrays,\x20
  94. using the KeyboardEvent.key properties:\x20
  95. https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values.`);const S={callback:c,group:u,runOnlyIf:h,captureCtrl:d,preventDefault:f,stopPropagation:g};He(m)&&([S.relativeToGroup,S.position]=[m,w]),iL(C)&&(S.forwardToContext=C),l.forEach(v=>{const T=Ig(v);if(e.hasItem(T)){const M=e.getItem(T);let E=M.findIndex(Y=>Y.group===m);E!==-1?w==="before"?E-=1:E+=1:E=M.length,M.splice(E,0,S)}else e.addItem(T,[S])})},n=function(l){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};l.forEach(u=>{dt(c,(h,d)=>{Object.prototype.hasOwnProperty.call(u,d)===!1&&(u[d]=c[d])}),r(u)})},i=l=>{const c=Ig(l);e.removeItem(c)};return{__kindOf:nL,addShortcut:r,addShortcuts:n,getShortcuts:l=>{const c=Ig(l),u=e.getItem(c);return He(u)?u.slice():[]},hasShortcut:l=>{const c=Ig(l);return e.hasItem(c)},removeShortcutsByKeys:i,removeShortcutsByGroup:l=>{e.getItems().forEach(u=>{let[h,d]=u;const f=d.filter(g=>g.group!==l);f.length===0?i(Aae(h)):(d.length=0,d.push(...f))})}}};function Iae(){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 Pae=["meta","alt","shift","control"],Sh=Iae();let Pg=0;function Dae(t,e,r,n,i){const s=f=>Pae.includes(f),o=function(f){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const m=[];return f.altKey&&m.push("alt"),g&&(f.ctrlKey||f.metaKey)?m.push("control/meta"):(f.ctrlKey&&m.push("control"),f.metaKey&&m.push("meta")),f.shiftKey&&m.push("shift"),m},a=f=>{if(e(f)===!1)return;const g=r(f);if(f.keyCode===229||g===!1||Il(f))return;const m=xv(f);let w=[];s(m)||(w=o(f));const C=[m].concat(w);!i(f,C)&&(O1()&&w.includes("meta")||!O1()&&w.includes("control"))&&i(f,[m].concat(o(f,!0))),n(f)},l=f=>{const g=xv(f);s(g)&&Sh.press(g)},c=f=>{const g=xv(f);s(g)&&Sh.release(g)},u=()=>{Sh.releaseAll()};return{mount:()=>{let f=t;for(Pg+=1;f;)Pg===1&&(f.document.documentElement.addEventListener("keydown",l),f.document.documentElement.addEventListener("keyup",c)),f.document.documentElement.addEventListener("keydown",a),f.document.documentElement.addEventListener("blur",u),f=vm(f)},unmount:()=>{let f=t;for(Pg-=1;f;)Pg===0&&(f.document.documentElement.removeEventListener("keydown",l),f.document.documentElement.removeEventListener("keyup",c)),f.document.documentElement.removeEventListener("keydown",a),f.document.documentElement.removeEventListener("blur",u),f=vm(f)},isPressed:f=>Sh.isPressed(f),releasePressedKeys:()=>Sh.releaseAll()}}const kae=t=>{let{ownerWindow:e,handleEvent:r,beforeKeyDown:n,afterKeyDown:i}=t;const s=Op({errorIdExists:g=>`The "${g}" context name is already registered.`});let o="grid";const a=g=>{const m=Oae(g);return s.addItem(g,m),m},l=()=>o,c=g=>s.getItem(g),u=g=>{if(!s.hasItem(g))throw new Error(Pt`You've tried to activate the "${g}" shortcut context\x20
  96. that does not exist. Before activation, register the context using the "addContext" method.`);o=g};let h=!1;const d=function(g,m){let w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l();const C=iL(w)?w:c(w);let S=!1;if(!C.hasShortcut(m))return S;const v=C.getShortcuts(m);for(let T=0;T<v.length;T++){const{callback:A,runOnlyIf:M,preventDefault:E,stopPropagation:Y,captureCtrl:D,forwardToContext:U}=v[T];if(M(g)===!0){if(h=D,S=A(g,m)===!1,h=!1,E&&g.preventDefault(),Y&&(vs(g),g.stopPropagation()),S)break;U&&d(g,m,U)}}return S},f=Dae(e,r,n,i,d);return f.mount(),{addContext:a,getActiveContextName:l,getContext:c,setActiveContextName:u,isCtrlPressed:()=>!h&&(f.isPressed("control")||f.isPressed("meta")),releasePressedKeys:()=>f.releasePressedKeys(),destroy:()=>f.unmount()}};let bv=null;const Ev=new Map;function sL(t,e){var r,n=this;let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=!1,o=this;const a=new ms(o);let l,c,u,h,d,f=!0;wie(i)&&pie(this),this.rootElement=t,this.rootDocument=t.ownerDocument,this.rootWindow=this.rootDocument.defaultView,this.isDestroyed=!1,this.renderSuspendedCounter=0,this.executionSuspendedCounter=0;const g=(r=e==null?void 0:e.layoutDirection)!==null&&r!==void 0?r:"inherit",m=["rtl","ltr"].includes(g)?g:this.rootWindow.getComputedStyle(this.rootElement).direction;this.rootElement.setAttribute("dir",m),this.isRtl=function(){return m==="rtl"},this.isLtr=function(){return!o.isRtl()},this.getDirectionFactor=function(){return o.isLtr()?1:-1},e.language=vse(e.language);const w=new eL(o,e,[Moe,Poe]),C=w.getTableMeta(),S=w.getGlobalMeta(),v=Op();this.container=this.rootDocument.createElement("div"),this.renderCall=!1,t.insertBefore(this.container,t.firstChild),D0(this)&&KJ(e.licenseKey,t),this.guid=`ht_${oH()}`,Ev.set(this.guid,this),this.columnIndexMapper=new V1,this.rowIndexMapper=new V1,this.columnIndexMapper.addLocalHook("indexesSequenceChange",p=>{o.runHooks("afterColumnSequenceChange",p)}),this.rowIndexMapper.addLocalHook("indexesSequenceChange",p=>{o.runHooks("afterRowSequenceChange",p)}),c=new Pie(o),(!this.rootElement.id||this.rootElement.id.substring(0,3)==="ht_")&&(this.rootElement.id=this.guid);const T=p=>{const{row:y,col:b}=p;return o._createCellCoords(y>=0?o.rowIndexMapper.getRenderableFromVisualIndex(y):y,b>=0?o.columnIndexMapper.getRenderableFromVisualIndex(b):b)},A=p=>{const{row:y,col:b}=p;return o._createCellCoords(y>=0?o.rowIndexMapper.getVisualFromRenderableIndex(y):y,b>=0?o.columnIndexMapper.getVisualFromRenderableIndex(b):b)};let M=new Qse(C,{rowIndexMapper:o.rowIndexMapper,columnIndexMapper:o.columnIndexMapper,countCols:()=>o.countCols(),countRows:()=>o.countRows(),propToCol:p=>l.propToCol(p),isEditorOpened:()=>o.getActiveEditor()?o.getActiveEditor().isOpened():!1,countRenderableColumns:()=>this.view.countRenderableColumns(),countRenderableRows:()=>this.view.countRenderableRows(),countRowHeaders:()=>this.countRowHeaders(),countColHeaders:()=>this.countColHeaders(),getShortcutManager:()=>o.getShortcutManager(),createCellCoords:(p,y)=>o._createCellCoords(p,y),createCellRange:(p,y,b)=>o._createCellRange(p,y,b),visualToRenderableCoords:T,renderableToVisualCoords:A,isDisabledCellSelection:(p,y)=>p<0||y<0?o.getSettings().disableVisualSelection:o.getCellMeta(p,y).disableVisualSelection});this.selection=M;const E=p=>{let{hiddenIndexesChanged:y}=p;y&&this.selection.refresh()};this.columnIndexMapper.addLocalHook("cacheUpdated",E),this.rowIndexMapper.addLocalHook("cacheUpdated",E),this.selection.addLocalHook("afterSetRangeEnd",p=>{const y=zs(!1),b=this.selection.getSelectedRange(),{from:x,to:O}=b.current(),_=b.size()-1;this.runHooks("afterSelection",x.row,x.col,O.row,O.col,y,_),this.runHooks("afterSelectionByProp",x.row,o.colToProp(x.col),O.row,o.colToProp(O.col),y,_);let N=!0;s&&(N=!1),y.isTouched()&&(N=!y.value);const K=this.selection.selectedRange.current(),le=this.selection.isSelectedByAnyHeader(),ce=this.selection.isSelectedByRowHeader(),te=this.selection.isSelectedByColumnHeader();if(N!==!1)if(le)ce?this.scrollViewportTo({row:p.row}):te&&this.scrollViewportTo({col:p.col});else if(K&&!this.selection.isMultiple()){const{row:ge,col:Me}=K.from;ge<0&&Me>=0?this.scrollViewportTo({col:Me}):Me<0&&ge>=0?this.scrollViewportTo({row:ge}):this.scrollViewportTo({row:ge,col:Me})}else this.scrollViewportTo(p.toObject());ce&&te?be(this.rootElement,["ht__selection--rows","ht__selection--columns"]):ce?(rt(this.rootElement,"ht__selection--columns"),be(this.rootElement,"ht__selection--rows")):te?(rt(this.rootElement,"ht__selection--rows"),be(this.rootElement,"ht__selection--columns")):rt(this.rootElement,["ht__selection--rows","ht__selection--columns"]),this._refreshBorders(null)}),this.selection.addLocalHook("afterSelectionFinished",p=>{const y=p.length-1,{from:b,to:x}=p[y];this.runHooks("afterSelectionEnd",b.row,b.col,x.row,x.col,y),this.runHooks("afterSelectionEndByProp",b.row,o.colToProp(b.col),x.row,o.colToProp(x.col),y)}),this.selection.addLocalHook("afterIsMultipleSelection",p=>{const y=this.runHooks("afterIsMultipleSelection",p.value);p.value&&(p.value=y)}),this.selection.addLocalHook("afterDeselect",()=>{h.destroyEditor(),this._refreshBorders(),rt(this.rootElement,["ht__selection--rows","ht__selection--columns"]),this.runHooks("afterDeselect")}),this.selection.addLocalHook("beforeHighlightSet",()=>this.runHooks("beforeSelectionHighlightSet")).addLocalHook("beforeSetRangeStart",function(){for(var p=arguments.length,y=new Array(p),b=0;b<p;b++)y[b]=arguments[b];return n.runHooks("beforeSetRangeStart",...y)}).addLocalHook("beforeSetRangeStartOnly",function(){for(var p=arguments.length,y=new Array(p),b=0;b<p;b++)y[b]=arguments[b];return n.runHooks("beforeSetRangeStartOnly",...y)}).addLocalHook("beforeSetRangeEnd",function(){for(var p=arguments.length,y=new Array(p),b=0;b<p;b++)y[b]=arguments[b];return n.runHooks("beforeSetRangeEnd",...y)}).addLocalHook("beforeSelectColumns",function(){for(var p=arguments.length,y=new Array(p),b=0;b<p;b++)y[b]=arguments[b];return n.runHooks("beforeSelectColumns",...y)}).addLocalHook("afterSelectColumns",function(){for(var p=arguments.length,y=new Array(p),b=0;b<p;b++)y[b]=arguments[b];return n.runHooks("afterSelectColumns",...y)}).addLocalHook("beforeSelectRows",function(){for(var p=arguments.length,y=new Array(p),b=0;b<p;b++)y[b]=arguments[b];return n.runHooks("beforeSelectRows",...y)}).addLocalHook("afterSelectRows",function(){for(var p=arguments.length,y=new Array(p),b=0;b<p;b++)y[b]=arguments[b];return n.runHooks("afterSelectRows",...y)}).addLocalHook("beforeModifyTransformStart",function(){for(var p=arguments.length,y=new Array(p),b=0;b<p;b++)y[b]=arguments[b];return n.runHooks("modifyTransformStart",...y)}).addLocalHook("afterModifyTransformStart",function(){for(var p=arguments.length,y=new Array(p),b=0;b<p;b++)y[b]=arguments[b];return n.runHooks("afterModifyTransformStart",...y)}).addLocalHook("beforeModifyTransformEnd",function(){for(var p=arguments.length,y=new Array(p),b=0;b<p;b++)y[b]=arguments[b];return n.runHooks("modifyTransformEnd",...y)}).addLocalHook("afterModifyTransformEnd",function(){for(var p=arguments.length,y=new Array(p),b=0;b<p;b++)y[b]=arguments[b];return n.runHooks("afterModifyTransformEnd",...y)}).addLocalHook("beforeRowWrap",function(){for(var p=arguments.length,y=new Array(p),b=0;b<p;b++)y[b]=arguments[b];return n.runHooks("beforeRowWrap",...y)}).addLocalHook("beforeColumnWrap",function(){for(var p=arguments.length,y=new Array(p),b=0;b<p;b++)y[b]=arguments[b];return n.runHooks("beforeColumnWrap",...y)}).addLocalHook("insertRowRequire",p=>this.alter("insert_row_above",p,1,"auto")).addLocalHook("insertColRequire",p=>this.alter("insert_col_start",p,1,"auto")),u={alter(p,y){var b,x;let O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,_=arguments.length>3?arguments[3]:void 0,N=arguments.length>4?arguments[4]:void 0;const K=le=>{if(le.length===0)return[];const ce=[...le];return ce.sort((ge,Me)=>{let[L]=ge,[Fe]=Me;return L===Fe?0:L>Fe?1:-1}),Cn(ce,(ge,Me)=>{let[L,Fe]=Me;const ue=ge[ge.length-1],[ze,Ie]=ue,we=ze+Ie;if(L<=we){const Be=Math.max(Fe-(we-L),0);ue[1]+=Be}else ge.push([L,Fe]);return ge},[ce[0]])};switch(p){case"insert_row_below":case"insert_row_above":const le=o.countSourceRows();if(C.maxRows===le)return;const ce=p==="insert_row_below"?"below":"above";y=(b=y)!==null&&b!==void 0?b:ce==="below"?le:0;const{delta:te,startPhysicalIndex:ge}=l.createRow(y,O,{source:_,mode:ce});if(te){const Ie=M.selectedRange.current(),we=Ie==null?void 0:Ie.from,Be=we==null?void 0:we.row,Le=o.toVisualRow(ge);if(M.isSelectedByCorner())M.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(He(Be)&&Be>=Le){const{row:I,col:F}=Ie.to;let z=we.col;M.isSelectedByRowHeader()&&(z=-1),M.getSelectedRange().pop(),M.setRangeStartOnly(o._createCellCoords(Be+te,z),!0),M.setRangeEnd(o._createCellCoords(I+te,F))}else o._refreshBorders()}break;case"insert_col_start":case"insert_col_end":const Me=p==="insert_col_end"?"end":"start";y=(x=y)!==null&&x!==void 0?x:Me==="end"?o.countSourceCols():0;const{delta:L,startPhysicalIndex:Fe}=l.createCol(y,O,{source:_,mode:Me});if(L){if(Array.isArray(C.colHeaders)){const I=[o.toVisualColumn(Fe),0];I.length+=L,Array.prototype.splice.apply(C.colHeaders,I)}const Ie=M.selectedRange.current(),we=Ie==null?void 0:Ie.from,Be=we==null?void 0:we.col,Le=o.toVisualColumn(Fe);if(M.isSelectedByCorner())M.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(He(Be)&&Be>=Le){const{row:I,col:F}=Ie.to;let z=we.row;M.isSelectedByColumnHeader()&&(z=-1),M.getSelectedRange().pop(),M.setRangeStartOnly(o._createCellCoords(z,Be+L),!0),M.setRangeEnd(o._createCellCoords(I,F+L))}else o._refreshBorders()}break;case"remove_row":const ue=Ie=>{let we=0;j(Ie,Be=>{let[Le,I]=Be;const F=kr(Le)?o.countRows()-1:Math.max(Le-we,0);if(Number.isInteger(Le)&&(Le=Math.max(Le-we,0)),!l.removeRow(Le,I,_))return;const se=o.countRows(),q=C.fixedRowsTop;q>=F+1&&(C.fixedRowsTop-=Math.min(I,q-F));const ie=C.fixedRowsBottom;ie&&F>=se-ie&&(C.fixedRowsBottom-=Math.min(I,ie)),we+=I})};Array.isArray(y)?ue(K(y)):ue([[y,O]]),u.adjustRowsAndCols(),o._refreshBorders();break;case"remove_col":const ze=Ie=>{let we=0;j(Ie,Be=>{let[Le,I]=Be;const F=kr(Le)?o.countCols()-1:Math.max(Le-we,0);let z=o.toPhysicalColumn(F);if(Number.isInteger(Le)&&(Le=Math.max(Le-we,0)),!l.removeCol(Le,I,_))return;const q=C.fixedColumnsStart;q>=F+1&&(C.fixedColumnsStart-=Math.min(I,q-F)),Array.isArray(C.colHeaders)&&(typeof z=="undefined"&&(z=-1),C.colHeaders.splice(z,I)),we+=I})};Array.isArray(y)?ze(K(y)):ze([[y,O]]),u.adjustRowsAndCols(),o._refreshBorders();break;default:throw new Error(`There is no such action "${p}"`)}N||u.adjustRowsAndCols()},adjustRowsAndCols(){const p=C.minRows,y=C.minSpareRows,b=C.minCols,x=C.minSpareCols;if(o.countRows()===0&&o.countCols()===0&&M.deselect(),p){const O=o.countRows();O<p&&l.createRow(O,p-O,{source:"auto"})}if(y){const O=o.countEmptyRows(!0);if(O<y){const _=y-O,N=Math.min(_,C.maxRows-o.countSourceRows());l.createRow(o.countRows(),N,{source:"auto"})}}{let O;(b||x)&&(O=o.countEmptyCols(!0));let _=o.countCols();if(b&&!C.columns&&_<b){const N=b-_;O+=N,l.createCol(_,N,{source:"auto"})}if(x&&!C.columns&&o.dataType==="array"&&O<x){_=o.countCols();const N=x-O,K=Math.min(N,C.maxCols-_);l.createCol(_,K,{source:"auto"})}}if(M.isSelected()){const O=o.countRows(),_=o.countCols();j(M.selectedRange,N=>{let K=!1,le=N.from.row,ce=N.from.col,te=N.to.row,ge=N.to.col;le>O-1?(le=O-1,K=!0,te>le&&(te=le)):te>O-1&&(te=O-1,K=!0,le>te&&(le=te)),ce>_-1?(ce=_-1,K=!0,ge>ce&&(ge=ce)):ge>_-1&&(ge=_-1,K=!0,ce>ge&&(ce=ge)),K&&(ce<0?o.selectRows(le,te,ce):le<0?o.selectColumns(ce,ge,le):o.selectCell(le,ce,te,ge))})}o.view&&o.view.adjustElementsSize()},populateFromArray(p,y,b,x,O){let _,N,K,le;const ce=[],te={},ge=[],Me=p.row,L=p.col;if(N=y.length,N===0)return!1;let Fe=0,ue=0;switch(at(b)&&(Fe=b.col-L+1,ue=b.row-Me+1),O){case"shift_down":const ze=O0(y),Ie=ze.length,we=Math.max(Ie,Fe),Be=o.getData().slice(Me),Le=O0(Be).slice(L,L+we);for(K=0;K<we;K+=1)if(K<Ie){for(_=0,N=ze[K].length;_<ue-N;_+=1)ze[K].push(ze[K][_%N]);K<Le.length?ge.push(ze[K].concat(Le[K])):ge.push(ze[K].concat(new Array(Be.length).fill(null)))}else ge.push(ze[K%Ie].concat(Le[K]));o.populateFromArray(Me,L,O0(ge));break;case"shift_right":const I=y.length,F=Math.max(I,ue),z=o.getData().slice(Me).map(J=>J.slice(L));for(_=0;_<F;_+=1)if(_<I){for(K=0,le=y[_].length;K<Fe-le;K+=1)y[_].push(y[_][K%le]);if(_<z.length)for(let J=0;J<z[_].length;J+=1)y[_].push(z[_][J]);else y[_].push(...new Array(z[0].length).fill(null))}else y.push(y[_%N].slice(0,F).concat(z[_]));o.populateFromArray(Me,L,y);break;case"overwrite":default:te.row=p.row,te.col=p.col;let se=0,q=0,ie=!0,Q;const ee=function(Se){let Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const Pe=y[Se%y.length];return Oe!==null?Pe[Oe%Pe.length]:Pe},oe=y.length,ne=b?b.row-p.row+1:0;for(b?N=ne:N=Math.max(oe,ne),_=0;_<N&&!(b&&te.row>b.row&&ne>oe||!C.allowInsertRow&&te.row>o.countRows()-1||te.row>=C.maxRows);_++){const J=_-se,Se=ee(J).length,Oe=b?b.col-p.col+1:0;if(b?le=Oe:le=Math.max(Se,Oe),te.col=p.col,Q=o.getCellMeta(te.row,te.col),(x==="CopyPaste.paste"||x==="Autofill.fill")&&Q.skipRowOnPaste){se+=1,te.row+=1,N+=1;continue}for(q=0,K=0;K<le&&!(b&&te.col>b.col&&Oe>Se||!C.allowInsertColumn&&te.col>o.countCols()-1||te.col>=C.maxCols);K++){if(Q=o.getCellMeta(te.row,te.col),(x==="CopyPaste.paste"||x==="Autofill.fill")&&Q.skipColumnOnPaste){q+=1,te.col+=1,le+=1;continue}if(Q.readOnly&&x!=="UndoRedo.undo"){te.col+=1;continue}const Pe=K-q;let je=ee(J,Pe),Qe=o.getDataAtCell(te.row,te.col);if(je!==null&&typeof je=="object")if(Array.isArray(je)&&Qe===null&&(Qe=[]),Qe===null||typeof Qe!="object")ie=!1;else{const kt=zd(Array.isArray(Qe)?Qe:Qe[0]||Qe),lt=zd(Array.isArray(je)?je:je[0]||je);Wy(kt,lt)||Array.isArray(kt)&&Array.isArray(lt)?je=Hn(je):ie=!1}else Qe!==null&&typeof Qe=="object"&&(ie=!1);ie&&ce.push([te.row,te.col,je]),ie=!0,te.col+=1}te.row+=1}o.setDataAtCell(ce,null,null,x||"populateFromArray");break}}};function Y(p){const y=kF(p);Wb(y)?(o.runHooks("beforeLanguageChange",y),S.language=y,o.runHooks("afterLanguageChange",y)):NF(p)}function D(p,y){const b=p==="className"?o.rootElement:o.table;if(f)be(b,y);else{let x=[],O=[];S[p]&&(x=Array.isArray(S[p])?S[p]:HT(S[p])),y&&(O=Array.isArray(y)?y:HT(y));const _=NT(x,O),N=NT(O,x);_.length&&rt(b,_),N.length&&be(b,N)}S[p]=y}this.init=function(){c.setData(C.data),o.runHooks("beforeInit"),(Ea()||kH())&&be(o.rootElement,"mobile"),this.updateSettings(C,!0),this.view=new Eie(this),h=xee.getInstance(o,C,M),d=new Ree(o),D0(this)&&Tae(o),o.runHooks("init"),this.forceFullRender=!0,this.view.render(),!!f&&o.rootElement.offsetParent===null&&AQ(o.rootElement,()=>{o.view._wt.wtOverlays.updateLastSpreaderSize(),o.render(),o.view.adjustElementsSize()}),typeof f=="object"&&(o.runHooks("afterChange",f[0],f[1]),f=!1),o.runHooks("afterInit")};function U(){let p=!1;return{validatorsInQueue:0,valid:!0,addValidatorToQueue(){this.validatorsInQueue+=1,p=!1},removeValidatorFormQueue(){this.validatorsInQueue=this.validatorsInQueue-1<0?0:this.validatorsInQueue-1,this.checkIfQueueIsEmpty()},onQueueEmpty(){},checkIfQueueIsEmpty(){this.validatorsInQueue===0&&p===!1&&(p=!0,this.onQueueEmpty(this.valid))}}}function X(p){const y=p.replace(",",".");return isNaN(parseFloat(y))===!1?parseFloat(y):p}function G(p,y,b){if(!p.length)return;const x=o.getActiveEditor(),O=new U;let _=!0;O.onQueueEmpty=N=>{x&&_&&x.cancelChanges(),b(N)};for(let N=p.length-1;N>=0;N--){const[K,le,,ce]=p[N],te=l.propToCol(le),ge=o.getCellMeta(K,te);ge.type==="numeric"&&typeof ce=="string"&&Pee(ce)&&(p[N][3]=X(ce)),o.getCellValidator(ge)&&(O.addValidatorToQueue(),o.validateCell(p[N][3],ge,function(Me,L){return function(Fe){if(typeof Fe!="boolean")throw new Error("Validation error: result is not boolean");if(Fe===!1&&L.allowInvalid===!1){_=!1,p.splice(Me,1),L.valid=!0;const ue=o.getCell(L.visualRow,L.visualCol);ue!==null&&rt(ue,C.invalidCellClassName)}O.removeValidatorFormQueue()}}(N,ge),y))}O.checkIfQueueIsEmpty()}function ae(p,y){let b=p.length-1;if(b<0)return;for(;b>=0;b--){let O=!1;if(p[b]===null){p.splice(b,1);continue}if(!((p[b][2]===null||p[b][2]===void 0)&&(p[b][3]===null||p[b][3]===void 0))){if(C.allowInsertRow)for(;p[b][0]>o.countRows()-1;){const{delta:_}=l.createRow(void 0,void 0,{source:y});if(_===0){O=!0;break}}if(o.dataType==="array"&&(!C.columns||C.columns.length===0)&&C.allowInsertColumn)for(;l.propToCol(p[b][1])>o.countCols()-1;){const{delta:_}=l.createCol(void 0,void 0,{source:y});if(_===0){O=!0;break}}O||l.set(p[b][0],p[b][1],p[b][3])}}o.forceFullRender=!0,u.adjustRowsAndCols(),o.runHooks("beforeChangeRender",p,y),h.lockEditor(),o._refreshBorders(null),h.unlockEditor(),o.view.adjustElementsSize(),o.runHooks("afterChange",p,y||"edit");const x=o.getActiveEditor();x&&He(x.refreshValue)&&x.refreshValue()}this._createCellCoords=function(p,y){return o.view._wt.createCellCoords(p,y)},this._createCellRange=function(p,y,b){return o.view._wt.createCellRange(p,y,b)},this.validateCell=function(p,y,b,x){let O=o.getCellValidator(y);function _(N){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)||y.hidden===!0){b(N);return}const le=y.visualCol,ce=y.visualRow,te=o.getCell(ce,le,!0);if(te&&te.nodeName!=="TH"){const ge=o.rowIndexMapper.getRenderableFromVisualIndex(ce),Me=o.columnIndexMapper.getRenderableFromVisualIndex(le);o.view._wt.getSetting("cellRenderer",ge,Me,te)}b(N)}YJ(O)&&(O=function(N){return function(K,le){le(N.test(K))}}(O)),Ut(O)?(p=o.runHooks("beforeValidate",p,y.visualRow,y.prop,x),o._registerImmediate(()=>{O.call(y,p,N=>{!o||(N=o.runHooks("afterValidate",N,p,y.visualRow,y.prop,x),y.valid=N,_(N),o.runHooks("postAfterValidate",N,p,y.visualRow,y.prop,x))})})):o._registerImmediate(()=>{y.valid=!0,_(y.valid,!1)})};function ve(p,y,b){return Array.isArray(p)?p:[[p,y,b]]}function me(p,y){const b=o.getActiveEditor(),x=o.runHooks("beforeChange",p,y||"edit"),O=p.filter(_=>_!==null);return x===!1||O.length===0?(b&&b.cancelChanges(),[]):O}this.setDataAtCell=function(p,y,b,x){const O=ve(p,y,b),_=[];let N=x,K,le,ce;for(K=0,le=O.length;K<le;K++){if(typeof O[K]!="object")throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if(typeof O[K][1]!="number")throw new Error("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`");O[K][1]>=this.countCols()?ce=O[K][1]:ce=l.colToProp(O[K][1]),_.push([O[K][0],ce,c.getAtCell(this.toPhysicalRow(O[K][0]),O[K][1]),O[K][2]])}!N&&typeof p=="object"&&(N=y);const te=me(_,x);o.runHooks("afterSetDataAtCell",te,N),G(te,N,()=>{ae(te,N)})},this.setDataAtRowProp=function(p,y,b,x){const O=ve(p,y,b),_=[];let N=x,K,le;for(K=0,le=O.length;K<le;K++)_.push([O[K][0],O[K][1],c.getAtCell(this.toPhysicalRow(O[K][0]),O[K][1]),O[K][2]]);!N&&typeof p=="object"&&(N=y);const ce=me(_,x);o.runHooks("afterSetDataAtRowProp",ce,N),G(ce,N,()=>{ae(ce,N)})},this.listen=function(){o&&!o.isListening()&&(Ev.forEach(p=>{o!==p&&p.unlisten()}),bv=o.guid,o.runHooks("afterListen"))},this.unlisten=function(){this.isListening()&&(bv=null,o.runHooks("afterUnlisten"))},this.isListening=function(){return bv===o.guid},this.destroyEditor=function(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;o._refreshBorders(p,y)},this.populateFromArray=function(p,y,b,x,O,_,N){if(!(typeof b=="object"&&typeof b[0]=="object"))throw new Error("populateFromArray parameter `input` must be an array of arrays");const K=typeof x=="number"?o._createCellCoords(x,O):null;return u.populateFromArray(o._createCellCoords(p,y),b,K,_,N)},this.spliceCol=function(p,y,b){for(var x=arguments.length,O=new Array(x>3?x-3:0),_=3;_<x;_++)O[_-3]=arguments[_];return l.spliceCol(p,y,b,...O)},this.spliceRow=function(p,y,b){for(var x=arguments.length,O=new Array(x>3?x-3:0),_=3;_<x;_++)O[_-3]=arguments[_];return l.spliceRow(p,y,b,...O)},this.getSelected=function(){if(M.isSelected())return ht(M.getSelectedRange(),p=>{let{from:y,to:b}=p;return[y.row,y.col,b.row,b.col]})},this.getSelectedLast=function(){const p=this.getSelected();let y;return p&&p.length>0&&(y=p[p.length-1]),y},this.getSelectedRange=function(){if(M.isSelected())return Array.from(M.getSelectedRange())},this.getSelectedRangeLast=function(){const p=this.getSelectedRange();let y;return p&&p.length>0&&(y=p[p.length-1]),y},this.emptySelectedCells=function(p){if(!M.isSelected()||this.countRows()===0||this.countCols()===0)return;const y=[];j(M.getSelectedRange(),b=>{if(b.isSingleHeader())return;const x=b.getTopStartCorner(),O=b.getBottomEndCorner();Ue(x.row,O.row,_=>{Ue(x.col,O.col,N=>{this.getCellMeta(_,N).readOnly||y.push([_,N,null])})})}),y.length>0&&this.setDataAtCell(y,p)},this.isRenderSuspended=function(){return this.renderSuspendedCounter>0},this.suspendRender=function(){this.renderSuspendedCounter+=1},this.resumeRender=function(){const p=this.renderSuspendedCounter-1;this.renderSuspendedCounter=Math.max(p,0),!this.isRenderSuspended()&&p===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(p){this.suspendRender();const y=p();return this.resumeRender(),y},this.isExecutionSuspended=function(){return this.executionSuspendedCounter>0},this.suspendExecution=function(){this.executionSuspendedCounter+=1,this.columnIndexMapper.suspendOperations(),this.rowIndexMapper.suspendOperations()},this.resumeExecution=function(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const y=this.executionSuspendedCounter-1;this.executionSuspendedCounter=Math.max(y,0),(!this.isExecutionSuspended()&&y===this.executionSuspendedCounter||p)&&(this.columnIndexMapper.resumeOperations(),this.rowIndexMapper.resumeOperations())},this.batchExecution=function(p){let y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this.suspendExecution();const b=p();return this.resumeExecution(y),b},this.batch=function(p){this.suspendRender(),this.suspendExecution();const y=p();return this.resumeExecution(),this.resumeRender(),y},this.refreshDimensions=function(){if(!o.view)return;const{width:p,height:y}=o.view.getLastSize(),{width:b,height:x}=o.rootElement.getBoundingClientRect(),O=b!==p||x!==y;o.runHooks("beforeRefreshDimensions",{width:p,height:y},{width:b,height:x},O)!==!1&&((O||o.view._wt.wtOverlays.scrollableElement===o.rootWindow)&&(o.view.setLastSize(b,x),o.render()),o.runHooks("afterRefreshDimensions",{width:p,height:y},{width:b,height:x},O))},this.updateData=function(p,y){iA(p,b=>{l=b},b=>{l=b,o.columnIndexMapper.fitToLength(this.getInitialColumnCount()),o.rowIndexMapper.fitToLength(this.countSourceRows()),u.adjustRowsAndCols()},{hotInstance:o,dataMap:l,dataSource:c,internalSource:"updateData",source:y,metaManager:w,firstRun:f})},this.loadData=function(p,y){iA(p,b=>{l=b},()=>{w.clearCellsCache(),o.initIndexMappers(),u.adjustRowsAndCols(),f&&(f=[null,"loadData"])},{hotInstance:o,dataMap:l,dataSource:c,internalSource:"loadData",source:y,metaManager:w,firstRun:f})},this.getInitialColumnCount=function(){const p=C.columns;let y=0;if(Array.isArray(p))y=p.length;else if(Ut(p))if(o.dataType==="array"){const b=this.countSourceCols();for(let x=0;x<b;x+=1)p(x)&&(y+=1)}else(o.dataType==="object"||o.dataType==="function")&&(y=l.colToPropCache.length);else if(He(C.dataSchema)){const b=l.getSchema();y=Array.isArray(b)?b.length:Vy(b)}else y=this.countSourceCols();return y},this.initIndexMappers=function(){this.columnIndexMapper.initToLength(this.getInitialColumnCount()),this.rowIndexMapper.initToLength(this.countSourceRows())},this.getData=function(p,y,b,x){return Gt(p)?l.getAll():l.getRange(o._createCellCoords(p,y),o._createCellCoords(b,x),l.DESTINATION_RENDERER)},this.getCopyableText=function(p,y,b,x){return l.getCopyableText(o._createCellCoords(p,y),o._createCellCoords(b,x))},this.getCopyableData=function(p,y){return l.getCopyable(p,l.colToProp(y))},this.getSchema=function(){return l.getSchema()},this.updateSettings=function(p){let y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const b=(f?o.loadData:o.updateData).bind(this);let x=!1,O,_;if(He(p.rows))throw new Error('The "rows" setting is no longer supported. Do you mean startRows, minRows or maxRows?');if(He(p.cols))throw new Error('The "cols" setting is no longer supported. Do you mean startCols, minCols or maxCols?');if(He(p.ganttChart))throw new Error('Since 8.0.0 the "ganttChart" setting is no longer supported.');for(O in p)O==="data"||(O==="language"?Y(p.language):O==="className"?D("className",p.className):O==="tableClassName"&&o.table?(D("tableClassName",p.tableClassName),o.view._wt.wtOverlays.syncOverlayTableClassNames()):$e.getSingleton().isRegistered(O)||$e.getSingleton().isDeprecated(O)?(Ut(p[O])||Array.isArray(p[O]))&&(p[O].initialHook=!0,o.addHook(O,p[O])):!y&&lr(p,O)&&(S[O]=p[O]));p.data===void 0&&C.data===void 0?b(null,"updateSettings"):p.data!==void 0?b(p.data,"updateSettings"):p.columns!==void 0&&(l.createMap(),o.initIndexMappers());const N=o.countCols(),K=C.columns;if(K&&Ut(K)&&(x=!0),(p.cell!==void 0||p.cells!==void 0||p.columns!==void 0)&&w.clearCache(),N>0)for(O=0,_=0;O<N;O++){if(K){const te=x?K(O):K[_];te&&w.updateColumnMeta(_,te)}_+=1}He(p.cell)&&dt(p.cell,te=>{o.setCellMetaObject(te.row,te.col,te)}),o.runHooks("afterCellMetaReset");let le=o.rootElement.style.height;le!==""&&(le=parseInt(o.rootElement.style.height,10));let ce=p.height;if(Ut(ce)&&(ce=ce()),y&&o.rootElement.getAttribute("style")&&o.rootElement.setAttribute("data-initialstyle",o.rootElement.getAttribute("style")),ce===null){const te=o.rootElement.getAttribute("data-initialstyle");te&&(te.indexOf("height")>-1||te.indexOf("overflow")>-1)?o.rootElement.setAttribute("style",te):(o.rootElement.style.height="",o.rootElement.style.overflow="")}else ce!==void 0&&(o.rootElement.style.height=isNaN(ce)?`${ce}`:`${ce}px`,o.rootElement.style.overflow="hidden");if(typeof p.width!="undefined"){let te=p.width;Ut(te)&&(te=te()),o.rootElement.style.width=isNaN(te)?`${te}`:`${te}px`}y||(o.view&&(o.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked(),o.view._wt.exportSettingsAsClassNames()),o.runHooks("afterUpdateSettings",p)),u.adjustRowsAndCols(),o.view&&!f&&(o.forceFullRender=!0,h.lockEditor(),o._refreshBorders(null),o.view._wt.wtOverlays.adjustElementsSize(),h.unlockEditor()),!y&&o.view&&(le===""||ce===""||ce===void 0)&&le!==ce&&o.view._wt.wtOverlays.updateMainScrollableElements()},this.getValue=function(){const p=o.getSelectedLast();if(C.getValue){if(Ut(C.getValue))return C.getValue.call(o);if(p)return o.getData()[p[0][0]][C.getValue]}else if(p)return o.getDataAtCell(p[0],p[1])},this.getSettings=function(){return C},this.clear=function(){this.selectAll(),this.emptySelectedCells()},this.alter=function(p,y,b,x,O){u.alter(p,y,b,x,O)},this.getCell=function(p,y){let b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,x=y,O=p;if(y>=0){if(this.columnIndexMapper.isHidden(this.toPhysicalColumn(y)))return null;x=this.columnIndexMapper.getRenderableFromVisualIndex(y)}if(p>=0){if(this.rowIndexMapper.isHidden(this.toPhysicalRow(p)))return null;O=this.rowIndexMapper.getRenderableFromVisualIndex(p)}return O===null||x===null?null:o.view.getCellAtCoords(o._createCellCoords(O,x),b)},this.getCoords=function(p){const y=this.view._wt.wtTable.getCoords(p);if(y===null)return null;const{row:b,col:x}=y;let O=b,_=x;return b>=0&&(O=this.rowIndexMapper.getVisualFromRenderableIndex(b)),x>=0&&(_=this.columnIndexMapper.getVisualFromRenderableIndex(x)),o._createCellCoords(O,_)},this.colToProp=function(p){return l.colToProp(p)},this.propToCol=function(p){return l.propToCol(p)},this.toVisualRow=p=>this.rowIndexMapper.getVisualFromPhysicalIndex(p),this.toVisualColumn=p=>this.columnIndexMapper.getVisualFromPhysicalIndex(p),this.toPhysicalRow=p=>this.rowIndexMapper.getPhysicalFromVisualIndex(p),this.toPhysicalColumn=p=>this.columnIndexMapper.getPhysicalFromVisualIndex(p),this.getDataAtCell=function(p,y){return l.get(p,l.colToProp(y))},this.getDataAtRowProp=function(p,y){return l.get(p,y)},this.getDataAtCol=function(p){const y=[],b=l.getRange(o._createCellCoords(0,p),o._createCellCoords(C.data.length-1,p),l.DESTINATION_RENDERER);for(let x=0;x<b.length;x+=1)for(let O=0;O<b[x].length;O+=1)y.push(b[x][O]);return y},this.getDataAtProp=function(p){const y=[],b=l.getRange(o._createCellCoords(0,l.propToCol(p)),o._createCellCoords(C.data.length-1,l.propToCol(p)),l.DESTINATION_RENDERER);for(let x=0;x<b.length;x+=1)for(let O=0;O<b[x].length;O+=1)y.push(b[x][O]);return y},this.getSourceData=function(p,y,b,x){let O;return p===void 0?O=c.getData():O=c.getByRange(o._createCellCoords(p,y),o._createCellCoords(b,x)),O},this.getSourceDataArray=function(p,y,b,x){let O;return p===void 0?O=c.getData(!0):O=c.getByRange(o._createCellCoords(p,y),o._createCellCoords(b,x),!0),O},this.getSourceDataAtCol=function(p){return c.getAtColumn(p)},this.setSourceDataAtCell=function(p,y,b,x){const O=ve(p,y,b),_=this.hasHook("afterSetSourceDataAtCell"),N=[];_&&j(O,le=>{let[ce,te,ge]=le;N.push([ce,te,c.getAtCell(ce,te),ge])}),j(O,le=>{let[ce,te,ge]=le;c.setAtCell(ce,te,ge)}),_&&this.runHooks("afterSetSourceDataAtCell",N,x),this.render();const K=o.getActiveEditor();K&&He(K.refreshValue)&&K.refreshValue()},this.getSourceDataAtRow=function(p){return c.getAtRow(p)},this.getSourceDataAtCell=function(p,y){return c.getAtCell(p,y)},this.getDataAtRow=function(p){return l.getRange(o._createCellCoords(p,0),o._createCellCoords(p,this.countCols()-1),l.DESTINATION_RENDERER)[0]||[]},this.getDataType=function(p,y,b,x){const O=p===void 0?[0,0,this.countRows(),this.countCols()]:[p,y,b,x],[_,N]=O;let[,,K,le]=O,ce=null,te=null;K===void 0&&(K=_),le===void 0&&(le=N);let ge="mixed";return Ue(Math.max(Math.min(_,K),0),Math.max(_,K),Me=>{let L=!0;return Ue(Math.max(Math.min(N,le),0),Math.max(N,le),Fe=>(te=this.getCellMeta(Me,Fe).type,ce?L=ce===te:ce=te,L)),ge=L?te:"mixed",L}),ge},this.removeCellMeta=function(p,y,b){const[x,O]=[this.toPhysicalRow(p),this.toPhysicalColumn(y)];let _=w.getCellMetaKeyValue(x,O,b);o.runHooks("beforeRemoveCellMeta",p,y,b,_)!==!1&&(w.removeCellMeta(x,O,b),o.runHooks("afterRemoveCellMeta",p,y,b,_)),_=null},this.spliceCellsMeta=function(p){let y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;for(var b=arguments.length,x=new Array(b>2?b-2:0),O=2;O<b;O++)x[O-2]=arguments[O];if(x.length>0&&!Array.isArray(x[0]))throw new Error("The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.");y>0&&w.removeRow(this.toPhysicalRow(p),y),x.length>0&&j(x.reverse(),_=>{w.createRow(this.toPhysicalRow(p)),j(_,(N,K)=>this.setCellMetaObject(p,K,N))}),o.render()},this.setCellMetaObject=function(p,y,b){typeof b=="object"&&dt(b,(x,O)=>{this.setCellMeta(p,y,O,x)})},this.setCellMeta=function(p,y,b,x){if(o.runHooks("beforeSetCellMeta",p,y,b,x)===!1)return;let _=p,N=y;p<this.countRows()&&(_=this.toPhysicalRow(p)),y<this.countCols()&&(N=this.toPhysicalColumn(y)),w.setCellMeta(_,N,b,x),o.runHooks("afterSetCellMeta",p,y,b,x)},this.getCellsMeta=function(){return w.getCellsMeta()},this.getCellMeta=function(p,y){let b=this.toPhysicalRow(p),x=this.toPhysicalColumn(y);return b===null&&(b=p),x===null&&(x=y),w.getCellMeta(b,x,{visualRow:p,visualColumn:y})},this.getCellMetaAtRow=function(p){return w.getCellsMetaAtRow(p)},this.isColumnModificationAllowed=function(){return!(o.dataType==="object"||C.columns)},this.getCellRenderer=function(p,y){const b=typeof p=="number"?o.getCellMeta(p,y).renderer:p.renderer;return typeof b=="string"?g_(b):Gt(b)?g_("text"):b},this.getCellEditor=function(p,y){const b=typeof p=="number"?o.getCellMeta(p,y).editor:p.editor;return typeof b=="string"?r_(b):Gt(b)?r_("text"):b},this.getCellValidator=function(p,y){const b=typeof p=="number"?o.getCellMeta(p,y).validator:p.validator;return typeof b=="string"?Xee(b):b},this.validateCells=function(p){this._validateCells(p)},this.validateRows=function(p,y){if(!Array.isArray(p))throw new Error("validateRows parameter `rows` must be an array");this._validateCells(y,p)},this.validateColumns=function(p,y){if(!Array.isArray(p))throw new Error("validateColumns parameter `columns` must be an array");this._validateCells(y,void 0,p)},this._validateCells=function(p,y,b){const x=new U;p&&(x.onQueueEmpty=p);let O=o.countRows()-1;for(;O>=0;){if(y!==void 0&&y.indexOf(O)===-1){O-=1;continue}let _=o.countCols()-1;for(;_>=0;){if(b!==void 0&&b.indexOf(_)===-1){_-=1;continue}x.addValidatorToQueue(),o.validateCell(o.getDataAtCell(O,_),o.getCellMeta(O,_),N=>{if(typeof N!="boolean")throw new Error("Validation error: result is not boolean");N===!1&&(x.valid=!1),x.removeValidatorFormQueue()},"validateCells"),_-=1}O-=1}x.checkIfQueueIsEmpty()},this.getRowHeader=function(p){let y=C.rowHeaders,b=p;return b!==void 0&&(b=o.runHooks("modifyRowHeader",b)),b===void 0?(y=[],Ue(o.countRows()-1,x=>{y.push(o.getRowHeader(x))})):Array.isArray(y)&&y[b]!==void 0?y=y[b]:Ut(y)?y=y(b):y&&typeof y!="string"&&typeof y!="number"&&(y=b+1),y},this.hasRowHeaders=function(){return!!C.rowHeaders},this.hasColHeaders=function(){if(C.colHeaders!==void 0&&C.colHeaders!==null)return!!C.colHeaders;for(let p=0,y=o.countCols();p<y;p++)if(o.getColHeader(p))return!0;return!1},this.getColHeader=function(p){let y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1;const b=o.runHooks("modifyColHeader",p);if(b===void 0){const K=[],le=o.countCols();for(let ce=0;ce<le;ce++)K.push(o.getColHeader(ce));return K}let x=C.colHeaders;const O=function(K){const le=[],ce=o.countCols();let te=0;for(;te<ce;te++)Ut(C.columns)&&C.columns(te)&&le.push(te);return le[K]},_=o.toPhysicalColumn(b),N=O(_);return C.colHeaders===!1?x=null:C.columns&&Ut(C.columns)&&C.columns(N)&&C.columns(N).title?x=C.columns(N).title:C.columns&&C.columns[_]&&C.columns[_].title?x=C.columns[_].title:Array.isArray(C.colHeaders)&&C.colHeaders[_]!==void 0?x=C.colHeaders[_]:Ut(C.colHeaders)?x=C.colHeaders(_):C.colHeaders&&typeof C.colHeaders!="string"&&typeof C.colHeaders!="number"&&(x=Tie(b)),x=o.runHooks("modifyColumnHeaderValue",x,p,y),x},this._getColWidthFromSettings=function(p){let y;if(p>=0&&(y=o.getCellMeta(0,p).width),(y===void 0||y===C.width)&&(y=C.colWidths),y!=null){switch(typeof y){case"object":y=y[p];break;case"function":y=y(p);break}typeof y=="string"&&(y=parseInt(y,10))}return y},this.getColWidth=function(p){let y=o._getColWidthFromSettings(p);return y=o.runHooks("modifyColWidth",y,p),y===void 0&&(y=Sf.DEFAULT_WIDTH),y},this._getRowHeightFromSettings=function(p){let y=C.rowHeights;if(y!=null){switch(typeof y){case"object":y=y[p];break;case"function":y=y(p);break}typeof y=="string"&&(y=parseInt(y,10))}return y},this.getRowHeight=function(p){let y=o._getRowHeightFromSettings(p);return y=o.runHooks("modifyRowHeight",y,p),y},this.countSourceRows=function(){return c.countRows()},this.countSourceCols=function(){return c.countFirstRowKeys()},this.countRows=function(){return l.getLength()},this.countCols=function(){const p=C.maxCols,y=this.columnIndexMapper.getNotTrimmedIndexesLength();return Math.min(p,y)},this.countRenderedRows=function(){return o.view._wt.drawn?o.view._wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return o.view._wt.drawn?o.view._wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return o.view._wt.drawn?o.view._wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return o.view._wt.drawn?o.view._wt.wtTable.getVisibleColumnsCount():-1},this.countRowHeaders=function(){return this.view.getRowHeadersCount()},this.countColHeaders=function(){return this.view.getColumnHeadersCount()},this.countEmptyRows=function(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,y=0;return D1(o.countRows()-1,b=>{if(o.isEmptyRow(b))y+=1;else if(p===!0)return!1}),y},this.countEmptyCols=function(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,y=0;return D1(o.countCols()-1,b=>{if(o.isEmptyCol(b))y+=1;else if(p===!0)return!1}),y},this.isEmptyRow=function(p){return C.isEmptyRow.call(o,p)},this.isEmptyCol=function(p){return C.isEmptyCol.call(o,p)},this.selectCell=function(p,y,b,x){let O=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,_=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;return Gt(p)||Gt(y)?!1:this.selectCells([[p,y,b,x]],O,_)},this.selectCells=function(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[[]],y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;y===!1&&(s=!0);const x=M.selectCells(p);return x&&b&&o.listen(),s=!1,x},this.selectColumns=function(p){let y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p,b=arguments.length>2?arguments[2]:void 0;return M.selectColumns(p,y,b)},this.selectRows=function(p){let y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p,b=arguments.length>2?arguments[2]:void 0;return M.selectRows(p,y,b)},this.deselectCell=function(){M.deselect()},this.selectAll=function(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p,b=arguments.length>2?arguments[2]:void 0;s=!0,M.selectAll(p,y,b),s=!1};const Re=(p,y)=>p.getNearestNotHiddenIndex(y,1,!0);this.scrollViewportTo=function(p){var y;if(typeof p=="number"){var b;p={row:arguments[0],col:arguments[1],verticalSnap:arguments[2]?"bottom":"top",horizontalSnap:arguments[3]?"end":"start",considerHiddenIndexes:(b=arguments[4])!==null&&b!==void 0?b:!0}}const{row:x,col:O,verticalSnap:_,horizontalSnap:N,considerHiddenIndexes:K}=(y=p)!==null&&y!==void 0?y:{};let le,ce,te,ge;_!==void 0&&(le=_==="top",ce=!le),N!==void 0&&(te=N==="start",ge=!te);let Me=x,L=O;if(K===void 0||K){const ze=Number.isInteger(x)&&x>=0,Ie=Number.isInteger(O)&&O>=0,we=ze?Re(this.rowIndexMapper,x):void 0,Be=Ie?Re(this.columnIndexMapper,O):void 0;if(we===null||Be===null)return!1;Me=ze?o.rowIndexMapper.getRenderableFromVisualIndex(we):x,L=Ie?o.columnIndexMapper.getRenderableFromVisualIndex(Be):O}const Fe=Number.isInteger(Me),ue=Number.isInteger(L);return Fe&&Me>=0&&ue&&L>=0?o.view.scrollViewport(o._createCellCoords(Me,L),le,ge,ce,te):Fe&&Me>=0&&(ue&&L<0||!ue)?o.view.scrollViewportVertically(Me,le,ce):ue&&L>=0&&(Fe&&Me<0||!Fe)?o.view.scrollViewportHorizontally(L,ge,te):!1},this.scrollToFocusedCell=function(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:()=>{};if(!this.selection.isSelected())return;this.addHookOnce("afterScroll",p);const{highlight:y}=this.getSelectedRangeLast();this.scrollViewportTo(y.toObject())?this.view.render():(this.removeHook("afterScroll",p),this._registerImmediate(()=>p()))},this.destroy=function(){if(o._clearTimeouts(),o._clearImmediates(),o.view&&o.view.destroy(),c&&c.destroy(),c=null,this.getShortcutManager().destroy(),w.clearCache(),Ev.delete(this.guid),D0(o)){const p=this.rootDocument.querySelector(".hot-display-license-info");p&&p.parentNode.removeChild(p)}Zs(o.rootElement),a.destroy(),h&&h.destroy(),o.batchExecution(()=>{o.rowIndexMapper.unregisterAll(),o.columnIndexMapper.unregisterAll(),v.getItems().forEach(p=>{let[,y]=p;y.destroy()}),v.clear(),o.runHooks("afterDestroy")},!0),$e.getSingleton().destroy(o),dt(o,(p,y,b)=>{Ut(p)?b[y]=Ce(y):y!=="guid"&&(b[y]=null)}),o.isDestroyed=!0,l&&l.destroy(),l=null,u=null,M=null,h=null,o=null};function Ce(p){return()=>{throw new Error(`The "${p}" method cannot be called because this Handsontable instance has been destroyed`)}}this.getActiveEditor=function(){return h.getActiveEditor()},this.getPlugin=function(p){const y=gs(p);return y==="UndoRedo"?this.undoRedo:v.getItem(y)},this.getPluginName=function(p){return p===this.undoRedo?this.undoRedo.constructor.PLUGIN_KEY:v.getId(p)},this.getInstance=function(){return o},this.addHook=function(p,y){$e.getSingleton().add(p,y,o)},this.hasHook=function(p){return $e.getSingleton().has(p,o)||$e.getSingleton().has(p)},this.addHookOnce=function(p,y){$e.getSingleton().once(p,y,o)},this.removeHook=function(p,y){$e.getSingleton().remove(p,y,o)},this.runHooks=function(p,y,b,x,O,_,N){return $e.getSingleton().run(o,p,y,b,x,O,_,N)},this.getTranslatedPhrase=function(p,y){return WF(C.language,p,y)},this.toHTML=()=>h_(this),this.toTableElement=()=>{const p=this.rootDocument.createElement("div");return p.insertAdjacentHTML("afterbegin",h_(this)),p.firstElementChild},this.timeouts=[],this._registerTimeout=function(p){let y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,b=p;typeof b=="function"&&(b=setTimeout(b,y)),this.timeouts.push(b)},this._clearTimeouts=function(){j(this.timeouts,p=>{clearTimeout(p)})},this.immediates=[],this._registerImmediate=function(p){this.immediates.push(setImmediate(p))},this._clearImmediates=function(){j(this.immediates,p=>{clearImmediate(p)})},this._refreshBorders=function(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;h.destroyEditor(p),o.view.render(),y&&M.isSelected()&&h.prepareEditor()},this._getEditorManager=function(){return h},this.isRtl=function(){return o.rootWindow.getComputedStyle(o.rootElement).direction==="rtl"},this.isLtr=function(){return!o.isRtl()},this.getDirectionFactor=function(){return o.isLtr()?1:-1};const _e=kae({handleEvent(){return o.isListening()},beforeKeyDown:p=>this.runHooks("beforeKeyDown",p),afterKeyDown:p=>{this.isDestroyed||o.runHooks("afterDocumentKeyDown",p)},ownerWindow:this.rootWindow});this.addHook("beforeOnCellMouseDown",p=>{p.ctrlKey===!1&&p.metaKey===!1&&_e.releasePressedKeys()}),this.getShortcutManager=function(){return _e},this.getFocusManager=function(){return d},zH().forEach(p=>{const y=Ky(p);v.addItem(p,new y(this))}),Eae(o),_e.setActiveContextName("grid"),$e.getSingleton().run(o,"construct")}const Nae="hooksRefRegisterer",oL={_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){j(this._hooksStorage[t]||[],e=>{this.hot.removeHook(t,e)})},clearHooks(){dt(this._hooksStorage,(t,e)=>this.removeHooksByKey(e)),this._hooksStorage={}}};zo(oL,"MIXIN_NAME",Nae,{writable:!1,enumerable:!1});const Hae=oL;function Ki(t,e,r){return e=Fae(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fae(t){var e=Lae(t,"string");return typeof e=="symbol"?e:String(e)}function Lae(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const $ae="base",_r=Object.freeze({VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"}),K1="baseEditor";class zu{static get EDITOR_TYPE(){return $ae}constructor(e){Ki(this,"hot",void 0),Ki(this,"state",_r.VIRGIN),Ki(this,"_opened",!1),Ki(this,"_fullEditMode",!1),Ki(this,"_closeCallback",null),Ki(this,"TD",null),Ki(this,"row",null),Ki(this,"col",null),Ki(this,"prop",null),Ki(this,"originalValue",null),Ki(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,r,n,i,s,o){this.TD=i,this.row=e,this.col=r,this.prop=n,this.originalValue=s,this.cellProperties=o,this.state=_r.VIRGIN}extend(){return class extends this.constructor{}}saveValue(e,r){let n,i,s,o;if(r){const h=this.hot.getSelectedLast();n=Math.max(Math.min(h[0],h[2]),0),i=Math.max(Math.min(h[1],h[3]),0),s=Math.max(h[0],h[2]),o=Math.max(h[1],h[3])}else[n,i,s,o]=[this.row,this.col,null,null];const a=this.hot.runHooks("modifyGetCellCoords",n,i);Array.isArray(a)&&([n,i]=a);const c=this.hot.getShortcutManager().getContext("editor"),u={runOnlyIf:()=>He(this.hot.getSelected()),group:K1};this.isInFullEditMode()&&c.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())}}],u),this.hot.populateFromArray(n,i,e,s,o,"edit")}beginEditing(e,r){if(this.state!==_r.VIRGIN)return;const n=this.hot,i=n.rowIndexMapper.getRenderableFromVisualIndex(this.row),s=n.columnIndexMapper.getRenderableFromVisualIndex(this.col);if(n.view.scrollViewport(n._createCellCoords(i,s)),this.state=_r.EDITING,this.isInFullEditMode()){const o=typeof e=="string"?e:Sr(this.originalValue);this.setValue(o)}this.open(r),this._opened=!0,this.focus(),n.view.render(),n.runHooks("afterBeginEditing",this.row,this.col)}finishEditing(e,r,n){let i;if(n){const a=this._closeCallback;this._closeCallback=l=>{a&&a(l),n(l),this.hot.view.render()}}if(this.isWaiting())return;const o=this.hot.getShortcutManager().getContext("editor");if(o.removeShortcutsByGroup(K1),o.removeShortcutsByGroup(Mp),this.state===_r.VIRGIN){this.hot._registerTimeout(()=>{this._fireCallbacks(!0)});return}if(this.state===_r.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=_r.WAITING,this.saveValue(i,r),this.hot.getCellValidator(this.cellProperties)?this.hot.addHookOnce("postAfterValidate",l=>{this.state=_r.FINISHED,this.discardEditor(l)}):(this.state=_r.FINISHED,this.discardEditor(!0))}}cancelChanges(){this.state=_r.FINISHED,this.discardEditor()}discardEditor(e){this.state===_r.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.hot.selectCell(this.row,this.col),this.focus(),this.state=_r.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=_r.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===_r.WAITING}getEditedCellRect(){var e;const r=this.getEditedCell();if(!r)return;const{wtOverlays:n,wtViewport:i}=this.hot.view._wt,s=this.hot.rootWindow,o=Wr(r),a=Ht(r),l=Wr(this.hot.rootElement),c=Ht(this.hot.rootElement),u=n.topOverlay.holder,h=n.inlineStartOverlay.holder,d=u!==s?u.scrollTop:0,f=h!==s?h.scrollLeft:0,g=s.innerWidth-l.left-c,{wtTable:m}=(e=n.getParentOverlay(r))!==null&&e!==void 0?e:this.hot.view._wt,w=m.name,C=["master","inline_start"].includes(w)?d:0,S=["master","top","bottom"].includes(w)?f:0,v=o.top===l.top?0:1;let T=o.top-l.top-v-C,A=0;this.hot.isRtl()?A=s.innerWidth-o.left-a-g-1+S:A=o.left-l.left-1-S,["top","top_inline_start_corner"].includes(w)&&(T+=n.topOverlay.getOverlayOffset()),["inline_start","top_inline_start_corner"].includes(w)&&(A+=Math.abs(n.inlineStartOverlay.getOverlayOffset()));const M=this.hot.hasColHeaders(),E=this.hot.rowIndexMapper.getRenderableFromVisualIndex(this.row),Y=this.hot.columnIndexMapper.getRenderableFromVisualIndex(this.col),U=this.hot.rowIndexMapper.getRenderableIndexesLength()-this.hot.view._wt.getSetting("fixedRowsBottom");(M&&E<=0||E===U)&&(T+=1),Y<=0&&(A+=1);const X=i.rowsRenderCalculator.startPosition,G=i.columnsRenderCalculator.startPosition,ae=Math.abs(n.inlineStartOverlay.getScrollPosition()),ve=n.topOverlay.getScrollPosition(),me=Ur(this.hot.rootDocument);let Re=r.offsetTop;if(["inline_start","master"].includes(w)&&(Re+=X-ve),["bottom","bottom_inline_start_corner"].includes(w)){const{wtViewport:ce,wtTable:te}=n.bottomOverlay.clone;Re+=ce.getWorkspaceHeight()-te.getHeight()-me}let Ce=r.offsetLeft;this.hot.isRtl()?(Ce>=0?Ce=m.getWidth()-r.offsetLeft:Ce=Math.abs(Ce),Ce+=G-ae-a):["top","master","bottom"].includes(w)&&(Ce+=G-ae);const _e=Fa(this.TD,this.hot.rootWindow),p=this.hot.isRtl()?"borderRightWidth":"borderLeftWidth",y=parseInt(_e[p],10)>0?0:1,b=parseInt(_e.borderTopWidth,10)>0?0:1,x=Ht(r)+y,O=cr(r)+b,_=TQ(u)?me:0,N=_Q(h)?me:0,K=this.hot.view.maximumVisibleElementWidth(Ce)-_+y,le=Math.max(this.hot.view.maximumVisibleElementHeight(Re)-N+b,23);return{top:T,start:A,height:O,maxHeight:le,width:x,maxWidth:K}}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 r="";return this.row<this.hot.getSettings().fixedRowsTop?this.col<this.hot.getSettings().fixedColumnsStart?r="top-inline-start-corner":r="top":this.hot.getSettings().fixedRowsBottom&&this.row>=e-this.hot.getSettings().fixedRowsBottom?this.col<this.hot.getSettings().fixedColumnsStart?r="bottom-inline-start-corner":r="bottom":this.col<this.hot.getSettings().fixedColumnsStart&&(r="inline-start"),r}}Vt(zu,Hae);function cA(t,e,r){t.addEventListener(e,r,!1)}function uA(t,e,r){t.removeEventListener(e,r,!1)}function hA(t){return t.ownerDocument.defaultView.getComputedStyle(t)}function Bae(t){const e={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300},r=t.body,n=t.createTextNode(""),i=t.createElement("span");let s;function o(){n.textContent=s.value,i.style.position="absolute",i.style.fontSize=hA(s).fontSize,i.style.fontFamily=hA(s).fontFamily,i.style.whiteSpace="pre",r.appendChild(i);const u=i.clientWidth+2;r.removeChild(i);const h=s.style;h.height=`${e.minHeight}px`,e.minWidth>u?h.width=`${e.minWidth}px`:u>e.maxWidth?h.width=`${e.maxWidth}px`:h.width=`${u}px`;const d=s.scrollHeight?s.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(o,0)}function l(u){if(u&&u.minHeight)if(u.minHeight==="inherit")e.minHeight=s.clientHeight;else{const h=parseInt(u.minHeight,10);isNaN(h)||(e.minHeight=h)}if(u&&u.maxHeight)if(u.maxHeight==="inherit")e.maxHeight=s.clientHeight;else{const h=parseInt(u.maxHeight,10);isNaN(h)||(e.maxHeight=h)}if(u&&u.minWidth)if(u.minWidth==="inherit")e.minWidth=s.clientWidth;else{const h=parseInt(u.minWidth,10);isNaN(h)||(e.minWidth=h)}if(u&&u.maxWidth)if(u.maxWidth==="inherit")e.maxWidth=s.clientWidth;else{const h=parseInt(u.maxWidth,10);isNaN(h)||(e.maxWidth=h)}i.firstChild||(i.className="autoResize",i.style.display="inline-block",i.appendChild(n))}function c(u,h){let d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;s=u,l(h),s.nodeName==="TEXTAREA"&&(s.style.resize="none",s.style.overflowY="",s.style.height=`${e.minHeight}px`,s.style.minWidth=`${e.minWidth}px`,s.style.maxWidth=`${e.maxWidth}px`,s.style.overflowY="hidden"),d&&(cA(s,"input",o),cA(s,"keydown",a)),o()}return{init:c,resize:o,unObserve(){uA(s,"input",o),uA(s,"keydown",a)}}}function dA(t,e){const r=SH(e),n=e.value.split(`
  97. `);let i=r,s=0;for(let o=0;o<n.length;o++){const a=n[o];o!==0&&(s+=n[o-1].length+1);const l=s+a.length;if(t==="home"?i=s:t==="end"&&(i=l),r<=l)break}Tp(e,i)}function al(t,e,r){return e=Wae(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Wae(t){var e=Vae(t,"string");return typeof e=="symbol"?e:String(e)}function Vae(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Uae="ht_editor_visible",Dg="ht_editor_hidden",fA="textEditor",Gae="text";class hc extends zu{static get EDITOR_TYPE(){return Gae}constructor(e){super(e),al(this,"eventManager",new ms(this)),al(this,"autoResize",Bae(this.hot.rootDocument)),al(this,"TEXTAREA",void 0),al(this,"textareaStyle",void 0),al(this,"TEXTAREA_PARENT",void 0),al(this,"textareaParentStyle",void 0),al(this,"layerClass",void 0),this.eventManager=new ms(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(),SQ(this.hot.rootDocument.activeElement,this.hot.rootElement)&&this.hot.listen(),this.hideEditableElement(),this.unregisterShortcuts()}prepare(e,r,n,i,s,o){const a=this.state;if(super.prepare(e,r,n,i,s,o),!o.readOnly){this.refreshDimensions(!0);const{allowInvalid:l}=o;l&&(this.TEXTAREA.value=""),a!==_r.FINISHED&&this.hideEditableElement()}}beginEditing(e,r){this.state===_r.VIRGIN&&(this.TEXTAREA.value="",super.beginEditing(e,r))}focus(){this.TEXTAREA.select(),Tp(this.TEXTAREA,this.TEXTAREA.value.length)}createElements(){const{rootDocument:e}=this.hot;this.TEXTAREA=e.createElement("TEXTAREA"),qe(this.TEXTAREA,[["data-hot-input",""],Vu(-1)]),this.hot.getSettings().ariaTags&&qe(this.TEXTAREA,[Yo()]),be(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"),be(this.TEXTAREA_PARENT,"handsontableInputHolder"),Je(this.TEXTAREA_PARENT,this.layerClass)&&rt(this.TEXTAREA_PARENT,this.layerClass),be(this.TEXTAREA_PARENT,Dg),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.hot.rootElement.appendChild(this.TEXTAREA_PARENT)}hideEditableElement(){QQ()&&(this.textareaStyle.textIndent="-99999px"),this.textareaStyle.overflowY="visible",this.textareaParentStyle.opacity="0",this.textareaParentStyle.height="1px",rt(this.TEXTAREA_PARENT,this.layerClass),be(this.TEXTAREA_PARENT,Dg)}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 r=!1;Ue(e.length-1,n=>{const i=e[n];if(Je(i,"handsontableEditor"))return r=!0,!1}),Je(this.TEXTAREA_PARENT,Dg)&&rt(this.TEXTAREA_PARENT,Dg),r?(this.layerClass=Uae,be(this.TEXTAREA_PARENT,this.layerClass)):(this.layerClass=this.getEditedCellsLayerClass(),be(this.TEXTAREA_PARENT,this.layerClass))}refreshValue(){const e=this.hot.toPhysicalRow(this.row),r=this.hot.getSourceDataAtCell(e,this.col);this.originalValue=r,this.setValue(r),this.refreshDimensions()}refreshDimensions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.state!==_r.EDITING&&!e)return;if(this.TD=this.getEditedCell(),!this.TD){e||this.close();return}const{top:r,start:n,width:i,maxWidth:s,height:o,maxHeight:a}=this.getEditedCellRect();this.textareaParentStyle.top=`${r}px`,this.textareaParentStyle[this.hot.isRtl()?"right":"left"]=`${n}px`,this.showEditableElement();const l=Fa(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 c=Fa(this.TEXTAREA),u=parseInt(c.paddingLeft,10)+parseInt(c.paddingRight,10),h=parseInt(c.paddingTop,10)+parseInt(c.paddingBottom,10),d=i-u,f=o-h,g=s-u,m=a-h;this.autoResize.init(this.TEXTAREA,{minWidth:Math.min(d,g),minHeight:Math.min(f,m),maxWidth:g,maxHeight:m},!0)}bindEvents(){DH()&&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===_r.EDITING&&this.focus()}),this.addHook("afterRowResize",()=>{this.refreshDimensions(),this.state===_r.EDITING&&this.focus()})}allowKeyEventPropagation(){}destroy(){this.eventManager.destroy(),this.clearHooks()}registerShortcuts(){const e=this.hot.getShortcutManager(),r=e.getContext("editor"),n=e.getContext("grid"),i={runOnlyIf:()=>He(this.hot.getSelected()),group:fA},s=()=>{this.hot.rootDocument.execCommand("insertText",!1,`
  98. `)};r.addShortcuts([{keys:[["Tab"],["Shift","Tab"],["PageUp"],["PageDown"]],forwardToContext:n,callback:()=>{}},{keys:[["Control","Enter"]],callback:()=>(s(),!1),runOnlyIf:o=>!this.hot.selection.isMultiple()&&!o.altKey},{keys:[["Meta","Enter"]],callback:()=>(s(),!1),runOnlyIf:()=>!this.hot.selection.isMultiple()},{keys:[["Alt","Enter"]],callback:()=>(s(),!1)},{keys:[["Home"]],callback:(o,a)=>{let[l]=a;dA(l,this.TEXTAREA)}},{keys:[["End"]],callback:(o,a)=>{let[l]=a;dA(l,this.TEXTAREA)}}],i)}unregisterShortcuts(){const r=this.hot.getShortcutManager().getContext("editor");r.removeShortcutsByGroup(Mp),r.removeShortcutsByGroup(fA),r.removeShortcutsByGroup(K1)}}const Yae="base";function Ef(t,e,r,n,i,s,o){const a=o.ariaTags,l=[],c=[],u=[],h=[];o.className&&be(e,o.className),o.readOnly?(l.push(o.readOnlyCellClassName),a&&h.push(VT())):a&&u.push(VT()[0]),o.valid===!1&&o.invalidCellClassName?(l.push(o.invalidCellClassName),a&&h.push(UT())):(c.push(o.invalidCellClassName),a&&u.push(UT()[0])),o.wordWrap===!1&&o.noWordWrapClassName&&l.push(o.noWordWrapClassName),!s&&o.placeholder&&l.push(o.placeholderCellClassName),rt(e,c),be(e,l),Uu(e,u),qe(e,h)}Ef.RENDERER_TYPE=Yae;const zae="text";function Ko(t,e,r,n,i,s,o){Ef.apply(this,[t,e,r,n,i,s,o]);let a=s;if(!a&&o.placeholder&&(a=o.placeholder),a=Sr(a),o.trimWhitespace&&(a=a.trim()),o.rendererTemplate){Zs(e);const l=t.rootDocument.createElement("TEMPLATE");l.setAttribute("bind","{{}}"),l.innerHTML=o.rendererTemplate,HTMLTemplateElement.decorate(l),l.model=t.getSourceDataAtRow(r),e.appendChild(l)}else jl(e,a)}Ko.RENDERER_TYPE=zae;const jae="text",aL={CELL_TYPE:jae,editor:hc,renderer:Ko};es(aL);mi.editors={BaseEditor:zu};function mi(t,e){const r=new sL(t,e||{},dx);return r.init(),r}mi.Core=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new sL(t,e,dx)};mi.DefaultSettings=JF();mi.hooks=$e.getSingleton();mi.CellCoords=bm;mi.CellRange=qy;mi.packageName="handsontable";mi.buildDate="16/01/2024 10:27:23";mi.version="14.1.0";mi.languages={dictionaryKeys:hse,getLanguageDictionary:BF,getLanguagesDictionaries:pse,registerLanguageDictionary:$F,getTranslatedPhrase:WF};function gA(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Kae(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?gA(Object(r),!0).forEach(function(n){Zae(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):gA(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Xae(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function qae(t){var e=Xae(t,"string");return typeof e=="symbol"?e:String(e)}function X1(t){return X1=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},X1(t)}function Zae(t,e,r){return e=qae(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Eu=Symbol("unassigned"),Jae="The Handsontable instance bound to this component was destroyed and cannot be used properly.";function Am(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function lL(t){var e=mi.hooks.getRegistered(),r={};Object.assign(r,mi.DefaultSettings);for(var n in r)r[n]={default:Eu};for(var i=0;i<e.length;i++)r[e[i]]={default:Eu};return r.settings={default:Eu},t==="HotTable"&&(r.id={type:String,default:"hot-".concat(Math.random().toString(36).substring(5))}),r}function cL(t){var e={},r=t.settings;if(r!==Eu)for(var n in r)Am(r,n)&&r[n]!==Eu&&(e[n]=r[n]);for(var i in t)Am(t,i)&&i!=="settings"&&t[i]!==Eu&&(e[i]=t[i]);return e}function mA(t,e){var r=cL(t),n=t.settings?t.settings:r,i=t.settings?r:null,s={};for(var o in n)Am(n,o)&&n[o]!==void 0&&(e&&o!=="data"?!pA(e[o],n[o]):!0)&&(s[o]=n[o]);for(var a in i)Am(i,a)&&a!=="id"&&a!=="settings"&&i[a]!==void 0&&(e&&a!=="data"?!pA(e[a],i[a]):!0)&&(s[a]=i[a]);return s}function pA(t,e){var r=function(){var n=new WeakSet;return function(i,s){if(X1(s)==="object"&&s!==null){if(n.has(s))return;n.add(s)}return s}}();return JSON.stringify(t,r)===JSON.stringify(e,r)}var Qae="14.1.0",Gb=xS({name:"HotTable",props:lL("HotTable"),provide:function(){return{columnsCache:this.columnsCache}},watch:{$props:{handler:function(e){var r=mA(e,this.hotInstance?this.hotInstance.getSettings():void 0);!this.hotInstance||r===void 0||(r.data&&(this.hotInstance.isColumnModificationAllowed()||!this.hotInstance.isColumnModificationAllowed()&&this.hotInstance.countSourceCols()===this.miscCache.currentSourceColumns)&&(this.matchHotMappersSize(),delete r.data),Object.keys(r).length?this.hotInstance.updateSettings(r):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(Jae),null)},set hotInstance(e){this.__hotInstance=e}}},methods:{hotInit:function(){var e=mA(this.$props);e.columns=this.columnSettings?this.columnSettings:e.columns,this.hotInstance=P4(new mi.Core(this.$el,e)),this.hotInstance.init(),this.miscCache.currentSourceColumns=this.hotInstance.countSourceCols()},matchHotMappersSize:function(){var e=this;if(!!this.hotInstance){var r=this.hotInstance.getSourceData(),n=[],i=[],s=this.hotInstance.rowIndexMapper.getNumberOfIndexes(),o=this.hotInstance.isColumnModificationAllowed(),a=0;if(r&&r.length!==s&&r.length<s)for(var l=r.length;l<s;l++)n.push(l);if(o){var c;if(a=this.hotInstance.columnIndexMapper.getNumberOfIndexes(),r&&r[0]&&((c=r[0])===null||c===void 0?void 0:c.length)!==a&&r[0].length<a)for(var u=r[0].length;u<a;u++)i.push(u)}this.hotInstance.batch(function(){n.length>0?e.hotInstance.rowIndexMapper.removeIndexes(n):e.hotInstance.rowIndexMapper.insertIndexes(s-1,r.length-s),o&&r.length!==0&&(i.length>0?e.hotInstance.columnIndexMapper.removeIndexes(i):e.hotInstance.columnIndexMapper.insertIndexes(a-1,r[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:Qae}),ele=["id"];function tle(t,e,r,n,i,s){return V2(),D4("div",{id:t.id},[k4(t.$slots,"default")],8,ele)}Gb.render=tle;Gb.__file="src/HotTable.vue";var rle=xS({name:"HotColumn",props:lL("HotColumn"),inject:["columnsCache"],methods:{createColumnSettings:function(){var e=cL(this.$props),r=Kae({},e);e.renderer&&(r.renderer=e.renderer),e.editor&&(r.editor=e.editor),this.columnsCache.set(this,r)}},mounted:function(){this.createColumnSettings()},unmounted:function(){this.columnsCache.delete(this)},render:function(){return null}});rle.__file="src/HotColumn.vue";const wA="handsontableEditor",nle="handsontable";class Yb extends hc{static get EDITOR_TYPE(){return nle}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(),Tp(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,r,n,i,s,o){super.prepare(e,r,n,i,s,o);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(c,u){const h=this.getSourceData(u.row,u.col);h!==void 0&&a.setValue(h),a.hot.destroyEditor()},preventWheel:!0,layoutDirection:this.hot.isRtl()?"rtl":"ltr"};this.cellProperties.handsontable&&Ar(l,o.handsontable),this.htOptions=l}beginEditing(e,r){const n=this.hot.getSettings().onBeginEditing;n&&n()===!1||super.beginEditing(e,r)}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,r,n){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,r,n)}assignHooks(){this.hot.addHook("afterDestroy",()=>{this.htEditor&&this.htEditor.destroy()})}registerShortcuts(){const r=this.hot.getShortcutManager().getContext("editor");super.registerShortcuts();const n={group:wA,relativeToGroup:Mp,position:"before"},i=(s,o)=>{const a=this.htEditor;if(s!==void 0&&(s<0||a.flipped&&s>a.countRows()-1?a.deselectCell():a.selectCell(s,0),a.getData().length))return o.preventDefault(),vs(o),this.hot.listen(),this.TEXTAREA.focus(),!1};r.addShortcuts([{keys:[["ArrowUp"]],callback:s=>{const o=this.htEditor;let a,l;return!o.getSelectedLast()&&o.flipped?a=o.countRows()-1:o.getSelectedLast()&&(o.flipped?(l=o.getSelectedLast()[0],a=Math.max(0,l-1)):(l=o.getSelectedLast()[0],a=l-1)),i(a,s)},preventDefault:!1},{keys:[["ArrowDown"]],callback:s=>{const o=this.htEditor;let a,l;if(!o.getSelectedLast()&&!o.flipped)a=0;else if(o.getSelectedLast()){if(o.flipped)a=o.getSelectedLast()[0]+1;else if(!o.flipped){const c=o.countRows()-1;l=o.getSelectedLast()[0],a=Math.min(c,l+1)}}return i(a,s)},preventDefault:!1}],n)}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(wA)}}function ile(t,e,r){sle(t,e),e.set(t,r)}function sle(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function kg(t,e,r){return e=ole(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ole(t){var e=ale(t,"string");return typeof e=="symbol"?e:String(e)}function ale(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function vA(t,e){var r=lle(t,e,"get");return cle(t,r)}function lle(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function cle(t,e){return e.get?e.get.call(t):e.value}const ule="autocomplete";var Rv=new WeakMap;class zb extends Yb{constructor(){super(...arguments),kg(this,"query",null),kg(this,"strippedChoices",[]),kg(this,"rawChoices",[]),ile(this,Rv,{writable:!0,value:this.hot.guid.slice(0,9)}),kg(this,"sortByRelevance",function(e,r,n){const i=[],s=[],o=e.length;let a=r.length,l,c,u,h;if(o===0){for(u=0;u<a;u++)s.push(u);return s}for(u=0;u<a;u++){if(c=WT(Sr(r[u])),n)h=c.indexOf(e);else{const d=this.cellProperties.locale;h=c.toLocaleLowerCase(d).indexOf(e.toLocaleLowerCase(d))}h!==-1&&(l=c.length-h-o,i.push({baseIndex:u,index:h,charsLeft:l,value:c}))}for(i.sort((d,f)=>{if(f.index===-1)return-1;if(d.index===-1)return 1;if(d.index<f.index)return-1;if(f.index<d.index)return 1;if(d.index===f.index){if(d.charsLeft<f.charsLeft)return-1;if(d.charsLeft>f.charsLeft)return 1}return 0}),u=0,a=i.length;u<a;u++)s.push(i[u].baseIndex);return s})}static get EDITOR_TYPE(){return ule}getValue(){const e=this.rawChoices.find(r=>this.stripValueIfNeeded(r)===this.TEXTAREA.value);return He(e)?e:this.TEXTAREA.value}createElements(){super.createElements(),be(this.htContainer,"autocompleteEditor"),be(this.htContainer,this.hot.rootWindow.navigator.platform.indexOf("Mac")===-1?"":"htMacScroll"),this.hot.getSettings().ariaTags&&qe(this.TEXTAREA,[aQ(),rQ(),hH("listbox"),dQ()])}prepare(e,r,n,i,s,o){super.prepare(e,r,n,i,s,o),this.hot.getSettings().ariaTags&&qe(this.TEXTAREA,[Pi("false"),fQ(`${vA(this,Rv)}-listbox-${e}-${r}`)])}open(){super.open();const e=this.cellProperties.trimDropdown===void 0?!0:this.cellProperties.trimDropdown,r=this.hot.getSettings().ariaTags,n=Array.isArray(this.cellProperties.source)?this.cellProperties.source:null,i=n==null?void 0:n.length,{row:s,col:o}=this;this.showEditableElement(),this.focus();let a=Ur();a===0&&O1()&&(a+=15),this.addHook("beforeKeyDown",l=>this.onBeforeKeyDown(l)),this.htEditor.updateSettings({colWidths:e?[Ht(this.TEXTAREA)-2]:void 0,width:e?Ht(this.TEXTAREA)+a:void 0,autoColumnSize:!0,renderer:(l,c,u,h,d,f,g)=>{Ko(l,c,u,h,d,f,g);const{filteringCaseSensitive:m,allowHtml:w,locale:C}=this.cellProperties,S=this.query;let v=Sr(f),T,A;v&&!w&&(T=m===!0?v.indexOf(S):v.toLocaleLowerCase(C).indexOf(S.toLocaleLowerCase(C)),T!==-1&&(A=v.substr(T,S.length),v=v.replace(A,`<strong>${A}</strong>`))),r&&qe(c,[nQ(),...n?[wQ(i)]:[],...n?[vQ(n.indexOf(f)+1)]:[],["id",`${this.htEditor.rootElement.id}_${u}-${h}`]]),c.innerHTML=v},afterSelection:(l,c)=>{if(r){const u=this.htEditor.getCell(l,c,!0);qe(u,[Hy()]),qe(this.TEXTAREA,...gQ(u.id))}}}),r&&(qe(this.htEditor.view._wt.wtOverlays.wtTable.TABLE,...Ys()),qe(this.htEditor.rootElement,[uH(),mQ("polite"),pQ("text"),["id",`${vA(this,Rv)}-listbox-${s}-${o}`]]),qe(this.TEXTAREA,...Pi("true"))),this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)})}close(){this.removeHooksByKey("beforeKeyDown"),super.close(),this.hot.getSettings().ariaTags&&qe(this.TEXTAREA,[Pi("false")])}discardEditor(e){super.discardEditor(e),this.hot.view.render()}queryChoices(e){const r=this.cellProperties.source;this.query=e,typeof r=="function"?r.call(this.cellProperties,e,n=>{this.rawChoices=n,this.updateChoicesList(this.stripValuesIfNeeded(n))}):Array.isArray(r)?(this.rawChoices=r,this.updateChoicesList(this.stripValuesIfNeeded(r))):this.updateChoicesList([])}updateChoicesList(e){const r=SH(this.TEXTAREA),n=EQ(this.TEXTAREA),i=this.cellProperties.sortByRelevance,s=this.cellProperties.filter;let o=null,a=null,l=e;i&&(o=this.sortByRelevance(this.stripValueIfNeeded(this.getValue()),l,this.cellProperties.filteringCaseSensitive));const c=Array.isArray(o)?o.length:0;if(s===!1)c&&(a=o[0]);else{const u=[];for(let h=0,d=l.length;h<d&&!(i&&c<=h);h++)c?u.push(l[o[h]]):u.push(l[h]);a=0,l=u}this.strippedChoices=l,this.htEditor.loadData(O0([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(),Tp(this.TEXTAREA,r,r===n?void 0:n)}flipDropdownIfNeeded(){const e=Iu(this.hot.view._wt.wtTable.TABLE),r=e===this.hot.rootWindow,n=this.cellProperties.preventOverflow;if(r||!r&&(n||n==="horizontal"))return!1;const i=Wr(this.TEXTAREA),s=cr(this.TEXTAREA),o=this.getDropdownHeight(),a=e.scrollTop,l=cr(this.hot.view._wt.wtTable.THEAD),c=Wr(e),u=i.top-c.top-l+a,h=e.scrollHeight-u-l-s,d=o>h&&u>h;return d?this.flipDropdown(o):this.unflipDropdown(),this.limitDropdownIfNeeded(d?u:h,o),d}limitDropdownIfNeeded(e,r){if(r>e){let n=0,i=0,s=0,o=null;do s=this.htEditor.getRowHeight(i)||this.htEditor.view._wt.getSetting("defaultRowHeight"),n+=s,i+=1;while(n<e);o=n-s,this.htEditor.flipped&&(this.htEditor.rootElement.style.top=`${parseInt(this.htEditor.rootElement.style.top,10)+r-o}px`),this.setDropdownHeight(n-s)}}flipDropdown(e){const r=this.htEditor.rootElement.style;r.position="absolute",r.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)+Ur(this.hot.rootDocument)+2,r=this.cellProperties.trimDropdown;this.htEditor.updateSettings({height:this.getDropdownHeight(),width:r?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,r=this.cellProperties.visibleRows;return this.strippedChoices.length>=r?r*e:this.strippedChoices.length*e+8}stripValueIfNeeded(e){return this.stripValuesIfNeeded([e])[0]}stripValuesIfNeeded(e){const{allowHtml:r}=this.cellProperties,n=ht(e,s=>Sr(s));return ht(n,s=>r?s:WT(s))}allowKeyEventPropagation(e){const r=this.htEditor.getSelectedRangeLast(),n={row:r?r.from.row:-1};let i=!1;return e===Ke.ARROW_DOWN&&n.row>0&&n.row<this.htEditor.countRows()-1&&(i=!0),e===Ke.ARROW_UP&&n.row>-1&&(i=!0),i}onBeforeKeyDown(e){if(tee(e.keyCode)||e.keyCode===Ke.BACKSPACE||e.keyCode===Ke.DELETE||e.keyCode===Ke.INSERT){let r=10;if(e.keyCode===Ke.C&&(e.ctrlKey||e.metaKey))return;this.isOpened()||(r+=10),this.htEditor&&this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)},r)}}}const hle="checkbox";class uL extends zu{static get EDITOR_TYPE(){return hle}beginEditing(e,r){if(r&&r.type==="mouseup"){const n=this.TD.querySelector('input[type="checkbox"]');Je(n,"htBadValue")||n.click()}}finishEditing(){}init(){}open(){}close(){}getValue(){}setValue(){}focus(){}}/*!
  99. * Pikaday
  100. *
  101. * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/Pikaday/Pikaday
  102. */const Ta=()=>window,Mi=()=>window.document,q1=(t,e)=>window.setTimeout(t,e),Hs=function(t,e,r,n){t.addEventListener(e,r,!!n)},fo=function(t,e,r,n){t.removeEventListener(e,r,!!n)},dle=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},ti=function(t,e){return(" "+t.className+" ").indexOf(" "+e+" ")!==-1},Tv=function(t,e){ti(t,e)||(t.className=t.className===""?e:t.className+" "+e)},_v=function(t,e){t.className=dle((" "+t.className+" ").replace(" "+e+" "," "))},jb=function(t){return/Array/.test(Object.prototype.toString.call(t))},ni=function(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())},fle=function(t){let e=t.getDay();return e===0||e===6},gle=function(t){return t%4===0&&t%100!==0||t%400===0},CA=function(t,e){return[31,gle(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},Ng=function(t){ni(t)&&t.setHours(0,0,0,0)},Hg=function(t,e){return t.getTime()===e.getTime()},Mm=function(t,e,r){let n,i;for(n in e)i=t[n]!==void 0,i&&typeof e[n]=="object"&&e[n]!==null&&e[n].nodeName===void 0?ni(e[n])?r&&(t[n]=new Date(e[n].getTime())):jb(e[n])?r&&(t[n]=e[n].slice(0)):t[n]=Mm({},e[n],r):(r||!i)&&(t[n]=e[n]);return t},SA=function(t,e,r){let n=Mi().createEvent("HTMLEvents");n.initEvent(e,!0,!1),n=Mm(n,r),t.dispatchEvent(n)},yA=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},Ts={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},xA=function(t,e,r){for(e+=t.firstDay;e>=7;)e-=7;return r?t.i18n.weekdaysShort[e]:t.i18n.weekdays[e]},mle=function(t){let e=[],r="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"),r="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="'+r+'"><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>"},ple=function(t,e){t.setHours(0,0,0,0);let r=t.getDate(),n=t.getDay(),i=e,s=i-1,o=7,a=function(d){return(d+o-1)%o};t.setDate(r+s-a(n));let l=new Date(t.getFullYear(),0,i),c=24*60*60*1e3,u=(t.getTime()-l.getTime())/c;return 1+Math.round((u-s+a(l.getDay()))/o)},wle=function(t,e,r,n,i){let s=new Date(n,r,e);return'<td class="pika-week">'+(t.hasMoment?t.moment(s).isoWeek():ple(s,i))+"</td>"},vle=function(t,e,r,n){return'<tr class="pika-row'+(r?" pick-whole-week":"")+(n?" is-selected":"")+'">'+(e?t.reverse():t).join("")+"</tr>"},Cle=function(t){return"<tbody>"+t.join("")+"</tbody>"},Sle=function(t){let e,r=[];for(t.showWeekNumber&&r.push("<th></th>"),e=0;e<7;e++)r.push('<th scope="col"><abbr title="'+xA(t,e)+'">'+xA(t,e,!0)+"</abbr></th>");return"<thead><tr>"+(t.isRTL?r.reverse():r).join("")+"</tr></thead>"},yle=function(t,e,r,n,i,s){let o,a,l,c=t._o,u=r===c.minYear,h=r===c.maxYear,d='<div id="'+s+'" class="pika-title" role="heading" aria-live="polite">',f,g,m=!0,w=!0;for(l=[],o=0;o<12;o++)l.push('<option value="'+(r===i?o-e:12+o-e)+'"'+(o===n?' selected="selected"':"")+(u&&o<c.minMonth||h&&o>c.maxMonth?' disabled="disabled"':"")+">"+c.i18n.months[o]+"</option>");for(f='<div class="pika-label">'+c.i18n.months[n]+'<select class="pika-select pika-select-month" tabindex="-1">'+l.join("")+"</select></div>",jb(c.yearRange)?(o=c.yearRange[0],a=c.yearRange[1]+1):(o=r-c.yearRange,a=1+r+c.yearRange),l=[];o<a&&o<=c.maxYear;o++)o>=c.minYear&&l.push('<option value="'+o+'"'+(o===r?' selected="selected"':"")+">"+o+"</option>");return g='<div class="pika-label">'+r+c.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+l.join("")+"</select></div>",c.showMonthAfterYear?d+=g+f:d+=f+g,u&&(n===0||c.minMonth>=n)&&(m=!1),h&&(n===11||c.maxMonth<=n)&&(w=!1),e===0&&(d+='<button class="pika-prev'+(m?"":" is-disabled")+'" type="button">'+c.i18n.previousMonth+"</button>"),e===t._o.numberOfMonths-1&&(d+='<button class="pika-next'+(w?"":" is-disabled")+'" type="button">'+c.i18n.nextMonth+"</button>"),d+="</div>"},xle=function(t,e,r){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+r+'">'+Sle(t)+Cle(e)+"</table>"};function Z1(t){let e=this,r=e.config(t);e._onMouseDown=function(i){if(!e._v)return;i=i||Ta().event;let s=i.target||i.srcElement;if(!!s)if(ti(s,"is-disabled")||(ti(s,"pika-button")&&!ti(s,"is-empty")&&!ti(s.parentNode,"is-disabled")?(e.setDate(new Date(s.getAttribute("data-pika-year"),s.getAttribute("data-pika-month"),s.getAttribute("data-pika-day"))),r.bound&&q1(function(){e.hide(),r.blurFieldOnSelect&&r.field&&r.field.blur()},100)):ti(s,"pika-prev")?e.prevMonth():ti(s,"pika-next")&&e.nextMonth()),ti(s,"pika-select"))e._c=!0;else if(i.preventDefault)i.preventDefault();else return i.returnValue=!1,!1},e._onChange=function(i){i=i||Ta().event;let s=i.target||i.srcElement;!s||(ti(s,"pika-select-month")?e.gotoMonth(s.value):ti(s,"pika-select-year")&&e.gotoYear(s.value))},e._onKeyChange=function(i){if(i=i||Ta().event,e.isVisible())switch(i.keyCode){case 13:case 27:r.field&&r.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(r.parse)return r.parse(r.field.value,r.format);if(this.hasMoment){let i=this.moment(r.field.value,r.format,r.formatStrict);return i&&i.isValid()?i.toDate():null}else return new Date(Date.parse(r.field.value))},e._onInputChange=function(i){let s;i.firedBy!==e&&(s=e._parseFieldValue(),ni(s)&&e.setDate(s),e._v||e.show())},e._onInputFocus=function(){e.show()},e._onInputClick=function(){e.show()},e._onInputBlur=function(){let i=Mi().activeElement;do if(ti(i,"pika-single"))return;while(i=i.parentNode);e._c||(e._b=q1(function(){e.hide()},50)),e._c=!1},e._onClick=function(i){i=i||Ta().event;let s=i.target||i.srcElement,o=s;if(!!s){!hasEventListeners&&ti(s,"pika-select")&&(s.onchange||(s.setAttribute("onchange","return;"),Hs(s,"change",e._onChange)));do if(ti(o,"pika-single")||o===r.trigger)return;while(o=o.parentNode);e._v&&s!==r.trigger&&o!==r.trigger&&e.hide()}},e.el=Mi().createElement("div"),e.el.className="pika-single"+(r.isRTL?" is-rtl":"")+(r.theme?" "+r.theme:""),Hs(e.el,"mousedown",e._onMouseDown,!0),Hs(e.el,"touchend",e._onMouseDown,!0),Hs(e.el,"change",e._onChange),r.keyboardInput&&Hs(Mi(),"keydown",e._onKeyChange),r.field&&(r.container?r.container.appendChild(e.el):r.bound?Mi().body.appendChild(e.el):r.field.parentNode.insertBefore(e.el,r.field.nextSibling),Hs(r.field,"change",e._onInputChange),r.defaultDate||(r.defaultDate=e._parseFieldValue(),r.setDefaultDate=!0));let n=r.defaultDate;ni(n)?r.setDefaultDate?e.setDate(n,!0):e.gotoDate(n):e.gotoDate(new Date),r.bound?(this.hide(),e.el.className+=" is-bound",Hs(r.trigger,"click",e._onInputClick),Hs(r.trigger,"focus",e._onInputFocus),Hs(r.trigger,"blur",e._onInputBlur)):this.show()}Z1.prototype={config:function(t){this._o||(this._o=Mm({},Ts,!0));let e=Mm(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 r=parseInt(e.numberOfMonths,10)||1;if(e.numberOfMonths=r>4?4:r,ni(e.minDate)||(e.minDate=!1),ni(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),jb(e.yearRange)){let n=new Date().getFullYear()-10;e.yearRange[0]=parseInt(e.yearRange[0],10)||n,e.yearRange[1]=parseInt(e.yearRange[1],10)||n}else e.yearRange=Math.abs(parseInt(e.yearRange,10))||Ts.yearRange,e.yearRange>100&&(e.yearRange=100);return e},toString:function(t){return t=t||this._o.format,ni(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 ni(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="",SA(this._o.field,"change",{firedBy:this})),this.draw();if(typeof t=="string"&&(t=new Date(Date.parse(t))),!ni(t))return;let r=this._o.minDate,n=this._o.maxDate;ni(r)&&t<r?t=r:ni(n)&&t>n&&(t=n),this._d=new Date(t.getTime()),Ng(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),SA(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(!!ni(t)){if(this.calendars){let r=new Date(this.calendars[0].year,this.calendars[0].month,1),n=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),i=t.getTime();n.setMonth(n.getMonth()+1),n.setDate(n.getDate()-1),e=i<r.getTime()||n.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 r=this.getDate()||new Date,n=parseInt(e)*24*60*60*1e3,i;t==="add"?i=new Date(r.valueOf()+n):t==="subtract"&&(i=new Date(r.valueOf()-n)),this.setDate(i)},adjustCalendars:function(){this.calendars[0]=yA(this.calendars[0]);for(let t=1;t<this._o.numberOfMonths;t++)this.calendars[t]=yA({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?(Ng(t),this._o.minDate=t,this._o.minYear=t.getFullYear(),this._o.minMonth=t.getMonth()):(this._o.minDate=Ts.minDate,this._o.minYear=Ts.minYear,this._o.minMonth=Ts.minMonth,this._o.startRange=Ts.startRange),this.draw()},setMaxDate:function(t){t instanceof Date?(Ng(t),this._o.maxDate=t,this._o.maxYear=t.getFullYear(),this._o.maxMonth=t.getMonth()):(this._o.maxDate=Ts.maxDate,this._o.maxYear=Ts.maxYear,this._o.maxMonth=Ts.maxMonth,this._o.endRange=Ts.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,r=e.minYear,n=e.maxYear,i=e.minMonth,s=e.maxMonth,o="",a;this._y<=r&&(this._y=r,!isNaN(i)&&this._m<i&&(this._m=i)),this._y>=n&&(this._y=n,!isNaN(s)&&this._m>s&&(this._m=s));for(let l=0;l<e.numberOfMonths;l++)a="pika-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2),o+='<div class="pika-lendar">'+yle(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=o,e.bound&&e.field.type!=="hidden"&&q1(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,r,n,i,s,o,a,l,c,u;this._o.container||(this.el.style.position="absolute",t=this._o.trigger,e=this.el.offsetWidth,r=this.el.offsetHeight,n=Ta().innerWidth||Mi().documentElement.clientWidth,i=Ta().innerHeight||Mi().documentElement.clientHeight,s=Mi().body.scrollTop||Mi().documentElement.scrollTop,c=!0,u=!0,l=t.getBoundingClientRect(),o=l.left+Ta().pageXOffset,a=l.bottom+Ta().pageYOffset,(this._o.reposition&&o+e>n||this._o.position.indexOf("right")>-1&&o-e+t.offsetWidth>0)&&(o=o-e+t.offsetWidth,c=!1),(this._o.reposition&&a+r>i+s||this._o.position.indexOf("top")>-1&&a-r-t.offsetHeight>0)&&(a=a-r-t.offsetHeight,u=!1),o<0&&(o=0),a<0&&(a=0),this.el.style.left=o+"px",this.el.style.top=a+"px",Tv(this.el,c?"left-aligned":"right-aligned"),Tv(this.el,u?"bottom-aligned":"top-aligned"),_v(this.el,c?"right-aligned":"left-aligned"),_v(this.el,u?"top-aligned":"bottom-aligned"))},render:function(t,e,r){let n=this._o,i=new Date,s=CA(t,e),o=new Date(t,e,1).getDay(),a=[],l=[];Ng(i),n.firstDay>0&&(o-=n.firstDay,o<0&&(o+=7));let c=e===0?11:e-1,u=e===11?0:e+1,h=e===0?t-1:t,d=e===11?t+1:t,f=CA(h,c),g=s+o,m=g;for(;m>7;)m-=7;g+=7-m;let w=!1;for(let C=0,S=0;C<g;C++){let v=new Date(t,e,1+(C-o)),T=ni(this._d)?Hg(v,this._d):!1,A=Hg(v,i),M=n.events.indexOf(v.toDateString())!==-1,E=C<o||C>=s+o,Y=1+(C-o),D=e,U=t,X=n.startRange&&Hg(n.startRange,v),G=n.endRange&&Hg(n.endRange,v),ae=n.startRange&&n.endRange&&n.startRange<v&&v<n.endRange,ve=n.minDate&&v<n.minDate||n.maxDate&&v>n.maxDate||n.disableWeekends&&fle(v)||n.disableDayFn&&n.disableDayFn(v);E&&(C<o?(Y=f+Y,D=c,U=h):(Y=Y-s,D=u,U=d));let me={day:Y,month:D,year:U,hasEvent:M,isSelected:T,isToday:A,isDisabled:ve,isEmpty:E,isStartRange:X,isEndRange:G,isInRange:ae,showDaysInNextAndPreviousMonths:n.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:n.enableSelectionDaysInNextAndPreviousMonths};n.pickWholeWeek&&T&&(w=!0),l.push(mle(me)),++S===7&&(n.showWeekNumber&&l.unshift(wle(this,C-o,e,t,n.firstWeekOfYearMinDays)),a.push(vle(l,n.isRTL,n.pickWholeWeek,w)),l=[],S=0,w=!1)}return xle(n,a,r)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),_v(this.el,"is-hidden"),this._o.bound&&(Hs(Mi(),"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&&fo(Mi(),"click",this._onClick),this._o.container||(this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto"),Tv(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(),fo(this.el,"mousedown",this._onMouseDown,!0),fo(this.el,"touchend",this._onMouseDown,!0),fo(this.el,"change",this._onChange),t.keyboardInput&&fo(Mi(),"keydown",this._onKeyChange),t.field&&(fo(t.field,"change",this._onInputChange),t.bound&&(fo(t.trigger,"click",this._onInputClick),fo(t.trigger,"focus",this._onInputFocus),fo(t.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}};function Av(t,e,r){return e=ble(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ble(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 r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const hL="date",bA="dateEditor";class dL extends hc{constructor(){super(...arguments),Av(this,"defaultDateFormat","DD/MM/YYYY"),Av(this,"parentDestroyed",!1),Av(this,"$datePicker",null)}static get EDITOR_TYPE(){return hL}init(){if(typeof ye!="function")throw new Error("You need to include moment.js to your project.");if(typeof Z1!="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"),be(this.datePicker,"htDatepickerHolder"),this.hot.rootDocument.body.appendChild(this.datePicker),this.eventManager.addEventListener(this.datePicker,"mousedown",e=>{Je(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,r,n,i,s,o){super.prepare(e,r,n,i,s,o)}open(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;const n=this.hot.getShortcutManager().getContext("editor");super.open(),this.showDatepicker(e),n.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:bA})}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(bA),super.close()}finishEditing(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.finishEditing(e,r)}showDatepicker(e){const r=this.TD.getBoundingClientRect(),n=this.cellProperties.dateFormat||this.defaultDateFormat,i=this.hot.view.isMouseDown(),s=e?NH(e.keyCode):!1;let o;this.datePicker.style.display="block",this.$datePicker=new Z1(this.getDatePickerConfig()),typeof this.$datePicker.useMoment=="function"&&this.$datePicker.useMoment(ye),this.$datePicker._onInputFocus=function(){},this.datePickerStyle.top=`${this.hot.rootWindow.pageYOffset+r.top+cr(this.TD)}px`;let a=this.hot.rootWindow.pageXOffset;this.hot.isRtl()?a=r.right-Ht(this.datePicker):a=r.left,this.datePickerStyle.left=`${a}px`,this.originalValue?(o=this.originalValue,ye(o,n,!0).isValid()&&this.$datePicker.setMoment(ye(o,n),!0),this.getValue()!==this.originalValue&&this.setValue(this.originalValue),!s&&!i&&this.setValue("")):this.cellProperties.defaultDate?(o=this.cellProperties.defaultDate,ye(o,n,!0).isValid()&&this.$datePicker.setMoment(ye(o,n),!0),!s&&!i&&this.setValue("")):this.$datePicker.gotoToday()}hideDatepicker(){this.datePickerStyle.display="none",this.$datePicker.hide()}getDatePickerConfig(){const e=this.TEXTAREA,r={};this.cellProperties&&this.cellProperties.datePickerConfig&&Ap(r,this.cellProperties.datePickerConfig);const n=r.onSelect,i=r.onClose;return r.field=e,r.trigger=e,r.container=this.datePicker,r.bound=!1,r.keyboardInput=!1,r.format=r.format||this.defaultDateFormat,r.reposition=r.reposition||!1,r.isRTL=!1,r.onSelect=s=>{let o=s;isNaN(o.getTime())||(o=ye(o).format(this.cellProperties.dateFormat||this.defaultDateFormat)),this.setValue(o),n&&n()},r.onClose=()=>{this.parentDestroyed||this.finishEditing(!1),i&&i()},r}}const Rle="dropdown";class Kb extends zb{static get EDITOR_TYPE(){return Rle}prepare(e,r,n,i,s,o){super.prepare(e,r,n,i,s,o),this.cellProperties.filter=!1,this.cellProperties.strict=!0}}$e.getSingleton().add("beforeValidate",function(t,e,r){const n=this.getCellMeta(e,this.propToCol(r));n.editor===Kb&&n.strict===void 0&&(n.filter=!1,n.strict=!0)});const Tle="numeric";class fL extends hc{static get EDITOR_TYPE(){return Tle}}const _le="password";class gL extends hc{static get EDITOR_TYPE(){return _le}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&&qe(this.TEXTAREA,[Yo()]),Zs(this.TEXTAREA_PARENT),this.TEXTAREA_PARENT.appendChild(this.TEXTAREA)}}const Mv="ht_editor_visible",EA="selectEditor",Ale="select";class mL extends zu{static get EDITOR_TYPE(){return Ale}init(){this.select=this.hot.rootDocument.createElement("select"),this.select.setAttribute("data-hot-input","true"),this.select.style.display="none",be(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",Je(this.select,Mv)&&rt(this.select,Mv),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,r,n,i,s,o){super.prepare(e,r,n,i,s,o);const a=this.cellProperties.selectOptions;let l;typeof a=="function"?l=this.prepareOptions(a(this.row,this.col,this.prop)):l=this.prepareOptions(a),Zs(this.select),dt(l,(c,u)=>{const h=this.hot.rootDocument.createElement("OPTION");h.value=u,Gu(h,c),this.select.appendChild(h)})}prepareOptions(e){let r={};if(Array.isArray(e))for(let n=0,i=e.length;n<i;n++)r[e[n]]=e[n];else typeof e=="object"&&(r=e);return r}refreshValue(){const e=this.hot.getSourceDataAtCell(this.row,this.prop);this.originalValue=e,this.setValue(e),this.refreshDimensions()}refreshDimensions(){if(this.state!==_r.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD){this.close();return}const{top:e,start:r,width:n,height:i}=this.getEditedCellRect(),s=this.select.style;s.height=`${i}px`,s.width=`${n}px`,s.top=`${e}px`,s[this.hot.isRtl()?"right":"left"]=`${r}px`,s.margin="0px",be(this.select,Mv)}registerShortcuts(){const e=this.hot.getShortcutManager(),r=e.getContext("editor"),n=e.getContext("grid"),i={group:EA};this.isInFullEditMode()!==!1&&r.addShortcuts([{keys:[["Tab"],["Shift","Tab"]],forwardToContext:n,callback:()=>{}},{keys:[["ArrowUp"]],callback:()=>{const s=this.select.selectedIndex-1;s>=0&&(this.select[s].selected=!0)}},{keys:[["ArrowDown"]],callback:()=>{const s=this.select.selectedIndex+1;s<=this.select.length-1&&(this.select[s].selected=!0)}}],i)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(EA)}}const Mle="time";class pL extends hc{static get EDITOR_TYPE(){return Mle}prepare(e,r,n,i,s,o){super.prepare(e,r,n,i,s,o),this.TEXTAREA.dir="ltr"}}function Ole(){ri(zu),ri(zb),ri(uL),ri(dL),ri(Kb),ri(Yb),ri(fL),ri(gL),ri(mL),ri(hc),ri(pL)}const Ile="html";function Xb(t,e,r,n,i,s,o){Ef.apply(this,[t,e,r,n,i,s,o]),Gu(e,s==null?"":s,!1)}Xb.RENDERER_TYPE=Ile;const Ple="autocomplete";function ju(t,e,r,n,i,s,o){const{rootDocument:a}=t,l=o.allowHtml?Xb:Ko,c=a.createElement("DIV"),u=t.getSettings().ariaTags;if(c.className="htAutocompleteArrow",u&&c.setAttribute(...Yo()),c.appendChild(a.createTextNode(String.fromCharCode(9660))),l.apply(this,[t,e,r,n,i,s,o]),e.firstChild||e.appendChild(a.createTextNode(String.fromCharCode(160))),e.insertBefore(c,e.firstChild),be(e,"htAutocomplete"),!t.acArrowListener){const h=new ms(t);t.acArrowListener=function(d){Je(d.target,"htAutocompleteArrow")&&t.view._wt.getSetting("onCellDblClick",null,t._createCellCoords(r,n),e)},h.addEventListener(t.rootElement,"mousedown",t.acArrowListener),t.addHookOnce("afterDestroy",()=>{h.destroy()})}}ju.RENDERER_TYPE=Ple;const Dle="dropdown";function qb(t,e,r,n,i,s,o){ju.apply(this,[t,e,r,n,i,s,o])}qb.RENDERER_TYPE=Dle;const RA=new WeakMap,TA=new WeakMap,kle="htBadValue",Du="data-row",ku="data-col",Nle="checkboxRenderer",wL="checkbox";$e.getSingleton().add("modifyAutoColumnSizeSeed",function(t,e,r){const{label:n,type:i,row:s,column:o,prop:a}=e;if(i===wL){if(n){const{value:l,property:c}=n;let u=r;if(l)u=typeof l=="function"?l(s,o,a,r):l;else if(c){const h=this.getDataAtRowProp(s,c);u=h!==null?h:r}t=u}return t}});function Zb(t,e,r,n,i,s,o){const{rootDocument:a}=t,l=t.getSettings().ariaTags;Ef.apply(this,[t,e,r,n,i,s,o]),Hle(t);let c=Fle(a);const u=o.label;let h=!1;if(typeof o.checkedTemplate=="undefined"&&(o.checkedTemplate=!0),typeof o.uncheckedTemplate=="undefined"&&(o.uncheckedTemplate=!1),Zs(e),s===o.checkedTemplate||Sr(s).toLocaleLowerCase(o.locale)===Sr(o.checkedTemplate).toLocaleLowerCase(o.locale)?c.checked=!0:s===o.uncheckedTemplate||Sr(s).toLocaleLowerCase(o.locale)===Sr(o.uncheckedTemplate).toLocaleLowerCase(o.locale)?c.checked=!1:kr(s)?be(c,"noValue"):(c.style.display="none",be(c,kle),h=!0),qe(c,[[Du,r],[ku,n]]),l&&qe(c,[ky(c.checked?t.getTranslatedPhrase($b):t.getTranslatedPhrase(Bb)),hQ(c.checked),iQ()]),!h&&u){let m="";if(u.value)m=typeof u.value=="function"?u.value.call(this,r,n,i,s):u.value;else if(u.property){const C=t.getDataAtRowProp(r,u.property);m=C!==null?C:""}const w=Lle(a,m,u.separated!==!0);u.position==="before"?u.separated?(e.appendChild(w),e.appendChild(c)):(w.appendChild(c),c=w):(!u.position||u.position==="after")&&(u.separated?(e.appendChild(c),e.appendChild(w)):(w.insertBefore(c,w.firstChild),c=w))}(!u||u&&!u.separated)&&e.appendChild(c),h&&e.appendChild(a.createTextNode("#bad-value#")),RA.has(t)||(RA.set(t,!0),d());function d(){const w=t.getShortcutManager().getContext("grid"),C={group:Nle};w.addShortcuts([{keys:[["space"]],callback:()=>(f(),!g())},{keys:[["enter"]],callback:()=>(f(),!g()),runOnlyIf:()=>t.getSettings().enterBeginsEditing},{keys:[["delete"],["backspace"]],callback:()=>(f(!0),!g()),relativeToGroup:Ub,position:"before"}],C)}function f(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const w=t.getSelectedRange();if(!!w)for(let C=0;C<w.length;C++){const{row:S,col:v}=w[C].getTopStartCorner(),{row:T,col:A}=w[C].getBottomEndCorner(),M=[];for(let E=S;E<=T;E+=1)for(let Y=v;Y<=A;Y+=1){const D=t.getCellMeta(E,Y);if(D.type!=="checkbox")return;if(D.readOnly===!0)continue;typeof D.checkedTemplate=="undefined"&&(D.checkedTemplate=!0),typeof D.uncheckedTemplate=="undefined"&&(D.uncheckedTemplate=!1);const U=t.getDataAtCell(E,Y);m===!1?[D.checkedTemplate,D.checkedTemplate.toString()].includes(U)?M.push([E,Y,D.uncheckedTemplate]):[D.uncheckedTemplate,D.uncheckedTemplate.toString(),null,void 0].includes(U)&&M.push([E,Y,D.checkedTemplate]):M.push([E,Y,D.uncheckedTemplate])}M.length>0&&t.setDataAtCell(M)}}function g(){const m=t.getSelectedRange();if(!!m){for(let w=0;w<m.length;w++){const C=m[w].getTopStartCorner(),S=m[w].getBottomEndCorner();for(let v=C.row;v<=S.row;v++)for(let T=C.col;T<=S.col;T++){const A=t.getCellMeta(v,T);if(A.type!=="checkbox")return!1;const M=t.getCell(v,T);if(M==null)return!0;if(M.querySelectorAll("input[type=checkbox]").length>0&&!A.readOnly)return!0}}return!1}}}Zb.RENDERER_TYPE=wL;function Hle(t){let e=TA.get(t);if(!e){const{rootElement:r}=t;e=new ms(t),e.addEventListener(r,"click",n=>Ble(n,t)),e.addEventListener(r,"mouseup",n=>$le(n,t)),e.addEventListener(r,"change",n=>Wle(n,t)),TA.set(t,e)}return e}function Fle(t){const e=t.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("tabindex","-1"),e.cloneNode(!1)}function Lle(t,e,r){const n=t.createElement("label");return n.className=`htCheckboxRendererLabel ${r?"fullWidth":""}`,n.appendChild(t.createTextNode(e)),n.cloneNode(!0)}function $le(t,e){const{target:r}=t;!Jb(r)||!r.hasAttribute(Du)||!r.hasAttribute(ku)||setTimeout(e.listen,10)}function Ble(t,e){const{target:r}=t;if(!Jb(r)||!r.hasAttribute(Du)||!r.hasAttribute(ku))return;const n=parseInt(r.getAttribute(Du),10),i=parseInt(r.getAttribute(ku),10);e.getCellMeta(n,i).readOnly&&t.preventDefault()}function Wle(t,e){const{target:r}=t;if(!Jb(r)||!r.hasAttribute(Du)||!r.hasAttribute(ku))return;const n=parseInt(r.getAttribute(Du),10),i=parseInt(r.getAttribute(ku),10),s=e.getCellMeta(n,i);if(!s.readOnly){let o=null;t.target.checked?o=s.uncheckedTemplate===void 0?!0:s.checkedTemplate:o=s.uncheckedTemplate===void 0?!1:s.uncheckedTemplate,e.setDataAtCell(n,i,o)}}function Jb(t){return t.tagName==="INPUT"&&t.getAttribute("type")==="checkbox"}const Vle="handsontable";function Qb(t,e,r,n,i,s,o){ju.apply(this,[t,e,r,n,i,s,o])}Qb.RENDERER_TYPE=Vle;var vL={exports:{}};(function(t,e){(function(r){t.exports=r()})(function(){return function r(n,i,s){function o(c,u){if(!i[c]){if(!n[c]){var h=typeof jh=="function"&&jh;if(!u&&h)return h(c,!0);if(a)return a(c,!0);var d=new Error("Cannot find module '"+c+"'");throw d.code="MODULE_NOT_FOUND",d}var f=i[c]={exports:{}};n[c][0].call(f.exports,function(g){return o(n[c][1][g]||g)},f,f.exports,r,n,i,s)}return i[c].exports}for(var a=typeof jh=="function"&&jh,l=0;l<s.length;l++)o(s[l]);return o}({1:[function(r,n,i){(function(s){var o,a=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,l=Math.ceil,c=Math.floor,u="[BigNumber Error] ",h=u+"Number primitive has more than 15 significant digits: ",d=1e14,f=14,g=9007199254740991,m=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],w=1e7,C=1e9;function S(D){var U=0|D;return 0<D||D===U?U:U-1}function v(D){for(var U,X,G=1,ae=D.length,ve=D[0]+"";G<ae;){for(U=D[G++]+"",X=f-U.length;X--;U="0"+U);ve+=U}for(ae=ve.length;ve.charCodeAt(--ae)===48;);return ve.slice(0,ae+1||1)}function T(D,U){var X,G,ae=D.c,ve=U.c,me=D.s,Re=U.s,Ce=D.e,_e=U.e;if(!me||!Re)return null;if(X=ae&&!ae[0],G=ve&&!ve[0],X||G)return X?G?0:-Re:me;if(me!=Re)return me;if(X=me<0,G=Ce==_e,!ae||!ve)return G?0:!ae^X?1:-1;if(!G)return _e<Ce^X?1:-1;for(Re=(Ce=ae.length)<(_e=ve.length)?Ce:_e,me=0;me<Re;me++)if(ae[me]!=ve[me])return ae[me]>ve[me]^X?1:-1;return Ce==_e?0:_e<Ce^X?1:-1}function A(D,U,X,G){if(D<U||X<D||D!==(D<0?l(D):c(D)))throw Error(u+(G||"Argument")+(typeof D=="number"?D<U||X<D?" out of range: ":" not an integer: ":" not a primitive number: ")+String(D))}function M(D){var U=D.c.length-1;return S(D.e/f)==U&&D.c[U]%2!=0}function E(D,U){return(1<D.length?D.charAt(0)+"."+D.slice(1):D)+(U<0?"e":"e+")+U}function Y(D,U,X){var G,ae;if(U<0){for(ae=X+".";++U;ae+=X);D=ae+D}else if(++U>(G=D.length)){for(ae=X,U-=G;--U;ae+=X);D+=ae}else U<G&&(D=D.slice(0,U)+"."+D.slice(U));return D}(o=function D(U){var X,G,ae,ve,me,Re,Ce,_e,p,y,b=ue.prototype={constructor:ue,toString:null,valueOf:null},x=new ue(1),O=20,_=4,N=-7,K=21,le=-1e7,ce=1e7,te=!1,ge=1,Me=0,L={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},Fe="0123456789abcdefghijklmnopqrstuvwxyz";function ue(I,F){var z,se,q,ie,Q,ee,oe,ne,J=this;if(!(J instanceof ue))return new ue(I,F);if(F==null){if(I instanceof ue)return J.s=I.s,J.e=I.e,void(J.c=(I=I.c)?I.slice():I);if((ee=typeof I=="number")&&0*I==0){if(J.s=1/I<0?(I=-I,-1):1,I===~~I){for(ie=0,Q=I;10<=Q;Q/=10,ie++);return J.e=ie,void(J.c=[I])}ne=String(I)}else{if(ne=String(I),!a.test(ne))return ae(J,ne,ee);J.s=ne.charCodeAt(0)==45?(ne=ne.slice(1),-1):1}-1<(ie=ne.indexOf("."))&&(ne=ne.replace(".","")),0<(Q=ne.search(/e/i))?(ie<0&&(ie=Q),ie+=+ne.slice(Q+1),ne=ne.substring(0,Q)):ie<0&&(ie=ne.length)}else{if(A(F,2,Fe.length,"Base"),ne=String(I),F==10)return Be(J=new ue(I instanceof ue?I:ne),O+J.e+1,_);if(ee=typeof I=="number"){if(0*I!=0)return ae(J,ne,ee,F);if(J.s=1/I<0?(ne=ne.slice(1),-1):1,ue.DEBUG&&15<ne.replace(/^0\.0*|\./,"").length)throw Error(h+I);ee=!1}else J.s=ne.charCodeAt(0)===45?(ne=ne.slice(1),-1):1;for(z=Fe.slice(0,F),ie=Q=0,oe=ne.length;Q<oe;Q++)if(z.indexOf(se=ne.charAt(Q))<0){if(se=="."){if(ie<Q){ie=oe;continue}}else if(!q&&(ne==ne.toUpperCase()&&(ne=ne.toLowerCase())||ne==ne.toLowerCase()&&(ne=ne.toUpperCase()))){q=!0,Q=-1,ie=0;continue}return ae(J,String(I),ee,F)}-1<(ie=(ne=G(ne,F,10,J.s)).indexOf("."))?ne=ne.replace(".",""):ie=ne.length}for(Q=0;ne.charCodeAt(Q)===48;Q++);for(oe=ne.length;ne.charCodeAt(--oe)===48;);if(ne=ne.slice(Q,++oe)){if(oe-=Q,ee&&ue.DEBUG&&15<oe&&(g<I||I!==c(I)))throw Error(h+J.s*I);if(ce<(ie=ie-Q-1))J.c=J.e=null;else if(ie<le)J.c=[J.e=0];else{if(J.e=ie,J.c=[],Q=(ie+1)%f,ie<0&&(Q+=f),Q<oe){for(Q&&J.c.push(+ne.slice(0,Q)),oe-=f;Q<oe;)J.c.push(+ne.slice(Q,Q+=f));ne=ne.slice(Q),Q=f-ne.length}else Q-=oe;for(;Q--;ne+="0");J.c.push(+ne)}}else J.c=[J.e=0]}function ze(I,F,z,se){var q,ie,Q,ee,oe;if(z==null?z=_:A(z,0,8),!I.c)return I.toString();if(q=I.c[0],Q=I.e,F==null)oe=v(I.c),oe=se==1||se==2&&(Q<=N||K<=Q)?E(oe,Q):Y(oe,Q,"0");else if(ie=(I=Be(new ue(I),F,z)).e,ee=(oe=v(I.c)).length,se==1||se==2&&(F<=ie||ie<=N)){for(;ee<F;oe+="0",ee++);oe=E(oe,ie)}else if(F-=Q,oe=Y(oe,ie,"0"),ee<ie+1){if(0<--F)for(oe+=".";F--;oe+="0");}else if(0<(F+=ie-ee))for(ie+1==ee&&(oe+=".");F--;oe+="0");return I.s<0&&q?"-"+oe:oe}function Ie(I,F){for(var z,se=1,q=new ue(I[0]);se<I.length;se++){if(!(z=new ue(I[se])).s){q=z;break}F.call(q,z)&&(q=z)}return q}function we(I,F,z){for(var se=1,q=F.length;!F[--q];F.pop());for(q=F[0];10<=q;q/=10,se++);return(z=se+z*f-1)>ce?I.c=I.e=null:I.c=z<le?[I.e=0]:(I.e=z,F),I}function Be(I,F,z,se){var q,ie,Q,ee,oe,ne,J,Se=I.c,Oe=m;if(Se){e:{for(q=1,ee=Se[0];10<=ee;ee/=10,q++);if((ie=F-q)<0)ie+=f,Q=F,J=(oe=Se[ne=0])/Oe[q-Q-1]%10|0;else if((ne=l((ie+1)/f))>=Se.length){if(!se)break e;for(;Se.length<=ne;Se.push(0));oe=J=0,Q=(ie%=f)-f+(q=1)}else{for(oe=ee=Se[ne],q=1;10<=ee;ee/=10,q++);J=(Q=(ie%=f)-f+q)<0?0:oe/Oe[q-Q-1]%10|0}if(se=se||F<0||Se[ne+1]!=null||(Q<0?oe:oe%Oe[q-Q-1]),se=z<4?(J||se)&&(z==0||z==(I.s<0?3:2)):5<J||J==5&&(z==4||se||z==6&&(0<ie?0<Q?oe/Oe[q-Q]:0:Se[ne-1])%10&1||z==(I.s<0?8:7)),F<1||!Se[0])return Se.length=0,se?(F-=I.e+1,Se[0]=Oe[(f-F%f)%f],I.e=-F||0):Se[0]=I.e=0,I;if(ie==0?(Se.length=ne,ee=1,ne--):(Se.length=ne+1,ee=Oe[f-ie],Se[ne]=0<Q?c(oe/Oe[q-Q]%Oe[Q])*ee:0),se)for(;;){if(ne==0){for(ie=1,Q=Se[0];10<=Q;Q/=10,ie++);for(Q=Se[0]+=ee,ee=1;10<=Q;Q/=10,ee++);ie!=ee&&(I.e++,Se[0]==d&&(Se[0]=1));break}if(Se[ne]+=ee,Se[ne]!=d)break;Se[ne--]=0,ee=1}for(ie=Se.length;Se[--ie]===0;Se.pop());}I.e>ce?I.c=I.e=null:I.e<le&&(I.c=[I.e=0])}return I}function Le(I){var F,z=I.e;return z===null?I.toString():(F=v(I.c),F=z<=N||K<=z?E(F,z):Y(F,z,"0"),I.s<0?"-"+F:F)}return ue.clone=D,ue.ROUND_UP=0,ue.ROUND_DOWN=1,ue.ROUND_CEIL=2,ue.ROUND_FLOOR=3,ue.ROUND_HALF_UP=4,ue.ROUND_HALF_DOWN=5,ue.ROUND_HALF_EVEN=6,ue.ROUND_HALF_CEIL=7,ue.ROUND_HALF_FLOOR=8,ue.EUCLID=9,ue.config=ue.set=function(I){var F,z;if(I!=null){if(typeof I!="object")throw Error(u+"Object expected: "+I);if(I.hasOwnProperty(F="DECIMAL_PLACES")&&(A(z=I[F],0,C,F),O=z),I.hasOwnProperty(F="ROUNDING_MODE")&&(A(z=I[F],0,8,F),_=z),I.hasOwnProperty(F="EXPONENTIAL_AT")&&((z=I[F])&&z.pop?(A(z[0],-C,0,F),A(z[1],0,C,F),N=z[0],K=z[1]):(A(z,-C,C,F),N=-(K=z<0?-z:z))),I.hasOwnProperty(F="RANGE"))if((z=I[F])&&z.pop)A(z[0],-C,-1,F),A(z[1],1,C,F),le=z[0],ce=z[1];else{if(A(z,-C,C,F),!z)throw Error(u+F+" cannot be zero: "+z);le=-(ce=z<0?-z:z)}if(I.hasOwnProperty(F="CRYPTO")){if((z=I[F])!==!!z)throw Error(u+F+" not true or false: "+z);if(z){if(typeof crypto=="undefined"||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw te=!z,Error(u+"crypto unavailable");te=z}else te=z}if(I.hasOwnProperty(F="MODULO_MODE")&&(A(z=I[F],0,9,F),ge=z),I.hasOwnProperty(F="POW_PRECISION")&&(A(z=I[F],0,C,F),Me=z),I.hasOwnProperty(F="FORMAT")){if(typeof(z=I[F])!="object")throw Error(u+F+" not an object: "+z);L=z}if(I.hasOwnProperty(F="ALPHABET")){if(typeof(z=I[F])!="string"||/^.$|[+-.\s]|(.).*\1/.test(z))throw Error(u+F+" invalid: "+z);Fe=z}}return{DECIMAL_PLACES:O,ROUNDING_MODE:_,EXPONENTIAL_AT:[N,K],RANGE:[le,ce],CRYPTO:te,MODULO_MODE:ge,POW_PRECISION:Me,FORMAT:L,ALPHABET:Fe}},ue.isBigNumber=function(I){return I instanceof ue||I&&I._isBigNumber===!0||!1},ue.maximum=ue.max=function(){return Ie(arguments,b.lt)},ue.minimum=ue.min=function(){return Ie(arguments,b.gt)},ue.random=(ve=9007199254740992,me=Math.random()*ve&2097151?function(){return c(Math.random()*ve)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(I){var F,z,se,q,ie,Q=0,ee=[],oe=new ue(x);if(I==null?I=O:A(I,0,C),q=l(I/f),te)if(crypto.getRandomValues){for(F=crypto.getRandomValues(new Uint32Array(q*=2));Q<q;)9e15<=(ie=131072*F[Q]+(F[Q+1]>>>11))?(z=crypto.getRandomValues(new Uint32Array(2)),F[Q]=z[0],F[Q+1]=z[1]):(ee.push(ie%1e14),Q+=2);Q=q/2}else{if(!crypto.randomBytes)throw te=!1,Error(u+"crypto unavailable");for(F=crypto.randomBytes(q*=7);Q<q;)9e15<=(ie=281474976710656*(31&F[Q])+1099511627776*F[Q+1]+4294967296*F[Q+2]+16777216*F[Q+3]+(F[Q+4]<<16)+(F[Q+5]<<8)+F[Q+6])?crypto.randomBytes(7).copy(F,Q):(ee.push(ie%1e14),Q+=7);Q=q/7}if(!te)for(;Q<q;)(ie=me())<9e15&&(ee[Q++]=ie%1e14);for(q=ee[--Q],I%=f,q&&I&&(ie=m[f-I],ee[Q]=c(q/ie)*ie);ee[Q]===0;ee.pop(),Q--);if(Q<0)ee=[se=0];else{for(se=-1;ee[0]===0;ee.splice(0,1),se-=f);for(Q=1,ie=ee[0];10<=ie;ie/=10,Q++);Q<f&&(se-=f-Q)}return oe.e=se,oe.c=ee,oe}),ue.sum=function(){for(var I=1,F=arguments,z=new ue(F[0]);I<F.length;)z=z.plus(F[I++]);return z},G=function(){var I="0123456789";function F(z,se,q,ie){for(var Q,ee,oe=[0],ne=0,J=z.length;ne<J;){for(ee=oe.length;ee--;oe[ee]*=se);for(oe[0]+=ie.indexOf(z.charAt(ne++)),Q=0;Q<oe.length;Q++)oe[Q]>q-1&&(oe[Q+1]==null&&(oe[Q+1]=0),oe[Q+1]+=oe[Q]/q|0,oe[Q]%=q)}return oe.reverse()}return function(z,se,q,ie,Q){var ee,oe,ne,J,Se,Oe,Pe,je,Qe=z.indexOf("."),kt=O,lt=_;for(0<=Qe&&(J=Me,Me=0,z=z.replace(".",""),Oe=(je=new ue(se)).pow(z.length-Qe),Me=J,je.c=F(Y(v(Oe.c),Oe.e,"0"),10,q,I),je.e=je.c.length),ne=J=(Pe=F(z,se,q,Q?(ee=Fe,I):(ee=I,Fe))).length;Pe[--J]==0;Pe.pop());if(!Pe[0])return ee.charAt(0);if(Qe<0?--ne:(Oe.c=Pe,Oe.e=ne,Oe.s=ie,Pe=(Oe=X(Oe,je,kt,lt,q)).c,Se=Oe.r,ne=Oe.e),Qe=Pe[oe=ne+kt+1],J=q/2,Se=Se||oe<0||Pe[oe+1]!=null,Se=lt<4?(Qe!=null||Se)&&(lt==0||lt==(Oe.s<0?3:2)):J<Qe||Qe==J&&(lt==4||Se||lt==6&&1&Pe[oe-1]||lt==(Oe.s<0?8:7)),oe<1||!Pe[0])z=Se?Y(ee.charAt(1),-kt,ee.charAt(0)):ee.charAt(0);else{if(Pe.length=oe,Se)for(--q;++Pe[--oe]>q;)Pe[oe]=0,oe||(++ne,Pe=[1].concat(Pe));for(J=Pe.length;!Pe[--J];);for(Qe=0,z="";Qe<=J;z+=ee.charAt(Pe[Qe++]));z=Y(z,ne,ee.charAt(0))}return z}}(),X=function(){function I(se,q,ie){var Q,ee,oe,ne,J=0,Se=se.length,Oe=q%w,Pe=q/w|0;for(se=se.slice();Se--;)J=((ee=Oe*(oe=se[Se]%w)+(Q=Pe*oe+(ne=se[Se]/w|0)*Oe)%w*w+J)/ie|0)+(Q/w|0)+Pe*ne,se[Se]=ee%ie;return J&&(se=[J].concat(se)),se}function F(se,q,ie,Q){var ee,oe;if(ie!=Q)oe=Q<ie?1:-1;else for(ee=oe=0;ee<ie;ee++)if(se[ee]!=q[ee]){oe=se[ee]>q[ee]?1:-1;break}return oe}function z(se,q,ie,Q){for(var ee=0;ie--;)se[ie]-=ee,ee=se[ie]<q[ie]?1:0,se[ie]=ee*Q+se[ie]-q[ie];for(;!se[0]&&1<se.length;se.splice(0,1));}return function(se,q,ie,Q,ee){var oe,ne,J,Se,Oe,Pe,je,Qe,kt,lt,Rt,$t,no,Xa,qt,hr,io,Gr=se.s==q.s?1:-1,pr=se.c,Bt=q.c;if(!(pr&&pr[0]&&Bt&&Bt[0]))return new ue(se.s&&q.s&&(pr?!Bt||pr[0]!=Bt[0]:Bt)?pr&&pr[0]==0||!Bt?0*Gr:Gr/0:NaN);for(kt=(Qe=new ue(Gr)).c=[],Gr=ie+(ne=se.e-q.e)+1,ee||(ee=d,ne=S(se.e/f)-S(q.e/f),Gr=Gr/f|0),J=0;Bt[J]==(pr[J]||0);J++);if(Bt[J]>(pr[J]||0)&&ne--,Gr<0)kt.push(1),Se=!0;else{for(Xa=pr.length,hr=Bt.length,Gr+=2,1<(Oe=c(ee/(Bt[J=0]+1)))&&(Bt=I(Bt,Oe,ee),pr=I(pr,Oe,ee),hr=Bt.length,Xa=pr.length),no=hr,Rt=(lt=pr.slice(0,hr)).length;Rt<hr;lt[Rt++]=0);io=Bt.slice(),io=[0].concat(io),qt=Bt[0],Bt[1]>=ee/2&&qt++;do{if(Oe=0,(oe=F(Bt,lt,hr,Rt))<0){if($t=lt[0],hr!=Rt&&($t=$t*ee+(lt[1]||0)),1<(Oe=c($t/qt)))for(ee<=Oe&&(Oe=ee-1),je=(Pe=I(Bt,Oe,ee)).length,Rt=lt.length;F(Pe,lt,je,Rt)==1;)Oe--,z(Pe,hr<je?io:Bt,je,ee),je=Pe.length,oe=1;else Oe==0&&(oe=Oe=1),je=(Pe=Bt.slice()).length;if(je<Rt&&(Pe=[0].concat(Pe)),z(lt,Pe,Rt,ee),Rt=lt.length,oe==-1)for(;F(Bt,lt,hr,Rt)<1;)Oe++,z(lt,hr<Rt?io:Bt,Rt,ee),Rt=lt.length}else oe===0&&(Oe++,lt=[0]);kt[J++]=Oe,lt[0]?lt[Rt++]=pr[no]||0:(lt=[pr[no]],Rt=1)}while((no++<Xa||lt[0]!=null)&&Gr--);Se=lt[0]!=null,kt[0]||kt.splice(0,1)}if(ee==d){for(J=1,Gr=kt[0];10<=Gr;Gr/=10,J++);Be(Qe,ie+(Qe.e=J+ne*f-1)+1,Q,Se)}else Qe.e=ne,Qe.r=+Se;return Qe}}(),Re=/^(-?)0([xbo])(?=\w[\w.]*$)/i,Ce=/^([^.]+)\.$/,_e=/^\.([^.]+)$/,p=/^-?(Infinity|NaN)$/,y=/^\s*\+(?=[\w.])|^\s+|\s+$/g,ae=function(I,F,z,se){var q,ie=z?F:F.replace(y,"");if(p.test(ie))I.s=isNaN(ie)?null:ie<0?-1:1,I.c=I.e=null;else{if(!z&&(ie=ie.replace(Re,function(Q,ee,oe){return q=(oe=oe.toLowerCase())=="x"?16:oe=="b"?2:8,se&&se!=q?Q:ee}),se&&(q=se,ie=ie.replace(Ce,"$1").replace(_e,"0.$1")),F!=ie))return new ue(ie,q);if(ue.DEBUG)throw Error(u+"Not a"+(se?" base "+se:"")+" number: "+F);I.c=I.e=I.s=null}},b.absoluteValue=b.abs=function(){var I=new ue(this);return I.s<0&&(I.s=1),I},b.comparedTo=function(I,F){return T(this,new ue(I,F))},b.decimalPlaces=b.dp=function(I,F){var z,se,q;if(I!=null)return A(I,0,C),F==null?F=_:A(F,0,8),Be(new ue(this),I+this.e+1,F);if(!(z=this.c))return null;if(se=((q=z.length-1)-S(this.e/f))*f,q=z[q])for(;q%10==0;q/=10,se--);return se<0&&(se=0),se},b.dividedBy=b.div=function(I,F){return X(this,new ue(I,F),O,_)},b.dividedToIntegerBy=b.idiv=function(I,F){return X(this,new ue(I,F),0,1)},b.exponentiatedBy=b.pow=function(I,F){var z,se,q,ie,Q,ee,oe,ne,J=this;if((I=new ue(I)).c&&!I.isInteger())throw Error(u+"Exponent not an integer: "+Le(I));if(F!=null&&(F=new ue(F)),Q=14<I.e,!J.c||!J.c[0]||J.c[0]==1&&!J.e&&J.c.length==1||!I.c||!I.c[0])return ne=new ue(Math.pow(+Le(J),Q?2-M(I):+Le(I))),F?ne.mod(F):ne;if(ee=I.s<0,F){if(F.c?!F.c[0]:!F.s)return new ue(NaN);(se=!ee&&J.isInteger()&&F.isInteger())&&(J=J.mod(F))}else{if(9<I.e&&(0<J.e||J.e<-1||(J.e==0?1<J.c[0]||Q&&24e7<=J.c[1]:J.c[0]<8e13||Q&&J.c[0]<=9999975e7)))return ie=J.s<0&&M(I)?-0:0,-1<J.e&&(ie=1/ie),new ue(ee?1/ie:ie);Me&&(ie=l(Me/f+2))}for(oe=Q?(z=new ue(.5),ee&&(I.s=1),M(I)):(q=Math.abs(+Le(I)))%2,ne=new ue(x);;){if(oe){if(!(ne=ne.times(J)).c)break;ie?ne.c.length>ie&&(ne.c.length=ie):se&&(ne=ne.mod(F))}if(q){if((q=c(q/2))===0)break;oe=q%2}else if(Be(I=I.times(z),I.e+1,1),14<I.e)oe=M(I);else{if((q=+Le(I))==0)break;oe=q%2}J=J.times(J),ie?J.c&&J.c.length>ie&&(J.c.length=ie):se&&(J=J.mod(F))}return se?ne:(ee&&(ne=x.div(ne)),F?ne.mod(F):ie?Be(ne,Me,_,void 0):ne)},b.integerValue=function(I){var F=new ue(this);return I==null?I=_:A(I,0,8),Be(F,F.e+1,I)},b.isEqualTo=b.eq=function(I,F){return T(this,new ue(I,F))===0},b.isFinite=function(){return!!this.c},b.isGreaterThan=b.gt=function(I,F){return 0<T(this,new ue(I,F))},b.isGreaterThanOrEqualTo=b.gte=function(I,F){return(F=T(this,new ue(I,F)))===1||F===0},b.isInteger=function(){return!!this.c&&S(this.e/f)>this.c.length-2},b.isLessThan=b.lt=function(I,F){return T(this,new ue(I,F))<0},b.isLessThanOrEqualTo=b.lte=function(I,F){return(F=T(this,new ue(I,F)))===-1||F===0},b.isNaN=function(){return!this.s},b.isNegative=function(){return this.s<0},b.isPositive=function(){return 0<this.s},b.isZero=function(){return!!this.c&&this.c[0]==0},b.minus=function(I,F){var z,se,q,ie,Q=this,ee=Q.s;if(F=(I=new ue(I,F)).s,!ee||!F)return new ue(NaN);if(ee!=F)return I.s=-F,Q.plus(I);var oe=Q.e/f,ne=I.e/f,J=Q.c,Se=I.c;if(!oe||!ne){if(!J||!Se)return J?(I.s=-F,I):new ue(Se?Q:NaN);if(!J[0]||!Se[0])return Se[0]?(I.s=-F,I):new ue(J[0]?Q:_==3?-0:0)}if(oe=S(oe),ne=S(ne),J=J.slice(),ee=oe-ne){for((q=(ie=ee<0)?(ee=-ee,J):(ne=oe,Se)).reverse(),F=ee;F--;q.push(0));q.reverse()}else for(se=(ie=(ee=J.length)<(F=Se.length))?ee:F,ee=F=0;F<se;F++)if(J[F]!=Se[F]){ie=J[F]<Se[F];break}if(ie&&(q=J,J=Se,Se=q,I.s=-I.s),0<(F=(se=Se.length)-(z=J.length)))for(;F--;J[z++]=0);for(F=d-1;ee<se;){if(J[--se]<Se[se]){for(z=se;z&&!J[--z];J[z]=F);--J[z],J[se]+=d}J[se]-=Se[se]}for(;J[0]==0;J.splice(0,1),--ne);return J[0]?we(I,J,ne):(I.s=_==3?-1:1,I.c=[I.e=0],I)},b.modulo=b.mod=function(I,F){var z,se,q=this;return I=new ue(I,F),!q.c||!I.s||I.c&&!I.c[0]?new ue(NaN):!I.c||q.c&&!q.c[0]?new ue(q):(ge==9?(se=I.s,I.s=1,z=X(q,I,0,3),I.s=se,z.s*=se):z=X(q,I,0,ge),(I=q.minus(z.times(I))).c[0]||ge!=1||(I.s=q.s),I)},b.multipliedBy=b.times=function(I,F){var z,se,q,ie,Q,ee,oe,ne,J,Se,Oe,Pe,je,Qe,kt,lt=this,Rt=lt.c,$t=(I=new ue(I,F)).c;if(!(Rt&&$t&&Rt[0]&&$t[0]))return!lt.s||!I.s||Rt&&!Rt[0]&&!$t||$t&&!$t[0]&&!Rt?I.c=I.e=I.s=null:(I.s*=lt.s,Rt&&$t?(I.c=[0],I.e=0):I.c=I.e=null),I;for(se=S(lt.e/f)+S(I.e/f),I.s*=lt.s,(oe=Rt.length)<(Se=$t.length)&&(je=Rt,Rt=$t,$t=je,q=oe,oe=Se,Se=q),q=oe+Se,je=[];q--;je.push(0));for(Qe=d,kt=w,q=Se;0<=--q;){for(z=0,Oe=$t[q]%kt,Pe=$t[q]/kt|0,ie=q+(Q=oe);q<ie;)z=((ne=Oe*(ne=Rt[--Q]%kt)+(ee=Pe*ne+(J=Rt[Q]/kt|0)*Oe)%kt*kt+je[ie]+z)/Qe|0)+(ee/kt|0)+Pe*J,je[ie--]=ne%Qe;je[ie]=z}return z?++se:je.splice(0,1),we(I,je,se)},b.negated=function(){var I=new ue(this);return I.s=-I.s||null,I},b.plus=function(I,F){var z,se=this,q=se.s;if(F=(I=new ue(I,F)).s,!q||!F)return new ue(NaN);if(q!=F)return I.s=-F,se.minus(I);var ie=se.e/f,Q=I.e/f,ee=se.c,oe=I.c;if(!ie||!Q){if(!ee||!oe)return new ue(q/0);if(!ee[0]||!oe[0])return oe[0]?I:new ue(ee[0]?se:0*q)}if(ie=S(ie),Q=S(Q),ee=ee.slice(),q=ie-Q){for((z=0<q?(Q=ie,oe):(q=-q,ee)).reverse();q--;z.push(0));z.reverse()}for((q=ee.length)-(F=oe.length)<0&&(z=oe,oe=ee,ee=z,F=q),q=0;F;)q=(ee[--F]=ee[F]+oe[F]+q)/d|0,ee[F]=d===ee[F]?0:ee[F]%d;return q&&(ee=[q].concat(ee),++Q),we(I,ee,Q)},b.precision=b.sd=function(I,F){var z,se,q;if(I!=null&&I!==!!I)return A(I,1,C),F==null?F=_:A(F,0,8),Be(new ue(this),I,F);if(!(z=this.c))return null;if(se=(q=z.length-1)*f+1,q=z[q]){for(;q%10==0;q/=10,se--);for(q=z[0];10<=q;q/=10,se++);}return I&&this.e+1>se&&(se=this.e+1),se},b.shiftedBy=function(I){return A(I,-g,g),this.times("1e"+I)},b.squareRoot=b.sqrt=function(){var I,F,z,se,q,ie=this,Q=ie.c,ee=ie.s,oe=ie.e,ne=O+4,J=new ue("0.5");if(ee!==1||!Q||!Q[0])return new ue(!ee||ee<0&&(!Q||Q[0])?NaN:Q?ie:1/0);if((z=(ee=Math.sqrt(+Le(ie)))==0||ee==1/0?(((F=v(Q)).length+oe)%2==0&&(F+="0"),ee=Math.sqrt(+F),oe=S((oe+1)/2)-(oe<0||oe%2),new ue(F=ee==1/0?"1e"+oe:(F=ee.toExponential()).slice(0,F.indexOf("e")+1)+oe)):new ue(ee+"")).c[0]){for((ee=(oe=z.e)+ne)<3&&(ee=0);;)if(q=z,z=J.times(q.plus(X(ie,q,ne,1))),v(q.c).slice(0,ee)===(F=v(z.c)).slice(0,ee)){if(z.e<oe&&--ee,(F=F.slice(ee-3,ee+1))!="9999"&&(se||F!="4999")){+F&&(+F.slice(1)||F.charAt(0)!="5")||(Be(z,z.e+O+2,1),I=!z.times(z).eq(ie));break}if(!se&&(Be(q,q.e+O+2,0),q.times(q).eq(ie))){z=q;break}ne+=4,ee+=4,se=1}}return Be(z,z.e+O+1,_,I)},b.toExponential=function(I,F){return I!=null&&(A(I,0,C),I++),ze(this,I,F,1)},b.toFixed=function(I,F){return I!=null&&(A(I,0,C),I=I+this.e+1),ze(this,I,F)},b.toFormat=function(I,F,z){var se;if(z==null)I!=null&&F&&typeof F=="object"?(z=F,F=null):I&&typeof I=="object"?(z=I,I=F=null):z=L;else if(typeof z!="object")throw Error(u+"Argument not an object: "+z);if(se=this.toFixed(I,F),this.c){var q,ie=se.split("."),Q=+z.groupSize,ee=+z.secondaryGroupSize,oe=z.groupSeparator||"",ne=ie[0],J=ie[1],Se=this.s<0,Oe=Se?ne.slice(1):ne,Pe=Oe.length;if(ee&&(q=Q,Q=ee,Pe-=ee=q),0<Q&&0<Pe){for(q=Pe%Q||Q,ne=Oe.substr(0,q);q<Pe;q+=Q)ne+=oe+Oe.substr(q,Q);0<ee&&(ne+=oe+Oe.slice(q)),Se&&(ne="-"+ne)}se=J?ne+(z.decimalSeparator||"")+((ee=+z.fractionGroupSize)?J.replace(new RegExp("\\d{"+ee+"}\\B","g"),"$&"+(z.fractionGroupSeparator||"")):J):ne}return(z.prefix||"")+se+(z.suffix||"")},b.toFraction=function(I){var F,z,se,q,ie,Q,ee,oe,ne,J,Se,Oe,Pe=this,je=Pe.c;if(I!=null&&(!(ee=new ue(I)).isInteger()&&(ee.c||ee.s!==1)||ee.lt(x)))throw Error(u+"Argument "+(ee.isInteger()?"out of range: ":"not an integer: ")+Le(ee));if(!je)return new ue(Pe);for(F=new ue(x),ne=z=new ue(x),se=oe=new ue(x),Oe=v(je),ie=F.e=Oe.length-Pe.e-1,F.c[0]=m[(Q=ie%f)<0?f+Q:Q],I=!I||0<ee.comparedTo(F)?0<ie?F:ne:ee,Q=ce,ce=1/0,ee=new ue(Oe),oe.c[0]=0;J=X(ee,F,0,1),(q=z.plus(J.times(se))).comparedTo(I)!=1;)z=se,se=q,ne=oe.plus(J.times(q=ne)),oe=q,F=ee.minus(J.times(q=F)),ee=q;return q=X(I.minus(z),se,0,1),oe=oe.plus(q.times(ne)),z=z.plus(q.times(se)),oe.s=ne.s=Pe.s,Se=X(ne,se,ie*=2,_).minus(Pe).abs().comparedTo(X(oe,z,ie,_).minus(Pe).abs())<1?[ne,se]:[oe,z],ce=Q,Se},b.toNumber=function(){return+Le(this)},b.toPrecision=function(I,F){return I!=null&&A(I,1,C),ze(this,I,F,2)},b.toString=function(I){var F,z=this,se=z.s,q=z.e;return q===null?se?(F="Infinity",se<0&&(F="-"+F)):F="NaN":(F=I==null?q<=N||K<=q?E(v(z.c),q):Y(v(z.c),q,"0"):I===10?Y(v((z=Be(new ue(z),O+q+1,_)).c),z.e,"0"):(A(I,2,Fe.length,"Base"),G(Y(v(z.c),q,"0"),10,I,se,!0)),se<0&&z.c[0]&&(F="-"+F)),F},b.valueOf=b.toJSON=function(){return Le(this)},b._isBigNumber=!0,typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"&&(b[Symbol.toStringTag]="BigNumber",b[Symbol.for("nodejs.util.inspect.custom")]=b.valueOf),U!=null&&ue.set(U),ue}()).default=o.BigNumber=o,n!==void 0&&n.exports?n.exports=o:(s||(s=typeof self!="undefined"&&self?self:window),s.BigNumber=o)})(this)},{}],2:[function(r,n,i){n.exports={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(s){var o=s%10;return~~(s%100/10)==1?"th":o===1?"st":o===2?"nd":o===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(r,n,i){function s(S,v){return function(T){if(Array.isArray(T))return T}(S)||function(T,A){var M=[],E=!0,Y=!1,D=void 0;try{for(var U,X=T[Symbol.iterator]();!(E=(U=X.next()).done)&&(M.push(U.value),!A||M.length!==A);E=!0);}catch(G){Y=!0,D=G}finally{try{E||X.return==null||X.return()}finally{if(Y)throw D}}return M}(S,v)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var o=r("./globalState"),a=r("./validating"),l=r("./parsing"),c=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],u={general:{scale:1024,suffixes:c,marker:"bd"},binary:{scale:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],marker:"b"},decimal:{scale:1e3,suffixes:c,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(S){var v=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},T=2<arguments.length?arguments[2]:void 0;if(typeof v=="string"&&(v=l.parseFormat(v)),!a.validateFormat(v))return"ERROR: invalid format";var A=v.prefix||"",M=v.postfix||"",E=function(Y,D,U){switch(D.output){case"currency":return D=C(D,o.currentCurrencyDefaultFormat()),function(Fe,ue,ze){var Ie=ze.currentCurrency(),we=Object.assign({},h,ue),Be=void 0,Le="",I=!!we.totalLength||!!we.forceAverage||we.average,F=ue.currencyPosition||Ie.position,z=ue.currencySymbol||Ie.symbol;we.spaceSeparated&&(Le=" "),F==="infix"&&(Be=Le+z+Le);var se=w({instance:Fe,providedFormat:ue,state:ze,decimalSeparator:Be});return F==="prefix"&&(se=Fe._value<0&&we.negative==="sign"?"-".concat(Le).concat(z).concat(se.slice(1)):z+Le+se),F&&F!=="postfix"||(se=se+(Le=I?"":Le)+z),se}(Y,D,o);case"percent":return D=C(D,o.currentPercentageDefaultFormat()),function(Fe,ue,ze,Ie){var we=ue.prefixSymbol,Be=w({instance:Ie(100*Fe._value),providedFormat:ue,state:ze}),Le=Object.assign({},h,ue);return we?"%".concat(Le.spaceSeparated?" ":"").concat(Be):"".concat(Be).concat(Le.spaceSeparated?" ":"","%")}(Y,D,o,U);case"byte":return D=C(D,o.currentByteDefaultFormat()),x=Y,_=o,N=U,K=(O=D).base||"binary",le=u[K],ce=f(x._value,le.suffixes,le.scale),te=ce.value,ge=ce.suffix,Me=w({instance:N(te),providedFormat:O,state:_,defaults:_.currentByteDefaultFormat()}),L=_.currentAbbreviations(),"".concat(Me).concat(L.spaced?" ":"").concat(ge);case"time":return D=C(D,o.currentTimeDefaultFormat()),_e=Y,p=Math.floor(_e._value/60/60),y=Math.floor((_e._value-60*p*60)/60),b=Math.round(_e._value-60*p*60-60*y),"".concat(p,":").concat(y<10?"0":"").concat(y,":").concat(b<10?"0":"").concat(b);case"ordinal":return D=C(D,o.currentOrdinalDefaultFormat()),X=Y,G=D,ve=(ae=o).currentOrdinal(),me=Object.assign({},h,G),Re=w({instance:X,providedFormat:G,state:ae}),Ce=ve(X._value),"".concat(Re).concat(me.spaceSeparated?" ":"").concat(Ce);case"number":default:return w({instance:Y,providedFormat:D,numbro:U})}var X,G,ae,ve,me,Re,Ce,_e,p,y,b,x,O,_,N,K,le,ce,te,ge,Me,L}(S,v,T);return E=(E=A+E)+M}function f(S,v,T){var A=v[0],M=Math.abs(S);if(T<=M){for(var E=1;E<v.length;++E){var Y=Math.pow(T,E),D=Math.pow(T,E+1);if(Y<=M&&M<D){A=v[E],S/=Y;break}}A===v[0]&&(S/=Math.pow(T,v.length-1),A=v[v.length-1])}return{value:S,suffix:A}}function g(S){for(var v="",T=0;T<S;T++)v+="0";return v}function m(S,v){return S.toString().indexOf("e")!==-1?function(T,A){var M=T.toString(),E=s(M.split("e"),2),Y=E[0],D=E[1],U=s(Y.split("."),2),X=U[0],G=U[1],ae=G===void 0?"":G;if(0<+D)M=X+ae+g(D-ae.length);else{var ve=".";ve=+X<0?"-0".concat(ve):"0".concat(ve);var me=(g(-D-1)+Math.abs(X)+ae).substr(0,A);me.length<A&&(me+=g(A-me.length)),M=ve+me}return 0<+D&&0<A&&(M+=".".concat(g(A))),M}(S,v):(Math.round(+"".concat(S,"e+").concat(v))/Math.pow(10,v)).toFixed(v)}function w(S){var v=S.instance,T=S.providedFormat,A=S.state,M=A===void 0?o:A,E=S.decimalSeparator,Y=S.defaults,D=Y===void 0?M.currentDefaults():Y,U=v._value;if(U===0&&M.hasZeroFormat())return M.getZeroFormat();if(!isFinite(U))return U.toString();var X,G,ae,ve,me,Re,Ce,_e,p=Object.assign({},h,D,T),y=p.totalLength,b=y?0:p.characteristic,x=p.optionalCharacteristic,O=p.forceAverage,_=!!y||!!O||p.average,N=y?-1:_&&T.mantissa===void 0?0:p.mantissa,K=!y&&(T.optionalMantissa===void 0?N===-1:p.optionalMantissa),le=p.trimMantissa,ce=p.thousandSeparated,te=p.spaceSeparated,ge=p.negative,Me=p.forceSign,L=p.exponential,Fe="";if(_){var ue=function(I){var F=I.value,z=I.forceAverage,se=I.abbreviations,q=I.spaceSeparated,ie=q!==void 0&&q,Q=I.totalLength,ee=Q===void 0?0:Q,oe="",ne=Math.abs(F),J=-1;if(ne>=Math.pow(10,12)&&!z||z==="trillion"?(oe=se.trillion,F/=Math.pow(10,12)):ne<Math.pow(10,12)&&ne>=Math.pow(10,9)&&!z||z==="billion"?(oe=se.billion,F/=Math.pow(10,9)):ne<Math.pow(10,9)&&ne>=Math.pow(10,6)&&!z||z==="million"?(oe=se.million,F/=Math.pow(10,6)):(ne<Math.pow(10,6)&&ne>=Math.pow(10,3)&&!z||z==="thousand")&&(oe=se.thousand,F/=Math.pow(10,3)),oe&&(oe=(ie?" ":"")+oe),ee){var Se=F.toString().split(".")[0];J=Math.max(ee-Se.length,0)}return{value:F,abbreviation:oe,mantissaPrecision:J}}({value:U,forceAverage:O,abbreviations:M.currentAbbreviations(),spaceSeparated:te,totalLength:y});U=ue.value,Fe+=ue.abbreviation,y&&(N=ue.mantissaPrecision)}if(L){var ze=(G=(X={value:U,characteristicPrecision:b}).value,ae=X.characteristicPrecision,ve=ae===void 0?0:ae,me=s(G.toExponential().split("e"),2),Re=me[0],Ce=me[1],_e=+Re,ve&&1<ve&&(_e*=Math.pow(10,ve-1),Ce=0<=(Ce=+Ce-(ve-1))?"+".concat(Ce):Ce),{value:_e,abbreviation:"e".concat(Ce)});U=ze.value,Fe=ze.abbreviation+Fe}var Ie,we,Be,Le=function(I,F,z,se,q){if(se===-1)return I;var ie=m(F,se),Q=s(ie.toString().split("."),2),ee=Q[0],oe=Q[1],ne=oe===void 0?"":oe;if(ne.match(/^0+$/)&&(z||q))return ee;var J=ne.match(/0+$/);return q&&J?"".concat(ee,".").concat(ne.toString().slice(0,J.index)):ie.toString()}(U.toString(),U,K,N,le);return Le=function(I,F,z,se,q){var ie=se.currentDelimiters(),Q=ie.thousands;q=q||ie.decimal;var ee=ie.thousandsSize||3,oe=I.toString(),ne=oe.split(".")[0],J=oe.split(".")[1];return z&&(F<0&&(ne=ne.slice(1)),function(Se,Oe){for(var Pe=[],je=0,Qe=Se;0<Qe;Qe--)je===Oe&&(Pe.unshift(Qe),je=0),je++;return Pe}(ne.length,ee).forEach(function(Se,Oe){ne=ne.slice(0,Se+Oe)+Q+ne.slice(Se+Oe)}),F<0&&(ne="-".concat(ne))),oe=J?ne+q+J:ne}(Le=function(I,F,z,se){var q=I,ie=s(q.toString().split("."),2),Q=ie[0],ee=ie[1];if(Q.match(/^-?0$/)&&z)return ee?"".concat(Q.replace("0",""),".").concat(ee):Q.replace("0","");if(Q.length<se)for(var oe=se-Q.length,ne=0;ne<oe;ne++)q="0".concat(q);return q.toString()}(Le,0,x,b),U,ce,M,E),(_||L)&&(Le=Le+Fe),(Me||U<0)&&(Ie=Le,Be=ge,Le=(we=U)===0?Ie:+Ie==0?Ie.replace("-",""):0<we?"+".concat(Ie):Be==="sign"?Ie:"(".concat(Ie.replace("-",""),")")),Le}function C(S,v){if(!S)return v;var T=Object.keys(S);return T.length===1&&T[0]==="output"?v:S}n.exports=function(S){return{format:function(){for(var v=arguments.length,T=new Array(v),A=0;A<v;A++)T[A]=arguments[A];return d.apply(void 0,T.concat([S]))},getByteUnit:function(){for(var v=arguments.length,T=new Array(v),A=0;A<v;A++)T[A]=arguments[A];return function(M){var E=u.general;return f(M._value,E.suffixes,E.scale).suffix}.apply(void 0,T.concat([S]))},getBinaryByteUnit:function(){for(var v=arguments.length,T=new Array(v),A=0;A<v;A++)T[A]=arguments[A];return function(M){var E=u.binary;return f(M._value,E.suffixes,E.scale).suffix}.apply(void 0,T.concat([S]))},getDecimalByteUnit:function(){for(var v=arguments.length,T=new Array(v),A=0;A<v;A++)T[A]=arguments[A];return function(M){var E=u.decimal;return f(M._value,E.suffixes,E.scale).suffix}.apply(void 0,T.concat([S]))},formatOrDefault:C}}},{"./globalState":4,"./parsing":8,"./validating":10}],4:[function(r,n,i){var s=r("./en-US"),o=r("./validating"),a=r("./parsing"),l={},c=void 0,u={},h=null,d={};function f(m){c=m}function g(){return u[c]}l.languages=function(){return Object.assign({},u)},l.currentLanguage=function(){return c},l.currentCurrency=function(){return g().currency},l.currentAbbreviations=function(){return g().abbreviations},l.currentDelimiters=function(){return g().delimiters},l.currentOrdinal=function(){return g().ordinal},l.currentDefaults=function(){return Object.assign({},g().defaults,d)},l.currentOrdinalDefaultFormat=function(){return Object.assign({},l.currentDefaults(),g().ordinalFormat)},l.currentByteDefaultFormat=function(){return Object.assign({},l.currentDefaults(),g().byteFormat)},l.currentPercentageDefaultFormat=function(){return Object.assign({},l.currentDefaults(),g().percentageFormat)},l.currentCurrencyDefaultFormat=function(){return Object.assign({},l.currentDefaults(),g().currencyFormat)},l.currentTimeDefaultFormat=function(){return Object.assign({},l.currentDefaults(),g().timeFormat)},l.setDefaults=function(m){m=a.parseFormat(m),o.validateFormat(m)&&(d=m)},l.getZeroFormat=function(){return h},l.setZeroFormat=function(m){return h=typeof m=="string"?m:null},l.hasZeroFormat=function(){return h!==null},l.languageData=function(m){if(m){if(u[m])return u[m];throw new Error('Unknown tag "'.concat(m,'"'))}return g()},l.registerLanguage=function(m){var w=1<arguments.length&&arguments[1]!==void 0&&arguments[1];if(!o.validateLanguage(m))throw new Error("Invalid language data");u[m.languageTag]=m,w&&f(m.languageTag)},l.setLanguage=function(m){var w=1<arguments.length&&arguments[1]!==void 0?arguments[1]:s.languageTag;if(!u[m]){var C=m.split("-")[0],S=Object.keys(u).find(function(v){return v.split("-")[0]===C});return u[S]?void f(S):void f(w)}f(m)},l.registerLanguage(s),c=s.languageTag,n.exports=l},{"./en-US":2,"./parsing":8,"./validating":10}],5:[function(r,n,i){n.exports=function(s){return{loadLanguagesInNode:function(o){return a=s,void o.forEach(function(l){var c=void 0;try{c=r("../languages/".concat(l))}catch(u){console.error('Unable to load "'.concat(l,'". No matching language file found.'))}c&&a.registerLanguage(c)});var a}}}},{}],6:[function(r,n,i){var s=r("bignumber.js");function o(a,l,c){var u=new s(a._value),h=l;return c.isNumbro(l)&&(h=l._value),h=new s(h),a._value=u.minus(h).toNumber(),a}n.exports=function(a){return{add:function(l,c){return h=c,d=a,f=new s((u=l)._value),g=h,d.isNumbro(h)&&(g=h._value),g=new s(g),u._value=f.plus(g).toNumber(),u;var u,h,d,f,g},subtract:function(l,c){return o(l,c,a)},multiply:function(l,c){return h=c,d=a,f=new s((u=l)._value),g=h,d.isNumbro(h)&&(g=h._value),g=new s(g),u._value=f.times(g).toNumber(),u;var u,h,d,f,g},divide:function(l,c){return h=c,d=a,f=new s((u=l)._value),g=h,d.isNumbro(h)&&(g=h._value),g=new s(g),u._value=f.dividedBy(g).toNumber(),u;var u,h,d,f,g},set:function(l,c){return u=l,d=h=c,a.isNumbro(h)&&(d=h._value),u._value=d,u;var u,h,d},difference:function(l,c){return u=c,o(d=(h=a)(l._value),u,h),Math.abs(d._value);var u,h,d}}}},{"bignumber.js":1}],7:[function(r,n,i){function s(w,C){for(var S=0;S<C.length;S++){var v=C[S];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(w,v.key,v)}}var o=r("./globalState"),a=r("./validating"),l=r("./loading")(m),c=r("./unformatting"),u=r("./formatting")(m),h=r("./manipulating")(m),d=r("./parsing"),f=function(){function w(v){(function(T,A){if(!(T instanceof A))throw new TypeError("Cannot call a class as a function")})(this,w),this._value=v}var C,S;return C=w,(S=[{key:"clone",value:function(){return m(this._value)}},{key:"format",value:function(){var v=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};return u.format(this,v)}},{key:"formatCurrency",value:function(v){return typeof v=="string"&&(v=d.parseFormat(v)),(v=u.formatOrDefault(v,o.currentCurrencyDefaultFormat())).output="currency",u.format(this,v)}},{key:"formatTime",value:function(){var v=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};return v.output="time",u.format(this,v)}},{key:"binaryByteUnits",value:function(){return u.getBinaryByteUnit(this)}},{key:"decimalByteUnits",value:function(){return u.getDecimalByteUnit(this)}},{key:"byteUnits",value:function(){return u.getByteUnit(this)}},{key:"difference",value:function(v){return h.difference(this,v)}},{key:"add",value:function(v){return h.add(this,v)}},{key:"subtract",value:function(v){return h.subtract(this,v)}},{key:"multiply",value:function(v){return h.multiply(this,v)}},{key:"divide",value:function(v){return h.divide(this,v)}},{key:"set",value:function(v){return h.set(this,g(v))}},{key:"value",value:function(){return this._value}},{key:"valueOf",value:function(){return this._value}}])&&s(C.prototype,S),w}();function g(w){var C=w;return m.isNumbro(w)?C=w._value:typeof w=="string"?C=m.unformat(w):isNaN(w)&&(C=NaN),C}function m(w){return new f(g(w))}m.version="2.1.2",m.isNumbro=function(w){return w instanceof f},m.language=o.currentLanguage,m.registerLanguage=o.registerLanguage,m.setLanguage=o.setLanguage,m.languages=o.languages,m.languageData=o.languageData,m.zeroFormat=o.setZeroFormat,m.defaultFormat=o.currentDefaults,m.setDefaults=o.setDefaults,m.defaultCurrencyFormat=o.currentCurrencyDefaultFormat,m.validate=a.validate,m.loadLanguagesInNode=l.loadLanguagesInNode,m.unformat=c.unformat,n.exports=m},{"./formatting":3,"./globalState":4,"./loading":5,"./manipulating":6,"./parsing":8,"./unformatting":9,"./validating":10}],8:[function(r,n,i){n.exports={parseFormat:function(s){var o,a,l,c,u,h,d,f,g,m,w,C,S,v,T,A,M,E,Y,D,U=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};return typeof s!="string"?s:(a=U,s=(l=(o=s).match(/^{([^}]*)}/))?(a.prefix=l[1],o.slice(l[0].length)):o,u=U,function(X,G){if(X.indexOf("$")===-1){if(X.indexOf("%")===-1)return X.indexOf("bd")!==-1?(G.output="byte",G.base="general"):X.indexOf("b")!==-1?(G.output="byte",G.base="binary"):X.indexOf("d")!==-1?(G.output="byte",G.base="decimal"):X.indexOf(":")===-1?X.indexOf("o")!==-1&&(G.output="ordinal"):G.output="time";G.output="percent"}else G.output="currency"}(s=(h=(c=s).match(/{([^}]*)}$/))?(u.postfix=h[1],c.slice(0,-h[0].length)):c,U),d=U,(f=s.match(/[1-9]+[0-9]*/))&&(d.totalLength=+f[0]),g=U,(m=s.split(".")[0].match(/0+/))&&(g.characteristic=m[0].length),function(X,G){if(X.indexOf(".")!==-1){var ae=X.split(".")[0];G.optionalCharacteristic=ae.indexOf("0")===-1}}(s,U),w=U,s.indexOf("a")!==-1&&(w.average=!0),S=U,(C=s).indexOf("K")!==-1?S.forceAverage="thousand":C.indexOf("M")!==-1?S.forceAverage="million":C.indexOf("B")!==-1?S.forceAverage="billion":C.indexOf("T")!==-1&&(S.forceAverage="trillion"),function(X,G){var ae=X.split(".")[1];if(ae){var ve=ae.match(/0+/);ve&&(G.mantissa=ve[0].length)}}(s,U),T=U,(v=s).match(/\[\.]/)?T.optionalMantissa=!0:v.match(/\./)&&(T.optionalMantissa=!1),A=U,s.indexOf(",")!==-1&&(A.thousandSeparated=!0),M=U,s.indexOf(" ")!==-1&&(M.spaceSeparated=!0),Y=U,(E=s).match(/^\+?\([^)]*\)$/)&&(Y.negative="parenthesis"),E.match(/^\+?-/)&&(Y.negative="sign"),D=U,s.match(/^\+/)&&(D.forceSign=!0),U)}}},{}],9:[function(r,n,i){var s=[{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 o(l){return l.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function a(l,c){var u=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,f=5<arguments.length?arguments[5]:void 0,g=6<arguments.length?arguments[6]:void 0;if(l!=="")return l===d?0:function m(w,C){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:"",v=3<arguments.length?arguments[3]:void 0,T=4<arguments.length?arguments[4]:void 0,A=5<arguments.length?arguments[5]:void 0,M=6<arguments.length?arguments[6]:void 0;if(!isNaN(+w))return+w;var E="",Y=w.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(Y!==w)return-1*m(Y,C,S,v,T,A,M);for(var D=0;D<s.length;D++){var U=s[D];if((E=w.replace(U.key,""))!==w)return m(E,C,S,v,T,A,M)*U.factor}if((E=w.replace("%",""))!==w)return m(E,C,S,v,T,A,M)/100;var X=parseFloat(w);if(!isNaN(X)){var G=v(X);if(G&&G!=="."&&(E=w.replace(new RegExp("".concat(o(G),"$")),""))!==w)return m(E,C,S,v,T,A,M);var ae={};Object.keys(A).forEach(function(y){ae[A[y]]=y});for(var ve=Object.keys(ae).sort().reverse(),me=ve.length,Re=0;Re<me;Re++){var Ce=ve[Re],_e=ae[Ce];if((E=w.replace(Ce,""))!==w){var p=void 0;switch(_e){case"thousand":p=Math.pow(10,3);break;case"million":p=Math.pow(10,6);break;case"billion":p=Math.pow(10,9);break;case"trillion":p=Math.pow(10,12)}return m(E,C,S,v,T,A,M)*p}}}}(function(m,w){var C=2<arguments.length&&arguments[2]!==void 0?arguments[2]:"",S=m.replace(C,"");return S=(S=S.replace(new RegExp("([0-9])".concat(o(w.thousands),"([0-9])"),"g"),"$1$2")).replace(w.decimal,".")}(l,c,u),c,u,h,d,f,g)}n.exports={unformat:function(l,c){var u,h,d,f=r("./globalState"),g=f.currentDelimiters(),m=f.currentCurrency().symbol,w=f.currentOrdinal(),C=f.getZeroFormat(),S=f.currentAbbreviations(),v=void 0;if(typeof l=="string")v=function(T,A){if(!T.indexOf(":")||A.thousands===":")return!1;var M=T.split(":");if(M.length!==3)return!1;var E=+M[0],Y=+M[1],D=+M[2];return!isNaN(E)&&!isNaN(Y)&&!isNaN(D)}(l,g)?(u=l.split(":"),h=+u[0],d=+u[1],+u[2]+60*d+3600*h):a(l,g,m,w,C,S,c);else{if(typeof l!="number")return;v=l}if(v!==void 0)return v}}},{"./globalState":4}],10:[function(r,n,i){function s(g){return function(m){if(Array.isArray(m)){for(var w=0,C=new Array(m.length);w<m.length;w++)C[w]=m[w];return C}}(g)||function(m){if(Symbol.iterator in Object(m)||Object.prototype.toString.call(m)==="[object Arguments]")return Array.from(m)}(g)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function o(g){return(o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m})(g)}var a=r("./unformatting"),l=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,c={output:{type:"string",validValues:["currency","percent","byte","time","ordinal","number"]},base:{type:"string",validValues:["decimal","binary","general"],restriction:function(g,m){return m.output==="byte"},message:"`base` must be provided only when the output is `byte`",mandatory:function(g){return g.output==="byte"}},characteristic:{type:"number",restriction:function(g){return 0<=g},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(g){return 0<=g},message:"value must be positive"},{restriction:function(g,m){return!m.exponential},message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:function(g){return 0<=g},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(g,m){return m.output==="percent"},message:"`prefixSymbol` can be provided only when the output is `percent`"}},u={languageTag:{type:"string",mandatory:!0,restriction:function(g){return g.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(g){return!!a.unformat(g)}function d(g,m,w){var C=3<arguments.length&&arguments[3]!==void 0&&arguments[3],S=Object.keys(g).map(function(v){if(!m[v])return console.error("".concat(w," Invalid key: ").concat(v)),!1;var T=g[v],A=m[v];if(typeof A=="string"&&(A={type:A}),A.type==="format"){if(!d(T,c,"[Validate ".concat(v,"]"),!0))return!1}else if(o(T)!==A.type)return console.error("".concat(w," ").concat(v,' type mismatched: "').concat(A.type,'" expected, "').concat(o(T),'" provided')),!1;if(A.restrictions&&A.restrictions.length)for(var M=A.restrictions.length,E=0;E<M;E++){var Y=A.restrictions[E],D=Y.restriction,U=Y.message;if(!D(T,g))return console.error("".concat(w," ").concat(v," invalid value: ").concat(U)),!1}return A.restriction&&!A.restriction(T,g)?(console.error("".concat(w," ").concat(v," invalid value: ").concat(A.message)),!1):A.validValues&&A.validValues.indexOf(T)===-1?(console.error("".concat(w," ").concat(v," invalid value: must be among ").concat(JSON.stringify(A.validValues),', "').concat(T,'" provided')),!1):!(A.children&&!d(T,A.children,"[Validate ".concat(v,"]")))});return C||S.push.apply(S,s(Object.keys(m).map(function(v){var T=m[v];if(typeof T=="string"&&(T={type:T}),T.mandatory){var A=T.mandatory;if(typeof A=="function"&&(A=A(g)),A&&g[v]===void 0)return console.error("".concat(w,' Missing mandatory key "').concat(v,'"')),!1}return!0}))),S.reduce(function(v,T){return v&&T},!0)}function f(g){return d(g,c,"[Validate format]")}n.exports={validate:function(g,m){var w=h(g),C=f(m);return w&&C},validateFormat:f,validateInput:h,validateLanguage:function(g){return d(g,u,"[Validate language]")}}},{"./unformatting":9}]},{},[7])(7)})})(vL);const ll=vL.exports,Ule="numeric";function eE(t,e,r,n,i,s,o){let a=s;if(Zn(a)){const l=o.numericFormat,c=l&&l.culture||"-",u=l&&l.pattern,h=o.className||"",d=h.length?h.split(" "):[];if(typeof c!="undefined"&&!ll.languages()[c]){const f=c.replace("-",""),g=ll.allLanguages?ll.allLanguages[c]:ll[f];g&&ll.registerLanguage(g)}ll.setLanguage(c),a=ll(a).format(u||"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"),o.className=d.join(" "),e.dir="ltr"}Ko(t,e,r,n,i,a,o)}eE.RENDERER_TYPE=Ule;const Gle="password";function tE(t,e,r,n,i,s,o){Ko.apply(this,[t,e,r,n,i,s,o]);const a=o.hashLength||e.innerHTML.length,l=o.hashSymbol||"*";let c="";Ue(a-1,()=>{c+=l}),Gu(e,c)}tE.RENDERER_TYPE=Gle;const Yle="select";function rE(t,e,r,n,i,s,o){Ko.apply(this,[t,e,r,n,i,s,o])}rE.RENDERER_TYPE=Yle;const zle="time";function nE(t,e,r,n,i,s,o){Ko.apply(this,[t,e,r,n,i,s,o]),e.dir="ltr"}nE.RENDERER_TYPE=zle;function jle(){bi(ju),bi(Ef),bi(Zb),bi(qb),bi(Qb),bi(Xb),bi(eE),bi(tE),bi(rE),bi(Ko),bi(nE)}const Kle="autocomplete";function $p(t,e){let r=t;if(r==null&&(r=""),this.allowEmpty&&r===""){e(!0);return}this.strict&&this.source?typeof this.source=="function"?this.source(r,_A(r,e)):_A(r,e)(this.source):e(!0)}$p.VALIDATOR_TYPE=Kle;function _A(t,e){const r=t;return function(n){let i=!1;for(let s=0,o=n.length;s<o;s++)if(r===n[s]){i=!0;break}e(i)}}function Xle(t){const e=new Date(t);return isNaN(new Date(`${t}T00:00`).getDate())?e:new Date(e.getTime()+e.getTimezoneOffset()*6e4)}const qle="date";function iE(t,e){const r=$H(hL,this.instance);let n=t,i=!0;n==null&&(n="");let s=ye(n,this.dateFormat||r.defaultDateFormat,!0).isValid(),o=ye(new Date(n)).isValid()||s;if(this.allowEmpty&&n===""&&(o=!0,s=!0),o||(i=!1),!o&&s&&(i=!0),o&&!s)if(this.correctFormat===!0){const a=Zle(n,this.dateFormat),l=this.instance.toVisualRow(this.row),c=this.instance.toVisualColumn(this.col);this.instance.setDataAtCell(l,c,a,"dateValidator"),i=!0}else i=!1;e(i)}iE.VALIDATOR_TYPE=qle;function Zle(t,e){const r=ye(Xle(t)),n=ye(t,e),i=t.search(/[A-z]/g)>-1;let s;return r.isValid()&&r.format("x")===n.format("x")||!n.isValid()||i?s=r:s=n,s.format(e)}const Jle="dropdown";function sE(t,e){$p.apply(this,[t,e])}sE.VALIDATOR_TYPE=Jle;const Qle="numeric";function oE(t,e){let r=t;r==null&&(r=""),this.allowEmpty&&r===""?e(!0):e(r===""?!1:Zn(t))}oE.VALIDATOR_TYPE=Qle;const ece=["YYYY-MM-DDTHH:mm:ss.SSSZ","X","x"],tce="time";function aE(t,e){const r=this.timeFormat||"h:mm:ss a";let n=!0,i=t;i===null&&(i=""),i=/^\d{3,}$/.test(i)?parseInt(i,10):i;const s=/^\d{1,2}$/.test(i);s&&(i+=":00");const o=ye(i,ece,!0).isValid()?ye(i):ye(i,r);let a=o.isValid(),l=ye(i,r,!0).isValid()&&!s;if(this.allowEmpty&&i===""&&(a=!0,l=!0),a||(n=!1),!a&&l&&(n=!0),a&&!l)if(this.correctFormat===!0){const c=o.format(r),u=this.instance.toVisualRow(this.row),h=this.instance.toVisualColumn(this.col);this.instance.setDataAtCell(u,h,c,"timeValidator"),n=!0}else n=!1;e(n)}aE.VALIDATOR_TYPE=tce;function rce(){au($p),au(sE),au(iE),au(oE),au(aE)}const nce="autocomplete",ice={CELL_TYPE:nce,editor:zb,renderer:ju,validator:$p},sce="checkbox",oce={CELL_TYPE:sce,editor:uL,renderer:Zb},ace="date";function CL(t,e,r,n,i,s,o){ju.apply(this,[t,e,r,n,i,s,o])}CL.RENDERER_TYPE=ace;const lce="date",cce={CELL_TYPE:lce,editor:dL,renderer:CL,validator:iE},uce="dropdown",hce={CELL_TYPE:uce,editor:Kb,renderer:qb,validator:sE},dce="handsontable",fce={CELL_TYPE:dce,editor:Yb,renderer:Qb},gce="numeric",mce={CELL_TYPE:gce,editor:fL,renderer:eE,validator:oE,dataType:"number"},pce="password",wce={CELL_TYPE:pce,editor:gL,renderer:tE,copyable:!1},vce="select",Cce={CELL_TYPE:vce,editor:mL,renderer:rE},Sce="time",yce={CELL_TYPE:Sce,editor:pL,renderer:nE,validator:aE};function xce(){es(ice),es(oce),es(cce),es(hce),es(fce),es(mce),es(wce),es(Cce),es(aL),es(yce)}function bce(t,e){SL(t,e),e.add(t)}function Ece(t,e,r){SL(t,e),e.set(t,r)}function SL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Tc(t,e,r){return e=Rce(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Rce(t){var e=Tce(t,"string");return typeof e=="symbol"?e:String(e)}function Tce(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function _ce(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function _c(t,e){var r=Ace(t,e,"get");return Mce(t,r)}function Ace(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function Mce(t,e){return e.get?e.get.call(t):e.value}const AA=new Map([["plugin",Vee],["cell-type",ZF],["editor",LH],["renderer",jH],["validator",KH]]),Oce="base",Ov=[];let _s=null;var cl=new WeakMap,MA=new WeakSet;class It{static get PLUGIN_KEY(){return Oce}static get SETTING_KEYS(){return[this.PLUGIN_KEY]}constructor(e){bce(this,MA),Tc(this,"eventManager",new ms(this)),Tc(this,"pluginName",null),Tc(this,"pluginsInitializedCallbacks",[]),Tc(this,"isPluginsReady",!1),Tc(this,"enabled",!1),Tc(this,"initialized",!1),Ece(this,cl,{writable:!0,value:{}}),zo(this,"hot",e,{writable:!1}),_s=null,this.hot.addHook("afterPluginsInitialized",()=>this.onAfterPluginsInitialized()),this.hot.addHook("afterUpdateSettings",r=>this.onUpdateSettings(r)),this.hot.addHook("beforeInit",()=>this.init())}init(){this.pluginName=this.hot.getPluginName(this);const e=this.constructor.PLUGIN_DEPS,r=Array.isArray(e)?e:[];if(r.length>0){const i=[];if(r.forEach(s=>{const[o,a]=s.split(":");if(!AA.has(o))throw new Error(`Unknown plugin dependency type "${o}" was found.`);AA.get(o)(a)||i.push(` - ${a} (${o})`)}),i.length>0){const s=[`The ${this.pluginName} plugin requires the following modules:
  103. `,`${i.join(`
  104. `)}
  105. `].join("");Ov.push(s)}}if(_s||(_s=zH()),_s.indexOf("UndoRedo")>=0&&_s.splice(_s.indexOf("UndoRedo"),1),_s.indexOf(this.pluginName)>=0&&_s.splice(_s.indexOf(this.pluginName),1),this.hot.addHookOnce("afterPluginsInitialized",()=>{this.isEnabled&&this.isEnabled()&&this.enablePlugin()}),_s.length===0){if(Ov.length>0){const i=[`${Ov.join(`
  106. `)}
  107. `,"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,r){_c(this,cl)[e]=_c(this,cl)[e]||[];const n=_c(this,cl)[e];this.hot.addHook(e,r),n.push(r),_c(this,cl)[e]=n}removeHooks(e){j(_c(this,cl)[e]||[],r=>{this.hot.removeHook(e,r)})}clearHooks(){const e=_c(this,cl);dt(e,(r,n)=>this.removeHooks(n)),e.length=0}callOnPluginsReady(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)}onAfterPluginsInitialized(){j(this.pluginsInitializedCallbacks,e=>e()),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0}onUpdateSettings(e){const r=_ce(this,MA,Ice).call(this,e);this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&r&&this.updatePlugin(e))}updatePlugin(){}destroy(){var e;(e=this.eventManager)===null||e===void 0||e.destroy(),this.clearHooks(),dt(this,(r,n)=>{n!=="hot"&&(this[n]=null)}),delete this.t,delete this.hot}}function Ice(t){if(!t)return!1;const e=this.constructor.SETTING_KEYS;if(typeof e=="boolean")return e;for(let r=0;r<e.length;r++)if(t[e[r]]!==void 0)return!0;return!1}function ul(t,e,r){return e=Pce(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Pce(t){var e=Dce(t,"string");return typeof e=="symbol"?e:String(e)}function Dce(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class kce{constructor(e){ul(this,"hot",null),ul(this,"container",null),ul(this,"injected",!1),ul(this,"rows",[]),ul(this,"columns",[]),ul(this,"samples",null),ul(this,"settings",{useHeaders:!0}),this.hot=e}addRow(e,r){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 n={row:e};this.rows.push(n),this.samples=r,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),n.table=this.table.table}addColumnHeadersRow(e){const r=this.hot.getColHeader(0);if(r!=null){const n={row:-1};this.rows.push(n),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),n.table=this.table.table}}addColumn(e,r){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 n={col:e};this.columns.push(n),this.samples=r,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),n.table=this.table.table}getHeights(e){this.injected||this.injectTable(),j(this.rows,r=>{e(r.row,cr(r.table)-1)})}getWidths(e){this.injected||this.injectTable(),j(this.columns,r=>{const{width:n}=r.table.getBoundingClientRect();e(r.col,Math.ceil(n))})}setSettings(e){this.settings=e}setSetting(e,r){this.settings||(this.settings={}),this.settings[e]=r}getSettings(){return this.settings}getSetting(e){return this.settings?this.settings[e]:null}createColGroupsCol(e){const r=this.hot.rootDocument.createDocumentFragment();return this.hot.hasRowHeaders()&&r.appendChild(this.createColElement(-1,-1)),this.samples.forEach(n=>{j(n.strings,i=>{r.appendChild(this.createColElement(i.col,e))})}),r}createRow(e){const{rootDocument:r}=this.hot,n=r.createDocumentFragment(),i=r.createElement("th");return this.hot.hasRowHeaders()&&(this.hot.view.appendRowHeader(e,i),n.appendChild(i)),this.samples.forEach(s=>{j(s.strings,o=>{const a=o.col,l=this.hot.getCellMeta(e,a);l.col=a,l.row=e;const c=this.hot.getCellRenderer(l),u=r.createElement("td");u.setAttribute("ghost-table",1),c(this.hot,u,e,a,this.hot.colToProp(a),o.value,l),n.appendChild(u)})}),n}appendColumnHeadersRow(){const{rootDocument:e}=this.hot,r=e.createDocumentFragment(),n=[];if(this.hot.hasRowHeaders()){const i=e.createElement("th");n.push([-1,i]),r.appendChild(i)}this.samples.forEach(i=>{j(i.strings,s=>{const o=s.col,a=e.createElement("th");n.push([o,a]),r.appendChild(a)})}),this.table.tHead.appendChild(r),j(n,i=>{const[s,o]=i;this.hot.view.appendColHeader(s,o)})}createCol(e){const{rootDocument:r}=this.hot,n=r.createDocumentFragment();return this.samples.forEach(i=>{j(i.strings,s=>{const o=s.row,a=this.hot.getCellMeta(o,e);a.col=e,a.row=o;const l=this.hot.getCellRenderer(a),c=r.createElement("td"),u=r.createElement("tr");c.setAttribute("ghost-table",1),l(this.hot,c,o,e,this.hot.colToProp(e),s.value,a),u.appendChild(c),n.appendChild(u)})}),n}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,r){const n=this.hot.rootDocument.createElement("col");let i=0;r>=0&&e>=0&&(i=this.hot.getCellMeta(r,e).colspan);let s=this.hot.view._wt.wtTable.getStretchedColumnWidth(e);if(i>1)for(let o=e+1;o<e+i;o++)s+=this.hot.view._wt.wtTable.getStretchedColumnWidth(o);return n.style.width=`${s}px`,n}createTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{rootDocument:r}=this.hot,n=r.createDocumentFragment(),i=r.createElement("table"),s=r.createElement("thead"),o=r.createElement("tbody"),a=r.createElement("colgroup"),l=r.createElement("tr"),c=r.createElement("th");return this.isVertical()&&i.appendChild(a),this.isHorizontal()&&(l.appendChild(c),s.appendChild(l),i.style.tableLayout="auto",i.style.width="auto"),i.appendChild(s),this.isVertical()&&o.appendChild(l),i.appendChild(o),be(i,e),n.appendChild(i),{fragment:n,table:i,tHead:s,tBody:o,colGroup:a,tr:l,th:c}}createContainer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{rootDocument:r}=this.hot,n=r.createDocumentFragment(),i=r.createElement("div"),s=`htGhostTable htAutoSize ${e.trim()}`;return be(i,s),n.appendChild(i),{fragment:n,container:i}}isVertical(){return!!(this.rows.length&&!this.columns.length)}isHorizontal(){return!!(this.columns.length&&!this.rows.length)}}const yL=kce;function Fg(t,e,r){return e=Nce(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nce(t){var e=Hce(t,"string");return typeof e=="symbol"?e:String(e)}function Hce(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class lE{static get SAMPLE_COUNT(){return 3}constructor(e){Fg(this,"samples",null),Fg(this,"dataFactory",null),Fg(this,"customSampleCount",null),Fg(this,"allowDuplicates",!1),this.dataFactory=e}getSampleCount(){return this.customSampleCount?this.customSampleCount:lE.SAMPLE_COUNT}setSampleCount(e){this.customSampleCount=e}setAllowDuplicates(e){this.allowDuplicates=e}generateRowSamples(e,r){return this.generateSamples("row",r,e)}generateColumnSamples(e,r){return this.generateSamples("col",r,e)}generateSamples(e,r,n){const i=new Map,{from:s,to:o}=typeof n=="number"?{from:n,to:n}:n;return Ue(s,o,a=>{const l=this.generateSample(e,r,a);i.set(a,l)}),i}generateSample(e,r,n){if(e!=="row"&&e!=="col")throw new Error("Unsupported sample type");const i=new Map,s=e==="row"?"col":"row",o=[];return Ue(r.from,r.to,a=>{const l=e==="row"?this.dataFactory(n,a):this.dataFactory(a,n);if(l===!1)return;const{value:c,bundleSeed:u}=l,h=typeof u=="string"&&u.length>0;let d;h?d=u:at(c)?d=`${Object.keys(c).length}`:Array.isArray(c)?d=`${c.length}`:d=`${Sr(c).length}`,i.has(d)||i.set(d,{needed:this.getSampleCount(),strings:[]});const f=i.get(d);f.needed&&(!(o.indexOf(c)>-1)||this.allowDuplicates||h)&&(f.strings.push({value:c,[s]:a}),o.push(c),f.needed-=1)}),i}}const xL=lE;function Ac(t,e){bL(t,e),e.add(t)}function Fce(t,e,r){bL(t,e),e.set(t,r)}function bL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Mc(t,e,r){return e=Lce(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Lce(t){var e=$ce(t,"string");return typeof e=="symbol"?e:String(e)}function $ce(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Bce(t,e,r){var n=EL(t,e,"set");return Wce(t,n,r),r}function Wce(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function Lg(t,e){var r=EL(t,e,"get");return Vce(t,r)}function EL(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function Vce(t,e){return e.get?e.get.call(t):e.value}function hl(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}$e.getSingleton().register("modifyAutoColumnSizeSeed");const yh="autoColumnSize",Uce=10,Gce="autoColumnSize";var lu=new WeakMap,OA=new WeakSet,IA=new WeakSet,PA=new WeakSet,Iv=new WeakSet,DA=new WeakSet,kA=new WeakSet;class vd extends It{static get PLUGIN_KEY(){return yh}static get PLUGIN_PRIORITY(){return Uce}static get SETTING_KEYS(){return!0}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 50}constructor(e){super(e),Ac(this,kA),Ac(this,DA),Ac(this,Iv),Ac(this,PA),Ac(this,IA),Ac(this,OA),Mc(this,"ghostTable",new yL(this.hot)),Mc(this,"samplesGenerator",new xL((r,n)=>{const i=this.hot.getCellMeta(r,n);let s="";i.spanned||(s=this.hot.getDataAtCell(r,n));let o="";return this.hot.hasHook("modifyAutoColumnSizeSeed")&&(o=this.hot.runHooks("modifyAutoColumnSizeSeed",o,i,s)),{value:s,bundleSeed:o}})),Mc(this,"firstCalculation",!0),Mc(this,"inProgress",!1),Mc(this,"measuredColumns",0),Mc(this,"columnWidthsMap",new Ka),Fce(this,lu,{writable:!0,value:[]}),this.hot.columnIndexMapper.registerMap(Gce,this.columnWidthsMap),this.addHook("beforeColumnResize",(r,n,i)=>hl(this,Iv,NA).call(this,r,n,i))}isEnabled(){return this.hot.getSettings()[yh]!==!1&&!this.hot.getSettings().colWidths}enablePlugin(){var e=this;if(this.enabled)return;const r=this.hot.getSettings()[yh];r&&r.useHeaders!==null&&r.useHeaders!==void 0&&this.ghostTable.setSetting("useHeaders",r.useHeaders),this.setSamplingOptions(),this.addHook("afterLoadData",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return hl(e,IA,zce).call(e,...i)}),this.addHook("beforeChangeRender",n=>hl(this,PA,jce).call(this,n)),this.addHook("afterFormulasValuesUpdate",n=>hl(this,kA,Xce).call(this,n)),this.addHook("beforeViewRender",n=>hl(this,OA,Yce).call(this,n)),this.addHook("modifyColWidth",(n,i)=>this.getColumnWidth(i,n)),this.addHook("afterInit",()=>hl(this,DA,Kce).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,r,n)=>hl(this,Iv,NA).call(this,e,r,n))}calculateVisibleColumnsWidth(){if(!this.hot.countRows())return;const r=this.hot.renderCall,n=this.getFirstVisibleColumn(),i=this.getLastVisibleColumn();n===-1||i===-1||this.calculateColumnsWidth({from:n,to:i},void 0,r)}calculateColumnsWidth(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countCols()-1},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{from:0,to:this.hot.countRows()-1},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=typeof e=="number"?{from:e,to:e}:e,s=typeof r=="number"?{from:r,to:r}:r;Ue(i.from,i.to,o=>{let a=this.hot.toPhysicalColumn(o);if(a===null&&(a=o),n||this.columnWidthsMap.getValueAtIndex(a)===null&&!this.hot._getColWidthFromSettings(a)){const l=this.samplesGenerator.generateColumnSamples(o,s);j(l,c=>{let[u,h]=c;return this.ghostTable.addColumn(u,h)})}}),this.ghostTable.columns.length&&(this.hot.batchExecution(()=>{this.ghostTable.getWidths((o,a)=>{const l=this.hot.toPhysicalColumn(o);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},r=0;const n=this.hot.countCols()-1;let i=null;this.inProgress=!0;const s=()=>{if(!this.hot){Sm(i),this.inProgress=!1;return}this.calculateColumnsWidth({from:r,to:Math.min(r+vd.CALCULATION_STEP,n)},e),r=r+vd.CALCULATION_STEP+1,r<n?i=Uy(s):(Sm(i),this.inProgress=!1,this.hot.view.adjustElementsSize())},o=this.getSyncCalculationLimit();this.firstCalculation&&o>=0&&(this.calculateColumnsWidth({from:0,to:o},e),this.firstCalculation=!1,r=o+1),r<n?s():this.inProgress=!1}setSamplingOptions(){const e=this.hot.getSettings()[yh],r=e&&lr(e,"samplingRatio")?e.samplingRatio:void 0,n=e&&lr(e,"allowSampleDuplicates")?e.allowSampleDuplicates:void 0;r&&!isNaN(r)&&this.samplesGenerator.setSampleCount(parseInt(r,10)),n&&this.samplesGenerator.setAllowDuplicates(n)}recalculateAllColumnsWidth(){this.hot.view&&this.hot.view._wt.wtTable.isVisible()&&(this.clearCache(),this.calculateAllColumnsWidth())}getSyncCalculationLimit(){const e=this.hot.getSettings()[yh];let r=vd.SYNC_CALCULATION_LIMIT;const n=this.hot.countCols()-1;return at(e)&&(r=e.syncLimit,aH(r)?r=UH(n,r):r>>=0),Math.min(r,n)}getColumnWidth(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=r;return i===void 0&&(i=this.columnWidthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e)),n&&typeof i=="number"&&(i=Math.max(i,Sf.DEFAULT_WIDTH))),i}getFirstVisibleColumn(){const e=this.hot.view._wt;if(e.wtViewport.columnsVisibleCalculator){const r=e.wtTable.getFirstVisibleColumn();if(r!==-1)return this.hot.columnIndexMapper.getVisualFromRenderableIndex(r)}if(e.wtViewport.columnsRenderCalculator){const r=e.wtTable.getFirstRenderedColumn();if(r!==-1)return this.hot.columnIndexMapper.getVisualFromRenderableIndex(r)}return-1}getLastVisibleColumn(){const e=this.hot.view._wt;if(e.wtViewport.columnsVisibleCalculator){const r=e.wtTable.getLastVisibleColumn();if(r!==-1)return this.hot.columnIndexMapper.getVisualFromRenderableIndex(r)}if(e.wtViewport.columnsRenderCalculator){const r=e.wtTable.getLastRenderedColumn();if(r!==-1)return this.hot.columnIndexMapper.getVisualFromRenderableIndex(r)}return-1}findColumnsWhereHeaderWasChanged(){const e=this.hot.getColHeader();return Cn(e,(n,i,s)=>{const o=Lg(this,lu).length;return(o-1<s||Lg(this,lu)[s]!==i)&&n.push(s),o-1<s?Lg(this,lu).push(i):Lg(this,lu)[s]=i,n},[])}clearCache(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];e.length?this.hot.batchExecution(()=>{j(e,r=>{this.columnWidthsMap.setValueAtIndex(r,null)})},!0):this.columnWidthsMap.clear()}isNeedRecalculate(){return!!Ni(this.columnWidthsMap.getValues().slice(0,this.measuredColumns),e=>e===null).length}destroy(){this.ghostTable.clean(),super.destroy()}}function Yce(){this.calculateVisibleColumnsWidth(),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllColumnsWidth()}function zce(){this.hot.view?this.recalculateAllColumnsWidth():setTimeout(()=>{this.hot&&this.recalculateAllColumnsWidth()},0)}function jce(t){const e=ht(t,r=>{let[,n]=r;return this.hot.toPhysicalColumn(this.hot.propToCol(n))});this.clearCache(Array.from(new Set(e)))}function NA(t,e,r){let n=t;return r&&(this.calculateColumnsWidth(e,void 0,!0),n=this.getColumnWidth(e,void 0,!1)),n}function Kce(){Bce(this,lu,this.hot.getColHeader())}function Xce(t){const e=Ni(t,n=>{var i;return He((i=n.address)===null||i===void 0?void 0:i.col)}),r=ht(e,n=>n.address.col);this.clearCache(Array.from(new Set(r)))}const kl={horizontal:"horizontal",vertical:"vertical"};function qce(t,e,r){let n,i,s;return e[0]===t[0]&&e[1]<t[1]?(s="left",n=r(e[0],e[1]),i=r(e[2],t[1]-1)):e[2]===t[2]&&e[0]===t[0]&&e[3]>t[3]?(s="right",n=r(e[0],t[3]+1),i=r(e[2],e[3])):e[0]<t[0]&&e[1]===t[1]?(s="up",n=r(e[0],e[1]),i=r(t[0]-1,e[3])):e[2]>t[2]&&e[1]===t[1]&&(s="down",n=r(t[2]+1,e[1]),i=r(e[2],e[3])),n&&n.normalize(),i&&i.normalize(),{directionOfDrag:s,startOfDragCoords:n,endOfDragCoords:i}}function Zce(t){const e={};return t===!0?(e.directions=Object.keys(kl),e.autoInsertRow=!0):at(t)?(He(t.autoInsertRow)?t.direction===kl.horizontal?e.autoInsertRow=!1:e.autoInsertRow=t.autoInsertRow:e.autoInsertRow=!1,He(t.direction)?e.directions=[t.direction]:e.directions=Object.keys(kl)):typeof t=="string"?(e.directions=[t],e.autoInsertRow=!0):(e.directions=[],e.autoInsertRow=!1),e}function xh(t,e){Jce(t,e),e.add(t)}function Jce(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Oc(t,e,r){return e=Qce(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qce(t){var e=eue(t,"string");return typeof e=="symbol"?e:String(e)}function eue(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function bh(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}$e.getSingleton().register("modifyAutofillRange");$e.getSingleton().register("beforeAutofill");$e.getSingleton().register("afterAutofill");const HA="autofill",tue=20,rue=["fillHandle"],nue="insert_row_below",iue=200;var FA=new WeakSet,LA=new WeakSet,$A=new WeakSet,BA=new WeakSet,WA=new WeakSet;class sue extends It{constructor(){super(...arguments),xh(this,WA),xh(this,BA),xh(this,$A),xh(this,LA),xh(this,FA),Oc(this,"addingStarted",!1),Oc(this,"mouseDownOnCellCorner",!1),Oc(this,"mouseDragOutside",!1),Oc(this,"handleDraggedCells",0),Oc(this,"directions",[]),Oc(this,"autoInsertRow",!1)}static get PLUGIN_KEY(){return HA}static get PLUGIN_PRIORITY(){return tue}static get SETTING_KEYS(){return[HA,...rue]}isEnabled(){return this.hot.getSettings().fillHandle}enablePlugin(){this.enabled||(this.mapSettings(),this.registerEvents(),this.addHook("afterOnCellCornerMouseDown",e=>bh(this,LA,aue).call(this,e)),this.addHook("afterOnCellCornerDblClick",e=>bh(this,FA,oue).call(this,e)),this.addHook("beforeOnCellMouseOver",(e,r)=>bh(this,$A,lue).call(this,r)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.clearMappedSettings(),super.disablePlugin()}getSelectionData(){const e=this.hot.getSelectedRangeLast(),{row:r,col:n}=e.getTopStartCorner(),{row:i,col:s}=e.getBottomEndCorner(),o=this.hot.runHooks("modifyCopyableRange",[{startRow:r,startCol:n,endRow:i,endCol:s}]),a=[],l=[],c=[];return j(o,u=>{for(let h=u.startRow;h<=u.endRow;h+=1)a.indexOf(h)===-1&&a.push(h);for(let h=u.startCol;h<=u.endCol;h+=1)l.indexOf(h)===-1&&l.push(h)}),j(a,u=>{const h=[];j(l,d=>{h.push(this.hot.getCopyableData(u,d))}),c.push(h)}),c}fillIn(){if(this.hot.selection.highlight.getFill().isEmpty())return!1;const[e,r,n,i]=this.hot.selection.highlight.getFill().getVisualCorners(),s=this.hot.getSelectedRangeLast(),o=s.getTopStartCorner(),a=s.getBottomEndCorner();this.resetSelectionOfDraggedArea();const l=[o.row,o.col,a.row,a.col],c=this.hot.runHooks("modifyAutofillRange",[Math.min(o.row,e),Math.min(o.col,r),Math.max(a.row,n),Math.max(a.col,i)],l),{directionOfDrag:u,startOfDragCoords:h,endOfDragCoords:d}=qce(l,c,(f,g)=>this.hot._createCellCoords(f,g));if(h&&h.row>-1&&h.col>-1){const f=this.getSelectionData(),g=s.clone(),m=this.hot._createCellRange(h,h,d),w=this.hot.runHooks("beforeAutofill",f,g,m,u);if(w===!1)return this.hot.selection.highlight.getFill().clear(),this.hot.render(),!1;let C=w;const S=w;if(["up","left"].indexOf(u)>-1&&!(S.length===1&&S[0].length===0))if(C=[],u==="up"){const v=d.row-h.row+1,T=v%S.length;for(let A=0;A<v;A++)C.push(S[(A+(S.length-T))%S.length])}else{const v=d.col-h.col+1,T=v%S[0].length;for(let A=0;A<S.length;A++){C.push([]);for(let M=0;M<v;M++)C[A].push(S[A][(M+(S[A].length-T))%S[A].length])}}this.hot.populateFromArray(h.row,h.col,C,d.row,d.col,`${this.pluginName}.fill`,null),this.setSelection(c),this.hot.runHooks("afterAutofill",C,g,m,u),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 r=this.hot.getSelectedRangeLast(),n=r.getBottomEndCorner();let i=e;if(this.directions.includes(kl.vertical)&&this.directions.includes(kl.horizontal)){const s=r.getTopStartCorner();(n.col<=e.col||s.col>=e.col)&&(i=this.hot._createCellCoords(n.row,e.col)),(n.row<e.row||s.row>e.row)&&(i=this.hot._createCellCoords(e.row,n.col))}else if(this.directions.includes(kl.vertical))i=this.hot._createCellCoords(e.row,n.col);else if(this.directions.includes(kl.horizontal))i=this.hot._createCellCoords(n.row,e.col);else return;return this.reduceSelectionAreaIfNeeded(i)}showBorder(e){const r=this.getCoordsOfDragAndDropBorders(e);r&&this.redrawBorders(r)}addRow(){this.hot._registerTimeout(()=>{this.hot.alter(nue,void 0,1,`${this.pluginName}.fill`),this.addingStarted=!1},iue)}addNewRowIfNeeded(){if(!this.hot.selection.highlight.getFill().isEmpty()&&this.addingStarted===!1&&this.autoInsertRow){const e=this.hot.getSelectedLast(),r=this.hot.selection.highlight.getFill().getVisualCorners(),n=this.hot.countRows();e[2]<n-1&&r[2]===n-1&&(this.addingStarted=!0,this.addRow())}}getIndexOfLastAdjacentFilledInRow(e){const r=this.hot.getData(),n=this.hot.countRows();let i;for(let s=e[2]+1;s<n;s++){for(let l=e[1];l<=e[3];l++)if(r[s][l])return-1;const o=r[s][e[1]-1],a=r[s][e[3]+1];(!!o||!!a)&&(i=s)}return i}addSelectionFromStartAreaToSpecificRowIndex(e,r){this.hot.selection.highlight.getFill().clear().add(this.hot._createCellCoords(e[0],e[1])).add(this.hot._createCellCoords(r,e[3])).commit()}setSelection(e){this.hot.selectCell(...ht(e,r=>Math.max(r,0)),!1,!1)}selectAdjacent(){const e=this.hot.getSelectedLast(),r=this.getIndexOfLastAdjacentFilledInRow(e);return r===-1||r===void 0?!1:(this.addSelectionFromStartAreaToSpecificRowIndex(e,r),!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:r}=this.hot.rootDocument,n=Wr(this.hot.table).top-(this.hot.rootWindow.pageYOffset||r.scrollTop)+cr(this.hot.table),i=Wr(this.hot.table).left-(this.hot.rootWindow.pageXOffset||r.scrollLeft)+Ht(this.hot.table);return e.clientY>n&&e.clientX<=i}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mouseup",()=>bh(this,BA,cue).call(this)),this.eventManager.addEventListener(e,"mousemove",r=>bh(this,WA,uue).call(this,r))}clearMappedSettings(){this.directions.length=0,this.autoInsertRow=!1}mapSettings(){const e=Zce(this.hot.getSettings().fillHandle);this.directions=e.directions,this.autoInsertRow=e.autoInsertRow}destroy(){super.destroy()}}function oue(){this.selectAdjacent()&&this.fillIn()}function aue(){this.handleDraggedCells=1,this.mouseDownOnCellCorner=!0}function lue(t){this.mouseDownOnCellCorner&&!this.hot.view.isMouseDown()&&this.handleDraggedCells&&(this.handleDraggedCells+=1,this.showBorder(t),this.addNewRowIfNeeded())}function cue(){this.handleDraggedCells&&(this.handleDraggedCells>1&&this.fillIn(),this.handleDraggedCells=0,this.mouseDownOnCellCorner=!1)}function uue(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 $g(t,e){hue(t,e),e.add(t)}function hue(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function dl(t,e,r){return e=due(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function due(t){var e=fue(t,"string");return typeof e=="symbol"?e:String(e)}function fue(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Eh(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}const Bg="autoRowSize",gue=40,mue="autoRowSize";var VA=new WeakSet,Pv=new WeakSet,UA=new WeakSet,GA=new WeakSet;class Cd extends It{static get PLUGIN_KEY(){return Bg}static get PLUGIN_PRIORITY(){return gue}static get SETTING_KEYS(){return!0}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 500}constructor(e){super(e),$g(this,GA),$g(this,UA),$g(this,Pv),$g(this,VA),dl(this,"headerHeight",null),dl(this,"ghostTable",new yL(this.hot)),dl(this,"samplesGenerator",new xL((r,n)=>{if(r>=0&&n>=0&&this.hot.getCellMeta(r,n).hidden)return!1;let i;return r>=0?i=this.hot.getDataAtCell(r,n):r===-1&&(i=this.hot.getColHeader(n)),{value:i}})),dl(this,"firstCalculation",!0),dl(this,"inProgress",!1),dl(this,"measuredRows",0),dl(this,"rowHeightsMap",new Ka),this.hot.rowIndexMapper.registerMap(mue,this.rowHeightsMap),this.addHook("beforeRowResize",(r,n,i)=>Eh(this,Pv,YA).call(this,r,n,i))}isEnabled(){const e=this.hot.getSettings()[Bg];return e===!0||at(e)}enablePlugin(){var e=this;this.enabled||(this.setSamplingOptions(),this.addHook("afterLoadData",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Eh(e,UA,wue).call(e,...n)}),this.addHook("beforeChangeRender",r=>Eh(this,GA,vue).call(this,r)),this.addHook("beforeColumnResize",()=>this.recalculateAllRowsHeight()),this.addHook("beforeViewRender",r=>Eh(this,VA,pue).call(this,r)),this.addHook("modifyRowHeight",(r,n)=>this.getRowHeight(n,r)),this.addHook("modifyColumnHeaderHeight",()=>this.getColumnHeaderHeight()),super.enablePlugin())}disablePlugin(){this.headerHeight=null,super.disablePlugin(),this.addHook("beforeRowResize",(e,r,n)=>Eh(this,Pv,YA).call(this,e,r,n))}calculateRowsHeight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countRows()-1},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{from:0,to:this.hot.countCols()-1},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=typeof e=="number"?{from:e,to:e}:e,s=typeof r=="number"?{from:r,to:r}:r;if(this.hot.getColHeader(0)!==null){const o=this.samplesGenerator.generateRowSamples(-1,s);this.ghostTable.addColumnHeadersRow(o.get(-1))}Ue(i.from,i.to,o=>{if(n||this.rowHeightsMap.getValueAtIndex(o)===null){const a=this.samplesGenerator.generateRowSamples(o,s);j(a,l=>{let[c,u]=l;return this.ghostTable.addRow(c,u)})}}),this.ghostTable.rows.length&&(this.hot.batchExecution(()=>{this.ghostTable.getHeights((o,a)=>{o<0?this.headerHeight=a:this.rowHeightsMap.setValueAtIndex(this.hot.toPhysicalRow(o),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},r=0;const n=this.hot.countRows()-1;let i=null;this.inProgress=!0;const s=()=>{if(!this.hot){Sm(i),this.inProgress=!1;return}this.calculateRowsHeight({from:r,to:Math.min(r+Cd.CALCULATION_STEP,n)},e),r=r+Cd.CALCULATION_STEP+1,r<n?i=Uy(s):(Sm(i),this.inProgress=!1,this.hot.view.adjustElementsSize(!0),this.hot.view._wt.wtOverlays.inlineStartOverlay.needFullRender&&this.hot.view._wt.wtOverlays.inlineStartOverlay.clone.draw())},o=this.getSyncCalculationLimit();this.firstCalculation&&o>=0&&(this.calculateRowsHeight({from:0,to:o},e),this.firstCalculation=!1,r=o+1),r<n?s():(this.inProgress=!1,this.hot.view.adjustElementsSize(!1))}setSamplingOptions(){const e=this.hot.getSettings()[Bg],r=e&&lr(e,"samplingRatio")?e.samplingRatio:void 0,n=e&&lr(e,"allowSampleDuplicates")?e.allowSampleDuplicates:void 0;r&&!isNaN(r)&&this.samplesGenerator.setSampleCount(parseInt(r,10)),n&&this.samplesGenerator.setAllowDuplicates(n)}recalculateAllRowsHeight(){Kl(this.hot.view._wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllRowsHeight())}getSyncCalculationLimit(){const e=this.hot.getSettings()[Bg];let r=Cd.SYNC_CALCULATION_LIMIT;const n=this.hot.countRows()-1;return at(e)&&(r=e.syncLimit,aH(r)?r=UH(n,r):r>>=0),Math.min(r,n)}getRowHeight(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;const n=e<0?this.headerHeight:this.rowHeightsMap.getValueAtIndex(this.hot.toPhysicalRow(e));let i=r;return n!==null&&n>(r||0)&&(i=n),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:r,to:n}=typeof e=="number"?{from:e,to:e}:e;this.hot.batchExecution(()=>{Ue(Math.min(r,n),Math.max(r,n),i=>{this.rowHeightsMap.setValueAtIndex(i,null)})},!0)}isNeedRecalculate(){return!!Ni(this.rowHeightsMap.getValues().slice(0,this.measuredRows),e=>e===null).length}destroy(){this.ghostTable.clean(),super.destroy()}}function pue(){const t=this.hot.renderCall,e=this.hot.getSettings().fixedRowsBottom,r=this.getFirstVisibleRow(),n=this.getLastVisibleRow();if(!(r===-1||n===-1)){if(this.calculateRowsHeight({from:r,to:n},void 0,t),e){const i=this.hot.countRows()-1;this.calculateRowsHeight({from:i-e,to:i})}this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllRowsHeight()}}function YA(t,e,r){let n=t;return r&&(this.calculateRowsHeight(e,void 0,!0),n=this.getRowHeight(e)),n}function wue(){this.hot.view?this.recalculateAllRowsHeight():this.hot._registerTimeout(()=>{this.hot&&this.recalculateAllRowsHeight()})}function vue(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:Cue,getListWithRemovedItems:Sue}=MF("physicallyIndexed");class yue extends uc{constructor(){super(e=>e)}insert(e,r){const n=wx(this.indexedValues,r);this.indexedValues=Cue(n,e,r,this.initValueOrFn),super.insert(e,r)}remove(e){const r=Sue(this.indexedValues,e);this.indexedValues=px(r,e),super.remove(e)}}const xue=yue,{getListWithInsertedItems:bue,getListWithRemovedItems:Eue}=MF("physicallyIndexed");class Rue extends uc{constructor(){super(e=>e)}insert(e,r){this.indexedValues=bue(this.indexedValues,e,r,(n,i)=>this.getNextValue(i)),super.insert(e,r)}remove(e){this.indexedValues=Eue(this.indexedValues,e),super.remove(e)}getNextValue(e){return Math.max(...this.getValues())+1+e}}const Tue=Rue;function _ue(t,e){Aue(t,e),e.add(t)}function Aue(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Mue(t,e,r){return e=Oue(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Oue(t){var e=Iue(t,"string");return typeof e=="symbol"?e:String(e)}function Iue(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Pue(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}const Dv="bindRowsWithHeaders",Due=210,kue="loose",Nue=new Map([["loose",xue],["strict",Tue]]);var zA=new WeakSet;class Hue extends It{constructor(){super(...arguments),_ue(this,zA),Mue(this,"headerIndexes",null)}static get PLUGIN_KEY(){return Dv}static get PLUGIN_PRIORITY(){return Due}isEnabled(){return!!this.hot.getSettings()[Dv]}enablePlugin(){if(this.enabled)return;let e=this.hot.getSettings()[Dv];typeof e!="string"&&(e=kue);const r=Nue.get(e);this.headerIndexes=this.hot.rowIndexMapper.registerMap("bindRowsWithHeaders",new r),this.addHook("modifyRowHeader",n=>Pue(this,zA,Fue).call(this,n)),super.enablePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("bindRowsWithHeaders"),super.disablePlugin()}destroy(){super.destroy()}}function Fue(t){return this.headerIndexes.getValueAtIndex(this.hot.toPhysicalRow(t))}function Wg(t,e){RL(t,e),e.add(t)}function Lue(t,e,r){RL(t,e),e.set(t,r)}function RL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jA(t,e,r){return e=$ue(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $ue(t){var e=Bue(t,"string");return typeof e=="symbol"?e:String(e)}function Bue(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function KA(t,e){var r=TL(t,e,"get");return Wue(t,r)}function Wue(t,e){return e.get?e.get.call(t):e.value}function Vg(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function kv(t,e,r){var n=TL(t,e,"set");return Vue(t,n,r),r}function TL(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function Vue(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}const H0="collapsibleColumns",Uue=290,Gue=["nestedHeaders"],Ru="collapsibleIndicator",XA=H0,qA=new Map([["collapse",{hideColumn:!0,beforeHook:"beforeColumnCollapse",afterHook:"afterColumnCollapse"}],["expand",{hideColumn:!1,beforeHook:"beforeColumnExpand",afterHook:"afterColumnExpand"}]]);var Ic=new WeakMap,ZA=new WeakSet,JA=new WeakSet,QA=new WeakSet,eM=new WeakSet;class Yue extends It{constructor(){super(...arguments),Wg(this,eM),Wg(this,QA),Wg(this,JA),Wg(this,ZA),jA(this,"nestedHeadersPlugin",null),jA(this,"headerStateManager",null),Lue(this,Ic,{writable:!0,value:null})}static get PLUGIN_KEY(){return H0}static get PLUGIN_PRIORITY(){return Uue}static get PLUGIN_DEPS(){return["plugin:NestedHeaders"]}static get SETTING_KEYS(){return[H0,...Gue]}isEnabled(){return!!this.hot.getSettings()[H0]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:r}=this.hot.getSettings();r||Ft("You need to configure the Nested Headers plugin in order to use collapsible headers."),kv(this,Ic,this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName,"hiding")),this.nestedHeadersPlugin=this.hot.getPlugin("nestedHeaders"),this.headerStateManager=this.nestedHeadersPlugin.getStateManager(),this.addHook("init",()=>Vg(this,QA,Kue).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Vg(e,eM,Xue).call(e,...i)}),this.addHook("afterGetColHeader",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Vg(e,ZA,zue).call(e,...i)}),this.addHook("beforeOnCellMouseDown",(n,i,s)=>Vg(this,JA,jue).call(this,n,i,s)),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(r=>({collapsible:r.origColspan>1})):Array.isArray(e)&&(this.headerStateManager.mapState(()=>({collapsible:!1})),this.headerStateManager.mergeStateWith(e))}super.updatePlugin()}}disablePlugin(){this.hot.columnIndexMapper.unregisterMap(this.pluginName),kv(this,Ic,null),this.nestedHeadersPlugin=null,this.unregisterShortcuts(),this.clearButtons(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{var e;const{row:r,col:n}=this.hot.getSelectedRangeLast().highlight,{collapsible:i,isCollapsed:s,columnIndex:o}=(e=this.headerStateManager.getHeaderTreeNodeData(r,n))!==null&&e!==void 0?e:{};!i||(s?this.expandSection({row:r,col:o}):this.collapseSection({row:r,col:o}))},runOnlyIf:()=>{var e;return(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight.isHeader()},group:XA})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(XA)}clearButtons(){if(!this.hot.view)return;const e=this.hot.view._wt.getSetting("columnHeaders").length,r=this.hot.view._wt.wtTable.THEAD,n=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,s=function(o){o&&o.parentNode.removeChild(o)};Ue(0,e-1,o=>{const a=r.childNodes[o],l=n.childNodes[o],c=i?i.childNodes[o]:null;Ue(0,a.childNodes.length-1,u=>{let h=a.childNodes[u].querySelector(`.${Ru}`);s(h),l&&l.childNodes[u]&&(h=l.childNodes[u].querySelector(`.${Ru}`),s(h)),i&&c&&c.childNodes[u]&&(h=c.childNodes[u].querySelector(`.${Ru}`),s(h))})})}expandSection(e){this.toggleCollapsibleSection([e],"expand")}collapseSection(e){this.toggleCollapsibleSection([e],"collapse")}toggleAllCollapsibleSections(e){const r=this.headerStateManager.mapNodes(n=>{const{collapsible:i,origColspan:s,headerLevel:o,columnIndex:a,isCollapsed:l}=n;if(i===!0&&s>1&&(l&&e==="expand"||!l&&e==="collapse"))return{row:this.headerStateManager.levelToRowCoords(o),col:a}});this.toggleCollapsibleSection(r,e)}collapseAll(){this.toggleAllCollapsibleSections("collapse")}expandAll(){this.toggleAllCollapsibleSections("expand")}toggleCollapsibleSection(e,r){if(!qA.has(r))throw new Error(`Unsupported action is passed (${r}).`);if(!Array.isArray(e))return;const n=Ni(e,d=>{let{row:f}=d;return f<0});let i=n.length>0;j(n,d=>{var f;let{row:g,col:m}=d;const{collapsible:w,isCollapsed:C}=(f=this.headerStateManager.getHeaderSettings(g,m))!==null&&f!==void 0?f:{};if(!w||C&&r==="collapse"||!C&&r==="expand")return i=!1,!1});const s=[],o=[];i&&j(n,d=>{let{row:f,col:g}=d;const{colspanCompensation:m,affectedColumns:w,rollbackModification:C}=this.headerStateManager.triggerNodeModification(r,f,g);m>0&&(o.push(...w),s.push(C))});const a=this.getCollapsedColumns();let l=[];r==="collapse"?l=sH([...a,...o]):r==="expand"&&(l=Ni(a,d=>!o.includes(d)));const c=qA.get(r);if(this.hot.runHooks(c.beforeHook,a,l,i)===!1){j(s,d=>{d()});return}this.hot.batchExecution(()=>{j(o,d=>{KA(this,Ic).setValueAtIndex(this.hot.toPhysicalColumn(d),c.hideColumn)})},!0);const h=this.getCollapsedColumns().length!==a.length;this.hot.runHooks(c.afterHook,a,l,i,h),this.hot.render(),this.hot.view.adjustElementsSize(!0)}getCollapsedColumns(){return KA(this,Ic).getHiddenIndexes()}destroy(){kv(this,Ic,null),super.destroy()}}function zue(t,e,r){var n;const{collapsible:i,origColspan:s,isCollapsed:o}=(n=this.headerStateManager.getHeaderSettings(r,t))!==null&&n!==void 0?n:{},a=i&&s>1&&t>=this.hot.getSettings().fixedColumnsStart,l=this.hot.getSettings().ariaTags;let c=e.querySelector(`.${Ru}`);if(Uu(e,[Pi("")[0]]),a)c||(c=this.hot.rootDocument.createElement("div"),be(c,Ru),e.querySelector("div:first-child").appendChild(c)),rt(c,["collapsed","expanded"]),o?(be(c,"collapsed"),jl(c,"+"),l&&qe(e,...Pi(!1))):(be(c,"expanded"),jl(c,"-"),l&&qe(e,...Pi(!0))),l&&qe(c,...Yo());else{var u;(u=c)===null||u===void 0||u.remove()}}function jue(t,e){Je(t.target,Ru)&&(Je(t.target,"expanded")?(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"collapse")):Je(t.target,"collapsed")&&(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"expand")),vs(t))}function Kue(){this.updatePlugin()}function Xue(t,e){e||this.updatePlugin()}function fl(t,e,r){return e=que(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function que(t){var e=Zue(t,"string");return typeof e=="symbol"?e:String(e)}function Zue(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Jue=["sortEmptyCells","indicator","headerAction","compareFunctionFactory"],Que=!1,ehe=!0,the=!0;class rhe{constructor(e,r){fl(this,"hot",void 0),fl(this,"sortingStates",new Dp),fl(this,"sortEmptyCells",Que),fl(this,"indicator",ehe),fl(this,"headerAction",the),fl(this,"compareFunctionFactory",void 0),fl(this,"mapName",void 0),this.hot=e,this.mapName=r,this.hot.columnIndexMapper.registerMap(r,this.sortingStates)}updateAllColumnsProperties(e){!at(e)||dt(e,(r,n)=>{Jue.includes(n)&&(this[n]=r)})}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 r;return(r=this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))===null||r===void 0?void 0:r.sortOrder}getIndexOfColumnInSortQueue(e){return e=this.hot.toPhysicalColumn(e),this.sortingStates.getEntries().findIndex(r=>{let[n]=r;return n===e})}getNumberOfSortedColumns(){return this.sortingStates.getLength()}isListOfSortedColumnsEmpty(){return this.getNumberOfSortedColumns()===0}isColumnSorted(e){return at(this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))}getSortStates(){return this.sortingStates===null?[]:this.sortingStates.getEntries().map(r=>{let[n,i]=r;return yt({column:this.hot.toVisualColumn(n)},i)})}getColumnSortState(e){const r=this.getSortOrderOfColumn(e);if(He(r))return{column:e,sortOrder:r}}setSortStates(e){this.sortingStates.clear();for(let r=0;r<e.length;r+=1)this.sortingStates.setValueAtIndex(this.hot.toPhysicalColumn(e[r].column),{sortOrder:e[r].sortOrder})}destroy(){this.hot.columnIndexMapper.unregisterMap(this.mapName),this.sortingStates=null}}const Om="asc",Im="desc",_L="colHeader";function nhe(t){if(at(t)===!1)return!1;const{column:e,sortOrder:r}=t;return Number.isInteger(e)&&[Om,Im].includes(r)}function ihe(t){if(t.some(r=>nhe(r)===!1))return!1;const e=t.map(r=>{let{column:n}=r;return n});return new Set(e).size===e.length}function tM(t){if(t!==Im)return t===Om?Im:Om}function AL(t){return t.querySelector(`.${_L}`)}function ML(t,e){if(t<0||!e.parentNode)return!1;const r=e.parentNode.parentNode.childNodes;return Array.from(r).indexOf(e.parentNode)-r.length===-1}function cE(t,e,r){return t===-1&&e>=0&&Xl(r)===!1}const she="ascending",ohe="descending",OL="indicatorDisabled",IL="columnSorting",PL="sortAction",DL=new Map([[Om,she],[Im,ohe]]);function ahe(t,e,r,n){const i=[IL];if(n&&i.push(PL),r===!1)return i.push(OL),i;const s=t.getSortOrderOfColumn(e);return He(s)&&i.push(DL.get(s)),i}function lhe(){return Array.from(DL.values()).concat(PL,OL,IL)}function kL(t,e,r){const n=e.locale;return function(i,s){const{sortEmptyCells:o}=r;return typeof i=="string"&&(i=i.toLocaleLowerCase(n)),typeof s=="string"&&(s=s.toLocaleLowerCase(n)),i===s?Ks:kr(i)?kr(s)?Ks:o&&t==="asc"?or:ar:kr(s)?o&&t==="asc"?ar:or:isNaN(i)&&!isNaN(s)?t==="asc"?ar:or:!isNaN(i)&&isNaN(s)||(isNaN(i)||isNaN(s)||(i=parseFloat(i),s=parseFloat(s)),i<s)?t==="asc"?or:ar:i>s?t==="asc"?ar:or:Ks}}const NL="default";function che(t,e,r){return function(n,i){const s=parseFloat(n),o=parseFloat(i),{sortEmptyCells:a}=r;if(s===o||isNaN(s)&&isNaN(o))return Ks;if(a){if(kr(n))return t==="asc"?or:ar;if(kr(i))return t==="asc"?ar:or}return isNaN(s)?ar:isNaN(o)?or:s<o?t==="asc"?or:ar:s>o?t==="asc"?ar:or:Ks}}const uhe="numeric";function hhe(t,e,r){const n=e.checkedTemplate,i=e.uncheckedTemplate,{sortEmptyCells:s}=r;return function(o,a){const l=kr(o),c=kr(a),u=l?i:o,h=c?i:a,d=u===i||u===n,f=h===i||h===n;if(s===!1){if(l&&c===!1)return ar;if(l===!1&&c)return or}return d===!1&&f?t==="asc"?or:ar:d&&f===!1?t==="asc"?ar:or:d===!1&&f===!1?kL(t,e,r)(o,a):u===i&&h===n?t==="asc"?or:ar:u===n&&h===i?t==="asc"?ar:or:Ks}}const dhe="checkbox";function fhe(t,e,r){return function(n,i){const{sortEmptyCells:s}=r;if(n===i)return Ks;if(kr(n))return kr(i)?Ks:s&&t==="asc"?or:ar;if(kr(i))return s&&t==="asc"?ar:or;const o=e.dateFormat,a=ye(n,o),l=ye(i,o);return a.isValid()?l.isValid()?l.isAfter(a)?t==="asc"?or:ar:l.isBefore(a)?t==="asc"?ar:or:Ks:or:ar}}const ghe="date",{register:Bp,getItem:rM,hasItem:mhe}=Cs("sorting.compareFunctionFactory"),{register:HL,getItem:phe}=Cs("sorting.mainSortComparator");function FL(t){return mhe(t)?rM(t):rM(NL)}Bp(uhe,che);Bp(dhe,hhe);Bp(ghe,fhe);Bp(NL,kL);const Ks=0,or=-1,ar=1;function whe(t,e){const r=phe(e);for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s];t.sort(r(...i))}function vhe(t,e){return function(r,n){const[,...i]=r,[,...s]=n;return function(a){const l=t[a],c=e[a],u=i[a],h=s[a],d=c.columnSorting;return(d.compareFunctionFactory?d.compareFunctionFactory:FL(c.type))(l,c,d)(u,h)}(0)}}function Ug(t,e){Che(t,e),e.add(t)}function Che(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Gg(t,e,r){return e=She(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function She(t){var e=yhe(t,"string");return typeof e=="symbol"?e:String(e)}function yhe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function cu(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}const Pm="columnSorting",xhe=50,Dm="append",bhe="replace",nM=Pm;HL(Pm,vhe);$e.getSingleton().register("beforeColumnSort");$e.getSingleton().register("afterColumnSort");var F0=new WeakSet,iM=new WeakSet,sM=new WeakSet,oM=new WeakSet;class LL extends It{constructor(){super(...arguments),Ug(this,oM),Ug(this,sM),Ug(this,iM),Ug(this,F0),Gg(this,"columnStatesManager",null),Gg(this,"columnMetaCache",null),Gg(this,"pluginKey",Pm),Gg(this,"indexesSequenceCache",null)}static get PLUGIN_KEY(){return Pm}static get PLUGIN_PRIORITY(){return xhe}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){var e=this;this.enabled||(this.columnStatesManager=new rhe(this.hot,`${this.pluginKey}.sortingStates`),this.columnMetaCache=new Ka(r=>{let n=this.hot.toVisualColumn(r);return n===null&&(n=r),this.getMergedPluginSettings(n)}),this.hot.columnIndexMapper.registerMap(`${this.pluginKey}.columnMeta`,this.columnMetaCache),this.addHook("afterGetColHeader",(r,n)=>cu(this,iM,Ehe).call(this,r,n)),this.addHook("beforeOnCellMouseDown",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return cu(e,oM,The).call(e,...n)}),this.addHook("afterOnCellMouseDown",(r,n)=>this.onAfterOnCellMouseDown(r,n)),this.addHook("afterInit",()=>cu(this,F0,J1).call(this)),this.addHook("afterLoadData",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return cu(e,sM,Rhe).call(e,...n)}),this.hot.view&&cu(this,F0,J1).call(this),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){const e=(r,n)=>{const i=AL(n);ML(r,n)===!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 r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r&&this.hot.selection.isCellVisible(r)&&r.isHeader()},group:nM})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(nM)}sort(e){const r=this.getSortConfig(),n=this.getNormalizedSortConfigs(e),i=this.areValidSortConfigs(n);this.hot.runHooks("beforeColumnSort",r,n,i)!==!1&&(r.length===0&&this.indexesSequenceCache===null&&(this.indexesSequenceCache=this.hot.rowIndexMapper.registerMap(this.pluginKey,new OF),this.indexesSequenceCache.setValues(this.hot.rowIndexMapper.getIndexesSequence())),i&&(this.columnStatesManager.setSortStates(n),this.sortByPresetSortStates(n),this.saveAllSortSettings(n)),this.hot.runHooks("afterColumnSort",r,i?n:r,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 He(e)?this.columnStatesManager.getColumnSortState(e):this.columnStatesManager.getSortStates()}setSortConfig(e){const r=this.getNormalizedSortConfigs(e);this.areValidSortConfigs(r)&&this.columnStatesManager.setSortStates(r)}getNormalizedSortConfigs(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Array.isArray(e)?e.slice(0,1):[e]}areValidSortConfigs(e){const r=this.hot.countCols();return ihe(e)&&e.every(n=>{let{column:i}=n;return i<=r&&i>=0})}saveAllSortSettings(e){const r=this.columnStatesManager.getAllColumnsProperties(),n=i=>{let a=i,{column:s}=a,o=Sn(a,["column"]);return yt({column:this.hot.toPhysicalColumn(s)},o)};r.initialConfig=ht(e,n),this.hot.runHooks("persistentStateSave","columnSorting",r)}getAllSavedSortSettings(){const e={};this.hot.runHooks("persistentStateLoad","columnSorting",e);const r=e.value,n=i=>{let a=i,{column:s}=a,o=Sn(a,["column"]);return yt({column:this.hot.toVisualColumn(s)},o)};return He(r)&&Array.isArray(r.initialConfig)&&(r.initialConfig=ht(r.initialConfig,n)),r}getColumnNextConfig(e){const r=this.columnStatesManager.getSortOrderOfColumn(e);if(He(r)){const i=tM(r);return He(i)?{column:e,sortOrder:i}:void 0}const n=this.hot.countCols();if(Number.isInteger(e)&&e>=0&&e<n)return{column:e,sortOrder:tM()}}getNextSortConfig(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Dm;const n=this.columnStatesManager.getIndexOfColumnInSortQueue(e),i=n!==-1,s=this.getSortConfig(),o=this.getColumnNextConfig(e);if(i){if(Gt(o))return[...s.slice(0,n),...s.slice(n+1)];if(r===Dm)return[...s.slice(0,n),...s.slice(n+1),o];if(r===bhe)return[...s.slice(0,n),o,...s.slice(n+1)]}return He(o)?s.concat(o):s}getPluginColumnConfig(e){if(at(e)){const r=e[this.pluginKey];if(at(r))return r}return{}}getMergedPluginSettings(e){const r=this.hot.getSettings()[this.pluginKey],n=this.columnStatesManager.getAllColumnsProperties(),i=this.hot.getCellMeta(0,e),s=Object.getPrototypeOf(i);return Array.isArray(s.columns)?Object.assign(n,r,this.getPluginColumnConfig(s.columns[e])):Ut(s.columns)?Object.assign(n,r,this.getPluginColumnConfig(s.columns(e))):Object.assign(n,r)}getFirstCellSettings(e){const r=this.hot.getCellMeta(0,e),n=Object.create(r);return n[this.pluginKey]=this.columnMetaCache.getValueAtIndex(this.hot.toPhysicalColumn(e)),n}getNumberOfRowsToSort(e){const r=this.hot.getSettings();return r.maxRows<=e?r.maxRows:e-r.minSpareRows}sortByPresetSortStates(e){if(e.length===0){this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues());return}const r=[],n=this.hot.countRows(),i=c=>ht(e,u=>this.hot.getDataAtCell(c,u.column));for(let c=0;c<this.getNumberOfRowsToSort(n);c+=1)r.push([this.hot.toPhysicalRow(c)].concat(i(c)));const s=ht(r,c=>c[0]);whe(r,this.pluginKey,ht(e,c=>c.sortOrder),ht(e,c=>this.getFirstCellSettings(c.column)));for(let c=r.length;c<n;c+=1)r.push([c].concat(i(c)));const o=ht(r,c=>c[0]),a=new Map(ht(s,(c,u)=>[c,o[u]])),l=ht(this.hot.rowIndexMapper.getIndexesSequence(),c=>a.has(c)?a.get(c):c);this.hot.rowIndexMapper.setIndexesSequence(l)}sortBySettings(e){if(at(e)){this.columnStatesManager.updateAllColumnsProperties(e);const r=e.initialConfig;(Array.isArray(r)||at(r))&&this.sort(r)}else this.hot.render()}updateHeaderClasses(e){if(rt(e,lhe()),this.enabled!==!1){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];be(e,ahe(...n))}}onUpdateSettings(e){super.onUpdateSettings(),this.columnMetaCache!==null&&this.columnMetaCache.init(this.hot.columnIndexMapper.getNumberOfIndexes()),He(e[this.pluginKey])&&this.sortBySettings(e[this.pluginKey])}wasClickableHeaderClicked(e,r){return this.getFirstCellSettings(r)[this.pluginKey].headerAction&&Je(e.target,_L)}onAfterOnCellMouseDown(e,r){cE(r.row,r.col,e)!==!1&&this.wasClickableHeaderClicked(e,r.col)&&(this.hot.getShortcutManager().isCtrlPressed()&&(this.hot.deselectCell(),this.hot.selectColumns(r.col)),this.sort(this.getColumnNextConfig(r.col)))}destroy(){var e;(e=this.columnStatesManager)===null||e===void 0||e.destroy(),super.destroy()}}function J1(){const t=this.getAllSavedSortSettings();if(at(t))this.sortBySettings(t);else{const e=this.hot.getSettings()[this.pluginKey];this.sortBySettings(e)}}function Ehe(t,e){const r=AL(e);if(ML(t,e)===!1||r===null)return;const n=this.getFirstCellSettings(t)[this.pluginKey],i=n.indicator,s=n.headerAction;if(this.updateHeaderClasses(r,this.columnStatesManager,t,i,s),this.hot.getSettings().ariaTags){const o=this.columnStatesManager.getSortOrderOfColumn(t);qe(e,...uQ(o?`${o}ending`:"none"))}}function Rhe(t){t===!0&&this.hot.view&&cu(this,F0,J1).call(this)}function The(t,e,r,n){cE(e.row,e.col,t)!==!1&&this.wasClickableHeaderClicked(t,e.col)&&this.hot.getShortcutManager().isCtrlPressed()&&(n.column=!0)}function gl(t,e,r){return e=_he(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _he(t){var e=Ahe(t,"string");return typeof e=="symbol"?e:String(e)}function Ahe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Mhe{constructor(e,r){gl(this,"plugin",void 0),gl(this,"hot",void 0),gl(this,"endpoints",[]),gl(this,"settings",void 0),gl(this,"settingsType","array"),gl(this,"currentEndpoint",null),gl(this,"cellsToSetCache",[]),this.plugin=e,this.hot=this.plugin.hot,this.settings=r}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 r=[];let n=e;if(!n&&typeof this.settings=="function"){this.settingsType="function";return}return n||(n=this.settings),j(n,i=>{const s={};this.assignSetting(i,s,"ranges",[[0,this.hot.countRows()-1]]),this.assignSetting(i,s,"reversedRowCoords",!1),this.assignSetting(i,s,"destinationRow",new Error(`
  108. You must provide a destination row for the Column Summary plugin in order to work properly!
  109. `)),this.assignSetting(i,s,"destinationColumn",new Error(`
  110. You must provide a destination column for the Column Summary plugin in order to work properly!
  111. `)),this.assignSetting(i,s,"sourceColumn",i.destinationColumn),this.assignSetting(i,s,"type","sum"),this.assignSetting(i,s,"forceNumeric",!1),this.assignSetting(i,s,"suppressDataTypeErrors",!0),this.assignSetting(i,s,"customFunction",null),this.assignSetting(i,s,"readOnly",!0),this.assignSetting(i,s,"roundFloat",!1),r.push(s)}),r}assignSetting(e,r,n,i){if(n==="ranges"&&e[n]===void 0){r[n]=i;return}else if(n==="ranges"&&e[n].length===0)return;if(e[n]===void 0){if(i instanceof Error)throw i;r[n]=i}else n==="destinationRow"&&r.reversedRowCoords?r[n]=this.hot.countRows()-e[n]-1:r[n]=e[n]}resetSetupBeforeStructureAlteration(e,r,n){if(this.settingsType!=="function")return;const i=e.indexOf("row")>-1?"row":"col",s=this.getAllEndpoints();j(s,o=>{i==="row"&&o.destinationRow>=r&&(e==="insert_row"?o.alterRowOffset=n:e==="remove_row"&&(o.alterRowOffset=-1*n)),i==="col"&&o.destinationColumn>=r&&(e==="insert_col"?o.alterColumnOffset=n:e==="remove_col"&&(o.alterColumnOffset=-1*n))}),this.resetAllEndpoints(s,!1)}resetSetupAfterStructureAlteration(e,r,n,i,s){let o=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,c=this.getAllEndpoints(),u=e.indexOf("move_row")===0,h=r;j(c,d=>{a==="row"&&d.destinationRow>=h&&(d.alterRowOffset=l*n),a==="col"&&d.destinationColumn>=h&&(d.alterColumnOffset=l*n)}),this.resetAllEndpoints(c,!u),u?j(c,d=>{this.extendEndpointRanges(d,h,i[0],i.length),this.recreatePhysicalRanges(d),this.clearOffsetInformation(d)}):j(c,d=>{this.shiftEndpointCoordinates(d,h)}),o&&this.refreshAllEndpoints()}clearOffsetInformation(e){e.alterRowOffset=void 0,e.alterColumnOffset=void 0}extendEndpointRanges(e,r,n,i){j(e.ranges,s=>{s[1]&&(r>=s[0]&&r<=s[1]?n>s[1]?s[1]+=i:n<s[0]&&(s[0]-=i):n>=s[0]&&n<=s[1]&&(s[1]-=i,r<=s[0]&&(s[0]+=1,s[1]+=1)))})}recreatePhysicalRanges(e){const r=e.ranges,n=[],i=[];j(r,s=>{const o=[];if(s[1])for(let a=s[0];a<=s[1];a++)o.push(this.hot.toPhysicalRow(a));else o.push(this.hot.toPhysicalRow(s[0]));i.push(o)}),j(i,s=>{let o=[];j(s,(a,l)=>{l===0?o.push(a):s[l]!==s[l-1]+1&&(o.push(s[l-1]),n.push(o),o=[],o.push(a)),l===s.length-1&&(o.push(a),n.push(o))})}),e.ranges=n}shiftEndpointCoordinates(e,r){e.alterRowOffset&&e.alterRowOffset!==0?(e.destinationRow+=e.alterRowOffset||0,j(e.ranges,n=>{j(n,(i,s)=>{i>=r&&(n[s]+=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(),r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;e.some(i=>{const s=i.alterRowOffset||0,o=i.alterColumnOffset||0;return i.destinationRow+s>=this.hot.countRows()||i.destinationColumn+o>=this.hot.countCols()})||(this.cellsToSetCache=[],j(e,i=>{this.resetEndpointValue(i,r)}),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[])}refreshAllEndpoints(){this.cellsToSetCache=[],j(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 r=[];this.cellsToSetCache=[],j(e,(n,i,s)=>{`${n[2]||""}`!=`${n[3]}`&&j(this.getAllEndpoints(),(o,a)=>{this.hot.propToCol(s[i][1])===o.sourceColumn&&r.indexOf(a)===-1&&r.push(a)})}),j(r,n=>{this.refreshEndpoint(this.getEndpoint(n))}),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 r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const n=e.alterRowOffset||0,i=e.alterColumnOffset||0;this.cellsToSetCache.push([this.hot.toVisualRow(e.destinationRow+(r?n:0)),this.hot.toVisualColumn(e.destinationColumn+(r?i:0)),""])}setEndpointValue(e,r){let n=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 s=this.hot.toVisualRow(e.destinationRow);if(s!==null){const o=this.hot.getCellMeta(s,e.destinationColumn);(r==="init"||o.readOnly!==e.readOnly)&&(o.readOnly=e.readOnly,o.className="columnSummaryResult")}if((e.roundFloat===!0||Number.isInteger(e.roundFloat))&&!isNaN(e.result)){const o=e.roundFloat;let a=0;Number.isInteger(o)&&(a=Math.min(Math.max(0,o),100)),e.result=e.result.toFixed(a)}n?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(){Ft("One of the Column Summary plugins' destination points you provided is beyond the table boundaries!")}}const Ohe=Mhe;function Nv(t){return t==null||isNaN(t)}function Hv(t,e){Ihe(t,e),e.add(t)}function Ihe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Phe(t,e,r){return e=Dhe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Dhe(t){var e=khe(t,"string");return typeof e=="symbol"?e:String(e)}function khe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Fv(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}const Lv="columnSummary",Nhe=220;var aM=new WeakSet,lM=new WeakSet,cM=new WeakSet;class Hhe extends It{constructor(){super(...arguments),Hv(this,cM),Hv(this,lM),Hv(this,aM),Phe(this,"endpoints",null)}static get PLUGIN_KEY(){return Lv}static get PLUGIN_PRIORITY(){return Nhe}isEnabled(){return!!this.hot.getSettings()[Lv]}enablePlugin(){var e=this;this.enabled||(this.settings=this.hot.getSettings()[Lv],this.endpoints=new Ohe(this,this.settings),this.addHook("afterInit",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Fv(e,aM,Fhe).call(e,...n)}),this.addHook("afterChange",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Fv(e,lM,Lhe).call(e,...n)}),this.addHook("beforeCreateRow",(r,n,i)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_row",r,n,null,i)),this.addHook("beforeCreateCol",(r,n,i)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_col",r,n,null,i)),this.addHook("beforeRemoveRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.endpoints.resetSetupBeforeStructureAlteration("remove_row",...n)}),this.addHook("beforeRemoveCol",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.endpoints.resetSetupBeforeStructureAlteration("remove_col",...n)}),this.addHook("afterCreateRow",(r,n,i)=>this.endpoints.resetSetupAfterStructureAlteration("insert_row",r,n,null,i)),this.addHook("afterCreateCol",(r,n,i)=>this.endpoints.resetSetupAfterStructureAlteration("insert_col",r,n,null,i)),this.addHook("afterRemoveRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.endpoints.resetSetupAfterStructureAlteration("remove_row",...n)}),this.addHook("afterRemoveCol",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.endpoints.resetSetupAfterStructureAlteration("remove_col",...n)}),this.addHook("afterRowMove",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Fv(e,cM,$he).call(e,...n)}),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 r=0;return dt(e.ranges,n=>{r+=this.getPartialSum(n,e.sourceColumn)}),r}getPartialSum(e,r){let n=0,i=e[1]||e[0],s=null,o=0;do{if(s=this.getCellValue(i,r),s=Nv(s)?null:s,s!==null){const a=(`${s}`.split(".")[1]||[]).length||1;a>o&&(o=a)}n+=s||0,i-=1}while(i>=e[0]);return Math.round(n*iw(10,o))/iw(10,o)}calculateMinMax(e,r){let n=null;return dt(e.ranges,i=>{const s=this.getPartialMinMax(i,e.sourceColumn,r);if(n===null&&s!==null&&(n=s),s!==null)switch(r){case"min":n=Math.min(n,s);break;case"max":n=Math.max(n,s);break}}),n===null?"Not enough data":n}getPartialMinMax(e,r,n){let i=null,s=e[1]||e[0],o;do{if(o=this.getCellValue(s,r),o=Nv(o)?null:o,i===null)i=o;else if(o!==null)switch(n){case"min":i=Math.min(i,o);break;case"max":i=Math.max(i,o);break}s-=1}while(s>=e[0]);return i}countEmpty(e,r){let n,i=0,s=e[1]||e[0];do n=this.getCellValue(s,r),n=Nv(n)?null:n,n===null&&(i+=1),s-=1;while(s>=e[0]);return i}countEntries(e){let r=0;const n=e.ranges;return dt(n,i=>{const s=i[1]===void 0?1:i[1]-i[0]+1,o=this.countEmpty(i,e.sourceColumn);r+=s,r-=o}),r}calculateAverage(e){const r=this.calculateSum(e),n=this.countEntries(e);return r/n}getCellValue(e,r){const n=this.hot.toVisualRow(e),i=this.hot.toVisualColumn(r);let s=this.hot.getSourceDataAtCell(e,r),o="";if(n!==null&&i!==null&&(o=this.hot.getCellMeta(n,i).className||""),o.indexOf("columnSummaryResult")>-1)return null;if(this.endpoints.currentEndpoint.forceNumeric&&(typeof s=="string"&&(s=s.replace(/,/,".")),s=parseFloat(s)),isNaN(s)&&!this.endpoints.currentEndpoint.suppressDataTypeErrors)throw new Error(Pt`ColumnSummary plugin: cell at (${e}, ${r}) is not in a\x20
  112. numeric format. Cannot do the calculation.`);return s}}function Fhe(){this.endpoints.initEndpoints()}function Lhe(t,e){t&&e!=="ColumnSummary.reset"&&e!=="ColumnSummary.set"&&e!=="loadData"&&this.endpoints.refreshChangedEndpoints(t)}function $he(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 Pc(t,e,r){return e=Bhe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Bhe(t){var e=Whe(t,"string");return typeof e=="symbol"?e:String(e)}function Whe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class wu{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,r){Pc(this,"rootDocument",void 0),Pc(this,"isRtl",!1),Pc(this,"container",null),Pc(this,"editor",void 0),Pc(this,"editorStyle",void 0),Pc(this,"hidden",!0),this.rootDocument=e,this.isRtl=r,this.editor=this.createEditor(),this.editorStyle=this.editor.style,this.hide()}setPosition(e,r){this.editorStyle.left=`${e}px`,this.editorStyle.top=`${r}px`}setSize(e,r){if(e&&r){const n=this.getInputElement();n.style.width=`${e}px`,n.style.height=`${r}px`}}getSize(){return{width:Ht(this.getInputElement()),height:cr(this.getInputElement())}}resetSize(){const e=this.getInputElement();e.style.width="",e.style.height=""}setReadOnlyState(e){const r=this.getInputElement();r.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 r=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"")||"";this.getInputElement().value=r}getValue(){return this.getInputElement().value}isFocused(){return this.rootDocument.activeElement===this.getInputElement()}focus(){this.getInputElement().focus()}createEditor(){const e=this.rootDocument.createElement("div"),r=this.rootDocument.createElement("textarea");return e.style.display="none",this.container=this.rootDocument.createElement("div"),this.container.setAttribute("dir",this.isRtl?"rtl":"ltr"),be(this.container,wu.CLASS_EDITOR_CONTAINER),this.rootDocument.body.appendChild(this.container),be(e,wu.CLASS_EDITOR),be(r,wu.CLASS_INPUT),r.setAttribute("data-hot-input",!0),e.appendChild(r),this.container.appendChild(e),e}getInputElement(){return this.editor.querySelector(`.${wu.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 Vhe=wu;function $v(t,e,r){return e=Uhe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Uhe(t){var e=Ghe(t,"string");return typeof e=="symbol"?e:String(e)}function Ghe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Yhe=250,zhe=250;class $L{constructor(e){$v(this,"wasLastActionShow",!0),$v(this,"showDebounced",null),$v(this,"hidingTimer",null),this.updateDelay(e)}hide(){this.wasLastActionShow=!1,this.hidingTimer=setTimeout(()=>{this.wasLastActionShow===!1&&this.runLocalHooks("hide")},zhe)}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]:Yhe;this.showDebounced=By(r=>{this.wasLastActionShow&&this.runLocalHooks("show",r.from.row,r.from.col)},e)}destroy(){this.clearLocalHooks()}}Vt($L,Qn);const jhe=$L;function Khe(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ","")} ${e}`}function Xhe(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ","")} ${e}`}function ml(t,e){const r={};return j(t,n=>{n.forAll((i,s)=>{i>=0&&s>=0&&(r[i]||(r[i]=[]),r[i][s]=e(i,s))})}),r}function ha(t,e,r,n,i){j(t,s=>{s.forAll((o,a)=>{o>=0&&a>=0&&qhe(o,a,e,r,n,i)})})}function qhe(t,e,r,n,i,s){const o=i(t,e);let a=n;o.className&&(r==="vertical"?a=Khe(o.className,n):a=Xhe(o.className,n)),s(t,e,"className",a)}function xo(t){return`<span class="selected">${String.fromCharCode(10003)}</span>${t}`}function Ws(t,e){let r=!1;return Array.isArray(t)&&j(t,n=>(n.forAll((i,s)=>{if(i>=0&&s>=0&&e(i,s))return r=!0,!1}),r)),r}function Wp(t,e){const r={top:0,left:0};if(e!==t.ownerDocument){const{frameElement:n}=e.defaultView,{top:i,left:s}=n.getBoundingClientRect();r.top=i,r.left=s}return r}const ut="---------";function Zhe(){return{name:ut}}const Ai="alignment";function Jhe(){return{key:Ai,name(){return this.getTranslatedPhrase(Ux)},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:`${Ai}:left`,name(){let t=this.getTranslatedPhrase(Gx);return Ws(this.getSelectedRange(),(r,n)=>{const i=this.getCellMeta(r,n).className;if(i&&i.indexOf("htLeft")!==-1)return!0})&&(t=xo(t)),t},callback(){const t=this.getSelectedRange(),e=ml(t,(i,s)=>this.getCellMeta(i,s).className),r="horizontal",n="htLeft";this.runHooks("beforeCellAlignment",e,t,r,n),ha(t,r,n,(i,s)=>this.getCellMeta(i,s),(i,s,o,a)=>this.setCellMeta(i,s,o,a)),this.render()},disabled:!1},{key:`${Ai}:center`,name(){let t=this.getTranslatedPhrase(Yx);return Ws(this.getSelectedRange(),(r,n)=>{const i=this.getCellMeta(r,n).className;if(i&&i.indexOf("htCenter")!==-1)return!0})&&(t=xo(t)),t},callback(){const t=this.getSelectedRange(),e=ml(t,(i,s)=>this.getCellMeta(i,s).className),r="horizontal",n="htCenter";this.runHooks("beforeCellAlignment",e,t,r,n),ha(t,r,n,(i,s)=>this.getCellMeta(i,s),(i,s,o,a)=>this.setCellMeta(i,s,o,a)),this.render()},disabled:!1},{key:`${Ai}:right`,name(){let t=this.getTranslatedPhrase(zx);return Ws(this.getSelectedRange(),(r,n)=>{const i=this.getCellMeta(r,n).className;if(i&&i.indexOf("htRight")!==-1)return!0})&&(t=xo(t)),t},callback(){const t=this.getSelectedRange(),e=ml(t,(i,s)=>this.getCellMeta(i,s).className),r="horizontal",n="htRight";this.runHooks("beforeCellAlignment",e,t,r,n),ha(t,r,n,(i,s)=>this.getCellMeta(i,s),(i,s,o,a)=>this.setCellMeta(i,s,o,a)),this.render()},disabled:!1},{key:`${Ai}:justify`,name(){let t=this.getTranslatedPhrase(jx);return Ws(this.getSelectedRange(),(r,n)=>{const i=this.getCellMeta(r,n).className;if(i&&i.indexOf("htJustify")!==-1)return!0})&&(t=xo(t)),t},callback(){const t=this.getSelectedRange(),e=ml(t,(i,s)=>this.getCellMeta(i,s).className),r="horizontal",n="htJustify";this.runHooks("beforeCellAlignment",e,t,r,n),ha(t,r,n,(i,s)=>this.getCellMeta(i,s),(i,s,o,a)=>this.setCellMeta(i,s,o,a)),this.render()},disabled:!1},{name:ut},{key:`${Ai}:top`,name(){let t=this.getTranslatedPhrase(Kx);return Ws(this.getSelectedRange(),(r,n)=>{const i=this.getCellMeta(r,n).className;if(i&&i.indexOf("htTop")!==-1)return!0})&&(t=xo(t)),t},callback(){const t=this.getSelectedRange(),e=ml(t,(i,s)=>this.getCellMeta(i,s).className),r="vertical",n="htTop";this.runHooks("beforeCellAlignment",e,t,r,n),ha(t,r,n,(i,s)=>this.getCellMeta(i,s),(i,s,o,a)=>this.setCellMeta(i,s,o,a)),this.render()},disabled:!1},{key:`${Ai}:middle`,name(){let t=this.getTranslatedPhrase(Xx);return Ws(this.getSelectedRange(),(r,n)=>{const i=this.getCellMeta(r,n).className;if(i&&i.indexOf("htMiddle")!==-1)return!0})&&(t=xo(t)),t},callback(){const t=this.getSelectedRange(),e=ml(t,(i,s)=>this.getCellMeta(i,s).className),r="vertical",n="htMiddle";this.runHooks("beforeCellAlignment",e,t,r,n),ha(t,r,n,(i,s)=>this.getCellMeta(i,s),(i,s,o,a)=>this.setCellMeta(i,s,o,a)),this.render()},disabled:!1},{key:`${Ai}:bottom`,name(){let t=this.getTranslatedPhrase(qx);return Ws(this.getSelectedRange(),(r,n)=>{const i=this.getCellMeta(r,n).className;if(i&&i.indexOf("htBottom")!==-1)return!0})&&(t=xo(t)),t},callback(){const t=this.getSelectedRange(),e=ml(t,(i,s)=>this.getCellMeta(i,s).className),r="vertical",n="htBottom";this.runHooks("beforeCellAlignment",e,t,r,n),ha(t,r,n,(i,s)=>this.getCellMeta(i,s),(i,s,o,a)=>this.setCellMeta(i,s,o,a)),this.render()},disabled:!1}]}}}const Vp="clear_column";function Qhe(){return{key:Vp,name(){return this.getTranslatedPhrase(Mx)},callback(t,e){const r=e[0].start.col,n=e[0].end.col;this.countRows()&&this.populateFromArray(0,r,[[null]],Math.max(e[0].start.row,e[0].end.row),n,"ContextMenu.clearColumn")},disabled(){const t=this.getSelectedRangeLast();return!t||t.isSingleHeader()&&t.highlight.col<0?!0:!this.selection.isSelectedByColumnHeader()}}}const Rf="col_left";function ede(){return{key:Rf,name(){return this.getTranslatedPhrase(xx)},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 Tf="col_right";function tde(){return{key:Tf,name(){return this.getTranslatedPhrase(bx)},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 _f="make_read_only";function rde(){return{key:_f,name(){let t=this.getTranslatedPhrase(Ax);return Ws(this.getSelectedRange(),(r,n)=>this.getCellMeta(r,n).readOnly)&&(t=xo(t)),t},callback(){const t=this.getSelectedRange(),e=Ws(t,(r,n)=>this.getCellMeta(r,n).readOnly);j(t,r=>{r.forAll((n,i)=>{n>=0&&i>=0&&this.setCellMeta(n,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 Up="redo";function nde(){return{key:Up,name(){return this.getTranslatedPhrase(_x)},callback(){this.redo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isRedoAvailable()}}}const Af="remove_col";function ide(){return{key:Af,name(){const t=this.getSelected();let e=0;if(t)if(t.length>1)e=1;else{const[,r,,n]=t[0];r-n!==0&&(e=1)}return this.getTranslatedPhrase(Rx,e)},callback(){this.alter("remove_col",Yse(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 Gp="remove_row";function sde(){return{key:Gp,name(){const t=this.getSelected();let e=0;if(t)if(t.length>1)e=1;else{const[r,,n]=t[0];r-n!==0&&(e=1)}return this.getTranslatedPhrase(Ex,e)},callback(){this.alter("remove_row",zse(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 Yp="row_above";function ode(){return{key:Yp,name(){return this.getTranslatedPhrase(Sx)},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 zp="row_below";function ade(){return{key:zp,name(){return this.getTranslatedPhrase(yx)},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 Xd="no_items";function lde(){return{key:Xd,name(){return this.getTranslatedPhrase(Cx)},disabled:!0,isCommand:!1}}const jp="undo";function cde(){return{key:jp,name(){return this.getTranslatedPhrase(Tx)},callback(){this.undo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isUndoAvailable()}}}const ude=[Yp,zp,Rf,Tf,Vp,Gp,Af,jp,Up,_f,Ai,ut,Xd],hde={[ut]:Zhe,[Xd]:lde,[Yp]:ode,[zp]:ade,[Rf]:ede,[Tf]:tde,[Vp]:Qhe,[Gp]:sde,[Af]:ide,[jp]:cde,[Up]:nde,[_f]:rde,[Ai]:Jhe};function BL(){const t={};return dt(hde,(e,r)=>{t[r]=e()}),t}function dde(t){return{key:"commentsAddEdit",name(){var e;const r=(e=this.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r!=null&&r.isCell()&&t.getCommentAtCell(r.row,r.col)?this.getTranslatedPhrase(Bx):this.getTranslatedPhrase($x)},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 fde(t){return{key:"commentsRemove",name(){return this.getTranslatedPhrase(Wx)},callback(){this.getSelectedRangeLast().forAll((r,n)=>{r>=0&&n>=0&&t.removeCommentAtCell(r,n,!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 gde(t){return{key:"commentsReadOnly",name(){const e=this.getTranslatedPhrase(Vx);return Ws(this.getSelectedRange(),(n,i)=>t.getCommentMeta(n,i,L0))?xo(e):e},callback(){this.getSelectedRangeLast().forAll((r,n)=>{if(r>=0&&n>=0){const i=!!t.getCommentMeta(r,n,L0);t.updateCommentMeta(r,n,{[L0]:!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 As(t,e){WL(t,e),e.add(t)}function pl(t,e,r){WL(t,e),e.set(t,r)}function WL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function mde(t,e,r){return e=pde(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pde(t){var e=wde(t,"string");return typeof e=="symbol"?e:String(e)}function wde(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ms(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function Mo(t,e,r){var n=VL(t,e,"set");return vde(t,n,r),r}function vde(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function pt(t,e){var r=VL(t,e,"get");return Cde(t,r)}function VL(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function Cde(t,e){return e.get?e.get.call(t):e.value}const Sd="comments",Sde=60,bo="comment",ed="value",UL="style",L0="readOnly",Yg=Sd,Q1=`plugin:${Sd}`;var jt=new WeakMap,rs=new WeakMap,Kp=new WeakMap,$0=new WeakMap,km=new WeakMap,eS=new WeakMap,Nm=new WeakMap,uM=new WeakSet,hM=new WeakSet,dM=new WeakSet,fM=new WeakSet,gM=new WeakSet,mM=new WeakSet,pM=new WeakSet,wM=new WeakSet,vM=new WeakSet,CM=new WeakSet;class yde extends It{constructor(){super(...arguments),As(this,CM),As(this,vM),As(this,wM),As(this,pM),As(this,mM),As(this,gM),As(this,fM),As(this,dM),As(this,hM),As(this,uM),mde(this,"range",{}),pl(this,jt,{writable:!0,value:null}),pl(this,rs,{writable:!0,value:null}),pl(this,Kp,{writable:!0,value:!1}),pl(this,$0,{writable:!0,value:!1}),pl(this,km,{writable:!0,value:{}}),pl(this,eS,{writable:!0,value:null}),pl(this,Nm,{writable:!0,value:""})}static get PLUGIN_KEY(){return Sd}static get PLUGIN_PRIORITY(){return Sde}isEnabled(){return!!this.hot.getSettings()[Sd]}enablePlugin(){this.enabled||(pt(this,jt)||Mo(this,jt,new Vhe(this.hot.rootDocument,this.hot.isRtl())),pt(this,rs)||Mo(this,rs,new jhe(this.getDisplayDelaySetting())),this.addHook("afterContextMenuDefaultOptions",e=>this.addToContextMenu(e)),this.addHook("afterRenderer",(e,r,n,i,s,o)=>Ms(this,fM,Rde).call(this,e,o)),this.addHook("afterScroll",()=>Ms(this,CM,Ide).call(this)),this.addHook("afterBeginEditing",()=>this.hide()),this.addHook("afterDocumentKeyDown",e=>Ms(this,vM,Ode).call(this,e)),pt(this,rs).addLocalHook("hide",()=>this.hide()),pt(this,rs).addLocalHook("show",(e,r)=>this.showAtCell(e,r)),this.registerShortcuts(),this.registerListeners(),super.enablePlugin())}updatePlugin(){pt(this,rs).updateDelay(this.getDisplayDelaySetting()),super.updatePlugin()}disablePlugin(){this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=this.hot.getShortcutManager(),r=e.getContext("grid"),n=e.addContext(Q1);r.addShortcut({keys:[["Control","Alt","M"]],callback:()=>{const i=this.hot.getSelectedRangeLast();Mo(this,$0,!0),this.hot.scrollToFocusedCell(()=>{this.setRange(i),this.show(),this.focusEditor(),e.setActiveContextName(Q1),this.hot._registerTimeout(()=>{Mo(this,$0,!1)})})},stopPropagation:!0,runOnlyIf:()=>{var i;return((i=this.hot.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight.isCell())&&!pt(this,jt).isVisible()},group:Yg}),n.addShortcut({keys:[["Escape"]],callback:()=>{pt(this,jt).setValue(pt(this,Nm)),this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>{var i;return((i=this.hot.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight.isCell())&&pt(this,jt).isVisible()},group:Yg}),n.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())&&pt(this,jt).isVisible()},group:Yg})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(Yg)}registerListeners(){const{rootDocument:e}=this.hot,r=this.getEditorInputElement();this.eventManager.addEventListener(e,"mouseover",n=>Ms(this,hM,bde).call(this,n)),this.eventManager.addEventListener(e,"mousedown",n=>Ms(this,uM,xde).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>Ms(this,dM,Ede).call(this)),this.eventManager.addEventListener(r,"focus",()=>Ms(this,mM,_de).call(this)),this.eventManager.addEventListener(r,"blur",()=>Ms(this,gM,Tde).call(this)),this.eventManager.addEventListener(r,"mousedown",n=>Ms(this,pM,Ade).call(this,n)),this.eventManager.addEventListener(r,"mouseup",n=>Ms(this,wM,Mde).call(this,n))}setRange(e){this.range=e}clearRange(){this.range={}}targetIsCellWithComment(e){const r=zl(e.target,"TD","TBODY");return!!(r&&Je(r,"htCommentCell")&&zl(r,[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 r=pt(this,jt).getValue();let n="";e!=null?n=e:r!=null&&(n=r);const i=this.range.from.row,s=this.range.from.col;this.updateCommentMeta(i,s,{[ed]:n}),this.hot.render()}setCommentAtCell(e,r,n){this.setRange({from:this.hot._createCellCoords(e,r)}),this.setComment(n)}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,bo),e&&this.hot.render(),this.hide()}removeCommentAtCell(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;this.setRange({from:this.hot._createCellCoords(e,r)}),this.removeComment(n)}getComment(){const e=this.range.from.row,r=this.range.from.col;return this.getCommentMeta(e,r,ed)}getCommentAtCell(e,r){return this.getCommentMeta(e,r,ed)}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:r,col:n}}=this.range;if(r<0||r>this.hot.countSourceRows()-1||n<0||n>this.hot.countSourceCols()-1)return!1;const i=this.hot.getCellMeta(this.range.from.row,this.range.from.col);return pt(this,rs).cancelHiding(),pt(this,jt).setValue((e=i[bo]?i[bo][ed]:null)!==null&&e!==void 0?e:""),pt(this,jt).show(),this.refreshEditor(!0),!0}showAtCell(e,r){return this.setRange({from:this.hot._createCellCoords(e,r)}),this.show()}hide(){pt(this,jt).hide()}refreshEditor(){var e,r;if(!(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&(!this.range.from||!pt(this,jt).isVisible()))return;const{rowIndexMapper:i,columnIndexMapper:s}=this.hot,{row:o,col:a}=this.range.from;let l=i.getRenderableFromVisualIndex(o),c=s.getRenderableFromVisualIndex(a);const u=l===null;pt(this,jt).setPosition(0,0),l===null&&(l=i.getRenderableFromVisualIndex(i.getNearestNotHiddenIndex(o,-1))),c===null&&(c=s.getRenderableFromVisualIndex(s.getNearestNotHiddenIndex(a,-1)));const h=l===null,d=c===null;l=(e=l)!==null&&e!==void 0?e:0,c=(r=c)!==null&&r!==void 0?r:0;const{rootWindow:f,view:{_wt:g}}=this.hot,{wtTable:m}=g,w=g.getCell({row:l,col:c},!0),C=this.getCommentMeta(o,a,UL);C?pt(this,jt).setSize(C.width,C.height):pt(this,jt).resetSize();const S=d?0:m.getStretchedColumnWidth(c),v=u&&!h?cr(w):0,{left:T,top:A,width:M,height:E}=w.getBoundingClientRect(),{width:Y,height:D}=pt(this,jt).getSize(),{innerWidth:U,innerHeight:X}=this.hot.rootWindow,G=this.hot.rootDocument.documentElement;let ae=T+f.scrollX+S,ve=A+f.scrollY+v;this.hot.isRtl()&&(ae-=Y+S),this.hot.isLtr()&&T+M+Y>U?ae=T+f.scrollX-Y-1:this.hot.isRtl()&&ae<-(G.scrollWidth-G.clientWidth)&&(ae=T+f.scrollX+S+1),A+D>X&&(ve-=D-E+1),pt(this,jt).setPosition(ae,ve),pt(this,jt).setReadOnlyState(this.getCommentMeta(o,a,L0))}focusEditor(){pt(this,jt).focus()}updateCommentMeta(e,r,n){const i=this.hot.getCellMeta(e,r)[bo];let s;i?(s=Hn(i),Ap(s,n)):s=n,this.hot.setCellMeta(e,r,bo,s)}getCommentMeta(e,r,n){const i=this.hot.getCellMeta(e,r);if(!!i[bo])return i[bo][n]}addToContextMenu(e){e.items.push({name:ut},dde(this),fde(this),gde(this))}getDisplayDelaySetting(){const e=this.hot.getSettings()[Sd];if(at(e))return e.displayDelay}getEditorInputElement(){return pt(this,jt).getInputElement()}destroy(){pt(this,jt)&&pt(this,jt).destroy(),pt(this,rs)&&pt(this,rs).destroy(),super.destroy()}}function xde(t){if(!(!this.hot.view||!this.hot.view._wt)&&!pt(this,Kp)&&!this.targetIsCommentTextArea(t)){const e=zl(t.target,"TD","TBODY");let r=null;e&&(r=this.hot.getCoords(e)),(!e||this.range.from&&r&&(this.range.from.row!==r.row||this.range.from.col!==r.col))&&this.hide()}}function bde(t){const{rootDocument:e}=this.hot;if(!(pt(this,Kp)||pt(this,jt).isFocused()||Je(t.target,"wtBorder")||pt(this,eS)===t.target||!pt(this,jt)))if(Mo(this,eS,e.elementFromPoint(t.clientX,t.clientY)),this.targetIsCellWithComment(t)){const r=this.hot._createCellRange(this.hot.getCoords(t.target));pt(this,rs).show(r)}else Vl(t.target,e)&&!this.targetIsCommentTextArea(t)&&pt(this,rs).hide()}function Ede(){Mo(this,Kp,!1)}function Rde(t,e){e[bo]&&e[bo][ed]&&be(t,e.commentedCellClassName)}function Tde(){Mo(this,Nm,""),this.hot.getShortcutManager().setActiveContextName("grid"),this.setComment()}function _de(){Mo(this,Nm,this.getComment()),this.hot.listen(),this.hot.getShortcutManager().setActiveContextName(Q1)}function Ade(t){Mo(this,km,{width:Ht(t.target),height:cr(t.target)})}function Mde(t){const e=Ht(t.target),r=cr(t.target);(e!==pt(this,km).width+1||r!==pt(this,km).height+2)&&this.updateCommentMeta(this.range.from.row,this.range.from.col,{[UL]:{width:e,height:r}})}function Ode(t){pt(this,jt).isVisible()&&vs(t)}function Ide(){pt(this,$0)||this.hide()}var SM=lp,Pde=TypeError,Dde=function(t,e){if(!delete t[e])throw new Pde("Cannot delete property "+SM(e)+" of "+SM(t))},kde=Ya,Nde=hp,Hde=hf,Fde=Kk,Lde=Dde,$de=Xk,Bde=[].unshift(0)!==1,Wde=function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(t){return t instanceof TypeError}},Vde=Bde||!Wde();kde({target:"Array",proto:!0,arity:1,forced:Vde},{unshift:function(e){var r=Nde(this),n=Hde(r),i=arguments.length;if(i){$de(n+i);for(var s=n;s--;){var o=s+i;s in r?r[o]=r[s]:Lde(r,o)}for(var a=0;a<i;a++)r[a]=arguments[a]}return Fde(r,n+i)}});function Bv(t,e,r){return e=Ude(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ude(t){var e=Gde(t,"string");return typeof e=="symbol"?e:String(e)}function Gde(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class GL{constructor(e){Bv(this,"hot",void 0),Bv(this,"commands",{}),Bv(this,"commonCallback",null),this.hot=e}registerCommand(e,r){this.commands[e]=r}setCommonCallback(e){this.commonCallback=e}execute(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];const s=e.split(":"),o=s[0],a=s.length===2?s[1]:null;let l=this.commands[o];if(!l)throw new Error(`Menu command '${o}' not exists.`);if(a&&l.submenu&&(l=Yde(a,l.submenu.items)),l.disabled===!0||typeof l.disabled=="function"&&l.disabled.call(this.hot)===!0||lr(l,"submenu"))return;const c=[];typeof l.callback=="function"&&c.push(l.callback),typeof this.commonCallback=="function"&&c.push(this.commonCallback),n.unshift(s.join(":")),j(c,u=>u.apply(this.hot,n))}}function Yde(t,e){let r;return j(e,n=>{const i=n.key?n.key.split(":"):null;if(Array.isArray(i)&&i[1]===t)return r=n,!1}),r}function Wv(t,e,r){return e=zde(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function zde(t){var e=jde(t,"string");return typeof e=="symbol"?e:String(e)}function jde(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class YL{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;Wv(this,"hot",void 0),Wv(this,"predefinedItems",BL()),Wv(this,"defaultOrderPattern",void 0),this.hot=e,this.defaultOrderPattern=r}setPredefinedItems(e){const r={};this.defaultOrderPattern.length=0,dt(e,(n,i)=>{let s="";n.name===ut?(r[ut]=n,s=ut):isNaN(parseInt(i,10))?(n.key=n.key===void 0?i:n.key,r[i]=n,s=n.key):(r[n.key]=n,s=n.key),this.defaultOrderPattern.push(s)}),this.predefinedItems=r}getItems(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return Kde(e,this.defaultOrderPattern,this.predefinedItems)}}function Kde(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=[];let i=t;return i&&i.items?i=i.items:Array.isArray(i)||(i=e),at(i)?dt(i,(s,o)=>{let a=r[typeof s=="string"?s:o];a||(a=s),at(s)?Ar(a,s):typeof a=="string"&&(a={name:a}),a.key===void 0&&(a.key=o),n.push(a)}):j(i,(s,o)=>{let a=r[s];!a&&ude.indexOf(s)>=0||(a||(a={name:s,key:`${o}`}),at(s)&&Ar(a,s),a.key===void 0&&(a.key=o),n.push(a))}),n}function ra(t,e,r){return e=Xde(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xde(t){var e=qde(t,"string");return typeof e=="symbol"?e:String(e)}function qde(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Zde{constructor(e,r){ra(this,"top",void 0),ra(this,"topRelative",void 0),ra(this,"left",void 0),ra(this,"leftRelative",void 0),ra(this,"scrollTop",void 0),ra(this,"scrollLeft",void 0),ra(this,"cellHeight",void 0),ra(this,"cellWidth",void 0);const n=r.scrollY,i=r.scrollX;let s,o,a,l,c,u;this.rootWindow=r,this.type=this.getSourceType(e),this.type==="literal"?(s=parseInt(e.top,10),a=parseInt(e.left,10),c=e.height||0,u=e.width||0,o=s,l=a,s+=n,a+=i):this.type==="event"&&(s=parseInt(e.pageY,10),a=parseInt(e.pageX,10),c=e.target.clientHeight,u=e.target.clientWidth,o=s-n,l=a-i),this.top=s,this.topRelative=o,this.left=a,this.leftRelative=l,this.scrollTop=n,this.scrollLeft=i,this.cellHeight=c,this.cellWidth=u}getSourceType(e){let r="literal";return e instanceof Event&&(r="event"),r}fitsAbove(e){return this.topRelative>=e.offsetHeight}fitsBelow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.rootWindow.innerHeight;return this.topRelative+e.offsetHeight<=r}fitsOnRight(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.rootWindow.innerWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=r}fitsOnLeft(e){return this.leftRelative>=e.offsetWidth}}function Rh(t,e,r){Jde(t,e),e.set(t,r)}function Jde(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gt(t,e){var r=zL(t,e,"get");return Qde(t,r)}function Qde(t,e){return e.get?e.get.call(t):e.value}function zg(t,e,r){var n=zL(t,e,"set");return efe(t,n,r),r}function zL(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function efe(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}var bn=new WeakMap,na=new WeakMap,Yr=new WeakMap,Vv=new WeakMap,Dc=new WeakMap;class tfe{constructor(e){Rh(this,bn,{writable:!0,value:void 0}),Rh(this,na,{writable:!0,value:void 0}),Rh(this,Yr,{writable:!0,value:void 0}),Rh(this,Vv,{writable:!0,value:!1}),Rh(this,Dc,{writable:!0,value:{above:0,below:0,left:0,right:0}}),zg(this,Vv,e)}setOffset(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return gt(this,Dc)[e]=r,this}setElement(e){return zg(this,bn,e),this}setParentElement(e){return zg(this,na,e),this}updatePosition(e){zg(this,Yr,new Zde(e,gt(this,bn).ownerDocument.defaultView)),gt(this,Vv)?(gt(this,Yr).fitsBelow(gt(this,bn))?this.setPositionBelowCursor():gt(this,Yr).fitsAbove(gt(this,bn))?this.setPositionAboveCursor():this.setPositionBelowCursor(),this.updateHorizontalPosition()):(this.setPositionBelowCursor(),this.setPositionOnRightOfCursor())}updateHorizontalPosition(){gt(this,bn).dir==="rtl"?gt(this,Yr).fitsOnLeft(gt(this,bn))?this.setPositionOnLeftOfCursor():this.setPositionOnRightOfCursor():gt(this,Yr).fitsOnRight(gt(this,bn))?this.setPositionOnRightOfCursor():this.setPositionOnLeftOfCursor()}setPositionAboveCursor(){let e=gt(this,Dc).above+gt(this,Yr).top-gt(this,bn).offsetHeight;gt(this,na)&&(e=gt(this,Yr).top+gt(this,Yr).cellHeight-gt(this,bn).offsetHeight+3),gt(this,bn).style.top=`${e}px`}setPositionBelowCursor(){let e=gt(this,Dc).below+gt(this,Yr).top+1;gt(this,na)&&(e=gt(this,Yr).top-1),gt(this,bn).style.top=`${e}px`}setPositionOnRightOfCursor(){let e=gt(this,Yr).left;if(gt(this,na)){const{right:r}=gt(this,na).getBoundingClientRect();e+=gt(this,Yr).cellWidth+r-(gt(this,Yr).left+gt(this,Yr).cellWidth)}else e+=gt(this,Dc).right;gt(this,bn).style.left=`${e}px`}setPositionOnLeftOfCursor(){let e=gt(this,Dc).left+gt(this,Yr).left-gt(this,bn).offsetWidth;if(gt(this,na)){const{left:r}=gt(this,na).getBoundingClientRect();e-=gt(this,Yr).left-r}gt(this,bn).style.left=`${e}px`}}function jL(t){let{initialPage:e=-1,size:r=()=>0,onItemSelect:n=()=>{},onClear:i=()=>{}}=t;const s=new Set;let o=ui(e,-1,g()-1);function a(w,C){const S=g()-1;return w<0&&(w=S),w>S&&(w=0),s.has(w)?-1:(s.add(w),n(w,!1)===!1&&(w=a(C===1?++w:--w,C)),w)}function l(w){w>-1&&w<g()&&n(w,!0)!==!1&&(o=w)}function c(){return o}function u(){g()>0&&(s.clear(),o=a(0,1))}function h(){g()>0&&(s.clear(),o=a(g()-1,-1))}function d(){g()>0&&(s.clear(),o=a(++o,1))}function f(){g()>0&&(s.clear(),o=a(--o,-1))}function g(){return Math.max(r(),0)}function m(){s.clear(),o=e,i()}return{setCurrentPage:l,getCurrentPage:c,toFirstItem:u,toLastItem:h,toNextItem:d,toPreviousItem:f,getSize:g,clear:m}}function rfe(t){return ht(t,e=>({start:e.getTopStartCorner(),end:e.getBottomEndCorner()}))}function tS(t){return lr(t,"submenu")}function rS(t){return new RegExp(ut,"i").test(t.name)}function B0(t,e){return t.disabled===!0||typeof t.disabled=="function"&&t.disabled.call(e)===!0}function yM(t){return lr(t,"disableSelection")}function nfe(t){return Je(t,"htSeparator")}function ife(t){return Je(t,"htSubmenu")}function sfe(t){return Je(t,"htDisabled")}function ofe(t){return Je(t,"htSelectionDisabled")}function afe(t,e){return!t.hidden||!(typeof t.hidden=="function"&&t.hidden.call(e))}function KL(t,e){const r=t.slice(0);for(let n=0;n<r.length&&r[n].name===e;)r.shift();return r}function lfe(t,e){let r=t.slice(0);return r.reverse(),r=KL(r,e),r.reverse(),r}function cfe(t){const e=[];return j(t,(r,n)=>{n>0?e[e.length-1].name!==r.name&&e.push(r):e.push(r)}),e}function ufe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ut,r=t.slice(0);return r=KL(r,e),r=lfe(r,e),r=cfe(r),r}function hfe(t){return jL({size:()=>t.countRows(),onItemSelect(e,r){const n=t.getCell(e,0);if(!n||nfe(n)||sfe(n)||ofe(n))return!1;t.selectCell(e,0,...r?[e,0,!1,!1]:[])},onClear(){t.deselectCell()}})}function dfe(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 r=t.openSubMenu(e[0]);r&&r.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 r=t.hotMenu.getSelectedLast();!r||(t.hotMenu.getSourceDataAtRow(r[0]).submenu?t.openSubMenu(r[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 XL="menu",xM=XL;function ffe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=[];n(dfe(t)),e.forEach(c=>{let{shortcuts:u,contextName:h}=c;i(u,h)});function n(c,u){a(u).addShortcuts(c,{group:XL})}function i(c,u){const h=a(u);c.forEach(d=>{let{keys:f}=d;f.forEach(g=>h.removeShortcutsByKeys(g))}),r.push({shortcuts:c,contextName:u}),n(c,u)}function s(){return[...r]}function o(c){return c?`${xM}:${c}`:xM}function a(c){var u;const h=t.hotMenu.getShortcutManager(),d=o(c);return(u=h.getContext(d))!==null&&u!==void 0?u:h.addContext(d)}function l(c){t.hotMenu.getShortcutManager().setActiveContextName(o(c))}return{addCustomShortcuts:i,getCustomShortcuts:s,getContext:a,listen:l}}function gfe(t){return(e,r,n,i,s,o)=>{if(r.hasAttribute("ghost-table"))return;const a=e.getSourceDataAtRow(n),l=t.rootDocument.createElement("div"),c=typeof o=="function"?o.call(t):o;if(Zs(r),be(l,"htItemWrapper"),t.getSettings().ariaTags){const u=!B0(a,t)&&!yM(a)&&!rS(a);qe(r,[tQ(),ky(c),...u?[Vu(-1)]:[],...B0(a,t)?[lQ()]:[],...tS(a)?[Pi(!1)]:[]])}r.className="",r.appendChild(l),rS(a)?be(r,"htSeparator"):typeof a.renderer=="function"?(be(r,"htCustomMenuRenderer"),r.appendChild(a.renderer(e,l,n,i,s,c))):Gu(l,c),B0(a,t)?be(r,"htDisabled"):yM(a)?be(r,"htSelectionDisabled"):tS(a)&&be(r,"htSubmenu")}}function bM(t,e,r){mfe(t,e),e.set(t,r)}function mfe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Os(t,e,r){return e=pfe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pfe(t){var e=wfe(t,"string");return typeof e=="symbol"?e:String(e)}function wfe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function EM(t,e,r){var n=qL(t,e,"set");return vfe(t,n,r),r}function vfe(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function Th(t,e){var r=qL(t,e,"get");return Cfe(t,r)}function qL(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function Cfe(t,e){return e.get?e.get.call(t):e.value}const RM=215;var _h=new WeakMap,jg=new WeakMap;class Ku{constructor(e,r){var n=this;Os(this,"hot",void 0),Os(this,"options",void 0),Os(this,"eventManager",new ms(this)),Os(this,"container",void 0),Os(this,"positioner",void 0),Os(this,"hotMenu",null),Os(this,"hotSubMenus",{}),Os(this,"parentMenu",void 0),Os(this,"menuItems",null),Os(this,"origOutsideClickDeselects",null),bM(this,_h,{writable:!0,value:void 0}),bM(this,jg,{writable:!0,value:void 0}),this.hot=e,this.options=r||{parent:null,name:null,className:"",keepInViewport:!0,standalone:!1,minWidth:RM,container:this.hot.rootDocument.documentElement},this.container=this.createContainer(this.options.name),this.positioner=new tfe(this.options.keepInViewport),this.parentMenu=this.options.parent||null,this.registerEvents(),this.isSubMenu()&&this.addLocalHook("afterSelectionChange",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return n.parentMenu.runLocalHooks("afterSelectionChange",...s)})}registerEvents(){let e=this.hot.rootWindow;for(;e;)this.eventManager.addEventListener(e.document,"mousedown",r=>this.onDocumentMouseDown(r)),this.eventManager.addEventListener(e.document,"contextmenu",r=>this.onDocumentContextMenu(r)),e=vm(e)}setMenuItems(e){this.menuItems=e}getNavigator(){return Th(this,_h)}getKeyboardShortcutsCtrl(){return Th(this,jg)}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=By(a=>this.openSubMenu(a),300),r=this.options.minWidth||RM;let n=!1,i=Ni(this.menuItems,a=>(a.key===Xd&&(n=!0),afe(a,this.hot)));if(i.length<1&&!n)i.push(BL()[Xd]);else if(i.length===0)return;i=ufe(i,ut);let s=!1;const o={data:i,colHeaders:!1,autoColumnSize:!0,autoWrapRow:!1,modifyColWidth(a){return He(a)&&a<r?r:a},autoRowSize:!1,readOnly:!0,editor:!1,copyPaste:!1,hiddenRows:!0,maxCols:1,columns:[{data:"name",renderer:gfe(this.hot)}],renderAllRows:!0,fragmentSelection:!1,outsideClickDeselects:!1,disableVisualSelection:"area",layoutDirection:this.hot.isRtl()?"rtl":"ltr",ariaTags:!1,beforeOnCellMouseOver:(a,l)=>{Th(this,_h).setCurrentPage(l.row)},afterOnCellMouseOver:(a,l)=>{this.isAllSubMenusClosed()?e(l.row):this.openSubMenu(l.row)},rowHeights:a=>i[a].name===ut?1:23,afterOnCellContextMenu:a=>{a.preventDefault(),t_()&&s&&this.hasSelectedItem()&&this.close(!0)},afterSelection:(a,l,c,u,h)=>{this.hotMenu.view.isMouseDown()&&(h.value=!0),this.runLocalHooks("afterSelectionChange",this.getSelectedItem())},beforeOnCellMouseUp:a=>{this.hasSelectedItem()&&(s=!this.isCommandPassive(this.getSelectedItem()),this.executeCommand(a))},afterOnCellMouseUp:a=>{(!t_()||!Xl(a))&&s&&this.hasSelectedItem()&&(Ea()||kH()?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,o),this.hotMenu.addHook("afterInit",()=>this.onAfterInit()),this.hotMenu.init(),EM(this,_h,hfe(this.hotMenu)),EM(this,jg,ffe(this)),Th(this,jg).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(Th(this,_h).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 r=this.parentMenu.hotMenu.getSelectedLast();if(r){const n=this.parentMenu.hotMenu.getCell(r[0],0);qe(n,[Pi(!1)])}}this.parentMenu.hotMenu.listen()}}}openSubMenu(e){if(!this.hotMenu)return!1;const r=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!r||!ife(r))return!1;const n=this.hotMenu.getSourceDataAtRow(e),i=new Ku(this.hot,{parent:this,name:n.name,className:this.options.className,keepInViewport:!0,container:this.options.container});return i.setMenuItems(n.submenu.items),i.open(),i.setPosition(r.getBoundingClientRect()),this.hotSubMenus[n.key]=i,this.hot.getSettings().ariaTags&&qe(r,[Pi(!0)]),i}closeSubMenu(e){const r=this.hotMenu.getSourceDataAtRow(e),n=this.hotSubMenus[r.key];if(n){n.destroy(),delete this.hotSubMenus[r.key];const i=this.hotMenu.getCell(e,0);this.hot.getSettings().ariaTags&&qe(i,[Pi(!1)])}}closeAllSubMenus(){j(this.hotMenu.getData(),(e,r)=>this.closeSubMenu(r))}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 r=this.getSelectedItem();if(this.runLocalHooks("select",r,e),this.isCommandPassive(r))return;const n=this.hot.getSelectedRange(),i=n?rfe(n):[];this.runLocalHooks("executeCommand",r.key,i,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",r.key,i,e)}isCommandPassive(e){return e.isCommand===!1||rS(e)||B0(e,this.hot)||tS(e)}setOffset(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.positioner.setOffset(e,r)}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 r=this.options.container.ownerDocument;let n=e,i;return n&&(Ut(n)&&(n=n.call(this.hot),n===null||Gt(n)?n="":n=n.toString()),n=n.replace(/[^A-z0-9]/g,"_"),n=`${this.options.className}Sub_${n}`,i=r.querySelector(`.${this.options.className}.${n}`)),i||(i=r.createElement("div"),be(i,`htMenu ${this.options.className}`),n&&be(i,n),this.options.container.appendChild(i)),i}onAfterInit(){const{wtTable:e}=this.hotMenu.view._wt,r=this.hotMenu.getSettings().data,n=e.hider.style,i=e.holder.style,s=parseInt(n.width,10),o=Cn(r,(a,l)=>a+(l.name===ut?1:26),0);i.width=`${s+3}px`,i.height=`${o+3}px`,n.height=i.height,this.hot.getSettings().ariaTags&&qe(this.hotMenu.rootElement,[eQ(),Vu(-1)])}onDocumentMouseDown(e){!this.isOpened()||(this.options.standalone&&this.hotMenu&&!Vl(e.target,this.hotMenu.rootElement)?this.close(!0):(this.isAllSubMenusClosed()||this.isSubMenu())&&!Vl(e.target,".htMenu")&&this.close(!0))}onDocumentContextMenu(e){!this.isOpened()||Je(e.target,"htCore")&&Vl(e.target,this.hotMenu.rootElement)&&e.preventDefault()}}Vt(Ku,Qn);function Kg(t,e){Sfe(t,e),e.add(t)}function Sfe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Uv(t,e,r){return e=yfe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yfe(t){var e=xfe(t,"string");return typeof e=="symbol"?e:String(e)}function xfe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Xg(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}const td="contextMenu",bfe=70,TM=td;$e.getSingleton().register("afterContextMenuDefaultOptions");$e.getSingleton().register("beforeContextMenuShow");$e.getSingleton().register("afterContextMenuShow");$e.getSingleton().register("afterContextMenuHide");$e.getSingleton().register("afterContextMenuExecute");var _M=new WeakSet,AM=new WeakSet,MM=new WeakSet,OM=new WeakSet;class Xp extends It{constructor(){super(...arguments),Kg(this,OM),Kg(this,MM),Kg(this,AM),Kg(this,_M),Uv(this,"commandExecutor",new GL(this.hot)),Uv(this,"itemsFactory",null),Uv(this,"menu",null)}static get PLUGIN_KEY(){return td}static get PLUGIN_PRIORITY(){return bfe}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[Yp,zp,ut,Rf,Tf,ut,Gp,Af,ut,jp,Up,ut,_f,ut,Ai]}isEnabled(){return!!this.hot.getSettings()[td]}enablePlugin(){var e=this;if(this.enabled)return;const r=this.hot.getSettings()[td];typeof r.callback=="function"&&this.commandExecutor.setCommonCallback(r.callback),this.menu=new Ku(this.hot,{className:"htContextMenu",keepInViewport:!0,container:r.uiContainer||this.hot.rootDocument.body}),this.menu.addLocalHook("beforeOpen",()=>Xg(this,AM,Rfe).call(this)),this.menu.addLocalHook("afterOpen",()=>Xg(this,MM,Tfe).call(this)),this.menu.addLocalHook("afterClose",()=>Xg(this,OM,_fe).call(this)),this.menu.addLocalHook("executeCommand",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return e.executeCommand.call(e,...i)}),this.addHook("afterOnCellContextMenu",n=>Xg(this,_M,Efe).call(this,n)),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 r=this.hot.getCell(e.row,e.col,!0).getBoundingClientRect(),n=Wp(this.menu.container,this.hot.rootDocument);this.open({left:r.left+n.left,top:r.top+n.top-1+r.height},{left:r.width,above:-r.height}),this.menu.getNavigator().toFirstItem()},runOnlyIf:()=>{var e;const r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r&&this.hot.selection.isCellVisible(r)&&!this.menu.isOpened()},group:TM})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(TM)}open(e){var r;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{above:0,below:0,left:0,right:0};(r=this.menu)!==null&&r!==void 0&&r.isOpened()||(this.prepareMenuItems(),this.menu.open(),dt(n,(i,s)=>{this.menu.setOffset(s,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 r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.commandExecutor.execute(e,...n)}prepareMenuItems(){this.itemsFactory=new YL(this.hot,Xp.DEFAULT_ITEMS);const e=this.hot.getSettings()[td],r={items:this.itemsFactory.getItems(e)};this.hot.runHooks("afterContextMenuDefaultOptions",r),this.itemsFactory.setPredefinedItems(r.items);const n=this.itemsFactory.getItems(e);this.hot.runHooks("beforeContextMenuSetItems",n),this.menu.setMenuItems(n),j(n,i=>this.commandExecutor.registerCommand(i.key,i))}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function Efe(t){const e=this.hot.getSettings(),r=e.rowHeaders,n=e.colHeaders;function i(a){return a.nodeName==="TD"||a.parentNode.nodeName==="TD"}const s=t.target;if(this.close(),Je(s,"handsontableInput")||(t.preventDefault(),t.stopPropagation(),!(r||n)&&!i(s)&&!(Je(s,"current")&&Je(s,"wtBorder"))))return;const o=Wp(this.menu.container,this.hot.rootDocument);this.open({top:t.clientY+o.top,left:t.clientX+o.left})}function Rfe(){this.hot.runHooks("beforeContextMenuShow",this)}function Tfe(){this.hot.runHooks("afterContextMenuShow",this)}function _fe(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)}Xp.SEPARATOR={name:ut};function Afe(t){return{key:"copy",name(){return this.getTranslatedPhrase(Ox)},callback(){t.copyCellsOnly()},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const r=this.getSelected();return!r||r.length>1},hidden:!1}}function Mfe(t){return{key:"copy_column_headers_only",name(){const e=this.getSelectedRangeLast(),r=e?ui(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(Dx,r)},callback(){t.copyColumnHeadersOnly()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const r=this.getSelected();return!r||r.length>1},hidden:!1}}function Ofe(t){return{key:"copy_with_column_group_headers",name(){const e=this.getSelectedRangeLast(),r=e?ui(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(Px,r)},callback(){t.copyWithAllColumnHeaders()},disabled(){if(!this.hasColHeaders()||!this.getSettings().nestedHeaders)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const r=this.getSelected();return!r||r.length>1},hidden:!1}}function Ife(t){return{key:"copy_with_column_headers",name(){const e=this.getSelectedRangeLast(),r=e?ui(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(Ix,r)},callback(){t.copyWithColumnHeaders()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const r=this.getSelected();return!r||r.length>1},hidden:!1}}function Pfe(t){return{key:"cut",name(){return this.getTranslatedPhrase(kx)},callback(){t.cut()},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const r=this.getSelected();return!r||r.length>1},hidden:!1}}class Dfe{constructor(){this.data={}}setData(e,r){this.data[e]=r}getData(e){return this.data[e]||void 0}}class kfe{constructor(){this.clipboardData=new Dfe}}function IM(t,e){ZL(t,e),e.add(t)}function kc(t,e,r){ZL(t,e),e.set(t,r)}function ZL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function qg(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function Tn(t,e){var r=JL(t,e,"get");return Nfe(t,r)}function Nfe(t,e){return e.get?e.get.call(t):e.value}function Nc(t,e,r){var n=JL(t,e,"set");return Hfe(t,n,r),r}function JL(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function Hfe(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}var ia=new WeakMap,Gv=new WeakMap,Ah=new WeakMap,nS=new WeakMap,iS=new WeakMap,Mh=new WeakMap,Zg=new WeakSet,PM=new WeakSet;class Ffe{constructor(e){let{countRows:r,countColumns:n,rowsLimit:i,columnsLimit:s,countColumnHeaders:o}=e;IM(this,PM),IM(this,Zg),kc(this,ia,{writable:!0,value:void 0}),kc(this,Gv,{writable:!0,value:void 0}),kc(this,Ah,{writable:!0,value:void 0}),kc(this,nS,{writable:!0,value:void 0}),kc(this,iS,{writable:!0,value:void 0}),kc(this,Mh,{writable:!0,value:void 0}),Nc(this,Gv,r),Nc(this,Ah,n),Nc(this,nS,i),Nc(this,iS,s),Nc(this,Mh,o)}setSelectedRange(e){Nc(this,ia,e)}getCellsRange(){if(Tn(this,Gv).call(this)===0||Tn(this,Ah).call(this)===0)return null;const{row:e,col:r}=Tn(this,ia).getTopStartCorner(),{row:n,col:i}=Tn(this,ia).getBottomEndCorner(),s=qg(this,PM,Lfe).call(this,e,n),o=qg(this,Zg,Yv).call(this,r,i);return{isRangeTrimmed:n!==s||i!==o,startRow:e,startCol:r,endRow:s,endCol:o}}getMostBottomColumnHeadersRange(){if(Tn(this,Ah).call(this)===0||Tn(this,Mh).call(this)===0)return null;const{col:e}=Tn(this,ia).getTopStartCorner(),{col:r}=Tn(this,ia).getBottomEndCorner(),n=qg(this,Zg,Yv).call(this,e,r);return{isRangeTrimmed:r!==n,startRow:-1,startCol:e,endRow:-1,endCol:n}}getAllColumnHeadersRange(){if(Tn(this,Ah).call(this)===0||Tn(this,Mh).call(this)===0)return null;const{col:e}=Tn(this,ia).getTopStartCorner(),{col:r}=Tn(this,ia).getBottomEndCorner(),n=qg(this,Zg,Yv).call(this,e,r);return{isRangeTrimmed:r!==n,startRow:-Tn(this,Mh).call(this),startCol:e,endRow:-1,endCol:n}}}function Yv(t,e){return Math.min(e,Math.max(t+Tn(this,iS).call(this)-1,t))}function Lfe(t,e){return Math.min(e,Math.max(t+Tn(this,nS).call(this)-1,t))}function QL(t){const e=[],r=[];return j(t,n=>{const i=Math.min(n.startRow,n.endRow),s=Math.max(n.startRow,n.endRow);Ue(i,s,l=>{e.indexOf(l)===-1&&e.push(l)});const o=Math.min(n.startCol,n.endCol),a=Math.max(n.startCol,n.endCol);Ue(o,a,l=>{r.indexOf(l)===-1&&r.push(l)})}),{rows:e,columns:r}}function Is(t,e){e$(t,e),e.add(t)}function sa(t,e,r){e$(t,e),e.set(t,r)}function e$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Oh(t,e,r){return e=$fe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $fe(t){var e=Bfe(t,"string");return typeof e=="symbol"?e:String(e)}function Bfe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function jn(t,e){var r=t$(t,e,"get");return Wfe(t,r)}function Wfe(t,e){return e.get?e.get.call(t):e.value}function Ri(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function ts(t,e,r){var n=t$(t,e,"set");return Vfe(t,n,r),r}function t$(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function Vfe(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}$e.getSingleton().register("afterCopyLimit");$e.getSingleton().register("modifyCopyableRange");$e.getSingleton().register("beforeCut");$e.getSingleton().register("afterCut");$e.getSingleton().register("beforePaste");$e.getSingleton().register("afterPaste");$e.getSingleton().register("beforeCopy");$e.getSingleton().register("afterCopy");const Jg="copyPaste",Ufe=80,Gfe=["fragmentSelection"],DM=['<meta name="generator" content="Handsontable"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join("");var sS=new WeakMap,oS=new WeakMap,aS=new WeakMap,Hc=new WeakMap,Qg=new WeakMap,e0=new WeakMap,Fc=new WeakMap,Hm=new WeakMap,zv=new WeakSet,kM=new WeakSet,r$=new WeakSet,uE=new WeakSet,NM=new WeakSet,HM=new WeakSet,FM=new WeakSet,LM=new WeakSet,$M=new WeakSet,BM=new WeakSet;class Yfe extends It{constructor(){super(...arguments),Is(this,BM),Is(this,$M),Is(this,LM),Is(this,FM),Is(this,HM),Is(this,NM),Is(this,uE),Is(this,r$),Is(this,kM),Is(this,zv),Oh(this,"columnsLimit",1/0),Oh(this,"rowsLimit",1/0),Oh(this,"pasteMode","overwrite"),Oh(this,"uiContainer",this.hot.rootDocument.body),sa(this,sS,{writable:!0,value:!1}),sa(this,oS,{writable:!0,value:!1}),sa(this,aS,{writable:!0,value:!1}),sa(this,Hc,{writable:!0,value:"cells-only"}),sa(this,Qg,{writable:!0,value:!1}),sa(this,e0,{writable:!0,value:!1}),sa(this,Fc,{writable:!0,value:new Ffe({countRows:()=>this.hot.countRows(),countColumns:()=>this.hot.countCols(),rowsLimit:()=>this.rowsLimit,columnsLimit:()=>this.columnsLimit,countColumnHeaders:()=>this.hot.view.getColumnHeadersCount()})}),sa(this,Hm,{writable:!0,value:!1}),Oh(this,"copyableRanges",[])}static get PLUGIN_KEY(){return Jg}static get SETTING_KEYS(){return[Jg,...Gfe]}static get PLUGIN_PRIORITY(){return Ufe}isEnabled(){return!!this.hot.getSettings()[Jg]}enablePlugin(){var e=this;if(this.enabled)return;const{[Jg]:r}=this.hot.getSettings();if(typeof r=="object"){var n,i;this.pasteMode=(n=r.pasteMode)!==null&&n!==void 0?n:this.pasteMode,this.rowsLimit=isNaN(r.rowsLimit)?this.rowsLimit:r.rowsLimit,this.columnsLimit=isNaN(r.columnsLimit)?this.columnsLimit:r.columnsLimit,ts(this,sS,!!r.copyColumnHeaders),ts(this,oS,!!r.copyColumnGroupHeaders),ts(this,aS,!!r.copyColumnHeadersOnly),this.uiContainer=(i=r.uiContainer)!==null&&i!==void 0?i:this.uiContainer}this.addHook("afterContextMenuDefaultOptions",s=>Ri(this,NM,Kfe).call(this,s)),this.addHook("afterSelection",function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return Ri(e,HM,Xfe).call(e,...o)}),this.addHook("afterSelectionEnd",()=>Ri(this,FM,qfe).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)}),PH()&&(this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseenter",function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return Ri(e,LM,Zfe).call(e,...o)}),this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseleave",function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return Ri(e,$M,Jfe).call(e,...o)}),this.addHook("afterSelection",()=>Ri(this,BM,Qfe).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";ts(this,Hc,e),ts(this,Qg,!0),Ri(this,zv,WM).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(){ts(this,e0,!0),Ri(this,zv,WM).call(this,"cut")}getRangedCopyableData(e){return wd(this.getRangedData(e))}getRangedData(e){const r=[],{rows:n,columns:i}=QL(e);return j(n,s=>{const o=[];j(i,a=>{s<0?o.push(this.hot.getColHeader(a,s)):o.push(this.hot.getCopyableData(s,a))}),r.push(o)}),r}paste(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;if(!e&&!r)return;const n=new kfe;e&&n.clipboardData.setData("text/plain",e),r&&n.clipboardData.setData("text/html",r),this.onPaste(n)}setCopyableText(){const e=this.hot.getSelectedRangeLast();if(!e)return;if(e.isSingleHeader()){this.copyableRanges=[];return}jn(this,Fc).setSelectedRange(e);const r=new Map([["headers",null],["cells",null]]);jn(this,Hc)==="column-headers-only"?r.set("headers",jn(this,Fc).getMostBottomColumnHeadersRange()):(jn(this,Hc)==="with-column-headers"?r.set("headers",jn(this,Fc).getMostBottomColumnHeadersRange()):jn(this,Hc)==="with-column-group-headers"&&r.set("headers",jn(this,Fc).getAllColumnHeadersRange()),r.set("cells",jn(this,Fc).getCellsRange())),this.copyableRanges=Array.from(r.values()).filter(i=>i!==null).map(i=>{let{startRow:s,startCol:o,endRow:a,endCol:l}=i;return{startRow:s,startCol:o,endRow:a,endCol:l}}),this.copyableRanges=this.hot.runHooks("modifyCopyableRange",this.copyableRanges);const n=r.get("cells");if(n!==null&&n.isRangeTrimmed){const{startRow:i,startCol:s,endRow:o,endCol:a}=n;this.hot.runHooks("afterCopyLimit",o-i+1,a-s+1,this.rowsLimit,this.columnsLimit)}}isEditorOpened(){var e;return(e=this.hot.getActiveEditor())===null||e===void 0?void 0:e.isOpened()}populateValues(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.hot.getSelectedRangeLast();if(!e.length)return;const n=e.length,i=e[0].length,s=[],{row:o,col:a}=r.getTopStartCorner(),{row:l,col:c}=r.getBottomEndCorner();let u=o,h=a,d=o,f=a;for(;s.length<n||u<=l;){const{skipRowOnPaste:g,visualRow:m}=this.hot.getCellMeta(u,a);if(u=m+1,g===!0)continue;d=m,h=a;const w=[],C=s.length%n;for(;w.length<i||h<=c;){const{skipColumnOnPaste:S,visualCol:v}=this.hot.getCellMeta(o,h);if(h=v+1,S===!0)continue;f=v;const T=w.length%i;w.push(e[C][T])}s.push(w)}return ts(this,Hm,!0),this.hot.populateFromArray(o,a,s,void 0,void 0,"CopyPaste.paste",this.pasteMode),[o,a,d,f]}onCopy(e){if(!this.hot.isListening()&&!jn(this,Qg)||this.isEditorOpened())return;this.setCopyableText(),ts(this,Qg,!1);const r=this.getRangedData(this.copyableRanges),n=Ri(this,kM,zfe).call(this,this.copyableRanges);if(!!this.hot.runHooks("beforeCopy",r,this.copyableRanges,n)){const s=wd(r);if(e&&e.clipboardData){const o=d_(r,this.hot.rootDocument);e.clipboardData.setData("text/plain",s),e.clipboardData.setData("text/html",[DM,o].join(""))}else typeof ClipboardEvent=="undefined"&&this.hot.rootWindow.clipboardData.setData("Text",s);this.hot.runHooks("afterCopy",r,this.copyableRanges,n)}ts(this,Hc,"cells-only"),e.preventDefault()}onCut(e){if(!this.hot.isListening()&&!jn(this,e0)||this.isEditorOpened())return;this.setCopyableText(),ts(this,e0,!1);const r=this.getRangedData(this.copyableRanges);if(!!this.hot.runHooks("beforeCut",r,this.copyableRanges)){const i=wd(r);if(e&&e.clipboardData){const s=d_(r,this.hot.rootDocument);e.clipboardData.setData("text/plain",i),e.clipboardData.setData("text/html",[DM,s].join(""))}else typeof ClipboardEvent=="undefined"&&this.hot.rootWindow.clipboardData.setData("Text",i);this.hot.emptySelectedCells("CopyPaste.cut"),this.hot.runHooks("afterCut",r,this.copyableRanges)}e.preventDefault()}onPaste(e){if(!this.hot.isListening()||this.isEditorOpened()||!this.hot.getSelected())return;e&&e.preventDefault&&e.preventDefault();let r;if(e&&typeof e.clipboardData!="undefined"){const a=Dy(e.clipboardData.getData("text/html"),{ADD_TAGS:["meta"],ADD_ATTR:["content"],FORCE_BODY:!0});a&&/(<table)|(<TABLE)/g.test(a)?r=Iee(a,this.hot.rootDocument).data:r=e.clipboardData.getData("text/plain")}else typeof ClipboardEvent=="undefined"&&typeof this.hot.rootWindow.clipboardData!="undefined"&&(r=this.hot.rootWindow.clipboardData.getData("Text"));if(typeof r=="string"&&(r=toe(r)),r===void 0||r&&r.length===0||this.hot.runHooks("beforePaste",r,this.copyableRanges)===!1)return;const[n,i,s,o]=this.populateValues(r);this.hot.selectCell(n,i,Math.min(this.hot.countRows()-1,s),Math.min(this.hot.countCols()-1,o)),this.hot.runHooks("afterPaste",r,this.copyableRanges)}destroy(){super.destroy()}}function WM(t){if(PH()){const e=this.hot.getSelectedRangeLast();if(e){const{row:r,col:n}=e.highlight,i=this.hot.getCell(r,n,!0);i&&MQ(i,()=>{this.hot.rootDocument.execCommand(t)})}}else this.hot.rootDocument.execCommand(t)}function zfe(t){const{rows:e}=QL(t);let r=0;for(let n=0;n<e.length&&!(e[n]>=0);n++)r+=1;return{columnHeadersCount:r}}function jfe(){if(this.hot.isListening()){const t=this.hot.getSelectedRangeLast();if(t){const{row:e,col:r}=t.highlight,n=this.hot.getCell(e,r,!0);n&&bH(n)}}}function n$(){if(this.hot.isListening()){const t=this.hot.getSelectedRangeLast();if(t){const{row:e,col:r}=t.highlight,n=this.hot.getCell(e,r,!0);n!=null&&n.hasAttribute("contenteditable")&&EH(n)}}}function Kfe(t){t.items.push({name:"---------"},Afe(this)),jn(this,sS)&&t.items.push(Ife(this)),jn(this,oS)&&t.items.push(Ofe(this)),jn(this,aS)&&t.items.push(Mfe(this)),t.items.push(Pfe(this))}function Xfe(t,e,r,n,i){jn(this,Hm)&&(i.value=!0),ts(this,Hm,!1)}function qfe(){this.isEditorOpened()||this.hot.getSettings().fragmentSelection||this.setCopyableText()}function Zfe(){Ri(this,uE,n$).call(this)}function Jfe(){Ri(this,r$,jfe).call(this)}function Qfe(){Ri(this,uE,n$).call(this)}function i$(t,e){return`border_row${t}col${e}`}function rd(){return{width:1,color:"#000"}}function Oo(){return{hide:!0}}function ege(){return{width:1,color:"#000",cornerVisible:!1}}function jv(t){if(He(t.start)||He(t.left)){var e;t.start=(e=t.start)!==null&&e!==void 0?e:t.left}if(He(t.end)||He(t.right)){var r;t.end=(r=t.end)!==null&&r!==void 0?r:t.right}return delete t.left,delete t.right,t}function Ih(t){return He(t.start)&&(t.left=t.start),He(t.end)&&(t.right=t.end),t}function Kv(t,e){return{id:i$(t,e),border:ege(),row:t,col:e,top:Oo(),bottom:Oo(),start:Oo(),end:Oo()}}function tge(t,e){return lr(e,"border")&&e.border&&(t.border=e.border),lr(e,"top")&&He(e.top)&&(e.top?(at(e.top)||(e.top=rd()),t.top=e.top):(e.top=Oo(),t.top=e.top)),lr(e,"bottom")&&He(e.bottom)&&(e.bottom?(at(e.bottom)||(e.bottom=rd()),t.bottom=e.bottom):(e.bottom=Oo(),t.bottom=e.bottom)),lr(e,"start")&&He(e.start)&&(e.start?(at(e.start)||(e.start=rd()),t.start=e.start):(e.start=Oo(),t.start=e.start)),lr(e,"end")&&He(e.end)&&(e.end?(at(e.end)||(e.end=rd()),t.end=e.end):(e.end=Oo(),t.end=e.end)),t}function $o(t,e){let r=!1;return j(t.getSelectedRange(),n=>{n.forAll((i,s)=>{if(i<0||s<0)return;const o=t.getCellMeta(i,s).borders;if(o)if(e){if(!lr(o[e],"hide")||o[e].hide===!1)return r=!0,!1}else return r=!0,!1})}),r}function qp(t){return`<span class="selected">${String.fromCharCode(10003)}</span>${t}`}function rge(t){return t.some(e=>He(e.left)||He(e.right))}function nge(t){return t.some(e=>He(e.start)||He(e.end))}const ige=new Map([["left","start"],["right","end"]]);function sge(t){var e;return(e=ige.get(t))!==null&&e!==void 0?e:t}function oge(t){return{key:"borders:bottom",name(){let e=this.getTranslatedPhrase(eb);return $o(this,"bottom")&&(e=qp(e)),e},callback(e,r){const n=$o(this,"bottom");t.prepareBorder(r,"bottom",n)}}}function age(t){const e=t.hot.isRtl()?"end":"start";return{key:"borders:left",name(){let r=this.getTranslatedPhrase(tb);return $o(this,e)&&(r=qp(r)),r},callback(r,n){const i=$o(this,e);t.prepareBorder(n,e,i)}}}function lge(t){return{key:"borders:no_borders",name(){return this.getTranslatedPhrase(rb)},callback(e,r){t.prepareBorder(r,"noBorders")},disabled(){return!$o(this)}}}function cge(t){const e=t.hot.isRtl()?"start":"end";return{key:"borders:right",name(){let r=this.getTranslatedPhrase(Qx);return $o(this,e)&&(r=qp(r)),r},callback(r,n){const i=$o(this,e);t.prepareBorder(n,e,i)}}}function uge(t){return{key:"borders:top",name(){let e=this.getTranslatedPhrase(Jx);return $o(this,"top")&&(e=qp(e)),e},callback(e,r){const n=$o(this,"top");t.prepareBorder(r,"top",n)}}}function VM(t,e){hge(t,e),e.add(t)}function hge(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function dge(t,e,r){return e=fge(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fge(t){var e=gge(t,"string");return typeof e=="symbol"?e:String(e)}function gge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function UM(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}const W0="customBorders",mge=90;var GM=new WeakSet,YM=new WeakSet;class pge extends It{constructor(){super(...arguments),VM(this,YM),VM(this,GM),dge(this,"savedBorders",[])}static get PLUGIN_KEY(){return W0}static get PLUGIN_PRIORITY(){return mge}isEnabled(){return!!this.hot.getSettings()[W0]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>UM(this,GM,wge).call(this,e)),this.addHook("init",()=>UM(this,YM,vge).call(this)),super.enablePlugin())}disablePlugin(){this.hideBorders(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.changeBorderSettings(),super.updatePlugin()}setBorders(e,r){let n=["top","bottom","start","end"],i=null;r&&(this.checkSettingsCohesion([r]),n=Object.keys(r),i=jv(r));const s=Pu(e),o=Kd(s,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)});j(e,a=>{o(a).forAll((l,c)=>{j(n,u=>{this.prepareBorderFromCustomAdded(l,c,i,sge(u))})})}),this.hot.view.render()}getBorders(e){if(!Array.isArray(e))return this.savedBorders;const r=Pu(e),n=Kd(r,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)}),i=[];return j(e,s=>{n(s).forAll((o,a)=>{j(this.savedBorders,l=>{l.row===o&&l.col===a&&i.push(Ih(l))})})}),i}clearBorders(e){e?this.setBorders(e):(j(this.savedBorders,r=>{this.clearBordersFromSelectionSettings(r.id),this.clearNullCellRange(),this.hot.removeCellMeta(r.row,r.col,"borders")}),this.savedBorders.length=0)}insertBorderIntoSettings(e,r){this.checkSavedBorders(e)||this.savedBorders.push(e);const i=this.hot._createCellRange(this.hot._createCellCoords(e.row,e.col));this.checkCustomSelections(e,i,r)||this.hot.selection.highlight.addCustomSelection({border:e,visualCellRange:i})}prepareBorderFromCustomAdded(e,r,n,i){const s=this.hot.countRows(),o=this.hot.countCols();if(e>=s||r>=o)return;let a=Kv(e,r);n&&(a=tge(a,n),j(this.hot.selection.highlight.customSelections,l=>{if(a.id===l.settings.id)return Object.assign(l.settings,n),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,r,"borders",Ih(a)),this.insertBorderIntoSettings(a,i)}prepareBorderFromCustomAddedRange(e,r){const n=Math.min(e.to.row,this.hot.countRows()-1),i=Math.min(e.to.col,this.hot.countCols()-1);Ue(e.from.row,n,s=>{Ue(e.from.col,i,o=>{const a=Kv(s,o);let l=0;s===e.from.row&&lr(r,"top")&&(l+=1,a.top=r.top),s===e.to.row&&lr(r,"bottom")&&(l+=1,a.bottom=r.bottom),o===e.from.col&&lr(r,"start")&&(l+=1,a.start=r.start),o===e.to.col&&lr(r,"end")&&(l+=1,a.end=r.end),l>0&&(this.hot.setCellMeta(s,o,"borders",Ih(a)),this.insertBorderIntoSettings(a))})})}removeAllBorders(e,r){const n=i$(e,r);this.spliceBorder(n),this.clearBordersFromSelectionSettings(n),this.clearNullCellRange(),this.hot.removeCellMeta(e,r,"borders")}setBorder(e,r,n,i){let s=this.hot.getCellMeta(e,r).borders;!s||s.border===void 0?s=Kv(e,r):s=jv(s),i?(s[n]=Oo(),this.countHide(s)===4?this.removeAllBorders(e,r):(this.checkCustomSelectionsFromContextMenu(s,n,i)||this.insertBorderIntoSettings(s),this.hot.setCellMeta(e,r,"borders",Ih(s)))):(s[n]=rd(),this.checkCustomSelectionsFromContextMenu(s,n,i)||this.insertBorderIntoSettings(s),this.hot.setCellMeta(e,r,"borders",Ih(s)))}prepareBorder(e,r,n){j(e,i=>{let{start:s,end:o}=i;if(s.row===o.row&&s.col===o.col)r==="noBorders"?this.removeAllBorders(s.row,s.col):this.setBorder(s.row,s.col,r,n);else switch(r){case"noBorders":Ue(s.col,o.col,a=>{Ue(s.row,o.row,l=>{this.removeAllBorders(l,a)})});break;case"top":Ue(s.col,o.col,a=>{this.setBorder(s.row,a,r,n)});break;case"bottom":Ue(s.col,o.col,a=>{this.setBorder(o.row,a,r,n)});break;case"start":Ue(s.row,o.row,a=>{this.setBorder(a,s.col,r,n)});break;case"end":Ue(s.row,o.row,a=>{this.setBorder(a,o.col,r,n)});break}})}createCustomBorders(e){j(e,r=>{const n=jv(r);r.range?this.prepareBorderFromCustomAddedRange(r.range,n):this.prepareBorderFromCustomAdded(r.row,r.col,n)})}countHide(e){const{top:r,bottom:n,start:i,end:s}=e;return Cn([r,n,i,s],(a,l)=>{let c=a;return l&&l.hide&&(c+=1),c},0)}clearBordersFromSelectionSettings(e){const r=ht(this.hot.selection.highlight.customSelections,n=>n.settings.id).indexOf(e);r>-1&&this.hot.selection.highlight.customSelections[r].clear()}clearNullCellRange(){j(this.hot.selection.highlight.customSelections,(e,r)=>{if(e.cellRange===null)return this.hot.selection.highlight.customSelections[r].destroy(),this.hot.selection.highlight.customSelections.splice(r,1),!1})}hideBorders(){j(this.savedBorders,e=>{this.clearBordersFromSelectionSettings(e.id),this.clearNullCellRange()})}spliceBorder(e){const r=ht(this.savedBorders,n=>n.id).indexOf(e);r>-1&&this.savedBorders.splice(r,1)}checkSavedBorders(e){let r=!1;return this.countHide(e)===4?(this.spliceBorder(e.id),r=!0):j(this.savedBorders,(i,s)=>{if(e.id===i.id)return this.savedBorders[s]=e,r=!0,!1}),r}checkCustomSelectionsFromContextMenu(e,r,n){let i=!1;return j(this.hot.selection.highlight.customSelections,s=>{if(e.id===s.settings.id){const o=this.hot.view._wt.selectionManager.getBorderInstances(s);return j(o,a=>{a.toggleHiddenClass(r,n)}),i=!0,!1}}),i}checkCustomSelections(e,r,n){const i=this.countHide(e);let s=!1;return i===4?(this.removeAllBorders(e.row,e.col),s=!0):j(this.hot.selection.highlight.customSelections,o=>{if(e.id===o.settings.id){if(o.visualCellRange=r,o.commit(),n){const a=this.hot.view._wt.selectionManager.getBorderInstances(o);j(a,l=>{l.changeBorderStyle(n,e)})}return s=!0,!1}}),s}changeBorderSettings(){const e=this.hot.getSettings()[W0];if(Array.isArray(e)){const r=Hn(e);this.checkSettingsCohesion(r),r.length||(this.savedBorders=r),this.createCustomBorders(r)}else e!==void 0&&this.createCustomBorders(this.savedBorders)}checkSettingsCohesion(e){const r=rge(e),n=nge(e);if(r&&n)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()&&r)throw new Error('The "left"/"right" properties are not supported for RTL. Please use option "start"/"end".')}destroy(){super.destroy()}}function wge(t){!this.hot.getSettings()[W0]||t.items.push({name:"---------"},{key:"borders",name(){return this.getTranslatedPhrase(Zx)},disabled(){const e=this.getSelectedRangeLast();return!e||e.isSingleHeader()?!0:this.selection.isSelectedByCorner()},submenu:{items:[uge(this),cge(this),oge(this),age(this),lge(this)]}})}function vge(){this.changeBorderSettings()}function Cge(t,e){Sge(t,e),e.add(t)}function Sge(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xv(t,e,r){return e=yge(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yge(t){var e=xge(t,"string");return typeof e=="symbol"?e:String(e)}function xge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function zM(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}const jM="dragToScroll",bge=100;var qv=new WeakSet;class Ege extends It{constructor(){super(...arguments),Cge(this,qv),Xv(this,"boundaries",null),Xv(this,"callback",null),Xv(this,"listening",!1)}static get PLUGIN_KEY(){return jM}static get PLUGIN_PRIORITY(){return bge}isEnabled(){return!!this.hot.getSettings()[jM]}enablePlugin(){this.enabled||(this.addHook("afterOnCellMouseDown",e=>zM(this,qv,KM).call(this,e)),this.addHook("afterOnCellCornerMouseDown",e=>zM(this,qv,KM).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,r){let n=0,i=0;r<this.boundaries.top?i=r-this.boundaries.top:r>this.boundaries.bottom&&(i=r-this.boundaries.bottom),e<this.boundaries.left?n=e-this.boundaries.left:e>this.boundaries.right&&(n=e-this.boundaries.right),this.callback(n,i)}listen(){this.listening=!0}unlisten(){this.listening=!1}isListening(){return this.listening}registerEvents(){const{rootWindow:e}=this.hot;let r=e;for(;r;)this.eventManager.addEventListener(r.document,"contextmenu",()=>this.unlisten()),this.eventManager.addEventListener(r.document,"mouseup",()=>this.unlisten()),this.eventManager.addEventListener(r.document,"mousemove",n=>this.onMouseMove(n)),r=vm(r)}unregisterEvents(){this.eventManager.clear()}onMouseMove(e){!this.isListening()||this.check(e.clientX,e.clientY)}destroy(){super.destroy()}}function KM(t){if(Xl(t))return;const e=this.hot.view._wt.wtOverlays.topOverlay.mainTableScrollableElement;this.setBoundaries(e!==this.hot.rootWindow?e.getBoundingClientRect():void 0),this.setCallback((r,n)=>{var i,s;const o=(i=e.scrollLeft)!==null&&i!==void 0?i:e.scrollX,a=(s=e.scrollTop)!==null&&s!==void 0?s:e.scrollY;e.scroll(o+Math.sign(r)*50,a+Math.sign(n)*20)}),this.listen()}function wl(t,e){Rge(t,e),e.add(t)}function Rge(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Zv(t,e,r){return e=Tge(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Tge(t){var e=_ge(t,"string");return typeof e=="symbol"?e:String(e)}function _ge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function fa(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}$e.getSingleton().register("afterDropdownMenuDefaultOptions");$e.getSingleton().register("beforeDropdownMenuShow");$e.getSingleton().register("afterDropdownMenuShow");$e.getSingleton().register("afterDropdownMenuHide");$e.getSingleton().register("afterDropdownMenuExecute");const V0="dropdownMenu",Age=230,lS="changeType",Jv=V0;var hE=new WeakSet,XM=new WeakSet,qM=new WeakSet,ZM=new WeakSet,JM=new WeakSet,QM=new WeakSet,eO=new WeakSet;class Zp extends It{static get PLUGIN_KEY(){return V0}static get PLUGIN_PRIORITY(){return Age}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[Rf,Tf,ut,Af,ut,Vp,ut,_f,ut,Ai]}constructor(e){super(e),wl(this,eO),wl(this,QM),wl(this,JM),wl(this,ZM),wl(this,qM),wl(this,XM),wl(this,hE),Zv(this,"commandExecutor",new GL(this.hot)),Zv(this,"itemsFactory",null),Zv(this,"menu",null),this.hot.addHook("afterGetColHeader",(r,n)=>fa(this,qM,Oge).call(this,r,n))}isEnabled(){return this.hot.getSettings()[V0]}enablePlugin(){var e=this;if(this.enabled)return;this.itemsFactory=new YL(this.hot,Zp.DEFAULT_ITEMS);const r=this.hot.getSettings()[V0],n={items:this.itemsFactory.getItems(r)};this.registerEvents(),typeof r.callback=="function"&&this.commandExecutor.setCommonCallback(r.callback),this.registerShortcuts(),super.enablePlugin(),this.callOnPluginsReady(()=>{this.hot.runHooks("afterDropdownMenuDefaultOptions",n),this.itemsFactory.setPredefinedItems(n.items);const i=this.itemsFactory.getItems(r);this.menu&&this.menu.destroy(),this.menu=new Ku(this.hot,{className:"htDropdownMenu",keepInViewport:!0,container:r.uiContainer||this.hot.rootDocument.body}),this.hot.runHooks("beforeDropdownMenuSetItems",i),this.menu.setMenuItems(i),this.menu.addLocalHook("beforeOpen",()=>fa(this,ZM,Ige).call(this)),this.menu.addLocalHook("afterOpen",()=>fa(this,JM,Pge).call(this)),this.menu.addLocalHook("afterSubmenuOpen",s=>fa(this,QM,Dge).call(this,s)),this.menu.addLocalHook("afterClose",()=>fa(this,eO,kge).call(this)),this.menu.addLocalHook("executeCommand",function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return e.executeCommand.call(e,...o)}),j(i,s=>this.commandExecutor.registerCommand(s.key,s))})}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"),r=()=>{const{highlight:n}=this.hot.getSelectedRangeLast();if((n.isHeader()&&n.row===-1||n.isCell())&&n.col>=0){this.hot.selectColumns(n.col,n.col,-1);const{from:i}=this.hot.getSelectedRangeLast(),s=Wp(this.menu.container,this.hot.rootDocument),o=this.hot.getCell(-1,i.col,!0),a=o.getBoundingClientRect();this.open({left:a.left+s.left,top:a.top+o.offsetHeight+s.top},{left:a.width}),this.menu.getNavigator().toFirstItem()}};e.addShortcuts([{keys:[["Shift","Alt","ArrowDown"],["Control/Meta","Enter"]],callback:r,runOnlyIf:()=>{var n;const i=(n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.highlight;return i&&this.hot.selection.isCellVisible(i)&&i.isHeader()&&!this.menu.isOpened()},captureCtrl:!0,group:Jv},{keys:[["Shift","Alt","ArrowDown"]],callback:r,runOnlyIf:()=>{var n;const i=(n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.highlight;return i&&this.hot.selection.isCellVisible(i)&&i.isCell()&&!this.menu.isOpened()},group:Jv}])}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(Jv)}registerEvents(){this.eventManager.addEventListener(this.hot.rootElement,"click",e=>fa(this,XM,Mge).call(this,e))}open(e){var r;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{above:0,below:0,left:0,right:0};(r=this.menu)!==null&&r!==void 0&&r.isOpened()||(this.menu.open(),dt(n,(i,s)=>{this.menu.setOffset(s,i)}),this.menu.setPosition(e))}close(){var e;(e=this.menu)===null||e===void 0||e.close()}executeCommand(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.commandExecutor.execute(e,...n)}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 s$(t){t.getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Control/Meta","A"]],callback:()=>!1}])}function Mge(t){if(t.stopPropagation(),Je(t.target,lS)){const e=Wp(this.menu.container,this.hot.rootDocument),r=t.target.getBoundingClientRect();this.open({left:r.left+e.left,top:r.top+t.target.offsetHeight+3+e.top},{left:r.width})}}function Oge(t,e){const r=e.parentNode;if(!r)return;const n=r.parentNode.childNodes,i=Array.prototype.indexOf.call(n,r);if(t<0||i!==n.length-1)return;const s=e.querySelector(`.${lS}`);if(this.enabled&&s)return;if(!this.enabled){s&&s.parentNode.removeChild(s);return}const o=this.hot.rootDocument.createElement("button");o.className=lS,o.type="button",o.tabIndex=-1,this.hot.getSettings().ariaTags&&(qe(o,[Yo(),ky(" ")]),qe(e,[hH("menu")])),o.onclick=function(){return!1},e.firstChild.insertBefore(o,e.firstChild.firstChild)}function Ige(){this.hot.runHooks("beforeDropdownMenuShow",this)}function Pge(){this.hot.runHooks("afterDropdownMenuShow",this),fa(this,hE,s$).call(this,this.menu)}function Dge(t){fa(this,hE,s$).call(this,t)}function kge(){this.hot.listen(),this.hot.runHooks("afterDropdownMenuHide",this)}Zp.SEPARATOR={name:ut};function tO(t,e,r){return e=Nge(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nge(t){var e=Hge(t,"string");return typeof e=="symbol"?e:String(e)}function Hge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Fge{constructor(e){tO(this,"hot",void 0),tO(this,"options",{}),this.hot=e}setOptions(e){this.options=e}getData(){const{startRow:e,startCol:r,endRow:n,endCol:i}=this._getDataRange(),s=this.options,o=[];return Ue(e,n,a=>{const l=[];!s.exportHiddenRows&&this._isHiddenRow(a)||(Ue(r,i,c=>{!s.exportHiddenColumns&&this._isHiddenColumn(c)||l.push(this.hot.getDataAtCell(a,c))}),o.push(l))}),o}getRowHeaders(){const e=[];if(this.options.rowHeaders){const{startRow:r,endRow:n}=this._getDataRange(),i=this.hot.getRowHeader();Ue(r,n,s=>{!this.options.exportHiddenRows&&this._isHiddenRow(s)||e.push(i[s])})}return e}getColumnHeaders(){const e=[];if(this.options.columnHeaders){const{startCol:r,endCol:n}=this._getDataRange(),i=this.hot.getColHeader();Ue(r,n,s=>{!this.options.exportHiddenColumns&&this._isHiddenColumn(s)||e.push(i[s])})}return e}_getDataRange(){const e=this.hot.countCols()-1,r=this.hot.countRows()-1;let[n=0,i=0,s=r,o=e]=this.options.range;return n=Math.max(n,0),i=Math.max(i,0),s=Math.min(s,r),o=Math.min(o,e),{startRow:n,startCol:i,endRow:s,endCol:o}}_isHiddenRow(e){return this.hot.rowIndexMapper.isHidden(this.hot.toPhysicalRow(e))}_isHiddenColumn(e){return this.hot.columnIndexMapper.isHidden(this.hot.toPhysicalColumn(e))}}const Lge=Fge;function rO(t,e,r){return e=$ge(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $ge(t){var e=Bge(t,"string");return typeof e=="symbol"?e:String(e)}function Bge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class dE{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,r){rO(this,"dataProvider",void 0),rO(this,"options",void 0),this.dataProvider=e,this.options=this._mergeOptions(r),this.dataProvider.setOptions(this.options)}_mergeOptions(e){let r=Jn(this.constructor.DEFAULT_OPTIONS);const n=new Date;return r=Ar(Jn(dE.DEFAULT_OPTIONS),r),r=Ar(r,e),r.filename=lH(r.filename,{YYYY:n.getFullYear(),MM:`${n.getMonth()+1}`.padStart(2,"0"),DD:`${n.getDate()}`.padStart(2,"0")}),r}}const Wge=dE,Vge=String.fromCharCode(13),Uge=String.fromCharCode(34),Gge=String.fromCharCode(10);class Yge extends Wge{static get DEFAULT_OPTIONS(){return{mimeType:"text/csv",fileExtension:"csv",bom:!0,columnDelimiter:",",rowDelimiter:`\r
  113. `}}export(){const e=this.options,r=this.dataProvider.getData();let n=this.dataProvider.getColumnHeaders();const i=n.length>0,s=this.dataProvider.getRowHeaders(),o=s.length>0;let a=e.bom?String.fromCharCode(65279):"";return i&&(n=ht(n,l=>this._escapeCell(l,!0)),o&&(a+=e.columnDelimiter),a+=n.join(e.columnDelimiter),a+=e.rowDelimiter),j(r,(l,c)=>{c>0&&(a+=e.rowDelimiter),o&&(a+=this._escapeCell(s[c])+e.columnDelimiter),a+=l.map(u=>this._escapeCell(u)).join(e.columnDelimiter)}),a}_escapeCell(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=Sr(e);return n!==""&&(r||n.indexOf(Vge)>=0||n.indexOf(Uge)>=0||n.indexOf(Gge)>=0||n.indexOf(this.options.columnDelimiter)>=0)&&(n=n.replace(new RegExp('"',"g"),'""'),n=`"${n}"`),n}}const zge=Yge,jge="csv",cS={[jge]:zge};function Kge(t,e,r){return typeof cS[t]=="function"?new cS[t](e,r):null}const Xge="exportFile",qge=240;class Zge extends It{static get PLUGIN_KEY(){return Xge}static get PLUGIN_PRIORITY(){return qge}isEnabled(){return!0}exportAsString(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._createTypeFormatter(e,r).export()}exportAsBlob(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._createBlob(this._createTypeFormatter(e,r))}downloadFile(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{rootDocument:n,rootWindow:i}=this.hot,s=this._createTypeFormatter(e,r),o=this._createBlob(s),a=i.URL||i.webkitURL,l=n.createElement("a"),c=`${s.options.filename}.${s.options.fileExtension}`;if(l.download!==void 0){const u=a.createObjectURL(o);l.style.display="none",l.setAttribute("href",u),l.setAttribute("download",c),n.body.appendChild(l),l.dispatchEvent(new MouseEvent("click")),n.body.removeChild(l),setTimeout(()=>{a.revokeObjectURL(u)},100)}else navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob(o,c)}_createTypeFormatter(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!cS[e])throw new Error(`Export format type "${e}" is not supported.`);return Kge(e,new Lge(this.hot),r)}_createBlob(e){let r=null;return typeof Blob!="undefined"&&(r=new Blob([e.export()],{type:`${e.options.mimeType};charset=${e.options.encoding}`})),r}}function Lc(t,e,r){return e=Jge(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Jge(t){var e=Qge(t,"string");return typeof e=="symbol"?e:String(e)}function Qge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Mf{constructor(e,r){let{id:n,stateless:i=!0}=r;Lc(this,"hot",void 0),Lc(this,"id",void 0),Lc(this,"elements",[]),Lc(this,"hidden",!1),Lc(this,"stateId",""),Lc(this,"state",void 0),this.hot=e,this.id=n,this.stateId=`Filters.component.${this.id}`,this.state=i?null:this.hot.columnIndexMapper.registerMap(this.stateId,new Dp)}getElements(){return this.elements}reset(){j(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(),j(this.elements,e=>e.destroy()),this.state=null,this.elements=null,this.hot=null}}Vt(Mf,Qn);const qd={};function $a(t,e){if(!qd[t])throw Error(`Filter condition "${t}" does not exist.`);const{condition:r,descriptor:n}=qd[t];let i=e;return n.inputValuesDecorator&&(i=n.inputValuesDecorator(i)),function(s){return r.apply(s.meta.instance,[].concat([s],[i]))}}function Nl(t){if(!qd[t])throw Error(`Filter condition "${t}" does not exist.`);return qd[t].descriptor}function yr(t,e,r){r.key=t,qd[t]={condition:e,descriptor:r}}const Br="none";function e0e(){return!0}yr(Br,e0e,{name:kp,inputsCount:0,showOperators:!1});const yd="empty";function t0e(t){return kr(t.value)}yr(yd,t0e,{name:cb,inputsCount:0,showOperators:!0});const U0="not_empty";function r0e(t,e){return!$a(yd,e)(t)}yr(U0,r0e,{name:ub,inputsCount:0,showOperators:!0});const xd="eq";function n0e(t,e){let[r]=e;return Sr(t.value).toLocaleLowerCase(t.meta.locale)===Sr(r)}yr(xd,n0e,{name:hb,inputsCount:1,showOperators:!0});const G0="neq";function i0e(t,e){return!$a(xd,e)(t)}yr(G0,i0e,{name:db,inputsCount:1,showOperators:!0});const o$="gt";function s0e(t,e){let[r]=e,n=r;return t.meta.type==="numeric"&&(n=parseFloat(n,10)),t.value>n}yr(o$,s0e,{name:wb,inputsCount:1,showOperators:!0});const a$="gte";function o0e(t,e){let[r]=e,n=r;return t.meta.type==="numeric"&&(n=parseFloat(n,10)),t.value>=n}yr(a$,o0e,{name:vb,inputsCount:1,showOperators:!0});const l$="lt";function a0e(t,e){let[r]=e,n=r;return t.meta.type==="numeric"&&(n=parseFloat(n,10)),t.value<n}yr(l$,a0e,{name:Cb,inputsCount:1,showOperators:!0});const c$="lte";function l0e(t,e){let[r]=e,n=r;return t.meta.type==="numeric"&&(n=parseFloat(n,10)),t.value<=n}yr(c$,l0e,{name:Sb,inputsCount:1,showOperators:!0});const fE="date_after";function c0e(t,e){let[r]=e;const n=ye(t.value,t.meta.dateFormat),i=ye(r,t.meta.dateFormat);return!n.isValid()||!i.isValid()?!1:n.diff(i)>=0}yr(fE,c0e,{name:bb,inputsCount:1,showOperators:!0});const gE="date_before";function u0e(t,e){let[r]=e;const n=ye(t.value,t.meta.dateFormat),i=ye(r,t.meta.dateFormat);return!n.isValid()||!i.isValid()?!1:n.diff(i)<=0}yr(gE,u0e,{name:Eb,inputsCount:1,showOperators:!0});const Fm="between";function h0e(t,e){let[r,n]=e,i=r,s=n;if(t.meta.type==="numeric"){const o=parseFloat(i,10),a=parseFloat(s,10);i=Math.min(o,a),s=Math.max(o,a)}else if(t.meta.type==="date"){const o=$a(gE,[s]),a=$a(fE,[i]);return o(t)&&a(t)}return t.value>=i&&t.value<=s}yr(Fm,h0e,{name:yb,inputsCount:2,showOperators:!0});const u$="not_between";function d0e(t,e){return!$a(Fm,e)(t)}yr(u$,d0e,{name:xb,inputsCount:2,showOperators:!0});const h$="begins_with";function f0e(t,e){let[r]=e;return Sr(t.value).toLocaleLowerCase(t.meta.locale).startsWith(Sr(r))}yr(h$,f0e,{name:fb,inputsCount:1,showOperators:!0});const d$="ends_with";function g0e(t,e){let[r]=e;return Sr(t.value).toLocaleLowerCase(t.meta.locale).endsWith(Sr(r))}yr(d$,g0e,{name:gb,inputsCount:1,showOperators:!0});const mE="contains";function m0e(t,e){let[r]=e;return Sr(t.value).toLocaleLowerCase(t.meta.locale).indexOf(Sr(r))>=0}yr(mE,m0e,{name:mb,inputsCount:1,showOperators:!0});const f$="not_contains";function p0e(t,e){return!$a(mE,e)(t)}yr(f$,p0e,{name:pb,inputsCount:1,showOperators:!0});const g$="date_tomorrow";function w0e(t){const e=ye(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(ye().subtract(-1,"days").startOf("day"),"d"):!1}yr(g$,w0e,{name:Tb,inputsCount:0});const m$="date_today";function v0e(t){const e=ye(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(ye().startOf("day"),"d"):!1}yr(m$,v0e,{name:Rb,inputsCount:0});const p$="date_yesterday";function C0e(t){const e=ye(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(ye().subtract(1,"days").startOf("day"),"d"):!1}yr(p$,C0e,{name:_b,inputsCount:0});KQ();function S0e(t,e){let r=t;return r===""&&(r=`(${e})`),r}const uS=new Set([1]).has(1),y0e=uS&&typeof Array.from=="function";function Of(t){let e=t;return uS&&(e=new Set(e)),function(r){let n;return uS?n=e.has(r):n=!!~e.indexOf(r),n}}function w$(t){return t==null?"":t}function hS(t){let e=t;return y0e?e=Array.from(new Set(e)):e=sH(e),e=e.sort((r,n)=>typeof r=="number"&&typeof n=="number"?r-n:r===n?0:r>n?1:-1),e}function nO(t,e,r,n){const i=[],s=t===e;let o;return s||(o=Of(e)),j(t,a=>{let l=!1;(s||o(a))&&(l=!0);const c={checked:l,value:a,visualValue:S0e(a,r)};n&&n(c),i.push(c)}),i}const Hl="by_value";function x0e(t,e){let[r]=e;return r(t.value)}yr(Hl,x0e,{name:"By value",inputsCount:0,inputValuesDecorator(t){let[e]=t;return[Of(e)]},showOperators:!1});const Zd={};function b0e(t){if(!Zd[t])throw Error(`Operation with id "${t}" does not exist.`);const e=Zd[t].func;return function(r,n){return e(r,n)}}function E0e(t){return Zd[t].name}function pE(t,e,r){Zd[t]={name:e,func:r}}const Da="conjunction",R0e=Ob;function T0e(t,e){return t.every(r=>r.func(e))}pE(Da,R0e,T0e);const Lm="disjunction",_0e=Np;function A0e(t,e){return t.some(r=>r.func(e))}pE(Lm,_0e,A0e);const wE="disjunctionWithExtraCondition",M0e=Np;function O0e(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(r=>r.func(e))&&t[t.length-1].func(e)}pE(wE,M0e,O0e);const I0e="numeric",v$="text",P0e="date",iO={[I0e]:[Br,ut,yd,U0,ut,xd,G0,ut,o$,a$,l$,c$,Fm,u$],[v$]:[Br,ut,yd,U0,ut,xd,G0,ut,h$,d$,ut,mE,f$],[P0e]:[Br,ut,yd,U0,ut,xd,G0,ut,gE,fE,Fm,ut,g$,m$,p$]};function D0e(t){const e=[];let r=t;return iO[r]||(r=v$),j(iO[r],n=>{let i;n===ut?i={name:ut}:i=Jn(Nl(n)),e.push(i)}),e}function Ph(t,e,r){return e=k0e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function k0e(t){var e=N0e(t,"string");return typeof e=="symbol"?e:String(e)}function N0e(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Qv="built",eC="building",sO=["click","input","keydown","keypress","keyup","focus","blur","change"];class fi{static get DEFAULTS(){return Jn({className:"",value:"",tagName:"div",children:[],wrapIt:!0})}constructor(e,r){Ph(this,"hot",void 0),Ph(this,"eventManager",new ms(this)),Ph(this,"options",void 0),Ph(this,"_element",void 0),Ph(this,"buildState",void 0),this.hot=e,this.options=Ar(fi.DEFAULTS,r),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===eC?this._element:this.buildState===Qv?(this.update(),this._element):(this.buildState=eC,this.build(),this.buildState=Qv,this._element)}isBuilt(){return this.buildState===Qv}translateIfPossible(e){return typeof e=="string"&&e.startsWith(Ln)?this.hot.getTranslatedPhrase(e):e}build(){const e=(r,n)=>{this.eventManager.addEventListener(r,n,i=>this.runLocalHooks(n,i,this))};if(this.buildState||(this.buildState=eC),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&&be(this._element,this.options.className),this.options.children.length)j(this.options.children,r=>this._element.appendChild(r.element));else if(this.options.wrapIt){const r=this.hot.rootDocument.createElement(this.options.tagName);r.setAttribute("data-hot-input",!0),dt(this.options,(n,i)=>{r[i]!==void 0&&i!=="className"&&i!=="tagName"&&i!=="children"&&(r[i]=this.translateIfPossible(n))}),this._element.appendChild(r),j(sO,n=>e(r,n))}else j(sO,r=>e(this._element,r))}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}}Vt(fi,Qn);function H0e(t,e){C$(t,e),e.add(t)}function F0e(t,e,r){C$(t,e),e.set(t,r)}function C$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function t0(t,e){var r=S$(t,e,"get");return L0e(t,r)}function L0e(t,e){return e.get?e.get.call(t):e.value}function $0e(t,e,r){var n=S$(t,e,"set");return B0e(t,n,r),r}function S$(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function B0e(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function W0e(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}var $c=new WeakMap,oO=new WeakSet;class ka extends fi{static get DEFAULTS(){return Jn({placeholder:"",type:"text",tagName:"input",tabIndex:-1})}constructor(e,r){super(e,Ar(ka.DEFAULTS,r)),H0e(this,oO),F0e(this,$c,{writable:!0,value:void 0}),this.registerHooks()}registerHooks(){this.addLocalHook("keyup",e=>W0e(this,oO,V0e).call(this,e))}build(){super.build();const e=this.hot.rootDocument.createElement("div");$0e(this,$c,this._element.firstChild),be(this._element,"htUIInput"),be(e,"htUIInputIcon"),this._element.appendChild(e),this.update()}update(){!this.isBuilt()||(t0(this,$c).type=this.options.type,t0(this,$c).placeholder=this.translateIfPossible(this.options.placeholder),t0(this,$c).value=this.translateIfPossible(this.options.value))}focus(){this.isBuilt()&&t0(this,$c).focus()}}function V0e(t){this.options.value=t.target.value}function tC(t,e){y$(t,e),e.add(t)}function Dh(t,e,r){y$(t,e),e.set(t,r)}function y$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Bc(t,e,r){var n=x$(t,e,"set");return U0e(t,n,r),r}function U0e(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function rC(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function tr(t,e){var r=x$(t,e,"get");return G0e(t,r)}function x$(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function G0e(t,e){return e.get?e.get.call(t):e.value}var Mr=new WeakMap,r0=new WeakMap,n0=new WeakMap,nC=new WeakMap,i0=new WeakMap,aO=new WeakSet,lO=new WeakSet,cO=new WeakSet;class Jd extends fi{static get DEFAULTS(){return Jn({className:"htUISelect",wrapIt:!1,tabIndex:-1})}constructor(e,r){super(e,Ar(Jd.DEFAULTS,r)),tC(this,cO),tC(this,lO),tC(this,aO),Dh(this,Mr,{writable:!0,value:null}),Dh(this,r0,{writable:!0,value:[]}),Dh(this,n0,{writable:!0,value:void 0}),Dh(this,nC,{writable:!0,value:void 0}),Dh(this,i0,{writable:!0,value:void 0}),this.registerHooks()}getMenu(){return tr(this,Mr)}registerHooks(){this.addLocalHook("click",()=>rC(this,cO,j0e).call(this))}setItems(e){Bc(this,r0,this.translateNames(e)),tr(this,Mr)&&tr(this,Mr).setMenuItems(tr(this,r0))}translateNames(e){return j(e,r=>{r.name=this.translateIfPossible(r.name)}),e}build(){super.build(),Bc(this,Mr,new Ku(this.hot,{className:"htSelectUI htFiltersConditionsMenu",keepInViewport:!1,standalone:!0,container:this.options.menuContainer})),tr(this,Mr).setMenuItems(tr(this,r0));const e=new fi(this.hot,{className:"htUISelectCaption"}),r=new fi(this.hot,{className:"htUISelectDropdown"});Bc(this,n0,e),Bc(this,nC,e.element),Bc(this,i0,r),this.hot.getSettings().ariaTags&&(qe(r.element,[Yo()]),qe(this._element,[uH()])),j([e,r],n=>this._element.appendChild(n.element)),tr(this,Mr).addLocalHook("select",n=>rC(this,aO,Y0e).call(this,n)),tr(this,Mr).addLocalHook("afterClose",()=>rC(this,lO,z0e).call(this)),this.update()}update(){if(!this.isBuilt())return;let e;this.options.value?e=this.options.value.name:e=tr(this,Mr).hot.getTranslatedPhrase(kp),tr(this,nC).textContent=e,super.update()}openOptions(){const e=this.element.getBoundingClientRect();tr(this,Mr)&&(tr(this,Mr).open(),tr(this,Mr).setPosition({left:this.hot.isLtr()?e.left-5:e.left-31,top:e.top-1,width:e.width,height:e.height}),tr(this,Mr).getNavigator().toFirstItem(),tr(this,Mr).getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:r=>{this.closeOptions(),this.runLocalHooks("tabKeydown",r)}},{keys:[["Control/Meta","A"]],callback:()=>!1}]))}closeOptions(){tr(this,Mr)&&tr(this,Mr).close()}focus(){this.isBuilt()&&this.element.focus()}destroy(){tr(this,Mr)&&(tr(this,Mr).destroy(),Bc(this,Mr,null)),tr(this,n0)&&tr(this,n0).destroy(),tr(this,i0)&&tr(this,i0).destroy(),super.destroy()}}function Y0e(t){t.name!==ut&&(this.options.value=t,this.update(),this.runLocalHooks("select",this.options.value))}function z0e(){this.runLocalHooks("afterClose")}function j0e(){this.openOptions()}function uO(t,e){K0e(t,e),e.add(t)}function K0e(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function hO(t,e,r){return e=X0e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function X0e(t){var e=q0e(t,"string");return typeof e=="symbol"?e:String(e)}function q0e(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function dO(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}var fO=new WeakSet,gO=new WeakSet;class dS extends Mf{constructor(e,r){super(e,{id:r.id,stateless:!1}),uO(this,gO),uO(this,fO),hO(this,"name",""),hO(this,"addSeparator",!1),this.name=r.name,this.addSeparator=r.addSeparator,this.elements.push(new Jd(this.hot,{menuContainer:r.menuContainer})),this.elements.push(new ka(this.hot,{placeholder:Hb})),this.elements.push(new ka(this.hot,{placeholder:Fb})),this.registerHooks()}registerHooks(){this.getSelectElement().addLocalHook("select",e=>dO(this,fO,Z0e).call(this,e)).addLocalHook("afterClose",()=>this.runLocalHooks("afterClose")).addLocalHook("tabKeydown",e=>this.runLocalHooks("selectTabKeydown",e)),j(this.getInputElements(),e=>{e.addLocalHook("keydown",r=>dO(this,gO,J0e).call(this,r))})}setState(e){if(this.reset(),!e)return;const r=Jn(e.command);r.name.startsWith(ur)&&(r.name=this.hot.getTranslatedPhrase(r.name)),this.getSelectElement().setValue(r),j(e.args,(n,i)=>{if(i>r.inputsCount-1)return!1;const s=this.getInputElement(i);s.setValue(n),s[r.inputsCount>i?"show":"hide"](),i||this.hot._registerTimeout(()=>s.focus(),10)})}getState(){const e=this.getSelectElement().getValue()||Nl(Br),r=[];return j(this.getInputElements(),(n,i)=>{e.inputsCount>i&&r.push(n.getValue())}),{command:e,args:r}}updateState(e,r){const n=Nl(e?e.name:Br);this.state.setValueAtIndex(r,{command:n,args:e?e.args:[]}),e||j(this.getInputElements(),i=>i.setValue(null))}getSelectElement(){return this.elements.filter(e=>e instanceof Jd)[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 ka)}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,r,n,i,s,o)=>{be(r.parentNode,"htFiltersMenuCondition"),this.addSeparator&&be(r.parentNode,"border");const a=this.hot.rootDocument.createElement("div");return be(a,"htFiltersMenuLabel"),a.textContent=o,r.appendChild(a),j(this.elements,l=>r.appendChild(l.element)),r}}}reset(){const e=this.hot.getPlugin("filters").getSelectedColumn();let r=[Nl(Br)];if(e!==null){const{visualIndex:n}=e;r=D0e(this.hot.getDataType(0,n,this.hot.countRows(),n))}j(this.getInputElements(),n=>n.hide()),this.getSelectElement().setItems(r),super.reset(),this.getSelectElement().setValue(r[0])}}function Z0e(t){j(this.getInputElements(),(e,r)=>{e[t.inputsCount>r?"show":"hide"](),r===0&&this.hot._registerTimeout(()=>e.focus(),10)}),this.runLocalHooks("change",t)}function J0e(t){Cf(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),vs(t))}function mO(t,e,r){Q0e(t,e),e.set(t,r)}function Q0e(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function kh(t,e){var r=b$(t,e,"get");return eme(t,r)}function eme(t,e){return e.get?e.get.call(t):e.value}function pO(t,e,r){var n=b$(t,e,"set");return tme(t,n,r),r}function b$(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function tme(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}var Wc=new WeakMap,iC=new WeakMap;class $m extends fi{static get DEFAULTS(){return Jn({type:"radio",tagName:"input",className:"htUIRadio",label:{}})}constructor(e,r){super(e,Ar($m.DEFAULTS,r)),mO(this,Wc,{writable:!0,value:void 0}),mO(this,iC,{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),pO(this,iC,e),pO(this,Wc,this._element.firstChild),kh(this,Wc).checked=this.options.checked,this._element.appendChild(e),this.update()}update(){!this.isBuilt()||(kh(this,iC).textContent=this.translateIfPossible(this.options.label.textContent))}isChecked(){return this.isBuilt()?kh(this,Wc).checked:!1}setChecked(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isBuilt()&&(kh(this,Wc).checked=e)}focus(){this.isBuilt()&&kh(this,Wc).focus()}}function rme(t,e){nme(t,e),e.add(t)}function nme(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ime(t,e,r){return e=sme(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function sme(t){var e=ome(t,"string");return typeof e=="symbol"?e:String(e)}function ome(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ame(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}const wO=0;var vO=new WeakSet;class lme extends Mf{constructor(e,r){super(e,{id:r.id,stateless:!1}),rme(this,vO),ime(this,"name",""),this.name=r.name,this.buildOperatorsElement()}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,r)=>(be(r.parentNode,"htFiltersMenuOperators"),j(this.elements,n=>r.appendChild(n.element)),r)}}buildOperatorsElement(){const e=[Da,Lm];j(e,r=>{const n=new $m(this.hot,{name:"operator",label:{htmlFor:r,textContent:E0e(r)},value:r,checked:r===e[wO],id:r});n.addLocalHook("change",i=>ame(this,vO,cme).call(this,i)),this.elements.push(n)})}setChecked(e){if(this.elements.length<e)throw Error(Pt`Radio button with index ${e} doesn't exist.`);j(this.elements,(r,n)=>{r.setChecked(n===e)})}getActiveOperationId(){const e=this.elements.find(r=>r instanceof $m&&r.isChecked());return e?e.getValue():Da}getState(){return this.getActiveOperationId()}setState(e){this.reset(),e&&this.getActiveOperationId()!==e&&j(this.elements,r=>{r.setChecked(r.getValue()===e)})}updateState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Da,r=arguments.length>1?arguments[1]:void 0,n=e;n===wE&&(n=Lm),this.state.setValueAtIndex(r,n)}reset(){this.setChecked(wO)}}function cme(t){this.setState(t.target.value)}function ume(t,e,r){hme(t,e),e.set(t,r)}function hme(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function sC(t,e){var r=E$(t,e,"get");return dme(t,r)}function dme(t,e){return e.get?e.get.call(t):e.value}function fme(t,e,r){var n=E$(t,e,"set");return gme(t,n,r),r}function E$(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function gme(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}var Nh=new WeakMap;class Qd extends fi{static get DEFAULTS(){return Jn({href:"#",tagName:"a",tabIndex:-1,role:"button"})}constructor(e,r){super(e,Ar(Qd.DEFAULTS,r)),ume(this,Nh,{writable:!0,value:void 0})}build(){super.build(),fme(this,Nh,this._element.firstChild)}update(){!this.isBuilt()||(sC(this,Nh).textContent=this.translateIfPossible(this.options.textContent))}focus(){this.isBuilt()&&sC(this,Nh).focus()}activate(){sC(this,Nh).click()}}function s0(t,e){R$(t,e),e.add(t)}function Vc(t,e,r){R$(t,e),e.set(t,r)}function R$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function o0(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function et(t,e){var r=T$(t,e,"get");return mme(t,r)}function mme(t,e){return e.get?e.get.call(t):e.value}function Xi(t,e,r){var n=T$(t,e,"set");return pme(t,n,r),r}function T$(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function pme(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}const CO="multipleSelect.itemBox";var ns=new WeakMap,Jt=new WeakMap,oC=new WeakMap,go=new WeakMap,oa=new WeakMap,aa=new WeakMap,SO=new WeakSet,yO=new WeakSet,xO=new WeakSet,bO=new WeakSet;class ef extends fi{static get DEFAULTS(){return Jn({className:"htUIMultipleSelect",value:[]})}constructor(e,r){super(e,Ar(ef.DEFAULTS,r)),s0(this,bO),s0(this,xO),s0(this,yO),s0(this,SO),Vc(this,ns,{writable:!0,value:[]}),Vc(this,Jt,{writable:!0,value:void 0}),Vc(this,oC,{writable:!0,value:void 0}),Vc(this,go,{writable:!0,value:void 0}),Vc(this,oa,{writable:!0,value:void 0}),Vc(this,aa,{writable:!0,value:void 0}),Xi(this,go,new ka(this.hot,{placeholder:Nb,className:"htUIMultipleSelectSearch"})),Xi(this,oa,new Qd(this.hot,{textContent:Ib,className:"htUISelectAll"})),Xi(this,aa,new Qd(this.hot,{textContent:Pb,className:"htUIClearAll"})),this.registerHooks()}getItemsBox(){return et(this,Jt)}registerHooks(){et(this,go).addLocalHook("keydown",e=>o0(this,yO,vme).call(this,e)),et(this,go).addLocalHook("input",e=>o0(this,SO,wme).call(this,e)),et(this,oa).addLocalHook("click",e=>o0(this,xO,Cme).call(this,e)),et(this,aa).addLocalHook("click",e=>o0(this,bO,Sme).call(this,e))}setItems(e){Xi(this,ns,e),et(this,Jt)&&et(this,Jt).loadData(et(this,ns))}setLocale(e){Xi(this,oC,e)}getLocale(){return et(this,oC)}getItems(){return[...et(this,ns)]}getValue(){return xme(et(this,ns))}getSearchInputElement(){return et(this,go)}getSelectAllElement(){return et(this,oa)}getClearAllElement(){return et(this,aa)}isSelectedAllValues(){return et(this,ns).length===this.getValue().length}build(){super.build();const{rootDocument:e}=this.hot,r=e.createElement("div"),n=new fi(this.hot,{className:"htUISelectionControls",children:[et(this,oa),et(this,aa)]});this._element.appendChild(et(this,go).element),this._element.appendChild(n.element),this._element.appendChild(r);const i=s=>{if(!this._element)return;et(this,Jt)&&et(this,Jt).destroy(),be(s,"htUIMultipleSelectHot"),Xi(this,Jt,new this.hot.constructor(s,{data:et(this,ns),columns:[{data:"checked",type:"checkbox",label:{property:"visualValue",position:"after"}}],beforeRenderer:(l,c,u,h,d,f)=>{l.title=f.instance.getDataAtRowProp(c,f.label.property)},afterListen:()=>{this.runLocalHooks("focus",this)},beforeOnCellMouseUp:()=>{et(this,Jt).listen()},maxCols:1,autoWrapCol:!0,height:110,colWidths:()=>et(this,Jt).container.scrollWidth-Ur(e),copyPaste:!1,disableVisualSelection:"area",fillHandle:!1,fragmentSelection:"cell",tabMoves:{row:1,col:0},layoutDirection:this.hot.isRtl()?"rtl":"ltr"})),et(this,Jt).init();const a=et(this,Jt).getShortcutManager().getContext("grid");a.removeShortcutsByKeys(["Tab"]),a.removeShortcutsByKeys(["Shift","Tab"]),a.addShortcut({keys:[["Escape"]],callback:l=>{this.runLocalHooks("keydown",l,this)},group:CO}),a.addShortcut({keys:[["Tab"],["Shift","Tab"]],callback:l=>{et(this,Jt).deselectCell(),this.runLocalHooks("keydown",l,this),this.runLocalHooks("listTabKeydown",l,this)},group:CO})};i(r),this.hot._registerTimeout(()=>i(r),100)}focus(){this.isBuilt()&&et(this,Jt).listen()}reset(){et(this,go).reset(),et(this,oa).reset(),et(this,aa).reset()}update(){!this.isBuilt()||(et(this,Jt).loadData(yme(et(this,ns),this.options.value)),super.update())}destroy(){et(this,Jt)&&et(this,Jt).destroy(),et(this,go).destroy(),et(this,aa).destroy(),et(this,oa).destroy(),Xi(this,go,null),Xi(this,aa,null),Xi(this,oa,null),Xi(this,Jt,null),Xi(this,ns,null),super.destroy()}}function wme(t){const e=t.target.value.toLocaleLowerCase(this.getLocale());let r;e===""?r=[...et(this,ns)]:r=Ni(et(this,ns),n=>`${n.value}`.toLocaleLowerCase(this.getLocale()).indexOf(e)>=0),et(this,Jt).loadData(r)}function vme(t){this.runLocalHooks("keydown",t,this),RH(Cf,t.keyCode)("ARROW_DOWN")&&(t.preventDefault(),vs(t),et(this,Jt).listen(),et(this,Jt).selectCell(0,0))}function Cme(t){const e=[];t.preventDefault(),j(et(this,Jt).getSourceData(),(r,n)=>{r.checked=!0,e.push(_F(r,n)[0])}),et(this,Jt).setSourceDataAtCell(e)}function Sme(t){const e=[];t.preventDefault(),j(et(this,Jt).getSourceData(),(r,n)=>{r.checked=!1,e.push(_F(r,n)[0])}),et(this,Jt).setSourceDataAtCell(e)}function yme(t,e){const r=Of(e);return ht(t,n=>(n.checked=r(n.value),n))}function xme(t){const e=[];return j(t,r=>{r.checked&&e.push(r.value)}),e}function bme(t,e){Eme(t,e),e.add(t)}function Eme(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Rme(t,e,r){return e=Tme(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Tme(t){var e=_me(t,"string");return typeof e=="symbol"?e:String(e)}function _me(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ame(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}var EO=new WeakSet;class Mme extends Mf{constructor(e,r){super(e,{id:r.id,stateless:!1}),bme(this,EO),Rme(this,"name",""),this.name=r.name,this.elements.push(new ef(this.hot)),this.registerHooks()}registerHooks(){this.getMultipleSelectElement().addLocalHook("keydown",e=>Ame(this,EO,Ome).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===Hl){const r=this.getMultipleSelectElement();r.setItems(e.itemsSnapshot),r.setValue(e.args[0]),r.setLocale(e.locale)}}getState(){const e=this.getMultipleSelectElement(),r=e.getItems();return{command:{key:e.isSelectedAllValues()||!r.length?Br:Hl},args:[e.getValue()],itemsSnapshot:r}}updateState(e){const r=(n,i,s,o,a)=>{const[l]=Ni(i,h=>h.name===Hl),c={},u=this.hot.getTranslatedPhrase(Tm);if(l){const h=hS(ht(o(n,a),m=>m.value));s&&(l.args[0]=s);const d=[],f=nO(h,l.args[0],u,m=>{m.checked&&d.push(m.value)}),g=e.editedConditionStack.column;c.locale=this.hot.getCellMeta(0,g).locale,c.args=[d],c.command=Nl(Hl),c.itemsSnapshot=f}else c.args=[],c.command=Nl(Br);this.state.setValueAtIndex(n,c)};r(e.editedConditionStack.column,e.editedConditionStack.conditions,e.conditionArgsChange,e.filteredRowsFactory),e.dependentConditionStacks.length&&r(e.dependentConditionStacks[0].column,e.dependentConditionStacks[0].conditions,e.conditionArgsChange,e.filteredRowsFactory,e.editedConditionStack)}getMultipleSelectElement(){return this.elements.filter(e=>e instanceof ef)[0]}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,r,n,i,s,o)=>{be(r.parentNode,"htFiltersMenuValue");const a=this.hot.rootDocument.createElement("div");return be(a,"htFiltersMenuLabel"),a.textContent=o,r.appendChild(a),j(this.elements,l=>r.appendChild(l.element)),r}}}reset(){const e=this.hot.getTranslatedPhrase(Tm),r=hS(this._getColumnVisibleValues()),n=nO(r,r,e);this.getMultipleSelectElement().setItems(n),super.reset(),this.getMultipleSelectElement().setValue(r);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?[]:ht(this.hot.getDataAtCol(e.visualIndex),r=>w$(r))}}function Ome(t){Cf(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),vs(t))}var _$;function Ime(t,e){Pme(t,e),e.add(t)}function Pme(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Dme(t,e,r){return e=kme(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function kme(t){var e=Nme(t,"string");return typeof e=="symbol"?e:String(e)}function Nme(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Hme(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}var RO=new WeakSet;class tf extends Mf{static get BUTTON_OK(){return"ok"}static get BUTTON_CANCEL(){return"cancel"}constructor(e,r){super(e,{id:r.id,stateless:!0}),Ime(this,RO),Dme(this,"name",""),this.name=r.name,this.elements.push(new ka(this.hot,{type:"button",value:Db,className:"htUIButton htUIButtonOK",identifier:tf.BUTTON_OK})),this.elements.push(new ka(this.hot,{type:"button",value:kb,className:"htUIButton htUIButtonCancel",identifier:tf.BUTTON_CANCEL})),this.registerHooks()}registerHooks(){j(this.elements,e=>{e.addLocalHook("click",(r,n)=>Hme(this,RO,Fme).call(this,r,n))})}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,r)=>(be(r.parentNode,"htFiltersMenuActionBar"),j(this.elements,n=>r.appendChild(n.element)),r)}}accept(){this.runLocalHooks("accept")}cancel(){this.runLocalHooks("cancel")}}_$=tf;function Fme(t,e){e.options.identifier===_$.BUTTON_OK?this.accept():this.cancel()}function aC(t,e,r){return e=Lme(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Lme(t){var e=$me(t,"string");return typeof e=="symbol"?e:String(e)}function $me(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const TO="ConditionCollection.filteringStates";class A${constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;aC(this,"hot",void 0),aC(this,"isMapRegistrable",void 0),aC(this,"filteringStates",new Dp),this.hot=e,this.isMapRegistrable=r,this.isMapRegistrable===!0?this.hot.columnIndexMapper.registerMap(TO,this.filteringStates):this.filteringStates.init(this.hot.columnIndexMapper.getNumberOfIndexes())}isEmpty(){return this.getFilteredColumns().length===0}isMatch(e,r){var n;const i=this.filteringStates.getValueAtIndex(r),s=(n=i==null?void 0:i.conditions)!==null&&n!==void 0?n:[],o=i==null?void 0:i.operation;return this.isMatchInConditions(s,e,o)}isMatchInConditions(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Da;return e.length?b0e(n)(e,r):!0}addCondition(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Da,i=arguments.length>3?arguments[3]:void 0;const s=this.hot.getCellMeta(0,e).locale,o=ht(r.args,u=>typeof u=="string"?u.toLocaleLowerCase(s):u),a=r.name||r.command.key;this.runLocalHooks("beforeAdd",e);const l=this.getOperation(e);if(l){if(l!==n)throw Error(Pt`The column of index ${e} has been already applied with a \`${l}\`\x20
  114. filter operation. Use \`removeConditions\` to clear the current conditions and then add new ones.\x20
  115. Mind that you cannot mix different types of operations (for instance, if you use \`conjunction\`,\x20
  116. use it consequently for a particular column).`)}else if(Gt(Zd[n]))throw new Error(Pt`Unexpected operation named \`${n}\`. Possible ones are\x20
  117. \`disjunction\` and \`conjunction\`.`);const c=this.getConditions(e);c.length===0?this.filteringStates.setValueAtIndex(e,{operation:n,conditions:[{name:a,args:o,func:$a(a,o)}]},i):c.push({name:a,args:o,func:$a(a,o)}),this.runLocalHooks("afterAdd",e)}getConditions(e){var r,n;return(r=(n=this.filteringStates.getValueAtIndex(e))===null||n===void 0?void 0:n.conditions)!==null&&r!==void 0?r:[]}getOperation(e){var r;return(r=this.filteringStates.getValueAtIndex(e))===null||r===void 0?void 0:r.operation}getFilteredColumns(){return this.filteringStates.getEntries().map(e=>{let[r]=e;return r})}getColumnStackPosition(e){return this.getFilteredColumns().indexOf(e)}exportAllConditions(){return Cn(this.filteringStates.getEntries(),(e,r)=>{let[n,{operation:i,conditions:s}]=r;return e.push({column:n,operation:i,conditions:ht(s,o=>{let{name:a,args:l}=o;return{name:a,args:l}})}),e},[])}importAllConditions(e){this.clean(),j(e,r=>{j(r.conditions,n=>this.addCondition(r.column,n))})}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,r){const n=this.getConditions(e);return r?n.some(i=>i.name===r):n.length>0}destroy(){this.isMapRegistrable&&this.hot.columnIndexMapper.unregisterMap(TO),this.filteringStates=null,this.clearLocalHooks()}}Vt(A$,Qn);const M$=A$;function _O(t,e,r){return e=Bme(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Bme(t){var e=Wme(t,"string");return typeof e=="symbol"?e:String(e)}function Wme(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Vme{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:()=>[];_O(this,"conditionCollection",void 0),_O(this,"columnDataFactory",void 0),this.conditionCollection=e,this.columnDataFactory=r}filter(){let e=[];return j(this.conditionCollection.getFilteredColumns(),(r,n)=>{let i=this.columnDataFactory(r);n&&(i=this._getIntersectData(i,e)),e=this.filterByColumn(r,i)}),e}filterByColumn(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=[];return j(r,i=>{i!==void 0&&this.conditionCollection.isMatch(i,e)&&n.push(i)}),n}_getIntersectData(e,r){const n=[];return j(r,i=>{const s=i.meta.visualRow;e[s]!==void 0&&(n[s]=e[s])}),n}}const O$=Vme;function lC(t,e){Ume(t,e),e.add(t)}function Ume(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function vl(t,e,r){return e=Gme(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Gme(t){var e=Yme(t,"string");return typeof e=="symbol"?e:String(e)}function Yme(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function cC(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}var AO=new WeakSet,MO=new WeakSet,OO=new WeakSet;class I${constructor(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:()=>[];lC(this,OO),lC(this,MO),lC(this,AO),vl(this,"hot",void 0),vl(this,"conditionCollection",void 0),vl(this,"columnDataFactory",void 0),vl(this,"changes",[]),vl(this,"grouping",!1),vl(this,"latestEditedColumnPosition",-1),vl(this,"latestOrderStack",[]),this.hot=e,this.conditionCollection=r,this.columnDataFactory=n,this.conditionCollection.addLocalHook("beforeRemove",i=>cC(this,AO,zme).call(this,i)),this.conditionCollection.addLocalHook("afterRemove",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("afterAdd",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("beforeClean",()=>cC(this,MO,jme).call(this)),this.conditionCollection.addLocalHook("afterClean",()=>cC(this,OO,Kme).call(this))}groupChanges(){this.grouping=!0}flush(){this.grouping=!1,j(this.changes,e=>{this.updateStatesAtColumn(e)}),this.changes.length=0}updateStatesAtColumn(e,r){var n=this;if(this.grouping){this.changes.indexOf(e)===-1&&this.changes.push(e);return}const i=this.conditionCollection.exportAllConditions();let s=this.conditionCollection.getColumnStackPosition(e);s===-1&&(s=this.latestEditedColumnPosition);const o=i.slice(0,s),a=i.slice(s);a.length&&a[0].column===e&&a.shift();const l=OQ(function(u,h){let d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];const f=new M$(n.hot,!1),g=[].concat(u,d);f.importAllConditions(g);const m=n.columnDataFactory(h);let w;f.isEmpty()?w=m:w=new O$(f,S=>n.columnDataFactory(S)).filter(),w=ht(w,S=>S.meta.visualRow);const C=Of(w);return f.destroy(),Ni(m,S=>C(S.meta.visualRow))})(o),c=[].concat(this.conditionCollection.getConditions(e));this.runLocalHooks("update",{editedConditionStack:{column:e,conditions:c},dependentConditionStacks:a,filteredRowsFactory:l,conditionArgsChange:r})}destroy(){this.clearLocalHooks(),dt(this,(e,r)=>{this[r]=null})}}function zme(t){this.latestEditedColumnPosition=this.conditionCollection.getColumnStackPosition(t)}function jme(){this.latestOrderStack=this.conditionCollection.getFilteredColumns()}function Kme(){j(this.latestOrderStack,t=>{this.updateStatesAtColumn(t)})}Vt(I$,Qn);const Xme=I$;function qme(t){return jL({initialPage:0,size:()=>t.length,onItemSelect:(r,n)=>{const i=t[r];if(i instanceof ef)return n;if(i.element&&!Kl(i.element))return!1;i.focus()}})}const Hh="filters";function Zme(t,e){let r=-1;const n=qme(e),i=l=>()=>{t.isOpened()&&t.getKeyboardShortcutsCtrl().listen(Hh),n.setCurrentPage(e.indexOf(l))};e.forEach(l=>{l instanceof fi&&(l.addLocalHook("click",i(l)),l.addLocalHook("focus",i(l)),l.addLocalHook("afterClose",i(l)))}),t.addLocalHook("afterSelectionChange",l=>{l.key.startsWith("filter_")||n.clear()});function s(l){const c=t.getKeyboardShortcutsCtrl(),u=l.getKeyboardShortcutsCtrl();n.clear(),u.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],forwardToContext:c.getContext(Hh),callback:()=>{l.isSubMenu()&&l.close(),c.listen(Hh)}}]),!l.isSubMenu()&&c.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:h=>{const d=t.getNavigator();d.getCurrentPage()>-1&&(r=d.getCurrentPage()),d.clear(),h.shiftKey?n.toPreviousItem():n.toNextItem()}},{keys:[["Escape"]],callback:()=>{t.close()}},{keys:[["Enter"],["Space"]],preventDefault:!1,callback:h=>{const d=e[n.getCurrentPage()];d instanceof Jd&&(d.openOptions(),h.preventDefault()),d instanceof Qd&&(d.activate(),h.preventDefault()),d instanceof fi||h.preventDefault()}}],Hh)}t.addLocalHook("afterSubmenuOpen",s),t.addLocalHook("afterOpen",s);function o(){t.focus(),t.getKeyboardShortcutsCtrl().listen(Hh)}function a(){return r}return Zr(yt({},n),{listen:o,getLastMenuPage:a})}function mo(t,e){P$(t,e),e.add(t)}function Jme(t,e,r){P$(t,e),e.set(t,r)}function P$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Fh(t,e,r){return e=Qme(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qme(t){var e=epe(t,"string");return typeof e=="symbol"?e:String(e)}function epe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tpe(t,e,r){var n=D$(t,e,"set");return rpe(t,n,r),r}function rpe(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function Lh(t,e){var r=D$(t,e,"get");return npe(t,r)}function D$(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function npe(t,e){return e.get?e.get.call(t):e.value}function qi(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}const fS="filters",ipe=250,IO=fS;var Cl=new WeakMap,PO=new WeakSet,DO=new WeakSet,kO=new WeakSet,NO=new WeakSet,uC=new WeakSet,HO=new WeakSet,hC=new WeakSet,FO=new WeakSet,LO=new WeakSet;class spe extends It{static get PLUGIN_KEY(){return fS}static get PLUGIN_PRIORITY(){return ipe}static get PLUGIN_DEPS(){return["plugin:DropdownMenu","plugin:HiddenRows","cell-type:checkbox"]}constructor(e){super(e),mo(this,LO),mo(this,FO),mo(this,hC),mo(this,HO),mo(this,uC),mo(this,NO),mo(this,kO),mo(this,DO),mo(this,PO),Fh(this,"dropdownMenuPlugin",null),Fh(this,"conditionCollection",null),Fh(this,"conditionUpdateObserver",null),Fh(this,"components",new Map([["filter_by_condition",null],["filter_operators",null],["filter_by_condition2",null],["filter_by_value",null],["filter_action_bar",null]])),Fh(this,"filtersRowsMap",null),Jme(this,Cl,{writable:!0,value:void 0}),this.hot.addHook("afterGetColHeader",(r,n)=>qi(this,FO,hpe).call(this,r,n))}isEnabled(){return!!this.hot.getSettings()[fS]}enablePlugin(){if(this.enabled)return;this.filtersRowsMap=this.hot.rowIndexMapper.registerMap(this.pluginName,new bf),this.dropdownMenuPlugin=this.hot.getPlugin("dropdownMenu");const e=this.hot.getSettings().dropdownMenu,r=e&&e.uiContainer||this.hot.rootDocument.body,n=o=>(o.addLocalHook("accept",()=>qi(this,uC,$O).call(this,"accept")),o.addLocalHook("cancel",()=>qi(this,uC,$O).call(this,"cancel")),o.addLocalHook("change",a=>qi(this,HO,upe).call(this,o,a)),o),i=()=>`${this.hot.getTranslatedPhrase(Ab)}:`,s=()=>`${this.hot.getTranslatedPhrase(Mb)}:`;if(!this.components.get("filter_by_condition")){const o=new dS(this.hot,{id:"filter_by_condition",name:i,addSeparator:!1,menuContainer:r});o.addLocalHook("afterClose",()=>qi(this,hC,BO).call(this)),this.components.set("filter_by_condition",n(o))}if(this.components.get("filter_operators")||this.components.set("filter_operators",new lme(this.hot,{id:"filter_operators",name:"Operators"})),!this.components.get("filter_by_condition2")){const o=new dS(this.hot,{id:"filter_by_condition2",name:"",addSeparator:!0,menuContainer:r});o.addLocalHook("afterClose",()=>qi(this,hC,BO).call(this)),this.components.set("filter_by_condition2",n(o))}if(this.components.get("filter_by_value")||this.components.set("filter_by_value",n(new Mme(this.hot,{id:"filter_by_value",name:s}))),this.components.get("filter_action_bar")||this.components.set("filter_action_bar",n(new tf(this.hot,{id:"filter_action_bar",name:"Action bar"}))),this.conditionCollection||(this.conditionCollection=new M$(this.hot)),this.conditionUpdateObserver||(this.conditionUpdateObserver=new Xme(this.hot,this.conditionCollection,o=>this.getDataMapAtColumn(o)),this.conditionUpdateObserver.addLocalHook("update",o=>qi(this,LO,dpe).call(this,o))),this.components.forEach(o=>o.show()),this.addHook("afterDropdownMenuDefaultOptions",o=>qi(this,NO,cpe).call(this,o)),this.addHook("afterDropdownMenuShow",()=>qi(this,DO,ape).call(this)),this.addHook("afterDropdownMenuHide",()=>qi(this,kO,lpe).call(this)),this.addHook("afterChange",o=>qi(this,PO,ope).call(this,o)),this.hot.getSettings().dropdownMenu&&this.dropdownMenuPlugin&&(this.dropdownMenuPlugin.disablePlugin(),this.dropdownMenuPlugin.enablePlugin()),!Lh(this,Cl)&&this.dropdownMenuPlugin.enabled){const o=this.dropdownMenuPlugin.menu,a=[{focus:()=>{const c=o.getNavigator(),u=Lh(this,Cl).getLastMenuPage();o.focus(),u>0?c.setCurrentPage(u):c.toFirstItem()}},...Array.from(this.components).map(c=>{let[,u]=c;return u.getElements()}).flat()];tpe(this,Cl,Zme(o,a));const l=c=>{Lh(this,Cl).listen(),c.preventDefault(),Cf(c.keyCode,"TAB")&&(c.shiftKey?Lh(this,Cl).toPreviousItem():Lh(this,Cl).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((r,n)=>{r.destroy(),this.components.set(n,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:IO})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(IO)}addCondition(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Da;const s=this.hot.toPhysicalColumn(e);this.conditionCollection.addCondition(s,{command:{key:r},args:n},i)}removeConditions(e){const r=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(r)}clearConditions(e){if(e===void 0)this.conditionCollection.clean();else{const r=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(r)}}filter(){const{navigableHeaders:e}=this.hot.getSettings(),r=this._createDataFilter(),n=!this.conditionCollection.isEmpty();let i=[];const s=this.conditionCollection.exportAllConditions();if(this.hot.runHooks("beforeFilter",s)!==!1)if(n){const a=[];this.hot.batchExecution(()=>{this.filtersRowsMap.clear(),i=ht(r.filter(),c=>c.meta.visualRow);const l=Of(i);Ue(this.hot.countSourceRows()-1,c=>{l(c)||a.push(c)}),j(a,c=>{this.filtersRowsMap.setValueAtIndex(c,!0)})},!0),!e&&!i.length&&this.hot.deselectCell()}else this.filtersRowsMap.clear();this.hot.runHooks("afterFilter",s),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 r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r?{visualIndex:r.col,physicalIndex:this.hot.toPhysicalColumn(r.col)}:null}getDataMapAtColumn(e){const r=this.hot.toVisualColumn(e),n=[];return j(this.hot.getSourceDataAtCol(r),(i,s)=>{var o;const{row:a,col:l,visualCol:c,visualRow:u,type:h,instance:d,dateFormat:f,locale:g}=this.hot.getCellMeta(s,r),m=(o=this.hot.getDataAtCell(this.hot.toVisualRow(s),r))!==null&&o!==void 0?o:i;n.push({meta:{row:a,col:l,visualCol:c,visualRow:u,type:h,instance:d,dateFormat:f,locale:g},value:w$(m)})}),n}updateValueComponentCondition(e){const r=this.hot.getDataAtCol(e),n=hS(r);this.conditionUpdateObserver.updateStatesAtColumn(e,n)}restoreComponents(e){var r;const n=(r=this.getSelectedColumn())===null||r===void 0?void 0:r.physicalIndex;e.forEach(i=>{i.isHidden()||i.restoreState(n)}),this.updateDependentComponentsVisibility()}getOperationBasedOnArguments(e,r,n,i){let s=e;return s===Lm&&r.command.key!==Br&&n.command.key!==Br&&i.command.key!==Br?s=wE:i.command.key!==Br&&(r.command.key===Br||n.command.key===Br)&&(s=Da),s}setListeningDropdownMenu(){this.dropdownMenuPlugin&&this.dropdownMenuPlugin.setListening()}updateDependentComponentsVisibility(){const e=this.components.get("filter_by_condition"),{command:r}=e.getState(),n=[this.components.get("filter_by_condition2"),this.components.get("filter_operators")];r.showOperators?this.showComponents(...n):this.hideComponents(...n)}_createDataFilter(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.conditionCollection;return new O$(e,r=>this.getDataMapAtColumn(r))}getIndexesOfComponents(){const e=[];if(!this.dropdownMenuPlugin)return e;const r=this.dropdownMenuPlugin.menu;for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return j(i,o=>{j(r.menuItems,(a,l)=>{a.key===o.getMenuItemDescriptor().key&&e.push(l)})}),e}changeComponentsVisibility(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(!this.dropdownMenuPlugin)return;const n=this.dropdownMenuPlugin.menu.hotMenu,i=n.getPlugin("hiddenRows");for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];const l=this.getIndexesOfComponents(...o);e?i.showRows(l):i.hideRows(l),n.render()}hideComponents(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.changeComponentsVisibility(!1,...r)}showComponents(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.changeComponentsVisibility(!0,...r)}destroy(){this.enabled&&(this.components.forEach((e,r)=>{e!==null&&(e.destroy(),this.components.set(r,null))}),this.conditionCollection.destroy(),this.conditionUpdateObserver.destroy(),this.hot.rowIndexMapper.unregisterMap(this.pluginName)),super.destroy()}}function ope(t){t&&j(t,e=>{const[,r]=e,n=this.hot.propToCol(r);this.conditionCollection.hasConditions(n)&&this.updateValueComponentCondition(n)})}function ape(){this.restoreComponents(Array.from(this.components.values()))}function lpe(){this.components.get("filter_by_condition").getSelectElement().closeOptions(),this.components.get("filter_by_condition2").getSelectElement().closeOptions()}function cpe(t){t.items.push({name:ut}),this.components.forEach(e=>{t.items.push(e.getMenuItemDescriptor())})}function $O(t){var e;if(t==="accept"){const n=this.getSelectedColumn();if(n===null){var r;(r=this.dropdownMenuPlugin)===null||r===void 0||r.close();return}const{physicalIndex:i}=n,s=this.components.get("filter_by_condition").getState(),o=this.components.get("filter_by_condition2").getState(),a=this.components.get("filter_by_value").getState(),l=this.getOperationBasedOnArguments(this.components.get("filter_operators").getActiveOperationId(),s,o,a);this.conditionUpdateObserver.groupChanges();let c=this.conditionCollection.getColumnStackPosition(i);c===-1&&(c=void 0),this.conditionCollection.removeConditions(i),s.command.key!==Br&&(this.conditionCollection.addCondition(i,s,l,c),o.command.key!==Br&&this.conditionCollection.addCondition(i,o,l,c)),a.command.key!==Br&&this.conditionCollection.addCondition(i,a,l,c),this.conditionUpdateObserver.flush(),this.components.forEach(u=>u.saveState(i)),this.filtersRowsMap.clear(),this.filter()}(e=this.dropdownMenuPlugin)===null||e===void 0||e.close()}function upe(t,e){this.updateDependentComponentsVisibility(),t.constructor===dS&&!e.inputsCount&&this.setListeningDropdownMenu()}function BO(){this.setListeningDropdownMenu()}function hpe(t,e){const r=this.hot.toPhysicalColumn(t);this.enabled&&this.conditionCollection.hasConditions(r)?be(e,"htFiltersActive"):rt(e,"htFiltersActive")}function dpe(t){var e;if(!((e=this.dropdownMenuPlugin)!==null&&e!==void 0&&e.enabled))return;const{editedConditionStack:{conditions:r,column:n}}=t,i=r.filter(o=>o.name===Hl),s=r.filter(o=>o.name!==Hl);if(i.length>=2||s.length>=3)Ft(Pt`The filter conditions have been applied properly, but couldn’t be displayed visually.\x20
  118. The overall amount of conditions exceed the capability of the dropdown menu.\x20
  119. For more details see the documentation.`);else{const o=this.conditionCollection.getOperation(n);this.components.get("filter_by_condition").updateState(s[0],n),this.components.get("filter_by_condition2").updateState(s[1],n),this.components.get("filter_operators").updateState(o,n),this.components.get("filter_by_value").updateState(t)}}const k$="internal-use-in-handsontable",gS={licenseKey:k$,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 N$(t){var e;return{maxColumns:t.maxColumns,maxRows:t.maxRows,language:(e=t[ln])===null||e===void 0||(e=e.language)===null||e===void 0?void 0:e.langCode}}function H$(t){return Object.keys(t).reduce((e,r)=>(r!=="hyperformula"&&(e[r]=t[r]),e),{})}function fpe(t){var e;const r=t[ln],n=H$(r!=null&&(e=r.engine)!==null&&e!==void 0&&e.hyperformula?r.engine:{}),i=N$(t);return yt(yt(yt({},gS),n),i)}function gpe(t){var e;const r=t[ln],n=H$(r!=null&&(e=r.engine)!==null&&e!==void 0&&e.hyperformula?r.engine:{}),i=N$(t);return yt(yt({},n),i)}function mpe(t,e){return Object.keys(e).some(r=>e[r]!==void 0&&e[r]!==t[r])}function Jp(){const t="engine_relationship",e=Cs(ln);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function vE(){const t="shared_engine_usage",e=Cs(ln);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function ppe(t){const e=t.getSettings(),r=e[ln],n=r==null?void 0:r.engine;if(r===!0||Gt(n))return null;if(typeof n.hyperformula=="function"||typeof n=="function"){var i;return wpe((i=n.hyperformula)!==null&&i!==void 0?i:n,e,t)}else if(typeof n=="object"&&Gt(n.hyperformula)){const s=Jp(),o=vE().get(n);return s.has(n)||s.set(n,[]),s.get(n).push(t),o&&o.push(t.guid),n.getConfig().licenseKey||n.updateConfig({licenseKey:k$}),(n.getConfig().leapYear1900!==gS.leapYear1900||Wy(n.getConfig().nullDate,gS.nullDate)===!1)&&Ft(Pt`If you use HyperFormula with Handsontable, keep the default \`leapYear1900\` and \`nullDate\`
  120. settings. Otherwise, HyperFormula's dates may not sync correctly with Handsontable's dates.`),n}return null}function wpe(t,e,r){const n=e[ln],i=fpe(e),s=Jp(),o=vE();vpe(t,n.functions),Cpe(t,n.language);const a=t.buildEmpty(i);return s.set(a,[r]),o.set(a,[r.guid]),Spe(a,n.namedExpressions),a.on("sheetAdded",()=>{a.rebuildAndRecalculate()}),a.on("sheetRemoved",()=>{a.rebuildAndRecalculate()}),a}function WO(t){var e;const r=Jp(),n=r.size===0?[]:Array.from((e=r.get(t))!==null&&e!==void 0?e:[]);return new Map(n.map(i=>[i.getPlugin("formulas").sheetId,i]))}function VO(t,e){if(t){const r=Jp(),n=r.get(t),i=vE(),s=i.get(t);n&&n.includes(e)&&(n.splice(n.indexOf(e),1),n.length===0&&r.delete(t)),s&&s.includes(e.guid)&&(s.splice(s.indexOf(e.guid),1),s.length===0&&(i.delete(t),t.destroy()))}}function vpe(t,e){e&&e.forEach(r=>{const{name:n,plugin:i,translations:s}=r;try{t.registerFunction(n,i,s)}catch(o){Ft(o.message)}})}function Cpe(t,e){if(e){const{langCode:r}=e;try{t.registerLanguage(r,e)}catch(n){Ft(n.message)}}}function Spe(t,e){e&&(t.suspendEvaluation(),e.forEach(r=>{const{name:n,expression:i,scope:s,options:o}=r;try{t.addNamedExpression(n,i,s,o)}catch(a){Ft(a.message)}}),t.resumeEvaluation())}function ype(t,e){return(Gt(e)||!t.doesSheetExist(e))&&(e=t.addSheet(e)),e}const F$="DD/MM/YYYY";function L$(t){return typeof t=="string"&&t.charAt(0)==="'"&&t.charAt(1)==="="}function xpe(t){return L$(t)?t.substr(1):t}function bpe(t){return typeof t=="string"&&t.startsWith("=")}function CE(t,e){return typeof t=="string"&&e==="date"}function $$(t,e){return ye(t,e,!0).isValid()}function B$(t,e){return ye(t,e,!0).format(F$)}function Epe(t,e){return ye(t,F$,!0).format(e)}function W$(t,e){const n=new Date(Date.UTC(0,0,t+-1));return ye(n).format(e)}function Sl(t,e,r){Rpe(t,e),e.set(t,r)}function Rpe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function zt(t,e){var r=V$(t,e,"get");return Tpe(t,r)}function Tpe(t,e){return e.get?e.get.call(t):e.value}function la(t,e,r){var n=V$(t,e,"set");return _pe(t,n,r),r}function V$(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function _pe(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}var $h=new WeakMap,ca=new WeakMap,ei=new WeakMap,a0=new WeakMap,dC=new WeakMap,fC=new WeakMap,l0=new WeakMap;class Ape{constructor(e,r,n){Sl(this,$h,{writable:!0,value:void 0}),Sl(this,ca,{writable:!0,value:void 0}),Sl(this,ei,{writable:!0,value:void 0}),Sl(this,a0,{writable:!0,value:[]}),Sl(this,dC,{writable:!0,value:[]}),Sl(this,fC,{writable:!0,value:void 0}),Sl(this,l0,{writable:!0,value:[]}),la(this,$h,e),la(this,ca,r),la(this,ei,n)}setRemovedHfIndexes(e){return la(this,l0,e.map(r=>{const n=zt(this,ca).getVisualFromPhysicalIndex(r);return this.getHfIndexFromVisualIndex(n)})),zt(this,l0)}getRemovedHfIndexes(){return zt(this,l0)}getHfIndexFromVisualIndex(e){const r=zt(this,ca).getIndexesSequence(),n=zt(this,ca).getNotTrimmedIndexes();return r.indexOf(n[e])}syncMoves(e){const n=`move${gs(zt(this,$h))}s`;zt(this,ei).getEngine().batch(()=>{e.forEach(i=>{const s=i.from!==i.to,o=i.from+1!==i.to;s&&o&&zt(this,ei).getEngine()[n](zt(this,ei).getSheetId(),i.from,1,i.to)})})}storeMovesInformation(e,r,n){n!==!1&&(la(this,dC,e.map(i=>this.getHfIndexFromVisualIndex(i))),la(this,fC,this.getHfIndexFromVisualIndex(r)))}getMoveLine(e,r){const n=zt(this,ca).getNumberOfIndexes(),i=Array.from(Array(n).keys()).filter(o=>e.includes(o)===!1);if(r===0){var s;return(s=i[r])!==null&&s!==void 0?s:0}return i[r-1]+1}getInitiallyCalculatedMoves(e,r){let n=this.getMoveLine(e,r);const i=[];return e.forEach(s=>{const o={from:s,to:n};i.forEach(a=>{const l=a.from>a.to,c=a.to<=o.from;a.from>o.from&&c&&l&&(o.from+=1)}),o.from>=n&&(n+=1),i.push(o)}),i}adjustedCalculatedMoves(e){return e.forEach((r,n)=>{e.slice(n+1).forEach(s=>{const o=s.from<s.to;s.from>r.from&&o&&(s.from-=1)})}),e}calculateAndSyncMoves(e,r){if(zt(this,ei).isPerformingUndoRedo()||e===!1||r===!1)return;const n=this.adjustedCalculatedMoves(this.getInitiallyCalculatedMoves(zt(this,dC),zt(this,fC)));zt(this,ei).getSheetId()===null?zt(this,ei).getPostponeAction(()=>this.syncMoves(n)):this.syncMoves(n)}getIndexesChangeSyncMethod(){const e=`set${gs(zt(this,$h))}Order`;return r=>{if(zt(this,ei).isPerformingUndoRedo())return;const n=zt(this,ca).getIndexesSequence();if(r==="update"){const i=zt(this,a0).map(l=>n.indexOf(l)),s=zt(this,ei).getEngine().getSheetDimensions(zt(this,ei).getSheetId());let o;zt(this,$h)==="row"?o=s.height:o=s.width;const a=i.length;for(let l=a;l<o;l+=1)i.push(l);zt(this,ei).getEngine()[e](zt(this,ei).getSheetId(),i)}la(this,a0,n)}}init(){la(this,a0,zt(this,ca).getIndexesSequence())}}const UO=Ape;function yl(t,e,r){Mpe(t,e),e.set(t,r)}function Mpe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function po(t,e){var r=U$(t,e,"get");return Ope(t,r)}function Ope(t,e){return e.get?e.get.call(t):e.value}function xl(t,e,r){var n=U$(t,e,"set");return Ipe(t,n,r),r}function U$(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function Ipe(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}var c0=new WeakMap,u0=new WeakMap,gC=new WeakMap,mC=new WeakMap,pC=new WeakMap,wC=new WeakMap,vC=new WeakMap;class Ppe{constructor(e,r,n){yl(this,c0,{writable:!0,value:void 0}),yl(this,u0,{writable:!0,value:void 0}),yl(this,gC,{writable:!0,value:void 0}),yl(this,mC,{writable:!0,value:!1}),yl(this,pC,{writable:!0,value:!1}),yl(this,wC,{writable:!0,value:null}),yl(this,vC,{writable:!0,value:null}),xl(this,c0,new UO("row",e,this)),xl(this,u0,new UO("column",r,this)),xl(this,gC,n)}getForAxis(e){return e==="row"?po(this,c0):po(this,u0)}setPerformUndo(e){xl(this,mC,e)}setPerformRedo(e){xl(this,pC,e)}isPerformingUndoRedo(){return po(this,mC)||po(this,pC)}getSheetId(){return po(this,vC)}getEngine(){return po(this,wC)}getPostponeAction(){return po(this,gC)}setupSyncEndpoint(e,r){xl(this,wC,e),xl(this,vC,r),po(this,c0).init(),po(this,u0).init()}}const Dpe=Ppe;function Zt(t,e){G$(t,e),e.add(t)}function Uc(t,e,r){return e=kpe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function kpe(t){var e=Npe(t,"string");return typeof e=="symbol"?e:String(e)}function Npe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function CC(t,e,r){G$(t,e),e.set(t,r)}function G$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ba(t,e,r){var n=Y$(t,e,"set");return Hpe(t,n,r),r}function Hpe(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function Tu(t,e){var r=Y$(t,e,"get");return Fpe(t,r)}function Y$(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function Fpe(t,e){return e.get?e.get.call(t):e.value}function Wt(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}const ln="formulas",Lpe=["maxRows","maxColumns","language"],$pe=260;$e.getSingleton().register("afterNamedExpressionAdded");$e.getSingleton().register("afterNamedExpressionRemoved");$e.getSingleton().register("afterSheetAdded");$e.getSingleton().register("afterSheetRemoved");$e.getSingleton().register("afterSheetRenamed");$e.getSingleton().register("afterFormulasValuesUpdate");const Xu=t=>t==="UndoRedo.undo"||t==="UndoRedo.redo"||t==="auto";var Bo=new WeakMap,SE=new WeakMap,Bh=new WeakMap,GO=new WeakSet,YO=new WeakSet,SC=new WeakSet,zO=new WeakSet,yC=new WeakSet,jO=new WeakSet,KO=new WeakSet,xC=new WeakSet,XO=new WeakSet,qO=new WeakSet,ZO=new WeakSet,JO=new WeakSet,QO=new WeakSet,eI=new WeakSet,tI=new WeakSet,rI=new WeakSet,nI=new WeakSet,iI=new WeakSet,sI=new WeakSet,oI=new WeakSet,aI=new WeakSet,lI=new WeakSet,cI=new WeakSet,uI=new WeakSet;class Bpe extends It{constructor(){var e;super(...arguments),e=this,Zt(this,uI),Zt(this,cI),Zt(this,lI),Zt(this,aI),Zt(this,oI),Zt(this,sI),Zt(this,iI),Zt(this,nI),Zt(this,rI),Zt(this,tI),Zt(this,eI),Zt(this,QO),Zt(this,JO),Zt(this,ZO),Zt(this,qO),Zt(this,XO),Zt(this,xC),Zt(this,KO),Zt(this,jO),Zt(this,yC),Zt(this,zO),Zt(this,SC),Zt(this,YO),Zt(this,GO),CC(this,Bo,{writable:!0,value:!1}),CC(this,SE,{writable:!0,value:!1}),CC(this,Bh,{writable:!0,value:[["valuesUpdated",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Wt(e,sI,rwe).call(e,...n)}],["namedExpressionAdded",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Wt(e,oI,nwe).call(e,...n)}],["namedExpressionRemoved",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Wt(e,aI,iwe).call(e,...n)}],["sheetAdded",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Wt(e,lI,swe).call(e,...n)}],["sheetRenamed",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Wt(e,cI,owe).call(e,...n)}],["sheetRemoved",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Wt(e,uI,awe).call(e,...n)}]]}),Uc(this,"staticRegister",Cs("formulas")),Uc(this,"engine",null),Uc(this,"sheetName",null),Uc(this,"indexSyncer",null),Uc(this,"rowAxisSyncer",null),Uc(this,"columnAxisSyncer",null)}static get PLUGIN_KEY(){return ln}static get PLUGIN_PRIORITY(){return $pe}static get SETTING_KEYS(){return[ln,...Lpe]}get sheetId(){return this.sheetName===null?null:this.engine.getSheetId(this.sheetName)}isEnabled(){return!!this.hot.getSettings()[ln]}enablePlugin(){var e,r=this;if(!this.enabled){if(this.engine=(e=ppe(this.hot))!==null&&e!==void 0?e:this.engine,!this.engine){Ft("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 n=this.addSheet(this.sheetName,this.hot.getSourceDataArray());n!==!1&&(this.sheetName=n)}this.addHook("beforeLoadData",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Wt(r,SC,hI).call(r,...i)}),this.addHook("afterLoadData",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Wt(r,yC,dI).call(r,...i)}),this.addHook("beforeUpdateData",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Wt(r,SC,hI).call(r,...i)}),this.addHook("afterUpdateData",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Wt(r,yC,dI).call(r,...i)}),this.addHook("modifyData",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Wt(r,jO,Gpe).call(r,...i)}),this.addHook("modifySourceData",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Wt(r,KO,Ype).call(r,...i)}),this.addHook("beforeValidate",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Wt(r,GO,Wpe).call(r,...i)}),this.addHook("afterSetSourceDataAtCell",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Wt(r,XO,zpe).call(r,...i)}),this.addHook("afterSetDataAtCell",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Wt(r,xC,fI).call(r,...i)}),this.addHook("afterSetDataAtRowProp",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Wt(r,xC,fI).call(r,...i)}),this.addHook("beforeCreateRow",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Wt(r,qO,jpe).call(r,...i)}),this.addHook("beforeCreateCol",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Wt(r,ZO,Kpe).call(r,...i)}),this.addHook("afterCreateRow",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Wt(r,eI,Zpe).call(r,...i)}),this.addHook("afterCreateCol",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Wt(r,tI,Jpe).call(r,...i)}),this.addHook("beforeRemoveRow",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Wt(r,JO,Xpe).call(r,...i)}),this.addHook("beforeRemoveCol",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Wt(r,QO,qpe).call(r,...i)}),this.addHook("afterRemoveRow",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Wt(r,rI,Qpe).call(r,...i)}),this.addHook("afterRemoveCol",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Wt(r,nI,ewe).call(r,...i)}),this.indexSyncer=new Dpe(this.hot.rowIndexMapper,this.hot.columnIndexMapper,n=>{this.hot.addHookOnce("init",()=>{n()})}),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",(n,i,s,o)=>{this.rowAxisSyncer.storeMovesInformation(n,i,o)}),this.hot.addHook("beforeColumnMove",(n,i,s,o)=>{this.columnAxisSyncer.storeMovesInformation(n,i,o)}),this.hot.addHook("afterRowMove",(n,i,s,o,a)=>{this.rowAxisSyncer.calculateAndSyncMoves(o,a)}),this.hot.addHook("afterColumnMove",(n,i,s,o,a)=>{this.columnAxisSyncer.calculateAndSyncMoves(o,a)}),this.hot.addHook("beforeColumnFreeze",(n,i)=>{this.columnAxisSyncer.storeMovesInformation([n],this.hot.getSettings().fixedColumnsStart,i)}),this.hot.addHook("afterColumnFreeze",(n,i)=>{this.columnAxisSyncer.calculateAndSyncMoves(i,i)}),this.hot.addHook("beforeColumnUnfreeze",(n,i)=>{this.columnAxisSyncer.storeMovesInformation([n],this.hot.getSettings().fixedColumnsStart-1,i)}),this.hot.addHook("afterColumnUnfreeze",(n,i)=>{this.columnAxisSyncer.calculateAndSyncMoves(i,i)}),this.addHook("afterCellMetaReset",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Wt(r,zO,Upe).call(r,...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 n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Wt(r,iI,twe).call(r,...i)}),this.addHook("beforeAutofill",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Wt(r,YO,Vpe).call(r,...i)}),Tu(this,Bh).forEach(n=>{let[i,s]=n;return this.engine.on(i,s)}),super.enablePlugin()}}disablePlugin(){Tu(this,Bh).forEach(e=>{let[r,n]=e;return this.engine.off(r,n)}),VO(this.engine,this.hot),this.engine=null,super.disablePlugin()}updatePlugin(e){const r=gpe(this.hot.getSettings());mpe(this.engine.getConfig(),r)&&this.engine.updateConfig(r);const n=this.hot.getSettings()[ln];if(He(n)&&He(n.sheetName)&&n.sheetName!==this.sheetName&&this.switchSheet(n.sheetName),!e.data&&this.sheetName===null){const i=this.hot.getSettings()[ln].sheetName;i&&this.engine.doesSheetExist(i)?this.switchSheet(this.sheetName):this.sheetName=this.addSheet(i!=null?i:void 0,this.hot.getSourceDataArray())}super.updatePlugin(e)}destroy(){Tu(this,Bh).forEach(e=>{var r;let[n,i]=e;return(r=this.engine)===null||r===void 0?void 0:r.off(n,i)}),Ba(this,Bh,null),VO(this.engine,this.hot),this.engine=null,super.destroy()}addSheet(e,r){if(He(r)&&!_ie(r))return Ft("The provided data should be an array of arrays."),!1;if(e!=null&&this.engine.doesSheetExist(e))return Ft("Sheet with the provided name already exists."),!1;try{const n=this.engine.addSheet(e!=null?e:void 0);return r&&this.engine.setSheetContent(this.engine.getSheetId(n),r),n}catch(n){return Ft(n.message),!1}}switchSheet(e){if(!this.engine.doesSheetExist(e)){Yy(`The sheet named \`${e}\` does not exist, switch aborted.`);return}this.sheetName=e;const r=this.engine.getSheetSerialized(this.sheetId);r.length>0&&this.hot.loadData(r,`${gs(ln)}.switchSheet`)}getCellType(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.sheetId;const i=this.hot.toPhysicalRow(e),s=this.hot.toPhysicalColumn(r);return i!==null&&s!==null?this.engine.getCellType({sheet:n,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(r)}):"EMPTY"}isFormulaCellType(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.sheetId;return this.engine.doesCellHaveFormula({sheet:n,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(r)})}renderDependentSheets(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const n=new Set;e.forEach(i=>{var s;const o=i==null||(s=i.address)===null||s===void 0?void 0:s.sheet;o!==void 0&&(n.has(o)||n.add(o))}),WO(this.engine).forEach((i,s)=>{if((r||s!==this.sheetId)&&n.has(s)){var o;i.render(),(o=i.view)===null||o===void 0||o.adjustElementsSize()}})}validateDependentCells(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=s=>{var o;const{row:a,col:l,sheet:c}=(o=s==null?void 0:s.address)!==null&&o!==void 0?o:{};return He(c)?`${c}:${a}x${l}`:""},i=new Set(r.map(s=>n(s)));e.forEach(s=>{var o,a;const{row:l,col:c}=(o=s.address)!==null&&o!==void 0?o:{};if(He(l)===!1||He(c)===!1||l>=this.hot.countRows()||c>=this.hot.countCols())return;const u=s==null||(a=s.address)===null||a===void 0?void 0:a.sheet,h=n(s);if(u!==void 0&&!i.has(h)){const d=WO(this.engine).get(u);if(!d)return;d.validateCell(d.getDataAtCell(l,c),d.getCellMeta(l,c),()=>{})}})}syncChangeWithEngine(e,r,n){const i={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(r),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(i)){Ft(`Not possible to set cell data at ${JSON.stringify(i)}`);return}const s=this.hot.getCellMeta(e,r);return CE(n,s.type)&&($$(n,s.dateFormat)?n=B$(n,s.dateFormat):bpe(n)===!1&&(n=`'${n}`)),this.engine.setCellContents(i,n)}}function Wpe(t,e,r){const n=this.hot.propToCol(r);if(this.isFormulaCellType(e,n)){const i={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(n),sheet:this.sheetId},s=this.hot.getCellMeta(e,n);let o=this.engine.getCellValue(i);return s.type==="date"&&Zn(o)&&(o=W$(o,s.dateFormat)),typeof o=="object"&&o!==null?o.value:o}return t}function Vpe(t,e,r){const{row:n,col:i}=e.getTopStartCorner(),{row:s,col:o}=e.getBottomEndCorner(),{row:a,col:l}=r.getTopStartCorner(),{row:c,col:u}=r.getBottomEndCorner(),h={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(n),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(i),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(s),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(o),sheet:this.sheetId}},d={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(a),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(l),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(c),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(u),sheet:this.sheetId}};if(this.engine.isItPossibleToSetCellContents(d)===!1)return!1;const f=this.engine.getFillRangeData(h,d),{row:g,col:m}=h.start,{row:w,col:C}=h.end,S=w-g+1,v=C-m+1;for(let T=0;T<f.length;T+=1)for(let A=0;A<f[T].length;A+=1){const M=f[T][A],E=T%S,Y=A%v,D=this.hot.getCellMeta(E,Y);CE(M,D.type)&&(M.startsWith("'")?f[T][A]=M.slice(1):this.isFormulaCellType(E,Y,this.sheetId)===!1&&(f[T][A]=Epe(M,D.dateFormat)))}return f}function hI(t,e){(arguments.length>2&&arguments[2]!==void 0?arguments[2]:"").includes(gs(ln))||Ba(this,SE,Gt(this.hot.getSettings().data))}function Upe(){const t=this.hot.getSourceDataArray();let e=!1;t.forEach((r,n)=>{r.forEach((i,s)=>{const o=this.hot.getCellMeta(n,s),a=o.dateFormat;CE(i,o.type)&&(e=!0,$$(i,a)?t[n][s]=B$(i,a):this.isFormulaCellType(n,s)===!1&&(t[n][s]=`'${i}`))})}),e===!0&&(Ba(this,Bo,!0),this.engine.setSheetContent(this.sheetId,t),Ba(this,Bo,!1))}function dI(t,e){if(!(arguments.length>2&&arguments[2]!==void 0?arguments[2]:"").includes(gs(ln)))if(this.sheetName=ype(this.engine,this.hot.getSettings()[ln].sheetName),Tu(this,SE))this.switchSheet(this.sheetName);else{const n=this.hot.getSourceDataArray();if(this.engine.isItPossibleToReplaceSheetContent(this.sheetId,n)){Ba(this,Bo,!0);const i=this.engine.setSheetContent(this.sheetId,n);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(i),Ba(this,Bo,!1)}}}function Gpe(t,e,r,n){if(n!=="get"||Tu(this,Bo)||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"){L$(r.value)&&(r.value=xpe(r.value));return}const o={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(e),sheet:this.sheetId};let a=this.engine.getCellValue(o);const l=this.hot.getCellMeta(i,e);l.type==="date"&&Zn(a)&&(a=W$(a,l.dateFormat));const c=typeof a=="object"&&a!==null?a.value:a;r.value=c}function Ype(t,e,r,n){if(n!=="get"||Tu(this,Bo)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName))return;const i=this.hot.toVisualRow(t),s=this.hot.propToCol(e);if(i===null||s===null||!this.isFormulaCellType(i,s)&&this.getCellType(i,s)!=="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(s),sheet:this.sheetId};r.value=this.engine.getCellSerialized(l)}function fI(t,e){if(Xu(e))return;const r=[],n=[],i=this.engine.batch(()=>{t.forEach(s=>{let[o,a,,l]=s;const c=this.hot.propToCol(a),u=this.hot.toPhysicalRow(o),h=this.hot.toPhysicalColumn(c),d={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(o),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(c),sheet:this.sheetId};u!==null&&h!==null?this.syncChangeWithEngine(o,c,l):r.push([o,c,l]),n.push({address:d})})});r.length&&this.hot.addHookOnce("afterChange",()=>{const s=this.engine.batch(()=>{r.forEach(o=>{let[a,l,c]=o;this.syncChangeWithEngine(a,l,c)})});this.renderDependentSheets(s,!0)}),this.renderDependentSheets(i),this.validateDependentCells(i,n)}function zpe(t,e){if(Xu(e))return;const r=[],n=[];t.forEach(i=>{let[s,o,,a]=i;const l=this.hot.propToCol(o);if(!Zn(l))return;const c={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(s),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(l),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(c)){Ft(`Not possible to set source cell data at ${JSON.stringify(c)}`);return}n.push({address:c}),r.push(...this.engine.setCellContents(c,a))}),this.renderDependentSheets(r),this.validateDependentCells(r,n)}function jpe(t,e){let r=this.rowAxisSyncer.getHfIndexFromVisualIndex(t);if(t>=this.hot.countRows()&&(r=t),this.sheetId===null||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddRows(this.sheetId,[r,e]))return!1}function Kpe(t,e){let r=this.columnAxisSyncer.getHfIndexFromVisualIndex(t);if(t>=this.hot.countCols()&&(r=t),this.sheetId===null||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddColumns(this.sheetId,[r,e]))return!1}function Xpe(t,e,r){return this.rowAxisSyncer.setRemovedHfIndexes(r).every(s=>this.engine.isItPossibleToRemoveRows(this.sheetId,[s,1]))===!1?!1:void 0}function qpe(t,e,r){return this.columnAxisSyncer.setRemovedHfIndexes(r).every(s=>this.engine.isItPossibleToRemoveColumns(this.sheetId,[s,1]))===!1?!1:void 0}function Zpe(t,e,r){if(Xu(r))return;const n=this.engine.addRows(this.sheetId,[this.rowAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(n)}function Jpe(t,e,r){if(Xu(r))return;const n=this.engine.addColumns(this.sheetId,[this.columnAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(n)}function Qpe(t,e,r,n){if(Xu(n))return;const i=this.rowAxisSyncer.getRemovedHfIndexes().sort().reverse(),s=this.engine.batch(()=>{i.forEach(o=>{this.engine.removeRows(this.sheetId,[o,1])})});this.renderDependentSheets(s)}function ewe(t,e,r,n){if(Xu(n))return;const i=this.columnAxisSyncer.getRemovedHfIndexes().sort().reverse(),s=this.engine.batch(()=>{i.forEach(o=>{this.engine.removeColumns(this.sheetId,[o,1])})});this.renderDependentSheets(s)}function twe(t,e,r){var n;Ba(this,Bo,!0);const i=this.hot.getSourceDataArray(r,0,r+(((n=e.__children)===null||n===void 0?void 0:n.length)||0),this.hot.countSourceCols());Ba(this,Bo,!1),i.forEach((s,o)=>{s.forEach((a,l)=>{this.engine.setCellContents({col:l,row:r+o,sheet:this.sheetId},[[a]])})})}function rwe(t){this.hot.runHooks("afterFormulasValuesUpdate",t)}function nwe(t,e){this.hot.runHooks("afterNamedExpressionAdded",t,e)}function iwe(t,e){this.hot.runHooks("afterNamedExpressionRemoved",t,e)}function swe(t){this.hot.runHooks("afterSheetAdded",t)}function owe(t,e){this.hot.runHooks("afterSheetRenamed",t,e)}function awe(t,e){this.hot.runHooks("afterSheetRemoved",t,e)}function lwe(t){return{key:"hidden_columns_hide",name(){const e=this.getSelectedLast();let r=0;if(Array.isArray(e)){const[,n,,i]=e;n-i!==0&&(r=1)}return this.getTranslatedPhrase(sb,r)},callback(){const{from:e,to:r}=this.getSelectedRangeLast(),n=Math.max(Math.min(e.col,r.col),0),i=Math.max(e.col,r.col),s=[];for(let l=n;l<=i;l+=1)s.push(l);t.hideColumns(s);const o=s[s.length-1],a=this.columnIndexMapper.getNearestNotHiddenIndex(o,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 cwe(t){const e=[];return{key:"hidden_columns_show",name(){const r=e.length>1?1:0;return this.getTranslatedPhrase(ob,r)},callback(){var r,n;if(e.length===0)return;let i=e[0],s=e[e.length-1];i=(r=this.columnIndexMapper.getNearestNotHiddenIndex(i-1,-1))!==null&&r!==void 0?r:0,s=(n=this.columnIndexMapper.getNearestNotHiddenIndex(s+1,1))!==null&&n!==void 0?n:this.countCols()-1,t.showColumns(e),this.render(),this.view.adjustElementsSize(!0),s-i+1===this.countCols()||this.selectColumns(i,s)},disabled:!1,hidden(){const r=ht(t.getHiddenColumns(),h=>this.toPhysicalColumn(h));if(!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())||r.length<1)return!0;e.length=0;const n=this.getSelectedRangeLast(),i=n.getTopStartCorner().col,s=n.getBottomEndCorner().col,o=this.columnIndexMapper,a=o.getRenderableFromVisualIndex(i),l=o.getRenderableFromVisualIndex(s),c=o.getNotTrimmedIndexes(),u=[];if(i!==s){const h=s-i+1,d=l-a+1;if(h>d){const f=c.slice(i,s+1);u.push(...f.filter(g=>r.includes(g)))}}else if(a===0&&a<i)u.push(...c.slice(0,i));else if(a===null)u.push(...c.slice(0,this.countCols()));else{const h=this.countCols()-1,d=o.getRenderableFromVisualIndex(o.getNearestNotHiddenIndex(h,-1));l===d&&h>s&&u.push(...c.slice(s+1))}return j(u,h=>{e.push(this.toVisualColumn(h))}),e.length===0}}}function Gc(t,e){z$(t,e),e.add(t)}function gI(t,e,r){z$(t,e),e.set(t,r)}function z$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Yc(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function ai(t,e){var r=j$(t,e,"get");return uwe(t,r)}function uwe(t,e){return e.get?e.get.call(t):e.value}function Wh(t,e,r){var n=j$(t,e,"set");return hwe(t,n,r),r}function j$(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function hwe(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}$e.getSingleton().register("beforeHideColumns");$e.getSingleton().register("afterHideColumns");$e.getSingleton().register("beforeUnhideColumns");$e.getSingleton().register("afterUnhideColumns");const bC="hiddenColumns",dwe=310;var js=new WeakMap,Ps=new WeakMap,mI=new WeakSet,pI=new WeakSet,wI=new WeakSet,vI=new WeakSet,CI=new WeakSet,SI=new WeakSet;class fwe extends It{constructor(){super(...arguments),Gc(this,SI),Gc(this,CI),Gc(this,vI),Gc(this,wI),Gc(this,pI),Gc(this,mI),gI(this,js,{writable:!0,value:{}}),gI(this,Ps,{writable:!0,value:null})}static get PLUGIN_KEY(){return bC}static get PLUGIN_PRIORITY(){return dwe}isEnabled(){return!!this.hot.getSettings()[bC]}enablePlugin(){var e=this;if(this.enabled)return;const r=this.hot.getSettings()[bC];at(r)&&(Wh(this,js,r),Gt(r.copyPasteEnabled)&&(r.copyPasteEnabled=!0)),Wh(this,Ps,new Pp),ai(this,Ps).addLocalHook("init",()=>Yc(this,SI,Cwe).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,ai(this,Ps)),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Yc(e,CI,vwe).call(e,...i)}),this.addHook("afterGetCellMeta",(n,i,s)=>Yc(this,pI,mwe).call(this,n,i,s)),this.addHook("modifyColWidth",(n,i)=>Yc(this,mI,gwe).call(this,n,i)),this.addHook("afterGetColHeader",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Yc(e,vI,wwe).call(e,...i)}),this.addHook("modifyCopyableRange",n=>Yc(this,wI,pwe).call(this,n)),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.hot.columnIndexMapper.unregisterMap(this.pluginName),Wh(this,js,{}),super.disablePlugin(),this.resetCellsMeta()}showColumns(e){const r=this.getHiddenColumns(),n=this.isValidConfig(e);let i=r;const s=ai(this,Ps).getValues().slice(),o=e.length>0;if(n&&o){const l=e.map(c=>this.hot.toPhysicalColumn(c));j(l,c=>{s[c]=!1}),i=Cn(s,(c,u,h)=>(u&&c.push(this.hot.toVisualColumn(h)),c),[])}this.hot.runHooks("beforeUnhideColumns",r,i,n&&o)!==!1&&(n&&o&&ai(this,Ps).setValues(s),this.hot.view.adjustElementsSize(),this.hot.runHooks("afterUnhideColumns",r,i,n&&o,n&&i.length<r.length))}showColumn(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.showColumns(r)}hideColumns(e){const r=this.getHiddenColumns(),n=this.isValidConfig(e);let i=r;n&&(i=Array.from(new Set(r.concat(e)))),this.hot.runHooks("beforeHideColumns",r,i,n)!==!1&&(n&&this.hot.batchExecution(()=>{j(e,o=>{ai(this,Ps).setValueAtIndex(this.hot.toPhysicalColumn(o),!0)})},!0),this.hot.runHooks("afterHideColumns",r,i,n,n&&i.length>r.length))}hideColumn(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.hideColumns(r)}getHiddenColumns(){return ht(ai(this,Ps).getHiddenIndexes(),e=>this.hot.toVisualColumn(e))}isHidden(e){return ai(this,Ps).getValueAtIndex(this.hot.toPhysicalColumn(e))||!1}isValidConfig(e){const r=this.hot.countCols();return Array.isArray(e)&&e.length>0?e.every(n=>Number.isInteger(n)&&n>=0&&n<r):!1}resetCellsMeta(){j(this.hot.getCellsMeta(),e=>{e&&(e.skipColumnOnPaste=!1)})}destroy(){Wh(this,js,null),Wh(this,Ps,null),super.destroy()}}function gwe(t,e){if(this.isHidden(e))return 0;if(ai(this,js).indicators&&(this.isHidden(e+1)||this.isHidden(e-1))&&typeof t=="number"&&this.hot.hasColHeaders())return t+15}function mwe(t,e,r){if(ai(this,js).copyPasteEnabled===!1&&this.isHidden(e)&&(r.skipColumnOnPaste=!0),this.isHidden(e-1))r.className=r.className||"",r.className.indexOf("afterHiddenColumn")===-1&&(r.className+=" afterHiddenColumn");else if(r.className){const n=r.className.split(" ");if(n.length>0){const i=n.indexOf("afterHiddenColumn");i>-1&&n.splice(i,1),r.className=n.join(" ")}}}function pwe(t){if(ai(this,js).copyPasteEnabled)return t;const e=[],r=(n,i,s,o)=>{e.push({startRow:n,endRow:i,startCol:s,endCol:o})};return j(t,n=>{let i=!0,s=0;Ue(n.startCol,n.endCol,o=>{this.isHidden(o)?(i||r(n.startRow,n.endRow,s,o-1),i=!0):(i&&(s=o),o===n.endCol&&r(n.startRow,n.endRow,s,o),i=!1)})}),e}function wwe(t,e){if(!ai(this,js).indicators||t<0)return;const r=[];t>=1&&this.isHidden(t-1)&&r.push("afterHiddenColumn"),t<this.hot.countCols()-1&&this.isHidden(t+1)&&r.push("beforeHiddenColumn"),be(e,r)}function vwe(t){t.items.push({name:ut},lwe(this),cwe(this))}function Cwe(){Array.isArray(ai(this,js).columns)&&this.hideColumns(ai(this,js).columns)}function Swe(t){return{key:"hidden_rows_hide",name(){const e=this.getSelectedLast();let r=0;if(Array.isArray(e)){const[n,,i]=e;n-i!==0&&(r=1)}return this.getTranslatedPhrase(ab,r)},callback(){const{from:e,to:r}=this.getSelectedRangeLast(),n=Math.max(Math.min(e.row,r.row),0),i=Math.max(e.row,r.row),s=[];for(let l=n;l<=i;l+=1)s.push(l);t.hideRows(s);const o=s[s.length-1],a=this.rowIndexMapper.getNearestNotHiddenIndex(o,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 ywe(t){const e=[];return{key:"hidden_rows_show",name(){const r=e.length>1?1:0;return this.getTranslatedPhrase(lb,r)},callback(){var r,n;if(e.length===0)return;let i=e[0],s=e[e.length-1];i=(r=this.rowIndexMapper.getNearestNotHiddenIndex(i-1,-1))!==null&&r!==void 0?r:0,s=(n=this.rowIndexMapper.getNearestNotHiddenIndex(s+1,1))!==null&&n!==void 0?n:this.countRows()-1,t.showRows(e),this.render(),this.view.adjustElementsSize(!0),s-i+1===this.countRows()||this.selectRows(i,s)},disabled:!1,hidden(){const r=ht(t.getHiddenRows(),h=>this.toPhysicalRow(h));if(!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())||r.length<1)return!0;e.length=0;const n=this.getSelectedRangeLast(),i=n.getTopStartCorner().row,s=n.getBottomEndCorner().row,o=this.rowIndexMapper,a=o.getRenderableFromVisualIndex(i),l=o.getRenderableFromVisualIndex(s),c=o.getNotTrimmedIndexes(),u=[];if(i!==s){const h=s-i+1,d=l-a+1;if(h>d){const f=c.slice(i,s+1);u.push(...f.filter(g=>r.includes(g)))}}else if(a===0&&a<i)u.push(...c.slice(0,i));else if(a===null)u.push(...c.slice(0,this.countRows()));else{const h=this.countRows()-1,d=o.getRenderableFromVisualIndex(o.getNearestNotHiddenIndex(h,-1));l===d&&h>s&&u.push(...c.slice(s+1))}return j(u,h=>{e.push(this.toVisualRow(h))}),e.length===0}}}function zc(t,e){K$(t,e),e.add(t)}function yI(t,e,r){K$(t,e),e.set(t,r)}function K$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jc(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function Oi(t,e){var r=X$(t,e,"get");return xwe(t,r)}function xwe(t,e){return e.get?e.get.call(t):e.value}function Vh(t,e,r){var n=X$(t,e,"set");return bwe(t,n,r),r}function X$(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function bwe(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}$e.getSingleton().register("beforeHideRows");$e.getSingleton().register("afterHideRows");$e.getSingleton().register("beforeUnhideRows");$e.getSingleton().register("afterUnhideRows");const EC="hiddenRows",Ewe=320;var Io=new WeakMap,Ds=new WeakMap,xI=new WeakSet,bI=new WeakSet,EI=new WeakSet,RI=new WeakSet,TI=new WeakSet,_I=new WeakSet;class Rwe extends It{constructor(){super(...arguments),zc(this,_I),zc(this,TI),zc(this,RI),zc(this,EI),zc(this,bI),zc(this,xI),yI(this,Io,{writable:!0,value:{}}),yI(this,Ds,{writable:!0,value:null})}static get PLUGIN_KEY(){return EC}static get PLUGIN_PRIORITY(){return Ewe}isEnabled(){return!!this.hot.getSettings()[EC]}enablePlugin(){var e=this;if(this.enabled)return;const r=this.hot.getSettings()[EC];at(r)&&(Vh(this,Io,r),Gt(r.copyPasteEnabled)&&(r.copyPasteEnabled=!0)),Vh(this,Ds,new Pp),Oi(this,Ds).addLocalHook("init",()=>jc(this,_I,Iwe).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,Oi(this,Ds)),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return jc(e,TI,Owe).call(e,...i)}),this.addHook("afterGetCellMeta",(n,i,s)=>jc(this,bI,_we).call(this,n,i,s)),this.addHook("modifyRowHeight",(n,i)=>jc(this,xI,Twe).call(this,n,i)),this.addHook("afterGetRowHeader",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return jc(e,RI,Mwe).call(e,...i)}),this.addHook("modifyCopyableRange",n=>jc(this,EI,Awe).call(this,n)),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap(this.pluginName),Vh(this,Io,{}),super.disablePlugin(),this.resetCellsMeta()}showRows(e){const r=this.getHiddenRows(),n=this.isValidConfig(e);let i=r;const s=Oi(this,Ds).getValues().slice(),o=e.length>0;if(n&&o){const l=e.map(c=>this.hot.toPhysicalRow(c));j(l,c=>{s[c]=!1}),i=Cn(s,(c,u,h)=>(u&&c.push(this.hot.toVisualRow(h)),c),[])}this.hot.runHooks("beforeUnhideRows",r,i,n&&o)!==!1&&(n&&o&&Oi(this,Ds).setValues(s),this.hot.runHooks("afterUnhideRows",r,i,n&&o,n&&i.length<r.length))}showRow(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.showRows(r)}hideRows(e){const r=this.getHiddenRows(),n=this.isValidConfig(e);let i=r;n&&(i=Array.from(new Set(r.concat(e)))),this.hot.runHooks("beforeHideRows",r,i,n)!==!1&&(n&&this.hot.batchExecution(()=>{j(e,o=>{Oi(this,Ds).setValueAtIndex(this.hot.toPhysicalRow(o),!0)})},!0),this.hot.runHooks("afterHideRows",r,i,n,n&&i.length>r.length))}hideRow(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.hideRows(r)}getHiddenRows(){return ht(Oi(this,Ds).getHiddenIndexes(),e=>this.hot.toVisualRow(e))}isHidden(e){return Oi(this,Ds).getValueAtIndex(this.hot.toPhysicalRow(e))||!1}isValidConfig(e){const r=this.hot.countRows();return Array.isArray(e)&&e.length>0?e.every(n=>Number.isInteger(n)&&n>=0&&n<r):!1}resetCellsMeta(){j(this.hot.getCellsMeta(),e=>{e&&(e.skipRowOnPaste=!1)})}destroy(){Vh(this,Io,null),Vh(this,Ds,null),super.destroy()}}function Twe(t,e){return this.isHidden(e)?0:t}function _we(t,e,r){if(Oi(this,Io).copyPasteEnabled===!1&&this.isHidden(t)&&(r.skipRowOnPaste=!0),this.isHidden(t-1))r.className=r.className||"",r.className.indexOf("afterHiddenRow")===-1&&(r.className+=" afterHiddenRow");else if(r.className){const n=r.className.split(" ");if(n.length>0){const i=n.indexOf("afterHiddenRow");i>-1&&n.splice(i,1),r.className=n.join(" ")}}}function Awe(t){if(Oi(this,Io).copyPasteEnabled)return t;const e=[],r=(n,i,s,o)=>{e.push({startRow:n,endRow:i,startCol:s,endCol:o})};return j(t,n=>{let i=!0,s=0;Ue(n.startRow,n.endRow,o=>{this.isHidden(o)?(i||r(s,o-1,n.startCol,n.endCol),i=!0):(i&&(s=o),o===n.endRow&&r(s,o,n.startCol,n.endCol),i=!1)})}),e}function Mwe(t,e){if(!Oi(this,Io).indicators||t<0)return;const r=[];t>=1&&this.isHidden(t-1)&&r.push("afterHiddenRow"),t<this.hot.countRows()-1&&this.isHidden(t+1)&&r.push("beforeHiddenRow"),be(e,r)}function Owe(t){t.items.push({name:ut},Swe(this),ywe(this))}function Iwe(){Array.isArray(Oi(this,Io).rows)&&this.hideRows(Oi(this,Io).rows)}function Pwe(t){return{key:"freeze_column",name(){return this.getTranslatedPhrase(Nx)},callback(e,r){const[{start:{col:n}}]=r;t.freezeColumn(n),this.render(),this.view.adjustElementsSize(!0)},hidden(){const e=this.getSelectedRange();let r=!1;return(e===void 0||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col<=this.getSettings().fixedColumnsStart-1)&&(r=!0),r}}}function Dwe(t){return{key:"unfreeze_column",name(){return this.getTranslatedPhrase(Hx)},callback(e,r){const[{start:{col:n}}]=r;t.unfreezeColumn(n),this.render(),this.view.adjustElementsSize(!0)},hidden(){const e=this.getSelectedRange();let r=!1;return(e===void 0||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col>=this.getSettings().fixedColumnsStart)&&(r=!0),r}}}function AI(t,e){q$(t,e),e.add(t)}function kwe(t,e,r){q$(t,e),e.set(t,r)}function q$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function mS(t,e){var r=Z$(t,e,"get");return Nwe(t,r)}function Nwe(t,e){return e.get?e.get.call(t):e.value}function RC(t,e,r){var n=Z$(t,e,"set");return Hwe(t,n,r),r}function Z$(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function Hwe(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function MI(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}$e.getSingleton().register("beforeColumnFreeze");$e.getSingleton().register("afterColumnFreeze");$e.getSingleton().register("beforeColumnUnfreeze");$e.getSingleton().register("afterColumnUnfreeze");const OI="manualColumnFreeze",Fwe=110;var Ml=new WeakMap,II=new WeakSet,PI=new WeakSet;class Lwe extends It{constructor(){super(...arguments),AI(this,PI),AI(this,II),kwe(this,Ml,{writable:!0,value:!1})}static get PLUGIN_KEY(){return OI}static get PLUGIN_PRIORITY(){return Fwe}isEnabled(){return!!this.hot.getSettings()[OI]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>MI(this,II,$we).call(this,e)),this.addHook("beforeColumnMove",(e,r)=>MI(this,PI,Bwe).call(this,e,r)),super.enablePlugin())}disablePlugin(){RC(this,Ml,!1),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}freezeColumn(e){const r=this.hot.getSettings(),n=r.fixedColumnsStart<this.hot.countCols()&&e>r.fixedColumnsStart-1;mS(this,Ml)||RC(this,Ml,!0),this.hot.runHooks("beforeColumnFreeze",e,n)!==!1&&(n&&(this.hot.columnIndexMapper.moveIndexes(e,r.fixedColumnsStart),r._fixedColumnsStart+=1),this.hot.runHooks("afterColumnFreeze",e,n))}unfreezeColumn(e){const r=this.hot.getSettings(),n=r.fixedColumnsStart>0&&e<=r.fixedColumnsStart-1;mS(this,Ml)||RC(this,Ml,!0),this.hot.runHooks("beforeColumnUnfreeze",e,n)!==!1&&(n&&(r._fixedColumnsStart-=1,this.hot.columnIndexMapper.moveIndexes(e,r.fixedColumnsStart)),this.hot.runHooks("afterColumnUnfreeze",e,n))}}function $we(t){t.items.push({name:"---------"},Pwe(this),Dwe(this))}function Bwe(t,e){if(mS(this,Ml)){const r=this.hot.getSettings().fixedColumnsStart;if(e<r||t.some(n=>n<r))return!1}}function h0(t,e,r){return e=Wwe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Wwe(t){var e=Vwe(t,"string");return typeof e=="symbol"?e:String(e)}function Vwe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const TC=0,DI=1,kI=2,Kc="px";class Uwe{constructor(e){h0(this,"hot",void 0),h0(this,"_element",null),h0(this,"state",TC),h0(this,"inlineProperty",void 0),this.hot=e,this.inlineProperty=e.isRtl()?"right":"left"}appendTo(e){e.appendChild(this._element),this.state=kI}build(){this.state===TC&&(this._element=this.hot.rootDocument.createElement("div"),this.state=DI)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=TC}isAppended(){return this.state===kI}isBuilt(){return this.state>=DI}setPosition(e,r){Zn(e)&&(this._element.style.top=e+Kc),Zn(r)&&(this._element.style[this.inlineProperty]=r+Kc)}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,r){Zn(e)&&(this._element.style.width=e+Kc),Zn(r)&&(this._element.style.height=r+Kc)}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,r){Zn(e)&&(this._element.style.marginTop=e+Kc),Zn(r)&&(this._element.style[`margin${gs(this.inlineProperty)}`]=r+Kc)}getOffset(){const e=this._element.style,r=`margin${gs(this.inlineProperty)}`;return{top:e.marginTop?parseInt(e.marginTop,10):0,start:e[r]?parseInt(e[r],10):0}}}const J$=Uwe,Gwe="ht__manualColumnMove--backlight";class Ywe extends J${build(){super.build(),be(this._element,Gwe)}}const zwe=Ywe,jwe="ht__manualColumnMove--guideline";class Kwe extends J${build(){super.build(),be(this._element,jwe)}}const Xwe=Kwe;function Xc(t,e){Q$(t,e),e.add(t)}function Zi(t,e,r){Q$(t,e),e.set(t,r)}function Q$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xn(t,e,r){var n=e4(t,e,"set");return qwe(t,n,r),r}function qwe(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function Ve(t,e){var r=e4(t,e,"get");return Zwe(t,r)}function e4(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function Zwe(t,e){return e.get?e.get.call(t):e.value}function qc(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}$e.getSingleton().register("beforeColumnMove");$e.getSingleton().register("afterColumnMove");const _C="manualColumnMove",Jwe=120,NI="ht__manualColumnMove",Bm="show-ui",pS="on-moving--columns",wS="after-selection--columns";var Mn=new WeakMap,wa=new WeakMap,Po=new WeakMap,Y0=new WeakMap,_a=new WeakMap,_n=new WeakMap,d0=new WeakMap,Ti=new WeakMap,uu=new WeakMap,Wm=new WeakMap,bd=new WeakMap,HI=new WeakSet,FI=new WeakSet,LI=new WeakSet,$I=new WeakSet,BI=new WeakSet,WI=new WeakSet;class Qwe extends It{constructor(){super(...arguments),Xc(this,WI),Xc(this,BI),Xc(this,$I),Xc(this,LI),Xc(this,FI),Xc(this,HI),Zi(this,Mn,{writable:!0,value:new zwe(this.hot)}),Zi(this,wa,{writable:!0,value:new Xwe(this.hot)}),Zi(this,Po,{writable:!0,value:[]}),Zi(this,Y0,{writable:!0,value:0}),Zi(this,_a,{writable:!0,value:!1}),Zi(this,_n,{writable:!0,value:{}}),Zi(this,d0,{writable:!0,value:void 0}),Zi(this,Ti,{writable:!0,value:void 0}),Zi(this,uu,{writable:!0,value:void 0}),Zi(this,Wm,{writable:!0,value:void 0}),Zi(this,bd,{writable:!0,value:void 0})}static get PLUGIN_KEY(){return _C}static get PLUGIN_PRIORITY(){return Jwe}isEnabled(){return!!this.hot.getSettings()[_C]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return qc(e,HI,eve).call(e,...n)}),this.addHook("beforeOnCellMouseOver",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return qc(e,LI,rve).call(e,...n)}),this.addHook("afterScrollVertically",()=>qc(this,BI,ive).call(this)),this.addHook("afterLoadData",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return qc(e,WI,sve).call(e,...n)}),this.buildPluginUI(),this.registerEvents(),be(this.hot.rootElement,NI),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){rt(this.hot.rootElement,NI),this.unregisterEvents(),Ve(this,Mn).destroy(),Ve(this,wa).destroy(),super.disablePlugin()}moveColumn(e,r){return this.moveColumns([e],r)}moveColumns(e,r){const n=Ve(this,d0),i=this.isMovePossible(e,r),s=this.hot.runHooks("beforeColumnMove",e,r,n,i);if(Xn(this,d0,void 0),s===!1)return;i&&this.hot.columnIndexMapper.moveIndexes(e,r);const o=i&&this.isColumnOrderChanged(e,r);return this.hot.runHooks("afterColumnMove",e,r,n,i,o),o}dragColumn(e,r){return this.dragColumns([e],r)}dragColumns(e,r){const n=this.countFinalIndex(e,r);return Xn(this,d0,r),this.moveColumns(e,n)}isMovePossible(e,r){const n=this.hot.columnIndexMapper.getNotTrimmedIndexesLength(),i=e.length+r>n,s=r<0,o=e.some(l=>l<0),a=e.some(l=>l>=n);return!(i||s||o||a)}isColumnOrderChanged(e,r){return e.some((n,i)=>n-i!==r)}countFinalIndex(e,r){const n=Cn(e,(i,s)=>(s<r&&(i+=1),i),0);return r-n}getColumnsWidth(e,r){const n=this.hot.columnIndexMapper;let i=0;for(let s=e;s<=r;s+=1){const o=n.getRenderableFromVisualIndex(s);s<0?i+=this.hot.view._wt.wtViewport.getRowHeaderWidth()||0:o!==null&&(i+=this.hot.view._wt.wtTable.getStretchedColumnWidth(o)||0)}return i}moveBySettingsOrLoad(){const e=this.hot.getSettings()[_C];if(Array.isArray(e))this.moveColumns(e,0);else if(e!==void 0){const r=this.persistentStateLoad();r.length&&this.moveColumns(r,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,r){const n=[];return Ue(e,r,i=>{n.push(i)}),n}refreshPositions(){const e=this.hot.view.getFirstFullyVisibleColumn();this.isFixedColumnsStart(Ve(this,Ti))&&e>0&&this.hot.scrollViewportTo({col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(e-1,-1)});const r=this.hot.view._wt.wtTable,n=this.hot.view._wt.wtOverlays.scrollableElement,i=typeof n.scrollX=="number"?n.scrollX:n.scrollLeft;let s=this.hot.view.THEAD.offsetLeft+this.getColumnsWidth(0,Ve(this,Ti)-1);const o=r.hider.offsetWidth,a=r.TBODY.offsetLeft,l=Ve(this,Mn).getOffset().start,c=Ve(this,Mn).getSize().width;let u=0,h=0;if(this.hot.isRtl()){const g=this.hot.rootWindow,m=Ht(this.hot.rootElement),w=g.innerWidth-Ve(this,uu)-m;h=g.innerWidth-Ve(this,_n).eventPageX-w-(n.scrollX===void 0?i:0)}else h=Ve(this,_n).eventPageX-(Ve(this,uu)-(n.scrollX===void 0?i:0));if(Ve(this,Wm)&&(u=this.hot.view._wt.wtOverlays.inlineStartOverlay.clone.wtTable.getColumnHeader(-1).offsetWidth),this.isFixedColumnsStart(Ve(this,Ti))&&(s+=i),s+=u,Ve(this,Ti)<0)Ve(this,bd)>0?Ve(this,_n).col=0:Ve(this,_n).col=e>0?e-1:e;else if(Ve(this,_n).TD.offsetWidth/2+s<=h){const g=Ve(this,Ti)>=Ve(this,Y0)?Ve(this,Y0)-1:Ve(this,Ti);Ve(this,_n).col=g+1,s+=Ve(this,_n).TD.offsetWidth}else Ve(this,_n).col=Ve(this,Ti);let d=h,f=s;h+c+l>=o?d=o-c-l:h+l<a+u&&(d=a+u+Math.abs(l)),s>=o-1?f=o-1:f===0?f=1:n.scrollX!==void 0&&Ve(this,Ti)<Ve(this,bd)&&(f-=Ve(this,uu)<=n.scrollX?Ve(this,uu):0),Ve(this,Mn).setPosition(null,d),Ve(this,wa).setPosition(null,f)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",r=>qc(this,FI,tve).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>qc(this,$I,nve).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){Ve(this,Mn).build(),Ve(this,wa).build()}destroy(){Ve(this,Mn).destroy(),Ve(this,wa).destroy(),super.destroy()}}function eve(t,e,r,n){const i=this.hot.view._wt.wtTable,s=this.hot.selection.isSelectedByColumnHeader(),o=this.hot.getSelectedRangeLast(),a=Je(t.target,"sortAction");if(!o||!s||Ve(this,_a)||t.button!==0||a){Xn(this,_a,!1),Ve(this,Po).length=0,rt(this.hot.rootElement,[pS,Bm]);return}const l=Ve(this,wa).isBuilt()&&!Ve(this,wa).isAppended(),c=Ve(this,Mn).isBuilt()&&!Ve(this,Mn).isAppended();l&&c&&(Ve(this,wa).appendTo(i.hider),Ve(this,Mn).appendTo(i.hider));const{from:u,to:h}=o,d=Math.min(u.col,h.col),f=Math.max(u.col,h.col);if(e.row<0&&e.col>=d&&e.col<=f){n.column=!0,Xn(this,_a,!0);const g=r.firstChild?nee(t,r.firstChild).x:t.offsetX;Ve(this,_n).eventPageX=t.pageX,Xn(this,Ti,e.col),Ve(this,_n).TD=r,Ve(this,_n).col=e.col,Xn(this,Po,this.prepareColumnsToMoving(d,f)),Xn(this,Wm,!!this.hot.getSettings().rowHeaders),Xn(this,Y0,this.hot.countCols()),Xn(this,bd,this.hot.getSettings().fixedColumnsStart),Xn(this,uu,Wr(this.hot.rootElement).left);const m=Ve(this,Wm)?-1:0,w=i.holder.scrollTop+i.getColumnHeaderHeight(0)+1,C=e.col<Ve(this,bd),S=this.hot.view._wt.wtOverlays.inlineStartOverlay.getOverlayOffset(),v=Math.abs(g-(this.hot.isRtl()?r.offsetWidth:0)),T=this.getColumnsWidth(d,e.col-1)+v,A=this.getColumnsWidth(m,d-1)+(C?S:0)+T;Ve(this,Mn).setPosition(w,A),Ve(this,Mn).setSize(this.getColumnsWidth(d,f),i.hider.offsetHeight-w),Ve(this,Mn).setOffset(null,-T),be(this.hot.rootElement,pS)}else rt(this.hot.rootElement,wS),Xn(this,_a,!1),Ve(this,Po).length=0}function tve(t){!Ve(this,_a)||(Ve(this,_n).eventPageX=t.pageX,this.refreshPositions())}function rve(t,e,r,n){!this.hot.getSelectedRangeLast()||!Ve(this,_a)||(Ve(this,Po).indexOf(e.col)>-1?rt(this.hot.rootElement,Bm):be(this.hot.rootElement,Bm),n.row=!0,n.column=!0,n.cell=!0,Xn(this,Ti,e.col),Ve(this,_n).TD=r)}function nve(){const t=Ve(this,_n).col,e=Ve(this,Po).length;if(Xn(this,Ti,void 0),Xn(this,_a,!1),rt(this.hot.rootElement,[pS,Bm,wS]),this.hot.selection.isSelectedByColumnHeader()&&be(this.hot.rootElement,wS),e<1||t===void 0)return;const r=Ve(this,Po)[0],n=this.hot.toPhysicalColumn(r),i=this.dragColumns(Ve(this,Po),t);if(Ve(this,Po).length=0,i===!0){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize(!0);const s=this.hot.toVisualColumn(n),o=s+e-1;this.hot.selectColumns(s,o)}}function ive(){const t=this.hot.view._wt.wtTable,e=t.getColumnHeaderHeight(0)+1,r=t.holder.scrollTop,n=e+r;Ve(this,Mn).setPosition(n),Ve(this,Mn).setSize(null,t.hider.offsetHeight-n)}function sve(){this.moveBySettingsOrLoad()}function wo(t,e){t4(t,e),e.add(t)}function tn(t,e,r){t4(t,e),e.set(t,r)}function t4(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function vo(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function fr(t,e,r){var n=r4(t,e,"set");return ove(t,n,r),r}function ove(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function ke(t,e){var r=r4(t,e,"get");return ave(t,r)}function r4(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function ave(t,e){return e.get?e.get.call(t):e.value}const Vm="manualColumnResize",lve=130,VI="manualColumnWidths";var Eo=new WeakMap,f0=new WeakMap,ii=new WeakMap,Um=new WeakMap,Gs=new WeakMap,cve=new WeakMap,_u=new WeakMap,g0=new WeakMap,Gn=new WeakMap,So=new WeakMap,Ql=new WeakMap,Gm=new WeakMap,Ed=new WeakMap,Rd=new WeakMap,oi=new WeakMap,Td=new WeakMap,UI=new WeakSet,GI=new WeakSet,YI=new WeakSet,zI=new WeakSet,jI=new WeakSet,KI=new WeakSet,XI=new WeakSet,qI=new WeakSet,ZI=new WeakSet;class uve extends It{static get PLUGIN_KEY(){return Vm}static get PLUGIN_PRIORITY(){return lve}constructor(e){super(e),wo(this,ZI),wo(this,qI),wo(this,XI),wo(this,KI),wo(this,jI),wo(this,zI),wo(this,YI),wo(this,GI),wo(this,UI),tn(this,Eo,{writable:!0,value:null}),tn(this,f0,{writable:!0,value:null}),tn(this,ii,{writable:!0,value:[]}),tn(this,Um,{writable:!0,value:null}),tn(this,Gs,{writable:!0,value:null}),tn(this,cve,{writable:!0,value:null}),tn(this,_u,{writable:!0,value:null}),tn(this,g0,{writable:!0,value:null}),tn(this,Gn,{writable:!0,value:this.hot.rootDocument.createElement("DIV")}),tn(this,So,{writable:!0,value:this.hot.rootDocument.createElement("DIV")}),tn(this,Ql,{writable:!0,value:null}),tn(this,Gm,{writable:!0,value:!1}),tn(this,Ed,{writable:!0,value:0}),tn(this,Rd,{writable:!0,value:null}),tn(this,oi,{writable:!0,value:void 0}),tn(this,Td,{writable:!0,value:void 0}),be(ke(this,Gn),"manualColumnResizer"),be(ke(this,So),"manualColumnResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[Vm]}enablePlugin(){this.enabled||(fr(this,oi,new Ka),ke(this,oi).addLocalHook("init",()=>vo(this,UI,hve).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,ke(this,oi)),this.addHook("modifyColWidth",(e,r)=>vo(this,XI,wve).call(this,e,r)),this.addHook("beforeStretchingColumnWidth",(e,r)=>vo(this,qI,vve).call(this,e,r)),this.addHook("beforeColumnResize",(e,r,n)=>vo(this,ZI,Cve).call(this,e,r,n)),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){fr(this,Td,ke(this,oi).getValues()),this.hot.columnIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualColumnWidths(){this.hot.runHooks("persistentStateSave",VI,ke(this,oi).getValues())}loadManualColumnWidths(){const e={};return this.hot.runHooks("persistentStateLoad",VI,e),e.value}setManualSize(e,r){const n=Math.max(r,20),i=this.hot.toPhysicalColumn(e);return ke(this,oi).setValueAtIndex(i,n),n}clearManualSize(e){const r=this.hot.toPhysicalColumn(e);ke(this,oi).setValueAtIndex(r,null)}setupHandlePosition(e){if(!e.parentNode)return;fr(this,Eo,e);const{_wt:r}=this.hot.view,n=r.wtTable.getCoords(ke(this,Eo)),i=n.col;if(i<0)return;const s=cr(ke(this,Eo)),o=ke(this,Eo).getBoundingClientRect(),a=i<r.getSetting("fixedColumnsStart");let l;a&&(l=r.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(ke(this,Eo),n.row,n.col)),l||(l=r.wtOverlays.topOverlay.getRelativeCellPosition(ke(this,Eo),n.row,n.col)),fr(this,f0,this.hot.columnIndexMapper.getVisualFromRenderableIndex(i)),fr(this,ii,[]);const c=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByColumnHeader();if(this.hot.selection.isSelected()&&c){const u=this.hot.getSelectedRange();j(u,h=>{const d=h.getTopStartCorner().col,f=h.getBottomEndCorner().col;Ue(d,f,g=>{ke(this,ii).includes(g)||ke(this,ii).push(g)})})}ke(this,ii).includes(ke(this,f0))||fr(this,ii,[ke(this,f0)]),fr(this,g0,l.start-6),fr(this,_u,parseInt(o.width,10)),ke(this,Gn).style.top=`${l.top}px`,ke(this,Gn).style[this.inlineDir]=`${ke(this,g0)+ke(this,_u)}px`,ke(this,Gn).style.height=`${s}px`,this.hot.rootElement.appendChild(ke(this,Gn))}refreshHandlePosition(){ke(this,Gn).style[this.inlineDir]=`${ke(this,g0)+ke(this,Um)}px`}setupGuidePosition(){const e=parseInt(cr(ke(this,Gn)),10),r=parseInt(ke(this,Gn).style.top,10)+e,n=parseInt(this.hot.view.maximumVisibleElementHeight(0),10);be(ke(this,Gn),"active"),be(ke(this,So),"active"),ke(this,So).style.top=`${r}px`,this.refreshGuidePosition(),ke(this,So).style.height=`${n-e}px`,this.hot.rootElement.appendChild(ke(this,So))}refreshGuidePosition(){ke(this,So).style[this.inlineDir]=ke(this,Gn).style[this.inlineDir]}hideHandleAndGuide(){rt(ke(this,Gn),"active"),rt(ke(this,So),"active")}checkIfColumnHeader(e){const r=zl(e,["THEAD"],this.hot.rootElement),{topOverlay:n,topInlineStartCornerOverlay:i}=this.hot.view._wt.wtOverlays;return[n.clone.wtTable.THEAD,i.clone.wtTable.THEAD].includes(r)}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)},r=(n,i)=>{const s=this.hot.runHooks("beforeColumnResize",ke(this,Gs),n,!0);s!==void 0&&fr(this,Gs,s),this.hot.getSettings().stretchH==="all"?this.clearManualSize(n):this.setManualSize(n,ke(this,Gs)),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",ke(this,Gs),n,!0),i&&e()};ke(this,Ed)>=2&&(ke(this,ii).length>1?(j(ke(this,ii),i=>{r(i)}),e()):j(ke(this,ii),i=>{r(i,!0)})),fr(this,Ed,0),fr(this,Rd,null)}bindEvents(){const{rootWindow:e,rootElement:r}=this.hot;this.eventManager.addEventListener(r,"mouseover",n=>vo(this,GI,dve).call(this,n)),this.eventManager.addEventListener(r,"mousedown",n=>vo(this,YI,fve).call(this,n)),this.eventManager.addEventListener(e,"mousemove",n=>vo(this,zI,gve).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>vo(this,jI,mve).call(this)),this.eventManager.addEventListener(ke(this,Gn),"contextmenu",()=>vo(this,KI,pve).call(this))}destroy(){super.destroy()}}function hve(){const t=this.hot.getSettings()[Vm],e=this.loadManualColumnWidths();typeof e!="undefined"?this.hot.batchExecution(()=>{e.forEach((r,n)=>{ke(this,oi).setValueAtIndex(n,r)})},!0):Array.isArray(t)?(this.hot.batchExecution(()=>{t.forEach((r,n)=>{ke(this,oi).setValueAtIndex(n,r)})},!0),fr(this,Td,t)):t===!0&&Array.isArray(ke(this,Td))&&this.hot.batchExecution(()=>{ke(this,Td).forEach((r,n)=>{ke(this,oi).setValueAtIndex(n,r)})},!0)}function dve(t){if(!xH(t.target)&&ke(this,Gm)!==!0&&this.checkIfColumnHeader(t.target)){const e=this.getClosestTHParent(t.target);if(!e)return;const r=e.getAttribute("colspan");e&&(r===null||r==="1")&&(ke(this,Ql)||this.setupHandlePosition(e))}}function fve(t){Je(t.target,"manualColumnResizer")&&(this.setupHandlePosition(ke(this,Eo)),this.setupGuidePosition(),fr(this,Ql,!0),ke(this,Rd)===null&&(fr(this,Rd,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(ke(this,Rd))),fr(this,Ed,ke(this,Ed)+1),this.startX=t.pageX,fr(this,Gs,ke(this,_u)))}function gve(t){if(ke(this,Ql)){const e=(t.pageX-this.startX)*this.hot.getDirectionFactor();fr(this,Um,ke(this,_u)+e),j(ke(this,ii),r=>{fr(this,Gs,this.setManualSize(r,ke(this,Um)))}),this.refreshHandlePosition(),this.refreshGuidePosition()}}function mve(){const t=()=>{this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize(!0)},e=(r,n)=>{this.hot.runHooks("beforeColumnResize",ke(this,Gs),r,!1),n&&t(),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",ke(this,Gs),r,!1)};ke(this,Ql)&&(this.hideHandleAndGuide(),fr(this,Ql,!1),ke(this,Gs)!==ke(this,_u)&&(ke(this,ii).length>1?(j(ke(this,ii),n=>{e(n)}),t()):j(ke(this,ii),n=>{e(n,!0)})),this.setupHandlePosition(ke(this,Eo)))}function pve(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(ke(this,Gn)),this.hot.rootElement.removeChild(ke(this,So)),fr(this,Ql,!1),fr(this,Gm,!0),this.hot._registerImmediate(()=>{fr(this,Gm,!1)})}function wve(t,e){let r=t;if(this.enabled){const n=this.hot.toPhysicalColumn(e),i=ke(this,oi).getValueAtIndex(n);this.hot.getSettings()[Vm]&&i&&(r=i)}return r}function vve(t,e){let r=ke(this,oi).getValueAtIndex(e);return r===null&&(r=t),r}function Cve(){this.hot.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked()}function AC(t,e,r){return e=Sve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Sve(t){var e=yve(t,"string");return typeof e=="symbol"?e:String(e)}function yve(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const MC=0,JI=1,QI=2,Zc="px";class xve{constructor(e){AC(this,"hot",void 0),AC(this,"_element",null),AC(this,"state",MC),this.hot=e}appendTo(e){e.appendChild(this._element),this.state=QI}build(){this.state===MC&&(this._element=this.hot.rootDocument.createElement("div"),this.state=JI)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=MC}isAppended(){return this.state===QI}isBuilt(){return this.state>=JI}setPosition(e,r){e!==void 0&&(this._element.style.top=e+Zc),r!==void 0&&(this._element.style.left=r+Zc)}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,r){e&&(this._element.style.width=e+Zc),r&&(this._element.style.height=r+Zc)}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,r){e&&(this._element.style.marginTop=e+Zc),r&&(this._element.style.marginLeft=r+Zc)}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 n4=xve,bve="ht__manualRowMove--backlight";class Eve extends n4{build(){super.build(),be(this._element,bve)}}const Rve=Eve,Tve="ht__manualRowMove--guideline";class _ve extends n4{build(){super.build(),be(this._element,Tve)}}const Ave=_ve;function Jc(t,e){i4(t,e),e.add(t)}function Qc(t,e,r){i4(t,e),e.set(t,r)}function i4(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Fl(t,e,r){var n=s4(t,e,"set");return Mve(t,n,r),r}function Mve(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function tt(t,e){var r=s4(t,e,"get");return Ove(t,r)}function s4(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function Ove(t,e){return e.get?e.get.call(t):e.value}function eu(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}$e.getSingleton().register("beforeRowMove");$e.getSingleton().register("afterRowMove");const OC="manualRowMove",Ive=140,eP="ht__manualRowMove",Ym="show-ui",vS="on-moving--rows",CS="after-selection--rows";var On=new WeakMap,va=new WeakMap,Do=new WeakMap,Aa=new WeakMap,qn=new WeakMap,m0=new WeakMap,tP=new WeakSet,rP=new WeakSet,nP=new WeakSet,iP=new WeakSet,sP=new WeakSet,oP=new WeakSet;class Pve extends It{constructor(){super(...arguments),Jc(this,oP),Jc(this,sP),Jc(this,iP),Jc(this,nP),Jc(this,rP),Jc(this,tP),Qc(this,On,{writable:!0,value:new Rve(this.hot)}),Qc(this,va,{writable:!0,value:new Ave(this.hot)}),Qc(this,Do,{writable:!0,value:[]}),Qc(this,Aa,{writable:!0,value:void 0}),Qc(this,qn,{writable:!0,value:{}}),Qc(this,m0,{writable:!0,value:void 0})}static get PLUGIN_KEY(){return OC}static get PLUGIN_PRIORITY(){return Ive}isEnabled(){return!!this.hot.getSettings()[OC]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return eu(e,tP,Dve).call(e,...n)}),this.addHook("beforeOnCellMouseOver",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return eu(e,nP,Nve).call(e,...n)}),this.addHook("afterScrollHorizontally",()=>eu(this,sP,Fve).call(this)),this.addHook("afterLoadData",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return eu(e,oP,Lve).call(e,...n)}),this.buildPluginUI(),this.registerEvents(),be(this.hot.rootElement,eP),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){rt(this.hot.rootElement,eP),this.unregisterEvents(),tt(this,On).destroy(),tt(this,va).destroy(),super.disablePlugin()}moveRow(e,r){return this.moveRows([e],r)}moveRows(e,r){const n=tt(this,m0),i=this.isMovePossible(e,r),s=this.hot.runHooks("beforeRowMove",e,r,n,i);if(Fl(this,m0,void 0),s===!1)return;i&&this.hot.rowIndexMapper.moveIndexes(e,r);const o=i&&this.isRowOrderChanged(e,r);return this.hot.runHooks("afterRowMove",e,r,n,i,o),o}dragRow(e,r){return this.dragRows([e],r)}dragRows(e,r){const n=this.countFinalIndex(e,r);return Fl(this,m0,r),this.moveRows(e,n)}isMovePossible(e,r){const n=this.hot.rowIndexMapper.getNotTrimmedIndexesLength(),i=e.length+r>n,s=r<0,o=e.some(l=>l<0),a=e.some(l=>l>=n);return!(i||s||o||a)}isRowOrderChanged(e,r){return e.some((n,i)=>n-i!==r)}countFinalIndex(e,r){const n=Cn(e,(i,s)=>(s<r&&(i+=1),i),0);return r-n}getRowsHeight(e,r){const n=this.hot.rowIndexMapper;let i=0;for(let s=e;s<=r;s++){const o=n.getRenderableFromVisualIndex(s);o!==null&&(i+=this.hot.view._wt.wtTable.getRowHeight(o)||23)}return i}moveBySettingsOrLoad(){const e=this.hot.getSettings()[OC];if(Array.isArray(e))this.moveRows(e,0);else if(e!==void 0){const r=this.persistentStateLoad();r.length&&this.moveRows(r,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(),r=[];if(!e)return r;const{from:n,to:i}=e,s=Math.min(n.row,i.row),o=Math.max(n.row,i.row);return Ue(s,o,a=>{r.push(a)}),r}refreshPositions(){const e=tt(this,qn).coords,r=this.hot.view.getFirstFullyVisibleRow(),n=this.hot.view.getLastFullyVisibleRow(),i=this.hot.countRows();this.isFixedRowTop(e.row)&&r>0&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(r-1,-1)),this.isFixedRowBottom(e.row)&&n<i&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(n+1,1),void 0,!0);const s=this.hot.view._wt.wtTable,o=tt(this,qn).TD,a=this.hot.rootElement,l=Wr(a),c=Iu(a),u=s.holder.scrollTop,h=this.hot.rootWindow!==c?c.scrollTop:0,d=l.top-h,f=tt(this,qn).eventPageY-d+u,g=s.hider.offsetHeight,m=s.TBODY.offsetTop,w=tt(this,On).getOffset().top,C=tt(this,On).getSize().height,S=o.offsetHeight/2,v=o.offsetHeight;let T=this.hot.view.THEAD.offsetHeight+this.getRowsHeight(0,e.row-1);const A=f>=T+S;this.isFixedRowTop(e.row)&&(T+=this.hot.view._wt.wtOverlays.topOverlay.getOverlayOffset()),e.row<0?tt(this,qn).row=r>0?r-1:r:A?(tt(this,qn).row=e.row+1,T+=e.row===0?v-1:v):tt(this,qn).row=e.row;let M=f,E=T;f+C+w>=g?M=g-C-w:f+w<m&&(M=m+Math.abs(w)),T>=g-1&&(E=g-1),tt(this,On).setPosition(M),tt(this,va).setPosition(E)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",r=>eu(this,rP,kve).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>eu(this,iP,Hve).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){tt(this,On).build(),tt(this,va).build()}destroy(){tt(this,On).destroy(),tt(this,va).destroy(),super.destroy()}}function Dve(t,e,r,n){const{wtTable:i,wtViewport:s}=this.hot.view._wt,o=this.hot.selection.isSelectedByRowHeader(),a=this.hot.getSelectedRangeLast();if(!a||!o||tt(this,Aa)||t.button!==0){Fl(this,Aa,!1),tt(this,Do).length=0,rt(this.hot.rootElement,[vS,Ym]);return}const l=tt(this,va).isBuilt()&&!tt(this,va).isAppended(),c=tt(this,On).isBuilt()&&!tt(this,On).isAppended();l&&c&&(tt(this,va).appendTo(i.hider),tt(this,On).appendTo(i.hider));const{from:u,to:h}=a,d=Math.min(u.row,h.row),f=Math.max(u.row,h.row);if(e.col<0&&e.row>=d&&e.row<=f){n.row=!0,Fl(this,Aa,!0),tt(this,qn).eventPageY=t.pageY,tt(this,qn).coords=e,tt(this,qn).TD=r,Fl(this,Do,this.prepareRowsToMoving());const g=i.holder.scrollLeft+s.getRowHeaderWidth(),m=this.getRowsHeight(d,e.row-1)+t.offsetY;tt(this,On).setPosition(null,g),tt(this,On).setSize(i.hider.offsetWidth-g,this.getRowsHeight(d,f)),tt(this,On).setOffset(-m,null),be(this.hot.rootElement,vS),this.refreshPositions()}else rt(this.hot.rootElement,CS),Fl(this,Aa,!1),tt(this,Do).length=0}function kve(t){!tt(this,Aa)||(tt(this,qn).eventPageY=t.pageY,this.refreshPositions())}function Nve(t,e,r,n){!this.hot.getSelectedRangeLast()||!tt(this,Aa)||(tt(this,Do).indexOf(e.row)>-1?rt(this.hot.rootElement,Ym):be(this.hot.rootElement,Ym),n.row=!0,n.column=!0,n.cell=!0,tt(this,qn).coords=e,tt(this,qn).TD=r)}function Hve(){const t=tt(this,qn).row,e=tt(this,Do).length;if(Fl(this,Aa,!1),rt(this.hot.rootElement,[vS,Ym,CS]),this.hot.selection.isSelectedByRowHeader()&&be(this.hot.rootElement,CS),e<1||t===void 0)return;const r=tt(this,Do)[0],n=this.hot.toPhysicalRow(r),i=this.dragRows(tt(this,Do),t);if(tt(this,Do).length=0,i===!0){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize(!0);const s=this.hot.toVisualRow(n),o=s+e-1;this.hot.selectRows(s,o)}}function Fve(){const t=this.hot.view._wt.wtTable,e=this.hot.view._wt.wtViewport.getRowHeaderWidth(),r=t.holder.scrollLeft,n=e+r;tt(this,On).setPosition(null,n),tt(this,On).setSize(t.hider.offsetWidth-n)}function Lve(){this.moveBySettingsOrLoad()}function bl(t,e){o4(t,e),e.add(t)}function rn(t,e,r){o4(t,e),e.set(t,r)}function o4(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function El(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}function sr(t,e,r){var n=a4(t,e,"set");return $ve(t,n,r),r}function $ve(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function De(t,e){var r=a4(t,e,"get");return Bve(t,r)}function a4(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function Bve(t,e){return e.get?e.get.call(t):e.value}const zm="manualRowResize",Wve=30,aP="manualRowHeights";var $s=new WeakMap,p0=new WeakMap,si=new WeakMap,jm=new WeakMap,Ca=new WeakMap,yE=new WeakMap,Au=new WeakMap,w0=new WeakMap,Rn=new WeakMap,Fs=new WeakMap,ec=new WeakMap,Km=new WeakMap,_d=new WeakMap,Ad=new WeakMap,is=new WeakMap,Md=new WeakMap,lP=new WeakSet,cP=new WeakSet,uP=new WeakSet,hP=new WeakSet,dP=new WeakSet,fP=new WeakSet,gP=new WeakSet;class Vve extends It{static get PLUGIN_KEY(){return zm}static get PLUGIN_PRIORITY(){return Wve}constructor(e){super(e),bl(this,gP),bl(this,fP),bl(this,dP),bl(this,hP),bl(this,uP),bl(this,cP),bl(this,lP),rn(this,$s,{writable:!0,value:null}),rn(this,p0,{writable:!0,value:null}),rn(this,si,{writable:!0,value:[]}),rn(this,jm,{writable:!0,value:null}),rn(this,Ca,{writable:!0,value:null}),rn(this,yE,{writable:!0,value:null}),rn(this,Au,{writable:!0,value:null}),rn(this,w0,{writable:!0,value:null}),rn(this,Rn,{writable:!0,value:this.hot.rootDocument.createElement("DIV")}),rn(this,Fs,{writable:!0,value:this.hot.rootDocument.createElement("DIV")}),rn(this,ec,{writable:!0,value:!1}),rn(this,Km,{writable:!0,value:!1}),rn(this,_d,{writable:!0,value:0}),rn(this,Ad,{writable:!0,value:null}),rn(this,is,{writable:!0,value:void 0}),rn(this,Md,{writable:!0,value:void 0}),be(De(this,Rn),"manualRowResizer"),be(De(this,Fs),"manualRowResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[zm]}enablePlugin(){this.enabled||(sr(this,is,new Ka),De(this,is).addLocalHook("init",()=>El(this,gP,Xve).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,De(this,is)),this.addHook("modifyRowHeight",(e,r)=>El(this,fP,Kve).call(this,e,r)),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){sr(this,Md,De(this,is).getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualRowHeights(){this.hot.runHooks("persistentStateSave",aP,De(this,is).getValues())}loadManualRowHeights(){const e={};return this.hot.runHooks("persistentStateLoad",aP,e),e.value}setManualSize(e,r){const n=this.hot.toPhysicalRow(e),i=Math.max(r,Ip.DEFAULT_HEIGHT);return De(this,is).setValueAtIndex(n,i),i}setupHandlePosition(e){sr(this,$s,e);const{view:r}=this.hot,{_wt:n}=r,i=n.wtTable.getCoords(De(this,$s)),s=i.row;if(s<0)return;const o=Ht(De(this,$s)),a=De(this,$s).getBoundingClientRect(),l=s<n.getSetting("fixedRowsTop"),c=s>=r.countNotHiddenRowIndexes(0,1)-n.getSetting("fixedRowsBottom");let u;l?u=n.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(De(this,$s),i.row,i.col):c&&(u=n.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition(De(this,$s),i.row,i.col)),u||(u=n.wtOverlays.inlineStartOverlay.getRelativeCellPosition(De(this,$s),i.row,i.col)),sr(this,p0,this.hot.rowIndexMapper.getVisualFromRenderableIndex(s)),sr(this,si,[]);const h=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByRowHeader();if(this.hot.selection.isSelected()&&h){const d=this.hot.getSelectedRange();j(d,f=>{const g=f.getTopStartCorner().row,m=f.getBottomStartCorner().row;Ue(g,m,w=>{De(this,si).includes(w)||De(this,si).push(w)})})}De(this,si).includes(De(this,p0))||sr(this,si,[De(this,p0)]),sr(this,w0,u.top-6),sr(this,Au,parseInt(a.height,10)),De(this,Rn).style.top=`${De(this,w0)+De(this,Au)}px`,De(this,Rn).style[this.inlineDir]=`${u.start}px`,De(this,Rn).style.width=`${o}px`,this.hot.rootElement.appendChild(De(this,Rn))}refreshHandlePosition(){De(this,Rn).style.top=`${De(this,w0)+De(this,jm)}px`}setupGuidePosition(){const e=parseInt(Ht(De(this,Rn)),10),r=parseInt(De(this,Rn).style[this.inlineDir],10)+e,n=parseInt(this.hot.view.maximumVisibleElementWidth(0),10);be(De(this,Rn),"active"),be(De(this,Fs),"active"),De(this,Fs).style.top=De(this,Rn).style.top,De(this,Fs).style[this.inlineDir]=`${r}px`,De(this,Fs).style.width=`${n-e}px`,this.hot.rootElement.appendChild(De(this,Fs))}refreshGuidePosition(){De(this,Fs).style.top=De(this,Rn).style.top}hideHandleAndGuide(){rt(De(this,Rn),"active"),rt(De(this,Fs),"active")}checkIfRowHeader(e){const r=zl(e,["TBODY"],this.hot.rootElement),{inlineStartOverlay:n,topInlineStartCornerOverlay:i,bottomInlineStartCornerOverlay:s}=this.hot.view._wt.wtOverlays;return[n.clone.wtTable.TBODY,i.clone.wtTable.TBODY,s.clone.wtTable.TBODY].includes(r)}getClosestTHParent(e){return e.tagName!=="TABLE"?e.tagName==="TH"?e:this.getClosestTHParent(e.parentNode):null}getActualRowHeight(e){const r=this.hot.view._wt.wtTable.getRowHeight(e);return r!==void 0&&De(this,Ca)<r?r:De(this,Ca)}afterMouseDownTimeout(){const e=()=>{this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize(!0)},r=(n,i)=>{const s=this.hot.runHooks("beforeRowResize",this.getActualRowHeight(n),n,!0);s!==void 0&&sr(this,Ca,s),this.setManualSize(n,De(this,Ca)),this.hot.runHooks("afterRowResize",this.getActualRowHeight(n),n,!0),i&&e()};De(this,_d)>=2&&(De(this,si).length>1?(j(De(this,si),i=>{r(i)}),e()):j(De(this,si),i=>{r(i,!0)})),sr(this,_d,0),sr(this,Ad,null)}bindEvents(){const{rootElement:e,rootWindow:r}=this.hot;this.eventManager.addEventListener(e,"mouseover",n=>El(this,lP,Uve).call(this,n)),this.eventManager.addEventListener(e,"mousedown",n=>El(this,cP,Gve).call(this,n)),this.eventManager.addEventListener(r,"mousemove",n=>El(this,uP,Yve).call(this,n)),this.eventManager.addEventListener(r,"mouseup",()=>El(this,hP,zve).call(this)),this.eventManager.addEventListener(De(this,Rn),"contextmenu",()=>El(this,dP,jve).call(this))}destroy(){super.destroy()}}function Uve(t){if(!xH(t.target)&&De(this,Km)!==!0&&this.checkIfRowHeader(t.target)){const e=this.getClosestTHParent(t.target);e&&(De(this,ec)||this.setupHandlePosition(e))}}function Gve(t){Je(t.target,"manualRowResizer")&&(this.setupHandlePosition(De(this,$s)),this.setupGuidePosition(),sr(this,ec,!0),De(this,Ad)===null&&(sr(this,Ad,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(De(this,Ad))),sr(this,_d,De(this,_d)+1),sr(this,yE,t.pageY),sr(this,Ca,De(this,Au)))}function Yve(t){De(this,ec)&&(sr(this,jm,De(this,Au)+(t.pageY-De(this,yE))),j(De(this,si),e=>{sr(this,Ca,this.setManualSize(e,De(this,jm)))}),this.refreshHandlePosition(),this.refreshGuidePosition())}function zve(){const t=()=>{this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize(!0)},e=(r,n)=>{this.hot.runHooks("beforeRowResize",this.getActualRowHeight(r),r,!1),n&&t(),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.getActualRowHeight(r),r,!1)};De(this,ec)&&(this.hideHandleAndGuide(),sr(this,ec,!1),De(this,Ca)!==De(this,Au)&&(De(this,si).length>1?(j(De(this,si),n=>{e(n)}),t()):j(De(this,si),n=>{e(n,!0)})),this.setupHandlePosition(De(this,$s)))}function jve(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(De(this,Rn)),this.hot.rootElement.removeChild(De(this,Fs)),sr(this,ec,!1),sr(this,Km,!0),this.hot._registerImmediate(()=>{sr(this,Km,!1)})}function Kve(t,e){let r=t;if(this.enabled){const n=this.hot.toPhysicalRow(e),i=De(this,is).getValueAtIndex(n);this.hot.getSettings()[zm]&&i&&(r=i)}return r}function Xve(){const t=this.hot.getSettings()[zm],e=this.loadManualRowHeights();this.hot.batchExecution(()=>{typeof e!="undefined"?e.forEach((r,n)=>{De(this,is).setValueAtIndex(n,r)}):Array.isArray(t)?(t.forEach((r,n)=>{De(this,is).setValueAtIndex(n,r)}),sr(this,Md,t)):t===!0&&Array.isArray(De(this,Md))&&De(this,Md).forEach((r,n)=>{De(this,is).setValueAtIndex(n,r)})},!0)}function Rl(t,e,r){return e=qve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qve(t){var e=Zve(t,"string");return typeof e=="symbol"?e:String(e)}function Zve(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Jve{constructor(e,r,n,i,s,o){Rl(this,"row",void 0),Rl(this,"col",void 0),Rl(this,"rowspan",void 0),Rl(this,"colspan",void 0),Rl(this,"removed",!1),Rl(this,"cellCoordsFactory",void 0),Rl(this,"cellRangeFactory",void 0),this.row=e,this.col=r,this.rowspan=n,this.colspan=i,this.cellCoordsFactory=s,this.cellRangeFactory=o}static NEGATIVE_VALUES_WARNING(e){return Pt`The merged cell declared with {row: ${e.row}, col: ${e.col},\x20
  121. rowspan: ${e.rowspan}, colspan: ${e.colspan}} contains negative values, which is\x20
  122. not supported. It will not be added to the collection.`}static IS_OUT_OF_BOUNDS_WARNING(e){return Pt`The merged cell declared at [${e.row}, ${e.col}] is positioned\x20
  123. (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 Pt`The merged cell declared at [${e.row}, ${e.col}] has both "rowspan"\x20
  124. and "colspan" declared as "1", which makes it a single cell. It cannot be added to the collection.`}static ZERO_SPAN_WARNING(e){return Pt`The merged cell declared at [${e.row}, ${e.col}] has "rowspan"\x20
  125. 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,r,n){return e.row<0||e.col<0||e.row>=r||e.row+e.rowspan-1>=r||e.col>=n||e.col+e.colspan-1>=n}normalize(e){const r=e.countRows(),n=e.countCols();this.row<0?this.row=0:this.row>r-1&&(this.row=r-1),this.col<0?this.col=0:this.col>n-1&&(this.col=n-1),this.row+this.rowspan>r-1&&(this.rowspan=r-this.row),this.col+this.colspan>n-1&&(this.colspan=n-this.col)}includes(e,r){return this.row<=e&&this.col<=r&&this.row+this.rowspan-1>=e&&this.col+this.colspan-1>=r}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,r){const n=e[0]||e[1],i=r+Math.abs(e[0]||e[1])-1,s=e[0]?"colspan":"rowspan",o=e[0]?"col":"row",a=Math.min(r,i),l=Math.max(r,i),c=this[o],u=this[o]+this[s]-1;if(c>=r&&(this[o]+=n),n>0)r<=u&&r>c&&(this[s]+=n);else if(n<0){if(a<=c&&l>=u)return this.removed=!0,!1;if(c>=a&&c<=l){const h=l-c+1,d=Math.abs(n)-h;this[o]-=d+n,this[s]-=h}else if(c<=a&&u>=l)this[s]+=n;else if(c<=a&&u>=a&&u<l){const h=u-a+1;this[s]-=h}}return!0}isFarther(e,r){return e?r==="down"?e.row+e.rowspan-1<this.row+this.rowspan-1:r==="up"?e.row>this.row:r==="right"?e.col+e.colspan-1<this.col+this.colspan-1:r==="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 Bs=Jve;function SS(t,e,r,n){e?e.row===r&&e.col===n?(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 IC(t,e,r){return e=Qve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qve(t){var e=eCe(t,"string");return typeof e=="symbol"?e:String(e)}function eCe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class xE{constructor(e){IC(this,"plugin",void 0),IC(this,"mergedCells",[]),IC(this,"hot",void 0),this.plugin=e,this.hot=e.hot}static IS_OVERLAPPING_WARNING(e){return Pt`The merged cell declared at [${e.row}, ${e.col}], overlaps\x20
  126. with the other declared merged cell. The overlapping merged cell was not added to the table, please\x20
  127. fix your setup.`}get(e,r){const n=this.mergedCells;let i=!1;return j(n,s=>s.row<=e&&s.row+s.rowspan-1>=e&&s.col<=r&&s.col+s.colspan-1>=r?(i=s,!1):!0),i}getByRange(e){const r=this.mergedCells;let n=!1;return j(r,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?(n=i,n):!0),n}getWithinRange(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const n=this.mergedCells,i=[];let s=e;if(!s.includesRange){const o=this.hot._createCellCoords(s.from.row,s.from.col),a=this.hot._createCellCoords(s.to.row,s.to.col);s=this.hot._createCellRange(o,o,a)}return j(n,o=>{const a=this.hot._createCellCoords(o.row,o.col),l=this.hot._createCellCoords(o.row+o.rowspan-1,o.col+o.colspan-1),c=this.hot._createCellRange(a,a,l);r?s.overlaps(c)&&i.push(o):s.includesRange(c)&&i.push(o)}),i.length?i:!1}add(e){const r=this.mergedCells,n=e.row,i=e.col,s=e.rowspan,o=e.colspan,a=new Bs(n,i,s,o,this.hot._createCellCoords,this.hot._createCellRange),l=this.get(n,i),c=this.isOverlapping(a);return!l&&!c?(this.hot&&a.normalize(this.hot),r.push(a),a):(Ft(xE.IS_OVERLAPPING_WARNING(a)),!1)}remove(e,r){const n=this.mergedCells,i=this.get(e,r),s=i?this.mergedCells.indexOf(i):-1;return i&&s!==-1?(n.splice(s,1),i):!1}clear(){const e=this.mergedCells,r=[],n=[];j(e,i=>{const s=this.hot.getCell(i.row,i.col);s&&r.push([s,this.get(i.row,i.col),i.row,i.col])}),this.mergedCells.length=0,j(r,(i,s)=>{Ue(0,i.rowspan-1,o=>{Ue(0,i.colspan-1,a=>{if(a!==0||o!==0){const l=this.hot.getCell(i.row+o,i.col+a);l&&n.push([l,null,null,null])}})}),r[s][1]=null}),j(r,i=>{SS(...i)}),j(n,i=>{SS(...i)})}isOverlapping(e){const r=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 n=!1;return j(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(r)?(n=!0,!1):!0),n}isFirstRenderableMergedCell(e,r){const n=this.get(e,r);return n&&this.hot.rowIndexMapper.getNearestNotHiddenIndex(n.row,1)===e&&this.hot.columnIndexMapper.getNearestNotHiddenIndex(n.col,1)===r}getFirstRenderableCoords(e,r){const n=this.get(e,r);if(!n||this.isFirstRenderableMergedCell(e,r))return this.hot._createCellCoords(e,r);const i=this.hot.rowIndexMapper.getNearestNotHiddenIndex(n.row,1),s=this.hot.columnIndexMapper.getNearestNotHiddenIndex(n.col,1);return this.hot._createCellCoords(i,s)}shiftCollections(e,r,n){const i=[0,0];switch(e){case"right":i[0]+=n;break;case"left":i[0]-=n;break;case"down":i[1]+=n;break;case"up":i[1]-=n;break}j(this.mergedCells,s=>{s.shift(i,r)}),D1(this.mergedCells.length-1,0,s=>{const o=this.mergedCells[s];o&&o.removed&&this.mergedCells.splice(this.mergedCells.indexOf(o),1)})}}const tCe=xE;function PC(t,e,r){return e=rCe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function rCe(t){var e=nCe(t,"string");return typeof e=="symbol"?e:String(e)}function nCe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class iCe{constructor(e){PC(this,"plugin",void 0),PC(this,"mergedCellsCollection",void 0),PC(this,"currentFillData",null),this.plugin=e,this.mergedCellsCollection=this.plugin.mergedCellsCollection}correctSelectionAreaSize(e){if(e[0]===e[2]&&e[1]===e[3]){const r=this.mergedCellsCollection.get(e[0],e[1]);r&&(e[2]=e[0]+r.rowspan-1,e[3]=e[1]+r.colspan-1)}}getDirection(e,r){let n=null;return r[0]===e[0]&&r[1]===e[1]&&r[3]===e[3]?n="down":r[2]===e[2]&&r[1]===e[1]&&r[3]===e[3]?n="up":r[1]===e[1]&&r[2]===e[2]?n="right":n="left",n}snapDragArea(e,r,n,i){const s=r.slice(0),o=this.getAutofillSize(e,r,n),[a,l,c,u]=e,d=["up","down"].indexOf(n)>-1?c-a+1:u-l+1,f=Math.floor(o/d)*d,g=o-f,m=this.getFarthestCollection(e,r,n,i);if(m){if(n==="down"){const w=m.row+m.rowspan-a-g;s[2]+w>=this.plugin.hot.countRows()?s[2]-=g:s[2]+=g?w:0}else if(n==="right"){const w=m.col+m.colspan-l-g;s[3]+w>=this.plugin.hot.countCols()?s[3]-=g:s[3]+=g?w:0}else if(n==="up"){const w=c-g-m.row+1;s[0]+w<0?s[0]+=g:s[0]-=g?w:0}else if(n==="left"){const w=u-g-m.col+1;s[1]+w<0?s[1]+=g:s[1]-=g?w:0}}return this.updateCurrentFillCache({baseArea:e,dragDirection:n,foundMergedCells:i,fillSize:o,dragArea:s,cycleLength:d}),s}updateCurrentFillCache(e){this.currentFillData||(this.currentFillData={}),Ar(this.currentFillData,e)}getAutofillSize(e,r,n){const[i,s,o,a]=e,[l,c,u,h]=r;switch(n){case"up":return i-l;case"down":return u-o;case"left":return s-c;case"right":return h-a;default:return null}}getDragArea(e,r,n){const[i,s,o,a]=e,[l,c,u,h]=r;switch(n){case"up":return[l,c,i-1,a];case"down":return[o+1,s,u,a];case"left":return[l,c,o,s-1];case"right":return[i,a+1,u,h];default:return null}}getFarthestCollection(e,r,n,i){const[s,o,a,l]=e,c=["up","down"].indexOf(n)>-1,u=c?a:l,h=c?s:o,d=this.getAutofillSize(e,r,n),f=c?a-s+1:l-o+1,g=Math.floor(d/f)*f,m=d-g;let w=null,C=null,S=null;switch(n){case"up":w="includesVertically",S=u-m+1;break;case"left":w="includesHorizontally",S=u-m+1;break;case"down":w="includesVertically",S=h+m-1;break;case"right":w="includesHorizontally",S=h+m-1;break}return j(i,v=>{v[w](S)&&v.isFarther(C,n)&&(C=v)}),C}recreateAfterDataPopulation(e){if(!this.currentFillData)return;const r=this.getRangeFromChanges(e),n=this.currentFillData.foundMergedCells,i=this.currentFillData.dragDirection,s=(c,u)=>{switch(i){case"up":return c.row-u>=r.from.row;case"down":return c.row+c.rowspan-1+u<=r.to.row;case"left":return c.col-u>=r.from.column;case"right":return c.col+c.colspan-1+u<=r.to.column;default:return null}};let o=0,a=null,l=1;do for(let c=0;c<n.length;c+=1){if(a=n[c],o=l*this.currentFillData.cycleLength,s(a,o))switch(i){case"up":this.plugin.mergedCellsCollection.add({row:a.row-o,rowspan:a.rowspan,col:a.col,colspan:a.colspan});break;case"down":this.plugin.mergedCellsCollection.add({row:a.row+o,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-o,colspan:a.colspan});break;case"right":this.plugin.mergedCellsCollection.add({row:a.row,rowspan:a.rowspan,col:a.col+o,colspan:a.colspan});break}c===n.length-1&&(l+=1)}while(s(a,o));this.currentFillData=null,this.plugin.hot.render(),n.length>0&&this.plugin.ifChromeForceRepaint()}getRangeFromChanges(e){const r={min:null,max:null},n={min:null,max:null};return j(e,i=>{const s=i[0],o=this.plugin.hot.propToCol(i[1]);(r.min===null||s<r.min)&&(r.min=s),(r.max===null||s>r.max)&&(r.max=s),(n.min===null||o<n.min)&&(n.min=o),(n.max===null||o>n.max)&&(n.max=o)}),{from:{row:r.min,column:n.min},to:{row:r.max,column:n.max}}}dragAreaOverlapsCollections(e,r,n){const i=this.getDragArea(e,r,n),[s,o,a,l]=i,c=this.plugin.hot._createCellCoords(s,o),u=this.plugin.hot._createCellCoords(a,l),h=this.plugin.hot._createCellRange(c,c,u);return!!this.mergedCellsCollection.getWithinRange(h,!0)}}const sCe=iCe;function DC(t,e,r){return e=oCe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function oCe(t){var e=aCe(t,"string");return typeof e=="symbol"?e:String(e)}function aCe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class lCe{constructor(e){DC(this,"plugin",void 0),DC(this,"hot",void 0),DC(this,"fullySelectedMergedCellClassName","fullySelectedMergedCell"),this.plugin=e,this.hot=e.hot}snapDelta(e,r,n){const i=r.to,s=i.row+e.row,o=i.col+e.col;e.row?this.jumpOverMergedCell(e,n,s):e.col&&this.jumpOverMergedCell(e,n,o)}jumpOverMergedCell(e,r,n){let i=e.row||e.col,s=null,o=null,a=null;e.row?(s=r.includesVertically(n),o=r.row,a=r.getLastRow()):e.col&&(s=r.includesHorizontally(n),o=r.col,a=r.getLastColumn()),i!==0&&(i>0?s&&n!==o&&(i+=a-n+1):s&&n!==a&&(i-=n-o+1),e.row?e.row=i:e.col&&(e.col=i))}getUpdatedSelectionRange(e,r){return this.hot._createCellRange(e.highlight,e.from,this.hot._createCellCoords(e.to.row+r.row,e.to.col+r.col))}getSelectedMergedCellClassName(e,r,n,i){const s=Math.min(n[0],n[2]),o=Math.min(n[1],n[3]),a=Math.max(n[0],n[2]),l=Math.max(n[1],n[3]);if(i===void 0||!this.plugin.mergedCellsCollection.isFirstRenderableMergedCell(e,r))return;const u=this.plugin.mergedCellsCollection.get(e,r);if(!u)return;const h=u.getLastRow(),d=u.getLastColumn();if(s<=u.row&&o<=u.col&&a>=h&&l>=d)return`${this.fullySelectedMergedCellClassName}-${i}`;if(this.plugin.selectionCalculations.isMergeCellFullySelected(u,this.plugin.hot.getSelectedRange()))return`${this.fullySelectedMergedCellClassName}-multiple`}isMergeCellFullySelected(e,r){const n=[];if(!r||!e)return!1;for(let i=0;i<e.rowspan;i+=1)for(let s=0;s<e.colspan;s+=1)n.push(this.hot._createCellCoords(e.row+i,e.col+s));for(let i=0;i<n.length;i+=1){const s=[];for(let o=0;o<r.length;o+=1)s[o]=r[o].includes(n[i]);if(!s.includes(!0))return!1}return!0}getSelectedMergedCellClassNameToRemove(){const e=[];for(let r=0;r<=7;r+=1)e.push(`${this.fullySelectedMergedCellClassName}-${r}`);return e.push(`${this.fullySelectedMergedCellClassName}-multiple`),e}}const cCe=lCe;function uCe(t){return{key:"mergeCells",name(){const e=this.getSelectedLast();if(e){const r=t.mergedCellsCollection.get(e[0],e[1]);if(r.row===e[0]&&r.col===e[1]&&r.row+r.rowspan-1===e[2]&&r.col+r.colspan-1===e[3])return this.getTranslatedPhrase(Lx)}return this.getTranslatedPhrase(Fx)},callback(){t.toggleMergeOnSelection()},disabled(){const e=this.getSelectedLast();return e?Bs.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 dr(t,e){l4(t,e),e.add(t)}function hCe(t,e,r){l4(t,e),e.set(t,r)}function l4(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function kC(t,e,r){return e=dCe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function dCe(t){var e=fCe(t,"string");return typeof e=="symbol"?e:String(e)}function fCe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function NC(t,e,r){var n=c4(t,e,"set");return gCe(t,n,r),r}function gCe(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function tu(t,e){var r=c4(t,e,"get");return mCe(t,r)}function c4(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function mCe(t,e){return e.get?e.get.call(t):e.value}function rr(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}$e.getSingleton().register("beforeMergeCells");$e.getSingleton().register("afterMergeCells");$e.getSingleton().register("beforeUnmergeCells");$e.getSingleton().register("afterUnmergeCells");const Od="mergeCells",pCe=150,mP=Od;var Ls=new WeakMap,pP=new WeakSet,wP=new WeakSet,vP=new WeakSet,CP=new WeakSet,SP=new WeakSet,yP=new WeakSet,xP=new WeakSet,HC=new WeakSet,bP=new WeakSet,EP=new WeakSet,RP=new WeakSet,TP=new WeakSet,_P=new WeakSet,AP=new WeakSet,MP=new WeakSet,OP=new WeakSet,IP=new WeakSet,PP=new WeakSet,DP=new WeakSet,kP=new WeakSet,NP=new WeakSet,HP=new WeakSet;class wCe extends It{constructor(){super(...arguments),dr(this,HP),dr(this,NP),dr(this,kP),dr(this,DP),dr(this,PP),dr(this,IP),dr(this,OP),dr(this,MP),dr(this,AP),dr(this,_P),dr(this,TP),dr(this,RP),dr(this,EP),dr(this,bP),dr(this,HC),dr(this,xP),dr(this,yP),dr(this,SP),dr(this,CP),dr(this,vP),dr(this,wP),dr(this,pP),kC(this,"mergedCellsCollection",null),kC(this,"autofillCalculations",null),kC(this,"selectionCalculations",null),hCe(this,Ls,{writable:!0,value:null})}static get PLUGIN_KEY(){return Od}static get PLUGIN_PRIORITY(){return pCe}isEnabled(){return!!this.hot.getSettings()[Od]}enablePlugin(){var e=this;this.enabled||(this.mergedCellsCollection=new tCe(this),this.autofillCalculations=new sCe(this),this.selectionCalculations=new cCe(this),this.addHook("afterInit",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return rr(e,pP,vCe).call(e,...n)}),this.addHook("modifyTransformStart",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return rr(e,vP,SCe).call(e,...n)}),this.addHook("afterModifyTransformStart",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return rr(e,kP,HCe).call(e,...n)}),this.addHook("modifyTransformEnd",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return rr(e,CP,yCe).call(e,...n)}),this.addHook("modifyGetCellCoords",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return rr(e,SP,xCe).call(e,...n)}),this.addHook("beforeSetRangeStart",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return rr(e,HC,FP).call(e,...n)}),this.addHook("beforeSetRangeStartOnly",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return rr(e,HC,FP).call(e,...n)}),this.addHook("beforeSetRangeEnd",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return rr(e,bP,RCe).call(e,...n)}),this.addHook("afterIsMultipleSelection",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return rr(e,wP,CCe).call(e,...n)}),this.addHook("afterRenderer",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return rr(e,xP,ECe).call(e,...n)}),this.addHook("afterContextMenuDefaultOptions",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return rr(e,yP,bCe).call(e,...n)}),this.addHook("afterGetCellMeta",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return rr(e,EP,TCe).call(e,...n)}),this.addHook("afterViewportRowCalculatorOverride",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return rr(e,RP,_Ce).call(e,...n)}),this.addHook("afterViewportColumnCalculatorOverride",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return rr(e,TP,ACe).call(e,...n)}),this.addHook("modifyAutofillRange",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return rr(e,_P,MCe).call(e,...n)}),this.addHook("afterCreateCol",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return rr(e,AP,OCe).call(e,...n)}),this.addHook("afterRemoveCol",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return rr(e,MP,ICe).call(e,...n)}),this.addHook("afterCreateRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return rr(e,OP,PCe).call(e,...n)}),this.addHook("afterRemoveRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return rr(e,IP,DCe).call(e,...n)}),this.addHook("afterChange",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return rr(e,PP,kCe).call(e,...n)}),this.addHook("beforeDrawBorders",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return rr(e,DP,NCe).call(e,...n)}),this.addHook("afterDrawSelection",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return rr(e,NP,FCe).call(e,...n)}),this.addHook("beforeRemoveCellClassNames",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return rr(e,HP,LCe).call(e,...n)}),this.addHook("beforeUndoStackChange",(r,n)=>{if(n==="MergeCells")return!1}),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){this.clearCollections(),this.unregisterShortcuts(),this.hot.render(),super.disablePlugin()}updatePlugin(){const e=this.hot.getSettings()[Od];this.disablePlugin(),this.enablePlugin(),this.generateFromSettings(e),super.updatePlugin()}ifChromeForceRepaint(){if(!IH())return;const e=[];let r=[];this.mergedCellsCollection.mergedCells.forEach(n=>{const{row:i,rowspan:s}=n;for(let o=i+1;o<i+s;o++)r.push(o)}),r=[...new Set(r)],r.forEach(n=>{const i=this.hot.rowIndexMapper.getRenderableFromVisualIndex(n);this.hot.view._wt.wtOverlays.getOverlays(!0).map(s=>(s==null?void 0:s.name)==="master"?s:s.clone.wtTable).forEach(s=>{const o=s.getRow(i);o&&(o.style.background=Yd(o,"backgroundColor").replace(")",", 0.99)"),e.push(o))})}),this.hot._registerTimeout(()=>{e.forEach(n=>{n.style.background=Yd(n,"backgroundColor").replace(", 0.99)",")")})},1)}validateSetting(e){let r=!0;return e?(Bs.containsNegativeValues(e)?(Ft(Bs.NEGATIVE_VALUES_WARNING(e)),r=!1):Bs.isOutOfBounds(e,this.hot.countRows(),this.hot.countCols())?(Ft(Bs.IS_OUT_OF_BOUNDS_WARNING(e)),r=!1):Bs.isSingleCell(e)?(Ft(Bs.IS_SINGLE_CELL(e)),r=!1):Bs.containsZeroSpan(e)&&(Ft(Bs.ZERO_SPAN_WARNING(e)),r=!1),r):!1}generateFromSettings(e){if(Array.isArray(e)){const r=[];if(j(e,n=>{if(!this.validateSetting(n))return;const i=this.hot._createCellCoords(n.row,n.col),s=this.hot._createCellCoords(n.row+n.rowspan-1,n.col+n.colspan-1),o=this.hot._createCellRange(i,i,s);this.mergeRange(o,!0,!0),Ue(n.row,n.row+n.rowspan-1,a=>{Ue(n.col,n.col+n.colspan-1,l=>{a===n.row&&l===n.col||r.push([a,l,null])})})}),r.length===0)return;this.hot.setDataAtCell(r)}}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:r,to:n}=e;this.toggleMerge(e),this.hot.selectCell(r.row,r.col,n.row,n.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:r,to:n}=e;this.unmergeRange(e,!0),this.mergeRange(e),this.hot.selectCell(r.row,r.col,n.row,n.col,!1)}unmergeSelection(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.hot.getSelectedRangeLast();if(!e)return;const{from:r,to:n}=e;this.unmergeRange(e,!0),this.hot.selectCell(r.row,r.col,n.row,n.col,!1)}mergeRange(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=e.getTopStartCorner(),s=e.getBottomEndCorner(),o={row:i.row,col:i.col,rowspan:s.row-i.row+1,colspan:s.col-i.col+1},a=[];let l=null;return this.canMergeRange(o,r)?(this.hot.runHooks("beforeMergeCells",e,r),Ue(0,o.rowspan-1,u=>{Ue(0,o.colspan-1,h=>{let d=null;a[u]||(a[u]=[]),u===0&&h===0?d=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(o.row),this.hot.toPhysicalColumn(o.col)):this.hot.setCellMeta(o.row+u,o.col+h,"hidden",!0),a[u][h]=d})}),this.hot.setCellMeta(o.row,o.col,"spanned",!0),this.mergedCellsCollection.add(o)?(n?l=[o.row,o.col,a]:this.hot.populateFromArray(o.row,o.col,a,void 0,void 0,this.pluginName),r||this.ifChromeForceRepaint(),this.hot.runHooks("afterMergeCells",e,o,r),l):!0):!1}unmergeRange(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const n=this.mergedCellsCollection.getWithinRange(e);!n||(this.hot.runHooks("beforeUnmergeCells",e,r),j(n,i=>{this.mergedCellsCollection.remove(i.row,i.col),Ue(0,i.rowspan-1,s=>{Ue(0,i.colspan-1,o=>{this.hot.removeCellMeta(i.row+s,i.col+o,"hidden"),this.hot.removeCellMeta(i.row+s,i.col+o,"copyable")})}),this.hot.removeCellMeta(i.row,i.col,"spanned")}),this.hot.runHooks("afterUnmergeCells",e,r),this.hot.render())}toggleMerge(e){const r=this.mergedCellsCollection.get(e.from.row,e.from.col);r.row===e.from.row&&r.col===e.from.col&&r.row+r.rowspan-1===e.to.row&&r.col+r.colspan-1===e.to.col?this.unmergeRange(e):this.mergeSelection(e)}merge(e,r,n,i){const s=this.hot._createCellCoords(e,r),o=this.hot._createCellCoords(n,i);this.mergeRange(this.hot._createCellRange(s,s,o))}unmerge(e,r,n,i){const s=this.hot._createCellCoords(e,r),o=this.hot._createCellCoords(n,i);this.unmergeRange(this.hot._createCellRange(s,s,o))}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Control","m"]],callback:()=>{const n=this.hot.getSelectedRangeLast();n&&!n.isSingleHeader()&&(this.toggleMerge(n),this.hot.render())},runOnlyIf:n=>!n.altKey,group:mP})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(mP)}modifyViewportRowStart(e,r){const n=this.hot.rowIndexMapper,i=n.getVisualFromRenderableIndex(e.startRow);for(let s=0;s<r;s+=1){const o=this.mergedCellsCollection.get(i,s);if(at(o)){const a=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(o.row,1));if(a<e.startRow){e.startRow=a,this.modifyViewportRowStart(e,r);return}}}}modifyViewportRowEnd(e,r){const n=this.hot.rowIndexMapper,i=n.getVisualFromRenderableIndex(e.endRow);for(let s=0;s<r;s+=1){const o=this.mergedCellsCollection.get(i,s);if(at(o)){const a=o.row+o.rowspan-1,l=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(a,-1));if(l>e.endRow){e.endRow=l,this.modifyViewportRowEnd(e,r);return}}}}modifyViewportColumnStart(e,r){const n=this.hot.columnIndexMapper,i=n.getVisualFromRenderableIndex(e.startColumn);for(let s=0;s<r;s+=1){const o=this.mergedCellsCollection.get(s,i);if(at(o)){const a=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(o.col,1));if(a<e.startColumn){e.startColumn=a,this.modifyViewportColumnStart(e,r);return}}}}modifyViewportColumnEnd(e,r){const n=this.hot.columnIndexMapper,i=n.getVisualFromRenderableIndex(e.endColumn);for(let s=0;s<r;s+=1){const o=this.mergedCellsCollection.get(s,i);if(at(o)){const a=o.col+o.colspan-1,l=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(a,-1));if(l>e.endColumn){e.endColumn=l,this.modifyViewportColumnEnd(e,r);return}}}}translateMergedCellToRenderable(e,r,n,i){const{rowIndexMapper:s,columnIndexMapper:o}=this.hot;let a,l;r===0?a=s.getNearestNotHiddenIndex(e,1):a=s.getNearestNotHiddenIndex(e+r-1,-1),i===0?l=o.getNearestNotHiddenIndex(n,1):l=o.getNearestNotHiddenIndex(n+i-1,-1);const c=e>=0?s.getRenderableFromVisualIndex(a):e,u=n>=0?o.getRenderableFromVisualIndex(l):n;return[c,u]}}function vCe(){this.generateFromSettings(this.hot.getSettings()[Od]),this.hot.render()}function CCe(t){if(t){const e=this.mergedCellsCollection.mergedCells,r=this.hot.getSelectedRangeLast();for(let n=0;n<e.length;n+=1)if(r.from.row===e[n].row&&r.from.col===e[n].col&&r.to.row===e[n].row+e[n].rowspan-1&&r.to.col===e[n].col+e[n].colspan-1)return!1}return t}function SCe(t){const e=this.hot.getSelectedRangeLast();let r={row:t.row,col:t.col},n=null;const i=this.hot._createCellCoords(e.highlight.row,e.highlight.col),s=this.mergedCellsCollection.get(i.row,i.col);if(tu(this,Ls)||NC(this,Ls,this.hot._createCellCoords(null,null)),s){const a=this.hot._createCellCoords(s.row,s.col),l=this.hot._createCellCoords(s.row+s.rowspan-1,s.col+s.colspan-1);this.hot._createCellRange(a,a,l).includes(tu(this,Ls))||NC(this,Ls,this.hot._createCellCoords(null,null)),r.row=tu(this,Ls).row?tu(this,Ls).row-i.row:r.row,r.col=tu(this,Ls).col?tu(this,Ls).col-i.col:r.col,t.row>0?r.row=s.row+s.rowspan-1-i.row+t.row:t.row<0&&(r.row=i.row-s.row+t.row),t.col>0?r.col=s.col+s.colspan-1-i.col+t.col:t.col<0&&(r.col=i.col-s.col+t.col)}n=this.hot._createCellCoords(e.highlight.row+r.row,e.highlight.col+r.col);const o=this.mergedCellsCollection.get(n.row,n.col);if(o){const a=this.mergedCellsCollection.getFirstRenderableCoords(o.row,o.col);NC(this,Ls,n),r={row:a.row-i.row,col:a.col-i.col}}r.row!==0&&(t.row=r.row),r.col!==0&&(t.col=r.col)}function yCe(t){const e=this.hot.getSelectedRangeLast(),r=Jn(t),n=this.selectionCalculations.getUpdatedSelectionRange(e,t);let i=Jn(r);const s=this.mergedCellsCollection.getWithinRange(n,!0);do i=Jn(r),this.selectionCalculations.getUpdatedSelectionRange(e,r),j(s,o=>{this.selectionCalculations.snapDelta(r,e,o)});while(r.row!==i.row||r.col!==i.col);t.row=r.row,t.col=r.col}function xCe(t,e){if(t<0||e<0)return;const r=this.mergedCellsCollection.get(t,e);if(!r)return;const{row:n,col:i,colspan:s,rowspan:o}=r;return[n,i,n+o-1,i+s-1]}function bCe(t){t.items.push({name:"---------"},uCe(this))}function ECe(t,e,r){const n=this.mergedCellsCollection.get(e,r),i=at(n)?Jn(n):void 0;if(at(i)){const{rowIndexMapper:s,columnIndexMapper:o}=this.hot,{row:a,col:l,colspan:c,rowspan:u}=i,[h,d]=this.translateMergedCellToRenderable(a,u,l,c),f=s.getRenderableFromVisualIndex(e),g=o.getRenderableFromVisualIndex(r),m=h-f+1,w=d-g+1;i.row=s.getNearestNotHiddenIndex(i.row,1),i.col=o.getNearestNotHiddenIndex(i.col,1),i.rowspan=Math.min(i.rowspan,m),i.colspan=Math.min(i.colspan,w)}SS(t,i,e,r)}function FP(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 RCe(t){const e=this.hot.getSelectedRangeLast();e.highlight=this.hot._createCellCoords(e.highlight.row,e.highlight.col),e.to=t;let r=!1;if(!(this.hot.selection.isSelectedByColumnHeader()||this.hot.selection.isSelectedByRowHeader()))do{r=!1;for(let n=0;n<this.mergedCellsCollection.mergedCells.length;n+=1){const s=this.mergedCellsCollection.mergedCells[n].getRange();e.expandByRange(s)&&(t.row=e.to.row,t.col=e.to.col,r=!0)}}while(r)}function TCe(t,e,r){const n=this.mergedCellsCollection.get(t,e);n&&(n.row!==t||n.col!==e?r.copyable=!1:(r.rowspan=n.rowspan,r.colspan=n.colspan))}function _Ce(t){const e=this.hot.countCols();this.modifyViewportRowStart(t,e),this.modifyViewportRowEnd(t,e)}function ACe(t){const e=this.hot.countRows();this.modifyViewportColumnStart(t,e),this.modifyViewportColumnEnd(t,e)}function MCe(t,e){this.autofillCalculations.correctSelectionAreaSize(e);const r=this.autofillCalculations.getDirection(e,t);let n=t;if(this.autofillCalculations.dragAreaOverlapsCollections(e,n,r))return n=e,n;const i=this.mergedCellsCollection.getWithinRange({from:{row:e[0],col:e[1]},to:{row:e[2],col:e[3]}});return i&&(n=this.autofillCalculations.snapDragArea(e,n,r,i)),n}function OCe(t,e){this.mergedCellsCollection.shiftCollections("right",t,e)}function ICe(t,e){this.mergedCellsCollection.shiftCollections("left",t,e)}function PCe(t,e,r){r!=="auto"&&this.mergedCellsCollection.shiftCollections("down",t,e)}function DCe(t,e){this.mergedCellsCollection.shiftCollections("up",t,e)}function kCe(t,e){e==="Autofill.fill"&&this.autofillCalculations.recreateAfterDataPopulation(t)}function NCe(t,e){if(e&&e==="area"){const r=this.hot.getSelectedRangeLast(),n=this.mergedCellsCollection.getWithinRange(r);j(n,i=>{r.getBottomEndCorner().row===i.getLastRow()&&r.getBottomEndCorner().col===i.getLastColumn()&&(t[2]=i.row,t[3]=i.col)})}}function HCe(t,e,r){if(!this.enabled)return;const n=this.mergedCellsCollection.get(t.row,t.col);if(!n)return;const i=e>0,s=e<0,o=r<0,a=r>0,l=n.row+n.rowspan-1===this.hot.countRows()-1,c=n.row===0,u=n.col+n.colspan-1===this.hot.countCols()-1,h=n.col===0;(i&&l||s&&c||a&&u||o&&h)&&(t.row=n.row,t.col=n.col)}function FCe(t,e,r,n){if(!!r)return this.selectionCalculations.getSelectedMergedCellClassName(t,e,r,n)}function LCe(){return this.selectionCalculations.getSelectedMergedCellClassNameToRemove()}function $Ce(t,e){return function(r,n){const[,...i]=r,[,...s]=n;return function o(a){const l=t[a],c=e[a],u=i[a],h=s[a],d=c.multiColumnSorting,g=(d.compareFunctionFactory?d.compareFunctionFactory:FL(c.type))(l,c,d)(u,h);if(g===Ks){const m=a+1;if(typeof e[m]!="undefined")return o(m)}return g}(0)}}function LP(){Ft(Pt`Plugins \`columnSorting\` and \`multiColumnSorting\` should not be enabled simultaneously.
  128. Only \`multiColumnSorting\` will work.`)}const u4="sort";function BCe(t,e,r){const n=[];return r===!1||t.isColumnSorted(e)&&t.getNumberOfSortedColumns()>1&&n.push(`${u4}-${t.getIndexOfColumnInSortQueue(e)+1}`),n}function WCe(t){const e=t.className.split(" "),r=new RegExp(`^${u4}-[0-9]{1,2}$`);return e.filter(n=>r.test(n))}function VCe(t,e,r){return e=UCe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function UCe(t){var e=GCe(t,"string");return typeof e=="symbol"?e:String(e)}function GCe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Xm="multiColumnSorting",YCe=170,$P="columnSorting",BP=Xm;HL(Xm,$Ce);class zCe extends LL{constructor(){super(...arguments),VCe(this,"pluginKey",Xm)}static get PLUGIN_KEY(){return Xm}static get PLUGIN_PRIORITY(){return YCe}isEnabled(){return super.isEnabled()}enablePlugin(){!this.enabled&&this.hot.getSettings()[this.pluginKey]&&this.hot.getSettings()[$P]&&LP(),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,Dm))},runOnlyIf:()=>{var e;const r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r&&this.hot.selection.isCellVisible(r)&&r.isHeader()},group:BP})}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(BP)}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 r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];super.updateHeaderClasses(e,...n),rt(e,WCe(e)),this.enabled!==!1&&be(e,BCe(...n))}onUpdateSettings(e){this.hot.getSettings()[this.pluginKey]&&this.hot.getSettings()[$P]&&LP(),super.onUpdateSettings(e)}onAfterOnCellMouseDown(e,r){cE(r.row,r.col,e)!==!1&&this.wasClickableHeaderClicked(e,r.col)&&(this.hot.getShortcutManager().isCtrlPressed()?(this.hot.deselectCell(),this.hot.selectColumns(r.col),this.sort(this.getNextSortConfig(r.col,Dm))):this.sort(this.getColumnNextConfig(r.col)))}}function WP(t,e,r){return e=jCe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function jCe(t){var e=KCe(t,"string");return typeof e=="symbol"?e:String(e)}function KCe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const XCe="multipleSelectionHandles",qCe=160;class ZCe extends It{constructor(){super(...arguments),WP(this,"dragged",[]),WP(this,"lastSetCell",null)}static get PLUGIN_KEY(){return XCe}static get PLUGIN_PRIORITY(){return qCe}isEnabled(){return Ea()}enablePlugin(){this.enabled||(this.registerListeners(),super.enablePlugin())}registerListeners(){const e=this,{rootElement:r}=this.hot;function n(i){if(e.dragged.length===1)return e.dragged.splice(0,e.dragged.length),!0;const s=e.dragged.indexOf(i);if(s===-1)return!1;s===0?e.dragged=e.dragged.slice(0,1):s===1&&(e.dragged=e.dragged.slice(-1))}this.eventManager.addEventListener(r,"touchstart",i=>{let s;if(Je(i.target,"topSelectionHandle-HitArea"))return s=e.hot.getSelectedRangeLast(),e.dragged.push("top"),e.touchStartRange={width:s.getWidth(),height:s.getHeight(),direction:s.getDirection()},i.preventDefault(),!1;if(Je(i.target,"bottomSelectionHandle-HitArea"))return s=e.hot.getSelectedRangeLast(),e.dragged.push("bottom"),e.touchStartRange={width:s.getWidth(),height:s.getHeight(),direction:s.getDirection()},i.preventDefault(),!1}),this.eventManager.addEventListener(r,"touchend",i=>{if(Je(i.target,"topSelectionHandle-HitArea"))return n.call(e,"top"),e.touchStartRange=void 0,i.preventDefault(),!1;if(Je(i.target,"bottomSelectionHandle-HitArea"))return n.call(e,"bottom"),e.touchStartRange=void 0,i.preventDefault(),!1}),this.eventManager.addEventListener(r,"touchmove",i=>{const{rootDocument:s}=this.hot;let o,a,l,c,u,h;if(e.dragged.length===0)return;const d=s.elementFromPoint(i.touches[0].clientX,i.touches[0].clientY);!d||d===e.lastSetCell||((d.nodeName==="TD"||d.nodeName==="TH")&&(o=e.hot.getCoords(d),o.col===-1&&(o.col=0),a=e.hot.getSelectedRangeLast(),l=a.getWidth(),c=a.getHeight(),u=a.getDirection(),l===1&&c===1&&e.hot.selection.setRangeEnd(o),h=e.getCurrentRangeCoords(a,o,e.touchStartRange.direction,u,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,r,n,i,s){const o=e.getTopStartCorner(),a=e.getBottomEndCorner(),l=e.getBottomStartCorner(),c=e.getTopEndCorner();let u={start:null,end:null};switch(n){case"NE-SW":switch(i){case"NE-SW":case"NW-SE":s==="top"?u={start:this.hot._createCellCoords(r.row,e.highlight.col),end:this.hot._createCellCoords(l.row,r.col)}:u={start:this.hot._createCellCoords(e.highlight.row,r.col),end:this.hot._createCellCoords(r.row,o.col)};break;case"SE-NW":s==="bottom"&&(u={start:this.hot._createCellCoords(a.row,r.col),end:this.hot._createCellCoords(r.row,o.col)});break}break;case"NW-SE":switch(i){case"NE-SW":s==="top"?u={start:r,end:l}:u.end=r;break;case"NW-SE":s==="top"?u={start:r,end:a}:u.end=r;break;case"SE-NW":s==="top"?u={start:r,end:o}:u.end=r;break;case"SW-NE":s==="top"?u={start:r,end:c}:u.end=r;break}break;case"SW-NE":switch(i){case"NW-SE":s==="bottom"?u={start:this.hot._createCellCoords(r.row,o.col),end:this.hot._createCellCoords(l.row,r.col)}:u={start:this.hot._createCellCoords(o.row,r.col),end:this.hot._createCellCoords(r.row,a.col)};break;case"SW-NE":s==="top"?u={start:this.hot._createCellCoords(e.highlight.row,r.col),end:this.hot._createCellCoords(r.row,a.col)}:u={start:this.hot._createCellCoords(r.row,o.col),end:this.hot._createCellCoords(o.row,r.col)};break;case"SE-NW":s==="bottom"?u={start:this.hot._createCellCoords(r.row,c.col),end:this.hot._createCellCoords(o.row,r.col)}:s==="top"&&(u={start:l,end:r});break}break;case"SE-NW":switch(i){case"NW-SE":case"NE-SW":case"SW-NE":s==="top"&&(u.end=r);break;case"SE-NW":s==="top"?u.end=r:u={start:r,end:o};break}break}return u}isDragged(){return this.dragged.length>0}}function yS(){let{label:t="",colspan:e=1,origColspan:r=1,collapsible:n=!1,crossHiddenColumns:i=[],isCollapsed:s=!1,isHidden:o=!1,isRoot:a=!1,isPlaceholder:l=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{label:t,colspan:e,origColspan:r,collapsible:n,isCollapsed:s,crossHiddenColumns:i,isHidden:o,isRoot:a,isPlaceholder:l}}function h4(){return{label:"",isPlaceholder:!0}}function JCe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1/0;const r=[];if(e===0)return r;j(t,i=>{const s=[];let o=0;r.push(s),j(i,a=>{const l=yS();if(at(a)){const{label:u,colspan:h}=a;l.label=Sr(u),typeof h=="number"&&h>1&&(l.colspan=h,l.origColspan=h)}else l.label=Sr(a);o+=l.origColspan;let c=!1;if(o>=e&&(l.colspan=l.origColspan-(o-e),l.origColspan=l.colspan,c=!0),s.push(l),l.colspan>1)for(let u=0;u<l.colspan-1;u++)s.push(h4());return!c})});const n=Math.max(...ht(r,i=>i.length));return j(r,i=>{if(i.length<n){const s=ht(new Array(n-i.length),()=>yS());i.splice(i.length,0,...s)}}),r}function FC(t,e,r){QCe(t,e),e.set(t,r)}function QCe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ji(t,e){var r=d4(t,e,"get");return e1e(t,r)}function e1e(t,e){return e.get?e.get.call(t):e.value}function Uh(t,e,r){var n=d4(t,e,"set");return t1e(t,n,r),r}function d4(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function t1e(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}const VP=["label","collapsible"];var Co=new WeakMap,Tl=new WeakMap,LC=new WeakMap;class r1e{constructor(){FC(this,Co,{writable:!0,value:[]}),FC(this,Tl,{writable:!0,value:0}),FC(this,LC,{writable:!0,value:1/0})}setColumnsLimit(e){Uh(this,LC,e)}setData(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];Uh(this,Co,JCe(e,Ji(this,LC))),Uh(this,Tl,Ji(this,Co).length)}getData(){return Ji(this,Co)}mergeWith(e){j(e,r=>{let a=r,{row:n,col:i}=a,s=Sn(a,["row","col"]);const o=this.getHeaderSettings(n,i);o!==null&&Ar(o,s,VP)})}map(e){j(Ji(this,Co),r=>{j(r,n=>{const i=e(yt({},n));at(i)&&Ar(n,i,VP)})})}getHeaderSettings(e,r){var n;if(e>=Ji(this,Tl)||e<0)return null;const i=Ji(this,Co)[e];return Array.isArray(i)===!1||r>=i.length?null:(n=i[r])!==null&&n!==void 0?n:null}getHeadersSettings(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const i=[];if(e>=Ji(this,Tl)||e<0)return i;const s=Ji(this,Co)[e];let o=0;for(let a=r;a<s.length;a++){const l=s[a];if(l.isPlaceholder)throw new Error("The first column settings cannot overlap the other header layers");if(o+=l.colspan,i.push(l),l.colspan>1&&(a+=l.colspan-1),o===n)break;if(o>n)throw new Error("The last column settings cannot overlap the other header layers")}return i}getLayersCount(){return Ji(this,Tl)}getColumnsCount(){return Ji(this,Tl)>0?Ji(this,Co)[0].length:0}clear(){Uh(this,Co,[]),Uh(this,Tl,0)}}function $C(t,e,r){return e=n1e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function n1e(t){var e=i1e(t,"string");return typeof e=="symbol"?e:String(e)}function i1e(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const f4="DF-pre-order";function g4(t,e){let r=t.call(e,this);for(let n=0;n<this.childs.length;n++){if(r===!1)return!1;r=g4.call(this.childs[n],t,e)}return r}const s1e="DF-post-order";function m4(t,e){for(let r=0;r<this.childs.length;r++)if(m4.call(this.childs[r],t,e)===!1)return!1;return t.call(e,this)}const p4="BF";function o1e(t,e){const r=[this];function n(){if(r.length===0)return;const i=r.shift();r.push(...i.childs),t.call(e,i)!==!1&&n()}n()}const a1e=p4,UP=new Map([[f4,g4],[s1e,m4],[p4,o1e]]);class qm{constructor(e){$C(this,"data",{}),$C(this,"parent",null),$C(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 r=new qm(yt({},e.data));for(let n=0;n<e.childs.length;n++)r.addChild(this.cloneTree(e.childs[n]));return r}replaceTreeWith(e){this.data=yt({},e.data),this.childs=[];for(let r=0;r<e.childs.length;r++)this.addChild(e.childs[r])}walkDown(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:a1e;if(!UP.has(r))throw new Error(`Traversal strategy "${r}" does not exist`);UP.get(r).call(this,e,this)}walkUp(e){const r=this,n=i=>{e.call(r,i)!==!1&&i.parent!==null&&n(i.parent)};n(this)}}function BC(t,e,r){l1e(t,e),e.set(t,r)}function l1e(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function En(t,e){var r=w4(t,e,"get");return c1e(t,r)}function c1e(t,e){return e.get?e.get.call(t):e.value}function u1e(t,e,r){var n=w4(t,e,"set");return h1e(t,n,r),r}function w4(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function h1e(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}var ru=new WeakMap,_l=new WeakMap,nu=new WeakMap;class d1e{constructor(e){BC(this,ru,{writable:!0,value:new Map}),BC(this,_l,{writable:!0,value:new Map}),BC(this,nu,{writable:!0,value:null}),u1e(this,nu,e)}getRoots(){return Array.from(En(this,ru).values())}getRootByColumn(e){let r;return En(this,_l).has(e)&&(r=En(this,ru).get(En(this,_l).get(e))),r}getNode(e,r){const n=this.getRootByColumn(r);if(!n)return;const i=r-En(this,_l).get(r);let s=0,o;return n.walkDown(a=>{const{data:{origColspan:l,headerLevel:c}}=a;if(e===c){if(i>=s&&i<=s+l-1)return o=a,o.data.isRoot=r===o.data.columnIndex,!1;s+=l}}),o}rebuildTreeIndex(){let e=0;En(this,_l).clear(),j(En(this,ru),r=>{let[,{data:{colspan:n}}]=r;for(let i=e;i<e+n;i++)En(this,_l).set(i,e);e+=n})}buildTree(){this.clear();const e=En(this,nu).getColumnsCount();let r=0;for(;r<e;){const n=En(this,nu).getHeaderSettings(0,r),i=new qm;En(this,ru).set(r,i),this.buildLeaves(i,r,0,n.origColspan),r+=n.origColspan}this.rebuildTreeIndex()}buildLeaves(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;const s=En(this,nu).getHeadersSettings(n,r,i);n+=1,j(s,o=>{const a=Zr(yt({},o),{headerLevel:n-1,columnIndex:r});let l;n===1?(e.data=a,l=e):(l=new qm(a),e.addChild(l)),n<En(this,nu).getLayersCount()&&this.buildLeaves(l,r,n,o.origColspan),r+=o.origColspan})}clear(){En(this,ru).clear(),En(this,_l).clear()}}function v4(t,e){t.walkDown(r=>{let{data:n,childs:i}=r;if(!n.isHidden&&(e(n.columnIndex),i.length===0))for(let s=1;s<n.colspan;s++)e(n.columnIndex+s)})}function Zm(t,e){let{childs:r}=t;if(r.length!==0)return r[0].data[e]}function Jm(t){return Zm(t,"origColspan")===t.data.origColspan}function bE(t){const{data:e,childs:r}=t;if(!e.isCollapsed||e.isHidden||e.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(Jm(t))return bE(r[0]);e.isCollapsed=!1;const i=r.slice(1),s=new Set;let o=0;if(i.length>0)j(i,a=>{a.replaceTreeWith(a.data.clonedTree),a.data.clonedTree=null;const l=a.data;o+=l.colspan,v4(a,c=>{s.add(c)})});else{const{colspan:a,origColspan:l,columnIndex:c}=e;o=l-a;for(let u=1;u<l;u++)s.add(c+u)}return t.walkUp(a=>{const{data:l}=a;l.colspan+=o,l.colspan>=l.origColspan?(l.colspan=l.origColspan,l.isCollapsed=!1):Jm(a)&&(l.isCollapsed=Zm(a,"isCollapsed"))}),{rollbackModification:()=>EE(t),affectedColumns:Array.from(s),colspanCompensation:o}}function EE(t){var e;const{data:r,childs:n}=t;if(r.isCollapsed||r.isHidden||r.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(Jm(t))return EE(n[0]);r.isCollapsed=!0;const s=n.slice(1),o=new Set;if(s.length>0)j(s,l=>{v4(l,c=>{o.add(c)}),l.data.clonedTree=l.cloneTree(),l.walkDown(c=>{let{data:u}=c;u.isHidden=!0})});else{const{origColspan:l,columnIndex:c}=r;for(let u=1;u<l;u++){const h=c+u;o.add(h)}}const a=r.colspan-((e=Zm(t,"colspan"))!==null&&e!==void 0?e:1);return t.walkUp(l=>{const{data:c}=l;c.colspan-=a,c.colspan<=1?(c.colspan=1,c.isCollapsed=!0):Jm(l)&&(c.isCollapsed=Zm(l,"isCollapsed"))}),{rollbackModification:()=>bE(t),affectedColumns:Array.from(o),colspanCompensation:a}}function f1e(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(Pt`The passed node is not the last node on the tree. Only for\x20
  129. the last node, the hide column modification can be applied.`);const{crossHiddenColumns:r}=t.data;if(r.includes(e))return;let n=!1;t.walkUp(i=>{const{data:{collapsible:s}}=i;if(s)return n=!0,!1}),!n&&t.walkUp(i=>{const{data:s}=i;s.crossHiddenColumns.push(e),s.colspan>1?s.colspan-=1:s.isHidden=!0})}function g1e(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(Pt`The passed node is not the last node on the tree. Only for\x20
  130. the last node, the show column modification can be applied.`);const{crossHiddenColumns:r}=t.data;if(!r.includes(e))return;let n=!1;t.walkUp(i=>{const{data:{collapsible:s}}=i;if(s)return n=!0,!1}),!n&&t.walkUp(i=>{const{data:s}=i;s.crossHiddenColumns.splice(s.crossHiddenColumns.indexOf(e),1),!s.isHidden&&s.colspan<s.origColspan&&(s.colspan+=1),s.isHidden=!1})}const GP=new Map([["collapse",EE],["expand",bE],["hide-column",f1e],["show-column",g1e]]);function m1e(t,e,r){if(!GP.has(t))throw new Error(`The node modifier action ("${t}") does not exist.`);return GP.get(t)(e,r)}function v0(t){const e=[];return j(t,r=>{r.walkDown(n=>{const i=n.data,{origColspan:s,columnIndex:o,headerLevel:a,crossHiddenColumns:l}=i,c=w1e(e,a);let u=!1;for(let h=o;h<o+s;h++)if(l.includes(h)||u)c.push(h4());else{const f=p1e(i);f.isRoot=!0,c.push(f),u=!0}})}),e}function p1e(t){const n=yS(t),{crossHiddenColumns:e}=n;return Sn(n,["crossHiddenColumns"])}function w1e(t,e){let r;return Array.isArray(t[e])?r=t[e]:(r=[],t[e]=r),r}function WC(t,e,r){v1e(t,e),e.set(t,r)}function v1e(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Gh(t,e,r){var n=C4(t,e,"set");return C1e(t,n,r),r}function C1e(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function nr(t,e){var r=C4(t,e,"get");return S1e(t,r)}function C4(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function S1e(t,e){return e.get?e.get.call(t):e.value}var ks=new WeakMap,Wn=new WeakMap,Al=new WeakMap;class y1e{constructor(){WC(this,ks,{writable:!0,value:new r1e}),WC(this,Wn,{writable:!0,value:new d1e(nr(this,ks))}),WC(this,Al,{writable:!0,value:[[]]})}setState(e){nr(this,ks).setData(e);let r=!1;try{nr(this,Wn).buildTree()}catch(n){nr(this,Wn).clear(),nr(this,ks).clear(),r=!0}return Gh(this,Al,v0(nr(this,Wn).getRoots())),r}setColumnsLimit(e){nr(this,ks).setColumnsLimit(e)}mergeStateWith(e){const r=ht(e,n=>{let o=n,{row:i}=o,s=Sn(o,["row"]);return yt({row:i<0?this.rowCoordsToLevel(i):i},s)});nr(this,ks).mergeWith(r),nr(this,Wn).buildTree(),Gh(this,Al,v0(nr(this,Wn).getRoots()))}mapState(e){nr(this,ks).map(e),nr(this,Wn).buildTree(),Gh(this,Al,v0(nr(this,Wn).getRoots()))}mapNodes(e){return Cn(nr(this,Wn).getRoots(),(r,n)=>(n.walkDown(i=>{const s=e(i.data);s!==void 0&&r.push(s)}),r),[])}triggerNodeModification(e,r,n){r<0&&(r=this.rowCoordsToLevel(r));const i=nr(this,Wn).getNode(r,n);let s;return i&&(s=m1e(e,i,n),Gh(this,Al,v0(nr(this,Wn).getRoots()))),s}triggerColumnModification(e,r){return this.triggerNodeModification(e,-1,r)}rowCoordsToLevel(e){if(e>=0)return null;const r=e+Math.max(this.getLayersCount(),1);return r<0?null:r}levelToRowCoords(e){if(e<0)return null;const r=e-Math.max(this.getLayersCount(),1);return r>=0?null:r}getHeaderSettings(e,r){var n,i;return e<0&&(e=this.rowCoordsToLevel(e)),e===null||e>=this.getLayersCount()?null:(n=(i=nr(this,Al)[e])===null||i===void 0?void 0:i[r])!==null&&n!==void 0?n:null}getHeaderTreeNodeData(e,r){const n=this.getHeaderTreeNode(e,r);return n?yt({},n.data):null}getHeaderTreeNode(e,r){if(e<0&&(e=this.rowCoordsToLevel(e)),e===null||e>=this.getLayersCount())return null;const n=nr(this,Wn).getNode(e,r);return n||null}findTopMostEntireHeaderLevel(e){var r;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;const i=n-e+1;let s=!1,o=null;for(let a=e;a<=n;a++){const l=nr(this,Wn).getRootByColumn(a);if(!l)break;s=!0,l.walkDown(c=>{const{columnIndex:u,headerLevel:h,origColspan:d,isHidden:f}=c.data;f||d<=i&&u>=e&&u+d-1<=n&&(o===null||h<o)&&(o=h)},f4)}return s&&o===null?-1:this.levelToRowCoords((r=o)!==null&&r!==void 0?r:0)}findLeftMostColumnIndex(e,r){var n;const{isRoot:i}=(n=this.getHeaderSettings(e,r))!==null&&n!==void 0?n:{isRoot:!0};if(i)return r;let s=r-1;for(;s>=0;){var o;const{isRoot:a}=(o=this.getHeaderSettings(e,s))!==null&&o!==void 0?o:{isRoot:!0};if(a)break;s-=1}return s}findRightMostColumnIndex(e,r){var n;const{isRoot:i,origColspan:s}=(n=this.getHeaderSettings(e,r))!==null&&n!==void 0?n:{isRoot:!0,origColspan:1};if(i)return r+s-1;let o=r+1;for(;o<this.getColumnsCount();){var a;const{isRoot:l}=(a=this.getHeaderSettings(e,o))!==null&&a!==void 0?a:{isRoot:!0};if(l)break;o+=1}return o-1}getLayersCount(){return nr(this,ks).getLayersCount()}getColumnsCount(){return nr(this,ks).getColumnsCount()}clear(){Gh(this,Al,[]),nr(this,ks).clear(),nr(this,Wn).clear()}}function Yh(t,e,r){return e=x1e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function x1e(t){var e=b1e(t,"string");return typeof e=="symbol"?e:String(e)}function b1e(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class E1e{constructor(e,r){Yh(this,"hot",void 0),Yh(this,"nestedHeaderSettingsGetter",void 0),Yh(this,"layersCount",0),Yh(this,"container",void 0),Yh(this,"widthsMap",void 0),this.hot=e,this.nestedHeaderSettingsGetter=r,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"),r=e.length;this.widthsMap.clear();for(let n=0;n<r;n++){const i=this.hot.columnIndexMapper.getVisualFromRenderableIndex(n),s=this.hot.toPhysicalColumn(i);this.widthsMap.setValueAtIndex(s,e[n].offsetWidth)}this.container.parentNode.removeChild(this.container),this.container=null}_buildGhostTable(e){const{rootDocument:r,columnIndexMapper:n}=this.hot,i=r.createDocumentFragment(),s=r.createElement("table"),o=!!this.hot.getSettings().dropdownMenu,a=n.getRenderableIndexesLength();for(let l=0;l<this.layersCount;l++){const c=r.createElement("tr");for(let u=0;u<a;u++){let h=n.getVisualFromRenderableIndex(u);h===null&&(h=u);const d=r.createElement("th"),f=this.nestedHeaderSettingsGetter(l,h);if(f&&(!f.isPlaceholder||f.isHidden)){let g=f.label;o&&(g+='<button class="changeType"></button>'),Gu(d,g),d.colSpan=f.colspan,c.appendChild(d)}}s.appendChild(c)}i.appendChild(s),e.appendChild(i)}clear(){this.widthsMap.clear(),this.container=null}}const R1e=E1e;function Lr(t,e){S4(t,e),e.add(t)}function YP(t,e,r){return e=T1e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function T1e(t){var e=_1e(t,"string");return typeof e=="symbol"?e:String(e)}function _1e(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function C0(t,e,r){S4(t,e),e.set(t,r)}function S4(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ll(t,e,r){var n=y4(t,e,"set");return A1e(t,n,r),r}function A1e(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function Ct(t,e){var r=y4(t,e,"get");return M1e(t,r)}function y4(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function M1e(t,e){return e.get?e.get.call(t):e.value}function Er(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}const zP="nestedHeaders",O1e=280;var Dt=new WeakMap,ua=new WeakMap,Id=new WeakMap,Qp=new WeakMap,S0=new WeakSet,jP=new WeakSet,KP=new WeakSet,XP=new WeakSet,qP=new WeakSet,ZP=new WeakSet,JP=new WeakSet,QP=new WeakSet,e2=new WeakSet,t2=new WeakSet,r2=new WeakSet,n2=new WeakSet,i2=new WeakSet,s2=new WeakSet,o2=new WeakSet,a2=new WeakSet,l2=new WeakSet,c2=new WeakSet;class I1e extends It{constructor(){super(...arguments),Lr(this,c2),Lr(this,l2),Lr(this,a2),Lr(this,o2),Lr(this,s2),Lr(this,i2),Lr(this,n2),Lr(this,r2),Lr(this,t2),Lr(this,e2),Lr(this,QP),Lr(this,JP),Lr(this,ZP),Lr(this,qP),Lr(this,XP),Lr(this,KP),Lr(this,jP),Lr(this,S0),C0(this,Dt,{writable:!0,value:new y1e}),C0(this,ua,{writable:!0,value:null}),C0(this,Id,{writable:!0,value:null}),C0(this,Qp,{writable:!0,value:!1}),YP(this,"ghostTable",new R1e(this.hot,(e,r)=>this.getHeaderSettings(e,r))),YP(this,"detectedOverlappedHeaders",!1)}static get PLUGIN_KEY(){return zP}static get PLUGIN_PRIORITY(){return O1e}isEnabled(){return!!this.hot.getSettings()[zP]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:r}=this.hot.getSettings();(!Array.isArray(r)||!Array.isArray(r[0]))&&Ft(Pt`Your Nested Headers plugin configuration is invalid. The settings has to be\x20
  131. passed as an array of arrays e.q. [['A1', { label: 'A2', colspan: 2 }]]`),this.addHook("init",()=>Er(this,l2,j1e).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Er(e,c2,K1e).call(e,...i)}),this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Er(e,qP,N1e).call(e,...i)}),this.addHook("afterOnCellMouseDown",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Er(e,ZP,H1e).call(e,...i)}),this.addHook("beforeOnCellMouseOver",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Er(e,JP,F1e).call(e,...i)}),this.addHook("beforeOnCellMouseUp",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Er(e,QP,L1e).call(e,...i)}),this.addHook("beforeSelectionHighlightSet",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Er(e,e2,$1e).call(e,...i)}),this.addHook("modifyTransformStart",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Er(e,t2,B1e).call(e,...i)}),this.addHook("afterSelection",()=>Er(this,S0,VC).call(this)),this.addHook("beforeViewportScrollHorizontally",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Er(e,jP,P1e).call(e,...i)}),this.addHook("afterGetColumnHeaderRenderers",n=>Er(this,n2,V1e).call(this,n)),this.addHook("modifyColWidth",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Er(e,s2,G1e).call(e,...i)}),this.addHook("modifyColumnHeaderValue",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Er(e,o2,Y1e).call(e,...i)}),this.addHook("beforeHighlightingColumnHeader",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Er(e,KP,D1e).call(e,...i)}),this.addHook("beforeCopy",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Er(e,XP,k1e).call(e,...i)}),this.addHook("beforeSelectColumns",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Er(e,r2,W1e).call(e,...i)}),this.addHook("afterViewportColumnCalculatorOverride",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Er(e,i2,U1e).call(e,...i)}),this.addHook("modifyFocusedElement",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Er(e,a2,z1e).call(e,...i)}),this.hot.columnIndexMapper.addLocalHook("cacheUpdated",()=>Er(this,S0,VC).call(this)),this.hot.rowIndexMapper.addLocalHook("cacheUpdated",()=>Er(this,S0,VC).call(this)),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(!this.hot.view)return;const{nestedHeaders:e}=this.hot.getSettings();Ct(this,Dt).setColumnsLimit(this.hot.countCols()),Array.isArray(e)&&(this.detectedOverlappedHeaders=Ct(this,Dt).setState(e)),this.detectedOverlappedHeaders&&Ft(Pt`Your Nested Headers plugin setup contains overlapping headers. This kind of configuration\x20
  132. is currently not supported.`),this.enabled&&this.hot.columnIndexMapper.hidingMapsCollection.getMergedValues().forEach((r,n)=>{const i=r===!0?"hide-column":"show-column";Ct(this,Dt).triggerColumnModification(i,n)}),!Ct(this,ua)&&this.enabled&&Ll(this,ua,this.hot.columnIndexMapper.createChangesObserver("hiding").subscribe(r=>{r.forEach(n=>{let{op:i,index:s,newValue:o}=n;if(i==="replace"){const a=o===!0?"hide-column":"show-column";Ct(this,Dt).triggerColumnModification(a,s)}}),this.ghostTable.buildWidthsMap()})),this.ghostTable.setLayersCount(this.getLayersCount()).buildWidthsMap(),super.updatePlugin()}disablePlugin(){this.clearColspans(),Ct(this,Dt).clear(),Ct(this,ua).unsubscribe(),Ll(this,ua,null),this.ghostTable.clear(),super.disablePlugin()}getStateManager(){return Ct(this,Dt)}getLayersCount(){return Ct(this,Dt).getLayersCount()}getHeaderSettings(e,r){return Ct(this,Dt).getHeaderSettings(e,r)}clearColspans(){if(!this.hot.view)return;const{_wt:e}=this.hot.view,r=e.getSetting("columnHeaders").length,n=e.wtTable.THEAD,i=e.wtOverlays.topOverlay.clone.wtTable.THEAD,s=e.wtOverlays.topInlineStartCornerOverlay?e.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null;for(let o=0;o<r;o++){const a=n.childNodes[o];if(!a)break;const l=i.childNodes[o],c=s?s.childNodes[o]:null;for(let u=0,h=a.childNodes.length;u<h;u++)a.childNodes[u].removeAttribute("colspan"),rt(a.childNodes[u],"hiddenHeader"),l&&l.childNodes[u]&&(l.childNodes[u].removeAttribute("colspan"),rt(l.childNodes[u],"hiddenHeader")),s&&c&&c.childNodes[u]&&(c.childNodes[u].removeAttribute("colspan"),rt(c.childNodes[u],"hiddenHeader"))}}headerRendererFactory(e){var r=this;const n=this.hot.view._wt.getSetting("fixedColumnsStart");return(i,s)=>{var o;const{columnIndexMapper:a,view:l}=this.hot;let c=a.getVisualFromRenderableIndex(i);c===null&&(c=i),s.removeAttribute("colspan"),rt(s,"hiddenHeader");const{colspan:u,isHidden:h,isPlaceholder:d}=(o=Ct(this,Dt).getHeaderSettings(e,c))!==null&&o!==void 0?o:{label:""};if(d||h)be(s,"hiddenHeader");else if(u>1){var f,g;const{wtOverlays:m}=l._wt,w=(f=m.topInlineStartCornerOverlay)===null||f===void 0?void 0:f.clone.wtTable.THEAD.contains(s),C=(g=m.inlineStartOverlay)===null||g===void 0?void 0:g.clone.wtTable.THEAD.contains(s),S=w||C?Math.min(u,n-i):u;S>1&&s.setAttribute("colspan",S)}this.hot.view.appendColHeader(c,s,function(){return r.getColumnHeaderValue(...arguments)},e)}}getColumnHeaderValue(e,r){var n;const{isHidden:i,isPlaceholder:s}=(n=Ct(this,Dt).getHeaderSettings(r,e))!==null&&n!==void 0?n:{};return s||i?"":this.hot.getColHeader(e,r)}destroy(){Ll(this,Dt,null),Ct(this,ua)!==null&&(Ct(this,ua).unsubscribe(),Ll(this,ua,null)),super.destroy()}_getHeaderTreeNodeDataByCoords(e){if(!(e.row>=0||e.col<0))return Ct(this,Dt).getHeaderTreeNodeData(e.row,e.col)}}function VC(){var t;const e=(t=this.hot)===null||t===void 0?void 0:t.getSelectedRangeLast();if(!e)return;const{highlight:r}=e;if(r.isHeader()&&r.col>=0){const i=Ct(this,Dt).findLeftMostColumnIndex(r.row,r.col),s=this.hot.selection.highlight.getFocus();s.visualCellRange.highlight.col=i,s.visualCellRange.from.col=i,s.visualCellRange.to.col=i,s.commit()}}function P1e(t){const e=this.hot.getSelectedRangeLast();if(!e)return t;const{highlight:r}=e;if(!(r.isHeader()&&r.col>=0))return t;const i=this.hot.view.getFirstFullyVisibleColumn(),s=this.hot.view.getLastFullyVisibleColumn(),o=Ct(this,Dt).findLeftMostColumnIndex(r.row,r.col),a=Ct(this,Dt).findRightMostColumnIndex(r.row,r.col);return o<i&&a>s?t:o<i?o:a}function D1e(t,e,r){const n=Ct(this,Dt).getHeaderTreeNodeData(e,t);if(!n)return t;const{columnCursor:i,selectionType:s,selectionWidth:o}=r,{isRoot:a,colspan:l}=Ct(this,Dt).getHeaderSettings(e,t);if(s===ix){if(!a)return n.columnIndex}else if(s===pF&&(l>o-i||!a))return null;return t}function k1e(t,e,r){let{columnHeadersCount:n}=r;if(n!==0)for(let s=0;s<e.length;s++){const{startRow:o,startCol:a,endRow:l,endCol:c}=e[s],u=l-o+1,h=a-c+1;if(o>=0||h===1)break;for(let d=a;d<=c;d++)for(let f=o;f<=l;f++){var i;const g=u+f,m=d-a;if(m===0)continue;((i=Ct(this,Dt).getHeaderTreeNodeData(f,d))===null||i===void 0?void 0:i.isRoot)===!1&&(t[g][m]="")}}}function N1e(t,e,r,n){this._getHeaderTreeNodeDataByCoords(e)&&(n.column=!0)}function H1e(t,e){const r=this._getHeaderTreeNodeDataByCoords(e);if(!r)return;Ll(this,Id,e.clone()),Ll(this,Qp,!0);const{selection:n}=this.hot,i=n.isSelected()?n.getSelectedRange().current():null,s=[],{columnIndex:o,origColspan:a}=r,l=!n.inInSelection(e);t.shiftKey&&i?e.col<i.from.col?s.push(i.getTopEndCorner().col,o,e.row):e.col>i.from.col?s.push(i.getTopStartCorner().col,o+a-1,e.row):s.push(o,o+a-1,e.row):(Gy(t)||Xl(t)&&l)&&s.push(o,o+a-1,e.row),n.selectColumns(...s)}function F1e(t,e,r,n){if(!this.hot.view.isMouseDown())return;const i=this._getHeaderTreeNodeDataByCoords(e);if(!i)return;const{columnIndex:s,origColspan:o}=i,a=this.hot.getSelectedRangeLast(),l=a.getTopStartCorner(),c=a.getBottomEndCorner(),{from:u}=a;n.column=!0,n.cell=!0;const h=[],d=ui(e.row,-1/0,-1);e.col<u.col?h.push(c.col,s,d):e.col>u.col?h.push(l.col,s+o-1,d):h.push(s,s+o-1,d),this.hot.selection.selectColumns(...h)}function L1e(){Ll(this,Qp,!1)}function $1e(){const{navigableHeaders:t}=this.hot.getSettings();if(!this.hot.view.isMouseDown()||!Ct(this,Qp)||!t)return;const e=this.hot.getSelectedRangeLast(),r=e.getTopStartCorner().col,n=e.getBottomEndCorner().col,{columnIndex:i,origColspan:s}=Ct(this,Dt).getHeaderTreeNodeData(Ct(this,Id).row,Ct(this,Id).col);if(e.setHighlight(Ct(this,Id)),s>e.getWidth()||i<r||i+s-1>n){const o=Ct(this,Dt).findTopMostEntireHeaderLevel(ui(r,i,i+s-1),ui(n,i,i+s-1));e.highlight.row=o,e.highlight.col=e.from.col}}function B1e(t){const{highlight:e}=this.hot.getSelectedRangeLast(),r=this.hot._createCellCoords(e.row+t.row,e.col+t.col);if(!(r.isHeader()&&r.col>=0))return;const i=Ct(this,Dt).findLeftMostColumnIndex(r.row,r.col),s=Ct(this,Dt).findRightMostColumnIndex(r.row,r.col);if(t.col<0){const o=e.col>=i&&e.col<=s?i-1:s,a=this.hot.columnIndexMapper.getNearestNotHiddenIndex(o,-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 o=e.col>=i&&e.col<=s?s+1:i,a=this.hot.columnIndexMapper.getNearestNotHiddenIndex(o,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 W1e(t,e){const r=t.row,n=this._getHeaderTreeNodeDataByCoords({row:r,col:t.col}),i=this._getHeaderTreeNodeDataByCoords({row:r,col:e.col});e.col<t.col?(n&&(t.col=n.columnIndex+n.origColspan-1),i&&(e.col=i.columnIndex)):e.col>=t.col&&(n&&(t.col=n.columnIndex),i&&(e.col=i.columnIndex+i.origColspan-1))}function V1e(t){t.length=0;for(let e=0;e<Ct(this,Dt).getLayersCount();e++)t.push(this.headerRendererFactory(e))}function U1e(t){const e=Ct(this,Dt).getLayersCount();let r=t.startColumn,n=!!e;for(let i=0;i<e;i++){const s=Ct(this,Dt).findLeftMostColumnIndex(i,t.startColumn),o=this.hot.columnIndexMapper.getRenderableFromVisualIndex(s);if(s>=0&&(n=!1),Zn(o)&&o<t.startColumn){r=o;break}}t.startColumn=n?Ct(this,Dt).getHeaderTreeNodeData(0,r).columnIndex:r}function G1e(t,e){const r=this.ghostTable.getWidth(e);return t>r?t:r}function Y1e(t,e,r){var n;const{label:i}=(n=Ct(this,Dt).getHeaderTreeNodeData(r,e))!==null&&n!==void 0?n:{label:""};return i}function z1e(t,e){if(t<0)return this.hot.getCell(t,Ct(this,Dt).findLeftMostColumnIndex(t,e),!0)}function j1e(){this.updatePlugin()}function K1e(t,e){e||this.updatePlugin()}function zh(t,e,r){return e=X1e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function X1e(t){var e=q1e(t,"string");return typeof e=="symbol"?e:String(e)}function q1e(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Z1e{constructor(e,r){zh(this,"hot",void 0),zh(this,"data",null),zh(this,"plugin",void 0),zh(this,"parentReference",new WeakMap),zh(this,"cache",{levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap}),this.hot=r,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},Ue(0,this.data.length-1,e=>{this.cacheNode(this.data[e],0,null)})}cacheNode(e,r,n){this.cache.levels[r]||(this.cache.levels[r]=[],this.cache.levelCount+=1),this.cache.levels[r].push(e),this.cache.rows.push(e),this.cache.nodeInfo.set(e,{parent:n,row:this.cache.rows.length-1,level:r}),this.hasChildren(e)&&j(e.__children,i=>{this.cacheNode(i,r+1,e)})}getDataObject(e){return e==null?null:this.cache.rows[e]}readTreeNodes(e,r,n,i){let s=!1,o=r;if(isNaN(o)&&o.end)return o;let a=e;return a||(a={__children:this.data},s=!0,o-=1),n!=null&&o===n?{result:a,end:!0}:i!=null&&a===i?{result:o,end:!0}:(o+=1,a.__children&&j(a.__children,l=>{if(this.parentReference.set(l,s?null:a),o=this.readTreeNodes(l,o,n,i),isNaN(o)&&o.end)return!1}),o)}mockParent(){const e=this.mockNode();return e.__children=this.data,e}mockNode(){const e={};return dt(this.data[0],(r,n)=>{e[n]=null}),e}getRowIndex(e){return e==null?null:this.cache.nodeInfo.get(e).row}getRowIndexWithinParent(e){let r=null;isNaN(e)?r=e:r=this.getDataObject(e);const n=this.getRowParent(e);return n==null?this.data.indexOf(r):n.__children.indexOf(r)}countAllRows(){const e={__children:this.data};return this.countChildren(e)}countChildren(e){let r=0,n=e;return isNaN(n)||(n=this.getDataObject(n)),!n||!n.__children?0:(j(n.__children,i=>{r+=1,i.__children&&(r+=this.countChildren(i))}),r)}getRowParent(e){let r;return isNaN(e)?r=e:r=this.getDataObject(e),this.getRowObjectParent(r)}getRowObjectParent(e){return!e||typeof e!="object"?null:this.cache.nodeInfo.get(e).parent}getRowLevel(e){let r=null;return isNaN(e)?r=e:r=this.getDataObject(e),r?this.getRowObjectLevel(r):null}getRowObjectLevel(e){return e==null?null:this.cache.nodeInfo.get(e).level}hasChildren(e){let r=e;return isNaN(r)||(r=this.getDataObject(r)),!!(r.__children&&r.__children.length)}isChild(e){return this.getRowParent(e)!==null}getChild(e,r){var n;return((n=e.__children)===null||n===void 0?void 0:n[r])||null}isRowHighestLevel(e){return!this.isChild(e)}isParent(e){var r;let n=e;return isNaN(n)||(n=this.getDataObject(n)),n&&!!n.__children&&((r=n.__children)===null||r===void 0?void 0:r.length)!==0}addChild(e,r){let n=r;this.hot.runHooks("beforeAddChild",e,n);let i=null;e&&(i=this.getRowIndex(e)),this.hot.runHooks("beforeCreateRow",i+this.countChildren(e)+1,1);let s=e;e||(s=this.mockParent()),s.__children||(s.__children=[]),n||(n=this.mockNode()),s.__children.push(n),this.rewriteCache();const o=this.getRowIndex(n);this.hot.rowIndexMapper.insertIndexes(o,1),this.hot.runHooks("afterCreateRow",o,1),this.hot.runHooks("afterAddChild",e,n)}addChildAtIndex(e,r,n){let i=n,s;if(i||(i=this.mockNode()),this.hot.runHooks("beforeAddChild",e,i,r),e){const a=this.getRowIndex(e)+r+1;this.hot.runHooks("beforeCreateRow",a,1),e.__children.splice(r,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),s=a}else this.plugin.disableCoreAPIModifiers(),this.hot.alter("insert_row_above",r,1,"NestedRows.addChildAtIndex"),this.plugin.enableCoreAPIModifiers(),s=this.getRowIndex(this.data[r]);i=this.getDataObject(s),this.hot.runHooks("afterAddChild",e,i,r)}addSibling(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"below";const n=this.translateTrimmedRow(e),i=this.getRowParent(n),s=this.getRowIndexWithinParent(n);switch(r){case"below":this.addChildAtIndex(i,s+1,null);break;case"above":this.addChildAtIndex(i,s,null);break}}detachFromParent(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=null;const i=[];Array.isArray(e)?(Ue(e[0],e[2],d=>{const f=this.translateTrimmedRow(d);i.push(this.getDataObject(f))}),Ue(0,i.length-2,d=>{this.detachFromParent(i[d],!1)}),n=i[i.length-1]):n=e;const s=this.getRowIndex(n),o=this.countChildren(n),a=this.getRowIndexWithinParent(n),l=this.getRowParent(n),c=this.getRowParent(l),u=this.getRowIndex(c);let h=null;if(this.hot.runHooks("beforeDetachChild",l,n),a!=null){const d=Array.from(new Array(s+o+1).keys()).splice(-1*(o+1));if(this.hot.runHooks("beforeRemoveRow",s,o+1,d,this.plugin.pluginName),l.__children.splice(a,1),this.rewriteCache(),this.hot.runHooks("afterRemoveRow",s,o+1,d,this.plugin.pluginName),c){h=u+this.countChildren(c);const f=this.getChild(c,this.countChildren(c)-1),g=this.getRowIndex(f);this.hot.runHooks("beforeCreateRow",g+1,o+1,this.plugin.pluginName),c.__children.push(n)}else h=this.hot.countRows()+1,this.hot.runHooks("beforeCreateRow",h-2,o+1,this.plugin.pluginName),this.data.push(n)}this.rewriteCache(),this.hot.runHooks("afterCreateRow",h-2,o+1,this.plugin.pluginName),this.hot.runHooks("afterDetachChild",l,n,this.getRowIndex(n)),r&&this.hot.render()}filterData(e,r,n){const i=[];j(n,s=>{i.push(this.getDataObject(s))}),j(i,s=>{const o=this.getRowIndexWithinParent(s),a=this.getRowParent(s);a===null?this.data.splice(o,1):a.__children.splice(o,1)}),this.rewriteCache()}spliceData(e,r,n){const i=this.getDataObject(e-1);let s=null,o=e;i&&i.__children&&i.__children.length===0?(s=i,o=0):e<this.countAllRows()&&(s=this.getRowParent(e),o=this.getRowIndexWithinParent(e)),s?n?s.__children.splice(o,r,...n):s.__children.splice(o,r):n?this.data.splice(o,r,...n):this.data.splice(o,r),this.rewriteCache()}syncRowWithRawSource(e){let r=e,n=null;do n=this.getRowParent(n),n!==null&&(r=n);while(n!==null);this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndex(r),"__children",r.__children,"NestedRows.syncRowWithRawSource"),this.plugin.enableCoreAPIModifiers()}moveRow(e,r,n,i){const s=r===this.hot.countRows(),o=this.getRowParent(e),a=this.getRowIndexWithinParent(e),l=o.__children.slice(a,a+1),c=e>r;let u=s?this.getRowParent(r-1):this.getRowParent(r);u==null&&(u=this.getRowParent(r-1)),u==null&&(u=this.getDataObject(r-1)),u?u.__children||(u.__children=[]):(u=this.getDataObject(r),u.__children=[]);const h=s||n||i?u.__children.length:this.getRowIndexWithinParent(r),d=o===u;u.__children.splice(h,0,l[0]),o.__children.splice(a+(c&&d?1:0),1),this.syncRowWithRawSource(o),d||this.syncRowWithRawSource(u)}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 J1e=Z1e;function u2(t,e,r){return e=Q1e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Q1e(t){var e=eSe(t,"string");return typeof e=="symbol"?e:String(e)}function eSe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class tSe{constructor(e,r){u2(this,"hot",void 0),u2(this,"plugin",void 0),this.hot=r,this.plugin=e}}const RE=tSe;class Ro extends RE{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,r){super(e,r),this.dataManager=this.plugin.dataManager,this.collapsingUI=this.plugin.collapsingUI,this.rowHeaderWidthCache=null}appendLevelIndicators(e,r){const n=this.hot.toPhysicalRow(e),i=this.dataManager.getRowLevel(n),s=this.dataManager.getDataObject(n),o=r.getElementsByTagName("DIV")[0],a=o.querySelector("span.rowHeader"),l=o.querySelectorAll('[class^="ht_nesting"]'),c=this.hot.getSettings().ariaTags;if(j(l,u=>{u&&o.removeChild(u)}),be(r,Ro.CSS_CLASSES.indicatorContainer),i){const{rootDocument:u}=this.hot,h=a.cloneNode(!0);o.innerHTML="",Ue(0,i-1,()=>{const d=u.createElement("SPAN");be(d,Ro.CSS_CLASSES.emptyIndicator),o.appendChild(d)}),o.appendChild(h)}if(this.dataManager.hasChildren(s)){const u=this.hot.rootDocument.createElement("DIV");c&&qe(u,[Yo()]),be(r,Ro.CSS_CLASSES.parent),this.collapsingUI.areChildrenCollapsed(n)?(be(u,`${Ro.CSS_CLASSES.button} ${Ro.CSS_CLASSES.expandButton}`),c&&qe(r,[Pi(!1)])):(be(u,`${Ro.CSS_CLASSES.button} ${Ro.CSS_CLASSES.collapseButton}`),c&&qe(r,[Pi(!0)])),o.appendChild(u)}}updateRowHeaderWidth(e){let r=e;r||(r=this.dataManager.cache.levelCount),this.rowHeaderWidthCache=Math.max(50,11+10*r+25),this.hot.render()}}const x4=Ro;class rSe extends RE{constructor(e,r){var n;super(e,r),n=this,this.dataManager=this.plugin.dataManager,this.collapsedRows=[],this.collapsedRowsStash={stash:function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;n.lastCollapsedRows=n.collapsedRows.slice(0),n.expandMultipleChildren(n.lastCollapsedRows,i)},shiftStash:function(i,s){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;s==null&&(s=1/0),j(n.lastCollapsedRows,(a,l)=>{a>=i&&a<s&&(n.lastCollapsedRows[l]=a+o)})},applyStash:function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;n.collapseMultipleChildren(n.lastCollapsedRows,i),n.lastCollapsedRows=void 0},trimStash:(i,s)=>{Ue(i,i+s-1,o=>{const a=this.lastCollapsedRows.indexOf(o);a>-1&&this.lastCollapsedRows.splice(a,1)})}}}collapseChildren(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];let s=null,o=null,a=null;return isNaN(e)?(s=e,o=this.dataManager.getRowIndex(s)):(s=this.dataManager.getDataObject(e),o=e),this.dataManager.hasChildren(s)&&j(s.__children,l=>{i.push(this.dataManager.getRowIndex(l))}),a=this.collapseRows(i,!0,!1),n&&this.trimRows(a),r&&this.renderAndAdjust(),this.collapsedRows.indexOf(o)===-1&&this.collapsedRows.push(o),a}collapseMultipleChildren(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];j(e,s=>{i.push(...this.collapseChildren(s,!1,!1))}),n&&this.trimRows(i),r&&this.renderAndAdjust()}collapseRow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.collapseRows([e],r)}collapseRows(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=[];return j(e,s=>{i.push(s),r&&this.collapseChildRows(s,i)}),n&&this.trimRows(i),i}collapseChildRows(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(this.dataManager.hasChildren(e)){const i=this.dataManager.getDataObject(e);j(i.__children,s=>{const o=this.dataManager.getRowIndex(s);r.push(o),this.collapseChildRows(o,r)})}n&&this.trimRows(r)}expandRow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.expandRows([e],r)}expandRows(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=[];return j(e,s=>{i.push(s),r&&this.expandChildRows(s,i)}),n&&this.untrimRows(i),i}expandChildRows(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(this.dataManager.hasChildren(e)){const i=this.dataManager.getDataObject(e);j(i.__children,s=>{if(!this.isAnyParentCollapsed(s)){const o=this.dataManager.getRowIndex(s);r.push(o),this.expandChildRows(o,r)}})}n&&this.untrimRows(r)}expandChildren(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];let s=null,o=null,a=null;return isNaN(e)?(s=e,o=this.dataManager.getRowIndex(e)):(s=this.dataManager.getDataObject(e),o=e),this.collapsedRows.splice(this.collapsedRows.indexOf(o),1),this.dataManager.hasChildren(s)&&j(s.__children,l=>{const c=this.dataManager.getRowIndex(l);i.push(c)}),a=this.expandRows(i,!0,!1),n&&this.untrimRows(a),r&&this.renderAndAdjust(),a}expandMultipleChildren(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];j(e,s=>{i.push(...this.expandChildren(s,!1,!1))}),n&&this.untrimRows(i),r&&this.renderAndAdjust()}collapseAll(){const e=this.dataManager.getData(),r=[];j(e,n=>{this.dataManager.hasChildren(n)&&r.push(n)}),this.collapseMultipleChildren(r),this.renderAndAdjust()}expandAll(){const e=this.dataManager.getData(),r=[];j(e,n=>{this.dataManager.hasChildren(n)&&r.push(n)}),this.expandMultipleChildren(r),this.renderAndAdjust()}trimRows(e){this.hot.batchExecution(()=>{j(e,r=>{this.plugin.collapsedRowsMap.setValueAtIndex(r,!0)})},!0)}untrimRows(e){this.hot.batchExecution(()=>{j(e,r=>{this.plugin.collapsedRowsMap.setValueAtIndex(r,!1)})},!0)}areChildrenCollapsed(e){let r=isNaN(e)?e:this.dataManager.getDataObject(e),n=!0;return r===null&&(r={__children:this.dataManager.data}),this.dataManager.hasChildren(r)&&j(r.__children,i=>{const s=this.dataManager.getRowIndex(i);if(!this.plugin.collapsedRowsMap.getValueAtIndex(s))return n=!1,!1}),n}isAnyParentCollapsed(e){let r=e;for(;r!==null;){r=this.dataManager.getRowParent(r);const n=this.dataManager.getRowIndex(r);if(this.collapsedRows.indexOf(n)>-1)return!0}return!1}toggleState(e,r){if(r.col>=0)return;const n=this.translateTrimmedRow(r.row);Je(e.target,x4.CSS_CLASSES.button)&&(this.areChildrenCollapsed(n)?this.expandChildren(n):this.collapseChildren(n),vs(e))}translateTrimmedRow(e){return this.hot.toPhysicalRow(e)}untranslateTrimmedRow(e){return this.hot.toVisualRow(e)}renderAndAdjust(){this.hot.render(),this.hot.view.adjustElementsSize()}}const nSe=rSe;function iSe(t,e,r){sSe(t,e),e.set(t,r)}function sSe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function oSe(t,e,r){return e=aSe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function aSe(t){var e=lSe(t,"string");return typeof e=="symbol"?e:String(e)}function lSe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function cSe(t,e){var r=uSe(t,e,"get");return hSe(t,r)}function uSe(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function hSe(t,e){return e.get?e.get.call(t):e.value}var h2=new WeakMap;class dSe extends RE{constructor(){super(...arguments),oSe(this,"dataManager",this.plugin.dataManager),iSe(this,h2,{writable:!0,value:{row_above:(e,r)=>{const n=r[r.length-1];this.dataManager.addSibling(n.start.row,"above")},row_below:(e,r)=>{const n=r[r.length-1];this.dataManager.addSibling(n.start.row,"below")}}})}appendOptions(e){const r=[{key:"add_child",name(){return this.getTranslatedPhrase(nb)},callback:()=>{const n=this.dataManager.translateTrimmedRow(this.hot.getSelectedLast()[0]),i=this.dataManager.getDataObject(n);this.dataManager.addChild(i)},disabled:()=>{const n=this.hot.getSelectedLast();return!n||n[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{key:"detach_from_parent",name(){return this.getTranslatedPhrase(ib)},callback:()=>{this.dataManager.detachFromParent(this.hot.getSelectedLast())},disabled:()=>{const n=this.hot.getSelectedLast(),i=this.dataManager.translateTrimmedRow(n[0]);return!this.dataManager.getRowParent(i)||!n||n[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{name:"---------"}];return Ue(0,e.items.length-1,n=>{if(n===0)return j(r,(i,s)=>{e.items.splice(n+s,0,i)}),!1}),this.modifyRowInsertingOptions(e)}modifyRowInsertingOptions(e){return Ue(0,e.items.length-1,r=>{const n=cSe(this,h2)[e.items[r].key];n!=null&&(e.items[r].callback=n)}),e}}const fSe=dSe;function y0(t,e,r){return e=gSe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gSe(t){var e=mSe(t,"string");return typeof e=="symbol"?e:String(e)}function mSe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class pSe{constructor(e){y0(this,"plugin",void 0),y0(this,"hot",void 0),y0(this,"dataManager",void 0),y0(this,"collapsingUI",void 0),this.plugin=e,this.hot=e.hot,this.dataManager=e.dataManager,this.collapsingUI=e.collapsingUI}onBeforeRowMove(e,r,n,i){if(this.displayAPICompatibilityWarning({rows:e,finalIndex:r,dropIndex:n,movePossible:i}))return!1;this.movedToCollapsed=!1;const o=n===this.hot.countRows(),a=o?this.hot.countSourceRows():this.dataManager.translateTrimmedRow(n);let l=!0;const c=e.map(g=>{if(!l)return!1;const m=this.dataManager.translateTrimmedRow(g);return l=this.shouldAllowMoving(m,a),m}),u=c.indexOf(a)===-1;if(!l||!u)return!1;const h=this.getBaseParent(c),d=this.getTargetParent(o,a),f=h===d;return this.movedToCollapsed=this.collapsingUI.areChildrenCollapsed(d),this.collapsingUI.collapsedRowsStash.stash(),this.shiftCollapsibleParentsLocations(c,a,f),this.moveRows(c,a,d),this.dataManager.rewriteCache(),this.moveCellsMeta(c,a),this.collapsingUI.collapsedRowsStash.applyStash(!1),this.hot.runHooks("afterRowMove",e,r,n,i,i&&this.isRowOrderChanged(e,r)),this.hot.render(),this.selectCells(e,n),!1}displayAPICompatibilityWarning(e){const{rows:r,finalIndex:n,dropIndex:i,movePossible:s}=e;let o=!1;return Gt(i)&&(Ft(Pt`Since version 8.0.0 of the Handsontable the 'moveRows' method isn't used for moving rows\x20
  133. when the NestedRows plugin is enabled. Please use the 'dragRows' method instead.`),this.hot.runHooks("afterRowMove",r,n,i,s,!1),o=!0),o}shouldAllowMoving(e,r){return!(this.dataManager.isParent(e)||this.dataManager.isRowHighestLevel(e)||e===r||r===0)}getBaseParent(e){return this.dataManager.getRowParent(e[0])}getTargetParent(e,r){let n=this.dataManager.getRowParent(e?r-1:r);return n==null&&(n=this.dataManager.getRowParent(r-1)),n}shiftCollapsibleParentsLocations(e,r,n){n||(Math.max(...e)<=r?this.collapsingUI.collapsedRowsStash.shiftStash(e[0],r,-1*e.length):this.collapsingUI.collapsedRowsStash.shiftStash(r,e[0],e.length))}moveRows(e,r,n){const i=r===this.dataManager.getRowIndex(n)+this.dataManager.countChildren(n)+1;this.hot.batchRender(()=>{e.forEach(s=>{this.dataManager.moveRow(s,r,this.movedToCollapsed,i)})})}moveCellsMeta(e,r){const n=[],i=Math.max(...e)<r;e.forEach(s=>{n.push(this.hot.getCellMetaAtRow(s))}),this.hot.spliceCellsMeta(e[0],e.length),this.hot.spliceCellsMeta(r-(i?n.length:0),0,...n)}selectCells(e,r){const n=e.length;let i=0,s=0,o=null,a=null;if(this.movedToCollapsed){let l=null;e[n-1]<r?l=this.dataManager.translateTrimmedRow(r-n):l=this.dataManager.translateTrimmedRow(r);const c=this.dataManager.getRowParent(l===null?this.hot.countSourceRows()-1:l-1),u=this.dataManager.getRowIndex(c);i=this.dataManager.untranslateTrimmedRow(u),s=i}else e[n-1]<r?(s=r-1,i=s-n+1):(i=r,s=i+n-1);o=this.hot.selection,a=this.hot.countCols()-1,o.setRangeStart(this.hot._createCellCoords(i,0)),o.setRangeEnd(this.hot._createCellCoords(s,a),!0)}isRowOrderChanged(e,r){return e.some((n,i)=>n-i!==r)}}function nn(t,e){b4(t,e),e.add(t)}function d2(t,e,r){b4(t,e),e.set(t,r)}function b4(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function UC(t,e,r){return e=wSe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wSe(t){var e=vSe(t,"string");return typeof e=="symbol"?e:String(e)}function vSe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function z0(t,e){var r=E4(t,e,"get");return CSe(t,r)}function CSe(t,e){return e.get?e.get.call(t):e.value}function Qm(t,e,r){var n=E4(t,e,"set");return SSe(t,n,r),r}function E4(t,e,r){if(!e.has(t))throw new TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function SSe(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function zr(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}const ep="nestedRows",ySe=300,f2=ep,xSe="The Nested Rows plugin requires an Array of Objects as a dataset to be provided. The plugin has been disabled.";var ew=new WeakMap,iu=new WeakMap,g2=new WeakSet,m2=new WeakSet,p2=new WeakSet,w2=new WeakSet,v2=new WeakSet,C2=new WeakSet,S2=new WeakSet,y2=new WeakSet,x2=new WeakSet,b2=new WeakSet,E2=new WeakSet,R2=new WeakSet,T2=new WeakSet,_2=new WeakSet,A2=new WeakSet,GC=new WeakSet;class bSe extends It{constructor(){super(...arguments),nn(this,GC),nn(this,A2),nn(this,_2),nn(this,T2),nn(this,R2),nn(this,E2),nn(this,b2),nn(this,x2),nn(this,y2),nn(this,S2),nn(this,C2),nn(this,v2),nn(this,w2),nn(this,p2),nn(this,m2),nn(this,g2),UC(this,"dataManager",null),UC(this,"headersUI",null),UC(this,"collapsedRowsMap",null),d2(this,ew,{writable:!0,value:!1}),d2(this,iu,{writable:!0,value:!1})}static get PLUGIN_KEY(){return ep}static get PLUGIN_PRIORITY(){return ySe}isEnabled(){return!!this.hot.getSettings()[ep]}enablePlugin(){var e=this;this.enabled||(this.collapsedRowsMap=this.hot.rowIndexMapper.registerMap("nestedRows",new bf),this.dataManager=new J1e(this,this.hot),this.collapsingUI=new nSe(this,this.hot),this.headersUI=new x4(this,this.hot),this.contextMenuUI=new fSe(this,this.hot),this.rowMoveController=new pSe(this),this.addHook("afterInit",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return zr(e,_2,FSe).call(e,...n)}),this.addHook("beforeViewRender",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return zr(e,A2,LSe).call(e,...n)}),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 r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return zr(e,p2,TSe).call(e,...n)}),this.addHook("afterContextMenuDefaultOptions",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return zr(e,w2,_Se).call(e,...n)}),this.addHook("afterGetRowHeader",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return zr(e,v2,ASe).call(e,...n)}),this.addHook("beforeOnCellMouseDown",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return zr(e,m2,RSe).call(e,...n)}),this.addHook("beforeRemoveRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return zr(e,y2,ISe).call(e,...n)}),this.addHook("afterRemoveRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return zr(e,S2,OSe).call(e,...n)}),this.addHook("beforeAddChild",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return zr(e,x2,PSe).call(e,...n)}),this.addHook("afterAddChild",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return zr(e,b2,DSe).call(e,...n)}),this.addHook("beforeDetachChild",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return zr(e,E2,kSe).call(e,...n)}),this.addHook("afterDetachChild",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return zr(e,R2,NSe).call(e,...n)}),this.addHook("modifyRowHeaderWidth",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return zr(e,C2,MSe).call(e,...n)}),this.addHook("afterCreateRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return zr(e,T2,HSe).call(e,...n)}),this.addHook("beforeRowMove",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return zr(e,g2,ESe).call(e,...n)}),this.addHook("beforeLoadData",r=>zr(this,GC,M2).call(this,r)),this.addHook("beforeUpdateData",r=>zr(this,GC,M2).call(this,r)),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 r=this.collapsingUI.translateTrimmedRow(e.row);this.collapsingUI.areChildrenCollapsed(r)?this.collapsingUI.expandChildren(r):this.collapsingUI.collapseChildren(r)}},runOnlyIf:()=>{var e;const r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r&&this.hot.selection.isCellVisible(r)&&r.isHeader()},group:f2})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(f2)}disableCoreAPIModifiers(){Qm(this,iu,!0)}enableCoreAPIModifiers(){Qm(this,iu,!1)}onModifyRowData(e){if(!z0(this,iu))return this.dataManager.getDataObject(e)}onModifySourceLength(){if(!z0(this,iu))return this.dataManager.countAllRows()}onBeforeDataSplice(e,r,n){return z0(this,iu)||this.dataManager.isRowHighestLevel(e)?!0:(this.dataManager.spliceData(e,r,n),!1)}destroy(){super.destroy()}}function ESe(t,e,r,n){return this.rowMoveController.onBeforeRowMove(t,e,r,n)}function RSe(t,e,r){this.collapsingUI.toggleState(t,e,r)}function TSe(t,e,r){return this.collapsingUI.collapsedRowsStash.stash(),this.collapsingUI.collapsedRowsStash.trimStash(r[0],e),this.collapsingUI.collapsedRowsStash.shiftStash(r[0],null,-1*e),this.dataManager.filterData(t,e,r),Qm(this,ew,!0),this.dataManager.getData().slice()}function _Se(t){return this.contextMenuUI.appendOptions(t)}function ASe(t,e){this.headersUI.appendLevelIndicators(t,e)}function MSe(t){return Math.max(this.headersUI.rowHeaderWidthCache,t)}function OSe(t,e,r,n){n!==this.pluginName&&this.hot._registerTimeout(()=>{Qm(this,ew,!1),this.headersUI.updateRowHeaderWidth(),this.collapsingUI.collapsedRowsStash.applyStash()})}function ISe(t,e,r){const n=Array.from(r.reduce((i,s)=>{if(this.dataManager.isParent(s)){const o=this.dataManager.getDataObject(s).__children;return i.add(s),Array.isArray(o)&&o.forEach(a=>i.add(this.dataManager.getRowIndex(a))),i}return i.add(s)},new Set));r.length=0,r.push(...n)}function PSe(){this.collapsingUI.collapsedRowsStash.stash()}function DSe(t,e){this.collapsingUI.collapsedRowsStash.shiftStash(this.dataManager.getRowIndex(e)),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function kSe(){this.collapsingUI.collapsedRowsStash.stash()}function NSe(t,e,r){this.collapsingUI.collapsedRowsStash.shiftStash(r,null,-1),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function HSe(){this.dataManager.rewriteCache()}function FSe(){this.headersUI.updateRowHeaderWidth()}function LSe(t,e){z0(this,ew)&&(e.skipRender=!0)}function M2(t){if(!Aie(t)){Yy(xSe),this.hot.getSettings()[ep]=!1,this.disablePlugin();return}this.dataManager.setData(t),this.dataManager.rewriteCache()}function YC(t,e,r){return e=$Se(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $Se(t){var e=BSe(t,"string");return typeof e=="symbol"?e:String(e)}function BSe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class WSe{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;YC(this,"rootWindow",void 0),YC(this,"prefix",void 0),YC(this,"savedKeys",[]),this.rootWindow=r,this.prefix=e,this.loadSavedKeys()}saveValue(e,r){this.rootWindow.localStorage.setItem(`${this.prefix}_${e}`,JSON.stringify(r)),this.savedKeys.indexOf(e)===-1&&(this.savedKeys.push(e),this.saveSavedKeys())}loadValue(e,r){const n=typeof e=="undefined"?r:e,i=this.rootWindow.localStorage.getItem(`${this.prefix}_${n}`);return i===null?void 0:JSON.parse(i)}reset(e){this.rootWindow.localStorage.removeItem(`${this.prefix}_${e}`)}resetAll(){j(this.savedKeys,(e,r)=>{this.rootWindow.localStorage.removeItem(`${this.prefix}_${this.savedKeys[r]}`)}),this.clearSavedKeys()}loadSavedKeys(){const e=this.rootWindow.localStorage.getItem(`${this.prefix}__persistentStateKeys`),r=typeof e=="string"?JSON.parse(e):void 0;this.savedKeys=r||[]}saveSavedKeys(){this.rootWindow.localStorage.setItem(`${this.prefix}__persistentStateKeys`,JSON.stringify(this.savedKeys))}clearSavedKeys(){this.savedKeys.length=0,this.saveSavedKeys()}}const VSe=WSe;function USe(t,e,r){return e=GSe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function GSe(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 r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}$e.getSingleton().register("persistentStateSave");$e.getSingleton().register("persistentStateLoad");$e.getSingleton().register("persistentStateReset");const O2="persistentState",zSe=0;class jSe extends It{constructor(){super(...arguments),USe(this,"storage",void 0)}static get PLUGIN_KEY(){return O2}static get PLUGIN_PRIORITY(){return zSe}isEnabled(){return!!this.hot.getSettings()[O2]}enablePlugin(){this.enabled||(this.storage||(this.storage=new VSe(this.hot.rootElement.id,this.hot.rootWindow)),this.addHook("persistentStateSave",(e,r)=>this.saveValue(e,r)),this.addHook("persistentStateLoad",(e,r)=>this.loadValue(e,r)),this.addHook("persistentStateReset",()=>this.resetValue()),super.enablePlugin())}disablePlugin(){this.storage=void 0,super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}loadValue(e,r){r.value=this.storage.loadValue(e)}saveValue(e,r){this.storage.saveValue(e,r)}resetValue(e){typeof e=="undefined"?this.storage.resetAll():this.storage.reset(e)}destroy(){super.destroy()}}function KSe(t,e){XSe(t,e),e.add(t)}function XSe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function zC(t,e,r){return e=qSe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qSe(t){var e=ZSe(t,"string");return typeof e=="symbol"?e:String(e)}function ZSe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function I2(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}const jC="search",JSe=190,QSe="htSearchResult",eye=function(t,e,r,n,i){t.getCellMeta(e,r).isSearchResult=i},tye=function(t,e,r){return Gt(t)||t===null||!t.toLocaleLowerCase||t.length===0||Gt(e)||e===null?!1:e.toString().toLocaleLowerCase(r.locale).indexOf(t.toLocaleLowerCase(r.locale))!==-1};var KC=new WeakSet;class rye extends It{constructor(){super(...arguments),KSe(this,KC),zC(this,"callback",eye),zC(this,"queryMethod",tye),zC(this,"searchResultClass",QSe)}static get PLUGIN_KEY(){return jC}static get PLUGIN_PRIORITY(){return JSe}isEnabled(){return this.hot.getSettings()[jC]}enablePlugin(){var e=this;if(this.enabled)return;const r=this.hot.getSettings()[jC];this.updatePluginSettings(r),this.addHook("beforeRenderer",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return I2(e,KC,P2).call(e,...i)}),super.enablePlugin()}disablePlugin(){var e=this;const r=function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return I2(e,KC,P2).call(e,...i)};this.hot.addHook("beforeRenderer",r),this.hot.addHookOnce("afterViewRender",()=>{this.hot.removeHook("beforeRenderer",r)}),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}query(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getCallback(),n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.getQueryMethod();const i=this.hot.countRows(),s=this.hot.countCols(),o=[],a=this.hot;return Ue(0,i-1,l=>{Ue(0,s-1,c=>{const u=this.hot.getDataAtCell(l,c),h=this.hot.getCellMeta(l,c),d=h.search.callback||r,g=(h.search.queryMethod||n)(e,u,h);if(g){const m={row:l,col:c,data:u};o.push(m)}d&&d(a,l,c,u,g)})}),o}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){at(e)&&(e.searchResultClass&&this.setSearchResultClass(e.searchResultClass),e.queryMethod&&this.setQueryMethod(e.queryMethod),e.callback&&this.setCallback(e.callback))}destroy(){super.destroy()}}function P2(t,e,r,n,i,s){const o=s.className||[];let a=[];typeof o=="string"?a=o.split(" "):a.push(...o),this.isEnabled()&&s.isSearchResult?a.includes(this.searchResultClass)||a.push(`${this.searchResultClass}`):a.includes(this.searchResultClass)&&a.splice(a.indexOf(this.searchResultClass),1),s.className=a.join(" ")}function XC(t,e){nye(t,e),e.add(t)}function nye(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function x0(t,e,r){return e=iye(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function iye(t){var e=sye(t,"string");return typeof e=="symbol"?e:String(e)}function sye(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function qC(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}const oye="touchScroll",aye=200;var D2=new WeakSet,k2=new WeakSet,N2=new WeakSet;class lye extends It{constructor(){super(...arguments),XC(this,N2),XC(this,k2),XC(this,D2),x0(this,"scrollbars",[]),x0(this,"clones",[]),x0(this,"lockedCollection",!1),x0(this,"freezeOverlays",!1)}static get PLUGIN_KEY(){return oye}static get PLUGIN_PRIORITY(){return aye}static get SETTING_KEYS(){return!0}isEnabled(){return OH()}enablePlugin(){this.enabled||(this.addHook("afterViewRender",()=>qC(this,D2,cye).call(this)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.lockedCollection=!1,super.updatePlugin()}disablePlugin(){super.disablePlugin()}registerEvents(){this.addHook("beforeTouchScroll",()=>qC(this,k2,uye).call(this)),this.addHook("afterMomentumScroll",()=>qC(this,N2,hye).call(this))}}function cye(){if(this.lockedCollection)return;const{topOverlay:t,bottomOverlay:e,inlineStartOverlay:r,topInlineStartCornerOverlay:n,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(r),n&&this.scrollbars.push(n),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),r.needFullRender&&this.clones.push(r.clone.wtTable.holder.parentNode),n&&this.clones.push(n.clone.wtTable.holder.parentNode),i&&i.clone&&this.clones.push(i.clone.wtTable.holder.parentNode)}function uye(){this.freezeOverlays=!0,j(this.clones,t=>{be(t,"hide-tween")})}function hye(){this.freezeOverlays=!1,j(this.clones,t=>{rt(t,"hide-tween"),be(t,"show-tween")}),this.hot._registerTimeout(()=>{j(this.clones,t=>{rt(t,"show-tween")})},400),j(this.scrollbars,t=>{t.refresh(),t.resetFixedPosition()}),this.hot.view._wt.wtOverlays.syncScrollWithMaster()}function dye(t,e){fye(t,e),e.add(t)}function fye(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gye(t,e,r){return e=mye(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mye(t){var e=pye(t,"string");return typeof e=="symbol"?e:String(e)}function pye(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function wye(t,e,r){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return r}const j0="trimRows",vye=330;var H2=new WeakSet;class Cye extends It{constructor(){super(...arguments),dye(this,H2),gye(this,"trimmedRowsMap",null)}static get PLUGIN_KEY(){return j0}static get PLUGIN_PRIORITY(){return vye}isEnabled(){return!!this.hot.getSettings()[j0]}enablePlugin(){this.enabled||(this.trimmedRowsMap=this.hot.rowIndexMapper.registerMap("trimRows",new bf),this.trimmedRowsMap.addLocalHook("init",()=>wye(this,H2,Sye).call(this)),super.enablePlugin())}updatePlugin(){const e=this.hot.getSettings()[j0];Array.isArray(e)&&this.hot.batchExecution(()=>{this.trimmedRowsMap.clear(),j(e,r=>{this.trimmedRowsMap.setValueAtIndex(r,!0)})},!0),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("trimRows"),super.disablePlugin()}getTrimmedRows(){return this.trimmedRowsMap.getTrimmedIndexes()}trimRows(e){const r=this.getTrimmedRows(),n=this.isValidConfig(e);let i=r;n&&(i=Array.from(new Set(r.concat(e)))),this.hot.runHooks("beforeTrimRow",r,i,n)!==!1&&(n&&this.hot.batchExecution(()=>{j(e,o=>{this.trimmedRowsMap.setValueAtIndex(o,!0)})},!0),this.hot.runHooks("afterTrimRow",r,i,n,n&&i.length>r.length))}trimRow(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.trimRows(r)}untrimRows(e){const r=this.getTrimmedRows(),n=this.isValidConfig(e);let i=r;const s=this.trimmedRowsMap.getValues().slice(),o=e.length>0;n&&o&&(j(e,l=>{s[l]=!1}),i=Cn(s,(l,c,u)=>(c&&l.push(u),l),[])),this.hot.runHooks("beforeUntrimRow",r,i,n&&o)!==!1&&(n&&o&&this.trimmedRowsMap.setValues(s),this.hot.runHooks("afterUntrimRow",r,i,n&&o,n&&i.length<r.length))}untrimRow(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.untrimRows(r)}isTrimmed(e){return this.trimmedRowsMap.getValueAtIndex(e)||!1}untrimAll(){this.untrimRows(this.getTrimmedRows())}isValidConfig(e){const r=this.hot.countSourceRows();return e.every(n=>Number.isInteger(n)&&n>=0&&n<r)}destroy(){super.destroy()}}function Sye(){const t=this.hot.getSettings()[j0];Array.isArray(t)&&this.hot.batchExecution(()=>{j(t,e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)})},!0)}var R4={},yye=$u,xye=R4,bye=yye("iterator"),Eye=Array.prototype,Rye=function(t){return t!==void 0&&(xye.Array===t||Eye[bye]===t)},Tye=Qk,F2=ry,_ye=ZS,Aye=R4,Mye=$u,Oye=Mye("iterator"),T4=function(t){if(!_ye(t))return F2(t,Oye)||F2(t,"@@iterator")||Aye[Tye(t)]},Iye=ac,Pye=cp,Dye=Ga,kye=lp,Nye=T4,Hye=TypeError,Fye=function(t,e){var r=arguments.length<2?Nye(t):e;if(Pye(r))return Dye(Iye(r,t));throw new Hye(kye(t)+" is not iterable")},Lye=ac,L2=Ga,$ye=ry,Bye=function(t,e,r){var n,i;L2(t);try{if(n=$ye(t,"return"),!n){if(e==="throw")throw r;return r}n=Lye(n,t)}catch(s){i=!0,n=s}if(e==="throw")throw r;if(i)throw n;return L2(n),r},Wye=sN,Vye=ac,Uye=Ga,Gye=lp,Yye=Rye,zye=hf,$2=JS,jye=Fye,Kye=T4,B2=Bye,Xye=TypeError,K0=function(t,e){this.stopped=t,this.result=e},W2=K0.prototype,qye=function(t,e,r){var n=r&&r.that,i=!!(r&&r.AS_ENTRIES),s=!!(r&&r.IS_RECORD),o=!!(r&&r.IS_ITERATOR),a=!!(r&&r.INTERRUPTED),l=Wye(e,n),c,u,h,d,f,g,m,w=function(S){return c&&B2(c,"normal",S),new K0(!0,S)},C=function(S){return i?(Uye(S),a?l(S[0],S[1],w):l(S[0],S[1])):a?l(S,w):l(S)};if(s)c=t.iterator;else if(o)c=t;else{if(u=Kye(t),!u)throw new Xye(Gye(t)+" is not iterable");if(Yye(u)){for(h=0,d=zye(t);d>h;h++)if(f=C(t[h]),f&&$2(W2,f))return f;return new K0(!1)}c=jye(t,u)}for(g=s?t.next:c.next;!(m=Vye(g,c)).done;){try{f=C(m.value)}catch(S){B2(c,"throw",S)}if(typeof f=="object"&&f&&$2(W2,f))return f}return new K0(!1)},Zye=ps,Jye=Ua,Qye=op,exe=function(t,e,r){Zye?Jye.f(t,e,Qye(0,r)):t[e]=r},txe=Ya,rxe=qye,nxe=exe;txe({target:"Object",stat:!0},{fromEntries:function(e){var r={};return rxe(e,function(n,i){nxe(r,n,i)},{AS_ENTRIES:!0}),r}});const _4="undoRedo",ixe="undoRedo";function Ne(t){const e=this;this.instance=t,this.doneActions=[],this.undoneActions=[],this.ignoreNewActions=!1,this.enabled=!1,t.addHook("afterChange",function(n,i){const s=n&&n.length;if(!s||!n.find(l=>{const[,,c,u]=l;return c!==u}))return;const a=()=>{const l=n.reduce((u,h)=>(u.push([...h]),u),[]);j(l,u=>{u[1]=t.propToCol(u[1])});const c=s>1?this.getSelected():[[l[0][0],l[0][1]]];return new Ne.ChangeAction(l,c)};e.done(a,i)}),t.addHook("afterCreateRow",(n,i,s)=>{e.done(()=>new Ne.CreateRowAction(n,i),s)});const r=(n,i,s,o)=>{const a=["visualRow","visualCol","row","col","prop"],l=a.length,c=[];return Ue(s,o,u=>{Ue(n,i,h=>{const d=t.getCellMeta(h,u);if(Object.keys(d).length!==l){const f=Object.fromEntries(Object.entries(d).filter(g=>{let[m]=g;return a.includes(m)===!1}));c.push([d.visualRow,d.visualCol,f])}})}),c};t.addHook("beforeRemoveRow",(n,i,s,o)=>{const a=()=>{const l=t.toPhysicalRow(n),c=l+i-1,u=Hn(e.instance.getSourceData(l,0,l+i-1,e.instance.countSourceCols()-1));return new Ne.RemoveRowAction(l,u,t.getSettings().fixedRowsBottom,t.getSettings().fixedRowsTop,t.rowIndexMapper.getIndexesSequence(),r(l,c,0,t.countCols()-1))};e.done(a,o)}),t.addHook("afterCreateCol",(n,i,s)=>{e.done(()=>new Ne.CreateColumnAction(n,i),s)}),t.addHook("beforeRemoveCol",(n,i,s,o)=>{const a=()=>{const l=e.instance.getSourceDataArray(),c=(e.instance.countCols()+n)%e.instance.countCols(),u=c+i-1,h=[],d=[],f=[];Ue(l.length-1,w=>{const C=[],S=l[w];Ue(c,u,v=>{C.push(S[t.toPhysicalColumn(v)])}),h.push(C)}),Ue(i-1,w=>{f.push(t.toPhysicalColumn(c+w))}),Array.isArray(t.getSettings().colHeaders)&&Ue(i-1,w=>{d.push(t.getSettings().colHeaders[t.toPhysicalColumn(c+w)]||null)});const g=t.columnIndexMapper.getIndexesSequence(),m=t.rowIndexMapper.getIndexesSequence();return new Ne.RemoveColumnAction(c,f,h,d,g,m,t.getSettings().fixedColumnsStart,r(0,t.countRows(),c,u))};e.done(a,o)}),t.addHook("beforeCellAlignment",(n,i,s,o)=>{e.done(()=>new Ne.CellAlignmentAction(n,i,s,o))}),t.addHook("beforeFilter",n=>{e.done(()=>new Ne.FiltersAction(n))}),t.addHook("beforeRowMove",(n,i)=>{n!==!1&&e.done(()=>new Ne.RowMoveAction(n,i))}),t.addHook("beforeMergeCells",(n,i)=>{i||e.done(()=>new Ne.MergeCellsAction(t,n))}),t.addHook("afterUnmergeCells",(n,i)=>{i||e.done(()=>new Ne.UnmergeCellsAction(t,n))}),t.addHook("afterInit",()=>{e.init()})}Ne.prototype.done=function(t,e){if(this.ignoreNewActions||e==="UndoRedo.undo"||e==="UndoRedo.redo"||e==="auto")return;const n=this.doneActions.slice();if(this.instance.runHooks("beforeUndoStackChange",n,e)===!1)return;const s=t(),o=this.undoneActions.slice();this.doneActions.push(s),this.instance.runHooks("afterUndoStackChange",n,this.doneActions.slice()),this.instance.runHooks("beforeRedoStackChange",o),this.undoneActions.length=0,this.instance.runHooks("afterRedoStackChange",o,this.undoneActions.slice())};Ne.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 r=Hn(e);if(this.instance.runHooks("beforeUndo",r)===!1)return;this.ignoreNewActions=!0;const i=this,s=this.undoneActions.slice();this.instance.runHooks("beforeRedoStackChange",s),e.undo(this.instance,()=>{i.ignoreNewActions=!1,i.undoneActions.push(e)}),this.instance.runHooks("afterRedoStackChange",s,this.undoneActions.slice()),this.instance.runHooks("afterUndo",r)}};Ne.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 r=Hn(e);if(this.instance.runHooks("beforeRedo",r)===!1)return;this.ignoreNewActions=!0;const i=this,s=this.doneActions.slice();this.instance.runHooks("beforeUndoStackChange",s),e.redo(this.instance,()=>{i.ignoreNewActions=!1,i.doneActions.push(e)}),this.instance.runHooks("afterUndoStackChange",s,this.doneActions.slice()),this.instance.runHooks("afterRedo",r)}};Ne.prototype.isUndoAvailable=function(){return this.doneActions.length>0};Ne.prototype.isRedoAvailable=function(){return this.undoneActions.length>0};Ne.prototype.clear=function(){this.doneActions.length=0,this.undoneActions.length=0};Ne.prototype.isEnabled=function(){return this.enabled};Ne.prototype.enable=function(){if(this.isEnabled())return;const t=this.instance;this.enabled=!0,axe(t),this.registerShortcuts(),t.addHook("afterChange",A4)};Ne.prototype.disable=function(){if(!this.isEnabled())return;const t=this.instance;this.enabled=!1,lxe(t),this.unregisterShortcuts(),t.removeHook("afterChange",A4)};Ne.prototype.destroy=function(){this.clear(),this.instance=null,this.doneActions=null,this.undoneActions=null};Ne.Action=function(){};Ne.Action.prototype.undo=function(){};Ne.Action.prototype.redo=function(){};Ne.ChangeAction=function(t,e){this.changes=t,this.selected=e,this.actionType="change"};za(Ne.ChangeAction,Ne.Action);Ne.ChangeAction.prototype.undo=function(t,e){const r=Hn(this.changes),n=t.countEmptyRows(!0),i=t.countEmptyCols(!0);for(let o=0,a=r.length;o<a;o++)r[o].splice(3,1);t.addHookOnce("afterChange",e),t.setDataAtCell(r,null,null,"UndoRedo.undo");for(let o=0,a=r.length;o<a;o++){const[l,c]=r[o];t.getSettings().minSpareRows&&l+1+t.getSettings().minSpareRows===t.countRows()&&n===t.getSettings().minSpareRows&&(t.alter("remove_row",parseInt(l+1,10),t.getSettings().minSpareRows),t.undoRedo.doneActions.pop()),t.getSettings().minSpareCols&&c+1+t.getSettings().minSpareCols===t.countCols()&&i===t.getSettings().minSpareCols&&(t.alter("remove_col",parseInt(c+1,10),t.getSettings().minSpareCols),t.undoRedo.doneActions.pop())}const s=t.getSelectedLast();if(s!==void 0){const[o,a]=r[0],[l,c]=s,u=t.view.getFirstFullyVisibleRow(),h=t.view.getFirstFullyVisibleColumn(),d=o>=u,f=a>=h;if((d&&f)===!1&&(l!==o||c!==a)===!0){const w={row:o,col:a};d===!1&&(w.verticalSnap="top"),f===!1&&(w.horizontalSnap="start"),t.scrollViewportTo(w)}}t.selectCells(this.selected,!1,!1)};Ne.ChangeAction.prototype.redo=function(t,e){const r=Hn(this.changes);for(let n=0,i=r.length;n<i;n++)r[n].splice(2,1);t.addHookOnce("afterChange",e),t.setDataAtCell(r,null,null,"UndoRedo.redo"),this.selected&&t.selectCells(this.selected,!1,!1)};Ne.CreateRowAction=function(t,e){this.index=t,this.amount=e,this.actionType="insert_row"};za(Ne.CreateRowAction,Ne.Action);Ne.CreateRowAction.prototype.undo=function(t,e){const r=t.countRows(),n=t.getSettings().minSpareRows;this.index>=r&&this.index-n<r&&(this.index-=n),t.addHookOnce("afterRemoveRow",e),t.alter("remove_row",this.index,this.amount,"UndoRedo.undo")};Ne.CreateRowAction.prototype.redo=function(t,e){t.addHookOnce("afterCreateRow",e),t.alter("insert_row_above",this.index,this.amount,"UndoRedo.redo")};Ne.RemoveRowAction=function(t,e,r,n,i,s){this.index=t,this.data=e,this.actionType="remove_row",this.fixedRowsBottom=r,this.fixedRowsTop=n,this.rowIndexesSequence=i,this.removedCellMetas=s};za(Ne.RemoveRowAction,Ne.Action);Ne.RemoveRowAction.prototype.undo=function(t,e){const r=t.getSettings(),n=[];r.fixedRowsBottom=this.fixedRowsBottom,r.fixedRowsTop=this.fixedRowsTop,this.data.forEach((i,s)=>{Object.keys(i).forEach(o=>{const a=parseInt(o,10);n.push([this.index+s,isNaN(a)?o:a,i[o]])})}),t.alter("insert_row_above",this.index,this.data.length,"UndoRedo.undo"),this.removedCellMetas.forEach(i=>{let[s,o,a]=i;t.setCellMetaObject(s,o,a)}),t.addHookOnce("afterViewRender",e),t.setSourceDataAtCell(n,null,null,"UndoRedo.undo"),t.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence)};Ne.RemoveRowAction.prototype.redo=function(t,e){t.addHookOnce("afterRemoveRow",e),t.alter("remove_row",this.index,this.data.length,"UndoRedo.redo")};Ne.CreateColumnAction=function(t,e){this.index=t,this.amount=e,this.actionType="insert_col"};za(Ne.CreateColumnAction,Ne.Action);Ne.CreateColumnAction.prototype.undo=function(t,e){t.addHookOnce("afterRemoveCol",e),t.alter("remove_col",this.index,this.amount,"UndoRedo.undo")};Ne.CreateColumnAction.prototype.redo=function(t,e){t.addHookOnce("afterCreateCol",e),t.alter("insert_col_start",this.index,this.amount,"UndoRedo.redo")};Ne.RemoveColumnAction=function(t,e,r,n,i,s,o,a){this.index=t,this.indexes=e,this.data=r,this.amount=this.data[0].length,this.headers=n,this.columnPositions=i.slice(0),this.rowPositions=s.slice(0),this.actionType="remove_col",this.fixedColumnsStart=o,this.removedCellMetas=a};za(Ne.RemoveColumnAction,Ne.Action);Ne.RemoveColumnAction.prototype.undo=function(t,e){const r=t.getSettings();r.fixedColumnsStart=this.fixedColumnsStart;const n=this.indexes.slice(0).sort(),i=(c,u,h)=>h[this.indexes.indexOf(n[u])],s=this.data.length,o=[];for(let c=0;c<s;c++)o.push(ht(this.data[c],i));const a=ht(this.headers,i),l=[];t.alter("insert_col_start",this.indexes[0],this.indexes.length,"UndoRedo.undo"),j(t.getSourceDataArray(),(c,u)=>{j(n,(h,d)=>{c[h]=o[u][d],l.push([u,h,c[h]])})}),t.setSourceDataAtCell(l,void 0,void 0,"UndoRedo.undo"),typeof this.headers!="undefined"&&j(a,(c,u)=>{t.getSettings().colHeaders[n[u]]=c}),this.removedCellMetas.forEach(c=>{let[u,h,d]=c;t.setCellMetaObject(u,h,d)}),t.batchExecution(()=>{t.rowIndexMapper.setIndexesSequence(this.rowPositions),t.columnIndexMapper.setIndexesSequence(this.columnPositions)},!0),t.addHookOnce("afterViewRender",e),t.render()};Ne.RemoveColumnAction.prototype.redo=function(t,e){t.addHookOnce("afterRemoveCol",e),t.alter("remove_col",this.index,this.amount,"UndoRedo.redo")};Ne.CellAlignmentAction=function(t,e,r,n){this.stateBefore=t,this.range=e,this.type=r,this.alignment=n};Ne.CellAlignmentAction.prototype.undo=function(t,e){j(this.range,r=>{r.forAll((n,i)=>{n>=0&&i>=0&&t.setCellMeta(n,i,"className",this.stateBefore[n][i]||" htLeft")})}),t.addHookOnce("afterViewRender",e),t.render()};Ne.CellAlignmentAction.prototype.redo=function(t,e){ha(this.range,this.type,this.alignment,(r,n)=>t.getCellMeta(r,n),(r,n,i,s)=>t.setCellMeta(r,n,i,s)),t.addHookOnce("afterViewRender",e),t.render()};Ne.FiltersAction=function(t){this.conditionsStack=t,this.actionType="filter"};za(Ne.FiltersAction,Ne.Action);Ne.FiltersAction.prototype.undo=function(t,e){const r=t.getPlugin("filters");t.addHookOnce("afterViewRender",e),r.conditionCollection.importAllConditions(this.conditionsStack.slice(0,this.conditionsStack.length-1)),r.filter()};Ne.FiltersAction.prototype.redo=function(t,e){const r=t.getPlugin("filters");t.addHookOnce("afterViewRender",e),r.conditionCollection.importAllConditions(this.conditionsStack),r.filter()};class sxe extends Ne.Action{constructor(e,r){super(),this.cellRange=r;const n=this.cellRange.getTopStartCorner(),i=this.cellRange.getBottomEndCorner();this.rangeData=e.getData(n.row,n.col,i.row,i.col)}undo(e,r){const n=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",r),n.unmergeRange(this.cellRange,!0);const i=this.cellRange.getTopStartCorner();e.populateFromArray(i.row,i.col,this.rangeData,void 0,void 0,"MergeCells")}redo(e,r){const n=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",r),n.mergeRange(this.cellRange)}}Ne.MergeCellsAction=sxe;class oxe extends Ne.Action{constructor(e,r){super(),this.cellRange=r}undo(e,r){const n=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",r),n.mergeRange(this.cellRange,!0)}redo(e,r){const n=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",r),n.unmergeRange(this.cellRange,!0),e.render()}}Ne.UnmergeCellsAction=oxe;Ne.RowMoveAction=function(t,e){this.rows=t.slice(),this.finalIndex=e,this.actionType="row_move"};za(Ne.RowMoveAction,Ne.Action);Ne.RowMoveAction.prototype.undo=function(t,e){const r=t.getPlugin("manualRowMove"),n=[].concat(this.rows),i=n.filter(a=>a>this.finalIndex),s=n.filter(a=>a<=this.finalIndex),o=i.sort((a,l)=>l-a).concat(s.sort((a,l)=>a-l));t.addHookOnce("afterViewRender",e);for(let a=0;a<o.length;a+=1){const l=t.toVisualRow(o[a]);r.moveRow(l,o[a])}t.render(),t.deselectCell(),t.selectRows(this.rows[0],this.rows[0]+this.rows.length-1)};Ne.RowMoveAction.prototype.redo=function(t,e){const r=t.getPlugin("manualRowMove");t.addHookOnce("afterViewRender",e),r.moveRows(this.rows.slice(),this.finalIndex),t.render(),t.deselectCell(),t.selectRows(this.finalIndex,this.finalIndex+this.rows.length-1)};Ne.prototype.init=function(){const t=this.instance.getSettings().undo,e=typeof t=="undefined"||t;this.instance.undoRedo||(this.instance.undoRedo=this),e?this.instance.undoRedo.enable():this.instance.undoRedo.disable()};Ne.prototype.registerShortcuts=function(){const e=this.instance.getShortcutManager().getContext("grid"),n={runOnlyIf:i=>!i.altKey,group:_4};e.addShortcuts([{keys:[["Control/Meta","z"]],callback:()=>{this.undo()}},{keys:[["Control/Meta","y"],["Control/Meta","Shift","z"]],callback:()=>{this.redo()}}],n)};Ne.prototype.unregisterShortcuts=function(){this.instance.getShortcutManager().getContext("grid").removeShortcutsByGroup(_4)};function A4(t,e){const r=this;if(e==="loadData")return r.undoRedo.clear()}function axe(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 lxe(t){delete t.undo,delete t.redo,delete t.isUndoAvailable,delete t.isRedoAvailable,delete t.clearUndo}const If=$e.getSingleton();If.add("afterUpdateSettings",function(){var t;(t=this.getPlugin("undoRedo"))===null||t===void 0||t.init()});If.register("beforeUndo");If.register("afterUndo");If.register("beforeRedo");If.register("afterRedo");Ne.PLUGIN_KEY=ixe;Ne.SETTING_KEYS=!0;function cxe(){Tt(vd),Tt(sue),Tt(Cd),Tt(Hue),Tt(Yue),Tt(LL),Tt(Hhe),Tt(yde),Tt(Xp),Tt(Yfe),Tt(pge),Tt(Ege),Tt(Zp),Tt(Zge),Tt(spe),Tt(Bpe),Tt(fwe),Tt(Rwe),Tt(Lwe),Tt(Qwe),Tt(uve),Tt(Pve),Tt(Vve),Tt(wCe),Tt(zCe),Tt(ZCe),Tt(I1e),Tt(bSe),Tt(jSe),Tt(rye),Tt(lye),Tt(Cye),Tt(Ne)}function uxe(){Ole(),jle(),rce(),xce(),cxe()}class hxe{constructor(){Jr(this,"m_aryColumn",[]);Jr(this,"m_allData",[]);Jr(this,"m_rowHeights",[]);Jr(this,"m_dColumnHeight",28);Jr(this,"m_dRowHeight",25);Jr(this,"m_mates",[]);Jr(this,"m_dRowLineWdith",0);Jr(this,"m_dColumnLineWidth",.5);Jr(this,"m_dRowTextHeight",13);Jr(this,"m_dColumnTextHeight",13)}addColumn(e,r){this.m_aryColumn.push({name:e,w:r})}addRow(e,r){this.m_allData.push(e),this.m_rowHeights.push(r)}}class dxe{constructor(){Jr(this,"data",new hxe);Jr(this,"pt",new N4);Jr(this,"dScale",1);Jr(this,"mxcad",H4.getCurrentMxCAD());Jr(this,"isDrawTableHead",!1)}draw(e,r){return this.pt=e,this.dScale=r,this.data.m_aryColumn.length==0||this.data.m_allData.length==0?!1:(this.DrawTableHead(),this.DrawContent(),!0)}DrawTableHead(){if(!this.isDrawTableHead)return;let e=this.data,r=this.pt.clone(),n=this.pt.clone(),i=new Hf(0,1,0).mult(this.Scale(this.data.m_dColumnHeight)),s=this.Scale(this.data.m_dColumnLineWidth),o=0,a=new Hf(1,0,0);for(let l=0;l<e.m_aryColumn.length;l++){let c=e.m_aryColumn[l];this.DrawLine(n,n.clone().subvec(i),s),this.DrawMCText(n.clone().addvec(a.clone().mult(this.Scale(c.w)*.5)).subvec(i.clone().mult(.5)),c.name,this.Scale(e.m_dColumnTextHeight)),n.addvec(a.clone().mult(this.Scale(c.w))),o+=this.Scale(c.w)}return this.DrawLine(n,n.clone().subvec(i),s),this.DrawLine(r,r.clone().addvec(a.clone().mult(o)),s),this.DrawLine(r.clone().subvec(i),r.addvec(a.clone().mult(o)).subvec(i),s),!0}DrawContent(){let e=this.data,r=this.pt,n=0;for(let u=0;u<e.m_aryColumn.length;u++)n+=this.Scale(e.m_aryColumn[u].w);let i=this.Scale(this.data.m_dRowLineWdith),s=new Hf(1,0,0),o=new Hf(0,1,0),a=r.clone().subvec(o.clone().mult(this.Scale(e.m_dColumnHeight))),l=[],c=[];for(let u=0;u<e.m_allData.length;u++){const h=e.m_rowHeights[u];let d=a.clone(),f=o.clone().mult(this.Scale(h||e.m_dRowHeight));for(let g=0;g<e.m_aryColumn.length;g++){let m=e.m_aryColumn[g],{hidden:w,rowspan:C,colspan:S}=e.m_mates[u][g]||{};if(w||(this.DrawLine(d,d.clone().subvec(f),i),this.DrawMCText(d.clone().addvec(s.clone().mult(this.Scale(m.w*0))).subvec(f.clone().mult(.25)),e.m_allData[u][g],this.Scale(e.m_dRowTextHeight))),typeof C=="number"&&C>0&&typeof S=="number"&&S>0)for(let A=1;A<C;A++){l.push([u+A,g]);for(let M=0;M<S;M++)c.push([u+A,g+M])}const v=l.some(([A,M])=>u===A&&g===M),T=c.some(([A,M])=>u===A&&g===M);if(v&&this.DrawLine(d,d.clone().subvec(f),i),d.addvec(s.clone().mult(this.Scale(m.w))),T||this.DrawLine(d,d.clone().subvec(s.clone().mult(this.Scale(m.w))),i),u===e.m_allData.length-1){const A=d.clone().subvec(o.clone().mult(this.Scale(h||e.m_dRowHeight)));this.DrawLine(A,A.clone().subvec(s.clone().mult(this.Scale(m.w))),i)}g===e.m_aryColumn.length-1&&this.DrawLine(d,d.clone().subvec(f),i)}a.subvec(f)}return!0}DrawLine(e,r,n){this.mxcad.drawLineWidth=n,this.mxcad.drawLine(e.x,e.y,r.x,r.y)}DrawMCText(e,r,n){if(!r)return;const i=new F4;i.textHeight=n,i.contents=r.replaceAll(`
  134. `,"\\P"),i.attachment=L4.AttachmentPoint.kTopLeft,i.lineweight=n,i.location=e,this.mxcad.drawEntity(i)}Scale(e){return e*this.dScale}}const fxe={class:"d-flex align-center justify-space-between my-2"},gxe={class:"d-flex"},Axe=xS({__name:"index",setup(t){uxe();const{isShow:e,showDialog:r}=$4(!1,"Mx_InsertTable"),n=Ff({width:"auto",height:"300",rowHeaders:!0,colHeaders:!0,autoWrapRow:!0,autoRowSize:!0,autoWrapCol:!0,startRows:10,startCols:10,licenseKey:"non-commercial-and-evaluation",dropdownMenu:!1,comments:!0,manualRowMove:!0,manualColumnFreeze:!0,manualColumnMove:!0,manualRowResize:!0,manualColumnResize:!0,mergeCells:[],contextMenu:{items:{row_above:{name:"\u4E0A\u9762\u63D2\u5165\u4E00\u884C"},row_below:{name:"\u4E0B\u9762\u63D2\u5165\u4E00\u884C"},col_left:{name:"\u5DE6\u4FA7\u63D2\u5165\u4E00\u5217"},col_right:{name:"\u53F3\u4FA7\u63D2\u5165\u4E00\u5217"},remove_row:{name:"\u79FB\u9664\u672C\u884C"},remove_col:{name:"\u79FB\u9664\u672C\u5217"},clear_custom:{name:"\u6E05\u7A7A\u6240\u6709\u5355\u5143\u683C\u6570\u636E",callback:function(){this.clear()}},mergeCells:{name:"\u5408\u5E76\u5355\u5143\u683C"}}}});B4(e,()=>{n.value.mergeCells=[]});const i=[{name:"\u786E\u5B9A",fun:()=>AE(this,null,function*(){r(!1);let d=new dxe;const f=s.value.hotInstance.getData(),g=s.value.hotInstance.getColHeader();s.value.hotInstance.getRowHeader(),g.forEach((v,T)=>{const A=s.value.hotInstance.getColWidth(T);d.data.addColumn(v.toString(),A)}),f.map((v,T)=>{d.data.addRow([...v],s.value.hotInstance.getRowHeight(T))});const m=[];s.value.hotInstance.getCellsMeta().map(v=>{const{hidden:T,row:A,col:M,rowspan:E,colspan:Y}=v;m[A]?m[A][M]={hidden:!!T,rowspan:E,colspan:Y}:m[A]=[{hidden:!!T,rowspan:E,colspan:Y}]}),d.data.m_mates=m;let w=new G4;w.setMessage(`
  135. \u6307\u5B9A\u8868\u683C\u63D2\u5165\u70B9:`);let C=yield w.go();if(!C)return;let S=Y4.viewCoordLong2Cad(1);d.draw(C,S)}),primary:!0},{name:"\u5173\u95ED",fun:()=>r(!1)}],s=Ff();let o=!1;const a=d=>{const f=d.target;if(f.files){const g=f.files[0],m=new FileReader;m.onload=function(w){var D;const C=(D=w.target)==null?void 0:D.result,S=o1(C,{type:"binary"}),v=S.Sheets[S.SheetNames[0]],T=X9.sheet_to_csv(S.Sheets[S.SheetNames[0]],{blankrows:!0}),A=v["!merges"];A&&(n.value.mergeCells=A.map(U=>({row:U.s.r,col:U.s.c,rowspan:U.e.r-U.s.r+1,colspan:U.e.c-U.s.c+1})));const M=T.split(`
  136. `);let E=0;const Y=M.map(function(U){const X=U.split(",");return E=Math.max(E,X.length),X});Y.forEach(U=>{for(;U.length<E;)U.push("")}),s.value.hotInstance.loadData(Y)},m.readAsBinaryString(g)}},l=()=>{o=j4(),window.addEventListener("focus",()=>{setTimeout(()=>{o&&z4("MxFullscreen")},100)},{once:!0})},c=Ff(4),u=Ff(4),h=()=>{const d=[];for(let f=0;f<c.value;f++){let g=[];for(let m=0;m<u.value;m++)g.push("");d.push(g)}n.value.mergeCells=[],s.value.hotInstance.loadData(d)};return(d,f)=>(V2(),W4(K4,{title:"\u8868\u683C","max-width":"600",modelValue:OE(e),"onUpdate:modelValue":f[2]||(f[2]=g=>U4(e)?e.value=g:null),footerBtnList:i},{default:Lf(()=>[$f("div",fxe,[$f("label",null,[eh(" \u5BFC\u5165\u8868\u683C: "),$f("input",{class:"mb-1",accept:".xls,.xlsx,.xlsm,.csv,.xlsb",onClick:l,type:"file",onChange:a},null,32)]),$f("div",gxe,[Bf(ME,{modelValue:c.value,"onUpdate:modelValue":f[0]||(f[0]=g=>c.value=g),type:"number",class:"pa-0",style:{"max-width":"60px"}},{prepend:Lf(()=>[eh("\u5217:")]),_:1},8,["modelValue"]),Bf(ME,{modelValue:u.value,"onUpdate:modelValue":f[1]||(f[1]=g=>u.value=g),type:"number",class:"pa-0 ml-1",style:{"max-width":"60px"}},{prepend:Lf(()=>[eh("\u884C:")]),_:1},8,["modelValue"])]),Bf(V4,{size:"24",class:"ml-2",onClick:h},{default:Lf(()=>[eh("\u65B0\u5EFA\u8868\u683C")]),_:1})]),eh(" \u9884\u89C8\u7F16\u8F91: "),Bf(OE(Gb),{settings:n.value,ref_key:"hotTable",ref:s},null,8,["settings"])]),_:1},8,["modelValue"]))}});export{Axe as default};