UNPKG

@progress/kendo-ui

Version:

This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.

53 lines 873 kB
/* @license */
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("kendo.core.min.js")):typeof define==`function`&&define.amd?define([`exports`,`kendo.core.min`],t):(e=typeof globalThis<`u`?globalThis:e||self,t((e.kendo=e.kendo||{},e.kendo._globals=e.kendo._globals||{},e.kendo._globals.SpreadsheetCommon={}),e.kendo._globals.Core))})(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var n=Object.defineProperty,r=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},i=class{},a=class extends i{constructor(){super(),this._events={}}bind(e,t,n){let r=s(e),i=o(t),a=r.length;if(t===void 0){for(let t in e)this.bind(t,e[t]);return this}for(let e=0;e<a;e++){let a=r[e],o=i?t:t[a];if(o){if(n){let e=o;o=()=>{this.unbind(a,o),e.apply(this,arguments)},o.original=e}(this._events[a]=this._events[a]||[]).push(o)}}return this}one(e,t){return this.bind(e,t,!0)}first(e,t){let n=s(e),r=o(t);for(let e=0,i=n.length;e<i;e++){let i=n[e],a=r?t:t[i];a&&(this._events[i]=this._events[i]||[]).unshift(a)}return this}trigger(e,t={}){let n=this._events[e];if(n){let e=n.length;t.sender=this,t._defaultPrevented=!1,t.preventDefault=c,t.isDefaultPrevented=l,n=n.slice();for(let r=0;r<e;r++)n[r].call(this,t);return t._defaultPrevented===!0}return!1}unbind(e,t){let n=this._events[e];if(e===void 0)this._events={};else if(n)if(t)for(let e=n.length-1;e>=0;e--)(n[e]===t||n[e].original===t)&&n.splice(e,1);else this._events[e]=[];return this}};function o(e){return typeof e==`function`}function s(e){return typeof e==`string`?[e]:e}function c(){this._defaultPrevented=!0}function l(){return this._defaultPrevented===!0}let u=e=>{let t=typeof window<`u`?window:{},n=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)};u=e=>n.call(t,e),u(e)};var d=u;let f=/&/g,p=/</g,m=/"/g,h=/'/g,g=/>/g;function _(e){return String(e).replace(f,`&amp;`).replace(p,`&lt;`).replace(g,`&gt;`).replace(m,`&quot;`).replace(h,`&#39;`)}function v(e){let t=window.console;t!==void 0&&t.log&&t.log(e)}function y(e){let t={edge:/(edge)[ \/]([\w.]+)/i,webkit:/(chrome)[ \/]([\w.]+)/i,safari:/(webkit)[ \/]([\w.]+)/i,opera:/(opera)(?:.*version|)[ \/]([\w.]+)/i,msie:/(msie\s|trident.*? rv:)([\w.]+)/i,mozilla:/(mozilla)(?:.*? rv:([\w.]+))/i},n={};for(let r in t)if(t.hasOwnProperty(r)){let i=e.match(t[r]);if(i){n[r]=!0,n[i[1].toLowerCase().split(` `)[0].split(`/`)[0]]=!0,n.version=parseInt(document.documentMode||i[2],10);break}}return n}let b=null,x={get browser(){return typeof window>`u`||b||(b=y(window.navigator.userAgent)),b}},S=Date.now||function(){return new Date().getTime()};function C(e,t){let n=0,r;if(!t||t<=0)return e;let i=function(){let i=S()-n,a=arguments,o=function(){e.apply(null,a),n=S()};if(!n)return o();r&&clearTimeout(r),i>t?o():r=setTimeout(o,t-i)};return i.cancel=function(){clearTimeout(r)},i}let w={aliceblue:`f0f8ff`,antiquewhite:`faebd7`,aqua:`00ffff`,aquamarine:`7fffd4`,azure:`f0ffff`,beige:`f5f5dc`,bisque:`ffe4c4`,black:`000000`,blanchedalmond:`ffebcd`,blue:`0000ff`,blueviolet:`8a2be2`,brown:`a52a2a`,burlywood:`deb887`,cadetblue:`5f9ea0`,chartreuse:`7fff00`,chocolate:`d2691e`,coral:`ff7f50`,cornflowerblue:`6495ed`,cornsilk:`fff8dc`,crimson:`dc143c`,cyan:`00ffff`,darkblue:`00008b`,darkcyan:`008b8b`,darkgoldenrod:`b8860b`,darkgray:`a9a9a9`,darkgrey:`a9a9a9`,darkgreen:`006400`,darkkhaki:`bdb76b`,darkmagenta:`8b008b`,darkolivegreen:`556b2f`,darkorange:`ff8c00`,darkorchid:`9932cc`,darkred:`8b0000`,darksalmon:`e9967a`,darkseagreen:`8fbc8f`,darkslateblue:`483d8b`,darkslategray:`2f4f4f`,darkslategrey:`2f4f4f`,darkturquoise:`00ced1`,darkviolet:`9400d3`,deeppink:`ff1493`,deepskyblue:`00bfff`,dimgray:`696969`,dimgrey:`696969`,dodgerblue:`1e90ff`,firebrick:`b22222`,floralwhite:`fffaf0`,forestgreen:`228b22`,fuchsia:`ff00ff`,gainsboro:`dcdcdc`,ghostwhite:`f8f8ff`,gold:`ffd700`,goldenrod:`daa520`,gray:`808080`,grey:`808080`,green:`008000`,greenyellow:`adff2f`,honeydew:`f0fff0`,hotpink:`ff69b4`,indianred:`cd5c5c`,indigo:`4b0082`,ivory:`fffff0`,khaki:`f0e68c`,lavender:`e6e6fa`,lavenderblush:`fff0f5`,lawngreen:`7cfc00`,lemonchiffon:`fffacd`,lightblue:`add8e6`,lightcoral:`f08080`,lightcyan:`e0ffff`,lightgoldenrodyellow:`fafad2`,lightgray:`d3d3d3`,lightgrey:`d3d3d3`,lightgreen:`90ee90`,lightpink:`ffb6c1`,lightsalmon:`ffa07a`,lightseagreen:`20b2aa`,lightskyblue:`87cefa`,lightslategray:`778899`,lightslategrey:`778899`,lightsteelblue:`b0c4de`,lightyellow:`ffffe0`,lime:`00ff00`,limegreen:`32cd32`,linen:`faf0e6`,magenta:`ff00ff`,maroon:`800000`,mediumaquamarine:`66cdaa`,mediumblue:`0000cd`,mediumorchid:`ba55d3`,mediumpurple:`9370d8`,mediumseagreen:`3cb371`,mediumslateblue:`7b68ee`,mediumspringgreen:`00fa9a`,mediumturquoise:`48d1cc`,mediumvioletred:`c71585`,midnightblue:`191970`,mintcream:`f5fffa`,mistyrose:`ffe4e1`,moccasin:`ffe4b5`,navajowhite:`ffdead`,navy:`000080`,oldlace:`fdf5e6`,olive:`808000`,olivedrab:`6b8e23`,orange:`ffa500`,orangered:`ff4500`,orchid:`da70d6`,palegoldenrod:`eee8aa`,palegreen:`98fb98`,paleturquoise:`afeeee`,palevioletred:`d87093`,papayawhip:`ffefd5`,peachpuff:`ffdab9`,peru:`cd853f`,pink:`ffc0cb`,plum:`dda0dd`,powderblue:`b0e0e6`,purple:`800080`,red:`ff0000`,rosybrown:`bc8f8f`,royalblue:`4169e1`,saddlebrown:`8b4513`,salmon:`fa8072`,sandybrown:`f4a460`,seagreen:`2e8b57`,seashell:`fff5ee`,sienna:`a0522d`,silver:`c0c0c0`,skyblue:`87ceeb`,slateblue:`6a5acd`,slategray:`708090`,slategrey:`708090`,snow:`fffafa`,springgreen:`00ff7f`,steelblue:`4682b4`,tan:`d2b48c`,teal:`008080`,thistle:`d8bfd8`,tomato:`ff6347`,turquoise:`40e0d0`,violet:`ee82ee`,wheat:`f5deb3`,white:`ffffff`,whitesmoke:`f5f5f5`,yellow:`ffff00`,yellowgreen:`9acd32`},T=x.browser,E=e=>{let t=Object.keys(w);t.push(`transparent`);let n=RegExp(`^(`+t.join(`|`)+`)(\\W|$)`,`i`);return E=e=>n.exec(e),n.exec(e)};var D=class extends i{constructor(){super()}toHSV(){return this}toRGB(){return this}toHex(e){return this.toBytes().toHex(e)}toBytes(){return this}toCss(e){return`#`+this.toHex(e)}toCssRgba(){let e=this.toBytes();return`rgba(${e.r}, ${e.g}, ${e.b}, ${parseFloat(Number(this.a).toFixed(3))})`}toCssHex(){return this.a===1?`#`+this.toHex():`#`+this.toHex({alpha:!0})}toDisplay(){return T.msie&&T.version<9?this.toCss():this.toCssRgba()}equals(e){return e===this||e!=null&&this.toCssRgba()===se(e).toCssRgba()}diff(e){if(e===null)return NaN;let t=this.toBytes(),n=e.toBytes();return Math.sqrt(((t.r-n.r)*.3)**2+((t.g-n.g)*.59)**2+((t.b-n.b)*.11)**2)}clone(){let e=this.toBytes();return e===this&&(e=new te(e.r,e.g,e.b,e.a)),e}},ee=class extends D{constructor(e,t,n,r){super(),this.r=e,this.g=t,this.b=n,this.a=r}toHSV(){let{r:e,g:t,b:n}=this,r=Math.min(e,t,n),i=Math.max(e,t,n),a=i-r,o=i,s,c;return a===0?new re(0,0,o,this.a):(i===0?(c=0,s=-1):(c=a/i,s=e===i?(t-n)/a:t===i?2+(n-e)/a:4+(e-t)/a,s*=60,s<0&&(s+=360)),new re(s,c,o,this.a))}toHSL(){let{r:e,g:t,b:n}=this,r=Math.max(e,t,n),i=Math.min(e,t,n),a,o,s=(r+i)/2;if(r===i)a=o=0;else{let c=r-i;switch(o=s>.5?c/(2-r-i):c/(r+i),r){case e:a=(t-n)/c+(t<n?6:0);break;case t:a=(n-e)/c+2;break;case n:a=(e-t)/c+4;break;default:break}}return new ie(a*60,o*100,s*100,this.a)}toBytes(){return new te(this.r*255,this.g*255,this.b*255,this.a)}},te=class extends ee{constructor(e,t,n,r){super(Math.round(e),Math.round(t),Math.round(n),r)}toRGB(){return new ee(this.r/255,this.g/255,this.b/255,this.a)}toHSV(){return this.toRGB().toHSV()}toHSL(){return this.toRGB().toHSL()}toHex(e){let t=ne(this.r,2)+ne(this.g,2)+ne(this.b,2);return e&&e.alpha&&(t+=ne(Math.round(this.a*255),2)),t}toBytes(){return this}};function ne(e,t,n=`0`){let r=e.toString(16);for(;t>r.length;)r=n+r;return r}var re=class extends D{constructor(e,t,n,r){super(),this.h=e,this.s=t,this.v=n,this.a=r}toRGB(){let{h:e,s:t,v:n}=this,r,i,a;if(t===0)r=i=a=n;else{e/=60;let o=Math.floor(e),s=e-o,c=n*(1-t),l=n*(1-t*s),u=n*(1-t*(1-s));switch(o){case 0:r=n,i=u,a=c;break;case 1:r=l,i=n,a=c;break;case 2:r=c,i=n,a=u;break;case 3:r=c,i=l,a=n;break;case 4:r=u,i=c,a=n;break;default:r=n,i=c,a=l;break}}return new ee(r,i,a,this.a)}toHSL(){return this.toRGB().toHSL()}toBytes(){return this.toRGB().toBytes()}},ie=class extends D{constructor(e,t,n,r){super(),this.h=e,this.s=t,this.l=n,this.a=r}toRGB(){let e=this.h/360,t=this.s/100,n=this.l/100,r,i,a;if(t===0)r=i=a=n;else{let o=n<.5?n*(1+t):n+t-n*t,s=2*n-o;r=ae(s,o,e+1/3),i=ae(s,o,e),a=ae(s,o,e-1/3)}return new ee(r,i,a,this.a)}toHSV(){return this.toRGB().toHSV()}toBytes(){return this.toRGB().toBytes()}};function ae(e,t,n){let r=n;return r<0&&(r+=1),r>1&&--r,r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function oe(e){return parseFloat(parseFloat(parseInt(e,16)/255).toFixed(3))}function se(e,t){let n,r;if(!e||e===`none`)return null;if(e instanceof D)return e;let i=e.toLowerCase();if(n=E(i))return i=n[1]===`transparent`?new ee(1,1,1,0):se(w[n[1]],t),i.match=[n[1]],i;if((n=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})\b/i.exec(i))?r=new te(parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16),1):(n=/^#?([0-9a-f])([0-9a-f])([0-9a-f])\b/i.exec(i))?r=new te(parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16),1):(n=/^#?([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])\b/i.exec(i))?r=new te(parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16),oe(n[4]+n[4])):(n=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})\b/i.exec(i))?r=new te(parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16),oe(n[4])):(n=/^rgb\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/.exec(i))?r=new te(parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10),1):(n=/^rgba\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9.]+)\s*\)/.exec(i))?r=new te(parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10),parseFloat(n[4])):(n=/^rgb\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*\)/.exec(i))?r=new ee(parseFloat(n[1])/100,parseFloat(n[2])/100,parseFloat(n[3])/100,1):(n=/^rgba\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9.]+)\s*\)/.exec(i))?r=new ee(parseFloat(n[1])/100,parseFloat(n[2])/100,parseFloat(n[3])/100,parseFloat(n[4])):(n=/^color\(\s*srgb\s*([0-9]*\.?[0-9]+)\s+([0-9]*\.?[0-9]+)\s+([0-9]*\.?[0-9]+)\s*(\/\s+([0-9]*\.?[0-9]+))?\)/.exec(i))&&(r=new ee(parseFloat(n[1]),parseFloat(n[2]),parseFloat(n[3]),parseFloat(n[5]||`1`))),r)r.match=n;else if(!t)throw Error(`Cannot parse color: `+i);return r}var ce=class e extends i{constructor(t){if(super(),arguments.length===1){let n=e.formats,r=this.resolveColor(t);for(let e=0;e<n.length;e++){let t=n[e].re,i=n[e].process,a=t.exec(r);if(a){let e=i(a);this.r=e[0],this.g=e[1],this.b=e[2]}}}else this.r=arguments[0],this.g=arguments[1],this.b=arguments[2];this.r=this.normalizeByte(this.r),this.g=this.normalizeByte(this.g),this.b=this.normalizeByte(this.b)}toHex(){let e=this.padDigit,t=this.r.toString(16),n=this.g.toString(16),r=this.b.toString(16);return`#`+e(t)+e(n)+e(r)}resolveColor(t){let n=t||`black`;return n.charAt(0)===`#`&&(n=n.substr(1,6)),n=n.replace(/ /g,``),n=n.toLowerCase(),n=e.namedColors[n]||n,n}normalizeByte(e){return e<0||isNaN(e)?0:e>255?255:e}padDigit(e){return e.length===1?`0`+e:e}brightness(e){let t=Math.round;return this.r=t(this.normalizeByte(this.r*e)),this.g=t(this.normalizeByte(this.g*e)),this.b=t(this.normalizeByte(this.b*e)),this}percBrightness(){return Math.sqrt(.241*this.r*this.r+.691*this.g*this.g+.068*this.b*this.b)}isDark(){return this.percBrightness()<180}static fromBytes(e,t,n,r){return new te(e,t,n,r??1)}static fromRGB(e,t,n,r){return new ee(e,t,n,r??1)}static fromHSV(e,t,n,r){return new re(e,t,n,r??1)}static fromHSL(e,t,n,r){return new ie(e,t,n,r??1)}};ce.formats=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,process:function(e){return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,process:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,process:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}}],ce.namedColors=w;let le=e=>e.ownerDocument.defaultView.getComputedStyle(e),ue=(e,t)=>{let n=document.createElement(`div`);e.parentElement?e.parentElement.appendChild(n):e.appendChild(n),n.style.color=`rgb(from ${t} clamp(0, r, 255) clamp(0, g, 255) clamp(0, b, 255))`;let r=se(le(n).color,!0);return n.remove(),r?r.toCssHex():`#000000`};function de(e,t){let n=le(e).getPropertyValue(t),r=se(n,!0);return r?r.toCssHex():ue(e,n)}var fe=class extends i{observers(){return this._observers=this._observers||[],this._observers}addObserver(e){return this._observers?this._observers.push(e):this._observers=[e],this}removeObserver(e){let t=this.observers(),n=t.indexOf(e);return n!==-1&&t.splice(n,1),this}trigger(e,t){let n=this._observers;if(n&&!this._suspended)for(let r=0;r<n.length;r++){let i=n[r];i[e]&&i[e](t)}return this}optionsChange(e={}){e.element=this,this.trigger(`optionsChange`,e)}geometryChange(){this.trigger(`geometryChange`,{element:this})}suspend(){return this._suspended=(this._suspended||0)+1,this}resume(){return this._suspended=Math.max((this._suspended||0)-1,0),this}_observerField(e,t){this[e]&&this[e].removeObserver(this),this[e]=t,t.addObserver(this)}};let pe={}.toString;var me=class e extends fe{constructor(e,t=``){super(),this.prefix=t;for(let t in e){let n=e[t];n=this._wrap(n,t),this[t]=n}}get(e){let t=e.split(`.`),n=this;for(;t.length&&n;){let e=t.shift();n=n[e]}return n}set(e,t){this.get(e)!==t&&(this._set(e,this._wrap(t,e)),this.optionsChange({field:this.prefix+e,value:t}))}_set(t,n){let r=t.indexOf(`.`)>=0,i=this,a=t;if(r){let t=a.split(`.`),n=this.prefix;for(;t.length>1;){a=t.shift(),n+=a+`.`;let r=i[a];r||(r=new e({},n),r.addObserver(this),i[a]=r),i=r}a=t[0]}i._clear(a),i[a]=n}_clear(e){let t=this[e];t&&t.removeObserver&&t.removeObserver(this)}_wrap(t,n){let r=pe.call(t),a=t;return a!=null&&r===`[object Object]`&&(!(t instanceof e)&&!(t instanceof i)&&(a=new e(a,this.prefix+n+`.`)),a.addObserver(this)),a}};function he(e){return function(t){return this[e]!==t&&(this[e]=t,this.geometryChange()),this}}function ge(e){return function(){return this[e]}}function _e(e,t){for(let n=0;n<t.length;n++){let r=t[n],i=r.charAt(0).toUpperCase()+r.substring(1,r.length);e[`set`+i]=he(r),e[`get`+i]=ge(r)}}let ve=(e,t)=>{let n=class extends e{};return _e(n.prototype,t),n};function ye(e,t){return e.push.apply(e,t),e}let be={1:`i`,10:`x`,100:`c`,2:`ii`,20:`xx`,200:`cc`,3:`iii`,30:`xxx`,300:`ccc`,4:`iv`,40:`xl`,400:`cd`,5:`v`,50:`l`,500:`d`,6:`vi`,60:`lx`,600:`dc`,7:`vii`,70:`lxx`,700:`dcc`,8:`viii`,80:`lxxx`,800:`dccc`,9:`ix`,90:`xc`,900:`cm`,1e3:`m`};function xe(e){let t=[1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],n=``;for(;e>0;)e<t[0]?t.shift():(n+=be[t[0]],e-=t[0]);return n}function Se(){let e,t,n=new Promise((r,i)=>{e=e=>(n._state=`resolved`,r(e),n),t=e=>(n._state=`rejected`,i(e),n)});return n._state=`pending`,n.resolve=e,n.reject=t,n.state=()=>n._state,n}function Ce(e){return e!==void 0}let we=1;function Te(){return`kdef`+we++}let Ee=Math.PI/180,De=Number.MAX_VALUE,Oe=-Number.MAX_VALUE;function ke(e){return e/Ee}let Ae=String.fromCharCode;function je(e){let t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(55296<=r&&r<=56319){let t=r,i=e.charCodeAt(++n);isNaN(i)||(r=(t-55296)*1024+(i-56320)+65536)}r<128?t+=Ae(r):r<2048?(t+=Ae(192|r>>>6),t+=Ae(128|r&63)):r<65536?(t+=Ae(224|r>>>12),t+=Ae(128|r>>>6&63),t+=Ae(128|r&63)):r<1114111&&(t+=Ae(240|r>>>18),t+=Ae(128|r>>>12&63),t+=Ae(128|r>>>6&63),t+=Ae(128|r&63))}return t}function Me(e){return Ae(e>>8)+Ae(e&255)}function Ne(e){let t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r<65535)t+=Me(r);else{let e=(r-65536>>10)+55296,n=(r-65536&1023)+56320;t+=Me(e),t+=Me(n)}}return t}let Pe=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`;function Fe(e){let t=``,n=0,r=je(e);for(;n<r.length;){let e=r.charCodeAt(n++),i=r.charCodeAt(n++),a=r.charCodeAt(n++),o=e>>2,s=(e&3)<<4|i>>4,c=(i&15)<<2|a>>6,l=a&63;isNaN(i)?c=l=64:isNaN(a)&&(l=64),t=t+Pe.charAt(o)+Pe.charAt(s)+Pe.charAt(c)+Pe.charAt(l)}return t}function Ie(e){return(e.x||{}).location===void 0?{x:e.pageX||e.clientX||0,y:e.pageY||e.clientY||0}:{x:e.x.location,y:e.y.location}}function Le(e={}){return e.touch?e.touch.initialTouch:e.target}function Re(e){return e===``||e===null||e===`none`||e===`transparent`||e===void 0}function ze(e){if(e)return e[e.length-1]}function Be(e,t,n){return Math.max(Math.min(e,n),t)}function Ve(e,t){if(e.length<2)return e.slice();function n(e,n){for(var r=[],i=0,a=0,o=0;i<e.length&&a<n.length;)t(e[i],n[a])<=0?r[o++]=e[i++]:r[o++]=n[a++];return i<e.length&&r.push.apply(r,e.slice(i)),a<n.length&&r.push.apply(r,n.slice(a)),r}return(function e(t){if(t.length<=1)return t;var r=Math.floor(t.length/2),i=t.slice(0,r),a=t.slice(r);return i=e(i),a=e(a),n(i,a)})(e)}function He(e){return Promise.all(e)}function Ue(e){return e*Ee}function We(e){return e?10**e:1}function O(e,t){let n=We(t);return Math.round(e*n)/n}function Ge(e,t){return e===void 0?t:e}function Ke(e,t){for(let n in t){let r=n.trim().split(` `);for(let i=0;i<r.length;i++)e.addEventListener(r[i],t[n],!1)}}function qe(e){let t=e.getBoundingClientRect(),n=document.documentElement;return{top:t.top+(window.pageYOffset||n.scrollTop)-(n.clientTop||0),left:t.left+(window.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}}function Je(e,t){let n={},r=window.getComputedStyle(e)||{},i=Array.isArray(t)?t:[t];for(let e=0;e<i.length;e++){let t=i[e];n[t]=r[t]}return n}function Ye(e){return isNaN(e)?e:e+`px`}function Xe(e,t){if(t){let{width:n,height:r}=t;n!==void 0&&(e.style.width=Ye(n)),r!==void 0&&(e.style.height=Ye(r))}else{let t=Je(e,[`width`,`height`]);return{width:parseInt(t.width,10),height:parseInt(t.height,10)}}}function Ze(e,t={}){for(let n in t){let r=n.trim().split(` `);for(let i=0;i<r.length;i++)e.removeEventListener(r[i],t[n],!1)}}function Qe(e){let{paddingLeft:t,paddingTop:n}=Je(e,[`paddingLeft`,`paddingTop`]);return{top:parseFloat(n),left:parseFloat(t)}}var $e=class e extends i{constructor(e=0,t=0,n=0,r=0,i=0,a=0){super(),this.a=e,this.b=t,this.c=n,this.d=r,this.e=i,this.f=a}multiplyCopy(t){return new e(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.e+this.c*t.f+this.e,this.b*t.e+this.d*t.f+this.f)}invert(){let{a:t,b:n,c:r,d:i,e:a,f:o}=this,s=t*i-n*r;return s===0?null:new e(i/s,-n/s,-r/s,t/s,(r*o-i*a)/s,(n*a-t*o)/s)}clone(){return new e(this.a,this.b,this.c,this.d,this.e,this.f)}equals(e){return e?this.a===e.a&&this.b===e.b&&this.c===e.c&&this.d===e.d&&this.e===e.e&&this.f===e.f:!1}round(e){return this.a=O(this.a,e),this.b=O(this.b,e),this.c=O(this.c,e),this.d=O(this.d,e),this.e=O(this.e,e),this.f=O(this.f,e),this}toArray(e){let t=[this.a,this.b,this.c,this.d,this.e,this.f];if(e!==void 0)for(let n=0;n<t.length;n++)t[n]=O(t[n],e);return t}toString(e,t=`,`){return this.toArray(e).join(t)}static translate(t,n){return new e(1,0,0,1,t,n)}static unit(){return new e(1,0,0,1,0,0)}static rotate(t,n,r){let i=new e;return i.a=Math.cos(Ue(t)),i.b=Math.sin(Ue(t)),i.c=-i.b,i.d=i.a,i.e=n-n*i.a+r*i.b||0,i.f=r-r*i.a-n*i.b||0,i}static scale(t,n){return new e(t,0,0,n,0,0)}};$e.IDENTITY=$e.unit();let et=/matrix\((.*)\)/;function tt(e){let t=e.match(et);return t===null||t.length!==2?$e.unit():new $e(...t[1].split(`,`).map(e=>parseFloat(e)))}function nt(e){let t=getComputedStyle(e).transform;return t===`none`?$e.unit():tt(t)}function rt(e){if(!e)return $e.unit();let t=nt(e),n=e.parentElement;for(;n;){let e=nt(n);t=t.multiplyCopy(e),n=n.parentElement}return t.b=t.c=t.e=t.f=0,t}var it=class extends i{constructor(e){super(),this._size=e,this._length=0,this._map={}}put(e,t){let n=this._map,r={key:e,value:t};n[e]=r,this._head?(this._tail.newer=r,r.older=this._tail,this._tail=r):this._head=this._tail=r,this._length>=this._size?(n[this._head.key]=null,this._head=this._head.newer,this._head.older=null):this._length++}get(e){let t=this._map[e];if(t)return t===this._head&&t!==this._tail&&(this._head=t.newer,this._head.older=null),t!==this._tail&&(t.older&&(t.older.newer=t.newer,t.newer.older=t.older),t.older=this._tail,t.newer=null,this._tail.newer=t,this._tail=t),t.value}};let at=/\r?\n|\r|\t/g;function ot(e){return String(e).replace(at,` `)}function st(e){let t=[];for(let n in e)t.push(n+e[n]);return t.sort().join(``)}function ct(e){let t=2166136261;for(let n=0;n<e.length;++n)t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24),t^=e.charCodeAt(n);return t>>>0}function lt(){return{width:0,height:0,baseline:0}}let ut={baselineMarkerSize:1},dt;typeof document<`u`&&(dt=document.createElement(`div`),dt.style.setProperty(`position`,`absolute`,`important`),dt.style.setProperty(`top`,`-4000px`,`important`),dt.style.setProperty(`width`,`auto`,`important`),dt.style.setProperty(`height`,`auto`,`important`),dt.style.setProperty(`padding`,`0`,`important`),dt.style.setProperty(`margin`,`0`,`important`),dt.style.setProperty(`border`,`0`,`important`),dt.style.setProperty(`line-height`,`normal`,`important`),dt.style.setProperty(`visibility`,`hidden`,`important`),dt.style.setProperty(`white-space`,`pre`,`important`));var ft=class extends i{constructor(e){super(),this._cache=new it(1e3),this.options=Object.assign({},ut,e)}measure(e,t,n={}){if(e==null)return lt();let r=ct(e+st(t)),i=this._cache.get(r);if(i)return i;let a=lt(),o=n.box||dt,s=this._baselineMarker().cloneNode(!1);for(let e in t){let n=t[e];n!==void 0&&(o.style[e]=n)}let c=n.normalizeText===!1?String(e):ot(e);return o.textContent=c,o.appendChild(s),document.body.appendChild(o),c.length&&(a.width=o.offsetWidth-this.options.baselineMarkerSize,a.height=o.offsetHeight,a.baseline=s.offsetTop+this.options.baselineMarkerSize),a.width>0&&a.height>0&&this._cache.put(r,a),o.parentNode.removeChild(o),a}_baselineMarker(){let e=document.createElement(`div`);return e.style.display=`inline-block`,e.style.verticalAlign=`baseline`,e.style.width=this.options.baselineMarkerSize+`px`,e.style.height=this.options.baselineMarkerSize+`px`,e.style.overflow=`hidden`,e}};ft.current=new ft;function pt(e,t,n){return ft.current.measure(e,t,n)}let mt=()=>typeof window<`u`,ht={wp:/(Windows Phone(?: OS)?)\s(\d+)\.(\d+(\.\d+)?)/,fire:/(Silk)\/(\d+)\.(\d+(\.\d+)?)/,android:/(Android|Android.*(?:Opera|Firefox).*?\/)\s*(\d+)(\.(\d+(\.\d+)?))?/,iphone:/(iPhone|iPod).*OS\s+(\d+)[\._]([\d\._]+)/,ipad:/(iPad).*OS\s+(\d+)[\._]([\d_]+)/,meego:/(MeeGo).+NokiaBrowser\/(\d+)\.([\d\._]+)/,webos:/(webOS)\/(\d+)\.(\d+(\.\d+)?)/,blackberry:/(BlackBerry|BB10).*?Version\/(\d+)\.(\d+(\.\d+)?)/,playbook:/(PlayBook).*?Tablet\s*OS\s*(\d+)\.(\d+(\.\d+)?)/,windows:/(MSIE)\s+(\d+)\.(\d+(\.\d+)?)/,tizen:/(tizen).*?Version\/(\d+)\.(\d+(\.\d+)?)/i,sailfish:/(sailfish).*rv:(\d+)\.(\d+(\.\d+)?).*firefox/i,ffos:/(Mobile).*rv:(\d+)\.(\d+(\.\d+)?).*Firefox/},gt={ios:/^i(phone|pad|pod)$/i,android:/^android|fire$/i,blackberry:/^blackberry|playbook/i,windows:/windows/,wp:/wp/,flat:/sailfish|ffos|tizen/i,meego:/meego/},_t={edge:/(edge)[ \/]([\w.]+)/i,webkit:/(chrome)[ \/]([\w.]+)/i,safari:/(webkit)[ \/]([\w.]+)/i,opera:/(opera)(?:.*version|)[ \/]([\w.]+)/i,msie:/(msie\s|trident.*? rv:)([\w.]+)/i,mozilla:/(mozilla)(?:.*? rv:([\w.]+)|)/i},vt={omini:/Opera\sMini/i,omobile:/Opera\sMobi/i,firefox:/Firefox|Fennec/i,mobilesafari:/version\/.*safari/i,ie:/MSIE|Windows\sPhone/i,chrome:/chrome|crios/i,webkit:/webkit/i},yt=(e,t,n)=>{for(let n in t)if(t.hasOwnProperty(n)&&t[n].test(e))return n;return n===void 0?e:n},bt=e=>{let t,n=[];for(let r in ht)if(ht.hasOwnProperty(r)){if(n=e.match(ht[r]),!n)continue;if(r===`windows`&&`plugins`in window.navigator)return null;let i={};return i.device=r,i.browser=yt(e,vt,`default`),i.name=yt(r,gt),i[i.name]=!0,i.majorVersion=n[2],i.minorVersion=n[3]?n[3].replace(`_`,`.`):`.0`,t=i.minorVersion.replace(`.`,``).substr(0,2),i.flatVersion=i.majorVersion+t+Array(3-(t.length<3?t.length:2)).join(`0`),i.cordova=!0,i.appMode=window.navigator.standalone||/file|local|wmapp/.test(window.location.protocol)||i.cordova,i}return null},xt=e=>{let t=null,n=[];for(let r in _t)if(_t.hasOwnProperty(r)&&(n=e.match(_t[r]),n)){t={},t[r]=!0,t[n[1].toLowerCase().split(` `)[0].split(`/`)[0]]=!0,t.version=parseInt(document.documentMode||n[2],10);break}return t},St=mt()&&window.navigator?window.navigator.userAgent:null,Ct=St?xt(St):null;St&&bt(St),mt()&&`ontouchstart`in window,Ct&&!Ct.chrome&&window.MSPointerEvent,Ct&&!Ct.chrome&&window.PointerEvent;let wt={};wt.undefined=e=>e;let Tt={};Tt.undefined=e=>e;let Et=/\/\*[\s\S]*?\*\//g,Dt=/([^\s:;]+?)\s*:\s*((?:(?:url\(\s*(?:(?:[^"')\\]|\\.)*|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')\s*\)|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|[^;"'])*?)\s*)(?=;|$)/gi,Ot=/&quot;|&#34;|&#x22;/gi,kt=/&apos;|&#39;|&#x27;/gi;function At(e){return e.replace(Ot,`"`).replace(kt,`'`)}function jt(e){let t={},n=At((e||``).replace(Et,``)),r=Dt.exec(n),i,a;for(;r!==null;)i=r[1].trim(),a=r[2].trim(),t[i]=a,r=Dt.exec(n);return t}let Mt=(e,t)=>{let n=jt(t);Object.keys(n).forEach(t=>{e.style[t]=n[t]})},Nt=`data-style`,Pt=e=>(e||``).replace(/\sstyle=/g,` data-style=`),Ft=e=>{Array.from(e.querySelectorAll(`[data-style]`)).forEach(e=>{let t=e.getAttribute(Nt);e.removeAttribute(Nt),Mt(e,t)})},It=(e,t)=>{e.innerHTML=Pt(t),Ft(e)},Lt=(e,t)=>{let n=document.createElement(`div`);It(n,t),n.firstElementChild&&e.insertBefore(n.firstElementChild,e.firstChild)};var Rt=r({DEG_TO_RAD:()=>Ee,LRUCache:()=>it,MAX_NUM:()=>De,MIN_NUM:()=>Oe,TextMetrics:()=>ft,append:()=>ye,arabicToRoman:()=>xe,bindEvents:()=>Ke,createPromise:()=>Se,defined:()=>Ce,definitionId:()=>Te,deg:()=>ke,elementOffset:()=>qe,elementPadding:()=>Qe,elementScale:()=>rt,elementSize:()=>Xe,elementStyles:()=>Je,encodeBase64:()=>Fe,eventCoordinates:()=>Ie,eventElement:()=>Le,hashKey:()=>ct,isTransparent:()=>Re,last:()=>ze,limitValue:()=>Be,measureText:()=>pt,mergeSort:()=>Ve,normalizeText:()=>ot,now:()=>S,objectKey:()=>st,promiseAll:()=>He,rad:()=>Ue,round:()=>O,setInnerHTML:()=>It,unbindEvents:()=>Ze,valueOrDefault:()=>Ge});function zt(e){return e&&typeof e.matrix==`function`?e.matrix():e}var k=class e extends ve(fe,[`x`,`y`]){constructor(e,t){super(),this.x=e||0,this.y=t||0}equals(e){return e&&e.x===this.x&&e.y===this.y}clone(){return new e(this.x,this.y)}rotate(t,n){let r=e.create(n)||e.ZERO;return this.transform($e.rotate(t,r.x,r.y))}translate(e,t){return this.x+=e,this.y+=t,this.geometryChange(),this}translateWith(e){return this.translate(e.x,e.y)}move(e,t){return this.x=this.y=0,this.translate(e,t)}scale(e,t=e){return this.x*=e,this.y*=t,this.geometryChange(),this}scaleCopy(e,t){return this.clone().scale(e,t)}transform(e){let t=zt(e),{x:n,y:r}=this;return this.x=t.a*n+t.c*r+t.e,this.y=t.b*n+t.d*r+t.f,this.geometryChange(),this}transformCopy(e){let t=this.clone();return e&&t.transform(e),t}distanceTo(e){let t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)}round(e){return this.x=O(this.x,e),this.y=O(this.y,e),this.geometryChange(),this}toArray(e){let t=e!==void 0;return[t?O(this.x,e):this.x,t?O(this.y,e):this.y]}toString(e,t=` `){let{x:n,y:r}=this;return e!==void 0&&(n=O(n,e),r=O(r,e)),n+t+r}static create(t,n){if(t!==void 0)return t instanceof e?t:arguments.length===1&&t.length===2?new e(t[0],t[1]):new e(t,n)}static min(){let t=De,n=De;for(let e=0;e<arguments.length;e++){let r=arguments[e];t=Math.min(r.x,t),n=Math.min(r.y,n)}return new e(t,n)}static max(){let t=Oe,n=Oe;for(let e=0;e<arguments.length;e++){let r=arguments[e];t=Math.max(r.x,t),n=Math.max(r.y,n)}return new e(t,n)}static minPoint(){return new e(Oe,Oe)}static maxPoint(){return new e(De,De)}static get ZERO(){return new e(0,0)}},Bt=class e extends ve(fe,[`width`,`height`]){constructor(e,t){super(),this.width=e||0,this.height=t||0}equals(e){return e&&e.width===this.width&&e.height===this.height}clone(){return new e(this.width,this.height)}toArray(e){let t=e!==void 0;return[t?O(this.width,e):this.width,t?O(this.height,e):this.height]}static create(t,n){if(t!==void 0)return t instanceof e?t:arguments.length===1&&t.length===2?new e(t[0],t[1]):new e(t,n)}static get ZERO(){return new e(0,0)}},A=class e extends fe{constructor(e=new k,t=new Bt,n=0){super(),this.setOrigin(e),this.setSize(t),this.setCornerRadius(n)}clone(){return new e(this.origin.clone(),this.size.clone())}equals(e){return e&&e.origin.equals(this.origin)&&e.size.equals(this.size)}setOrigin(e){return this._observerField(`origin`,k.create(e)),this.geometryChange(),this}getOrigin(){return this.origin}setCornerRadius(e){return this.cornerRadius=Array.isArray(e)?e:[e,e],this.geometryChange(),this}getCornerRadius(){return this.cornerRadius}setSize(e){return this._observerField(`size`,Bt.create(e)),this.geometryChange(),this}getSize(){return this.size}width(){return this.size.width}height(){return this.size.height}topLeft(){return this.origin.clone()}bottomRight(){return this.origin.clone().translate(this.width(),this.height())}topRight(){return this.origin.clone().translate(this.width(),0)}bottomLeft(){return this.origin.clone().translate(0,this.height())}center(){return this.origin.clone().translate(this.width()/2,this.height()/2)}bbox(t){let n=this.topLeft().transformCopy(t),r=this.topRight().transformCopy(t),i=this.bottomRight().transformCopy(t),a=this.bottomLeft().transformCopy(t);return e.fromPoints(n,r,i,a)}transformCopy(t){return e.fromPoints(this.topLeft().transform(t),this.bottomRight().transform(t))}expand(e,t=e){return this.size.width+=2*e,this.size.height+=2*t,this.origin.translate(-e,-t),this}expandCopy(e,t){return this.clone().expand(e,t)}containsPoint(e){let t=this.origin,n=this.bottomRight();return!(e.x<t.x||e.y<t.y||n.x<e.x||n.y<e.y)}_isOnPath(e,t){let n=this.expandCopy(t,t),r=this.expandCopy(-t,-t);return n.containsPoint(e)&&!r.containsPoint(e)}static fromPoints(){let t=k.min.apply(null,arguments),n=k.max.apply(null,arguments),r=new Bt(n.x-t.x,n.y-t.y);return new e(t,r)}static union(t,n){return e.fromPoints(k.min(t.topLeft(),n.topLeft()),k.max(t.bottomRight(),n.bottomRight()))}static intersect(t,n){let r={left:t.topLeft().x,top:t.topLeft().y,right:t.bottomRight().x,bottom:t.bottomRight().y},i={left:n.topLeft().x,top:n.topLeft().y,right:n.bottomRight().x,bottom:n.bottomRight().y};if(r.left<=i.right&&i.left<=r.right&&r.top<=i.bottom&&i.top<=r.bottom)return e.fromPoints(new k(Math.max(r.left,i.left),Math.max(r.top,i.top)),new k(Math.min(r.right,i.right),Math.min(r.bottom,i.bottom)))}},Vt=class e extends fe{constructor(e=$e.unit()){super(),this._matrix=e}clone(){return new e(this._matrix.clone())}equals(e){return e&&e._matrix.equals(this._matrix)}translate(e,t){return this._matrix=this._matrix.multiplyCopy($e.translate(e,t)),this._optionsChange(),this}scale(e,t=e,n=null){let r=n;return r&&(r=k.create(r),this._matrix=this._matrix.multiplyCopy($e.translate(r.x,r.y))),this._matrix=this._matrix.multiplyCopy($e.scale(e,t)),r&&(this._matrix=this._matrix.multiplyCopy($e.translate(-r.x,-r.y))),this._optionsChange(),this}rotate(e,t){let n=k.create(t)||k.ZERO;return this._matrix=this._matrix.multiplyCopy($e.rotate(e,n.x,n.y)),this._optionsChange(),this}multiply(e){let t=zt(e);return this._matrix=this._matrix.multiplyCopy(t),this._optionsChange(),this}matrix(e){return e?(this._matrix=e,this._optionsChange(),this):this._matrix}_optionsChange(){this.optionsChange({field:`transform`,value:this})}};function Ht(e){return e===null?null:e instanceof Vt?e:new Vt(e)}let Ut={dot:[1.5,3.5],dash:[4,3.5],longdash:[8,3.5],dashdot:[3.5,3.5,1.5,3.5],longdashdot:[8,3.5,1.5,3.5],longdashdotdot:[8,3.5,1.5,3.5,1.5,3.5]},Wt=`butt`;var Gt=class extends fe{get nodeType(){return`Rect`}constructor(e){super(),this._initOptions(e)}_initOptions(e={}){let{clip:t,transform:n}=e;n&&(e.transform=Ht(n)),t&&!t.id&&(t.id=Te()),this.options=new me(e),this.options.addObserver(this)}transform(e){if(e!==void 0)this.options.set(`transform`,Ht(e));else return this.options.get(`transform`)}parentTransform(){let e=this,t;for(;e.parent;){e=e.parent;let n=e.transform();n&&(t=n.matrix().multiplyCopy(t||$e.unit()))}if(t)return Ht(t)}currentTransform(e=this.parentTransform()){let t=zt(this.transform()),n=zt(e),r;if(r=t&&n?n.multiplyCopy(t):t||n,r)return Ht(r)}visible(e){return e===void 0?this.options.get(`visible`)!==!1:(this.options.set(`visible`,e),this)}clip(e){let t=this.options;return e===void 0?t.get(`clip`):(e&&!e.id&&(e.id=Te()),t.set(`clip`,e),this)}opacity(e){return e===void 0?Ge(this.options.get(`opacity`),1):(this.options.set(`opacity`,e),this)}className(e){return e===void 0?this.options.get(`className`):(this.options.set(`className`,e),this)}clippedBBox(e){let t=this._clippedBBox(e);if(t){let n=this.clip();return n?A.intersect(t,n.bbox(e)):t}}containsPoint(e,t){if(this.visible()){let n=this.currentTransform(t),r=e;return n&&(r=e.transformCopy(n.matrix().invert())),this._hasFill()&&this._containsPoint(r)||this._isOnPath&&this._hasStroke()&&this._isOnPath(r)}return!1}_hasFill(){let e=this.options.fill;return e&&(e.nodeType===`Pattern`||!Re(e.color))}_hasStroke(){let e=this.options.stroke;return e&&e.width>0&&!Re(e.color)}_clippedBBox(e){return this.bbox(e)}};function Kt(e,t,n,r){let i=0,a=0;return r&&(i=Math.atan2(r.c*n,r.a*t),r.b!==0&&(a=Math.atan2(r.d*n,r.b*t))),{x:i,y:a}}let qt=Math.PI/2;var Jt=class e extends ve(fe,[`radius`]){constructor(e=new k,t=0){super(),this.setCenter(e),this.setRadius(t)}setCenter(e){return this._observerField(`center`,k.create(e)),this.geometryChange(),this}getCenter(){return this.center}equals(e){return e&&e.center.equals(this.center)&&e.radius===this.radius}clone(){return new e(this.center.clone(),this.radius)}pointAt(e){return this._pointAt(Ue(e))}bbox(e){let t=Kt(this.center,this.radius,this.radius,e),n=k.maxPoint(),r=k.minPoint();for(let i=0;i<4;i++){let a=this._pointAt(t.x+i*qt).transformCopy(e),o=this._pointAt(t.y+i*qt).transformCopy(e),s=new k(a.x,o.y);n=k.min(n,s),r=k.max(r,s)}return A.fromPoints(n,r)}_pointAt(e){let{center:t,radius:n}=this;return new k(t.x+n*Math.cos(e),t.y+n*Math.sin(e))}containsPoint(e){let{center:t,radius:n}=this;return(e.x-t.x)**2+(e.y-t.y)**2<=n**2}_isOnPath(e,t){let{center:n,radius:r}=this,i=n.distanceTo(e);return r-t<=i&&i<=r+t}};let Yt=e=>class extends e{fill(e,t){let n=this.options;if(e!==void 0){if(e&&e.nodeType!==`Gradient`){let r={color:e};t!==void 0&&(r.opacity=t),n.set(`fill`,r)}else n.set(`fill`,e);return this}return n.get(`fill`)}stroke(e,t,n){return e===void 0?this.options.get(`stroke`):(this.options.set(`stroke.color`,e),t!==void 0&&this.options.set(`stroke.width`,t),n!==void 0&&this.options.set(`stroke.opacity`,n),this)}},Xt=$e.IDENTITY.toString(),Zt=e=>class extends e{bbox(e){let t=zt(this.currentTransform(e)),n=t?t.toString():Xt,r;this._bboxCache&&this._matrixHash===n?r=this._bboxCache.clone():(r=this._bbox(t),this._bboxCache=r?r.clone():null,this._matrixHash=n);let i=this.options.get(`stroke.width`);return i&&r&&r.expand(i/2),r}geometryChange(){delete this._bboxCache,this.trigger(`geometryChange`,{element:this})}};function Qt(e){let t=`_`+e;return function(e){return e===void 0?this[t]:(this._observerField(t,e),this.geometryChange(),this)}}function $t(e,t){for(let n=0;n<t.length;n++)e[t[n]]=Qt(t[n])}let en=(e,t=[`geometry`])=>{let n=class extends e{};return $t(n.prototype,t),n};var tn=class extends Yt(Zt(en(Gt))){get nodeType(){return`Circle`}constructor(e=new Jt,t={}){super(t),this.geometry(e),this.options.stroke===void 0&&this.stroke(`#000`)}rawBBox(){return this._geometry.bbox()}_bbox(e){return this._geometry.bbox(e)}_containsPoint(e){return this.geometry().containsPoint(e)}_isOnPath(e){return this.geometry()._isOnPath(e,this.options.stroke.width/2)}};function nn(e,t,n=10){return O(Math.abs(e-t),n)===0}function rn(e,t,n){return e<t||nn(e,t,n)}function an(e,t,n,r){let i=t.x-e.x,a=r.x-n.x,o=t.y-e.y,s=r.y-n.y,c=e.x-n.x,l=e.y-n.y,u=i*s-a*o,d=(i*l-o*c)/u,f=(a*l-s*c)/u;if(d>=0&&d<=1&&f>=0&&f<=1)return new k(e.x+f*i,e.y+f*o)}let on=Math.pow,sn=[`radiusX`,`radiusY`,`startAngle`,`endAngle`,`anticlockwise`];var cn=class e extends ve(fe,sn){constructor(e=new k,t={}){super(),this.setCenter(e),this.radiusX=t.radiusX,this.radiusY=t.radiusY||t.radiusX,this.startAngle=t.startAngle,this.endAngle=t.endAngle,this.anticlockwise=t.anticlockwise||!1,this.xRotation=t.xRotation}clone(){return new e(this.center,{radiusX:this.radiusX,radiusY:this.radiusY,startAngle:this.startAngle,endAngle:this.endAngle,anticlockwise:this.anticlockwise})}setCenter(e){return this._observerField(`center`,k.create(e)),this.geometryChange(),this}getCenter(){return this.center}pointAt(e){let t=this.center,n=Ue(e);return new k(t.x+this.radiusX*Math.cos(n),t.y+this.radiusY*Math.sin(n))}curvePoints(){let e=this.startAngle,t=this.anticlockwise?-1:1,n=[this.pointAt(e)],r=this._arcInterval(),i=r.endAngle-r.startAngle,a=Math.ceil(i/45),o=i/a,s=e,c;this.xRotation&&(c=Ht().rotate(this.xRotation,this.center));for(let e=1;e<=a;e++){let e=s+t*o,r=this._intervalCurvePoints(s,e,c);n.push(r.cp1,r.cp2,r.p2),s=e}return n}bbox(e){let t=this._arcInterval(),n=t.startAngle,r=t.endAngle,i=Kt(this.center,this.radiusX,this.radiusY,e),a=ke(i.x),o=ke(i.y),s=this.pointAt(r).transformCopy(e),c=dn(a,n),l=dn(o,n),u=this.pointAt(n).transformCopy(e),d=k.min(u,s),f=k.max(u,s);for(;c<r||l<r;){let t;c<r&&(t=this.pointAt(c).transformCopy(e),c+=90);let n;l<r&&(n=this.pointAt(l).transformCopy(e),l+=90),u=new k(t.x,n.y),d=k.min(d,u),f=k.max(f,u)}return A.fromPoints(d,f)}_arcInterval(){let{startAngle:e,endAngle:t,anticlockwise:n}=this;if(n){let n=e;e=t,t=n}return(e>t||n&&e===t)&&(t+=360),{startAngle:e,endAngle:t}}_intervalCurvePoints(e,t,n){let r=this.pointAt(e),i=this.pointAt(t),a=this._derivativeAt(e),o=this._derivativeAt(t),s=(Ue(t)-Ue(e))/3,c=new k(r.x+s*a.x,r.y+s*a.y),l=new k(i.x-s*o.x,i.y-s*o.y);return n&&(r.transform(n),i.transform(n),c.transform(n),l.transform(n)),{p1:r,cp1:c,cp2:l,p2:i}}_derivativeAt(e){let t=Ue(e);return new k(-this.radiusX*Math.sin(t),this.radiusY*Math.cos(t))}containsPoint(e){let t=this._arcInterval(),n=t.endAngle-t.startAngle,{center:r,radiusX:i,radiusY:a}=this,o=r.distanceTo(e),s=Math.atan2(e.y-r.y,e.x-r.x),c=i*a/Math.sqrt(on(i,2)*on(Math.sin(s),2)+on(a,2)*on(Math.cos(s),2)),l=this.pointAt(this.startAngle).round(10),u=this.pointAt(this.endAngle).round(10),d=an(r,e.round(10),l,u),f;if(n<180)f=d&&rn(r.distanceTo(d),o)&&rn(o,c);else{let n=ln(r.x,r.y,i,a,e.x,e.y);n!==360&&(n=(360+n)%360);let s=t.startAngle<=n&&n<=t.endAngle;f=s&&rn(o,c)||!s&&(!d||d.equals(e))}return f}_isOnPath(e,t){let n=this._arcInterval(),r=this.center,i=ln(r.x,r.y,this.radiusX,this.radiusY,e.x,e.y);return i!==360&&(i=(360+i)%360),n.startAngle<=i&&i<=n.endAngle&&this.pointAt(i).distanceTo(e)<=t}static fromPoints(t,n,r,i,a,o,s){let c=un({x1:t.x,y1:t.y,x2:n.x,y2:n.y,rx:r,ry:i,largeArc:a,swipe:o,rotation:s});return new e(c.center,{startAngle:c.startAngle,endAngle:c.endAngle,radiusX:c.radiusX,radiusY:c.radiusY,xRotation:c.xRotation,anticlockwise:o===0})}};function ln(e,t,n,r,i,a){let o=O((i-e)/n,3),s=O((a-t)/r,3);return O(ke(Math.atan2(s,o)))}function un(e){let{x1:t,y1:n,x2:r,y2:i,rx:a,ry:o,largeArc:s,swipe:c,rotation:l=0}=e,u=Ue(l),d=Math.cos(u),f=Math.sin(u),p=d*(t-r)/2+f*(n-i)/2,m=-f*(t-r)/2+d*(n-i)/2,h=s===c?-1:1,g=p**2,_=m**2,v=a**2,y=o**2,b=g/v+_/y;b>1&&(b=Math.sqrt(g/v+_/y),a=b*a,v=a**2,o=b*o,y=o**2);let x=h*Math.sqrt((v*y-v*_-y*g)/(v*_+y*g));isNaN(x)&&(x=0);let S=a*m*x/o,C=-x*(o*p)/a,w=d*S-f*C+(t+r)/2,T=f*S+d*C+(n+i)/2,E=(p-S)/a,D=(m-C)/o,ee=-(p+S)/a,te=-(m+C)/o,ne=(D>=0?1:-1)*ke(Math.acos(E/Math.sqrt(E*E+D*D))),re=O((E*ee+D*te)/(Math.sqrt(E*E+D*D)*Math.sqrt(ee*ee+te*te)),10),ie=(E*te-D*ee>=0?1:-1)*ke(Math.acos(re));!c&&ie>0&&(ie-=360),c&&ie<0&&(ie+=360);let ae=ne+ie,oe=ae>=0?1:-1;return ae=Math.abs(ae)%360*oe,{center:new k(w,T),startAngle:ne,endAngle:ae,radiusX:a,radiusY:o,xRotation:l}}function dn(e,t){let n=e;for(;n<t;)n+=90;return n}let fn=[].splice,pn=[].slice;var mn=class extends fe{constructor(e=[]){super(),this.length=0,this._splice(0,e.length,e)}elements(e){return e?(this._splice(0,this.length,e),this._change(),this):this.slice(0)}push(...e){let t=this.length,n=e.length;for(let r=0;r<n;r++)this[t+r]=e[r],e[r].addObserver(this);return this.length=t+n,this._change(),this.length}slice(){return pn.call(this)}pop(){if(this.length>0){let e=this[this.length-1];return this.length--,e.removeObserver(this),this._change(),e}}splice(e,t,...n){let r=this._splice(e,t,n);return this._change(),r}shift(){if(this.length>0){let e=this[0];for(let e=1;e<this.length;e++)this[e-1]=this[e];return this.length--,e.removeObserver(this),this._change(),e}}unshift(...e){let t=e.length;for(let e=this.length-1;e>=0;e--)this[e+t]=this[e];for(let n=0;n<t;n++)this[n]=e[n],e[n].addObserver(this);return this.length+=t,this._change(),this.length}indexOf(e){let t=this.length;for(let n=0;n<t;n++)if(this[n]===e)return n;return-1}_splice(e,t,n){let r=fn.apply(this,[e,t].concat(n));return this._clearObserver(r),this._setObserver(n),r}_add(e){this._setObserver(e),this._change()}_remove(e){this._clearObserver(e),this._change()}_setObserver(e){for(let t=0;t<e.length;t++)e[t].addObserver(this)}_clearObserver(e){for(let t=0;t<e.length;t++)e[t].removeObserver(this)}_change(){}},hn=class extends mn{_change(){this.geometryChange()}};function gn(e,t,n){let r=ke(Math.atan2(t.y-e.y,t.x-e.x));return n.transformCopy(Ht().rotate(-r,e)).x<e.x}function _n(e,t,n){let r=1-e;return r**3*n[0][t]+3*r**2*e*n[1][t]+3*e**2*r*n[2][t]+e**3*n[3][t]}function vn(e,t){return[-e[0][t]+3*e[1][t]-3*e[2][t]+e[3][t],3*(e[0][t]-2*e[1][t]+e[2][t]),3*(-e[0][t]+e[1][t]),e[0][t]]}var yn=class e extends i{constructor(e=0,t=0){super(),this.real=e,this.img=t}add(t){return new e(O(this.real+t.real,10),O(this.img+t.img,10))}addConstant(t){return new e(this.real+t,this.img)}negate(){return new e(-this.real,-this.img)}multiply(t){return new e(this.real*t.real-this.img*t.img,this.real*t.img+this.img*t.real)}multiplyConstant(t){return new e(this.real*t,this.img*t)}nthRoot(t){let n=Math.atan2(this.img,this.real),r=Math.sqrt(this.img**2+this.real**2)**(1/t);return new e(r*Math.cos(n/t),r*Math.sin(n/t))}equals(e){return this.real===e.real&&this.img===e.img}isReal(){return this.img===0}};function bn(e){return e<0?-1:1}function xn(e,t,n){let r=Math.sqrt(t**2-4*e*n);return[(-t+r)/(2*e),(-t-r)/(2*e)]}function Sn(e,t,n,r){if(e===0)return xn(t,n,r);let i=(3*e*n-t**2)/(3*e**2),a=(2*t**3-9*e*t*n+27*e**2*r)/(27*e**3),o=(i/3)**3+(a/2)**2,s=new yn(0,1),c=-t/(3*e),l,u,d,f,p,m,h;o<0?(l=new yn(-a/2,Math.sqrt(-o)).nthRoot(3),u=new yn(-a/2,-Math.sqrt(-o)).nthRoot(3)):(l=-a/2+Math.sqrt(o),l=new yn(bn(l)*Math.abs(l)**(1/3)),u=-a/2-Math.sqrt(o),u=new yn(bn(u)*Math.abs(u)**(1/3))),d=l.add(u),m=l.add(u).multiplyConstant(-1/2),h=l.add(u.negate()).multiplyConstant(Math.sqrt(3)/2),f=m.add(s.multiply(h)),p=m.add(s.negate().multiply(h));let g=[];return d.isReal()&&g.push(O(d.real+c,10)),f.isReal()&&g.push(O(f.real+c,10)),p.isReal()&&g.push(O(p.real+c,10)),g}function Cn(e,t,n,r,i){let a=vn(e,r),o=Sn(a[0],a[1],a[2],a[3]-t[r]),s;for(let r=0;r<o.length;r++)if(0<=o[r]&&o[r]<=1&&(s=_n(o[r],n,e),Math.abs(s-t[n])<=i))return!0}function wn(e,t,n){let r=vn(e,`x`),i=Sn(r[0],r[1],r[2],r[3]-t.x),a,o,s=0;for(let r=0;r<i.length;r++)a=_n(i[r],`y`,e),o=nn(a,t.y)||a>t.y,o&&((i[r]===0||i[r]===1)&&n.bottomRight().x>t.x||0<i[r]&&i[r]<1)&&s++;return s}function Tn(e,t,n){let r;if(e.x!==t.x){let i=Math.min(e.x,t.x),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y),s=Math.max(e.y,t.y),c=i<=n.x&&n.x<a;r=o===s?n.y<=o&&c:c&&(s-o)*((e.x-t.x)*(e.y-t.y)>0?n.x-i:a-n.x)/(a-i)+o-n.y>=0}return+!!r}function En(e){let t=`_`+e;return function(e){return e===void 0?this[t]:(this._observerField(t,k.create(e)),this.geometryChange(),this)}}function Dn(e,t){for(let n=0;n<t.length;n++)e[t[n]]=En(t[n])}let On=(e,t)=>{let n=class extends e{};return Dn(n.prototype,t),n},kn=[`anchor`,`controlIn`,`controlOut`];var An=class extends On(fe,kn){constructor(e,t,n){super(),this.anchor(e||new k),this.controlIn(t),this.controlOut(n)}bboxTo(e,t){let n=this.anchor().transformCopy(t),r=e.anchor().transformCopy(t),i;return i=this.controlOut()&&e.controlIn()?this._curveBoundingBox(n,this.controlOut().transformCopy(t),e.controlIn().transformCopy(t),r):this._lineBoundingBox(n,r),i}_lineBoundingBox(e,t){return A.fromPoints(e,t)}_curveBoundingBox(e,t,n,r){let i=[e,t,n,r],a=this._curveExtremesFor(i,`x`),o=this._curveExtremesFor(i,`y`),s=jn([a.min,a.max,e.x,r.x]),c=jn([o.min,o.max,e.y,r.y]);return A.fromPoints(new k(s.min,c.min),new k(s.max,c.max))}_curveExtremesFor(e,t){let n=this._curveExtremes(e[0][t],e[1][t],e[2][t],e[3][t]);return{min:_n(n.min,t,e),max:_n(n.max,t,e)}}_curveExtremes(e,t,n,r){let i=e-3*t+3*n-r,a=-2*(e-2*t+n),o=e-t,s=Math.sqrt(a*a-4*i*o),c=0,l=1;i===0?a!==0&&(c=l=-o/a):isNaN(s)||(c=(-a+s)/(2*i),l=(-a-s)/(2*i));let u=Math.max(Math.min(c,l),0);(u<0||u>1)&&(u=0);let d=Math.min(Math.max(c,l),1);return(d>1||d<0)&&(d=1),{min:u,max:d}}_intersectionsTo(e,t){let n;return n=this.controlOut()&&e.controlIn()?wn([this.anchor(),this.controlOut(),e.controlIn(),e.anchor()],t,this.bboxTo(e)):Tn(this.anchor(),e.anchor(),t),n}_isOnCurveTo(e,t,n,r){if(this.bboxTo(e).expand(n,n).containsPoint(t)){let i=this.anchor(),a=this.controlOut(),o=e.controlIn(),s=e.anchor();if(r===`start`&&i.distanceTo(t)<=n)return!gn(i,a,t);if(r===`end`&&s.distanceTo(t)<=n)return!gn(s,o,t);let c=[i,a,o,s];if(Cn(c,t,`x`,`y`,n)||Cn(c,t,`y`,`x`,n))return!0;let l=Ht().rotate(45,t),u=[i.transformCopy(l),a.transformCopy(l),o.transformCopy(l),s.transformCopy(l)];return Cn(u,t,`x`,`y`,n)||Cn(u,t,`y`,`x`,n)}}_isOnLineTo(e,t,n){let r=this.anchor(),i=e.anchor(),a=ke(Math.atan2(i.y-r.y,i.x-r.x));return new A([r.x,r.y-n/2],[r.distanceTo(i),n]).containsPoint(t.transformCopy(Ht().rotate(-a,r)))}_isOnPathTo(e,t,n,r){let i;return i=this.controlOut()&&e.controlIn()?this._isOnCurveTo(e,t,n/2,r):this._isOnLineTo(e,t,n),i}};function jn(e){let t=e.length,n=De,r=Oe;for(let i=0;i<t;i++)r=Math.max(r,e[i]),n=Math.min(n,e[i]);return{min:n,max:r}}let Mn=.333;function Nn(e,t){let n=e.slice(0),r=[],i=n.length;if(i>2&&(Pn(0,n),i=n.length),i<2||i===2&&n[0].equals(n[1]))return r;let a=n[0],o=n[1],s=n[2];for(r.push(new An(a));a.equals(n[i-1]);)t=!0,n.pop(),i--;if(i===2){let e=Bn(a,o,`x`,`y`);return ze(r).controlOut(Hn(e,a,o,`x`,`y`)),r.push(new An(o,Un(e,a,o,`x`,`y`))),r}let c,l;if(t){a=n[i-1],o=n[0],s=n[1];let e=Rn(a,o,s);c=e[1],l=e[0]}else c=Hn(Bn(a,o,`x`,`y`),a,o,`x`,`y`);let u=c;for(let e=0;e<=i-3;e++)if(Pn(e,n),i=n.length,e+3<=i){a=n[e],o=n[e+1],s=n[e+2];let t=Rn(a,o,s);ze(r).controlOut(u),u=t[1];let i=t[0];r.push(new An(o,i))}if(t){a=n[i-2],o=n[i-1],s=n[0];let e=Rn(a,o,s);ze(r).controlOut(u),r.push(new An(o,e[0])),ze(r).controlOut(e[1]),r.push(new An(s,l))}else{let e=Bn(o,s,`x`,`y`);ze(r).controlOut(u),r.push(new An(s,Un(e,o,s,`x`,`y`)))}return r}function Pn(e,t){for(;t[e+1]&&(t[e].equals(t[e+1])||t[e+1].equals(t[e+2]));)t.splice(e+1,1)}function Fn(e,t,n){let r=!1;if(e.x===t.x)r=!0;else if(t.x===n.x)(t.y<n.y&&e.y<=t.y||n.y<t.y&&t.y<=e.y)&&(r=!0);else{let i=Gn(Ln(e,t),n.x);!(e.y<=t.y&&n.y<=i)&&!(t.y<=e.y&&n.y>=i)&&(r=!0)}return r}function In(e,t,n){let r=Gn(Ln(e,t),n.x);return e.x===t.x&&t.x===n.x||O(r,1)===O(n.y,1)}function Ln(e,t){let n=(t.y-e.y)/(t.x-e.x);return[e.y-n*e.x,n]}function Rn(e,t,n){let r=`x`,i=`y`,a=!1,o=!1,s;if(In(e,t,n))s=Bn(e,t,`x`,`y`);else{let c={x:Vn(e,t,n,`x`),y:Vn(e,t,n,`y`)};if(c.x&&c.y)s=Bn(e,n,`x`,`y`),a=!0;else if(Fn(e,t,n)&&(r=`y`,i=`x`),c[r])s=0;else{let a;a=n[i]<e[i]&&e[i]<=t[i]||e[i]<n[i]&&t[i]<=e[i]?Kn((n[i]-e[i])*(t[r]-e[r])):-Kn((n[r]-e[r])*(t[i]-e[i])),s=.01*a,o=!0}}let c=Un(s,e,t,r,i);if(o){let e=r;r=i,i=e}let l=Hn(s,t,n,r,i);return a&&(zn(e,t,c,s),zn(t,n,l,s)),[c,l]}function zn(e,t,n,r){e.y<t.y?t.y<n.y?(n.x=e.x+(t.y-e.y)/r,n.y=t.y):n.y<e.y&&(n.x=t.x-(t.y-e.y)/r,n.y=e.y):n.y<t.y?(n.x=e.x-(e.y-t.y)/r,n.y=t.y):e.y<n.y&&(n.x=t.x+(e.y-t.y)/r,n.y=e.y)}function Bn(e,t,n,r){let i=t[n]-e[n],a=t[r]-e[r],o;return o=i===0?0:a/i,o}function Vn(e,t,n,r){return n[r]>t[r]&&t[r]>e[r]||n[r]<t[r]&&t[r]<e[r]}function Hn(e,t,n,r,i){let a=t[r],o=(n[r]-a)*Mn;return Wn(a+o,t[i]+o*e,r,i)}function Un(e,t,n,r,i){let a=t[r],o=n[r],s=(o-a)*Mn;return Wn(o-s,n[i]-s*e,r,i)}function Wn(e,t,n,r){let i=new k;return i[n]=e,i[r]=t,i}function Gn(e,t){let n=e.length,r=0;for(let i=0;i<n;i++)r+=t**+i*e[i];return r}function Kn(e){return e<=0?-1:1}let qn={l:function(e,t){let{parameters:n,position:r}=t;for(let i=0;i<n.length;i+=2){let a=new k(n[i],n[i+1]);t.isRelative&&a.translateWith(r),e.lineTo(a.x,a.y),r.x=a.x,r.y=a.y}},c:function(e,t){let{parameters:n,position:r}=t;for(let i=0;i<n.length;i+=6){let a=new k(n[i],n[i+1]),o=new k(n[i+2],n[i+3]),s=new k(n[i+4],n[i+5]);t.isRelative&&(o.translateWith(r),a.translateWith(r),s.translateWith(r)),e.curveTo(a,o,s),r.x=s.x,r.y=s.y}},v:function(e,t){let n=t.isRelative?0:t.position.x;Jn(t.parameters,!0,n),this.l(e,t)},h:function(e,t){let n=t.isRelative?0:t.position.y;Jn(t.parameters,!1,n),this.l(e,t)},a:function(e,t){let{parameters:n,position:r}=t;for(let i=0;i<n.length;i+=7){let a=n[i],o=n[i+1],s=n[i+2],c=n[i+3],l=n[i+4],u=new k(n[i+5],n[i+6]);t.isRelative&&u.translateWith(r),(r.x!==u.x||r.y!==u.y)&&(e.arcTo(u,a,o,c,l,s),r.x=u.x,r.y=u.y)}},s:function(e,t){let{parameters:n,position:r,previousCommand:i}=t,a;(i===`s`||i===`c`)&&(a=ze(ze(e.paths).segments).controlIn());for(let i=0;i<n.length;i+=4){let o=new k(n[i],n[i+1]),s=new k(n[i+2],n[i+3]),c;t.isRelative&&(o.translateWith(r),s.translateWith(r)),c=a?Yn(a,r):r.clone(),a=o,e.curveTo(c,o,s),r.x=s.x,r.y=s.y}},q:function(e,t){let{parameters:n,position:r}=t;for(let i=0;i<n.length;i+=4){let a=new k(n[i],n[i+1]),o=new k(n[i+2],n[i+3]);t.isRelative&&(a.translateWith(r),o.translateWith(r));let s=Zn(r,a,o);e.curveTo(s.controlOut,s.controlIn,o),r.x=o.x,r.y=o.y}},t:function(e,t){let{parameters:n,position:r,previousCommand:i}=t,a;(i===`q`||i===`t`)&&(a=ze(ze(e.paths).segments).controlIn().clone().translateWith(r.scaleCopy(-1/3)).scale(3/2));for(let i=0;i<n.length;i+=2){let o=new k(n[i],n[i+1]);t.isRelative&&o.translateWith(r),a=a?Yn(a,r):r.clone();let s=Zn(r,a,o);e.curveTo(s.controlOut,s.controlIn,o),r.x=o.x,r.y=o.y}}};function Jn(e,t,n){let r=+!t;for(let t=0;t<e.length;t+=2)e.splice(t+r,0,n)}function Yn(e,t){if(e&&t)return t.scaleCopy(2).translate(-e.x,-e.y)}let Xn=1/3;function Zn(e,t,n){let r=t.clone().scale(2/3);return{controlOut:r.clone().translateWith(e.scaleCopy(Xn)),controlIn:r.translateWith(n.scaleCopy(Xn))}}let Qn=/([a-df-z]{1})([^a-df-z]*)(z)?/gi,$n=/[,\s]?([+\-]?(?:\d*\.\d+|\d+)(?:[eE][+\-]?\d+)?)/g;function er(e){let t=[];return e.replace($n,function(e,n){t.push(parseFloat(n))}),t}function tr(e,t){let n=new k,r;return t.replace(Qn,(t,i,a,o)=>{let s=i.toLowerCase(),c=s===i,l=er(a.trim());if(s===`m`&&(c?(n.x+=l[0],n.y+=l[1]):(n.x=l[0],n.y=l[1]),e.moveTo(n.x,n.y),l.length>2&&(s=`l`,l.splice(0,2))),qn[s])qn[s](e,{parameters:l,position:n,isRelative:c,previousCommand:r}),o&&o.toLowerCase()===`z`&&e.close();else if(s!==`m`)throw Error(`Error while parsing SVG path. Unsupported command: `+s);r=s}),e}function nr(e,t,n){let r;for(let i=0;i<e.length;i++){let a=e[i];if(a.visible()){let e=t?a.bbox(n):a.rawBBox();e&&(r=r?A.union(r,e):e)}}return r}function rr(e,t){let n;for(let r=0;r<e.length;r++){let i=e[r];if(i.visible()){let e=i.clippedBBox(t);e&&(n=n?A.union(n,e):e)}}return n}let ir=e=>(...t)=>t.map(t=>t.toString(e)).join(` `),ar=(e,t)=>e.controlOut()&&t.controlIn()?`C`:`L`;var j=class e extends Yt(Zt(Gt)){get nodeType(){return`Path`}constructor(e){super(e),this.segments=new hn,this.segments.addObserver(this),this.options.stroke===void 0&&(this.stroke(`#000`),this.options.stroke.lineJoin===void 0&&this.options.set(`stroke.lineJoin`,`miter`))}moveTo(e,t){return this.suspend(),this.segments.elements([]),this.resume(),this.lineTo(e,t),this}lineTo(e,t){let n=new An(t===void 0?e:new k(e,t));return this.segments.push(n),this}curveTo(e,t,n){if(this.segments.length>0){let r=ze(this.segments),i=new An(n,t);this.suspend(),r.controlOut(e),this.resume(),this.segments.push(i)}return this}arc(e,t,n,r,i){if(this.segments.length>0){let a=ze(this.segments).anchor(),o=Ue(e),s=new cn(new k(a.x-n*Math.cos(o),a.y-r*Math.sin(o)),{startAngle:e,endAngle:t,radiusX:n,radiusY:r,anticlockwise:i});this._addArcSegments(s)}return this}arcTo(e,t,n,r,i,a){if(this.segments.length>0){let o=ze(this.segments).anchor(),s=cn.fromPoints(o,k.create(e),t,n,r,i,a);this._addArcSegments(s)}return this}_addArcSegments(e){this.suspend();let t=e.curvePoints();for(let e=1;e<t.length;e+=3)this.curveTo(t[e],t[e+1],t[e+2]);this.resume(),this.geometryChange()}close(){return this.options.closed=!0,this.geometryChange(),this}rawBBox(){return this._bbox()}toString(e){let t=``,n=this.segments,r=n.length;if(r>0){let i=[],a=ir(e),o;for(let e=1;e<r;e++){let t=ar(n[e-1],n[e]);t!==o&&(o=t,i.push(t)),t===`L`?i.push(a(n[e].anchor())):i.push(a(n[e-1].controlOut(),n[e].controlIn(),n[e].anchor()))}t=`M`+a(n[0].anchor())+` `+i.join(` `),this.options.closed&&(t+=`Z`)}return t}_containsPoint(e){let t=this.segments,n=t.length,r=0,i,a;for(let o=1;o<n;o++)i=t[o-1],a=t[o],r+=i._intersectionsTo(a,e);return(this.options.closed||!t[0].anchor().equals(t[n-1].anchor()))&&(r+=Tn(t[0].anchor(),t[n-1].anchor(),e)),r%2!=0}_isOnPath(e,t){let n=this.segments,r=n.length,i=t||this.options.stroke.width;if(r>1){if(n[0]._isOnPathTo(n[1],e,i,`start`))return!0;for(let t=2;t<=r-2;t++)if(n[t-1]._isOnPathTo(n[t],e,i))return!0;if(n[r-2]._isOnPathTo(n[r-1],e,i,`end`))return!0}return!1}_bbox(e){let t=this.segments,n=t.length,r;if(n===1)r=new A(t[0].anchor().transformCopy(e),Bt.ZERO);else if(n>0)for(let i=1;i<n;i++){let n=t[i-1].bboxTo(t[i],e);r=r?A.union(r,n):n}return r}static parse(e,t){return or.parse(e,t)}static fromRect(t,n){let r=new e(n),[i,a]=t.cornerRadius;if(i===0&&a===0)r.moveTo(t.topLeft()).lineTo(t.topRight()).lineTo(t.bottomRight()).lineTo(t.bottomLeft()).close();else{let{x:e,y:n}=t.origin,o=t.width(),s=t.height();i=Be(i,0,o/2),a=Be(a,0,s/2),r.moveTo(e+i,n).lineTo(e+o-i,n).arcTo([e+o,n+a],i,a,!1).lineTo(e+o,n+s-a).arcTo([e+o-i,n+s],i,a,!1).lineTo(e+i,n+s).arcTo([e,n+s-a],i,a,!1).lineTo(e,n+a).arcTo([e+i,n],i,a,!1)}return r}static fromPoints(t,n){if(t){let r=new e(n);for(let e=0;e<t.length;e++){let n=k.create(t[e]);n&&(e===0?r.moveTo(n):r.lineTo(n))}return r}}static curveFromPoints(t,n){if(t){let r=Nn(t),i=new e(n);return i.segments.push.apply(i.segments,r),i}}static fromArc(t,n){let r=new e(n),i=t.startAngle,a=t.pointAt(i);return r.moveTo(a.x,a.y),r.arc(i,t.endAngle,t.radiusX,t.radiusY,t.anticlockwise),r}},or=class e extends Yt(Zt(Gt)){static parse(t,n){return tr(new e(n),t)}toString(e){let t=this.paths,n=``;if(t.length>0){let r=[];for(let n=0;n<t.length;n++)r.push(t[n].toString(e));n=r.join(` `)}return n}get nodeType(){return`MultiPath`}constructor(e){super(e),this.paths=new hn,this.paths.addObserver(this),this.options.stroke===void 0&&this.stroke(`#000`)}moveTo(e,t){let n=new j;return n.moveTo(e,t),this.paths.push(n),this}lineTo(e,t){return this.paths.length>0&&ze(this.paths).lineTo(e,t),this}curveTo(e,t,n){return this.paths.length>0&&ze(this.paths).curveTo(e,t,n),this}arc(e,t,n,r,i){return this.paths.length>0&&ze(this.paths).arc(e,t,n,r,i),this}arcTo(e,t,n,r,i,a){return this.paths.length>0&&ze(this.paths).arcTo(e,t,n,r,i,a),this}close(){return this.paths.length>0&&ze(this.paths).close(),this}_bbox(e){return nr(this.paths,!0,e)}rawBBox(){return nr(this.paths,!1)}_containsPoint(e){let t=this.paths;for(let n=0;n<t.length;n++)if(t[n]._containsPoint(e))return!0;return!1}_isOnPath(e){let t=this.paths,n=this.options.stroke.width;for(let r=0;r<t.length;r++)if(t[r]._isOnPath(e,n))return!0;return!1}_clippedBBox(e){return rr(this.paths,this.currentTransform(e))}};en(Gt);var sr=class extends Yt(On(Gt,[`position`])){get nodeType(){return`Text`}constructor(e,t=new k,n={}){super(n),this.content(e),this.position(t),this.options.font||(this.options.font=`12px sans-serif`),this.options.fill===void 0&&this.fill(`#000`)}content(e){return e===void 0?this.options.get(`content`):(this.options.set(`content`,e),this)}measure(){return pt(this.content(),{font:this.options.get(`font`)})}rect(){let e=this.measure();return new A(this.position().clone(),[e.width,e.height])}bbox(e){let t=zt(this.currentTransform(e));return this.rect().bbox(t)}rawBBox(){return this.rect().bbox()}_containsPoint(e){return this.rect().containsPoint(e)}},cr=class extends en(Gt,[`rect`]){get nodeType(){return`Image`}constructor(e,t=new A,n={}){super(n),this.src(e),this.rect(t)}src(e){return e===void 0?this.options.get(`src`):(this.options.set(`src`,e),this)}bbox(e){let t=zt(this.currentTransform(e));return this._rect.bbox(t)}rawBBox(){return this._rect.bbox()}_containsPoint(e){return this._rect.containsPoint(e)}_hasFill(){return this.src()}};let lr=(e,t)=>class extends e{traverse(e){let n=this[t];for(let t=0;t<n.length;t++){let r=n[t];r.traverse?r.traverse(e):e(r)}return this}};var ur=class extends lr(Gt,`children`){get nodeType(){return`Group`}constructor(e){super(e),this.children=[]}childrenChange(e,t,n){this.trigger(`childrenChange`,{action:e,items:t,index:n})}append(){return ye(this.children,arguments),this._reparent(arguments,this),this.childrenChange(`add`,arguments),this}insert(e,t){return this.children.splice(e,0,t),t.parent=this,this.childrenChange(`add`,[t],e),this}insertAt(e,t){return this.insert(t,e)}remove(e){let t=this.children.indexOf(e);return t>=0&&(this.children.splice(t,1),e.parent=null,this.childrenChange(`remove`,[e],t)),this}removeAt(e){if(0<=e&&e<this.children.length){let t=this.children[e];this.children.splice(e,1),t.parent=null,this.childrenChange(`remove`,[t],e)}return this}clear(){let e=this.children;return this.children=[],this._reparent(e,null),this.childrenChange(`remove`,e,0),this}bbox(e){return nr(this.children,!0,this.currentTransform(e))}rawBBox(){return nr(this.children,!1)}_clippedBBox(e){return rr(this.children,this.currentTransform(e))}currentTransform(e){return Gt.prototype.currentTransform.call(this,e)||null}containsPoint(e,t){if(this.visible()){let n=this.children,r=this.currentTransform(t);for(let t=0;t<n.length;t++)if(n[t].containsPoint(e,r))return!0}return!1}_reparent(e,t){for(let n=0;n<e.length;n++){let r=e[n],i=r.parent;i&&i!==this&&i.remove&&i.remove(r),r.parent=t}}};function dr(e,t,n){let r=n.transform()||Ht(),i=r.matrix();i.e+=e.x-t.origin.x,i.f+=e.y-t.origin.y,r.matrix(i),n.transform(r)}function fr(e,t,n,r,i){let a;return a=n===`start`?t.origin[r]:n===`end`?t.origin[r]+t.size[i]-e:t.origin[r]+(t.size[i]-e)/2,a}function pr(e,t,n,r,i){let a;return a=n===`start`?t.origin[r]+t.size[i]-e:n===`end`?t.origin[r]:t.origin[r]+(t.size[i]-e)/2,a}let mr={alignContent:`start`,justifyContent:`start`,alignItems:`start`,spacing:0,orientation:`horizontal`,lineSpacing:0,wrap:!0,revers:!1},hr=(e,t)=>{e.forEach(t)},gr=(e,t)=>{let n=e.length;for(let r=n-1;r>=0;r--)t(e[r],r)};(class extends ur{constructor(e,t){super(Object.assign({},mr,t)),this._rect=e,this._fieldMap={}}rect(e){return e?(this._rect=e,this):this._rect}appendBreak(){let e=new ur;return e._isBreakMarker=!0,this.append(e),this}_initMap(){let e=this.options,t=this._fieldMap;e.orientation===`horizontal`?(t.sizeField=`width`,t.groupsSizeField=`height`,t.groupAxis=`x`,t.groupsAxis=`y`):(t.sizeField=`height`,t.groupsSizeField=`width`,t.groupAxis=`y`,t.groupsAxis=`x`),e.reverse?(this.forEach=gr,this.justifyAlign=pr):(this.forEach=hr,this.justifyAlign=fr)}reflow(){if(!this._rect||this.children.length===0)return;this._initMap(),this.options.transform&&this.transform(null);let e=this.options,t=this._rect,{groups:n,groupsSize:r}=this._initGroups(),{sizeField:i,groupsSizeField:a,groupAxis:o,groupsAxis:s}=this._fieldMap,c=new k,l=new k,u=new Bt,d=fr(r,t,e.alignContent,s,a),f,p,m,h=(t,n)=>{let r=p.elements[n];l[o]=f,l[s]=fr(t.size[a],m,e.alignItems,s,a),dr(l,t,r),f+=t.size[i]+e.spacing};for(let r=0;r<n.length;r++)p=n[r],c[o]=f=this.justifyAlign(p.size,t,e.justifyContent,o,i),c[s]=d,u[i]=p.size,u[a]=p.lineSize,m=new A(c,u),this.forEach(p.bboxes,h),d+=p.lineSize+e.lineSpacing;if(!e.wrap&&p.size>t.size[i]){let n=t.size[i]/m.size[i],r=m.topLeft().scale(n,n),c=fr(m.size[a]*n,t,e.alignContent,s,a),l=Ht();o===`x`?l.translate(t.origin.x-r.x,c-r.y):l.translate(c-r.x,t.origin.y-r.y),l.scale(n,n),this.transform(l)}}_initGroups(){let{options:e,children:t}=this,{lineSpacing:n,wrap:r,spacing:i}=e,a=this._fieldMap.sizeField,o=this._newGroup(),s=[],c=function(){s.push(o),l+=o.lineSize+n},l=-n;for(let e=0;e<t.length;e++){let n=t[e],s=t[e].clippedBBox();if(n._isBreakMarker){o.bboxes.length>0&&(c(),o=this._newGroup());continue}n.visible()&&s&&(r&&o.size+s.size[a]+i>this._rect.size[a]?o.bboxes.length===0?(this._addToGroup(o,s,n),c(),o=this._newGroup()):(c(),o=this._newGroup(),this._addToGroup(o,s,n)):this._addToGroup(o,s,n))}return o.bboxes.length&&c(),{groups:s,groupsSize:l}}_addToGroup(e,t,n){e.size+=t.size[this._fieldMap.sizeField]+this.options.spacing,e.lineSize=Math.max(t.size[this._fieldMap.groupsSizeField],e.lineSize),e.bboxes.push(t),e.elements.push(n)}_newGroup(){return{lineSize:0,size:-this.options.spacing,bboxes:[],elements:[]}}});var _r=class extends Yt(Zt(en(Gt))){get nodeType(){return`Rect`}constructor(e=new A,t={}){super(t),this.geometry(e),this.options.stroke===void 0&&this.stroke(`#000`)}_bbox(e){return this._geometry.bbox(e)}rawBBox(){return this._geometry.bbox()}_containsPoint(e){return this._geometry.containsPoint(e)}_isOnPath(e){return this.geometry()._isOnPath(e,this.options.stroke.width/2)}},vr=class extends mn{_change(){this.optionsChange({field:`stops`})}};function yr(e){return function(t){return t===void 0?this.options.get(e):(this.options.set(e,t),this)}}function br(e,t){for(let n=0;n<t.length;n++)e[t[n]]=yr(t[n])}let xr=(e,t)=>{let n=class extends e{};return br(n.prototype,t),n},Sr=[`offset`,`color`,`opacity`];var Cr=class e extends xr(fe,Sr){constructor(e,t,n){super(),this.options=new me({offset:e,color:t,opacity:n===void 0?1:n}),this.options.addObserver(this)}static create(t){if(t!==void 0){let n;return n=t instanceof e?t:t.length>1?new e(t[0],t[1],t[2]):new e(t.offset,t.color,t.opacity),n}}},wr=class extends fe{get nodeType(){return`Gradient`}constructor(e={}){super(),this.stops=new vr(this._createStops(e.stops)),this.stops.addObserver(this),this._userSpace=e.userSpace,this.id=Te()}userSpace(e){return e===void 0?this._userSpace:(this._userSpace=e,this.optionsChange(),this)}_createStops(e=[]){let t=[];for(let n=0;n<e.length;n++)t.push(Cr.create(e[n]));return t}addStop(e,t,n){this.stops.push(new Cr(e,t,n))}removeStop(e){let t=this.stops.indexOf(e);t>=0&&this.stops.splice(t,1)}optionsChange(e){this.trigger(`optionsChange`,{field:`gradient`+(e?`.`+e.field:``),value:this})}geometryChange(){this.optionsChange()}};let Tr=[`start`,`end`];var Er=class extends On(wr,Tr){constructor(e={}){super(e),this.start(e.start||new k),this.end(e.end||new k(1,0))}},Dr=class extends On(wr,[`center`]){constructor(e={}){super(e),this.center(e.center||new k),this._radius=e.radius===void 0?1:e.radius,this._fallbackFill=e.fallbackFill}radius(e){return e===void 0?this._radius:(this._radius=e,this.geometryChange(),this)}fallbackFill(e){return e===void 0?this._fallbackFill:(this._fallbackFill=e,this.optionsChange(),this)}},Or=class extends ur{get nodeType(){return`Pattern`}constructor(e){super();let{width:t,height:n}=e;this._size=Bt.create([t,n]),this.id=Te()}size(e){return e?(this._size=Bt.create(e),this):this._size}},kr=r({easeInOutBack:()=>Hr,easeInOutCubic:()=>Pr,easeInOutExpo:()=>Br,easeInOutQuad:()=>Ir,easeInOutQuint:()=>Wr,easeInOutSine:()=>Rr,easeOutBack:()=>Vr,easeOutCirc:()=>Lr,easeOutCubic:()=>Nr,easeOutElastic:()=>Mr,easeOutExpo:()=>zr,easeOutQuad:()=>Fr,easeOutQuint:()=>Ur,linear:()=>jr,swing:()=>Ar});function Ar(e){return .5-Math.cos(e*Math.PI)/2}function jr(e){return e}function Mr(e){return e===0||e===1?e:2**(-10*e)*Math.sin((e-.125)*(1.1*Math.PI)/.5)+1}function Nr(e){return 1-(1-e)**3}function Pr(e){return e<.5?4*e*e*e:1-(-2*e+2)**3/2}function Fr(e){return 1-(1-e)**2}function Ir(e){return e<.5?2*e*e:1-(-2*e+2)**2/2}function Lr(e){return Math.sqrt(1-(e-1)**2)}function Rr(e){return-(Math.cos(Math.PI*e)-1)/2}function zr(e){return e===1?1:1-2**(-10*e)}function Br(e){return e===0||e===1?e:e<.5?2**(20*e-10)/2:(2-2**(-20*e+10))/2}function Vr(e){return 1+2.70158*(e-1)**3+1.70158*(e-1)**2}function Hr(e){let t=1.70158*1.525;return e<.5?(2*e)**2*(3.5949095*2*e-t)/2:((2*e-2)**2*(3.5949095*(e*2-2)+t)+2)/2}function Ur(e){return 1-(1-e)**5}function Wr(e){return e<.5?16*e**5:1-(-2*e+2)**5/2}let Gr;var Kr=class e extends i{static get current(){return Gr||=new e,Gr}constructor(){super(),this._items=[]}register(e,t){this._items.push({name:e,type:t})}create(e,t){let n=this._items,r;if(t&&t.type){let e=t.type.toLowerCase();for(let t=0;t<n.length;t++)if(n[t].name.toLowerCase()===e){r=n[t];break}}if(r)return new r.type(e,t)}};function qr(e){return Math.min(1,Math.max(0,e))}function Jr(e,t,n,r){let i=3*e,a=3*(n-e)-i,o=1-i-a,s=3*t,c=3*(r-t)-s,l=1-s-c;function u(e){return((o*e+a)*e+i)*e}function d(e){return((l*e+c)*e+s)*e}function f(e){return(3*o*e+2*a)*e+i}function p(e){let t=e;for(let n=0;n<8;n++){let n=u(t)-e,r=f(t);if(Math.abs(n)<1e-7)return t;if(Math.abs(r)<1e-7)break;t-=n/r}let n=0,r=1;t=e;for(let t=0;t<24;t++){let t=(n+r)/2,i=u(t);if(Math.abs(i-e)<1e-7)return t;i<e?n=t:r=t}return(n+r)/2}return e=>{let t=qr(e);return t===0||t===1?t:d(p(t))}}let Yr={duration:500,easing:`swing`};(class extends i{static create(e,t,n){return Kr.current.create(e,t,n)}get options(){return this._options||Yr}set options(e){this._options=e}constructor(e,t){super(),this.options=Object.assign({},this.options,t),this.element=e}setup(){}step(){}play(){let e=this.options;typeof e.easing==`string`&&kr[e.easing]?e.easing=kr[e.easing]:Array.isArray(e.easing)&&e.easing.length===4?e.easing=Jr(...e.easing):e.easing=kr[Yr.easing];let{duration:t,delay:n=0,easing:r}=e,i=S()+n,a=i+t;t===0?(this.step(1),this.abort()):setTimeout(()=>{let e=()=>{if(this._stopped)return;let n=S(),o=Be(n-i,0,t),s=r(o/t);this.step(s),n<a?d(e):this.abort()};e()},n)}abort(){this._stopped=!0}destroy(){this.abort()}});let Xr;(class e extends i{static get current(){return Xr||=new e,Xr}parse(e,t){return tr(new or(t),e)}});var Zr=class extends i{constructor(e){super(),this.childNodes=[],this.parent=null,e&&(this.srcElement=e,this.observe())}destroy(){this.srcElement&&this.srcElement.removeObserver(this);let e=this.childNodes;for(let t=0;t<e.length;t++)this.childNodes[t].destroy();this.parent=null}load(){}observe(){this.srcElement&&this.srcElement.addObserver(this)}append(e){this.childNodes.push(e),e.parent=this}insertAt(e,t){this.childNodes.splice(t,0,e),e.parent=this}remove(e,t){let n=e+t;for(let t=e;t<n;t++)this.childNodes[t].removeSelf();this.childNodes.splice(e,t)}removeSelf(){this.clear(),this.destroy()}clear(){this.remove(0,this.childNodes.length)}invalidate(){this.parent&&this.parent.invalidate()}geometryChange(){this.invalidate()}optionsChange(){this.invalidate()}childrenChange(e){e.action===`add`?this.load(e.items,e.index):e.action===`remove`&&this.remove(e.index,e.items.length),this.invalidate()}};let Qr=[`click`,`mouseenter`,`mouseleave`,`mousemove`,`resize`];var $r=class extends a{constructor(e,t){super(),this.options=Object.assign({},t),this.element=e,this.element._kendoExportVisual=this.exportVisual.bind(this),this._click=this._handler(`click`),this._mouseenter=this._handler(`mouseenter`),this._mouseleave=this._handler(`mouseleave`),this._mousemove=this._handler(`mousemove`),this._visual=new ur,Xe(e,this.options),this.bind(Qr,this.options),this._enableTracking()}draw(e){this._visual.children.push(e)}clear(){this._visual.children=[]}destroy(){this._visual=null,this.element._kendoExportVisual=null,this.unbind()}eventTarget(e){let t=Le(e),n;for(;!n&&t&&(n=t._kendoNode,t!==this.element);)t=t.parentElement;if(n)return n.srcElement}exportVisual(){return this._visual}getSize(){return Xe(this.element)}currentSize(e){if(e)this._size=e;else return this._size}setSize(e){Xe(this.element,e),this.currentSize(e),this._resize()}resize(e){let t=this.getSize(),n=this.currentSize();(e||(t.width>0||t.height>0)&&(!n||t.width!==n.width||t.height!==n.height))&&(this.currentSize(t),this._resize(t,e),this.trigger(`resize`,t))}size(e){if(!e)return this.getSize();this.setSize(e)}suspendTracking(){this._suspendedTracking=!0}resumeTracking(){this._suspendedTracking=!1}_enableTracking(){}_resize(){}_handler(e){return t=>{let n=this.eventTarget(t);n&&!this._suspendedTracking&&this.trigger(e,{element:n,originalEvent:t,type:e})}}_elementOffset(){let e=this.element,t=Qe(e),{left:n,top:r}=qe(e);return{left:n+t.left,top:r+t.top}}_surfacePoint(e){let t=this._elementOffset(),n=Ie(e),r=n.x-t.left,i=n.y-t.top,a=rt(this.element).invert();return new k(r,i).transform(a)}};function ei(e,t){return t==null?``:` ${e}="${t}" `}function ti(e){let t=``;for(let n=0;n<e.length;n++)t+=ei(e[n][0],e[n][1]);return t}function ni(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n][1];r!==void 0&&(t+=e[n][0]+`:`+r+`;`)}if(t!==``)return t}let ri={},ii=`none`,ai=(e,t)=>{Lt(e,t)},oi=(e,t)=>{let n=new DOMParser().parseFromString(Pt(t),`text/xml`);Ft(n);let r=document.adoptNode(n.documentElement);e.insertBefore(r,e.firstChild)},si,ci=(e,t)=>{if(si)return si(e,t);if(si=ai,typeof document<`u`){let e=document.createElement(`div`),t=typeof DOMParser<`u`;e.innerHTML=`<svg xmlns='http://www.w3.org/2000/svg'></svg>`,t&&e.firstChild.namespaceURI!==`http://www.w3.org/2000/svg`&&(si=oi)}return si(e,t)},li=`transform`,ui={clip:`clip-path`,fill:`fill`};function di(e,t){return e===`clip`||e===`fill`&&(!t||t.nodeType===`Gradient`||t.nodeType===`Pattern`)}var fi=class extends Zr{constructor(e,t){super(e),this.definitions={},this.options=t}destroy(){this.element&&=(this.element._kendoNode=null,null),this.clearDefinitions(),super.destroy()}load(e,t){for(let n=0;n<e.length;n++){let r=e[n],i=r.children,a=new ri[r.nodeType](r,this.options);t===void 0?this.append(a):this.insertAt(a,t),a.createDefinitions(),i&&i.length>0&&a.load(i);let o=this.element;o&&a.attachTo(o,t)}}root(){let e=this;for(;e.parent;)e=e.parent;return e}attachTo(e,t){let n=document.createElement(`div`);ci(n,`<svg xmlns='http://www.w3.org/2000/svg' version='1.1'>`+this.render()+`</svg>`);let r=n.firstChild.firstChild;r&&(t===void 0?e.appendChild(r):e.insertBefore(r,e.childNodes[t]||null),this.setElement(r))}setElement(e){this.element&&(this.element._kendoNode=null),this.element=e,this.element._kendoNode=this;let t=this.childNodes;for(let n=0;n<t.length;n++){let r=e.childNodes[n];t[n].setElement(r)}}clear(){this.clearDefinitions(),this.element&&(this.element.innerHTML=``);let e=this.childNodes;for(let t=0;t<e.length;t++)e[t].destroy();this.childNodes=[]}removeSelf(){if(this.element){let e=this.element.parentNode;e&&e.removeChild(this.element),this.element=null}super.removeSelf()}template(){return this.renderChildren()}render(){return this.template()}renderChildren(){let e=this.childNodes,t=``;for(let n=0;n<e.length;n++)t+=e[n].render();return t}optionsChange(e){let{field:t,value:n}=e;t===`visible`?this.css(`display`,n?``:ii):ui[t]&&di(t,n)?this.updateDefinition(t,n):t===`opacity`?this.attr(`opacity`,n):t===`cursor`?this.css(`cursor`,n):t===`id`&&(n?this.attr(`id`,n):this.removeAttr(`id`)),super.optionsChange(e)}accessibilityOptionsChange(e){let{field:t,value:n}=e;t===`role`?n?this.attr(`role`,n):this.removeAttr(`role`):t===`ariaLabel`?n?this.attr(`aria-label`,_(n)):this.removeAttr(`aria-label`):t===`ariaRoleDescription`?n?this.attr(`aria-roledescription`,_(n)):this.removeAttr(`aria-roledescription`):t===`ariaChecked`?n===void 0?this.removeAttr(`aria-checked`):this.attr(`aria-checked`,n):t===`className`&&this.className(n)}attr(e,t){this.element&&this.element.setAttribute(e,t)}allAttr(e){for(let t=0;t<e.length;t++)this.attr(e[t][0],e[t][1])}toggleAttr(e,t){t?this.attr(e,t):this.removeAttr(e)}css(e,t){this.element&&(this.element.style[e]=t)}allCss(e){for(let t=0;t<e.length;t++)this.css(e[t][0],e[t][1])}className(e){this.element&&(this.element.classList.remove(...this.element.classList),e&&e.split(` `).forEach(e=>{e&&this.element.classList.add(e)}))}removeAttr(e){this.element&&this.element.removeAttribute(e)}mapTransform(e){let t=[];return e&&t.push([li,`matrix(`+e.matrix().toString(6)+`)`]),t}renderTransform(){return ti(this.mapTransform(this.srcElement.transform()))}transformChange(e){e?this.allAttr(this.mapTransform(e)):this.removeAttr(li)}mapStyle(){let e=this.srcElement.options,t=[[`cursor`,e.cursor]];return e.visible===!1&&t.push([`display`,ii]),t}renderStyle(){return ei(`style`,ni(this.mapStyle(!0)))}renderOpacity(){return ei(`opacity`,this.srcElement.options.opacity)}renderId(){return ei(`id`,this.srcElement.options.id)}renderClassName(){return ei(`class`,this.srcElement.options.className)}renderRole(){return ei(`role`,this.srcElement.options.role)}renderAriaLabel(){let e=this.srcElement.options.ariaLabel;return e&&=_(e),ei(`aria-label`,e)}renderAriaRoleDescription(){let e=this.srcElement.options.ariaRoleDescription;return e&&=_(e),ei(`aria-roledescription`,e)}renderAriaChecked(){return ei(`aria-checked`,this.srcElement.options.ariaChecked)}createDefinitions(){let e=this.srcElement,t=this.definitions;if(e){let n=e.options,r;for(let e in ui){let i=n.get(e);i&&di(e,i)&&(t[e]=i,r=!0)}r&&this.definitionChange({action:`add`,definitions:t})}}definitionChange(e){this.parent&&this.parent.definitionChange(e)}updateDefinition(e,t){let n=this.definitions,r=n[e],i=ui[e],a={};r&&(a[e]=r,this.definitionChange({action:`remove`,definitions:a}),delete n[e]),t?(a[e]=t,this.definitionChange({action:`add`,definitions:a}),n[e]=t,this.attr(i,this.refUrl(t.id))):r&&this.removeAttr(i)}clearDefinitions(){let e=this.definitions;this.definitionChange({action:`remove`,definitions:e}),this.definitions={}}renderDefinitions(){return ti(this.mapDefinitions())}mapDefinitions(){let e=this.definitions,t=[];for(let n in e){let r=e[n];t.push([ui[n],this.refUrl(r.id)])}return t}refUrl(e){return`url(#${e})`}},pi=class extends fi{template(){return`<stop ${this.renderOffset()} ${this.renderStyle()} />`}renderOffset(){return ei(`offset`,this.srcElement.offset())}mapStyle(){let e=this.srcElement;return[[`stop-color`,e.color()],[`stop-opacity`,e.opacity()]]}optionsChange(e){e.field===`offset`?this.attr(e.field,e.value):(e.field===`color`||e.field===`opacity`)&&this.css(`stop-`+e.field,e.value)}},mi=class extends fi{constructor(e){super(e),this.id=e.id,this.loadStops()}loadStops(){let e=this.srcElement.stops,t=this.element;for(let n=0;n<e.length;n++){let r=new pi(e[n]);this.append(r),t&&r.attachTo(t)}}optionsChange(e){e.field===`gradient.stops`?(Zr.prototype.clear.call(this),this.loadStops()):e.field===`gradient`&&this.allAttr(this.mapCoordinates())}renderCoordinates(){return ti(this.mapCoordinates())}mapSpace(){return[`gradientUnits`,this.srcElement.userSpace()?`userSpaceOnUse`:`objectBoundingBox`]}},hi=class extends mi{template(){return`<linearGradient id='${this.id}' ${this.renderCoordinates()}>${this.renderChildren()}</linearGradient>`}mapCoordinates(){let e=this.srcElement,t=e.start(),n=e.end();return[[`x1`,t.x],[`y1`,t.y],[`x2`,n.x],[`y2`,n.y],this.mapSpace()]}},gi=class extends mi{template(){return`<radialGradient id='${this.id}' ${this.renderCoordinates()}>${this.renderChildren()}</radialGradient>`}mapCoordinates(){let e=this.srcElement,t=e.center(),n=e.radius();return[[`cx`,t.x],[`cy`,t.y],[`r`,n],this.mapSpace()]}},_i=class extends fi{constructor(e){super(e),this.id=e.id,this.load(e.children)}template(){let e=this.srcElement.size().getWidth(),t=this.srcElement.size().getHeight();return`<pattern id='${this.srcElement.id}' width='${e}' height='${t}' patternUnits='userSpaceOnUse'>${this.renderChildren()}</pattern>`}},vi=class extends fi{constructor(e){super(),this.srcElement=e,this.id=e.id,this.load([e])}renderClipRule(){return ei(`clip-rule`,`evenodd`)}template(){return`<clipPath ${this.renderClipRule()} id='${this.id}'>${this.renderChildren()}</clipPath>`}},yi=class extends fi{constructor(){super(),this.definitionMap={}}attachTo(e){this.element=e}template(){return`<defs>${this.renderChildren()}</defs>`}definitionChange(e){let{definitions:t,action:n}=e;n===`add`?this.addDefinitions(t):n===`remove`&&this.removeDefinitions(t)}createDefinition(e,t){let n;return e===`clip`?n=vi:e===`fill`&&(t instanceof Er?n=hi:t instanceof Dr?n=gi:t.nodeType===`Pattern`&&(n=_i)),new n(t)}addDefinitions(e){for(let t in e)this.addDefinition(t,e[t])}addDefinition(e,t){let{element:n,definitionMap:r}=this,i=t.id,a=r[i];if(a)a.count++;else{let a=this.createDefinition(e,t);r[i]={element:a,count:1},this.append(a),n&&a.attachTo(this.element)}}removeDefinitions(e){for(let t in e)this.removeDefinition(e[t])}removeDefinition(e){let t=this.definitionMap,n=e.id,r=t[n];r&&(r.count--,r.count===0&&(this.remove(this.childNodes.indexOf(r.element),1),delete t[n]))}},bi=class extends fi{constructor(e){super(),this.options=e,this.defs=new yi}attachTo(e){this.element=e,this.defs.attachTo(e.firstElementChild)}clear(){Zr.prototype.clear.call(this)}template(){return this.defs.render()+this.renderChildren()}definitionChange(e){this.defs.definitionChange(e)}};let xi={"fill.opacity":`fill-opacity`,"stroke.color":`stroke`,"stroke.width":`stroke-width`,"stroke.opacity":`stroke-opacity`};var Si=class extends fi{geometryChange(){this.attr(`d`,this.renderData()),this.invalidate()}optionsChange(e){switch(e.field){case`fill`:e.value?this.allAttr(this.mapFill(e.value)):this.removeAttr(`fill`);break;case`fill.color`:this.allAttr(this.mapFill({color:e.value}));break;case`stroke`:e.value?this.allAttr(this.mapStroke(e.value)):this.removeAttr(`stroke`);break;case`transform`:this.transformChange(e.value);break;default:{let t=xi[e.field];t&&this.attr(t,e.value);break}}this.accessibilityOptionsChange(e),super.optionsChange(e)}content(){this.element&&(this.element.textContent=this.srcElement.content())}renderData(){return this.srcElement.toString(3)||void 0}mapStroke(e){let t=[];return e&&!Re(e.color)?(t.push([`stroke`,e.color]),t.push([`stroke-width`,e.width]),t.push([`stroke-linecap`,this.renderLinecap(e)]),t.push([`stroke-linejoin`,e.lineJoin]),e.opacity!==void 0&&t.push([`stroke-opacity`,e.opacity]),e.dashType!==void 0&&t.push([`stroke-dasharray`,this.renderDashType(e)])):t.push([`stroke`,ii]),t}renderStroke(){return ti(this.mapStroke(this.srcElement.options.stroke))}renderDashType(e){let{dashType:t,width:n=1}=e;if(t&&t!==`solid`){let e=Ut[t.toLowerCase()],r=[];for(let t=0;t<e.length;t++)r.push(e[t]*n);return r.join(` `)}}renderLinecap(e){let{dashType:t,lineCap:n}=e;return t&&t!==`solid`?Wt:n}mapFill(e){let t=[];return e&&(e.nodeType===`Gradient`||e.nodeType===`Pattern`)||(e&&!Re(e.color)?(t.push([`fill`,e.color]),e.opacity!==void 0&&t.push([`fill-opacity`,e.opacity])):t.push([`fill`,ii])),t}renderFill(){return ti(this.mapFill(this.srcElement.options.fill))}template(){return`<path ${this.renderId()} ${this.renderStyle()} ${this.renderOpacity()} ${ei(`d`,this.renderData())}${this.renderStroke()}${this.renderFill()}${this.renderDefinitions()}${this.renderTransform()}${this.renderClassName()} ${this.renderRole()}${this.renderAriaLabel()} ${this.renderAriaRoleDescription()}${this.renderAriaChecked()} ></path>`}},Ci=class extends Si{renderData(){return this.srcElement.toPath().toString(3)}},wi=class extends Si{geometryChange(){let e=this.center();this.attr(`cx`,e.x),this.attr(`cy`,e.y),this.attr(`r`,this.radius()),this.invalidate()}center(){return this.srcElement.geometry().center}radius(){return this.srcElement.geometry().radius}template(){return`<circle ${this.renderId()} ${this.renderStyle()} ${this.renderOpacity()}cx='${this.center().x}' cy='${this.center().y}' r='${this.radius()}'${this.renderStroke()} ${this.renderFill()} ${this.renderDefinitions()}${this.renderClassName()} ${this.renderRole()}${this.renderAriaLabel()} ${this.renderAriaRoleDescription()}${this.renderAriaChecked()} ${this.renderTransform()} ></circle>`}},Ti=class extends fi{template(){return`<g${this.renderId()+this.renderTransform()+this.renderClassName()+this.renderStyle()+this.renderOpacity()+this.renderRole()+this.renderAriaLabel()+this.renderAriaRoleDescription()+this.renderAriaChecked()+this.renderDefinitions()}>${this.renderChildren()}</g>`}optionsChange(e){let{field:t,value:n}=e;t===`transform`&&this.transformChange(n),this.accessibilityOptionsChange(e),super.optionsChange(e)}},Ei=class extends Si{geometryChange(){this.allAttr(this.mapPosition()),this.invalidate()}optionsChange(e){e.field===`src`&&this.allAttr(this.mapSource()),super.optionsChange(e)}mapPosition(){let e=this.srcElement.rect(),t=e.topLeft();return[[`x`,t.x],[`y`,t.y],[`width`,e.width()+`px`],[`height`,e.height()+`px`]]}renderPosition(){return ti(this.mapPosition())}mapSource(e){let t=this.srcElement.src();return e&&(t=_(t)),[[`xlink:href`,t]]}renderSource(){return ti(this.mapSource(!0))}template(){return`<image preserveAspectRatio='none' ${this.renderId()} ${this.renderStyle()} ${this.renderTransform()} ${this.renderOpacity()}${this.renderPosition()} ${this.renderSource()} ${this.renderDefinitions()}${this.renderClassName()} ${this.renderRole()}${this.renderAriaLabel()} ${this.renderAriaRoleDescription()}${this.renderAriaChecked()} ></image>`}},Di=class extends Si{renderData(){return this.srcElement.toString(3)||`undefined`}},Oi=class extends Si{geometryChange(){let e=this.srcElement.geometry();this.attr(`x`,e.origin.x),this.attr(`y`,e.origin.y),this.attr(`width`,e.size.width),this.attr(`height`,e.size.height),this.attr(`rx`,e.cornerRadius[0]),this.attr(`ry`,e.cornerRadius[1]),this.invalidate()}size(){return this.srcElement.geometry().size}origin(){return this.srcElement.geometry().origin}rx(){return this.srcElement.geometry().cornerRadius[0]}ry(){return this.srcElement.geometry().cornerRadius[1]}template(){return`<rect ${this.renderId()} ${this.renderStyle()} ${this.renderOpacity()} x='${this.origin().x}' y='${this.origin().y}' rx='${this.rx()}' ry='${this.ry()}' width='${this.size().width}' height='${this.size().height}' ${this.renderStroke()} ${this.renderFill()} ${this.renderDefinitions()} ${this.renderTransform()}${this.renderClassName()} ${this.renderRole()}${this.renderAriaLabel()} ${this.renderAriaRoleDescription()}${this.renderAriaChecked()} />`}};let ki=/&(?:[a-zA-Z]+|#\d+);/g;function Ai(e){if(!e||typeof e!=`string`||!ki.test(e))return e;let t=Ai._element;return ki.lastIndex=0,e.replace(ki,e=>(t.innerHTML=e,t.textContent||t.innerText))}typeof document<`u`&&(Ai._element=document.createElement(`span`));var ji=class extends Si{geometryChange(){let e=this.pos();this.attr(`x`,e.x),this.attr(`y`,e.y),this.invalidate()}optionsChange(e){e.field===`font`?(this.attr(`style`,ni(this.mapStyle())),this.geometryChange()):e.field===`content`&&super.content(this.srcElement.content()),super.optionsChange(e)}mapStyle(e){let t=super.mapStyle(e),n=this.srcElement.options.font;return e&&(n=_(n)),t.push([`font`,n],[`white-space`,`pre`]),t}pos(){let e=this.srcElement.position(),t=this.srcElement.measure();return e.clone().setY(e.y+t.baseline)}renderContent(){let e=this.srcElement.content();return e=Ai(e),e=_(e),ot(e)}renderTextAnchor(){let e;return(this.options||{}).rtl&&!(x.browser.msie||x.browser.edge)&&(e=`end`),ei(`text-anchor`,e)}renderPaintOrder(){let e=this.srcElement.options.paintOrder;return e?ei(`paint-order`,e):``}template(){return`<text ${this.renderId()} ${this.renderTextAnchor()} ${this.renderStyle()} ${this.renderOpacity()}x='${this.pos().x}' y='${this.pos().y}' ${this.renderStroke()} ${this.renderTransform()} ${this.renderDefinitions()}${this.renderPaintOrder()}${this.renderFill()}${this.renderClassName()} ${this.renderRole()}${this.renderAriaLabel()} ${this.renderAriaRoleDescription()}${this.renderAriaChecked()}>${this.renderContent()}</text>`}};ri.Arc=Ci,ri.Circle=wi,ri.Group=Ti,ri.Image=Ei,ri.MultiPath=Di,ri.Path=Si,ri.Rect=Oi,ri.Text=ji;function Mi(e){let t;try{t=e.getScreenCTM?e.getScreenCTM():null}catch{}if(t){let n=-t.e%1,r=-t.f%1,i=e.style;(n!==0||r!==0)&&(i.left=n+`px`,i.top=r+`px`)}}var Ni=class extends $r{get type(){return`svg`}constructor(e,t){super(e,t),this._root=new bi(Object.assign({rtl:Je(e,`direction`).direction===`rtl`},this.options)),ci(this.element,this._template(``)),this._rootElement=this.element.firstElementChild,this._rootElement.style.width=`100%`,this._rootElement.style.height=`100%`,this._rootElement.style.overflow=`hidden`,Mi(this._rootElement),this._root.attachTo(this._rootElement),Ke(this.element,{click:this._click,mouseover:this._mouseenter,mouseout:this._mouseleave,mousemove:this._mousemove}),this.resize()}destroy(){this._root&&(this._root.destroy(),this._root=null,this._rootElement&&this._rootElement.parentNode&&this._rootElement.parentNode.removeChild(this._rootElement),this._rootElement=null,Ze(this.element,{click:this._click,mouseover:this._mouseenter,mouseout:this._mouseleave,mousemove:this._mousemove})),super.destroy()}translate(e){let t=`${Math.round(e.x)} ${Math.round(e.y)} ${this._size.width} ${this._size.height}`;this._offset=e,this._rootElement.setAttribute(`viewBox`,t)}draw(e){super.draw(e),this._root.load([e])}clear(){super.clear(),this._root.clear()}svg(){return`<?xml version='1.0' ?>`+this._template()}exportVisual(){let{_visual:e,_offset:t}=this;if(t){let n=new ur;n.children.push(e),n.transform(Ht().translate(-t.x,-t.y)),e=n}return e}_resize(){this._offset&&this.translate(this._offset)}_template(e){return`<svg ${typeof e==`string`?e:`style='width: 100%; height: 100%; overflow: hidden;' `}xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>${this._root.render()}</svg>`}};let Pi={};var Fi=class extends Zr{constructor(e){super(e),e&&this.initClip()}initClip(){let e=this.srcElement.clip();e&&(this.clip=e,e.addObserver(this))}clear(){this.srcElement&&this.srcElement.removeObserver(this),this.clearClip(),super.clear()}clearClip(){this.clip&&(this.clip.removeObserver(this),delete this.clip)}setClip(e){this.clip&&(e.beginPath(),new Pi[this.clip.nodeType](this.clip).renderPoints(e,this.clip),e.clip(`evenodd`))}optionsChange(e){e.field===`clip`&&(this.clearClip(),this.initClip()),super.optionsChange(e)}setTransform(e){if(this.srcElement){let t=this.srcElement.transform();t&&e.transform.apply(e,t.matrix().toArray(6))}}loadElements(e,t,n){for(let r=0;r<e.length;r++){let i=e[r],a=i.children,o=new Pi[i.nodeType](i,n);a&&a.length>0&&o.load(a,t,n),t===void 0?this.append(o):this.insertAt(o,t)}}load(e,t,n){this.loadElements(e,t,n),this.invalidate()}setOpacity(e){if(this.srcElement){let t=this.srcElement.opacity();t!==void 0&&this.globalAlpha(e,t)}}globalAlpha(e,t){let n=t;n&&e.globalAlpha&&(n*=e.globalAlpha),e.globalAlpha=n}visible(){let e=this.srcElement;return!e||e&&e.options.visible!==!1}},Ii=class extends lr(Fi,`childNodes`){renderTo(e){if(!this.visible())return;e.save(),this.setTransform(e),this.setClip(e),this.setOpacity(e);let t=this.childNodes;for(let n=0;n<t.length;n++){let r=t[n];r.visible()&&r.renderTo(e)}e.restore()}},Li=class extends lr(Ii,`childNodes`){constructor(e,t){super(),this.canvas=e,this.size=t,this.ctx=e.getContext(`2d`);let n=this._invalidate.bind(this);this.invalidate=C(()=>{d(n)},16.666666666666668)}destroy(){super.destroy(),this.canvas=null,this.ctx=null}load(e,t,n){this.loadElements(e,t,n),this._invalidate()}_rescale(e){let{canvas:t,size:n}=this;t.width=n.width*e,t.height=n.height*e,this.ctx.scale(e,e)}_devicePixelRatio(){return typeof window.devicePixelRatio==`number`?window.devicePixelRatio:1}_invalidate(e){if(!this.ctx)return;let t=e&&e.fixedScale?1:this._devicePixelRatio();this._rescale(t),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.renderTo(this.ctx)}},Ri=class extends i{constructor(){super(),this.shapes=[]}_add(e,t){this.shapes.push({bbox:t,shape:e}),e._quadNode=this}pointShapes(e){let t=this.shapes,n=t.length,r=[];for(let i=0;i<n;i++)t[i].bbox.containsPoint(e)&&r.push(t[i].shape);return r}insert(e,t){this._add(e,t)}remove(e){let t=this.shapes,n=t.length;for(let r=0;r<n;r++)if(t[r].shape===e){t.splice(r,1);break}}},zi=class e extends Ri{constructor(e){super(),this.children=[],this.rect=e}inBounds(e){let t=this.rect,n=t.bottomRight(),r=e.bottomRight();return t.origin.x<=e.origin.x&&t.origin.y<=e.origin.y&&r.x<=n.x&&r.y<=n.y}pointShapes(e){let t=this.children,n=t.length,r=super.pointShapes(e);for(let i=0;i<n;i++)ye(r,t[i].pointShapes(e));return r}insert(e,t){let n=this.children,r=!1;if(this.inBounds(t)){if(this.shapes.length<4)this._add(e,t);else{n.length||this._initChildren();for(let i=0;i<n.length;i++)if(n[i].insert(e,t)){r=!0;break}r||this._add(e,t)}r=!0}return r}_initChildren(){let{rect:t,children:n}=this,r=t.center(),i=t.width()/2,a=t.height()/2;n.push(new e(new A([t.origin.x,t.origin.y],[i,a])),new e(new A([r.x,t.origin.y],[i,a])),new e(new A([t.origin.x,r.y],[i,a])),new e(new A([r.x,r.y],[i,a])))}};let Bi=3e3,Vi=BigInt(1e4);var Hi=class extends i{constructor(){super(),this.initRoots()}initRoots(){this.rootMap={},this.root=new Ri,this.rootElements=[]}clear(){let e=this.rootElements;for(let t=0;t<e.length;t++)this.remove(e[t]);this.initRoots()}pointShape(e){let t=(this.rootMap[Math.floor(e.x/Bi)]||{})[Math.floor(e.y/Bi)],n=this.root.pointShapes(e);t&&(n=n.concat(t.pointShapes(e)));let r=Ki(n);this.assignZindex(n,r),n.sort(Ui);for(let t=0;t<n.length;t++)if(n[t].containsPoint(e))return n[t]}assignZindex(e,t){let n=Gi(Vi,BigInt(t)),r=[],i=BigInt(0);for(let t=0;t<e.length;t++){let a=e[t],o=i,s=n,c=[];for(;a;)c.push(a),a=a.parent;for(;c.length;)a=c.pop(),o+=BigInt((a.parent?a.parent.children:this.rootElements).indexOf(a)+1)*s,s/=Vi;e[t]._zIndex=o,r.push(o)}r.sort(Wi);for(let t=0;t<e.length;t++)e[t]._zIndex=r.indexOf(e[t]._zIndex)}optionsChange(e){(e.field===`transform`||e.field===`stroke.width`)&&this.bboxChange(e.element)}geometryChange(e){this.bboxChange(e.element)}bboxChange(e){if(e.nodeType===`Group`)for(let t=0;t<e.children.length;t++)this.bboxChange(e.children[t]);else e._quadNode&&e._quadNode.remove(e),this._insertShape(e)}add(e){let t=Array.isArray(e)?e.slice(0):[e];ye(this.rootElements,t),this._insert(t)}childrenChange(e){if(e.action===`remove`)for(let t=0;t<e.items.length;t++)this.remove(e.items[t]);else this._insert(Array.prototype.slice.call(e.items,0))}_insert(e){let t;for(;e.length>0;)t=e.pop(),t.addObserver(this),t.nodeType===`Group`?ye(e,t.children):this._insertShape(t)}_insertShape(e){let t=e.bbox();if(t){let n=this.getSectors(t),r=n[0][0],i=n[1][0];if(this.inRoot(n))this.root.insert(e,t);else{let n=this.rootMap;n[r]||(n[r]={}),n[r][i]||(n[r][i]=new zi(new A([r*Bi,i*Bi],[Bi,Bi]))),n[r][i].insert(e,t)}}}remove(e){if(e.removeObserver(this),e.nodeType===`Group`){let t=e.children;for(let e=0;e<t.length;e++)this.remove(t[e])}else e._quadNode&&(e._quadNode.remove(e),delete e._quadNode)}inRoot(e){return e[0].length>1||e[1].length>1}getSectors(e){let t=e.bottomRight(),n=Math.floor(t.x/Bi),r=Math.floor(t.y/Bi),i=[[],[]];for(let t=Math.floor(e.origin.x/Bi);t<=n;t++)i[0].push(t);for(let t=Math.floor(e.origin.y/Bi);t<=r;t++)i[1].push(t);return i}};function Ui(e,t){return e._zIndex<t._zIndex?1:e._zIndex>t._zIndex?-1:0}function Wi(e,t){return e<t?-1:+(e>t)}function Gi(e,t){let n=e,r=t,i=BigInt(1),a=i;for(;r;)r&i&&(a*=n),r>>=i,r&&(n*=n);return a}function Ki(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n],i=[];for(;r;)i.push(r),r=r.parent;t=Math.max(t,i.length)}return t+1}var qi=class{constructor(e){e.bind(`mouseenter`,this._mouseenter.bind(this)),e.bind(`mouseleave`,this._mouseleave.bind(this)),this.element=e.element}clear(){this._resetCursor()}destroy(){this._resetCursor(),delete this.element}_mouseenter(e){let t=this._shapeCursor(e);t?(this._current||(this._defaultCursor=this._getCursor()),this._setCursor(t)):this._resetCursor()}_mouseleave(){this._resetCursor()}_shapeCursor(e){let t=e.element;for(;t&&t.options.cursor===void 0;)t=t.parent;if(t)return t.options.cursor}_getCursor(){if(this.element)return this.element.style.cursor}_setCursor(e){this.element&&(this.element.style.cursor=e,this._current=e)}_resetCursor(){this._current&&(this._setCursor(this._defaultCursor||``),delete this._current)}};function Ji(e,t){let n=t.segments;if(n.length===0)return;let r=n[0],i=r.anchor();e.moveTo(i.x,i.y);for(let t=1;t<n.length;t++){r=n[t],i=r.anchor();let a=n[t-1].controlOut(),o=r.controlIn();a&&o?e.bezierCurveTo(a.x,a.y,o.x,o.y,i.x,i.y):e.lineTo(i.x,i.y)}t.options.closed&&e.closePath()}function Yi(e,t){for(let n=0;n<t.length;n++){let r=t[n],i=se(r.color());i.a*=r.opacity(),e.addColorStop(r.offset(),i.toCssRgba())}}var Xi=class extends Fi{renderTo(e){e.save(),this.setTransform(e),this.setClip(e),this.setOpacity(e),e.beginPath(),this.renderPoints(e,this.srcElement),this.setLineDash(e),this.setLineCap(e),this.setLineJoin(e),this.setFill(e),this.setStroke(e),e.restore()}setFill(e){let t=this.srcElement.options.fill,n=!1;return t&&(t.nodeType===`Gradient`?(this.setGradientFill(e,t),n=!0):t.nodeType===`Pattern`?(this.setPatternFill(e,t),n=!0):Re(t.color)||(e.fillStyle=t.color,e.save(),this.globalAlpha(e,t.opacity),e.fill(),e.restore(),n=!0)),n}setGradientFill(e,t){let n=this.srcElement.rawBBox(),r;if(t instanceof Er){let n=t.start(),i=t.end();r=e.createLinearGradient(n.x,n.y,i.x,i.y)}else if(t instanceof Dr){let n=t.center();r=e.createRadialGradient(n.x,n.y,0,n.x,n.y,t.radius())}Yi(r,t.stops),e.save(),t.userSpace()||e.transform(n.width(),0,0,n.height(),n.origin.x,n.origin.y),e.fillStyle=r,e.fill(),e.restore()}setPatternFill(e,t){let n=t.size(),r=document.createElement(`canvas`),i=r.getContext(`2d`);r.width=n.getWidth(),r.height=n.getHeight(),this.childNodes.length=0,this.loadElements(t.children);let a=this.childNodes;for(let e=0;e<a.length;e++)a[e].renderTo(i);e.save(),e.fillStyle=e.createPattern(r,`repeat`),e.fill(),e.restore()}setStroke(e){let t=this.srcElement.options.stroke;if(t&&!Re(t.color)&&t.width>0)return e.strokeStyle=t.color,e.lineWidth=Ge(t.width,1),e.lineJoin=Ge(t.lineJoin,e.lineJoin),e.save(),this.globalAlpha(e,t.opacity),e.stroke(),e.restore(),!0}dashType(){let e=this.srcElement.options.stroke;if(e&&e.dashType)return e.dashType.toLowerCase()}setLineDash(e){let t=this.dashType();if(t&&t!==`solid`){let n=Ut[t];e.setLineDash?e.setLineDash(n):(e.mozDash=n,e.webkitLineDash=n)}}setLineCap(e){let t=this.dashType(),n=this.srcElement.options.stroke;t&&t!==`solid`?e.lineCap=Wt:n&&n.lineCap&&(e.lineCap=n.lineCap)}setLineJoin(e){let t=this.srcElement.options.stroke;t&&t.lineJoin&&(e.lineJoin=t.lineJoin)}renderPoints(e,t){Ji(e,t)}},Zi=class extends Xi{renderPoints(e){Ji(e,this.srcElement.toPath())}},Qi=class extends Xi{renderPoints(e){let{center:t,radius:n}=this.srcElement.geometry();e.arc(t.x,t.y,n,0,Math.PI*2)}},$i=class extends Xi{constructor(e,t){super(e),this.onLoad=this.onLoad.bind(this),this.onError=this.onError.bind(this),this.loading=Se();let n=this.img=new Image,r=e.src();t&&!/^data:/i.test(r)&&(n.crossOrigin=t),r&&(n.src=r),n.complete?this.onLoad():(n.onload=this.onLoad,n.onerror=this.onError)}renderTo(e){this.loading.state()===`resolved`&&(e.save(),this.setTransform(e),this.setClip(e),this.drawImage(e),e.restore())}optionsChange(e){e.field===`src`?(this.loading=Se(),this.img.src=this.srcElement.src()):super.optionsChange(e)}onLoad(){this.loading.resolve(),this.invalidate()}onError(){this.loading.reject(Error(`Unable to load image '`+this.img.src+`'. Check for connectivity and verify CORS headers.`))}drawImage(e){let t=this.srcElement.rect(),n=t.topLeft();e.drawImage(this.img,n.x,n.y,t.width(),t.height())}},ea=class extends Xi{renderPoints(e){let t=this.srcElement.paths;for(let n=0;n<t.length;n++)Ji(e,t[n])}},ta=class extends Xi{renderPoints(e){let t=this.srcElement.geometry(),[n,r]=t.cornerRadius;if(n===0&&r===0){let{origin:n,size:r}=t;e.rect(n.x,n.y,r.width,r.height)}else super.renderPoints(e,j.fromRect(t))}},na=class extends Xi{renderTo(e){let t=this.srcElement,n=t.position(),r=t.measure();e.save(),this.setTransform(e),this.setClip(e),this.setOpacity(e),e.beginPath(),e.font=t.options.font,e.textAlign=`left`,t.options.paintOrder===`stroke`?(this.stroke(e,t,n,r),this.fill(e,t,n,r)):(this.fill(e,t,n,r),this.stroke(e,t,n,r)),e.restore()}stroke(e,t,n,r){this.setStroke(e)&&(this.setLineDash(e),e.strokeText(t.content(),n.x,n.y+r.baseline))}fill(e,t,n,r){this.setFill(e)&&e.fillText(t.content(),n.x,n.y+r.baseline)}};Pi.Arc=Zi,Pi.Circle=Qi,Pi.Group=Ii,Pi.Image=$i,Pi.MultiPath=ea,Pi.Path=Xi,Pi.Rect=ta,Pi.Text=na;var ra=class extends $r{get type(){return`canvas`}constructor(e,t){super(e,t),Lt(this.element,this._template(this));let n=this.element.firstElementChild;n.style.width=`100%`,n.style.height=`100%`;let r=Xe(e);n.width=r.width,n.height=r.height,this._rootElement=n,this._root=new Li(n,r),this._mouseTrackHandler=this._trackMouse.bind(this),Ke(this.element,{click:this._mouseTrackHandler,mousemove:this._mouseTrackHandler})}destroy(){super.destroy(),this._root&&=(this._root.destroy(),null),this._searchTree&&(this._searchTree.clear(),delete this._searchTree),this._cursor&&(this._cursor.destroy(),delete this._cursor),Ze(this.element,{click:this._mouseTrackHandler,mousemove:this._mouseTrackHandler}),this._rootElement&&this._rootElement.parentNode&&this._rootElement.parentNode.removeChild(this._rootElement),this._rootElement=null}draw(e){super.draw(e),this._root.load([e],void 0,this.options.cors),this._searchTree&&this._searchTree.add([e])}clear(){super.clear(),this._root.clear(),this._searchTree&&this._searchTree.clear(),this._cursor&&this._cursor.clear()}eventTarget(e){if(this._searchTree){let t=this._surfacePoint(e);return this._searchTree.pointShape(t)}}image(){let{_root:e,_rootElement:t}=this,n=[];e.traverse(e=>{e.loading&&n.push(e.loading)});let r=Se(),i=()=>{e._invalidate({fixedScale:!0});try{let e=t.toDataURL();r.resolve(e)}catch(e){r.reject(e)}};return He(n).then(i,i),r}suspendTracking(){super.suspendTracking(),this._searchTree&&(this._searchTree.clear(),delete this._searchTree)}resumeTracking(){if(super.resumeTracking(),!this._searchTree){this._searchTree=new Hi;let e=this._root.childNodes,t=[];for(let n=0;n<e.length;n++)t.push(e[n].srcElement);this._searchTree.add(t)}}_resize(){this._rootElement.width=this._size.width,this._rootElement.height=this._size.height,this._root.size=this._size,this._root.invalidate()}_template(){return`<canvas></canvas>`}_enableTracking(){this._searchTree=new Hi,this._cursor=new qi(this),super._enableTracking()}_trackMouse(e){if(this._suspendedTracking)return;let t=this.eventTarget(e);if(e.type!==`click`){let n=this._currentShape;n&&n!==t&&this.trigger(`mouseleave`,{element:n,originalEvent:e,type:`mouseleave`}),t&&n!==t&&this.trigger(`mouseenter`,{element:t,originalEvent:e,type:`mouseenter`}),this.trigger(`mousemove`,{element:t,originalEvent:e,type:`mousemove`}),this._currentShape=t}else t&&this.trigger(`click`,{element:t,originalEvent:e,type:`click`})}};let ia,aa,oa=()=>typeof document<`u`,sa=()=>oa()&&document.createElement(`canvas`).getContext,ca=()=>oa()&&document.implementation.hasFeature(`http://www.w3.org/TR/SVG11/feature#BasicStructure`,`1.1`);var la=class e extends i{static get support(){return aa||={canvas:sa(),svg:ca()},aa}static get current(){return ia||=new e,ia}constructor(){super(),this._items=[{name:`svg`,type:Ni},{name:`canvas`,type:ra}]}create(e,t){let n=this._items,r=n[0];if(t&&t.type){let e=t.type.toLowerCase();for(let t=0;t<n.length;t++)if(n[t].name===e){r=n[t];break}}if(r)return new r.type(e,t);v(`Warning: Unable to create Kendo UI Drawing Surface. Possible causes:
- The browser does not support SVG and Canvas. User agent: ${navigator.userAgent}`)}};(class extends $r{static get support(){return la.support}static create(e,t){return la.current.create(e,t)}});let ua=typeof Uint8Array<`u`&&x.browser&&(!x.browser.msie||x.browser.version>9),da=function(){var e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`;return{decode:function(t){for(var n=t.replace(/[^A-Za-z0-9\+\/\=]/g,``),r=0,i=n.length,a=[];r<i;){var o=e.indexOf(n.charAt(r++)),s=e.indexOf(n.charAt(r++)),c=e.indexOf(n.charAt(r++)),l=e.indexOf(n.charAt(r++)),u=o<<2|s>>>4,d=(s&15)<<4|c>>>2,f=(c&3)<<6|l;a.push(u),c!=64&&a.push(d),l!=64&&a.push(f)}return a},encode:function(t){for(var n=0,r=t.length,i=``;n<r;){var a=t[n++],o=t[n++],s=t[n++],c=a>>>2,l=(a&3)<<4|o>>>4,u=(o&15)<<2|s>>>6,d=s&63;n-r==2?u=d=64:n-r==1&&(d=64),i+=e.charAt(c)+e.charAt(l)+e.charAt(u)+e.charAt(d)}return i}}}();function fa(e){var t=0,n=0;e==null?e=ua?new Uint8Array(256):[]:n=e.length;var r=ua?function(t){if(t>=e.length){var n=new Uint8Array(Math.max(t+256,e.length*2));n.set(e,0),e=n}}:function(){},i=ua?function(){return new Uint8Array(e.buffer,0,n)}:function(){return e},a=ua?function(i){if(typeof i==`string`)return w(i);var a=i.length;r(t+a),e.set(i,t),t+=a,t>n&&(n=t)}:function(e){if(typeof e==`string`)return w(e);for(var t=0;t<e.length;++t)l(e[t])},o=ua?function(t,n){if(e.buffer.slice)return new Uint8Array(e.buffer.slice(t,t+n));var r=new Uint8Array(n);return r.set(new Uint8Array(e.buffer,t,n)),r}:function(t,n){return e.slice(t,t+n)};function s(){return t>=n}function c(){return t<n?e[t++]:0}function l(i){r(t),e[t++]=i&255,t>n&&(n=t)}function u(){return c()<<8|c()}function d(e){l(e>>8),l(e)}function f(){var e=u();return e>=32768?e-65536:e}function p(e){d(e<0?e+65536:e)}function m(){return u()*65536+u()}function h(e){d(e>>>16&65535),d(e&65535)}function g(){var e=m();return e>=2147483648?e-4294967296:e}function _(e){h(e<0?e+4294967296:e)}function v(){return m()/65536}function y(e){h(Math.round(e*65536))}function b(){return g()/65536}function x(e){_(Math.round(e*65536))}function S(e){return T(e,c)}function C(e){return String.fromCharCode.apply(String,S(e))}function w(e){for(var t=0;t<e.length;++t)l(e.charCodeAt(t))}function T(e,t){for(var n=Array(e),r=0;r<e;++r)n[r]=t();return n}var E={eof:s,readByte:c,writeByte:l,readShort:u,writeShort:d,readLong:m,writeLong:h,readFixed:v,writeFixed:y,readShort_:f,writeShort_:p,readLong_:g,writeLong_:_,readFixed_:b,writeFixed_:x,read:S,write:a,readString:C,writeString:w,times:T,get:i,slice:o,offset:function(e){return e==null?t:(t=e,E)},skip:function(e){t+=e},toString:function(){throw Error(`FIX CALLER.  BinaryStream is no longer convertible to string!`)},length:function(){return n},saveExcursion:function(e){var n=t;try{return e()}finally{t=n}},writeBase64:function(e){window.atob?w(window.atob(e)):a(da.decode(e))},base64:function(){return da.encode(i())}};return E}function pa(e){return e.map(function(e){var t=``;return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t}).join(``)}var ma=class{constructor(e,t){this.definition=t,this.length=t.length,this.offset=t.offset,this.file=e,this.rawData=e.raw,this.parse(e.raw)}raw(){return this.rawData.slice(this.offset,this.length)}parse(){}};(class extends ma{parse(e){e.offset(this.offset),this.version=e.readLong(),this.revision=e.readLong(),this.checkSumAdjustment=e.readLong(),this.magicNumber=e.readLong(),this.flags=e.readShort(),this.unitsPerEm=e.readShort(),this.created=e.read(8),this.modified=e.read(8),this.xMin=e.readShort_(),this.yMin=e.readShort_(),this.xMax=e.readShort_(),this.yMax=e.readShort_(),this.macStyle=e.readShort(),this.lowestRecPPEM=e.readShort(),this.fontDirectionHint=e.readShort_(),this.indexToLocFormat=e.readShort_(),this.glyphDataFormat=e.readShort_()}render(e){var t=fa();return t.writeLong(this.version),t.writeLong(this.revision),t.writeLong(0),t.writeLong(this.magicNumber),t.writeShort(this.flags),t.writeShort(this.unitsPerEm),t.write(this.created),t.write(this.modified),t.writeShort_(this.xMin),t.writeShort_(this.yMin),t.writeShort_(this.xMax),t.writeShort_(this.yMax),t.writeShort(this.macStyle),t.writeShort(this.lowestRecPPEM),t.writeShort_(this.fontDirectionHint),t.writeShort_(e),t.writeShort_(this.glyphDataFormat),t.get()}}),class extends ma{parse(e){e.offset(this.offset),this.file.head.indexToLocFormat===0?this.offsets=e.times(this.length/2,function(){return 2*e.readShort()}):this.offsets=e.times(this.length/4,e.readLong)}offsetOf(e){return this.offsets[e]}lengthOf(e){return this.offsets[e+1]-this.offsets[e]}render(e){for(var t=fa(),n=e[e.length-1]>65535,r=0;r<e.length;++r)n?t.writeLong(e[r]):t.writeShort(e[r]/2);return{format:+!!n,table:t.get()}}},class extends ma{parse(e){e.offset(this.offset),this.version=e.readLong(),this.ascent=e.readShort_(),this.descent=e.readShort_(),this.lineGap=e.readShort_(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort_(),this.minRightSideBearing=e.readShort_(),this.xMaxExtent=e.readShort_(),this.caretSlopeRise=e.readShort_(),this.caretSlopeRun=e.readShort_(),this.caretOffset=e.readShort_(),e.skip(8),this.metricDataFormat=e.readShort_(),this.numOfLongHorMetrics=e.readShort()}render(e){var t=fa();return t.writeLong(this.version),t.writeShort_(this.ascent),t.writeShort_(this.descent),t.writeShort_(this.lineGap),t.writeShort(this.advanceWidthMax),t.writeShort_(this.minLeftSideBearing),t.writeShort_(this.minRightSideBearing),t.writeShort_(this.xMaxExtent),t.writeShort_(this.caretSlopeRise),t.writeShort_(this.caretSlopeRun),t.writeShort_(this.caretOffset),t.write([0,0,0,0,0,0,0,0]),t.writeShort_(this.metricDataFormat),t.writeShort(e.length),t.get()}},class extends ma{parse(e){e.offset(this.offset),this.version=e.readLong(),this.numGlyphs=e.readShort(),this.maxPoints=e.readShort(),this.maxContours=e.readShort(),this.maxComponentPoints=e.readShort(),this.maxComponentContours=e.readShort(),this.maxZones=e.readShort(),this.maxTwilightPoints=e.readShort(),this.maxStorage=e.readShort(),this.maxFunctionDefs=e.readShort(),this.maxInstructionDefs=e.readShort(),this.maxStackElements=e.readShort(),this.maxSizeOfInstructions=e.readShort(),this.maxComponentElements=e.readShort(),this.maxComponentDepth=e.readShort()}render(e){var t=fa();return t.writeLong(this.version),t.writeShort(e.length),t.writeShort(this.maxPoints),t.writeShort(this.maxContours),t.writeShort(this.maxComponentPoints),t.writeShort(this.maxComponentContours),t.writeShort(this.maxZones),t.writeShort(this.maxTwilightPoints),t.writeShort(this.maxStorage),t.writeShort(this.maxFunctionDefs),t.writeShort(this.maxInstructionDefs),t.writeShort(this.maxStackElements),t.writeShort(this.maxSizeOfInstructions),t.writeShort(this.maxComponentElements),t.writeShort(this.maxComponentDepth),t.get()}},class extends ma{parse(e){e.offset(this.offset);var t=this.file,n=t.hhea;this.metrics=e.times(n.numOfLongHorMetrics,function(){return{advance:e.readShort(),lsb:e.readShort_()}});var r=t.maxp.numGlyphs-t.hhea.numOfLongHorMetrics;this.leftSideBearings=e.times(r,e.readShort_)}forGlyph(e){var t=this.metrics,n=t.length;return e<n?t[e]:{advance:t[n-1].advance,lsb:this.leftSideBearings[e-n]}}render(e){for(var t=fa(),n=0;n<e.length;++n){var r=this.forGlyph(e[n]);t.writeShort(r.advance),t.writeShort_(r.lsb)}return t.get()}},(function(){var e=`.notdef .null nonmarkingreturn space exclam quotedbl numbersign dollar percent ampersand quotesingle parenleft parenright asterisk plus comma hyphen period slash zero one two three four five six seven eight nine colon semicolon less equal greater question at A B C D E F G H I J K L M N O P Q R S T U V W X Y Z bracketleft backslash bracketright asciicircum underscore grave a b c d e f g h i j k l m n o p q r s t u v w x y z braceleft bar braceright asciitilde Adieresis Aring Ccedilla Eacute Ntilde Odieresis Udieresis aacute agrave acircumflex adieresis atilde aring ccedilla eacute egrave ecircumflex edieresis iacute igrave icircumflex idieresis ntilde oacute ograve ocircumflex odieresis otilde uacute ugrave ucircumflex udieresis dagger degree cent sterling section bullet paragraph germandbls registered copyright trademark acute dieresis notequal AE Oslash infinity plusminus lessequal greaterequal yen mu partialdiff summation product pi integral ordfeminine ordmasculine Omega ae oslash questiondown exclamdown logicalnot radical florin approxequal Delta guillemotleft guillemotright ellipsis nonbreakingspace Agrave Atilde Otilde OE oe endash emdash quotedblleft quotedblright quoteleft quoteright divide lozenge ydieresis Ydieresis fraction currency guilsinglleft guilsinglright fi fl daggerdbl periodcentered quotesinglbase quotedblbase perthousand Acircumflex Ecircumflex Aacute Edieresis Egrave Iacute Icircumflex Idieresis Igrave Oacute Ocircumflex apple Ograve Uacute Ucircumflex Ugrave dotlessi circumflex tilde macron breve dotaccent ring cedilla hungarumlaut ogonek caron Lslash lslash Scaron scaron Zcaron zcaron brokenbar Eth eth Yacute yacute Thorn thorn minus multiply onesuperior twosuperior threesuperior onehalf onequarter threequarters franc Gbreve gbreve Idotaccent Scedilla scedilla Cacute cacute Ccaron ccaron dcroat`.split(/\s+/g);return class extends ma{parse(e){e.offset(this.offset),this.format=e.readLong(),this.italicAngle=e.readFixed_(),this.underlinePosition=e.readShort_(),this.underlineThickness=e.readShort_(),this.isFixedPitch=e.readLong(),this.minMemType42=e.readLong(),this.maxMemType42=e.readLong(),this.minMemType1=e.readLong(),this.maxMemType1=e.readLong();var t;switch(this.format){case 65536:case 196608:break;case 131072:t=e.readShort(),this.glyphNameIndex=e.times(t,e.readShort),this.names=[];for(var n=this.offset+this.length;e.offset()<n;)this.names.push(e.readString(e.readByte()));break;case 151552:t=e.readShort(),this.offsets=e.read(t);break;case 262144:this.map=e.times(this.file.maxp.numGlyphs,e.readShort);break}}glyphFor(t){switch(this.format){case 65536:return e[t]||`.notdef`;case 131072:var n=this.glyphNameIndex[t];return n<e.length?e[n]:this.names[n-e.length]||`.notdef`;case 151552:case 196608:return`.notdef`;case 262144:return this.map[t]||65535}}render(t){if(this.format==196608)return this.raw();var n=fa(this.rawData.slice(this.offset,32));n.writeLong(131072),n.offset(32);for(var r=[],i=[],a=0;a<t.length;++a){var o=t[a],s=this.glyphFor(o),c=e.indexOf(s);c>=0?r.push(c):(r.push(e.length+i.length),i.push(s))}for(n.writeShort(t.length),a=0;a<r.length;++a)n.writeShort(r[a]);for(a=0;a<i.length;++a)n.writeByte(i[a].length),n.writeString(i[a]);return n.get()}}})(),class extends ma{parse(e){e.offset(this.offset),this.version=e.readShort(),this.averageCharWidth=e.readShort_(),this.weightClass=e.readShort(),this.widthClass=e.readShort(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort_(),this.ySubscriptYSize=e.readShort_(),this.ySubscriptXOffset=e.readShort_(),this.ySubscriptYOffset=e.readShort_(),this.ySuperscriptXSize=e.readShort_(),this.ySuperscriptYSize=e.readShort_(),this.ySuperscriptXOffset=e.readShort_(),this.ySuperscriptYOffset=e.readShort_(),this.yStrikeoutSize=e.readShort_(),this.yStrikeoutPosition=e.readShort_(),this.familyClass=e.readShort_(),this.panose=e.times(10,e.readByte),this.charRange=e.times(4,e.readLong),this.vendorID=e.readString(4),this.selection=e.readShort(),this.firstCharIndex=e.readShort(),this.lastCharIndex=e.readShort(),this.version>0&&(this.ascent=e.readShort_(),this.descent=e.readShort_(),this.lineGap=e.readShort_(),this.winAscent=e.readShort(),this.winDescent=e.readShort(),this.codePageRange=e.times(2,e.readLong),this.version>1&&(this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()))}render(){return this.raw()}};function ha(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ga(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if(typeof n!=`object`)throw TypeError(n+`must be non-object`);for(var r in n)ha(n,r)&&(e[r]=n[r])}}return e}function _a(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)}var va={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray){e.set(t.subarray(n,n+r),i);return}for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){var t,n,r=0,i,a,o;for(t=0,n=e.length;t<n;t++)r+=e[t].length;for(o=new Uint8Array(r),i=0,t=0,n=e.length;t<n;t++)a=e[t],o.set(a,i),i+=a.length;return o},Buf8:function(e){return new Uint8Array(e)},Buf16:function(e){return new Uint16Array(e)},Buf32:function(e){return new Int32Array(e)}},ya={arraySet:function(e,t,n,r,i){for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){return[].concat.apply([],e)},Buf8:function(e){return Array(e)},Buf16:function(e){return Array(e)},Buf32:function(e){return Array(e)}};let ba=()=>{let e=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Int32Array<`u`;return ba=()=>e,e},xa=(e,t,n,r,i)=>(xa=ba()?va.arraySet:ya.arraySet,xa(e,t,n,r,i)),Sa=e=>(Sa=ba()?va.flattenChunks:ya.flattenChunks,Sa(e)),Ca=e=>(Ca=ba()?va.Buf8:ya.Buf8,Ca(e)),wa=e=>(wa=ba()?va.Buf16:ya.Buf16,wa(e)),Ta=e=>(Ta=ba()?va.Buf32:ya.Buf32,Ta(e)),Ea=function(){let e=!0;try{String.fromCharCode.apply(null,[0])}catch{e=!1}return Ea=()=>e,e},Da=function(){let e=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{e=!1}return Da=()=>e,e},Oa=function(e){for(var t=Ca(256),n=0;n<256;n++)t[n]=n>=252?6:n>=248?5:n>=240?4:n>=224?3:n>=192?2:1;return t[254]=t[254]=1,Oa=e=>t[e],t[e]};function ka(e){var t,n,r,i,a,o=e.length,s=0;for(i=0;i<o;i++)n=e.charCodeAt(i),(n&64512)==55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)==56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),a=0,i=0;a<s;i++)n=e.charCodeAt(i),(n&64512)==55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)==56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|n&63):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|n&63):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|n&63);return t}function Aa(e,t){if(t<65534&&(e.subarray&&Da()||!e.subarray&&Ea()))return String.fromCharCode.apply(null,_a(e,t));for(var n=``,r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n}function ja(e){return Aa(e,e.length)}function Ma(e){for(var t=new Uint8Array(e.length),n=0,r=t.length;n<r;n++)t[n]=e.charCodeAt(n);return t}function Na(e,t){var n,r,i,a,o=t||e.length,s=Array(o*2);for(r=0,n=0;n<o;){if(i=e[n++],i<128){s[r++]=i;continue}if(a=Oa(i),a>4){s[r++]=65533,n+=a-1;continue}for(i&=a===2?31:a===3?15:7;a>1&&n<o;)i=i<<6|e[n++]&63,a--;if(a>1){s[r++]=65533;continue}i<65536?s[r++]=i:(i-=65536,s[r++]=55296|i>>10&1023,s[r++]=56320|i&1023)}return Aa(s,r)}function Pa(e,t){var n;for(t||=e.length,t>e.length&&(t=e.length),n=t-1;n>=0&&(e[n]&192)==128;)n--;return n<0||n===0?t:n+Oa(e[n])>t?n:t}function Fa(e,t,n,r){for(var i=e&65535|0,a=e>>>16&65535|0,o=0;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0}function Ia(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t}let La=function(){let e=Ia();return La=()=>e,e};function Ra(e,t,n,r){var i=La(),a=r+n;e^=-1;for(var o=r;o<a;o++)e=e>>>8^i[(e^t[o])&255];return e^-1}var za=30,Ba=12;function Va(e,t){var n=e.state,r=e.next_in,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T=e.input,E;i=r+(e.avail_in-5),a=e.next_out,E=e.output,o=a-(t-e.avail_out),s=a+(e.avail_out-257),c=n.dmax,l=n.wsize,u=n.whave,d=n.wnext,f=n.window,p=n.hold,m=n.bits,h=n.lencode,g=n.distcode,_=(1<<n.lenbits)-1,v=(1<<n.distbits)-1;top:do{m<15&&(p+=T[r++]<<m,m+=8,p+=T[r++]<<m,m+=8),y=h[p&_];dolen:for(;;){if(b=y>>>24,p>>>=b,m-=b,b=y>>>16&255,b===0)E[a++]=y&65535;else if(b&16){x=y&65535,b&=15,b&&(m<b&&(p+=T[r++]<<m,m+=8),x+=p&(1<<b)-1,p>>>=b,m-=b),m<15&&(p+=T[r++]<<m,m+=8,p+=T[r++]<<m,m+=8),y=g[p&v];dodist:for(;;){if(b=y>>>24,p>>>=b,m-=b,b=y>>>16&255,b&16){if(S=y&65535,b&=15,m<b&&(p+=T[r++]<<m,m+=8,m<b&&(p+=T[r++]<<m,m+=8)),S+=p&(1<<b)-1,S>c){e.msg=`invalid distance too far back`,n.mode=za;break top}if(p>>>=b,m-=b,b=a-o,S>b){if(b=S-b,b>u&&n.sane){e.msg=`invalid distance too far back`,n.mode=za;break top}if(C=0,w=f,d===0){if(C+=l-b,b<x){x-=b;do E[a++]=f[C++];while(--b);C=a-S,w=E}}else if(d<b){if(C+=l+d-b,b-=d,b<x){x-=b;do E[a++]=f[C++];while(--b);if(C=0,d<x){b=d,x-=b;do E[a++]=f[C++];while(--b);C=a-S,w=E}}}else if(C+=d-b,b<x){x-=b;do E[a++]=f[C++];while(--b);C=a-S,w=E}for(;x>2;)E[a++]=w[C++],E[a++]=w[C++],E[a++]=w[C++],x-=3;x&&(E[a++]=w[C++],x>1&&(E[a++]=w[C++]))}else{C=a-S;do E[a++]=E[C++],E[a++]=E[C++],E[a++]=E[C++],x-=3;while(x>2);x&&(E[a++]=E[C++],x>1&&(E[a++]=E[C++]))}}else if(b&64){e.msg=`invalid distance code`,n.mode=za;break top}else{y=g[(y&65535)+(p&(1<<b)-1)];continue dodist}break}}else if(!(b&64)){y=h[(y&65535)+(p&(1<<b)-1)];continue dolen}else if(b&32){n.mode=Ba;break top}else{e.msg=`invalid literal/length code`,n.mode=za;break top}break}}while(r<i&&a<s);x=m>>3,r-=x,m-=x<<3,p&=(1<<m)-1,e.next_in=r,e.next_out=a,e.avail_in=r<i?5+(i-r):5-(r-i),e.avail_out=a<s?257+(s-a):257-(a-s),n.hold=p,n.bits=m}var Ha=15,Ua=852,Wa=592,Ga=0,Ka=1,qa=2,Ja=[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,0,0],Ya=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Xa=[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,0,0],Za=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function Qa(e,t,n,r,i,a,o,s){var c=s.bits,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y,b,x,S,C,w=null,T=0,E,D=wa(Ha+1),ee=wa(Ha+1),te=null,ne=0,re,ie,ae;for(l=0;l<=Ha;l++)D[l]=0;for(u=0;u<r;u++)D[t[n+u]]++;for(p=c,f=Ha;f>=1&&D[f]===0;f--);if(p>f&&(p=f),f===0)return i[a++]=20971520,i[a++]=20971520,s.bits=1,0;for(d=1;d<f&&D[d]===0;d++);for(p<d&&(p=d),g=1,l=1;l<=Ha;l++)if(g<<=1,g-=D[l],g<0)return-1;if(g>0&&(e===Ga||f!==1))return-1;for(ee[1]=0,l=1;l<Ha;l++)ee[l+1]=ee[l]+D[l];for(u=0;u<r;u++)t[n+u]!==0&&(o[ee[t[n+u]]++]=u);if(e===Ga?(w=te=o,E=19):e===Ka?(w=Ja,T-=257,te=Ya,ne-=257,E=256):(w=Xa,te=Za,E=-1),v=0,u=0,l=d,C=a,m=p,h=0,x=-1,_=1<<p,S=_-1,e===Ka&&_>Ua||e===qa&&_>Wa)return 1;for(;;){re=l-h,o[u]<E?(ie=0,ae=o[u]):o[u]>E?(ie=te[ne+o[u]],ae=w[T+o[u]]):(ie=96,ae=0),y=1<<l-h,b=1<<m,d=b;do b-=y,i[C+(v>>h)+b]=re<<24|ie<<16|ae|0;while(b!==0);for(y=1<<l-1;v&y;)y>>=1;if(y===0?v=0:(v&=y-1,v+=y),u++,--D[l]===0){if(l===f)break;l=t[n+o[u]]}if(l>p&&(v&S)!==x){for(h===0&&(h=p),C+=d,m=l-h,g=1<<m;m+h<f&&(g-=D[m+h],!(g<=0));)m++,g<<=1;if(_+=1<<m,e===Ka&&_>Ua||e===qa&&_>Wa)return 1;x=v&S,i[x]=p<<24|m<<16|C-a|0}}return v!==0&&(i[C+v]=l-h<<24|4194304),s.bits=p,0}var $a=0,eo=1,to=2,no=4,ro=5,io=6,ao=0,oo=1,so=2,co=-2,lo=-3,uo=-4,fo=-5,po=8,mo=1,ho=2,go=3,_o=4,vo=5,yo=6,bo=7,xo=8,So=9,Co=10,wo=11,To=12,Eo=13,Do=14,Oo=15,ko=16,Ao=17,jo=18,Mo=19,No=20,Po=21,Fo=22,Io=23,Lo=24,Ro=25,zo=26,Bo=27,Vo=28,Ho=29,Uo=30,Wo=31,Go=32,Ko=852,qo=592;function Jo(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function Yo(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=wa(320),this.work=wa(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Xo(e){var t;return!e||!e.state?co:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=t.wrap&1),t.mode=mo,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=Ta(Ko),t.distcode=t.distdyn=Ta(qo),t.sane=1,t.back=-1,ao)}function Zo(e){var t;return!e||!e.state?co:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,Xo(e))}function Qo(e,t){var n,r;return!e||!e.state||(r=e.state,t<0?(n=0,t=-t):(n=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?co:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,Zo(e))}function $o(e,t){var n,r;return e?(r=new Yo,e.state=r,r.window=null,n=Qo(e,t),n!==ao&&(e.state=null),n):co}var es=!0,ts,ns;function rs(e){if(es){var t;for(ts=Ta(512),ns=Ta(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Qa(eo,e.lens,0,288,ts,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Qa(to,e.lens,0,32,ns,0,e.work,{bits:5}),es=!1}e.lencode=ts,e.lenbits=9,e.distcode=ns,e.distbits=5}function is(e,t,n,r){var i,a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=Ca(a.wsize)),r>=a.wsize?(xa(a.window,t,n-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),xa(a.window,t,n-r,i,a.wnext),r-=i,r?(xa(a.window,t,n-r,r,0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0}function as(e,t){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g=0,_,v,y,b,x,S,C,w,T=Ca(4),E,D,ee=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return co;n=e.state,n.mode===To&&(n.mode=Eo),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,d=s,f=c,w=ao;inf_leave:for(;;)switch(n.mode){case mo:if(n.wrap===0){n.mode=Eo;break}for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&2&&l===35615){n.check=0,T[0]=l&255,T[1]=l>>>8&255,n.check=Ra(n.check,T,2,0),l=0,u=0,n.mode=ho;break}if(n.flags=0,n.head&&(n.head.done=!1),!(n.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg=`incorrect header check`,n.mode=Uo;break}if((l&15)!==po){e.msg=`unknown compression method`,n.mode=Uo;break}if(l>>>=4,u-=4,C=(l&15)+8,n.wbits===0)n.wbits=C;else if(C>n.wbits){e.msg=`invalid window size`,n.mode=Uo;break}n.dmax=1<<C,e.adler=n.check=1,n.mode=l&512?Co:To,l=0,u=0;break;case ho:for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.flags=l,(n.flags&255)!==po){e.msg=`unknown compression method`,n.mode=Uo;break}if(n.flags&57344){e.msg=`unknown header flags set`,n.mode=Uo;break}n.head&&(n.head.text=l>>8&1),n.flags&512&&(T[0]=l&255,T[1]=l>>>8&255,n.check=Ra(n.check,T,2,0)),l=0,u=0,n.mode=go;case go:for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.time=l),n.flags&512&&(T[0]=l&255,T[1]=l>>>8&255,T[2]=l>>>16&255,T[3]=l>>>24&255,n.check=Ra(n.check,T,4,0)),l=0,u=0,n.mode=_o;case _o:for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.xflags=l&255,n.head.os=l>>8),n.flags&512&&(T[0]=l&255,T[1]=l>>>8&255,n.check=Ra(n.check,T,2,0)),l=0,u=0,n.mode=vo;case vo:if(n.flags&1024){for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.length=l,n.head&&(n.head.extra_len=l),n.flags&512&&(T[0]=l&255,T[1]=l>>>8&255,n.check=Ra(n.check,T,2,0)),l=0,u=0}else n.head&&(n.head.extra=null);n.mode=yo;case yo:if(n.flags&1024&&(p=n.length,p>s&&(p=s),p&&(n.head&&(C=n.head.extra_len-n.length,n.head.extra||(n.head.extra=Array(n.head.extra_len)),xa(n.head.extra,r,a,p,C)),n.flags&512&&(n.check=Ra(n.check,r,p,a)),s-=p,a+=p,n.length-=p),n.length))break inf_leave;n.length=0,n.mode=bo;case bo:if(n.flags&2048){if(s===0)break inf_leave;p=0;do C=r[a+p++],n.head&&C&&n.length<65536&&(n.head.name+=String.fromCharCode(C));while(C&&p<s);if(n.flags&512&&(n.check=Ra(n.check,r,p,a)),s-=p,a+=p,C)break inf_leave}else n.head&&(n.head.name=null);n.length=0,n.mode=xo;case xo:if(n.flags&4096){if(s===0)break inf_leave;p=0;do C=r[a+p++],n.head&&C&&n.length<65536&&(n.head.comment+=String.fromCharCode(C));while(C&&p<s);if(n.flags&512&&(n.check=Ra(n.check,r,p,a)),s-=p,a+=p,C)break inf_leave}else n.head&&(n.head.comment=null);n.mode=So;case So:if(n.flags&512){for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(l!==(n.check&65535)){e.msg=`header crc mismatch`,n.mode=Uo;break}l=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=To;break;case Co:for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}e.adler=n.check=Jo(l),l=0,u=0,n.mode=wo;case wo:if(n.havedict===0)return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,so;e.adler=n.check=1,n.mode=To;case To:if(t===ro||t===io)break inf_leave;case Eo:if(n.last){l>>>=u&7,u-=u&7,n.mode=Bo;break}for(;u<3;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}switch(n.last=l&1,l>>>=1,--u,l&3){case 0:n.mode=Do;break;case 1:if(rs(n),n.mode=No,t===io){l>>>=2,u-=2;break inf_leave}break;case 2:n.mode=Ao;break;case 3:e.msg=`invalid block type`,n.mode=Uo}l>>>=2,u-=2;break;case Do:for(l>>>=u&7,u-=u&7;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if((l&65535)!=(l>>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=Uo;break}if(n.length=l&65535,l=0,u=0,n.mode=Oo,t===io)break inf_leave;case Oo:n.mode=ko;case ko:if(p=n.length,p){if(p>s&&(p=s),p>c&&(p=c),p===0)break inf_leave;xa(i,r,a,p,o),s-=p,a+=p,c-=p,o+=p,n.length-=p;break}n.mode=To;break;case Ao:for(;u<14;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.nlen=(l&31)+257,l>>>=5,u-=5,n.ndist=(l&31)+1,l>>>=5,u-=5,n.ncode=(l&15)+4,l>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg=`too many length or distance symbols`,n.mode=Uo;break}n.have=0,n.mode=jo;case jo:for(;n.have<n.ncode;){for(;u<3;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.lens[ee[n.have++]]=l&7,l>>>=3,u-=3}for(;n.have<19;)n.lens[ee[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,E={bits:n.lenbits},w=Qa($a,n.lens,0,19,n.lencode,0,n.work,E),n.lenbits=E.bits,w){e.msg=`invalid code lengths set`,n.mode=Uo;break}n.have=0,n.mode=Mo;case Mo:for(;n.have<n.nlen+n.ndist;){for(;g=n.lencode[l&(1<<n.lenbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(y<16)l>>>=_,u-=_,n.lens[n.have++]=y;else{if(y===16){for(D=_+2;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(l>>>=_,u-=_,n.have===0){e.msg=`invalid bit length repeat`,n.mode=Uo;break}C=n.lens[n.have-1],p=3+(l&3),l>>>=2,u-=2}else if(y===17){for(D=_+3;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=_,u-=_,C=0,p=3+(l&7),l>>>=3,u-=3}else{for(D=_+7;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=_,u-=_,C=0,p=11+(l&127),l>>>=7,u-=7}if(n.have+p>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=Uo;break}for(;p--;)n.lens[n.have++]=C}}if(n.mode===Uo)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=Uo;break}if(n.lenbits=9,E={bits:n.lenbits},w=Qa(eo,n.lens,0,n.nlen,n.lencode,0,n.work,E),n.lenbits=E.bits,w){e.msg=`invalid literal/lengths set`,n.mode=Uo;break}if(n.distbits=6,n.distcode=n.distdyn,E={bits:n.distbits},w=Qa(to,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,E),n.distbits=E.bits,w){e.msg=`invalid distances set`,n.mode=Uo;break}if(n.mode=No,t===io)break inf_leave;case No:n.mode=Po;case Po:if(s>=6&&c>=258){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,Va(e,f),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,n.mode===To&&(n.back=-1);break}for(n.back=0;g=n.lencode[l&(1<<n.lenbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(v&&!(v&240)){for(b=_,x=v,S=y;g=n.lencode[S+((l&(1<<b+x)-1)>>b)],_=g>>>24,v=g>>>16&255,y=g&65535,!(b+_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=b,u-=b,n.back+=b}if(l>>>=_,u-=_,n.back+=_,n.length=y,v===0){n.mode=zo;break}if(v&32){n.back=-1,n.mode=To;break}if(v&64){e.msg=`invalid literal/length code`,n.mode=Uo;break}n.extra=v&15,n.mode=Fo;case Fo:if(n.extra){for(D=n.extra;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=Io;case Io:for(;g=n.distcode[l&(1<<n.distbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(!(v&240)){for(b=_,x=v,S=y;g=n.distcode[S+((l&(1<<b+x)-1)>>b)],_=g>>>24,v=g>>>16&255,y=g&65535,!(b+_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=b,u-=b,n.back+=b}if(l>>>=_,u-=_,n.back+=_,v&64){e.msg=`invalid distance code`,n.mode=Uo;break}n.offset=y,n.extra=v&15,n.mode=Lo;case Lo:if(n.extra){for(D=n.extra;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=Uo;break}n.mode=Ro;case Ro:if(c===0)break inf_leave;if(p=f-c,n.offset>p){if(p=n.offset-p,p>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=Uo;break}p>n.wnext?(p-=n.wnext,m=n.wsize-p):m=n.wnext-p,p>n.length&&(p=n.length),h=n.window}else h=i,m=o-n.offset,p=n.length;p>c&&(p=c),c-=p,n.length-=p;do i[o++]=h[m++];while(--p);n.length===0&&(n.mode=Po);break;case zo:if(c===0)break inf_leave;i[o++]=n.length,c--,n.mode=Po;break;case Bo:if(n.wrap){for(;u<32;){if(s===0)break inf_leave;s--,l|=r[a++]<<u,u+=8}if(f-=c,e.total_out+=f,n.total+=f,f&&(e.adler=n.check=n.flags?Ra(n.check,i,f,o-f):Fa(n.check,i,f,o-f)),f=c,(n.flags?l:Jo(l))!==n.check){e.msg=`incorrect data check`,n.mode=Uo;break}l=0,u=0}n.mode=Vo;case Vo:if(n.wrap&&n.flags){for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(l!==(n.total&4294967295)){e.msg=`incorrect length check`,n.mode=Uo;break}l=0,u=0}n.mode=Ho;case Ho:w=oo;break inf_leave;case Uo:w=lo;break inf_leave;case Wo:return uo;case Go:default:return co}return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,(n.wsize||f!==e.avail_out&&n.mode<Uo&&(n.mode<Bo||t!==no))&&is(e,e.output,e.next_out,f-e.avail_out),d-=e.avail_in,f-=e.avail_out,e.total_in+=d,e.total_out+=f,n.total+=f,n.wrap&&f&&(e.adler=n.check=n.flags?Ra(n.check,i,f,e.next_out-f):Fa(n.check,i,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===To?128:0)+(n.mode===No||n.mode===Oo?256:0),(d===0&&f===0||t===no)&&w===ao&&(w=fo),w}function os(e){if(!e||!e.state)return co;var t=e.state;return t.window&&=null,e.state=null,ao}function ss(e,t){var n;return!e||!e.state||(n=e.state,!(n.wrap&2))?co:(n.head=t,t.done=!1,ao)}function cs(e,t){var n=t.length,r,i,a;return!e||!e.state||(r=e.state,r.wrap!==0&&r.mode!==wo)?co:r.mode===wo&&(i=1,i=Fa(i,t,n,0),i!==r.check)?lo:(a=is(e,t,n,n),a?(r.mode=Wo,uo):(r.havedict=1,ao))}var ls={2:`need dictionary`,1:`stream end`,0:``,"-1":`file error`,"-2":`stream error`,"-3":`data error`,"-4":`insufficient memory`,"-5":`buffer error`,"-6":`incompatible version`};function us(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}function ds(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=``,this.comment=``,this.hcrc=0,this.done=!1}var fs=Object.prototype.toString,ps=class e{constructor(t){if(!(this instanceof e))return new e(t);this.options=ga({chunkSize:16384,windowBits:0,to:``},t||{});var n=this.options;n.raw&&n.windowBits>=0&&n.windowBits<16&&(n.windowBits=-n.windowBits,n.windowBits===0&&(n.windowBits=-15)),n.windowBits>=0&&n.windowBits<16&&!(t&&t.windowBits)&&(n.windowBits+=32),n.windowBits>15&&n.windowBits<48&&(n.windowBits&15||(n.windowBits|=15)),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new us,this.strm.avail_out=0;var r=$o(this.strm,n.windowBits);if(r!==0||(this.header=new ds,ss(this.strm,this.header),n.dictionary&&(typeof n.dictionary==`string`?n.dictionary=ka(n.dictionary):fs.call(n.dictionary)===`[object ArrayBuffer]`&&(n.dictionary=new Uint8Array(n.dictionary)),n.raw&&(r=cs(this.strm,n.dictionary),r!==0))))throw Error(ls[r])}push(e,t){var n=this.strm,r=this.options.chunkSize,i=this.options.dictionary,a,o,s,c,l,u,d=!1;if(this.ended)return!1;o=t===~~t?t:t===!0?4:0,typeof e==`string`?n.input=Ma(e):fs.call(e)===`[object ArrayBuffer]`?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;do{if(n.avail_out===0&&(n.output=Ca(r),n.next_out=0,n.avail_out=r),a=as(n,0),a===2&&i&&(u=typeof i==`string`?ka(i):fs.call(i)===`[object ArrayBuffer]`?new Uint8Array(i):i,a=cs(this.strm,u)),a===-5&&d===!0&&(a=0,d=!1),a!==1&&a!==0)return this.onEnd(a),this.ended=!0,!1;n.next_out&&(n.avail_out===0||a===1||n.avail_in===0&&(o===4||o===2))&&(this.options.to===`string`?(s=Pa(n.output,n.next_out),c=n.next_out-s,l=Na(n.output,s),n.next_out=c,n.avail_out=r-c,c&&xa(n.output,n.output,s,c,0),this.onData(l)):this.onData(_a(n.output,n.next_out))),n.avail_in===0&&n.avail_out===0&&(d=!0)}while((n.avail_in>0||n.avail_out===0)&&a!==1);return a===1&&(o=4),o===4?(a=os(this.strm),this.onEnd(a),this.ended=!0,a===0):o===2?(this.onEnd(0),n.avail_out=0,!0):!0}onData(e){this.chunks.push(e)}onEnd(e){e===0&&(this.options.to===`string`?this.result=this.chunks.join(``):this.result=Sa(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}};function ms(e){for(var t=e.length;--t>=0;)e[t]=0}var hs=0,gs=1,_s=2,vs=3,ys=258,bs=29,xs=256,Ss=xs+1+bs,Cs=30,ws=19,Ts=2*Ss+1,Es=15,Ds=16,Os=7,ks=256,As=16,js=17,Ms=18,Ns=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Ps=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Fs=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Is=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Ls=512,Rs,zs,Bs,Vs,Hs,Us;function Ws(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}var Gs,Ks,qs;function Js(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Ys(e){return e<256?Bs[e]:Bs[256+(e>>>7)]}function Xs(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function Zs(e,t,n){e.bi_valid>Ds-n?(e.bi_buf|=t<<e.bi_valid&65535,Xs(e,e.bi_buf),e.bi_buf=t>>Ds-e.bi_valid,e.bi_valid+=n-Ds):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function Qs(e,t,n){Zs(e,n[t*2],n[t*2+1])}function $s(e,t){var n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1}function ec(e){e.bi_valid===16?(Xs(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function tc(e,t){var n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,l,u,d,f,p,m,h=0;for(f=0;f<=Es;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<Ts;l++)u=e.heap[l],f=n[n[u*2+1]*2+1]+1,f>c&&(f=c,h++),n[u*2+1]=f,!(u>r)&&(e.bl_count[f]++,p=0,u>=s&&(p=o[u-s]),m=n[u*2],e.opt_len+=m*(f+p),a&&(e.static_len+=m*(i[u*2+1]+p)));if(h!==0){do{for(f=c-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,h-=2}while(h>0);for(f=c;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--l],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}}function nc(e,t,n){var r=Array(Es+1),i=0,a,o;for(a=1;a<=Es;a++)r[a]=i=i+n[a-1]<<1;for(o=0;o<=t;o++){var s=e[o*2+1];s!==0&&(e[o*2]=$s(r[s]++,s))}}function rc(){var e,t,n,r,i,a=Array(Es+1);for(Rs=Array((Ss+2)*2),ms(Rs),zs=Array(Cs*2),ms(zs),Bs=Array(Ls),ms(Bs),Vs=Array(ys-vs+1),ms(Vs),Hs=Array(bs),ms(Hs),Us=Array(Cs),ms(Us),n=0,r=0;r<bs-1;r++)for(Hs[r]=n,e=0;e<1<<Ns[r];e++)Vs[n++]=r;for(Vs[n-1]=r,i=0,r=0;r<16;r++)for(Us[r]=i,e=0;e<1<<Ps[r];e++)Bs[i++]=r;for(i>>=7;r<Cs;r++)for(Us[r]=i<<7,e=0;e<1<<Ps[r]-7;e++)Bs[256+i++]=r;for(t=0;t<=Es;t++)a[t]=0;for(e=0;e<=143;)Rs[e*2+1]=8,e++,a[8]++;for(;e<=255;)Rs[e*2+1]=9,e++,a[9]++;for(;e<=279;)Rs[e*2+1]=7,e++,a[7]++;for(;e<=287;)Rs[e*2+1]=8,e++,a[8]++;for(nc(Rs,Ss+1,a),e=0;e<Cs;e++)zs[e*2+1]=5,zs[e*2]=$s(e,5);Gs=new Ws(Rs,Ns,xs+1,Ss,Es),Ks=new Ws(zs,Ps,0,Cs,Es),qs=new Ws([],Fs,0,ws,Os)}function ic(e){var t;for(t=0;t<Ss;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Cs;t++)e.dyn_dtree[t*2]=0;for(t=0;t<ws;t++)e.bl_tree[t*2]=0;e.dyn_ltree[ks*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function ac(e){e.bi_valid>8?Xs(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function oc(e,t,n,r){ac(e),r&&(Xs(e,n),Xs(e,~n)),xa(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}function sc(e,t,n,r){var i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]}function cc(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&sc(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!sc(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function lc(e,t,n){var r,i,a=0,o,s;if(e.last_lit!==0)do r=e.pending_buf[e.d_buf+a*2]<<8|e.pending_buf[e.d_buf+a*2+1],i=e.pending_buf[e.l_buf+a],a++,r===0?Qs(e,i,t):(o=Vs[i],Qs(e,o+xs+1,t),s=Ns[o],s!==0&&(i-=Hs[o],Zs(e,i,s)),r--,o=Ys(r),Qs(e,o,n),s=Ps[o],s!==0&&(r-=Us[o],Zs(e,r,s)));while(a<e.last_lit);Qs(e,ks,t)}function uc(e,t){var n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,c=-1,l;for(e.heap_len=0,e.heap_max=Ts,o=0;o<a;o++)n[o*2]===0?n[o*2+1]=0:(e.heap[++e.heap_len]=c=o,e.depth[o]=0);for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,n[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=r[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)cc(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],cc(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,cc(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],tc(e,t),nc(n,c,e.bl_count)}function dc(e,t,n){var r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a===0?s<=10?e.bl_tree[js*2]++:e.bl_tree[Ms*2]++:(a!==i&&e.bl_tree[a*2]++,e.bl_tree[As*2]++),s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))}function fc(e,t,n){var r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)){if(s<l)do Qs(e,a,e.bl_tree);while(--s!==0);else a===0?s<=10?(Qs(e,js,e.bl_tree),Zs(e,s-3,3)):(Qs(e,Ms,e.bl_tree),Zs(e,s-11,7)):(a!==i&&(Qs(e,a,e.bl_tree),s--),Qs(e,As,e.bl_tree),Zs(e,s-3,2));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}}function pc(e){var t;for(dc(e,e.dyn_ltree,e.l_desc.max_code),dc(e,e.dyn_dtree,e.d_desc.max_code),uc(e,e.bl_desc),t=ws-1;t>=3&&e.bl_tree[Is[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function mc(e,t,n,r){var i;for(Zs(e,t-257,5),Zs(e,n-1,5),Zs(e,r-4,4),i=0;i<r;i++)Zs(e,e.bl_tree[Is[i]*2+1],3);fc(e,e.dyn_ltree,t-1),fc(e,e.dyn_dtree,n-1)}function hc(e){var t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return 0;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return 1;for(n=32;n<xs;n++)if(e.dyn_ltree[n*2]!==0)return 1;return 0}var gc=!1;function _c(e){gc||=(rc(),!0),e.l_desc=new Js(e.dyn_ltree,Gs),e.d_desc=new Js(e.dyn_dtree,Ks),e.bl_desc=new Js(e.bl_tree,qs),e.bi_buf=0,e.bi_valid=0,ic(e)}function vc(e,t,n,r){Zs(e,(hs<<1)+ +!!r,3),oc(e,t,n,!0)}function yc(e){Zs(e,gs<<1,3),Qs(e,ks,Rs),ec(e)}function bc(e,t,n,r){var i,a,o=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=hc(e)),uc(e,e.l_desc),uc(e,e.d_desc),o=pc(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?vc(e,t,n,r):e.strategy===4||a===i?(Zs(e,(gs<<1)+ +!!r,3),lc(e,Rs,zs)):(Zs(e,(_s<<1)+ +!!r,3),mc(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),lc(e,e.dyn_ltree,e.dyn_dtree)),ic(e),r&&ac(e)}function xc(e,t,n){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(Vs[n]+xs+1)*2]++,e.dyn_dtree[Ys(t)*2]++),e.last_lit===e.lit_bufsize-1}var Sc=9,Cc=286,wc=30,Tc=19,Ec=2*Cc+1,Dc=15,M=3,Oc=258,kc=Oc+M+1,Ac=32,jc=42,Mc=69,Nc=73,Pc=91,Fc=103,Ic=113,Lc=666,Rc=1,zc=2,Bc=3,Vc=4,Hc=3;function Uc(e,t){return e.msg=ls[t],t}function Wc(e){return(e<<1)-(e>4?9:0)}function Gc(e){for(var t=e.length;--t>=0;)e[t]=0}function Kc(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(xa(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function qc(e,t){bc(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Kc(e.strm)}function N(e,t){e.pending_buf[e.pending++]=t}function Jc(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function Yc(e,t,n,r){var i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,xa(t,e.input,e.next_in,i,n),e.state.wrap===1?e.adler=Fa(e.adler,t,i,n):e.state.wrap===2&&(e.adler=Ra(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)}function Xc(e,t){var n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-kc?e.strstart-(e.w_size-kc):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+Oc,p=l[r+o-1],m=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(i=t,l[i+o]!==m||l[i+o-1]!==p||l[i]!==l[r]||l[++i]!==l[r+1])continue;r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<f);if(a=Oc-(f-r),r=f-Oc,a>o){if(e.match_start=t,o=a,a>=s)break;p=l[r+o-1],m=l[r+o]}}while((t=d[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead}function Zc(e){var t=e.w_size,n,r,i,a,o;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-kc)){xa(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,r=e.hash_size,n=r;do i=e.head[--n],e.head[n]=i>=t?i-t:0;while(--r);r=t,n=r;do i=e.prev[--n],e.prev[n]=i>=t?i-t:0;while(--r);a+=t}if(e.strm.avail_in===0)break;if(r=Yc(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=r,e.lookahead+e.insert>=M)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+M-1])&e.hash_mask,e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<M)););}while(e.lookahead<kc&&e.strm.avail_in!==0)}function Qc(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Zc(e),e.lookahead===0&&t===0)return Rc;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,qc(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-kc&&(qc(e,!1),e.strm.avail_out===0))return Rc}return e.insert=0,t===4?(qc(e,!0),e.strm.avail_out===0?Bc:Vc):(e.strstart>e.block_start&&(qc(e,!1),e.strm.avail_out),Rc)}function $c(e,t){for(var n,r;;){if(e.lookahead<kc){if(Zc(e),e.lookahead<kc&&t===0)return Rc;if(e.lookahead===0)break}if(n=0,e.lookahead>=M&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-kc&&(e.match_length=Xc(e,n)),e.match_length>=M)if(r=xc(e,e.strstart-e.match_start,e.match_length-M),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=M){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=xc(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(qc(e,!1),e.strm.avail_out===0))return Rc}return e.insert=e.strstart<M-1?e.strstart:M-1,t===4?(qc(e,!0),e.strm.avail_out===0?Bc:Vc):e.last_lit&&(qc(e,!1),e.strm.avail_out===0)?Rc:zc}function el(e,t){for(var n,r,i;;){if(e.lookahead<kc){if(Zc(e),e.lookahead<kc&&t===0)return Rc;if(e.lookahead===0)break}if(n=0,e.lookahead>=M&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=M-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-kc&&(e.match_length=Xc(e,n),e.match_length<=5&&(e.strategy===1||e.match_length===M&&e.strstart-e.match_start>4096)&&(e.match_length=M-1)),e.prev_length>=M&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-M,r=xc(e,e.strstart-1-e.prev_match,e.prev_length-M),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=M-1,e.strstart++,r&&(qc(e,!1),e.strm.avail_out===0))return Rc}else if(e.match_available){if(r=xc(e,0,e.window[e.strstart-1]),r&&qc(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Rc}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(r=xc(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<M-1?e.strstart:M-1,t===4?(qc(e,!0),e.strm.avail_out===0?Bc:Vc):e.last_lit&&(qc(e,!1),e.strm.avail_out===0)?Rc:zc}function tl(e,t){for(var n,r,i,a,o=e.window;;){if(e.lookahead<=Oc){if(Zc(e),e.lookahead<=Oc&&t===0)return Rc;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=M&&e.strstart>0&&(i=e.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){a=e.strstart+Oc;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<a);e.match_length=Oc-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=M?(n=xc(e,1,e.match_length-M),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=xc(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(qc(e,!1),e.strm.avail_out===0))return Rc}return e.insert=0,t===4?(qc(e,!0),e.strm.avail_out===0?Bc:Vc):e.last_lit&&(qc(e,!1),e.strm.avail_out===0)?Rc:zc}function nl(e,t){for(var n;;){if(e.lookahead===0&&(Zc(e),e.lookahead===0)){if(t===0)return Rc;break}if(e.match_length=0,n=xc(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(qc(e,!1),e.strm.avail_out===0))return Rc}return e.insert=0,t===4?(qc(e,!0),e.strm.avail_out===0?Bc:Vc):e.last_lit&&(qc(e,!1),e.strm.avail_out===0)?Rc:zc}function rl(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}let il=function(){let e=[new rl(0,0,0,0,Qc),new rl(4,4,8,4,$c),new rl(4,5,16,8,$c),new rl(4,6,32,32,$c),new rl(4,4,16,16,el),new rl(8,16,32,32,el),new rl(8,16,128,128,el),new rl(8,32,128,256,el),new rl(32,128,258,1024,el),new rl(32,258,258,4096,el)];return il=()=>e,e};function al(e){e.window_size=2*e.w_size,Gc(e.head);let t=il();e.max_lazy_match=t[e.level].max_lazy,e.good_match=t[e.level].good_length,e.nice_match=t[e.level].nice_length,e.max_chain_length=t[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=M-1,e.match_available=0,e.ins_h=0}function ol(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=wa(Ec*2),this.dyn_dtree=wa((2*wc+1)*2),this.bl_tree=wa((2*Tc+1)*2),Gc(this.dyn_ltree),Gc(this.dyn_dtree),Gc(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=wa(Dc+1),this.heap=wa(2*Cc+1),Gc(this.heap),this.heap_len=0,this.heap_max=0,this.depth=wa(2*Cc+1),Gc(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function sl(e){var t;return!e||!e.state?Uc(e,-2):(e.total_in=e.total_out=0,e.data_type=2,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?jc:Ic,e.adler=t.wrap===2?0:1,t.last_flush=0,_c(t),0)}function cl(e){var t=sl(e);return t===0&&al(e.state),t}function ll(e,t){return!e||!e.state||e.state.wrap!==2?-2:(e.state.gzhead=t,0)}function ul(e,t,n,r,i,a){if(!e)return-2;var o=1;if(t===-1&&(t=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>Sc||n!==8||r<8||r>15||t<0||t>9||a<0||a>4)return Uc(e,-2);r===8&&(r=9);var s=new ol;return e.state=s,s.strm=e,s.wrap=o,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+M-1)/M),s.window=Ca(s.w_size*2),s.head=wa(s.hash_size),s.prev=wa(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=Ca(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=a,s.method=n,cl(e)}function dl(e,t){var n,r,i,a;if(!e||!e.state||t>5||t<0)return e?Uc(e,-2):-2;if(r=e.state,!e.output||!e.input&&e.avail_in!==0||r.status===Lc&&t!==4)return Uc(e,e.avail_out===0?-5:-2);if(r.strm=e,n=r.last_flush,r.last_flush=t,r.status===jc)if(r.wrap===2)e.adler=0,N(r,31),N(r,139),N(r,8),r.gzhead?(N(r,+!!r.gzhead.text+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),N(r,r.gzhead.time&255),N(r,r.gzhead.time>>8&255),N(r,r.gzhead.time>>16&255),N(r,r.gzhead.time>>24&255),N(r,r.level===9?2:r.strategy>=2||r.level<2?4:0),N(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(N(r,r.gzhead.extra.length&255),N(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=Ra(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Mc):(N(r,0),N(r,0),N(r,0),N(r,0),N(r,0),N(r,r.level===9?2:r.strategy>=2||r.level<2?4:0),N(r,Hc),r.status=Ic);else{var o=8+(r.w_bits-8<<4)<<8,s=-1;s=r.strategy>=2||r.level<2?0:r.level<6?1:r.level===6?2:3,o|=s<<6,r.strstart!==0&&(o|=Ac),o+=31-o%31,r.status=Ic,Jc(r,o),r.strstart!==0&&(Jc(r,e.adler>>>16),Jc(r,e.adler&65535)),e.adler=1}if(r.status===Mc)if(r.gzhead.extra){for(i=r.pending;r.gzindex<(r.gzhead.extra.length&65535)&&!(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=Ra(e.adler,r.pending_buf,r.pending-i,i)),Kc(e),i=r.pending,r.pending===r.pending_buf_size));)N(r,r.gzhead.extra[r.gzindex]&255),r.gzindex++;r.gzhead.hcrc&&r.pending>i&&(e.adler=Ra(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=Nc)}else r.status=Nc;if(r.status===Nc)if(r.gzhead.name){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=Ra(e.adler,r.pending_buf,r.pending-i,i)),Kc(e),i=r.pending,r.pending===r.pending_buf_size)){a=1;break}a=r.gzindex<r.gzhead.name.length?r.gzhead.name.charCodeAt(r.gzindex++)&255:0,N(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(e.adler=Ra(e.adler,r.pending_buf,r.pending-i,i)),a===0&&(r.gzindex=0,r.status=Pc)}else r.status=Pc;if(r.status===Pc)if(r.gzhead.comment){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=Ra(e.adler,r.pending_buf,r.pending-i,i)),Kc(e),i=r.pending,r.pending===r.pending_buf_size)){a=1;break}a=r.gzindex<r.gzhead.comment.length?r.gzhead.comment.charCodeAt(r.gzindex++)&255:0,N(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(e.adler=Ra(e.adler,r.pending_buf,r.pending-i,i)),a===0&&(r.status=Fc)}else r.status=Fc;if(r.status===Fc&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&Kc(e),r.pending+2<=r.pending_buf_size&&(N(r,e.adler&255),N(r,e.adler>>8&255),e.adler=0,r.status=Ic)):r.status=Ic),r.pending!==0){if(Kc(e),e.avail_out===0)return r.last_flush=-1,0}else if(e.avail_in===0&&Wc(t)<=Wc(n)&&t!==4)return Uc(e,-5);if(r.status===Lc&&e.avail_in!==0)return Uc(e,-5);if(e.avail_in!==0||r.lookahead!==0||t!==0&&r.status!==Lc){var c=r.strategy===2?nl(r,t):r.strategy===3?tl(r,t):il()[r.level].func(r,t);if((c===Bc||c===Vc)&&(r.status=Lc),c===Rc||c===Bc)return e.avail_out===0&&(r.last_flush=-1),0;if(c===zc&&(t===1?yc(r):t!==5&&(vc(r,0,0,!1),t===3&&(Gc(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),Kc(e),e.avail_out===0))return r.last_flush=-1,0}return t===4?r.wrap<=0?1:(r.wrap===2?(N(r,e.adler&255),N(r,e.adler>>8&255),N(r,e.adler>>16&255),N(r,e.adler>>24&255),N(r,e.total_in&255),N(r,e.total_in>>8&255),N(r,e.total_in>>16&255),N(r,e.total_in>>24&255)):(Jc(r,e.adler>>>16),Jc(r,e.adler&65535)),Kc(e),r.wrap>0&&(r.wrap=-r.wrap),+(r.pending===0)):0}function fl(e){var t;return!e||!e.state?-2:(t=e.state.status,t!==jc&&t!==Mc&&t!==Nc&&t!==Pc&&t!==Fc&&t!==Ic&&t!==Lc?Uc(e,-2):(e.state=null,t===Ic?Uc(e,-3):0))}function pl(e,t){var n=t.length,r,i,a,o,s,c,l,u;if(!e||!e.state||(r=e.state,o=r.wrap,o===2||o===1&&r.status!==jc||r.lookahead))return-2;for(o===1&&(e.adler=Fa(e.adler,t,n,0)),r.wrap=0,n>=r.w_size&&(o===0&&(Gc(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=Ca(r.w_size),xa(u,t,n-r.w_size,r.w_size,0),t=u,n=r.w_size),s=e.avail_in,c=e.next_in,l=e.input,e.avail_in=n,e.next_in=0,e.input=t,Zc(r);r.lookahead>=M;){i=r.strstart,a=r.lookahead-(M-1);do r.ins_h=(r.ins_h<<r.hash_shift^r.window[i+M-1])&r.hash_mask,r.prev[i&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=i,i++;while(--a);r.strstart=i,r.lookahead=M-1,Zc(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=M-1,r.match_available=0,e.next_in=c,e.input=l,e.avail_in=s,r.wrap=o,0}var ml=Object.prototype.toString,hl=class{constructor(e){this.options=ga({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:``},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new us,this.strm.avail_out=0;var n=ul(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==0)throw Error(ls[n]);if(t.header&&ll(this.strm,t.header),t.dictionary){var r=typeof t.dictionary==`string`?ka(t.dictionary):ml.call(t.dictionary)===`[object ArrayBuffer]`?new Uint8Array(t.dictionary):t.dictionary;if(n=pl(this.strm,r),n!==0)throw Error(ls[n]);this._dict_set=!0}}push(e,t){var n=this.strm,r=this.options.chunkSize,i,a;if(this.ended)return!1;a=t===~~t?t:t===!0?4:0,typeof e==`string`?n.input=ka(e):ml.call(e)===`[object ArrayBuffer]`?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;do{if(n.avail_out===0&&(n.output=Ca(r),n.next_out=0,n.avail_out=r),i=dl(n,a),i!==1&&i!==0)return this.onEnd(i),this.ended=!0,!1;(n.avail_out===0||n.avail_in===0&&(a===4||a===2))&&(this.options.to===`string`?this.onData(ja(_a(n.output,n.next_out))):this.onData(_a(n.output,n.next_out)))}while((n.avail_in>0||n.avail_out===0)&&i!==1);return a===4?(i=fl(this.strm),this.onEnd(i),this.ended=!0,i===0):a===2?(this.onEnd(0),n.avail_out=0,!0):!0}onData(e){this.chunks.push(e)}onEnd(e){e===0&&(this.options.to===`string`?this.result=this.chunks.join(``):this.result=Sa(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}};function gl(e,t){var n=new hl(t);if(n.push(e,!0),n.err)throw n.msg||ls[n.err];return n.result}let _l=gl;function vl(){return!0}x.browser;var yl=0;let bl=0;function xl(){var e=0,t=fa();function n(){for(var e=0;e<arguments.length;++e){var r=arguments[e];if(r===void 0)throw Error(`Cannot output undefined to PDF`);if(r instanceof kl)r.beforeRender(n),r.render(n);else if(Tl(r))Dl(r,n);else if(El(r))Ol(r,n);else if(typeof r==`number`){if(isNaN(r))throw Error(`Cannot output NaN to PDF`);var i=r.toFixed(7);i.indexOf(`.`)>=0&&(i=i.replace(/\.?0+$/,``)),i==`-0`&&(i=`0`),t.writeString(i)}else/string|boolean/.test(typeof r)?t.writeString(String(r)):typeof r.get==`function`?t.write(r.get()):typeof r==`object`&&(r?n(new F(r)):t.writeString(`null`))}}return n.writeData=function(e){t.write(e)},n.withIndent=function(t){++e,t(n),--e},n.indent=function(){n(`
`,Sl(``,e*2,`  `)),n.apply(null,arguments)},n.offset=function(){return t.offset()},n.toString=function(){throw Error(`FIX CALLER`)},n.get=function(){return t.get()},n.stream=function(){return t},n}function Sl(e,t,n){for(;e.length<t;)e=n+e;return e}function Cl(e,t){return Sl(String(e),t,`0`)}function wl(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Tl=Array.isArray||function(e){return e instanceof Array};function El(e){return e instanceof Date}function Dl(e,t){t(`[`),e.length>0&&t.withIndent(function(){for(var n=0;n<e.length;++n)n>0&&n%8==0?t.indent(e[n]):t(` `,e[n])}),t(` ]`)}function Ol(e,t){t(`(D:`,Cl(e.getUTCFullYear(),4),Cl(e.getUTCMonth()+1,2),Cl(e.getUTCDate(),2),Cl(e.getUTCHours(),2),Cl(e.getUTCMinutes(),2),Cl(e.getUTCSeconds(),2),`Z)`)}var kl=class{beforeRender(){}},Al=class extends kl{constructor(e,t){super(),this.value=e,this.utf16be=!!t}render(e){let t=this.value;if(this.utf16be)t=`þÿ`+Ne(t),t=t.replace(/([\(\)\\])/g,`\\$1`),e(`(`,t,`)`);else{let r=[40];for(var n=0;n<t.length;++n){let e=t.charCodeAt(n)&255;(e==40||e==41||e==92)&&r.push(92),r.push(e)}r.push(41),e.writeData(r)}}toString(){return this.value}},jl=class extends Al{constructor(e){super(e),this.value=e}render(e){e(`<`);for(var t=0;t<this.value.length;++t)e(Cl(this.value.charCodeAt(t).toString(16),4));e(`>`)}},Ml=class extends kl{static get(e){return P(e)}constructor(e){super(),this.name=e}render(e){e(`/`+this.escape())}escape(){return this.name.replace(/[^\x21-\x7E]/g,function(e){return`#`+Cl(e.charCodeAt(0).toString(16),2)})}toString(){return this.name}};function P(e){return new Ml(e)}var F=class extends kl{constructor(e){super(),this.props=e}render(e){var t=this.props,n=!0;e(`<<`),e.withIndent(function(){for(var r in t)wl(t,r)&&!/^_/.test(r)&&(n=!1,e.indent(P(r),` `,t[r]))}),n||e.indent(),e(`>>`)}},Nl=class extends kl{constructor(e,t,n){if(super(),typeof e==`string`){var r=fa();r.write(e),e=r}this.data=e,this.props=t||{},this.compress=n}render(e){var t=this.data.get(),n=this.props;this.compress&&vl()&&(n.Filter?n.Filter instanceof Array||(n.Filter=[n.Filter]):n.Filter=[],n.Filter.unshift(P(`FlateDecode`)),t=_l(t)),n.Length=t.length,e(new F(n),` stream`,`
`),e.writeData(t),e(`
`,`endstream`)}};(class extends F{constructor(){super({Type:P(`Catalog`)})}setPages(e){this.props.Pages=e}}),class extends F{constructor(){super({Type:P(`Pages`),Kids:[],Count:0})}addPage(e){this.props.Kids.push(e),this.props.Count++}},class extends F{constructor(e,t,n){let{width:r,height:i}=e.size(),a=new Ul(t._pdf,{});a._content=new Nl(xl(),null,!0),n(e,a,{}),t._xResources=Object.assign(t._xResources,a._xResources),t._fontResources=Object.assign(t._fontResources,a._fontResources),t._gsResources=Object.assign(t._gsResources,a._gsResources),super({Type:P(`Pattern`),PatternType:1,PaintType:1,TilingType:1,BBox:[0,0,r,i],XStep:r,YStep:i,Matrix:[1,0,0,-1,0,i],Resources:{ExtGState:new F(a._gsResources),XObject:new F(a._xResources),Font:new F(a._fontResources)}}),this._resourceName=P(`P`+ ++bl),this.data=a._content.data,this.compress=!0}render(e){Nl.prototype.render.call(this,e)}},class extends F{constructor(e){super({Type:P(`Font`),Subtype:P(`Type1`),BaseFont:P(e)}),this._resourceName=P(`F`+ ++yl)}encodeText(e){return new Al(String(e))}};var Pl=class extends F{constructor(e,t,n){super({}),n=this.props,n.Type=P(`Font`),n.Subtype=P(`Type0`),n.Encoding=P(`Identity-H`),this._pdf=e,this._font=t,this._sub=t.makeSubset(),this._resourceName=P(`F`+ ++yl);var r=t.head;this.name=t.psName;var i=this.scale=t.scale;this.bbox=[r.xMin*i,r.yMin*i,r.xMax*i,r.yMax*i],this.italicAngle=t.post.italicAngle,this.ascent=t.ascent*i,this.descent=t.descent*i,this.lineGap=t.lineGap*i,this.capHeight=t.os2.capHeight||this.ascent,this.xHeight=t.os2.xHeight||0,this.stemV=0,this.familyClass=(t.os2.familyClass||0)>>8,this.isSerif=this.familyClass>=1&&this.familyClass<=7,this.isScript=this.familyClass==10,this.flags=!!t.post.isFixedPitch|(this.isSerif?2:0)|(this.isScript?8:0)|(this.italicAngle===0?0:64)|32}encodeText(e){return new jl(this._sub.encodeText(String(e)))}getTextWidth(e,t){for(var n=0,r=this._font.cmap.codeMap,i=0;i<t.length;++i){var a=r[t.charCodeAt(i)];n+=this._font.widthOfGlyph(a||0)}return n*e/1e3}beforeRender(){var e=this,t=e._sub,n=t.render(),r=new Nl(fa(n),{Length1:n.length},!0),i=e._pdf.attach(new F({Type:P(`FontDescriptor`),FontName:P(e._sub.psName),FontBBox:e.bbox,Flags:e.flags,StemV:e.stemV,ItalicAngle:e.italicAngle,Ascent:e.ascent,Descent:e.descent,CapHeight:e.capHeight,XHeight:e.xHeight,FontFile2:e._pdf.attach(r)})),a=t.ncid2ogid,o=t.firstChar,s=t.lastChar,c=[];(function t(n,r){if(n<=s){var i=a[n];i==null?t(n+1):(r||c.push(n,r=[]),r.push(e._font.widthOfGlyph(i)),t(n+1,r))}})(o);var l=new F({Type:P(`Font`),Subtype:P(`CIDFontType2`),BaseFont:P(e._sub.psName),CIDSystemInfo:new F({Registry:new Al(`Adobe`),Ordering:new Al(`Identity`),Supplement:0}),FontDescriptor:i,FirstChar:o,LastChar:s,DW:Math.round(e._font.widthOfGlyph(0)),W:c,CIDToGIDMap:e._pdf.attach(e._makeCidToGidMap())}),u=e.props;u.BaseFont=P(e._sub.psName),u.DescendantFonts=[e._pdf.attach(l)];var d=new Fl(o,s,t.subset),f=new Nl(xl(),null,!0);f.data(d),u.ToUnicode=e._pdf.attach(f)}_makeCidToGidMap(){return new Nl(fa(this._sub.cidToGidMap()),null,!0)}},Fl=class extends kl{constructor(e,t,n){super(),this.firstChar=e,this.lastChar=t,this.map=n}render(e){e.indent(`/CIDInit /ProcSet findresource begin`),e.indent(`12 dict begin`),e.indent(`begincmap`),e.indent(`/CIDSystemInfo <<`),e.indent(`  /Registry (Adobe)`),e.indent(`  /Ordering (UCS)`),e.indent(`  /Supplement 0`),e.indent(`>> def`),e.indent(`/CMapName /Adobe-Identity-UCS def`),e.indent(`/CMapType 2 def`),e.indent(`1 begincodespacerange`),e.indent(`  <0000><ffff>`),e.indent(`endcodespacerange`);var t=this;e.indent(t.lastChar-t.firstChar+1,` beginbfchar`),e.withIndent(function(){for(var n=t.firstChar;n<=t.lastChar;++n){var r=t.map[n],i=pa([r]);e.indent(`<`,Cl(n.toString(16),4),`>`,`<`);for(var a=0;a<i.length;++a)e(Cl(i.charCodeAt(a).toString(16),4));e(`>`)}}),e.indent(`endbfchar`),e.indent(`endcmap`),e.indent(`CMapName currentdict /CMap defineresource pop`),e.indent(`end`),e.indent(`end`)}};function Il(e){return e.map(function(e){return Tl(e)?Il(e):typeof e==`number`?(Math.round(e*1e3)/1e3).toFixed(3):e}).join(` `)}function Ll(e,t,n,r,i,a,o){var s=Il([t,n,r,i,a,o]),c=e.GRAD_COL_FUNCTIONS[s];return c||=e.GRAD_COL_FUNCTIONS[s]=e.attach(new F({FunctionType:2,Domain:[0,1],Range:[0,1,0,1,0,1],N:1,C0:[t,n,r],C1:[i,a,o]})),c}function Rl(e,t,n){var r=Il([t,n]),i=e.GRAD_OPC_FUNCTIONS[r];return i||=e.GRAD_OPC_FUNCTIONS[r]=e.attach(new F({FunctionType:2,Domain:[0,1],Range:[0,1],N:1,C0:[t],C1:[n]})),i}function zl(e,t){var n=!1,r=[],i=[],a=[],o=[],s,c,l,u,d;for(s=1;s<t.length;++s)c=t[s-1],l=t[s],u=c.color,d=l.color,i.push(Ll(e,u.r,u.g,u.b,d.r,d.g,d.b)),(u.a<1||d.a<1)&&(n=!0),a.push(l.offset),o.push(0,1);if(n)for(s=1;s<t.length;++s)c=t[s-1],l=t[s],u=c.color,d=l.color,r.push(Rl(e,u.a,d.a));return a.pop(),{hasAlpha:n,colors:f(i),opacities:n?f(r):null};function f(e){return e.length==1?e[0]:{FunctionType:3,Functions:e,Domain:[0,1],Bounds:a,Encode:o}}}function Bl(e,t,n,r,i,a){var o,s;if(!a){var c=[t].concat(r);n.forEach(function(e){c.push(e.offset,e.color.r,e.color.g,e.color.b)}),s=Il(c),o=e.GRAD_COL[s]}return o||(o=new F({Type:P(`Shading`),ShadingType:t?3:2,ColorSpace:P(`DeviceRGB`),Coords:r,Domain:[0,1],Function:i,Extend:[!0,!0]}),e.attach(o),o._resourceName=`S`+ ++yl,s&&(e.GRAD_COL[s]=o)),o}function Vl(e,t,n,r,i,a){var o,s;if(!a){var c=[t].concat(r);n.forEach(function(e){c.push(e.offset,e.color.a)}),s=Il(c),o=e.GRAD_OPC[s]}return o||(o=new F({Type:P(`ExtGState`),AIS:!1,CA:1,ca:1,SMask:{Type:P(`Mask`),S:P(`Luminosity`),G:e.attach(new Nl(`/a0 gs /s0 sh`,{Type:P(`XObject`),Subtype:P(`Form`),FormType:1,BBox:a?[a.left,a.top+a.height,a.left+a.width,a.top]:[0,1,1,0],Group:{Type:P(`Group`),S:P(`Transparency`),CS:P(`DeviceGray`),I:!0},Resources:{ExtGState:{a0:{CA:1,ca:1}},Shading:{s0:{ColorSpace:P(`DeviceGray`),Coords:r,Domain:[0,1],ShadingType:t?3:2,Function:i,Extend:[!0,!0]}}}}))}}),e.attach(o),o._resourceName=`O`+ ++yl,s&&(e.GRAD_OPC[s]=o)),o}function Hl(e,t,n){var r=t.type==`radial`,i=zl(e,t.stops),a=r?[t.start.x,t.start.y,t.start.r,t.end.x,t.end.y,t.end.r]:[t.start.x,t.start.y,t.end.x,t.end.y],o=Bl(e,r,t.stops,a,i.colors,t.userSpace&&n),s=i.hasAlpha?Vl(e,r,t.stops,a,i.opacities,t.userSpace&&n):null;return{hasAlpha:i.hasAlpha,shading:o,opacity:s}}var Ul=class extends F{constructor(e,t){super(t),this._pdf=e,this._rcount=0,this._textMode=!1,this._fontResources={},this._gsResources={},this._xResources={},this._patResources={},this._shResources={},this._opacity=1,this._matrix=[1,0,0,1,0,0],this._annotations=[],this._font=null,this._fontSize=null,this._contextStack=[],t=this.props,t.Type=P(`Page`),t.ProcSet=[P(`PDF`),P(`Text`),P(`ImageB`),P(`ImageC`),P(`ImageI`)],t.Resources=new F({Font:new F(this._fontResources),ExtGState:new F(this._gsResources),XObject:new F(this._xResources),Pattern:new F(this._patResources),Shading:new F(this._shResources)}),t.Annots=this._annotations}_out(){this._content.data.apply(null,arguments)}transform(e,t,n,r,i,a){Zl(arguments)||(this._matrix=Xl(arguments,this._matrix),this._out(e,` `,t,` `,n,` `,r,` `,i,` `,a,` cm`),this._out(`
`))}translate(e,t){this.transform(1,0,0,1,e,t)}scale(e,t){this.transform(e,0,0,t,0,0)}rotate(e){var t=Math.cos(e),n=Math.sin(e);this.transform(t,n,-n,t,0,0)}beginText(){this._textMode=!0,this._out(`BT`,`
`)}endText(){this._textMode=!1,this._out(`ET`,`
`)}_requireTextMode(){if(!this._textMode)throw Error(`Text mode required; call page.beginText() first`)}_requireFont(){if(!this._font)throw Error(`No font selected; call page.setFont() first`)}setFont(e,t){this._requireTextMode(),e==null?e=this._font:e instanceof Pl||(e=this._pdf.getFont(e)),t??=this._fontSize,this._fontResources[e._resourceName]=e,this._font=e,this._fontSize=t,this._out(e._resourceName,` `,t,` Tf`,`
`)}setTextLeading(e){this._requireTextMode(),this._out(e,` TL`,`
`)}setTextRenderingMode(e){this._requireTextMode(),this._out(e,` Tr`,`
`)}showText(e,t){if(this._requireFont(),e.length>1&&t&&this._font instanceof Pl){var n=t/this._font.getTextWidth(this._fontSize,e)*100;this._out(n,` Tz `)}this._out(this._font.encodeText(e),` Tj`,`
`)}showTextNL(e){this._requireFont(),this._out(this._font.encodeText(e),` '`,`
`)}addLink(e,t){var n=this._toPage({x:t.left,y:t.bottom}),r=this._toPage({x:t.right,y:t.top});this._annotations.push(new F({Type:P(`Annot`),Subtype:P(`Link`),Rect:[n.x,n.y,r.x,r.y],Border:[0,0,0],A:new F({Type:P(`Action`),S:P(`URI`),URI:new Al(e)})}))}setStrokeColor(e,t,n){this._out(e,` `,t,` `,n,` RG`,`
`)}setOpacity(e){this.setFillOpacity(e),this.setStrokeOpacity(e),this._opacity*=e}setStrokeOpacity(e){if(e<1){var t=this._pdf.getOpacityGS(this._opacity*e,!0);this._gsResources[t._resourceName]=t,this._out(t._resourceName,` gs`,`
`)}}setFillColor(e,t,n){this._out(e,` `,t,` `,n,` rg`,`
`)}pattern(e,t,n){let r=this._pdf.getPattern(e,this,n);this._patResources[r._resourceName]=r,this._out(`/Pattern cs`,`
`),this._out(r._resourceName,` scn`,`
`),this.rect(t.left,t.top,t.width,t.height),this.fill()}setFillOpacity(e){if(e<1){var t=this._pdf.getOpacityGS(this._opacity*e,!1);this._gsResources[t._resourceName]=t,this._out(t._resourceName,` gs`,`
`)}}gradient(e,t){this.save(),this.rect(t.left,t.top,t.width,t.height),this.clip(),e.userSpace||this.transform(t.width,0,0,t.height,t.left,t.top);var n=Hl(this._pdf,e,t),r=n.shading._resourceName,i;this._shResources[r]=n.shading,n.hasAlpha&&(i=n.opacity._resourceName,this._gsResources[i]=n.opacity,this._out(`/`+i+` gs `)),this._out(`/`+r+` sh`,`
`),this.restore()}setDashPattern(e,t){this._out(e,` `,t,` d`,`
`)}setLineWidth(e){this._out(e,` w`,`
`)}setLineCap(e){this._out(e,` J`,`
`)}setLineJoin(e){this._out(e,` j`,`
`)}setMitterLimit(e){this._out(e,` M`,`
`)}save(){this._contextStack.push(this._context()),this._out(`q`,`
`)}restore(){this._out(`Q`,`
`),this._context(this._contextStack.pop())}moveTo(e,t){this._out(e,` `,t,` m`,`
`)}lineTo(e,t){this._out(e,` `,t,` l`,`
`)}bezier(e,t,n,r,i,a){this._out(e,` `,t,` `,n,` `,r,` `,i,` `,a,` c`,`
`)}bezier1(e,t,n,r){this._out(e,` `,t,` `,n,` `,r,` y`,`
`)}bezier2(e,t,n,r){this._out(e,` `,t,` `,n,` `,r,` v`,`
`)}close(){this._out(`h`,`
`)}rect(e,t,n,r){this._out(e,` `,t,` `,n,` `,r,` re`,`
`)}ellipse(e,t,n,r){function i(t){return e+t}function a(e){return t+e}var o=.5522847498307936;this.moveTo(i(0),a(r)),this.bezier(i(n*o),a(r),i(n),a(r*o),i(n),a(0)),this.bezier(i(n),a(-r*o),i(n*o),a(-r),i(0),a(-r)),this.bezier(i(-n*o),a(-r),i(-n),a(-r*o),i(-n),a(0)),this.bezier(i(-n),a(r*o),i(-n*o),a(r),i(0),a(r))}circle(e,t,n){this.ellipse(e,t,n,n)}stroke(){this._out(`S`,`
`)}nop(){this._out(`n`,`
`)}clip(){this._out(`W n`,`
`)}clipStroke(){this._out(`W S`,`
`)}closeStroke(){this._out(`s`,`
`)}fill(){this._out(`f`,`
`)}fillStroke(){this._out(`B`,`
`)}drawImage(e){var t=this._pdf.getImage(e);t&&(this._xResources[t._resourceName]=t,this._out(t._resourceName,` Do`,`
`))}comment(e){var t=this;e.split(/\r?\n/g).forEach(function(e){t._out(`% `,e,`
`)})}_context(e){if(e!=null)this._opacity=e.opacity,this._matrix=e.matrix;else return{opacity:this._opacity,matrix:this._matrix}}_toPage(e){var t=this._matrix,n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5];return{x:n*e.x+i*e.y+o,y:r*e.x+a*e.y+s}}};function Wl(e){return e.replace(/^\s*(['"])(.*)\1\s*$/,`$2`)}function Gl(e){var t=/^\s*((normal|italic)\s+)?(([a-z0-9-]+)\s+)?((normal|bold|\d+)\s+)?(([0-9.]+)(px|pt))(\/(([0-9.]+)(px|pt)|normal))?\s+(.*?)\s*$/i.exec(e);if(!t)return{fontSize:12,fontFamily:`sans-serif`};var n=t[8]?parseInt(t[8],10):12;return{italic:t[2]&&t[2].toLowerCase()==`italic`,variant:t[4],bold:t[6]&&/bold|[6789]00/i.test(t[6]),fontSize:n,lineHeight:t[12]?t[12]==`normal`?n:parseInt(t[12],10):null,fontFamily:t[14].split(/\s*,\s*/g).map(Wl)}}function Kl(e){function t(t){return e.bold&&(t+=`|bold`),e.italic&&(t+=`|italic`),t.toLowerCase()}var n=e.fontFamily,r,i;if(n instanceof Array)for(var a=0;a<n.length&&(r=t(n[a]),i=ql[r],!i);++a);else i=ql[n.toLowerCase()];for(;typeof i==`function`;)i=i();return i||=`Times-Roman`,i}var ql={serif:`Times-Roman`,"serif|bold":`Times-Bold`,"serif|italic":`Times-Italic`,"serif|bold|italic":`Times-BoldItalic`,"sans-serif":`Helvetica`,"sans-serif|bold":`Helvetica-Bold`,"sans-serif|italic":`Helvetica-Oblique`,"sans-serif|bold|italic":`Helvetica-BoldOblique`,monospace:`Courier`,"monospace|bold":`Courier-Bold`,"monospace|italic":`Courier-Oblique`,"monospace|bold|italic":`Courier-BoldOblique`,zapfdingbats:`ZapfDingbats`,"zapfdingbats|bold":`ZapfDingbats`,"zapfdingbats|italic":`ZapfDingbats`,"zapfdingbats|bold|italic":`ZapfDingbats`};function Jl(e,t){e=e.toLowerCase(),ql[e]=function(){return ql[t]},ql[e+`|bold`]=function(){return ql[t+`|bold`]},ql[e+`|italic`]=function(){return ql[t+`|italic`]},ql[e+`|bold|italic`]=function(){return ql[t+`|bold|italic`]}}Jl(`Times New Roman`,`serif`),Jl(`Courier New`,`monospace`),Jl(`Arial`,`sans-serif`),Jl(`Helvetica`,`sans-serif`),Jl(`Verdana`,`sans-serif`),Jl(`Tahoma`,`sans-serif`),Jl(`Georgia`,`sans-serif`),Jl(`Monaco`,`monospace`),Jl(`Andale Mono`,`monospace`);function Yl(e,t){if(arguments.length==1)for(var n in e)wl(e,n)&&Yl(n,e[n]);else switch(e=e.toLowerCase(),ql[e]=t,e){case`dejavu sans`:ql[`sans-serif`]=t;break;case`dejavu sans|bold`:ql[`sans-serif|bold`]=t;break;case`dejavu sans|italic`:ql[`sans-serif|italic`]=t;break;case`dejavu sans|bold|italic`:ql[`sans-serif|bold|italic`]=t;break;case`dejavu serif`:ql.serif=t;break;case`dejavu serif|bold`:ql[`serif|bold`]=t;break;case`dejavu serif|italic`:ql[`serif|italic`]=t;break;case`dejavu serif|bold|italic`:ql[`serif|bold|italic`]=t;break;case`dejavu mono`:ql.monospace=t;break;case`dejavu mono|bold`:ql[`monospace|bold`]=t;break;case`dejavu mono|italic`:ql[`monospace|italic`]=t;break;case`dejavu mono|bold|italic`:ql[`monospace|bold|italic`]=t;break}}function Xl(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=t[0],l=t[1],u=t[2],d=t[3],f=t[4],p=t[5];return[n*c+r*u,n*l+r*d,i*c+a*u,i*l+a*d,o*c+s*u+f,o*l+s*d+p]}function Zl(e){return e[0]===1&&e[1]===0&&e[2]===0&&e[3]===1&&e[4]===0&&e[5]===0}let Ql={fill:0,stroke:1,fillAndStroke:2,invisible:3,fillAndClip:4,strokeAndClip:5,fillStrokeClip:6,clip:7},$l={dash:[4],dashDot:[4,2,1,2],dot:[1,2],longDash:[8,2],longDashDot:[8,2,1,2],longDashDotDot:[8,2,1,2,1,2],solid:[]},eu={butt:0,round:1,square:2},tu={miter:0,round:1,bevel:2};function nu(e,t){var n=e[t.nodeType];return n?n.call.apply(n,arguments):t}function ru(e,t,n){e.options._pdfDebug&&t.comment(`BEGIN: `+e.options._pdfDebug);var r=e.transform(),i=e.opacity();if(t.save(),i!=null&&i<1&&t.setOpacity(i),iu(e,t,n),au(e,t,n),r){var a=r.matrix();t.transform(a.a,a.b,a.c,a.d,a.e,a.f)}ou(e,t,n),nu({Path:pu,MultiPath:mu,Circle:hu,Arc:gu,Text:_u,Image:bu,Group:yu,Rect:xu},e,t,n),t.restore(),e.options._pdfDebug&&t.comment(`END: `+e.options._pdfDebug)}function iu(e,t){var n=e.stroke&&e.stroke();if(n){var r=n.color;if(r){if(r=Su(r),r==null)return;t.setStrokeColor(r.r,r.g,r.b),r.a!=1&&t.setStrokeOpacity(r.a)}var i=n.width;if(i!=null){if(i===0)return;t.setLineWidth(i)}var a=n.dashType;a&&t.setDashPattern($l[a],0);var o=n.lineCap;o&&t.setLineCap(eu[o]);var s=n.lineJoin;s&&t.setLineJoin(tu[s]);var c=n.opacity;c!=null&&t.setStrokeOpacity(c)}}function au(e,t){var n=e.fill&&e.fill();if(n&&!(n instanceof wr||n instanceof Or)){var r=n.color;if(r){if(r=Su(r),r==null)return;t.setFillColor(r.r,r.g,r.b),r.a!=1&&t.setFillOpacity(r.a)}var i=n.opacity;i!=null&&t.setFillOpacity(i)}}function ou(e,t,n){var r=e.clip();r&&(fu(r,t,n),t.clip())}function su(e){return e&&(e instanceof wr||e instanceof Or||e.color&&!/^(none|transparent)$/i.test(e.color)&&(e.width==null||e.width>0)&&(e.opacity==null||e.opacity>0))}function cu(e,t,n,r){var i=e.fill();if(i instanceof wr){r?t.clipStroke():t.clip();var a=i instanceof Dr,o,s;a?(o={x:i.center().x,y:i.center().y,r:0},s={x:i.center().x,y:i.center().y,r:i.radius()}):(o={x:i.start().x,y:i.start().y},s={x:i.end().x,y:i.end().y});var c=i.stops.elements().map(function(e){var t=e.offset();t=/%$/.test(t)?parseFloat(t)/100:parseFloat(t);var n=Su(e.color());return n.a*=e.opacity(),{offset:t,color:n}});c.unshift(c[0]),c.push(c[c.length-1]);var l={userSpace:i.userSpace(),type:a?`radial`:`linear`,start:o,end:s,stops:c},u=e.rawBBox(),d=u.topLeft(),f=u.getSize();return u={left:d.x,top:d.y,width:f.width,height:f.height},t.gradient(l,u),!0}}function lu(e,t,n,r){let i=e.fill();if(i instanceof Or){r?t.clipStroke():t.clip();let n=e.rawBBox(),a=n.topLeft(),o=n.getSize(),s=e.stroke()?e.stroke().width:0;return t.pattern(i,{left:a.x+s/2,top:a.y+s/2,width:o.width-s,height:o.height-s},vu),!0}}function uu(e,t,n){su(e.fill())&&su(e.stroke())?!cu(e,t,n,!0)&&!lu(e,t,n,!0)&&t.fillStroke():su(e.fill())?!cu(e,t,n,!1)&&!lu(e,t,n,!1)&&t.fill():su(e.stroke())?t.stroke():t.nop()}function du(e,t){var n=e.segments;if(n.length==4&&e.options.closed){for(var r=[],i=0;i<n.length;++i){if(n[i].controlIn())return!1;r[i]=n[i].anchor()}if(r[0].y==r[1].y&&r[1].x==r[2].x&&r[2].y==r[3].y&&r[3].x==r[0].x||r[0].x==r[1].x&&r[1].y==r[2].y&&r[2].x==r[3].x&&r[3].y==r[0].y)return t.rect(r[0].x,r[0].y,r[2].x-r[0].x,r[2].y-r[0].y),!0}}function fu(e,t,n){var r=e.segments;if(r.length!==0&&!du(e,t,n)){for(var i,a=0;a<r.length;++a){var o=r[a],s=o.anchor();if(!i)t.moveTo(s.x,s.y);else{var c=i.controlOut(),l=o.controlIn();c&&l?t.bezier(c.x,c.y,l.x,l.y,s.x,s.y):t.lineTo(s.x,s.y)}i=o}e.options.closed&&t.close()}}function pu(e,t,n){fu(e,t,n),uu(e,t,n)}function mu(e,t,n){for(var r=e.paths,i=0;i<r.length;++i)fu(r[i],t,n);uu(e,t,n)}function hu(e,t,n){var r=e.geometry();t.circle(r.center.x,r.center.y,r.radius),uu(e,t,n)}function gu(e,t,n){var r=e.geometry().curvePoints();t.moveTo(r[0].x,r[0].y);for(var i=1;i<r.length;)t.bezier(r[i].x,r[i++].y,r[i].x,r[i++].y,r[i].x,r[i++].y);uu(e,t,n)}function _u(e,t){var n=Gl(e.options.font),r=e._position,i;t.transform(1,0,0,-1,r.x,r.y+n.fontSize);let a=r=>{t.beginText(),t.setFont(Kl(n),n.fontSize),t.setTextRenderingMode(r),t.showText(e.content(),e._pdfRect?e._pdfRect.width():null)};e.fill()&&e.stroke()?(i=Ql.fillAndStroke,e.options.paintOrder===`stroke`&&(a(Ql.stroke),i=Ql.fill)):e.fill()?i=Ql.fill:e.stroke()&&(i=Ql.stroke),a(i),t.endText()}function vu(e,t,n){for(var r=e.children,i=0;i<r.length;++i)ru(r[i],t,n)}function yu(e,t,n){e._pdfLink&&t.addLink(e._pdfLink.url,e._pdfLink);for(var r=e.children,i=0;i<r.length;++i)ru(r[i],t,n)}function bu(e,t){var n=e.src();if(n){var r=e.rect(),i=r.getOrigin(),a=r.getSize();t.transform(a.width,0,0,-a.height,i.x,i.y+a.height),t.drawImage(n)}}function xu(e,t,n){var r=e.geometry();let[i,a]=r.cornerRadius;i===0&&a===0?(t.rect(r.origin.x,r.origin.y,r.size.width,r.size.height),uu(e,t,n)):pu(j.fromRect(r,e.options),t,n)}function Su(e){var t=se(e,!0);return t?t.toRGB():null}let Cu=x.browser||{};function wu(e){return Array.prototype.slice.call(e)}var Tu=`KENDO-PSEUDO-ELEMENT`;let Eu=`data-kendo-bullet-type`;var Du={},I={};I._root=I;let Ou=typeof window<`u`?Cu.msie||Cu.edge:!1;var ku=class extends sr{constructor(e,t,n){super(e,t.getOrigin(),n),this._pdfRect=t}rect(){return this._pdfRect}rawBBox(){return this._pdfRect}},Au=typeof Element<`u`&&Element.prototype&&(function(e){return e.matches?function(e,t){return e.matches(t)}:e.webkitMatchesSelector?function(e,t){return e.webkitMatchesSelector(t)}:e.mozMatchesSelector?function(e,t){return e.mozMatchesSelector(t)}:e.msMatchesSelector?function(e,t){return e.msMatchesSelector(t)}:function(e){return[].indexOf.call(document.querySelectorAll(e),this)!==-1}})(Element.prototype);(function(e){return e?function t(n){var r=n.cloneNode(!1);if(n.nodeType==1){var i=e(n),a=e(r),o,s=i.data();for(o in s)a.data(o,s[o]);for(/^canvas$/i.test(n.tagName)?r.getContext(`2d`).drawImage(n,0,0):/^(?:input|select|textarea|option)$/i.test(n.tagName)?(r.removeAttribute(`id`),r.removeAttribute(`name`),/^textarea$/i.test(n.tagName)||(r.value=n.value),r.checked=n.checked,r.selected=n.selected):/^img$/i.test(n.tagName)&&r.removeAttribute(`loading`),n._kendoExportVisual&&(r._kendoExportVisual=n._kendoExportVisual),o=n.firstChild;o;o=o.nextSibling)r.appendChild(t(o))}return r}:function(e){let t=(function e(t){let n=t.cloneNode(!1);t._kendoExportVisual&&(n._kendoExportVisual=t._kendoExportVisual);for(let r=t.firstChild;r;r=r.nextSibling)n.appendChild(e(r));return n})(e),n=e.querySelectorAll(`canvas`);n.length&&wu(t.querySelectorAll(`canvas`)).forEach((e,t)=>{e.getContext(`2d`).drawImage(n[t],0,0)});let r=e.querySelectorAll(`input, select, textarea, option`);return wu(t.querySelectorAll(`input, select, textarea, option`)).forEach((e,t)=>{e.removeAttribute(`id`),e.removeAttribute(`name`),/^textarea$/i.test(e.tagName)||(e.value=r[t].value),e.checked=r[t].checked,e.selected=r[t].selected}),wu(t.querySelectorAll(`img`)).forEach(e=>{e.removeAttribute(`loading`)}),t}})(typeof window<`u`&&window.kendo&&window.kendo.jQuery);function ju(e){var t=new ur;return I._clipbox=!1,I._matrix=$e.unit(),I._stackingContext={element:e,group:t},Wu(e,Yu(e),t),e.firstChild.nodeType==3?Od(e,e.firstChild,t):gd(e,t),Gu(),t}var Mu=(function(){var e=/^((-webkit-|-moz-|-o-|-ms-)?linear-gradient\s*)\(/,t=/^([-0-9.]+%)/,n=/^([-0-9.]+px)/,r=/^(left|right|top|bottom|to|center)\W/,i=/^([-0-9.]+(deg|grad|rad|turn)|0)/,a=/^(\s+)/,o=/^(\()/,s=/^(\))/,c=/^(,)/,l=/^(url)\(/,u=/^(.*?)\)/,d={},f={};function p(f){var p=f;if(Fu(d,p))return d[p];function m(){var e=a.exec(f);e&&(f=f.substr(e[1].length))}function h(e){m();var t=e.exec(f);if(t)return f=f.substr(t[1].length),t[1]}function g(){var e=se(f,!0),r,i;if(e){let a=/^#[0-9a-f]+/i.exec(f)||/^rgba?\(.*?\)/i.exec(f)||/^..*?\b/.exec(f);return f=f.substr(a[0].length),e=e.toRGB(),(r=h(n))||(i=h(t)),{color:e,length:r,percent:i}}}function _(e){var n,a,l,u=[],d=!1;if(h(o)){if(n=h(i),n==`0`&&(n=`0deg`),n?(n=id(n),h(c)):(a=h(r),a==`to`?a=h(r):a&&/^-/.test(e)&&(d=!0),l=h(r),h(c)),/-moz-/.test(e)&&n==null&&a==null){var p=h(t),m=h(t);d=!0,p==`0%`?a=`left`:p==`100%`&&(a=`right`),m==`0%`?l=`top`:m==`100%`&&(l=`bottom`),h(c)}for(;f&&!h(s);){var _=g();if(!_)break;u.push(_),h(c)}return{type:`linear`,angle:n,to:a&&l?a+` `+l:a||l||null,stops:u,reverse:d}}}function v(){if(h(o)){var e=h(u);return e=e.replace(/^['"]+|["']+$/g,``),h(s),{type:`url`,url:e}}}var y;return(y=h(e))?y=_(y):(y=h(l))&&(y=v()),d[p]=y||{type:`none`}}return function(e){return Fu(f,e)?f[e]:f[e]=Nu(e).map(p)}})(),Nu=(function(){var e={};return function(t,n){n||=/^\s*,\s*/;var r=t+n;if(Fu(e,r))return e[r];var i=[],a=0,o=0,s=0,c=!1,l;function u(e){return l=e.exec(t.substr(o))}function d(e){return e.replace(/^\s+|\s+$/g,``)}for(;o<t.length;)!c&&u(/^[\(\[\{]/)?(s++,o++):!c&&u(/^[\)\]\}]/)?(s--,o++):!c&&u(/^[\"\']/)?(c=l[0],o++):c==`'`&&u(/^\\\'/)||c==`"`&&u(/^\\\"/)?o+=2:c==`'`&&u(/^\'/)||c==`"`&&u(/^\"/)?(c=!1,o++):u(n)?(!c&&!s&&o>a&&(i.push(d(t.substring(a,o))),a=o+l[0].length),o+=l[0].length):o++;return a<o&&i.push(d(t.substring(a,o))),e[r]=i}})(),Pu=(function(e){return function(t){var n=e[t];return n??=e[t]=pt(`Mapq`,{font:t}).height,n}})(Object.create(null));function Fu(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Iu(e){return e=`_counter_`+e,I[e]}function Lu(e){var t=[],n=I;for(e=`_counter_`+e;n;)Fu(n,e)&&t.push(n[e]),n=Object.getPrototypeOf(n);return t.reverse()}function Ru(e,t){var n=I;for(e=`_counter_`+e;n&&!Fu(n,e);)n=Object.getPrototypeOf(n);n||=I._root,n[e]=(n[e]||0)+(t??1)}function zu(e,t){e=`_counter_`+e,I[e]=t??0}function Bu(e,t,n){for(var r=0;r<e.length;){var i=e[r++],a=parseFloat(e[r]);isNaN(a)?t(i,n):(t(i,a),++r)}}function Vu(e){var t=L(e,`counter-reset`);t&&Bu(Nu(t,/^\s+/),zu,0);var n=L(e,`counter-increment`);n&&Bu(Nu(n,/^\s+/),Ru,1)}function Hu(e,t){var n=se(e,!0);return n&&(n=n.toRGB(),t?n=n.toCssRgba():n.a===0&&(n=null)),n}function Uu(e){var t=``;do{var n=e%26;t=String.fromCharCode(97+n)+t,e=Math.floor(e/26)}while(e>0);return t}function Wu(e,t,n){I=Object.create(I),I[e.tagName.toLowerCase()]={element:e,style:t};let r=L(t,`text-decoration`);if(r&&r!=`none`){let n=de(e,`text-decoration-color`);r.split(/\s+/g).forEach(function(e){if(!I[e]&&(I[e]=n,e==`underline`)){let e=L(t,`text-underline-offset`);e!=`auto`&&(I[`underline-offset`]=parseFloat(e))}})}Ju(t)&&(I._stackingContext={element:e,group:n})}function Gu(){I=Object.getPrototypeOf(I)}function Ku(e){if(I._clipbox!=null){var t=e.bbox(I._matrix);I._clipbox?I._clipbox=A.intersect(I._clipbox,t):I._clipbox=t}}function qu(){var e=I._clipbox;if(e==null)return!0;if(e)return e.width()===0||e.height()===0}function Ju(e){function t(t){return L(e,t)}if(t(`transform`)!=`none`||t(`position`)!=`static`||t(`z-index`)!=`auto`||t(`opacity`)<1)return!0}function Yu(e,t){return window.getComputedStyle(e,t||null)}function L(e,t,n){var r=e.getPropertyValue(t);return(r==null||r===``)&&(Cu.webkit?r=e.getPropertyValue(`-webkit-`+t):Cu.mozilla?r=e.getPropertyValue(`-moz-`+t):Cu.opera?r=e.getPropertyValue(`-o-`+t):Ou&&(r=e.getPropertyValue(`-ms-`+t))),arguments.length>2&&(r==null||r===``)?n:r}function Xu(e,t,n,r){e.setProperty(t,n,r),Cu.webkit?e.setProperty(`-webkit-`+t,n,r):Cu.mozilla?e.setProperty(`-moz-`+t,n,r):Cu.opera?e.setProperty(`-o-`+t,n,r):Ou&&(e.setProperty(`-ms-`+t,n,r),t=`ms`+t.replace(/(^|-)([a-z])/g,function(e,t,n){return t+n.toUpperCase()}),e[t]=n)}function Zu(e,t,n){return n=`border-`+n,{width:parseFloat(L(t,n+`-width`)),style:L(t,n+`-style`),color:de(e,n+`-color`)}}function Qu(e,t){var n=e.style.cssText,r=t();return Mt(e,n),r}function $u(e,t){var n=L(e,`border-`+t+`-radius`).split(/\s+/g).map(parseFloat);return n.length==1&&n.push(n[0]),cd({x:n[0],y:n[1]})}function ed(e){var t=e.getBoundingClientRect();return t=td(t,`border-*-width`,e),t=td(t,`padding-*`,e),t}function td(e,t,n){var r,i,a,o,s;return typeof t==`string`?(r=Yu(n),i=parseFloat(L(r,t.replace(`*`,`top`))),a=parseFloat(L(r,t.replace(`*`,`right`))),o=parseFloat(L(r,t.replace(`*`,`bottom`))),s=parseFloat(L(r,t.replace(`*`,`left`)))):typeof t==`number`&&(i=a=o=s=t),{top:e.top+i,right:e.right-a,bottom:e.bottom-o,left:e.left+s,width:e.right-e.left-a-s,height:e.bottom-e.top-o-i}}function nd(e){var t=L(e,`transform`);if(t==`none`)return null;var n=/^\s*matrix\(\s*(.*?)\s*\)\s*$/.exec(t);if(n){var r=L(e,`transform-origin`);return n=n[1].split(/\s*,\s*/g).map(parseFloat),r=r.split(/\s+/g).map(parseFloat),{matrix:n,origin:r}}}function rd(e){return 180*e/Math.PI%360}function id(e){var t=parseFloat(e);if(/grad$/.test(e))return Math.PI*t/200;if(/rad$/.test(e))return t;if(/turn$/.test(e))return Math.PI*t*2;if(/deg$/.test(e))return Math.PI*t/180}function ad(e,t){return t=new $e(t[0],t[1],t[2],t[3],t[4],t[5]),e.transform(t),t}function od(e,t){e.clip(t)}function sd(e,t,n,r){for(var i=new cn([t,n],r).curvePoints(),a=1;a<i.length;)e.curveTo(i[a++],i[a++],i[a++])}function cd(e){return(e.x<=0||e.y<=0)&&(e.x=e.y=0),e}function ld(e,t,n,r,i){var a=Math.max(0,t.x),o=Math.max(0,t.y),s=Math.max(0,n.x),c=Math.max(0,n.y),l=Math.max(0,r.x),u=Math.max(0,r.y),d=Math.max(0,i.x),f=Math.max(0,i.y),p=Math.min(e.width/(a+s),e.height/(c+u),e.width/(l+d),e.height/(f+o));return p<1&&(a*=p,o*=p,s*=p,c*=p,l*=p,u*=p,d*=p,f*=p),{tl:{x:a,y:o},tr:{x:s,y:c},br:{x:l,y:u},bl:{x:d,y:f}}}function ud(e,t,n){var r=Yu(e),i=$u(r,`top-left`),a=$u(r,`top-right`),o=$u(r,`bottom-left`),s=$u(r,`bottom-right`);if(n==`padding`||n==`content`){var c=Zu(e,r,`top`),l=Zu(e,r,`right`),u=Zu(e,r,`bottom`),d=Zu(e,r,`left`);if(i.x-=d.width,i.y-=c.width,a.x-=l.width,a.y-=c.width,s.x-=l.width,s.y-=u.width,o.x-=d.width,o.y-=u.width,n==`content`){var f=parseFloat(L(r,`padding-top`)),p=parseFloat(L(r,`padding-right`)),m=parseFloat(L(r,`padding-bottom`)),h=parseFloat(L(r,`padding-left`));i.x-=h,i.y-=f,a.x-=p,a.y-=f,s.x-=p,s.y-=m,o.x-=h,o.y-=m}}return typeof n==`number`&&(i.x-=n,i.y-=n,a.x-=n,a.y-=n,s.x-=n,s.y-=n,o.x-=n,o.y-=n),dd(t,i,a,s,o)}function dd(e,t,n,r,i){var a=ld(e,t,n,r,i),o=a.tl,s=a.tr,c=a.br,l=a.bl,u=new j({fill:null,stroke:null});return u.moveTo(e.left,e.top+o.y),o.x&&sd(u,e.left+o.x,e.top+o.y,{startAngle:-180,endAngle:-90,radiusX:o.x,radiusY:o.y}),u.lineTo(e.right-s.x,e.top),s.x&&sd(u,e.right-s.x,e.top+s.y,{startAngle:-90,endAngle:0,radiusX:s.x,radiusY:s.y}),u.lineTo(e.right,e.bottom-c.y),c.x&&sd(u,e.right-c.x,e.bottom-c.y,{startAngle:0,endAngle:90,radiusX:c.x,radiusY:c.y}),u.lineTo(e.left+l.x,e.bottom),l.x&&sd(u,e.left+l.x,e.bottom-l.y,{startAngle:90,endAngle:180,radiusX:l.x,radiusY:l.y}),u.close()}function fd(e,t){var n=String(parseFloat(e));switch(t){case`decimal-leading-zero`:return n.length<2&&(n=`0`+n),n;case`lower-roman`:return xe(e).toLowerCase();case`upper-roman`:return xe(e).toUpperCase();case`lower-latin`:case`lower-alpha`:return Uu(e-1);case`upper-latin`:case`upper-alpha`:return Uu(e-1).toUpperCase();default:return n}}function pd(e,t){function n(e,t,n){return n?(n=n.replace(/^\s*(["'])(.*)\1\s*$/,`$2`),Lu(e).map(function(e){return fd(e,t)}).join(n)):fd(Iu(e)||0,t)}var r=Nu(t,/^\s+/),i=[],a;return r.forEach(function(t){var r;(a=/^\s*(["'])(.*)\1\s*$/.exec(t))?i.push(a[2].replace(/\\([0-9a-f]{4})/gi,function(e,t){return String.fromCharCode(parseInt(t,16))})):(a=/^\s*counter\((.*?)\)\s*$/.exec(t))?(r=Nu(a[1]),i.push(n(r[0],r[1]))):(a=/^\s*counters\((.*?)\)\s*$/.exec(t))?(r=Nu(a[1]),i.push(n(r[0],r[2],r[1]))):(a=/^\s*attr\((.*?)\)\s*$/.exec(t))?i.push(e.getAttribute(a[1])||``):i.push(t)}),i.join(``)}function md(e){if(e.cssText)return e.cssText;for(var t=[],n=0;n<e.length;++n)t.push(e[n]+`: `+L(e,e[n]));return t.join(`;
`)}function hd(e,t){if(e.tagName==Tu){gd(e,t);return}let n=[];function r(t,r){let i=Yu(e,t),a=i.content;if(Vu(i),a&&a!=`normal`&&a!=`none`&&i.width!=`0px`){let t=e.ownerDocument.createElement(Tu);Mt(t,md(i)),t.textContent=pd(e,a),e.insertBefore(t,r),n.push(t)}}if(r(`:before`,e.firstChild),r(`:after`,null),n.length>0){let r=e.className;e.className+=` kendo-pdf-hide-pseudo-elements`,gd(e,t),e.className=r,n.forEach(function(t){e.removeChild(t)})}else gd(e,t)}function gd(e,t){var n=Yu(e),r=Zu(e,n,`top`),i=Zu(e,n,`right`),a=Zu(e,n,`bottom`),o=Zu(e,n,`left`),s=$u(n,`top-left`),c=$u(n,`top-right`),l=$u(n,`bottom-left`),u=$u(n,`bottom-right`),d=L(n,`direction`),f=Hu(de(e,`background-color`)),p=Mu(L(n,`background-image`)),m=Nu(L(n,`background-repeat`)),h=Nu(L(n,`background-position`)),g=Nu(L(n,`background-origin`)),_=Nu(L(n,`background-size`)),v,y;Ou&&(v=n.textOverflow,v==`ellipsis`&&(y=e.style.textOverflow,e.style.textOverflow=`clip`)),Cu.msie&&Cu.version<10&&(h=Nu(e.currentStyle.backgroundPosition));var b=td(e.getBoundingClientRect(),`border-*-width`,e);(function(){var e=L(n,`clip`),r=/^\s*rect\((.*)\)\s*$/.exec(e);if(r){var i=r[1].split(/[ ,]+/g),a=i[0]==`auto`?b.top:parseFloat(i[0])+b.top,o=i[1]==`auto`?b.right:parseFloat(i[1])+b.left,s=i[2]==`auto`?b.bottom:parseFloat(i[2])+b.top,c=i[3]==`auto`?b.left:parseFloat(i[3])+b.left,l=new ur,u=new j().moveTo(c,a).lineTo(o,a).lineTo(o,s).lineTo(c,s).close();od(l,u),t.append(l),t=l,Ku(u)}})();var x,S,C,w=L(n,`display`);if(w==`table-row`)for(x=[],S=0,C=e.children;S<C.length;++S)x.push(C[S].getBoundingClientRect());else x=e.getClientRects(),x.length==1&&(x=[e.getBoundingClientRect()]);for(x=T(x),S=0;S<x.length;++S)ne(x[S],S===0,S==x.length-1);if(e.tagName==`A`&&e.href&&!/^#?$/.test(e.getAttribute(`href`))&&(!I._avoidLinks||!Au(e,I._avoidLinks))){let n=document.createRange();n.selectNodeContents(e),wu(n.getClientRects()).forEach(function(n){let r=new ur;r._pdfLink={url:e.href,top:n.top,right:n.right,bottom:n.bottom,left:n.left},t.append(r)})}return x.length>0&&w==`list-item`&&!e.getAttribute(`kendo-no-bullet`)&&te(x[0]),(function(){function r(){var n=ud(e,b,`padding`),r=new ur;od(r,n),t.append(r),t=r,Ku(n)}(Sd(e)||/^(hidden|auto|scroll)/.test(L(n,`overflow`))||/^(hidden|auto|scroll)/.test(L(n,`overflow-x`))||/^(hidden|auto|scroll)/.test(L(n,`overflow-y`)))&&r()})(),!vd(e,t)&&!yd(e,t)&&Dd(e,t),Ou&&v==`ellipsis`&&(e.style.textOverflow=y),t;function T(t){if(/^td$/i.test(e.tagName)){var n=I.table;if(n&&L(n.style,`border-collapse`)==`collapse`){var r=Zu(n.element,n.style,`left`).width,i=Zu(n.element,n.style,`top`).width;if(r===0&&i===0)return t;var a=n.element.getBoundingClientRect(),o=n.element.rows[0].cells[0].getBoundingClientRect();if(o.top==a.top||o.left==a.left)return wu(t).map(function(e){return{left:e.left+r,top:e.top+i,right:e.right+r,bottom:e.bottom+i,height:e.height,width:e.width}})}}return t}function E(e,n,r,i,a,o,s,c){if(r<=0)return;var l,u=new ur;ad(u,c),t.append(u),cd(o),cd(s),l=new j({fill:{color:e},stroke:null}),u.append(l),l.moveTo(o.x?Math.max(o.x,i):0,0).lineTo(n-(s.x?Math.max(s.x,a):0),0).lineTo(n-Math.max(s.x,a),r).lineTo(Math.max(o.x,i),r).close(),o.x&&d(i,o,[-1,0,0,1,o.x,0]),s.x&&d(a,s,[1,0,0,1,n-s.x,0]);function d(t,n,i){var a=Math.PI/2*t/(t+r),o={x:n.x-t,y:n.y-r},s=new j({fill:{color:e},stroke:null}).moveTo(0,0);ad(s,i),sd(s,0,n.y,{startAngle:-90,endAngle:-rd(a),radiusX:n.x,radiusY:n.y}),o.x>0&&o.y>0?(s.lineTo(o.x*Math.cos(a),n.y-o.y*Math.sin(a)),sd(s,0,n.y,{startAngle:-rd(a),endAngle:-90,radiusX:o.x,radiusY:o.y,anticlockwise:!0})):o.x>0?s.lineTo(o.x,r).lineTo(0,r):s.lineTo(o.x,r).lineTo(o.x,0),u.append(s.close())}}function D(e){var n=new ur;if(od(n,dd(e,s,c,u,l)),t.append(n),f){var r=new j({fill:{color:f.toCssRgba()},stroke:null});r.moveTo(e.left,e.top).lineTo(e.right,e.top).lineTo(e.right,e.bottom).lineTo(e.left,e.bottom).close(),n.append(r)}for(var i=p.length;--i>=0;)ee(n,e,p[i],m[i%m.length],h[i%h.length],g[i%g.length],_[i%_.length])}function ee(t,n,r,i,a,o,s){if(!r||r==`none`)return;if(r.type==`url`){var c=Du[r.url];c&&c.width>0&&c.height>0&&l(t,n,c.width,c.height,function(e,t){e.append(new cr(r.url,t))})}else if(r.type==`linear`)l(t,n,n.width,n.height,_d(r));else return;function l(t,n,r,c,l){var u=r/c,d,f=n;if(o==`content-box`?(f=td(f,`border-*-width`,e),f=td(f,`padding-*`,e)):o==`padding-box`&&(f=td(f,`border-*-width`,e)),!/^\s*auto(\s+auto)?\s*$/.test(s))if(s==`contain`)d=Math.min(f.width/r,f.height/c),r*=d,c*=d;else if(s==`cover`)d=Math.max(f.width/r,f.height/c),r*=d,c*=d;else{var p=s.split(/\s+/g);r=/%$/.test(p[0])?f.width*parseFloat(p[0])/100:parseFloat(p[0]),c=p.length==1||p[1]==`auto`?r/u:/%$/.test(p[1])?f.height*parseFloat(p[1])/100:parseFloat(p[1])}var m=String(a);switch(m){case`bottom`:m=`50% 100%`;break;case`top`:m=`50% 0`;break;case`left`:m=`0 50%`;break;case`right`:m=`100% 50%`;break;case`center`:m=`50% 50%`;break}m=m.split(/\s+/),m.length==1&&(m[1]=`50%`),/%$/.test(m[0])?m[0]=parseFloat(m[0])/100*(f.width-r):m[0]=parseFloat(m[0]),/%$/.test(m[1])?m[1]=parseFloat(m[1])/100*(f.height-c):m[1]=parseFloat(m[1]);var h=new A([f.left+m[0],f.top+m[1]],[r,c]);function g(){for(;h.origin.x>n.left;)h.origin.x-=r}function _(){for(;h.origin.y>n.top;)h.origin.y-=c}function v(){for(;h.origin.x<n.right;)l(t,h.clone()),h.origin.x+=r}if(i==`no-repeat`)l(t,h);else if(i==`repeat-x`)g(),v();else if(i==`repeat-y`)for(_();h.origin.y<n.bottom;)l(t,h.clone()),h.origin.y+=c;else if(i==`repeat`){g(),_();for(var y=h.origin.clone();h.origin.y<n.bottom;)h.origin.x=y.x,v(),h.origin.y+=c}}}function te(){var r=L(n,`list-style-type`);if(r==`none`)return;var i=L(n,`list-style-position`);function a(n){Qu(e,function(){e.style.position=`relative`;var r=e.ownerDocument.createElement(Tu);r.style.position=`absolute`,r.style.boxSizing=`border-box`,i==`outside`?(r.style.width=`6em`,r.style.left=`-6.8em`,r.style.textAlign=`right`):r.style.left=`0px`,n(r),e.insertBefore(r,e.firstChild),Ad(r,t),e.removeChild(r)})}function o(t){var n=e.parentNode.children,r=e.getAttribute(`kendo-split-index`);if(r!=null)return t(r|0,n.length);for(var i=0;i<n.length;++i)if(n[i]===e)return t(i,n.length)}switch(r){case`circle`:case`disc`:case`square`:a(function(e){e.innerHTML=`&nbsp;`,e.setAttribute(Eu,r)});break;case`decimal`:case`decimal-leading-zero`:a(function(e){o(function(t){++t,r==`decimal-leading-zero`&&t<10&&(t=`0`+t),e.innerHTML=t+`.`})});break;case`lower-roman`:case`upper-roman`:a(function(e){o(function(t){t=xe(t+1),r==`upper-roman`&&(t=t.toUpperCase()),e.innerHTML=t+`.`})});break;case`lower-latin`:case`lower-alpha`:case`upper-latin`:case`upper-alpha`:a(function(e){o(function(t){t=Uu(t),/^upper/i.test(r)&&(t=t.toUpperCase()),e.innerHTML=t+`.`})});break}}function ne(n,f,p){if(n.width===0||n.height===0)return;D(n);var m=o.width>0&&(f&&d==`ltr`||p&&d==`rtl`),h=i.width>0&&(p&&d==`ltr`||f&&d==`rtl`);if(r.width===0&&o.width===0&&i.width===0&&a.width===0)return;if(r.color==i.color&&r.color==a.color&&r.color==o.color&&r.width==i.width&&r.width==a.width&&r.width==o.width&&m&&h){n=td(n,r.width/2);var g=ud(e,n,r.width/2);g.options.stroke={color:r.color,width:r.width},t.append(g);return}if(s.x===0&&c.x===0&&u.x===0&&l.x===0&&r.width<2&&o.width<2&&i.width<2&&a.width<2){r.width>0&&t.append(new j({stroke:{width:r.width,color:r.color}}).moveTo(n.left,n.top+r.width/2).lineTo(n.right,n.top+r.width/2)),a.width>0&&t.append(new j({stroke:{width:a.width,color:a.color}}).moveTo(n.left,n.bottom-a.width/2).lineTo(n.right,n.bottom-a.width/2)),m&&t.append(new j({stroke:{width:o.width,color:o.color}}).moveTo(n.left+o.width/2,n.top).lineTo(n.left+o.width/2,n.bottom)),h&&t.append(new j({stroke:{width:i.width,color:i.color}}).moveTo(n.right-i.width/2,n.top).lineTo(n.right-i.width/2,n.bottom));return}var _=ld(n,s,c,u,l),v=_.tl,y=_.tr,b=_.br,x=_.bl;E(r.color,n.width,r.width,o.width,i.width,v,y,[1,0,0,1,n.left,n.top]),E(a.color,n.width,a.width,i.width,o.width,b,x,[-1,0,0,-1,n.right,n.bottom]);function S(e){return{x:e.y,y:e.x}}E(o.color,n.height,o.width,a.width,r.width,S(x),S(v),[0,-1,1,0,n.left,n.bottom]),E(i.color,n.height,i.width,r.width,a.width,S(y),S(b),[0,1,-1,0,n.right,n.top])}}function _d(e){return function(t,n){var r=n.width(),i=n.height();switch(e.type){case`linear`:var a=e.angle==null?Math.PI:e.angle;switch(e.to){case`top`:a=0;break;case`left`:a=-Math.PI/2;break;case`bottom`:a=Math.PI;break;case`right`:a=Math.PI/2;break;case`top left`:case`left top`:a=-Math.atan2(i,r);break;case`top right`:case`right top`:a=Math.atan2(i,r);break;case`bottom left`:case`left bottom`:a=Math.PI+Math.atan2(i,r);break;case`bottom right`:case`right bottom`:a=Math.PI-Math.atan2(i,r);break}e.reverse&&(a-=Math.PI),a%=2*Math.PI,a<0&&(a+=2*Math.PI);var o=Math.abs(r*Math.sin(a))+Math.abs(i*Math.cos(a)),s=Math.atan(r*Math.tan(a)/i),c=Math.sin(s),l=Math.cos(s),u=Math.abs(c)+Math.abs(l),d=u/2*c,f=u/2*l;a>Math.PI/2&&a<=3*Math.PI/2&&(d=-d,f=-f);var p=[],m=0,h=e.stops.map(function(t,n){var r=t.percent;r?r=parseFloat(r)/100:t.length?r=parseFloat(t.length)/o:n===0?r=0:n==e.stops.length-1&&(r=1);var i={color:t.color.toCssRgba(),offset:r};return r==null?p.push({left:m,stop:i}):(m=r,p.forEach(function(e,t){var n=e.stop;n.offset=e.left+(m-e.left)*(t+1)/(p.length+1)}),p=[]),i}),g=[.5-d,.5+f],_=[.5+d,.5-f];t.append(j.fromRect(n).stroke(null).fill(new Er({start:g,end:_,stops:h,userSpace:!1})));break;case`radial`:window.console&&window.console.log&&window.console.log(`Radial gradients are not yet supported in HTML renderer`);break}}}function vd(e,t){let n=null;if(window.kendo&&window.kendo.jQuery&&e.getAttribute(window.kendo.attr(`role`))){let t=window.kendo.widgetInstance(window.kendo.jQuery(e));t&&(t.exportDOMVisual||t.exportVisual)&&(n=t.exportDOMVisual?t.exportDOMVisual():t.exportVisual())}if(n===null&&e._kendoExportVisual){let t=e.getBoundingClientRect(),r={width:t.width,height:t.height};n=e._kendoExportVisual(r)}if(!n)return!1;let r=new ur;r.children.push(n);let i=e.getBoundingClientRect();return r.transform(Ht().translate(i.left,i.top)),t.append(r),!0}function yd(e,t){let n=e.getAttribute(Eu);if(!n)return!1;var r=e.getBoundingClientRect();let i=de(e,`color`);if(n===`square`){let e=r.height/5;t.append(new _r(new A([r.right-e,r.top+r.height/2.1],[e,e])).fill(i).stroke(i))}else{let e=r.height/7,a=new tn(new Jt([r.right-e,r.top+(r.height+e)/2],e));n===`circle`?a.stroke(i,.5):a.fill(i).stroke(null),t.append(a)}return!0}function bd(e,t,n){var r=ed(e),i=new cr(t,new A([r.left,r.top],[r.width,r.height]));od(i,ud(e,r,`content`)),n.append(i)}function xd(e,t){var n=Yu(e),r=Yu(t),i=parseFloat(L(n,`z-index`)),a=parseFloat(L(r,`z-index`)),o=L(n,`position`),s=L(r,`position`);return isNaN(i)&&isNaN(a)?/static|absolute/.test(o)&&/static|absolute/.test(s)?0:o==`static`?-1:+(s==`static`):isNaN(i)?a===0?0:a>0?-1:1:isNaN(a)?i===0?0:i>0?1:-1:parseFloat(i)-parseFloat(a)}function Sd(e){return/^(?:textarea|select|input)$/i.test(e.tagName)}function Cd(e){return e.selectedOptions&&e.selectedOptions.length>0?e.selectedOptions[0]:e.options[e.selectedIndex]}function wd(e,t){Yu(e);var n=de(e,`color`),r=e.getBoundingClientRect();e.type==`checkbox`?(t.append(j.fromRect(new A([r.left+1,r.top+1],[r.width-2,r.height-2])).stroke(n,1)),e.checked&&t.append(new j().stroke(n,1.2).moveTo(r.left+.22*r.width,r.top+.55*r.height).lineTo(r.left+.45*r.width,r.top+.75*r.height).lineTo(r.left+.78*r.width,r.top+.22*r.width))):(t.append(new tn(new Jt([(r.left+r.right)/2,(r.top+r.bottom)/2],Math.min(r.width-2,r.height-2)/2)).stroke(n,1)),e.checked&&t.append(new tn(new Jt([(r.left+r.right)/2,(r.top+r.bottom)/2],Math.min(r.width-8,r.height-8)/2)).fill(n).stroke(null)))}function Td(e,t){var n=e.tagName.toLowerCase();if(n==`input`&&(e.type==`checkbox`||e.type==`radio`))return wd(e,t);var r=e.parentNode,i=e.ownerDocument,a=i.createElement(Tu),o;if(Mt(a,md(Yu(e))),n==`input`&&(a.style.whiteSpace=`pre`),(n==`select`||n==`textarea`)&&(a.style.overflow=`auto`),n==`select`)if(e.multiple)for(var s=0;s<e.options.length;++s)o=i.createElement(Tu),Mt(o,md(Yu(e.options[s]))),o.style.display=`block`,o.textContent=e.options[s].textContent,a.appendChild(o);else o=Cd(e),o&&(a.textContent=o.textContent);else a.textContent=e.value;r.insertBefore(a,e),a.scrollLeft=e.scrollLeft,a.scrollTop=e.scrollTop,e.style.display=`none`,Dd(a,t),e.style.display=``,r.removeChild(a)}function Ed(e){let t=new window.XMLSerializer,n=t.serializeToString(e);if(Cu.mozilla&&!(e.getAttribute(`width`)&&e.getAttribute(`height`))){let r=new window.DOMParser().parseFromString(n,`image/svg+xml`).documentElement,i=ed(e);r.setAttribute(`width`,i.width),r.setAttribute(`height`,i.height),n=t.serializeToString(r)}return n}function Dd(e,t){switch(I._stackingContext.element===e&&(I._stackingContext.group=t),e.tagName.toLowerCase()){case`img`:bd(e,e.src,t);break;case`svg`:bd(e,`data:image/svg+xml;base64,${Fe(Ed(e))}`,t);break;case`canvas`:try{bd(e,e.toDataURL(`image/png`),t)}catch{}break;case`textarea`:case`input`:case`select`:Td(e,t);break;default:for(var n=[],r=[],i=[],a=e.firstChild;a;a=a.nextSibling)switch(a.nodeType){case 3:/\S/.test(a.data)&&Od(e,a,t);break;case 1:var o=Yu(a),s=L(o,`float`);L(o,`position`)==`static`?s==`none`?n.push(a):r.push(a):i.push(a);break}Ve(n,xd).forEach(function(e){Ad(e,t)}),Ve(r,xd).forEach(function(e){Ad(e,t)}),Ve(i,xd).forEach(function(e){Ad(e,t)})}}function Od(e,t,n){if(qu())return;var r=Yu(e);if(parseFloat(L(r,`text-indent`))<-500)return;var i=t.data,a=0,o=i.search(/\S\s*$/)+1;if(!o)return;var s=L(r,`font-size`),c=L(r,`line-height`),l=[L(r,`font-style`),L(r,`font-variant`),L(r,`font-weight`),s,L(r,`font-family`)].join(` `);if(s=parseFloat(s),c=parseFloat(c),s===0||isNaN(s))return;var u=de(e,`color`),d=e.ownerDocument.createRange(),f=L(r,`text-align`)==`justify`,p=L(r,`column-count`,1),m=L(r,`white-space`),h=L(r,`text-transform`),g=e.getBoundingClientRect().width/s*5;g===0&&(g=500);var _=null,v=I.underline,y=I[`line-through`],b=I.overline,x=I[`underline-offset`];for(v&&S(ee);!w(););(y||b)&&S(D);return;function S(e){d.selectNode(t);let n=wu(d.getClientRects());S=e=>n.forEach(e),S(e)}function C(e){if(Ou||Cu.chrome||Cu.safari){for(var t=e.getClientRects(),n={top:1/0,right:-1/0,bottom:-1/0,left:1/0},r=!1,i=0;i<t.length;++i){var a=t[i];a.width<=1||a.bottom===_||(n.left=Math.min(a.left,n.left),n.top=Math.min(a.top,n.top),n.right=Math.max(a.right,n.right),n.bottom=Math.max(a.bottom,n.bottom),r=!0)}return r?(n.width=n.right-n.left,n.height=n.bottom-n.top,n):e.getBoundingClientRect()}return e.getBoundingClientRect()}function w(){var e=a,n,r=i.substr(a).search(/\S/);if(a+=r,r<0||a>=o)return!0;d.setStart(t,a),d.setEnd(t,a+1),n=C(d);var s=!1;if((f||p>1)&&(r=i.substr(a).search(/\s/),r>=0)){d.setEnd(t,a+r);var c=C(d);c.bottom==n.bottom&&(n=c,s=!0,a+=r)}if(!s){if(r=(function e(r,i,a){d.setEnd(t,i);var o=C(d);return o.bottom!=n.bottom&&r<i?e(r,r+i>>1,i):o.right==n.right?i:(n=o,i<a?e(i,i+a>>1,a):i)})(a,Math.min(o,a+g),o),r==a)return!0;if(a=r,r=d.toString().search(/\s+$/),r===0)return!1;r>0&&(d.setEnd(t,d.startOffset+r),n=C(d))}Ou&&(n=d.getClientRects()[0]);var l=d.toString();if(!/^(?:pre|pre-wrap)$/i.test(m))l=l.replace(/\s+/g,` `);else if(/\t/.test(l)){var u=0;for(r=e;r<d.startOffset;++r){var h=i.charCodeAt(r);h==9?u+=8-u%8:h==10||h==13?u=0:u++}for(;(r=l.search(`	`))>=0;){var v=`        `.substr(0,8-(u+r)%8);l=l.substr(0,r)+v+l.substr(r+1)}}s||(_=n.bottom),T(l,n)}function T(e,t){if(Ou&&!isNaN(c)){var r=Pu(l),i=(t.top+t.bottom-r)/2;t={top:i,right:t.right,bottom:i+r,left:t.left,height:r,width:t.right-t.left}}switch(h){case`uppercase`:e=e.toUpperCase();break;case`lowercase`:e=e.toLowerCase();break;case`capitalize`:e=e.replace(/(?:^|\s)\S/g,e=>e.toUpperCase());break}var a=new ku(e,new A([t.left,t.top],[t.width,t.height]),{font:l,fill:{color:u}});n.append(a)}function E(e,t,r,i){if(r){var a=new j({stroke:{width:e,color:r}});i-=e,a.moveTo(t.left,i).lineTo(t.right,i),n.append(a)}}function D(e){let t=s/12;E(t,e,y,e.bottom-e.height/2.7),E(t,e,b,e.top)}function ee(e){let t=s/12,n=e.bottom;x==null?n+=t:n+=x,E(t,e,v,n)}}function kd(e,t,n){var r;n==`auto`?(r=t,n=0):(r=I._stackingContext.group,n=parseFloat(n));for(var i=r.children,a=0;a<i.length&&!(i[a]._dom_zIndex!=null&&i[a]._dom_zIndex>n);++a);var o=new ur;if(r.insert(a,o),o._dom_zIndex=n,r!==t&&I._clipbox){var s=I._matrix.invert(),c=I._clipbox.transformCopy(s);od(o,j.fromRect(c))}return o}function Ad(e,t){var n=Yu(e);if(Vu(n),!/^(style|script|link|meta|iframe|col|colgroup)$/i.test(e.tagName)&&I._clipbox!=null){var r=parseFloat(L(n,`opacity`)),i=L(n,`visibility`),a=L(n,`display`);if(r!==0&&i!=`hidden`&&a!=`none`){var o=nd(n),s,c=L(n,`z-index`);(o||r<1)&&c==`auto`&&(c=0),s=kd(e,t,c),r<1&&s.opacity(r*s.opacity()),Wu(e,n,s),o?Qu(e,function(){Xu(e.style,`transform`,`none`,`important`),Xu(e.style,`transition`,`none`,`important`),L(n,`position`)==`static`&&Xu(e.style,`position`,`relative`,`important`);var t=e.getBoundingClientRect(),r=t.left+o.origin[0],i=t.top+o.origin[1],a=[1,0,0,1,-r,-i];a=jd(a,o.matrix),a=jd(a,[1,0,0,1,r,i]),a=ad(s,a),I._matrix=I._matrix.multiplyCopy(a),hd(e,s)}):hd(e,s),Gu()}}}function jd(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=t[0],l=t[1],u=t[2],d=t[3],f=t[4],p=t[5];return[n*c+r*u,n*l+r*d,i*c+a*u,i*l+a*d,o*c+s*u+f,o*l+s*d+p]}let Md=e=>e?new Date(e.getTime()):null,Nd=(e,t)=>{let n=Md(e);return t===0&&n.getHours()===23&&n.setHours(n.getHours()+2),n},Pd=(e,t)=>{let n=Md(e);return n.setDate(n.getDate()+t),Nd(n,e.getHours())},Fd=(e,t,n,r=0,i=0,a=0,o=0)=>{let s=new Date(e,t,n,r,i,a,o);return e>-1&&e<100&&s.setFullYear(s.getFullYear()-1900),Nd(s,r)},Id=e=>{let t=Fd(e.getFullYear(),e.getMonth()+1,1,e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds());return Pd(t,-1)},Ld=(e,t)=>e.getMonth()===t?e:Id(Rd(e,-1)),Rd=(e,t)=>{let n=Md(e),r=(12+(n.getMonth()+t)%12)%12;return n.setMonth(n.getMonth()+t),Ld(Nd(n,e.getHours()),r)};var zd;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(zd||={});let Bd=(e,t,n=zd.Forward)=>{let r=Md(e),i=(t-r.getDay()+7*n)%7;return r.setDate(r.getDate()+i),Nd(r,e.getHours())};var Vd;(function(e){e[e.Sunday=0]=`Sunday`,e[e.Monday=1]=`Monday`,e[e.Tuesday=2]=`Tuesday`,e[e.Wednesday=3]=`Wednesday`,e[e.Thursday=4]=`Thursday`,e[e.Friday=5]=`Friday`,e[e.Saturday=6]=`Saturday`})(Vd||={});let Hd=e=>Fd(e.getFullYear(),e.getMonth(),1,e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),Ud=e=>Fd(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0);new Date().getTime();var Wd={Promise};let Gd={base64:!0,array:!0,string:!0,nodebuffer:!1,nodestream:!1,get arraybuffer(){return typeof ArrayBuffer<`u`&&typeof Uint8Array<`u`},get uint8array(){return typeof Uint8Array<`u`},get blob(){return Kd()}},Kd=function(){let e;if(typeof ArrayBuffer>`u`)e=!1;else{let t=new ArrayBuffer(0);try{e=new Blob([t],{type:`application/zip`}).size===0}catch{e=!1}}return Kd=()=>e,e},qd=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`,Jd=function(e){let t=[],n,r,i,a,o,s,c,l=0,u=e.length,d=u,f=typeof e!=`string`;for(;l<e.length;)d=u-l,f?(n=e[l++],r=l<u?e[l++]:0,i=l<u?e[l++]:0):(n=e.charCodeAt(l++),r=l<u?e.charCodeAt(l++):0,i=l<u?e.charCodeAt(l++):0),a=n>>2,o=(n&3)<<4|r>>4,s=d>1?(r&15)<<2|i>>6:64,c=d>2?i&63:64,t.push(qd.charAt(a)+qd.charAt(o)+qd.charAt(s)+qd.charAt(c));return t.join(``)},Yd=function(e){let t,n,r,i,a,o,s,c=0,l=0;if(e.substr(0,5)===`data:`)throw Error(`Invalid base64 input, it looks like a data url.`);e=e.replace(/[^A-Za-z0-9\+\/\=]/g,``);let u=e.length*3/4;if(e.charAt(e.length-1)===qd.charAt(64)&&u--,e.charAt(e.length-2)===qd.charAt(64)&&u--,u%1!=0)throw Error(`Invalid base64 input, bad content length.`);let d;for(d=Gd.uint8array?new Uint8Array(u|0):Array(u|0);c<e.length;)i=qd.indexOf(e.charAt(c++)),a=qd.indexOf(e.charAt(c++)),o=qd.indexOf(e.charAt(c++)),s=qd.indexOf(e.charAt(c++)),t=i<<2|a>>4,n=(a&15)<<4|o>>2,r=(o&3)<<6|s,d[l++]=t,o!==64&&(d[l++]=n),s!==64&&(d[l++]=r);return d};function Xd(e){var t=null;return t=Gd.uint8array?new Uint8Array(e.length):Array(e.length),$d(e,t)}let Zd=function(e,t){return df(`blob`),new Blob([e],{type:t})};function Qd(e){return e}function $d(e,t){for(var n=0;n<e.length;++n)t[n]=e.charCodeAt(n)&255;return t}function ef(e,t,n){var r=[],i=0,a=e.length;if(a<=n)return String.fromCharCode.apply(null,e);for(;i<a;)t===`array`?r.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+n,a)))):r.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+n,a)))),i+=n;return r.join(``)}function tf(e){for(var t=``,n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}let nf=()=>{let e;try{e=Gd.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{e=!1}return nf=()=>e,e};function rf(e){var t=65536,n=uf(e),r=!0;if(n===`uint8array`&&(r=nf()),r)for(;t>1;)try{return ef(e,n,t)}catch{t=Math.floor(t/2)}return tf(e)}let af=rf;function of(e,t){for(var n=0;n<e.length;n++)t[n]=e[n];return t}var sf={string:{string:Qd,array:function(e){return $d(e,Array(e.length))},arraybuffer:function(e){return sf.string.uint8array(e).buffer},uint8array:function(e){return $d(e,new Uint8Array(e.length))}},array:{string:rf,array:Qd,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)}},arraybuffer:{string:function(e){return rf(new Uint8Array(e))},array:function(e){return of(new Uint8Array(e),Array(e.byteLength))},arraybuffer:Qd,uint8array:function(e){return new Uint8Array(e)}},uint8array:{string:rf,array:function(e){return of(e,Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:Qd}};let cf=function(e,t){return t||=``,e?(df(e),sf[uf(t)][e](t)):t},lf=function(e){for(var t=e.split(`/`),n=[],r=0;r<t.length;r++){var i=t[r];i===`.`||i===``&&r!==0&&r!==t.length-1||(i===`..`?n.pop():n.push(i))}return n.join(`/`)},uf=function(e){if(typeof e==`string`)return`string`;if(Object.prototype.toString.call(e)===`[object Array]`)return`array`;if(Gd.uint8array&&e instanceof Uint8Array)return`uint8array`;if(Gd.arraybuffer&&e instanceof ArrayBuffer)return`arraybuffer`},df=function(e){if(!Gd[e.toLowerCase()])throw Error(e+` is not supported by this platform`)},ff=65535,pf=function(e){var t=``,n,r;for(r=0;r<(e||``).length;r++)n=e.charCodeAt(r),t+=`\\x`+(n<16?`0`:``)+n.toString(16).toUpperCase();return t},mf=function(e,t,n){setTimeout(function(){e.apply(n||null,t||[])},0)},hf=function(){var e={},t,n;for(t=0;t<arguments.length;t++)for(n in arguments[t])Object.hasOwnProperty.call(arguments[t],n)&&e[n]===void 0&&(e[n]=arguments[t][n]);return e},gf=function(e,t,n,r,i){return Wd.Promise.resolve(t).then(function(e){return Gd.blob&&(e instanceof Blob||[`[object File]`,`[object Blob]`].indexOf(Object.prototype.toString.call(e))!==-1)&&typeof FileReader<`u`?new Wd.Promise(function(t,n){var r=new FileReader;r.onload=function(e){t(e.target.result)},r.onerror=function(e){n(e.target.error)},r.readAsArrayBuffer(e)}):e}).then(function(t){var a=uf(t);return a?(a===`arraybuffer`?t=cf(`uint8array`,t):a===`string`&&(i?t=Yd(t):n&&r!==!0&&(t=Xd(t))),t):Wd.Promise.reject(Error(`Can't read the data of '`+e+`'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?`))})};var _f=class{constructor(e){this.name=e||`default`,this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}push(e){this.emit(`data`,e)}end(){if(this.isFinished)return!1;this.flush();try{this.emit(`end`),this.cleanUp(),this.isFinished=!0}catch(e){this.emit(`error`,e)}return!0}error(e){return this.isFinished?!1:(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit(`error`,e),this.previous&&this.previous.error(e),this.cleanUp()),!0)}on(e,t){return this._listeners[e].push(t),this}cleanUp(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]}emit(e,t){if(this._listeners[e])for(var n=0;n<this._listeners[e].length;n++)this._listeners[e][n].call(this,t)}pipe(e){return e.registerPrevious(this)}registerPrevious(e){if(this.isLocked)throw Error(`The stream '`+this+`' has already been used.`);this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on(`data`,function(e){t.processChunk(e)}),e.on(`end`,function(){t.end()}),e.on(`error`,function(e){t.error(e)}),this}pause(){return this.isPaused||this.isFinished?!1:(this.isPaused=!0,this.previous&&this.previous.pause(),!0)}resume(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var e=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e}flush(){}processChunk(e){this.push(e)}withStreamInfo(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this}mergeStreamInfo(){for(var e in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(e)&&(this.streamInfo[e]=this.extraStreamInfo[e])}lock(){if(this.isLocked)throw Error(`The stream '`+this+`' has already been used.`);this.isLocked=!0,this.previous&&this.previous.lock()}toString(){var e=`Worker `+this.name;return this.previous?this.previous+` -> `+e:e}};let vf=function(e){let t=Array(256);for(let e=0;e<256;e++)t[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;return t[254]=t[254]=1,vf=function(e){return t[e]},t[e]};var yf=function(e){var t,n,r,i,a,o=e.length,s=0;for(i=0;i<o;i++)n=e.charCodeAt(i),(n&64512)==55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)==56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=Gd.uint8array?new Uint8Array(s):Array(s),a=0,i=0;a<s;i++)n=e.charCodeAt(i),(n&64512)==55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)==56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|n&63):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|n&63):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|n&63);return t},bf=function(e,t){var n;for(t||=e.length,t>e.length&&(t=e.length),n=t-1;n>=0&&(e[n]&192)==128;)n--;return n<0||n===0?t:n+vf(e[n])>t?n:t},xf=function(e){var t,n,r,i,a=e.length,o=Array(a*2);for(n=0,t=0;t<a;){if(r=e[t++],r<128){o[n++]=r;continue}if(i=vf(r),i>4){o[n++]=65533,t+=i-1;continue}for(r&=i===2?31:i===3?15:7;i>1&&t<a;)r=r<<6|e[t++]&63,i--;if(i>1){o[n++]=65533;continue}r<65536?o[n++]=r:(r-=65536,o[n++]=55296|r>>10&1023,o[n++]=56320|r&1023)}return o.length!==n&&(o.subarray?o=o.subarray(0,n):o.length=n),af(o)};let Sf=function(e){return yf(e)},Cf=function(e){return e=cf(Gd.uint8array?`uint8array`:`array`,e),xf(e)};var wf=class extends _f{constructor(){super(`utf-8 decode`),this.leftOver=null}processChunk(e){var t=cf(Gd.uint8array?`uint8array`:`array`,e.data);if(this.leftOver&&this.leftOver.length){if(Gd.uint8array){var n=t;t=new Uint8Array(n.length+this.leftOver.length),t.set(this.leftOver,0),t.set(n,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var r=bf(t),i=t;r!==t.length&&(Gd.uint8array?(i=t.subarray(0,r),this.leftOver=t.subarray(r,t.length)):(i=t.slice(0,r),this.leftOver=t.slice(r,t.length))),this.push({data:Cf(i),meta:e.meta})}flush(){this.leftOver&&this.leftOver.length&&(this.push({data:Cf(this.leftOver),meta:{}}),this.leftOver=null)}},Tf=class extends _f{constructor(){super(`utf-8 encode`)}processChunk(e){this.push({data:Sf(e.data),meta:e.meta})}},Ef=class extends _f{constructor(e){super(`ConvertWorker to `+e),this.destType=e}processChunk(e){this.push({data:cf(this.destType,e.data),meta:e.meta})}};function Df(e,t,n){switch(e){case`blob`:return Zd(cf(`arraybuffer`,t),n);case`base64`:return Jd(t);default:return cf(e,t)}}function Of(e,t){var n,r=0,i=null,a=0;for(n=0;n<t.length;n++)a+=t[n].length;switch(e){case`string`:return t.join(``);case`array`:return Array.prototype.concat.apply([],t);case`uint8array`:for(i=new Uint8Array(a),n=0;n<t.length;n++)i.set(t[n],r),r+=t[n].length;return i;default:throw Error(`concat : unsupported type '`+e+`'`)}}function kf(e,t){return new Wd.Promise(function(n,r){var i=[],a=e._internalType,o=e._outputType,s=e._mimeType;e.on(`data`,function(e,n){i.push(e),t&&t(n)}).on(`error`,function(e){i=[],r(e)}).on(`end`,function(){try{n(Df(o,Of(a,i),s))}catch(e){r(e)}i=[]}).resume()})}var Af=class{constructor(e,t,n){var r=t;switch(t){case`blob`:case`arraybuffer`:r=`uint8array`;break;case`base64`:r=`string`;break}try{this._internalType=r,this._outputType=t,this._mimeType=n,df(r),this._worker=e.pipe(new Ef(r)),e.lock()}catch(e){this._worker=new _f(`error`),this._worker.error(e)}}accumulate(e){return kf(this,e)}on(e,t){var n=this;return e===`data`?this._worker.on(e,function(e){t.call(n,e.data,e.meta)}):this._worker.on(e,function(){mf(t,arguments,n)}),this}resume(){return mf(this._worker.resume,[],this._worker),this}pause(){return this._worker.pause(),this}},jf=Object.freeze({__proto__:null,base64:!1,binary:!1,comment:null,compression:null,compressionOptions:null,createFolders:!0,date:null,dir:!1,dosPermissions:null,unixPermissions:null}),Mf=class extends _f{constructor(e){super(`DataWorker`);var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type=``,this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=uf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}cleanUp(){super.cleanUp(),this.data=null}resume(){return super.resume()?(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,mf(this._tickAndRepeat,[],this)),!0):!1}_tickAndRepeat(){this._tickScheduled=!1,!(this.isPaused||this.isFinished)&&(this._tick(),this.isFinished||(mf(this._tickAndRepeat,[],this),this._tickScheduled=!0))}_tick(){if(this.isPaused||this.isFinished)return!1;var e=16384,t=null,n=Math.min(this.max,this.index+e);if(this.index>=this.max)return this.end();switch(this.type){case`string`:t=this.data.substring(this.index,n);break;case`uint8array`:t=this.data.subarray(this.index,n);break;case`array`:t=this.data.slice(this.index,n);break}return this.index=n,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})}},Nf=class extends _f{constructor(e){super(`DataLengthProbe for `+e),this.propName=e,this.withStreamInfo(e,0)}processChunk(e){if(e){let t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}super.processChunk(e)}};let Pf=function(){let e=[];for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return Pf=function(){return e},e};function Ff(e,t,n,r){let i=Pf(),a=r+n;e^=-1;for(let n=r;n<a;n++)e=e>>>8^i[(e^t[n])&255];return e^-1}function If(e,t,n,r){let i=Pf(),a=r+n;e^=-1;for(let n=r;n<a;n++)e=e>>>8^i[(e^t.charCodeAt(n))&255];return e^-1}function Lf(e,t){return e===void 0||!e.length?0:uf(e)===`string`?If(t|0,e,e.length,0):Ff(t|0,e,e.length,0)}var Rf=class extends _f{constructor(){super(`Crc32Probe`),this.withStreamInfo(`crc32`,0)}processChunk(e){this.streamInfo.crc32=Lf(e.data,this.streamInfo.crc32||0),this.push(e)}},zf=class{constructor(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}getContentWorker(){var e=new Mf(Wd.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new Nf(`data_length`)),t=this;return e.on(`end`,function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw Error(`Bug : uncompressed data size mismatch`)}),e}getCompressedWorker(){return new Mf(Wd.Promise.resolve(this.compressedContent)).withStreamInfo(`compressedSize`,this.compressedSize).withStreamInfo(`uncompressedSize`,this.uncompressedSize).withStreamInfo(`crc32`,this.crc32).withStreamInfo(`compression`,this.compression)}static createWorkerFrom(e,t,n){return e.pipe(new Rf).pipe(new Nf(`uncompressedSize`)).pipe(t.compressWorker(n)).pipe(new Nf(`compressedSize`)).withStreamInfo(`compression`,t)}},Bf=class{constructor(e,t,n){this.name=e,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=t,this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}}internalStream(e){var t=null,n=`string`;try{if(!e)throw Error(`No output type specified.`);n=e.toLowerCase();var r=n===`string`||n===`text`;(n===`binarystring`||n===`text`)&&(n=`string`),t=this._decompressWorker();var i=!this._dataBinary;i&&!r&&(t=t.pipe(new Tf)),!i&&r&&(t=t.pipe(new wf))}catch(e){t=new _f(`error`),t.error(e)}return new Af(t,n,``)}async(e,t){return this.internalStream(e).accumulate(t)}_compressWorker(e,t){if(this._data instanceof zf&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new Tf)),zf.createWorkerFrom(n,e,t)}_decompressWorker(){return this._data instanceof zf?this._data.getContentWorker():this._data instanceof _f?this._data:new Mf(this._data)}};let Vf=function(){let e=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Uint32Array<`u`?`uint8array`:`array`;Vf=function(){return e}};var Hf=class extends _f{constructor(e,t){super(`FlateWorker/`+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}processChunk(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(cf(Vf(),e.data),!1)}flush(){super.flush(),this._pako===null&&this._createPako(),this._pako.push([],!0)}cleanUp(){super.cleanUp(),this._pako=null}_createPako(){let e={raw:!0,level:this._pakoOptions.level||-1};this._pako=this._pakoAction===`Deflate`?new hl(e):new ps(e),this._pako.onData=e=>{this.push({data:e,meta:this.meta})}}},Uf={STORE:{magic:`\0\0`,compressWorker:function(){return new _f(`STORE compression`)},uncompressWorker:function(){return new _f(`STORE decompression`)}},DEFLATE:{magic:`\b\0`,compressWorker:function(e){return new Hf(`Deflate`,e)},uncompressWorker:function(){return new Hf(`Inflate`,{})}}};let Wf=`PK`,Gf=`PK`,Kf=`PK`,qf=`PK\x07`,Jf=`PK`;var R=function(e,t){var n=``,r;for(r=0;r<t;r++)n+=String.fromCharCode(e&255),e>>>=8;return n},Yf=function(e,t){var n=e;return e||(n=t?16893:33204),(n&65535)<<16},Xf=function(e,t){return(e||0)&63},Zf=function(e,t,n,r,i,a){var o=e.file,s=e.compression,c=a!==Sf,l=cf(`string`,a(o.name)),u=cf(`string`,Sf(o.name)),d=o.comment,f=cf(`string`,a(d)),p=cf(`string`,Sf(d)),m=u.length!==o.name.length,h=p.length!==d.length,g,_,v=``,y=``,b=``,x=o.dir,S=o.date,C={crc32:0,compressedSize:0,uncompressedSize:0};(!t||n)&&(C.crc32=e.crc32,C.compressedSize=e.compressedSize,C.uncompressedSize=e.uncompressedSize);var w=0;t&&(w|=8),!c&&(m||h)&&(w|=2048);var T=0,E=0;x&&(T|=16),i===`UNIX`?(E=798,T|=Yf(o.unixPermissions,x)):(E=20,T|=Xf(o.dosPermissions)),g=S.getUTCHours(),g<<=6,g|=S.getUTCMinutes(),g<<=5,g|=S.getUTCSeconds()/2,_=S.getUTCFullYear()-1980,_<<=4,_|=S.getUTCMonth()+1,_<<=5,_|=S.getUTCDate(),m&&(y=R(1,1)+R(Lf(l),4)+u,v+=`up`+R(y.length,2)+y),h&&(b=R(1,1)+R(Lf(f),4)+p,v+=`uc`+R(b.length,2)+b);var D=``;return D+=`
\0`,D+=R(w,2),D+=s.magic,D+=R(g,2),D+=R(_,2),D+=R(C.crc32,4),D+=R(C.compressedSize,4),D+=R(C.uncompressedSize,4),D+=R(l.length,2),D+=R(v.length,2),{fileRecord:Wf+D+l+v,dirRecord:Gf+R(E,2)+D+R(f.length,2)+`\0\0\0\0`+R(T,4)+R(r,4)+l+v+f}},Qf=function(e,t,n,r,i){var a=``,o=cf(`string`,i(r));return a=`PK\0\0\0\0`+R(e,2)+R(e,2)+R(t,4)+R(n,4)+R(o.length,2)+o,a},$f=function(e){var t=``;return t=`PK\x07\b`+R(e.crc32,4)+R(e.compressedSize,4)+R(e.uncompressedSize,4),t},ep=class extends _f{constructor(e,t,n,r){super(`ZipFileWorker`),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}push(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,super.push({data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))}openedSource(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=Zf(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0}closedSource(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=Zf(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:$f(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null}flush(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var n=this.bytesWritten-e,r=Qf(this.dirRecords.length,n,e,this.zipComment,this.encodeFileName);this.push({data:r,meta:{percent:100}})}prepareNextSource(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()}registerPrevious(e){this._sources.push(e);var t=this;return e.on(`data`,function(e){t.processChunk(e)}),e.on(`end`,function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()}),e.on(`error`,function(e){t.error(e)}),this}resume(){if(!super.resume())return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0}error(e){var t=this._sources;if(!super.error(e))return!1;for(var n=0;n<t.length;n++)try{t[n].error(e)}catch{}return!0}lock(){super.lock();for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()}},tp=function(e,t){var n=e||t,r=Uf[n];if(!r)throw Error(n+` is not a valid compression method !`);return r};let np=function(e,t,n){var r=new ep(t.streamFiles,n,t.platform,t.encodeFileName),i=0;try{e.forEach(function(e,n){i++;var a=tp(n.options.compression,t.compression),o=n.options.compressionOptions||t.compressionOptions||{},s=n.dir,c=n.date;n._compressWorker(a,o).withStreamInfo(`file`,{name:e,dir:s,date:c,comment:n.comment||``,unixPermissions:n.unixPermissions,dosPermissions:n.dosPermissions}).pipe(r)}),r.entriesCount=i}catch(e){r.error(e)}return r};var rp=class{constructor(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}checkOffset(e){this.checkIndex(this.index+e)}checkIndex(e){if(this.length<this.zero+e||e<0)throw Error(`End of data reached (data length = `+this.length+`, asked index = `+e+`). Corrupted zip ?`)}setIndex(e){this.checkIndex(e),this.index=e}skip(e){this.setIndex(this.index+e)}byteAt(e){}readInt(e){var t=0,n;for(this.checkOffset(e),n=this.index+e-1;n>=this.index;n--)t=(t<<8)+this.byteAt(n);return this.index+=e,t}readString(e){return cf(`string`,this.readData(e))}readData(e){}lastIndexOfSignature(e){}readAndCheckSignature(e){}readDate(){var e=this.readInt(4);return new Date(Date.UTC((e>>25&127)+1980,(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(e&31)<<1))}},ip=class extends rp{constructor(e){super(e);for(var t=0;t<this.data.length;t++)e[t]=e[t]&255}byteAt(e){return this.data[this.zero+e]}lastIndexOfSignature(e){for(var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),i=e.charCodeAt(3),a=this.length-4;a>=0;--a)if(this.data[a]===t&&this.data[a+1]===n&&this.data[a+2]===r&&this.data[a+3]===i)return a-this.zero;return-1}readAndCheckSignature(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),i=e.charCodeAt(3),a=this.readData(4);return t===a[0]&&n===a[1]&&r===a[2]&&i===a[3]}readData(e){if(this.checkOffset(e),e===0)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t}},ap=class extends rp{constructor(e){super(e)}byteAt(e){return this.data.charCodeAt(this.zero+e)}lastIndexOfSignature(e){return this.data.lastIndexOf(e)-this.zero}readAndCheckSignature(e){return e===this.readData(4)}readData(e){this.checkOffset(e);let t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t}},op=class extends ip{constructor(e){super(e)}readData(e){if(this.checkOffset(e),e===0)return new Uint8Array;var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t}};function sp(e){let t=uf(e);return df(t),t===`string`&&!Gd.uint8array?new ap(e):Gd.uint8array?new op(cf(`uint8array`,e)):new ip(cf(`array`,e))}var cp=0,lp=3,up=function(e){for(var t in Uf)if(Uf.hasOwnProperty(t)&&Uf[t].magic===e)return Uf[t];return null},dp=class{constructor(e,t){this.options=e,this.loadOptions=t}isEncrypted(){return(this.bitFlag&1)==1}useUTF8(){return(this.bitFlag&2048)==2048}readLocalPart(e){var t,n;if(e.skip(22),this.fileNameLength=e.readInt(2),n=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(n),this.compressedSize===-1||this.uncompressedSize===-1)throw Error(`Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)`);if(t=up(this.compressionMethod),t===null)throw Error(`Corrupted zip : compression `+pf(this.compressionMethod)+` unknown (inner file : `+cf(`string`,this.fileName)+`)`);this.decompressed=new zf(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))}readCentralPart(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw Error(`Encrypted zip are not supported`);e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)}processAttributes(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(this.externalFileAttributes&16),e===cp&&(this.dosPermissions=this.externalFileAttributes&63),e===lp&&(this.unixPermissions=this.externalFileAttributes>>16&65535),!this.dir&&this.fileNameStr.slice(-1)===`/`&&(this.dir=!0)}parseZIP64ExtraField(e){if(this.extraFields[1]){var t=sp(this.extraFields[1].value);this.uncompressedSize===-1&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===-1&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===-1&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===-1&&(this.diskNumberStart=t.readInt(4))}}readExtraFields(e){var t=e.index+this.extraFieldsLength,n,r,i;for(this.extraFields||={};e.index<t;)n=e.readInt(2),r=e.readInt(2),i=e.readData(r),this.extraFields[n]={id:n,length:r,value:i}}handleUTF8(){var e=Gd.uint8array?`uint8array`:`array`;if(this.useUTF8())this.fileNameStr=Cf(this.fileName),this.fileCommentStr=Cf(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(t!==null)this.fileNameStr=t;else{var n=cf(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var r=this.findExtraFieldUnicodeComment();if(r!==null)this.fileCommentStr=r;else{var i=cf(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(i)}}}findExtraFieldUnicodePath(){var e=this.extraFields[28789];if(e){var t=sp(e.value);return t.readInt(1)!==1||Lf(this.fileName)!==t.readInt(4)?null:Cf(t.readData(e.length-5))}return null}findExtraFieldUnicodeComment(){var e=this.extraFields[25461];if(e){var t=sp(e.value);return t.readInt(1)!==1||Lf(this.fileComment)!==t.readInt(4)?null:Cf(t.readData(e.length-5))}return null}},fp=class{constructor(e){this.files=[],this.loadOptions=e}checkSignature(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw Error(`Corrupted zip or bug: unexpected signature (`+pf(t)+`, expected `+pf(e)+`)`)}}isSignature(e,t){var n=this.reader.index;this.reader.setIndex(e);var r=this.reader.readString(4)===t;return this.reader.setIndex(n),r}readBlockEndOfCentral(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=Gd.uint8array?`uint8array`:`array`,n=cf(t,e);this.zipComment=this.loadOptions.decodeFileName(n)}readBlockZip64EndOfCentral(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e=this.zip64EndOfCentralSize-44,t=0,n,r,i;t<e;)n=this.reader.readInt(2),r=this.reader.readInt(4),i=this.reader.readData(r),this.zip64ExtensibleData[n]={id:n,length:r,value:i}}readBlockZip64EndOfCentralLocator(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw Error(`Multi-volumes zip are not supported`)}readLocalFiles(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(Wf),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()}readCentralDir(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(Gf);)e=new dp({zip64:this.zip64},this.loadOptions),e.readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw Error(`Corrupted zip or bug: expected `+this.centralDirRecords+` records in central dir, got `+this.files.length)}readEndOfCentral(){var e=this.reader.lastIndexOfSignature(Kf);if(e<0)throw this.isSignature(0,Wf)?Error(`Corrupted zip: can't find end of central directory`):Error(`Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html`);this.reader.setIndex(e);var t=e;if(this.checkSignature(Kf),this.readBlockEndOfCentral(),this.diskNumber===ff||this.diskWithCentralDirStart===ff||this.centralDirRecordsOnThisDisk===ff||this.centralDirRecords===ff||this.centralDirSize===-1||this.centralDirOffset===-1){if(this.zip64=!0,e=this.reader.lastIndexOfSignature(qf),e<0)throw Error(`Corrupted zip: can't find the ZIP64 end of central directory locator`);if(this.reader.setIndex(e),this.checkSignature(qf),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,Jf)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(Jf),this.relativeOffsetEndOfZip64CentralDir<0))throw Error(`Corrupted zip: can't find the ZIP64 end of central directory`);this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(Jf),this.readBlockZip64EndOfCentral()}var n=this.centralDirOffset+this.centralDirSize;this.zip64&&(n+=20,n+=12+this.zip64EndOfCentralSize);var r=t-n;if(r>0)this.isSignature(t,Gf)||(this.reader.zero=r);else if(r<0)throw Error(`Corrupted zip: missing `+Math.abs(r)+` bytes.`)}prepareReader(e){this.reader=sp(e)}load(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};function pp(e){return new Wd.Promise(function(t,n){var r=e.decompressed.getContentWorker().pipe(new Rf);r.on(`error`,function(e){n(e)}).on(`end`,function(){r.streamInfo.crc32===e.decompressed.crc32?t():n(Error(`Corrupted zip : CRC32 mismatch`))}).resume()})}function mp(e,t){var n=this;return t=hf(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:Cf}),gf(`the loaded zip file`,e,!0,t.optimizedBinaryString,t.base64).then(function(e){var n=new fp(t);return n.load(e),n}).then(function(e){var n=[Wd.Promise.resolve(e)],r=e.files;if(t.checkCRC32)for(var i=0;i<r.length;i++)n.push(pp(r[i]));return Wd.Promise.all(n)}).then(function(e){for(var r=e.shift(),i=r.files,a=0;a<i.length;a++){var o=i[a],s=o.fileNameStr,c=lf(o.fileNameStr);n.file(c,o.decompressed,{binary:!0,optimizedBinaryString:!0,date:o.date,dir:o.dir,comment:o.fileCommentStr.length?o.fileCommentStr:null,unixPermissions:o.unixPermissions,dosPermissions:o.dosPermissions,createFolders:t.createFolders}),o.dir||(n.file(c).unsafeOriginalName=s)}return r.zipComment.length&&(n.comment=r.zipComment),n})}var hp=function(e,t,n){var r=uf(t),i,a=hf(n||{},jf);a.date=a.date||new Date,a.compression!==null&&(a.compression=a.compression.toUpperCase()),typeof a.unixPermissions==`string`&&(a.unixPermissions=parseInt(a.unixPermissions,8)),a.unixPermissions&&a.unixPermissions&16384&&(a.dir=!0),a.dosPermissions&&a.dosPermissions&16&&(a.dir=!0),a.dir&&(e=_p(e)),a.createFolders&&(i=gp(e))&&vp.call(this,i,!0);var o=r===`string`&&a.binary===!1&&a.base64===!1;(!n||n.binary===void 0)&&(a.binary=!o),(t instanceof zf&&t.uncompressedSize===0||a.dir||!t||t.length===0)&&(a.base64=!1,a.binary=!0,t=``,a.compression=`STORE`,r=`string`);var s=null;s=t instanceof zf||t instanceof _f?t:gf(e,t,a.binary,a.optimizedBinaryString,a.base64);var c=new Bf(e,s,a);this.files[e]=c},gp=function(e){e.slice(-1)===`/`&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf(`/`);return t>0?e.substring(0,t):``},_p=function(e){return e.slice(-1)!==`/`&&(e+=`/`),e},vp=function(e,t){return t=t===void 0||t,e=_p(e),this.files[e]||hp.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function yp(e){return Object.prototype.toString.call(e)===`[object RegExp]`}var bp=class e{constructor(){if(arguments.length)throw Error(`The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.`);this.files=Object.create(null),this.comment=null,this.root=``,this.clone=function(){let t=new e;for(let e in this)typeof this[e]!=`function`&&(t[e]=this[e]);return t}}load(){throw Error(`This method has been removed in JSZip 3.0, please check the upgrade guide.`)}forEach(e){var t,n,r;for(t in this.files)r=this.files[t],n=t.slice(this.root.length,t.length),n&&t.slice(0,this.root.length)===this.root&&e(n,r)}filter(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(r)}),t}file(e,t,n){if(arguments.length===1)if(yp(e)){var r=e;return this.filter(function(e,t){return!t.dir&&r.test(e)})}else{var i=this.files[this.root+e];return i&&!i.dir?i:null}else e=this.root+e,hp.call(this,e,t,n);return this}folder(e){if(!e)return this;if(yp(e))return this.filter(function(t,n){return n.dir&&e.test(t)});var t=this.root+e,n=vp.call(this,t),r=this.clone();return r.root=n.name,r}remove(e){e=this.root+e;var t=this.files[e];if(t||=(e.slice(-1)!==`/`&&(e+=`/`),this.files[e]),t&&!t.dir)delete this.files[e];else for(var n=this.filter(function(t,n){return n.name.slice(0,e.length)===e}),r=0;r<n.length;r++)delete this.files[n[r].name];return this}generate(e){throw Error(`This method has been removed in JSZip 3.0, please check the upgrade guide.`)}generateInternalStream(e){var t,n={};try{if(n=hf(e||{},{streamFiles:!1,compression:`STORE`,compressionOptions:null,type:``,platform:`DOS`,comment:null,mimeType:`application/zip`,encodeFileName:Sf}),n.type=n.type.toLowerCase(),n.compression=n.compression.toUpperCase(),n.type===`binarystring`&&(n.type=`string`),!n.type)throw Error(`No output type specified.`);df(n.type),(n.platform===`darwin`||n.platform===`freebsd`||n.platform===`linux`||n.platform===`sunos`)&&(n.platform=`UNIX`),n.platform===`win32`&&(n.platform=`DOS`);var r=n.comment||this.comment||``;t=np(this,n,r)}catch(e){t=new _f(`error`),t.error(e)}return new Af(t,n.type||`string`,n.mimeType)}generateAsync(e,t){return this.generateInternalStream(e).accumulate(t)}loadAsync(e,t){return mp.apply(this,[e,t])}static loadAsync(t,n){return new e().loadAsync(t,n)}static get support(){return Gd}static get defaults(){return jf}static get version(){return`3.2.2-esm`}static get external(){return Wd}},xp=r({ALL_PROPERTIES:()=>Yg,ALL_REASONS:()=>Ap,AddColumnCommand:()=>tC,AddCommand:()=>eC,AddRowCommand:()=>nC,AdjustDecimalsCommand:()=>jS,AdjustRowHeightCommand:()=>IS,ApplyFilterCommand:()=>qS,AutoFillCalculator:()=>Sb,AutoFillCommand:()=>US,Axis:()=>hb,AxisManager:()=>xb,BorderChangeCommand:()=>MS,BringToFrontCommand:()=>vS,CalcError:()=>W,CellRef:()=>V,ClearContentCommand:()=>DS,ClearFilterCommand:()=>JS,Clipboard:()=>nS,ColumnWidthCommand:()=>xS,Command:()=>Q,Context:()=>um,Controller:()=>wg,CopyCommand:()=>zS,CustomFilter:()=>Ub,CutCommand:()=>RS,Deferred:()=>IC,DefineNameCommand:()=>sC,DeleteColumnCommand:()=>$S,DeleteCommand:()=>ZS,DeleteDrawingCommand:()=>gS,DeleteNameCommand:()=>cC,DeleteRowCommand:()=>QS,Drawing:()=>nx,DrawingCommand:()=>mS,DrawingUpdateCommand:()=>pS,DynamicFilter:()=>Gb,EditCommand:()=>OS,EditValidationCommand:()=>rC,EventListener:()=>dg,FIRSTREF:()=>Ep,Filter:()=>Vb,FilterCommand:()=>GS,FormulaBar:()=>Wx,FormulaContext:()=>ag,FormulaInput:()=>Rx,FreezePanesCommand:()=>PS,Grid:()=>vb,GridLinesChangeCommand:()=>wS,HideLineCommand:()=>YS,HyperlinkCommand:()=>CS,InsertCommentCommand:()=>kS,InsertImageCommand:()=>hS,Matrix:()=>fm,MergeCellCommand:()=>NS,NULLREF:()=>B,NameCommand:()=>oC,NameEditor:()=>Gx,NameRef:()=>Tp,OpenCommand:()=>iC,Pane:()=>Nx,PaneAxis:()=>gb,PaneGrid:()=>yb,PasteCommand:()=>FS,PropertyBag:()=>Gg,PropertyChangeCommand:()=>TS,PropertyCleanCommand:()=>ES,Range:()=>X,RangeList:()=>Lg,RangeRef:()=>H,RangeTree:()=>Mg,Ref:()=>z,ReorderDrawingsCommand:()=>_S,RowHeightCommand:()=>SS,SHEETREF:()=>Dp,SaveAsCommand:()=>aC,SendToBackCommand:()=>yS,Sheet:()=>tx,SheetDataSourceBinder:()=>kb,SheetEditor:()=>sb,SheetNavigator:()=>wb,SortCommand:()=>KS,Sorter:()=>bb,SpreadsheetWidget:()=>rT,TargetValueCommand:()=>bS,TextWrapCommand:()=>AS,ToolbarCopyCommand:()=>HS,ToolbarCutCommand:()=>WS,ToolbarPasteCommand:()=>LS,TopFilter:()=>Wb,UnHideLineCommand:()=>XS,UnionRef:()=>U,ValidationFormulaContext:()=>og,ValueFilter:()=>Hb,View:()=>$x,Workbook:()=>eT,calc:()=>G,dateToNumber:()=>Db,dateToSerial:()=>lT,defineAlias:()=>uT,defineFunction:()=>Sm,draw:()=>Dx,drawCell:()=>Mx,formatting:()=>yh,initDynamicFilter:()=>Kb,intl:()=>om,numberToDate:()=>Eb,packDate:()=>iT,packTime:()=>oT,registerEditor:()=>ex,serialToDate:()=>cT,unpackDate:()=>aT,unpackTime:()=>sT,validation:()=>Fy});function Sp(e){let t=Math.floor(e/26)-1;return(t>=0?Sp(t):``)+String.fromCharCode(65+e%26)}function Cp(e){return/^[a-z_][a-z0-9_]*$/i.test(e)?e:`'`+e.replace(/\\/g,`\\\\`).replace(/\x27/g,`\\'`)+`'`}function wp(e,t,n,r){let i=``;return++t,isFinite(t)?r!=null&&!(r&2)&&(t=`$`+t):t=``,isFinite(n)?(i=Sp(n),r!=null&&!(r&1)&&(i=`$`+i)):n=``,e?Cp(e)+`!`+i+t:i+t}var z=class{constructor(){this.type=`ref`,this.sheet=``}clone(){return this}hasSheet(){return this._hasSheet}simplify(){return this}setSheet(e,t){return this.sheet=e,t!=null&&(this._hasSheet=t),this}absolute(e,t){return this}relative(...e){return this}adjust(e,t,n,r,i,a,o){return this}toString(){return this.relative(0,0,3,3).print(0,0)}forEach(e,t){e.call(t,this)}map(e,t){return e.call(t,this)}intersect(e){return this}intersects(e){return this.intersect(e)!==B}isCell(){return!1}toRow(e){return this}toColumn(e){return this}first(){return this}lastRange(){return this}size(){return 1}rangeAt(e){return this}nextRangeIndex(e){return 0}previousRangeIndex(e){return 0}eq(e){let t=this,n=e;if(t===B||n===B)return t===n;if((n instanceof V||n instanceof H&&!(t instanceof V))&&(t=e,n=this),t instanceof V)return n=n.simplify(),n instanceof V&&t.row==n.row&&t.col==n.col&&t.sheet==n.sheet;if(t instanceof H){if(n instanceof H)return n.topLeft.eq(t.topLeft)&&n.bottomRight.eq(t.bottomRight);if(n instanceof U)return n.single()&&t.eq(n.refs[0])}else if(t instanceof U&&n instanceof U){let e=t.refs,r=n.refs;if(e.length!=r.length)return!1;for(let t=0,n=e.length;t<n;t++)if(!e[t].eq(r[t]))return!1;return!0}return t===n}concat(e){return new U([this,e])}replaceAt(e,t){return t}forEachColumnIndex(e){this.forEachAxisIndex(`col`,e)}forEachRowIndex(e){this.forEachAxisIndex(`row`,e)}forEachRow(e){}forEachColumn(e){}forEachAxisIndex(e,t){let n=[],r=e===`row`?`forEachRow`:`forEachColumn`;this[r](function(t){let r=t.first()[e];n.indexOf(r)===-1&&n.push(r)}),n.sort(function(e,t){return e>t?1:e<t?-1:0}).forEach(t)}valid(){return!1}renameSheet(e,t){if(this.sheet&&this.sheet.toLowerCase()==e.toLowerCase())return this.sheet=t,!0}};z.display=wp;let B=new class extends z{print(){return`#NULL!`}eq(e){return e===this}forEach(){}};var Tp=class e extends z{constructor(e){super(),this.name=e,this.ref=`name`}clone(){return new e(this.name).setSheet(this.sheet,this.hasSheet())}print(){let e=Cp(this.name);return this.hasSheet()&&(e=Cp(this.sheet)+`!`+e),e}},V=class e extends z{constructor(e,t,n){super(),this.row=e,this.col=t,this.rel=n||0,this.ref=`cell`}clone(){return new e(this.row,this.col,this.rel).setSheet(this.sheet,this.hasSheet())}intersect(t){return t instanceof e?this.eq(t)?this:B:t.intersect(this)}print(e,t,n){let r=this.col,i=this.row,a=this.rel,o;if(e==null&&a){let e=this.hasSheet()?Cp(this.sheet)+`!`:``;return r=isFinite(r)?a&1?`C[`+r+`]`:`C`+(r+1):``,i=isFinite(i)?a&2?`R[`+i+`]`:`R`+(i+1):``,e+i+r}else return o=this.absolute(e,t),n?(i=o.row%1048576,r=o.col%16384,i<0&&(i+=1048576),r<0&&(r+=16384),wp(this._hasSheet&&this.sheet,i,r,a)):o.valid()?wp(this._hasSheet&&this.sheet,o.row,o.col,a):`#REF!`}absolute(e,t){let n=this.clone();return n.rel&3?(n.rel&1&&(n.col=(n.col+t)%16384),n.rel&2&&(n.row=(n.row+e)%1048576),n.rel=0,n):n}toRangeRef(){return new H(this,this)}relative(t,n,r){r??=this.rel;let i=r&2?this.row-t:this.row,a=r&1?this.col-n:this.col;return new e(i,a,r).setSheet(this.sheet,this.hasSheet())}height(){return 1}width(){return 1}toString(){return wp(null,this.row,this.col,3)}isCell(){return!0}leftColumn(){return this}rightColumn(){return this}topRow(){return this}bottomRow(){return this}forEachRow(e){e(this.toRangeRef())}forEachColumn(e){e(this.toRangeRef())}adjust(e,t,n,r,i,a,o){let s=this.absolute(e,t);if(i){if(s.row>=a){if(o<0&&s.row<a-o)return B;s.row+=o}}else if(s.col>=a){if(o<0&&s.col<a-o)return B;s.col+=o}return n!=null&&r!=null&&(s=s.relative(n,r,this.rel)),s}valid(){if(this.rel)throw Error(`valid() called on relative reference`);let e=this.col,t=this.row;return!(isFinite(e)&&e<0||isFinite(t)&&t<0)}},H=class e extends z{constructor(e,t){super(),this.ref=`range`,e._hasSheet&&t._hasSheet&&e.sheet.toLowerCase()!=t.sheet.toLowerCase()&&(this.endSheet=t.sheet),this.topLeft=new V(e.row,e.col,e.rel),this.bottomRight=new V(t.row,t.col,t.rel),this.normalize()}clone(){return new e(this.topLeft.clone(),this.bottomRight.clone()).setSheet(this.sheet,this.hasSheet())}_containsRange(e){return this._containsCell(e.topLeft)&&this._containsCell(e.bottomRight)}_containsCell(e){return e.sheet==this.sheet&&e.row>=this.topLeft.row&&e.col>=this.topLeft.col&&e.row<=this.bottomRight.row&&e.col<=this.bottomRight.col}contains(t){if(t instanceof Array){let e=this;return t.some(function(t){return!!e.contains(t)})}return t instanceof V?this._containsCell(t):t instanceof e&&this._containsRange(t)}_intersectRange(t){if(this.sheet!=t.sheet)return B;let n=this.topLeft.col,r=this.topLeft.row,i=this.bottomRight.col,a=this.bottomRight.row,o=t.topLeft.col,s=t.topLeft.row,c=t.bottomRight.col,l=t.bottomRight.row;return n<=c&&o<=i&&r<=l&&s<=a?new e(new V(Math.max(r,s),Math.max(n,o)),new V(Math.min(a,l),Math.min(i,c))).setSheet(this.sheet,this.hasSheet()):B}intersect(t){return t instanceof V?this._containsCell(t)?t:B:t instanceof e?this._intersectRange(t).simplify():t instanceof U?t.intersect(this):B}simplify(){return this.isCell()?new V(this.topLeft.row,this.topLeft.col,this.topLeft.rel).setSheet(this.sheet,this.hasSheet()):this}normalize(){let e=this.topLeft,t=this.bottomRight,n=e.row,r=e.col,i=t.row,a=t.col,o=e.rel&2,s=e.rel&1,c=t.rel&2,l=t.rel&1,u,d=!1;return o===c&&s===l&&(n>i&&(d=!0,u=n,n=i,i=u,u=o,o=c,c=u),r>a&&(d=!0,u=r,r=a,a=u,u=s,s=l,l=u),d&&(this.topLeft=new V(n,r,s|o),this.bottomRight=new V(i,a,l|c))),this}print(e,t,n){if(n||this.absolute(e,t).valid()){let r=this.topLeft.print(e,t,n)+`:`+this.bottomRight.print(e,t,n);return this.hasSheet()&&(r=Cp(this.sheet)+(this.endSheet?`:`+Cp(this.endSheet):``)+`!`+r),r}return`#REF!`}absolute(t,n){return new e(this.topLeft.absolute(t,n),this.bottomRight.absolute(t,n)).setSheet(this.sheet,this.hasSheet())}relative(t,n,r,i){return i??=r,new e(this.topLeft.relative(t,n,r),this.bottomRight.relative(t,n,i)).setSheet(this.sheet,this.hasSheet())}height(){if(this.topLeft.rel!=this.bottomRight.rel)throw Error(`Mixed relative/absolute references`);return this.bottomRight.row-this.topLeft.row+1}width(){if(this.topLeft.rel!=this.bottomRight.rel)throw Error(`Mixed relative/absolute references`);return this.bottomRight.col-this.topLeft.col+1}collapse(){return this.topLeft.toRangeRef()}leftColumn(){return new e(this.topLeft,new V(this.bottomRight.row,this.topLeft.col))}rightColumn(){return new e(new V(this.topLeft.row,this.bottomRight.col),this.bottomRight)}topRow(){return new e(this.topLeft,new V(this.topLeft.row,this.bottomRight.col))}bottomRow(){return new e(new V(this.bottomRight.row,this.topLeft.col),this.bottomRight)}toRangeRef(){return this}toRow(t){return t+=Math.max(0,this.topLeft.row),new e(new V(t,this.topLeft.col),new V(t,this.bottomRight.col)).setSheet(this.sheet,this.hasSheet())}toColumn(t){return t+=Math.max(0,this.topLeft.col),new e(new V(this.topLeft.row,t),new V(this.bottomRight.row,t)).setSheet(this.sheet,this.hasSheet())}toCell(e,t){return e+=Math.max(0,this.topLeft.row),t+=Math.max(0,this.topLeft.col),new V(e,t,0).setSheet(this.sheet,this.hasSheet())}forEachRow(t){let n=this.topLeft.row,r=this.bottomRight.row,i=this.topLeft.col,a=this.bottomRight.col;for(let o=n;o<=r;o++)t(new e(new V(o,i),new V(o,a)))}forEachColumn(t){let n=this.topLeft.row,r=this.bottomRight.row,i=this.topLeft.col,a=this.bottomRight.col;for(let o=i;o<=a;o++)t(new e(new V(n,o),new V(r,o)))}intersecting(e){return e.filter(e=>e.toRangeRef().intersects(this))}union(t,n){let r=this.intersecting(t),i=this.topLeft.row,a=this.topLeft.col,o=this.bottomRight.row,s=this.bottomRight.col,c=!1;r.forEach(function(e){e=e.toRangeRef(),e.topLeft.row<i&&(c=!0,i=e.topLeft.row),e.topLeft.col<a&&(c=!0,a=e.topLeft.col),e.bottomRight.row>o&&(c=!0,o=e.bottomRight.row),e.bottomRight.col>s&&(c=!0,s=e.bottomRight.col),n&&n(e)});let l=new e(new V(i,a),new V(o,s));return c?l.union(t,n):l}resize(t){let n=Math.max.bind(Math,0);function r(e){return e||0}let i=this.topLeft.row+r(t.top),a=this.topLeft.col+r(t.left),o=this.bottomRight.row+r(t.bottom),s=this.bottomRight.col+r(t.right);return a<0&&s<0||i<0&&o<0?B:i<=o&&a<=s?new e(new V(n(i),n(a)),new V(n(o),n(s))):B}move(t,n){return new e(new V(this.topLeft.row+t,this.topLeft.col+n),new V(this.bottomRight.row+t,this.bottomRight.col+n))}first(){return this.topLeft.clone().setSheet(this.sheet,this.hasSheet())}isCell(){return!this.endSheet&&this.topLeft.eq(this.bottomRight)}toString(){return this.topLeft+`:`+this.bottomRight}adjust(t,n,r,i,a,o,s){let c=this.topLeft.adjust(t,n,r,i,a,o,s),l=this.bottomRight.adjust(t,n,r,i,a,o,s);return c===B&&l===B?B:(c===B?(c=this.topLeft.absolute(t,n),a?c.row=o:c.col=o,r!=null&&i!=null&&(c=c.relative(r,i,this.topLeft.rel))):l===B&&(l=this.bottomRight.absolute(t,n),a?l.row=o-1:l.col=o-1,r!=null&&i!=null&&(l=l.relative(r,i,this.bottomRight.rel))),new e(c,l).setSheet(this.sheet,this.hasSheet()).simplify())}valid(){return this.topLeft.valid()&&this.bottomRight.valid()}},U=class e extends z{constructor(e){super(),this.refs=e,this.length=e.length}clone(){return new e(this.refs.slice())}intersect(t){let n=[];for(let e=0;e<this.length;++e){let r=t.intersect(this.refs[e]);r!==B&&n.push(r)}return n.length>0?new e(n).simplify():B}simplify(){let t=new e(this.refs.reduce(function(e,t){return t=t.simplify(),t!==B&&e.push(t),e},[]));return t.empty()?B:t.single()?t.refs[0]:t}absolute(t,n){return new e(this.refs.map(function(e){return e.absolute(t,n)}))}forEach(t,n){this.refs.forEach(function(r){r instanceof e?r.forEach(t,n):t.call(n,r)},n)}toRangeRef(){return this.refs[0].toRangeRef()}contains(e){return this.refs.some(function(t){return t.contains(e)})}map(t,n){let r=[];return this.forEach(function(e){r.push(t.call(n,e))}),new e(r)}first(){return this.refs[0].first()}lastRange(){return this.refs[this.length-1]}size(){return this.length}single(){return this.length==1}empty(){return this.length===0}isCell(){return this.single()&&this.refs[0].isCell()}rangeAt(e){return this.refs[e]}nextRangeIndex(e){return e===this.length-1?0:e+1}previousRangeIndex(e){return e===0?this.length-1:e-1}concat(t){return new e(this.refs.concat([t]))}print(e,t,n){return this.refs.map(function(r){return r.print(e,t,n)}).join(`,`)}replaceAt(t,n){let r=this.refs.slice();return r.splice(t,1,n),new e(r)}leftColumn(){return this.map(function(e){return e.leftColumn()})}rightColumn(){return this.map(function(e){return e.rightColumn()})}topRow(){return this.map(function(e){return e.topRow()})}bottomRow(){return this.map(function(e){return e.bottomRow()})}forEachRow(e){this.forEach(function(t){t.forEachRow(e)})}forEachColumn(e){this.forEach(function(t){t.forEachColumn(e)})}adjust(e,t,n,r,i,a,o){return this.map(function(s){return s.adjust(e,t,n,r,i,a,o)}).simplify()}toString(){return this.refs.map(function(e){return e.toString()}).join(`, `)}valid(){for(let e=this.refs.length;--e>=0;)if(this.refs[e].valid())return!1;return!0}renameSheet(e,t){this.refs.forEach(function(n){n.renameSheet(e,t)})}};let Ep=new V(0,0),Dp=new H(new V(0,0),new V(1/0,1/0));Dp.print=function(){return`#SHEET`};let Op={};Op.view={nameBox:`Name Box`,errors:{modifyMerged:`Cannot change part of a merged cell.`,openUnsupported:`Unsupported format. Please select an .xlsx file.`,shiftingNonblankCells:`Cannot insert cells due to data loss possibility. Select another insert location or delete the data from the end of your worksheet.`,insertColumnWhenRowIsSelected:`Cannot insert column when all columns are selected.`,insertRowWhenColumnIsSelected:`Cannot insert row when all rows are selected.`,filterRangeContainingMerges:`Cannot create a filter within a range containing merges`,sortRangeContainingMerges:`Cannot sort a range containing merges`,cantSortMultipleSelection:`Cannot sort multiple selection`,cantSortNullRef:`Cannot sort empty selection`,cantSortMixedCells:`Cannot sort range containing cells of mixed shapes`,validationError:`The value that you entered violates the validation rules set on the cell.`,cannotModifyDisabled:`Cannot modify disabled cells.`,insertRowBelowLastRow:`Cannot insert row below the last row.`,insertColAfterLastCol:`Cannot insert column to the right of the last column.`},tabs:{home:`Home`,insert:`Insert`,data:`Data`}},Op.menus={cut:`Cut`,copy:`Copy`,paste:`Paste`,merge:`Merge`,unmerge:`Unmerge`,delete:`Delete`,hide:`Hide`,unhide:`Unhide`,bringToFront:`Bring to front`,sendToBack:`Send to back`},Op.workbook={defaultSheetName:`Sheet`};let kp={name:`Spreadsheet`,toolbar:!0,sheetsbar:!0,rows:200,columns:50,rowHeight:20,columnWidth:64,headerHeight:20,headerWidth:32,excel:{fileName:`Workbook.xlsx`,forceProxy:!1,proxyURL:``,applyProtection:!1},messages:Op,pdf:{area:`workbook`,fileName:`Workbook.pdf`,proxyURL:``,paperSize:`a4`,landscape:!0,margin:null,title:null,author:null,subject:null,keywords:null,creator:`Kendo UI PDF Generator`,date:null},defaultCellStyle:{fontFamily:`Arial`,fontSize:12},useCultureDecimals:!1,locale:`en`},Ap={recalc:!0,selection:!0,activeCell:!0,layout:!0,sheetSelection:!0,resize:!0,editorChange:!1,editorClose:!1},jp={INSERT:45,DELETE:46,BACKSPACE:8,TAB:9,ENTER:13,ESC:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,END:35,HOME:36,SPACEBAR:32,PAGEUP:33,PAGEDOWN:34,F2:113,F10:121,F11:122,F12:123,NUMPAD_PLUS:107,NUMPAD_MINUS:109,NUMPAD_DOT:110,B:66,I:73,U:85,N:78,H:72,A:65,R:82},Mp=RegExp(`[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]`);function Np(e){return Mp.test(e)}function Pp(e){let t=Object.create(null);return function(){let n=``;for(let e=arguments.length;--e>=0;)n+=`:`+arguments[e];return n in t?t[n]:t[n]=e.apply(this,arguments)}}function Fp(e){let t={1:`i`,10:`x`,100:`c`,2:`ii`,20:`xx`,200:`cc`,3:`iii`,30:`xxx`,300:`ccc`,4:`iv`,40:`xl`,400:`cd`,5:`v`,50:`l`,500:`d`,6:`vi`,60:`lx`,600:`dc`,7:`vii`,70:`lxx`,700:`dcc`,8:`viii`,80:`lxxx`,800:`dccc`,9:`ix`,90:`xc`,900:`cm`,1e3:`m`},n=[1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],r=``;for(;e>0;)e<n[0]?n.shift():(r+=t[n[0]],e-=n[0]);return r}function Ip(e){e=e.toLowerCase();let t={i:1,v:5,x:10,l:50,c:100,d:500,m:1e3},n=0,r=0;for(let i=0;i<e.length;++i){let a=t[e.charAt(i)];if(!a)return null;n+=a,a>r&&(n-=2*r),r=a}return n}function Lp(e,t){try{return e.call(t,function(e){throw new n(e)})}catch(e){if(e instanceof n)return e.value;throw e}function n(e){this.value=e}}let Rp={};Rp.undefined=e=>e;let zp=/\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g;function Bp(e,t){let n=e+t;if(Rp[n])return Rp[n];let r=[];return im(e,1e3).replace(zp,(e,t,n,i)=>{r.push(Zp(t)?t:n||i)}),Rp[n]=e=>{let n=e;for(let e=0;e<r.length;e++)if(n=n[r[e]],!Zp(n)&&t)return n;return n},Rp[n]}function Vp(e){let t=1,n=arguments.length;for(t=1;t<n;t++)Hp(e,arguments[t]);return e}function Hp(e,t){let n,r,i,a;for(n in t)n!==`__proto__`&&n!==`constructor`&&(r=t[n],i=typeof r,r instanceof Date?e[n]=new Date(r.getTime()):nm(r?.clone)?e[n]=r.clone():i===`object`&&r!==null&&rm(r)?(a=e[n],(typeof a!=`object`||!a)&&(e[n]={}),Hp(e[n],r)):i!==`undefined`&&(e[n]=r));return e}function Up(){let e=``,t,n;for(e+=`abcdef`[Math.floor(Math.random()*6)],t=1;t<32;t++)n=Math.random()*16|0,(t===8||t===12||t===16||t===20)&&(e+=`-`),e+=(t===12?4:t===16?n&3|8:n).toString(16);return e}let Wp={},Gp=function(e){if(!isNaN(Wp._scrollbar)&&!e)return Wp._scrollbar;let t=document.createElement(`div`),n;return t.style.overflow=`scroll`,t.style.overflowX=`hidden`,t.style.zoom=`1`,t.style.clear=`both`,t.style.display=`block`,t.innerHTML=`&nbsp;`,document.body.appendChild(t),Wp._scrollbar=n=t.offsetWidth-t.scrollWidth,document.body.removeChild(t),n};function Kp(e){return e.replace(/\-(\w)/g,function(e,t){return t.toUpperCase()})}function qp(e){let t=0,n;for(n in e)e.hasOwnProperty(n)&&n!==`toJSON`&&t++;return t}let Jp=function(e,t){let n={},r;return document.defaultView&&document.defaultView.getComputedStyle?(r=document.defaultView.getComputedStyle(e,``),t&&t.forEach(function(e){n[e]=r.getPropertyValue(e)})):(r=e.currentStyle,t&&t.forEach(function(e){n[e]=r[Kp(e)]})),qp(n)||(n=r),n},Yp=function(e,t){t.parentNode.insertBefore(e,t.nextSibling)},Xp=function(){try{return document.activeElement}catch{return document.documentElement.activeElement}},Zp=e=>e!=null,Qp=e=>!Zp(e),$p=e=>e&&e.getTime,em=e=>typeof e==`string`,tm=e=>!isNaN(e-parseFloat(e)),nm=e=>typeof e==`function`,rm=function(e){if(!e||toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t.constructor===Object},im=function(e,t){return typeof e==`string`&&e.length>t?e.substring(0,t):e};var W=class e{constructor(t){if(t instanceof e)return t;this.code=t}toString(){return`#`+this.code+(this.code===`NAME`?`?`:`!`)}};let am={},om=e=>{if(e)am=e;else return am},sm=()=>om().localeInfo();function cm(e,t,n,r,i){let a={};return a.spreadsheet={calc:e,CalcError:t,Ref:n,CellRef:r,RangeRef:i},a.culture=()=>sm(),a}let G={runtime:{FUNCS:Object.create(null)}},lm=G.runtime.FUNCS;var um=class{constructor(e,t,n,r){this.callback=e,this.formula=t,this.ss=n,this.parent=r}resolve(e){var t=this;e instanceof z?t.resolveCells([e],function(){t._resolve(e)}):t._resolve(e)}error(e){return new W(e)}_resolve(e){e=e===void 0?null:Array.isArray(e)?this.asMatrix(e):vm(e);var t=this.formula;t.arrayFormulaRange?e=this.asMatrix(e)||this.asMatrix([[e]]):e instanceof H&&(e=this._arrayArg(e)),t.value=e,this.ss.onFormula(t)&&this.callback&&this.callback.call(t,e)}resolveCells(e,t){var n=this,r=[];if((function e(t){for(var r=0;r<t.length;++r){var i=t[r];i instanceof z&&s(n.getRefCells(i)),Array.isArray(i)&&e(i)}})(e),!r.length)return t.call(n);for(var i=r.length,a=0;a<r.length;++a)o(r[a]);function o(e){e.exec(n.ss,function(){--i||t.call(n)},n)}function s(e){for(var t=0;t<e.length;++t){var i=e[t];i.formula&&i.formula!==n.formula&&r.push(i.formula)}}}cellValues(e,t){for(var n=[],r=0;r<e.length;++r){var i=e[r];i instanceof z?(i=this.getRefData(i,t),n=n.concat(i)):Array.isArray(i)?n=n.concat(this.cellValues(i,t)):i instanceof fm?n=n.concat(this.cellValues(i.data,t)):n.push(i)}return n}fetchName(e,t){var n=this.formula,r=this.ss.nameValue(e,n.sheet,n.row,n.col);if(r instanceof mm){r=r.clone(n.sheet,n.row,n.col,!0);var i=new G.ValidationFormulaContext(this.ss.workbook);r.exec(i,t,this)}else r instanceof z&&(r=r.absolute(n.row,n.col),r instanceof H&&this.ss.isMerged(r)&&(r=r.topLeft),r.sheet||=n.sheet),t(r??new W(`NAME`))}force(e){return e instanceof z?this.getRefData(e):e}func(e,t,n){e=e.toLowerCase();var r=lm[e];if(r)return r.call(this,t,n);t(new W(`NAME`))}bool(e){return e instanceof z&&(e=this.getRefData(e)),typeof e==`string`?e.toLowerCase()==`true`:typeof e==`number`?e!==0:typeof e==`boolean`?e:e!=null}_arrayArg(e){var t=this.formula;return!t.arrayFormulaRange&&e instanceof H?e.height()==1&&t.col>=e.topLeft.col&&t.col<=e.bottomRight.col?this.getRefData(new V(e.topLeft.row,t.col).setSheet(e.sheet)):e.width()==1&&t.row>=e.topLeft.row&&t.row<=e.bottomRight.row?this.getRefData(new V(t.row,e.topLeft.col).setSheet(e.sheet)):new W(`VALUE`):this.asMatrix(e)}asMatrix(e){if(e instanceof fm)return e;let t=this;if(e instanceof H){let n=e.topLeft,r=n.row,i=n.col,a=t.getRefCells(e),o=new fm(t);return isFinite(e.width())&&(o.width=e.width()),isFinite(e.height())&&(o.height=e.height()),isFinite(r)||(r=0),isFinite(i)||(i=0),a.forEach(function(e){o.set(e.row-r,e.col-i,e.value)}),o}if(Array.isArray(e)&&e.length>0){let n=new fm(t),r=0;return e.forEach(function(e){let i=0,a=1;e.forEach(function(e){let o=e instanceof H;e instanceof z&&!o&&(e=t.getRefData(e)),(o||Array.isArray(e))&&(e=t.asMatrix(e)),e instanceof fm?(e.each(function(e,t,a){n.set(r+t,i+a,e)}),a=Math.max(a,e.height),i+=e.width):(typeof e==`string`&&e.length&&!isNaN(e)&&(e=Number(e)),n.set(r,i++,e))}),r+=a}),n}}getRefCells(e,t,n){var r=this.formula;return this.ss.getRefCells(e,t,r.sheet,r.row,r.col,n)}getRefData(e,t){var n=this.formula;return this.ss.getData(e,n.sheet,n.row,n.col,t)}workbook(){return this.ss.workbook}};function dm(e,t,n){for(var r=n(e),i=e;++e<t;){var a=n(e);a>r&&(r=a,i=e)}return i}var fm=class e{constructor(e){this.context=e,this.height=0,this.width=0,this.data=[]}clone(){var t=new e(this.context);return t.height=this.height,t.width=this.width,t.data=this.data.map(function(e){return e.slice()}),t}get(e,t){var n=this.data[e],r=n?n[t]:null;return r instanceof z?this.context.getRefData(r):r}getNA(e,t){return this.height==1&&(e=0),this.width==1&&(t=0),e<this.height&&t<this.width?this.get(e,t):new W(`N/A`)}set(e,t,n){if(t!==`__proto__`&&t!==`constructor`&&t!==`prototype`&&e!==`__proto__`&&e!==`constructor`&&e!==`prototype`){var r=this.data[e];r??=this.data[e]=[],r[t]=n,e>=this.height&&(this.height=e+1),t>=this.width&&(this.width=t+1)}}each(e,t){for(var n=0;n<this.height;++n)for(var r=0;r<this.width;++r){var i=this.get(n,r);if((t||i!=null)&&(i=e.call(this.context,i,n,r),i!==void 0))return i}}map(t,n){var r=new e(this.context);return this.each(function(e,n,i){r.set(n,i,t.call(this,e,n,i))},n),r}eachRow(e){for(var t=0;t<this.height;++t){var n=e.call(this.context,t);if(n!==void 0)return n}}eachCol(e){for(var t=0;t<this.width;++t){var n=e.call(this.context,t);if(n!==void 0)return n}}mapRow(t){var n=new e(this.context);return this.eachRow(function(e){n.set(e,0,t.call(this.context,e))}),n}mapCol(t){var n=new e(this.context);return this.eachCol(function(e){n.set(0,e,t.call(this.context,e))}),n}toString(){return JSON.stringify(this.data)}transpose(){var t=new e(this.context);return this.each(function(e,n,r){t.set(r,n,e)}),t}unit(e){this.width=this.height=e;for(var t=this.data=Array(e),n=e;--n>=0;)for(var r=t[n]=Array(e),i=e;--i>=0;)r[i]=+(n==i);return this}multiply(t){for(var n=this,r=new e(n.context),i=0;i<n.height;++i)for(var a=0;a<t.width;++a){for(var o=0,s=0;s<n.width;++s){var c=n.get(i,s),l=t.get(s,a);if(typeof c!=`number`||typeof l!=`number`)throw new W(`VALUE`);o+=c*l}r.set(i,a,o)}return r}adds(t,n){for(var r=this,i=new e(r.context),a=n?-1:1,o=0;o<r.height;++o)for(var s=0;s<r.width;++s){var c=r.get(o,s),l=t.get(o,s);i.set(o,s,c+a*l)}return i}determinant(){var e=this.clone().data,t=e.length,n=1,r,i,a,o;for(r=0;r<t;r++){for(i=r;i<t&&!e[i][r];i++);if(i==t)return 0;if(i!=r)for(n=-n,o=r;o<t;o++){var s=e[r][o];e[r][o]=e[i][o],e[i][o]=s}for(a=r+1;a<t;a++)for(o=r+1;o<t;o++)e[a][o]-=e[r][o]*e[a][r]/e[r][r];n*=e[r][r]}return n}inverse(){let t=this.width,n=this.augment(new e(this.context).unit(t)),r=n.data,i;for(let e=0;e<t;++e){let n=dm(e,t,function(t){return r[t][e]});if(!r[n][e])return null;e!=n&&(i=r[e],r[e]=r[n],r[n]=i);for(let n=e+1;n<t;++n){for(let i=e+1;i<2*t;++i)r[n][i]-=r[e][i]*r[n][e]/r[e][e];r[n][e]=0}}for(let e=0;e<t;++e)for(let n=r[e][e],i=0;i<2*t;++i)r[e][i]/=n;for(let e=t;--e>=0;)for(let n=e;--n>=0;)if(r[n][e])for(let i=2*t;--i>=t;)r[n][i]-=r[e][i]*r[n][e];return n.slice(0,t,t,t)}augment(e){var t=this.clone(),n=t.width;return e.each(function(e,r,i){t.set(r,i+n,e)}),t}slice(t,n,r,i){for(var a=new e(this.context),o=0;o<r;++o)for(var s=0;s<i;++s)a.set(o,s,this.get(t+o,n+s));return a}};function pm(e,t){if(e.constructor!==t.constructor)return!1;if(e instanceof V)return e.sheet==t.sheet&&e.row==t.row&&e.col==t.col&&e.rel==t.rel;if(e instanceof H)return pm(e.topLeft,t.topLeft)&&pm(e.bottomRight,t.bottomRight)&&e.endSheet==t.endSheet;if(e instanceof U){var n=e.refs.length;if(n!=t.refs.length)return!1;for(;--n>=0;)if(!pm(e.refs[n],t.refs[n]))return!1}return!0}let mm=class e{constructor(e,t,n,r,i,a,o){this.refs=e,this.handler=t,this.print=n,this.absrefs=null,this.sheet=r,this.row=i,this.col=a,this.onReady=[],this.pending=!1,this.arrayFormulaRange=o}setArrayFormulaRange(e){this.arrayFormulaRange=e.clone().setSheet(this.sheet)}clone(t,n,r,i){var a=t.toLowerCase(),o=this.refs,s=this.arrayFormulaRange;return(i||a!=this.sheet.toLowerCase())&&(o=o.map(function(e){return!e.hasSheet()&&(!e.sheet||e.sheet.toLowerCase()!=a)&&(e=e.clone().setSheet(t)),e}),s&&=s.clone().setSheet(t)),new e(o,this.handler,this.print,t,n,r,s)}deepClone(){var t=this.refs.map(function(e){return e.clone()});return new e(t,this.handler,this.print,this.sheet,this.row,this.col,this.arrayFormulaRange)}resolve(e){this.pending=!1,this.onReady.forEach(function(t){t(e)})}exec(e,t,n){if(`value`in this)t&&t(this.value);else{t&&this.onReady.push(t);let o=n;for(var r=new um(this.resolve,this,e,o),i=0;o;){if(o.formula===this){this.pending=!1,r.resolve(new W(`CIRCULAR`));return}o=o.parent,++i}if(this.pending)return;this.pending=!0;var a=function(){this.absrefs||=this.refs.map(function(e){return e.absolute(this.row,this.col)},this),this.handler.call(r)}.bind(this);i<20?a():setTimeout(a,0)}}reset(){this.onReady=[],this.pending=!1,delete this.value}renameSheet(e,t){e=e.toLowerCase(),this.absrefs=null,this.sheet.toLowerCase()==e&&(this.sheet=t),this.refs.forEach(function(n){n.renameSheet(e,t)})}adjust(t,n,r,i){t=t.toLowerCase();var a=this.row,o=this.col,s=this.sheet.toLowerCase(),c=!1;s==t&&(n==`row`&&a>=r&&(this.row+=i,c=!0),n==`col`&&o>=r&&(this.col+=i,c=!0));var l=this.row,u=this.col;this.absrefs=null;var d=this.refs,f=c;this.refs=d.map(function(e){var t=m(e);return!f&&!pm(t,e)&&(f=!0),t});var p=this.arrayFormulaRange;if(p&&(this.arrayFormulaRange=m(p),!f&&!pm(p,this.arrayFormulaRange)&&(f=!0)),f)return new e(d,this.handler,this.print,this.sheet,a,o,p);function m(e){return e===B?e:e.sheet.toLowerCase()==t?e.adjust(a,o,l,u,n==`row`,r,i):(c&&(n==`row`&&a>=r&&(e=e.relative(i,0)),n==`col`&&o>=r&&(e=e.relative(0,i))),e)}}toString(){return this.print(this.row,this.col)}};lm.if=function(e,t){var n=this,r=t[0],i=t[1],a=t[2];this.resolveCells([r],function(){var t=n.asMatrix(r);t?i(function(r){a(function(i){var a=n.asMatrix(r),o=n.asMatrix(i);e(t.map(function(e,t,s){return e instanceof W?e:n.bool(e)?a?a.get(t,s):r:o?o.get(t,s):i}))})}):(r=this.force(r),r instanceof W?e(r):n.bool(r)?i(e):a(e))})},lm.gr=function(e){e((1+Math.sqrt(5))/2)};function hm(e,t){var n=`function arrayArgs(args) { var xargs = [], width = 0, height = 0, arrays = [], i = 0; `,r=`function resolve(args, callback) { var toResolve = [], i = 0; `,i,a,o=`'use strict'; function check(args) { var stack = [], tmp, xargs = [], i = 0, m, err = 'VALUE'; `,s=!1,c=!1,l=!1;o+=t.map(d).join(``),o+=`if (i < args.length) return new CalcError('N/A'); `,o+=`return xargs; } `,n+=`return { args: xargs, width: width, height: height, arrays: arrays }; } `;var u;return s?(r+=`this.resolveCells(toResolve, callback); } `,u=Function(`kendo`,`CalcError`,`round`,`limitRef`,o+r+n+` return { resolve: resolve, check: check, arrayArgs: arrayArgs };`)):u=Function(`kendo`,`CalcError`,`round`,`limitRef`,o+` return { check: check };`),u=u(G.kendo,W,_m,gm),l||delete u.arrayArgs,u;function d(e){i=e[0];var t=`{ `;if(Array.isArray(i))n+=`while (i < args.length) { `,r+=`while (i < args.length) { `,t+=`xargs.push(tmp = []); stack.push(xargs); xargs = tmp; `,t+=`while (i < args.length) { `,t+=e.map(d).join(``),t+=`} `,t+=`xargs = stack.pop(); `,r+=`} `,n+=`} `;else if(i==`+`)n+=`while (i < args.length) { `,r+=`while (i < args.length) { `,t+=`if (i >= args.length) return new CalcError('N/A'); `,t+=`xargs.push(tmp = []); stack.push(xargs); xargs = tmp; `,t+=`do { `,t+=e.slice(1).map(d).join(``),t+=`} while (i < args.length); `,t+=`xargs = stack.pop(); `,r+=`} `,n+=`} `;else if(i==`?`)t+=`if (!(`+_(e[1])+`)) return new CalcError(err); `;else{var a=e[1];if(Array.isArray(a)&&/^#?collect/.test(a[0])){var o=/!$/.test(a[0]),s=a[2];f(),t+=`try {var $`+i+` = this.cellValues(args.slice(i`,s&&(t+=`, i + `+s),t+=`)`+(o?`,true`:``)+`).reduce(function(ret, $`+i+`){ `,a[0].charAt(0)!=`#`&&(t+=`if ($`+i+` instanceof CalcError) throw $`+i+`; `),t+=`if (`+_(a[1])+`) ret.push($`+i+`); `,t+=`return ret; `,t+=`}.bind(this), []); `,s?t+=`i += `+s+`; `:t+=`i = args.length; `,t+=`xargs.push($`+i+`)} catch(ex) { if (ex instanceof CalcError) return ex; throw ex; } `,r+=`toResolve.push(args.slice(i)); `}else if(a==`rest`)t+=`xargs.push(args.slice(i)); i = args.length; `;else{(c=/^\*/.test(i))&&(l=!0,i=i.substr(1)),t+=`var $`+i+` = args[i++]; `;var u=!1;/!$/.test(a)?(a=a.substr(0,a.length-1),u=!0):t+=`if ($`+i+` instanceof CalcError) return $`+i+`; `,t+=g(a,u)+`xargs.push($`+i+`); `}}return t+=`} `,t}function f(){return a?`$`+i:(s=!0,a=!0,r+=`toResolve.push(args[i++]); `,`($`+i+` = this.force($`+i+`))`)}function p(){return a?`$`+i:(s=!0,a=!0,r+=`toResolve.push(limitRef(args[i++], 'leftColumn')); `,`($`+i+` = this.force($`+i+`))`)}function m(){return a?`$`+i:(s=!0,a=!0,r+=`toResolve.push(limitRef(args[i++], 'topRow')); `,`($`+i+` = this.force($`+i+`))`)}function h(e){return`(`+(e?`(typeof `+f()+` == 'number' ? ($`+i+` = round($`+i+`), true) : false) || `:`(typeof `+f()+` == 'number') || `)+`(typeof $`+i+` == 'boolean' ? ($`+i+` = +$`+i+`, true) : false) || (typeof $`+i+` == 'string' && !/^(?:=|true|false)/i.test($`+i+`) ? (tmp = kendo.spreadsheet.calc.parse(0, 0, 0, $`+i+`), /^date|number|percent$/.test(tmp.type) ? ($`+i+` = +tmp.value, true) : false) : false))`}function g(e,t){a=!1;var o=`if (!(`+_(e)+`)) { `;return a&&!t&&(o+=` if ($`+i+` instanceof CalcError) return $`+i+`; `),o+=`return new CalcError(err); } `,a||(r+=`i++; `),c?n+=`var $`+i+` = this._arrayArg(args[i]); if ($`+i+`) { xargs.push($`+i+`); width = Math.max(width, $`+i+`.width); height = Math.max(height, $`+i+`.height); arrays.push(true) } else { xargs.push(args[i]); arrays.push(false); } i++; `:n+=`xargs.push(args[i++]); arrays.push(false); `,o}function _(e){if(Array.isArray(e)){if(e[0]==`or`)return`(`+e.slice(1).map(_).join(`) || (`)+`)`;if(e[0]==`and`)return`(`+e.slice(1).map(_).join(`) && (`)+`)`;if(e[0]==`values`)return`(`+e.slice(1).map(function(e){return f()+` === `+e}).join(`) || (`)+`)`;if(e[0]==`null`)return`(`+_(`null`)+` ? (($`+i+` = `+e[1]+`), true) : false)`;if(e[0]==`#null`)return`(`+_(`#null`)+` ? (($`+i+` = `+e[1]+`), true) : false)`;if(e[0]==`between`||e[0]==`[between]`)return`(`+f()+` >= `+e[1]+` && $`+i+` <= `+e[2]+` ? true : ((err = 'NUM'), false))`;if(e[0]==`(between)`)return`(`+f()+` > `+e[1]+` && $`+i+` < `+e[2]+` ? true : ((err = 'NUM'), false))`;if(e[0]==`(between]`)return`(`+f()+` > `+e[1]+` && $`+i+` <= `+e[2]+` ? true : ((err = 'NUM'), false))`;if(e[0]==`[between)`)return`(`+f()+` >= `+e[1]+` && $`+i+` < `+e[2]+` ? true : ((err = 'NUM'), false))`;if(e[0]==`assert`){var t=e[2]||`N/A`;return`((`+e[1]+`) ? true : (err = `+JSON.stringify(t)+`, false))`}if(e[0]==`not`)return`!(`+_(e[1])+`)`;throw Error(`Unknown array type condition: `+e[0])}if(e==`number`||e==`datetime`)return h(!0);if(e==`number!`)return`(typeof `+f()+` == 'number' ? ($`+i+` = round($`+i+`), true) : false)`;if(e==`integer`||e==`date`)return`(`+h()+` && (($`+i+` |= 0), true))`;if(e==`divisor`)return`(`+h(!0)+` && ($`+i+` == 0 ? ((err = 'DIV/0'), false) : true))`;if(e==`number+`)return`(`+h(!0)+` && ($`+i+` >= 0 ? true : ((err = 'NUM'), false)))`;if(e==`integer+`)return`(`+h()+` && (($`+i+` |= 0) >= 0 ? true : ((err = 'NUM'), false)))`;if(e==`number++`)return`(`+h(!0)+` && ($`+i+` > 0 ? true : ((err = 'NUM'), false)))`;if(e==`integer++`)return`(`+h()+` && (($`+i+` |= 0) > 0 ? true : ((err = 'NUM'), false)))`;if(e==`string`)return`((typeof `+f()+` == 'string' || typeof $`+i+` == 'boolean' || typeof $`+i+` == 'number') ? ($`+i+` += '', true) : ($`+i+` === undefined ? (($`+i+` = ''), true) : false))`;if(e==`boolean`)return`(typeof `+f()+` == 'boolean')`;if(e==`logical`)return`(typeof `+f()+` == 'boolean' || (typeof $`+i+` == 'number' ? ($`+i+` = !!$`+i+`, true) : false))`;if(e==`matrix`)return f(),`((m = this.asMatrix($`+i+`)) ? ($`+i+` = m) : false)`;if(e==`vlookup-matrix`)return p(),`((m = this.asMatrix($`+i+`)) ? ($`+i+` = m) : false)`;if(e==`hlookup-matrix`)return m(),`((m = this.asMatrix($`+i+`)) ? ($`+i+` = m) : false)`;if(e==`#matrix`)return`((m = this.asMatrix($`+i+`)) ? ($`+i+` = m) : false)`;if(e==`ref`)return`($`+i+` instanceof kendo.spreadsheet.Ref)`;if(e==`area`)return`($`+i+` instanceof kendo.spreadsheet.CellRef || $`+i+` instanceof kendo.spreadsheet.RangeRef)`;if(e==`cell`)return`($`+i+` instanceof kendo.spreadsheet.CellRef)`;if(e==`null`)return`(`+f()+` == null)`;if(e==`#null`)return`($`+i+` == null)`;if(e==`anyvalue`)return`(`+f()+` != null && i <= args.length)`;if(e==`forced`)return`(`+f()+`, i <= args.length)`;if(e==`anything`)return`(i <= args.length)`;if(e==`blank`)return`(`+f()+` == null || $`+i+` === '')`;throw Error(`Can't check for type: `+e)}}function gm(e,t){if(e instanceof H)switch(t){case`topRow`:return e.topRow();case`leftColumn`:return e.leftColumn()}return ret}function _m(e,t){return e===parseInt(e,10)?e:+e.toPrecision(t||16)}function vm(e,t){return typeof e==`number`?_m(e,t):e}function ym(e,t,n){if(n instanceof W)return n;try{return t.apply(e,n)}catch(e){if(e instanceof W)return e;throw e}}function bm(e,t,n,r){return function(i,a){function o(){if(r){let t=r.call(this,a);if(a=t.args,t.width>0&&t.height>0){let r=new fm(this);for(let i=0;i<t.height;++i)for(let o=0;o<t.width;++o){let s=[];for(let e=0;e<a.length;++e)t.arrays[e]?s[e]=a[e].getNA(i,o):s[e]=a[e];s=n.call(this,s),r.set(i,o,ym(this,e,s))}return i(r)}}let t=n.call(this,a);i(ym(this,e,t))}t?t.call(this,a,o):o.call(this)}}function xm(e,t,n,r){return function(i,a){function o(){if(r){let t=r.call(this,a);if(a=t.args,t.width>0&&t.height>0){let r=new fm(this),o=t.width*t.height,s=function(e,t){return function(n){if(r.set(e,t,n),--o,o===0)return i(r)}};for(let c=0;c<t.height&&o>0;++c)for(let l=0;l<t.width&&o>0;++l){let u=[];for(let e=0;e<a.length;++e)t.arrays[e]?u[e]=a[e].getNA(c,l):u[e]=a[e];if(u=n.call(this,u),u instanceof W){if(r.set(c,l,u),--o,o===0)return i(r)}else u.unshift(s(c,l)),e.apply(this,u)}return}}let t=n.call(this,a);t instanceof W?i(t):(t.unshift(i),e.apply(this,t))}t?t.call(this,a,o):o.call(this)}}function Sm(e,t){return e=e.toLowerCase(),lm[e]=t,{args:function(n,r){var i=hm(e,n);r&&(i.arrayArgs&&window.console.log(i.arrayArgs.toString()),i.resolve&&window.console.log(i.resolve.toString()),i.check&&window.console.log(i.check.toString()));var a=lm[e]=bm(t,i.resolve,i.check,i.arrayArgs);return a.kendoSpreadsheetArgs=n,this},argsAsync:function(n,r){var i=hm(e,n);r&&(i.arrayArgs&&window.console.log(i.arrayArgs.toString()),i.resolve&&window.console.log(i.resolve.toString()),i.check&&window.console.log(i.check.toString()));var a=lm[e]=xm(t,i.resolve,i.check,i.arrayArgs);return a.kendoSpreadsheetArgs=n,this}}}function Cm(e,t,n,r){e=e.toLowerCase(),lm[e]=t?xm(r,n.resolve,n.check,n.arrayArgs):bm(r,n.resolve,n.check,n.arrayArgs)}function wm(e,t,n){return t++,(1461*(e+4800+((t-14)/12|0))/4|0)+(367*(t-2-12*((t-14)/12|0))/12|0)-(3*((e+4900+((t-14)/12|0))/100|0)/4|0)+n-32075}function Tm(e){var t=e+68569,n=4*t/146097|0,r,i,a,o,s;return t-=(146097*n+3)/4|0,i=4e3*(t+1)/1461001|0,t=t-(1461*i/4|0)+31,r=80*t/2447|0,o=t-(2447*r/80|0),t=r/11|0,a=r+2-12*t,s=100*(n-49)+i+t,a--,{year:s,month:a,date:o,day:(e+1)%7,ord:Om[km(s)][a]+o}}var Em=wm(1900,0,-1),Dm=[31,28,31,30,31,30,31,31,30,31,30,31],Om=[[0,31,59,90,120,151,181,212,243,273,304,334],[0,31,60,91,121,152,182,213,244,274,305,335]];function km(e){return e%4?0:e%100?1:e%400?0:1}function Am(e){return km(e)?366:365}function jm(e,t){return km(e)&&t==1?29:Dm[t]}function Mm(e,t,n){return t>=1&&t<=12&&n>=1&&n<=jm(e,t-1)}function Nm(e){return Tm((e|0)+Em)}function Pm(e,t,n){return wm(e,t,n)-Em}var Fm=60*1e3,Im=60*Fm,Lm=24*Im;function Rm(e){var t=e-(e|0);t<0&&t++;var n=Math.round(Lm*t),r=Math.floor(n/Im);n-=r*Im;var i=Math.floor(n/Fm);n-=i*Fm;var a=Math.floor(n/1e3);return n-=a*1e3,{hours:r,minutes:i,seconds:a,milliseconds:n}}function zm(e){var t=Nm(e),n=Rm(e);return new Date(t.year,t.month,t.date,n.hours,n.minutes,n.seconds,n.milliseconds)}function Bm(e,t,n,r){return(e+(t+(n+r/1e3)/60)/60)/24}function Vm(e){var t=Bm(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds());return e=Pm(e.getFullYear(),e.getMonth(),e.getDate()),e<0?e-1+t:e+t}function Hm(e,t){t&&=G.formatting.makeDateFormat(t);let n=om().parseDate;return n(e,t)||n(e)||n(e,[`MMMM dd yyyy`,`MMMM dd yy`,`MMM dd yyyy`,`MMM dd yy`,`dd MMMM yyyy`,`dd MMMM yy`,`dd MMM yyyy`,`dd MMM yy`,`MMMM dd, yyyy`,`MMMM dd, yy`,`MMM dd, yyyy`,`MMM dd, yy`,`MMMM dd`,`MMM dd`,`MMMM yyyy`,`MMM yyyy`,`dd MMMM`,`dd MMM`])}function Um(e,t){var n=lm[t];if(!n)throw Error(`Function `+t+` is not yet defined`);n.kendoSpreadsheetAliases||=[t],n.kendoSpreadsheetAliases.push(e),lm[e]=n}var Wm=class{constructor(e,t){this.message=e,this.pos=t}toString(){return this.message}};function Gm(e){let t=0;return{next:r,peek:i,eof:a,croak:o,readWhile:u,readEscaped:l,lookingAt:d,skip:s,forward:c,pos:n};function n(){return t}function r(){return e.charAt(t++)}function i(){return e.charAt(t)}function a(){return i()===``}function o(n){throw new Wm(n+` (input: `+e+`)`,t)}function s(n){if(typeof n==`string`)e.substr(t,n.length)!==n&&o(`Expected `+n),c(n.length);else if(n instanceof RegExp){let r=n.exec(e.substr(t));if(r)return c(r[0].length),r}else c(n[0].length)}function c(e){for(;e-->0;)r()}function l(e){let t=!1,n=``;for(;!a();){let i=r();if(t)n+=i,t=!1;else if(i===`\\`)t=!0;else if(i===e)break;else n+=i}return n}function u(e){let t=``;for(;!a()&&e(i(),t);)t+=r();return t}function d(n){return n.exec(e.substr(t))}}G.runtime.CalcError=W,G.runtime.Formula=mm,G.runtime.Matrix=fm,G.runtime.packDate=Pm,G.runtime.unpackDate=Nm,G.runtime.packTime=Bm,G.runtime.unpackTime=Rm,G.runtime.serialToDate=zm,G.runtime.dateToSerial=Vm,G.runtime.daysInMonth=jm,G.runtime.validDate=Mm,G.runtime.isLeapYear=km,G.runtime.daysInYear=Am,G.runtime.parseDate=Hm,G.runtime.limitPrecision=_m,G.runtime.limitRef=gm,G.runtime.defineBuiltinFunction=Cm,G.runtime.defineAlias=Um,G.runtime.InputStream=Gm,G.runtime.ParseError=Wm;function Km(){this.node=null}Km.prototype={remove:function(){this.node.parentNode&&this.node.parentNode.removeChild(this.node),this.attr={}},attr:{},text:function(){return``}};function qm(){}qm.prototype={nodeName:`#null`,attr:{style:{}},children:[],remove:function(){}};let Jm=new qm;function Ym(e,t,n){this.nodeName=e,this.attr=t||{},this.children=n||[]}Ym.prototype=new Km,Ym.prototype.appendTo=function(e){let t=typeof this.nodeName==`string`?document.createElement(this.nodeName):this.nodeName,n=this.children;for(let e=0;e<n.length;e++)n[e].render(t,Jm);return e.appendChild(t),t},Ym.prototype.render=function(e,t){let n;if(t.nodeName!==this.nodeName)t.remove(),n=this.appendTo(e);else{n=t.node;let r,i=this.children,a=i.length,o=t.children,s=o.length;if(Math.abs(s-a)>2){this.render({appendChild:function(n){e.replaceChild(n,t.node)}},Jm);return}for(r=0;r<a;r++)i[r].render(n,o[r]||Jm);for(r=a;r<s;r++)o[r].remove()}this.node=n,this.syncAttributes(t.attr),this.removeAttributes(t.attr)},Ym.prototype.syncAttributes=function(e){let t=this.attr;for(let n in t){let r=t[n],i=e[n];n===`style`?this.setStyle(r,i):r!==i&&this.setAttribute(n,r,i)}},Ym.prototype.setStyle=function(e,t){let n=this.node,r;if(t)for(r in e)e[r]!==t[r]&&(n.style[r]=e[r]);else for(r in e)n.style[r]=e[r]},Ym.prototype.removeStyle=function(e){let t=this.attr.style||{},n=this.node;for(let r in e)t[r]===void 0&&(n.style[r]=``)},Ym.prototype.removeAttributes=function(e){let t=this.attr;for(let n in e)n===`style`?this.removeStyle(e.style):t[n]===void 0&&this.removeAttribute(n)},Ym.prototype.removeAttribute=function(e){let t=this.node;e===`style`?t.style.cssText=``:e===`className`?t.className=``:t.removeAttribute(e)},Ym.prototype.setAttribute=function(e,t){let n=this.node;n[e]===void 0?n.setAttribute(e,t):n[e]=t},Ym.prototype.text=function(){let e=``;for(let t=0;t<this.children.length;++t)e+=this.children[t].text();return e};function Xm(e){this.nodeValue=String(e)}Xm.prototype=new Km,Xm.prototype.nodeName=`#text`,Xm.prototype.render=function(e,t){let n;t.nodeName===this.nodeName?(n=t.node,this.nodeValue!==t.nodeValue&&n.parentNode&&(n.nodeValue=this.nodeValue)):(t.remove(),n=document.createTextNode(this.nodeValue),e.appendChild(n)),this.node=n},Xm.prototype.text=function(){return this.nodeValue};function Zm(e){this.html=e}Zm.prototype={nodeName:`#html`,attr:{},remove:function(){for(let e=0;e<this.nodes.length;e++){let t=this.nodes[e];t.parentNode&&t.parentNode.removeChild(t)}},render:function(e,t){if(t.nodeName!==this.nodeName||t.html!==this.html){t.remove();let n=e.lastChild;Qm(e,this.html),this.nodes=[];for(let t=n?n.nextSibling:e.firstChild;t;t=t.nextSibling)this.nodes.push(t)}else this.nodes=t.nodes.slice(0)}};function Qm(e,t){let n=document.createElement(`div`);for(n.innerHTML=t;n.firstChild;)e.appendChild(n.firstChild)}function $m(e){return new Zm(e)}function eh(e,t,n){return new Ym(e,t,n)}function th(e){return new Xm(e)}function nh(e){this.root=e,this.children=[]}nh.prototype={html:$m,element:eh,text:th,render:function(e){let t=this.children,n,r;for(n=0,r=e.length;n<r;n++){let r=t[n];r?(!r.node||!r.node.parentNode)&&(r.remove(),r=Jm):r=Jm,e[n].render(this.root,r)}for(n=r;n<t.length;n++)t[n].remove();this.children=e}};let K={html:$m,text:th,element:eh,Tree:nh,Node:Km},rh=/^\[(black|green|white|blue|magenta|yellow|cyan|red)\]/i,ih=/^\[(<=|>=|<>|<|>|=)(-?[0-9.]+)\]/;function ah(e){e=G.runtime.InputStream(e);let t=[],n=!1,r;for(;!e.eof();){let e=l();t.push(e),e.cond&&(n=!0)}return n||(t.length===1?t[0].cond=`num`:t.length===2?(t[0].cond={op:`>=`,value:0},t[1].cond={op:`<`,value:0}):t.length>=3&&(t[0].cond={op:`>`,value:0},t[1].cond={op:`<`,value:0},t[2].cond={op:`=`,value:0},t.length>3&&(t[3].cond=`text`,t=t.slice(0,4)))),t;function i(){let t=e.skip(rh);if(t)return t[1].toLowerCase()}function a(){let t=e.skip(ih);if(t){let e=parseFloat(t[2]);if(!isNaN(e))return{op:t[1],value:e,custom:!0}}}function o(){let t=[],n,r=null;for(;!e.eof()&&(n=c());)n.type===`date`?r&&/^(el)?time$/.test(r.type)&&r.part===`h`&&n.part===`m`&&n.format<3&&(n.type=`time`):/^(el)?time$/.test(n.type)&&n.part===`s`&&r&&r.type===`date`&&r.part===`m`&&r.format<3&&(r.type=`time`),/^(?:str|space|fill)$/.test(n.type)||(r=n),t.push(n);return t}function s(t){if(t.type!==`date`||t.part===`m`&&t.format<3){let n=e.skip(/^\.(0+)/);n&&(t.fraction=n[1].length,t.type===`date`&&(t.type=`time`))}return t}function c(){let t,n;if(n=e.skip(/^([#0?]+)(?:,([#0?]+))+/))return{type:`digit`,sep:!0,format:n[1]+n[2],decimal:r};if(n=e.skip(/^[#0?]+/))return{type:`digit`,sep:!1,format:n[0],decimal:r};if(n=e.skip(/^(e)([+-])/i))return{type:`exp`,ch:n[1],sign:n[2]};if(n=e.skip(/^(d{1,4}|m{1,5}|yyyy|yy|y)/i))return n=n[1].toLowerCase(),s({type:`date`,part:n.charAt(0),format:n.length});if(n=e.skip(/^(hh?|ss?)/i))return n=n[1].toLowerCase(),s({type:`time`,part:n.charAt(0),format:n.length});if(n=e.skip(/^\[(hh?|mm?|ss?)\]/i))return n=n[1].toLowerCase(),s({type:`eltime`,part:n.charAt(0),format:n.length});if(n=e.skip(/^(a[.]?m[.]?\/p[.]?m[.]?|a\/p)/i))return n=n[1].split(`/`),{type:`ampm`,am:n[0],pm:n[1]};switch(t=e.next()){case`;`:return null;case`\\`:return{type:`str`,value:e.next()};case`"`:return{type:`str`,value:e.readEscaped(t)};case`@`:return{type:`text`};case`_`:return{type:`space`,value:e.next()};case`*`:return{type:`fill`,value:e.next()};case`.`:return e.lookingAt(/^\s*[#0?]/)?(r=!0,{type:`dec`}):{type:`str`,value:`.`};case`%`:return{type:`percent`};case`,`:return{type:`comma`}}return{type:`str`,value:t}}function l(){r=!1;let e=i(),t=a();return!e&&t&&(e=i()),{color:e,cond:t,body:o()}}}function oh(e){return e.map(t).join(`;`);function t(e){let t=``;return e.color&&(t+=`[`+e.color+`]`),e.cond&&e.cond!==`text`&&e.cond!==`num`&&(t+=`[`+e.cond.op+e.cond.value+`]`),t+=e.body.map(r).join(``),t}function n(e,t){return t.fraction&&(e+=`.`+hh(``,t.fraction,`0`)),e}function r(e){if(e.type===`digit`)return e.sep?e.format.charAt(0)+`,`+e.format.substr(1):e.format;if(e.type===`exp`)return e.ch+e.sign;if(e.type===`date`||e.type===`time`)return n(hh(``,e.format,e.part),e);if(e.type===`eltime`)return n(`[`+hh(``,e.format,e.part)+`]`,e);if(e.type===`ampm`)return e.am+`/`+e.pm;if(e.type===`str`)return JSON.stringify(e.value);if(e.type===`text`)return`@`;if(e.type===`space`)return`_`+e.value;if(e.type===`fill`)return`*`+e.value;if(e.type===`dec`)return`.`;if(e.type===`percent`)return`%`;if(e.type===`comma`)return`,`}}function sh(e,t){e.forEach(function(e){let n=t;if(e.cond===`text`)return;let r=e.body,i=!1,a=r.length;for(;n!==0&&--a>=0;){let e=r[a];if(e.type===`digit`){if(e.decimal){if(i=!0,n>0)e.format+=hh(``,n,`0`);else if(n<0){let t=e.format.length;e.format=e.format.substr(0,t+n),n+=t-e.format.length}if(e.format.length===0)for(r.splice(a,1);--a>=0;){if(e=r[a],e.type===`digit`&&e.decimal){++a;break}if(e.type===`dec`){r.splice(a,1);break}}}if(n>0)break}}!i&&n>0&&r.splice(a+1,0,{type:`dec`},{type:`digit`,sep:!1,decimal:!0,format:hh(``,n,`0`)})})}function ch(e){let t=0;return{next:function(){return e[t++]},eof:function(){return t>=e.length},ahead:function(n,r){if(t+n<=e.length){let i=r.apply(null,e.slice(t,t+n));return i&&(t+=n),i}},restart:function(){t=0}}}let lh={unpackDate:G.runtime.unpackDate,unpackTime:G.runtime.unpackTime,date:function(e,t,n,r){switch(n){case`d`:switch(r){case 1:return t.date;case 2:return hh(t.date,2,`0`);case 3:return e.calendar.days.format.abbreviated[t.day];case 4:return e.calendar.days.format.wide[t.day]}break;case`m`:switch(r){case 1:return t.month+1;case 2:return hh(t.month+1,2,`0`);case 3:return e.calendar.months.format.abbreviated[t.month];case 4:return e.calendar.months.format.wide[t.month];case 5:return e.calendar.months.format.narrow[t.month]}break;case`y`:switch(r){case 1:return t.year;case 2:return t.year%100;case 4:return t.year}break}return`##`},time:function(e,t,n,r,i){let a,o;switch(t){case`h`:a=hh(r?e.hours%12||12:e.hours,n,`0`),i&&(o=(e.minutes+(e.seconds+e.milliseconds/1e3)/60)/60);break;case`m`:a=hh(e.minutes,n,`0`),i&&(o=(e.seconds+e.milliseconds/1e3)/60);break;case`s`:a=hh(e.seconds,n,`0`),i&&(o=e.milliseconds/1e3);break}return o&&(a+=lh.toFixed(o,i).replace(/^0+/,``)),a},eltime:function(e,t,n,r){let i,a;switch(t){case`h`:i=e*24;break;case`m`:i=e*24*60;break;case`s`:i=e*24*60*60;break}return r&&(a=i-(i|0)),i=hh(i|0,n,`0`),a&&(i+=lh.toFixed(a,r).replace(/^0+/,``)),i},fill:function(e){return e},formatInt:function(e,t,n,r,i){t=lh.toFixed(t,r).replace(/\..*$/,``);let a=n[n.length-1];r>0&&a[n.length-1]!=`0`&&(t===`0`?t=``:t===`-0`&&(t=`-`));let o=!1,s=t.length-1,c=[],l=0,u;function d(t,n){i&&l&&l%3==0&&/^[0-9]$/.test(t)&&(u=e.numbers.symbols.group+u),n&&t===`-`&&(o=!0,t=`0`),u=t+u,l++}for(let e=n.length;--e>=0;){let r=n[e];u=``;for(let e=r.length;--e>=0;){let n=r.charAt(e);s<0?n==`0`?d(`0`):n==`?`&&d(` `):(t==`0`&&n==`?`?d(` `):n==`0`?d(t.charAt(s),!0):d(t.charAt(s)),s--)}if(e===0)for(;s>=0;)d(t.charAt(s--));c.unshift(u)}return o&&(c[0]=`-`+c[0]),c},formatDec:function(e,t,n){e=lh.toFixed(e,n);let r=e.indexOf(`.`);e=r>=0?e.substr(r+1).replace(/0+$/,``):``;let i=0,a=[];for(let n=0;n<t.length;++n){let r=t[n],o=``;for(let t=0;t<r.length;++t){let n=r.charAt(t);i<e.length?o+=e.charAt(i++):n==`0`?o+=`0`:n==`?`&&(o+=` `)}a.push(o)}return a},toFixed:function(e,t){return(function e(n,r){if(!isFinite(n))return`#NUM!`;if(n<0)return`-`+e(-n);if(t===0)return String(Math.round(n));if(n===Math.round(n)&&!/e/i.test(String(n)))return n.toFixed(t);let i=_h(n),a=i.intpart,o=i.decpart;if(o.length<=t){for(;o.length<t;)o+=`0`;return a+`.`+o}if(r)return a+`.`+o.substr(0,t);let s=10**t;return e(Math.round(n*s)/s,!0)})(Number(e.toFixed(14)))}};function uh(e,t,n){switch(e.op){case`=`:return t==n;case`<`:return t<n;case`>`:return t>n;case`<=`:return t<=n;case`>=`:return t>=n}throw Error(`Unknown condition operator: ${JSON.stringify(e)}`)}function dh(e){let t=ch(e.body),n=!1,r=!1,i=!1,a=0,o=/[\$\xA2-\xA5\u058F\u060B\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BD\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6]/,s=0,c=!1,l=0,u=[],d=[],f=e.cond;function p(e,t){(e.type===`digit`&&t.type===`comma`||e.type===`comma`&&e.hidden&&t.type===`comma`)&&(t.hidden=!0,s++)}for(;!t.eof();){t.ahead(2,p);let e=t.next();e.type===`percent`?a++:e.type===`digit`?e.decimal?(l+=e.format.length,d.push(e.format)):(u.push(e.format),e.sep&&(c=!0)):e.type===`time`?r=!0:e.type===`date`?n=!0:e.type===`ampm`&&(i=r=!0)}return function(p,m,h){let g,_,v,y,b;if(f===`text`){if(!(typeof m==`string`||m instanceof W))return!1}else if(f===`num`){if(typeof m!=`number`)return!1}else if(f){if(typeof m!=`number`||!uh(f,m,f.value))return!1;f.custom||(m=Math.abs(m))}if((a>0||s>0||u.length||d.length||n||r)&&typeof m!=`number`)return!1;e.color&&(p.color=e.color),a>0&&(m*=100**a),s>0&&(m/=1e3**s),u.length&&(g=lh.formatInt(h,m,u,l,c),v=parseInt(g[0])<0),d.length&&(_=lh.formatDec(m,d,l)),(u.length||d.length)&&(p.type=`number`),n&&(y=lh.unpackDate(m)),r&&(b=lh.unpackTime(m)),(n||r)&&(p.type=`date`);let x=!1,S=``;for(t.restart();!t.eof();){let e=t.next();e.type===`dec`?S+=h.numbers.symbols.decimal:e.type===`comma`&&!e.hidden?S+=`,`:e.type===`percent`?(p.type=`percent`,S+=h.numbers.symbols.percentSign):e.type===`str`?(o.test(e.value)&&(p.type=`currency`,v&&(S+=`-`,x=!0)),S+=e.value):e.type===`text`?(p.type=`text`,S+=m):e.type===`space`?(S&&p.body.push(S),S=``,p.body.push(e)):e.type===`fill`?S+=lh.fill(e.value):e.type===`digit`?(v&&g[0]&&x&&(g[0]=g[0].replace(`-`,``)),S+=e.decimal?_.shift():g.shift()):e.type===`date`?S+=lh.date(h,y,e.part,e.format):e.type===`time`?S+=lh.time(b,e.part,e.format,i,e.fraction):e.type===`eltime`?S+=lh.eltime(m,e.part,e.format,e.fraction):e.type===`ampm`&&(S+=b.hours<12?e.am:e.pm)}return S&&p.body.push(S),!0}}let fh=dh({cond:`text`,body:[{type:`text`}]}),ph=Pp(function(e){let t=ah(e).map(dh);return t.push(fh),function(e,n=sm()){let r={body:[]};for(let i=0;i<t.length&&!t[i](r,e,n);++i);return r}}),mh=Pp(function(e){let t=ah(e),n,r=!1,i=!1;for(let e=0;e<t.length;++e){n=t[e];for(let e=0;e<n.body.length;++e)/^(?:date|time|ampm)$/.test(n.body[e].type)&&(r=!0,n.body[e].type===`ampm`&&(i=!0));if(r)break}if(!r)return null;return n.body.map(o).join(``);function a(e,t){return t.fraction&&(e+=hh(``,Math.max(t.fraction,3),`f`)),e}function o(e){if(e.type===`digit`)return e.sep?e.format.charAt(0)+`,`+e.format.substr(1):e.format;if(e.type===`exp`)return e.ch+e.sign;if(e.type===`date`||e.type===`time`){let t=e.part;return e.type===`date`&&/^m/.test(t)?t=`M`:e.type===`time`&&/^h/.test(t)&&(i||(t=t.toUpperCase())),a(hh(``,e.format,t),e)}else if(e.type===`ampm`)return`tt`;else if(e.type===`str`)return e.value;else if(e.type===`space`)return` `;else if(e.type===`dec`)return`.`;else if(e.type===`percent`)return`%`;else if(e.type===`comma`)return`,`;else return``}});function hh(e,t,n){for(e+=``;e.length<t;)e=n+e;return e}function gh(e,t,n){for(e+=``;e.length<t;)e+=n;return e}function _h(e){let t=String(e).toLowerCase(),n,r,i,a=t.indexOf(`.`);if(a<0?(a=t.indexOf(`e`),a<0?(n=t,r=``):(n=t.substr(0,a),r=t.substr(a))):(n=t.substr(0,a),r=t.substr(a+1)),i=/(\d*)e([-+]?\d+)/.exec(r)){let e=parseInt(i[2],10);e>=0?(r=gh(i[1],e,`0`),n+=r.substr(0,e),r=r.substr(e)):(n=hh(n,-e,`0`),r=n.substr(e)+i[1],n=n.substr(0,n.length+e))}return{intpart:n||`0`,decpart:r}}function vh(e){let t=e.body,n=``;for(let e=0;e<t.length;++e){let r=t[e];typeof r==`string`?n+=r:r.type===`space`&&(n+=` `)}return n}let yh={compile:ph,parse:ah,format:function(e,t,n){let r=ph(t)(e,n),i=K.element(`span`);i.__dataType=r.type;let a=r.body;r.color&&(i.attr.style={color:r.color});for(let e=0;e<a.length;++e){let t=a[e];typeof t==`string`?i.children.push(K.text(t)):t.type===`space`&&i.children.push(K.element(`span`,{style:{visibility:`hidden`}},[K.text(t.value)]))}return i},text:function(e,t,n){return vh(ph(t)(e,n))},textAndColor:function(e,t,n){let r=ph(t)(e,n);return{text:vh(r),color:r.color,type:r.type}},type:function(e,t,n){return ph(t)(e,n).type},adjustDecimals:function(e,t){let n=ah(e);return sh(n,t),oh(n)},makeDateFormat:mh};G.kendo=cm(G,W,z,V,H),G.formatting=yh;let bh=Object.create(null),xh=Object.create(null);(function(e){e.forEach(function(t,n){t.forEach(function(t){bh[t]=e.length-n,xh[t===`,`?`;`:t]=e.length-n})})})([[`:`],[` `],[`,`],[`%`],[`^`],[`*`,`/`],[`+`,`-`],[`&`],[`=`,`<`,`>`,`<=`,`>=`,`<>`]]);let Sh=bh,Ch={DEC:`.`,ARG:`,`,COL:`,`};function wh(e){Ch.DEC=e,Ch.ARG=e===`,`?`;`:`,`,Ch.COL=e===`,`?`\\`:`,`,Sh=e===`,`?xh:bh}G.withDecimalSeparator=function(e,t){if(Ch.DEC===e)return t();let n=Ch.DEC;wh(e);try{return t()}finally{wh(n)}},G._separators=Ch;let Th={type:`bool`,value:!0},Eh={type:`bool`,value:!1};function Dh(e){e=e.toUpperCase();let t=0;for(let n=0;n<e.length;++n)t=t*26+e.charCodeAt(n)-64;return t-1}function Oh(e){return parseInt(e,10)-1}function kh(e,t){if(e.toLowerCase()===`#sheet`)return Dp;OUT:{let t;if(t=/^(\$)?([a-z]+)(\$)?(\d+)$/i.exec(e)){let e=Oh(t[4]),n=Dh(t[2]);if(e<1048576&&n<16384)return new V(Oh(t[4]),Dh(t[2]));break OUT}let n=Jh(e,{}),r=[];for(;;){let e=n.next();if(e instanceof V)e.rel=0;else if(e instanceof H)e.topLeft.rel=0,e.bottomRight.rel=0;else break OUT;if(r.push(e),n.eof())break;if(!n.is(`op`,Ch.ARG))break OUT;n.next()}return r.length===1?r[0]:new U(r)}if(!t)throw Error(`Cannot parse reference: `+e)}function Ah(e,t,n,r){let i=[];r=Jh(r,{row:t,col:n});let a=r.is;return{type:`exp`,ast:c(!0),refs:i,sheet:e,row:t,col:n};function o(e){return e.index=i.length,i.push(e),e}function s(e,t,n){if(a(e,t))return r.next();{let i=r.peek();i?r.croak(`Expected `+e+` «`+t+`» but found `+i.type+` «`+i.value+`»`):n||r.croak(`Expected `+e+` «`+t+`»`)}}function c(e){return g(m(f()),0,e)}function l(e){return e.upper===`TRUE`||e.upper===`FALSE`?e.upper===`TRUE`?Th:Eh:o(new Tp(e.value))}function u(){let e=r.next();e=e.value,s(`punc`,`(`);let t=[];for(;!a(`punc`,`)`);){if(a(`op`,Ch.ARG)){t.push({type:`null`}),r.next();continue}if(t.push(c(!1)),r.eof()||a(`punc`,`)`))break;s(`op`,Ch.ARG)}return s(`punc`,`)`,!0),{type:`func`,func:e,args:t}}function d(t){return t.hasSheet()||t.setSheet(e),o(t)}function f(){let e;return a(`ref`)?e=d(r.next()):a(`func`)?e=u():a(`punc`,`(`)?(r.next(),e=c(!0),s(`punc`,`)`,!0)):a(`punc`,`{`)?(r.next(),e=p(),s(`punc`,`}`,!0)):a(`num`)||a(`str`)||a(`error`)?e=r.next():a(`sym`)?e=l(r.next()):a(`op`,`+`)||a(`op`,`-`)?e={type:`prefix`,op:r.next().value,exp:f()}:r.peek()?a(`punc`,`[`)?r.croak(`External reference not supported`):r.croak(`Parse error`):r.croak(`Incomplete expression`),h(e)}function p(){let e=[],t=[e],n=!0;for(;!r.eof()&&!a(`punc`,`}`);)n?n=!1:a(null,`;`)?(t.push(e=[]),r.next()):s(null,Ch.COL),e.push(c(!1));return{type:`matrix`,value:t}}function m(e){return a(`punc`,`(`)||a(`ref`)||a(`num`)||a(`func`)?{type:`binary`,op:` `,left:e,right:c(!1)}:e}function h(e){return a(`op`,`%`)?(r.next(),h({type:`postfix`,op:`%`,exp:e})):e}function g(e,t,n){let i=a(`op`);if(i&&(n||i.value!==Ch.ARG)){let a=Sh[i.value];if(a>t){r.next();let o=g(f(),a,n);return g({type:`binary`,op:i.value===`;`?`,`:i.value,left:e,right:o},t,n)}}return e}}function jh(e,t){let n=Ah(null,0,0,e);if(!(n.ast instanceof Tp))throw new G.runtime.ParseError(`Invalid name: `+e);if(n=n.ast,!(t instanceof z)){let e=Ah(n.sheet,0,0,t);t=e.ast instanceof z?e.ast:/^(?:str|num|bool|error)$/.test(e.ast.type)?e.ast.value:Kh(e)}return{name:n,value:t}}function Mh(e,t,n,r,i){return a(e.ast,e,0);function a(e,s,c){switch(e.type){case`num`:return G._separators.DEC==`.`?JSON.stringify(e.value):JSON.stringify(e.value).replace(`.`,G._separators.DEC);case`bool`:return e.value;case`error`:return`#`+e.value;case`str`:return JSON.stringify(e.value);case`ref`:return l(()=>t[e.index].print(n,r,i));case`prefix`:return l(()=>e.op+a(e.exp,e,Sh[e.op]));case`postfix`:return l(()=>a(e.exp,e,Sh[e.op])+e.op);case`binary`:return l(()=>{let t=o(a(e.left,e,Sh[e.op]),e.left instanceof Tp&&e.op===`:`),n=o(a(e.right,e,Sh[e.op]),e.right instanceof Tp&&e.op===`:`);return/^[,;]/.test(e.op)?t+G._separators.ARG+n:t+e.op+n});case`func`:return e.func+`(`+e.args.map(t=>a(t,e,0)).join(G._separators.ARG+` `)+`)`;case`matrix`:return`{ `+e.value.map(t=>t.map(t=>a(t,e,0)).join(G._separators.COL)).join(`; `)+` }`;case`null`:return``}throw Error(`Cannot print node `+e.type);function l(t){let n=e.op,r=Sh[n]<c||!c&&n===`,`||s.type===`prefix`&&c===Sh[n]&&s.op===`-`||s.type===`binary`&&c===Sh[n]&&e===s.right;return o(t(),r)}}function o(e,t){return t?`(`+e+`)`:e}}function Nh(e){return function(t,n,r){return Mh(e,this.refs,t,n,r)}}function Ph(e,t,n){return t.ref===`name`?e.fetchName(t,n):n(e.formula.absrefs[t.index])}function Fh(e,t,n,r,i){return Uh(e,t,t=>e.func(`if`,i,[t,t=>Uh(e,n,t),t=>Uh(e,r,t)]))}function Ih(e,t,n){return t.length===0?n(!0):t.length===1?Uh(e,t[0],t=>n(e.bool(t))):Uh(e,t[0],r=>e.bool(r)?Ih(e,t.slice(1),n):n(!1))}function Lh(e,t,n){return t.length===0?n(!1):t.length===1?Uh(e,t[0],t=>n(e.bool(t))):Uh(e,t[0],r=>e.bool(r)?n(!0):Lh(e,t.slice(1),n))}function Rh(e,t,n){switch(t.func.toLowerCase()){case`if`:return Fh(e,t.args[0],t.args[1]||Th,t.args[2]||Eh,n);case`and`:return Ih(e,t.args,n);case`or`:return Lh(e,t.args,n);case`true`:return n(!0);case`false`:return n(!1)}return zh(e,t.args,0,r=>e.func(t.func,n,r))}function zh(e,t,n,r,i=[]){return n===t.length?r(i):Uh(e,t[n],a=>(i[n]=a,zh(e,t,n+1,r,i)))}function Bh(e,t,n){return Uh(e,t.left,r=>Uh(e,t.right,i=>e.func(`binary`+t.op,n,[r,i])))}function Vh(e,t,n){return Uh(e,t.exp,r=>e.func(`unary`+t.op,n,[r]))}function Hh(e,{value:t},n){let r=[];return(function i(a){return a===t.length?n(r):zh(e,t[a],0,e=>(r[a]=e,i(a+1)))})(0)}function Uh(e,t,n){switch(t.type){case`ref`:return Ph(e,t,n);case`num`:case`str`:case`null`:case`bool`:return n(t.value);case`error`:return n(e.error(t.value));case`prefix`:case`postfix`:return Vh(e,t,n);case`binary`:return Bh(e,t,n);case`func`:return Rh(e,t,n);case`matrix`:return Hh(e,t,n)}throw Error(`Cannot evaluate `+t.type)}function Wh({ast:e}){return function(){return Uh(this,e,e=>this.resolve(e))}}let Gh=Object.create(null);function Kh(e){let t=Nh(e),n=t.call(e),r=Gh[n];return r?r.clone(e.sheet,e.row,e.col):(r=new G.runtime.Formula(e.refs,Wh(e),t,e.sheet,e.row,e.col),Gh[n]=r.clone(e.sheet,e.row,e.col),r)}function qh(e){return e}function Jh(e,t){e=Zh(G.runtime.InputStream(e),t);let n=e.ahead,r=e.skip,i=null,a=t.row!=null&&t.col!=null?function(e){return e.rel&1&&(e.col-=t.col),e.rel&2&&(e.row-=t.row),e}:qh,o=t.forEditor?function(e,t,n){return e.begin=t.begin,e.end=n.end,e}:qh;return{peek:c,next:l,croak:e.croak,eof:e.eof,is:s};function s(e,t){let n=c();return n!=null&&(e==null||n.type===e)&&(t==null||n.value===t)?n:null}function c(){return i??=u(),i}function l(){if(i!=null){let e=i;return i=null,e}return u()}function u(){let t,r=e.peek();return r&&((r.type===`sym`||r.type===`rc`||r.type===`num`)&&(t=n(8,f)||n(6,p)||n(6,m)||n(4,h)||n(4,g)||n(2,_)||n(2,v)),t||=e.next()),t}function d(n,r){if(n.type===`rc`)return n.rel&&!t.forEditor&&(t.row==null||t.col==null)&&e.croak(`Cannot read relative cell in RC notation`),new V(n.row,n.col,n.rel);if(n.type===`num`)return n.value<=1048577?a(new V(Oh(n.value),r?-1/0:1/0,2)):null;let i=n.value,o=/^(\$)?([a-z]+)(\$)?(\d+)$/i.exec(i);if(o){let e=Oh(o[4]),t=Dh(o[2]);return e<=1048576&&t<=16383?a(new V(Oh(o[4]),Dh(o[2]),!o[1]|(o[3]?0:2))):null}let s=i.charAt(0)===`$`;if(s&&(i=i.substr(1)),/^\d+$/.test(i)){if(Oh(i)<=1048576)return a(new V(Oh(i),r?-1/0:1/0,s?0:2))}else if(Dh(i)<=16383)return a(new V(r?-1/0:1/0,Dh(i),+!s))}function f(e,t,n,i,a,s,c,l){if(e.type===`sym`&&t.type===`op`&&t.value===`:`&&n.type===`sym`&&i.type===`punc`&&i.value===`!`&&(a.type===`sym`||a.type===`rc`||a.type===`num`&&a.value===a.value|0)&&s.type===`op`&&s.value===`:`&&(c.type===`sym`||c.type===`rc`||c.type===`num`&&c.value===c.value|0)&&c.type===a.type&&!(l.type===`punc`&&l.value===`(`&&!c.space)){let t=d(a,!0),i=d(c,!1);if(t&&i)return r(7),o(new H(t.setSheet(e.value,!0),i.setSheet(n.value,!0)).setSheet(e.value,!0),e,c)}}function p(e,t,n,i,a,s){if(e.type===`sym`&&t.type===`op`&&t.value===`:`&&n.type===`sym`&&i.type===`punc`&&i.value===`!`&&(a.type===`sym`||a.type===`rc`||a.type===`num`&&a.value===a.value|0)&&!(s.type===`punc`&&s.value===`(`&&!a.space)){let t=d(a);if(t){r(5);let i=t.clone();return o(new H(t.setSheet(e.value,!0),i.setSheet(n.value,!0)).setSheet(e.value,!0),e,a)}}}function m(e,t,n,i,a,s){if(e.type===`sym`&&t.type===`punc`&&t.value===`!`&&(n.type===`sym`||n.type===`rc`||n.type===`num`&&n.value===n.value|0)&&i.type===`op`&&i.value===`:`&&(a.type===`sym`||a.type===`rc`||a.type===`num`&&a.value===a.value|0)&&!(s.type===`punc`&&s.value===`(`&&!a.space)){let t=d(n,!0),i=d(a,!1);if(t&&i)return r(5),o(new H(t,i).setSheet(e.value,!0),e,a)}}function h(e,t,n,i){if(e.type===`sym`&&t.type===`punc`&&t.value===`!`&&(n.type===`sym`||n.type===`rc`||n.type===`num`&&n.value===n.value|0)&&!(i.type===`punc`&&i.value===`(`&&!n.space)){r(3);let t=d(n);return(!t||!isFinite(t.row))&&(t=new Tp(n.value)),o(t.setSheet(e.value,!0),e,n)}}function g(e,t,n,i){if((e.type===`sym`||e.type===`rc`||e.type===`num`&&e.value===e.value|0)&&t.type===`op`&&t.value===`:`&&(n.type===`sym`||n.type===`rc`||n.type===`num`&&n.value===n.value|0)&&!(i.type===`punc`&&i.value===`(`&&!n.space)){let t=d(e,!0),i=d(n,!1);if(t&&i)return r(3),o(new H(t,i),e,n)}}function _(e,t){if((e.type===`sym`||e.type===`rc`)&&!(t.type===`punc`&&t.value===`(`&&!e.space)){let t=d(e);if(t&&isFinite(t.row)&&isFinite(t.col))return r(1),o(t,e,e)}}function v(e,t){if(e.type===`sym`&&t.type===`punc`&&t.value===`(`&&!e.space)return e.type=`func`,r(1),e}}function Yh(e){return` 	\r
\xA0​`.indexOf(e)>=0}let Xh={type:`eof`};function Zh(e,t){let n=[],r=0,i=e.readWhile;return{next:b,peek:y,eof:C,croak:e.croak,ahead:x,skip:S};function a(e){return/[0-9]/i.test(e)}function o(e){return/[a-z$_]/i.test(e)||Np(e)}function s(e){return o(e)||a(e)||e===`.`}function c(e){return e in Sh}function l(e){return`\\!;(){}[]`.indexOf(e)>=0}function u(){let e=!1,t=i(function(t){return t===Ch.DEC?e?!1:(e=!0,!0):a(t)});return t===Ch.DEC?{type:`punc`,value:Ch.DEC}:{type:`num`,value:parseFloat(t.replace(Ch.DEC,`.`))}}function d(t,n){return{type:`sym`,value:t,upper:t.toUpperCase(),space:Yh(e.peek()),quote:n}}function f(e,t,n){if(!e&&!t&&!n)return null;if(!e&&!n||e&&n){let n=t?parseInt(t,10):0;return e?n:n-1}}function p(){let t=e.lookingAt(/^R(\[)?(-?[0-9]+)?(\])?C(\[)?(-?[0-9]+)?(\])?/i);if(t){let n=f(t[1],t[2],t[3]),r=f(t[4],t[5],t[6]);if(n!=null&&r!=null)return e.skip(t),{type:`rc`,row:n,col:r,rel:(t[4]||!(t[4]||t[5]||t[6])?1:0)|(t[1]||!(t[1]||t[2]||t[3])?2:0)}}return d(i(s))}function m(){return e.next(),{type:`str`,value:e.readEscaped(`"`)}}function h(){return e.next(),d(e.readEscaped(`'`),!0)}function g(){return{type:`op`,value:i(function(e,t){return t+e in Sh})}}function _(){return{type:`punc`,value:e.next()}}function v(){if(e.eof())return null;let n=e.peek(),r;return n===`"`?m():n===`'`?h():a(n)||n===Ch.DEC?u():o(n)?p():c(n)?g():l(n)?_():(r=e.lookingAt(/^#([a-z\/]+)[?!]?/i))?(e.skip(r),{type:`error`,value:r[1]}):(t.forEditor||e.croak(`Can't handle character with code: `+n.charCodeAt(0)),{type:`error`,value:e.next()})}function y(){for(;n.length<=r;){i(Yh);let r=e.pos(),a=v();t.forEditor&&a&&(a.begin=r,a.end=e.pos()),n.push(a)}return n[r]}function b(){let e=y();return e&&r++,e}function x(e,t){let n=r,i=[];for(;e-->0;)i.push(b()||Xh);return r=n,t.apply(i,i)}function S(e){r+=e}function C(){return y()==null}}let Qh=[],$h=G.registerFormatParser=function(e){Qh.push(e)};G.parse=function(e,t,n,r,i){if(r instanceof Date)return{type:`date`,value:G.runtime.dateToSerial(r)};if(typeof r==`number`)return{type:`number`,value:r};if(typeof r==`boolean`)return{type:`boolean`,value:r};if(r+=``,/^'/.test(r))return{type:`string`,value:r.substr(1)};if(/^-?[0-9]+%$/.test(r)){let e=r.substr(0,r.length-1),t=parseFloat(e);if(!isNaN(t)&&t===e)return{type:`percent`,value:t/100}}if(/^=/.test(r))return r=r.substr(1),/\S/.test(r)?Ah(e,t,n,r):{type:`string`,value:`=`+r};for(let e=0;e<Qh.length;++e){let t=Qh[e](r,i);if(t)return t}if(r.toLowerCase()===`true`)return{type:`boolean`,value:!0};if(r.toLowerCase()===`false`)return{type:`boolean`,value:!1};let a=G.runtime.parseDate(r,i);if(a)return{type:`date`,value:G.runtime.dateToSerial(a)};let o=parseFloat(r);return!isNaN(o)&&r.length>0&&o===r?(i=null,o!==Math.floor(o)&&(i=`0.`+String(o).split(`.`)[1].replace(/\d/g,`0`)),{type:`number`,value:o,format:i}):{type:`string`,value:r}};function eg(e,t,n){let r=[];for(e=Jh(e,{forEditor:!0,row:t,col:n});!e.eof();)r.push(a());let i=r[0];return i.type===`op`&&i.value===`=`&&(i.type=`startexp`),r;function a(){let r=e.next();return r.type===`sym`?r.upper===`TRUE`?(r.type=`bool`,r.value=!0):r.upper===`FALSE`&&(r.type=`bool`,r.value=!1):r.type===`ref`&&(r={type:`ref`,ref:t!=null&&n!=null?r.absolute(t,n):r,begin:r.begin,end:r.end}),r}}function tg(e,t,n){t||=0,n||=0,e=Jh(e,{row:t,col:n});let r=[];for(;!e.eof();){let i=e.next();if(i.type!==`ref`)throw new G.runtime.ParseError(`Expecting a reference but got: `+JSON.stringify(i));r.push(i.absolute(t,n))}return r}G.parseNameDefinition=jh,G.parseFormula=Ah,G.parseReference=kh,G.compile=Kh,G.parseSqref=tg,G.tokenize=eg,$h(function(e,t){let n,r=0,i=``;if(t||=sm().calendar.patterns.d,n=/^(\d+)([-/.])(\d+)\2(\d{2}(?:\d{2})?)(\s*)/.exec(e)){let a=parseInt(n[1],10),o=n[2],s=parseInt(n[3],10),c=parseInt(n[4],10);c<30?c+=2e3:c<100&&(c+=1900);let l=!t||t.indexOf(`M`)<t.indexOf(`d`);if(a>12||!l){let e=a;a=s,s=e,l=!1}if(!G.runtime.validDate(c,a,s))return null;r=G.runtime.packDate(c,a-1,s),r<0&&r--,i=l?[`mm`,`dd`,`yyyy`].join(o):[`dd`,`mm`,`yyyy`].join(o),i+=n[5],e=e.substr(n[0].length)}if(n=/^(\d+):(\d+)$/.exec(e)){let e=parseInt(n[1],10),t=parseInt(n[2],10);return{type:`date`,format:i+`hh:mm`,value:r+G.runtime.packTime(e,t,0,0)}}if(n=/^(\d+):(\d+)(\.\d+)$/.exec(e)){let e=parseInt(n[1],10),t=parseInt(n[2],10),a=parseFloat(n[3])*1e3;return{type:`date`,format:i+`mm:ss.00`,value:r+G.runtime.packTime(0,e,t,a)}}if(n=/^(\d+):(\d+):(\d+)$/.exec(e)){let e=parseInt(n[1],10),t=parseInt(n[2],10),a=parseInt(n[3],10);return{type:`date`,format:i+`hh:mm:ss`,value:r+G.runtime.packTime(e,t,a,0)}}if(n=/^(\d+):(\d+):(\d+)(\.\d+)$/.exec(e)){let e=parseInt(n[1],10),t=parseInt(n[2],10),a=parseInt(n[3],10),o=parseFloat(n[4])*1e3;return{type:`date`,format:i+`hh:mm:ss.00`,value:r+G.runtime.packTime(e,t,a,o)}}}),$h(function(e){let t,n,r=om();var i=r.localeInfo().numbers;let a=i.symbols.group,o=i.symbols.decimal,s=i.localeCurrency;!s&&r.localeCurrency&&(s=r.localeCurrency());let c=i.currencies[s].symbol,l=rg(a,o),u=RegExp(`^\\s*\\`+c+`\\s*`),d=1,f=``,p=``,m=!1,h=!1;if(e=G.runtime.InputStream(e.replace(/^\s+|\s+$/g,``)),e.skip(/^-\s*/)&&(d=-1),(t=e.skip(u))&&(m=!0,f+=`"`+t[0]+`"`),e.skip(/^-\s*/)){if(d<0)return null;d=-1}if(!(n=e.skip(l)))return null;if(f+=`0`,t=e.skip(u)){if(m)return null;m=!0,p=`"`+t[0]+`"`}if(!m&&(t=e.skip(/^\s*%\s*/))&&(h=!0,p=t[0]),!e.eof())return null;(n[2]||m)&&(f=f.replace(`0`,`#`),f+=`,0`),n[3]&&(f+=`.`+ig(`0`,n[3].length-1));let g=n[0].replace(RegExp(`\\`+a,`g`),``).replace(RegExp(`\\`+o,`g`),`.`);return g=parseFloat(g),h&&(g/=100),f+=p,m&&(f+=`;-`+f),{type:`number`,currency:m,format:f,value:d*g}}),$h(function(e){let t;if(t=/^([0-9]*)\.([0-9]+)(\s*%)$/.exec(e))return{type:`number`,value:parseFloat(e)/100,format:`0.`+ig(`0`,t[2].length)+t[3]}});let ng={};function rg(e,t){let n=e+t,r=ng[n];return r||(r=`^(\\d+(COM\\d{3})*(DOT\\d+)?)`,r=r.replace(/DOT/g,`\\`+t).replace(/COM/g,`\\`+e),r=new RegExp(r),ng[n]=r),r}function ig(e,t){let n=``;for(;t-->0;)n+=e;return n}var ag=class{constructor(e){this.workbook=e}getRefCells(e,t,n,r,i,a){let o,s,c,l;if(e instanceof V)return o=this.workbook.sheetByName(e.sheet),!o||!e.valid()?[{value:new W(`REF`)}]:(s=o.formula(e),c=o.range(e.row,e.col).value(),a||s!=null||c!=null?[{formula:s,value:c,row:e.row,col:e.col,sheet:e.sheet,hidden:t?o.columnWidth(e.col)===0||o.rowHeight(e.row)===0:!1}]:[]);if(e instanceof H){l=this.workbook.sheetIndex(e.sheet);let n=[],r=l;if(e.endSheet&&(r=this.workbook.sheetIndex(e.endSheet),l>r)){let e=l;l=r,r=e}if(l<0||r<0||!e.valid())return[{value:new W(`REF`)}];for(;l<=r;){o=this.workbook.sheetByIndex(l++);let r=o._grid.normalize(e.topLeft),i=o._grid.normalize(e.bottomRight),u=o._grid.cellRefIndex(r),d=o._grid.cellRefIndex(i),f=o._properties.iterator(`value`,u,d);for(let e=r.col;e<=i.col;++e)for(let l=r.row;l<=i.row;++l){let r=o._grid.index(l,e);s=o._properties.get(`formula`,r),c=f.at(r),(a||s!=null||c!=null)&&n.push({formula:s,value:c,row:l,col:e,sheet:o.name(),hidden:t?o.columnWidth(e)===0||o.rowHeight(l)===0:!1})}}return n}if(e instanceof U){let a=[];for(l=0;l<e.refs.length;++l)a=a.concat(this.getRefCells(e.refs[l],t,n,r,i));return a}if(e instanceof Tp){let a=this.nameValue(e,n,r,i);return a instanceof z?this.getRefCells(a,t,n,r,i):[{value:a??new W(`NAME`)}]}return[]}isMerged(e){return this.workbook.sheetByName(e.sheet).isMerged(e)}nameValue(e,t,n,r){let i;return e.hasSheet()?i=this.workbook.nameValue(this._displayString(e.print())):(e=e.clone().setSheet(t,!0),i=this.workbook.nameValue(this._displayString(e.print())),i??=this.workbook.nameValue(this._displayString(e.name)),i??=this.workbook.nameValue(e.print())||this.workbook.nameValue(e.name)),i instanceof z&&(i=i.absolute(n,r)),i}getData(e,t,n,r,i){let a=e instanceof V;e instanceof Tp&&(a=this.workbook.nameValue(e.name)instanceof V);let o=this.getRefCells(e,!1,t,n,r,i).map(function(e){let t=e.value;return t instanceof G.runtime.Formula&&(t=t.value),t});return a?o[0]:o}onFormula(e){let t=this.workbook.sheetByName(e.sheet),n=e.row,r=e.col,i=e.value;if(t.formula({row:n,col:r})!==e)return!1;let a=e.arrayFormulaRange;if(a){let e,n,r=i.width,o=i.height;t.forEach(a,function(a,s){e===void 0&&(e=a,n=s);let c=a-e,l=s-n,u;u=c<o&&l<r?i.get(c,l):new W(`N/A`),t._value(a,s,u)})}else i instanceof z&&(i=this.getData(i,e.sheet,n,r),Array.isArray(i)&&(i=i[0]),i===void 0&&(i=null)),i instanceof G.runtime.Matrix&&(i=i.get(0,0)),t._value(n,r,i);return clearTimeout(t._formulaContextRefresh),t._formulaContextRefresh=setTimeout(function(){t.batch(function(){},{layout:!0})},50),!0}_displayString(e){return/^[a-z_][a-z0-9_]*$/i.test(e)?e:`'`+e.replace(/\\/g,`\\\\`).replace(/\x27/g,`\\'`)+`'`}},og=class extends ag{onFormula(){return!0}};G.ValidationFormulaContext=og;let sg={8:`backspace`,9:`tab`,13:`enter`,27:`esc`,37:`left`,38:`up`,39:`right`,40:`down`,35:`end`,36:`home`,32:`spacebar`,33:`pageup`,34:`pagedown`,46:`delete`,113:`:edit`},cg=()=>navigator.platform.toUpperCase().indexOf(`MAC`)>=0,lg=function(e){return e>47&&e<58||e>64&&e<91||e>95&&e<112||e>185&&e<193||e>218&&e<223||e===229},ug=function(e){let t=e.keyCode,n=sg[t];return!n&&lg(t)&&(n=`:alphanum`),!n&&e.key&&e.key.length===1&&(n=`:alphanum`),n};var dg=class{constructor(e,t,n){if(this._handlers={},this.target=e,this._observer=t||window,this.keyDownProxy=this.keyDown.bind(this),this.mouseProxy=this.mouse.bind(this),this.touchProxy=this.touch.bind(this),this.threshold=5,this._pressLocation=null,this._attachEvent(e,`keydown`,this.keyDownProxy),this._attachEvent(e,`contextmenu mousedown cut copy paste scroll wheel click dblclick focus`,this.mouseProxy),this._attachEvent(e,`touchmove touchend`,this.touchProxy),this._attachEvent(document.documentElement,`mousemove mouseup`,this.mouseProxy),this._attachEvent(document.documentElement,`touchmove touchend`,this.touchProxy),n)for(let e in n)this.on(e,n[e])}_attachEvent(e,t,n){t.split(` `).forEach(t=>{e.addEventListener(t,n)})}_removeEvent(e,t,n){t.split(` `).forEach(t=>{e.removeEventListener(t,n)})}keyDown(e){e.altKey&&(e.key===`n`||e.key===`h`||e.key===`a`)||this.handleEvent(e,ug(e))}touch(e){this.handleEvent(e,e.type)}mouse(e){let t;e.which?t=e.which===3:e.button&&(t=e.button===2);let n=e.type;if(n===`mousedown`&&(t?n=`rightmousedown`:this._pressLocation={x:e.pageX,y:e.pageY}),n===`mouseup`&&(t||(this._pressLocation=null)),n===`mousemove`&&this._pressLocation){let t=this._pressLocation.x-e.pageX,r=this._pressLocation.y-e.pageY;Math.sqrt(t*t+r*r)>this.threshold&&(n=`mousedrag`)}this.handleEvent(e,n)}handleEvent(e,t){let n=``;e.mod=cg()?e.metaKey:e.ctrlKey&&!e.altKey,e.altKey&&(n+=`alt+`),e.shiftKey&&(n+=`shift+`),e.ctrlKey&&(n+=`ctrl+`),n+=t;let r=this._handlers[`*+`+t];r&&r.call(this._observer,e,n);let i=this._handlers[n];i&&i.call(this._observer,e,n)}on(e,t){let n=this._handlers;typeof t==`string`&&(t=this._observer[t]),typeof e==`string`&&(e=e.split(`,`)),e.forEach(function(e){n[e]=t})}destroy(){this._removeEvent(this.target,`keydown`,this.keyDownProxy),this._removeEvent(this.target,`contextmenu mousedown cut copy paste scroll wheel click dblclick focus`,this.mouseProxy),this._removeEvent(this.target,`touchmove touchend`,this.touchProxy),this._removeEvent(document.documentElement,`mousemove mouseup`,this.mouseProxy),this._removeEvent(document.documentElement,`touchmove touchend`,this.touchProxy)}};let fg=/:alphanum$/,pg={up:`up`,down:`down`,left:`left`,right:`right`,home:`first-col`,end:`last-col`,"ctrl+left":`word-left`,"ctrl+right":`word-right`,"ctrl+up":`word-up`,"ctrl+down":`word-down`,"ctrl+home":`first`,"ctrl+end":`last`,pageup:`prev-page`,pagedown:`next-page`},mg={tab:`next`,"shift+tab":`previous`,enter:`lower`,"shift+enter":`upper`,delete:`clearContents`,backspace:`clearContents`,"shift+:alphanum":`edit`,"alt+:alphanum":`edit`,":alphanum":`edit`,"ctrl+:alphanum":`ctrl`,"alt+ctrl+:alphanum":`edit`,":edit":`edit`},hg={wheel:`onWheel`,"*+mousedown":`onMouseDown`,"*+contextmenu":`onContextMenu`,"*+mousedrag":`onMouseDrag`,"*+mouseup":`onMouseUp`,"*+dblclick":`onDblClick`,mousemove:`onMouseMove`},gg={pageup:`onPageUp`,pagedown:`onPageDown`,mouseup:`onMouseUp`,"*+cut":`onCut`,"*+paste":`onPaste`,"*+copy":`onCopy`},_g={esc:`onEditorEsc`,enter:`onEditorBlur`,"alt+enter":`insertNewline`,"shift+enter":`onEditorBlur`,tab:`onEditorBlur`,"shift+tab":`onEditorBlur`,"shift+ctrl+enter":`onEditorArrayFormula`},vg=Object.assign({focus:`onEditorBarFocus`},_g),yg=Object.assign({focus:`onEditorCellFocus`},_g),bg={cell:`range`,rowheader:`row`,columnheader:`column`,topcorner:`sheet`,autofill:`autofill`},xg=[],Sg=[],Cg=[];for(let e in pg)xg.push(e),Sg.push(`shift+`+e);for(let e in mg)Cg.push(e);gg[xg]=`onAction`,gg[Sg]=`onShiftAction`,gg[Cg]=`onEntryAction`,yg[xg]=`onEditorAction`,yg[Sg]=`onEditorShiftAction`;var wg=class{constructor(e,t){this.view=e,this.workbook(t),this.container=e.container,this.clipboardElement=e.clipboard,this.scroller=e.scroller,this.tabstrip=e.tabstrip,this.sheetsbar=e.sheetsbar,e.nameEditor.bind(`enter`,this.onNameEditorEnter.bind(this)),e.nameEditor.bind(`cancel`,this.onNameEditorCancel.bind(this)),e.nameEditor.bind(`select`,this.onNameEditorSelect.bind(this)),e.nameEditor.bind(`delete`,this.onNameEditorDelete.bind(this)),this.editor=e.editor,this.editor.bind(`change`,this.onEditorChange.bind(this)),this.editor.bind(`activate`,this.onEditorActivate.bind(this)),this.editor.bind(`deactivate`,this.onEditorDeactivate.bind(this)),this.editor.bind(`update`,this.onEditorUpdate.bind(this)),this.listener=new dg(this.container,this,hg),this.scrollHandler=this.onScroll.bind(this),this.mouseDownHandler=this.onMouseDown.bind(this),e.scroller.addEventListener(`scroll`,this.scrollHandler),e.scroller.addEventListener(`mousedown`,this.mouseDownHandler),this._enableEditorEvents(),this.sheetsbar&&(this.sheetsbar.bind(`select`,this.onSheetBarSelect.bind(this)),this.sheetsbar.bind(`reorder`,this.onSheetBarReorder.bind(this)),this.sheetsbar.bind(`rename`,this.onSheetBarRename.bind(this)),this.sheetsbar.bind(`remove`,this.onSheetBarRemove.bind(this)))}executeCommand(e){return this._execute(e)}_enableEditorEvents(e){e===void 0||e?(this.keyListener=new dg(this.clipboardElement,this,gg),this.barKeyListener=new dg(this.editor.barElement(),this,vg),this.inputKeyListener=new dg(this.editor.cellElement(),this,yg)):(this.keyListener.destroy(),this.barKeyListener.destroy(),this.inputKeyListener.destroy())}_execute(e){let t=this._workbook.execute(e);return e.command===`EditCommand`&&!t&&this._workbook.trigger(`change`,{editorClose:!0}),t&&(this._preventNavigation=!0,t.reason===`error`?(this.editor.deactivate(!0),this.view.showError(t,function(){}.bind(this))):this.view.openDialog(t.reason)),t}_activeTooltip(){return this._workbook.activeSheet().activeCell().simplify().toString()}onContextMenuSelect(e){let t=e.item.getAttribute(`data-action`),n;switch(t){case`cut`:n={command:`ToolbarCutCommand`,options:{workbook:this._workbook}};break;case`copy`:n={command:`ToolbarCopyCommand`,options:{workbook:this._workbook}};break;case`paste`:n={command:`ToolbarPasteCommand`,options:{workbook:this._workbook}};break;case`delete-drawing`:n={command:`DeleteDrawingCommand`,options:{drawing:this.navigator._sheet._activeDrawing}};break;case`bring-to-front`:n={command:`BringToFrontCommand`,options:{drawing:this.navigator._sheet._activeDrawing}};break;case`send-to-back`:n={command:`SendToBackCommand`,options:{drawing:this.navigator._sheet._activeDrawing}};break;case`unmerge`:n={command:`MergeCellCommand`,options:{value:`unmerge`}};break;case`merge`:this.view.openDialog(`merge`);break;case`hide-row`:n={command:`HideLineCommand`,options:{axis:`row`}};break;case`hide-column`:n={command:`HideLineCommand`,options:{axis:`column`}};break;case`unhide-row`:n={command:`UnHideLineCommand`,options:{axis:`row`}};break;case`unhide-column`:n={command:`UnHideLineCommand`,options:{axis:`column`}};break;case`delete-row`:n={command:`DeleteRowCommand`};break;case`delete-column`:n={command:`DeleteColumnCommand`};break}n&&this._execute(n)}onSheetBarRemove(e){let t=this._workbook.sheetByName(e.name);t&&this._workbook.removeSheet(t)}destroy(){this.view.scroller.removeEventListener(`scroll`,this.scrollHandler),this.view.scroller.removeEventListener(`mousedown`,this.mouseDownHandler),this.listener.destroy(),this._enableEditorEvents(!1),this.keyListener.destroy(),this.inputKeyListener.destroy()}onSheetBarSelect(e){let t,n=this._workbook;if(e.isAddButton){if(this._workbook.trigger(`insertSheet`))return;t=n.insertSheet()}else t=n.sheetByName(e.name);if(n.activeSheet().name()!==t.name()){if(this._workbook.trigger(`selectSheet`,{sheet:t}))return;this.editor.canInsertRef(!1)||this.editor.deactivate(),n.activeSheet(t)}}onSheetBarReorder(e){let t=this._workbook,n=t.sheetByIndex(e.oldIndex),r=t.activeSheet(),i=r.name();if(t.moveSheetToIndex(n,e.newIndex),i!==n.name()){if(t.trigger(`selectSheet`,{sheet:n})){t.activeSheet(r);return}this.editor.canInsertRef(!1)||this.editor.deactivate(),t.activeSheet(n)}}onSheetBarRename(e){let t=this._workbook.sheetByIndex(e.sheetIndex);if(this._workbook.sheetByName(e.name)){this.view.showError({reason:`error`,type:`duplicateSheetName`});return}this._workbook.renameSheet(t,e.name),this.clipboardElement.focus({preventScroll:!0})}sheet(e){this.navigator=e.navigator(),this.axisManager=e.axisManager()}workbook(e){this._workbook=e,this.clipboard=e.clipboard(),e.bind(`commandRequest`,this.onCommandRequest.bind(this))}refresh(){let e=this.editor,t=this._workbook.activeSheet();this._viewPortHeight=this.view.scroller.clientHeight,this.navigator.height(this._viewPortHeight),!e.isActive()&&!this.isEditorDisabled&&(e.enable(t.selection().enable()!==!1),this.resetEditorValue());let n=t.selection()._ref.simplify(),r=this._workbook.nameForRef(n,t.name());this.view.nameEditor.value(r.name)}onScroll(){this.view.render({scroll:!0})}onWheel(e){let t=e.deltaX,n=e.deltaY;e.deltaMode===1&&(t*=10,n*=10),this.scrollWith(t,n),e.preventDefault()}onAction(e,t){let n=this._workbook.activeSheet();n._activeDrawing=null,this.navigator.moveActiveCell(pg[t]),e.preventDefault()}onPageUp(){this.scrollDown(-this._viewPortHeight)}onPageDown(){this.scrollDown(this._viewPortHeight)}onEntryAction(e,t){let n=this._workbook.activeSheet();if(e.mod){let t=String.fromCharCode(e.keyCode),r=!0;switch(t){case`A`:n._activeDrawing=null,this.navigator.selectAll();break;case`Y`:this._workbook.undoRedoStack.redo();break;case`Z`:this._workbook.undoRedoStack.undo();break;default:r=!1;break}r&&e.preventDefault()}else{let r=n.selection().enable()===!1,i=t!==`:edit`;if(t==`delete`||t==`backspace`)n._activeDrawing?this._execute({command:`DeleteDrawingCommand`,options:{drawing:n._activeDrawing}}):r||this._execute({command:`ClearContentCommand`}),e.preventDefault();else if(fg.test(t)||!i){if(n._activeDrawing=null,r){e.preventDefault();return}i&&this.editor.value(``),this.activateEditor(i)}else this.navigator.navigateInSelection(mg[t]),e.preventDefault()}}onShiftAction(e,t){this.navigator.modifySelection(pg[t.replace(`shift+`,``)],this.appendSelection),e.preventDefault()}onMouseMove(e){let t=this._workbook.activeSheet();if(t.resizingInProgress()||t.selectionInProgress())return;let n=this.objectAt(e);n.type===`columnresizehandle`||n.type===`rowresizehandle`?t.positionResizeHandle(n.ref):t.removeResizeHandle(),t._renderComment(n.type==`cell`?n.ref:null)}onMouseDown(e){let t=this.objectAt(e);if(t.pane&&(this.originFrame=t.pane),this._startResizingDrawing(e,t)){e.stopPropagation();return}let n=this._workbook.activeSheet();if(n._activeDrawing=null,t.type===`drawing`){n._activeDrawing=t.drawing,t.copy=t.drawing.clone(),t.startBox=n.drawingBoundingBox(t.copy),n.startDragging(t),n.triggerChange({dragging:!0}),e.preventDefault();return}if(t.type===`outside`){e.preventDefault(),e.stopPropagation();return}if(t.type===`editor`){if(e.which===3||e.button===2)return;this.onEditorEsc(),this.openCustomEditor(),e.preventDefault(),e.stopPropagation();return}if(this.editor.canInsertRef(!1)&&t.ref){this._workbook.activeSheet()._setFormulaSelections(this.editor.highlightedRefs()),this.navigator.startSelection(t.ref,this._selectionMode,this.appendSelection,e.shiftKey,this.view),e.preventDefault();return}else if(this._preventNavigation=!1,this.editor.deactivate(),this._preventNavigation)return;if(t.type===`columnresizehandle`||t.type===`rowresizehandle`){n.startResizing({x:t.x,y:t.y}),e.preventDefault();return}if(t.type===`filtericon`){this.openFilterMenu(e),e.preventDefault();return}this._selectionMode=bg[t.type],this.appendSelection=e.mod,this.navigator.startSelection(t.ref,this._selectionMode,this.appendSelection,e.shiftKey,this.view)}_startResizingDrawing(e){let t=e.target.closest(`.k-spreadsheet-drawing-handle`);if(t){let n=this.translateCoords(e),r=t.getAttribute(`data-direction`),i=this._workbook.activeSheet(),a=i._activeDrawing;return i.startDragging({pane:this.originFrame,drawing:a,copy:a.clone(),startBox:i.drawingBoundingBox(a),resize:r,startX:n.x,startY:n.y}),!0}}onContextMenu(e){let t=this._workbook.activeSheet();if(e.preventDefault(),e.stopPropagation(),t.resizingInProgress()||t.draggingInProgress())return;let n=this.objectAt(e);if(n.type===`columnresizehandle`||n.type===`rowresizehandle`)return;n.ref?this.navigator.selectForContextMenu(n.ref,bg[n.type]):n.type==`drawing`&&this.navigator.selectDrawingForContextMenu(n.drawing);let r=this.navigator._sheet.select()instanceof U,i=!1,a=!1;n.type==`columnheader`?i=!r&&this.axisManager.selectionIncludesHiddenColumns():n.type==`rowheader`?i=!r&&this.axisManager.selectionIncludesHiddenRows():n.type==`drawing`||(a=this.navigator.selectionIncludesMergedCells()),this._workbook.trigger(`contextmenu`,{objectRef:n.ref,targetType:n.type,isComposite:r,showUnhide:i,showUnmerge:a,originalEvent:e})}prevent(e){e.preventDefault()}constrainResize(e,t){let n=this._workbook.activeSheet().resizeHandlePosition();return!n||e===`outside`||e===`topcorner`||t.col<n.col||t.row<n.row}_dragDrawing(e){let t=this._workbook.activeSheet(),n=t.draggingInProgress();if(!n)return!1;let r=this.translateCoords(e),i=n.drawing,a=r.x-n.startX,o=r.y-n.startY;return n.resize==`SE`?n.aspect?Math.abs(a)>Math.abs(o)?(i.width=Math.max(n.copy.width+a,20),i.height=i.width/n.aspect):(i.height=Math.max(n.copy.height+o,20),i.width=i.height*n.aspect):(i.width=Math.max(n.copy.width+a,20),i.height=Math.max(n.copy.height+o,20)):n.resize==`E`?i.width=Math.max(n.copy.width+a,20):n.resize==`S`?i.height=Math.max(n.copy.height+o,20):n.resize==`N`?n.copy.height-o>20&&(i.height=n.copy.height-o,i.offsetY=n.copy.offsetY+o):n.resize==`W`?n.copy.width-a>20&&(i.width=n.copy.width-a,i.offsetX=n.copy.offsetX+a):n.resize==`NE`?(i.width=Math.max(n.copy.width+a,20),n.copy.height-o>20&&(i.height=n.copy.height-o,i.offsetY=n.copy.offsetY+o)):n.resize==`SW`?(i.height=Math.max(n.copy.height+o,20),n.copy.width-a>20&&(i.width=n.copy.width-a,i.offsetX=n.copy.offsetX+a)):n.resize==`NW`?(n.copy.height-o>20&&(i.height=n.copy.height-o,i.offsetY=n.copy.offsetY+o),n.copy.width-a>20&&(i.width=n.copy.width-a,i.offsetX=n.copy.offsetX+a)):(i.offsetX=n.copy.offsetX+a,i.offsetY=n.copy.offsetY+o),t.triggerChange({dragging:!0}),!0}onMouseDrag(e){if(this._selectionMode===`sheet`)return;let t={clientX:e.clientX,clientY:e.clientY},n=this._workbook.activeSheet();if(this._dragDrawing(e))return;let r=this.objectAt(t);if(n.resizingInProgress()){this.constrainResize(r.type,r.ref)||n.resizeHintPosition({x:r.x,y:r.y});return}if(r.type===`outside`){this.startAutoScroll(r);return}if(this.originFrame===r.pane)this.selectToLocation(t);else{let e=this.originFrame._grid;r.x,e.right,r.y>e.bottom&&this.scrollTop(),r.y<e.top||r.x<e.left?this.startAutoScroll(r,t):this.selectToLocation(t)}e.preventDefault()}onMouseUp(e){let t=this._workbook.activeSheet();t.completeResizing(),t.completeDragging(),this.navigator.completeSelection(),this.stopAutoScroll();let n=this.editor.activeEditor();if(!n)return;let r=e.target;for(;r;){if(r===n.element)return;r=r.parentNode}let i=this.objectAt(e);i&&i.ref&&n.canInsertRef(!1)&&(n.refAtPoint(t),t._setFormulaSelections(n.highlightedRefs()))}onDblClick(e){let t=this.objectAt(e),n=this._workbook.activeSheet().selection().enable()===!1;if(t.type!==`cell`||n)return;let r=this._workbook.activeSheet().selection();this.activateEditor(!r.value()&&!r.formula()),this.onEditorUpdate()}onCut(e){let t=this;setTimeout(function(){t.clipboard.menuInvoked=e===void 0,t._execute({command:`CutCommand`,options:{workbook:t.view._workbook,event:e}})})}clipBoardValue(){return this.clipboardElement.html()}_pasteImage(e){let t=this,n=new window.Image;n.src=window.URL.createObjectURL(e),n.onload=function(){t._execute({command:`InsertImageCommand`,options:{blob:e,width:n.width,height:n.height}})},setTimeout(function(){window.URL.revokeObjectURL(n.src)},10)}onPaste(e){let t=this,n=``,r=``;if(t.clipboard.menuInvoked=e===void 0,e){let i=e.clipboardData;if(i&&i.getData){e.preventDefault();let a=!1,o=!1;if(window.DOMStringList&&i.types instanceof window.DOMStringList?(a=i.types.contains(`text/html`),o=i.types.contains(`text/plain`)):Array.isArray(i.types)?(a=i.types.indexOf(`text/html`)>=0,o=i.types.indexOf(`text/plain`)>=0):(a=/text\/html/.test(i.types),o=/text\/plain/.test(i.types)),a&&(n=i.getData(`text/html`).trim()),o&&(r=i.getData(`text/plain`).trim()),!n&&!r&&i.items&&i.items.length)for(let e=0;e<i.items.length;++e){let n=i.items[e];if(n.kind===`file`&&/^image\/(?:png|jpe?g|gif)$/i.test(n.type))return t._pasteImage(n.getAsFile())}}else{if(window.clipboardData.files&&window.clipboardData.files.length){let e=window.clipboardData.files[0];if(/^image\/(?:png|jpe?g|gif)$/i.test(e.type))return t._pasteImage(e)}r=window.clipboardData.getData(`Text`),r&&=r.trim(),t.clipboardElement.empty(),setTimeout(function(){n=t.clipboardElement.html(),(n||r)&&(t.clipboard.external({html:n,plain:r}),t._execute({command:`PasteCommand`,options:{workbook:t.view._workbook,event:e}}))});return}}else t.clipboard.menuInvoked=!0;!n&&!r||(t.clipboard.external({html:n,plain:r}),t._execute({command:`PasteCommand`,options:{workbook:t.view._workbook,event:e}}))}onCopy(e){this.clipboard.menuInvoked=e===void 0,this._execute({command:`CopyCommand`,options:{workbook:this.view._workbook,event:e}})}scrollTop(){this.scroller.scrollTop=0}scrollLeft(){this.scroller.scrollLeft=0}scrollDown(e){this.scroller.scrollTop+=e}scrollRight(e){this.scroller.scrollLeft+=e}scrollWith(e,t){this.scroller.scrollTop+=t,this.scroller.scrollLeft+=e}translateCoords(e){let t=this.container.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}objectAt(e,t){if(!e)return;let n=this.translateCoords(e);return this.view.objectAt(n.x,n.y,t)}selectToLocation(e){let t=this.objectAt(e,!0);t.pane&&t.ref&&(this.extendSelection(t),this.lastKnownCellLocation=e,this.originFrame=t.pane),this.stopAutoScroll()}extendSelection(e){this.navigator.extendSelection(e.ref,this._selectionMode)}autoScroll(){let e=this._autoScrollTarget.x,t=this._autoScrollTarget.y,n=this.originFrame._grid,r=this.view.scroller,i=r.scrollLeft,a=r.scrollTop;e<n.left&&this.scrollRight(-8),e>n.right&&this.scrollRight(8),t<n.top&&this.scrollDown(-8),t>n.bottom&&this.scrollDown(8),a===r.scrollTop&&i===r.scrollLeft?this.selectToLocation(this.finalLocation):this.extendSelection(this.objectAt(this.lastKnownCellLocation))}startAutoScroll(e,t){this._scrollInterval||=setInterval(this.autoScroll.bind(this),50),this.finalLocation=t||this.lastKnownCellLocation,this._autoScrollTarget=e}stopAutoScroll(){clearInterval(this._scrollInterval),this._scrollInterval=null}openCustomEditor(){this.view.openCustomEditor()}openFilterMenu(e){let t=this.objectAt(e),n=this._workbook.activeSheet().filterColumn(t.ref),r=this.view.createFilterMenu(n);r.bind(`action`,this.onCommandRequest.bind(this)),r.bind(`action`,r.close.bind(r)),r.openFor(e.target,e)}_saveEditorValue(e){let t=this.editor._range.sheet(),n=this.editor.value();this._workbook.activeSheet()!==t&&(this._workbook.activeSheet()._setFormulaSelections(),this._workbook.activeSheet(t)),t.isInEditMode(!1),this._lastEditorValue=n,this._execute({command:`EditCommand`,options:{value:n,arrayFormula:e}})}onEditorChange(){this._saveEditorValue(!1)}onEditorArrayFormula(){this._saveEditorValue(!0),this.editor.deactivate(!0)}onEditorActivate(){let e=this._workbook.activeSheet();e._setFormulaSelections(this.editor.highlightedRefs()),e.isInEditMode(!0)}onEditorDeactivate(){let e=this._workbook.activeSheet();e.isInEditMode(!1),e._setFormulaSelections([])}onEditorUpdate(){this._workbook.activeSheet()._setFormulaSelections(this.editor.highlightedRefs())}onEditorBarFocus(){this._workbook.activeSheet().selection().enable()!==!1&&this.editor.activate({range:this._workbook.activeSheet().selection(),rect:this.view.activeCellRectangle(),tooltip:this._activeTooltip()})}onEditorCellFocus(){this.editor.scale()}onEditorEsc(){this.resetEditorValue(),this.editor.deactivate(),this.clipboardElement.focus({preventScroll:!0})}insertNewline(e){e.preventDefault(),this.editor.insertNewline()}onEditorBlur(e,t){e.defaultPrevented||this.editor.isFiltered()||(e.preventDefault(),this._preventNavigation=!1,this.editor.deactivate(),this._preventNavigation||(this.clipboardElement.focus({preventScroll:!0}),this.navigator.navigateInSelection(mg[t])),t===`tab`&&e.preventDefault())}onEditorAction(e,t){if(e.defaultPrevented)return;let n=this.editor,r=this._workbook.activeSheet();this._casualEditing&&/^(?:up|right|down|left)$/.test(t)?(this.deactivateEditor(),this.navigator.moveActiveCell(pg[t]),e.preventDefault()):n.canInsertRef(!0)&&(this.navigator.moveActiveCell(pg[t]),n.activeEditor().refAtPoint(r),r._setFormulaSelections(n.highlightedRefs()),e.preventDefault())}onEditorShiftAction(e,t){let n=this.editor,r=this._workbook.activeSheet();n.canInsertRef(!0)&&(this.navigator.modifySelection(pg[t.replace(`shift+`,``)],this.appendSelection),n.activeEditor().refAtPoint(r),r._setFormulaSelections(n.highlightedRefs()),e.preventDefault())}resetEditorValue(){let e=this._workbook.activeSheet(),t=e.activeCell(),n=this._workbook._inputForRef(t),r=e.range(t).intersectingArrayFormula();r&&(n=`=`+r.formula),this.editor.value(n,!!r)}activateEditor(e){this._casualEditing=e,this.editor.activate({range:this._workbook.activeSheet().selection(),rect:this.view.activeCellRectangle(),tooltip:this._activeTooltip()}).focus()}deactivateEditor(){this.view.editor.deactivate()}onCommandRequest(e){e.command?this._execute(e):this._workbook.undoRedoStack[e.action]()}onDialogRequest(e){let t={pdfExport:this._workbook.options.pdf,excelExport:this._workbook.options.excel};e.options?Vp(e.options,t):e.options=t,this.view.openDialog(e.name,e.options)}onNameEditorEnter({value:e}){let t,n=this._workbook,r=n.activeSheet(),i=e===void 0?this.view.nameEditor.value():e;if(t=G.parseReference(i,!0)||n.nameValue(i),t instanceof z){if(t.sheet&&t.sheet.toLowerCase()!==r.name().toLowerCase()){let e=n.sheetByName(t.sheet);e&&(n.activeSheet(e),r=e)}r.range(t).select();return}t=r.selection()._ref.clone().simplify().setSheet(r.name(),!0),this._execute({command:`DefineNameCommand`,options:{name:i,value:t}}),this.clipboardElement.focus({preventScroll:!0})}onNameEditorCancel(){this.clipboardElement.focus({preventScroll:!0})}onNameEditorSelect(e){let t=e.name,n=this._workbook,r=n.activeSheet(),i=n.nameValue(t);if(i instanceof z){if(i.sheet&&i.sheet.toLowerCase()!==r.name().toLowerCase()){let e=n.sheetByName(i.sheet);e&&(n.activeSheet(e),r=e)}r.range(i).select();return}this.clipboardElement.focus({preventScroll:!0})}onNameEditorDelete(e){this._execute({command:`DeleteNameCommand`,options:{name:e.name}}),this.clipboardElement.focus({preventScroll:!0})}},Tg=class{constructor(e,t,n,r){this.level=e,this.value=t,this.left=n,this.right=r}};let Eg={left:void 0,right:void 0,level:0};Eg.left=Eg,Eg.right=Eg;function Dg(e){let t=e;if(t.left.level===t.level){let e=t;t=t.left,e.left=t.right,t.right=e}return t}function Og(e){let t=e;if(t.right.right.level===t.level){let e=t;t=t.right,e.right=t.left,t.left=e,t.level+=1}return t}function kg(e,t){return e===Eg?new Tg(1,t,Eg,Eg):(e.value.start>t.start?e.left=kg(e.left,t):e.right=kg(e.right,t),Og(Dg(e)))}function Ag(e,t){let n=e;if(n===Eg)return n;let r=n.value.start-t.start;if(r===0)if(n.left!==Eg&&n.right!==Eg){let e=n.left;for(;e.right!==Eg;)e=e.right;n.value=e.value,n.left=Ag(n.left,n.value)}else n=n.left===Eg?n.right:n.left;else r>0?n.left=Ag(n.left,t):n.right=Ag(n.right,t);return(n.left.level<n.level-1||n.right.level<n.level-1)&&(--n.level,n.right.level>n.level&&(n.right.level=n.level),n=Dg(n),n.right=Dg(n.right),n.right.right=Dg(n.right.right),n=Og(n),n.right=Og(n.right)),n}var jg=class e{constructor(e,t,n){this.start=e,this.end=t,this.value=n}intersects(e){return e.start<=this.end&&e.end>=this.start}clone(){return new e(this.start,this.end,this.value)}},Mg=class e{constructor(){this.root=Eg}insert(e){this.root=kg(this.root,e)}remove(e){this.root=Ag(this.root,e)}findrange(e){let t=this.root;for(;t!==Eg;)if(e<t.value.start)t=t.left;else if(e>t.value.end)t=t.right;else return t.value;return null}values(){let e=[];return Ng(this.root,e),e}intersecting(e,t){let n=[];return Pg(this.root,new jg(e,t),n),n}map(t){let n=new e;return Fg(n,this.root,t),n}forEach(e){Ig(this.root,e)}clone(){return this.map(function(e){return e.clone()})}first(){let e=this.root;for(;e.left!==Eg;)e=e.left;return e}last(){let e=this.root;for(;e.right!==Eg;)e=e.right;return e}};function Ng(e,t){e!==Eg&&(Ng(e.left,t),t.push(e.value),Ng(e.right,t))}function Pg(e,t,n){if(e===Eg)return;let r=e.value;t.start<r.start&&Pg(e.left,t,n),r.intersects(t)&&n.push(r),t.end>r.end&&Pg(e.right,t,n)}function Fg(e,t,n){t!==Eg&&(Fg(e,t.left,n),e.insert(n(t.value)),Fg(e,t.right,n))}function Ig(e,t){e!==Eg&&(Ig(e.left,t),t(e.value),Ig(e.right,t))}var Lg=class e{constructor(e,t,n){t===void 0?this.tree=e:(this.tree=new Mg,this.tree.insert(new jg(e,t,n)))}values(){return this.tree.values()}map(t){return new e(this.tree.map(t))}forEach(e){this.tree.forEach(e)}intersecting(e,t){return this.tree.intersecting(e,t)}first(){return this.tree.first().value}last(){return this.tree.last().value}insert(e,t,n){return this.tree.insert(new jg(e,t,n))}value(e,t,n){let r=e,i=t;if(n===void 0)return i===void 0&&(i=r),this.intersecting(r,i)[0].value;let a=this.tree.intersecting(r-1,i+1);if(a.length){let e=a[0],t=a[a.length-1];e.end<r&&(e.value===n?r=e.start:a.shift()),t.start>i&&(t.value===n?i=t.end:a.pop());for(let e=0,t=a.length;e<t;e++){let t=a[e],o=t.value,s=t.start,c=t.end;this.tree.remove(t),s<r&&(o===n?r=s:this.insert(s,r-1,o)),c>i&&(o===n?i=c:this.insert(i+1,c,o))}}this.insert(r,i,n)}expandedValues(e,t){let n=this.intersecting(e,t),r=[],i=0;for(let a=e;a<=t;a++)n[i].end<a&&i++,r.push({index:a-e,value:n[i].value});return r}sortedIndices(e,t,n,r){let i=this.expandedValues(e,t),a=function(e,t){return e.value===t.value?e.index-t.index:n(e.value,t.value)};return r&&(a=function(e,t){let i=r[e.index],a=r[t.index];return i.value===a.value?n(e.value,t.value):e.index-t.index}),i.sort(a),i}sort(e,t,n){if(this.intersecting(e,t).length===1)return;let r=this.expandedValues(e,t);for(let t=0,i=n.length;t<i;t++)this.value(t+e,t+e,r[n[t].index].value)}copy(e,t,n){let r=this.intersecting(e,t),i=n,a;for(let n=0,o=r.length;n<o;n++){let o=r[n].start;o<e&&(o=e);let s=r[n].end;s>t&&(s=t),a=i+(s-o),this.value(i,a,r[n].value),i=++a}}iterator(e,t){return new Rg(e,t,this.intersecting(e,t))}getState(){return this.tree.clone()}setState(e){this.tree=e.clone()}toJSON(){return this.values()}fromJSON(e){e.forEach(e=>{this.value(e.start,e.end,e.value)})}},Rg=class{constructor(e,t,n){this.start=e,this.end=t,this.index=0,this.ranges=n}unique(){return this.ranges.map(function(e){return e.value})}at(e){for(;this.ranges[this.index]&&this.ranges[this.index].end<e;)this.index++;return this.ranges[this.index]&&this.ranges[this.index].value}forEach(e){for(let t=this.start;t<=this.end;t++)e(this.at(t),t);this.index=0}},zg=class extends Lg{constructor(e,t,n){super(e,t,n),this._defaultValue=n,this.tree=new Mg,this.range=new jg(e,t,n)}intersecting(e,t){let n=e,r=this.tree.intersecting(n,t),i=[],a;if(!r.length)return[this.range];for(let e=0,t=r.length;e<t;e++)a=r[e],a.start>n&&i.push(new jg(n,a.start-1,this.range.value)),i.push(a),n=a.end+1;return a.end<t&&i.push(new jg(a.end+1,t,this.range.value)),i}insert(e,t,n){let r=n;r??=this._defaultValue,r!==this.range.value&&this.tree.insert(new jg(e,t,r))}lastRangeStart(){let e=this.tree.root;if(e===Eg)return this.range.start;for(;e.right!==Eg;)e=e.right;return e.value.end+1}},Bg=class{constructor(e){this.list=e}get(e){return this.parse(this.list.value(e,e))}set(e,t,n){n===void 0&&(n=t,t=e),this.list.value(e,t,n)}parse(e){return e}copy(e,t,n){this.list.copy(e,t,n)}iterator(e,t){return this.list.iterator(e,t)}},Vg=class extends Bg{set(e,t,n){this.list.value(e,t,JSON.stringify(n))}parse(e){return JSON.parse(e)}},Hg=class extends Bg{constructor(e,t){super(e),this.formats=t}set(e,t,n){n instanceof Date?(n=G.runtime.dateToSerial(n),this.formats.value(e,t)||this.formats.value(e,t,Ug(sm().calendar.patterns.d))):typeof n==`number`&&(n=G.runtime.limitPrecision(n)),this.list.value(e,t,n)}};function Ug(e){return e.replace(/M/g,`m`).replace(/'/g,`"`).replace(/tt/,`am/pm`)}let Wg=[{property:Bg,name:`format`,value:null,sortable:!0,serializable:!0},{property:Hg,name:`value`,value:null,sortable:!0,serializable:!0,depends:`format`},{property:Bg,name:`formula`,value:null,sortable:!0,serializable:!0},{property:Bg,name:`background`,value:null,sortable:!0,serializable:!0},{property:Vg,name:`borderLeft`,value:null,sortable:!1,serializable:!0},{property:Vg,name:`borderRight`,value:null,sortable:!1,serializable:!0},{property:Vg,name:`borderTop`,value:null,sortable:!1,serializable:!0},{property:Vg,name:`borderBottom`,value:null,sortable:!1,serializable:!0},{property:Vg,name:`dBorders`,value:null,sortable:!1,serializable:!0},{property:Bg,name:`color`,value:null,sortable:!0,serializable:!0},{property:Bg,name:`fontFamily`,value:null,sortable:!0,serializable:!0},{property:Bg,name:`underline`,value:null,sortable:!0,serializable:!0},{property:Bg,name:`fontSize`,value:null,sortable:!0,serializable:!0},{property:Bg,name:`italic`,value:null,sortable:!0,serializable:!0},{property:Bg,name:`bold`,value:null,sortable:!0,serializable:!0},{property:Bg,name:`textAlign`,value:null,sortable:!0,serializable:!0},{property:Bg,name:`indent`,value:null,sortable:!0,serializable:!0},{property:Bg,name:`verticalAlign`,value:null,sortable:!0,serializable:!0},{property:Bg,name:`wrap`,value:null,sortable:!0,serializable:!0},{property:Bg,name:`validation`,value:null,sortable:!1,serializable:!0},{property:Bg,name:`enable`,value:null,sortable:!1,serializable:!0},{property:Bg,name:`link`,value:null,sortable:!0,serializable:!0},{property:Bg,name:`editor`,value:null,sortable:!0,serializable:!0},{property:Bg,name:`comment`,value:null,sortable:!0,serializable:!0},{property:Bg,name:`html`,value:null,sortable:!0,serializable:!0}];var Gg=class{constructor(e,t,n){n||={};let r=e*t-1;this.specs=Wg,this.rowCount=e,this.columnCount=t,this.cellCount=r,this.properties={},this.lists={},this.specs.forEach(function(e){let t=e.name,i=n[t];i===void 0&&(i=e.value),this.lists[t]=new zg(0,r,i);let a=this.properties[t]=new e.property(this.lists[t],this.lists[e.depends]);a.spec=e},this),this.lists.formula.tree.clone=Jg,this.lists.validation.tree.clone=Jg}_resize(e,t){let n=this,r=n.rowCount,i=e*t-1;function a(t){let n=t/r|0,i=t%r;return n*e+i}function o(e){e.start=a(e.start),e.end=a(e.end)}Object.keys(n.lists).forEach(function(t){let a=n.lists[t];e!==r&&a.forEach(o),a.range.end=i}),n.rowCount=e,n.columnCount=t,n.cellCount=i}getState(){let e={};return this.specs.forEach(function(t){e[t.name]=this.lists[t.name].getState()},this),e}setState(e){this.specs.forEach(function(t){this.lists[t.name].setState(e[t.name])},this)}get(e,t){return t===void 0?this.lists[e]:t>this.cellCount?null:this.properties[e].get(t)}set(e,t,n,r){switch(this._set(e,t,n,r),e){case`borderLeft`:this._set(`borderRight`,t-this.rowCount,n-this.rowCount,r);break;case`borderRight`:this._set(`borderLeft`,t+this.rowCount,n+this.rowCount,r);break;case`borderTop`:Kg(t,n,this.rowCount).forEach(e=>{var t=e[0]-1,n=e[1]-1;(t+1)%this.rowCount==0&&t++,this._set(`borderBottom`,t,n,r)});break;case`borderBottom`:Kg(t,n,this.rowCount).forEach(e=>{var t=e[0]+1,n=e[1]+1;n%this.rowCount==0&&n--,this._set(`borderTop`,t,n,r)});break}}_set(e,t,n,r){t>=0&&t<=n&&n<=this.cellCount&&this.properties[e].set(t,n,r)}fromJSON(e,t){for(let n=0;n<this.specs.length;n++){let r=this.specs[n];r.serializable&&t[r.name]!==void 0&&this.set(r.name,e,e,t[r.name],!1)}}copy(e,t,n){this.specs.forEach(function(r){this.properties[r.name].copy(e,t,n)},this)}iterator(e,t,n){let r=this.properties[e],i=r.iterator(t,n),a=i.at,o=this.cellCount;return i.at=function(e){return e>o?null:r.parse(a.call(i,e))},i.name=e,i.value=r.spec.value,i}sortable(){return this.specs.filter(function(e){return e.sortable}).map(function(e){return this.lists[e.name]},this)}iterators(e,t){return this.specs.reduce(function(n,r){return r.serializable&&n.push(this.iterator(r.name,e,t)),n}.bind(this),[])}forEach(e,t,n){let r=this.iterators(e,t),i,a;for(a=e;a<=t;a++){i={};for(let e=0;e<r.length;e++){let t=r[e],n=t.at(a);n!==t.value&&(i[t.name]=n)}n(i)}}forEachProperty(e){for(let t in this.properties)e(this.properties[t])}};function Kg(e,t,n){for(var r=[];e<=t;){var i=Math.min(t,n*(1+Math.floor(e/n))-1);r.push([e,i]),e=i+1}return r}function qg(e){return e=e.clone(),e.value=e.value.deepClone(),e}function Jg(){let e=this.map(qg);return e.clone=Jg,e}let Yg=Wg.reduce(function(e,t){return t.serializable&&e.push(t.name),e},[`borderTop`,`borderRight`,`borderBottom`,`borderLeft`]),{FUNCS:Xg,defineBuiltinFunction:q,limitPrecision:J,limitRef:Zg,packDate:Qg,unpackDate:Y,daysInMonth:$g,daysInYear:e_,isLeapYear:t_}=G.runtime;q(`binary+`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))||a==null&&(a=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))||o==null&&(o=0,!0)?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return e+t}),q(`binary-`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))||a==null&&(a=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))||o==null&&(o=0,!0)?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return e-t}),q(`binary*`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))||a==null&&(a=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))||o==null&&(o=0,!0)?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return e*t}),q(`binary/`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))||a==null&&(a=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o!=0||(i=`DIV/0`,!1))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return e/t}),q(`binary^`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))||a==null&&(a=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))||o==null&&(o=0,!0)?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return e**+t}),q(`binary&`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))||(typeof a==`string`||typeof a==`boolean`||typeof a==`number`?(a+=``,!0):a===void 0&&(a=``,!0))||typeof a==`boolean`||a==null))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))||(typeof o==`string`||typeof o==`boolean`||typeof o==`number`?(o+=``,!0):o===void 0&&(o=``,!0))||typeof o==`boolean`||o==null?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return e??=``,t??=``,``+e+t});function n_(e,t){return e=typeof e==`string`?e.toLowerCase():e,t=typeof t==`string`?t.toLowerCase():t,e===!1&&t==null||t===!1&&e==null||e===0&&t==null||t===0&&e==null||e===``&&t==null||t===``&&e==null||e===t}q(`binary=`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];if(i instanceof W)return i;if(i=this.force(i),!(n<=e.length))return i instanceof W?i:new W(r);t.push(i);var a=e[n++];return a instanceof W?a:(a=this.force(a),n<=e.length?(t.push(a),n<e.length?new W(`N/A`):t):a instanceof W?a:new W(r))}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return n_(e,t)}),q(`binary<>`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];if(i instanceof W)return i;if(i=this.force(i),!(n<=e.length))return i instanceof W?i:new W(r);t.push(i);var a=e[n++];return a instanceof W?a:(a=this.force(a),n<=e.length?(t.push(a),n<e.length?new W(`N/A`):t):a instanceof W?a:new W(r))}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return!n_(e,t)});function r_(e,t,n){return typeof e==`string`&&typeof t!=`string`&&(t=t==null?``:t+``),typeof e!=`string`&&typeof t==`string`&&(e=e==null?``:e+``),typeof e==`number`&&t==null&&(t=0),typeof t==`number`&&e==null&&(e=0),typeof e==`string`&&typeof t==`string`&&(e=e.toLowerCase(),t=t.toLowerCase()),typeof t==typeof e?(e=vm(e,15),t=vm(t,15),n(e,t)):new W(`VALUE`)}q(`binary<`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];if(i instanceof W)return i;if(i=this.force(i),!(n<=e.length))return i instanceof W?i:new W(r);t.push(i);var a=e[n++];return a instanceof W?a:(a=this.force(a),n<=e.length?(t.push(a),n<e.length?new W(`N/A`):t):a instanceof W?a:new W(r))}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return r_(e,t,(e,t)=>e<t)}),q(`binary<=`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];if(i instanceof W)return i;if(i=this.force(i),!(n<=e.length))return i instanceof W?i:new W(r);t.push(i);var a=e[n++];return a instanceof W?a:(a=this.force(a),n<=e.length?(t.push(a),n<e.length?new W(`N/A`):t):a instanceof W?a:new W(r))}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return r_(e,t,(e,t)=>e<=t)}),q(`binary>`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];if(i instanceof W)return i;if(i=this.force(i),!(n<=e.length))return i instanceof W?i:new W(r);t.push(i);var a=e[n++];return a instanceof W?a:(a=this.force(a),n<=e.length?(t.push(a),n<e.length?new W(`N/A`):t):a instanceof W?a:new W(r))}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return r_(e,t,(e,t)=>e>t)}),q(`binary>=`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];if(i instanceof W)return i;if(i=this.force(i),!(n<=e.length))return i instanceof W?i:new W(r);t.push(i);var a=e[n++];return a instanceof W?a:(a=this.force(a),n<=e.length?(t.push(a),n<e.length?new W(`N/A`):t):a instanceof W?a:new W(r))}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return r_(e,t,(e,t)=>e>=t)}),q(`unary+`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))||a==null&&(a=0,!0)?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return e}),q(`unary-`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))||a==null&&(a=0,!0)?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return-e}),q(`unary%`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))||a==null&&(a=0,!0)?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return e/100}),q(`binary:`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];if(i instanceof W)return i;if(!(i instanceof V))return new W(r);t.push(i);var a=e[n++];return a instanceof W?a:a instanceof V?(t.push(a),n<e.length?new W(`N/A`):t):new W(r)}return{check:e}}(),function(e,t){return new H(e,t).setSheet(e.sheet||this.formula.sheet,e.hasSheet())}),q(`binary,`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];if(i instanceof W)return i;if(!(i instanceof z))return new W(r);t.push(i);var a=e[n++];return a instanceof W?a:a instanceof z?(t.push(a),n<e.length?new W(`N/A`):t):new W(r)}return{check:e}}(),function(e,t){return new U([e,t])}),q(`binary `,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];if(i instanceof W)return i;if(!(i instanceof z))return new W(r);t.push(i);var a=e[n++];return a instanceof W?a:a instanceof z?(t.push(a),n<e.length?new W(`N/A`):t):new W(r)}return{check:e}}(),function(e,t){return e.intersect(t)}),q(`not`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i instanceof W?i:(i=this.force(i))!=null&&n<=e.length||i==null&&(i=0,!0)?(t.push(i),n<e.length?new W(`N/A`):t):i instanceof W?i:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return!this.bool(e)}),q(`isblank`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return n<=e.length?(t.push(i),n<e.length?new W(`N/A`):t):new W(r)}function t(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,arrayArgs:t}}(),function(e){return e instanceof V?(e=this.getRefData(e),e==null):!1}),q(`iserror`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i=this.force(i),n<=e.length?(t.push(i),n<e.length?new W(`N/A`):t):new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return e instanceof W}),q(`iserr`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i=this.force(i),n<=e.length?(t.push(i),n<e.length?new W(`N/A`):t):new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return e instanceof W&&e.code!=`N/A`}),q(`isna`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i=this.force(i),n<=e.length?(t.push(i),n<e.length?new W(`N/A`):t):new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return e instanceof W&&e.code==`N/A`}),q(`islogical`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i=this.force(i),n<=e.length?(t.push(i),n<e.length?new W(`N/A`):t):new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return typeof e==`boolean`}),q(`isnontext`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i=this.force(i),n<=e.length?(t.push(i),n<e.length?new W(`N/A`):t):new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return typeof e!=`string`}),q(`istext`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i=this.force(i),n<=e.length?(t.push(i),n<e.length?new W(`N/A`):t):new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return typeof e==`string`}),q(`isnumber`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i=this.force(i),n<=e.length?(t.push(i),n<e.length?new W(`N/A`):t):new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return typeof e==`number`}),q(`isref`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return n<=e.length?(t.push(i),n<e.length?new W(`N/A`):t):new W(r)}function t(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,arrayArgs:t}}(),function(e){return e instanceof V||e instanceof H}),q(`_matrix`,!1,function(){function e(e){var t=[],n=0,r,i=`VALUE`,a=e[n++];return a instanceof W?a:(r=this.asMatrix(a))&&(a=r)||(typeof a==`string`||typeof a==`boolean`||typeof a==`number`?(a+=``,!0):a===void 0&&(a=``,!0))?(t.push(a),n<e.length?new W(`N/A`):t):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){if(typeof e==`string`){let t=new fm(this);e.split(/\s*,\s*/).forEach(function(e,n){let r=G.parse(null,null,null,e),i=e;r&&r.type!==`exp`&&(i=r.value,r.type===`string`&&!/^'/.test(e)&&i.length&&!isNaN(i)&&(i=Number(i))),t.set(0,n,i)}),e=t}return e}),Xg[`,getname`]=function(e,t){this.fetchName(t[0],e)},q(`abs`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),Math.abs),q(`cos`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),Math.cos),q(`sin`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),Math.sin),q(`acos`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),Math.acos),q(`asin`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),Math.asin),q(`tan`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),Math.tan),q(`atan`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),Math.atan),q(`exp`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),Math.exp),q(`sqrt`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),Math.sqrt),q(`ln`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),Math.log),q(`log`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>0||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o>0||(i=`NUM`,!1))||o==null&&(o=10,!0)?(n.push(o),o!=1||(i=`DIV/0`,!1)?r<e.length?new W(`N/A`):n:new W(i)):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return Math.log(e)/Math.log(t)}),q(`log10`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>0||(i=`NUM`,!1))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return Math.log(e)/Math.log(10)}),q(`pi`,!1,function(){function e(e){return 0<e.length?new W(`N/A`):[]}return{check:e}}(),function(){return Math.PI}),q(`sqrtpi`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>=0||(i=`NUM`,!1))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return Math.sqrt(e*Math.PI)}),q(`degrees`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return 180*e/Math.PI%360}),q(`radians`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return Math.PI*e/180});function i_(e){return(Math.exp(e)+Math.exp(-e))/2}q(`cosh`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),i_),q(`acosh`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),a>=1||(i=`N/A`,!1)?r<e.length?new W(`N/A`):n:new W(i)):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return Math.log(e+Math.sqrt(e-1)*Math.sqrt(e+1))});function a_(e){return(Math.exp(e)-Math.exp(-e))/2}q(`sinh`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),a_),q(`asinh`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return Math.log(e+Math.sqrt(e*e+1))}),q(`sec`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return 1/Math.cos(e)}),q(`sech`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return 1/i_(e)}),q(`csc`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return 1/Math.sin(e)}),q(`csch`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return 1/a_(e)}),q(`atan2`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a!=0||(i=`DIV/0`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return Math.atan(t/e)});function o_(e){return a_(e)/i_(e)}q(`tanh`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),o_),q(`atanh`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>-1&&a<1||(i=`NUM`,!1))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return Math.log(Math.sqrt(1-e*e)/(1-e))}),q(`cot`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a!=0||(i=`DIV/0`,!1))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return 1/Math.tan(e)}),q(`coth`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a!=0||(i=`DIV/0`,!1))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return 1/o_(e)}),q(`acot`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return Math.PI/2-Math.atan(e)}),q(`acoth`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),a<-1||(i=`N/A`,!1)||a>1||(i=`N/A`,!1)?r<e.length?new W(`N/A`):n:new W(i)):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return Math.log((e+1)/(e-1))/2}),q(`power`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return e**+t}),q(`mod`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o!=0||(i=`DIV/0`,!1))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return e%t}),q(`quotient`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o!=0||(i=`DIV/0`,!1))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return Math.floor(e/t)}),q(`ceiling`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))?(n.push(o),o>=0||a<0||(i=`N/A`,!1)?r<e.length?new W(`N/A`):n:new W(i)):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return t?t*Math.ceil(e/t):0}),q(`ceiling.precise`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))||o==null&&(o=1,!0)?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return t=Math.abs(t),t?t*Math.ceil(e/t):0}),G.runtime.defineAlias(`iso.ceiling`,`ceiling.precise`),q(`ceiling.math`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))||o==null&&(o=a<0?-1:1,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:typeof(s=this.force(s))==`boolean`||typeof s==`number`&&(s=!!s,!0)||s==null&&(s=0,!0)?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var c=this._arrayArg(e[a]);return c?(t.push(c),n=Math.max(n,c.width),r=Math.max(r,c.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t,n){return!t||!e?0:(e<0&&(!n&&t<0||n&&t>0)&&(t=-t),t?t*Math.ceil(e/t):0)}),q(`floor`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))?(n.push(o),o>=0||a<0||(i=`N/A`,!1)?r<e.length?new W(`N/A`):n:new W(i)):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return t?t*Math.floor(e/t):0}),q(`floor.precise`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))||o==null&&(o=1,!0)?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return t=Math.abs(t),t?t*Math.floor(e/t):0}),q(`floor.math`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))||o==null&&(o=a<0?-1:1,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:typeof(s=this.force(s))==`boolean`||typeof s==`number`&&(s=!!s,!0)||s==null&&(s=0,!0)?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var c=this._arrayArg(e[a]);return c?(t.push(c),n=Math.max(n,c.width),r=Math.max(r,c.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t,n){return!t||!e?0:(e<0&&(!n&&t<0||n&&t>0)&&(t=-t),t?t*Math.floor(e/t):0)}),q(`int`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),Math.floor),q(`mround`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return t?t*Math.round(e/t):0}),q(`round`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){var n=e<0?-1:1;return n<0&&(e=-e),t=10**t,e=J(e*t),e=Math.round(e),n*e/t}),q(`roundup`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return t=10**t,e=J(e*t),e=e<0?Math.floor(e):Math.ceil(e),e/t}),q(`rounddown`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return t=10**t,e=J(e*t),e=e<0?Math.ceil(e):Math.floor(e),e/t}),q(`even`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){var t=e<0?Math.floor(e):Math.ceil(e);return t%2?t+(t<0?-1:1):t}),q(`odd`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){var t=e<0?Math.floor(e):Math.ceil(e);return t%2?t:t+(t<0?-1:1)}),q(`sign`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return e<0?-1:+(e>0)});function s_(e,t){for(;t;){var n=e%t;e=t,t=n}return e}function c_(e,t){return Math.abs(e*t)/s_(e,t)}q(`gcd`,!1,function(){function e(e){var t,n=[],r=0;try{var i=this.cellValues(e.slice(r)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r=e.length,n.push(i)}catch(e){if(e instanceof W)return e;throw e}return r<e.length?new W(`N/A`):n}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){for(var t=e[0],n=1;n<e.length;++n)t=s_(t,e[n]);return t}),q(`lcm`,!1,function(){function e(e){var t,n=[],r=0;try{var i=this.cellValues(e.slice(r)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r=e.length,n.push(i)}catch(e){if(e instanceof W)return e;throw e}return r<e.length?new W(`N/A`):n}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){for(var t=e[0],n=1;n<e.length;++n)t=c_(t,e[n]);return t}),q(`sum`,!1,function(){function e(e){var t,n=[],r=0;try{var i=this.cellValues(e.slice(r)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r=e.length,n.push(i)}catch(e){if(e instanceof W)return e;throw e}return r<e.length?new W(`N/A`):n}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){return e.reduce(function(e,t){return e+t},0)}),q(`product`,!1,function(){function e(e){var t,n=[],r=0;try{var i=this.cellValues(e.slice(r)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r=e.length,n.push(i)}catch(e){if(e instanceof W)return e;throw e}return r<e.length?new W(`N/A`):n}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){return e.length===0?0:e.reduce(function(e,t){return e*t},1)}),q(`sumproduct`,!1,function(){function e(e){var t=[],n,r=[],i=0,a,o=`VALUE`,s=e[i++];if(s instanceof W)return s;if(!((a=this.asMatrix(s))&&(s=a)))return s instanceof W?s:new W(o);if(r.push(s),i>=e.length)return new W(`N/A`);r.push(n=[]),t.push(r),r=n;do{var c=e[i++];if(c instanceof W)return c;if(!((a=this.asMatrix(c))&&(c=a)&&(c.width==s.width||(o=`N/A`,!1))&&(c.height==s.height||(o=`N/A`,!1))))return c instanceof W?c:new W(o);r.push(c)}while(i<e.length);return r=t.pop(),i<e.length?new W(`N/A`):r}function t(e,t){var n=[],r=0;for(n.push(e[r++]);r<e.length;)n.push(e[r++]);this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t){var n=0;return e.each(function(e,r,i){if(typeof e==`number`){for(var a=0;a<t.length;++a){var o=t[a].get(r,i);if(typeof o!=`number`)return;e*=o}n+=e}}),n}),q(`sumsq`,!1,function(){function e(e){var t,n=[],r=0;try{var i=this.cellValues(e.slice(r)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r=e.length,n.push(i)}catch(e){if(e instanceof W)return e;throw e}return r<e.length?new W(`N/A`):n}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){return e.reduce(function(e,t){return e+t*t},0)}),q(`sumx2my2`,!1,function(){function e(e){var t=[],n=0,r,i=`VALUE`,a=e[n++];if(a instanceof W)return a;if(!((r=this.asMatrix(a))&&(a=r)))return a instanceof W?a:new W(i);t.push(a);var o=e[n++];return o instanceof W?o:(r=this.asMatrix(o))&&(o=r)&&(o.width==a.width||(i=`N/A`,!1))&&(o.height==a.height||(i=`N/A`,!1))?(t.push(o),n<e.length?new W(`N/A`):t):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t){var n=0;return e.each(function(e,r,i){var a=t.get(r,i);typeof e==`number`&&typeof a==`number`&&(n+=e*e-a*a)}),n}),q(`sumx2py2`,!1,function(){function e(e){var t=[],n=0,r,i=`VALUE`,a=e[n++];if(a instanceof W)return a;if(!((r=this.asMatrix(a))&&(a=r)))return a instanceof W?a:new W(i);t.push(a);var o=e[n++];return o instanceof W?o:(r=this.asMatrix(o))&&(o=r)&&(o.width==a.width||(i=`N/A`,!1))&&(o.height==a.height||(i=`N/A`,!1))?(t.push(o),n<e.length?new W(`N/A`):t):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t){var n=0;return e.each(function(e,r,i){var a=t.get(r,i);typeof e==`number`&&typeof a==`number`&&(n+=e*e+a*a)}),n}),q(`sumxmy2`,!1,function(){function e(e){var t=[],n=0,r,i=`VALUE`,a=e[n++];if(a instanceof W)return a;if(!((r=this.asMatrix(a))&&(a=r)))return a instanceof W?a:new W(i);t.push(a);var o=e[n++];return o instanceof W?o:(r=this.asMatrix(o))&&(o=r)&&(o.width==a.width||(i=`N/A`,!1))&&(o.height==a.height||(i=`N/A`,!1))?(t.push(o),n<e.length?new W(`N/A`):t):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t){var n=0;return e.each(function(e,r,i){var a=t.get(r,i);typeof e==`number`&&typeof a==`number`&&(n+=(e-a)*(e-a))}),n}),q(`seriessum`,!1,function(){function e(e){var t,n=[],r=0,i,a=`VALUE`,o=e[r++];if(o instanceof W)return o;if(!(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))))return o instanceof W?o:new W(a);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!(typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0))))return s instanceof W?s:new W(a);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!(typeof(c=this.force(c))==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0))))return c instanceof W?c:new W(a);n.push(c);var l=e[r++];return l instanceof W?l:(i=this.asMatrix(l))&&(l=i)?(n.push(l),r<e.length?new W(`N/A`):n):l instanceof W?l:new W(a)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t,n,r){var i=0;return r.each(function(r){if(typeof r!=`number`)throw new W(`VALUE`);i+=r*e**+t,t+=n}),i}),q(`min`,!1,function(){function e(e){var t=[],n=0;try{var r=this.cellValues(e.slice(n)).reduce(function(e,t){if(t instanceof W)throw t;return typeof t==`number`&&(t=J(t),!0)&&e.push(t),e}.bind(this),[]);n=e.length,t.push(r)}catch(e){if(e instanceof W)return e;throw e}return n<e.length?new W(`N/A`):t}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){return e.length?Math.min.apply(Math,e):0}),q(`max`,!1,function(){function e(e){var t=[],n=0;try{var r=this.cellValues(e.slice(n)).reduce(function(e,t){if(t instanceof W)throw t;return typeof t==`number`&&(t=J(t),!0)&&e.push(t),e}.bind(this),[]);n=e.length,t.push(r)}catch(e){if(e instanceof W)return e;throw e}return n<e.length?new W(`N/A`):t}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){return e.length?Math.max.apply(Math,e):0}),q(`counta`,!1,function(){function e(e){var t=[],n=0;try{var r=this.cellValues(e.slice(n)).reduce(function(t,r){return r!=null&&n<=e.length&&t.push(r),t}.bind(this),[]);n=e.length,t.push(r)}catch(e){if(e instanceof W)return e;throw e}return n<e.length?new W(`N/A`):t}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){return e.length}),q(`count`,!1,function(){function e(e){var t,n=[],r=0;try{var i=this.cellValues(e.slice(r)).reduce(function(e,n){return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r=e.length,n.push(i)}catch(e){if(e instanceof W)return e;throw e}return r<e.length?new W(`N/A`):n}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){return e.length}),q(`countunique`,!1,function(){function e(e){var t=[],n=0;try{var r=this.cellValues(e.slice(n)).reduce(function(t,r){return r!=null&&n<=e.length&&t.push(r),t}.bind(this),[]);n=e.length,t.push(r)}catch(e){if(e instanceof W)return e;throw e}return n<e.length?new W(`N/A`):t}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){var t=0,n=[];return e.forEach(function(e){n.indexOf(e)<0&&(t++,n.push(e))}),t}),q(`countblank`,!1,function(){function e(e){var t=[],n,r=[],i=0,a,o=`VALUE`;if(i>=e.length)return new W(`N/A`);r.push(n=[]),t.push(r),r=n;do{var s=e[i++];if(s instanceof W)return s;if(!((a=this.asMatrix(s))&&(s=a)||s!=null&&i<=e.length))return s instanceof W?s:new W(o);r.push(s)}while(i<e.length);return r=t.pop(),i<e.length?new W(`N/A`):r}function t(e,t){for(var n=[],r=0;r<e.length;)n.push(e[r++]);this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){var t=0;function n(e){(e==null||e===``)&&t++}function r(e){for(var t=0;t<e.length;++t){var r=e[t];r instanceof fm?r.each(n,!0):n(r)}}return r(e),t}),q(`iseven`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return e%2==0}),q(`isodd`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return e%2!=0}),q(`n`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i instanceof W?i:(i=this.force(i))!=null&&n<=e.length?(t.push(i),n<e.length?new W(`N/A`):t):i instanceof W?i:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return typeof e==`boolean`?+!!e:typeof e==`number`?e:0}),q(`na`,!1,function(){function e(e){return 0<e.length?new W(`N/A`):[]}return{check:e}}(),function(){return new W(`N/A`)});function l_(e,t){for(var n=[],r=0,i=e[0];r<e.length;)n.push({matrix:e[r++],pred:k_(e[r++])});for(var a=0;a<i.height;++a)COL:for(var o=0;o<i.width;++o){for(r=0;r<n.length;++r){var s=n[r].matrix.get(a,o);if(!n[r].pred(s==null||s===``?0:s))continue COL}t(a,o)}}q(`countifs`,!1,function(){function e(e){var t=[],n,r=[],i=0,a,o=`VALUE`,s=e[i++];if(s instanceof W)return s;if(!((a=this.asMatrix(s))&&(s=a)))return s instanceof W?s:new W(o);r.push(s);var c=e[i++];if(c instanceof W)return c;if(!((c=this.force(c))!=null&&i<=e.length))return c instanceof W?c:new W(o);for(r.push(c),r.push(n=[]),t.push(r),r=n;i<e.length;){var l=e[i++];if(l instanceof W)return l;if(!((a=this.asMatrix(l))&&(l=a)))return l instanceof W?l:new W(o);r.push(l);var u=e[i++];if(u instanceof W)return u;if(!((u=this.force(u))!=null&&i<=e.length))return u instanceof W?u:new W(o);r.push(u)}return r=t.pop(),i<e.length?new W(`N/A`):r}function t(e,t){var n=[],r=0;for(n.push(e[r++]),n.push(e[r++]);r<e.length;)n.push(e[r++]),n.push(e[r++]);this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t,n){var r=0;return n.unshift(e,t),l_(n,function(){r++}),r}),q(`sumifs`,!1,function(){function e(e){var t=[],n,r=[],i=0,a,o=`VALUE`,s=e[i++];if(s instanceof W)return s;if(!((a=this.asMatrix(s))&&(s=a)))return s instanceof W?s:new W(o);r.push(s);var c=e[i++];if(c instanceof W)return c;if(!((a=this.asMatrix(c))&&(c=a)))return c instanceof W?c:new W(o);r.push(c);var l=e[i++];if(l instanceof W)return l;if(!((l=this.force(l))!=null&&i<=e.length))return l instanceof W?l:new W(o);for(r.push(l),r.push(n=[]),t.push(r),r=n;i<e.length;){var u=e[i++];if(u instanceof W)return u;if(!((a=this.asMatrix(u))&&(u=a)))return u instanceof W?u:new W(o);r.push(u);var d=e[i++];if(d instanceof W)return d;if(!((d=this.force(d))!=null&&i<=e.length))return d instanceof W?d:new W(o);r.push(d)}return r=t.pop(),i<e.length?new W(`N/A`):r}function t(e,t){var n=[],r=0;for(n.push(e[r++]),n.push(e[r++]),n.push(e[r++]);r<e.length;)n.push(e[r++]),n.push(e[r++]);this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t,n,r){r.unshift(e,A_,t,n);var i=0;return l_(r,function(t,n){var r=e.get(t,n);r&&(i+=r)}),i}),q(`averageifs`,!1,function(){function e(e){var t=[],n,r=[],i=0,a,o=`VALUE`,s=e[i++];if(s instanceof W)return s;if(!((a=this.asMatrix(s))&&(s=a)))return s instanceof W?s:new W(o);r.push(s);var c=e[i++];if(c instanceof W)return c;if(!((a=this.asMatrix(c))&&(c=a)))return c instanceof W?c:new W(o);r.push(c);var l=e[i++];if(l instanceof W)return l;if(!((l=this.force(l))!=null&&i<=e.length))return l instanceof W?l:new W(o);for(r.push(l),r.push(n=[]),t.push(r),r=n;i<e.length;){var u=e[i++];if(u instanceof W)return u;if(!((a=this.asMatrix(u))&&(u=a)))return u instanceof W?u:new W(o);r.push(u);var d=e[i++];if(d instanceof W)return d;if(!((d=this.force(d))!=null&&i<=e.length))return d instanceof W?d:new W(o);r.push(d)}return r=t.pop(),i<e.length?new W(`N/A`):r}function t(e,t){var n=[],r=0;for(n.push(e[r++]),n.push(e[r++]),n.push(e[r++]);r<e.length;)n.push(e[r++]),n.push(e[r++]);this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t,n,r){r.unshift(e,A_,t,n);var i=0,a=0;return l_(r,function(t,n){var r=e.get(t,n);(r==null||r===``)&&(r=0),i+=r,a++}),a?i/a:new W(`DIV/0`)}),q(`countif`,!1,function(){function e(e){var t=[],n=0,r,i=`VALUE`,a=e[n++];if(a instanceof W)return a;if(!((r=this.asMatrix(a))&&(a=r)))return a instanceof W?a:new W(i);t.push(a);var o=e[n++];return o instanceof W?o:(o=this.force(o))!=null&&n<=e.length?(t.push(o),n<e.length?new W(`N/A`):t):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0;t.push(e[a++]),i.push(!1);var o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){t=k_(t);var n=0;return e.each(function(e){t(e)&&n++}),n});function u_(e){return function(t,n,r,i){let a=this,o=i;if(r=k_(r),o instanceof z){o=o.clone().toRangeRef(),(o.width()!=n.width||o.height()!=n.height)&&(isFinite(o.topLeft.row)||(o.topLeft.row=0),isFinite(o.topLeft.col)||(o.topLeft.col=0),o.bottomRight.row=o.topLeft.row+n.height-1,o.bottomRight.col=o.topLeft.col+n.width-1);let i=[];return n.each(function(e,t,n){r(e)&&i.push(o.toCell(t,n))}),a.resolveCells(i,function(){let n=i.map(e=>a.getRefData(e));return t(e.call(a,n))})}let s=[];return n.each(function(e,t,n){r(e)&&s.push(o.get(t,n))}),t(e.call(a,s))}}q(`sumif`,!0,function(){function e(e){var t=[],n=0,r,i=`VALUE`,a=e[n++];if(a instanceof W)return a;if(!((r=this.asMatrix(a))&&(a=r)))return a instanceof W?a:new W(i);t.push(a);var o=e[n++];if(o instanceof W)return o;if(!((o=this.force(o))!=null&&n<=e.length))return o instanceof W?o:new W(i);t.push(o);var s=e[n++];return s instanceof W?s:s instanceof V||s instanceof H||(r=this.asMatrix(s))&&(s=r)||s==null&&(s=a,!0)?(t.push(s),n<e.length?new W(`N/A`):t):new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),r++,this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0;t.push(e[a++]),i.push(!1);var o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,t.push(e[a++]),i.push(!1),{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),u_(function(e){let t=0;return e.forEach(e=>{A_(e)&&(t+=e||0)}),t})),q(`averageif`,!0,function(){function e(e){var t=[],n=0,r,i=`VALUE`,a=e[n++];if(a instanceof W)return a;if(!((r=this.asMatrix(a))&&(a=r)))return a instanceof W?a:new W(i);t.push(a);var o=e[n++];if(o instanceof W)return o;if(!((o=this.force(o))!=null&&n<=e.length))return o instanceof W?o:new W(i);t.push(o);var s=e[n++];return s instanceof W?s:s instanceof V||s instanceof H||(r=this.asMatrix(s))&&(s=r)||(s=this.force(s))==null&&(s=a,!0)?(t.push(s),n<e.length?new W(`N/A`):t):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0;t.push(e[a++]),i.push(!1);var o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,t.push(e[a++]),i.push(!1),{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),u_(function(e){let t=0,n=0;return e.forEach(e=>{A_(e)&&(t+=e||0,n++)}),n?t/n:new W(`DIV/0`)}));function d_(e,t,n){var r=[];return e.each(function(e){if(e instanceof W)return e;typeof e==`number`&&r.push(e)})||(t>r.length?new W(`NUM`):r.sort(n)[t-1])}q(`large`,!1,function(){function e(e){var t,n=[],r=0,i,a=`VALUE`,o=e[r++];if(o instanceof W)return o;if(!((i=this.asMatrix(o))&&(o=i)))return o instanceof W?o:new W(a);n.push(o);var s=e[r++];return s instanceof W?s:(typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(a=`NUM`,!1))?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(a)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0;t.push(e[a++]),i.push(!1);var o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return d_(e,t,M_)}),q(`small`,!1,function(){function e(e){var t,n=[],r=0,i,a=`VALUE`,o=e[r++];if(o instanceof W)return o;if(!((i=this.asMatrix(o))&&(o=i)))return o instanceof W?o:new W(a);n.push(o);var s=e[r++];return s instanceof W?s:(typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(a=`NUM`,!1))?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(a)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0;t.push(e[a++]),i.push(!1);var o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return d_(e,t,j_)});function f_(e){return e.reduce(function(e,t){return e+t},0)/e.length}function p_(e,t,n){return n??=f_(e),e.reduce(function(e,t){return e+(t-n)**2},0)/t}function m_(e,t){return Math.sqrt(p_(e,t))}q(`stdev.s`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r=e.length,n.push(a)}catch(e){if(e instanceof W)return e;throw e}return a.length>=2||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){return m_(e,e.length-1)}),q(`stdev.p`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`;try{var i=this.cellValues(e.slice(n)).reduce(function(e,t){if(t instanceof W)throw t;return typeof t==`number`&&(t=J(t),!0)&&e.push(t),e}.bind(this),[]);n=e.length,t.push(i)}catch(e){if(e instanceof W)return e;throw e}return i.length>=1||(r=`NUM`,!1)?n<e.length?new W(`N/A`):t:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){return m_(e,e.length)}),q(`var.s`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r=e.length,n.push(a)}catch(e){if(e instanceof W)return e;throw e}return a.length>=2||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){return p_(e,e.length-1)}),q(`var.p`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r=e.length,n.push(a)}catch(e){if(e instanceof W)return e;throw e}return a.length>=2||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){return p_(e,e.length)}),q(`median`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r=e.length,n.push(a)}catch(e){if(e instanceof W)return e;throw e}return a.length>0||(i=`N/A`,!1)?r<e.length?new W(`N/A`):n:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){var t=e.length;return e.sort(j_),t%2?e[t>>1]:(e[t>>=1]+e[t-1])/2}),q(`mode.sngl`,!1,function(){function e(e){var t,n=[],r=0;try{var i=this.cellValues(e.slice(r)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r=e.length,n.push(i)}catch(e){if(e instanceof W)return e;throw e}return r<e.length?new W(`N/A`):n}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){e.sort(j_);for(var t=null,n=0,r=1,i=null,a=0;a<e.length;++a){var o=e[a];o==t?n++:(n=1,t=o),n>r&&(r=n,i=o)}return i??new W(`N/A`)}),q(`mode.mult`,!1,function(){function e(e){var t,n=[],r=0;try{var i=this.cellValues(e.slice(r)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r=e.length,n.push(i)}catch(e){if(e instanceof W)return e;throw e}return r<e.length?new W(`N/A`):n}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){var t=Object.create(null),n=2,r=[];e.forEach(function(e){var i=t[e]||0;t[e]=++i,i==n?r.push(e):i>n&&(n=i,r=[e])});var i=new fm(this);return r.forEach(function(e,t){i.set(t,0,e)}),i}),q(`geomean`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r=e.length,n.push(a)}catch(e){if(e instanceof W)return e;throw e}return a.length>0||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){var t=e.length;return e.reduce(function(e,t){if(t<0)throw new W(`NUM`);return e*t},1)**(1/t)}),q(`harmean`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r=e.length,n.push(a)}catch(e){if(e instanceof W)return e;throw e}return a.length>0||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){return e.length/e.reduce(function(e,t){if(!t)throw new W(`DIV/0`);return e+1/t},0)}),q(`trimmean`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(a)}catch(e){if(e instanceof W)return e;throw e}var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o>=0&&o<1||(i=`NUM`,!1))?(n.push(o),a.length>0||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t){var n=e.length;e.sort(j_);var r=Math.floor(n*t);r%2&&--r,r/=2;for(var i=0,a=r;a<n-r;++a)i+=e[a];return i/(n-r*2)}),q(`frequency`,!1,function(){function e(e){var t,n=[],r=0;try{var i=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(i)}catch(e){if(e instanceof W)return e;throw e}try{var a=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(a)}catch(e){if(e instanceof W)return e;throw e}return r<e.length?new W(`N/A`):n}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t){e.sort(j_),t.sort(j_);var n=-1/0,r=0;function i(t){for(var i=0;r<e.length&&e[r]>n&&e[r]<=t;)++i,++r;return i}var a=new fm(this);return t.forEach(function(e,t){var r=i(e);n=e,a.set(t,0,r)}),a.set(a.height,0,e.length-r),a}),q(`rank.eq`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);try{var o=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(o)}catch(e){if(e instanceof W)return e;throw e}var s=e[r++];return s instanceof W?s:typeof(s=this.force(s))==`boolean`||typeof s==`number`&&(s=!!s,!0)||s==null&&(s=!1,!0)?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t,n){t.sort(n?j_:M_);var r=t.indexOf(e);return r<0?new W(`N/A`):r+1}),G.runtime.defineAlias(`rank`,`rank.eq`),q(`rank.avg`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);try{var o=this.cellValues(e.slice(r)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r=e.length,n.push(o)}catch(e){if(e instanceof W)return e;throw e}var s=e[r++];return s instanceof W?s:typeof(s=this.force(s))==`boolean`||typeof s==`number`&&(s=!!s,!0)||s==null&&(s=!1,!0)?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t,n){t.sort(n?j_:M_);var r=t.indexOf(e);if(r<0)return new W(`N/A`);for(var i=r;t[i]==e;++i);return(r+i+1)/2}),q(`kurt`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r=e.length,n.push(a)}catch(e){if(e instanceof W)return e;throw e}return a.length>=4||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){var t=e.length,n=f_(e),r=p_(e,t-1,n),i=Math.sqrt(r),a=e.reduce(function(e,t){return e+((t-n)/i)**4},0);return t*(t+1)/((t-1)*(t-2)*(t-3))*a-3*(t-1)**2/((t-2)*(t-3))});function h_(e,t,n){var r=0,i=0,a=null,o=null,s=!1;return e.forEach(function(e){e<t?(r++,a=a==null?e:Math.max(a,e)):e>t?(i++,o=o==null?e:Math.min(o,e)):s=!0}),!r&&!i?new W(`N/A`):s?n?(r+1)/(e.length+1):r/(r+i):((o-t)*h_(e,a,n)+(t-a)*h_(e,o,n))/(o-a)}q(`percentrank.inc`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(a)}catch(e){if(e instanceof W)return e;throw e}var o=e[r++];if(o instanceof W)return o;if(!(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:(s=this.force(s))==null&&(s=3,!0)||(typeof s==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&((s|=0)>0||(i=`NUM`,!1))?(n.push(s),a.length>0||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t,n){var r=h_(e,t,0);return r=r.toFixed(n+1),parseFloat(r.substr(0,r.length-1))}),q(`percentrank.exc`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(a)}catch(e){if(e instanceof W)return e;throw e}var o=e[r++];if(o instanceof W)return o;if(!(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:(s=this.force(s))==null&&(s=3,!0)||(typeof s==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&((s|=0)>0||(i=`NUM`,!1))?(n.push(s),a.length>0||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t,n){var r=h_(e,t,1);return r=r.toFixed(n+1),parseFloat(r.substr(0,r.length-1))}),G.runtime.defineAlias(`percentrank`,`percentrank.inc`);function g_(e,t,n){for(var r=0,i=f_(e),a=f_(t),o=e.length,s=0;s<o;++s)r+=(e[s]-i)*(t[s]-a);return r/n}q(`covariance.p`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(a)}catch(e){if(e instanceof W)return e;throw e}try{var o=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(o)}catch(e){if(e instanceof W)return e;throw e}return!(a.length==o.length||(i=`N/A`,!1))||!(a.length>0||(i=`DIV/0`,!1))?new W(i):r<e.length?new W(`N/A`):n}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t){return g_(e,t,e.length)}),q(`covariance.s`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(a)}catch(e){if(e instanceof W)return e;throw e}try{var o=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(o)}catch(e){if(e instanceof W)return e;throw e}return!(a.length==o.length||(i=`N/A`,!1))||!(a.length>1||(i=`DIV/0`,!1))?new W(i):r<e.length?new W(`N/A`):n}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t){return g_(e,t,e.length-1)}),G.runtime.defineAlias(`covar`,`covariance.p`);var __=Pp(function(e){for(var t=2,n=1;t<=e;++t)n*=t;return n});q(`fact`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:(typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&((a|=0)>=0||(i=`NUM`,!1))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),__),q(`factdouble`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:(typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&((a|=0)>=0||(i=`NUM`,!1))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){for(var t=2+(e&1),n=1;t<=e;t+=2)n*=t;return n}),q(`multinomial`,!1,function(){function e(e){var t,n=[],r=0;try{var i=this.cellValues(e.slice(r)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r=e.length,n.push(i)}catch(e){if(e instanceof W)return e;throw e}return r<e.length?new W(`N/A`):n}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){var t=1,n=0;return e.forEach(function(e){if(e<0)throw new W(`NUM`);n+=e,t*=__(e)}),__(n)/t});var v_=Pp(function(e,t){for(var n=t+1,r=1,i=1,a=1;r<=e-t;++n,++r)i*=n,a*=r;return i/a});q(`combin`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&((a|=0)>0||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)&&(o>=0&&o<=a||(i=`NUM`,!1))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),v_),q(`combina`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&((a|=0)>0||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)&&(o>=1&&o<=a||(i=`NUM`,!1))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return v_(e+t-1,e-1)}),q(`average`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`;try{var i=this.cellValues(e.slice(n)).reduce(function(e,t){if(t instanceof W)throw t;return typeof t==`number`&&(t=J(t),!0)&&e.push(t),e}.bind(this),[]);n=e.length,t.push(i)}catch(e){if(e instanceof W)return e;throw e}return i.length>0||(r=`DIV/0`,!1)?n<e.length?new W(`N/A`):t:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){return e.reduce(function(e,t){return e+t},0)/e.length}),q(`averagea`,!1,function(){function e(e){var t=[],n=0;try{var r=this.cellValues(e.slice(n)).reduce(function(t,r){if(r instanceof W)throw r;return r!=null&&n<=e.length&&t.push(r),t}.bind(this),[]);n=e.length,t.push(r)}catch(e){if(e instanceof W)return e;throw e}return n<e.length?new W(`N/A`):t}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){var t=0,n=0;return e.forEach(function(e){typeof e!=`string`&&(t+=e),++n}),n?t/n:new W(`DIV/0`)});function y_(e,t){e.sort(j_);var n=e.length,r=t|0,i=t-r;return r===0?e[0]:r>=n?e[n-1]:(--r,e[r]+i*(e[r+1]-e[r]))}function b_(e,t){return y_(e,t*(e.length-1)+1)}function x_(e,t){return y_(e,t*(e.length+1))}q(`percentile.inc`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(a)}catch(e){if(e instanceof W)return e;throw e}var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o>=0&&o<=1||(i=`NUM`,!1))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),b_),q(`percentile.exc`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(a)}catch(e){if(e instanceof W)return e;throw e}var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o>0&&o<1||(i=`NUM`,!1))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),x_),q(`quartile.inc`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(a)}catch(e){if(e instanceof W)return e;throw e}var o=e[r++];return o instanceof W?o:(o=this.force(o))!==0&&o!==1&&o!==2&&o!==3&&o!==4?o instanceof W?o:new W(i):(n.push(o),r<e.length?new W(`N/A`):n)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t){return b_(e,t/4)}),q(`quartile.exc`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(a)}catch(e){if(e instanceof W)return e;throw e}var o=e[r++];return o instanceof W?o:(o=this.force(o))!==0&&o!==1&&o!==2&&o!==3&&o!==4?o instanceof W?o:new W(i):(n.push(o),r<e.length?new W(`N/A`):n)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t){return x_(e,t/4)}),G.runtime.defineAlias(`quartile`,`quartile.inc`),G.runtime.defineAlias(`percentile`,`percentile.inc`);var S_=[`AVERAGE`,`COUNT`,`COUNTA`,`MAX`,`MIN`,`PRODUCT`,`STDEV.S`,`STDEV.P`,`SUM`,`VAR.S`,`VAR.P`,`MEDIAN`,`MODE.SNGL`,`LARGE`,`SMALL`,`PERCENTILE.INC`,`QUARTILE.INC`,`PERCENTILE.EXC`,`QUARTILE.EXC`];function C_(e,t,n){var r=[],i=1,a=2,o=4;return(function t(s){if(s instanceof z)e.getRefCells(s,!0).forEach(function(e){var t=e.value;if(!(n&i&&e.hidden)){if(e.formula){var s=e.formula.print(e.row,e.col);if(/^\s*(?:aggregate|subtotal)\s*\(/i.test(s)&&!(n&o))return}n&a&&t instanceof W||(typeof t==`number`||t instanceof W)&&r.push(t)}});else if(Array.isArray(s))for(var c=0;c<s.length;++c)t(s[c]);else s instanceof fm?s.each(t):(typeof s==`number`||s instanceof W&&!(n&a))&&r.push(s)})(t),r}q(`aggregate`,!0,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];if(i instanceof W)return i;if((i=this.force(i))!==1&&i!==2&&i!==3&&i!==4&&i!==5&&i!==6&&i!==7&&i!==8&&i!==9&&i!==10&&i!==11&&i!==12&&i!==13&&i!==14&&i!==15&&i!==16&&i!==17&&i!==18&&i!==19)return i instanceof W?i:new W(r);t.push(i);var a=e[n++];return a instanceof W?a:(a=this.force(a))==null&&(a=0,!0)||a===0||a===1||a===2||a===3||a===4||a===5||a===6||a===7?(t.push(a),t.push(e.slice(n)),n=e.length,n<e.length?new W(`N/A`):t):a instanceof W?a:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t,n,r){var i=this;i.resolveCells(r,function(){var a;if(t>12){a=C_(i,r[0],n);var o=r[1];if(o instanceof V&&(o=i.getRefData(o)),typeof o!=`number`)return e(new W(`VALUE`))}else a=C_(i,r,n);i.func(S_[t-1],e,a)})}),q(`subtotal`,!0,function(){function e(e){var t=[],n,r=[],i=0,a,o=`VALUE`,s=e[i++];if(s instanceof W)return s;if((s=this.force(s))!==1&&s!==2&&s!==3&&s!==4&&s!==5&&s!==6&&s!==7&&s!==8&&s!==9&&s!==10&&s!==11&&s!==101&&s!==102&&s!==103&&s!==104&&s!==105&&s!==106&&s!==107&&s!==108&&s!==109&&s!==110&&s!==111)return s instanceof W?s:new W(o);if(r.push(s),i>=e.length)return new W(`N/A`);r.push(n=[]),t.push(r),r=n;do{var c=e[i++];if(c instanceof W)return c;if(!(c instanceof z||(a=this.asMatrix(c))&&(c=a)))return new W(o);r.push(c)}while(i<e.length);return r=t.pop(),i<e.length?new W(`N/A`):r}function t(e,t){var n=[],r=0;for(n.push(e[r++]);r<e.length;)r++;this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t){var n=this,r=t>100;r&&(t-=100);for(var i=[],a=2;a<arguments.length;++a)i.push(arguments[a]);n.resolveCells(i,function(){var a=C_(n,i,+!!r);n.func(S_[t-1],e,a)})}),q(`avedev`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r=e.length,n.push(a)}catch(e){if(e instanceof W)return e;throw e}return a.length>=2||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){var t=e.reduce(function(e,t){return e+t},0)/e.length;return e.reduce(function(e,n){return e+Math.abs(n-t)},0)/e.length});function w_(e,t,n,r){if(r){for(var i=0,a=0;a<=e;++a)i+=v_(t,a)*n**+a*(1-n)**(t-a);return i}else return v_(t,e)*n**+e*(1-n)**(t-e)}q(`binom.dist`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&((a|=0)>=0||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)&&(o>=a||(i=`N/A`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>=0&&s<=1||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];return c instanceof W?c:typeof(c=this.force(c))==`boolean`||typeof c==`number`&&(c=!!c,!0)?(n.push(c),r<e.length?new W(`N/A`):n):c instanceof W?c:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),w_),G.runtime.defineAlias(`binomdist`,`binom.dist`),q(`binom.inv`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&((a|=0)>=0||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o>=0&&o<=1||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:(typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>=0&&s<=1||(i=`NUM`,!1))?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t,n){for(var r=0;r<=e;++r)if(w_(r,e,t,!0)>=n)return r;return new W(`N/A`)}),G.runtime.defineAlias(`critbinom`,`binom.inv`),q(`binom.dist.range`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&((a|=0)>=0||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o>=0&&o<=1||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s|=0,!0)&&(s>=0&&s<=a||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];return c instanceof W?c:(typeof(c=this.force(c))==`number`||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&(c|=0,!0)&&(c>=s&&c<=a||(i=`NUM`,!1))||c==null&&(c=s,!0)?(n.push(c),r<e.length?new W(`N/A`):n):c instanceof W?c:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t,n,r){for(var i=0,a=n;a<=r;++a)i+=v_(e,a)*t**+a*(1-t)**(e-a);return i}),q(`negbinom.dist`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&((a|=0)>=0||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&((o|=0)>=0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>=0&&s<=1||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];return c instanceof W?c:typeof(c=this.force(c))==`boolean`||typeof c==`number`&&(c=!!c,!0)?(n.push(c),r<e.length?new W(`N/A`):n):c instanceof W?c:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t,n,r){if(r){for(var i=0;e>=0;)i+=v_(e+t-1,e)*n**+t*(1-n)**e,e--;return i}return v_(e+t-1,e)*n**+t*(1-n)**e}),G.runtime.defineAlias(`negbinomdist`,`negbinom.dist`),q(`address`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&((a|=0)>0||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&((o|=0)>0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((s=this.force(s))==null&&(s=1,!0)||s===1||s===2||s===3||s===4))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!((c=this.force(c))==null&&(c=!0,!0)||typeof c==`boolean`||typeof c==`number`&&(c=!!c,!0)))return c instanceof W?c:new W(i);n.push(c);var l=e[r++];return l instanceof W?l:(l=this.force(l))==null||(typeof l==`string`||typeof l==`boolean`||typeof l==`number`?(l+=``,!0):l===void 0&&(l=``,!0))?(n.push(l),r<e.length?new W(`N/A`):n):l instanceof W?l:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t,n,r,i){var a=new V(e-1,t-1,n-1);return i&&a.setSheet(i,!0),r?a.print(0,0):a.print()}),q(`areas`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i instanceof W?i:i instanceof z?(t.push(i),n<e.length?new W(`N/A`):t):new W(r)}return{check:e}}(),function(e){var t=0;return(function e(n){n instanceof V||n instanceof H?t++:n instanceof U&&n.refs.forEach(e)})(e),t}),q(`choose`,!1,function(){function e(e){var t=[],n,r=[],i=0,a=`VALUE`,o=e[i++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(n=G.parse(0,0,0,o),/^date|number|percent$/.test(n.type)&&(o=+n.value,!0)))&&(o|=0,!0)))return o instanceof W?o:new W(a);if(r.push(o),i>=e.length)return new W(`N/A`);r.push(n=[]),t.push(r),r=n;do{var s=e[i++];if(s instanceof W)return s;if(!(i<=e.length))return new W(a);r.push(s)}while(i<e.length);return r=t.pop(),i<e.length?new W(`N/A`):r}function t(e,t){var n=[],r=0;for(n.push(e[r++]);r<e.length;)r++;this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);for(o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;a<e.length;)t.push(e[a++]),i.push(!1);return{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return e>t.length?new W(`N/A`):t[e-1]}),q(`column`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i instanceof W?i:i instanceof V||i instanceof H||(i=this.force(i))==null?(t.push(i),n<e.length?new W(`N/A`):t):i instanceof W?i:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){return e?e instanceof V?e.col+1:this.asMatrix(e).mapCol(function(t){return t+e.topLeft.col+1}):this.formula.col+1}),q(`columns`,!1,function(){function e(e){var t=[],n=0,r,i=`VALUE`,a=e[n++];return a instanceof W?a:a instanceof V||a instanceof H||(r=this.asMatrix(a))&&(a=r)?(t.push(a),n<e.length?new W(`N/A`):t):new W(i)}return{check:e}}(),function(e){return e instanceof z?e.width():e.width}),q(`formulatext`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i instanceof W?i:i instanceof z?(t.push(i),n<e.length?new W(`N/A`):t):new W(r)}return{check:e}}(),function(e){var t=this.getRefCells(e)[0];return t.formula?t.formula.print(t.row,t.col):new W(`N/A`)}),q(`hlookup`,!1,function(){function e(e){var t,n=[],r=0,i,a=`VALUE`,o=e[r++];if(o instanceof W)return o;if(!((o=this.force(o))!=null&&r<=e.length))return o instanceof W?o:new W(a);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((i=this.asMatrix(s))&&(s=i)))return s instanceof W?s:new W(a);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!((typeof(c=this.force(c))==`number`||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&((c|=0)>0||(a=`NUM`,!1))))return c instanceof W?c:new W(a);n.push(c);var l=e[r++];return l instanceof W?l:typeof(l=this.force(l))==`boolean`||typeof l==`number`&&(l=!!l,!0)||l==null&&(l=!0,!0)?(n.push(l),r<e.length?new W(`N/A`):n):l instanceof W?l:new W(a)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(Zg(e[r++],`topRow`)),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t,n,r){var i=null;return t.eachCol(function(n){var a=t.get(0,n);if(r){if(a>e)return!0;i=n}else if(a===e)return i=n,!0}),i==null?new W(`N/A`):t.get(n-1,i)}),q(`index`,!0,function(){function e(e){var t,n=[],r=0,i,a=`VALUE`,o=e[r++];if(o instanceof W)return o;if(!(o instanceof z||(i=this.asMatrix(o))&&(o=i)))return o instanceof W?o:new W(a);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&((s|=0)>=0||(a=`NUM`,!1))||s==null))return s instanceof W?s:new W(a);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!((typeof(c=this.force(c))==`number`||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&((c|=0)>=0||(a=`NUM`,!1))||c==null))return c instanceof W?c:new W(a);n.push(c);var l=e[r++];return l instanceof W?l:(typeof(l=this.force(l))==`number`||typeof l==`boolean`&&(l=+l,!0)||typeof l==`string`&&!/^(?:=|true|false)/i.test(l)&&(t=G.parse(0,0,0,l),/^date|number|percent$/.test(t.type)&&(l=+t.value,!0)))&&((l|=0)>0||(a=`NUM`,!1))||l==null&&(l=1,!0)?(n.push(l),r<e.length?new W(`N/A`):n):l instanceof W?l:new W(a)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t,n,r,i){var a=this;if(t instanceof U&&(t=t.refs[i-1]),!n&&!r||!t)return e(new W(`N/A`));if(t instanceof V&&(t=t.toRangeRef()),t instanceof H){if(n&&r){if(r>t.width()||n>t.height())return e(new W(`REF`));var o=t.toCell(n-1,r-1);a.resolveCells([o],function(){e(a.getRefData(o))});return}if(!n){var s=t.toColumn(r-1);a.resolveCells([s],function(){e(a.asMatrix(s))});return}if(!r){var c=t.toRow(n-1);a.resolveCells([c],function(){e(a.asMatrix(c))});return}}else if(t instanceof fm){if(t.width>1&&t.height>1){if(n&&r)return e(t.get(n-1,r-1));if(!n)return e(t.mapRow(function(e){return t.get(e,r-1)}));if(!r)return e(t.mapCol(function(e){return t.get(n-1,e)}))}if(t.width==1)return e(t.get((n||1)-1,0));if(t.height==1)return e(t.get(0,(r||1)-1))}else e(new W(`REF`))}),q(`indirect`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i instanceof W?i:(typeof(i=this.force(i))==`string`||typeof i==`boolean`||typeof i==`number`?(i+=``,!0):i===void 0&&(i=``,!0))?(t.push(i),n<e.length?new W(`N/A`):t):i instanceof W?i:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){try{var t=this.formula,n=G.parseFormula(t.sheet,t.row,t.col,e).ast;if(n instanceof Tp&&(n=this.ss.nameValue(n,t.sheet,t.row,t.col)),!(n instanceof z))throw 1;return n.absolute(t.row,t.col)}catch{return new W(`REF`)}}),q(`match`,!1,function(){function e(e){var t=[],n=0,r,i=`VALUE`,a=e[n++];if(a instanceof W)return a;if(!((a=this.force(a))!=null&&n<=e.length))return a instanceof W?a:new W(i);t.push(a);var o=e[n++];if(o instanceof W)return o;if(!((r=this.asMatrix(o))&&(o=r)))return o instanceof W?o:new W(i);t.push(o);var s=e[n++];return s instanceof W?s:(s=this.force(s))===-1||s===0||s===1||s==null&&(s=1,!0)?(t.push(s),n<e.length?new W(`N/A`):t):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t,n){var r=1,i;return n===0?i=k_(e):n===-1?i=k_(`<=`+e):n===1&&(i=k_(`>=`+e)),t.each(function(t){if(t!=null&&i(t))return n!==0&&e!=t&&--r,!0;r++},!0)&&r>0?r:new W(`N/A`)}),q(`offset`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(a instanceof V||a instanceof H))return new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s|=0,!0)))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!((typeof(c=this.force(c))==`number`||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&((c|=0)>0||(i=`NUM`,!1))||c==null&&(c=a.height(),!0)))return c instanceof W?c:new W(i);n.push(c);var l=e[r++];return l instanceof W?l:(typeof(l=this.force(l))==`number`||typeof l==`boolean`&&(l=+l,!0)||typeof l==`string`&&!/^(?:=|true|false)/i.test(l)&&(t=G.parse(0,0,0,l),/^date|number|percent$/.test(t.type)&&(l=+t.value,!0)))&&((l|=0)>0||(i=`NUM`,!1))||l==null&&(l=a.width(),!0)?(n.push(l),r<e.length?new W(`N/A`):n):l instanceof W?l:new W(i)}function t(e,t){var n=[],r=0;r++,n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0;t.push(e[a++]),i.push(!1);var o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var c=this._arrayArg(e[a]);c?(t.push(c),n=Math.max(n,c.width),r=Math.max(r,c.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var l=this._arrayArg(e[a]);return l?(t.push(l),n=Math.max(n,l.width),r=Math.max(r,l.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t,n,r,i){var a=(e instanceof V?e:e.topLeft).clone();return a.row+=t,a.col+=n,a.row<0||a.col<0?new W(`VALUE`):r>1||i>1?new H(a,new V(a.row+r-1,a.col+i-1)).setSheet(e.sheet,e.hasSheet()):a}),q(`row`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i instanceof W?i:i instanceof V||i instanceof H||(i=this.force(i))==null?(t.push(i),n<e.length?new W(`N/A`):t):i instanceof W?i:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){return e?e instanceof V?e.row+1:this.asMatrix(e).mapRow(function(t){return t+e.topLeft.row+1}):this.formula.row+1}),q(`rows`,!1,function(){function e(e){var t=[],n=0,r,i=`VALUE`,a=e[n++];return a instanceof W?a:a instanceof V||a instanceof H||(r=this.asMatrix(a))&&(a=r)?(t.push(a),n<e.length?new W(`N/A`):t):new W(i)}return{check:e}}(),function(e){return e instanceof z?e.height():e.height}),q(`vlookup`,!1,function(){function e(e){var t,n=[],r=0,i,a=`VALUE`,o=e[r++];if(o instanceof W)return o;if(!((o=this.force(o))!=null&&r<=e.length))return o instanceof W?o:new W(a);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((i=this.asMatrix(s))&&(s=i)))return s instanceof W?s:new W(a);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!((typeof(c=this.force(c))==`number`||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&((c|=0)>0||(a=`NUM`,!1))))return c instanceof W?c:new W(a);n.push(c);var l=e[r++];return l instanceof W?l:typeof(l=this.force(l))==`boolean`||typeof l==`number`&&(l=!!l,!0)||l==null&&(l=!0,!0)?(n.push(l),r<e.length?new W(`N/A`):n):l instanceof W?l:new W(a)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(Zg(e[r++],`leftColumn`)),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t,n,r){var i=null;return typeof e!=`number`&&(r=!1),typeof e==`string`&&(e=e.toLowerCase()),t.eachRow(function(n){var a=t.get(n,0);if(r){if(a>e)return!0;i=n}else if(typeof a==`string`&&(a=a.toLowerCase()),a===e)return i=n,!0}),i==null?new W(`N/A`):t.get(i,n-1)}),q(`date`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:(typeof(s=this.force(s))==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s|=0,!0)?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var c=this._arrayArg(e[a]);return c?(t.push(c),n=Math.max(n,c.width),r=Math.max(r,c.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t,n){return Qg(e,t-1,n)}),q(`day`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:(typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return Y(e).date}),q(`month`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:(typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return Y(e).month+1}),q(`year`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:(typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return Y(e).year}),q(`weekday`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:(typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return Y(e).day+1}),q(`weeknum`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(o=this.force(o))==null&&(o=1,!0)||o===1||o===2||o===11||o===12||o===13||o===14||o===15||o===16||o===17||o===21?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){var n=Qg(Y(e).year,0,1),r=Y(n),i;return t==21?(i=3-(r.day+6)%7,i<0&&(i+=7),n+=i,r.date+=i,r.day=4,t=1):t=t==1?0:t==2?1:(t-10)%7,i=r.day-t,i<0&&(i+=7),n-=i,Math.ceil((e+1-n)/7)});function T_(e){var t=Y(Qg(e,0,1));return t.day==4||t.day==3&&G.runtime.isLeapYear(e)?53:52}q(`isoweeknum`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:(typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){var t=Y(e),n=t.day||7,r=Math.floor((t.ord-n+10)/7);return r<1?T_(t.year-1):r==53&&r>T_(t.year)?1:r}),q(`now`,!1,function(){function e(e){return 0<e.length?new W(`N/A`):[]}return{check:e}}(),function(){return G.runtime.dateToSerial(new Date)}),q(`today`,!1,function(){function e(e){return 0<e.length?new W(`N/A`):[]}return{check:e}}(),function(){return G.runtime.dateToSerial(new Date)|0}),q(`time`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:(typeof(s=this.force(s))==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s|=0,!0)?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var c=this._arrayArg(e[a]);return c?(t.push(c),n=Math.max(n,c.width),r=Math.max(r,c.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t,n){return G.runtime.packTime(e,t,n,0)}),q(`hour`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return G.runtime.unpackTime(e).hours}),q(`minute`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return G.runtime.unpackTime(e).minutes}),q(`second`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return G.runtime.unpackTime(e).seconds}),q(`edate`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){var n=Y(e),r=n.month+t,i=n.year+Math.floor(r/12);return r%=12,r<0&&(r+=12),n=Math.min(n.date,$g(i,r)),Qg(i,r,n)}),q(`eomonth`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){var n=Y(e),r=n.month+t,i=n.year+Math.floor(r/12);return r%=12,r<0&&(r+=12),n=$g(i,r),Qg(i,r,n)}),q(`workday`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)))return o instanceof W?o:new W(i);n.push(o);try{var s=this.cellValues(e.slice(r)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&(n|=0,!0)&&e.push(n),e}.bind(this),[]);r=e.length,n.push(s)}catch(e){if(e instanceof W)return e;throw e}return r<e.length?new W(`N/A`):n}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t,n){var r=t>0?1:-1;t=Math.abs(t);for(var i=Y(e).day;t>0;)e+=r,i=(i+r)%7,i<0&&(i+=7),i>0&&i<6&&n.indexOf(e)<0&&--t;return e}),q(`networkdays`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)))return o instanceof W?o:new W(i);n.push(o);try{var s=this.cellValues(e.slice(r)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&(n|=0,!0)&&e.push(n),e}.bind(this),[]);r=e.length,n.push(s)}catch(e){if(e instanceof W)return e;throw e}return r<e.length?new W(`N/A`):n}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t,n){if(e>t){var r=e;e=t,t=r}for(var i=0,a=Y(e).day;e<=t;)a>0&&a<6&&n.indexOf(e)<0&&i++,e++,a=(a+1)%7;return i}),q(`days`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return e-t});function E_(e,t,n){var r=Y(e),i=Y(t);return n?(r.date==31&&(r.date=30),i.date==31&&(i.date=30)):(r.month==1&&i.month==1&&r.date==$g(r.year,1)&&i.date==$g(i.year,1)&&(i.date=30),r.date==$g(r.year,r.month)?(r.date=30,i.date==31&&(i.date=30)):r.date==30&&i.date==31&&(i.date=30)),360*(i.year-r.year)+30*(i.month-r.month)+(i.date-r.date)}G.runtime._days_360=E_,q(`days360`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:typeof(s=this.force(s))==`boolean`||typeof s==`number`&&(s=!!s,!0)||s==null&&(s=!1,!0)?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var c=this._arrayArg(e[a]);return c?(t.push(c),n=Math.max(n,c.width),r=Math.max(r,c.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),E_),q(`yearfrac`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:(s=this.force(s))==null&&(s=0,!0)||s===0||s===1||s===2||s===3||s===4?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var c=this._arrayArg(e[a]);return c?(t.push(c),n=Math.max(n,c.width),r=Math.max(r,c.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t,n){switch(n){case 0:return E_(e,t,!1)/360;case 1:return(t-e)/e_(Y(e).year);case 2:return(t-e)/360;case 3:return(t-e)/365;case 4:return E_(e,t,!0)/360}}),q(`datevalue`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i instanceof W?i:(typeof(i=this.force(i))==`string`||typeof i==`boolean`||typeof i==`number`?(i+=``,!0):i===void 0&&(i=``,!0))?(t.push(i),n<e.length?new W(`N/A`):t):i instanceof W?i:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){var t=G.runtime.parseDate(e);return t?G.runtime.dateToSerial(t):new W(`VALUE`)}),q(`timevalue`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i instanceof W?i:(typeof(i=this.force(i))==`string`||typeof i==`boolean`||typeof i==`number`?(i+=``,!0):i===void 0&&(i=``,!0))?(t.push(i),n<e.length?new W(`N/A`):t):i instanceof W?i:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){var t=e.toLowerCase().match(/(\d+):(\d+)(:(\d+)(\.(\d+))?)?\s*(am?|pm?)?/);if(t){var n=parseFloat(t[1]),r=parseFloat(t[2]),i=t[3]?parseFloat(t[4]):0,a=t[7];return a&&(n>12||n<1)?new W(`VALUE`):(/^p/.test(a)&&(n+=12),G.runtime.packTime(n,r,i,0))}return new W(`VALUE`)}),q(`mdeterm`,!1,function(){function e(e){var t=[],n=0,r,i=`VALUE`,a=e[n++];return a instanceof W?a:(r=this.asMatrix(a))&&(a=r)&&(a.width==a.height||(i=`N/A`,!1))?(t.push(a),n<e.length?new W(`N/A`):t):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){return e.each(function(e){if(typeof e!=`number`)return new W(`VALUE`)},!0)||e.determinant()}),q(`transpose`,!1,function(){function e(e){var t=[],n=0,r,i=`VALUE`,a=e[n++];return a instanceof W?a:(r=this.asMatrix(a))&&(a=r)?(t.push(a),n<e.length?new W(`N/A`):t):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){return e.transpose()}),q(`mmult`,!1,function(){function e(e){var t=[],n=0,r,i=`VALUE`,a=e[n++];if(a instanceof W)return a;if(!((r=this.asMatrix(a))&&(a=r)))return a instanceof W?a:new W(i);t.push(a);var o=e[n++];return o instanceof W?o:(r=this.asMatrix(o))&&(o=r)&&(o.height==a.width||(i=`N/A`,!1))?(t.push(o),n<e.length?new W(`N/A`):t):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t){return e.multiply(t)}),q(`munit`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:(typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&((a|=0)>=0||(i=`NUM`,!1))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){return new fm(this).unit(e)}),q(`minverse`,!1,function(){function e(e){var t=[],n=0,r,i=`VALUE`,a=e[n++];return a instanceof W?a:(r=this.asMatrix(a))&&(a=r)&&(a.width==a.height||(i=`N/A`,!1))?(t.push(a),n<e.length?new W(`N/A`):t):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e){return e.each(function(e){if(typeof e!=`number`)return new W(`VALUE`)},!0)||e.inverse()||new W(`VALUE`)}),q(`rand`,!1,function(){function e(e){return 0<e.length?new W(`N/A`):[]}return{check:e}}(),function(){return Math.random()}),q(`randbetween`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)&&(o>=a||(i=`N/A`,!1))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t){return e+Math.floor((t-e+1)*Math.random())}),q(`true`,!1,function(){function e(e){return 0<e.length?new W(`N/A`):[]}return{check:e}}(),function(){return!0}),q(`false`,!1,function(){function e(e){return 0<e.length?new W(`N/A`):[]}return{check:e}}(),function(){return!0}),q(`roman`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:(typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return Fp(e).toUpperCase()}),q(`arabic`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i instanceof W?i:(typeof(i=this.force(i))==`string`||typeof i==`boolean`||typeof i==`number`?(i+=``,!0):i===void 0&&(i=``,!0))?(t.push(i),n<e.length?new W(`N/A`):t):i instanceof W?i:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return Ip(e)??new W(`VALUE`)}),q(`base`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)&&(o>=2&&o<=36||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:(typeof(s=this.force(s))==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&((s|=0)>=0||(i=`NUM`,!1))||s==null&&(s=0,!0)?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var c=this._arrayArg(e[a]);return c?(t.push(c),n=Math.max(n,c.width),r=Math.max(r,c.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t,n){for(var r=e.toString(t).toUpperCase();r.length<n;)r=`0`+r;return r}),q(`decimal`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`string`||typeof a==`boolean`||typeof a==`number`?(a+=``,!0):a===void 0&&(a=``,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)&&(o>=2&&o<=36||(i=`NUM`,!1))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){e=e.toUpperCase();for(var n=0,r=0;r<e.length;++r){var i=e.charCodeAt(r);if(i>=48&&i<=57)i-=48;else if(i>=65&&i<55+t)i-=55;else return new W(`VALUE`);n=n*t+i}return n}),q(`char`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:(typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&((a|=0)>=0||(i=`NUM`,!1))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return String.fromCharCode(e)});var D_=/[\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]/g;q(`clean`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i instanceof W?i:(typeof(i=this.force(i))==`string`||typeof i==`boolean`||typeof i==`number`?(i+=``,!0):i===void 0&&(i=``,!0))?(t.push(i),n<e.length?new W(`N/A`):t):i instanceof W?i:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return e.replace(D_,``)}),q(`code`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i instanceof W?i:(typeof(i=this.force(i))==`string`||typeof i==`boolean`||typeof i==`number`?(i+=``,!0):i===void 0&&(i=``,!0))?(t.push(i),n<e.length?new W(`N/A`):t):i instanceof W?i:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return e.charAt(0)}),G.runtime.defineAlias(`unichar`,`char`),G.runtime.defineAlias(`unicode`,`code`),q(`concatenate`,!1,function(){function e(e){var t=[],n,r=[],i=0,a=`VALUE`;if(i>=e.length)return new W(`N/A`);r.push(n=[]),t.push(r),r=n;do{var o=e[i++];if(o instanceof W)return o;if(!(typeof(o=this.force(o))==`string`||typeof o==`boolean`||typeof o==`number`?(o+=``,!0):o===void 0&&(o=``,!0)))return o instanceof W?o:new W(a);r.push(o)}while(i<e.length);return r=t.pop(),i<e.length?new W(`N/A`):r}function t(e,t){for(var n=[],r=0;r<e.length;)n.push(e[r++]);this.resolveCells(n,t)}function n(e){for(var t=[],n=0,r=0,i=[],a=0;a<e.length;){var o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++}return{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){for(var t=``,n=0;n<e.length;++n)t+=e[n];return t}),q(`dollar`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)||o==null&&(o=2,!0)?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){for(var n=`$#,##0DECIMALS;($#,##0DECIMALS)`,r=``,i=1;t-->0;)r+=`0`;for(;++t<0;)i*=10;return r===``?i!==1&&(e=Math.round(e/i)*i):r=`.`+r,n=n.replace(/DECIMALS/g,r),yh.text(e,n)}),q(`exact`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];if(i instanceof W)return i;if(!(typeof(i=this.force(i))==`string`||typeof i==`boolean`||typeof i==`number`?(i+=``,!0):i===void 0&&(i=``,!0)))return i instanceof W?i:new W(r);t.push(i);var a=e[n++];return a instanceof W?a:(typeof(a=this.force(a))==`string`||typeof a==`boolean`||typeof a==`number`?(a+=``,!0):a===void 0&&(a=``,!0))?(t.push(a),n<e.length?new W(`N/A`):t):a instanceof W?a:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return e===t}),q(`find`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`string`||typeof a==`boolean`||typeof a==`number`?(a+=``,!0):a===void 0&&(a=``,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!(typeof(o=this.force(o))==`string`||typeof o==`boolean`||typeof o==`number`?(o+=``,!0):o===void 0&&(o=``,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:(typeof(s=this.force(s))==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&((s|=0)>0||(i=`NUM`,!1))||s==null&&(s=1,!0)?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var c=this._arrayArg(e[a]);return c?(t.push(c),n=Math.max(n,c.width),r=Math.max(r,c.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t,n){var r=t.indexOf(e,n-1);return r<0?new W(`VALUE`):r+1}),q(`fixed`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)||o==null&&(o=2,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:typeof(s=this.force(s))==`boolean`||s==null&&(s=!1,!0)?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var c=this._arrayArg(e[a]);return c?(t.push(c),n=Math.max(n,c.width),r=Math.max(r,c.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t,n){var r=10**t;e=Math.round(e*r)/r;var i=n?`0`:`#,##0`;if(t>0)for(i+=`.`;t-->0;)i+=`0`;return yh.text(e,i)}),q(`left`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`string`||typeof a==`boolean`||typeof a==`number`?(a+=``,!0):a===void 0&&(a=``,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&((o|=0)>=0||(i=`NUM`,!1))||o==null&&(o=1,!0)?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return e.substr(0,t)}),q(`right`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`string`||typeof a==`boolean`||typeof a==`number`?(a+=``,!0):a===void 0&&(a=``,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&((o|=0)>=0||(i=`NUM`,!1))||o==null&&(o=1,!0)?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return e.substr(-t)}),q(`len`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i instanceof W?i:(typeof(i=this.force(i))==`string`||typeof i==`boolean`||typeof i==`number`?(i+=``,!0):i===void 0&&(i=``,!0))?(t.push(i),n<e.length?new W(`N/A`):t):i instanceof W?i:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return e.length}),q(`lower`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i instanceof W?i:(typeof(i=this.force(i))==`string`||typeof i==`boolean`||typeof i==`number`?(i+=``,!0):i===void 0&&(i=``,!0))?(t.push(i),n<e.length?new W(`N/A`):t):i instanceof W?i:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return e.toLowerCase()}),q(`upper`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i instanceof W?i:(typeof(i=this.force(i))==`string`||typeof i==`boolean`||typeof i==`number`?(i+=``,!0):i===void 0&&(i=``,!0))?(t.push(i),n<e.length?new W(`N/A`):t):i instanceof W?i:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return e.toUpperCase()}),q(`ltrim`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i instanceof W?i:(typeof(i=this.force(i))==`string`||typeof i==`boolean`||typeof i==`number`?(i+=``,!0):i===void 0&&(i=``,!0))?(t.push(i),n<e.length?new W(`N/A`):t):i instanceof W?i:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return e.replace(/^\s+/,``)}),q(`rtrim`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i instanceof W?i:(typeof(i=this.force(i))==`string`||typeof i==`boolean`||typeof i==`number`?(i+=``,!0):i===void 0&&(i=``,!0))?(t.push(i),n<e.length?new W(`N/A`):t):i instanceof W?i:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return e.replace(/\s+$/,``)}),q(`trim`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i instanceof W?i:(typeof(i=this.force(i))==`string`||typeof i==`boolean`||typeof i==`number`?(i+=``,!0):i===void 0&&(i=``,!0))?(t.push(i),n<e.length?new W(`N/A`):t):i instanceof W?i:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return e.replace(/^\s+|\s+$/,``)}),q(`mid`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`string`||typeof a==`boolean`||typeof a==`number`?(a+=``,!0):a===void 0&&(a=``,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&((o|=0)>0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:(typeof(s=this.force(s))==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&((s|=0)>=0||(i=`NUM`,!1))?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var c=this._arrayArg(e[a]);return c?(t.push(c),n=Math.max(n,c.width),r=Math.max(r,c.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t,n){return e.substr(t-1,n)}),q(`proper`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i instanceof W?i:(typeof(i=this.force(i))==`string`||typeof i==`boolean`||typeof i==`number`?(i+=``,!0):i===void 0&&(i=``,!0))?(t.push(i),n<e.length?new W(`N/A`):t):i instanceof W?i:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return e.toLowerCase().replace(/\b./g,function(e){return e.toUpperCase()})}),q(`replace`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`string`||typeof a==`boolean`||typeof a==`number`?(a+=``,!0):a===void 0&&(a=``,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&((o|=0)>0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&((s|=0)>=0||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];return c instanceof W?c:(typeof(c=this.force(c))==`string`||typeof c==`boolean`||typeof c==`number`?(c+=``,!0):c===void 0&&(c=``,!0))?(n.push(c),r<e.length?new W(`N/A`):n):c instanceof W?c:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var c=this._arrayArg(e[a]);c?(t.push(c),n=Math.max(n,c.width),r=Math.max(r,c.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var l=this._arrayArg(e[a]);return l?(t.push(l),n=Math.max(n,l.width),r=Math.max(r,l.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t,n,r){return e.substr(0,--t)+r+e.substr(t+n)}),q(`rept`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`string`||typeof a==`boolean`||typeof a==`number`?(a+=``,!0):a===void 0&&(a=``,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&((o|=0)>=0||(i=`NUM`,!1))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){for(var n=``;t-->0;)n+=e;return n}),q(`search`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`string`||typeof a==`boolean`||typeof a==`number`?(a+=``,!0):a===void 0&&(a=``,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!(typeof(o=this.force(o))==`string`||typeof o==`boolean`||typeof o==`number`?(o+=``,!0):o===void 0&&(o=``,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:(typeof(s=this.force(s))==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&((s|=0)>0||(i=`NUM`,!1))||s==null&&(s=1,!0)?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var c=this._arrayArg(e[a]);return c?(t.push(c),n=Math.max(n,c.width),r=Math.max(r,c.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t,n){var r=t.toLowerCase().indexOf(e.toLowerCase(),n-1);return r<0?new W(`VALUE`):r+1}),q(`substitute`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`string`||typeof a==`boolean`||typeof a==`number`?(a+=``,!0):a===void 0&&(a=``,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!(typeof(o=this.force(o))==`string`||typeof o==`boolean`||typeof o==`number`?(o+=``,!0):o===void 0&&(o=``,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!(typeof(s=this.force(s))==`string`||typeof s==`boolean`||typeof s==`number`?(s+=``,!0):s===void 0&&(s=``,!0)))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];return c instanceof W?c:(typeof(c=this.force(c))==`number`||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&((c|=0)>0||(i=`NUM`,!1))||c==null?(n.push(c),r<e.length?new W(`N/A`):n):c instanceof W?c:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var c=this._arrayArg(e[a]);c?(t.push(c),n=Math.max(n,c.width),r=Math.max(r,c.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var l=this._arrayArg(e[a]);return l?(t.push(l),n=Math.max(n,l.width),r=Math.max(r,l.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t,n,r){if(t===n)return e;var i=e.split(t);if(r==null)return i.join(n);e=``,r--;for(var a=0;a<i.length;++a)e+=i[a],a<i.length-1&&(a===r?e+=n:e+=t);return e}),q(`t`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i instanceof W?i:(i=this.force(i))!=null&&n<=e.length?(t.push(i),n<e.length?new W(`N/A`):t):i instanceof W?i:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return typeof e==`string`?e:``}),q(`text`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];if(i instanceof W)return i;if(!((i=this.force(i))!=null&&n<=e.length))return i instanceof W?i:new W(r);t.push(i);var a=e[n++];return a instanceof W?a:(typeof(a=this.force(a))==`string`||typeof a==`boolean`||typeof a==`number`?(a+=``,!0):a===void 0&&(a=``,!0))?(t.push(a),n<e.length?new W(`N/A`):t):a instanceof W?a:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return yh.text(e,t)}),q(`value`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];return i instanceof W?i:(i=this.force(i))!=null&&n<=e.length?(t.push(i),n<e.length?new W(`N/A`):t):i instanceof W?i:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);return o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e){return typeof e==`number`?e:typeof e==`boolean`?+e:(e=(e+``).replace(/[$€,]/g,``),e=parseFloat(e),isNaN(e)?new W(`VALUE`):e)});function O_(e,t){this.link=e,this.text=t}O_.prototype.toString=function(){return this.text||this.link},q(`hyperlink`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];if(i instanceof W)return i;if(!(typeof(i=this.force(i))==`string`||typeof i==`boolean`||typeof i==`number`?(i+=``,!0):i===void 0&&(i=``,!0)))return i instanceof W?i:new W(r);t.push(i);var a=e[n++];return a instanceof W?a:(typeof(a=this.force(a))==`string`||typeof a==`boolean`||typeof a==`number`?(a+=``,!0):a===void 0&&(a=``,!0))||a==null&&(a=i,!0)?(t.push(a),n<e.length?new W(`N/A`):t):a instanceof W?a:new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return new O_(e,t)}),q(`iferror`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`,i=e[n++];if(i=this.force(i),!(n<=e.length))return new W(r);t.push(i);var a=e[n++];return(a=this.force(a))!=null&&n<=e.length?(t.push(a),n<e.length?new W(`N/A`):t):new W(r)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}function n(e){var t=[],n=0,r=0,i=[],a=0,o=this._arrayArg(e[a]);o?(t.push(o),n=Math.max(n,o.width),r=Math.max(r,o.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++;var s=this._arrayArg(e[a]);return s?(t.push(s),n=Math.max(n,s.width),r=Math.max(r,s.height),i.push(!0)):(t.push(e[a]),i.push(!1)),a++,{args:t,width:n,height:r,arrays:i}}return{check:e,resolve:t,arrayArgs:n}}(),function(e,t){return e instanceof W?t:e});var k_=(function(){var e=Object.create(null);function t(e,t){if(typeof t==`string`){var n=parseFloat(t);!isNaN(n)&&n==t&&(t=n)}return function(n){var r=t;return typeof n==`string`&&typeof r==`string`&&(n=n.toLowerCase(),r=r.toLowerCase()),e(n,r)}}function n(e){var t,n;return typeof e==`string`&&(e=e.toLowerCase()),/^[0-9.]+%$/.test(e)?(n=e.substr(0,e.length-1),t=parseFloat(n),!isNaN(t)&&t==n&&(e=t/100)):/^[0-9.]+$/.test(e)&&(t=parseFloat(e),!isNaN(t)&&t==e&&(e=t)),e}function r(e,t){return n(e)<n(t)}function i(e,t){return n(e)<=n(t)}function a(e,t){return n(e)>n(t)}function o(e,t){return n(e)>=n(t)}function s(e,t){return!c(e,t)}function c(e,t){return t instanceof RegExp?t.test(e):((typeof e==`string`||typeof t==`string`)&&(e=String(e),t=String(t)),n(e)==n(t))}return function(n){if(typeof n==`function`)return n;var l;if(l=/^=(.*)$/.exec(n))return t(c,l[1]);if(l=/^<>(.*)$/.exec(n))return t(s,l[1]);if(l=/^<=(.*)$/.exec(n))return t(i,l[1]);if(l=/^<(.*)$/.exec(n))return t(r,l[1]);if(l=/^>=(.*)$/.exec(n))return t(o,l[1]);if(l=/^>(.*)$/.exec(n))return t(a,l[1]);if(/[?*]/.exec(n)){var u=e[n];return u||=(u=n.replace(/(~\?|~\*|[\]({\+\.\|\^\$\\})\[]|[?*])/g,function(e){switch(e){case`~?`:return`\\?`;case`~*`:return`\\*`;case`?`:return`.`;case`*`:return`.*`;default:return`\\`+e}}),e[n]=RegExp(`^`+u+`$`,`i`)),t(c,u)}return t(c,n)}})();function A_(e){return typeof e==`number`||typeof e==`boolean`||e==null||e===``}function j_(e,t){return e===t?0:e<t?-1:1}function M_(e,t){return e===t?0:e<t?1:-1}q(`ERF`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))||o==null?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t){return t==null?L_(e):L_(t)-L_(e)}),q(`ERFC`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),R_),q(`GAMMALN`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>0||(i=`NUM`,!1))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),z_),q(`GAMMA`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),B_),q(`GAMMA.DIST`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>=0||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o>0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];return c instanceof W?c:typeof(c=this.force(c))==`boolean`||typeof c==`number`&&(c=!!c,!0)?(n.push(c),r<e.length?new W(`N/A`):n):c instanceof W?c:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),K_),q(`GAMMA.INV`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>=0&&a<=1||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o>0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:(typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),q_),q(`NORM.S.DIST`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:typeof(o=this.force(o))==`boolean`||typeof o==`number`&&(o=!!o,!0)?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),J_),q(`NORM.S.INV`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>=0&&a<=1||(i=`NUM`,!1))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Y_),q(`NORM.DIST`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];return c instanceof W?c:typeof(c=this.force(c))==`boolean`||typeof c==`number`&&(c=!!c,!0)?(n.push(c),r<e.length?new W(`N/A`):n):c instanceof W?c:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),X_),q(`NORM.INV`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>=0&&a<=1||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:(typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Z_),q(`BETADIST`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o>0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!(typeof(c=this.force(c))==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0))||c==null&&(c=0,!0)))return c instanceof W?c:new W(i);n.push(c);var l=e[r++];return l instanceof W?l:typeof(l=this.force(l))==`number`&&(l=J(l),!0)||typeof l==`boolean`&&(l=+l,!0)||typeof l==`string`&&!/^(?:=|true|false)/i.test(l)&&(t=G.parse(0,0,0,l),/^date|number|percent$/.test(t.type)&&(l=+t.value,!0))||l==null&&(l=1,!0)?(n.push(l),!(a>=c||(i=`NUM`,!1))||!(a<=l||(i=`NUM`,!1))||!(c<l||(i=`NUM`,!1))?new W(i):r<e.length?new W(`N/A`):n):l instanceof W?l:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),nv),q(`BETA.DIST`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o>0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!(typeof(c=this.force(c))==`boolean`||typeof c==`number`&&(c=!!c,!0)))return c instanceof W?c:new W(i);n.push(c);var l=e[r++];if(l instanceof W)return l;if(!(typeof(l=this.force(l))==`number`&&(l=J(l),!0)||typeof l==`boolean`&&(l=+l,!0)||typeof l==`string`&&!/^(?:=|true|false)/i.test(l)&&(t=G.parse(0,0,0,l),/^date|number|percent$/.test(t.type)&&(l=+t.value,!0))||l==null&&(l=0,!0)))return l instanceof W?l:new W(i);n.push(l);var u=e[r++];return u instanceof W?u:typeof(u=this.force(u))==`number`&&(u=J(u),!0)||typeof u==`boolean`&&(u=+u,!0)||typeof u==`string`&&!/^(?:=|true|false)/i.test(u)&&(t=G.parse(0,0,0,u),/^date|number|percent$/.test(t.type)&&(u=+t.value,!0))||u==null&&(u=1,!0)?(n.push(u),!(a>=l||(i=`NUM`,!1))||!(a<=u||(i=`NUM`,!1))||!(l<u||(i=`NUM`,!1))?new W(i):r<e.length?new W(`N/A`):n):u instanceof W?u:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),rv),q(`BETA.INV`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>=0&&a<=1||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o>0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!(typeof(c=this.force(c))==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0))||c==null&&(c=0,!0)))return c instanceof W?c:new W(i);n.push(c);var l=e[r++];return l instanceof W?l:typeof(l=this.force(l))==`number`&&(l=J(l),!0)||typeof l==`boolean`&&(l=+l,!0)||typeof l==`string`&&!/^(?:=|true|false)/i.test(l)&&(t=G.parse(0,0,0,l),/^date|number|percent$/.test(t.type)&&(l=+t.value,!0))||l==null&&(l=1,!0)?(n.push(l),r<e.length?new W(`N/A`):n):l instanceof W?l:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),iv),q(`CHISQ.DIST`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>=0||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&((o|=0)>0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:typeof(s=this.force(s))==`boolean`||typeof s==`number`&&(s=!!s,!0)?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),av),q(`CHISQ.DIST.RT`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>=0||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&((o|=0)>0||(i=`NUM`,!1))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),ov),q(`CHISQ.INV`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>=0&&a<=1||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&((o|=0)>0||(i=`NUM`,!1))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),sv),q(`CHISQ.INV.RT`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>=0&&a<=1||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&((o|=0)>0||(i=`NUM`,!1))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),cv),q(`CHISQ.TEST`,!1,function(){function e(e){var t=[],n=0,r,i=`VALUE`,a=e[n++];if(a instanceof W)return a;if(!((r=this.asMatrix(a))&&(a=r)))return a instanceof W?a:new W(i);t.push(a);var o=e[n++];return o instanceof W?o:(r=this.asMatrix(o))&&(o=r)?(t.push(o),!(a.width==o.width||(i=`N/A`,!1))||!(a.height==o.height||(i=`N/A`,!1))?new W(i):n<e.length?new W(`N/A`):t):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),function(e,t){return lv(e.data,t.data)}),q(`EXPON.DIST`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>=0||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o>0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:typeof(s=this.force(s))==`boolean`||typeof s==`number`&&(s=!!s,!0)?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),uv),q(`POISSON.DIST`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&((a|=0)>=0||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o>=0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:typeof(s=this.force(s))==`boolean`||typeof s==`number`&&(s=!!s,!0)?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),dv),q(`F.DIST`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>=0||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&((o|=0)>0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&((s|=0)>0||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];return c instanceof W?c:typeof(c=this.force(c))==`boolean`||typeof c==`number`&&(c=!!c,!0)?(n.push(c),r<e.length?new W(`N/A`):n):c instanceof W?c:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),fv),q(`F.DIST.RT`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>=0||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&((o|=0)>0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:(typeof(s=this.force(s))==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&((s|=0)>0||(i=`NUM`,!1))?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),pv),q(`F.INV`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>=0&&a<=1||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&((o|=0)>0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:(typeof(s=this.force(s))==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&((s|=0)>0||(i=`NUM`,!1))?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),hv),q(`F.INV.RT`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>=0&&a<=1||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&((o|=0)>0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:(typeof(s=this.force(s))==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&((s|=0)>0||(i=`NUM`,!1))?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),mv),q(`F.TEST`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(a)}catch(e){if(e instanceof W)return e;throw e}try{var o=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(o)}catch(e){if(e instanceof W)return e;throw e}return!(a.length>=2||(i=`DIV/0`,!1))||!(o.length>=2||(i=`DIV/0`,!1))?new W(i):r<e.length?new W(`N/A`):n}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),vv),q(`FISHER`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>-1&&a<1||(i=`NUM`,!1))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),yv),q(`FISHERINV`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),bv),q(`T.DIST`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&((o|=0)>0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:typeof(s=this.force(s))==`boolean`||typeof s==`number`&&(s=!!s,!0)?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),xv),q(`T.DIST.RT`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&((o|=0)>0||(i=`NUM`,!1))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Sv),q(`T.DIST.2T`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>=0||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&((o|=0)>0||(i=`NUM`,!1))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Cv),q(`T.INV`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>0&&a<=1||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&((o|=0)>0||(i=`NUM`,!1))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),wv),q(`T.INV.2T`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>0&&a<=1||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&((o|=0)>0||(i=`NUM`,!1))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Tv),q(`T.TEST`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(a)}catch(e){if(e instanceof W)return e;throw e}try{var o=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(o)}catch(e){if(e instanceof W)return e;throw e}var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s|=0,!0)&&(s===1||s===2)))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];return c instanceof W?c:(typeof(c=this.force(c))==`number`||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&(c|=0,!0)&&(c===1||c===2||c===3)?(n.push(c),!(c!=1||a.length==o.length||(i=`N/A`,!1))||!(a.length>=2||(i=`DIV/0`,!1))||!(o.length>=2||(i=`DIV/0`,!1))?new W(i):r<e.length?new W(`N/A`):n):c instanceof W?c:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),n.push(e.slice(r)),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Ev),q(`CONFIDENCE.T`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>0&&a<1||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o>0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:(typeof(s=this.force(s))==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&((s|=0)>0||(i=`NUM`,!1))&&(s!=1||(i=`DIV/0`,!1))?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Dv),q(`CONFIDENCE.NORM`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>0&&a<1||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o>0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:(typeof(s=this.force(s))==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&((s|=0)>0||(i=`NUM`,!1))?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Ov),q(`GAUSS`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),kv),q(`PHI`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];return a instanceof W?a:typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))?(n.push(a),r<e.length?new W(`N/A`):n):a instanceof W?a:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Av),q(`LOGNORM.DIST`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>0||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];return c instanceof W?c:typeof(c=this.force(c))==`boolean`||typeof c==`number`&&(c=!!c,!0)?(n.push(c),r<e.length?new W(`N/A`):n):c instanceof W?c:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),jv),q(`LOGNORM.INV`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>0&&a<1||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:(typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Mv),q(`PROB`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(a)}catch(e){if(e instanceof W)return e;throw e}try{var o=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(o)}catch(e){if(e instanceof W)return e;throw e}var s=e[r++];if(s instanceof W)return s;if(!(typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];return c instanceof W?c:typeof(c=this.force(c))==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0))||c==null&&(c=s,!0)?(n.push(c),o.length==a.length||(i=`N/A`,!1)?r<e.length?new W(`N/A`):n:new W(i)):c instanceof W?c:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),n.push(e.slice(r)),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Nv),q(`SLOPE`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(a)}catch(e){if(e instanceof W)return e;throw e}try{var o=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(o)}catch(e){if(e instanceof W)return e;throw e}return!(o.length==a.length||(i=`N/A`,!1))||!(o.length>0&&a.length>0||(i=`N/A`,!1))?new W(i):r<e.length?new W(`N/A`):n}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Pv),q(`INTERCEPT`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(a)}catch(e){if(e instanceof W)return e;throw e}try{var o=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(o)}catch(e){if(e instanceof W)return e;throw e}return!(o.length==a.length||(i=`N/A`,!1))||!(o.length>0&&a.length>0||(i=`N/A`,!1))?new W(i):r<e.length?new W(`N/A`):n}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Fv),q(`PEARSON`,!1,function(){function e(e){var t=[],n=0,r=`VALUE`;try{var i=this.cellValues(e.slice(n,n+1),!0).reduce(function(t,r){if(r instanceof W)throw r;return n<=e.length&&t.push(r),t}.bind(this),[]);n+=1,t.push(i)}catch(e){if(e instanceof W)return e;throw e}try{var a=this.cellValues(e.slice(n,n+1),!0).reduce(function(t,r){if(r instanceof W)throw r;return n<=e.length&&t.push(r),t}.bind(this),[]);n+=1,t.push(a)}catch(e){if(e instanceof W)return e;throw e}return!(a.length==i.length||(r=`N/A`,!1))||!(a.length>0&&i.length>0||(r=`N/A`,!1))?new W(r):n<e.length?new W(`N/A`):t}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Iv),q(`RSQ`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(a)}catch(e){if(e instanceof W)return e;throw e}try{var o=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(o)}catch(e){if(e instanceof W)return e;throw e}return!(o.length==a.length||(i=`N/A`,!1))||!(o.length>0&&a.length>0||(i=`N/A`,!1))||!(o.length!=1&&a.length!=1||(i=`N/A`,!1))?new W(i):r<e.length?new W(`N/A`):n}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Lv),q(`STEYX`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(a)}catch(e){if(e instanceof W)return e;throw e}try{var o=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(o)}catch(e){if(e instanceof W)return e;throw e}return!(o.length==a.length||(i=`N/A`,!1))||!(o.length>=3&&a.length>=3||(i=`DIV/0`,!1))?new W(i):r<e.length?new W(`N/A`):n}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Rv),q(`FORECAST`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);try{var o=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(o)}catch(e){if(e instanceof W)return e;throw e}try{var s=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(s)}catch(e){if(e instanceof W)return e;throw e}return!(s.length==o.length||(i=`N/A`,!1))||!(s.length>0&&o.length>0||(i=`N/A`,!1))?new W(i):r<e.length?new W(`N/A`):n}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),zv),q(`LINEST`,!1,function(){function e(e){var t=[],n=0,r,i=`VALUE`,a=e[n++];if(a instanceof W)return a;if(!((r=this.asMatrix(a))&&(a=r)))return a instanceof W?a:new W(i);t.push(a);var o=e[n++];if(o instanceof W)return o;if(!((r=this.asMatrix(o))&&(o=r)||o==null))return o instanceof W?o:new W(i);t.push(o);var s=e[n++];if(s instanceof W)return s;if(!(typeof(s=this.force(s))==`boolean`||typeof s==`number`&&(s=!!s,!0)||s==null&&(s=!0,!0)))return s instanceof W?s:new W(i);t.push(s);var c=e[n++];return c instanceof W?c:typeof(c=this.force(c))==`boolean`||typeof c==`number`&&(c=!!c,!0)||c==null&&(c=!1,!0)?(t.push(c),n<e.length?new W(`N/A`):t):c instanceof W?c:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Hv),q(`LOGEST`,!1,function(){function e(e){var t=[],n=0,r,i=`VALUE`,a=e[n++];if(a instanceof W)return a;if(!((r=this.asMatrix(a))&&(a=r)))return a instanceof W?a:new W(i);t.push(a);var o=e[n++];if(o instanceof W)return o;if(!((r=this.asMatrix(o))&&(o=r)||o==null))return o instanceof W?o:new W(i);t.push(o);var s=e[n++];if(s instanceof W)return s;if(!(typeof(s=this.force(s))==`boolean`||typeof s==`number`&&(s=!!s,!0)||s==null&&(s=!0,!0)))return s instanceof W?s:new W(i);t.push(s);var c=e[n++];return c instanceof W?c:typeof(c=this.force(c))==`boolean`||typeof c==`number`&&(c=!!c,!0)||c==null&&(c=!1,!0)?(t.push(c),n<e.length?new W(`N/A`):t):c instanceof W?c:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Uv),q(`TREND`,!1,function(){function e(e){var t=[],n=0,r,i=`VALUE`,a=e[n++];if(a instanceof W)return a;if(!((r=this.asMatrix(a))&&(a=r)))return a instanceof W?a:new W(i);t.push(a);var o=e[n++];if(o instanceof W)return o;if(!((r=this.asMatrix(o))&&(o=r)||o==null))return o instanceof W?o:new W(i);t.push(o);var s=e[n++];if(s instanceof W)return s;if(!((r=this.asMatrix(s))&&(s=r)||s==null))return s instanceof W?s:new W(i);t.push(s);var c=e[n++];return c instanceof W?c:typeof(c=this.force(c))==`boolean`||typeof c==`number`&&(c=!!c,!0)||c==null&&(c=!0,!0)?(t.push(c),n<e.length?new W(`N/A`):t):c instanceof W?c:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Wv),q(`GROWTH`,!1,function(){function e(e){var t=[],n=0,r,i=`VALUE`,a=e[n++];if(a instanceof W)return a;if(!((r=this.asMatrix(a))&&(a=r)))return a instanceof W?a:new W(i);t.push(a);var o=e[n++];if(o instanceof W)return o;if(!((r=this.asMatrix(o))&&(o=r)||o==null))return o instanceof W?o:new W(i);t.push(o);var s=e[n++];if(s instanceof W)return s;if(!((r=this.asMatrix(s))&&(s=r)||s==null))return s instanceof W?s:new W(i);t.push(s);var c=e[n++];return c instanceof W?c:typeof(c=this.force(c))==`boolean`||typeof c==`number`&&(c=!!c,!0)||c==null&&(c=!0,!0)?(t.push(c),n<e.length?new W(`N/A`):t):c instanceof W?c:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Gv),q(`FV`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!(typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0))||s==null&&(s=0,!0)))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!(typeof(c=this.force(c))==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0))||c==null&&(c=0,!0)))return c instanceof W?c:new W(i);n.push(c);var l=e[r++];return l instanceof W?l:(l=this.force(l))===0||l===1||l==null&&(l=0,!0)?(n.push(l),s||c||(i=`N/A`,!1)?r<e.length?new W(`N/A`):n:new W(i)):l instanceof W?l:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),qv),q(`PV`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!(typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0))||s==null&&(s=0,!0)))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!(typeof(c=this.force(c))==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0))||c==null&&(c=0,!0)))return c instanceof W?c:new W(i);n.push(c);var l=e[r++];return l instanceof W?l:(l=this.force(l))===0||l===1||l==null&&(l=0,!0)?(n.push(l),r<e.length?new W(`N/A`):n):l instanceof W?l:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Jv),q(`PMT`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!(typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!(typeof(c=this.force(c))==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0))||c==null&&(c=0,!0)))return c instanceof W?c:new W(i);n.push(c);var l=e[r++];return l instanceof W?l:(l=this.force(l))===0||l===1||l==null&&(l=0,!0)?(n.push(l),r<e.length?new W(`N/A`):n):l instanceof W?l:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Yv),q(`NPER`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!(typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!(typeof(c=this.force(c))==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0))||c==null&&(c=0,!0)))return c instanceof W?c:new W(i);n.push(c);var l=e[r++];return l instanceof W?l:(l=this.force(l))===0||l===1||l==null&&(l=0,!0)?(n.push(l),r<e.length?new W(`N/A`):n):l instanceof W?l:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Xv),q(`RATE`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))||o==null&&(o=0,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!(typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!(typeof(c=this.force(c))==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0))||c==null&&(c=0,!0)))return c instanceof W?c:new W(i);n.push(c);var l=e[r++];if(l instanceof W)return l;if(!((l=this.force(l))===0||l===1||l==null&&(l=0,!0)))return l instanceof W?l:new W(i);n.push(l);var u=e[r++];return u instanceof W?u:(typeof(u=this.force(u))==`number`&&(u=J(u),!0)||typeof u==`boolean`&&(u=+u,!0)||typeof u==`string`&&!/^(?:=|true|false)/i.test(u)&&(t=G.parse(0,0,0,u),/^date|number|percent$/.test(t.type)&&(u=+t.value,!0)))&&(u>0||(i=`NUM`,!1))||u==null&&(u=.01,!0)?(n.push(u),o||c||(i=`N/A`,!1)?r<e.length?new W(`N/A`):n:new W(i)):u instanceof W?u:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Zv),q(`IPMT`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o>0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!(typeof(c=this.force(c))==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0))))return c instanceof W?c:new W(i);n.push(c);var l=e[r++];if(l instanceof W)return l;if(!(typeof(l=this.force(l))==`number`&&(l=J(l),!0)||typeof l==`boolean`&&(l=+l,!0)||typeof l==`string`&&!/^(?:=|true|false)/i.test(l)&&(t=G.parse(0,0,0,l),/^date|number|percent$/.test(t.type)&&(l=+t.value,!0))||l==null&&(l=0,!0)))return l instanceof W?l:new W(i);n.push(l);var u=e[r++];return u instanceof W?u:(u=this.force(u))===0||u===1||u==null&&(u=0,!0)?(n.push(u),o>=1&&o<=s||(i=`N/A`,!1)?r<e.length?new W(`N/A`):n:new W(i)):u instanceof W?u:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Qv),q(`PPMT`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o>0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!(typeof(c=this.force(c))==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0))))return c instanceof W?c:new W(i);n.push(c);var l=e[r++];if(l instanceof W)return l;if(!(typeof(l=this.force(l))==`number`&&(l=J(l),!0)||typeof l==`boolean`&&(l=+l,!0)||typeof l==`string`&&!/^(?:=|true|false)/i.test(l)&&(t=G.parse(0,0,0,l),/^date|number|percent$/.test(t.type)&&(l=+t.value,!0))||l==null&&(l=0,!0)))return l instanceof W?l:new W(i);n.push(l);var u=e[r++];return u instanceof W?u:(u=this.force(u))===0||u===1||u==null&&(u=0,!0)?(n.push(u),o>=1&&o<=s||(i=`N/A`,!1)?r<e.length?new W(`N/A`):n:new W(i)):u instanceof W?u:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),$v),q(`CUMPRINC`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>0||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o>0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!((typeof(c=this.force(c))==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&(c>0||(i=`NUM`,!1))))return c instanceof W?c:new W(i);n.push(c);var l=e[r++];if(l instanceof W)return l;if(!((typeof(l=this.force(l))==`number`&&(l=J(l),!0)||typeof l==`boolean`&&(l=+l,!0)||typeof l==`string`&&!/^(?:=|true|false)/i.test(l)&&(t=G.parse(0,0,0,l),/^date|number|percent$/.test(t.type)&&(l=+t.value,!0)))&&(l>0||(i=`NUM`,!1))))return l instanceof W?l:new W(i);n.push(l);var u=e[r++];return u instanceof W?u:(u=this.force(u))===0||u===1||u==null&&(u=0,!0)?(n.push(u),l>=c||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)):u instanceof W?u:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),ey),q(`CUMIPMT`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>0||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o>0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!((typeof(c=this.force(c))==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&(c>0||(i=`NUM`,!1))))return c instanceof W?c:new W(i);n.push(c);var l=e[r++];if(l instanceof W)return l;if(!((typeof(l=this.force(l))==`number`&&(l=J(l),!0)||typeof l==`boolean`&&(l=+l,!0)||typeof l==`string`&&!/^(?:=|true|false)/i.test(l)&&(t=G.parse(0,0,0,l),/^date|number|percent$/.test(t.type)&&(l=+t.value,!0)))&&(l>0||(i=`NUM`,!1))))return l instanceof W?l:new W(i);n.push(l);var u=e[r++];return u instanceof W?u:(u=this.force(u))===0||u===1||u==null&&(u=0,!0)?(n.push(u),l>=c||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)):u instanceof W?u:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),ty),q(`NPV`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);try{var o=this.cellValues(e.slice(r)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r=e.length,n.push(o)}catch(e){if(e instanceof W)return e;throw e}return o.length>0||(i=`N/A`,!1)?r<e.length?new W(`N/A`):n:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),ny),q(`IRR`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(a)}catch(e){if(e instanceof W)return e;throw e}var o=e[r++];return o instanceof W?o:typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))||o==null&&(o=.1,!0)?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),ry),q(`EFFECT`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>0||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&((o|=0)>0||(i=`NUM`,!1))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),iy),q(`NOMINAL`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>0||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];return o instanceof W?o:(typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&((o|=0)>0||(i=`NUM`,!1))?(n.push(o),r<e.length?new W(`N/A`):n):o instanceof W?o:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),ay),q(`XNPV`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);try{var o=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(o)}catch(e){if(e instanceof W)return e;throw e}try{var s=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&(n|=0,!0)&&e.push(n),e}.bind(this),[]);r+=1,n.push(s)}catch(e){if(e instanceof W)return e;throw e}return o.length==s.length||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),n.push(e.slice(r)),this.resolveCells(n,t)}return{check:e,resolve:t}}(),oy),q(`XIRR`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`;try{var a=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`&&(n=J(n),!0)||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&e.push(n),e}.bind(this),[]);r+=1,n.push(a)}catch(e){if(e instanceof W)return e;throw e}try{var o=this.cellValues(e.slice(r,r+1)).reduce(function(e,n){if(n instanceof W)throw n;return(typeof n==`number`||typeof n==`boolean`&&(n=+n,!0)||typeof n==`string`&&!/^(?:=|true|false)/i.test(n)&&(t=G.parse(0,0,0,n),/^date|number|percent$/.test(t.type)&&(n=+t.value,!0)))&&(n|=0,!0)&&e.push(n),e}.bind(this),[]);r+=1,n.push(o)}catch(e){if(e instanceof W)return e;throw e}var s=e[r++];return s instanceof W?s:typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0))||s==null&&(s=.1,!0)?(n.push(s),a.length==o.length||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e.slice(r)),n.push(e.slice(r)),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),sy),q(`ISPMT`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o>0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];return c instanceof W?c:typeof(c=this.force(c))==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0))?(n.push(c),o>=1&&o<=s||(i=`N/A`,!1)?r<e.length?new W(`N/A`):n:new W(i)):c instanceof W?c:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),cy),q(`DB`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!((typeof(c=this.force(c))==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&(c>0||(i=`NUM`,!1))))return c instanceof W?c:new W(i);n.push(c);var l=e[r++];return l instanceof W?l:typeof(l=this.force(l))==`number`&&(l=J(l),!0)||typeof l==`boolean`&&(l=+l,!0)||typeof l==`string`&&!/^(?:=|true|false)/i.test(l)&&(t=G.parse(0,0,0,l),/^date|number|percent$/.test(t.type)&&(l=+t.value,!0))||l==null&&(l=12,!0)?(n.push(l),r<e.length?new W(`N/A`):n):l instanceof W?l:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),ly),q(`DDB`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!((typeof(c=this.force(c))==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&(c>0||(i=`NUM`,!1))))return c instanceof W?c:new W(i);n.push(c);var l=e[r++];return l instanceof W?l:typeof(l=this.force(l))==`number`&&(l=J(l),!0)||typeof l==`boolean`&&(l=+l,!0)||typeof l==`string`&&!/^(?:=|true|false)/i.test(l)&&(t=G.parse(0,0,0,l),/^date|number|percent$/.test(t.type)&&(l=+t.value,!0))||l==null&&(l=2,!0)?(n.push(l),r<e.length?new W(`N/A`):n):l instanceof W?l:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),uy),q(`SLN`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];return s instanceof W?s:(typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))?(n.push(s),r<e.length?new W(`N/A`):n):s instanceof W?s:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),dy),q(`SYD`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!(typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!(typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];return c instanceof W?c:(typeof(c=this.force(c))==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&(c>0||(i=`NUM`,!1))?(n.push(c),r<e.length?new W(`N/A`):n):c instanceof W?c:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),fy),q(`VDB`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`&&(a=J(a),!0)||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a>=0||(i=`NUM`,!1))))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`&&(o=J(o),!0)||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o>=0||(i=`NUM`,!1))))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!((typeof(c=this.force(c))==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&(c>=0||(i=`NUM`,!1))))return c instanceof W?c:new W(i);n.push(c);var l=e[r++];if(l instanceof W)return l;if(!((typeof(l=this.force(l))==`number`&&(l=J(l),!0)||typeof l==`boolean`&&(l=+l,!0)||typeof l==`string`&&!/^(?:=|true|false)/i.test(l)&&(t=G.parse(0,0,0,l),/^date|number|percent$/.test(t.type)&&(l=+t.value,!0)))&&(l>=0||(i=`NUM`,!1))))return l instanceof W?l:new W(i);n.push(l);var u=e[r++];if(u instanceof W)return u;if(!((typeof(u=this.force(u))==`number`&&(u=J(u),!0)||typeof u==`boolean`&&(u=+u,!0)||typeof u==`string`&&!/^(?:=|true|false)/i.test(u)&&(t=G.parse(0,0,0,u),/^date|number|percent$/.test(t.type)&&(u=+t.value,!0)))&&(u>=0||(i=`NUM`,!1))||u==null&&(u=2,!0)))return u instanceof W?u:new W(i);n.push(u);var d=e[r++];return d instanceof W?d:typeof(d=this.force(d))==`boolean`||typeof d==`number`&&(d=!!d,!0)||d==null&&(d=!1,!0)?(n.push(d),l>=c||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)):d instanceof W?d:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),py),q(`COUPDAYBS`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s|=0,!0)&&(s===1||s===2||s===4)))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];return c instanceof W?c:(c=this.force(c))==null&&(c=0,!0)||(typeof c==`number`||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&(c|=0,!0)&&(c===0||c===1||c===2||c===3||c===4)?(n.push(c),a<o||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)):c instanceof W?c:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),vy),q(`COUPDAYS`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s|=0,!0)&&(s===1||s===2||s===4)))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];return c instanceof W?c:(c=this.force(c))==null&&(c=0,!0)||(typeof c==`number`||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&(c|=0,!0)&&(c===0||c===1||c===2||c===3||c===4)?(n.push(c),a<o||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)):c instanceof W?c:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),yy),q(`COUPDAYSNC`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s|=0,!0)&&(s===1||s===2||s===4)))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];return c instanceof W?c:(c=this.force(c))==null&&(c=0,!0)||(typeof c==`number`||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&(c|=0,!0)&&(c===0||c===1||c===2||c===3||c===4)?(n.push(c),a<o||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)):c instanceof W?c:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),by),q(`COUPPCD`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s|=0,!0)&&(s===1||s===2||s===4)))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];return c instanceof W?c:(c=this.force(c))==null&&(c=0,!0)||(typeof c==`number`||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&(c|=0,!0)&&(c===0||c===1||c===2||c===3||c===4)?(n.push(c),a<o||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)):c instanceof W?c:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),xy),q(`COUPNCD`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s|=0,!0)&&(s===1||s===2||s===4)))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];return c instanceof W?c:(c=this.force(c))==null&&(c=0,!0)||(typeof c==`number`||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&(c|=0,!0)&&(c===0||c===1||c===2||c===3||c===4)?(n.push(c),a<o||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)):c instanceof W?c:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Sy),q(`COUPNUM`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s|=0,!0)&&(s===1||s===2||s===4)))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];return c instanceof W?c:(c=this.force(c))==null&&(c=0,!0)||(typeof c==`number`||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&(c|=0,!0)&&(c===0||c===1||c===2||c===3||c===4)?(n.push(c),a<o||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)):c instanceof W?c:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Cy),q(`ACCRINTM`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!((c=this.force(c))==null&&(c=1e3,!0)||(typeof c==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&(c>0||(i=`NUM`,!1))))return c instanceof W?c:new W(i);n.push(c);var l=e[r++];return l instanceof W?l:(l=this.force(l))==null&&(l=0,!0)||(typeof l==`number`||typeof l==`boolean`&&(l=+l,!0)||typeof l==`string`&&!/^(?:=|true|false)/i.test(l)&&(t=G.parse(0,0,0,l),/^date|number|percent$/.test(t.type)&&(l=+t.value,!0)))&&(l|=0,!0)&&(l===0||l===1||l===2||l===3||l===4)?(n.push(l),a<o||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)):l instanceof W?l:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Ty),q(`ACCRINT`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s|=0,!0)))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!((typeof(c=this.force(c))==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&(c>0||(i=`NUM`,!1))))return c instanceof W?c:new W(i);n.push(c);var l=e[r++];if(l instanceof W)return l;if(!((l=this.force(l))==null&&(l=1e3,!0)||(typeof l==`number`&&(l=J(l),!0)||typeof l==`boolean`&&(l=+l,!0)||typeof l==`string`&&!/^(?:=|true|false)/i.test(l)&&(t=G.parse(0,0,0,l),/^date|number|percent$/.test(t.type)&&(l=+t.value,!0)))&&(l>0||(i=`NUM`,!1))))return l instanceof W?l:new W(i);n.push(l);var u=e[r++];if(u instanceof W)return u;if(!((typeof(u=this.force(u))==`number`||typeof u==`boolean`&&(u=+u,!0)||typeof u==`string`&&!/^(?:=|true|false)/i.test(u)&&(t=G.parse(0,0,0,u),/^date|number|percent$/.test(t.type)&&(u=+t.value,!0)))&&(u|=0,!0)&&(u===1||u===2||u===4)))return u instanceof W?u:new W(i);n.push(u);var d=e[r++];if(d instanceof W)return d;if(!((d=this.force(d))==null&&(d=0,!0)||(typeof d==`number`||typeof d==`boolean`&&(d=+d,!0)||typeof d==`string`&&!/^(?:=|true|false)/i.test(d)&&(t=G.parse(0,0,0,d),/^date|number|percent$/.test(t.type)&&(d=+t.value,!0)))&&(d|=0,!0)&&(d===0||d===1||d===2||d===3||d===4)))return d instanceof W?d:new W(i);n.push(d);var f=e[r++];return f instanceof W?f:typeof(f=this.force(f))==`boolean`||typeof f==`number`&&(f=!!f,!0)||f==null&&(f=!0,!0)?(n.push(f),a<s||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)):f instanceof W?f:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Ey),q(`DISC`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!((typeof(c=this.force(c))==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&(c>0||(i=`NUM`,!1))))return c instanceof W?c:new W(i);n.push(c);var l=e[r++];return l instanceof W?l:(l=this.force(l))==null&&(l=0,!0)||(typeof l==`number`||typeof l==`boolean`&&(l=+l,!0)||typeof l==`string`&&!/^(?:=|true|false)/i.test(l)&&(t=G.parse(0,0,0,l),/^date|number|percent$/.test(t.type)&&(l=+t.value,!0)))&&(l|=0,!0)&&(l===0||l===1||l===2||l===3||l===4)?(n.push(l),a<o||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)):l instanceof W?l:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Dy),q(`INTRATE`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!((typeof(c=this.force(c))==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&(c>0||(i=`NUM`,!1))))return c instanceof W?c:new W(i);n.push(c);var l=e[r++];return l instanceof W?l:(l=this.force(l))==null&&(l=0,!0)||(typeof l==`number`||typeof l==`boolean`&&(l=+l,!0)||typeof l==`string`&&!/^(?:=|true|false)/i.test(l)&&(t=G.parse(0,0,0,l),/^date|number|percent$/.test(t.type)&&(l=+t.value,!0)))&&(l|=0,!0)&&(l===0||l===1||l===2||l===3||l===4)?(n.push(l),a<o||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)):l instanceof W?l:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Oy),q(`RECEIVED`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!((typeof(c=this.force(c))==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&(c>0||(i=`NUM`,!1))))return c instanceof W?c:new W(i);n.push(c);var l=e[r++];return l instanceof W?l:(l=this.force(l))==null&&(l=0,!0)||(typeof l==`number`||typeof l==`boolean`&&(l=+l,!0)||typeof l==`string`&&!/^(?:=|true|false)/i.test(l)&&(t=G.parse(0,0,0,l),/^date|number|percent$/.test(t.type)&&(l=+t.value,!0)))&&(l|=0,!0)&&(l===0||l===1||l===2||l===3||l===4)?(n.push(l),a<o||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)):l instanceof W?l:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),ky),q(`PRICE`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!((typeof(c=this.force(c))==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&(c>0||(i=`NUM`,!1))))return c instanceof W?c:new W(i);n.push(c);var l=e[r++];if(l instanceof W)return l;if(!((typeof(l=this.force(l))==`number`&&(l=J(l),!0)||typeof l==`boolean`&&(l=+l,!0)||typeof l==`string`&&!/^(?:=|true|false)/i.test(l)&&(t=G.parse(0,0,0,l),/^date|number|percent$/.test(t.type)&&(l=+t.value,!0)))&&(l>0||(i=`NUM`,!1))))return l instanceof W?l:new W(i);n.push(l);var u=e[r++];if(u instanceof W)return u;if(!((typeof(u=this.force(u))==`number`||typeof u==`boolean`&&(u=+u,!0)||typeof u==`string`&&!/^(?:=|true|false)/i.test(u)&&(t=G.parse(0,0,0,u),/^date|number|percent$/.test(t.type)&&(u=+t.value,!0)))&&(u|=0,!0)&&(u===1||u===2||u===4)))return u instanceof W?u:new W(i);n.push(u);var d=e[r++];return d instanceof W?d:(d=this.force(d))==null&&(d=0,!0)||(typeof d==`number`||typeof d==`boolean`&&(d=+d,!0)||typeof d==`string`&&!/^(?:=|true|false)/i.test(d)&&(t=G.parse(0,0,0,d),/^date|number|percent$/.test(t.type)&&(d=+t.value,!0)))&&(d|=0,!0)&&(d===0||d===1||d===2||d===3||d===4)?(n.push(d),a<o||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)):d instanceof W?d:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),Ay),q(`PRICEDISC`,!1,function(){function e(e){var t,n=[],r=0,i=`VALUE`,a=e[r++];if(a instanceof W)return a;if(!((typeof(a=this.force(a))==`number`||typeof a==`boolean`&&(a=+a,!0)||typeof a==`string`&&!/^(?:=|true|false)/i.test(a)&&(t=G.parse(0,0,0,a),/^date|number|percent$/.test(t.type)&&(a=+t.value,!0)))&&(a|=0,!0)))return a instanceof W?a:new W(i);n.push(a);var o=e[r++];if(o instanceof W)return o;if(!((typeof(o=this.force(o))==`number`||typeof o==`boolean`&&(o=+o,!0)||typeof o==`string`&&!/^(?:=|true|false)/i.test(o)&&(t=G.parse(0,0,0,o),/^date|number|percent$/.test(t.type)&&(o=+t.value,!0)))&&(o|=0,!0)))return o instanceof W?o:new W(i);n.push(o);var s=e[r++];if(s instanceof W)return s;if(!((typeof(s=this.force(s))==`number`&&(s=J(s),!0)||typeof s==`boolean`&&(s=+s,!0)||typeof s==`string`&&!/^(?:=|true|false)/i.test(s)&&(t=G.parse(0,0,0,s),/^date|number|percent$/.test(t.type)&&(s=+t.value,!0)))&&(s>0||(i=`NUM`,!1))))return s instanceof W?s:new W(i);n.push(s);var c=e[r++];if(c instanceof W)return c;if(!((typeof(c=this.force(c))==`number`&&(c=J(c),!0)||typeof c==`boolean`&&(c=+c,!0)||typeof c==`string`&&!/^(?:=|true|false)/i.test(c)&&(t=G.parse(0,0,0,c),/^date|number|percent$/.test(t.type)&&(c=+t.value,!0)))&&(c>0||(i=`NUM`,!1))))return c instanceof W?c:new W(i);n.push(c);var l=e[r++];return l instanceof W?l:(l=this.force(l))==null&&(l=0,!0)||(typeof l==`number`||typeof l==`boolean`&&(l=+l,!0)||typeof l==`string`&&!/^(?:=|true|false)/i.test(l)&&(t=G.parse(0,0,0,l),/^date|number|percent$/.test(t.type)&&(l=+t.value,!0)))&&(l|=0,!0)&&(l===0||l===1||l===2||l===3||l===4)?(n.push(l),a<o||(i=`NUM`,!1)?r<e.length?new W(`N/A`):n:new W(i)):l instanceof W?l:new W(i)}function t(e,t){var n=[],r=0;n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),n.push(e[r++]),this.resolveCells(n,t)}return{check:e,resolve:t}}(),jy);var N_=300,P_=22204e-20,F_=1e-30,I_=Math.abs;function L_(e){if(I_(e)>=3.3)return 1-R_(e);var t=e>0?1:-1;t==-1&&(e=-e);for(var n=0,r=1,i=1;i<100;i++)n+=r,r*=2*e*e/(2*i+1);return t*2/Math.sqrt(Math.PI)*e*Math.exp(-e*e)*n}function R_(e){if(I_(e)<3.3)return 1-L_(e);var t=1;e<0&&(t=-1,e=-e);for(var n=e,r=8;r>=1;r-=.5)n=e+r/n;return n=1/(e+n),t==1?Math.exp(-e*e)/Math.sqrt(Math.PI)*n:2-Math.exp(-e*e)/Math.sqrt(Math.PI)*n}function z_(e){var t=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],n=e,r=e+5.5,i=t[0];r-=(e+.5)*Math.log(r);for(var a=1;a<=6;a++)n+=1,i+=t[a]/n;return-r+Math.log(Math.sqrt(2*Math.PI)*i/e)}function B_(e){if(e>0)return Math.exp(z_(e));var t=Math.PI,n=-e;return-t/(n*B_(n)*Math.sin(t*n))}function V_(e,t){return z_(e)+z_(t)-z_(e+t)}function H_(e,t){return Math.exp(V_(e,t))}function U_(e,t){return t<e+1?W_(e,t):1-G_(e,t)}function W_(e,t){var n=1/e,r=n,i=e,a=z_(e),o;for(o=1;o<=N_&&(i++,r*=t/i,n+=r,!(I_(r)<I_(n)*P_));o++);return n*Math.exp(-t+e*Math.log(t)-a)}function G_(e,t){for(var n=F_,r=n,i=0,a=1,o=t+1-e,s=z_(e),c=1;c<=N_;c++){i=o+a*i,I_(i)<F_&&(i=F_),r=o+a/r,I_(r)<F_&&(r=F_),i=1/i;var l=r*i;if(n*=l,I_(l-1)<P_)break;o+=2,a=-c*(c-e)}return n*Math.exp(-t-s+e*Math.log(t))}function K_(e,t,n,r){return r?U_(t,e/n):(e/n)**(t-1)*Math.exp(-e/n)/(n*B_(t))}function q_(e,t,n){if(e===0)return 0;if(e==1)return 1/0;var r=0,i=10,a=0,o=t*n;o>1&&(i*=o);for(var s=0;s<N_;s++){a=.5*(r+i);var c=K_(a,t,n,!0);if(I_(e-c)<1e-16)break;c>e?i=a:r=a}return a}function J_(e,t){return t?.5+.5*L_(e/Math.sqrt(2)):Math.exp(-e*e/2)/Math.sqrt(2*Math.PI)}function Y_(e){var t=[-39.69683028665376,220.9460984245205,-275.9285104469687,138.357751867269,-30.66479806614716,2.506628277459239],n=[-54.47609879822406,161.5858368580409,-155.6989798598866,66.80131188771972,-13.28068155288572],r=[-.007784894002430293,-.3223964580411365,-2.400758277161838,-2.549732539343734,4.374664141464968,2.938163982698783],i=[.007784695709041462,.3224671290700398,2.445134137142996,3.754408661907416],a=.02425,o=1-a,s,c;return e<a?(s=Math.sqrt(-2*Math.log(e)),(((((r[0]*s+r[1])*s+r[2])*s+r[3])*s+r[4])*s+r[5])/((((i[0]*s+i[1])*s+i[2])*s+i[3])*s+1)):o<e?(s=Math.sqrt(-2*Math.log(1-e)),-(((((r[0]*s+r[1])*s+r[2])*s+r[3])*s+r[4])*s+r[5])/((((i[0]*s+i[1])*s+i[2])*s+i[3])*s+1)):(s=e-.5,c=s*s,(((((t[0]*c+t[1])*c+t[2])*c+t[3])*c+t[4])*c+t[5])*s/(((((n[0]*c+n[1])*c+n[2])*c+n[3])*c+n[4])*c+1))}function X_(e,t,n,r){return r?J_((e-t)/n,!0):Math.exp(-(e-t)*(e-t)/(2*n*n))/(n*Math.sqrt(2*Math.PI))}function Z_(e,t,n){return t+n*Y_(e)}function Q_(e,t,n){return Math.exp((t-1)*Math.log(e)+(n-1)*Math.log(1-e)-V_(t,n))}function $_(e,t,n){var r=Math.exp(t*Math.log(e)+n*Math.log(1-e)-V_(t,n));return e<(t+1)/(t+n+2)?r*ev(t,n,e)/t:1-r*ev(n,t,1-e)/n}function ev(e,t,n){var r,i,a,o,s,c,l,u=e+t,d,f=e+1;for(d=e-1,o=1,s=1-u*n/f,I_(s)<F_&&(s=F_),s=1/s,l=s,r=1;r<=N_&&(i=2*r,a=r*(t-r)*n/((d+i)*(e+i)),s=1+a*s,I_(s)<F_&&(s=F_),o=1+a/o,I_(o)<F_&&(o=F_),s=1/s,l*=s*o,a=-(e+r)*(u+r)*n/((e+i)*(f+i)),s=1+a*s,I_(s)<F_&&(s=F_),o=1+a/o,I_(o)<F_&&(o=F_),s=1/s,c=s*o,l*=c,!(I_(c-1)<P_));r++);return l}function tv(e,t,n){for(var r=0,i=1,a=0,o=0;o<N_;o++){a=.5*(r+i);var s=$_(a,t,n);if(I_(e-s)<P_)break;s>e?i=a:r=a}return a}function nv(e,t,n,r,i){return $_((e-r)/(i-r),t,n)}function rv(e,t,n,r,i,a){return r?$_((e-i)/(a-i),t,n):Q_((e-i)/(a-i),t,n)/(a-i)}function iv(e,t,n,r,i){return r+(i-r)*tv(e,t,n)}function av(e,t,n){return K_(e,t/2,2,n)}function ov(e,t){return 1-av(e,t,!0)}function sv(e,t){return q_(e,t/2,2)}function cv(e,t){return sv(1-e,t)}function lv(e,t){var n=e.length,r=e[0].length,i=0,a,o;for(a=0;a<n;a++)for(o=0;o<r;o++){var s=t[a][o],c=e[a][o]-s;c*=c,i+=c/s}var l=(n-1)*(r-1);return ov(i,l)}function uv(e,t,n){return n?1-Math.exp(-t*e):t*Math.exp(-t*e)}function dv(e,t,n){if(n)return 1-av(2*t,2*(e+1),!0);for(var r=0,i=2;i<=e;i++)r+=Math.log(i);return Math.exp(e*Math.log(t)-t-r)}function fv(e,t,n,r){if(r)return $_(t*e/(n+t*e),t/2,n/2);var i=t/n;return t/=2,n/=2,i/H_(t,n)*(i*e)**(t-1)/(1+i*e)**+(t+n)}function pv(e,t,n){return 1-fv(e,t,n,!0)}function mv(e,t,n){return n/t*(1/iv(e,n/2,t/2,0,1)-1)}function hv(e,t,n){return n/t*(1/iv(1-e,n/2,t/2,0,1)-1)}function gv(e){for(var t=0,n=e.length,r=0;r<n;r++)t+=e[r];return t/n}function _v(e,t){for(var n=0,r=e.length,i=0;i<r;i++){var a=e[i]-t;n+=a*a}return n/(r-1)}function vv(e,t){var n=e.length-1,r=t.length-1,i=_v(e,gv(e)),a=_v(t,gv(t));if(!i||!a)throw new W(`DIV/0`);return 2*fv(i/a,n,r,!0)}function yv(e){return .5*Math.log((1+e)/(1-e))}function bv(e){var t=Math.exp(2*e);return(t-1)/(t+1)}function xv(e,t,n){return n?1-.5*$_(t/(e*e+t),t/2,.5):1/(Math.sqrt(t)*H_(.5,t/2))*(1+e*e/t)**(-(t+1)/2)}function Sv(e,t){return 1-xv(e,t,!0)}function Cv(e,t){return e<0&&(e=-e),2*Sv(e,t)}function wv(e,t){var n=tv(2*Math.min(e,1-e),t/2,.5);return n=Math.sqrt(t*(1-n)/n),e>.5?n:-n}function Tv(e,t){return wv(1-e/2,t)}function Ev(e,t,n,r){var i=e.length,a=t.length,o,s;if(r==1){for(var c=0,l=0,u=0;u<i;u++){var d=e[u]-t[u];c+=d,l+=d*d}var f=c/i;return o=f/Math.sqrt((l-c*f)/(i*(i-1))),n==1?Sv(o,i-1):Cv(o,i-1)}var p=gv(e),m=gv(t),h=_v(e,p),g=_v(t,m);if(r==3){var _=h/i,v=g/a,y=_+v,b=_/y,x=v/y;return s=1/(b*b/(i-1)+x*x/(a-1)),o=I_(p-m)/Math.sqrt(y),n==1?Sv(o,s):Cv(o,s)}else return s=i+a-2,o=I_(p-m)*Math.sqrt(s*i*a/((i+a)*((i-1)*h+(a-1)*g))),n==1?Sv(o,s):Cv(o,s)}function Dv(e,t,n){return-wv(e/2,n-1)*t/Math.sqrt(n)}function Ov(e,t,n){return-Y_(e/2)*t/Math.sqrt(n)}function kv(e){return J_(e,!0)-.5}function Av(e){return J_(e)}function jv(e,t,n,r){if(r)return .5+.5*L_((Math.log(e)-t)/(n*Math.sqrt(2)));var i=Math.log(e)-t;return Math.exp(-i*i/(2*n*n))/(e*n*Math.sqrt(2*Math.PI))}function Mv(e,t,n){return Math.exp(Z_(e,t,n))}function Nv(e,t,n,r){var i=e.length,a=0,o;for(o=0;o<i;o++){if(t[o]<=0||t[o]>1)throw new W(`NUM`);a+=t[o]}if(a!=1)throw new W(`NUM`);var s=0;for(o=0;o<i;o++){var c=e[o];c>=n&&c<=r&&(s+=t[o])}return s}function Pv(e,t){for(var n=gv(t),r=gv(e),i=0,a=0,o=0,s=e.length;o<s;o++){var c=t[o]-n;i+=c*(e[o]-r),a+=c*c}return i/a}function Fv(e,t){for(var n=gv(t),r=gv(e),i=0,a=0,o=0,s=e.length;o<s;o++){var c=t[o]-n;i+=c*(e[o]-r),a+=c*c}return r-i*n/a}function Iv(e,t){My(e,t);for(var n=gv(e),r=gv(t),i=0,a=0,o=0,s=0,c=e.length;s<c;s++){var l=e[s]-n,u=t[s]-r;i+=l*u,a+=l*l,o+=u*u}return i/Math.sqrt(a*o)}function Lv(e,t){var n=Iv(e,t);return n*n}function Rv(e,t){for(var n=t.length,r=gv(t),i=gv(e),a=0,o=0,s=0,c=0;c<n;c++){var l=t[c]-r,u=e[c]-i;a+=u*u,o+=l*u,s+=l*l}return Math.sqrt((a-o*o/s)/(n-2))}function zv(e,t,n){for(var r=gv(n),i=gv(t),a=0,o=0,s=0,c=n.length;s<c;s++){var l=n[s]-r,u=t[s]-i;a+=l*u,o+=l*l}if(o===0)throw new W(`N/A`);var d=a/o;return i-d*r+d*e}function Bv(e){for(var t=e.height,n=0,r=0;r<t;r++)n+=e.data[r][0];return n/t}function Vv(e,t){for(var n=e.height,r=0,i=0;i<n;i++){var a=e.data[i][0]-t;r+=a*a}return r}function Hv(e,t,n,r){var i=0;t||=e.map(function(){return++i}),n&&(t=t.clone(),t.eachRow(function(e){t.data[e].unshift(1)}),++t.width);var a=t.transpose(),o=a.multiply(t).inverse().multiply(a).multiply(e),s=[];for(i=o.height-1;i>=0;i--)s.push(o.data[i][0]);if(n||s.push(0),!r)return this.asMatrix([s]);var c=t.multiply(o),l=e.adds(c,!0),u=Vv(c,n?Bv(c):0),d=Vv(l,n?Bv(l):0),f=[];f.push(u,d);var p=u/(u+d),m=e.height-t.width,h=Math.sqrt(d/m),g=[];g.push(p,h);var _=n?u/(t.width-1)/(d/m):p/t.width/((1-p)/m),v=[];v.push(_,m);var y=a.multiply(t).inverse(),b=[];for(i=y.height-1;i>=0;i--)b.push(Math.sqrt(y.data[i][i]*d/m));return this.asMatrix([s,b,g,v,f])}function Uv(e,t,n,r){return Hv.call(this,e.map(Math.log),t,n,r).map(Math.exp)}function Wv(e,t,n,r){var i=0;t||=e.map(function(){return++i}),r&&(t=t.clone(),t.eachRow(function(e){t.data[e].unshift(1)}),++t.width);var a=t.transpose(),o=a.multiply(t).inverse().multiply(a).multiply(e);return n?r&&(n=n.clone(),n.eachRow(function(e){n.data[e].unshift(1)}),++n.width):n=t,n.multiply(o)}function Gv(e,t,n,r){return Wv.call(this,e.map(Math.log),t,n,r).map(Math.exp)}function Kv(e,t,n,r){for(var i=n||20,a=r||1e-7,o=t,s=1;s<=i;s++){var c=e(o),l=c[0]/c[1];if(o-=l,Math.abs(l)<a)return o}return new W(`NUM`)}function qv(e,t,n,r,i){var a=(1+e)**+t,o=e?(a-1)/e:t;return-(r*a+n*o*(1+e*i))}function Jv(e,t,n,r,i){if(!e)return-r-n*t;var a=(1+e)**+t;return-(r+n*(a-1)/e*(1+e*i))/a}function Yv(e,t,n,r,i){if(!e)return-(r+n)/t;var a=(1+e)**+t;return-e*(r+n*a)/((1+e*i)*(a-1))}function Xv(e,t,n,r,i){if(!e)return-(r+n)/t;var a=t*(1+e*i);return Math.log((a-r*e)/(a+n*e))/Math.log(1+e)}function Zv(e,t,n,r,i,a){function o(a){var o=(1+a)**(e-1),s=o*(1+a);return[n*s+t*(1/a+i)*(s-1)+r,e*n*o+t*(-(s-1)/(a*a)+(1/a+i)*e*o)]}return Kv(o,a)}function Qv(e,t,n,r,i,a){if(a==1&&t==1)return 0;var o=Yv(e,n,r,i,a),s=qv(e,t-1,o,r,a)*e;return a?s/(1+e):s}function $v(e,t,n,r,i,a){return Yv(e,n,r,i,a)-Qv(e,t,n,r,i,a)}function ey(e,t,n,r,i,a){a==1&&(r--,i--);var o=(1+e)**+t,s=(1+e)**(r-1),c=(1+e)**+i,l=e*n*o/(o-1),u=s*n-(s-1)/e*l;return c*n-(c-1)/e*l-u}function ty(e,t,n,r,i,a){for(var o=0,s=r;s<=i;s++)o+=Qv(e,s,t,n,0,a);return o}function ny(e,t){for(var n=0,r=0,i=t.length;r<i;r++)n+=t[r]*(1+e)**(-r-1);return n}function ry(e,t){function n(t){for(var n=0,r=0,i=0,a=e.length;i<a;i++)n+=e[i]*(1+t)**(-i-1),r+=-i*e[i]*(1+t)**(-i-2);return[n,r]}return Kv(n,t)}function iy(e,t){return(1+e/t)**+t-1}function ay(e,t){return t*((e+1)**(1/t)-1)}function oy(e,t,n){for(var r=0,i=0,a=t.length;i<a;i++)r+=t[i]*(1+e)**((n[0]-n[i])/365);return r}function sy(e,t,n){function r(n){for(var r=e[0],i=0,a=1,o=e.length;a<o;a++){var s=(t[0]-t[a])/365;r+=e[a]*(1+n)**+s,i+=s*e[a]*(1+n)**(s-1)}return[r,i]}return Kv(r,n)}function cy(e,t,n,r){return-r*e*(1-t/n)}function ly(e,t,n,r,i){var a=1-(t/e)**(1/n);a=Math.floor(a*1e3+.5)/1e3;var o=e*a*i/12;if(r==1)return o;for(var s=1;s<n;s++){if(s==r-1)return(e-o)*a;o+=(e-o)*a}return(e-o)*a*(12-i)/12}function uy(e,t,n,r,i){var a=i/n,o=-e*((1-a)**(r-1)-1),s=(e-o)*a;return s=Math.min(s,Math.max(0,e-o-t)),s}function dy(e,t,n){return(e-t)/n}function fy(e,t,n,r){return(e-t)*(n-r+1)*2/(n*(n+1))}function py(e,t,n,r,i,a,o){var s=a>=n?1:a/n;function c(e,n){var r,i=s==1?n==1?e:0:e*(1-s)**(n-1),a=e*(1-s)**n;return r=a<t?i-t:i-a,r<0?0:r}function l(e,n,r){for(var i=e-t,a=Math.ceil(r),o,s=0,l=0,u=!1,d=1;d<=a;d++){if(u)o=s;else{var f=c(e,d);s=i/(n-d+1),s>f?(o=s,u=!0):(o=f,i-=f)}d==a&&(o*=r+1-a),l+=o}return l}var u=Math.floor(r),d=Math.ceil(i),f=0;if(o)for(var p=u+1;p<=d;p++){var m=c(e,p);p==u+1?m*=Math.min(i,u+1)-r:p==d&&(m*=i+1-d),f+=m}else{var h=n;if(r!=Math.floor(r)&&a>1&&r>=n/2){var g=r-n/2;r=n/2,i-=g,h+=1}e-=l(e,h,r),f=l(e,n-r,i-r)}return f}function my(e,t){var n=Y(e),r=n.month+t,i=n.year+Math.floor(r/12);return r%=12,r<0&&(r+=12),n=Math.min(n.date,$g(i,r)),Qg(i,r,n)}function hy(e,t,n){return n==1||n==2||n==3?t-e:E_(e,t,n)}function gy(e,t,n){var r=Y(e),i=Y(t).year-r.year;i>0&&(i=(i-1)*n);var a,o,s=12/n;do i++,a=my(t,-i*s);while(e<a);return i--,o=my(t,-i*s),[a,o]}function _y(e,t,n){var r=Y(t),i=Y(e),a=r.year-i.year;a>0&&(a=(a-1)*n);for(var o=e,s,c=12/n;t>o;)s=o,a++,o=my(e,a*c);return[s,o]}function vy(e,t,n,r){var i=gy(e,t,n)[0];return hy(i,e,r)}function yy(e,t,n,r){if(r==1){var i=gy(e,t,n);return hy(i[0],i[1],1)}return r==3?365/n:360/n}function by(e,t,n,r){var i=gy(e,t,n)[1];return hy(e,i,r)}function xy(e,t,n){return gy(e,t,n)[0]}function Sy(e,t,n){return gy(e,t,n)[1]}function Cy(e,t,n){var r=Y(e),i=Y(t);return 1+((12*(i.year-r.year)+i.month-r.month)*n/12|0)}function wy(e,t){return t==3?365:t==1?t_(e)?366:365:360}function Ty(e,t,n,r,i){var a=wy(Y(t).year,i);return n*r*hy(e,t,i)/a}function Ey(e,t,n,r,i,a,o,s){var c=0,l=i*r/a,u,d,f,p,m,h,g=o%2==0?360:365;function _(e,t){return(t-e)*a/g|0}return n<=t?(u=gy(n,t,a),d=u[0],f=u[1],d<=e?l*hy(e,n,o)/hy(d,f,o):(u=gy(e,d,a),p=u[0],m=u[1],h=_(m,n),l*(h+hy(e,m,o)/hy(p,m,o)+(n<f?hy(d,n,o)/hy(d,f,o):0)))):(u=_y(t,n,a),d=u[0],f=u[1],h=_(t,n),c=f==n?l*h:l*(h+hy(d,n,o)/hy(d,f,o)),s?(u=gy(e,t,a),d=u[0],f=u[1],h=_(e,t),c+=l*(h+hy(e,f,o)/hy(d,f,o)),c):c)}function Dy(e,t,n,r,i){var a=i%2==0?360:t_(Y(e).year)?366:365;return(r-n)/r*a/hy(e,t,i)}function Oy(e,t,n,r,i){var a=i%2==0?360:t_(Y(e).year)?366:365;return(r-n)/n*a/hy(e,t,i)}function ky(e,t,n,r,i){var a=i%2==0?360:t_(Y(e).year)?366:365;return n/(1-r*hy(e,t,i)/a)}function Ay(e,t,n,r,i,a,o){var s=1+((t-e)*a/(o%2==0?360:365)|0),c=gy(e,t,a),l=c[0],u=c[1],d=hy(l,e,o),f=hy(e,u,o),p=hy(l,u,o),m=100*n/a,h=r/a,g=f/p;return s==1?(i+m)/(1+g*h)-d/p*m:i/(1+h)**+(s-1+g)+m*(1+h)**(1-s-g)*((1+h)**+s-1)/h-d/p*m}function jy(e,t,n,r,i){var a=hy(e,t,i),o=wy(Y(t).year,i);return r-n*r*a/o}function My(e,t){for(var n=e.length;--n>=0;)(typeof e[n]!=`number`||typeof t[n]!=`number`)&&(e.splice(n,1),t.splice(n,1))}function Ny(e,t,n,r){let i,a,o,s;if(typeof r==`string`&&(r=JSON.parse(r)),r.from&&(r.dataType===`list`&&!r.fromIsListValue&&(r.from.indexOf(`{`)>-1&&(r.from=im(r.from,1e3),r.from=r.from.replace(/\"/g,``).replace(/^\s*\{\s*/,`"`).replace(/\s*\}\s*$/,`"`)),r.from=`_matrix(${r.from})`,r.fromIsListValue=!0),r.dataType===`date`&&(o=G.runtime.parseDate(r.from),o&&(r.from=`DATEVALUE("${r.from}")`,r.fromIsDateValue=!0)),r.dataType===`text`&&(/^".*"$/.test(r.from)||(r.fromText=r.from,r.from=`"`+r.from.replace(/"/g,`""`)+`"`,r.fromIsStringValue=!0)),r.from=G.compile(G.parseFormula(e,t,n,r.from))),r.to&&(r.dataType===`date`&&(s=G.runtime.parseDate(r.to),s&&(r.to=`DATEVALUE("${r.to}")`,r.toIsDateValue=!0)),r.dataType===`text`&&(/^".*"$/.test(r.to)||(r.toText=r.to,r.to=`"`+r.to.replace(/"/g,`""`)+`"`,r.toIsStringValue=!0)),r.to=G.compile(G.parseFormula(e,t,n,r.to))),a=r.dataType===`custom`?Fy.validationComparers.custom:r.dataType===`list`?Fy.validationComparers.list:Fy.validationComparers[r.comparerType],!a)throw om().format(`'{0}' comparer is not implemented.`,r.comparerType);i=function(e){let t=this.to&&(this.to_value||this.to_value===0)?this.to_value:void 0;if(e===null||e===``)this.allowNulls?this.value=!0:this.value=!1;else if(this.dataType===`custom`)this.value=a(e,this.from_value,t);else if(this.dataType===`list`){let n=this._getListData();this.value=a(e,n,t)}else this.value=a(e,this.from_value,t);return this.value};let c=Object.assign({},r);return c.handler=i,c.sheet=e,c.row=t,c.col=n,new Py(c)}var Py=class e{constructor(e){this.handler=e.handler,this.from=e.from,this.to=e.to,this.dataType=e.dataType,this.comparerType=e.comparerType,this.type=e.type?e.type:`warning`,this.allowNulls=!!e.allowNulls,this.fromIsDateValue=!!e.fromIsDateValue,this.toIsDateValue=!!e.toIsDateValue,this.showButton=e.showButton,this.fromIsListValue=!!e.fromIsListValue,this.fromIsStringValue=!!e.fromIsStringValue,this.toIsStringValue=!!e.toIsStringValue,this.fromText=e.fromText===void 0?null:e.fromText,this.toText=e.toText===void 0?null:e.toText,this.sheet=e.sheet,this.row=e.row,this.col=e.col,e.tooltipMessageTemplate&&(this.tooltipMessageTemplate=e.tooltipMessageTemplate),e.tooltipTitleTemplate&&(this.tooltipTitleTemplate=e.tooltipTitleTemplate),e.messageTemplate&&(this.messageTemplate=e.messageTemplate),e.titleTemplate&&(this.titleTemplate=e.titleTemplate)}_formatMessages(e){let t=this.from?this.from_value:``,n=this.to?this.to_value:``,r=this.from?this.from.toString():``,i=this.to?this.to.toString():``,a=this.dataType,o=this.type,s=this.comparerType;return om().format(e,t,n,r,i,a,o,s)}_setMessages(){this.title=``,this.message=``,this.tooltipTitleTemplate&&(this.tooltipTitle=this._formatMessages(this.tooltipTitleTemplate)),this.tooltipMessageTemplate&&(this.tooltipMessage=this._formatMessages(this.tooltipMessageTemplate)),this.titleTemplate&&(this.title=this._formatMessages(this.titleTemplate)),this.messageTemplate&&(this.message=this._formatMessages(this.messageTemplate))}_getListData(){if(!this.from_value)return[];let e=this.from_value.data||this.from_value,t,n,r=[];if(!Array.isArray(e))return[e];for(t=0;t<e.length;t++){let i=e[t];if(Array.isArray(i))for(n=0;n<i.length;n++)r.push(i[n]);else i!==void 0&&r.push(i)}return r}clone(t,n,r){let i=this._getOptions();i.from&&=i.from.clone(t,n,r),i.to&&=i.to.clone(t,n,r);let a=Object.assign({},i);return a.handler=this.handler,a.sheet=t,a.row=n,a.col=r,new e(a)}deepClone(){let t=new e(this);return t.from=t.from.deepClone(),t.to&&=t.to.deepClone(),t}exec(e,t,n,r){let i=this;function a(t){return t instanceof z&&(t=e.getData(t),Array.isArray(t)&&i.dataType!==`list`&&(t=t[0])),t}let o=function(e){i.from_value=a(e),i.value=i.handler.call(i,t,n),i._setMessages(),r&&r(i.value)};i.to?i.to.exec(e,function(t){i.to_value=a(t),i.from.exec(e,o)}):i.from.exec(e,o)}reset(){this.from&&this.from.reset(),this.to&&this.to.reset(),delete this.value}adjust(t,n,r,i){let a,o,s,c=this.row,l=this.col;if(this.from&&(a=this.from.adjust(t,n,r,i)),this.to&&(o=this.to.adjust(t,n,r,i)),this.sheet.toLowerCase()===t.toLowerCase())switch(n){case`row`:c>=r&&(s=!0,this.row+=i);break;case`col`:l>=r&&(s=!0,this.col+=i);break}if(s||a||o){let t=new e(this);return t.from=a,t.to=o,t.row=c,t.col=l,t}}toJSON(){let e=this._getOptions();return e.from&&(e.from=e.from.toString(),e.dataType===`list`&&(e.from=e.from.replace(/^_matrix\((.*)\)$/i,`$1`),delete e.fromIsListValue),e.dataType===`date`&&this.fromIsDateValue&&(e.from=e.from.replace(/^DATEVALUE\("(.*)"\)$/i,`$1`),delete e.fromIsDateValue),e.dataType===`text`&&this.fromIsStringValue&&(e.from=this.fromText===null?e.from.slice(1,-1).replace(/""/g,`"`):this.fromText),delete e.fromIsStringValue,delete e.fromText),e.to&&(e.to=e.to.toString(),e.dataType===`date`&&this.toIsDateValue&&(e.to=e.to.replace(/^DATEVALUE\("(.*)"\)$/i,`$1`),delete e.toIsDateValue),e.dataType===`text`&&this.toIsStringValue&&(e.to=this.toText===null?e.to.slice(1,-1).replace(/""/g,`"`):this.toText),delete e.toIsStringValue,delete e.toText),delete e.fromIsStringValue,delete e.fromText,delete e.toIsStringValue,delete e.toText,e}_getOptions(){return{from:this.from,to:this.to,dataType:this.dataType,type:this.type,comparerType:this.comparerType,row:this.row,col:this.col,sheet:this.sheet,allowNulls:this.allowNulls,fromIsListValue:this.fromIsListValue,fromIsDateValue:this.fromIsDateValue,toIsDateValue:this.toIsDateValue,fromIsStringValue:this.fromIsStringValue,toIsStringValue:this.toIsStringValue,fromText:this.fromText,toText:this.toText,tooltipMessageTemplate:this.tooltipMessageTemplate,tooltipTitleTemplate:this.tooltipTitleTemplate,messageTemplate:this.messageTemplate,titleTemplate:this.titleTemplate,showButton:this.showButton}}};let Fy={};Fy.compile=Ny,Fy.validationComparers={greaterThan:function(e,t){return e>t},lessThan:function(e,t){return e<t},between:function(e,t,n){return e>=t&&e<=n},equalTo:function(e,t){return e===t},notEqualTo:function(e,t){return e!==t},greaterThanOrEqualTo:function(e,t){return e>=t},lessThanOrEqualTo:function(e,t){return e<=t},notBetween:function(e,t,n){return e<t||e>n},custom:function(e,t){return t},list:function(e,t){return t.indexOf(e)>-1}},Fy.Validation=Py;let{measureText:Iy}=Rt,Ly=[`color`,`fontFamily`,`underline`,`italic`,`bold`,`textAlign`,`indent`,`verticalAlign`,`background`,`format`,`link`,`editor`,`borderTop`,`borderRight`,`borderBottom`,`borderLeft`,`comment`,`html`],X=class e{constructor(e,t){this._sheet=t,this._ref=e}clone(){return new e(this._ref.clone(),this._sheet)}skipHiddenCells(){let e=[],t=this,n=t._sheet,r=n.isHiddenRow.bind(n),i=n.isHiddenColumn.bind(n);return t._ref.forEach(function(n){n=t._normalize(n.toRangeRef());let a=n.topLeft,o=n.bottomRight,s=Ry(a.row,o.row,r),c=Ry(a.col,o.col,i);for(let t=0;t<s.length;++t)for(let n=0;n<c.length;++n)e.push(new H(new V(s[t].begin,c[n].begin),new V(s[t].end,c[n].end)))}),n.range(e.length>1?new U(e):e[0])}_normalize(e){return this._sheet._grid.normalize(e)}_set(e,t,n){let r=this,i=r._sheet;return r._ref.forEach(function(n){let r=n;if((e===`value`||e===`formula`||e===`link`)&&n.topLeft){let e=new V(n.topLeft.row,n.topLeft.col);i.forEachMergedCell(function(t){t.intersects(e)&&(r=e)})}i._set(r.toRangeRef(),e,t)}),n||i.triggerChange({recalc:e===`formula`||e===`value`||e===`validation`,value:t,range:r,ref:r._ref,isValue:e===`value`}),r}_get(e){return this._sheet._get(this._ref.toRangeRef(),e)}_property(e,t){return t===void 0?this._get(e):this._set(e,t)}value(e){return e!==void 0&&this._set(`formula`,null,!0),this._property(`value`,e)}html(e){return this._property(`html`,e)}resize(t){let n=this._resizedRef(t);return new e(n,this._sheet)}_resizedRef(e){return this._ref.map(function(t){return t.toRangeRef().resize(e)})}input(e,t){t=Object.assign({arrayFormula:!1},t);let n=this._get(`format`),r;if(e!==void 0){let i=this._ref.toRangeRef().topLeft;return r=G.parse(this._sheet.name(),i.row,i.col,e,n),this._sheet.batch(function(){let i=null;if(r.type===`exp`)i=G.compile(r);else if(n!==`@`){let e=n&&yh.type(r.value,n);r.type===`date`&&e!==`date`?this.format(r.format||zy(sm().calendar.patterns.d)):r.type===`percent`&&e!==`percent`?this.format(r.value*100==(r.value*100|0)?`0%`:`0.00%`):r.format&&(!n||r.currency||e===`number`&&r.type===`number`&&r.format.length>n.length)&&this.format(r.format)}else r.type!==`string`&&(r.value=e);this.formula(i,t.arrayFormula),i||this.value(r.value)}.bind(this),{recalc:!0,value:e,ref:this._ref,editorChange:this._sheet.isInEditMode(),isValue:!0}),this}else{e=this._get(`value`);let t=this._get(`formula`),i=n&&!t&&yh.type(e,n);if(t)e=`=`+t;else OUT:{if(n&&i===`date`){let t=yh.text(e,n);if(r=G.parse(null,null,null,t,n),t===yh.text(r.value,n)){e=t;break OUT}}if(i===`date`){let t=om();e=t.toString(G.runtime.serialToDate(e),sm().calendar.patterns.d,t.locale)}else i===`percent`?e=G.runtime.limitPrecision(e*100)+`%`:typeof e==`string`&&(/^[=']/.test(e)||/^(?:true|false)$/i.test(e)||By(e))?e=`'`+e:this._sheet._useCultureDecimals()&&typeof e==`number`&&e!==Math.floor(e)&&(e=String(e).replace(`.`,sm().numbers.symbols.decimal))}return e}}enable(e){return e===void 0?!Lp(function(e){this._sheet.forEach(this._ref,function(t,n,r){r.enable===!1&&e(!0)})},this):this._property(`enable`,e)}formula(e,t){let n=this;if(e===void 0){let e=n._get(`formula`);return e?``+e:null}if(t){let t=this._ref.toRangeRef();e=n._sheet.range(t.topLeft)._set(`formula`,e)._get(`formula`),e&&e.setArrayFormulaRange(t)}else n._set(`formula`,e);return n}intersectingArrayFormula(){let e=this._ref.clone().simplify().setSheet(this._sheet.name());return Lp(function(t){this._sheet._forFormulas(function(n){let r=n.arrayFormulaRange;r&&(r=e.intersect(r))!==B&&t({formula:n,intersection:r})})},this)}canEditArrayFormula(){let e=this.intersectingArrayFormula();return!e||e.formula.arrayFormulaRange.eq(e.intersection)}validation(e){if(e===void 0){let e=this._get(`validation`);return e?e.toJSON():null}return this._property(`validation`,e)}_getValidationState(){let e=this._ref.toRangeRef(),t=e.topLeft.row,n=e.topLeft.col,r=e.bottomRight.row,i=e.bottomRight.col,a,o;for(a=n;a<=i;a++)for(o=t;o<=r;o++){let e=this._sheet._validation(o,a);if(e&&e.type===`reject`&&e.value===!1)return e}return!1}merge(){return this._ref=this._sheet._merge(this._ref),this}unmerge(){let e=this._sheet._mergedCells;return this._ref.forEach(function(t){t.toRangeRef().intersecting(e).forEach(function(t){e.splice(e.indexOf(t),1)})}),this._sheet.triggerChange({}),this}select(){return this._sheet.select(this._ref),this}values(e){if(this._ref instanceof U)throw Error(`Unsupported for multiple ranges.`);if(this._ref===B){if(e!==void 0)throw Error(`Unsupported for NULLREF.`);return[]}let t=this._ref.toRangeRef(),n=t.topLeft.row,r=t.topLeft.col,i=t.bottomRight.row,a=t.bottomRight.col,o,s;if(e===void 0){e=Array(t.height());for(let n=0;n<e.length;n++)e[n]=Array(t.width());for(o=r;o<=a;o++)for(s=n;s<=i;s++)e[s-n][o-r]=this._sheet._value(s,o);return e}else{for(this._sheet._set(t,`formula`,null),o=r;o<=a;o++)for(s=n;s<=i;s++){let t=e[s-n];if(t){let e=t[o-r];e!==void 0&&this._sheet._value(s,o,e)}}return this._sheet.triggerChange({recalc:!0,ref:t}),this}}_properties(e,t){if(this._ref instanceof U)throw Error(`Unsupported for multiple ranges.`);if(this._ref===B){if(e!==void 0)throw Error(`Unsupported for NULLREF.`);return[]}let n=this._ref.toRangeRef(),r=n.topLeft.row,i=n.topLeft.col,a=n.bottomRight.row,o=n.bottomRight.col,s,c,l=this._sheet;if(e===void 0)return e=Array(n.height()),l.forEach(n,function(t,n,a){t-=r,n-=i;let o=e[t]||(e[t]=[]);o[n]=a}),e;{let u;n=n.clone();let d=function(e){let t=u[e];n.topLeft.row=n.bottomRight.row=c,n.topLeft.col=n.bottomRight.col=s,e===`value`&&l._set(n,`formula`,null),l._set(n,e,t)},f=!1;for(s=i;s<=o;s++)if(!(!t&&l.isHiddenColumn(s)))for(c=r;c<=a;c++){if(!t&&l.isHiddenRow(c)||t&&l.isFilteredRow(c))continue;let n=e[c-r];if(n&&(u=n[s-i],u)){let e=Object.keys(u);e.forEach(d),f||=e.includes(`value`)}}return l.triggerChange({recalc:!0,ref:this._ref,isValue:f}),this}}clear(e){e||={};let t=e.clearAll||!Object.keys(e).length,n=this._sheet,r={recalc:t||e.contentsOnly,ref:this._ref,isValue:!0};return n.batch(function(){r.recalc&&this.formula(null),t&&this.validation(null),(t||e.formatOnly)&&(Ly.forEach(function(t){e.keepBorders&&/^border/i.test(t)||this[t](null)}.bind(this)),this.fontSize(null),this.wrap(null),this.unmerge())}.bind(this),r),this}clearContent(){return this.clear({contentsOnly:!0})}clearFormat(){return this.clear({formatOnly:!0})}isSortable(){return!this.cantSort()}cantSort(){if(this._ref instanceof U)return{code:`cantSortMultipleSelection`,message:`Unsupported for multiple ranges.`};if(this._ref===B)return{code:`cantSortNullRef`,message:`Unsupported for NULLREF.`};let e=this._sheet._getMergedCells(this._ref.toRangeRef()),t=e.primary,n=e.secondary,r=null,i=null,a={};try{this._sheet.forEach(this,function(o,s){let c=new V(o,s).print(),l=t[c];if(l){if(r===null)r=l.width(),i=l.height();else if(r!==l.width()||i!==l.height())throw a}else if(!n[c]&&e.hasMerged)throw a})}catch(e){if(e!==a)throw e;return{code:`cantSortMixedCells`,message:`Unsupported for range containing cells of different shapes.`}}return!1}sort(e){let t=this.cantSort();if(t)throw Error(t.message);return e===void 0&&(e={column:0}),e=e instanceof Array?e:[e],this._sheet._sortBy(this._ref.toRangeRef(),e.map(function(e,t){return typeof e==`number`&&(e={column:e}),{index:e.column===void 0?t:e.column,ascending:e.ascending===void 0||e.ascending}})),this}isFilterable(){return!(this._ref instanceof U)}filter(e){if(this._ref instanceof U)throw Error(`Unsupported for multiple ranges.`);return e===!1?this.clearFilters():(e=e===!0?[]:e instanceof Array?e:[e],this._sheet._filterBy(this._ref.toRangeRef(),e.map(function(e,t){return{index:e.column===void 0?e.index===void 0?t:e.index:e.column,filter:e.filter}}))),this}clearFilter(e){this._sheet.clearFilter(e)}clearFilters(){let e=this._sheet.filter(),t=[];if(e){for(let n=0;n<e.columns.length;n++)t.push(e.columns[n].index);this._sheet.batch(function(){this.clearFilter(t),this._filter=null},{layout:!0,filter:!0})}}hasFilter(){return!!this._sheet.filter()}leftColumn(){return new e(this._ref.leftColumn(),this._sheet)}rightColumn(){return new e(this._ref.rightColumn(),this._sheet)}topRow(){return new e(this._ref.topRow(),this._sheet)}bottomRow(){return new e(this._ref.bottomRow(),this._sheet)}column(t){return new e(this._ref.toColumn(t),this._sheet)}row(t){return new e(this._ref.toRow(t),this._sheet)}forEachRow(t){this._ref.forEachRow(function(n){t(new e(n,this._sheet))}.bind(this))}forEachColumn(t){this._ref.forEachColumn(function(n){t(new e(n,this._sheet))}.bind(this))}sheet(){return this._sheet}topLeft(){return this._ref.toRangeRef().topLeft}intersectingMerged(){let e=this._sheet,t=[];return e._mergedCells.forEach(function(e){e.intersects(this._ref)&&t.push(e.toString())}.bind(this)),t}getState(e){let t=this._ref.first(),n={ref:t,data:[],origRef:this._ref,rows:this._sheet._rows.getState()},r;e?r=e===`input`?[`value`,`formula`]:e===`border`?[`borderLeft`,`borderTop`,`borderRight`,`borderBottom`]:[e]:(r=Yg,n.mergedCells=this.intersectingMerged());let i=n.data;return this.forEachCell(function(e,n,a){let o={},s=e-t.row,c=n-t.col;i[s]||(i[s]=[]),i[s][c]=o,r.forEach(function(e){let t=a[e]===void 0?null:a[e];(t instanceof G.runtime.Formula||t instanceof Fy.Validation)&&(t=t.deepClone()),o[e]=t})}),n}setState(e,t){let n=this._sheet,r=this._ref.first(),i=e.ref.row-r.row,a=e.ref.col-r.col,o=t&&!t.isExternal(),s=t&&!o;n.batch(function(){e.mergedCells&&this.unmerge(),t||this._sheet._rows.setState(e.rows);let c=r.row,l=this.hasFilter();e.data.forEach(function(i,a){if(l&&o&&n.isHiddenRow(e.ref.row+a))return;let u=r.col;i.forEach(function(i,d){if(l&&o&&n.isHiddenColumn(e.ref.col+d))return;let f=t?n.range(c,u):n.range(r.row+a,r.col+d);if(f.enable()){for(let e in i)e!==`value`&&(t&&e===`enable`||f._set(e,i[e]));if(!i.formula)if(s)try{i.value==null?f._set(`value`,null):f.input(i.value)}catch{f._set(`value`,i.value)}else f._set(`value`,i.value)}u++}),c++}),e.mergedCells&&e.mergedCells.forEach(function(e){e=n._ref(e).relative(i,a,3),n.range(e).merge()},this)}.bind(this),{recalc:!0,ref:this._ref})}_adjustRowHeight(){let e=this,t=e._sheet,n=t._getMergedCells(e._ref.toRangeRef()),r=n.primary,i=n.secondary;t.batch(function(){e.forEachRow(function(e){let n=e._ref.topLeft.row,a=t.rowHeight(n);a&&(e.forEachCell(function(e,n,o){let s=new V(e,n).print();if(i[s])return;let c=r[s],l;l=c?t._columns.sum(c.topLeft.col,c.bottomRight.col):t.columnWidth(n);let u=o.value;o.format&&u!=null&&(u=yh.format(u,o.format));let d=Vy(u,l,o.fontFamily,o.fontSize,o.wrap);a=Math.max(a,d)}),t.rowHeight(n,a))})},{layout:!0})}forEachCell(e){this._ref.forEach(function(t){this._sheet.forEach(t.toRangeRef(),e.bind(this))}.bind(this))}hasValue(){let e=this._sheet._defaultCellStyle;return Lp(function(t){this.forEachCell(function(n,r,i){for(let n in i){let r=i[n];r!=null&&r!==e[n]&&t(!0)}})},this)}wrap(e){return e===void 0?!!this._property(`wrap`):(this._property(`wrap`,e),e!==null&&this._adjustRowHeight(),this)}fontSize(e){return e===void 0?this._property(`fontSize`):(this._property(`fontSize`,e),e!==null&&this._adjustRowHeight(),this)}draw(e,t){this._sheet.draw(this,e,t)}insideBorders(e){return this.insideVerticalBorders(e).insideHorizontalBorders(e)}insideVerticalBorders(e){return this._ref.forEach(function(t){t instanceof H&&t.width()>1&&(t=t.clone(),t.topLeft.col++,this._sheet.range(t).borderLeft(e))},this),this}insideHorizontalBorders(e){return this._ref.forEach(function(t){t instanceof H&&t.height()>1&&(t=t.clone(),t.topLeft.row++,this._sheet.range(t).borderTop(e))},this),this}};function Ry(e,t,n){for(;e<=t&&n(e);)e++;if(e>t)return[];for(let r=e+1;r<=t;++r)if(n(r))return[{begin:e,end:r-1}].concat(Ry(r+1,t,n));return[{begin:e,end:t}]}Ly.forEach(function(e){X.prototype[e]=function(t){return this._property(e,t)}});function zy(e){return e.replace(/M/g,`m`).replace(/'/g,`"`).replace(/tt/,`am/pm`)}function By(e){return!/^=/.test(e)&&/number|percent/.test(G.parse(null,0,0,e).type)}function Vy(e,t,n,r,i){let a=document.createElement(`div`);a.style.setProperty(`position`,`absolute`,`important`),a.style.setProperty(`top`,`-4000px`,`important`),a.style.setProperty(`height`,`auto`,`important`),a.style.setProperty(`padding`,`1px 3px`,`important`),a.style.setProperty(`box-sizing`,`border-box`,`important`),a.style.setProperty(`margin`,`0`,`important`),a.style.setProperty(`border`,`1px solid black`,`important`),a.style.setProperty(`line-height`,`normal`,`important`),a.style.setProperty(`visibility`,`hidden`,`important`),a.style.setProperty(`white-space`,`pre-wrap`);let o={baselineMarkerSize:0,width:i===!0?t+`px`:`auto`,"font-size":(r||12)+`px`,"font-family":n||`Arial`,"white-space":i===!0?`pre-wrap`:`pre`,"overflow-wrap":i===!0?`break-word`:`normal`,"word-wrap":i===!0?`break-word`:`normal`};return Iy(e,o,{box:a,normalizeText:!1}).height}var Hy=G.runtime.Formula,Uy=`incompatibleRanges`,Wy=`noFillDirection`,Gy=X.FillError=function(e){this.code=e};X.prototype._previewFillFrom=function(e,t){var n=this,r=n._sheet;typeof e==`string`&&(e=r.range(e));var i=e._ref.toRangeRef().clone().setSheet(r.name()),a=n._ref.toRangeRef().clone().setSheet(r.name());if(i.intersects(a)){if(i.eq(a))return null;if(a=a.clone(),i.topLeft.eq(a.topLeft))if(i.width()==a.width())a.topLeft.row+=i.height(),t=0;else if(i.height()==a.height())a.topLeft.col+=i.width(),t=1;else throw new Gy(Uy);else if(i.bottomRight.eq(a.bottomRight))if(i.width()==a.width())a.bottomRight.row-=i.height(),t=2;else if(i.height()==a.height())a.bottomRight.col-=i.width(),t=3;else throw new Gy(Uy);else throw new Gy(Uy);return r.range(a)._previewFillFrom(e,t)}if(t==null)if(i.topLeft.col==a.topLeft.col)t=i.topLeft.row<a.topLeft.row?0:2;else if(i.topLeft.row==a.topLeft.row)t=i.topLeft.col<a.topLeft.col?1:3;else throw new Gy(Wy);var o=t&1,s=t&2;if(o&&i.height()!=a.height()||!o&&i.width()!=a.width())throw new Gy(Uy);var c=e._properties(),l;o?l=a.width():(c=$y(c),l=a.height());for(var u=Array(c.length),d=null,f=0;f<c.length;++f)for(var p=c[f],m=qy(p),h=u[f]=Array(l),g=0;g<l;++g){var _=s?-g-1:p.length+g,v=s?p.length-g%p.length-1:g%p.length,y=h[s?l-g-1:g]=m(_,v);y.value!=null&&(d=y.value)}return o||(u=$y(u)),{props:u,direction:t,dest:n,hint:d}},X.prototype.fillFrom=function(e,t){var n=this._previewFillFrom(e,t);return n.dest._properties(n.props,!0),n.dest};function Ky(e){for(var t=e.length,n=(t+1)/2,r=e.reduce(function(e,t){return e+t},0)/t,i=0,a=0,o=0;o<t;o++){var s=o+1-n,c=e[o]-r;i+=s*c,a+=s*s}if(!a)return function(t){return e[t%e.length]};var l=i/a,u=r-l*n;return function(e){return u+l*(e+1)}}function qy(e){function t(e){for(var t=e[1]-e[0],n=2;n<e.length;++n)if(e[n]-e[n-1]!=t)return null;return t}function n(e){return e.map(function(e){return e.number})}var r=[],i=e.map(function(e){return e.formula||e.value});return Yy(i,function(e,a,o,s){var c,l;if(o==`number`)l=n(s),c=Ky(l);else if(o==`string`||o==`formula`||o==`boolean`)c=function(e,t){return i[t]};else if(Array.isArray(o))if(s.length==1)c=function(e){return o[(s[0].number+e)%o.length]};else{var u=t(n(s));c=u==null?function(e){return s[e%s.length].value}:function(e){return o[(s[0].number+u*e)%o.length]}}else o==`null`?c=function(){return null}:(l=n(s),l.length==1&&l.push(l[0]+1),l=Ky(l),c=function(e,t){return i[t].replace(/^(.*\D0*)\d+$/,`$1`+l(e,t))});for(var d={f:c,begin:e,end:a,len:a-e},f=e;f<a;++f)r[f]=d}),function(t,n){var a=r[n],o=t/i.length|0,s=t%i.length,c=o*a.len+s-a.begin,l=a.f(c,n),u=Jy(e[n]);return delete u.enable,l instanceof Hy?u.formula=l:u.value=l,u}}function Jy(e){var t={};return Object.keys(e||{}).forEach(function(n){t[n]=e[n]}),t}function Yy(e,t){for(var n=null,r=0,i=[],a,o=0;o<e.length;++o)a=Xy(e[o]),i.push(a),n!=null&&a.type!==n.type&&(t(r,o,n.type,i.slice(r,o)),r=o),n=a;t(r,o,n.type,i.slice(r,o))}function Xy(e){if(typeof e==`number`)return{type:`number`,number:e};if(typeof e==`string`){var t=Qy(e);if(t)return t;var n=/^(.*\D0*)(\d+)$/.exec(e);return n?(e=e.replace(/^(.*\D0*)\d+$/,`$1-######`),{type:e,match:n,number:parseFloat(n[2])}):{type:`string`}}if(typeof e==`boolean`)return{type:`boolean`};if(e==null)return{type:`null`};if(e instanceof Hy)return{type:`formula`};throw window.console.error(e),Error(`Cannot fill data`)}function Zy(){let e=sm().calendar;return[e.days.format.abbreviated,e.days.format.wide,e.months.format.abbreviated,e.months.format.wide]}function Qy(e){for(var t=e.toLowerCase(),n=Zy(),r=0;r<n.length;++r)for(var i=n[r],a=i.length;--a>=0;)if(i[a].toLowerCase()==t)return{type:i,number:a,value:e}}function $y(e){for(var t=e.length,n=e[0].length,r=[],i=0;i<n;++i){r[i]=[];for(var a=0;a<t;++a)r[i][a]=e[a][i]}return r}let eb=`string`,tb=`function`,nb=function(){this._defaultPrevented=!0},rb=function(){return this._defaultPrevented===!0};var ib=class{constructor(){this._events={}}bind(e,t,n){let r=this,i,a=typeof e==eb?[e]:e,o,s,c,l=typeof t==tb,u;if(t===void 0){for(i in e)r.bind(i,e[i]);return r}for(i=0,o=a.length;i<o;i++)e=a[i],c=l?t:t[e],c&&(n&&(s=c,c=function(){r.unbind(e,c),s.apply(r,arguments)},c.original=s),u=r._events[e]=r._events[e]||[],u.push(c));return r}one(e,t){return this.bind(e,t,!0)}first(e,t){let n=this,r,i=typeof e==eb?[e]:e,a,o,s=typeof t==tb,c;for(r=0,a=i.length;r<a;r++)e=i[r],o=s?t:t[e],o&&(c=n._events[e]=n._events[e]||[],c.unshift(o));return n}trigger(e,t){let n=this,r=n._events[e],i,a;if(r){for(t||={},t.sender=n,t._defaultPrevented=!1,t.preventDefault=nb,t.isDefaultPrevented=rb,r=r.slice(),i=0,a=r.length;i<a;i++)r[i].call(n,t);return t._defaultPrevented===!0}return!1}unbind(e,t){let n=this,r=n._events[e],i;if(e===void 0)n._events={};else if(r)if(t)for(i=r.length-1;i>=0;i--)(r[i]===t||r[i].original===t)&&r.splice(i,1);else n._events[e]=[];return n}},ab=class extends ib{constructor(e,t){super(),this.element=e,this.events=[],this.options=t}setOptions(e){this._setEvents(e),Vp({},this.options,e)}_setEvents(e){let t=this,n=0,r=t.events.length,i;for(;n<r;n++)i=t.events[n],t.options[i]&&e[i]&&(t.unbind(i,t.options[i]),t._events&&t._events[i]&&delete t._events[i]);t.bind(t.events,e)}resize(e){let t=this.getSize(),n=this._size;(e||(t.width>0||t.height>0)&&(!n||t.width!==n.width||t.height!==n.height))&&(this._size=t,this._resize(t,e),this.trigger(`resize`,t))}getSize(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}}destroy(){this.unbind()}};let ob=function(){try{return document.activeElement}catch{return document.documentElement.activeElement}};var sb=class extends ib{constructor(e){super(),this.events=[`activate`,`deactivate`,`change`,`update`],this.view=e,this.formulaBar=e.formulaBar,this._active=!1,this.barInput=e.formulaBar.formulaInput,this.cellInput=e.formulaInput,this.barInput.syncWith(this.cellInput),this.cellInput.syncWith(this.barInput),this.barInput.bind(`keyup`,this._triggerUpdate.bind(this)),this.cellInput.bind(`keyup`,this._triggerUpdate.bind(this)),this.barInput.bind(`blur`,this._blur.bind(this)),this.cellInput.bind(`blur`,this._blur.bind(this))}_blur(){this.deactivate()}_triggerUpdate(){this.trigger(`update`,{value:this.value()})}activeEditor(){let e=null,t=ob();return this.barElement()===t?e=this.barInput:this.cellElement()===t&&(e=this.cellInput),e}activate(e){let t=this.view.element,n,r,i;return this._active=!0,this._rect=e.rect,this._range=e.range,this.cellInput.position(e.rect),this.cellInput.resize(e.rect),this.cellInput.tooltip(e.tooltip),this.cellInput.activeCell=this.barInput.activeCell=this._range.topLeft(),this.cellInput.activeSheet=this.barInput.activeSheet=this._range._sheet,t&&(n=t.offsetWidth,r=t.querySelector(`.k-spreadsheet-scroller`),i=r.offsetWidth-r.clientWidth,this.cellInput.element.style.maxWidth=n-i-parseFloat(this.cellInput.element.style.left)+`px`),this.trigger(`activate`),this}deactivate(e){let t=this.cellInput;this._active&&(this._active=!1,!e&&t.value()!==this._value&&this.trigger(`change`,{value:t.value(),range:this._range}),this._rect=null,t.hide(),this.trigger(`deactivate`))}enable(e){this.barInput.enable(e),this.cellInput.enable(e)}barElement(){return this.barInput.element}cellElement(){return this.cellInput.element}focus(e){e||=`cell`,e===`cell`?(this.cellInput.element.focus(),this.cellInput.end()):this.barInput.focus()}isActive(){return this._active}isFiltered(){return this.barInput.popup.visible()||this.cellInput.popup.visible()}canInsertRef(e){let t=this.activeEditor();return t&&t.canInsertRef(e)}highlightedRefs(){let e=this.activeEditor(),t=[];return e&&(t=e.highlightedRefs()),t}scale(){this.cellInput.scale()}toggleTooltip(e){this.cellInput.toggleTooltip(cb(this._rect,e))}value(e,t){if(e===void 0)return this.barInput.value();e===null&&(e=``),this._value=e,this.barInput.value(e),this.cellInput.value(e),this.barInput.element.classList.toggle(`k-spreadsheet-array-formula`,!!t)}insertNewline(){this.activeEditor().insertNewline(),this.scale()}select(){this.activeEditor().select()}};function cb(e,t){return e&&(e.top!==t.top||e.left!==t.left)}let lb=/&/g,ub=/</g,db=/"/g,fb=/'/g,pb=/>/g,mb=function(e){return String(e).replace(lb,`&amp;`).replace(ub,`&lt;`).replace(pb,`&gt;`).replace(db,`&quot;`).replace(fb,`&#39;`)};var hb=class{constructor(e,t){this._value=t,this._count=e,this.values=new Lg(0,e-1,t),this._hidden=new Lg(0,e-1,0),this.scrollBarSize=Gp(),this._refresh()}_resize(e){e>this._count?(this.values.value(this._count,e-1,this._value),this._hidden.value(this._count,e-1,0)):e<this._count&&(this.values.value(e,this._count-1,0),this._hidden.value(e,this._count-1,0)),this._count=e,this._refresh()}adjust(e,t){t<0?(this.values.copy(e-t,this._count-1,e),this._hidden.copy(e-t,this._count-1,e)):(this.values.copy(e,this._count,e+t),this._hidden.copy(e,this._count,e+t),this.values.value(e,e+t-1,this._value),this._hidden.value(e,e+t-1,0)),this._refresh()}toJSON(e,t){let n=[],r=this.values.iterator(0,this._count-1);for(let i=0;i<this._count;i++){let a=r.at(i),o=this._hidden.value(i,i);if(a===this._value&&!o)continue;let s=t[i];if(s===void 0){s=n.length;let r={index:i};r[e]=a,o&&(r.hidden=o),n.push(r),t[i]=s}}return n}fromJSON(e,t){for(let n=0;n<t.length;n++){let r=t[n],i=r.index;i===void 0&&(i=n);let a=r[e];a===0?(this._hidden.value(i,i,r.hidden||this._value),this.value(i,i,0)):this.value(i,i,a)}}hide(e){if(!this.hidden(e)){let t=this.value(e,e);this._hidden.value(e,e,t),this.value(e,e,0)}}hidden(e){return this._hidden.value(e,e)!==0}includesHidden(e,t){return this._hidden.intersecting(e,t).length>1}nextVisible(e){let t=this._count-1,n=e;for(;++n<=t;)if(!this.hidden(n))return n;return e}nextUntil(e,t){let n=this._count-1,r=e,i=!1;for(;++r<=n;){let e=t(r,i,this.hidden(r));if(typeof e==`number`)return e;if(e)break;i=!0}return r-1}nextPage(e,t){return this.index(this.sum(0,e-1)+t)}prevPage(e,t){return this.index(this.sum(0,e)-t)}firstVisible(){let e=this._hidden.first();return e.value===0?0:e.end+1}lastVisible(){let e=this._hidden.last();return e.value===0?this._count-1:e.start-1}prevVisible(e){let t=e;for(;--t>=0;)if(!this.hidden(t))return t;return e}prevUntil(e,t){let n=e,r=!1;for(;--n>=0;){let e=t(n,r,this.hidden(n));if(typeof e==`number`)return e;if(e)break;r=!0}return n+1}unhide(e){if(this.hidden(e)){let t=this._hidden.value(e,e);this._hidden.value(e,e,0),this.value(e,e,t)}}value(e,t,n){if(n!==void 0)this.values.value(e,t,n),this._refresh();else return this.values.iterator(e,t).at(0)}sum(e,t){let n=this.values.iterator(e,t),r=0;for(let i=e;i<=t;i++)r+=n.at(i);return r}locate(e,t,n){let r=this.values.iterator(e,t),i=0;for(let a=e;a<=t;a++)if(i+=r.at(a),n(i))return a;return null}visible(e,t){let n=null,r=null,i=!1;t>=this.total+this.scrollBarSize&&(i=!0);let a=this._pixelValues.intersecting(e,t);if(n=a[0],r=a[a.length-1],!n)return{values:this.values.iterator(0,0),offset:0};let o=e-n.start,s=(o/n.value.value>>0)+n.value.start,c=o-(s-n.value.start)*n.value.value,l=t-r.start,u=(l/r.value.value>>0)+r.value.start;return u>r.value.end&&(u=r.value.end),i&&(c+=r.value.value-(l-(u-r.value.start)*r.value.value)),c=Math.min(-c,0),{values:this.values.iterator(s,u),offset:c}}index(e){let t=0,n=this.values.iterator(0,this._count-1),r=n.at(0);for(;r<e&&t<this._count-1;)r+=n.at(++t);return t}indexVisible(e){let t=this.index(e);return this.hidden(t)&&(t=this.prevVisible(t)),t}_refresh(){let e=0;this._pixelValues=this.values.map(function(t){let n=e;return e+=(t.end-t.start+1)*t.value,new jg(n,e-1,t)}),this.total=e}getState(){return{values:this.values.getState(),hidden:this._hidden.getState(),count:this._count}}setState(e){this.values.setState(e.values),this._hidden.setState(e.hidden);let t=this._count;t>e.count?(this._count=e.count,this._resize(t)):this._refresh()}},gb=class{constructor(e,t,n,r,i){this._axis=e,this._start=t,this._count=n,this._position=i,this.hasHeader=t===0,this.headerSize=r,this.defaultValue=e._value,this.frozen=n>0}viewSize(e){this._viewSize=e}sum(e,t){return this._axis.sum(e,t-1)}start(){return this.sum(0,this._start)}size(){return this.sum(this._start,this._start+this._count)}position(){return this._position===void 0||this._position===null?this.frozen?this.size():this.start():this.frozen?Math.min(this.size(),Math.max(0,this._position)):Math.max(0,this._position)}hiddenSize(){return this.frozen?this.size()-this.position():this.start()-this.position()}index(e,t){return this._axis.index(e+this.hiddenSize()+(this.frozen?0:t)-this.headerSize)}indexVisible(e,t){return this._axis.indexVisible(e+this.hiddenSize()+(this.frozen?0:t)-this.headerSize)}paneSegment(){let e=this.start(),t;return this.hasHeader||(e=this.position()+this.headerSize),this.frozen?(t=this.position(),this.hasHeader?t+=this.headerSize:t-=this.headerSize):t=this._viewSize-e,{offset:e,length:t}}visible(e){let t=this.start(),n;if(this.frozen?(n=this.position(),t+=Math.max(0,this.size()-n),this.hasHeader||(n-=this.headerSize)):(n=this._viewSize-this.position()-this.headerSize,t+=e),n<=0)return{values:this._axis.values.iterator(0,0),offset:this.hasHeader?this.headerSize:0,start:this.hasHeader?-this.headerSize:t};let r=this._axis.visible(t,t+n-1);return this.frozen&&(this._position===void 0||this._position===null||this.position()===this.size())&&(r.offset=0),r.start=t,this.hasHeader&&(r.offset+=this.headerSize,r.start-=this.headerSize),r}contains(e,t){return this.frozen?!(e>this._start+this._count||t<this._start):t>=this._start}},_b=class e{constructor(e,t,n,r){this.left=e,this.top=t,this.width=n,this.height=r,this.right=this.left+this.width,this.bottom=this.top+this.height}offset(t,n){return new e(this.left+t,this.top+n,this.width,this.height)}resize(t,n){return new e(this.left,this.top,this.width+t,this.height+n)}intersects(t,n){return t instanceof e?this.intersectsRect(t):this.left<t&&t<this.left+this.width&&this.top<n&&n<this.top+this.height}intersectsRect(e){let t=this;return t.left<=e.right&&e.left<=t.right&&t.top<=e.bottom&&e.top<=t.bottom}toDiv(e){return K.element(`div`,{className:e,style:{width:this.width+`px`,height:this.height+`px`,top:this.top+`px`,left:this.left+`px`}})}},vb=class{constructor(e,t,n,r,i,a){this.rowCount=n,this.columnCount=r,this._columns=t,this._rows=e,this._headerHeight=i,this._headerWidth=a}_resize(e,t){this.rowCount=e,this.columnCount=t}isAxis(e){e=e.toRangeRef();let t=e.topLeft,n=e.bottomRight;return t.row===0&&n.row===this.rowCount-1||t.col===0&&n.col===this.columnCount-1}width(e,t){return this._columns.sum(e,t)}height(e,t){return this._rows.sum(e,t)}totalHeight(){return this._rows.total+this._headerHeight}totalWidth(){return this._columns.total+this._headerWidth}index(e,t){return t*this.rowCount+e}cellRef(e){return new V(e%this.rowCount,e/this.rowCount>>0)}rowRef(e){return new H(new V(e,0),new V(e,this.columnCount-1))}colRef(e){return new H(new V(0,e),new V(this.rowCount-1,e))}cellRefIndex(e){return this.index(e.row,e.col)}normalize(e){return e instanceof H?new H(this.normalize(e.topLeft),this.normalize(e.bottomRight)).setSheet(e.sheet,e.hasSheet()):e instanceof U?e.map(function(e){return this.normalize(e)},this):(e instanceof V&&(e=e.clone(),e.col=Math.max(0,Math.min(this.columnCount-1,e.col)),e.row=Math.max(0,Math.min(this.rowCount-1,e.row))),e)}rectangle(e){let t=this.normalize(e.topLeft),n=this.normalize(e.bottomRight);return new _b(this.width(0,t.col-1),this.height(0,t.row-1),this.width(t.col,n.col),this.height(t.row,n.row))}pane(e){let t=e.panePosition||this._panePosition||{};return new yb(new gb(this._rows,e.row,e.rowCount,this._headerHeight,t.rows),new gb(this._columns,e.column,e.columnCount,this._headerWidth,t.columns),this)}rangeDimensions(e){return{rows:this._rows.values.iterator(e.topLeft.row,e.bottomRight.row),columns:this._columns.values.iterator(e.topLeft.col,e.bottomRight.col)}}forEach(e,t){let n=this.normalize(e.topLeft),r=this.normalize(e.bottomRight);for(let e=n.col;e<=r.col;e++)for(let i=n.row;i<=r.row;i++)t(new V(i,e))}trim(e,t){let n=this.normalize(e.topLeft),r=this.normalize(e.bottomRight),i=n.row,a=n.col;for(let e=n.col;e<=r.col;e++){let o=this.index(n.row,e),s=this.index(r.row,e),c=t.tree.intersecting(o,s);if(c.length){let t=this.cellRef(c[c.length-1].end);i=Math.max(i,t.row),a=e}}return new H(e.topLeft,new V(Math.min(i,e.bottomRight.row),a))}},yb=class{constructor(e,t,n){this.rows=e,this.columns=t,this._grid=n,this.headerHeight=e.headerSize,this.headerWidth=t.headerSize,this.hasRowHeader=t.hasHeader,this.hasColumnHeader=e.hasHeader}refresh(e,t){this.columns.viewSize(e),this.rows.viewSize(t);let n=this.columns.paneSegment(),r=this.rows.paneSegment();this.left=n.offset,this.top=r.offset,this.right=n.offset+n.length,this.bottom=r.offset+r.length,this.style={top:r.offset+`px`,left:n.offset+`px`,height:r.length+`px`,width:n.length+`px`}}view(e,t){let n=this.rows.visible(t),r=this.columns.visible(e);return{rows:n,columns:r,rowOffset:n.offset,columnOffset:r.offset,mergedCellLeft:r.start,mergedCellTop:n.start,ref:new H(new V(n.values.start,r.values.start),new V(n.values.end,r.values.end))}}contains(e){return this.rows.contains(e.topLeft.row,e.bottomRight.row)&&this.columns.contains(e.topLeft.col,e.bottomRight.col)}index(e,t){return this._grid.index(e,t)}boundingRectangle(e){return this._grid.rectangle(e)}cellRefIndex(e){return this._grid.cellRefIndex(e)}scrollBoundaries(e){let t=this.boundingRectangle(e),n=this.columns.hiddenSize(),r=this.rows.hiddenSize(),i={top:Math.max(0,t.top-this.top+(this.hasColumnHeader?0:this.headerHeight)-r),left:Math.max(0,t.left-this.left+(this.hasRowHeader?0:this.headerWidth)-n),right:t.right-this.columns._viewSize+this.headerWidth-n,bottom:t.bottom-this.rows._viewSize+this.headerHeight-r},a=this.columns.defaultValue/2,o=this.rows.defaultValue/2;return i.scrollTop=i.top-o,i.scrollBottom=i.bottom+o,i.scrollLeft=i.left-a,i.scrollRight=i.right+a,i}},bb=class e{constructor(e,t){this._grid=e,this._lists=t}indices(t,n,r,i){let a=e.ascendingComparer;return r===!1&&(a=e.descendingComparer),n.sortedIndices(this._grid.cellRefIndex(t.topLeft),this._grid.cellRefIndex(t.bottomRight),a,i)}sortBy(e,t,n,r,i){let a=this.indices(e.toColumn(t),n,r,i);for(let t=e.topLeft.col;t<=e.bottomRight.col;t++){let n=this._grid.index(e.topLeft.row,t),r=this._grid.index(e.bottomRight.row,t);for(let e=0;e<this._lists.length;e++)n<this._lists[e].lastRangeStart()&&this._lists[e].sort(n,r,a)}return a}};bb.ascendingComparer=function(e,t){if(e===null&&t===null)return 0;if(e===null)return 1;if(t===null)return-1;let n=typeof e,r=typeof t;if(n===`number`)return r===`number`?e-t:-1;if(n===`string`)switch(r){case`number`:return 1;case`string`:return e.localeCompare(t);default:return-1}if(n===`boolean`)switch(r){case`number`:return 1;case`string`:return 1;case`boolean`:return e-t;default:return-1}if(e instanceof W)return t instanceof W?0:1;throw Error(`Cannot compare `+e+` and `+t)},bb.descendingComparer=function(e,t){return e===null&&t===null?0:e===null?1:t===null?-1:bb.ascendingComparer(t,e)};var xb=class{constructor(e){this._sheet=e}forEachSelectedColumn(e){let t=this._sheet;t.batch(function(){t.select().forEachColumnIndex(function(n,r){e(t,n,r)})},{layout:!0,recalc:!0})}forEachSelectedRow(e){let t=this._sheet;t.batch(function(){t.select().forEachRowIndex(function(n,r){e(t,n,r)})},{layout:!0,recalc:!0})}includesHiddenColumns(e){return this._sheet._grid._columns.includesHidden(e.topLeft.col,e.bottomRight.col)}includesHiddenRows(e){return this._sheet._grid._rows.includesHidden(e.topLeft.row,e.bottomRight.row)}selectionIncludesHiddenColumns(){return this.includesHiddenColumns(this._sheet.select())}selectionIncludesHiddenRows(){return this.includesHiddenRows(this._sheet.select())}deleteSelectedColumns(){let e=[],t=0;return this.forEachSelectedColumn(function(n,r){if(r-=t,n.isHiddenColumn(r))return;t++;let i=[];e.unshift({index:r,formulas:i,width:n.columnWidth(r)}),n._saveModifiedFormulas(i,function(){n.deleteColumn(r)})}),e}deleteSelectedRows(){let e=[],t=0;return this.forEachSelectedRow(function(n,r){if(r-=t,n.isHiddenRow(r))return;t++;let i=[];e.unshift({index:r,formulas:i,height:n.rowHeight(r)}),n._saveModifiedFormulas(i,function(){n.deleteRow(r)})}),e}hideSelectedColumns(){this.forEachSelectedColumn(function(e,t){e.hideColumn(t)});let e=this._sheet,t=e.select().toRangeRef(),n=t.topLeft.col,r=t.bottomRight.col,i=null;for(;;){let t=r<e._columns._count,a=n>=0;if(!a&&!t)break;if(t&&!e.isHiddenColumn(r)){i=r;break}if(a&&!e.isHiddenColumn(n)){i=n;break}n--,r++}i!==null&&(t=new H(new V(0,i),new V(e._rows._count-1,i)),e.range(t).select())}hideSelectedRows(){this.forEachSelectedRow(function(e,t){e.hideRow(t)});let e=this._sheet,t=e.select().toRangeRef(),n=t.topLeft.row,r=t.bottomRight.row,i=null;for(;;){let t=r<e._rows._count,a=n>=0;if(!a&&!t)break;if(t&&!e.isHiddenRow(r)){i=r;break}if(a&&!e.isHiddenRow(n)){i=n;break}n--,r++}i!==null&&(t=new H(new V(i,0),new V(i,e._columns._count-1)),e.range(t).select())}unhideSelectedColumns(){this.forEachSelectedColumn(function(e,t){e.unhideColumn(t)})}unhideSelectedRows(){this.forEachSelectedRow(function(e,t){e.unhideRow(t)})}addColumnLeft(){let e=this._sheet,t,n=0;return e.batch(function(){e.select().forEachColumnIndex(function(r){t||=r,e.insertColumn(t),++n})},{recalc:!0,layout:!0}),{base:t,count:n}}addColumnRight(){let e=this._sheet,t,n=0;return e.batch(function(){e.select().forEachColumnIndex(function(e){t=e+1,++n});for(let r=0;r<n;++r)e.insertColumn(t)},{recalc:!0,layout:!0}),{base:t,count:n}}addRowAbove(){let e=this._sheet,t,n=0,r=e.select();return e.batch(function(){r.forEachRowIndex(function(r){t||=r,e.insertRow(t),++n})},{recalc:!0,layout:!0}),{base:t,count:n}}addRowBelow(){let e=this._sheet,t,n=0;return e.batch(function(){e.select().forEachRowIndex(function(e){t=e+1,++n});for(let r=0;r<n;++r)e.insertRow(t)},{recalc:!0,layout:!0}),{base:t,count:n}}},Sb=class{constructor(e){this._grid=e}rectIsVertical(e,t,n,r){let i=this._grid.rectangle(e.toRangeRef()),a=this._grid.rectangle(t.toRangeRef());return Math.abs(a[r]-i[r])>Math.abs(i[n]-a[n])}autoFillDest(e,t){let n=e.topLeft,r=e.bottomRight,i,a=t.row>=n.row,o=t.col>=n.col;i=a?o?4:3:o?2:1;let s,c,l,u;if(i===4)s=n,c=r,u=t.row>c.row||t.col>c.col,u&&(t=new V(Math.max(t.row,c.row),Math.max(t.col,c.col))),l=this.rectIsVertical(c,t,`right`,`bottom`)?new V(t.row,c.col):new V(c.row,t.col);else if(i===3){let e=new V(n.col,r.row);t.row>r.row&&this.rectIsVertical(e,t,`left`,`bottom`)?(s=n,l=new V(t.row,r.col)):(s=r,l=new V(n.row,t.col))}else if(i===2){let e=new V(n.row,r.col);t.col>r.col&&!this.rectIsVertical(e,t,`right`,`top`)?(s=n,l=new V(r.row,t.col)):(s=r,l=new V(t.row,n.col))}else s=r,l=this.rectIsVertical(n,t,`left`,`top`)?new V(t.row,n.col):new V(n.row,t.col);return this._grid.normalize(new H(s,l))}},Cb=class{constructor(e,t,n,r){this.rangeGetter=n,this.prevLeft=function(n){var i=r(this.range(n));return r(this.range(t.prevVisible(i.topLeft[e]))).topLeft[e]},this.nextRight=function(n){var i=r(this.range(n));return r(this.range(t.nextVisible(i.bottomRight[e]))).bottomRight[e]},this.nextLeft=function(n){var i=r(this.range(n));return t.nextVisible(i.bottomRight[e])},this.prevRight=function(n){var i=r(this.range(n));return t.prevVisible(i.topLeft[e])}}boundary(e,t){this.top=e,this.bottom=t}range(e){return this.rangeGetter(e,this.top,this.bottom)}},wb=class{constructor(e){this._sheet=e,this.autoFillCalculator=new Sb(e._grid),this.colEdge=new Cb(`col`,this._sheet._grid._columns,this.columnRange.bind(this),this.union.bind(this)),this.rowEdge=new Cb(`row`,this._sheet._grid._rows,this.rowRange.bind(this),this.union.bind(this))}height(e){this._viewPortHeight=e}union(e){return this._sheet.unionWithMerged(e)}columnRange(e,t,n){return this._sheet._ref(t,e,n-t,1)}rowRange(e,t,n){return this._sheet._ref(e,t,1,n-t)}selectionIncludesMergedCells(){return this._sheet.select().contains(this._sheet._mergedCells)}setSelectionValue(e){var t=this._sheet.selection();setTimeout(function(){t.value(e())})}selectAll(){this._sheet.select(this._sheet._sheetRef)}select(e,t,n){e=this.refForMode(e,t),n&&(e=this._sheet.select().concat(e)),this._sheet.select(e)}refForMode(e,t){var n=this._sheet._grid;switch(t){case`range`:e=n.normalize(e);break;case`row`:e=n.rowRef(e.row);break;case`column`:e=n.colRef(e.col);break;case`sheet`:e=this._sheet._sheetRef;break}return e}startSelection(e,t,n,r,i){if(t===`autofill`)this._sheet.startAutoFill();else if(r&&t===`range`){var a=new H(this._sheet.activeCell().first(),e);this._sheet.select(a,!1,!1),this._sheet.startSelection(i)}else this._sheet.startSelection(i),this.select(e,t,n)}completeSelection(){this._sheet.completeSelection()}selectForContextMenu(e,t){var n=this._sheet;n._activeDrawing=null,n.select().contains(this.refForMode(e,t))||this.select(e,t)}selectDrawingForContextMenu(e){var t=this._sheet;t._activeDrawing=e,t.triggerChange({selection:!0})}modifySelection(e){var t=this.determineDirection(e),n=this._sheet,r=this._viewPortHeight,i=n._grid._rows,a=n._grid._columns,o=n.currentOriginalSelectionRange(),s=n.select().toRangeRef(),c=n.activeCell(),l=o.topLeft.clone(),u=o.bottomRight.clone(),d=new V(u.row,l.col),f;switch(this.colEdge.boundary(s.topLeft.row,s.bottomRight.row),this.rowEdge.boundary(s.topLeft.col,s.bottomRight.col),t){case`expand-left`:l.col=this.colEdge.prevLeft(l.col),f=l;break;case`shrink-right`:l.col=this.colEdge.nextLeft(l.col),f=l;break;case`expand-right`:u.col=this.colEdge.nextRight(u.col),f=u;break;case`shrink-left`:u.col=this.colEdge.prevRight(u.col),f=u;break;case`expand-up`:l.row=this.rowEdge.prevLeft(l.row),f=l;break;case`shrink-down`:l.row=this.rowEdge.nextLeft(l.row),f=l;break;case`expand-down`:u.row=this.rowEdge.nextRight(u.row),f=u;break;case`shrink-up`:u.row=this.rowEdge.prevRight(u.row),f=u;break;case`expand-page-up`:l.row=i.prevPage(l.row,r);break;case`shrink-page-up`:u.row=i.prevPage(u.row,r);break;case`expand-page-down`:u.row=i.nextPage(u.row,r);break;case`shrink-page-down`:l.row=i.nextPage(l.row,r);break;case`first-col`:l.col=a.firstVisible(),u.col=c.bottomRight.col,f=l;break;case`last-col`:u.col=a.lastVisible(),l.col=c.topLeft.col,f=u;break;case`first-row`:l.row=i.firstVisible(),u.row=c.bottomRight.row,f=l;break;case`last-row`:u.row=i.lastVisible(),l.row=c.topLeft.row,f=u;break;case`last`:u.row=i.lastVisible(),u.col=a.lastVisible(),l=c.topLeft,f=u;break;case`first`:l.row=i.firstVisible(),l.col=a.firstVisible(),u=c.bottomRight,f=l;break;case`expand-word-right`:u.col=a.nextUntil(u.col,Tb(n,u,!0)),f=u;break;case`shrink-word-right`:l.col=a.nextUntil(d.col,Tb(n,d,!0)),f=l;break;case`expand-word-left`:l.col=a.prevUntil(d.col,Tb(n,d,!0)),f=l;break;case`shrink-word-left`:u.col=a.prevUntil(u.col,Tb(n,u,!0)),f=u;break;case`expand-word-up`:l.row=i.prevUntil(l.row,Tb(n,l,!1)),f=l;break;case`shrink-word-up`:u.row=i.prevUntil(u.row,Tb(n,u,!1)),f=u;break;case`expand-word-down`:u.row=i.nextUntil(u.row,Tb(n,u,!1)),f=u;break;case`shrink-word-down`:l.row=i.nextUntil(l.row,Tb(n,l,!1)),f=l;break}var p=new H(l,u);if(!this.union(p).intersects(c)){this.modifySelection(t.replace(`shrink`,`expand`));return}f&&n.focus(f),this.updateCurrentSelectionRange(p)}moveActiveCell(e){var t=this._sheet,n=t.activeCell(),r=n.topLeft,i=n.bottomRight,a=t.originalActiveCell(),o=t._grid._rows,s=t._grid._columns,c=a.row,l=a.col;switch(e){case`left`:l=s.prevVisible(r.col);break;case`up`:c=o.prevVisible(r.row);break;case`right`:l=s.nextVisible(i.col);break;case`down`:c=o.nextVisible(i.row);break;case`first-col`:l=s.firstVisible();break;case`last-col`:l=s.lastVisible();break;case`first-row`:c=o.firstVisible();break;case`last-row`:c=o.lastVisible();break;case`last`:c=o.lastVisible(),l=s.lastVisible();break;case`first`:c=o.firstVisible(),l=s.firstVisible();break;case`next-page`:c=o.nextPage(i.row,this._viewPortHeight);break;case`prev-page`:c=o.prevPage(i.row,this._viewPortHeight);break;case`word-right`:l=s.nextUntil(l,Tb(t,i,!0));break;case`word-left`:l=s.prevUntil(l,Tb(t,i,!0));break;case`word-up`:c=o.prevUntil(c,Tb(t,i,!1));break;case`word-down`:c=o.nextUntil(c,Tb(t,i,!1));break}t.select(new V(c,l))}navigateInSelection(e){var t=this._sheet,n=t.activeCell().topLeft,r=t.originalActiveCell(),i=t._grid._rows,a=t._grid._columns,o=r.row,s=r.col,c=!1,l=!1,u,d,f=n.col,p=n.row,m;function h(e){u=e.topLeft,d=e.bottomRight}h(t.currentNavigationRange());for(var g=!1,_=!1;!g&&!_;){var v=new V(o,s);switch(t.singleCellSelection()&&(c=u.eq(v)&&t._sheetRef.topLeft.eq(v),l=d.eq(v)&&t._sheetRef.bottomRight.eq(v),c||=a.firstVisible()===s&&i.firstVisible()===o,l||=a.lastVisible()===s&&i.lastVisible()===o),e){case`next`:l?_=!0:d.eq(v)?(h(t.nextNavigationRange()),o=u.row,s=u.col):(s=a.nextVisible(f),(s===f||s>d.col)&&(s=u.col,m=i.nextVisible(o),o=m===o||m>d.row?u.row:m));break;case`previous`:c?(_=!0,this._sheet._workbook._view.element.querySelector(`.k-spreadsheet-name-editor .k-input-inner`).focus()):u.eq(v)?(h(t.previousNavigationRange()),o=d.row,s=d.col):(s=a.prevVisible(f),(s===f||s<u.col)&&(s=d.col,m=i.prevVisible(o),o=m===o||m<u.row?d.row:m));break;case`lower`:d.eq(v)?(h(t.nextNavigationRange()),o=u.row,s=u.col):(o=i.nextVisible(p),(o===p||o>d.row)&&(o=u.row,m=a.nextVisible(s),s=m===s||m>d.col?u.col:m));break;case`upper`:u.eq(v)?(h(t.previousNavigationRange()),o=d.row,s=d.col):(o=i.prevVisible(p),(o===p||o<u.row)&&(o=d.row,m=a.prevVisible(s),s=m===s||m<u.col?d.col:m));break;default:throw Error(`Unknown entry navigation: `+e)}g=!this.shouldSkip(o,s),f=s,p=o}g&&(t.singleCellSelection()?t.select(new V(o,s)):t.activeCell(new V(o,s)))}extendSelection(e,t){var n=this._sheet,r=n._grid;if(t===`autofill`){this.resizeAutoFill(e);return}t===`range`?e=r.normalize(e):t===`row`?e=r.rowRef(e.row).bottomRight:t===`column`&&(e=r.colRef(e.col).bottomRight);var i=n.originalActiveCell().toRangeRef();this.updateCurrentSelectionRange(new H(i.topLeft,e))}shouldSkip(e,t){if(this._sheet.isHiddenRow(e)||this._sheet.isHiddenColumn(t))return!0;var n=new V(e,t),r=!1;return this._sheet.forEachMergedCell(function(e){e.intersects(n)&&!e.collapse().eq(n)&&(r=!0)}),r}resizeAutoFill(e){var t=this._sheet,n=t.select(),r=t._autoFillOrigin,i=this.autoFillCalculator.autoFillDest(n,e),a=this.punch(n,i),o,s;if(!a){var c=t.range(i)._previewFillFrom(t.range(r));c&&(s=c.direction,o=c.hint)}t.updateAutoFill(i,a,o,s)}determineDirection(e){var t=this._sheet.currentSelectionRange(),n=this._sheet.activeCell(),r=n.topLeft.col===t.topLeft.col,i=n.bottomRight.col===t.bottomRight.col,a=n.topLeft.row===t.topLeft.row,o=n.bottomRight.row===t.bottomRight.row;switch(e){case`left`:e=i?`expand-left`:`shrink-left`;break;case`right`:e=r?`expand-right`:`shrink-right`;break;case`up`:e=o?`expand-up`:`shrink-up`;break;case`down`:e=a?`expand-down`:`shrink-down`;break;case`prev-page`:e=o?`expand-page-up`:`shrink-page-up`;break;case`next-page`:e=a?`expand-page-down`:`shrink-page-down`;break;case`word-left`:e=i?`expand-word-left`:`shrink-word-left`;break;case`word-right`:e=r?`expand-word-right`:`shrink-word-right`;break;case`word-up`:e=o?`expand-word-up`:`shrink-word-up`;break;case`word-down`:e=a?`expand-word-down`:`shrink-word-down`;break}return e}updateCurrentSelectionRange(e){var t=this._sheet;t.select(t.originalSelect().replaceAt(t.selectionRangeIndex(),e),!1)}punch(e,t){var n;if(t.topLeft.eq(e.topLeft)){if(t.bottomRight.row<e.bottomRight.row)n=new H(new V(this.rowEdge.nextRight(t.bottomRight.row),e.topLeft.col),e.bottomRight);else if(t.bottomRight.col<e.bottomRight.col){var r=this.colEdge.nextRight(t.bottomRight.col);n=new H(new V(e.topLeft.row,r),e.bottomRight)}}return n}};function Tb(e,t,n){var r=e.range(t).value();return function(i,a,o){if(o)return!0;var s=(n?e.range(t.row,i):e.range(i,t.col)).value();return r===null?s!==null&&i:!a&&s===null?(r=null,!1):s===null}}function Eb(e){return e==null?null:G.runtime.serialToDate(e)}function Db(e){return e==null?null:G.runtime.dateToSerial(e)}var Ob=function(e){return e},kb=class{constructor(e){this.options=Object.assign({columns:[]},this.options,Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})),this.columns=this._normalizeColumns(this.options.columns),this._sheet(),this._dataSource(),this._header(),this._boundRowsCount=0,this.dataSource.fetch()}_sheet(){this.sheet=this.options.sheet,this._sheetChangeHandler=this._sheetChange.bind(this),this._sheetDeleteRowHandler=this._sheetDeleteRow.bind(this),this._sheetInsertRowHandler=this._sheetInsertRow.bind(this),this.sheet.bind(`change`,this._sheetChangeHandler).bind(`afterDeleteRow`,this._sheetDeleteRowHandler).bind(`afterInsertRow`,this._sheetInsertRowHandler)}_sheetInsertRow(e){e.index!==void 0&&this.dataSource.insert(Math.max(e.index-1,0),{})}_sheetDeleteRow(e){if(e.index!==void 0){var t=this.dataSource,n=t.view()[e.index-1];n&&t.remove(n)}}_header(){this.sheet.batch(function(){this.columns.forEach(function(e,t){this.sheet.range(0,t).value(e.title)}.bind(this))}.bind(this))}_sheetChange(e){if(!(e.insertRow||e.deleteRow)&&e.recalc&&e.ref&&e.isValue){var t=this.dataSource,n=t.view(),r=this.columns,i=[],a=this.sheet,o,s,c,l,u,d,f=function(e){e=e.toRangeRef();for(var a,o=0,c=e.topLeft.row;c<=e.bottomRight.row;c++){a=n[c-1],a||(a=t.insert(c-1,{}),n=t.view());for(var u=0,d=e.topLeft.col;d<=e.bottomRight.col&&d<r.length;d++){var f=i[l][o][u++];a.set(r[d].field,s[d](f))}o++}};for(t.reader.model&&(o=t.reader.model.fields),!r.length&&n.length&&(r=Object.keys(n[0].toJSON())),s=r.map(function(e){var t=e.field;return t&&o&&o[t]&&o[t].type===`date`?Eb:Ob}),this._skipRebind=!0,c=a._grid.normalize(e.ref),c instanceof U||(c=new U([c])),d=c.refs,d.forEach(function(e){i.push(a.range(e).values())}),l=0;l<d.length;l++)u=d[l],u.forEach(f);this._boundRowsCount=t.view().length,this._skipRebind=!1}}_normalizeColumns(e){return e.map(function(e){var t=e.field||e;return{field:t,title:e.title||t}})}_dataSource(){var e=this.options.dataSource;e=Array.isArray(e)?{data:e}:e,this.dataSource&&this._changeHandler?this.dataSource.unbind(`change`,this._changeHandler).unbind(`progress`,this._progressHandler).unbind(`error`,this._errorHandler):(this._changeHandler=this._change.bind(this),this._progressHandler=this._requestStart.bind(this),this._errorHandler=this._error.bind(this)),this.dataSource=this.options.sheet.createSheetDataSource?.(e).bind(`change`,this._changeHandler).bind(`progress`,this._progressHandler).bind(`error`,this._errorHandler)}_error(){this._progress(!1)}_requestStart(){this._progress(!0)}_progress(e){this.sheet.trigger(`progress`,{toggle:e})}_change(){if(!this._skipRebind&&!this.sheet.trigger(`dataBinding`)){var e=this.dataSource.view(),t=this.columns;!t.length&&e.length&&(this.columns=t=this._normalizeColumns(Object.keys(e[0].toJSON())),this._header());var n=t.map(function(e){return Bp(e.field)});this.sheet.batch(function(){for(var t=Math.max(e.length,this._boundRowsCount,this.sheet._grid.rowCount-1),r=0;r<t;r++)for(var i=0;i<n.length;i++){var a=e[r]?n[i](e[r]):null;this.sheet.range(r+1,i).value(a)}}.bind(this)),this._boundRowsCount=e.length,this._progress(!1),this.sheet.trigger(`dataBound`)}}destroy(){this.dataSource.unbind(`change`,this._changeHandler).unbind(`progress`,this._progressHandler).unbind(`error`,this._errorHandler),this.sheet.unbind(`change`,this._sheetChangeHandler).unbind(`deleteRow`,this._sheetDeleteRowHandler).unbind(`insertRow`,this._sheetInsertRowHandler)}};let Ab=(function(){function e(){return Ud(new Date)}function t(t){return Ud(t).getTime()===e().getTime()}return{dayOfWeek:Bd,getDate:Ud,isToday:t,addDays:Pd,today:e,firstDayOfMonth:Hd}})(),jb={or:{concat:(e,t)=>n=>e(n)||t(n),identity:()=>!1},and:{concat:(e,t)=>n=>e(n)&&t(n),identity:()=>!0}},Mb={contains:(e,t)=>(e||``).indexOf(t)>=0,doesnotcontain:(e,t)=>(e||``).indexOf(t)===-1,doesnotendwith:(e,t)=>(e||``).indexOf(t,(e||``).length-(t||``).length)<0,doesnotstartwith:(e,t)=>(e||``).lastIndexOf(t,0)===-1,endswith:(e,t)=>(e||``).indexOf(t,(e||``).length-(t||``).length)>=0,eq:(e,t)=>e===t,gt:(e,t)=>e>t,gte:(e,t)=>e>=t,isempty:e=>e===``,isnotempty:e=>e!==``,isnotnull:e=>Zp(e),isnull:e=>Qp(e),lt:(e,t)=>e<t,lte:(e,t)=>e<=t,neq:(e,t)=>e!=t,startswith:(e,t)=>(e||``).lastIndexOf(t,0)===0},Nb=/^\/Date\((.*?)\)\/$/,Pb=(e,t,n)=>{if(e!=null&&em(e)){let r=Nb.exec(e);if(r)return new Date(+r[1]).getTime();if(t)return n?e.toLocaleLowerCase(n):e.toLowerCase()}else if(e!=null&&$p(e))return e.getTime();return e},Fb=({field:e,ignoreCase:t,value:n,operator:r,accentFoldingFiltering:i})=>{e=Zp(e)?e:e=>e,t=!Zp(t)||t;let a=Ib(nm(e)?e:Bp(e,!0),n,t,i);n=Pb(n,t,i);let o=nm(r)?r:Mb[r];return e=>o(a(e),n,t)},Ib=(e,t,n,r)=>{if(!Zp(t))return e;let i=e;if(em(t)){let a=Nb.exec(t);a?t=new Date(+a[1]):i=t=>{let i=e(t);return typeof i==`string`&&n?r?i.toLocaleLowerCase(r):i.toLowerCase():tm(i)?i+``:i}}return $p(t)?e=>{let t=i(e);return $p(t)?t.getTime():t}:i},Lb=function(e){let t=e.accentFoldingFiltering,n=jb[e.logic||`and`];return e.filters.filter(Zp).map(e=>{let n=Zp(t)?Vp({},e,{accentFoldingFiltering:t}):e;return Zp(e.filters)?Lb(n):Fb(n)}).reduce(n.concat,n.identity)},Rb={},zb=G.runtime.dateToSerial,Bb=G.runtime.serialToDate;var Vb=class{prepare(){}value(e){return e.value}matches(){throw Error(`The 'matches' method is not implemented.`)}toJSON(){throw Error(`The 'toJSON' method is not implemented.`)}};Vb.create=function(e){var t=e.filter;if(!t)throw Error(`Filter type not specified.`);var n=Rb[t.charAt(0).toUpperCase()+t.substring(1)+`Filter`];if(!n)throw Error(`Filter type not recognized.`);return new n(e)};var Hb=class extends Vb{constructor(e){super(e),this._values=[],this._dates=[],this._blanks=!1,e.values!==void 0&&(this._values=e.values),e.blanks!==void 0&&(this._blanks=e.blanks),e.dates!==void 0&&(this._dates=e.dates)}value(e){var t=e.value;return this._dates.length>0&&e.format&&typeof t==`number`&&yh.type(t,e.format)===`date`&&(t=Bb(t)),t}matches(e){return e==null?this._blanks:e instanceof Date?this._dates.some(function(t){return t.year===e.getFullYear()&&(t.month===void 0||t.month===e.getMonth())&&(t.day===void 0||t.day===e.getDate())&&(t.hours===void 0||t.hours===e.getHours())&&(t.minutes===void 0||t.minutes===e.getMinutes())&&(t.seconds===void 0||t.seconds===e.getSeconds())}):this._values.indexOf(e)>=0}toJSON(){return{filter:`value`,blanks:this._blanks,values:this._values.slice(0)}}},Ub=class extends Vb{constructor(e){if(super(e),this._logic=`and`,e.logic!==void 0&&(this._logic=e.logic),e.criteria===void 0)throw Error(`Must specify criteria.`);this._criteria=e.criteria,this._matches=Lb({logic:this._logic,filters:this._criteria,accentFoldingFiltering:sm().name})}matches(e){return e!==null&&this._matches(e)}value(e){var t=e.value,n=this._criteria[0].value,r=n instanceof Date?`date`:typeof n,i=typeof t;return e.format&&(i=yh.type(t,e.format)),i==r?i==`date`&&(t=Bb(t)):r==`string`&&(e.format&&(t=yh.text(t,e.format)),t+=``),t}toJSON(){return{filter:`custom`,logic:this._logic,criteria:this._criteria}}},Wb=class extends Vb{constructor(e){super(e),this._type=e.type,this._value=e.value,this._values=[]}prepare(e){var t=e.map(this.value).sort().filter(function(e,t,n){return t===0||e!==n[t-1]});this._type===`topNumber`||this._type==`topPercent`?t.sort(function(e,t){return t-e}):t.sort(function(e,t){return e-t});var n=this._value;(this._type===`topPercent`||this._type===`bottomPercent`)&&(n=t.length*n/100>>0),this._values=t.slice(0,n)}matches(e){return this._values.indexOf(e)>=0}toJSON(){return{filter:`top`,type:this._type,value:this._value}}},Gb=class extends Vb{constructor(e){if(super(e),this._type=e.type,this._predicate=this[e.type],typeof this._predicate!=`function`)throw Error(`DynamicFilter type '`+e.type+`' not recognized.`)}value(e){var t=e.value;return e.format&&yh.type(t,e.format)===`date`&&(t=Bb(t)),t}prepare(e){for(var t=0,n=0,r=0;r<e.length;r++){var i=this.value(e[r]);typeof i==`number`&&(t+=i,n++)}n>0?this._average=t/n:this._average=0}matches(e){return this._predicate(e)}aboveAverage(e){return e instanceof Date&&(e=zb(e)),typeof e==`number`&&e>this._average}belowAverage(e){return e instanceof Date&&(e=zb(e)),typeof e==`number`&&e<this._average}tomorrow(e){if(e instanceof Date){var t=Ab.addDays(Ab.today(),1);return Ab.getDate(e).getTime()===t.getTime()}return!1}today(e){return e instanceof Date&&Ab.isToday(e)}yesterday(e){if(e instanceof Date){var t=Ab.addDays(Ab.today(),-1);return Ab.getDate(e).getTime()===t.getTime()}return!1}nextWeek(e){return Xb(Ab.addDays(Ab.today(),7),e)}thisWeek(e){return Xb(Ab.today(),e)}lastWeek(e){return Xb(Ab.addDays(Ab.today(),-7),e)}nextMonth(e){return Yb(e,1)}thisMonth(e){return Yb(e,0)}lastMonth(e){return Yb(e,-1)}nextQuarter(e){if(e instanceof Date){var t=Ab.today(),n=qb(e)-qb(t);return n===1&&t.getFullYear()===e.getFullYear()||n==-3&&t.getFullYear()+1===e.getFullYear()}return!1}thisQuarter(e){if(e instanceof Date){var t=Ab.today();return qb(e)-qb(t)===0&&t.getFullYear()===e.getFullYear()}return!1}lastQuarter(e){if(e instanceof Date){var t=Ab.today(),n=qb(t)-qb(e);return n===1&&t.getFullYear()===e.getFullYear()||n==-3&&t.getFullYear()-1===e.getFullYear()}return!1}nextYear(e){return Jb(e,1)}thisYear(e){return Jb(e,0)}lastYear(e){return Jb(e,-1)}yearToDate(e){if(e instanceof Date){var t=Ab.today();return e.getFullYear()===t.getFullYear()&&e<=t}return!1}toJSON(){return{filter:`dynamic`,type:this._type}}};Rb={Filter:Vb,ValueFilter:Hb,CustomFilter:Ub,TopFilter:Wb},[1,2,3,4].forEach(function(e){Gb.prototype[`quarter`+e]=function(t){return t instanceof Date&&qb(t)===e}});let Kb=()=>{sm().calendar.months.format.wide.forEach(function(e,t){Gb.prototype[e.toLowerCase()]=function(e){return e instanceof Date&&e.getMonth()===t}})};function qb(e){var t=e.getMonth()+1;return t>=1&&t<=3?1:t>=4&&t<=6?2:t>=7&&t<=9?3:4}function Jb(e,t){if(e instanceof Date){var n=Ab.today();return n.setFullYear(n.getFullYear()+t),n.getFullYear()===e.getFullYear()}return!1}function Yb(e,t){if(e instanceof Date){var n=Ab.firstDayOfMonth(Ab.today());return n.setMonth(n.getMonth()+t,1),n.getTime()===Ab.firstDayOfMonth(e).getTime()}return!1}function Xb(e,t){if(t instanceof Date){var n=Ab.dayOfWeek(Ab.getDate(e),1),r=Ab.dayOfWeek(Ab.getDate(t),1);return n.getTime()===r.getTime()}return!1}var Zb,Qb=class{constructor(e){this._sheet=e,this.selection=Ep.toRangeRef(),this.originalSelection=Ep.toRangeRef(),this._activeCell=Ep.toRangeRef(),this.originalActiveCell=Ep}currentSelectionRange(){return this.selection.rangeAt(this.selectionRangeIndex).toRangeRef()}currentOriginalNavigationRange(){return this.originalSelection.rangeAt(this.selectionRangeIndex).toRangeRef()}currentNavigationRange(){return this.singleCellSelection()?this._sheet._sheetRef:this.selection.rangeAt(this.selectionRangeIndex).toRangeRef()}nextNavigationRange(){return this.singleCellSelection()||(this.selectionRangeIndex=this.selection.nextRangeIndex(this.selectionRangeIndex)),this.currentNavigationRange()}previousNavigationRange(){return this.singleCellSelection()||(this.selectionRangeIndex=this.selection.previousRangeIndex(this.selectionRangeIndex)),this.currentNavigationRange()}activeCell(e){return e&&(this.originalActiveCell=e.first(),this._activeCell=this._sheet.unionWithMerged(e.toRangeRef()),this._sheet.focus(e),this._sheet.triggerChange({activeCell:!0,selection:!0})),this._activeCell}select(e,t,n,r){if(e){if(e.eq(this.originalSelection))return;if(this._sheet.triggerSelect(new X(e,this._sheet)),this.originalSelection=e,this.selection=t,n!==!1){if(e.isCell())this._sheet.forEachMergedCell(e,function(t){e=t.topLeft}),this.activeCell(e);else{if(e=this.selection.lastRange(),r&&r._sheet===this._sheet&&r.panes[0]){var i=r.panes,a,o,s,c,l,u;for(a=0;a<i.length&&(o=i[a],!(o._currentView&&(s=o._currentView.rows.values,c=o._currentView.columns.values,l=new H(new V(s.start,c.start),new V(s.end,c.end)),u=e.intersect(l),u!==B)));a++);u&&u!==B&&(e=u)}this.activeCell(e.first())}this.selectionRangeIndex=this.selection.size()-1}else this._sheet.triggerChange({selection:!0})}return this.selection}singleCellSelection(){return this._activeCell.eq(this.selection)}};let $b={};function ex(e,t){$b[e]=t}var tx=class extends ib{constructor(){super(),this.events=[`changing`,`commandRequest`,`afterInsertRow`,`afterDeleteRow`,`insertRow`,`insertColumn`,`deleteRow`,`deleteColumn`,`hideRow`,`hideColumn`,`unhideRow`,`unhideColumn`,`select`,`dataBinding`,`dataBound`,`progress`],this.createSheetDataSource=Array.from(arguments).pop(),this._reinit.apply(this,arguments)}activeCellCustomEditor(){let e=this.activeCell().first();if(this.range(e).enable()){let t=this.validation(e),n=this._properties.get(`editor`,this._grid.cellRefIndex(e)),r;return n==null?t&&t.showButton&&(n=`_validation_`+t.dataType,r=$b[n]):r=$b[n],typeof r==`function`&&(r=$b[n]=r()),r}}_reinit(e,t,n,r,i,a,o){o||={},this._defaultCellStyle={background:o.background,color:o.color,fontFamily:o.fontFamily,fontSize:o.fontSize,italic:o.italic,bold:o.bold,underline:o.underline,wrap:o.wrap,verticalAlign:o.verticalAlign,textAlign:o.textAlign},this._rows=new hb(e,n),this._columns=new hb(t,r),this._filteredRows=new Lg(0,e-1,!1),this._mergedCells=[],this._frozenRows=0,this._frozenColumns=0,this._suspendChanges=!1,this._filter=null,this._showGridLines=!0,this._gridLinesColor=null,this._grid=new vb(this._rows,this._columns,e,t,i,a),this._sheetRef=this._grid.normalize(Dp),this._properties=new Gg(e,t,this._defaultCellStyle),this._sorter=new bb(this._grid,this._properties.sortable()),this._viewSelection=new Qb(this),this._editSelection=new Qb(this),this._formulaSelections=[],this._drawings=[]}resize(e,t){e=Math.max(e,1),t=Math.max(t,1);var n=this._rows._count,r=this._columns._count;if(e<n&&this.range(e,0,n-e,r).clear(),t<r&&this.range(0,t,n,r-t).clear(),this._rows._resize(e),this._columns._resize(t),this._grid._resize(e,t),this._properties._resize(e,t),this._sheetRef=this._grid.normalize(Dp),e>n){this.range(n,0,e-n,t).clear({clearAll:!0,keepBorders:!0}).borderLeft(null).borderBottom(null).borderRight(null);for(let e=0;e<t;++e){let t=this.range(n-1,e,1,1);t.borderBottom(t.borderBottom())}this._filteredRows.value(n,e-1,!1)}if(t>r){this.range(0,r,e,t-r).clear({clearAll:!0,keepBorders:!0}).borderTop(null).borderRight(null).borderBottom(null);for(let t=0;t<e;++t){let e=this.range(t,r-1,1,1);e.borderRight(e.borderRight())}}this.triggerChange({layout:!0})}_resizeAddRow(e){this.resize(this._rows._count+(e||1),this._columns._count)}_resizeAddColumn(e){this.resize(this._rows._count,this._columns._count+(e||1))}_resizeDeleteRow(e){this._resizeAddRow(-(e||1))}_resizeDeleteColumn(e){this._resizeAddColumn(-(e||1))}_resizeForJSON(e){for(var t=e.length,n=0,r=0;r<e.length;++r){var i=e[r];if(i.index!=null&&(t=Math.max(t,i.index+1)),i.cells){n=Math.max(n,i.cells.length);for(var a=0;a<i.cells.length;++a){var o=i.cells[a];o.index!=null&&(n=Math.max(n,o.index+1))}}}this.resize(Math.max(t,this._rows._count),Math.max(n,this._columns._count))}_selectionState(){return this._inEdit?this._editSelection:this._viewSelection}navigator(){return this._navigator||=new wb(this),this._navigator}axisManager(){return this._axisManager||=new xb(this),this._axisManager}_name(e){return e?(this._sheetName=e,this):this._sheetName}name(){return this._name()}_state(e){return e?(this._sheetState=e,this):this._sheetState||`visible`}state(){return this._state()}_property(e,t,n){return t===void 0?e():(e(t),this.triggerChange(n))}_field(e,t,n){return t===void 0?this[e]:(this[e]=t,this.triggerChange(n))}suspendChanges(e){return e===void 0?this._suspendChanges:(this._suspendChanges=e,this)}triggerChange(e){return this._suspendChanges?e&&e.isValue&&(this._valueChanged=!0):this.trigger(`change`,e),this}triggerSelect(e){this.trigger(`select`,{range:e})}setDataSource(e,t){this.dataSourceBinder&&this.dataSourceBinder.destroy(),this.dataSourceBinder=new kb({dataSource:e,sheet:this,columns:t,createSheetDataSource:this.createSheetDataSource}),this.dataSource=this.dataSourceBinder.dataSource}hideColumn(e){if(!this.trigger(`hideColumn`,{index:e}))return this._property(this._columns.hide.bind(this._columns),e,{layout:!0})}unhideColumn(e){if(!this.trigger(`unhideColumn`,{index:e}))return this._property(this._columns.unhide.bind(this._columns),e,{layout:!0})}isHiddenColumn(e){return this._grid._columns.hidden(e)}_copyRange(e,t){var n=this._grid,r=n.rowCount,i=n.normalize(e.topLeft),a=n.normalize(e.bottomRight),o=i.col*r+i.row,s=a.col*r+a.row,c=t.col*r+t.row;this._properties.copy(o,s,c)}_saveModifiedFormulas(e,t){var n=Zb;Zb=e;var r=t();return Zb=n,r}_restoreModifiedFormulas(e){var t=this._workbook;e.forEach(function(e){var n=t.sheetByName(e.sheet),r;e instanceof G.runtime.Formula&&(r=n._grid.cellRefIndex(e),n._properties.set(`formula`,r,r,e)),e instanceof Fy.Validation&&(r=n._grid.cellRefIndex(e),n._properties.set(`validation`,r,r,e))})}_adjustReferences(e,t,n,r){if(this._mergedCells=r.reduce(function(r,i){return i=i.adjust(null,null,null,null,e===`row`,t,n),i instanceof H&&r.push(i),r},[]),this._workbook){var i=this._name();this._workbook._sheets.forEach(function(r){r._forFormulas(function(r){var a=r.adjust(i,e,t,n);a&&Zb&&Zb.push(a)}),r._forValidations(function(r){var a=r.adjust(i,e,t,n);a&&Zb&&Zb.push(a)})}),this._workbook.adjustNames(i,e===`row`,t,n)}var a=this.select();a=a.adjust(null,null,null,null,e===`row`,t,n),a!==B&&this.select(a),(e===`col`?this._columns:this._rows).adjust(t,n),e===`row`&&(n<0?this._filteredRows.copy(t-n,this._rows._count-1,t):(this._filteredRows.copy(t,this._rows._count,t+n),this._filteredRows.value(t,t+n-1,!1))),this._drawings.forEach(function(r){r.topLeftCell&&=r.topLeftCell.adjust(null,null,null,null,e===`row`,t,n)})}_forFormulas(e){var t=this._properties.get(`formula`).values(),n=t.length;t.forEach(function(t,r){e.call(this,t.value,r,n)},this)}_forValidations(e){this._properties.get(`validation`).values().forEach(function(t){e.call(this,t.value)},this)}insertRow(e,t){if(!this.trigger(`insertRow`,{index:e}))return this.batch(function(){this._resizeAddRow();var t=this._grid,n=t.columnCount,r=t.rowCount;if(e+1!==r){var i=this.frozenRows();e<i&&this.frozenRows(i+1);for(var a=this._mergedCells.slice(),o=0;o<n;o++){var s=new H(new V(e,o),new V(e,o)),c=t.normalize(s.topLeft),l=t.normalize(s.bottomRight),u=new H(new V(c.row,c.col),new V(r-2,l.col));this._copyRange(u,new V(c.row+1,c.col)),new X(s,this).clear({clearAll:!0,keepBorders:!0})}this._adjustReferences(`row`,e,1,a)}},{recalc:!0,layout:!0,insertRow:{index:e},ref:new H(new V(e,0),new V(1/0,1/0))}),t||this.trigger(`afterInsertRow`,{index:e}),this}isEnabledRow(e){var t=new H(new V(e,0),new V(e,this._grid.columnCount));return new X(t,this).enable()}deleteRow(e,t){if(!this.isEnabledRow(e))return this;if(!this.trigger(`deleteRow`,{index:e}))return this.batch(function(){var t=this._grid,n=t.columnCount,r=this.frozenRows();e<r&&this.frozenRows(r-1);for(var i=this._mergedCells.slice(),a=0;a<n;a++){var o=new H(new V(e,a),new V(e,a));new X(o,this).clear({clearAll:!0,keepBorders:!0});var s=t.normalize(o.topLeft),c=t.normalize(o.bottomRight),l=new H(new V(s.row+1,s.col),new V(1/0,c.col));this._copyRange(l,s);var u=t.normalize(l.bottomRight);new X(new H(u,u),this).clear()}this._adjustReferences(`row`,e,-1,i),this._resizeDeleteRow()},{recalc:!0,layout:!0,deleteRow:{index:e},ref:new H(new V(e,0),new V(1/0,1/0))}),t||this.trigger(`afterDeleteRow`,{index:e}),this}insertColumn(e){if(!this.trigger(`insertColumn`,{index:e}))return this.batch(function(){this._resizeAddColumn();var t=this._grid,n=t.columnCount;if(e+1!==n){var r=this.frozenColumns();e<r&&this.frozenColumns(r+1);for(var i=this._mergedCells.slice(),a=n;a>=e;a--){var o=new H(new V(0,a),new V(1/0,a));if(new X(o,this).clear({clearAll:!0,keepBorders:!0}),a===e)break;var s=t.normalize(o.topLeft),c=t.normalize(o.bottomRight),l=new H(new V(s.row,s.col-1),new V(c.row,c.col-1));this._copyRange(l,s)}this._adjustReferences(`col`,e,1,i)}},{recalc:!0,layout:!0,insertColumn:{index:e},ref:new H(new V(0,e),new V(1/0,1/0))}),this}isEnabledColumn(e){var t=new H(new V(0,e),new V(1/0,e));return new X(t,this).enable()}deleteColumn(e){if(!this.isEnabledColumn(e))return this;if(!this.trigger(`deleteColumn`,{index:e}))return this.batch(function(){var t=this._grid,n=t.columnCount,r=this.frozenColumns();e<r&&this.frozenColumns(r-1);for(var i=this._mergedCells.slice(),a=e;a<n;a++){var o=new H(new V(0,a),new V(1/0,a));if(new X(o,this).clear({clearAll:!0,keepBorders:!0}),a===n-1)break;var s=t.normalize(o.topLeft),c=t.normalize(o.bottomRight),l=new H(new V(s.row,s.col+1),new V(c.row,c.col+1));this._copyRange(l,s)}this._adjustReferences(`col`,e,-1,i),this._resizeDeleteColumn()},{recalc:!0,layout:!0,deleteColumn:{index:e},ref:new H(new V(0,e),new V(1/0,1/0))}),this}_filterRow(e){this._rows.hide(e),this._filteredRows.value(e,e,!0),this.triggerChange({layout:!0})}hideRow(e){if(!this.trigger(`hideRow`,{index:e}))return this._property(this._rows.hide.bind(this._rows),e,{layout:!0})}unhideRow(e){if(!this.trigger(`unhideRow`,{index:e}))return this._property(this._rows.unhide.bind(this._rows),e,{layout:!0})}isHiddenRow(e){return this._grid._rows.hidden(e)}isFilteredRow(e){return this._filteredRows.value(e)}columnWidth(e,t){return this._property(this._columns.value.bind(this._columns,e,e),t,{layout:!0})}rowHeight(e,t){return this._property(this._rows.value.bind(this._rows,e,e),t,{layout:!0})}frozenRows(e){return this._field(`_frozenRows`,e,{layout:!0})}frozenColumns(e){return this._field(`_frozenColumns`,e,{layout:!0})}showGridLines(e){return this._field(`_showGridLines`,e,{layout:!0})}gridLinesColor(e){return this._field(`_gridLinesColor`,e,{layout:!0})}_ref(e,t,n,r){var i=null;return e instanceof z?e:e instanceof X?e._ref.toRangeRef():(typeof e==`string`?i=G.parseReference(e):(n||=1,r||=1,i=new H(new V(e,t),new V(e+n-1,t+r-1))),i)}range(e,t,n,r){return new X(this._ref(e,t,n,r),this)}_getMergedCells(e){var t=this._grid,n={},r={},i=!1;return this.forEachMergedCell(e,function(a){var o=a.topLeft;t.forEach(a,function(t){o.eq(t)?(n[t.print()]=a,i=!0):e.contains(t)&&(r[t.print()]=o,i=!0)})}),{primary:n,secondary:r,hasMerged:i}}forEachMergedCell(e,t){var n=!1;t===void 0&&(t=e,n=!0),this._mergedCells.forEach(function(r){(n||r.intersects(e))&&t(r)})}forEachFilterHeader(e,t){var n=!1;if(t===void 0&&(t=e,n=!0),this._filter){var r=[];this._filter.ref.forEachColumn(function(t){(n||t.intersects(e))&&r.push(t.topLeft)}),this._mergedCells.forEach(function(e){r=r.map(function(t){return e.intersects(t)?e:t})}),r.reduce(function(e,t){return e.indexOf(t)<0&&e.push(t),e},[]).forEach(t)}}forEach(e,t){var n=this;function r(e){e instanceof H||(e=e.toRangeRef());var r=n._grid.normalize(e.topLeft),i=n._grid.normalize(e.bottomRight),a,o;function s(e){t(o++,a,e)}for(a=r.col;a<=i.col;a++){o=r.row;var c=n._grid.index(o,a),l=n._grid.index(i.row,a);n._properties.forEach(c,l,s)}}e instanceof H||(e=n._ref(e)),e instanceof U?e.forEach(r):r(e)}startResizing(e){this._initialPosition=e,this._resizeInProgress=!0}startAutoFill(){this._autoFillInProgress=!0;var e=this.select();this._autoFillOrigin=e,this._autoFillDest=e,this.triggerChange({selection:!0})}updateAutoFill(e,t,n,r){this._autoFillDest=e,this._autoFillPunch=t,this._autoFillHint=n,this._autoFillDirection=r,this.triggerChange({selection:!0})}autoFillRef(){return this._autoFillDest}autoFillPunch(){return this._autoFillPunch}autoFillInProgress(){return this._autoFillInProgress}resizingInProgress(){return this._resizeInProgress}draggingInProgress(){return this._draggingInProgress}completeResizing(){if(this._resizeInProgress){this._resizeInProgress=!1;var e=this.resizeHintPosition();if(this._initialPosition&&e){var t=this.resizeHandlePosition();t.col===-1/0?this.trigger(`commandRequest`,{command:`RowHeightCommand`,options:{target:t.row,value:this.rowHeight(t.row)-(this._initialPosition.y-e.y)}}):this.trigger(`commandRequest`,{command:`ColumnWidthCommand`,options:{target:t.col,value:this.columnWidth(t.col)-(this._initialPosition.x-e.x)}})}else this.trigger(`change`,{resize:!0})}}_visualRange(e){for(var t=this._mergedCells,n=t.length;--n>=0;)if(t[n].intersects(e))return this.range(t[n]);return this.range(e)}_renderComment(e){var t=null;if(e){var n=this._visualRange(e);t=n.comment(),e=n._ref.toRangeRef().topLeft}t?(!this._commentRef||!e.eq(this._commentRef))&&(this._commentRef=e,this.trigger(`change`,{comment:!0})):this._commentRef&&(this._commentRef=null,this.trigger(`change`,{comment:!0}))}resizeHandlePosition(){return this._resizeHandlePosition}resizeHintPosition(e){return e!==void 0&&(this._resizeHintPosition=e,this.trigger(`change`,{resize:!0})),this._resizeHintPosition}removeResizeHandle(){this._resizeHandlePosition&&(this._resizeHintPosition=void 0,this._resizeHandlePosition=void 0,this._initialPosition=void 0,this.trigger(`change`,{resize:!0}))}positionResizeHandle(e){this._resizeHandlePosition=e,this.trigger(`change`,{resize:!0})}startDragging(e){this._draggingInProgress=e}completeDragging(){var e=this._draggingInProgress;if(e){this._draggingInProgress=null;var t=e.drawing;if(t.eq(e.copy))return;if(t.topLeftCell){var n=this.drawingBoundingBox(t),r=new V(this._rows.indexVisible(n.top),this._columns.indexVisible(n.left)),i=this.refBoundingBox(r);t.offsetX=n.left-i.left,t.offsetY=n.top-i.top,t.topLeftCell=r,this.triggerChange({dragging:!0})}this.trigger(`commandRequest`,{command:`DrawingUpdateCommand`,options:{sheet:this,drawing:t,previous:e.copy}})}}startSelection(e){this.frozenRows()||this.frozenColumns()?this._currentView=null:e&&e._sheet===this&&(this._currentView=e),this._selectionInProgress=!0}completeSelection(){if(this._selectionInProgress&&(this._selectionInProgress=!1,this._resizeHintPosition=void 0,this.trigger(`change`,{selection:!0})),this._autoFillInProgress){this._autoFillInProgress=!1;var e=this._autoFillDest,t=this._autoFillOrigin;this._autoFillPunch?this.trigger(`commandRequest`,{command:`ClearContentCommand`,options:{operatingRange:this.range(this._autoFillPunch)}}):e.eq(t)?this.triggerChange({selection:!0}):this.trigger(`commandRequest`,{command:`AutoFillCommand`,options:{operatingRange:this.range(e),origin:this.range(t)}}),this._autoFillDest=null,this._autoFillPunch=null,this._autoFillOrigin=null,this.select(e)}}selectionInProgress(){return this._selectionInProgress}select(e,t){var n=this._selectionState(),r;return e&&(e=this._ref(e),e=this._grid.normalize(e),r=this._grid.isAxis(e)?e:this.unionWithMerged(e)),n.select(e,r,t,this._currentView)}originalSelect(){return this._selectionState().originalSelection}currentSelectionRange(){return this._selectionState().currentSelectionRange()}currentOriginalSelectionRange(){return this._selectionState().currentOriginalNavigationRange()}currentNavigationRange(){return this._selectionState().currentNavigationRange()}nextNavigationRange(){return this._selectionState().nextNavigationRange()}previousNavigationRange(){return this._selectionState().previousNavigationRange()}selectionRangeIndex(){return this._selectionState().selectionRangeIndex}activeCell(e){return this._selectionState().activeCell(e)}originalActiveCell(){return this._selectionState().originalActiveCell}singleCellSelection(){return this._selectionState().singleCellSelection()}unionWithMerged(e){var t=this._mergedCells;return e.map(function(e){return e.toRangeRef().union(t)})}trim(e){var t=[],n=this._grid;return this._properties.forEachProperty(function(r){t.push(n.trim(e,r.list))}),this.unionWithMerged(e.topLeft.toRangeRef().union(t))}focus(e){if(e)this._focus=e.toRangeRef();else{var t=this._focus;return this._focus=null,t}}activeCellSelection(){return new X(this._grid.normalize(this.activeCell()),this)}selection(){return new X(this._grid.normalize(this._selectionState().selection),this)}selectedHeaders(){var e=this.select(),t={},n={},r=!1,i=!1,a=this._grid.rowCount-1,o=this._grid.columnCount-1;return e.forEach(function(e){var s,c=`partial`,l=`partial`;e=e.toRangeRef();var u=e.bottomRight,d=e.topLeft,f=d.col<=0&&u.col>=o,p=d.row<=0&&u.row>=a;if(p&&(i=!0,l=`full`),f&&(r=!0,c=`full`),!p)for(s=d.row;s<=u.row;s++)t[s]!==`full`&&(t[s]=c);if(!f)for(s=d.col;s<=u.col;s++)n[s]!==`full`&&(n[s]=l)}),{rows:t,cols:n,allRows:i,allCols:r,all:i&&r}}isInEditMode(e){if(e===void 0)return this._inEdit;this._inEdit=e,e&&(this._editSelection.selection=this._viewSelection.selection.clone(),this._editSelection.originalSelection=this._viewSelection.originalSelection.clone(),this._editSelection._activeCell=this._viewSelection._activeCell.clone(),this._editSelection.originalActiveCell=this._viewSelection.originalActiveCell.clone())}_setFormulaSelections(e){this._formulaSelections=(e||[]).slice(),this.triggerChange({selection:!0})}_viewActiveCell(){return this._viewSelection._activeCell.toRangeRef()}toJSON(){var e={},t=this._rows.toJSON(`height`,e),n=this._columns.toJSON(`width`,{}),r=this._viewSelection,i=[],a=this._defaultCellStyle||{};function o(e){Object.keys(a).forEach(function(t){e[t]===a[t]&&delete e[t]})}this.forEach(Dp,function(n,r,a){if(o(a),Object.keys(a).length!==0){a.link&&i.push({ref:z.display(null,n,r),target:a.link});var s=e[n];s===void 0&&(s=t.length,t.push({index:n}),e[n]=s),n=t[s],a.index=r,n.cells===void 0&&(n.cells=[]),a.formula&&(a.formula.arrayFormulaRange?a.formula={src:a.formula.toString(),ref:a.formula.arrayFormulaRange.toString()}:a.formula=a.formula.toString()),a.validation&&=a.validation.toJSON(),a.color&&=se(a.color).toCss(),a.background&&=se(a.background).toCss(),a.borderTop&&a.borderTop.color&&(a.borderTop.color=se(a.borderTop.color).toCss()),a.borderBottom&&a.borderBottom.color&&(a.borderBottom.color=se(a.borderBottom.color).toCss()),a.borderRight&&a.borderRight.color&&(a.borderRight.color=se(a.borderRight.color).toCss()),a.borderLeft&&a.borderLeft.color&&(a.borderLeft.color=se(a.borderLeft.color).toCss()),n.cells.push(a)}});var s={name:this._name(),state:this._state(),rows:t,columns:n,selection:r.selection.toString(),activeCell:r.activeCell().toString(),frozenRows:this.frozenRows(),frozenColumns:this.frozenColumns(),showGridLines:this.showGridLines(),gridLinesColor:this.gridLinesColor(),mergedCells:this._mergedCells.map(function(e){return e.toString()}),hyperlinks:i,defaultCellStyle:a,drawings:this._drawings.map(function(e){return e.toJSON()})};return this._sort&&(s.sort={ref:this._sort.ref.toString(),columns:this._sort.columns.map(function(e){return{index:e.index,ascending:e.ascending}})}),this._filter&&(s.filter={ref:this._filter.ref.toString(),columns:this._filter.columns.map(function(e){var t=e.filter.toJSON();return t.index=e.index,t})}),s}fromJSON(e){this.batch(function(){if(e.name!==void 0&&this._name(e.name),e.frozenColumns!==void 0&&this.frozenColumns(e.frozenColumns),e.frozenRows!==void 0&&this.frozenRows(e.frozenRows),e.columns!==void 0&&this._columns.fromJSON(`width`,e.columns),e.rows!==void 0){this._resizeForJSON(e.rows),this._rows.fromJSON(`height`,e.rows);for(var t=0;t<e.rows.length;t++){var n=e.rows[t],r=n.index;if(r===void 0&&(r=t),n.cells)for(var i=0;i<n.cells.length;i++){var a=n.cells[i],o=a.index;if(o===void 0&&(o=i),a.formula){var s=typeof a.formula!=`string`,c=s?a.formula.src:a.formula,l=this._compileFormula(r,o,c);s&&l.setArrayFormulaRange(G.parseReference(a.formula.ref)),a.formula=l}a.validation&&=this._compileValidation(r,o,a.validation),this._properties.fromJSON(this._grid.index(r,o),a)}}}if(e.drawings&&(this._drawings=e.drawings.map(nx.fromJSON)),e.selection&&(this._viewSelection.selection=this._viewSelection.originalSelection=this._ref(e.selection)),e.activeCell){var u=this._ref(e.activeCell);this._viewSelection._activeCell=u.toRangeRef(),this._viewSelection.originalActiveCell=u.first()}if(e.mergedCells&&e.mergedCells.forEach(function(e){this.range(e).merge()},this),e.filter){var d=e.filter.ref,f=e.filter.columns===void 0?[]:e.filter.columns;d&&(this._filter={ref:this._ref(d),columns:f.map(function(e){return{index:e.index,filter:Vb.create(e)}})},this._refreshFilter())}e.showGridLines!==void 0&&(this._showGridLines=e.showGridLines),this._gridLinesColor=e.gridLinesColor,e.sort&&this._sortBy(this._ref(e.sort.ref),e.sort.columns.slice(0))}),this._rows._refresh(),this._columns._refresh()}formula(e){return this._properties.get(`formula`,this._grid.cellRefIndex(e))}validation(e){return this._properties.get(`validation`,this._grid.cellRefIndex(e))}resetFormulas(){this._forFormulas(function(e){e.reset()})}resetValidations(){this._forValidations(function(e){e.reset()})}recalc(e,t){var n=this._properties.get(`formula`).values(),r=n.length,i=0,a=0;if(!r&&t)return t();function o(){i--,a===r&&!i&&t()}for(;a<r;)i++,n[a++].value.exec(e,t?o:null)}revalidate(e){var t=this;this._forValidations(function(n){var r=new V(n.row,n.col),i=new H(r,r);n.exec(e,t._get(i,`value`),t._get(i,`format`))})}_value(e,t,n){var r=this._grid.index(e,t);if(n!==void 0)this._properties.set(`value`,r,r,n);else return this._properties.get(`value`,r)}_validation(e,t){var n=this._grid.index(e,t);return this._properties.get(`validation`,n)}_compileValidation(e,t,n){return n instanceof Fy.Validation?n.clone(this._name(),e,t):(n.from!=null&&(n.from=(n.from+``).replace(/^=/,``)),n.to!=null&&(n.to=(n.to+``).replace(/^=/,``)),Fy.compile(this._name(),e,t,n))}_compileFormula(e,t,n){return n=n.replace(/^=/,``),n=G.parseFormula(this._name(),e,t,n),G.compile(n)}_copyValuesInRange(e,t,n,r){var i,a,o;for(i=e.col;i<=t.col;i++){a=this._grid.index(e.row,i),o=this._grid.index(t.row,i);for(var s=a,c=e.row;s<=o;++s,++c)n=n.clone(this._name(),c,i),this._properties.set(r,s,s,n)}return n}_set(e,t,n){var r=this._grid.normalize(e.topLeft),i=this._grid.normalize(e.bottomRight),a,o,s;if(typeof n==`number`&&(n=G.runtime.limitPrecision(n)),n&&t===`formula`)typeof n==`string`&&(n=this._compileFormula(r.row,r.col,n)),n=this._copyValuesInRange(r,i,n,`formula`);else if(n&&t===`validation`)n=this._compileValidation(r.row,r.col,n),n=this._copyValuesInRange(r,i,n,`validation`);else for(a=r.col;a<=i.col;a++)o=this._grid.index(r.row,a),s=this._grid.index(i.row,a),this._properties.set(t,o,s,n),t===`formula`&&this._properties.set(`value`,o,s,null)}_get(e,t){var n=this._grid.normalize(e.topLeft),r=this._grid.index(n.row,n.col);return this._properties.get(t,r)}batch(e,t){var n=this.suspendChanges();return this.suspendChanges(!0),this._valueChanged=!1,e.call(this),t||={recalc:!0},this._valueChanged&&(t.isValue=!0),this.suspendChanges(n).triggerChange(t)}_sortBy(e,t){var n=null;t.forEach(function(t){n=this._sorter.sortBy(e,t.index,this._properties.get(`value`),t.ascending,n)},this),this._sort={ref:e,columns:t},this._refreshFilter(),this.forEach(e,function(e,t,n){var r=n.formula;if(r){var i=e-r.row;if(i!==0){var a=i>0?r.row:r.row+i;r.adjust(this.name(),`row`,a,i)}}}.bind(this)),this.triggerChange({recalc:!0})}_refreshFilter(){this._filter&&this._filterBy(this._filter.ref,this._filter.columns)}_filterBy(e,t){this.batch(function(){for(var n=e.topLeft.row;n<=e.bottomRight.row;n++)this.isFilteredRow(n)&&(this._filteredRows.value(n,n,!1),this._rows.unhide(n));t.forEach(function(t){var n=e.resize({top:1}).toColumn(t.index),r=[];if(n!==B){this.forEach(n,function(e,t,n){n.row=e,r.push(n)}),t.filter.prepare(r);for(var i=0;i<r.length;i++){var a=r[i],o=t.filter.value(a);t.filter.matches(o)===!1&&this._filterRow(a.row)}}},this),this._filter={ref:e,columns:t}},{recalc:!0,layout:!0,filter:!0})}filterColumn(e){var t=this.filter().ref;return e.toRangeRef().topLeft.col-t.topLeft.col}filter(){return this._filter}clearFilter(e){this._clearFilter(e instanceof Array?e:[e])}_clearFilter(e){this._filter&&this.batch(function(){this._filter.columns=this._filter.columns.filter(function(t){return e.indexOf(t.index)<0}),this._refreshFilter()},{recalc:!0,layout:!0,filter:!0})}getAxisState(){return{rows:this._rows.getState(),columns:this._columns.getState()}}setAxisState(e){this._rows.setState(e.rows),this._columns.setState(e.columns),this.triggerChange({layout:!0})}getState(){return{rows:this._rows.getState(),columns:this._columns.getState(),mergedCells:this._mergedCells.map(function(e){return e.clone()}),properties:this._properties.getState()}}setState(e){this._rows.setState(e.rows),this._columns.setState(e.columns),this._mergedCells=e.mergedCells,this._properties.setState(e.properties),this.triggerChange(Ap)}_merge(e){var t=this._mergedCells,n=this,r;return this.batch(function(){r=e.map(function(e){if(e instanceof V)return e;var r=e.toRangeRef().union(t,function(e){t.splice(t.indexOf(e),1)}),i=new X(r,n),a=i._get(`formula`),o=i.value(),s=i.format(),c=i.background();i.value(null),i.format(null),i.background(null);var l=new X(r.collapse(),n);return a?l._set(`formula`,a):l.value(o),l.format(s),l.background(c),t.push(r),r});var i=n._viewSelection;i.selection=n.unionWithMerged(i.originalSelection),i._activeCell=n.unionWithMerged(i.originalActiveCell)},{activeCell:!0,selection:!0}),r}_useCultureDecimals(){return this._workbook&&this._workbook.options.useCultureDecimals}withCultureDecimals(e){var t=`.`;return this._useCultureDecimals()&&(t=sm().numbers.symbols.decimal),G.withDecimalSeparator(t,e)}drawingBoundingBox(e){var t=e.offsetX,n=e.offsetY;return e.topLeftCell&&(t+=this._columns.sum(0,e.topLeftCell.col-1),n+=this._rows.sum(0,e.topLeftCell.row-1)),new _b(t,n,e.width,e.height)}refBoundingBox(e){return this._grid.rectangle(e.toRangeRef())}addDrawing(e,t){return e instanceof nx||(e=new nx(e)),this._drawings.push(e),t&&(this._activeDrawing=e),this.triggerChange({layout:!0}),e}removeDrawing(e){var t=this._drawings.indexOf(e);t>=0&&(this._drawings.splice(t,1),this.triggerChange({layout:!0}))}usesImage(e){for(var t=this._drawings.length;--t>=0;)if(this._drawings[t].image===e)return!0;return!1}isMerged(e){for(var t=this._mergedCells,n=t.length;--n>=0;)if(t[n].eq(e))return!0;return!1}},nx=class e{constructor(e){this.reset(e)}toJSON(){return{topLeftCell:this.topLeftCell.toString(),offsetX:this.offsetX,offsetY:this.offsetY,width:this.width,height:this.height,image:this.image,opacity:this.opacity}}clone(){return new e(this)}reset(e){var t=e.topLeftCell;typeof t==`string`&&(t=G.parseReference(t)),this.topLeftCell=t,this.offsetX=e.offsetX||0,this.offsetY=e.offsetY||0,this.width=e.width,this.height=e.height,this.image=e.image,this.opacity=e.opacity==null?1:e.opacity}eq(e){return(!this.topLeftCell&&!e.topLeftCell||this.topLeftCell&&e.topLeftCell&&this.topLeftCell.eq(e.topLeftCell))&&this.offsetX===e.offsetX&&this.offsetY===e.offsetY&&this.width===e.width&&this.height===e.height&&this.image===e.image&&this.opacity===e.opacity}};nx.fromJSON=function(e){return new nx(e)};let rx={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],executive:[521.86,756],folio:[612,936],legal:[612,1008],letter:[612,792],tabloid:[792,1224]};function ix(e){return 72/25.4*e}function ax(e){return ix(e*10)}function ox(e){return e*72}function sx(e,t){if(typeof e==`number`)return e;if(typeof e==`string`){let t;if(t=/^\s*([0-9.]+)\s*(mm|cm|in|pt)\s*$/.exec(e),t){let e=parseFloat(t[1]);if(!isNaN(e))return t[2]===`pt`?e:{mm:ix,cm:ax,in:ox}[t[2]](e)}}if(t!=null)return t;throw Error(`Can't parse unit: `+e)}function cx(e){if(typeof e!=`function`){let t=e;e=function(e,n){return e in t?t[e]:n}}let t=e(`paperSize`,rx.a4);if(!t)return{};if(typeof t==`string`&&(t=rx[t.toLowerCase()],t==null))throw Error(`Unknown paper size`);t[0]=sx(t[0]),t[1]=sx(t[1]),e(`landscape`,!1)&&(t=[Math.max(t[0],t[1]),Math.min(t[0],t[1])]);let n=e(`margin`);return n&&(typeof n==`string`||typeof n==`number`?(n=sx(n,0),n={left:n,top:n,right:n,bottom:n}):n={left:sx(n.left,0),top:sx(n.top,0),right:sx(n.right,0),bottom:sx(n.bottom,0)},e(`addMargin`)&&(t[0]+=n.left+n.right,t[1]+=n.top+n.bottom)),{paperSize:t,margin:n}}let lx=.8;function ux(e,t,n,r,i){let a=0,o=[],s=t,c=0;return t&&n&&(n*=t),e.forEach(function(e,l){r!=null&&l<r&&(c+=e),t&&a+e>s&&(s-a<n&&(a=t*Math.ceil(a/t)+c,c>0&&i.push(a-c)),s+=t*Math.ceil(e/t)),o.push(a),a+=e}),o.push(a),o}function dx(e,t,n){let r=e._grid;t=r.normalize(t);let i=r.rectangle(t),a=[];e._drawings.forEach(function(t){let n=e.drawingBoundingBox(t);n.intersects(i)&&a.push({drawing:t,box:n.offset(-i.left,-i.top)})});let o=[],s=[],c=[],l=e._getMergedCells(t),u=-1,d=-1;e.forEach(t,function(r,i,f){let p=r-t.topLeft.row,m=i-t.topLeft.col,h=e.rowHeight(r),g=e.columnWidth(i);n.forScreen||(f.drawings=a.filter(function(t){let n=t.drawing.topLeftCell;if(n&&n.row==r&&n.col==i)return u=Math.max(u,e._rows.index(t.box.bottom)),d=Math.max(d,e._columns.index(t.box.right)),!0})),m||s.push(h),p||c.push(g);let _=new V(r,i).print();if(l.secondary[_])return;f.row=p,f.col=m;let v=l.primary[_];if(v?(delete l.primary[_],f.merged=!0,f.rowspan=v.height(),f.colspan=v.width(),n.forScreen&&(f.width=e._columns.sum(v.topLeft.col,v.bottomRight.col),f.height=e._rows.sum(v.topLeft.row,v.bottomRight.row))):(f.rowspan=1,f.colspan=1),!e._grid._columns.sum(i,i+f.colspan-1)||!e._grid._rows.sum(r,r+f.rowspan-1))return;let y=n.forScreen||gx(f);(n.emptyCells||y)&&(y?(u=Math.max(u,p+f.rowspan-1),d=Math.max(d,m+f.colspan-1)):f.empty=!0,o.push(f))}),n.forScreen||(s=s.slice(0,u+1),c=c.slice(0,d+1));let f=n.pageWidth,p=n.pageHeight,m=n.scale||1;if(n.fitWidth){let e=c.reduce(mx,0);e>f&&(m=f/e)}f=Math.ceil(f/m),p=Math.ceil(p/m);let h=[],g=ux(s,p||0,n.maxEmpty,n.headerRows,h),_=ux(c,f||0,n.maxEmpty),v=0,y=0,b=[];return o=o.filter(function(e){return e.empty&&(e.row>u||e.col>d)?!1:(n.headerRows&&e.row<n.headerRows&&b.push(e),e.left=_[e.col],e.top=g[e.row],e.merged?n.forScreen?(e.right=e.left+e.width,e.bottom=e.top+e.height):(e.right=hx(_,e.col+e.colspan),e.bottom=hx(g,e.row+e.rowspan),e.width=e.right-e.left,e.height=e.bottom-e.top):(e.width=c[e.col],e.height=s[e.row],e.bottom=e.top+e.height,e.right=e.left+e.width),n.forScreen||e.drawings.forEach(function(t){let n=t.box;n.left=e.left+t.drawing.offsetX,n.top=e.top+t.drawing.offsetY,n.right=n.left+n.width,n.bottom=n.top+n.height}),v=Math.max(v,e.right),y=Math.max(y,e.bottom),!0)}),Object.keys(l.primary).forEach(function(n){let r=l.primary[n];e.forEach(r.topLeft.toRangeRef(),function(n,i,a){let s=n-t.topLeft.row,c=i-t.topLeft.col;a.merged=!0,a.colspan=r.width(),a.rowspan=r.height(),s<0?a.top=-e._rows.sum(n,n-s-1):a.top=g[s],c<0?a.left=-e._columns.sum(i,i-c-1):a.left=_[c],a.height=e._rows.sum(r.topLeft.row,r.bottomRight.row),a.width=e._columns.sum(r.topLeft.col,r.bottomRight.col),a.height>0&&a.width>0&&(a.right=a.left+a.width,a.bottom=a.top+a.height,a.row=s,a.col=c,o.push(a))})}),n.headerRows&&(h.forEach(function(e){b.forEach(function(t){t=fx(t),t.top+=e,t.bottom=t.top+t.height,o.push(t)}),g.push(e)}),g.sort(vx)),{width:v,height:y,cells:o.sort(_x),scale:m,xCoords:_,yCoords:g,drawings:a}}function fx(e,t){return t||={},Object.assign?Object.assign(t,e):Object.keys(e).reduce(function(t,n){return t[n]=e[n],t},t)}function px(e,t){return e.size===t.size&&e.color===t.color}function mx(e,t){return e+t}function hx(e,t){return t<e.length?e[t]:e[e.length-1]}function gx(e){return e.value!=null||e.merged||e.background!=null||e.borderRight!=null||e.borderBottom!=null||e.dBorders!=null||e.validation!=null&&!e.validation.value||e.drawings&&e.drawings.length}function _x(e,t){return e.top<t.top?-1:e.top==t.top?e.left<t.left?-1:e.left==t.left?0:1:1}function vx(e,t){return e<t?-1:+(e>t)}function yx(e,t,n,r){let i=Math.ceil(t.width/r.pageWidth),a=Math.ceil(t.height/r.pageHeight),o=Math.ceil(r.pageWidth/t.scale),s=Math.ceil(r.pageHeight/t.scale);for(let e=0;e<a;++e)for(let t=0;t<i;++t)c(e,t);function c(i,a){let c=a*o,l=c+o,u=i*s,d=u+s,f=0,p=0;function m(e){return e.right<=c||e.left>=l||e.bottom<=u||e.top>=d?!1:(f=Math.max(e.bottom,f),p=Math.max(e.right,p),!0)}let h=t.cells.filter(m),g=t.drawings.filter(function(e){return m(e.box)});if(f=Math.min(f,d),p=Math.min(p,l),h.length||g.length){let i=new ur;n.append(i);let a=new ur;i.append(a),a.clip(j.fromRect(new A([c-1,u-1],[p+1,f+1])));let o=$e.scale(t.scale,t.scale).multiplyCopy($e.translate(-c,-u));if((r.hCenter||r.vCenter)&&(o=o.multiplyCopy($e.translate(r.hCenter?(l-p)/2:0,r.vCenter?(d-f)/2:0))),a.transform(o),r.guidelines){let e=null;t.xCoords.forEach(function(t){t=Math.min(t,p),t!==e&&t>=c&&t<=l&&(e=t,a.append(new j().moveTo(t,u).lineTo(t,f).close().stroke(r.guideColor,lx)))}),e=null,t.yCoords.forEach(function(t){t=Math.min(t,f),t!==e&&t>=u&&t<=d&&(e=t,a.append(new j().moveTo(c,t).lineTo(p,t).close().stroke(r.guideColor,lx)))})}let s=Ex();h.forEach(function(t){bx(t,a,r),s.add(t,e)});let m=new ur;s.vert.forEach(function(e){e.forEach(function(e){e.rendered||(e.rendered=!0,m.append(new j().moveTo(e.x,e.top).lineTo(e.x,e.bottom).close().stroke(e.color,e.size)))})}),s.horiz.forEach(function(e){e.forEach(function(e){e.rendered||(e.rendered=!0,m.append(new j().moveTo(e.left,e.y).lineTo(e.right,e.y).close().stroke(e.color,e.size)))})}),a.append(m),g.forEach(function(t){let n=t.drawing,r=n.image;if(r!=null){let i=t.box,o=e._workbook.imageUrl(r);a.append(new cr(o,new A([i.left,i.top],[i.width,i.height])).opacity(n.opacity))}})}}}function bx(e,t,n){let r=new ur;t.append(r);let i=new A([e.left,e.top],[e.width,e.height]);if(e.background||e.merged){let t=i;n.guidelines&&(t=i.clone(),t.origin.x+=.5,t.origin.y+=.5,--t.size.width,--t.size.height),r.append(new _r(t).fill(e.background||`#fff`).stroke(null))}e.dBorders&&(e.dBorders.type&2&&r.append(new j().moveTo(e.left,e.bottom).lineTo(e.right,e.top).stroke(e.dBorders.color,e.dBorders.size)),e.dBorders.type&1&&r.append(new j().moveTo(e.left,e.top).lineTo(e.right,e.bottom).stroke(e.dBorders.color,e.dBorders.size)));let a=e.value;if(a!=null){let t=typeof a==`number`?`number`:null,n=new ur;n.clip(j.fromRect(i)),r.append(n);let o,s=e.format;if(!s&&t==`number`&&a!=Math.floor(a)&&(s=`0.##############`),s?(o=yh.textAndColor(a,s),a=o.text,o.type&&(t=o.type)):a+=``,!e.textAlign)switch(t){case`number`:case`date`:case`percent`:case`currency`:e.textAlign=`right`;break;case`boolean`:e.textAlign=`center`;break}Sx(a,o&&o.color||e.color||`#000`,e,n)}}function xx(e,t){if(e.indent){let n=1.4*e.indent;switch(t.textAlign){case null:case`left`:t.paddingLeft=n+`ch`;break;case`right`:t.paddingRight=n+`ch`;break;case`center`:t.paddingLeft=n/2+`ch`,t.paddingRight=n/2+`ch`;break}}}let Z;function Sx(e,t,n,r){Z||(Z=document.createElement(`div`),Z.style.position=`fixed`,Z.style.left=`0px`,Z.style.top=`0px`,Z.style.visibility=`hidden`,Z.style.overflow=`hidden`,Z.style.boxSizing=`border-box`,Z.style.lineHeight=`normal`,document.body.appendChild(Z)),Z.firstChild&&Z.removeChild(Z.firstChild),Z.style.padding=`2px 4px`,Z.style.color=t,Z.style.font=Cx(n),Z.style.width=n.width+`px`,Z.style.textAlign=n.textAlign||`left`,Z.style.textDecoration=n.underline?`underline`:`none`,xx(n,Z.style),n.wrap?(Z.style.whiteSpace=`pre-wrap`,Z.style.overflowWrap=Z.style.wordWrap=`break-word`):(Z.style.whiteSpace=`pre`,Z.style.overflowWrap=Z.style.wordWrap=`normal`),Z.appendChild(document.createTextNode(e));let i=0;switch(n.verticalAlign){case`center`:i=n.height-Z.offsetHeight>>1;break;case void 0:case null:case`bottom`:i=n.height-Z.offsetHeight;break}i<0&&(i=0);let a=ju(Z);a.transform($e.translate(n.left,n.top+i)),r.append(a)}function Cx(e){let t=[];return e.italic&&t.push(`italic`),e.bold&&t.push(`bold`),t.push((e.fontSize||12)+`px`),t.push(e.fontFamily||`Arial`),t.join(` `)}function wx(e,t,n,r){n==null&&r==null&&(r=t,n={},t=Dp),r??(r=n,t instanceof Range||t instanceof z||typeof t==`string`?n={}:(n=t,t=Dp)),n=Object.assign({},{paperSize:`A4`,landscape:!0,margin:`1cm`,guidelines:!0,guideColor:`#aaa`,emptyCells:!0,fitWidth:!1,center:!1,headerRows:null,maxEmpty:.2,scale:1},n);let i=new ur,a=cx(n);i.options.set(`pdf`,{author:n.author,creator:n.creator,date:n.date,keywords:n.keywords,margin:a.margin,multiPage:!0,paperSize:a.paperSize,subject:n.subject,title:n.title,autoPrint:n.autoPrint});let o=a.paperSize[0],s=a.paperSize[1];a.margin&&(o-=a.margin.left+a.margin.right+1,s-=a.margin.top+a.margin.bottom+1),n.pageWidth=o,n.pageHeight=s,yx(e,dx(e,e._ref(t),n),i,n),r(i)}tx.prototype.draw=function(e,t,n){let r=this;r._workbook?r.recalc(r._workbook._context,function(){wx(r,e,t,n)}):wx(r,e,t,n)};function Tx(){}Tx.prototype={forEach:function(e){Object.keys(this).forEach(function(t){e(this[t],t,this)},this)}};function Ex(){let e=new Tx,t=new Tx;function n(e){e.borderLeft&&i(e.row,e.col,e.borderLeft,e.left,e.top,e.bottom),e.borderRight&&i(e.row,e.col+e.colspan,e.borderRight,e.right,e.top,e.bottom),e.borderTop&&a(e.row,e.col,e.borderTop,e.top,e.left,e.right),e.borderBottom&&a(e.row+e.rowspan,e.col,e.borderBottom,e.bottom,e.left,e.right)}function r(e){return e===`__proto__`||e===`constructor`||e===`prototype`}function i(e,n,i,a,o,s){if(r(e)||r(n))return;let c=t[n]||(t[n]=new Tx),l=e>0&&c[e-1];l&&px(l,i)?(c[e]=l,l.bottom=s):c[e]={size:i.size,color:i.color||`#000`,x:a,top:o,bottom:s}}function a(t,n,i,a,o,s){if(r(t)||r(n))return;let c=e[t]||(e[t]=new Tx),l=n>0&&c[n-1];l&&px(l,i)?(c[n]=l,l.right=s):c[n]={size:i.size,color:i.color||`#000`,y:a,left:o,right:s}}return{add:n,horiz:e,vert:t}}let Dx={Borders:Ex,doLayout:dx,applyIndent:xx},Ox={view:`k-spreadsheet-view`,fixedContainer:`k-spreadsheet-fixed-container`,editContainer:`k-spreadsheet-edit-container`,scroller:`k-spreadsheet-scroller`,viewSize:`k-spreadsheet-view-size`,clipboard:`k-spreadsheet-clipboard`,cellEditor:`k-spreadsheet-cell-editor`,barEditor:`k-spreadsheet-editor`,topCorner:`k-spreadsheet-top-corner`,filterHeadersWrapper:`k-filter-wrapper`,filterRange:`k-filter-range`,filterButton:`k-spreadsheet-filter`,filterButtonSelected:`k-selected`,horizontalResize:`k-horizontal-resize`,verticalResize:`k-vertical-resize`,icon:`k-icon`,iconFilterDefault:`k-i-caret-alt-down`,sheetsBar:`k-spreadsheet-sheets-bar`,sheetsBarActive:`k-spreadsheet-sheets-bar-active`,sheetsBarInactive:`k-spreadsheet-sheets-bar-inactive`,cellContextMenu:`k-spreadsheet-cell-context-menu`,rowHeaderContextMenu:`k-spreadsheet-row-header-context-menu`,colHeaderContextMenu:`k-spreadsheet-col-header-context-menu`,drawingContextMenu:`k-spreadsheet-drawing-context-menu`},kx={cell:`k-spreadsheet-cell`,vaxis:`k-spreadsheet-vaxis`,haxis:`k-spreadsheet-haxis`,vborder:`k-spreadsheet-vborder`,hborder:`k-spreadsheet-hborder`,rowHeader:`k-spreadsheet-row-header`,columnHeader:`k-spreadsheet-column-header`,pane:`k-spreadsheet-pane`,data:`k-spreadsheet-data`,mergedCell:`k-spreadsheet-merged-cell`,mergedCellsWrapper:`k-merged-cells-wrapper`,activeCell:`k-spreadsheet-active-cell`,selection:`k-spreadsheet-selection`,selectionWrapper:`k-selection-wrapper`,autoFillWrapper:`k-auto-fill-wrapper`,single:`k-single`,top:`k-top`,right:`k-right`,bottom:`k-bottom`,left:`k-left`,resizeHandle:`k-resize-handle`,columnResizeHandle:`k-column-resize-handle`,rowResizeHandle:`k-row-resize-handle`,resizeHint:`k-resize-hint`,resizeHintHandle:`k-resize-hint-handle`,resizeHintMarker:`k-resize-hint-marker`,resizeHintVertical:`k-resize-hint-vertical`,selectionHighlight:`k-spreadsheet-selection-highlight`,series:[`k-series-a`,`k-series-b`,`k-series-c`,`k-series-d`,`k-series-e`,`k-series-f`]};function Ax(e){return(e.size||1)+`px solid `+(e.color||`#000`)}function jx(e){return/:\/\//.test(e)||(e=`http://`+e),e}function Mx(e,t,n,r){function i(e){let n=t.link;if(n||typeof t.value==`object`&&(n=t.value.link),n){let r={textDecoration:`none`};return t.color&&(r.color=t.color),t.underline&&(r.textDecoration=`underline`),K.element(`a`,{href:jx(n),style:r,target:`_blank`},e?[e]:[])}return e}let a=t.value!=null||t.validation!=null&&!t.validation.value||t.background||t.merged||t.comment||t.dBorders;if(!n&&!a)return;let o={background:[]},s=t.background;if(s){let e=s;r&&(e=se(e).toHSV(),e.v*=.9,e=e.toCssRgba()),e=Ax({color:e}),o.outline=e}t.dBorders&&(t.dBorders.type&2&&o.background.push(`linear-gradient(to top left, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) calc(50% - `+t.dBorders.size+`px), `+t.dBorders.color+` 50%, rgba(0, 0, 0, 0) calc(50% + `+t.dBorders.size+`px), rgba(0, 0, 0, 0) 100%)`),t.dBorders.type&1&&o.background.push(`linear-gradient(to top right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) calc(50% - `+t.dBorders.size+`px), `+t.dBorders.color+` 50%, rgba(0, 0, 0, 0) calc(50% + `+t.dBorders.size+`px), rgba(0, 0, 0, 0) 100%)`)),s&&o.background.push(s),t.color&&(o.color=t.color),t.fontFamily&&(o.fontFamily=t.fontFamily),t.underline&&(o.textDecoration=`underline`),t.italic&&(o.fontStyle=`italic`),t.textAlign&&(o.textAlign=t.textAlign),t.bold&&(o.fontWeight=`bold`),t.fontSize&&(o.fontSize=t.fontSize+`px`),t.wrap===!0?(o.whiteSpace=`pre-wrap`,o.overflowWrap=`break-word`,o.wordWrap=`break-word`):(o.whiteSpace=`pre`,o.overflowWrap=`normal`,o.wordWrap=`normal`),o.left=t.left+1+`px`,o.top=t.top+1+`px`,o.width=t.width-1+`px`,o.height=t.height-1+`px`;let c=t.value,l=typeof c,u=t.format;if(!u&&l===`number`&&c!==Math.floor(c)&&(u=`0.##############`),u&&c!=null?(c=yh.format(c,u),c.__dataType&&(l=c.__dataType)):c!=null&&(c=t.html?K.html(c):K.text(c)),!o.textAlign)switch(l){case`number`:case`date`:case`percent`:case`currency`:o.textAlign=`right`;break;case`boolean`:o.textAlign=`center`;break}Dx.applyIndent(t,o);let d=[kx.cell];n&&d.push(n),t.enable===!1&&d.push(`k-disabled`),t.merged&&(d.push(`k-spreadsheet-merged-cell`),t.enable||e.push(K.element(`div`,{className:`k-spreadsheet-disabled-mask`,style:{left:t.left+1+`px`,top:t.top+1+`px`,width:t.width-1+`px`,height:t.height-1+`px`}}))),t.comment&&d.push(`k-spreadsheet-has-comment`);let f=t.verticalAlign||`bottom`;c=f&&c?K.element(`div`,{className:`k-vertical-align-`+f},[i(c)]):i(c),o.background.length?o.background=o.background.join(`,`):delete o.background;let p=c?[c]:[],m={style:o},h=t.validation;h&&!h.value&&(p.push(K.element(`span`,{className:`k-dirty`})),d.push(`k-dirty-cell`),m.title=h.message),m.className=d.join(` `);let g=K.element(`div`,m,p);return e.push(g),g}var Nx=class e{constructor(e,t,n){this._sheet=e,this._grid=t,this.getIconHTMLString=n}refresh(e,t){this._grid.refresh(e,t)}isVisible(e,t,n){return this._grid.view(e,t).ref.intersects(n)}render(t){let n=t.scroller,r=n.scrollLeft,i=n.scrollTop;i<0&&(i=0),r<0&&(r=0);let a=e.classNames,o=this._sheet,s=this._grid,c=s.view(r,i);this._currentView=c,this._currentRect=this._rectangle(c.ref),this._selectedHeaders=o.selectedHeaders();let l=[];if(l.push(this.renderData(t)),o._activeDrawing||l.push(this.renderSelection()),l.push(this.renderAutoFill()),l.push(this.renderEditorSelection()),l.push(this.renderFilterHeaders()),s.hasRowHeader){let e=K.element(`div`,{className:a.rowHeader,style:{width:s.headerWidth+`px`,top:c.rowOffset+`px`}});l.push(e),o.forEach(c.ref.leftColumn(),function(t){if(!o.isHiddenRow(t)){let n=t+1,r=o.rowHeight(t);e.children.push(K.element(`div`,{className:this.headerClassName(t,`row`),style:{width:s.headerWidth+`px`,height:r+`px`}},[K.element(`div`,{className:`k-vertical-align-center`},[K.text(n+``)])]))}}.bind(this))}if(s.hasColumnHeader){let e=K.element(`div`,{className:a.columnHeader,style:{top:`0px`,left:c.columnOffset+`px`,width:this._currentRect.width+`px`,height:s.headerHeight+`px`}});l.push(e);let t=0;o.forEach(c.ref.topRow(),function(n,r){if(!o.isHiddenColumn(r)){let n=z.display(null,1/0,r),i=o.columnWidth(r);e.children.push(K.element(`div`,{className:this.headerClassName(r,`col`),style:{position:`absolute`,left:t+`px`,width:i+`px`,height:s.headerHeight+`px`}},[K.element(`div`,{className:`k-vertical-align-center`},[K.text(n+``)])])),t+=i}}.bind(this))}o.resizeHandlePosition()&&(s.hasColumnHeader||s.hasRowHeader)&&(o.resizeHintPosition()||this.renderResizeHandle(l));let u=[a.pane];return s.hasColumnHeader&&u.push(a.top),s.hasRowHeader&&u.push(a.left),K.element(`div`,{style:s.style,className:u.join(` `)},l)}headerClassName(e,t){let n=this._selectedHeaders,r,i;t===`row`?(r=n.rows[e],i=n.allRows):(r=n.cols[e],i=n.allCols);let a=r||(n.all?`full`:i?`partial`:`none`);return a&&=`k-selection-`+a,a}renderData(t){let n=this._sheet,r=this._currentView,i=K.element(`div`,{className:e.classNames.data,style:{position:`relative`,left:r.columnOffset+`px`,top:r.rowOffset+`px`}}),a=this._currentRect,o=Dx.doLayout(n,r.ref,{forScreen:!0}),s,c=this._grid,l=n._showGridLines;l&&(s=null,o.xCoords.forEach(function(e){e!==s&&(s=e,i.children.push(K.element(`div`,{className:kx.vaxis,style:{left:e+`px`,height:a.height+`px`,borderColor:n.gridLinesColor()}})))}),s=null,o.yCoords.forEach(function(e){e!==s&&(s=e,i.children.push(K.element(`div`,{className:kx.haxis,style:{top:e+`px`,width:a.width+`px`,borderColor:n.gridLinesColor()}})))}));let u=Dx.Borders(),d=n.activeCell().toRangeRef(),f=d.topLeft;return o.cells.forEach(function(a){let o=null,s=a.row+r.ref.topLeft.row,p=a.col+r.ref.topLeft.col,m=!1;if(n._activeDrawing){let e=n._activeDrawing.topLeftCell;e&&e.row===s&&e.col===p&&(o=`k-spreadsheet-drawing-anchor-cell`)}else s===f.row&&p===f.col&&(o=[e.classNames.activeCell].concat(this._activeFormulaColor(),this._directionClasses(d)),n.singleCellSelection()&&o.push(e.classNames.single),this._renderCustomEditorButton(i.children,a)&&(m=!0),o=o.join(` `));u.add(a);var h=Mx(i.children,a,o,l);if(m&&(h.attr.style.paddingRight=`23px`),a.comment&&n._commentRef&&s===n._commentRef.row&&p===n._commentRef.col){let e=a.right+c.left+r.columnOffset+4,n={top:a.top+c.top+r.rowOffset+`px`};e+200>t.contentWidth?n.right=t.contentWidth-c.left-a.left-r.columnOffset+4+`px`:n.left=e+`px`;let i=K.element(`div`,{className:`k-tooltip k-spreadsheet-cell-comment`,style:n},[K.text(a.comment)]);t.toplevelElements.push(i)}},this),u.vert.forEach(function(e){e.forEach(function(e){if(!e.rendered){e.rendered=!0;let t={left:e.x+`px`,top:e.top+`px`,height:e.bottom-e.top+1+`px`,borderWidth:e.size+`px`,borderColor:e.color};e.size!==1&&(t.transform=`translateX(-`+(e.size-1)/2+`px)`),i.children.push(K.element(`div`,{className:kx.vborder,style:t}))}})}),u.horiz.forEach(function(e){e.forEach(function(e){if(!e.rendered){e.rendered=!0;let t={top:e.y+`px`,left:e.left+`px`,width:e.right-e.left+`px`,borderWidth:e.size+`px`,borderColor:e.color};e.size!==1&&(t.transform=`translateY(-`+(e.size-1)/2+`px)`),i.children.push(K.element(`div`,{className:kx.hborder,style:t}))}})}),this.renderDrawings(o,i.children),i}renderDrawings(e,t){let n=this._sheet,r=n._workbook;e.drawings.forEach(function(e){let i=e.drawing,a=e.box.toDiv(`k-spreadsheet-drawing`);i.image&&a.children.push(K.element(`div`,{className:`k-spreadsheet-drawing-image`,style:{backgroundImage:`url('`+r.imageUrl(i.image)+`')`,opacity:i.opacity}})),i===n._activeDrawing&&(a.attr.className+=` k-spreadsheet-active-drawing`,Px(a.children)),t.push(a)})}renderResizeHandle(t){let n=this._sheet.resizeHandlePosition(),r=this._rectangle(n),i=[e.classNames.resizeHandle],a;if(n.col!==-1/0){if(this._grid.rows._start>0)return;a={height:this._grid.headerHeight+`px`,width:`7px`,left:r.right-7/2+`px`,top:`0px`},i.push(Ox.horizontalResize)}else{if(this._grid.columns._start>0)return;a={height:`7px`,width:this._grid.headerWidth+`px`,top:r.bottom-7/2+`px`,left:`0px`},i.push(Ox.verticalResize)}t.push(K.element(`div`,{className:i.join(` `),style:a}))}filterIconRect(e){let t=e.height<22?Math.max(e.height-2,0):22;return new _b(e.right-t,e.bottom-t,t,t)}icon(e){return typeof this.getIconHTMLString==`function`?K.element(this.getIconHTMLString(e)):K.element(`span`,{className:Ox.icon+` `+e})}renderFilterHeaders(){let e=this,t=this._sheet,n=[],r=Ox,i=t.filter();function a(t,n,r){let a={left:n.left+`px`,top:n.top+`px`,width:n.width+`px`,height:n.height+`px`,padding:`0px`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxSizing:`border-box`},o=i&&i.columns.some(function(e){return e.index===r}),s=t.filterButton;return o&&(s+=` `+t.filterButtonSelected),K.element(`span`,{className:s,style:a},[e.icon(t.iconFilterDefault)])}return i&&this._addDiv(n,i.ref,r.filterRange),t.forEachFilterHeader(this._currentView.ref,function(e){let t=this._rectangle(e),i=this.filterIconRect(t),o=this._sheet.filterColumn(e),s=a(r,i,o);n.push(s)}.bind(this)),K.element(`div`,{className:r.filterHeadersWrapper},n)}renderEditorSelection(){let t=e.classNames,n=this._sheet,r=[];return n._formulaSelections.forEach(function(e){let n=e.ref;n!==B&&this._addDiv(r,n,t.selectionHighlight+` `+e.colorClass)}.bind(this)),K.element(`div`,{className:t.selectionWrapper},r)}renderSelection(){let t=e.classNames,n=[],r=[t.selection],i=this._sheet.select();return r=r.concat(this._activeFormulaColor()),i.size()===1&&r.push(`k-single-selection`),this._sheet.autoFillPunch()&&r.push(`k-dim-auto-fill-handle`),i.forEach(function(e){e!==B&&this._addDiv(n,e,r.join(` `))}.bind(this)),K.element(`div`,{className:t.selectionWrapper},n)}renderAutoFill(){let t=[];if(this._sheet.autoFillInProgress()){let e=this._sheet.autoFillRef(),n=this._sheet.autoFillPunch(),r=this._sheet._autoFillDirection;if(this._addDiv(t,e,`k-auto-fill`),n)this._addDiv(t,n,`k-auto-fill-punch`);else if(r!==void 0){let n,i;switch(r){case 0:n=e.bottomRight,i=`k-auto-fill-br-hint`;break;case 1:n=e.bottomRight,i=`k-auto-fill-br-hint`;break;case 2:n=new V(e.topLeft.row,e.bottomRight.col),i=`k-auto-fill-tr-hint`;break;case 3:n=new V(e.bottomRight.row,e.topLeft.col),i=`k-auto-fill-bl-hint`;break}let a=this._addDiv(t,n,i);if(a){let e=K.element(`span`,{className:`k-tooltip`},[K.text(this._sheet._autoFillHint)]);a.children.push(e)}}}return K.element(`div`,{className:e.classNames.autoFillWrapper},t)}_addDiv(e,t,n){let r=this._currentView,i;return r.ref.intersects(t)&&(i=this._rectangle(t).resize(1,1).toDiv(n),e.push(i)),i}_renderCustomEditorButton(e,t){let n=this,r=this._sheet.activeCellCustomEditor();if(r){let i=K.element(`div`,{className:`k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-spreadsheet-editor-button`,style:{left:t.left+t.width-20+`px`,top:t.top+1+`px`,height:t.height-2+`px`,width:`20px`}});return r.icon&&i.children.push(n.icon(r.icon)),e.push(i),!0}}_activeFormulaColor(){let e,t=[];return this._sheet.isInEditMode()&&(e=this._sheet._formulaSelections.filter(function(e){return e.active&&e.type===`ref`})[0],e&&t.push(e.colorClass)),t}_directionClasses(t){let n=[],r=e.classNames,i=this._currentView.ref;return t.move(0,-1).intersects(i)||n.push(r.left),t.move(-1,0).intersects(i)||n.push(r.top),t.move(0,1).intersects(i)||n.push(r.right),t.move(1,0).intersects(i)||n.push(r.bottom),n}_rectangle(e){return this._grid.boundingRectangle(e.toRangeRef()).offset(-this._currentView.mergedCellLeft,-this._currentView.mergedCellTop)}_buttonOutOfVisiblePane(e,t,n){let r=this,i=r._grid,a=r._sheet,o=a.range(e,t)._ref,s=i.scrollBoundaries(o),c=i.columns.frozen?0:n.scrollLeft;if(s.right+20>c||t+1===a.frozenColumns())return!0}};Nx.classNames=kx;function Px(e){[`N`,`NE`,`E`,`SE`,`S`,`SW`,`W`,`NW`].forEach(function(t){e.push(K.element(`div`,{className:`k-spreadsheet-drawing-handle `+t,"data-direction":t}))})}let Fx=[`font-family`,`font-size`,`font-stretch`,`font-style`,`font-weight`,`letter-spacing`,`text-transform`,`line-height`],Ix={27:`esc`,37:`left`,39:`right`,35:`end`,36:`home`,32:`spacebar`},Lx=/(^_|[^a-z0-9]$)/i;var Rx=class e extends ab{constructor(t,n){let r=Object.assign({},{name:`FormulaInput`,autoScale:!1,filterOperator:`startswith`,scalePadding:30,minLength:1,formulaBarWidth:null},n);super(t,r),this.events=[`keyup`,`focus`],this.input=n.input,t&&(this.bind(this.events,this.options),t.classList.add(e.classNames.wrapper),r&&r.formulaBarWidth,this._highlightedRefs=[],this._formulaSource(),this._formulaList(),this._tooltip(),this._sync=this._sync.bind(this),this.scale=this.scale.bind(this),this._keydown=this._keydown.bind(this),this._keyup=this._keyup.bind(this),this._blur=this._blur.bind(this),this._input=this._input.bind(this),this._focus=this._focus.bind(this),this._paste=this._paste.bind(this),this.options.autoScale&&t.addEventListener(`input`,this.scale),t.addEventListener(`keydown`,this._keydown),t.addEventListener(`keyup`,this._keyup),t.addEventListener(`blur`,this._blur),t.addEventListener(`input`,this._input),t.addEventListener(`click`,this._input),t.addEventListener(`focus`,this._focus),t.addEventListener(`paste`,this._paste))}enable(e){if(e===void 0)return this.element.getAttribute(`contenteditable`)===`true`;e?this.element.setAttribute(`contenteditable`,e):this.element.removeAttribute(`contenteditable`),this.element.classList.toggle(`k-disabled`,!e)}getPos(){let e=this.element,t=window.getSelection(),n=i(t.focusNode,t.focusOffset),r=i(t.anchorNode,t.anchorOffset);if(n!=null&&r!=null){if(n>r){let e=n;n=r,r=e}return{begin:n,end:r,collapsed:n===r}}function i(t,n){try{(function e(r){if(r===t)throw n;if(r.nodeType===1)for(let t=r.firstChild;t;t=t.nextSibling)e(t);else r.nodeType===3&&(n+=r.nodeValue.length)})(e)}catch(e){return e}}}setPos(e,t){let n=this.element;e=r(n,e),t=t==null?e:r(n,t),e&&t&&this._setRange(e,t);function r(e,t){try{(function e(n){if(n.nodeType===3){let e=n.nodeValue.length;if(e>=t)throw n;t-=e}else if(n.nodeType===1)for(let t=n.firstChild;t;t=t.nextSibling)e(t)})(e)}catch(e){return{node:e,pos:t}}}}end(){this.setPos(this.length())}home(){this.setPos(0)}select(){this.setPos(0,this.length())}length(){return this.value().length}_setRange(e,t){let n=document.createRange();n.setStart(e.node,e.pos),n.setEnd(t.node,t.pos);let r=window.getSelection();i(n,r.getRangeAt(0))&&(r.removeAllRanges(),r.addRange(n));function i(e,t){return e.startOffset!==t.startOffset||e.endOffset!==t.endOffset||e.startContainer!==t.endContainer||e.endContainer!==t.endContainer}}_formulaSource(){let e=[],t;for(let n in G.runtime.FUNCS)Lx.test(n)||(t=n.toUpperCase(),e.push({value:t,text:t}));this.formulaSource=e}get list(){return this.input.current.list}get popup(){return this.input.current.popup}_formulaList(){this.list.data(this.formulaSource),this.list.itemClick(e=>{this._formulaListChange(e)})}_formulaListChange(e){let t=this._tokenContext();if(!t||this._mute)return;let n=t.token,r=e,i={replace:!0,token:n,end:n.end};(!t.nextToken||t.nextToken.value!==`(`)&&(r+=`(`),this._replaceAt(i,r),this.popup.close()}_blur(){this.popup.close(),clearTimeout(this._focusId),this.trigger(`blur`)}_isFormula(){return/^=/.test(this.value())}_keydown(e){let t=e.keyCode,n=this;Ix[t]?(n.popup.close(),n._navigated=!0):n._move(t)&&(n._navigated=!0,e.preventDefault()),n._keyDownTimeout=setTimeout(n._syntaxHighlight.bind(n))}_keyup(){let e=this.popup,t;if(this._isFormula()&&!this._navigated){t=((this._tokenContext()||{}).token||{}).value;let n=this.filter(t);!t||!n.length?e.close():(e[e.visible()?`position`:`open`](),setTimeout(()=>{this.list.focusFirst()},0))}this._navigated=!1,this._syntaxHighlight(),this.trigger(`keyup`)}_input(){this._syntaxHighlight()}_focus(){setTimeout(this._sync.bind(this)),this._focusTimeout=setTimeout(this._syntaxHighlight.bind(this)),this.trigger(`focus`)}_paste(e){e.preventDefault();let t=this.getPos(),n;n=e.clipboardData.getData(`text/plain`);let r=this.value();r=r.substr(0,t.begin)+n+r.substr(t.end),this.value(r),this.setPos(t.begin+n.length),this.scale()}_move(e){let t=this.list,n=this.popup;if(n.visible()){if(e===jp.DOWN)return t.focusNext(),!0;if(e===jp.UP)return t.focusPrev(),!0;if(e===jp.ENTER||e===jp.TAB){let e=typeof t.focusIndex==`function`?t.focusIndex():t.focus();return t.data()[e]&&this._formulaListChange(t.data()[e].value),n.close(),!0}if(e===jp.PAGEUP)return t.focusFirst(),!0;if(e===jp.PAGEDOWN)return t.focusLast(),!0}return!1}_tokenContext(){let e=this.getPos(),t=this.value();if(!t||!e||!e.collapsed)return null;let n=G.tokenize(t,this.row(),this.col()),r;for(let t=0;t<n.length;++t)if(r=n[t],Hx(r,e)&&/^(?:str|sym|func)$/.test(r.type))return{token:r,nextToken:n[t+1]};return null}_sync(){this._editorToSync&&this.isActive()&&this._editorToSync.value(this.value())}_textContainer(){let e=Jp(this.element,Fx);e.position=`absolute`,e.visibility=`hidden`,e.whiteSpace=`pre`,e.top=-3333,e.left=-3333,this._span=document.createElement(`span`),this._span.style.whiteSpace=`pre`;for(let t in e)Object.hasOwnProperty.call(e,t)&&(this._span.style[t]=e[t]);Yp(this._span,this.element)}_tooltip(){this._cellTooltip=document.createElement(`div`),this._cellTooltip.className=`k-widget k-tooltip`,this._cellTooltip.style.position=`absolute`,this._cellTooltip.style.display=`none`,this._cellTooltip.appendChild(document.createTextNode(`A1`)),Yp(this._cellTooltip,this.element)}tooltip(e){for(;this._cellTooltip.firstChild;)this._cellTooltip.removeChild(this._cellTooltip.firstChild);this._cellTooltip.appendChild(document.createTextNode(e))}toggleTooltip(e){this._cellTooltip.style.display=e?``:`none`}isActive(){return this.element===Xp()}filter(e){if(!e||e.length<this.options.minLength)return;let t=this.formulaSource.filter(t=>String(t.value).toLowerCase().startsWith(e.toLowerCase()));return this.list.data(t),t}hide(){this.enable(!1),this.element.style.display=`none`,this._cellTooltip.style.display=`none`}show(){this.enable(!0),this.element.style.display=`block`}row(){if(this.activeCell)return this.activeCell.row}col(){if(this.activeCell)return this.activeCell.col}position(e){e&&(this.show(),this.element.style.top=e.top+1+`px`,this.element.style.left=e.left+1+`px`,this._cellTooltip.style.top=e.top-this._cellTooltip.offsetHeight-10+`px`,this._cellTooltip.style.left=e.left+`px`)}resize(e){e&&(this.element.style.width=e.width-1+`px`,this.element.style.height=e.height-1+`px`)}canInsertRef(e){return this._canInsertRef(e)}_canInsertRef(e){if(this.popup.visible())return null;let t=e,n=this.getPos(),r,i,a;if(n&&this._isFormula()){if(n.begin===0)return null;for(r=G.tokenize(this.value(),this.row(),this.col()),a=0;a<r.length;++a){if(i=r[a],Hx(i,n))return s(i);if(o(i))return c(r[a-1],i)}return c(i,null)}return null;function o(e){return e.begin>n.begin}function s(e){if(e){if(/^(?:num|str|bool|sym|ref)$/.test(e.type))return{replace:!0,token:e,end:e.end};if(/^(?:op|punc|startexp)$/.test(e.type))return e.end===n.end?c(e,r[a+1]):c(r[a-1],e)}}function c(e,r){if(e==null)return null;if(r==null)return/^(?:op|startexp)$/.test(e.type)||zx(e.value)?{token:e,end:n.end}:null;if(t){if(e.type===`op`&&/^(?:punc|op)$/.test(r.type))return{token:e,end:n.end}}else{if(e.type===`startexp`||/^(?:op|punc)$/.test(e.type)&&/^[,;({]$/.test(e.value))return{token:e,end:n.end};if(/^(?:ref|sym)/.test(e.type))return{token:e,replace:!0,end:e.end};if(/^(?:ref|sym)/.test(r.type))return{token:r,replace:!0,end:r.end}}return!1}}refAtPoint(e){let t=this._canInsertRef();if(t){let n=e.selection()._ref.simplify().clone().relative(0,0,3);e.isMerged(n)&&(n=n.topLeft),e!==this.activeSheet&&(n=n.setSheet(e.name(),!0)),this._replaceAt(t,n.print(0,0))}}_replaceAt(e,t){let n=this.value(),r=e.token,i=n.substr(e.end);n=n.substr(0,e.replace?r.begin:e.end)+t;let a=n.length;n+=i,this._value(n),this.setPos(a),this.scale(),this._syntaxHighlight()}syncWith(e){this._editorToSync=e,this.element&&(this.element.removeEventListener(`input`,this._sync),this.element.addEventListener(`input`,this._sync))}scale(){let e=this.element,t,n;this._span||this._textContainer(),this._span.innerHTML=e.innerHTML,t=this._span.offsetWidth+this.options.scalePadding,n=this._span.offsetHeight,t>e.offsetWidth&&(e.style.width=t+`px`),n-1>e.offsetHeight&&(e.style.height=n-1+`px`),this._sync()}_value(e){if((this.element.innerText||this.element.textContent).replace(/\n$/,``)!==e){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.appendChild(document.createTextNode(e))}}value(e){let t=(this.element.innerText||this.element.textContent).replace(/\n$/,``);if(e===void 0)return t;t!==e&&(this._value(e),this._syntaxHighlight())}highlightedRefs(){return this._highlightedRefs.slice()}_syntaxHighlight(){let e=this.getPos(),t=this.value(),n=Nx.classNames.series,r=[],i=0,a=[],o=[];if(!(e&&!e.collapsed)){if(/^=/.test(t))o=G.tokenize(t,this.row(),this.col()),o.forEach(function(t){if(t.active=!1,t.cls=[`k-syntax-`+t.type],t.type===`ref`&&(t.colorClass=n[i++%n.length],t.cls.push(t.colorClass),r.push(t)),e&&t.type===`punc`){if(zx(t.value))a.unshift(t);else if(Bx(t.value)){let n=a.shift();n?Vx(t.value,n.value)?(Hx(t,e)||Hx(n,e))&&(t.cls.push(`k-syntax-paren-match`),n.cls.push(`k-syntax-paren-match`)):(t.cls.push(`k-syntax-error`),n.cls.push(`k-syntax-error`)):t.cls.push(`k-syntax-error`)}}e&&Hx(t,e)&&(t.cls.push(`k-syntax-at-point`),t.active=!0),t.type===`func`&&!Ux(t.value)&&(!e||!Hx(t,e))&&t.cls.push(`k-syntax-error`)}),o.reverse().forEach(function(e){let n=e.begin,r=e.end,i=mb(t.substring(n,r));t=t.substr(0,n)+`<span class='`+e.cls.join(` `)+`'>`+i+`</span>`+t.substr(r)}),this.element.innerHTML=t;else{this._highlightedRefs.length&&(this._highlightedRefs=[],this._value(t));return}e&&this.setPos(e.begin,e.end),this._highlightedRefs=r}}destroy(){this._editorToSync=null,this.element.removeEventListener(`input`,this.scale),this.element.removeEventListener(`keydown`,this._keydown),this.element.removeEventListener(`keyup`,this._keyup),this.element.removeEventListener(`blur`,this._blur),this.element.removeEventListener(`input`,this._input),this.element.removeEventListener(`click`,this._input),this.element.removeEventListener(`focus`,this._focus),this.element.removeEventListener(`paste`,this._paste),clearTimeout(this._focusTimeout),clearTimeout(this._keyDownTimeout),this._cellTooltip=null,this._span=null,super.destroy()}insertNewline(){let e=this.value(),t=this.getPos(),n=t.end===e.length;e=e.substr(0,t.begin)+(n?`

`:`
`+e.substr(t.end)),this.value(e),this.setPos(t.begin+1)}};Rx.classNames={wrapper:`k-spreadsheet-formula-input`,listWrapper:`k-spreadsheet-formula-list`};function zx(e){return e===`(`||e===`[`||e===`{`}function Bx(e){return e===`)`||e===`]`||e===`}`}function Vx(e,t){return t===`(`?e===`)`:t===`[`?e===`]`:t===`{`&&e===`}`}function Hx(e,t){return e.begin<=t.begin&&e.end>=t.end}function Ux(e){return G.runtime.FUNCS[e.toLowerCase()]}var Wx=class extends ab{constructor(e,t){super(e,t);let n=e&&e.querySelector(`.k-spreadsheet-formula-input:not(.k-spreadsheet-cell-editor)`);this.formulaInput=new Rx(n,this.options)}destroy(){this.formulaInput&&this.formulaInput.destroy(),this.formulaInput=null}},Gx=class extends ab{readData(){let e=[];return this._workbook.forEachName(function(t){!t.hidden&&t.value instanceof z&&e.push({name:t.name})}),e}value(e){if(this.options.combobox.current)return this.options.combobox.current.value(e)}},Kx=class extends ab{constructor(e,t){super(e,Object.assign({},{name:`SheetsBar`},t)),this.events=[`select`,`reorder`,`rename`]}onSheetReorderEnd(e){this.trigger(`reorder`,{oldIndex:e.oldIndex,newIndex:e.newIndex})}onSheetRemove(e){this.trigger(`remove`,{name:e,confirmation:!0})}onSheetSelect(e){this.trigger(`select`,{name:e,isAddButton:!1})}onSheetRename(e,t){this.trigger(`rename`,{name:e,sheetIndex:t})}onAddSelect(){this.trigger(`select`,{isAddButton:!0})}destroy(){super.destroy()}};function qx(e){let t=window.getSelection();t.removeAllRanges();let n=document.createRange();n.selectNodeContents(e),t.addRange(n)}function Jx(e,t){let n=e.trs[t].children;return n[n.length-2]}function Yx(e,t){let n=e.trs[t-1],r=e.trs[t].children.length-1;if(n&&r>=0)return n.children[r]}function Xx(e,t,n){let r={};n.background&&(r.backgroundColor=n.background),n.color&&(r.color=n.color),n.fontFamily&&(r.fontFamily=n.fontFamily),n.underline&&(r.textDecoration=`underline`),n.italic&&(r.fontStyle=`italic`),n.textAlign&&(r.textAlign=n.textAlign),n.verticalAlign&&(r.verticalAlign=n.verticalAlign===`center`?`middle`:n.verticalAlign),n.bold&&(r.fontWeight=`bold`),n.fontSize&&(r.fontSize=n.fontSize+`px`),n.wrap===!0&&(r.whiteSpace=`pre-wrap`),n.borderRight?r.borderRight=Ax(n.borderRight):n.background&&(r.borderRightColor=n.background),n.borderBottom?r.borderBottom=Ax(n.borderBottom):n.background&&(r.borderBottomColor=n.background);let i=n.value,a=typeof i,o=n.format;!o&&a===`number`&&i!==Math.floor(i)&&(o=`0.##############`),o&&i!=null&&(i=yh.format(i,o),i.__dataType&&(a=i.__dataType));let s={style:r};if(!r.textAlign)switch(a){case`number`:case`date`:case`percent`:case`currency`:r.textAlign=`right`;break;case`boolean`:r.textAlign=`center`;break}/^(?:string|undefined)$/.test(a)||(s.sdval=n.value,s[`data-sheets-value`]=JSON.stringify({1:3,3:n.value}),o&&(s.sdnum=o,s[`data-sheets-numberformat`]=JSON.stringify({1:2,2:o,3:1}))),n.formula&&(s[`data-sheets-formula`]=`=`+n.formula.print());let c=null;n.enable===!1&&(c=`k-disabled`);let l=e.addCell(t,i,s,c,n.validation),u,d;return n.borderLeft?(d=Jx(e,t),u=Ax(n.borderLeft),d&&u&&(d.attr.style.borderRight=u)):n.background&&(r.borderLeftColor=n.background),n.borderTop?(d=Yx(e,t),u=Ax(n.borderTop),d&&u&&(d.attr.style.borderBottom=u)):n.background&&(r.borderTopColor=n.background),l}var Zx=class{constructor(){this.cols=[],this.trs=[],this._height=0,this._width=0}addColumn(e){this._width+=e;let t=K.element(`col`,{style:{width:e+`px`}});t.visible=e>0,this.cols.push(t)}addRow(e){let t=null;t={style:{height:e+`px`}},this._height+=e;let n=K.element(`tr`,t);n.visible=e>0,this.trs.push(n)}addCell(e,t,n,r,i){t??=``,t instanceof K.Node||(t=K.text(t));let a=[t];i&&!i.value&&(a.push(K.element(`span`,{className:`k-dirty`})),r=(r||``)+(r?` `:``)+`k-dirty-cell`,n.title=i.message),r&&(n.className=r);let o=K.element(`td`,n,a);return this.trs[e].children.push(o),o}toDomTree(e,t,n){this.trs=this.trs.filter(function(e){return e.visible});let r=0;return this.cols=this.cols.filter(function(e,t){return e.visible||(this.trs.forEach(function(e){e.children.splice(t-r,1)}),r++),e.visible},this),K.element(`table`,{style:{left:e+`px`,top:t+`px`,height:this._height+`px`,width:this._width+`px`},className:n,role:`presentation`},[K.element(`colgroup`,null,this.cols),K.element(`tbody`,null,this.trs)])}};function Qx(e,t,n){return e>=t&&e<=n}var $x=class e extends ib{constructor(t,n){super();let r=e.classNames;if(this.element=t,this.options=Vp({},{messages:Op.view},this.options,n),this.events=[`update`,`message`],this._chrome(),this._dialogs=[],this._formulaInput(),this.wrapper=t.querySelector(`.`+r.view),this.container=t.querySelector(`.`+r.fixedContainer),this.scroller=t.querySelector(`.`+r.scroller),this.clipboard=t.querySelector(`.`+r.clipboard),this.viewSize=this.scroller?this.scroller.querySelector(`.k-spreadsheet-view-size`)||this.scroller.firstElementChild:null,!this.viewSize)throw Error(`The scroller element does not contain a view size element.`);this.tree=new K.Tree(this.container),this.clipboardContents=new K.Tree(this.clipboard),this.editor=new sb(this),this._sheetsbar(),this.options.createContextMenus?.()}enableClipboard(e){this.isClipboardDeactivated=!e,e?this.clipboard.setAttribute(`contenteditable`,e):this.clipboard.removeAttribute(`contenteditable`)}_resize(){}_chrome(){let e=this.element.querySelector(`.k-spreadsheet-name-editor`);this.nameEditor=new Gx(e,{combobox:this.options.nameBoxRef});let t=this.element.querySelector(`.k-spreadsheet-formula-bar`);this.formulaBar=new Wx(t,{input:this.options.formulaBarInputRef}),this._tabstrip()}_formulaInput(){let t=this.element.querySelector(`.`+e.classNames.cellEditor);this.formulaInput=new Rx(t,{autoScale:!0,input:this.options.formulaCellInputRef})}_sheetsbar(){this.options.sheetsbar&&(this.sheetsbar=new Kx(this.element.querySelector(`.`+e.classNames.sheetsBar),this.options.sheetsbar),this.options.createSheetBar?.(this.options.openDialogCallback))}_tabstrip(){this.tabstrip=this.options.createTabStrip?.()}_executeCommand(e){this._sheet.trigger(`commandRequest`,e)}workbook(e){this._workbook=e,e._view=this,this.nameEditor._workbook=e}sheet(e){this._sheet=e}activeCellRectangle(){return this.cellRectangle(this._sheet._viewActiveCell())}_rectangle(e,t){return e._grid.boundingRectangle(t.toRangeRef())}isColumnResizer(e,t,n){return e-=this._sheet._grid._headerWidth,t._grid.columns.frozen||(e+=this.scroller.scrollLeft),e+=t._grid.columns.hiddenSize(),n=this._sheet._grid._columns.locate(0,n,function(t){return Math.abs(e-t)<=7/2}),n!==null&&!this._sheet.isHiddenColumn(n)?n:null}isRowResizer(e,t,n){return e-=this._sheet._grid._headerHeight,t._grid.rows.frozen||(e+=this.scroller.scrollTop),e+=t._grid.rows.hiddenSize(),n=this._sheet._grid._rows.locate(0,n,function(t){return Math.abs(e-t)<=7/2}),n!==null&&!this._sheet.isHiddenRow(n)?n:null}isFilterIcon(e,t,n,r){let i=this,a=n._grid,o=a.rows.frozen?0:i.scroller.scrollTop,s=a.columns.frozen?0:i.scroller.scrollLeft;return e-=i._sheet._grid._headerWidth-s,t-=i._sheet._grid._headerHeight-o,Lp(function(a){i._sheet.forEachFilterHeader(r,function(r){let o=i._rectangle(n,r);n.filterIconRect(o).intersects(e,t)&&a(!0)})})}isAutoFill(e,t,n){let r=this._sheet.select();if(r.size>1)return!1;e-=this._sheet._grid._headerWidth,t-=this._sheet._grid._headerHeight,n._grid.columns.frozen||(e+=this.scroller.scrollLeft),n._grid.rows.frozen||(t+=this.scroller.scrollTop);let i=this._rectangle(n,r);return Math.abs(i.right-e)<8&&Math.abs(i.bottom-t)<8}isEditButton(e,t){if(this._sheet.activeCellCustomEditor()){let n=this.activeCellRectangle();if(t>=n.top&&t<=n.bottom)return e<n.right&&e>=n.right-20}}drawingAt(e,t,n){e-=this._sheet._grid._headerWidth,t-=this._sheet._grid._headerHeight,n._grid.columns.frozen||(e+=this.scroller.scrollLeft),n._grid.rows.frozen||(t+=this.scroller.scrollTop);let r=this._sheet,i=this._sheet._drawings;for(let n=i.length;--n>=0;){let a=i[n],o=r.drawingBoundingBox(a);if(o.intersects(e,t))return{drawing:a,drx:o.left-e,dry:o.top-t}}}objectAt(e,t,n){let r=this._sheet._grid,i,a;if(e<0||t<0||e>this.scroller.clientWidth||t>this.scroller.clientHeight)i={type:`outside`};else if(e<r._headerWidth&&t<r._headerHeight)i={type:`topcorner`};else if(a=this.paneAt(e,t),!a)i={type:`outside`};else{if(!n){let n=this.drawingAt(e,t,a);if(n)return{type:`drawing`,drawing:n.drawing,drx:n.drx,dry:n.dry,pane:a,startX:e,startY:t}}let o=a._grid.rows.indexVisible(t,this.scroller.scrollTop),s=a._grid.columns.indexVisible(e,this.scroller.scrollLeft),c=`cell`,l=new V(o,s),u=this._sheet.selectionInProgress();this.isAutoFill(e,t,a)?c=`autofill`:this.isFilterIcon(e,t,a,l)?c=`filtericon`:!u&&e<r._headerWidth?(c=`rowheader`,(o=this.isRowResizer(t,a,o))!==null&&(l=new V(o,-1/0),c=`rowresizehandle`)):!u&&t<r._headerHeight?(c=`columnheader`,(s=this.isColumnResizer(e,a,s))!==null&&(l=new V(-1/0,s),c=`columnresizehandle`)):this.isEditButton(e,t)&&(c=`editor`),i={type:c,ref:l}}return i.pane=a,i.x=e,i.y=t,i}paneAt(e,t){return this.panes.filter(function(n){let r=n._grid;return Qx(t,r.top,r.bottom)&&Qx(e,r.left,r.right)})[0]}containingPane(e){return this.panes.filter(function(t){return!!t._grid.contains(e)})[0]}cellRectangle(e){let t=this.containingPane(e)._grid;return this._sheet._grid.rectangle(e).offset(t.headerWidth-t.columns.hiddenSize()-(t.columns.frozen?0:this.scroller.scrollLeft),t.headerHeight-t.rows.hiddenSize()-(t.rows.frozen?0:this.scroller.scrollTop))}refresh(e){let t=this._sheet,n=t._grid._panePosition||{},r=this._hiddenFrozenSize(t._columns,t.frozenColumns(),n.columns),i=this._hiddenFrozenSize(t._rows,t.frozenRows(),n.rows);if(this.trigger(`update`,{reason:e,range:t.range(t.activeCell()),sheet:t}),this._resize(),this.viewSize.style.height=t._grid.totalHeight()-i+`px`,this.viewSize.style.width=t._grid.totalWidth()-r+`px`,e.layout){let e=t.frozenColumns(),n=t.frozenRows();this.panes=[this._pane(n,e)],e>0&&this.panes.push(this._pane(n,0,null,e)),n>0&&this.panes.push(this._pane(0,e,n,null)),n>0&&e>0&&this.panes.push(this._pane(0,0,n,e))}e.filter&&this._destroyFilterMenu(),e.activeCell&&(this._focus=t.activeCell().toRangeRef())}_hiddenFrozenSize(e,t,n){let r;return!t||(r=e.sum(0,t-1),n==null)?0:Math.max(0,r-n)}createFilterMenu(e){this._destroyFilterMenu();let t=this._sheet,n=t.filter().ref,r={column:e,range:new X(n,t)};return this._filterMenu=this.options.createFilterMenu(r),this._filterMenu}selectClipboardContents(){this.isClipboardDeactivated||(this.clipboard.focus({preventScroll:!0}),qx(this.clipboard))}scrollIntoView(e){let t=!1,n=this.containingPane(e)._grid,r=n.scrollBoundaries(e),i=this.scroller,a=n.rows.frozen?0:i.scrollTop,o=n.columns.frozen?0:i.scrollLeft;return r.top<a&&(t=!0,i.scrollTop=r.scrollTop),r.bottom>a&&(t=!0,i.scrollTop=r.scrollBottom),r.left<o&&(t=!0,i.scrollLeft=r.scrollLeft),r.right>o&&(t=!0,i.scrollLeft=r.scrollRight),t}_destroyDialog(){this._dialogs.pop()}openCustomEditor(){let e=this,t=e._sheet.activeCell().first(),n=e._sheet.activeCellCustomEditor(),r=e._sheet.range(t);n.edit({range:r,rect:e.activeCellRectangle(),view:this,validation:this._sheet.validation(t),callback:function(t,n){e._executeCommand({command:`EditCommand`,options:{operatingRange:r,editRange:r,property:n?`input`:`value`,value:t}})}})}openDialog(e,t){let n=this._sheet;return n.withCultureDecimals(function(){let r=n.activeCell(),i=new X(r,n),a={...t,name:e,ref:r,range:i};return this.trigger(`message`,a),a.dialog}.bind(this))}showError(e,t){let n=this._dialogs,r=this.options.messages.errors;if(n.length>0)return;let i=function(){n.pop(),this.selectClipboardContents(),t&&t()}.bind(this),a={title:e.title||`Error`,text:e.body?e.body:r[e.type],close:i};n.push(a),this.openDialog(e.type||`message`,a)}destroy(){this.unbind(),[this.tree,this.clipboardContents].forEach(e=>{for(;e&&e.root&&e.root.lastChild;)e.root.removeChild(e.root.lastChild)}),this.tree=this.clipboardContents=null,this.tabstrip&&=(this.tabstrip.destroy(),null),this._destroyFilterMenu()}_destroyFilterMenu(){this._filterMenu&&=(this._filterMenu.destroy(),void 0)}render(t){let n=this._sheet,r=n.focus(),i=Gp(),a=this.wrapper.clientWidth-i,o=this.wrapper.clientHeight-i;if(r&&this.scrollIntoView(r))return;let s=n.resizingInProgress()?n.resizeHandlePosition().col===-1/0?`column`:`row`:`none`;this.wrapper.classList.toggle(Ox.editContainer,this.editor.isActive()),this.wrapper.classList.toggle(Ox.horizontalResize,s===`row`),this.wrapper.classList.toggle(Ox.verticalResize,s===`column`);let c=n._grid,l=[],u={scroller:this.scroller,toplevelElements:l,contentWidth:a,contentHeight:o};this.panes.forEach(function(e){l.push(e.render(u))});let d=K.element(`div`,{style:{width:c._headerWidth+`px`,height:c._headerHeight+`px`},className:e.classNames.topCorner});l.push(d),n.resizeHandlePosition()&&n.resizeHintPosition()&&l.push(this.renderResizeHint()),this.tree.render(l),this.container.style.width=a+`px`,this.container.style.height=o+`px`,this.editor.isActive()?this.editor.toggleTooltip(this.activeCellRectangle()):t.resize||t.comment||n.selectionInProgress()||n.resizingInProgress()||n.draggingInProgress()||n.isInEditMode()||this.renderClipboardContents()}renderResizeHint(){let e=this._sheet,t=e.resizeHandlePosition().col!==-1/0,n;n=t?{height:this.scroller.clientHeight+`px`,width:`7px`,left:e.resizeHintPosition().x+`px`,top:`0px`}:{height:`7px`,width:this.scroller.clientWidth+`px`,top:e.resizeHintPosition().y+`px`,left:`0px`};let r=Nx.classNames;return K.element(`div`,{className:r.resizeHint+(t?``:` `+r.resizeHintVertical),style:n},[K.element(`div`,{className:r.resizeHintHandle}),K.element(`div`,{className:r.resizeHintMarker})])}renderClipboardContents(){let e=this._sheet,t=e._grid,n=t.normalize(e.select().toRangeRef()),r=this._workbook.clipboard().canCopy();if(r.canCopy===!1&&r.multiSelection){this.clipboardContents.render([]),this.selectClipboardContents();return}n=e.trim(n);let i=new Zx,a=t.rangeDimensions(n);a.rows.forEach(function(e){i.addRow(e)}),a.columns.forEach(function(e){i.addColumn(e)});let o=e._getMergedCells(n),s=o.primary,c=o.secondary;e.forEach(n,function(e,t,r){let a=new V(e,t).print();if(!c[a]){let t=Xx(i,e-n.topLeft.row,r),o=s[a];o&&(t.attr.colspan=o.width(),t.attr.rowspan=o.height())}}),this.clipboardContents.render([i.toDomTree(0,0,`kendo-clipboard-`+this._workbook.clipboard()._uid)]),this.selectClipboardContents()}_pane(e,t,n,r){let i=new Nx(this._sheet,this._sheet._grid.pane({row:e,column:t,rowCount:n,columnCount:r}),this.options.getIconHTMLString);return i.refresh(this.scroller.clientWidth,this.scroller.clientHeight),i}};$x.classNames=Ox;let eS=/<table [^>]*>/gim,tS=e=>(e||``).match(eS)||[];var nS=class{constructor(e){this._content={},this._externalContent={},this._internalContent={},this.workbook=e,this.origin=B,this.iframe=document.createElement(`iframe`),this.iframe.className=`k-spreadsheet-clipboard-paste`,this.iframe.setAttribute(`title`,`Spreadsheet clipboard iframe`),this.menuInvoked=!1,this._uid=Up(),document.body.appendChild(this.iframe)}destroy(){this.iframe&&this.iframe.parentNode&&this.iframe.parentNode.removeChild(this.iframe)}canCopy(){let e={canCopy:!0},t=this.workbook.activeSheet().select();return t===B&&(e.canCopy=!1),t instanceof U&&(e.canCopy=!1,e.multiSelection=!0),this.menuInvoked&&(e.canCopy=!1,e.menuInvoked=!0),e}canPaste(){let e=this.workbook.activeSheet(),t=this.pasteRef(),n=e.range(t),r={canPaste:!0,pasteOnMerged:!1,pasteOnDisabled:!1};return n.enable()||(r.canPaste=!1,r.pasteOnDisabled=!0),t.eq(e.unionWithMerged(t))||(r.canPaste=!1,r.pasteOnMerged=!0),this.menuInvoked&&(r.canPaste=!1,r.menuInvoked=!0),r}intersectsMerged(){let e=this.workbook.activeSheet();this.parse(),this.origin=this._content.origRef;let t=this.pasteRef();return!t.eq(e.unionWithMerged(t))}copy(){let e=this.workbook.activeSheet();this.origin=e.select(),this._internalContent=e.selection().getState(),delete this._externalContent.html,delete this._externalContent.plain}cut(){let e=this.workbook.activeSheet();this.copy(),e.range(e.select()).clear()}pasteRef(){let e=this.workbook.activeSheet();if(this.origin===B)return e.select();let t=e.activeCell().first(),n=this.origin.first(),r=n.row-t.row,i=n.col-t.col;return this.origin.relative(r,i,3)}paste(){let e=this.workbook.activeSheet(),t=this.pasteRef();(t.bottomRight.row>=e._rows._count||t.bottomRight.col>=e._columns._count)&&e.resize(Math.max(t.bottomRight.row+1,e._rows._count),Math.max(t.bottomRight.col+1,e._columns._count)),e.range(t).setState(this._content,this),e.triggerChange({recalc:!0,ref:t})}external(e){if(e&&(e.html||e.plain))this._externalContent=e;else return this._externalContent}isExternal(){return!this._isInternal()}parse(){let e;if(this._isInternal())e=this._internalContent;else{let t=this._externalContent;if(e=t.plain?uS(t.plain):rS(),t.html){let n=this.iframe.contentWindow.document,r=new DOMParser().parseFromString(t.html,`text/html`),i=r.querySelector(`table`),a=r.head.querySelector(`meta[name=ProgId]`)?.getAttribute(`content`);n.open(),n.write(`<html><head></head><body></body></html>`),n.close(),i&&n.body.appendChild(n.importNode(i,!0));let o=n.querySelector(`table`);if(o){let t=lS(o,a);t.data.forEach(function(t,n){t.forEach(function(t,r){/^\s*#+\s*$/.test(t.value)&&(t.value=e.data[n][r].value)})}),e=t}}this.origin=e.origRef}this._content=e}_isInternal(){if(this._externalContent.html===void 0)return!0;let e=`kendo-clipboard-`+this._uid,t=t=>t.some(t=>t.includes(e));return t(tS(this._externalContent.html))||t(tS(this._externalContent.plain))}};function rS(){let e=new V(0,0,0);return{ref:e,mergedCells:[],data:[],foreign:!0,origRef:e.toRangeRef()}}function iS(e,t,n,r){let i=e.data||=[];i[t]||(i[t]=[]),i[t][n]=r;let a=e.origRef.bottomRight;a.row=Math.max(a.row,t),a.col=Math.max(a.col,n)}function aS(e){return e.replace(/^-(?:ms|moz|webkit)-/,``)}function oS(e){switch(e){case`start`:return`left`;case`end`:return`right`}return e}function sS(e,t){e.className||(t=e.style);let n={};return[`borderBottom`,`borderRight`,`borderLeft`,`borderTop`].forEach(function(e){let r=t[e+`Width`];r&&=parseInt(r,10),r&&(n[e]={size:r,color:t[e+`Color`]||`#000`})}),n}function cS(e,t,n,r,i,a){let o=window.getComputedStyle(n),s=typeof a==`string`&&a.indexOf(`Excel`)>-1,c,l,u;!s&&(c=n.getAttribute(`data-sheets-value`))&&(c=JSON.parse(c),c=c[c[1]]),!s&&(l=n.getAttribute(`data-sheets-numberformat`))&&(l=JSON.parse(l),l=l[l[1]]),u=n.getAttribute(`data-sheets-formula`),!s&&c==null&&l==null&&u==null&&(c=n.getAttribute(`sdval`),l=n.getAttribute(`sdnum`),l&&=l.replace(/^1033;(?:0;)?/,``)),c??=(n.innerText||n.textContent).replace(/\t$/,``);let d=sS(n,o),f={value:c===``?null:c,formula:u,borderTop:d.borderTop||r.get(e,t)||null,borderBottom:d.borderBottom||r.get(e+1,t)||null,borderLeft:d.borderLeft||i.get(e,t)||null,borderRight:d.borderRight||i.get(e,t+1)||null,fontSize:parseInt(o.fontSize,10)};l!=null&&(f.format=l),r.set(e,t,f.borderTop),r.set(e+1,t,f.borderBottom),i.set(e,t,f.borderLeft),i.set(e,t+1,f.borderRight),o.backgroundColor!==`rgb(0, 0, 0)`&&o.backgroundColor!==`rgba(0, 0, 0, 0)`&&(f.background=o.backgroundColor),aS(o.textAlign)!==`right`&&(f.textAlign=oS(aS(o.textAlign))),o.verticalAlign!==`middle`&&(f.verticalAlign=o.verticalAlign),o.wordWrap!==`normal`&&(f.wrap=!0);let p=n.querySelector(`font`);return p&&(o=window.getComputedStyle(p)),o.color!==`rgb(0, 0, 0)`&&o.color!==`rgba(0, 0, 0, 0)`&&(f.color=o.color),/^underline/.test(o.textDecoration)&&(f.underline=!0),o.fontStyle==`italic`&&(f.italic=!0),/^(?:bold|[67]00)$/i.test(o.fontWeight)&&(f.bold=!0),f}function lS(e,t){let n=rS(),r=[],i=0,a=0;for(let t=0;t<e.rows.length;++t)r.push([]);let o=new G.runtime.Matrix,s=new G.runtime.Matrix;for(let c=0;c<e.rows.length;++c,++i){let l=e.rows[c];a=0;for(let e=0;e<l.cells.length;++e){let c=l.cells[e],u=c.rowSpan,d=c.colSpan;for(;r[i][a];)a++;let f=c.getAttribute(`style`),p=/mso-ignore:colspan/.test(f);iS(n,i,a,cS(i,a,c,o,s,t)),(u>1||d>1&&!p)&&n.mergedCells.push(new H(new V(i,a),new V(i+u-1,a+d-1)).toString());for(let e=i+u;--e>=i;)for(let t=a+d;--t>=a;)e<r.length&&(r[e][t]=!0,(e!==i||t!==a)&&iS(n,e,t,{}))}}return n}function uS(e){let t=rS();if(e.indexOf(`	`)===-1&&e.indexOf(`
`)===-1)iS(t,0,0,{value:e});else{let n=e.split(`
`);for(let e=0;e<n.length;e++){let r=n[e].split(`	`);for(let n=0;n<r.length;n++)iS(t,e,n,{value:r[n]})}}return t}let dS={AUTO_FILL:`autoFill`,CLEAR:`clear`,CUT:`cut`,EDIT:`edit`,PASTE:`paste`,VALIDATION:`validation`},fS=()=>{};var Q=class{constructor(e){this.options=e,this._workbook=e.workbook,this._property=e&&e.property,this._state={}}range(e){return e!==void 0&&this._setRange(e),this._range}_setRange(e){this._range=e}redo(){this.range().select(),this.exec()}undo(){this.setState(this._state)}getState(){this._state=this.range().getState(this._property)}setState(e){this.range().setState(e)}rejectState(e){return this.undo(),{title:e.title,body:e.message,reason:`error`,type:`validationError`}}_forEachCell(e){let t=this.range();t._ref.forEach(function(n){t.sheet().forEach(n.toRangeRef(),e.bind(this))}.bind(this))}usesImage(){return!1}},pS=class extends Q{constructor(e){super(e),this._sheet=e.sheet,this._drawing=e.drawing,this._orig=this._drawing.clone(),this._previous=e.previous}exec(){}undo(){this._drawing.reset(this._previous),this._sheet._activeDrawing=this._drawing,this._sheet.triggerChange({layout:!0})}redo(){this._drawing.reset(this._orig),this._sheet._activeDrawing=this._drawing,this._sheet.triggerChange({layout:!0})}usesImage(e){return this._drawing.image===e||this._orig.image===e||this._previous.image===e}},mS=class extends Q{constructor(e){super(e),this._drawing=e.drawing}usesImage(e){return this._drawing.image===e}},hS=class extends mS{constructor(e){super(e),this._blob=e.blob,this._width=e.width,this._height=e.height}exec(){let e=this.range(),t=e.sheet(),n=this._width,r=this._height,i=n/r;n>r?(n=Math.min(n,300),r=n/i):(r=Math.min(r,300),n=r*i),this._drawing=t.addDrawing({topLeftCell:e.topLeft(),offsetX:5,offsetY:5,width:n,height:r,opacity:1,image:this._workbook.addImage(this._blob)},!0),this._blob=null}undo(){let e=this.range().sheet();e._activeDrawing=null,e.removeDrawing(this._drawing)}redo(){let e=this.range().sheet();e._activeDrawing=this._drawing,e.addDrawing(this._drawing)}},gS=class extends mS{exec(){let e=this.range().sheet();e._activeDrawing=null,e.removeDrawing(this._drawing)}undo(){let e=this.range().sheet();e._activeDrawing=this._drawing,e.addDrawing(this._drawing)}redo(){this.exec()}},_S=class extends mS{exec(){let e=this.range().sheet();this._origIndex=e._drawings.indexOf(this._drawing),e._drawings.splice(this._origIndex,1),this._newIndex=this._reorder(),e._drawings.splice(this._newIndex,0,this._drawing),e.triggerChange({drawings:!0})}undo(){let e=this.range().sheet();e._drawings.splice(this._newIndex,1),e._drawings.splice(this._origIndex,0,this._drawing),e.triggerChange({drawings:!0})}},vS=class extends _S{_reorder(){return this.range().sheet()._drawings.length}},yS=class extends _S{_reorder(){return 0}},bS=class extends Q{constructor(e){super(e),this._target=e.target,this._value=e.value}exec(){this.getState(),this.setState(this._value)}},xS=class extends bS{getState(){this._state=this.range().sheet().columnWidth(this._target)}setState(e){this.range().sheet().columnWidth(this._target,e)}},SS=class extends bS{getState(){this._state=this.range().sheet().rowHeight(this._target)}setState(e){this.range().sheet().rowHeight(this._target,e)}},CS=class extends Q{constructor(e){super(e),this._link=e.link}exec(){let e=this.range();this._prevLink=e.link(),this._prevUnderline=e.underline(),e.link(this._link),e.underline(!0),e.value()??(this._hasSetValue=!0,e.value(this._link))}undo(){let e=this.range();e.link(this._prevLink),e.underline(this._prevUnderline),this._hasSetValue&&e.value(null)}},wS=class extends bS{getState(){this._state=this._range.sheet().showGridLines()}setState(e){this._range.sheet().showGridLines(e)}},TS=class extends Q{_setRange(e){Q.prototype._setRange.call(this,e.skipHiddenCells())}constructor(e){super(e),this._value=e.value}exec(){let e=this.range();e.enable()&&(this.getState(),this.options.property===`format`&&this._workbook.trigger(`changeFormat`,{range:e}),e[this._property](this._value))}},ES=class extends TS{exec(){let e=this.range();e.enable()&&(this.getState(),e.clearFormat())}},DS=class extends Q{exec(){let e=[],t,n,r,i,a;if(!this.range().enable())return{reason:`error`,type:`cannotModifyDisabled`};if(!this.range().canEditArrayFormula())return{reason:`error`,type:`intersectsArray`};if(this.getState(),t=this.range().skipHiddenCells(),t._ref.refs&&t._ref.refs.length>1?t._ref.refs.forEach(function(n){a=t.sheet().range(n),e=e.concat(a.values())}):e=t.values(),r=[],e.forEach(function(e){n=[],e.forEach(function(){n.push(null)}),r.push(n)}),!t.sheet().trigger(`changing`,{data:r,range:t,changeType:dS.CLEAR})&&(t.clearContent(),i=t._getValidationState(),i))return this.rejectState(i)}undo(){let e=this.range().skipHiddenCells(),t=e.sheet(),n=this._state.data,r=[],i;n.forEach(function(e){i=[],e.forEach(function(e){i.push(e.value)}),r.push(i)}),!t.trigger(`changing`,{data:r,range:e,changeType:dS.CLEAR})&&this.setState(this._state)}},OS=class extends TS{constructor(e){e.property=e.property||`input`,super(e)}_setRange(e){TS.prototype._setRange.apply(this,arguments),this._editRange=this.options.arrayFormula?e:e.sheet().activeCellSelection()}getState(){this._state=this.range().getState()}exec(){return this.range().sheet().withCultureDecimals(this._exec.bind(this))}undo(){let e=this._editRange,t=this._state;e.sheet().trigger(`changing`,{data:t.data[0][0].value,range:e,changeType:dS.EDIT})||this.setState(this._state)}_exec(){let e=this.options.arrayFormula,t=this._editRange;if(!t.enable())return{reason:`error`,type:`rangeDisabled`};if(!t.canEditArrayFormula())return{reason:`error`,type:`intersectsArray`};let n=this._value;if(this.getState(),!this.range().sheet().trigger(`changing`,{data:n,range:this._editRange,changeType:dS.EDIT})){if(this._property===`value`){t.value(n);return}try{t.link(null),n===``?t.value(null):(t.input(n,{arrayFormula:e}),/\n/.test(t.value())&&t.wrap(!0)),t._adjustRowHeight();let r=t._getValidationState();if(r)return this.rejectState(r)}catch(e){if(e instanceof G.runtime.ParseError)return{title:`Error in formula`,body:e+``,reason:`error`};throw e}}}},kS=class extends TS{constructor(e){e.property=`comment`,super(e)}},AS=class extends TS{constructor(e){e.property=`wrap`,super(e),this._value=e.value}getState(){let e={};this.range().forEachRow(function(t){let n=t.topLeft().row;e[n]=t.sheet().rowHeight(n)}),this._state=this.range().getState(this._property),this._rowHeight=e}undo(){let e=this.range().sheet(),t=this._rowHeight;this.range().setState(this._state);for(let n in t)e.rowHeight(n,t[n])}},jS=class extends Q{constructor(e){e.property=`format`,super(e),this._delta=e.value}exec(){let e=this.range().sheet(),t=this._delta;this.getState(),e.batch(function(){this.range().forEachCell(function(n,r,i){let a=i.format;if(!a){let e=i.value;typeof e==`number`&&/\./.test(e)&&(a=`0.`+String(e).split(`.`)[1].replace(/\d/g,`0`))}(a||t>0)&&(a=yh.adjustDecimals(a||`0`,t),e.range(n,r).format(a))})}.bind(this))}},MS=class extends Q{constructor(e){e.property=`border`,super(e),this._type=e.border,this._style=e.style}_batch(e){return this.range().sheet().batch(e,{})}exec(){let e=this;e._type&&(e.getState(),e._batch(function(){e[e._type](e._style)}))}noBorders(){this.range().insideBorders(null),this.outsideBorders(null)}allBorders(e){this.range().insideBorders(e),this.outsideBorders(e)}leftBorder(e){this.range().leftColumn().borderLeft(e)}rightBorder(e){this.range().rightColumn().borderRight(e)}topBorder(e){this.range().topRow().borderTop(e)}bottomBorder(e){this.range().bottomRow().borderBottom(e)}outsideBorders(e){let t=this.range();t.leftColumn().borderLeft(e),t.topRow().borderTop(e),t.rightColumn().borderRight(e),t.bottomRow().borderBottom(e)}insideBorders(e){this.range().insideBorders(e),this.outsideBorders(null)}insideHorizontalBorders(e){this.range().insideHorizontalBorders(e)}insideVerticalBorders(e){this.range().insideVerticalBorders(e)}},NS=class extends Q{constructor(e){super(e),this._type=e.value}exec(){this.getState(),this[this._type](),this.range().sheet().triggerChange({recalc:!0})}activate(e){this.range().sheet().activeCell(e)}getState(){this._state=this.range().getState()}undo(){this._type!==`unmerge`&&(this.range().unmerge(),this.activate(this.range().topLeft())),this.range().setState(this._state)}cells(){let e=this.range(),t=e._ref;e.merge(),this.activate(t)}horizontally(){let e=this.range().topRow()._ref;this.range().forEachRow(function(e){e.merge()}),this.activate(e)}vertically(){let e=this.range().leftColumn()._ref;this.range().forEachColumn(function(e){e.merge()}),this.activate(e)}unmerge(){let e=this.range(),t=e._ref.topLeft;e.unmerge(),this.activate(t)}},PS=class extends Q{constructor(e){super(e),this._type=e.value}exec(){let e=this._scrollState();this.getState(),this._topLeft=this.range().topLeft(),this._setPanePosition(e),this[this._type](),this._restoreScrollState(e)}getState(){let e=this.range().sheet();this._state={sheet:e.getState(),panePosition:this._clonePanePosition(e._grid._panePosition)}}undo(){let e=this.range().sheet();e._grid._panePosition=this._clonePanePosition(this._state.panePosition),e.setState(this._state.sheet)}_scrollState(){let e=this._workbook&&this._workbook._view&&this._workbook._view.scroller;if(!e)return null;let t=this.range().sheet(),n=t._grid._panePosition;return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,frozenColumns:t.frozenColumns(),frozenRows:t.frozenRows(),visibleFrozenWidth:this._visibleFrozenSize(t._columns,t.frozenColumns(),n&&n.columns),visibleFrozenHeight:this._visibleFrozenSize(t._rows,t.frozenRows(),n&&n.rows)}}_setPanePosition(e){let t=this.range().sheet();if(!e){this._type===`unfreeze`&&(t._grid._panePosition=void 0);return}t._grid._panePosition=this._nextPanePosition(e)}_nextPanePosition(e){let t=this.range().sheet(),n=this._workbook&&this._workbook._view&&this._workbook._view.scroller,r=this._nextFrozenRows(e),i=this._nextFrozenColumns(e),a={};return r>0&&(a.rows=this._type===`rows`||this._type===`panes`?this._splitPosition(t._rows,e.visibleFrozenHeight,e.frozenRows,r,e.scrollTop,this._availablePaneSize(n&&n.clientHeight,t._grid._headerHeight)):e.visibleFrozenHeight),i>0&&(a.columns=this._type===`columns`||this._type===`panes`?this._splitPosition(t._columns,e.visibleFrozenWidth,e.frozenColumns,i,e.scrollLeft,this._availablePaneSize(n&&n.clientWidth,t._grid._headerWidth)):e.visibleFrozenWidth),r||i?a:void 0}_nextFrozenRows(e){return this._type===`panes`||this._type===`rows`?this._topLeft.row:this._type===`unfreeze`?0:e.frozenRows}_nextFrozenColumns(e){return this._type===`panes`||this._type===`columns`?this._topLeft.col:this._type===`unfreeze`?0:e.frozenColumns}_splitPosition(e,t,n,r,i,a){let o=this._axisSize(e,r),s=this._axisSize(e,n),c=t+o-s-i;return c=Math.max(0,Math.min(o,c)),typeof a==`number`&&(c=Math.min(c,a)),c}_availablePaneSize(e,t){return typeof e==`number`?Math.max(0,e-(t||0)):e}_restoreScrollState(e){if(!e)return;let t=this.range().sheet(),n=this._workbook&&this._workbook._view&&this._workbook._view.scroller,r=this._axisSize(t._columns,t.frozenColumns()),i=this._axisSize(t._rows,t.frozenRows()),a=t._grid._panePosition,o=this._visibleFrozenSize(t._columns,t.frozenColumns(),a&&a.columns),s=this._visibleFrozenSize(t._rows,t.frozenRows(),a&&a.rows);n&&(n.scrollLeft=Math.max(0,e.scrollLeft+this._axisSize(t._columns,e.frozenColumns)-e.visibleFrozenWidth+o-r),n.scrollTop=Math.max(0,e.scrollTop+this._axisSize(t._rows,e.frozenRows)-e.visibleFrozenHeight+s-i))}_axisSize(e,t){return t?e.sum(0,t-1):0}_visibleFrozenSize(e,t,n){let r=this._axisSize(e,t);return r?n==null?r:Math.min(r,Math.max(0,n)):0}_clonePanePosition(e){return e&&Object.assign({},e)}panes(){let e=this._topLeft;this.range().sheet().frozenColumns(e.col).frozenRows(e.row)}rows(){let e=this._topLeft;this.range().sheet().frozenRows(e.row)}columns(){let e=this._topLeft;this.range().sheet().frozenColumns(e.col)}unfreeze(){this.range().sheet().frozenRows(0).frozenColumns(0)}},FS=class extends Q{constructor(e){super(e),this._clipboard=e.workbook.clipboard(),this._clipboard.parse(),this._event=e.event,this._clipboardContent=this._clipboard._content,this._sheet=this._workbook.activeSheet(),this._range=this._sheet.selection?this._sheet.selection():this._sheet.range(this._clipboard.pasteRef()),this._state=this._range.getState(),this._targetRangeRefs=(this._range._ref instanceof U?this._range._ref.refs:[this._range._ref]).map(function(e){return e.toRangeRef()})}exec(){return this.range().sheet().withCultureDecimals(this._exec.bind(this))}undo(){let e=this._sheet,t=this._range;e.trigger(`changing`,{data:this._state.data,range:t,changeType:dS.PASTE})||this.setState(this._state)}_exec(){let e=this._clipboard.canPaste();if(!e.canPaste)return e.menuInvoked?{reason:`error`,type:`useKeyboard`}:e.pasteOnMerged?{reason:`error`,type:`modifyMerged`}:e.pasteOnDisabled?(this._event.preventDefault(),{reason:`error`,type:`cannotModifyDisabled`}):{reason:`error`};let t=this._sheet,n=this._range;if(this._workbook.trigger(`paste`,{range:n,clipboardContent:this._clipboardContent})||t.trigger(`changing`,{data:this._clipboardContent.data,range:n,changeType:dS.PASTE})){this._event.preventDefault();return}else this._processPaste()}_adjustPasteTarget(e,t,n){let r=this,i=r._targetRangeRefs,a=r._sheet,o=[],s=function(e,t){let n=0,r=e.topLeft,i=t.topLeft;return r.row>i.row?n=1:r.row<i.row?n=-1:r.col>i.col?n=1:r.col<i.col&&(n=-1),n},c,l,u,d,f,p,m;for(p=0;p<i.length;p+=1)u=i[p],f=e[p],d=u.topLeft,m={row:f.rows*t+d.row-1,col:f.cols*n+d.col-1},c=new H(d,m),o.push(c);o.length===1?l=a.range(c):(o.sort(s),l=a.range(new U(o))),l.select(),r._range=l,r._state=r._range.getState()}_processPaste(){let e=this,t=e._sheet,n=e._clipboardContent,r=e._range,i=n.data,a=i.length,o=i[0].length,s=e._targetRangeRefs,c=e._targetRanges(a,o),l,u=this._clipboard.pasteRef();(u.bottomRight.row>=t._rows._count||u.bottomRight.col>=t._columns._count)&&t.resize(Math.max(u.bottomRight.row+1,t._rows._count),Math.max(u.bottomRight.col+1,t._columns._count)),e._adjustPasteTarget(c,a,o),t.batch(function(){for(l=0;l<s.length;l++)e._populateTargetRange(s[l],a,o,c[l])},{recalc:!0,ref:e._range._ref}),r._adjustRowHeight()}_populateTargetRange(e,t,n,r){let i=e.topLeft,a,o,s;for(o=0;o<r.rows;o++)for(s=0;s<r.cols;s++)a=this._sheet.range(i.row+t*o,i.col+n*s),a.setState(this._clipboardContent,this._clipboard)}_targetRangeDimensions(e,t,n){let r=e.topLeft,i=e.bottomRight,a=i.row-r.row+1,o=i.col-r.col+1,s=1,c=1;return a%t===0&&o%n===0&&(s=a/t,c=o/n),{rows:s,cols:c}}_targetRanges(e,t){let n=this._targetRangeRefs,r=[],i;for(i=0;i<n.length;i++)r.push(this._targetRangeDimensions(n[i],e,t));return r}},IS=class extends Q{exec(){let e=this.options,t=this._workbook.activeSheet();(e.range||t.range(e.rowIndex))._adjustRowHeight()}},LS=class extends Q{exec(){if(BS().paste)this._workbook._view.clipboard.focus({preventScroll:!0}),document.execCommand(`paste`);else return{reason:`error`,type:`useKeyboard`}}},RS=class extends Q{constructor(e){super(e),this._eventType=`cut`,this._clipboard=e.workbook.clipboard(),this._event=e.event}exec(){let e=this._clipboard.canCopy(),t=[],n,r;if(!e.canCopy)return e.menuInvoked?{reason:`error`,type:`useKeyboard`}:e.multiSelection?{reason:`error`,type:`unsupportedSelection`}:void 0;let i=this._workbook.activeSheet().selection();if(this._eventType===`cut`){if(!i.enable())return this._event.preventDefault(),{reason:`error`,type:`cannotModifyDisabled`};this.getState()}if(this._workbook.trigger(this._eventType,{range:i}))this._event.preventDefault();else if(this._eventType===`cut`){if(n=i.values(),n.forEach(function(e){r=[],e.forEach(function(){r.push({})}),t.push(r)}),i.sheet().trigger(`changing`,{data:t,range:i,changeType:dS.CUT}))return;this._clipboard.cut()}else this._clipboard.copy()}undo(){let e=this.range();e.sheet().trigger(`changing`,{data:this._state.data,range:e,changeType:dS.CUT})||this.setState(this._state)}},zS=class extends RS{constructor(e){super(e),this._eventType=`copy`,this.undo=fS}};function BS(){return{copy:document.queryCommandSupported?document.queryCommandSupported(`copy`):!1,cut:document.queryCommandSupported?document.queryCommandSupported(`cut`):!1,paste:document.queryCommandSupported?document.queryCommandSupported(`paste`):!1}}function VS(e){(e&&e._view)?.selectClipboardContents?.()}var HS=class extends Q{constructor(e){super(e),this._clipboard=e.workbook.clipboard(),this.cannotUndo=!0}exec(){if(BS().copy)VS(this._workbook),document.execCommand(`copy`);else return{reason:`error`,type:`useKeyboard`}}},US=class extends Q{constructor(e){super(e)}origin(e){this._origin=e}exec(){let e=this.range(),t;if(!e.enable())return{reason:`error`,type:`rangeDisabled`};if(e.intersectingArrayFormula())return{reason:`error`,type:`intersectsArray`};this.getState();try{if(t=e._previewFillFrom(this._origin),e.sheet().trigger(`changing`,{data:t.props,range:t.dest,changeType:dS.AUTO_FILL}))return;t.dest._properties(t.props,!0)}catch(e){if(e instanceof X.FillError)return{reason:`error`,type:e.code};throw e}}undo(){let e=this.range(),t=this._state;e.sheet().trigger(`changing`,{data:t.data,range:e,changeType:dS.AUTO_FILL})||this.setState(this._state)}},WS=class extends Q{constructor(e){super(e),this._clipboard=e.workbook.clipboard(),this.cannotUndo=!0}exec(){if(BS().copy)VS(this._workbook),document.execCommand(`cut`);else return{reason:`error`,type:`useKeyboard`}}},GS=class extends Q{undo(){this.range().filter(this._state)}exec(){let e=this.range();this._state=e.hasFilter(),e.filter(!this._state)}},KS=class extends Q{undo(){this.range().sheet().setState(this._state)}exec(){let e=this.range(),t=e.sheet(),n=t.activeCell(),r=this.options.sheet?n.topLeft.col:this.options.column||0,i=this.options.value===`asc`;this._state=t.getState(),this.options.sheet&&(e=this.expandRange());let a=e.cantSort();if(a)return{reason:`error`,type:a.code};e.sort({column:r,ascending:i})}expandRange(){let e=this.range().sheet();return new X(e._sheetRef,e)}},qS=class extends Q{column(){return this.options.column||0}undo(){this.range().sheet().clearFilter(this.column()),this._state.length&&this.range().filter(this._state)}getState(){let e=this.range().sheet().filter();e&&(this._state=e.columns.filter(function(e){return e.index===this.column()}.bind(this)))}exec(){let e=this.range(),t=this.column(),n=e.sheet().filter(),r,i,a=!1;this.options.valueFilter?i={column:t,filter:new Hb(this.options.valueFilter)}:this.options.customFilter&&(i={column:t,filter:new Ub(this.options.customFilter)}),this.getState(),n&&n.ref.eq(e._ref)&&n.columns.length?(n.columns.forEach(function(e){e.index===t&&(a=!0)}),r=n.columns.map(function(e){return e.index===t?i:{column:e.index,filter:e.filter}}),a||r.push(i)):r=i,e.filter(r)}},JS=class extends qS{exec(){let e=this.range(),t=this.column();this.getState(),e.clearFilter(t)}},YS=class extends Q{constructor(e){super(e),this.axis=e.axis}undo(){this.range().sheet().setAxisState(this._state)}exec(){let e=this.range().sheet();this._state=e.getAxisState(),this.axis===`row`?e.axisManager().hideSelectedRows():e.axisManager().hideSelectedColumns()}},XS=class extends YS{exec(){let e=this.range().sheet();this._state=e.getAxisState(),this.axis===`row`?e.axisManager().unhideSelectedRows():e.axisManager().unhideSelectedColumns()}},ZS=class extends Q{exec(){this._expandedRange=this._expand(this.range()),this._state=this._expandedRange.getState(),this._indexes=this._exec(this._expandedRange.sheet())}undo(){let e=this,t=e._expandedRange,n=t.sheet();n.batch(function(){e._indexes.forEach(function(t){e._undoOne(n,t),n._restoreModifiedFormulas(t.formulas)}),t.setState(e._state)},{layout:!0,recalc:!0,ref:t._ref,isValue:!0})}},QS=class extends ZS{_expand(e){return e.resize({left:-1/0,right:1/0})}_exec(e){return e.axisManager().deleteSelectedRows()}_undoOne(e,t){e.insertRow(t.index),e.rowHeight(t.index,t.height)}},$S=class extends ZS{_expand(e){return e.resize({top:-1/0,bottom:1/0})}_exec(e){return e.axisManager().deleteSelectedColumns()}_undoOne(e,t){e.insertColumn(t.index),e.columnWidth(t.index,t.width)}},eC=class extends Q{constructor(e){super(e),this._value=e.value}undo(){let e=this,t=e.range().sheet();t.batch(function(){for(let n=e._pos.count;--n>=0;)e._undoOne(t,e._pos.base)},{layout:!0,recalc:!0})}},tC=class extends eC{exec(){let e=this._value,t=this.range().sheet();e===`left`?this._pos=t.axisManager().addColumnLeft():this._pos=t.axisManager().addColumnRight()}_undoOne(e,t){e.deleteColumn(t)}},nC=class extends eC{exec(){let e=this._value,t=this.range().sheet();e===`above`?this._pos=t.axisManager().addRowAbove():this._pos=t.axisManager().addRowBelow()}_undoOne(e,t){e.deleteRow(t)}},rC=class extends Q{constructor(e){super(e),this._value=e.value}exec(){let e=this,t=e.range().sheet();if(this.getState(),!t.trigger(`changing`,{data:e._value,range:e.range(),changeType:dS.VALIDATION}))try{t.withCultureDecimals(function(){e.range().validation(e._value)})}catch(e){if(e instanceof G.runtime.ParseError)return{title:`Error in formula`,body:e+``,reason:`error`};throw e}}undo(){let e=this.range(),t=this._state;e.sheet().trigger(`changing`,{data:t.data[0][0].validation,range:e,changeType:dS.VALIDATION})||this.setState(this._state)}},iC=class extends Q{constructor(e){super(e),this.cannotUndo=!0}exec(){if(this.options.file.name.match(/.xlsx$/i)===null)return{reason:`error`,type:`openUnsupported`};let e=this.options.workbook;e.fromFile(this.options.file);let t=e.excelImportErrors;t&&t.length&&e._view.openDialog(`importError`,{errors:t})}},aC=class extends Q{constructor(e){super(e),this.cannotUndo=!0}exec(){let e=this.options.name+this.options.extension;if(this.options.extension===`.xlsx`)return this.options.workbook.saveAsExcel({fileName:e});this.options.extension===`.pdf`&&this.options.workbook.saveAsPDF(Vp(this.options.pdf,{workbook:this.options.workbook,fileName:e}))}},oC=class extends Q{constructor(e){super(e),this._name=e.name,this._value=e.value}getState(){this._state=this._workbook.nameDefinition(this._name)}setState(){this._workbook.nameDefinition(this._name,this._state),this._workbook.trigger(`change`,{recalc:!0})}},sC=class extends oC{exec(){this.getState();try{this._workbook.defineName(this._name,this._value),this._workbook.trigger(`change`,{recalc:!0})}catch(e){return{title:`Error`,body:e+``,reason:`error`}}}},cC=class extends oC{exec(){this.getState(),this._workbook.undefineName(this._name),this._workbook.trigger(`change`,{recalc:!0})}},lC=Object.freeze({__proto__:null,AddColumnCommand:tC,AddCommand:eC,AddRowCommand:nC,AdjustDecimalsCommand:jS,AdjustRowHeightCommand:IS,ApplyFilterCommand:qS,AutoFillCommand:US,BorderChangeCommand:MS,BringToFrontCommand:vS,ClearContentCommand:DS,ClearFilterCommand:JS,ColumnWidthCommand:xS,Command:Q,CopyCommand:zS,CutCommand:RS,DefineNameCommand:sC,DeleteColumnCommand:$S,DeleteCommand:ZS,DeleteDrawingCommand:gS,DeleteNameCommand:cC,DeleteRowCommand:QS,DrawingCommand:mS,DrawingUpdateCommand:pS,EditCommand:OS,EditValidationCommand:rC,FilterCommand:GS,FreezePanesCommand:PS,GridLinesChangeCommand:wS,HideLineCommand:YS,HyperlinkCommand:CS,InsertCommentCommand:kS,InsertImageCommand:hS,MergeCellCommand:NS,NameCommand:oC,OpenCommand:iC,PasteCommand:FS,PropertyChangeCommand:TS,PropertyCleanCommand:ES,ReorderDrawingsCommand:_S,RowHeightCommand:SS,SaveAsCommand:aC,SendToBackCommand:yS,SortCommand:KS,TargetValueCommand:bS,TextWrapCommand:AS,ToolbarCopyCommand:HS,ToolbarCutCommand:WS,ToolbarPasteCommand:LS,UnHideLineCommand:XS}),uC=class extends ib{constructor(e){super(),this.options=e,this.events=[`undo`,`redo`],this.clear()}push(e){this.stack=this.stack.slice(0,this.currentCommandIndex+1),this.currentCommandIndex=this.stack.push(e)-1}undo(){if(this.canUndo()){let e=this.stack[this.currentCommandIndex--];e.undo(),this.trigger(`undo`,{command:e})}}redo(){if(this.canRedo()){let e=this.stack[++this.currentCommandIndex];e.redo(),this.trigger(`redo`,{command:e})}}clear(){this.stack=[],this.currentCommandIndex=-1}canUndo(){return this.currentCommandIndex>=0}canRedo(){return this.currentCommandIndex!==this.stack.length-1}};let dC=String.fromCharCode,fC={amp:38,lt:60,gt:62,quot:34,apos:39,nbsp:160};function pC(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}function mC(e,t){t>65535?(t-=65536,e.push(t>>>10&1023|55296,56320|t&1023)):e.push(t)}let hC=pC(`<![CDATA[`),gC=pC(`]]>`),_C=pC(`-->`),vC=pC(`!--`),yC=pC(`/>`),bC=pC(`</`),xC=pC(`?>`),SC=pC(`?`),CC=pC(`<`),wC=pC(`>`),TC=pC(`;`),EC=pC(`=`),DC=pC(`&`),OC=pC(`"`),kC=pC(`'`),AC=pC(`#`),jC=pC(`x`),MC=pC(`X`),NC={};function PC(e,t){let n=0,r=[],i={is:function(e){let t=r.length,n=e.length;for(;--t>=0&&--n>=0;)if(r[t].$tag!==e[n]&&e[n]!==`*`)return!1;return n<0?r[r.length-1]:null},exit:function(){throw NC},stack:r},a=null;function o(){a=Object.create(a)}function s(){a=Object.getPrototypeOf(a)}function c(e){let t=a?.[e];return t==null&&e!==``&&f(`Undefined namespace ${e}`),t}function l(e,n){let r=c(n);if(r!=null){let n=t.namespaces[r];n&&(e=`${n}:${e}`)}return e}function u(e,n){if(!t.namespaces)return!1;let r=!1;for(let[e,t]of Object.entries(n))if(e===`xmlns`)r||=(o(),!0),a[``]=t;else{let i=/^([^:]+):(.*)$/.exec(e);if(i){let e=i[1];if(e===`xmlns`){let e=i[2];r||=(o(),!0),a[e]=t||null}else/^xml/i.test(e)||(n[l(i[2],e)]=t)}}let i=/^([^:]+):(.*)$/.exec(e);return e=i?l(i[2],i[1]):l(e,``),n.$tag=e,r}function d(t){let r=e[n++];r&240^240?r&224^224?r&192^192?t.push(r):mC(t,(r&31)<<6|e[n++]&63):mC(t,(r&15)<<12|(e[n++]&63)<<6|e[n++]&63):mC(t,(r&3)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)}function f(e){throw Error(e+`, at `+n)}function p(t){let r=[];for(;n<e.length&&t(e[n]);)r.push(e[n++]);return r}function m(e){return dC.apply(0,p(e))}function h(){p(v)}function g(t){let r=n;for(let i=0;i<t.length;++i)if(e[n++]!==t[i])return n=r,!1;return t}function _(e){g(e)||f(`Expecting `+e.join(`, `))}function v(e){return e===9||e===10||e===13||e===32}function y(e){return e>=48&&e<=57}function b(e){return e>=48&&e<=57||(e|=32)>=97&&e<=102}function x(e){return e===58||e===95||(e|=32)>=97&&e<=122}function S(e){return e===45||y(e)||x(e)}function C(){let t=[];for(;n<e.length;){if(g(_C))return re(`comment`,dC.apply(0,t));d(t)}}function w(){let e,t;if(g(SC))te();else if(g(vC))C();else{e=E(),t=ne(e);let n=u(e,t);r.push(t),g(yC)?re(`enter`,t.$tag,t,!0):(_(wC),re(`enter`,t.$tag,t),T(e),e!==E()&&f(`Bad closing tag`),re(`leave`,t.$tag,t),h(),_(wC)),n&&s(),r.pop()}}function T(t){let r=[];for(;n<e.length;){if(g(bC))return r.length&&re(`text`,dC.apply(0,r));if(g(hC))for(;n<e.length&&!g(gC);)d(r);else g(CC)?(r.length&&re(`text`,dC.apply(0,r)),w(),r=[]):g(DC)?ee(r):d(r)}f(`Unclosed tag `+t)}function E(){return x(e[n])||f(`Expecting XML name`),m(S)}function D(){let t=g(OC)||g(kC);t||f(`Expecting string`);let r=[];for(;n<e.length;){if(g(t))return dC.apply(0,r);g(DC)?ee(r):d(r)}f(`Unfinished string`)}function ee(e){let t;if(g(AC))t=g(jC)||g(MC)?parseInt(m(b),16):parseInt(m(y),10),isNaN(t)&&f(`Bad numeric entity`);else{let e=E();t=fC[e],t===void 0&&f(`Unknown entity `+e)}mC(e,t),_(TC)}function te(){re(`decl`,E(),ne()),_(xC)}function ne(t){let r={$tag:t};for(;n<e.length;){h();let t=e[n];if(t===63||t===62||t===47)break;r[E()]=(_(EC),D())}return r}function re(e,n,r,a){let o=t&&t[e];o&&o.call(i,n,r,a)}let ie=[];for(d(ie),ie[0]!==65279&&(n=0);n<e.length;)h(),_(CC),w(),h()}let FC=function(){try{return PC.apply(this,arguments)}catch(e){if(e!==NC)throw e}};var IC=class{constructor(){this._progressHandlers=[],this._resolved=!1,this._rejected=!1,this.promise=new window.Promise((e,t)=>{this._resolve=t=>{!this._resolved&&!this._rejected&&(this._resolved=!0,e(t))},this._reject=e=>{!this._resolved&&!this._rejected&&(this._rejected=!0,t(e))}})}resolve(e){return this._resolve(e),this}reject(e){return this._reject(e),this}notify(e){!this._resolved&&!this._rejected&&this._progressHandlers.forEach(t=>t(e))}progress(e){return this._progressHandlers.push(e),this}then(e,t,n){return n&&this.progress(n),this.promise.then(e,t)}catch(e){return this.promise.catch(e)}finally(e){return this.promise.finally(e)}promise(){return this.promise}};let LC={"http://schemas.openxmlformats.org/package/2006/relationships":``,"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties":``,"http://schemas.openxmlformats.org/package/2006/content-types":``,"http://schemas.openxmlformats.org/spreadsheetml/2006/main":``,"http://schemas.openxmlformats.org/package/2006/metadata/core-properties":`cp`,"http://purl.org/dc/elements/1.1/":`dc`,"http://purl.org/dc/terms/":`dcterms`,"http://purl.org/dc/dcmitype/":`dcmitype`,"http://www.w3.org/2001/XMLSchema-instance":`xsi`,"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes":`vt`,"http://schemas.openxmlformats.org/officeDocument/2006/relationships":`r`,"http://schemas.openxmlformats.org/markup-compatibility/2006":`mc`,"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac":`x14ac`,"urn:schemas-microsoft-com:vml":`v`,"urn:schemas-microsoft-com:office:office":`o`,"urn:schemas-microsoft-com:office:excel":`x`,"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing":`xdr`,"http://schemas.openxmlformats.org/drawingml/2006/main":`a`},RC={greaterThanOrEqual:`greaterThanOrEqualTo`,lessThanOrEqual:`lessThanOrEqualTo`},zC=null;function BC(e,t,n){let r=new FileReader;r.onload=async function(e){try{await hw(await bp.loadAsync(e.target.result),t,n)}catch(e){n.reject(e)}},r.onerror=function(){n.reject(Error(`Failed to read file: `+(r.error?.message||`Unknown error`)))},r.readAsArrayBuffer(e)}let VC=[`sheetData`,`row`,`c`],HC=[`cols`,`col`],UC=[`definedNames`,`definedName`],WC=[`sheetData`,`row`,`c`,`f`],GC=[`mergeCells`,`mergeCell`],KC=[`sheetViews`,`sheetView`,`pane`],qC=[`sheetData`,`row`],JC=[`sheetViews`,`sheetView`,`selection`],YC=[`sheets`,`sheet`],XC=[`sheetData`,`row`,`c`,`is`],ZC=[`t`],QC=[`si`],$C=[`sheetData`,`row`,`c`,`v`],ew=[`bookViews`,`workbookView`],tw=[`sheetViews`,`sheetView`],nw=[`hyperlinks`,`hyperlink`],rw=[`sheetProtection`],iw=[`dataValidations`,`dataValidation`],aw=[`dataValidations`,`dataValidation`,`formula1`],ow=[`dataValidations`,`dataValidation`,`formula2`],sw=[`x14:dataValidations`,`x14:dataValidation`],cw=[`x14:dataValidations`,`x14:dataValidation`,`xm:sqref`],lw=[`x14:dataValidations`,`x14:dataValidation`,`x14:formula1`,`xm:f`],uw=[`x14:dataValidations`,`x14:dataValidation`,`x14:formula2`,`xm:f`],dw=[`commentList`,`comment`],fw=[`authors`,`author`],pw=[`t`];function mw(e){return/^\//.test(e)?e=e.substr(1):/^xl\//.test(e)||(e=`xl/`+e),e}async function hw(e,t,n){zC=t.excelImportErrors=[],t._clearSheets();let r=await Fw(e),i=await Iw(e,`_rels/workbook.xml`),a=await Ww(e,await qw(e,i.byType.theme[0])),o=[],s=0;await Pw(e,`xl/workbook.xml`,{enter:function(n,c){if(this.is(YC)){let n=c[`r:id`],s=i.byId[n],l=c.name,u=c.state,d=yw(i.bytes[s]);t.options.columnWidth=d.columnWidth||t.options.columnWidth,t.options.rowHeight=d.rowHeight||t.options.rowHeight,o.push({workbook:t,zip:e,strings:r,styles:a,file:s,options:{state:u,name:l,rows:Math.max(t.options.rows||0,d.rows),columns:Math.max(t.options.columns||0,d.cols),columnWidth:d.columnWidth,rowHeight:d.rowHeight}})}else this.is(ew)&&c.activeTab&&(s=Jw(c.activeTab))},text:function(e){let n=this.is(UC);if(n&&!(Yw(n.function)||Yw(n.vbProcedure))){let r=n.localSheetId,i=null;r!=null&&(i=o[r].options.name);let a=n.name;a!==`_xlnm._FilterDatabase`&&(i&&(a=`'`+i.replace(/\\/g,`\\\\`).replace(/\'/g,`\\'`)+`'!`+a),Aw(i,null,function(){t.defineName(a,e,Yw(n.hidden))},`reading user-defined name: `+a))}}});let c=new IC;c.progress(function(e){n&&n.notify(e)}).then(function(){let e=t.sheets();vw(e),t.activeSheet(e[s]),n&&n.resolve()}),gw(o,t,c)}function gw(e,t,n){let r=window.Promise.resolve();for(let i=0;i<e.length;i++)(function(i,a){r=r.then(function(){let r=t.insertSheet(i.options);r.suspendChanges(!0);let o=_w(r,i),s={sheet:r,progress:a===1?1:a/(e.length-1)};return o.then(function(){n.notify(s)}),o})})(e[i],i);r.then(function(){n.resolve()})}function _w(e,t){let n=new IC;return setTimeout(async function(){await Sw(t.zip,t.file,e,t.strings,t.styles),n.resolve()},0),n}function vw(e){for(let t=0;t<e.length;t++)e[t].suspendChanges(!1).triggerChange({recalc:!0})}function yw(e){let t,n={rows:0,cols:0};return FC(e,{namespaces:LC,enter:function(e,r){e===`dimension`?(t=G.parseReference(r.ref),t.bottomRight&&(n.cols=t.bottomRight.col+1,n.rows=t.bottomRight.row+1)):e===`sheetFormatPr`?(r.defaultColWidth&&(n.columnWidth=bw(parseFloat(r.defaultColWidth))),r.defaultRowHeight&&(n.rowHeight=xw(parseFloat(r.defaultRowHeight)))):this.is(qC)&&r.r?n.rows=Math.max(n.rows,+r.r):this.is(VC)&&r.r&&(t=G.parseReference(r.r),n.rows=Math.max(n.rows,t.row+1),n.cols=Math.max(n.cols,t.col+1))}}),n}function bw(e){return(256*e+18)/256*7}function xw(e){return 4/3*e}async function Sw(e,t,n,r,i){let a={},o,s,c,l,u,d,f=n._columns._count,p=null,m=await Iw(e,t.replace(/worksheets\//,`worksheets/_rels/`)),h,g,_,v,y,b,x,S,C=[],w=[],T=!!n._workbook?.options?.excel?.applyProtection;zC=n._workbook.excelImportErrors,t=mw(t),await Pw(e,t,{enter:function(e,t,r){let i;if(this.is(WC))r&&t.t===`shared`&&t.si!=null&&(l=n.range(a[t.si])._get(`formula`));else if(this.is(VC)){c=null,l=null,o=t.r,u=null,o??=(o=G.parseReference(p),o.col++,o.toString()),p=o,s=t.t;let e=t.s;e!=null&&w.push({ref:o,sty:+e})}else if(this.is(GC))n.range(t.ref).merge();else if(this.is(HC)){let e=Jw(t.min)-1,r=Math.min(f,Jw(t.max))-1,i;if(t.width&&(i=bw(parseFloat(t.width)),i!==0&&n._columns.values.value(e,r,i)),t.hidden===`1`||i===0)for(let t=e;t<=r;t++)n.hideColumn(t);t.style!=null&&w.unshift({ref:new H(new V(-1/0,e),new V(1/0,r)),sty:+t.style})}else if(this.is(qC)){let e=Jw(t.r)-1,r;t.ht&&(r=xw(parseFloat(t.ht)),r!==0&&n._rows.values.value(e,e,r)),(t.hidden===`1`||r===0)&&n.hideRow(e)}else if(this.is(JC)){if(t.activeCell){let e=G.parseReference(t.activeCell);n.select(e,!0)}}else if(this.is(KC))t.state&&t.state.indexOf(`frozen`)>-1&&(t.xSplit&&n.frozenColumns(Jw(t.xSplit)),t.ySplit&&n.frozenRows(Jw(t.ySplit)));else if(this.is(tw))n.showGridLines(Yw(t.showGridLines,!0));else if(this.is(nw)){let e=t[`r:id`],r=m.byId[e];r&&n.range(t.ref).link(r)}else T&&this.is(rw)?t.sheet&&n.range(Dp).enable(!1):this.is([`autoFilter`])?(_=t.ref,r&&E()):_&&(this.is([`filterColumn`])?v=parseInt(t.colId,10):this.is([`customFilters`])?(y=Yw(t.and)?`and`:`or`,b=[]):this.is([`customFilter`])?(i=Dw(t.operator,t.val),i&&b.push({operator:i.operator,value:i.value})):this.is([`dynamicFilter`])?C.push({column:v,filter:new Gb({type:Ow(t.type)})}):this.is([`top10`])?C.push({column:v,filter:new Wb({value:kw(t.val),type:(function(e,t){return e&&t?`topPercent`:t?`topNumber`:e?`bottomPercent`:`bottomNumber`})(Yw(t.percent),Yw(t.top))})}):this.is([`filters`])?(x=Yw(t.blank),S=[]):this.is([`filter`])&&S.push(kw(t.val)))},leave:function(e,t){if(this.is(WC))!l&&t.t===`shared`&&t.si!=null&&(l=n.range(a[t.si])._get(`formula`));else if(this.is(VC)){if(l!=null)Aw(n,u||o,function(){n.range(u||o).formula(l,d)},`parsing formula`)&&n.range(u||o).value(l).background(`#ffaaaa`);else if(c!=null){let e=n.range(o);e._get(`formula`)||(!s||s===`n`?c=parseFloat(c):s===`s`?c=r[Jw(c)]:s===`b`?c=c===`1`:s===`d`&&(c=om().parseDate(c)),c!=null&&e.value(c))}}else this.is(iw)||this.is(sw)?(function(){let e=G.parseSqref(t.sqref),r=t.type.toLowerCase(),i=t.operator;/^(?:whole|decimal)$/.test(r)?r=`number`:r===`list`&&(i=`list`),!i&&/^(?:number|date)$/.test(r)&&(i=`between`),e.forEach(function(e){Aw(n,e,function(){n.range(e).validation({type:Yw(t.showErrorMessage,!0)?`reject`:`warning`,from:h,to:g,dataType:r,comparerType:RC[i]||i,allowNulls:Yw(t.allowBlank),showButton:Yw(t.showDropDown)||r===`date`||r===`list`,messageTemplate:t.error,titleTemplate:t.errorTitle})},`parsing validation`)})})():e===`cols`?n._columns._refresh():e===`sheetData`?n._rows._refresh():e===`autoFilter`?E():_&&(e===`customFilters`?C.push({column:v,filter:new Ub({logic:y,criteria:b})}):e===`filters`&&C.push({column:v,filter:new Hb({values:S,blanks:x})}))},text:function(e){let t;this.is($C)||this.is(XC)?c=e:(t=this.is(WC))?(l=e,d=t.t===`array`,d?u=t.ref:t.t===`shared`&&(a[t.si]=o)):this.is(aw)||this.is(lw)?h=e:this.is(ow)||this.is(uw)?g=e:this.is(cw)&&(this.stack[this.stack.length-2].sqref=e)}}),w.forEach(({ref:e,sty:t})=>Nw(n,e,i,t)),m.byType.comments&&await Ew(e,Xw(t,m.byType.comments[0]),n),m.byType.drawing&&await Tw(e,Xw(t,m.byType.drawing[0]),n);function E(){n.range(_).filter(C),_=null}}function Cw(e){let t=/\.([^.]+)$/.exec(e);if(t&&t[1])return{jpg:`image/jpeg`,jpeg:`image/jpeg`,png:`image/png`,gif:`image/gif`,wmf:`image/wmf`}[t[1].toLowerCase()]}function ww(e){let t=/[^/]+$/.exec(e);return t&&t[0]}async function Tw(e,t,n){let r=[`xdr:twoCellAnchor`],i=[`xdr:ext`],a=[`xdr:oneCellAnchor`],o=[`xdr:from`],s=[`xdr:to`],c=[`xdr:row`],l=[`xdr:col`],u=[`xdr:rowOff`],d=[`xdr:colOff`],f=[`xdr:blipFill`,`a:blip`],p=await Iw(e,t.replace(/drawings\//,`drawings/_rels/`));if(p.byType.image){let r=Object.keys(p.byId);for(let i=0;i<r.length;++i){let a=r[i],o=Xw(t,p.byId[a]),s=Cw(o);if(s){let t=await e.file(o).async(`arraybuffer`),r=ww(o),i=r&&!Ct.edge?new window.File([t],r,{type:s}):new window.Blob([t],{type:s});p.byId[a]=n._workbook.addImage(i)}}}let m,h,g,_;await Pw(e,t,{enter:function(e,t){if(this.is(r)||this.is(a))m={};else if(this.is(o)||this.is(s))h={};else if(this.is(f)){let e=t[`r:embed`];m.image=p.byId[e]}else this.is(i)&&(g=Zw(parseFloat(t.cx)),_=Zw(parseFloat(t.cy)))},leave:function(){if(this.is(o))m.topLeftCell=new V(h.row,h.col),m.offsetX=Zw(h.colOffset),m.offsetY=Zw(h.rowOffset);else if(this.is(s))m.brCell=new V(h.row,h.col),m.brX=Zw(h.colOffset),m.brY=Zw(h.rowOffset);else if(this.is(r)&&m.image){let e=n._columns.sum(0,m.topLeftCell.col-1)+m.offsetX,t=n._rows.sum(0,m.topLeftCell.row-1)+m.offsetY,r=n._columns.sum(0,m.brCell.col-1)+m.brX,i=n._rows.sum(0,m.brCell.row-1)+m.brY;n.addDrawing({topLeftCell:m.topLeftCell,offsetX:m.offsetX,offsetY:m.offsetY,width:g??r-e,height:_??i-t,image:m.image,opacity:1})}else this.is(a)&&m.image&&n.addDrawing({topLeftCell:m.topLeftCell,offsetX:m.offsetX,offsetY:m.offsetY,width:g,height:_,image:m.image,opacity:1})},text:function(e){this.is(c)?h.row=parseFloat(e):this.is(l)?h.col=parseFloat(e):this.is(u)?h.rowOffset=parseFloat(e):this.is(d)&&(h.colOffset=parseFloat(e))}})}async function Ew(e,t,n){let r=[],i,a;await Pw(e,t,{enter:function(e,t){this.is(dw)?a={author:r[t.authorId],ref:t.ref,text:``}:this.is(fw)&&(i=``)},leave:function(){this.is(dw)?n.range(a.ref).comment(a.text):this.is(fw)&&r.push(i)},text:function(e){this.is(pw)?a.text+=e:this.is(fw)&&(i+=e)}})}function Dw(e,t){let n={equal:`eq`,notEqual:`ne`,greaterThan:`gt`,greaterThanOrEqual:`gte`,lessThan:`lt`,lessThanOrEqual:`lte`}[e];if(t=kw(t),n&&typeof t==`number`)return{operator:n,value:t};if((e===`notEqual`||!e)&&typeof t==`string`)return{operator:e?`doesnotmatch`:`matches`,value:t}}function Ow(e){return{Q1:`quarter1`,Q2:`quarter2`,Q3:`quarter3`,Q4:`quarter4`,M1:`january`,M2:`february`,M3:`march`,M4:`april`,M5:`may`,M6:`june`,M7:`july`,M8:`august`,M9:`september`,M10:`october`,M11:`november`,M12:`december`}[e.toUpperCase()]||e}function kw(e){let t=parseFloat(e);return!isNaN(t)&&t==e?t:e}function Aw(e,t,n,r){try{return n(),!1}catch(n){let i={context:r,error:String(n)};return e&&e.name?i.sheet=e.name():e&&(i.sheet=e),t&&(i.location=String(t)),zC.push(i),!0}}let jw={none:0,thin:1,medium:2,dashed:1,dotted:1,thick:3,double:3,hair:1,mediumDashed:2,dashDot:1,mediumDashDot:2,dashDotDot:1,mediumDashDotDot:2,slantDashDot:1},Mw={0:`General`,1:`0`,2:`0.00`,3:`#,##0`,4:`#,##0.00`,9:`0%`,10:`0.00%`,11:`0.00E+00`,12:`# ?/?`,13:`# ??/??`,14:`mm-dd-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:`@`};function Nw(e,t,n,r){let i=e.range(t),a=!!e._workbook?.options?.excel?.applyProtection,o=n.inlineStyles[r],s,c;o.xfId&&(s=n.namedStyles[o.xfId]),p(`applyBorder`,`borderId`)&&f(n.borders[c]),p(`applyFont`,`fontId`)&&d(n.fonts[c]),p(`applyAlignment`,`textAlign`)&&i.textAlign(c),p(`applyAlignment`,`verticalAlign`)&&i.verticalAlign(c),p(`applyAlignment`,`indent`)&&i.indent(c),p(`applyAlignment`,`wrapText`)&&i._property(`wrap`,c),p(`applyFill`,`fillId`)&&u(n.fills[c]),p(`applyNumberFormat`,`numFmtId`)&&l(n.numFmts[c]||Mw[c]),a&&p(`applyProtection`,`protection`)&&i.enable(!o.protection.locked);function l(e){let t=typeof e==`string`?e:e.formatCode;t!=null&&!/^general$/i.test(t)&&(t=t.replace(/^\[\$-[0-9]+\]/,``),i.format(t))}function u(e){e.type===`solid`&&i.background(e.color)}function d(e){i.fontFamily(e.name),e.size&&i._property(`fontSize`,e.size*4/3),e.bold&&i.bold(!0),e.italic&&i.italic(!0),e.underline&&i.underline(!0),e.color&&i.color(e.color)}function f(e){function t(t,n){let r=e[t];if(!r)return;let a=jw[r.style];if(!a)return;let o=r.color;o??=`#000`;let s={size:a,color:o};return t===`diagonal`&&(s.type=r.up<<1|r.down),i._property(n,s),!0}t(`left`,`borderLeft`)||t(`start`,`borderLeft`),t(`right`,`borderRight`)||t(`end`,`borderRight`),t(`top`,`borderTop`),t(`bottom`,`borderBottom`),t(`diagonal`,`dBorders`)}function p(e,t){let n=o[e];if(n!=null&&!n)return!1;if(c=o[t],s&&c==null){if(n=s[e],n!=null&&!n)return!1;c=s[t]}return c!=null}}function Pw(e,t,n){return new window.Promise(r=>{let i=e.file(t);i?i.async(`uint8array`).then(e=>{FC(e,{namespaces:LC,...n}),r()}):r()})}async function Fw(e){let t=[],n=null;return await Pw(e,`xl/sharedStrings.xml`,{leave:function(){this.is(QC)&&(t.push(n),n=null)},text:function(e){this.is(ZC)&&(n??=``,n+=e)}}),t}async function Iw(e,t){let n={byId:{},byType:{theme:[]},bytes:{}};await Pw(e,mw(t)+`.rels`,{enter:function(e,t){if(e===`Relationship`){n.byId[t.Id]=t.Target;let e=t.Type.match(/\w+$/)[0],r=n.byType[e]||[];r.push(t.Target),n.byType[e]=r}}});let r=[],i=[];Object.keys(n.byId).forEach(t=>{let a=n.byId[t],o=e.file(mw(a));o&&(r.push(a),i.push(o.async(`uint8array`)))});let a=await window.Promise.all(i);return r.forEach((e,t)=>n.bytes[e]=a[t]),n}let Lw=[`borders`,`border`],Rw=[`fills`,`fill`],zw=[`fonts`,`font`],Bw=[`cellXfs`,`xf`],Vw=[`cellStyleXfs`,`xf`],Hw=[`numFmts`,`numFmt`],Uw=[$(`FF000000`),$(`FFFFFFFF`),$(`FFFF0000`),$(`FF00FF00`),$(`FF0000FF`),$(`FFFFFF00`),$(`FFFF00FF`),$(`FF00FFFF`),$(`FF000000`),$(`FFFFFFFF`),$(`FFFF0000`),$(`FF00FF00`),$(`FF0000FF`),$(`FFFFFF00`),$(`FFFF00FF`),$(`FF00FFFF`),$(`FF800000`),$(`FF008000`),$(`FF000080`),$(`FF808000`),$(`FF800080`),$(`FF008080`),$(`FFC0C0C0`),$(`FF808080`),$(`FF9999FF`),$(`FF993366`),$(`FFFFFFCC`),$(`FFCCFFFF`),$(`FF660066`),$(`FFFF8080`),$(`FF0066CC`),$(`FFCCCCFF`),$(`FF000080`),$(`FFFF00FF`),$(`FFFFFF00`),$(`FF00FFFF`),$(`FF800080`),$(`FF800000`),$(`FF008080`),$(`FF0000FF`),$(`FF00CCFF`),$(`FFCCFFFF`),$(`FFCCFFCC`),$(`FFFFFF99`),$(`FF99CCFF`),$(`FFFF99CC`),$(`FFCC99FF`),$(`FFFFCC99`),$(`FF3366FF`),$(`FF33CCCC`),$(`FF99CC00`),$(`FFFFCC00`),$(`FFFF9900`),$(`FFFF6600`),$(`FF666699`),$(`FF969696`),$(`FF003366`),$(`FF339966`),$(`FF003300`),$(`FF333300`),$(`FF993300`),$(`FF993366`),$(`FF333399`),$(`FF333333`),$(`FF000000`),$(`FFFFFFFF`)];async function Ww(e,t){let n={fonts:[],numFmts:{},fills:[],borders:[],namedStyles:[],inlineStyles:[]},r=null,i=null,a=null,o=null;await Pw(e,`xl/styles.xml`,{enter:function(e,t,l){if(this.is(Hw))n.numFmts[t.numFmtId]=t;else if(this.is(zw))n.fonts.push(r={}),l&&(r=null);else if(r)e===`sz`?r.size=parseFloat(t.val):e===`name`?r.name=t.val:e===`b`?r.bold=Yw(t.val,!0):e===`i`?r.italic=Yw(t.val,!0):e===`u`?r.underline=t.val==null||t.val===`single`:e===`color`&&(r.color=c(t,null));else if(this.is(Rw))n.fills.push(i={}),l&&(i=null);else if(i)e===`patternFill`?i.type=t.patternType:(e===`fgColor`&&i.type===`solid`||e===`bgColor`&&i.type!==`solid`)&&(i.color=c(t,Uw[0]));else if(this.is(Lw))n.borders.push(a={diagonalUp:+Yw(t.diagonalUp,0),diagonalDown:+Yw(t.diagonalDown,0)}),l&&(a=null);else if(a){if(/^(?:left|start|top|right|end|bottom|diagonal)$/.test(e)&&(a[e]={style:t.style||`none`},e===`diagonal`&&(a.diagonal.up=a.diagonalUp,a.diagonal.down=a.diagonalDown)),e===`color`){let e=this.stack[this.stack.length-2].$tag;a[e].color=c(t,Uw[0])}}else this.is(Vw)?(o=s(t),n.namedStyles.push(o),l&&(o=null)):this.is(Bw)?(o=s(t),n.inlineStyles.push(o),l&&(o=null)):o&&(e===`alignment`?(/^(?:left|center|right|justify)$/.test(t.horizontal)&&(o.textAlign=t.horizontal),/^(?:top|center|bottom)$/.test(t.vertical)&&(o.verticalAlign=t.vertical),t.wrapText!=null&&(o.wrapText=Yw(t.wrapText)),t.indent!=null&&(o.indent=Jw(t.indent))):e==`protection`&&(o.protection={locked:Yw(t.locked)}))},leave:function(e){this.is(zw)?r=null:this.is(Rw)?i=null:this.is(Lw)?a=null:e===`xf`&&(o=null)}});function s(e){let t={borderId:Jw(e.borderId),fillId:Jw(e.fillId),fontId:Jw(e.fontId),numFmtId:Jw(e.numFmtId),pivotButton:Yw(e.pivotButton),quotePrefix:Yw(e.quotePrefix),xfId:Jw(e.xfId)};n(`applyAlignment`),n(`applyBorder`),n(`applyFill`),n(`applyFont`),n(`applyNumberFormat`),n(`applyProtection`)&&(t.protection={locked:!0});function n(n){if(e[n]!=null)return t[n]=Yw(e[n])}return t}function c(e,n){if(e.rgb)return $(e.rgb);if(e.indexed)return Uw[Jw(e.indexed)];if(e.theme){let r=t.colorScheme[Jw(e.theme)];if(!r)return n;let i=se(r);if(e.tint){i=i.toHSL();let t=parseFloat(e.tint);t<0?i.l*=1+t:i.l=i.l*(1-t)+(100-100*(1-t))}return i.toCssRgba()}}return n}let Gw=[`a:clrScheme`,`*`,`a:srgbClr`],Kw=[`a:clrScheme`,`*`,`a:sysClr`];async function qw(e,t){let n=[],r={colorScheme:n},i=mw(t);e.file(i)&&(await Pw(e,i,{enter:function(e,t){this.is(Kw)?n.push($(t.val===`window`?`FFFFFFFF`:`FF000000`)):this.is(Gw)&&n.push($(`FF`+t.val))}}),n.length>3&&(a(n,0,1),a(n,2,3)));function a(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}return r}function Jw(e){return e==null?null:parseInt(e,10)}function Yw(e,t){return e==null?t:e===`true`||e===!0||e===1||e===`1`}function $(e){let t=/^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);return`rgba(`+parseInt(t[2],16)+`, `+parseInt(t[3],16)+`, `+parseInt(t[4],16)+`, `+parseInt(t[1],16)/255+`)`}function Xw(e,t){for(e=e.split(/\/+/),t=t.split(/\/+/),e.pop();t.length;){let n=t.shift();if(n===``)e=[];else if(n===`.`)continue;else n===`..`?e.pop():e.push(n)}return e.join(`/`)}function Zw(e){return e/9525}let Qw=[`cut`,`copy`,`paste`,`changing`,`change`,`contextmenu`,`excelImport`,`excelExport`,`insertSheet`,`removeSheet`,`selectSheet`,`renameSheet`,`insertRow`,`insertColumn`,`deleteRow`,`deleteColumn`,`hideRow`,`hideColumn`,`unhideRow`,`unhideColumn`,`select`,`changeFormat`,`dataBinding`,`dataBound`,`progress`];function $w(e,t){let n=new XMLHttpRequest;n.onload=function(){t(n.response,n.getResponseHeader(`Content-Type`))},n.onerror=function(){t(null)},n.open(`GET`,e),n.responseType=`arraybuffer`,n.send()}var eT=class extends ib{constructor(e,t){super(),this.events=Qw,this.options=e,this._view=t,this._sheets=[],this._images={},this._imgID=0,this._sheetsSearchCache={},this._sheet=this.insertSheet({rows:this.options.rows,columns:this.options.columns,rowHeight:this.options.rowHeight,columnWidth:this.options.columnWidth,headerHeight:this.options.headerHeight,headerWidth:this.options.headerWidth,dataSource:this.options.dataSource}),this.undoRedoStack=new uC,this.undoRedoStack.bind([`undo`,`redo`],this._onUndoRedo.bind(this)),this._context=new ag(this),this._validationContext=new og(this),this._names=Object.create(null),this.fromJSON(this.options)}clipboard(){return this._clipboard||=new nS(this),this._clipboard}destroy(){this.unbind(),this._clipboard&&this._clipboard.destroy()}_sheetChanging(e){this.trigger(`changing`,e)&&e.preventDefault()}_sheetChange(e){this.trigger(`change`,e)}_sheetInsertRow(e){this.trigger(`insertRow`,{sheet:e.sender,index:e.index})&&e.preventDefault()}_sheetInsertColumn(e){this.trigger(`insertColumn`,{sheet:e.sender,index:e.index})&&e.preventDefault()}_sheetDeleteRow(e){this.trigger(`deleteRow`,{sheet:e.sender,index:e.index})&&e.preventDefault()}_sheetDeleteColumn(e){this.trigger(`deleteColumn`,{sheet:e.sender,index:e.index})&&e.preventDefault()}_sheetHideRow(e){this.trigger(`hideRow`,{sheet:e.sender,index:e.index})&&e.preventDefault()}_sheetHideColumn(e){this.trigger(`hideColumn`,{sheet:e.sender,index:e.index})&&e.preventDefault()}_sheetUnhideRow(e){this.trigger(`unhideRow`,{sheet:e.sender,index:e.index})&&e.preventDefault()}_sheetUnhideColumn(e){this.trigger(`unhideColumn`,{sheet:e.sender,index:e.index})&&e.preventDefault()}_sheetSelect(e){this.trigger(`select`,e)}_sheetDataBinding(e){this.trigger(`dataBinding`,{sheet:e.sender})&&e.preventDefault()}_sheetDataBound(e){this.trigger(`dataBound`,{sheet:e.sender})}_sheetProgress(e){let t=this;setTimeout(function(){t.trigger(`progress`,{toggle:e.toggle})})}_sheetCommandRequest(e){this.trigger(`commandRequest`,e)}_inputForRef(e){let t=this;return t._sheet.withCultureDecimals(function(){return new X(e,t._sheet).input()})}_onUndoRedo(e){e.command.range().select()}execute(e){let t=Object.assign({},{workbook:this},e.options),n;this.options.getWorkbookCommand&&(n=this.options.getWorkbookCommand(e.command,t)),n||=new lC[e.command](t);let r=this.activeSheet();t.origin&&n.origin(t.origin),t.operatingRange?n.range(t.operatingRange):n.range(r.selection()),t.editRange&&(n._editRange=t.editRange);let i=n.exec();return(!i||i.reason!==`error`)&&(n.cannotUndo||this.undoRedoStack.push(n)),this.cleanupImages(),i}resetFormulas(){this._sheets.forEach(function(e){e.resetFormulas()})}resetValidations(){this._sheets.forEach(function(e){e.resetValidations()})}refresh(e){e.recalc&&(this.resetFormulas(),this.resetValidations(),this._sheet.recalc(this._context),this._sheet.revalidate(this._validationContext))}activeSheet(e){if(e===void 0)return this._sheet;this.sheetByName(e.name())&&(this._sheet=e,e.triggerChange(Ap))}moveSheetToIndex(e,t){let n=this.sheetIndex(e),r=this._sheets;n!==-1&&(this._sheetsSearchCache={},r.splice(t,0,r.splice(n,1)[0]),this.trigger(`change`,{sheetSelection:!0}))}insertSheet(e){e||={};let t=this,n=typeof e.index==`number`?e.index:t._sheets.length,r,i=t._sheets,a=this.options.messages,o=function(e){e||=1;let n=a.workbook.defaultSheetName+e;return t.sheetByName(n)?o(e+1):n};if(e.name&&t.sheetByName(e.name))return;this._sheetsSearchCache={},r=e.name||o();let s=new tx(e.rows||this.options.rows,e.columns||this.options.columns,e.rowHeight||this.options.rowHeight,e.columnWidth||this.options.columnWidth,e.headerHeight||this.options.headerHeight,e.headerWidth||this.options.headerWidth,e.defaultCellStyle||this.options.defaultCellStyle,e.createSheetDataSource||this.options.createSheetDataSource);return s._workbook=this,s._name(r),s._state(e.state),this._bindSheetEvents(s),i.splice(n,0,s),e.data&&s.fromJSON(e.data),e.dataSource&&s.setDataSource(e.dataSource),this.trigger(`change`,{sheetSelection:!0}),s}_bindSheetEvents(e){e.bind(`changing`,this._sheetChanging.bind(this)),e.bind(`change`,this._sheetChange.bind(this)),e.bind(`insertRow`,this._sheetInsertRow.bind(this)),e.bind(`insertColumn`,this._sheetInsertColumn.bind(this)),e.bind(`deleteRow`,this._sheetDeleteRow.bind(this)),e.bind(`deleteColumn`,this._sheetDeleteColumn.bind(this)),e.bind(`hideRow`,this._sheetHideRow.bind(this)),e.bind(`hideColumn`,this._sheetHideColumn.bind(this)),e.bind(`unhideRow`,this._sheetUnhideRow.bind(this)),e.bind(`unhideColumn`,this._sheetUnhideColumn.bind(this)),e.bind(`select`,this._sheetSelect.bind(this)),e.bind(`commandRequest`,this._sheetCommandRequest.bind(this)),e.bind(`dataBinding`,this._sheetDataBinding.bind(this)),e.bind(`dataBound`,this._sheetDataBound.bind(this)),e.bind(`progress`,this._sheetProgress.bind(this))}sheets(){return this._sheets.slice()}sheetByName(e){return this._sheets[this.sheetIndex(e)]}sheetByIndex(e){return this._sheets[e]}sheetIndex(e){let t=this._sheets,n=(typeof e==`string`?e:e.name()).toLowerCase(),r=this._sheetsSearchCache[n];if(r>=0)return r;for(r=0;r<t.length;r++){let e=t[r].name().toLowerCase();if(this._sheetsSearchCache[e]=r,e===n)return r}return-1}renameSheet(e,t){let n=e.name().toLowerCase();if(!(!t||n===t.toLowerCase()||this.sheetByName(t))&&(e=this.sheetByName(n),e&&(this._sheetsSearchCache={},!this.trigger(`renameSheet`,{sheet:e,newSheetName:t}))))return this._sheets.forEach(function(e){e._forFormulas(function(e){e.renameSheet(n,t)})}),this.forEachName(function(e,r){e.nameref.renameSheet(n,t)&&(this.undefineName(r),e.name=e.nameref.print(),this.nameDefinition(e.name,e)),(e.value instanceof z||e.value instanceof G.runtime.Formula)&&e.value.renameSheet(n,t)}.bind(this)),e._name(t),this.trigger(`change`,{sheetSelection:!0}),e}removeSheet(e){let t=this,n=t._sheets,r=e.name(),i=t.sheetIndex(e);if(n.length!==1&&!this.trigger(`removeSheet`,{sheet:e})&&(this._sheetsSearchCache={},i>-1))if(e.unbind(),n.splice(i,1),t.activeSheet().name()===r){let e=n[i===n.length?i-1:i];t.activeSheet(e)}else this.trigger(`change`,{recalc:!0,sheetSelection:!0})}_clearSheets(){for(let e=0;e<this._sheets.length;e++)this._sheets[e]._activeDrawing=[],this._sheets[e]._drawings=[],this._sheets[e].unbind();this._sheets=[],this._sheetsSearchCache={},this._names={},this._images={},this._imgID=0}_loadImages(){let e=this,t=Object.keys(e._images),n=t.length;n?t.forEach(function(t){let n=e._images[t];n.blob||$w(n.url,function(e,t){e!=null&&(n.blob=new Blob([e],{type:t}),delete n.url),r()})}):r();function r(){--n<=0&&e.activeSheet().triggerChange({layout:!0})}}fromJSON(e){if(e.sheets){this._clearSheets(),e.images&&(this._imgID=0,this._images={},Object.keys(e.images).forEach(function(t){if(!isNaN(t)){let e=parseFloat(t);isFinite(e)&&(this._imgID=Math.max(this._imgID,e))}this._images[t]={url:e.images[t]}},this),this._loadImages());for(let t=0;t<e.sheets.length;t++){let n=e.sheets[t],r=tT(n,this.options),i=this.insertSheet({rows:r.rowCount,columns:r.columnCount,rowHeight:r.rowHeight,columnWidth:r.columnWidth,headerHeight:r.headerHeight,headerWidth:r.headerWidth,data:n});n.dataSource&&i.setDataSource(n.dataSource)}}e.activeSheet?this.activeSheet(this.sheetByName(e.activeSheet)):this.activeSheet(this._sheets[0]),e.names&&e.names.forEach(function(e){this.defineName(e.name,e.value,e.hidden)},this)}toJSON(){this.resetFormulas(),this.resetValidations();let e=Object.keys(this._names).map(function(e){let t=this._names[e],n=t.value;return n=n instanceof z||n instanceof G.runtime.Formula?n.print(0,0,!0):n instanceof W?String(n):JSON.stringify(n),{value:n,hidden:t.hidden,name:t.name,sheet:t.nameref.sheet,localName:t.nameref.name}},this);return{activeSheet:this.activeSheet().name(),sheets:this._sheets.map(function(e){return e.recalc(this._context),e.revalidate(this._validationContext),e.toJSON()},this),names:e,images:{},columnWidth:this.options.columnWidth,rowHeight:this.options.rowHeight}}saveJSON(){let e=this,t=e.toJSON(),n=Object.keys(e._images).filter(function(t){return e.usesImage(t)===1}),r=n.length,i=[];return r&&n.forEach(function(n){let r=e._images[n];if(r.blob){let e=new Promise(e=>{let i=new FileReader;i.onload=function(){t.images[n]=i.result,e()},i.readAsDataURL(r.blob)});i.push(e)}else t.images[n]=r.url}),Promise.all(i).then(()=>t)}fromFile(e){let t=new IC;return e&&!this.trigger(`excelImport`,{file:e,deferred:t})&&this._readExcel(e,this,t),t.promise}_readExcel(e,t,n){BC(e,t,n)}saveAsExcel(e){let t=this;e=Vp({},t.options.excel,e);let n=t.toJSON();if(e.applyProtection||n.sheets.forEach(({rows:e})=>{e.forEach(({cells:t})=>{e.cells&&t.forEach(e=>delete e.enable)})}),t.trigger(`excelExport`,{workbook:n}))return;let r=Object.keys(t._images).filter(function(e){return t.usesImage(e)===1}),i=r.length,a=i?{}:null,o=[];if(i)return r.forEach(function(e){let n=t._images[e];if(n.blob){let t=new Promise(t=>{let r=new FileReader;r.onload=function(){a[e]={type:n.blob.type,name:n.blob.name,data:r.result},i--,t()},r.readAsArrayBuffer(n.blob)});o.push(t)}else{let t=new Promise(t=>{$w(n.url,function(n,r){a[e]={type:r,data:n},i--,t()})});o.push(t)}}),Promise.all(o).then(()=>s());return s();function s(){if(--i<=0){n.images=a;let t=new e.Workbook(n),r=e.forceProxy?t.toDataURL():t.toBlob();return e.saveAs?r.then(t=>{e.saveAs(t,n.fileName||e.fileName,{proxyURL:e.proxyURL,forceProxy:e.forceProxy})}):r}return Promise.resolve()}}draw(e,t){typeof e==`function`&&!t&&(t=e,e={});let n=[],r=this._sheets;(function i(a){if(a<r.length)r[a].draw(Dp,e,function(e){n.push(e),i(a+1)});else{let e=n[0];for(a=1;a<n.length;++a)e.children=e.children.concat(n[a].children);t(e)}})(0)}nameForRef(e,t){t===void 0&&(t=e.sheet),t=t.toLowerCase();let n=String(e);for(let e in this._names){let r=this._names[e],i=r.value;if(i instanceof z&&(!i.sheet||i.sheet&&t===i.sheet.toLowerCase())&&String(i)===n)return r}return{name:n}}defineName(e,t,n){let r=G.parseNameDefinition(e,t);e=r.name.print(),this._names[e.toLowerCase()]={value:r.value,hidden:n,name:e,nameref:r.name}}undefineName(e){delete this._names[e.toLowerCase()]}nameValue(e){return e=e.toLowerCase(),e in this._names?this._names[e].value:null}nameDefinition(e,t){return e=e.toLowerCase(),arguments.length>1&&(t===void 0?delete this._names[e]:this._names[e]=t),this._names[e]}forEachName(e){Object.keys(this._names).forEach(function(t){e(this._names[t],t)},this)}adjustNames(e,t,n,r){e=e.toLowerCase(),Object.keys(this._names).forEach(function(i){let a=this._names[i],o=a.value;o instanceof z&&o.sheet.toLowerCase()===e?a.value=o.adjust(null,null,null,null,t,n,r):o instanceof G.runtime.Formula&&o.adjust(e,t?`row`:`col`,n,r)},this)}addImage(e){let t=String(++this._imgID);return typeof e==`string`?this._images[t]={url:e}:this._images[t]={blob:e},t}imageUrl(e){let t=this._images[e],n=t.url;return n||=t.url=window.URL.createObjectURL(t.blob),n}cleanupImages(){Object.keys(this._images).forEach(function(e){if(!this.usesImage(e)){let t=this._images[e].url;t&&window.URL.revokeObjectURL(t),delete this._images[e]}},this)}usesImage(e){let t,n=this._sheets;for(t=n.length;--t>=0;)if(n[t].usesImage(e))return 1;let r=this.undoRedoStack.stack;for(t=r.length;--t>=0;)if(r[t].usesImage(e))return 2;return!1}};function tT(e,t){function n(e,t,n){return e===void 0?t===void 0?n:t:e}let r=n(e.rowCount,t.rows,200),i=n(e.columnCount,t.columns,50),a=n(e.rowHeight,t.rowHeight,20),o=n(e.columnWidth,t.columnWidth,64),s=n(e.headerHeight,t.headerHeight,20),c=n(e.headerWidth,t.headerWidth,32);if(e.rows!==void 0)for(let t=0;t<e.rows.length;++t){let a=e.rows[t],o=n(a.index,t);if(o>=r&&(r=o+1),a.cells)for(let e=0;e<a.cells.length;++e){let t=a.cells[e],r=n(t.index,e);r>=i&&(i=r+1)}}return{rowCount:r,columnCount:i,rowHeight:a,columnWidth:o,headerHeight:s,headerWidth:c}}let nT=`cut.copy.paste.pdfExport.excelExport.excelImport.changing.change.render.removeSheet.selectSheet.renameSheet.insertRow.insertColumn.deleteRow.insertSheet.deleteColumn.hideRow.hideColumn.unhideRow.unhideColumn.select.changeFormat.dataBinding.dataBound.update.message.contextmenu`.split(`.`);var rT=class extends ab{constructor(e,t){super(e,Vp({},kp,t)),this.events=nT,this.bind(this.events,this.options),om({locale:this.options.locale,...this.options.intl}),Kb(),this._view=new $x(this.element,{messages:this.options.messages.view,toolbar:this.options.toolbar,sheetsbar:this.options.sheetsbar,formulaBarInputRef:this.options.formulaBarInputRef,formulaCellInputRef:this.options.formulaCellInputRef,nameBoxRef:this.options.nameBoxRef,createTabStrip:this.options.createTabStrip,createFilterMenu:this.options.createFilterMenu,createContextMenus:this.options.createContextMenus,createSheetBar:this.options.createSheetBar,getIconHTMLString:this.options.getIconHTMLString,openDialogCallback:this.openDialog.bind(this)}),this._workbook=new eT(this.options,this._view),this._controller=new wg(this._view,this._workbook),this._autoRefresh=!0,this._bindWorkbookEvents(),this._bindViewEvents(),this._view.workbook(this._workbook),this._view.enableClipboard(!1),this.refresh(),this._view.enableClipboard(!0),this._resizeHandler=this.resize.bind(this),window.addEventListener(`resize`,this._resizeHandler),this._keyDownHandler=this._keyDown.bind(this),this.element.addEventListener(`keydown`,this._keyDownHandler)}get view(){return this._view}get workbook(){return this._workbook}_keyDown(e){let t=e.keyCode,n=e.ctrlKey||e.metaKey;if(this.trigger(`keydown`,e),t===jp.F11&&e.shiftKey){this._view.sheetsbar.onAddSelect(),e.preventDefault();return}else if(e.altKey&&t===jp.PAGEDOWN){let e=this.sheetIndex(this.activeSheet()),t=this.sheetByIndex(e+1)?.name();t&&this._view.sheetsbar.onSheetSelect(t)}else if(e.altKey&&t===jp.PAGEUP){let e=this.sheetIndex(this.activeSheet()),t=this.sheetByIndex(e-1)?.name();t&&this._view.sheetsbar.onSheetSelect(t)}else if(e.altKey&&t===jp.DELETE){this._view.sheetsbar.onSheetRemove(this.activeSheet()._name()),e.preventDefault();return}else if(e.altKey&&t===jp.R){this.options.createSheetEditor?.(),e.preventDefault();return}else if(n&&t===jp.B)this._handleTypographicalEmphasis(`bold`);else if(n&&t===jp.I)this._handleTypographicalEmphasis(`italic`);else if(n&&t===jp.U)this._handleTypographicalEmphasis(`underline`);else if(e.altKey&&t===jp.H){this._view.tabstrip?.select(`home`),e.preventDefault();return}else if(e.altKey&&t===jp.N){this._view.tabstrip?.select(`insert`),e.preventDefault();return}else if(e.altKey&&t===jp.A){this._view.tabstrip?.select(`data`),e.preventDefault();return}else t===jp.F10&&(e.preventDefault(),this._view.tabstrip?.focus())}_handleTypographicalEmphasis(e){let t=this.activeSheet();t&&this.executeCommand({command:`PropertyChangeCommand`,options:{property:e,value:!t.range(t.activeCell())[e]()}})}_resize(){this.refresh({layout:!0})}_workbookChanging(e){this.trigger(`changing`,e)&&e.preventDefault()}_workbookChange(e){if(this._autoRefresh&&this.refresh(e),e.recalc&&e.ref){let t=e.range||new X(e.ref,this.activeSheet());this.trigger(`change`,{range:t})}}_workbookCut(e){this.trigger(`cut`,e)}_workbookCopy(e){this.trigger(`copy`,e)}_workbookPaste(e){this.trigger(`paste`,e)}activeSheet(e){return this._workbook.activeSheet(e)}moveSheetToIndex(e,t){return this._workbook.moveSheetToIndex(e,t)}insertSheet(e){return this._workbook.insertSheet(e)}sheets(){return this._workbook.sheets()}removeSheet(e){return this._workbook.removeSheet(e)}sheetByName(e){return this._workbook.sheetByName(e)}sheetIndex(e){return this._workbook.sheetIndex(e)}sheetByIndex(e){return this._workbook.sheetByIndex(e)}renameSheet(e,t){return this._workbook.renameSheet(e,t)}executeCommand(e){return this._controller.executeCommand(e)}refresh(e){return e||=Ap,e.editorClose||(this._view.sheet(this._workbook.activeSheet()),this._controller.sheet(this._workbook.activeSheet()),this._workbook.refresh(e)),e.editorChange||(this._view.refresh(e),this._controller.refresh(),this._view.render(e),this.trigger(`render`)),this}openDialog(e,t){return this._view.openDialog(e,t)}autoRefresh(e){return e===void 0?this._autoRefresh:(this._autoRefresh=e,e===!0&&this.refresh(),this)}toJSON(){return this._workbook.toJSON()}fromJSON(e){e.sheets?(this._workbook.destroy(),this._workbook=new eT(Vp({},this.options,e)),this._bindWorkbookEvents(),this._view.workbook(this._workbook),this._controller.workbook(this._workbook),this.activeSheet(this.activeSheet())):this.refresh()}saveJSON(){return this._workbook.saveJSON()}fromFile(e){return this._workbook.fromFile(e)}saveAsPDF(e){this._workbook.saveAsPDF(Vp({},this.options.pdf,e,{workbook:this._workbook}))}saveAsExcel(e){return this._workbook.saveAsExcel(e)}draw(e,t){this._workbook.draw(e,t)}_workbookExcelExport(e){this.trigger(`excelExport`,e)&&e.preventDefault()}_workbookExcelImport(e){this.trigger(`excelImport`,e)&&e.preventDefault()}_workbookPdfExport(e){this.trigger(`pdfExport`,e)&&e.preventDefault()}_workbookInsertSheet(e){this.trigger(`insertSheet`,e)&&e.preventDefault()}_workbookRemoveSheet(e){this.trigger(`removeSheet`,e)&&e.preventDefault()}_workbookSelectSheet(e){this.trigger(`selectSheet`,e)&&e.preventDefault()}_workbookRenameSheet(e){this.trigger(`renameSheet`,e)&&e.preventDefault()}_workbookInsertRow(e){this.trigger(`insertRow`,e)&&e.preventDefault()}_workbookInsertColumn(e){this.trigger(`insertColumn`,e)&&e.preventDefault()}_workbookDeleteRow(e){this.trigger(`deleteRow`,e)&&e.preventDefault()}_workbookDeleteColumn(e){this.trigger(`deleteColumn`,e)&&e.preventDefault()}_workbookHideRow(e){this.trigger(`hideRow`,e)&&e.preventDefault()}_workbookHideColumn(e){this.trigger(`hideColumn`,e)&&e.preventDefault()}_workbookUnhideRow(e){this.trigger(`unhideRow`,e)&&e.preventDefault()}_workbookUnhideColumn(e){this.trigger(`unhideColumn`,e)&&e.preventDefault()}_workbookSelect(e){this.trigger(`select`,e)}_workbookChangeFormat(e){this.trigger(`changeFormat`,e)}_workbookDataBinding(e){this.trigger(`dataBinding`,e)&&e.preventDefault()}_workbookDataBound(e){this.trigger(`dataBound`,e)}_workbookProgress(){}_viewUpdate(e){this.trigger(`update`,e)}_viewMessage(e){this.trigger(`message`,e)}_onContextMenu(e){this.trigger(`contextmenu`,e)}_bindWorkbookEvents(){this._workbook.bind(`cut`,this._workbookCut.bind(this)),this._workbook.bind(`copy`,this._workbookCopy.bind(this)),this._workbook.bind(`paste`,this._workbookPaste.bind(this)),this._workbook.bind(`changing`,this._workbookChanging.bind(this)),this._workbook.bind(`change`,this._workbookChange.bind(this)),this._workbook.bind(`excelExport`,this._workbookExcelExport.bind(this)),this._workbook.bind(`excelImport`,this._workbookExcelImport.bind(this)),this._workbook.bind(`pdfExport`,this._workbookPdfExport.bind(this)),this._workbook.bind(`insertSheet`,this._workbookInsertSheet.bind(this)),this._workbook.bind(`removeSheet`,this._workbookRemoveSheet.bind(this)),this._workbook.bind(`selectSheet`,this._workbookSelectSheet.bind(this)),this._workbook.bind(`renameSheet`,this._workbookRenameSheet.bind(this)),this._workbook.bind(`insertRow`,this._workbookInsertRow.bind(this)),this._workbook.bind(`insertColumn`,this._workbookInsertColumn.bind(this)),this._workbook.bind(`deleteRow`,this._workbookDeleteRow.bind(this)),this._workbook.bind(`deleteColumn`,this._workbookDeleteColumn.bind(this)),this._workbook.bind(`hideRow`,this._workbookHideRow.bind(this)),this._workbook.bind(`hideColumn`,this._workbookHideColumn.bind(this)),this._workbook.bind(`unhideRow`,this._workbookUnhideRow.bind(this)),this._workbook.bind(`unhideColumn`,this._workbookUnhideColumn.bind(this)),this._workbook.bind(`select`,this._workbookSelect.bind(this)),this._workbook.bind(`changeFormat`,this._workbookChangeFormat.bind(this)),this._workbook.bind(`dataBinding`,this._workbookDataBinding.bind(this)),this._workbook.bind(`dataBound`,this._workbookDataBound.bind(this)),this._workbook.bind(`progress`,this._workbookProgress.bind(this)),this._workbook.bind(`contextmenu`,this._onContextMenu.bind(this))}_bindViewEvents(){this._view.bind(`update`,this._viewUpdate.bind(this)),this._view.bind(`message`,this._viewMessage.bind(this))}destroy(){window.removeEventListener(`resize`,this._resizeHandler),this.element.removeEventListener(`keydown`,this._keyDownHandler),this.unbind(),this._workbook.destroy(),this._controller.destroy(),this._view.destroy()}defineName(e,t,n){return this._workbook.defineName(e,t,n)}undefineName(e){return this._workbook.undefineName(e)}nameValue(e){return this._workbook.nameValue(e)}forEachName(e){return this._workbook.forEachName(e)}cellContextMenu(){return this._view.cellContextMenu}rowHeaderContextMenu(){return this._view.rowHeaderContextMenu}colHeaderContextMenu(){return this._view.colHeaderContextMenu}addImage(e){return this._workbook.addImage(e)}cleanupImages(){return this._workbook.cleanupImages()}};let{packDate:iT,unpackDate:aT,packTime:oT,unpackTime:sT,serialToDate:cT,dateToSerial:lT,defineAlias:uT}=G.runtime;(function(e){e.jQuery.extend(e.spreadsheet,xp),e.spreadsheet.commonEngine=xp})(kendo),e.__meta__={id:`spreadsheet.common`,name:`Spreadsheet common engine`,category:`web`,description:`Spreadsheet component`,depends:[`core`]}});
//# sourceMappingURL=kendo.spreadsheet.common.min.js.map