@omegagrid/bundle 0.7.8 → 0.7.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/omegagrid.js +6 -6
- package/package.json +18 -18
package/omegagrid.js
CHANGED
|
@@ -2747,7 +2747,7 @@
|
|
|
2747
2747
|
og-icon {
|
|
2748
2748
|
margin-right: -4px;
|
|
2749
2749
|
}
|
|
2750
|
-
`],Tg([Ss({type:Array})],Og.prototype,"path",void 0),Tg([Ss({type:Boolean})],Og.prototype,"clickable",void 0),Og=Tg([Cs("og-bucket-path")],Og);class $g{static init(t){$g.monacoPath=t}static async get(){return this.monaco||(this.monaco=await this.load()),this.monaco}static getSync(){return this.monaco}static load(){if(!sn.require)throw new Error("AMDLoader is not initialized");return sn.require.config({paths:{vs:$g.monacoPath}}),new Promise((t=>{sn.require(["vs/editor/editor.main"],(()=>{t(self.monaco)}))}))}static async loadToIFrame(t){if(!sn.require)throw new Error("AMDLoader is not initialized");const e=t.contentWindow;return e.monaco?e.monaco:(await an.load(`${$g.monacoPath}/loader.js`,t.contentDocument),e.require.config({paths:{vs:$g.monacoPath}}),await new Promise((t=>{e.require(["vs/editor/editor.main"],(()=>{t(e.monaco)}))})))}}class Dg extends Event{constructor(t,e,i){super(`code.${t}`,{bubbles:!0,composed:!0}),Object.assign(this,e),this.origEvent=i}}var Ng,Pg,jg,Hg,Bg,Fg,Wg,Vg,Ug,Gg,qg,Yg=function(t,e,i,o){var r,n=arguments.length,s=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s},Zg=function(t,e,i,o){if("a"===i&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?o:"a"===i?o.call(t):o?o.value:e.get(t)},Xg=function(t,e,i,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(t,i):r?r.value=i:e.set(t,i),i};let Qg=qg=class extends xs{constructor(){super(...arguments),Ng.set(this,void 0),Pg.set(this,void 0),jg.set(this,"typescript"),Hg.set(this,!1),Bg.set(this,0),Fg.set(this,void 0),Wg.set(this,void 0),Vg.set(this,void 0),Ug.set(this,void 0),Gg.set(this,(()=>{Zg(this,Ng,"f").updateOptions({theme:this.theme})})),this.getOptions=()=>({...this.options,theme:this.theme,language:Zg(this,jg,"f"),fontSize:tn().fontSize,fontLigatures:""})}get monaco(){return qg.monaco}get editor(){return Zg(this,Ng,"f")}get model(){return Zg(this,Ng,"f")?.getModel()}get options(){return Zg(this,Pg,"f")}set options(t){Xg(this,Pg,t,"f"),Zg(this,Ng,"f")?.updateOptions(t)}get content(){return Zg(this,Ng,"f")?Zg(this,Ng,"f").getValue():Zg(this,Fg,"f")}set content(t){null==t&&(t=""),Zg(this,Ng,"f")?(Xg(this,Hg,!0,"f"),Zg(this,Ng,"f")?.setValue(t)):Xg(this,Fg,t,"f")}get language(){return Zg(this,jg,"f")}set language(t){Xg(this,jg,t,"f"),this.model&&$g.get().then((e=>e.editor.setModelLanguage(this.model,t)))}get selectedContent(){if(!Zg(this,Ng,"f"))return Zg(this,Fg,"f");const t=Zg(this,Ng,"f").getSelections().map((t=>this.model.getValueInRange(t))).join("\n").trim();return null==t||""==t?Zg(this,Ng,"f").getValue():t}get container(){return Zg(this,Ug,"f")??Xg(this,Ug,yt("div",{style:{zIndex:
|
|
2750
|
+
`],Tg([Ss({type:Array})],Og.prototype,"path",void 0),Tg([Ss({type:Boolean})],Og.prototype,"clickable",void 0),Og=Tg([Cs("og-bucket-path")],Og);class $g{static init(t){$g.monacoPath=t}static async get(){return this.monaco||(this.monaco=await this.load()),this.monaco}static getSync(){return this.monaco}static load(){if(!sn.require)throw new Error("AMDLoader is not initialized");return sn.require.config({paths:{vs:$g.monacoPath}}),new Promise((t=>{sn.require(["vs/editor/editor.main"],(()=>{t(self.monaco)}))}))}static async loadToIFrame(t){if(!sn.require)throw new Error("AMDLoader is not initialized");const e=t.contentWindow;return e.monaco?e.monaco:(await an.load(`${$g.monacoPath}/loader.js`,t.contentDocument),e.require.config({paths:{vs:$g.monacoPath}}),await new Promise((t=>{e.require(["vs/editor/editor.main"],(()=>{t(e.monaco)}))})))}}class Dg extends Event{constructor(t,e,i){super(`code.${t}`,{bubbles:!0,composed:!0}),Object.assign(this,e),this.origEvent=i}}var Ng,Pg,jg,Hg,Bg,Fg,Wg,Vg,Ug,Gg,qg,Yg=function(t,e,i,o){var r,n=arguments.length,s=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s},Zg=function(t,e,i,o){if("a"===i&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?o:"a"===i?o.call(t):o?o.value:e.get(t)},Xg=function(t,e,i,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(t,i):r?r.value=i:e.set(t,i),i};let Qg=qg=class extends xs{constructor(){super(...arguments),Ng.set(this,void 0),Pg.set(this,void 0),jg.set(this,"typescript"),Hg.set(this,!1),Bg.set(this,0),Fg.set(this,void 0),Wg.set(this,void 0),Vg.set(this,void 0),Ug.set(this,void 0),Gg.set(this,(()=>{Zg(this,Ng,"f").updateOptions({theme:this.theme})})),this.zIndex=qg.defaultZIndex,this.getOptions=()=>({...this.options,theme:this.theme,language:Zg(this,jg,"f"),fontSize:tn().fontSize,fontLigatures:""})}get monaco(){return qg.monaco}get editor(){return Zg(this,Ng,"f")}get model(){return Zg(this,Ng,"f")?.getModel()}get options(){return Zg(this,Pg,"f")}set options(t){Xg(this,Pg,t,"f"),Zg(this,Ng,"f")?.updateOptions(t)}get content(){return Zg(this,Ng,"f")?Zg(this,Ng,"f").getValue():Zg(this,Fg,"f")}set content(t){null==t&&(t=""),Zg(this,Ng,"f")?(Xg(this,Hg,!0,"f"),Zg(this,Ng,"f")?.setValue(t)):Xg(this,Fg,t,"f")}get language(){return Zg(this,jg,"f")}set language(t){Xg(this,jg,t,"f"),this.model&&$g.get().then((e=>e.editor.setModelLanguage(this.model,t)))}get selectedContent(){if(!Zg(this,Ng,"f"))return Zg(this,Fg,"f");const t=Zg(this,Ng,"f").getSelections().map((t=>this.model.getValueInRange(t))).join("\n").trim();return null==t||""==t?Zg(this,Ng,"f").getValue():t}get container(){return Zg(this,Ug,"f")??Xg(this,Ug,yt("div",{style:{zIndex:this.zIndex.toString()}}),"f")}get theme(){return"light"==Aa().activeTheme?.type?"vs":"vs-dark"}showContainer(){this.container.parentElement!==document.body&&document.body.appendChild(this.container)}hideContainer(){Zg(this,Ug,"f")?.remove()}async initEditor(){if(Zg(this,Bg,"f")>0)return;Xg(this,Bg,1,"f"),qg.monaco=await $g.get(),Xg(this,Ng,qg.monaco.editor.create(this.container,this.getOptions()),"f");const t=Zg(this,jg,"f"),e=qg.monaco.editor.createModel(Zg(this,Fg,"f"),t);Zg(this,Ng,"f").setModel(e),Zg(this,Wg,"f")&&Zg(this,Ng,"f").setSelection(Zg(this,Wg,"f")),Zg(this,Vg,"f")&&Zg(this,Ng,"f").setScrollPosition({scrollTop:Zg(this,Vg,"f").top,scrollLeft:Zg(this,Vg,"f").left}),Zg(this,Ng,"f").onDidBlurEditorText((()=>{this.dispatchEvent(new Dg("blur",{editor:Zg(this,Ng,"f")}))})),Zg(this,Ng,"f").onDidChangeModelContent((t=>{Zg(this,Hg,"f")?Xg(this,Hg,!1,"f"):(this.dispatchEvent(new Dg("change",{editor:Zg(this,Ng,"f"),changes:t.changes})),this.dispatchEvent(new qr({value:e})))})),Zg(this,Ng,"f").onKeyDown((t=>{this.dispatchEvent(new Dg("keydown",{editor:Zg(this,Ng,"f")},t.browserEvent))})),Xg(this,Hg,!1,"f"),Xg(this,Bg,2,"f"),this.dispatchEvent(new Dg("ready",{editor:Zg(this,Ng,"f")})),Zg(this,Ng,"f").focus(),setTimeout((()=>{Zg(this,jg,"f")!=t&&qg.monaco.editor.setModelLanguage(e,Zg(this,jg,"f"))}),100)}async updated(){await this.initEditor(),this.layout()}connectedCallback(){super.connectedCallback(),Aa().addEventListener("change",Zg(this,Gg,"f")),this.hasUpdated&&(this.initEditor(),this.layout())}disconnectedCallback(){Aa().removeEventListener("change",Zg(this,Gg,"f")),this.hideContainer()}layout(){if(!this.isConnected||this.clientWidth<10||this.clientHeight<10)return void this.hideContainer();this.showContainer();const t=Tt(this,document.body);Ht(this.container,{t:t.top+1,l:t.left+1}),Nt(this.container,{w:this.clientWidth-1,h:this.clientHeight-1}),this.editor?.layout()}dispose(){Zg(this,Ug,"f")?.remove(),Xg(this,Ug,null,"f"),Zg(this,Ng,"f")?.dispose(),Xg(this,Ng,null,"f"),Xg(this,Bg,0,"f")}focus(){Zg(this,Ng,"f")?.focus()}};Ng=new WeakMap,Pg=new WeakMap,jg=new WeakMap,Hg=new WeakMap,Bg=new WeakMap,Fg=new WeakMap,Wg=new WeakMap,Vg=new WeakMap,Ug=new WeakMap,Gg=new WeakMap,Qg.defaultZIndex=1e4,Qg.styles=fn`
|
|
2751
2751
|
:host {
|
|
2752
2752
|
user-select: text;
|
|
2753
2753
|
display: block;
|
|
@@ -2755,7 +2755,7 @@
|
|
|
2755
2755
|
height: 100%;
|
|
2756
2756
|
position: relative;
|
|
2757
2757
|
}
|
|
2758
|
-
`,Yg([Ss({type:Object,noAccessor:!0})],Qg.prototype,"options",null),Yg([Ss({type:String,noAccessor:!0})],Qg.prototype,"content",null),Yg([Ss({type:String,noAccessor:!0})],Qg.prototype,"language",null),Qg=qg=Yg([Cs("og-code")],Qg);var Kg,Jg,tm,em,im,om,rm,nm,sm,am,lm,cm,hm=function(t,e,i,o){var r,n=arguments.length,s=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s},dm=function(t,e,i,o){if("a"===i&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?o:"a"===i?o.call(t):o?o.value:e.get(t)},um=function(t,e,i,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(t,i):r?r.value=i:e.set(t,i),i};let pm=cm=class extends xs{constructor(){super(...arguments),Kg.set(this,!1),Jg.set(this,0),tm.set(this,void 0),em.set(this,void 0),im.set(this,void 0),om.set(this,void 0),rm.set(this,""),nm.set(this,""),sm.set(this,"typescript"),am.set(this,void 0),lm.set(this,(()=>{this.editor.updateOptions({theme:this.theme})})),this.getOptions=()=>({...this.options,theme:this.theme,fontSize:tn().fontSize,fontLigatures:""})}get monaco(){return cm.monaco}get editor(){return dm(this,im,"f")}get modifiedModel(){return dm(this,im,"f")?.getModel().modified}get originalModel(){return dm(this,im,"f")?.getModel().original}get options(){return dm(this,om,"f")}set options(t){um(this,om,t,"f"),dm(this,im,"f")?.updateOptions(t)}get modifiedContent(){return this.modifiedModel?this.modifiedModel.getValue():dm(this,rm,"f")}set modifiedContent(t){this.modifiedModel?(um(this,Kg,!0,"f"),this.modifiedModel.setValue(t)):um(this,rm,t,"f")}get originalContent(){return this.originalModel?this.originalModel.getValue():dm(this,nm,"f")}set originalContent(t){this.originalModel?(um(this,Kg,!0,"f"),this.originalModel.setValue(t)):um(this,nm,t,"f")}get language(){return dm(this,sm,"f")}set language(t){um(this,sm,t,"f"),dm(this,im,"f")&&$g.get().then((e=>{e.editor.setModelLanguage(dm(this,im,"f").getModel().modified,t),e.editor.setModelLanguage(dm(this,im,"f").getModel().original,t)}))}get selectedContent(){if(!dm(this,im,"f"))return dm(this,nm,"f");if(!dm(this,em,"f"))return dm(this,nm,"f");const t=dm(this,im,"f").getSelections().map((t=>dm(this,em,"f").getValueInRange(t))).join("\n").trim();return null==t||""==t?dm(this,em,"f").getValue():t}get container(){return dm(this,am,"f")??um(this,am,yt("div",{style:{zIndex:
|
|
2758
|
+
`,Yg([Ss({type:Object,noAccessor:!0})],Qg.prototype,"options",null),Yg([Ss({type:String,noAccessor:!0})],Qg.prototype,"content",null),Yg([Ss({type:String,noAccessor:!0})],Qg.prototype,"language",null),Yg([Ss({type:Number})],Qg.prototype,"zIndex",void 0),Qg=qg=Yg([Cs("og-code")],Qg);var Kg,Jg,tm,em,im,om,rm,nm,sm,am,lm,cm,hm=function(t,e,i,o){var r,n=arguments.length,s=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s},dm=function(t,e,i,o){if("a"===i&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?o:"a"===i?o.call(t):o?o.value:e.get(t)},um=function(t,e,i,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(t,i):r?r.value=i:e.set(t,i),i};let pm=cm=class extends xs{constructor(){super(...arguments),Kg.set(this,!1),Jg.set(this,0),tm.set(this,void 0),em.set(this,void 0),im.set(this,void 0),om.set(this,void 0),rm.set(this,""),nm.set(this,""),sm.set(this,"typescript"),am.set(this,void 0),lm.set(this,(()=>{this.editor.updateOptions({theme:this.theme})})),this.zIndex=Qg.defaultZIndex,this.getOptions=()=>({...this.options,theme:this.theme,fontSize:tn().fontSize,fontLigatures:""})}get monaco(){return cm.monaco}get editor(){return dm(this,im,"f")}get modifiedModel(){return dm(this,im,"f")?.getModel().modified}get originalModel(){return dm(this,im,"f")?.getModel().original}get options(){return dm(this,om,"f")}set options(t){um(this,om,t,"f"),dm(this,im,"f")?.updateOptions(t)}get modifiedContent(){return this.modifiedModel?this.modifiedModel.getValue():dm(this,rm,"f")}set modifiedContent(t){this.modifiedModel?(um(this,Kg,!0,"f"),this.modifiedModel.setValue(t)):um(this,rm,t,"f")}get originalContent(){return this.originalModel?this.originalModel.getValue():dm(this,nm,"f")}set originalContent(t){this.originalModel?(um(this,Kg,!0,"f"),this.originalModel.setValue(t)):um(this,nm,t,"f")}get language(){return dm(this,sm,"f")}set language(t){um(this,sm,t,"f"),dm(this,im,"f")&&$g.get().then((e=>{e.editor.setModelLanguage(dm(this,im,"f").getModel().modified,t),e.editor.setModelLanguage(dm(this,im,"f").getModel().original,t)}))}get selectedContent(){if(!dm(this,im,"f"))return dm(this,nm,"f");if(!dm(this,em,"f"))return dm(this,nm,"f");const t=dm(this,im,"f").getSelections().map((t=>dm(this,em,"f").getValueInRange(t))).join("\n").trim();return null==t||""==t?dm(this,em,"f").getValue():t}get container(){return dm(this,am,"f")??um(this,am,yt("div",{style:{zIndex:this.zIndex.toString()}}),"f")}get theme(){return"light"==Aa().activeTheme?.type?"vs":"vs-dark"}showContainer(){this.container.parentElement!==document.body&&document.body.appendChild(this.container)}hideContainer(){dm(this,am,"f")?.remove()}async initEditor(){if(dm(this,Jg,"f")>0)return;um(this,Jg,1,"f"),cm.monaco=await $g.get(),um(this,im,cm.monaco.editor.createDiffEditor(this.container,this.getOptions()),"f");const t=dm(this,sm,"f"),e=cm.monaco.editor.createModel(dm(this,nm,"f"),t),i=cm.monaco.editor.createModel(dm(this,rm,"f"),t);this.editor.setModel({original:e,modified:i}),dm(this,tm,"f")&&dm(this,im,"f").setSelection(dm(this,tm,"f")),i.onDidChangeContent((t=>{dm(this,Kg,"f")?um(this,Kg,!1,"f"):(this.dispatchEvent(new Dg("change",{editor:this.editor,changes:t.changes})),this.dispatchEvent(new qr({value:this.editor.getModel().modified.getValue()})))}));const o=dm(this,im,"f").getModifiedEditor(),r=dm(this,im,"f").getOriginalEditor();o.onDidFocusEditorText((()=>um(this,em,o.getModel(),"f"))),r.onDidFocusEditorText((()=>um(this,em,r.getModel(),"f"))),o.onKeyDown((t=>{this.dispatchEvent(new Dg("keydown",{editor:dm(this,im,"f")},t.browserEvent))})),r.onKeyDown((t=>{this.dispatchEvent(new Dg("keydown",{editor:dm(this,im,"f")},t.browserEvent))})),um(this,Kg,!1,"f"),um(this,Jg,2,"f"),this.dispatchEvent(new Dg("ready",{editor:dm(this,im,"f")})),dm(this,im,"f").focus(),setTimeout((()=>{dm(this,sm,"f")!=t&&(cm.monaco.editor.setModelLanguage(dm(this,im,"f").getModel().modified,dm(this,sm,"f")),cm.monaco.editor.setModelLanguage(dm(this,im,"f").getModel().original,dm(this,sm,"f")))}),100)}async updated(){await this.initEditor(),this.layout()}connectedCallback(){super.connectedCallback(),Aa().addEventListener("change",dm(this,lm,"f")),this.hasUpdated&&(this.initEditor(),this.layout())}disconnectedCallback(){Aa().removeEventListener("change",dm(this,lm,"f")),this.hideContainer()}layout(){if(!this.isConnected||this.clientWidth<10||this.clientHeight<10)return void this.hideContainer();this.showContainer();const t=Tt(this,document.body);Ht(this.container,{t:t.top+1,l:t.left+1});const e=this.clientWidth-1,i=this.clientHeight-1;Nt(this.container,{w:e,h:i}),dm(this,im,"f")?.layout({width:e,height:i})}dispose(){dm(this,am,"f")?.remove(),um(this,am,null,"f"),dm(this,im,"f")?.dispose(),um(this,im,null,"f"),um(this,Jg,0,"f")}focus(){dm(this,im,"f")?.focus()}};Kg=new WeakMap,Jg=new WeakMap,tm=new WeakMap,em=new WeakMap,im=new WeakMap,om=new WeakMap,rm=new WeakMap,nm=new WeakMap,sm=new WeakMap,am=new WeakMap,lm=new WeakMap,pm.styles=fn`
|
|
2759
2759
|
:host {
|
|
2760
2760
|
user-select: text;
|
|
2761
2761
|
display: block;
|
|
@@ -2769,7 +2769,7 @@
|
|
|
2769
2769
|
height: 100%;
|
|
2770
2770
|
border: none;
|
|
2771
2771
|
}
|
|
2772
|
-
`,hm([Ss({type:Object,noAccessor:!0})],pm.prototype,"options",null),hm([Ss({type:String,noAccessor:!0})],pm.prototype,"modifiedContent",null),hm([Ss({type:String,noAccessor:!0})],pm.prototype,"originalContent",null),hm([Ss({type:String,noAccessor:!0})],pm.prototype,"language",null),pm=cm=hm([Cs("og-code-diff")],pm);class gm extends(Lr()){get type(){return this._type}set type(t){this._type=t}get checkbox(){return this._checkbox}set checkbox(t){this._checkbox=t}get key(){return this._key}set key(t){this._key=t}get value(){return this._value}set value(t){this._value=t}get htmlValue(){return this._htmlValue}set htmlValue(t){this._htmlValue=t}get icon(){return this._icon}set icon(t){this._icon=t}get folder(){return this._folder}set folder(t){this._folder=t}get renderer(){return this._renderer||this.model.options.nodeRenderer}set renderer(t){this._renderer=t}get properties(){return this._properties}set properties(t){this._properties=t}constructor(t,e){super(),this.model=t,this.subLevels=null,this._checkbox=null,this.populate(e)}populate(t){super.populate(t),this.key=t.hasOwnProperty("key")?t.key:t.k,this.value=((t.hasOwnProperty("value")?t.value:t.v)??"").toString(),this.type=t.t,this.icon=t.icon,this.folder=t.folder,this.checkbox=t.ch??null,this.renderer=t.renderer,this._properties=t.props}getSourceData(){const t=super.getSourceData();return this.key&&(t.k=this.key),this.value&&(t.v=this.value),this.type&&(t.t=this.type),this.icon&&(t.icon=this.icon),this.folder&&(t.folder=this.folder),null!=this.checkbox&&(t.ch=this.checkbox),this.properties&&(t.props=this.properties),t}}class mm{get maxLevel(){return this._maxLevel}get root(){return this._root}get nodes(){return this._nodes}get visibleNodes(){return this._visibleNodes}getNodeByViewIndex(t){return this.visibleNodes[t]}constructor(t,e){this.options=e,this.nodeMap=new Map,this._maxLevel=-1,this.populate(t)}populate(t){this._root=new gm(this,{k:null,v:null,i:-1}),this._root.level=-1,this._nodes=t.map(((t,e)=>new gm(this,{...t,i:e}))),this._maxLevel=Tr(this._nodes,this._root),this.indexNodes(!0),this.indexVisibleNodes()}insertNodes(t,e){const i=this.nodes[t].parent,o=isNaN(e)?e.length:e,r=isNaN(e)?e:new Array(o).fill(null).map((()=>new gm(this,{})));return this.nodes.splice(t,0,...r),this.maxLevel>0&&i.insertChildren(r,t-(i.index||-1)-1),this.indexNodes(),this.indexVisibleNodes(),r}deleteNodes(t,e){const i=this.nodes[t].parent,o=this.nodes.splice(t,e);return i?.deleteChildren(o),this.indexNodes(!0),this.indexVisibleNodes(),o}calculateNodeLevels(t){let e=t.parent;for(;e;)e.subLevels=Math.max(e.subLevels,t.level-e.level+(t.hasChildren?1:0)),e=e.parent}indexNodes(t=!1){this.nodeMap.clear(),this._nodes.forEach(((e,i)=>{e.index=i,this.nodeMap.set(e.key,e),t&&this.calculateNodeLevels(e)}))}indexNodesByTree(t=!1){this.nodeMap.clear(),this._nodes=[];let e=0;this.root.walk((i=>{i.index=e++,i.visibleIndex=null,this._nodes.push(i),this.nodeMap.set(i.key,i),t&&this.calculateNodeLevels(i)})),this._maxLevel=this.root.subLevels-1,this.indexVisibleNodes()}indexVisibleNodes(){this._visibleNodes=[];const t=this.options?.pageSize;t>0?this.root.walkVisible((t=>{t.visibleIndex=this._visibleNodes.length,this._visibleNodes.push(t),t.parent&&t.parent.lastChild===t&&t.parent.isPartialyLoaded&&this._visibleNodes.push({placeholder:!0,parent:t.parent})})):this.root.walkVisible((t=>{t.visibleIndex=this._visibleNodes.length,this._visibleNodes.push(t)}))}getSourceData(){return this.nodes.map((t=>t.getSourceData()))}}var fm,vm,bm;function ym(t){return t.map((t=>Array.isArray(t)?t:[t.toString(),0,1]))}!function(t){t.None="none",t.Single="single",t.Multiple="multiple",t.MultipleLevels="multipleLevels"}(fm||(fm={})),function(t){t.Numeric="n",t.Text="t",t.Date="d",t.Boolean="b"}(vm||(vm={})),function(t){t[t.None=0]="None",t[t.Checked=1]="Checked",t[t.CheckedByParent=2]="CheckedByParent",t[t.Unchecked=3]="Unchecked"}(bm||(bm={}));class wm{get count(){return this.items.size}constructor(t,e){this.options=t,this.items=new Map,e&&this.populate(e)}ensureItem(t,e){this.items.has(t)||this.items.set(t,{levels:new Map});const i=this.items.get(t);return null!=e&&(i.value=e),i}setItems(t){this.populate(t??[])}populate(t){const e=this.items;this.items=new Map,t.forEach((t=>{const i=t[3]?.v??t[3]?.value??e.get(t[0])?.value,o=this.ensureItem(t[0],i);o.levels.set(t[1]??0,1==(t[2]??1)),t[3]&&Object.assign(o,t[3])}))}getPropertySerializer(t){return(e,i)=>t.reduce(((t,o)=>(t[o]="v"==o||"value"==o?i.value??this.model?.nodeMap.get(e)?.value:this.model?.nodeMap.get(e)?.value,t)),{})}serialize(t){const e=[],i=t?.length?this.getPropertySerializer(t):null;return this.items.forEach(((t,o)=>{const r=i?i(o,t):null;t.levels.forEach(((t,i)=>e.push(r?[o,i,t?1:0,r]:[o,i,t?1:0])))})),e}clear(){this.items.clear()}validateChange(t,e,i){return this.options.selectMode!=fm.Single||!1!==i||1!=this.items.size}toggle(t,e){let i=this.ensureItem(t.key,t.value);const o=i.levels.has(e)?i.levels.get(e):null;return this.validateChange(t,e,!i.levels.has(e)||!i.levels.get(e))?(o?i.levels.delete(e):this.options.selectMode==fm.MultipleLevels?0==e&&this.isSelectedByParent(t)?!1===o?i.levels.delete(0):i.levels.set(0,!1):i.levels.set(e,!0):(this.options.selectMode==fm.Single&&(this.clear(),i=this.ensureItem(t.key,t.value)),0==e?i.levels.set(0,!0):this.toggleChildNodes(t,e)),0==i.levels.size&&this.clearItemSelection(t),this):this}select(t,e,i=!0){const o=this.ensureItem(t.key,t.value);return this.validateChange(t,e,null===i?!!o.levels.has(e)&&o.levels.get(e):i)?(!0===i?o.levels.set(e,!0):!1===i&&this.options.selectMode==fm.MultipleLevels?o.levels.set(e,!1):o.levels.delete(e),0==o.levels.size&&this.clearItemSelection(t),this):this}deselect(t,e){return this.validateChange(t,e,!1)?(this.items.has(t.key)&&(this.items.get(t.key).levels.delete(e),0==this.items.get(t.key).levels.size&&this.clearItemSelection(t)),this):this}clearItemSelection(t){this.items.delete(t.key)}getLevelSelection(t){return this.items.has(t.key)?this.items.get(t.key).levels:new Map}getValue(t,e,i=null){return this.items.has(t.key)?((t,e,i=null)=>t.has(e)?t.get(e):i)(this.items.get(t.key).levels,e,i):i}isSelectedByParent(t){let e=t.parent,i=0;for(;e;){if(this.getValue(e,++i,!1))return!0;e=e.parent}return!1}getSelectionStatus(t){const e=this.getValue(t,0,null);return!0===e?bm.Checked:!1===e?bm.Unchecked:this.options.selectMode==fm.MultipleLevels&&this.isSelectedByParent(t)?bm.CheckedByParent:bm.None}toggleChildNodes(t,e){const i=t.level;let o=null;t.walk((t=>{if(t.level-i==e)return null===o&&(o=this.getSelectionStatus(t)!=bm.Checked),this.select(t,0,!!o||null),!1}))}}const xm={DEFAULT_NODE_HEIGHT:20,DEFAULT_MAX_NODES:10,RENDERING_NODE_TRESHOLD:20,TREE_COLUMN_WIDTH:16,MAX_HIGHLIGHT_ITEM_OFFSET:2,SEARCH_DEBOUNCE_DELAY:300,...G},km={nodeHeight:xm.DEFAULT_NODE_HEIGHT,renderingNodeTreshold:xm.RENDERING_NODE_TRESHOLD,selectMode:fm.MultipleLevels,levelIndent:10,maxLevel:null,globalLevels:!0,levelsAlwaysVisible:!0,allowEmpty:!0,itemProperties:[],itemTypeOptions:{},expanders:!0,search:!1,checkboxes:!0,autoClose:!1,folderOptions:null,alwaysRefresh:!1};function Cm(t,e=null){return{...en(t,e),...km,...e,...t}}const Mm=fn`
|
|
2772
|
+
`,hm([Ss({type:Object,noAccessor:!0})],pm.prototype,"options",null),hm([Ss({type:String,noAccessor:!0})],pm.prototype,"modifiedContent",null),hm([Ss({type:String,noAccessor:!0})],pm.prototype,"originalContent",null),hm([Ss({type:String,noAccessor:!0})],pm.prototype,"language",null),hm([Ss({type:Number})],pm.prototype,"zIndex",void 0),pm=cm=hm([Cs("og-code-diff")],pm);class gm extends(Lr()){get type(){return this._type}set type(t){this._type=t}get checkbox(){return this._checkbox}set checkbox(t){this._checkbox=t}get key(){return this._key}set key(t){this._key=t}get value(){return this._value}set value(t){this._value=t}get htmlValue(){return this._htmlValue}set htmlValue(t){this._htmlValue=t}get icon(){return this._icon}set icon(t){this._icon=t}get folder(){return this._folder}set folder(t){this._folder=t}get renderer(){return this._renderer||this.model.options.nodeRenderer}set renderer(t){this._renderer=t}get properties(){return this._properties}set properties(t){this._properties=t}constructor(t,e){super(),this.model=t,this.subLevels=null,this._checkbox=null,this.populate(e)}populate(t){super.populate(t),this.key=t.hasOwnProperty("key")?t.key:t.k,this.value=((t.hasOwnProperty("value")?t.value:t.v)??"").toString(),this.type=t.t,this.icon=t.icon,this.folder=t.folder,this.checkbox=t.ch??null,this.renderer=t.renderer,this._properties=t.props}getSourceData(){const t=super.getSourceData();return this.key&&(t.k=this.key),this.value&&(t.v=this.value),this.type&&(t.t=this.type),this.icon&&(t.icon=this.icon),this.folder&&(t.folder=this.folder),null!=this.checkbox&&(t.ch=this.checkbox),this.properties&&(t.props=this.properties),t}}class mm{get maxLevel(){return this._maxLevel}get root(){return this._root}get nodes(){return this._nodes}get visibleNodes(){return this._visibleNodes}getNodeByViewIndex(t){return this.visibleNodes[t]}constructor(t,e){this.options=e,this.nodeMap=new Map,this._maxLevel=-1,this.populate(t)}populate(t){this._root=new gm(this,{k:null,v:null,i:-1}),this._root.level=-1,this._nodes=t.map(((t,e)=>new gm(this,{...t,i:e}))),this._maxLevel=Tr(this._nodes,this._root),this.indexNodes(!0),this.indexVisibleNodes()}insertNodes(t,e){const i=this.nodes[t].parent,o=isNaN(e)?e.length:e,r=isNaN(e)?e:new Array(o).fill(null).map((()=>new gm(this,{})));return this.nodes.splice(t,0,...r),this.maxLevel>0&&i.insertChildren(r,t-(i.index||-1)-1),this.indexNodes(),this.indexVisibleNodes(),r}deleteNodes(t,e){const i=this.nodes[t].parent,o=this.nodes.splice(t,e);return i?.deleteChildren(o),this.indexNodes(!0),this.indexVisibleNodes(),o}calculateNodeLevels(t){let e=t.parent;for(;e;)e.subLevels=Math.max(e.subLevels,t.level-e.level+(t.hasChildren?1:0)),e=e.parent}indexNodes(t=!1){this.nodeMap.clear(),this._nodes.forEach(((e,i)=>{e.index=i,this.nodeMap.set(e.key,e),t&&this.calculateNodeLevels(e)}))}indexNodesByTree(t=!1){this.nodeMap.clear(),this._nodes=[];let e=0;this.root.walk((i=>{i.index=e++,i.visibleIndex=null,this._nodes.push(i),this.nodeMap.set(i.key,i),t&&this.calculateNodeLevels(i)})),this._maxLevel=this.root.subLevels-1,this.indexVisibleNodes()}indexVisibleNodes(){this._visibleNodes=[];const t=this.options?.pageSize;t>0?this.root.walkVisible((t=>{t.visibleIndex=this._visibleNodes.length,this._visibleNodes.push(t),t.parent&&t.parent.lastChild===t&&t.parent.isPartialyLoaded&&this._visibleNodes.push({placeholder:!0,parent:t.parent})})):this.root.walkVisible((t=>{t.visibleIndex=this._visibleNodes.length,this._visibleNodes.push(t)}))}getSourceData(){return this.nodes.map((t=>t.getSourceData()))}}var fm,vm,bm;function ym(t){return t.map((t=>Array.isArray(t)?t:[t.toString(),0,1]))}!function(t){t.None="none",t.Single="single",t.Multiple="multiple",t.MultipleLevels="multipleLevels"}(fm||(fm={})),function(t){t.Numeric="n",t.Text="t",t.Date="d",t.Boolean="b"}(vm||(vm={})),function(t){t[t.None=0]="None",t[t.Checked=1]="Checked",t[t.CheckedByParent=2]="CheckedByParent",t[t.Unchecked=3]="Unchecked"}(bm||(bm={}));class wm{get count(){return this.items.size}constructor(t,e){this.options=t,this.items=new Map,e&&this.populate(e)}ensureItem(t,e){this.items.has(t)||this.items.set(t,{levels:new Map});const i=this.items.get(t);return null!=e&&(i.value=e),i}setItems(t){this.populate(t??[])}populate(t){const e=this.items;this.items=new Map,t.forEach((t=>{const i=t[3]?.v??t[3]?.value??e.get(t[0])?.value,o=this.ensureItem(t[0],i);o.levels.set(t[1]??0,1==(t[2]??1)),t[3]&&Object.assign(o,t[3])}))}getPropertySerializer(t){return(e,i)=>t.reduce(((t,o)=>(t[o]="v"==o||"value"==o?i.value??this.model?.nodeMap.get(e)?.value:this.model?.nodeMap.get(e)?.value,t)),{})}serialize(t){const e=[],i=t?.length?this.getPropertySerializer(t):null;return this.items.forEach(((t,o)=>{const r=i?i(o,t):null;t.levels.forEach(((t,i)=>e.push(r?[o,i,t?1:0,r]:[o,i,t?1:0])))})),e}clear(){this.items.clear()}validateChange(t,e,i){return this.options.selectMode!=fm.Single||!1!==i||1!=this.items.size}toggle(t,e){let i=this.ensureItem(t.key,t.value);const o=i.levels.has(e)?i.levels.get(e):null;return this.validateChange(t,e,!i.levels.has(e)||!i.levels.get(e))?(o?i.levels.delete(e):this.options.selectMode==fm.MultipleLevels?0==e&&this.isSelectedByParent(t)?!1===o?i.levels.delete(0):i.levels.set(0,!1):i.levels.set(e,!0):(this.options.selectMode==fm.Single&&(this.clear(),i=this.ensureItem(t.key,t.value)),0==e?i.levels.set(0,!0):this.toggleChildNodes(t,e)),0==i.levels.size&&this.clearItemSelection(t),this):this}select(t,e,i=!0){const o=this.ensureItem(t.key,t.value);return this.validateChange(t,e,null===i?!!o.levels.has(e)&&o.levels.get(e):i)?(!0===i?o.levels.set(e,!0):!1===i&&this.options.selectMode==fm.MultipleLevels?o.levels.set(e,!1):o.levels.delete(e),0==o.levels.size&&this.clearItemSelection(t),this):this}deselect(t,e){return this.validateChange(t,e,!1)?(this.items.has(t.key)&&(this.items.get(t.key).levels.delete(e),0==this.items.get(t.key).levels.size&&this.clearItemSelection(t)),this):this}clearItemSelection(t){this.items.delete(t.key)}getLevelSelection(t){return this.items.has(t.key)?this.items.get(t.key).levels:new Map}getValue(t,e,i=null){return this.items.has(t.key)?((t,e,i=null)=>t.has(e)?t.get(e):i)(this.items.get(t.key).levels,e,i):i}isSelectedByParent(t){let e=t.parent,i=0;for(;e;){if(this.getValue(e,++i,!1))return!0;e=e.parent}return!1}getSelectionStatus(t){const e=this.getValue(t,0,null);return!0===e?bm.Checked:!1===e?bm.Unchecked:this.options.selectMode==fm.MultipleLevels&&this.isSelectedByParent(t)?bm.CheckedByParent:bm.None}toggleChildNodes(t,e){const i=t.level;let o=null;t.walk((t=>{if(t.level-i==e)return null===o&&(o=this.getSelectionStatus(t)!=bm.Checked),this.select(t,0,!!o||null),!1}))}}const xm={DEFAULT_NODE_HEIGHT:20,DEFAULT_MAX_NODES:10,RENDERING_NODE_TRESHOLD:20,TREE_COLUMN_WIDTH:16,MAX_HIGHLIGHT_ITEM_OFFSET:2,SEARCH_DEBOUNCE_DELAY:300,...G},km={nodeHeight:xm.DEFAULT_NODE_HEIGHT,renderingNodeTreshold:xm.RENDERING_NODE_TRESHOLD,selectMode:fm.MultipleLevels,levelIndent:10,maxLevel:null,globalLevels:!0,levelsAlwaysVisible:!0,allowEmpty:!0,itemProperties:[],itemTypeOptions:{},expanders:!0,search:!1,checkboxes:!0,autoClose:!1,folderOptions:null,alwaysRefresh:!1};function Cm(t,e=null){return{...en(t,e),...km,...e,...t}}const Mm=fn`
|
|
2773
2773
|
:host {
|
|
2774
2774
|
font-size: var(--og-font-size);
|
|
2775
2775
|
font-family: var(--og-font-family);
|
|
@@ -3431,7 +3431,7 @@
|
|
|
3431
3431
|
padding-right: 2px;
|
|
3432
3432
|
}
|
|
3433
3433
|
|
|
3434
|
-
`,Af={enabled:!1,includeChildren:!0,includeParents:!0},Of={enabled:!0,reversed:!1},$f={ROW_HEIGHT:22,RESIZE_TRESHOLD:10,ROW_HEADER_WIDTH:60,SLIDER_SIZE:12,EXPANDER_SIZE:13,MAX_CACHE_ITEMS:5e3,CACHE_CLEAN_INTERVAL:30,COMMENT_HIDE_TIMEOUT:1e3,SELECTOR_BORDER_WIDTH:2,MIN_ROW_HEIGHT:5,MIN_COL_WIDTH:5,SPARKLINE_GAP:4,AUTOSCROLL_TRESHOLD:100,AUTOSCROLL_RATIO:1.1,AUTOSCROLL_INTERVAL:100,DEFAULT_SPARKLINE_OPTIONS:{minValue:"auto",maxValue:"auto",type:"line",style:{color:"0094FF",weight:1},marker:{color:"ff0000"}},DEFAULT_OPTIONS:{rows:100,columns:20,readOnly:!1,rowNumbers:!0,rowPriority:2,rowTree:{enabled:!0},columnTree:{enabled:!0},colLetters:!0,emptyPlaceholder:!0,freezeTop:0,fontSize:12,rowHeight:22,rowResize:!0,columnWidth:100,columnResize:!0,columnPriority:1,freezeLeft:0,freezeRight:0,freezeBottom:0,maxSortingColumns:3,numberFormat:null,levelIndentFactor:2,cellIndentFactor:10,emptyClickable:!1,grid:!0,autofill:!0,undoRedo:!0,commandWindow:!0,cellCache:!0,singleCellModel:!1,zoom:1,editing:{rowInsertion:!0,rowDeletion:!0,colInsertion:!0,colDeletion:!0,rowOutline:!0,colOutline:!0,dateCalendarEditor:!1},comments:{hideTimeout:1e3,offsetX:30,offsetY:-30,zIndex:500,headerPosition:"top"},scrolling:{verticalOverscroll:!0,horizontalOverscroll:!0,scrollbarVisibilityTreshold:100},selecting:{enabled:!0,multiSelect:!0},events:{click:{mouseMoveTreshold:10}},clipboard:{pasteProps:["v","dv"],rowPasteMode:"rewrite_append",columnPasteMode:"rewrite"},print:{dpi:600,margins:{left:6.35,right:6.35,top:19.05,bottom:19.05,header:7.62,footer:7.62},orientation:"portrait",paper:"A4"}},MAX_COMMENT_AUTOHEIGHT:300,MIN_COMMENT_AUTOHEIGHT:25,...G},Df=/^(?!.*[\\\/\*\[\]\:\?"])(.{1,31})$/;function Nf(t){return Df.test(t)}function Pf(t){return["\\","/","*","[","]",":","?",'"'].forEach((e=>t=t.replace(new RegExp(`\\${e}`,"g"),""))),t}function jf(t,e){return!isNaN(t)&&null!=t||!isNaN(e)&&null!=e||(t=null==t?"":ct(t.toString()).toLowerCase(),e=null==e?"":ct(e.toString()).toLowerCase()),t>e?1:t<e?-1:0}function Hf(t,e){const i=Q(e);return Q(t)?(t=t.toString().trim()).startsWith("=")?0==jf(e,i?t.substring(1):parseFloat(t.substring(1))):t.startsWith(">=")?jf(e,i?t.substring(2):parseFloat(t.substring(2)))>=0:t.startsWith("<=")?jf(e,i?t.substring(2):parseFloat(t.substring(2)))<=0:t.startsWith(">")?jf(e,i?t.substring(1):parseFloat(t.substring(1)))>0:t.startsWith("<")?jf(e,i?t.substring(1):parseFloat(t.substring(1)))<0:0==jf(e,i?t:isNaN(t)?t||"":parseFloat(t)):e==t}const Bf=new Map([["=",["==",1,0]],[">",[">",1,0]],["<",["<",1,0]],[">=",[">=",1,0]],["<=",["<=",1,0]],["+",["+",2,0]],["-",["-",2,0]],["*",["*",3,0]],["/",["/",3,0]]]),Ff=t=>["=",">","<",">=","<="].includes(t),Wf=t=>["+","-","*","/"].includes(t),Vf=t=>Wf(t)||Ff(t);function Uf(t,e,i){switch(i){case"+":return t+e;case"-":return t-e;case"*":return t*e;case"/":return t/e;case"=":return 0==jf(t,e);case">":return jf(t,e)>0;case"<":return jf(t,e)<0;case">=":return jf(t,e)>=0;case"<=":return jf(t,e)<=0;default:throw new Error(`Invalid operator: ${i}`)}}function Gf(t,e,i){const o=Array.isArray(t),r=Array.isArray(e);if(!o&&!r)return[[Uf(t,e,i)]];const n=Math.max(o?t.length:0,r?e.length:0),s=Math.max(o?t[0].length:0,r?e[0].length:0),a=[];for(let l=0;l<n;l++){const n=[];for(let a=0;a<s;a++){const s=o?t[l]?.[a]:t,c=r?e[l]?.[a]:e,h=null==s&&null==c?null:Uf(s,c,i);n.push(h)}a.push(n)}return a}var qf;!function(t){t[t.Number=0]="Number",t[t.Boolean=1]="Boolean",t[t.String=2]="String",t[t.StringQuote=3]="StringQuote",t[t.Function=4]="Function",t[t.ArgumentSeparator=5]="ArgumentSeparator",t[t.OpenBracket=6]="OpenBracket",t[t.CloseBracket=7]="CloseBracket",t[t.Operator=8]="Operator",t[t.Cell=9]="Cell",t[t.Variable=10]="Variable",t[t.Range=11]="Range",t[t.Sheet=12]="Sheet",t[t.SheetQuote=13]="SheetQuote",t[t.SheetSeparator=14]="SheetSeparator",t[t.Unknown=15]="Unknown",t[t.Operand=16]="Operand"}(qf||(qf={}));const Yf=t=>t===qf.Number||t===qf.Boolean||t===qf.String||t===qf.Cell||t===qf.Variable||t===qf.Range,Zf=t=>t>=48&&t<=57,Xf=t=>"true"===(t=t.toLowerCase())||"false"===t,Qf=t=>t>=65&&t<=90||t>=97&&t<=122||t>=192&&t<=687,Kf={decimalPoint:".",stringQuote:'"',sheetQuote:"'",argumentSeparator:","};class Jf{constructor(t){this.options=Object.assign(Kf,t)}tokenize(t){const e=[],i=t.length;let o,r,n,s,a=0,l="",c=!1,h=!1,d=!1;for(;a<i;){if(o=t.charAt(a),r=o.charCodeAt(0),"="==o&&0==a)++a;else if(Zf(r)){for(l=(d?"-":"")+o,++a;a<i;)if(o=t.charAt(a),r=o.charCodeAt(0),Zf(r))l+=o,++a;else{if(o!==this.options.decimalPoint)break;l+=".",++a}d=!1,e.push([l,qf.Number])}else if(Qf(r)||"$"==o){l=o,n=null,++a;do{if(o=t.charAt(a),r=o.charCodeAt(0),Qf(r)||Zf(r)||"."===o||"$"===o||"_"===o)"_"==o?n=qf.Variable:Zf(r)&&!c&&null==n&&(n=qf.Cell),l+=o,++a,a==i&&e.push([l,n||qf.Variable]);else{if("("==o){e.push([l.toUpperCase(),qf.Function]),e.push([o,qf.OpenBracket]),++a;break}if("'"==o)e.push([l,qf.Sheet]),l="",e.push([o,qf.SheetQuote]),c=!0,++a;else if(":"==o)n=qf.Range,l+=o,++a;else{if(!c||" "!=o){if("!"==o){""!==l&&e.push([l,qf.Sheet]),e.push([o,qf.SheetSeparator]),c=!1,l="",++a;break}e.push([l,n||(Xf(l)?qf.Boolean:qf.Variable)]);break}l+=o,++a}}}while(a<i)}else if(Vf(o)){if("-"===o&&Zf(t.charCodeAt(a+1))&&(null==s||"("==s[0]||Ff(s[0])||s[1]==qf.ArgumentSeparator))d=!0;else{for(l=o;Ff(t.charAt(a+1));)l+=t.charAt(++a);e.push([l,qf.Operator])}++a}else if("("===o)e.push([o,qf.OpenBracket]),++a;else if(")"===o)e.push([o,qf.CloseBracket]),++a;else if("'"===o)e.push([o,qf.SheetQuote]),c=!0,++a;else if(o===this.options.argumentSeparator)e.push([o,qf.ArgumentSeparator]),++a;else if(o===this.options.stringQuote){for(h=!1,e.push([o,qf.StringQuote]),l="";++a<i;){if(o=t.charAt(a),o===this.options.stringQuote){h=!0,++a;break}l+=o}e.push([l,qf.String]),h&&e.push([this.options.stringQuote,qf.StringQuote])}else e.push([o,qf.Unknown]),++a;s=e[e.length-1]}return e}}function tv(t,e,i=null,o=!0){return t+=e,0==e?t:t>=0?i?o?t%i:Math.min(t,i-1):t:o&&i?i+t%i:Math.max(t,0)}const ev=/(?:'?([\w\s]*)'?!)?(\$?)([a-z]*)(\$?)(\d*)(?::(\$?)([a-z]*)(\$?)(\d*))?/i;class iv{constructor(t,e,i,o,r){this.setCoords(t,e,i,o),this.sheet=r}setCoords(t,e,i,o){this.c1=null==t&&null==i?0:t,this.r1=null==e&&null==o?0:e,this.c2=null==o&&null!=t||null!=i?null==i?t:i:1/0,this.r2=null==i&&null!=e||null!=o?null==o?e:o:1/0,this.normalize()}get size(){return{columns:this.c2-this.c1+1,rows:this.r2-this.r1+1}}get count(){const{columns:t,rows:e}=this.size;return t*e}normalize(){const[t,e]=[Math.min(this.c1,this.c2),Math.max(this.c1,this.c2)],[i,o]=[Math.min(this.r1,this.r2),Math.max(this.r1,this.r2)];return this.c1=t,this.c2=e,this.r1=i,this.r2=o,this}move(t,e,i=null,o=null,r=!0){const n=tv(this.c1,t,i,r);r&&(e+=this.c1+t!=n&&0!=t?t>0?1:-1:0),this.c1=n,this.r1=tv(this.r1,e,o,r),this.c2=tv(this.c2,t,i,r),this.r2=tv(this.r2,e,o,r)}contains(t){return t.c1>=this.c1&&t.c2<=this.c2&&t.r1>=this.r1&&t.r2<=this.r2}containsColumn(t){return this.c1<=t&&this.c2>=t}containsRow(t){return this.r1<=t&&this.r2>=t}removeAnchors(){return this.c1Anchor=!1,this.c2Anchor=!1,this.r1Anchor=!1,this.r2Anchor=!1,this}addAnchors(){return this.c1Anchor=!0,this.c2Anchor=!0,this.r1Anchor=!0,this.r2Anchor=!0,this}shiftLeft(t,e=1,i=null,o=!1){return t<=this.c1&&(o||!this.c1Anchor)&&(null==i||this.c1<=i)&&(this.c1-=e),t<=this.c2&&(o||!this.c2Anchor)&&(null==i||this.c2<=i)&&(this.c2-=e),this}shiftRight(t,e=1,i=null,o=!1){return t<=this.c1&&(o||!this.c1Anchor)&&(null==i||this.c1<=i)&&(this.c1+=e),t<=this.c2&&(o||!this.c2Anchor)&&(null==i||this.c2<=i)&&(this.c2+=e),this}shiftUp(t,e=1,i=null,o=!1){return t<=this.r1&&(o||!this.r1Anchor)&&(null==i||this.r1<=i)&&(this.r1-=e),t<=this.r2&&(o||!this.r2Anchor)&&(null==i||this.r2<=i)&&(this.r2-=e),this}shiftDown(t,e=1,i=null,o=!1){return t<=this.r1&&(o||!this.r1Anchor)&&(null==i||this.r1<=i)&&(this.r1+=e),t<=this.r2&&(o||!this.r2Anchor)&&(null==i||this.r2<=i)&&(this.r2+=e),this}shift(t){const{index:e,offset:i,direction:o,maxIndex:r,ignoreAnchors:n}=t;switch(o){case"down":return this.shiftDown(e,i,r,n);case"up":return this.shiftUp(e,i,r,n);case"left":return this.shiftLeft(e,i,r,n);case"right":return this.shiftRight(e,i,r,n)}}intersect(t){this.normalize(),t.normalize();const e=Math.max(t.c1,this.c1),i=Math.min(t.c2,this.c2),o=Math.max(t.r1,this.r1),r=Math.min(t.r2,this.r2);return e<=i&&o<=r?new iv(e,o,i,r,this.sheet):null}unite(t){return this.normalize(),t.normalize(),new iv(Math.min(this.c1,t.c1),Math.min(this.r1,t.r1),Math.max(this.c2,t.c2),Math.max(this.r2,t.r2),this.sheet)}clone(){const t=new iv(this.c1,this.r1,this.c2,this.r2,this.sheet);return t.c1Anchor=this.c1Anchor,t.r1Anchor=this.r1Anchor,t.c2Anchor=this.c2Anchor,t.r2Anchor=this.r2Anchor,t}equals(t,e=!1){return t.c1==this.c1&&t.r1==this.r1&&t.c2==this.c2&&t.r2==this.r2&&(0==e||t.c1Anchor==this.c1Anchor&&t.r1Anchor==this.r1Anchor&&t.c2Anchor==this.c2Anchor&&t.r2Anchor==this.r2Anchor)}get isCell(){return this.c2==this.c2&&this.r2==this.r1}get isRange(){return this.c2!=this.c1||this.r2!=this.r1}get isColumn(){return 0==this.r1&&this.r2==1/0}get isRow(){return 0==this.c1&&this.c2==1/0}get A1(){const t=this.isRange,e=(this.c1Anchor?"$":"")+(0!==this.c1||this.c2!==1/0?nv(this.c1):"")+(0===this.r1&&this.r2===1/0?"":(this.r1Anchor?"$":"")+ov(this.r1)),i=t?(this.c2Anchor?"$":"")+(!isNaN(this.c2)&&this.c2<1/0?nv(this.c2):"")+(this.r2Anchor?"$":"")+(!isNaN(this.r2)&&this.r2<1/0?ov(this.r2):""):e;return(null==this.sheet?"":((o=this.sheet).indexOf(" ")>-1?"'"+o+"'":o)+"!")+(e==i?e:e+":"+i);var o}get bounds(){return[[new iv(this.c1,this.r1),this.c2<1/0?new iv(this.c2,this.r1):null],[this.r2<1/0?new iv(this.c1,this.r2):null,this.r2<1/0&&this.c2<1/0?new iv(this.c2,this.r2):null]]}*cells(){for(let t=this.r1;t<=this.r2;t++)for(let e=this.c1;e<=this.c2;e++)yield new iv(e,t)}static fromA1(t){const e=ev.exec(t),i=new iv(e[3]?sv(e[3]):null,e[5]?rv(e[5]):null,e[7]?sv(e[7]):null,e[9]?rv(e[9]):null,e[1]||null);return!e[2]&&e[3]||(i.c1Anchor=!0),!e[4]&&e[5]||(i.r1Anchor=!0),(e[6]||e[2]&&!e[7])&&(i.c2Anchor=!0),(e[8]||e[4]&&!e[9])&&(i.r2Anchor=!0),i}}function ov(t){return(t+1).toString()}function rv(t){return parseInt(t)-1}function nv(t){++t;let e,i="";for(;t>0;)e=(t-1)%26,i=String.fromCharCode(e+65)+i,t=(t-e-1)/26;return i}function sv(t){const e=t.length;let i=0;for(let o=0;o<e;o++)i+=(t.charCodeAt(o)-64)*Math.pow(26,e-o-1);return i-1}function av(t){return t.sort(((t,e)=>{const i=Math.min(t.r1,t.r2),o=Math.min(e.r1,e.r2),r=Math.min(t.c1,t.c2),n=Math.min(e.c1,e.c2);return i<o?-1:i>o?1:r<n?-1:n>r?1:0}))}function lv(t){return t.formula.cells.map((e=>t.cell.model.getCellByRange(e[1])))}function cv(t){let e=t;for(;Array.isArray(e);)e=e.length>0?e[0]:null;return e}function hv(t){return Array.isArray(t)?t:[[t]]}function dv(t,e,i,o){if(!Array.isArray(t))return e(t,i,o);for(let o=0;o<t.length;o++)if(!1===dv(t[o],e,null==i?o:i,null==i?void 0:o))return!1}iv.fromA1s=(t,e=";")=>t.split(e).map((t=>iv.fromA1(t))),iv.toA1s=(t,e=";")=>t.map((t=>t.A1)).join(e),iv.fromCoords=t=>new iv(t.c1,t.r1,t.c2,t.r2),iv.fullColumn=t=>new iv(t,0,t,1/0),iv.fullRow=t=>new iv(0,t,1/0,t);const uv=new Set(["SUMPRODUCT","FILTER"]),pv=t=>uv.has(t),gv=t=>!!(t&&t.length>0&&"="==t.charAt(0)),mv=t=>gv(t)?t:"="+(t??""),fv=t=>gv(t)?t.substring(1):t,vv=["#5B97FF","#FF616B","#B77CFF","#00B02C","#FC58BE","#FF9000","#2EB0B3"],bv=t=>vv[t%vv.length],yv=new Map([["FORMULATEXT","_xlfn."],["CONCAT","_xlfn."],["INDIRECT","_xlfn."],["ISOWEEKNUM","_xlfn."],["SWITCH","_xlfn."],["XOR","_xlfn."]]);class wv{get fn(){return this._fn??(this._fn=new Function("t","ctx","return "+this.compile()))}get tokens(){return this._tokens}get variables(){return this._variables}get cells(){return this._cells}get ranges(){return this._ranges}get colors(){if(!this._colors){let t;this._colors=new Map,this._tokens.forEach(((e,i)=>{if([qf.Cell,qf.Range].includes(e[1])){const o=(t?"'"+t+"'!":"")+e[0];this._colors.set(o,{color:bv(this._colors.size),address:e[0],sheet:t,type:e[1],tokenIndex:i}),t=null}else e[1]==qf.Sheet&&(t=e[0])}))}return this._colors}constructor(t,e){this.expression=t,this.tokenizer=e,this._tokens=e.tokenize(this.expression),this.updateDependecies()}findTokenIndexAtPosition(t){let e=0;return this._tokens.findIndex((i=>{const o=i[0].length;if(t>=e&&t<=e+o)return!0;e+=o}))}findSheetTokenIndex(t){const e=this._tokens[t];if(![qf.Cell,qf.Range].includes(e[1]))return-1;if(0==t||this._tokens[t-1][1]!=qf.SheetSeparator)return-1;let i=t-2;for(;i>=0;){if(this._tokens[i][1]==qf.Sheet)return i;i--}return-1}removeSheetToken(t){if(this._tokens[t][1]!=qf.Sheet&&(t=this.findSheetTokenIndex(t)),t>-1){t>0&&this._tokens[t-1][1]==qf.SheetQuote&&t--;let e=t;for(;e<this._tokens.length&&[qf.SheetSeparator,qf.SheetQuote,qf.Sheet].includes(this._tokens[e][1]);)e++;return this._tokens.splice(t,e-t),e-t}return 0}getNamedColor(t){return this.colors.get(t)?.color??"inherit"}getTokenPosition(t){let e=0;for(let i=0;i<t;i++)e+=this._tokens[i][0].length;return{min:e,max:e+this._tokens[t][0].length}}updateToken(t,e){this._fn=null,this._formula=null,this._xlFormula=null,this._tokens[t][0]=e}removeToken(t){this._fn=null,this._formula=null,this._xlFormula=null,this._tokens.splice(t,1)}insertToken(t,e,i){this._fn=null,this._formula=null,this._xlFormula=null;const o=[];return i==qf.Sheet&&/\s/.test(e)?(o.push([this.tokenizer.options.sheetQuote,qf.SheetQuote]),o.push([e,qf.Sheet]),o.push([this.tokenizer.options.sheetQuote,qf.SheetQuote])):o.push([e,i]),o.push(["!",qf.SheetSeparator]),this._tokens.splice(t,0,...o),o.length}clone(){return new wv(this.createFormulaString(),this.tokenizer)}updateDependecies(){let t;this._variables=[],this._cells=[],this._ranges=[],this._tokens.forEach(((e,i)=>{switch(e[1]){case qf.Sheet:t=e[0];break;case qf.Variable:this._variables.push([i,e[0],t]),t=void 0;break;case qf.Cell:this._cells.push([i,iv.fromA1(e[0]),t]),t=void 0;break;case qf.Range:this._ranges.push([i,iv.fromA1(e[0]),t]),t=void 0}}))}createFormulaString(t=!1,e=!1){const i=this.tokenizer.options;let o,r,n,s="";for(let l=0;l<this._tokens.length;l++)switch(o=this._tokens[l],o[1]){case qf.SheetQuote:s+="'";break;case qf.SheetSeparator:s+="!";break;case qf.Sheet:r=o[0],s+=t?`<span style="font-style:italic">${r}</span>`:r;break;case qf.Variable:s+=o[0];break;case qf.Range:case qf.Cell:n=(r?"'"+r+"'!":"")+o[0],s+=t?`<span style="color:${this.getNamedColor(n)}">${o[0]}</span>`:o[0],r=null;break;case qf.StringQuote:s+=i.stringQuote;break;case qf.String:s+=o[0].replace(new RegExp(i.stringQuote,"g"),"\\"+i.stringQuote);break;case qf.ArgumentSeparator:s+=i.argumentSeparator;break;case qf.Function:s+=(e?(a=o[0],yv.get(a)??""):"")+o[0];break;case qf.Unknown:s+=t?`<span style="background:#f00;color:#fff">${o[0]}</span>`:o[0];break;default:s+=o[0]}var a;return s}createExpressionTree(){const t=[],e=[],i=this.tokens;let o,r,n,s,a,l=null;for(let c=0;c<i.length;c++)switch(o=i[c],o[1]){case qf.Sheet:l=o[0];break;case qf.Cell:case qf.Range:t.push({t:o[0],tt:o[1],s:l}),l=null;break;case qf.Number:case qf.String:case qf.Boolean:case qf.Variable:t.push({t:o[0],tt:o[1]});break;case qf.Operator:for(0==t.length&&t.push({t:"",tt:qf.Operand}),n=Bf.get(o[0]);e.length>0&&(s=Bf.get(e[e.length-1][0]),s)&&(0===n[2]&&n[1]<=s[1]||1===n[2]&&n[1]<s[1]);)r=e.pop(),a=[t.pop(),t.pop()].reverse(),t.push({t:r[0],tt:r[1],c:a});e.push(o);break;case qf.Function:case qf.OpenBracket:e.push(o);break;case qf.ArgumentSeparator:for(;e.length>0&&(r=e[e.length-1],![qf.OpenBracket,qf.ArgumentSeparator].includes(r[1]));)r=e.pop(),a=[t.pop(),t.pop()].reverse(),t.push({t:r[0],tt:r[1],c:a});e.push(o);break;case qf.CloseBracket:for(a=[];e.length>0&&e[e.length-1][1]!==qf.OpenBracket;)r=e.pop(),r[1]==qf.Operator?a.push({t:r[0],tt:r[1],c:[t.pop(),t.pop()].reverse()}):r[1]==qf.ArgumentSeparator&&t.length>0&&a.push(t.pop());e.pop(),e.length>0&&e[e.length-1][1]===qf.Function?(r=e.pop(),a=a.reverse(),t.length>0&&i[c-1][1]!==qf.OpenBracket&&a.unshift(t.pop()),t.push({t:r[0],tt:r[1],c:a})):t.push(...a)}for(;e.length>0;)r=e.pop(),t.push({t:r[0],tt:r[1],c:[t.pop(),t.pop()].reverse()});return t.pop()}createExpressionJSCode(t,e,i){let o;switch(t.tt){case qf.Range:return"t.rn('"+t.t+"'"+(t.s?",'"+t.s+"'":"")+")";case qf.Cell:return"t.cl('"+t.t+"'"+(t.s?",'"+t.s+"'":"")+")";case qf.Operand:return"t.cl()";case qf.Variable:return i||e?.tt===qf.Function?"t.nr('"+t.t+"'"+(t.s?",'"+t.s+"'":"")+")":"t.nv('"+t.t+"'"+(t.s?",'"+t.s+"'":"")+")";case qf.String:return"'"+t.t.replace(/'/g,"\\'")+"'";case qf.Boolean:return"T"==t.t[0].toUpperCase()?"1":"0";case qf.Function:return o=t.c.map((e=>this.createExpressionJSCode(e,t,i||pv(t.t)))),"t.fn('"+t.t+"').call(ctx"+(o.length>0?","+o.join(","):"")+")";case qf.Operator:return i?(o=t.c.map((e=>this.createExpressionJSCode(e,t,i||pv(t.t)))),"t.op("+o[0]+","+o[1]+",'"+t.t+"')"):Bf.has(t.t)?"("+t.c.map((e=>this.createExpressionJSCode(e,t,i))).join(Bf.get(t.t)[0])+")":null;default:return t.t}}compile(){const t=this.createExpressionTree();return this.createExpressionJSCode(t)}toString(t=!1){return(t?"=":"")+(this._formula??(this._formula=this.createFormulaString()))}toExcelString(){return this._xlFormula??(this._xlFormula=this.createFormulaString(!1,!0))}shift(t){const{index:e,offset:i,direction:o,maxIndex:r,sheet:n,allSheets:s}=t;return this._cells&&this._cells.forEach((t=>{if(s||null==t[2]||t[2]==n){switch(o){case"up":t[1].shiftUp(e,i,r);break;case"right":t[1].shiftRight(e,i,r);break;case"down":t[1].shiftDown(e,i,r);break;case"left":t[1].shiftLeft(e,i,r)}this._tokens[t[0]][0]=t[1].A1}})),this._ranges&&this._ranges.forEach((t=>{if(s||null==t[2]||t[2]==n){switch(o){case"up":t[1].shiftUp(e,i,r);break;case"right":t[1].shiftRight(e,i,r);break;case"down":t[1].shiftDown(e,i,r);break;case"left":t[1].shiftLeft(e,i,r)}this._tokens[t[0]][0]=t[1].A1}})),this}hasSheetReference(t){for(const e of this._cells)if(e[2]==t)return!0;for(const e of this._ranges)if(e[2]==t)return!0;for(const e of this._variables)if(e[2]==t)return!0;return!1}renameSheet(t,e){let i=!1;return this._tokens.forEach((o=>{o[1]==qf.Sheet&&o[0]==t&&(o[0]=e,i=!0)})),i}}function xv(t,e){return e&&(t=ur(this.cell.model.options.locale,vr(e,"d"),!1)(t)),null==t?"":t.toString()}function kv(t,e){return(t=null==t?"":t.toString()).substring(0,e)}function Cv(t,e){return(t=null==t?"":t.toString()).substring(Math.max(0,t.length-e),t.length)}function Mv(t,e,i){return(t=null==t?"":t.toString()).substring(e,e+i)}function _v(...t){let e="";return dv(t,(t=>e+=null==t?"":t.toString())),e}function Sv(t){return t instanceof Date?t:Q(t)?Yo(t,Eo()):rr(t)}function Ev(t){return tt(t)?t:or(t instanceof Date?t:Yo(t,Eo()))}function zv(t){return Q(t)?Ev(t):t}function Lv(t,e){const i=Sv(t).getDay();switch(e){case 2:return i;case 3:return i-1;default:return i%7+1}}function Iv(t,e,i){return nr(Ev(cv(t)),e)}function Rv(){return or(se(new Date))}function Tv(t){return null==(t=cv(t))||""===t}function Av(t,e,i){return or(new Date(t,e-1,i))}function Ov(t){return Sv(t).getFullYear()}function $v(t){return Sv(t).getMonth()+1}function Dv(t){return Sv(t).getDate()}function Nv(t,e){const i=Sv(t);return i.setMonth(i.getMonth()+e+1),i.setDate(0),or(i)}function Pv(t){return xi(Sv(t))}function jv(t){return Math.acos(t)}function Hv(t){return Math.acosh(t)}function Bv(t){return Math.PI/2-Math.atan(t)}function Fv(t){return.5*Math.log((t+1)/(t-1))}function Wv(t){return Math.asin(t)}function Vv(t){return Math.asinh(t)}function Uv(t){return Math.atan(t)}function Gv(t){return Math.atanh(t)}function qv(t){return Math.cos(t)}function Yv(t){return Math.cosh(t)}function Zv(t){return 1/Math.tan(t)}function Xv(t){return 1/Math.tanh(t)}function Qv(t){return 1/Math.sin(t)}function Kv(t){return 1/Math.sinh(t)}function Jv(t){return 180*t/Math.PI}function tb(){return Math.PI}function eb(t){return 1/Math.cos(t)}function ib(t){return 1/Math.cosh(t)}function ob(t){return Math.sin(t)}function rb(t){return Math.sinh(t)}function nb(t){return Math.tan(t)}function sb(t){return Math.tanh(t)}function ab(t){return Math.abs(t)}function lb(t){if(t<0)throw new Error("#NUM");return Math.ceil(t)}function cb(t){return(t=Math.ceil(t))%2==0?t:t+1}function hb(t){return Math.pow(Math.E,t)}function db(t){return t<0?-1:0==t?1:t*db(t-1)}function ub(t){return t<=0?1:t*ub(t-2)}function pb(t){return Math.floor(t)}function gb(t){return t%1!=0}function mb(t){return!gb(t)&&t%2==0}function fb(t){return gb(t)||t%2==1}function vb(t){return Math.log(t)}function bb(t,e){return Math.log(t)/Math.log(e)}function yb(t){return Math.log10(t)}function wb(t,e){return t%e}function xb(t){return(t=Math.ceil(t))%2==0?t+1:t}function kb(t,e){return Math.pow(t,e)}function Cb(...t){let e=1;return dv(t,(t=>e*=t||1)),e}function Mb(t,e){return Math.floor(t/e)}function _b(t){return t*Math.PI/180}function Sb(){return Math.random()}function Eb(t,e){const i=Array(t).fill(null).map((()=>Array(e)));for(let o=0;o<t;o++)for(let t=0;t<e;t++)i[o][t]=Math.random();return i}function zb(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}function Lb(t,e){return t.toFixed(e)}function Ib(t,e){return e=e||0,Math.floor(t*Math.pow(10,e))/Math.pow(10,e)}function Rb(t,e){return e=e||0,Math.ceil(t*Math.pow(10,e))/Math.pow(10,e)}function Tb(t,e,i=1,o=1){const r=Array(t).fill(null).map((()=>Array(e)));let n=i;for(let i=0;i<t;i++)for(let t=0;t<e;t++)r[i][t]=n,n+=o;return r}function Ab(t){return t<0?-1:t>0?1:0}function Ob(t){return Math.sqrt(t)}function $b(t){return Math.sqrt(Math.PI*t)}function Db(...t){let e=0;return dv(t,(t=>e+=null==t?0:1)),e}function Nb(...t){let e=0;return dv(t,(t=>e+=null==t?1:0)),e}function Pb(t,e){let i=0;return dv(t,(t=>i+=Hf(e,t)?1:0)),i}function jb(...t){let e=0;const i=new Map;return dv(t,(t=>{i.has(t)||(i.set(t,t),++e)})),e}function Hb(...t){let e=0;return dv(t,(t=>e+=isNaN(t)||null==t||""===t?0:t)),e}function Bb(t,e,i){let o=0;if(i){const r=hv(i);dv(t,((t,i,n)=>o+=Hf(e,t)&&r[i]&&r[i][n]&&!isNaN(r[i][n])?r[i][n]:0))}else dv(t,(t=>o+=Hf(e,t)&&!isNaN(t)?t:0));return o}function Fb(t,e){let i=0;return dv(t,(t=>i+=Hf(e,t)&&!isNaN(t)?t*t:0)),i}function Wb(...t){let e=0;const i=t.shift();if(0===t.length)dv(i,(t=>e+=isNaN(t)?0:t));else{const o=hv(t[0]);dv(i,((t,i,r)=>e+=o[i]&&o[i][r]&&!isNaN(t)&&!isNaN(o[i][r])?t*o[i][r]:0))}return e}function Vb(t,e){return t=null==t?"":t.toString(),e?e=>e==t:(t=t.toLowerCase(),e=>(e??"").toString().toLowerCase()==t)}function Ub(t,e,i=1){const o=new iv(Math.max((e||0)-1,0),Math.max((t||0)-1,0));return 1!=i&&2!=i||(o.r1Anchor=!0),1!=i&&3!=i||(o.c1Anchor=!0),o.A1}function Gb(t,e,i,o=!1){let r,n;const s=Vb(t,o);for(r=0;r<e.length;r++)for(n=0;n<e[r].length;n++)if(s(e[r][n]))return e[r][i-1];return null}function qb(t,e,i,o=!1){let r,n;const s=Vb(t,o);for(r=0;r<e.length;r++)for(n=0;n<e[r].length;n++)if(s(e[r][n]))return e[i-1][n];return null}function Yb(t,e,i){let o,r;t:for(o=0;o<e.length;o++)for(r=0;r<e[o].length;r++)if(e[o][r]==t)break t;return i?i[o]?i[o][r]:null:e[o][e[o].length-1]}function Zb(t,...e){let i=null,o=0;return dv(e,(e=>{if(t==++o)return i=e,!1})),i}function Xb(t){return(t?iv.fromA1(t).c1:this.cell.c)+1}function Qb(t){return(t?iv.fromA1(t).r1:this.cell.r)+1}function Kb(t){return Array.isArray(t)?t[0]?.length:1}function Jb(t){return Array.isArray(t)?t.length:1}function ty(){const t=lv(this)[0];return t&&t.hasFormula?" "+mv(t.formula):""}function ey(t,e,i){return e=e||1,i=i||1,Array.isArray(t)?t[e-1]?t[e-1][i-1]:null:1==e&&1==i?t:null}function iy(t){const e=this.cell,i=e.model,o=i.getCellByA1(t);let r;return i.calculations.dependencies.cellDependencies.has(e.address)?r=i.calculations.dependencies.cellDependencies.get(e.address):(r=new Map,i.calculations.dependencies.cellDependencies.set(e.address,r)),r.set(o.address,[o.range]),i.calculations.dependencies.cellDependants.has(o.address)?r=i.calculations.dependencies.cellDependants.get(o.address):(r=new Map,i.calculations.dependencies.cellDependants.set(o.address,r)),r.set(e.address,[e.range]),o.value}function oy(t,e,i=0){let o,r;for(o=0;o<e.length;o++)for(r=0;r<e[o].length;r++){if(0==i&&e[o][r]==t)return Math.max(o+1,r+1);if(1==i&&e[o][r]>t)return Math.max(o+1,r+1);if(-1==i&&e[o][r]<t)return Math.max(o+1,r+1)}return null}function ry(t,e,i,o,r){const n=lv(this)[0],s=[];o=o||1,r=r||1;for(let t=0;t<o;t++){const o=[];for(let s=0;s<r;s++){const r=n.model.rows[n.r+t+e].cell(n.c+s+i);o.push(r?n.value:null)}s.push(o)}return s}function ny(t,e){const i=[];if(t.length==e.length)for(let o=0;o<t.length;o++){let r=!0;for(let t=0;t<e[o].length;t++)if(!e[o][t]){r=!1;break}r&&i.push(t[o])}return i}const sy=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,2.1531153547440383e-8],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],ay=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]];function ly(t){const e=t*t;let i,o=sy[0][4]*e,r=e;for(i=0;i<3;i+=1)o=(o+sy[0][i])*e,r=(r+ay[0][i])*e;return t*(o+sy[0][3])/(r+ay[0][3])}function cy(...t){let e=!0;return dv(t,(t=>{if(!t)return e=!1})),e}function hy(...t){let e=!1;return dv(t,(t=>{if(t)return e=!0})),e}function dy(...t){let e=null;return dv(t,(t=>{e=null===e?!!t:!!t!=e})),e}function uy(...t){const e=t[0];for(let i=1;i<t.length;i+=2){if(i==t.length-1)return t[i];if(e==t[i])return t[i+1]}return null}function py(t,e,i){return t?e:i}function gy(t){return!t}function my(){return!1}function fy(){return!0}function vy(t,e){return e=""===e?null:e,this.cell.hasError?(this.cell.error.handled=!0,e):t===1/0||t===-1/0||Number.isNaN(t)?e:t}var by=i(235),yy=i.n(by),wy=i(5949),xy=i.n(wy);function ky(...t){let e=0,i=0;return dv(t,(t=>{null==t||isNaN(t)||(e+=t||0,++i)})),e/i}function Cy(t,e){const i=xy()(),o=hv(t),r=hv(e);for(let t=0;t<o.length;t++)for(let e=0;e<o[t].length;e++)i(o[t][e],(r[t]?r[t][e]:1)??1);return i()}function My(...t){const e=function(t){const e=[];return dv(t,(t=>e.push(t))),e}(t),i=yy()(e.length,e,1);return e.reduce(((t,e)=>t+Math.abs(e-i)),0)/e.length}function _y(...t){let e=1/0;return dv(t,(t=>e=Math.min(e,t))),e}function Sy(...t){let e=-1/0;return dv(t,(t=>e=Math.max(e,t))),e}function Ey(t,e){Object.keys(e).forEach((i=>t.set(st(i,"_").replace(/_/g,".").toUpperCase(),e[i])))}const zy=new Map;Ey(zy,_),Ey(zy,S),Ey(zy,E),Ey(zy,z),Ey(zy,I),Ey(zy,L),Ey(zy,R);class Ly{constructor(t){this.model=t,this.getModel=t=>{const e=t?this.model.getConnectedModel(t):this.model;if(e)return e;throw new Error(`Sheet "${t}" not found`)},this.cl=(t,e)=>{const i=this.getModel(e);if(null==t)return this.currentCell.value;const o=i.getCellByA1(t);return o?o.value:(this.currentCell.error={message:`undefined cell ${t}`},null)},this.rn=(t,e)=>this.getModel(e).getValuesInRange(iv.fromA1(t)),this.nv=(t,e)=>this.getModel(e).getCellByName(t,this.currentCell.range).value,this.nr=(t,e)=>{const i=this.getModel(e).getValueMatrixByName(t);return 1===i.length&&1===i[0].length?i[0][0]:i},this.fn=t=>{const e=zy.get(t);if(e)return e;throw new Error(`Function "${t}" not found`)},this.op=(t,e,i)=>Gf(t,e,i)}}function Iy(t,e){const i=Array(e).fill(null);let o=0,r=[];if(t.length>1){r=t.map((t=>parseFloat(t.value)||0)),o=r[1]-r[0];for(let t=2;t<r.length;t++)if(r[t]-r[t-1]!==o){o=0;break}}if(0==o)for(let o=0;o<e;o++)i[o]=t[o%t.length]?.value;else{let t=r[r.length-1];for(let r=0;r<e;r++)t=i[r]=t+o}return i}function Ry(t,e,i){const o=new wv(t.formula,t.model.calculations.tokenizer),r=[];for(let t=0;t<i;t++)r.push(mv(o.shift({index:0,offset:1,direction:e,allSheets:!0}).createFormulaString()));return r}function Ty(t,e,i,o){const r=t.getCellMatrix(e);let n;"right"==o?n=Gr(r):"down"==o?n=Ur(r):"left"==o?n=Wr(r):"up"==o&&(n=Wr(Ur(r)));const s=new Array(i.size.rows);for(let t=0;t<i.size.rows;t++){s[t]=new Array(i.size.columns);for(let e=0;e<i.size.columns;e++){const i=r.length>t?r[t][r[t].length>e?e:0]:r[0][e];s[t][e]=i.hasDisplayValue?i.displayValue:null}}const a=i.size["down"==o||"up"==o?"rows":"columns"];let l=n.map((t=>t[t.length-1].hasFormula?Ry(t[t.length-1],o,a):Iy(t,a)));return"down"==o?l=Ur(l):"left"==o?l=Wr(l):"up"==o&&(l=Vr(Ur(l))),t.spillValues({cell:t.getCellByRange(i.bounds[0][0]),values:l,propertyCell:t.getCellByRange(e.bounds[0][0]),displayValues:s})}function Ay(t){return t.pattern&&"string"==typeof t.pattern&&(t.pattern=new RegExp(t.pattern)),t}function Oy(t,e){const i=t.validation;if(!i)return!0;if(i.allowInvalid)return!0;let o=!0;return i.pattern&&(i.pattern.test((e??"").toString())||(o=!1)),i.validate&&(i.validate(t,e)||(o=!1)),o}class $y{get address(){return null}get renderer(){return this._renderer}set renderer(t){this._renderer=t}get afterRenderer(){return this._afterRenderer}set afterRenderer(t){this._afterRenderer=t}get commentRenderer(){return this._commentRenderer}set commentRenderer(t){this._commentRenderer=t}get type(){return this._type}set type(t){this._type=t}get name(){return this._name}set name(t){this._name=t}get style(){return this._style}set style(t){this._style=t}get commentable(){return this._commentable}set commentable(t){this._commentable=t}get clickable(){return this._clickable}set clickable(t){this._clickable=t}get editable(){return this._editable}set editable(t){this._editable=t}get validation(){return this._validation}set validation(t){this._validation=t}get hasFormula(){return!!this._formula}get formula(){return this._formula}set formula(t){this._formula=t?t.replace(/^=/,""):null}get value2(){return this.hasFormula?mv(this.formula):null}get editorContent(){return this._editorContent}set editorContent(t){this._editorContent=t}get adapter(){return this._adapter}set adapter(t){this._adapter=t}get properties(){return this._properties}set properties(t){this._properties=t}getProperty(t){return this._properties?.[t]}setProperty(t,e){this._properties||(this._properties={}),this._properties[t]=e}get format(){return this._format}set format(t){this._format=t,this._valueFormatter=null}get valueFormatter(){return this._valueFormatter}constructor(t,e){this.model=t,this._type=null,this._clickable=!1,e&&this.populate(e)}populate(t){this._renderer=t.renderer,this._afterRenderer=t.afterRenderer,this._commentRenderer=t.commentRenderer,this._name=t.name,this._type=t.t,this._editorContent=t.content,this._adapter=t.adapter,this._format=t.z,this._formula=t.f,this._editable=t.e,this._commentable=t.commentable,this._clickable=t.clickable,this._validation=t.validation?Ay(t.validation):null,this._properties=t.props,this._style=null==t.s?null:this.model.styles.add(t.s).id}update(t){const e={};if("renderer"in t&&(e.renderer=this._renderer,this._renderer=t.renderer),"afterRenderer"in t&&(this._afterRenderer=t.afterRenderer),"commentRenderer"in t&&(this._commentRenderer=t.commentRenderer),"name"in t&&(e.name=this._name,this._name=t.name),"t"in t&&(e.t=this._type,this._type=t.t),"content"in t&&(e.content=this._editorContent,this._editorContent=t.content),"adapter"in t&&(e.adapter=this._adapter,this._adapter=t.adapter),"z"in t&&(e.z=this._format,this._format=t.z),"f"in t&&(e.f=this._formula,this._formula=t.f),"e"in t&&(e.e=this._editable,this._editable=t.e),"commentable"in t&&(e.commentable=this._commentable,this._commentable=t.commentable),"clickable"in t&&(e.clickable=this._clickable,this._clickable=t.clickable),"validation"in t&&(e.validation=this._validation,this._validation=Ay(t.validation)),"props"in t&&(e.props=this._properties,this._properties=t.props),"s"in t){const i=this.model.styles.add(t.s).id;this._style!==i&&(e.s=this._style,this._style=i)}return e}getSourceData(){const t={};return null!=this._type&&(t.t=this._type),null!=this._format&&(t.z=this._format),null!=this._formula&&(t.f=this._formula),null!=this._editable&&(t.e=this._editable),null!=this._commentable&&(t.commentable=this._commentable),null!=this._clickable&&(t.clickable=this._clickable),this._properties&&(t.props=rt(this._properties)),null!=this._editorContent&&(t.content=Z(this._editorContent)?rt(this._editorContent):this._editorContent),null!=this._style&&(t.s=this._style),null!=this._name&&(t.name=this._name),t}setStyleProperties(t,e=!1){this.style=e?this.model.styles.set(this.style,t).id:this.model.styles.duplicate(this.style,t).id}removeStyleProperties(t){null!==this.style&&this.model.styles.unset(this.style,t)}get composedStyle(){return this.model.styles.get(this.style)}}function Dy(t){const e={};return t.split(";").forEach((t=>{const[i,o]=t.split(":");e[i]=o.trim()})),e}const Ny=new Map([["thin",{width:1.5,style:"solid"}],["medium",{width:2,style:"solid"}],["thick",{width:3,style:"solid"}],["double",{width:3,style:"double"}],["dotted",{width:1.5,style:"dotted"}],["hair",{width:1,style:"solid"}],["dashed",{width:1.5,style:"dashed"}],["mediumDashed",{width:2,style:"dashed"}],["dashDot",{width:1.5,style:"dashed"}],["mediumDashDot",{width:2,style:"dashed"}],["dashDotDot",{width:1.5,style:"dotted"}],["mediumDashDotDot",{width:2,style:"dotted"}],["slantDashDot",{width:1.5,style:"dashed"}],["none",{width:1.5,style:"solid"}]]),Py=(()=>{const t=new Map;return Ny.forEach(((e,i)=>{let o=t.get(e.style);o||(o=t.set(e.style,new Map).get(e.style)),o.set(e.width,i)})),t})();function jy(t){return"middle"==t?"center":t}function Hy(t){return 3==(t="#"==t.charAt(0)?t.substring(1):t).length?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t}const By=t=>{if("none"==t)return null;const e=t.split(" "),i=parseInt(e[0].charAt(0))||1,o=e.length>1?e[1]:"solid",r=Py.get(o);return{style:(r?r.get(i):null)??"thin",color:e.length>2?Hy(e[2]):"CCCCCC"}},Fy=t=>{const e=Ny.get(t.style||"none");return e?[Dt(e.width),e.style,"none"==t.style?"var(--og-cell-background)":t.color?`#${t.color}`:"var(--og-border-color)"].join(" "):"none"},Wy=(t,e)=>{const i="#"+(e.fgColor||"000000"),o="#"+(e.bgColor||"FFFFFF");switch(e.patternType){case"solid":t.backgroundColor=i||o;break;case"darkGray":t.backgroundColor=Or(o,.75);break;case"mediumGray":t.backgroundColor=Or(o,.5);break;case"lightGray":t.backgroundColor=Or(o,.25);break;case"gray125":t.backgroundColor=Or(o,.125);break;case"gray0625":t.backgroundColor=Or(o,.0625);break;case"darkHorizontal":t.backgroundImage=`linear-gradient(0deg, ${i} 33.33%, ${o} 33.33%, ${o} 50%, ${i} 50%, ${i} 83.33%, ${o} 83.33%, ${o} 100%)`,t.backgroundSize="6px 6px";break;case"darkVertical":t.backgroundImage=`linear-gradient(90deg, ${i} 33.33%, ${o} 33.33%, ${o} 50%, ${i} 50%, ${i} 83.33%, ${o} 83.33%, ${o} 100%)`,t.backgroundSize="6px 6px";break;case"darkDown":t.backgroundImage=`linear-gradient(45deg, ${i} 33.33%, ${o} 33.33%, ${o} 50%, ${i} 50%, ${i} 83.33%, ${o} 83.33%, ${o} 100%)`,t.backgroundSize="6px 6px";break;case"darkUp":t.backgroundImage=`linear-gradient(-45deg, ${i} 33.33%, ${o} 33.33%, ${o} 50%, ${i} 50%, ${i} 83.33%, ${o} 83.33%, ${o} 100%)`,t.backgroundSize="6px 6px";break;case"lightHorizontal":t.backgroundImage=`linear-gradient(0deg, ${o} 25%, ${i} 25%, ${i} 50%, ${o} 50%, ${o} 75%, ${i} 75%, ${i} 100%)`,t.backgroundSize="4px 4px";break;case"lightVertical":t.backgroundImage=`linear-gradient(90deg, ${o} 25%, ${i} 25%, ${i} 50%, ${o} 50%, ${o} 75%, ${i} 75%, ${i} 100%)`,t.backgroundSize="4px 4px";break;case"lightDown":t.backgroundImage=`linear-gradient(45deg, ${o} 25%, ${i} 25%, ${i} 50%, ${o} 50%, ${o} 75%, ${i} 75%, ${i} 100%)`,t.backgroundSize="4px 4px";break;case"lightUp":t.backgroundImage=`linear-gradient(-45deg, ${o} 25%, ${i} 25%, ${i} 50%, ${o} 50%, ${o} 75%, ${i} 75%, ${i} 100%)`,t.backgroundSize="4px 4px";break;case"darkGrid":t.backgroundImage=`linear-gradient(${o} 0.5px, transparent 0.5px), linear-gradient(90deg, ${o} 0.5px, transparent 0.5px)`,t.backgroundSize="2px 2px";break;case"lightGrid":t.backgroundImage=`linear-gradient(${o} 0.5px, transparent 0.5px), linear-gradient(90deg, ${o} 0.5px, transparent 0.5px)`,t.backgroundSize="1px 1px";break;case"darkTrellis":t.backgroundImage=`linear-gradient(45deg, ${o} 0.5px, transparent 0.5px), linear-gradient(90deg, ${o} 0.5px, transparent 0.5px)`,t.backgroundSize="2px 2px";break;case"lightTrellis":t.backgroundImage=`linear-gradient(45deg, ${o} 0.5px, transparent 0.5px), linear-gradient(90deg, ${o} 0.5px, transparent 0.5px)`,t.backgroundSize="1px 1px"}return t},Vy=(t,e)=>(t.backgroundImage=`linear-gradient(${(e.angle??0)+90}deg,${e.stops.map((t=>`#${t.rgb} ${100*t.v}%`)).join(",")})`,t),Uy=t=>{const e=t.cssStyle?{...t.cssStyle}:{};return null!=t.bold&&(e.fontWeight=t.bold?"bold":"normal"),t.italic&&(e.fontStyle="italic"),t.underline?e.textDecoration="underline":t.strike&&(e.textDecoration="line-through"),t.sz&&(e.fontSize=$t(t.sz)),t.color&&(e.color="#"+t.color),t.top&&(e.borderTop=Fy(t.top)),t.right&&(e.borderRight=Fy(t.right)),t.bottom&&(e.borderBottom=Fy(t.bottom)),t.left&&(e.borderLeft=Fy(t.left)),(t.top||t.right||t.bottom||t.left)&&(e.zIndex="1"),t.alignment&&t.alignment.vertical&&(e.display="flex",e.justifyContent=t.alignment.horizontal,e.alignItems="top"==t.alignment.vertical?"start":"bottom"==t.alignment.vertical?"end":"center"),t.alignment&&t.alignment.horizontal&&(e.textAlign=t.alignment.horizontal),t.alignment&&t.alignment.wrapText&&(e.display="flex",e.justifyContent=e.justifyContent??e.textAlign??"left",e.alignItems=e.alignItems??"center",e.whiteSpace="pre-wrap"),t.patternType?Wy(e,t):t.stops&&t.stops.length?Vy(e,t):t.fgColor?e.backgroundColor="#"+t.fgColor:t.bgColor&&(e.backgroundColor="#"+t.bgColor),e},Gy=t=>{const e=Z(t)?t:Dy(t),i={};let o;for(const t in e){const r=e[t];if(null!=r)switch(t){case"borderTop":case"border-top":i.top=By(r);break;case"borderTopColor":case"border-top-color":i.top?i.top.color=Hy(r):i.top={style:"thin",color:Hy(r)};break;case"borderRight":case"border-right":i.right=By(r);break;case"borderRightColor":case"border-right-color":i.right?i.right.color=Hy(r):i.right={style:"thin",color:Hy(r)};break;case"borderBottom":case"border-bottom":i.bottom=By(r);break;case"borderBottomColor":case"border-bottom-color":i.bottom?i.bottom.color=Hy(r):i.bottom={style:"thin",color:Hy(r)};break;case"borderLeft":case"border-left":i.left=By(r);break;case"borderLeftColor":case"border-left-color":i.left?i.left.color=Hy(r):i.left={style:"thin",color:Hy(r)};break;case"border":o=By(r),i.top=i.top||o,i.right=i.right||o,i.bottom=i.bottom||o,i.left=i.left||o;break;case"textAlign":case"text-align":i.alignment=i.alignment||{},i.alignment.horizontal=r;break;case"verticalAlign":case"vertical-align":i.alignment=i.alignment||{},i.alignment.vertical=jy(r);break;case"whiteSpace":case"white-space":i.alignment=i.alignment||{},i.alignment.wrapText=r&&"nowrap"!=r;break;case"color":i.color=Hy(r);break;case"background":case"backgroundColor":i.fgColor=Hy(r);break;case"fontSize":case"font-size":i.sz=parseFloat(r);break;case"fontWeight":case"font-weight":i.bold="bold"==r;break;case"fontStyle":case"font-style":i.italic="italic"==r;break;default:i[t]=r}}return i},qy={n:t=>{const e=Q(t)?parseFloat(t):t;return Number.isNaN(e)?t:e},t:t=>t,d:(t,e)=>{if(null==t||""===t)return null;if(Q(t))try{return K(t)?J(t):or(Yo(t,e.model.options.formatLocale))}catch(i){return e.model.logger.error(`Invalid date value in cell ${e.address}: ${t}`),null}return t instanceof Date?or(t):t},tm:t=>Q(t)?new Date(t):t,dt:t=>Q(t)?new Date(t):t,b:t=>!!t&&"0"!==t&&"false"!==t.toString().toLowerCase(),s:t=>t,m:t=>t,g:t=>{if(null==t||""===t)return null;const e=parseFloat(t);return isNaN(e)?t:e},a:t=>Q(t)&&""!==t?JSON.parse(t):t,h:t=>t},Yy=new Map;class Zy extends $y{get tooltip(){return this._tooltip}set tooltip(t){this._tooltip=t}get hasTooltip(){return null!=this._tooltip}get rowspan(){return this._rowspan}set rowspan(t){this._rowspan=t}get colspan(){return this._colspan}set colspan(t){this._colspan=t}get row(){return this._row}set row(t){this._row=t}get r(){return this._row.index}get column(){return this._column}set column(t){this._column=t}get c(){return this._column.index}get hasValue(){return null!=this._value}get value(){return this._evaluated||this.evaluate(),this._value}set value(t){if(t&&gv(t.toString()))this._value=void 0,this.formula=t;else{let e=qy[this.type](t,this);Oy(this,e)||(e=void 0),e!==this._value&&(this._value=e,this._displayValue=void 0),this.row.data&&this.column.data&&(this.row.data[this.column.data]=this._value)}}evaluate(){return this._value=qy[this.type](this.model.calculations.evaluate(this),this),this._evaluated=!0,this._value}get value2(){return this.hasFormula?mv(this.formula):this.value}get hasDisplayValue(){return null!=this._displayValue}get displayValue(){return this._displayValue}set displayValue(t){this._displayValue=t}get prefersDisplayValue(){return["s","m"].includes(this.type)}get error(){return this._error}set error(t){this._error=t}get hasError(){return!!this._error}clearError(){this._error=void 0}get spillRange(){return this._spillRange}get prevSpillRange(){return this._prevSpillRange}set spillRange(t){!this._spillRange||t&&this._spillRange.equals(t)||(this._prevSpillRange=this._spillRange),this._spillRange=t}get isSpillSource(){return null!=this._spillRange}get spillSource(){return this._spillSource}get isSpilled(){return null!=this._spillSource}spillValue(t,e){this.value=t,this._spillSource=e}clearSpilledValue(){this._spillSource=void 0,this._value=void 0}get hasSparkline(){return null===this._sparkline?this._sparkline=this.model.sparklines.has(this.address):this._sparkline}get hasComment(){return null===this._hasComment?this._hasComment=(this.model.comments.get(this.address)??[]).length>0:this._hasComment}get comments(){return this.model.comments.get(this.address)}get valueFormatter(){const t=super.valueFormatter??this.row.valueFormatter??this.column.valueFormatter;if(t)return t;const e=this.type,i=this.format,{formatLocale:o,fixNumberFormat:r}=this.model.options,n=this.value;if(null==n||""===n)return null;if("n"==e)return null!=i?ur(o,i,r):this.model.options.numberFormatter;if("g"==e){if(null!=i)return ur(o,i,r);if(tt(n))return this.model.options.numberFormatter}else{if("t"==e)return null==i?null:ur(o,i,!1);if("d"==e)return i?Zo(o,i):this.model.options.dateFormatter;if("s"==e&&this.editorContent)return(t=>{if(t=t||null,!Yy.has(t))if(t){const e=t.reduce(((t,e)=>t.set(e.k,e.v)),new Map);Yy.set(t,(t=>e.has(t)?e.get(t):t))}else Yy.set(t,(t=>t));return Yy.get(t)})(this.editorContent)}return null}get formattedValue(){return null==this.value?"":this.hasDisplayValue?this.displayValue:this.valueFormatter?this.valueFormatter(this.value):this.value.toString()}get elm1(){return this.row.priority>=this.column.priority?this.row:this.column}get elm2(){return this.row.priority<this.column.priority?this.row:this.column}get clickable(){return super.clickable??this.elm1.clickable??this.elm2.clickable}get type(){return super.type??this.elm1.type??this.elm2.type??"g"}set type(t){this._type=t}get editorContent(){return super.editorContent??this.elm1.editorContent??this.elm2.editorContent??null}get adapter(){return super.adapter??this.elm1.adapter??this.elm2.adapter}set adapter(t){this._adapter=t}get address(){return this.column.address+this.row.address}get range(){return iv.fromA1(this.address)}get validation(){return super.validation??this.elm1.validation??this.elm2.validation??this.model.options.cellValidation}get editable(){return super.editable??this.elm1.editable??this.elm2.editable??this.model.options.editable}set editable(t){this._editable=t}get commentable(){return super.commentable??this.elm1.commentable??this.elm2.commentable??this.model.options.commentable}get renderer(){return super.renderer??this.elm1.renderer??this.elm2.renderer}get afterRenderer(){return super.afterRenderer??this.elm1.afterRenderer??this.elm2.afterRenderer??this.model.options.afterRenderer}get commentRenderer(){return super.commentRenderer??this.elm1.commentRenderer??this.elm2.commentRenderer??this.model.options.comments.renderer}get format(){return super.format??this.elm1.format??this.elm2.format}set format(t){super.format=t}get hyperlink(){return this._hyperlink}set hyperlink(t){this._hyperlink=t}get hasOwnFormula(){return!!this._formula}get hasFormula(){return null==this._hasFormula&&(this._hasFormula=!!this.formula),this._hasFormula}get formula(){return this._formula??this.elm1.formula??this.elm2.formula}set formula(t){super.formula=t,this.refreshFormula()}invalidateValue(){this.hasFormula?(this._value=void 0,this._evaluated=!1):this._evaluated=!0,this.clearError()}refreshFormula(){this.invalidateValue(),this._hasFormula=null}clearFormula(){this._formula=null,this._hasFormula=!1,this._evaluated=!0}constructor(t,e){super(t),this._evaluated=!0,this._sparkline=null,this._hasComment=null,this._hasStyle=null,this.row=t.rows[e.r],this.column=t.columns[e.c],this.populate(e)}populate(t){super.populate(t),this._colspan=t.cs??1,this._rowspan=t.rs??1,this._tooltip=t.tooltip,this._hyperlink=t.hl,null!=t.f&&""!==t.f?this._evaluated=!1:null!=t.v&&(this.value=t.v),this._displayValue=t.dv}update(t){const e=super.update(t);return"cs"in t&&(e.cs=this._colspan,this._colspan=t.cs),"rs"in t&&(e.rs=this._rowspan,this._rowspan=t.rs),"tooltip"in t&&(e.tooltip=this._tooltip,this._tooltip=t.tooltip),"hl"in t&&(e.hl=this._hyperlink,this._hyperlink=t.hl),"f"in t?this._evaluated=!1:"v"in t&&(e.v=this.value,this.value=t.v),"dv"in t&&(e.dv=this._displayValue,this._displayValue=t.dv),e}getSourceData(t){const e=super.getSourceData();return this._colspan>1&&(e.cs=this._colspan),this._rowspan>1&&(e.rs=this._rowspan),null!=this.value&&(e.v=this.value),this.hasTooltip&&(e.tooltip=this._tooltip),this._hyperlink&&(e.hl=this._hyperlink),t&&t.displayValue&&this.hasDisplayValue&&(e.dv=this._displayValue),e}createComposedStyle(t,e,i){const o=[];return t=t||this.column.style,e=e||this.row.style,null!=t&&null!=e?this.column.priority>this.row.priority?o.push(e,t):o.push(t,e):null!=t?o.push(t):null!=e&&o.push(e),null!=this.style&&o.push(this.style),null!=i&&o.push(i),o.length>0?this.model.styles.merge(...o):null}get composedStyle(){if(null===this._hasStyle){const t=this.createComposedStyle(null,null,this.model.conditionalFormats.evaluate(this));this._hasStyle=null!=t,this._composedStyle=t}return this._composedStyle}get calculatedIndent(){const t=this.composedStyle;return t?.alignment?.indent?t.alignment.indent:this.column.levelIndent&&this.row.level>0?this.row.level*this.model.options.levelIndentFactor:null}get cssStyle(){if(!1===this._hasStyle)return null;if(!this._cssStyle){const t=this.composedStyle;t&&(this._cssStyle=Uy(t))}return this._cssStyle}invalidateStyle(){this._hasComment=null,this._hasStyle=null,this._composedStyle=null,this._cssStyle=null,this._sparkline=null}setStyleProperties(t){super.setStyleProperties(t),this.invalidateStyle()}removeStyleProperties(t){super.removeStyleProperties(t),this.invalidateStyle()}previewStyleProperties(t,e="cell"){const i=Object.assign({},this.createComposedStyle("column"==e?t:null,"row"==e?t:null)??{});if("cell"==e)for(const e in t)i[e]=t[e];this._hasStyle=!0,this._cssStyle=Uy(i)}validate(){return!this.validation||Oy(this,this.value)}toString(){return this.address}}const Xy={property:"value",enabled:!0};class Qy extends(Lr($y)){get comparer(){return this._comparer}set comparer(t){this._comparer=t}get filter(){return this._filter??(this.model.options.filters?.enabled?Xy:{enabled:!1})}set filter(t){this._filter=t}get hasFilter(){return this.filter.enabled}get sorting(){return this._sorting??this.model.options.columnSorting}set sorting(t){this._sorting=t}get width(){return this._width??this.model.options.columnWidth}set width(t){this._width=t}get levelIndent(){return this._levelIndent}set levelIndent(t){this._levelIndent=t}get levelButtons(){return this._levelButtons}set levelButtons(t){this._levelButtons=t}get priority(){return this._priority}set priority(t){this._priority=t}get address(){return nv(this.index)}get range(){return new iv(this.index,null,this.index,null)}get hasFormula(){return!!this._formula}get formula(){return this._formula}set formula(t){super.formula=t;const e=this.index;this.model.rows.forEach((t=>t.cells[e]?.refreshFormula()))}constructor(t,e){super(t,e),null==this._priority&&(this._priority=t.options.columnPriority)}get mergedHeaders(){return this._mergedHeaders??(this._mergedHeaders=this._header?.filter((t=>t.cs>1||t.rs>1))??[])}updateMergedHeaders(){this._mergedHeaders=null}set header(t){this._mergedHeaders=null,this._header=t}get header(){if(!this._header||this._header.length<this.model.headerCount){this._header=this._header??[];for(let t=this._header.length;t<this.model.headerCount;t++)this._header.push({r:t})}return this._header}convertSourceHeader(t){return Array.isArray(t)?t.map(((t,e)=>(null==(t=t??{r:e}).height&&(t.height=t.h),t.r=e,null==t.style&&(t.style=t.s),t._style=null==t.style?null:this.model.styles.add(t.style).id,t))):Q(t)?[{label:t,r:0}]:null}populate(t){super.populate(t),this._width=null==t.w||"auto"==t.w?null:t.w,this._levelIndent=t.levelIndent,this._levelButtons=t.levelButtons,this._header=this.convertSourceHeader(t.header),this._sorting=t.sorting,this._filter=Z(t.filter)?Object.assign({enabled:!0},t.filter):t.filter?Xy:!1===t.filter?{enabled:!1}:null,this._comparer=t.comparer,this.data=t.data,this._mergedHeaders=null,null!=t.priority&&(this._priority=t.priority)}getSourceData(){const t=super.getSourceData();return null!=this._width&&(t.w=this._width),null!=this._levelIndent&&(t.levelIndent=this._levelIndent),null!=this._levelButtons&&(t.levelButtons=this._levelButtons),null!=this._header&&(t.header=this._header),null!=this._sorting&&(t.sorting=this._sorting),null!=this._filter&&(t.filter=this._filter),null!=this.data&&(t.data=this.data),t}expand(t){super.expand(t),this.model.indexVisibleColumns()}collapse(){super.collapse(),this.model.indexVisibleColumns()}get prev(){return this.model.columns[this.index-1]}get next(){return this.model.columns[this.index+1]}get prevVisible(){const t=this.model.visibleColumnIndex[this.index];return null==t||0===t?null:this.model.visibleColumns[t-1]}get nextVisible(){const t=this.model.visibleColumnIndex[this.index];return null==t?null:this.model.visibleColumns[t+1]}calculateRealColspan(t){let e=1,i=this.nextVisible;for(;i&&i.index-this.index<t&&e<t;)++e,i=i.nextVisible;return e}cell(t){return this.model.rows[t].cell(this.index)}clearCalculatedValues(){this.model.rows.forEach((t=>{const e=t.cells[this.index];e&&this.model.calculations.refreshFormula(e)}))}}var Ky;!function(t){t[t.Asc=1]="Asc",t[t.Desc=-1]="Desc"}(Ky||(Ky={}));const Jy={g:(t,e)=>t.value==e.value?0:t.value>e.value?1:-1,t:(t,e)=>(t.value||"").toString().localeCompare((e.value||"").toString()),s:(t,e)=>t.value==e.value?0:t.value>e.value?1:-1,m:(t,e)=>t.value==e.value?0:t.value>e.value?1:-1,n:(t,e)=>t.value-e.value,d:(t,e)=>(t.value instanceof Date?t.value.getTime():0)-(e.value instanceof Date?e.value.getTime():0),tm:(t,e)=>(t.value instanceof Date?t.value.getTime():0)-(e.value instanceof Date?e.value.getTime():0),dt:(t,e)=>(t.value instanceof Date?t.value.getTime():0)-(e.value instanceof Date?e.value.getTime():0),b:(t,e)=>t.value-e.value,h:(t,e)=>(t.value||"").localeCompare(e.value),a:()=>0},tw={g:(t,e)=>e.value==t.value?0:e.value>t.value?1:-1,t:(t,e)=>(e.value||"").toString().localeCompare((t.value||"").toString()),s:(t,e)=>e.value==t.value?0:e.value>t.value?1:-1,m:(t,e)=>e.value==t.value?0:e.value>t.value?1:-1,n:(t,e)=>e.value-t.value,d:(t,e)=>(e.value instanceof Date?e.value.getTime():0)-(t.value instanceof Date?t.value.getTime():0),tm:(t,e)=>(e.value instanceof Date?e.value.getTime():0)-(t.value instanceof Date?t.value.getTime():0),dt:(t,e)=>(e.value instanceof Date?e.value.getTime():0)-(t.value instanceof Date?t.value.getTime():0),b:(t,e)=>e.value-t.value,h:(t,e)=>(e.value||"").localeCompare(t.value),a:()=>0},ew=(t,e)=>t.origIndex-e.origIndex;class iw{get settings(){return this._settings}set settings(t){this._settings=t,this.colMap.clear(),this.settings.length>0&&(this.settings.forEach(((t,e)=>this.colMap.set(t.c,e))),this.applySort(),Sr().info(`sorting applied: ${JSON.stringify(this.settings)}`))}constructor(t,e=[]){this.model=t,this.colMap=new Map,this._settings=[],this.settings=e}get(t){return this.colMap.has(t)?this.settings[this.colMap.get(t)]:null}sort(t,e=null,i=!1){let o=this.get(t);return o&&o.ord==Ky.Desc&&null===e?(this.settings.splice(this.colMap.get(t),1),o=null):o?(o.ord=Ky.Desc,this.settings.splice(this.colMap.get(t),1)):o={c:t,ord:Ky.Asc},o&&(null!==e&&(o.ord=e),this.colMap.set(t,0),this.settings.unshift(o)),this.settings.length>this.model.options.maxSortingColumns&&this.settings.pop(),this.colMap.clear(),this.settings.forEach(((t,e)=>{t.index=e,this.colMap.set(t.c,e)})),i||(this.settings.length>0?this.applySort():this.resetSort()),o}applySort(){const t=this.model,e=this.settings.map((e=>{const i=t.columns[e.c];return i?i.comparer?e.ord==Ky.Asc?i.comparer:(t,e)=>-i.comparer(t,e):e.ord==Ky.Asc?Jy[i.type??"t"]:tw[i.type??"t"]:(Sr().warn(`Column sorting: Column with index ${e.c} not found`),null)})).filter((t=>t)),i=e.length;let o,r,n;t.rowRoot.sort(((t,s)=>{if(!1===t.sortable||!1===s.sortable)return t.origIndex-s.origIndex;for(r=0;r<i;r++)if(n=this.settings[r].c,o=e[r](t.cell(n),s.cell(n)),0!=o)return o;return 0})),t.indexRowsByTree()}resetSort(){this.settings=[],this.colMap.clear(),this.model.rowRoot.sort(ew),this.model.indexRowsByTree()}persistSort(){this.model.rows.forEach(((t,e)=>t.origIndex=e))}}class ow{get properties(){return this._properties}set properties(t){this._properties=t}constructor(t){t&&this.pupulate(t)}pupulate(t){this.author=t.author,this.text=t.text,this.date=t.date?new Date(t.date):null,this.data=t.data,this.readOnly=!!t.readOnly,this._properties=t.props}getSourceData(){const t={};return this._properties&&(t.props=this._properties),this.author&&(t.author=this.author),this.text&&(t.text=this.text),this.data&&(t.data=this.data),null!==this.readOnly&&(t.readOnly=this.readOnly),this.date&&(t.date=Zo("en-US")(this.date,"yyyy-MM-dd HH:mm:ss")),t}}class rw{constructor(t,e){this.model=t,this._commentMap=new Map,this.has=t=>this._commentMap.has(t),this.delete=t=>this._commentMap.delete(t),this.cleanCell=t=>{this.has(t)&&this._commentMap.set(t,this.get(t).filter((t=>(t.text??"").length>0||null!=t.data)))},this.get=t=>(this.has(t)||this._commentMap.set(t,[]),this._commentMap.get(t)),this.set=(t,e)=>{this._commentMap.set(t,e?.map((t=>t instanceof ow?t:new ow(t)))||[]),this.cleanCell(t)},e&&this.populate(e)}populate(t){t.forEach((t=>{const e=t.a1||new iv(t.c,t.r).A1;this._commentMap.has(e)||this._commentMap.set(e,[]),this._commentMap.get(e).push(new ow(t))})),this._commentMap.forEach((t=>{t.sort(((t,e)=>(e.date?e.date.getTime():0)-(t.date?t.date.getTime():0)))}))}shift(t){Array.from(this._commentMap.keys()).forEach((e=>{const i=iv.fromA1(e);i.shift(t),i.A1!=e&&(this._commentMap.set(i.A1,this._commentMap.get(e)),this._commentMap.delete(e))}))}}function nw(t,e,i){t.forEach((t=>t.forEach((t=>{t[1]==e&&(t[1]=i)}))))}class sw{get cellDependencies(){return this._cellDependencies}get cellDependants(){return this._cellDependants}get rangeDependencies(){return this._rangeDependencies}get rangeDependants(){return this._rangeDependants}get sheetDependencies(){return this._sheetDependencies}get sheetDependants(){return this._sheetDependants}constructor(t,e="calculations"){this.model=t,this.modelPart=e,this._cellDependencies=new Map,this._cellDependants=new Map,this._rangeDependencies=new Map,this._rangeDependants=new Map,this._sheetDependencies=new Map,this._sheetDependants=new Map}clear(){this._cellDependants.clear(),this._cellDependencies.clear(),this._rangeDependencies.clear(),this._rangeDependants.clear()}clearCellDependecies(t){return this._cellDependencies.has(t)&&this._cellDependencies.delete(t),this._rangeDependencies.has(t)&&this._rangeDependants.delete(t),this}has(t){return this._cellDependencies.has(t)||this._rangeDependencies.has(t)}add(t,e,i){const o=iv.fromA1(t).removeAnchors(),r=iv.fromA1(e).removeAnchors();e=r.A1;const n=r.isRange,s=n?this._rangeDependencies:this._cellDependencies;let a=null;if((s.has(t)?s.get(t):s.set(t,new Map).get(t)).set(e,[r,i]),i){const t=this.model.getConnectedModel(i);t&&(t.calculations.dependencies.sheetDependants.set(this.model.name,this.model.name),this.sheetDependencies.set(i,i),a=n?t.calculations.dependencies.rangeDependants:t.calculations.dependencies.cellDependants),i=this.model.name}else a=n?this._rangeDependants:this._cellDependants;a&&(a.has(e)||a.set(e,new Map),a.get(e).set(t,[o,i]))}getDependants(t,e=null){let i,o;const r=t.A1;return e=e??new Map,this._cellDependants.has(r)&&this._cellDependants.get(r).forEach((([t,n])=>{e.has(t)||(n&&(o=this.model.getConnectedModel(n)),i=o||this.model,e.set(t,[i.getCellByRange(t),n]),o?o[this.modelPart].dependencies.getDependants(t).forEach(((t,i)=>{e.set(i,[t[0],t[1]??n])})):(t.A1!=r||o)&&i.calculations.dependencies.getDependants(t,e))})),this._rangeDependants.forEach(((i,o)=>{iv.fromA1(o).contains(t)&&i.forEach((([t,i])=>{e.has(t)||(e.delete(t),this.getDependants(t,e.set(t,[(i?this.model.getConnectedModel(i):this.model).getCellByRange(t),i])))}))})),e}renameSheet(t,e){this._sheetDependants.has(t)&&(this._sheetDependants.delete(t),this._sheetDependants.set(e,e)),this._sheetDependencies.has(t)&&(this._sheetDependencies.delete(t),this._sheetDependencies.set(e,e)),nw(this._cellDependants,t,e),nw(this._cellDependencies,t,e),nw(this._rangeDependants,t,e),nw(this._rangeDependencies,t,e)}}class aw{get dependencies(){return this._dependencies}constructor(t,e){this.model=t,this._dependencies=new sw(t,e)}}function lw(t){return t instanceof RangeError?"Maximum call stack size exceeded"==t.message?"infinite loop":t.message:t.toString()}class cw extends aw{get tokenizer(){return this._tokenizer}get formulas(){return this._formulas}constructor(t){super(t,"calculations"),this._tokenizer=new Jf,this._formulas=new Map,this.context=new Ly(t)}createFormula(t){const e=new wv(t.formula,this.tokenizer);return this._formulas.set(t.address,e),t.hasOwnFormula&&(t.formula=e.createFormulaString()),this.createDependecies(t),e}createDependecies(t){const e=t.address;if(this.formulas.has(e)){const i=this.formulas.get(e);i.ranges.forEach((([t,i,o])=>this._dependencies.add(e,i.A1,o))),i.cells.forEach((([t,i,o])=>this._dependencies.add(e,i.A1,o))),i.variables.forEach((([i,o])=>{const r=this.model.getCellByName(o,t.range);r&&this._dependencies.add(e,r.address,null)}))}return this}refreshFormula(t){return t.refreshFormula(),this.formulas.delete(t.address),this.clearDependecies(t),this}updateDependencies(t){return this.clearDependecies(t).getFormula(t),this}getFormula(t){return this._formulas.has(t.address)?this._formulas.get(t.address):this.createFormula(t)}refresh(){this.dependencies.clear(),this._formulas.clear()}clearDependecies(t){const e=t.address;return this.dependencies.clearCellDependecies(e),this.formulas.delete(e),this}evaluateFormula(t,e){return this.context.currentCell=e,t.fn(this.context,{cell:e,formula:t})}evaluateExpression(t,e){this.context.currentCell=e;const i=new wv(t,this.tokenizer);return i.fn(this.context,{cell:e,formula:i})}evaluate(t,e){if(!t)return null;let i=null;if(t.hasFormula){const o=this.getFormula(t);try{t.clearError(),this.context.currentCell=t,i=o.fn(this.context,{cell:t,formula:o}),Array.isArray(i)?(e||this.model.spillValues({cell:t,values:i}).range,i=i.length>0&&i[0].length>0?i[0][0]:null,e&&(t.value=i)):t.value=i}catch(e){t.error={message:lw(e)}}}else i=t.value;return i}evaluateAll(){this.model.rows.forEach((t=>this.model.columns.forEach(((e,i)=>t.cell(i).evaluate()))))}calculateViewport(t){const e=[];return t.rows.forEach((t=>t.cells.forEach((t=>{if(t.hasFormula){if(!t.hasValue&&(this.evaluate(t),t.spillRange))for(const i of this.model.getRangeIterator(t.spillRange))e.push(i);e.push(t)}})))),e}shift(t){this.getFormulaCells().forEach((e=>{e.formula=this.getFormula(e).shift(t).createFormulaString(!1),this.updateDependencies(e)}));const e=this.model.name;return this.dependencies.sheetDependants.forEach((i=>{const o=this.model.getConnectedModel(i);o?.calculations.getFormulaCells().forEach((i=>{const r=o.calculations.getFormula(i);r.hasSheetReference(e)&&(i.formula=r.shift(t).createFormulaString(!1),o.calculations.updateDependencies(i))}))})),this}getFormulaCells(){const t=this.model,e=[];let i;const o=t.rows.length,r=t.columns.length;for(let n=0;n<o;n++){i=t.rows[n];for(let t=0;t<r;t++)i.hasCellFormula(t)&&e.push(i.cell(t))}return e}renameSheet(t,e){let i=!1;return this.dependencies.renameSheet(t,e),this.getFormulaCells().forEach((o=>{const r=this.getFormula(o);r.renameSheet(t,e)&&(o.formula=r.createFormulaString(),this.refreshFormula(o),i=!0)})),i}invalidateCellDependants(t){const e=[];return this.dependencies.getDependants(t.range).forEach((([t,i])=>{e.push([t,i]),t.invalidateValue()})),e}invalidateDependants(t){const e=new Map,i=new Map;for(const i of t)this.invalidateCellDependants(i).forEach((([t,i])=>e.set(t,i)));e.forEach(((t,e)=>i.set(e,t)));for(const i of t)e.set(i,null);return e.forEach(((t,e)=>{this.model.sparklines.dependencies.getDependants(e.range).forEach((([t,e])=>{i.set(t,e)})),this.model.conditionalFormats.dependencies.getDependants(e.range).forEach((([t,e])=>{this.model.conditionalFormats.invalidateExtremes(t),t.invalidateStyle(),i.set(t,e)}))})),i}}const hw="#ff0000",dw="#fcd53f",uw="#00bb5e",pw="#555555",gw=new Map([["3Arrows",[{icon:["fas","down"],color:hw},{icon:["fas","right"],color:dw},{icon:["fas","up"],color:uw}]],["3ArrowsGray",[{icon:["fas","down"],color:pw},{icon:["fas","right"],color:pw},{icon:["fas","up"],color:pw}]],["3Flags",[{icon:["fas","flag-pennant"],color:hw},{icon:["fas","flag-pennant"],color:dw},{icon:["fas","flag-pennant"],color:uw}]],["3TrafficLights1",[{icon:["fas","circle"],color:hw},{icon:["fas","circle"],color:dw},{icon:["fas","circle"],color:uw}]],["3TrafficLights2",[{icon:["fas","square-o"],color:hw},{icon:["fas","square-o"],color:dw},{icon:["fas","square-o"],color:uw}]],["3Signs",[{icon:["fas","square"],rotation:45,color:hw},{icon:["fas","triangle"],color:dw},{icon:["fas","circle"],color:uw}]],["3Symbols",[{icon:["fas","circle-xmark"],color:hw},{icon:["fas","circle-exclamation"],color:dw},{icon:["fas","circle-check"],color:uw}]],["3Symbols2",[{icon:["fas","xmark"],color:hw},{icon:["fas","exclamation"],color:dw},{icon:["fas","check"],color:uw}]],["3Stars",[{icon:["fal","star"],color:dw},{icon:["fas","star-half-stroke"],color:dw},{icon:["fas","star"],color:dw}]],["3Triangles",[{icon:"caret-down",color:hw},{icon:"dash",color:dw},{icon:"caret-up",color:uw}]],["4Arrows",[{icon:["fas","down"],color:hw},{icon:["fas","down-right"],color:dw},{icon:["fas","up-right"],color:dw},{icon:["fas","up"],color:uw}]],["4ArrowsGray",[{icon:["fas","down"],color:pw},{icon:["fas","down-right"],color:pw},{icon:["fas","up-right"],color:pw},{icon:["fas","up"],color:pw}]],["4RedToBlack",[{icon:["fas","circle"],color:"#000000"},{icon:["fas","circle"],color:"#b1b1b1"},{icon:["fas","circle"],color:"#edb2a3"},{icon:["fas","circle"],color:hw}]],["4Rating",[{icon:"signal-bars-weak",color:"#4a7db1"},{icon:"signal-bars-fair",color:"#4a7db1"},{icon:"signal-bars-good",color:"#4a7db1"},{icon:["fas","signal-bars"],color:"#4a7db1"}]],["4TrafficLights",[{icon:["fas","circle"],color:"#000000"},{icon:["fas","circle"],color:hw},{icon:["fas","circle"],color:dw},{icon:["fas","circle"],color:uw}]],["5Arrows",[{icon:["fas","down"],color:hw},{icon:["fas","down-right"],color:dw},{icon:["fas","right"],color:dw},{icon:["fas","up-right"],color:dw},{icon:["fas","up"],color:uw}]],["5ArrowsGray",[{icon:["fas","down"],color:pw},{icon:["fas","down-right"],color:pw},{icon:["fas","right"],color:pw},{icon:["fas","up-right"],color:pw},{icon:["fas","up"],color:pw}]],["5Rating",[{icon:["fal","signal-bars"]},{icon:["fal","signal-bars-weak"],color:"#4a7db1"},{icon:["fal","signal-bars-fair"],color:"#4a7db1"},{icon:["fal","signal-bars-good"],color:"#4a7db1"},{icon:["fas","signal-bars"],color:"#4a7db1"}]],["5Quarters",[{icon:["fal","circle"],color:"#505050"},{icon:["fas","circle-quarter-stroke"],color:"#505050"},{icon:["fas","circle-half-stroke"],color:"#505050"},{icon:["fas","circle-three-quarters-stroke"],color:"#505050"},{icon:["fas","circle"],color:"#505050"}]]]),mw=(t,e)=>{const i=gw.get(t);return i?i[e]:null};class fw extends aw{constructor(t,e){super(t,"conditionalFormats"),this.formats=[],this.cellFormatMap=new Map,this.extremes=new Map,e&&this.populate(e)}populate(t){t.forEach((t=>{try{this.add(t)}catch(e){Sr().error(`conditional format error: ${JSON.stringify(t)}`,e)}}))}refresh(){this.dependencies.clear(),this.cellFormatMap.clear(),this.extremes.clear(),this.formats.forEach((t=>this.initConditionalFormat(t)))}clearCellDependecies(t){const e=t.address;return this.dependencies.clearCellDependecies(e),this.cellFormatMap.get(e).forEach((t=>({cf:t.cf}))),this}getExtremes(t){if(this.extremes.has(t.key))return this.extremes.get(t.key);const e=[1/0,-1/0];return t.ranges.forEach((t=>{for(const i of this.model.getValuesInRange(t))for(const t of i)null!=t&&(isNaN(t)||(e[0]=Math.min(e[0],t),e[1]=Math.max(e[1],t)))})),t.cmin&&("num"==t.cmin.t?e[0]=t.cmin.v:"percent"==t.cmin.t&&(e[0]=e[0]+(e[1]-e[0])*t.cmin.v/100)),t.cmax&&("num"==t.cmax.t?e[1]=t.cmax.v:"percent"==t.cmax.t&&(e[1]=e[0]+(e[1]-e[0])*t.cmax.v/100)),this.extremes.set(t.key,e),e}invalidateExtremes(t){this.cellFormatMap.get(t.address).forEach((t=>this.extremes.delete(t.cf.key)))}evaluateScaleFormat(t,e){const i=t.value;if(null==i)return null;const[o,r]=this.getExtremes(e.cf);let n;const s=(i-o)/(r-o);if(e.cf.cmid?.color)n=.5==s?"#"+e.cf.cmid.color:s>.5?Nr("#"+e.cf.cmid.color,"#"+e.cf.cmax.color,2*(s-.5)):Nr("#"+e.cf.cmin.color,"#"+e.cf.cmid.color,2*s);else{if(!e.cf.cmin?.color||!e.cf.cmax?.color)return null;n=Nr("#"+e.cf.cmin.color,"#"+e.cf.cmax.color,s)}return{color:Pr(n).substring(1),fgColor:n.substring(1)}}evaluateBarFormat(t,e){const i=t.value;if(null==i)return null;const o=this.getExtremes(e.cf);let r=o[0];const n=o[1],s=r<0;s||(r-=.1*(n-r));const a=Math.round(100*(i-r)/(n-r));e.initialized||(e.initialized=!0,e.cf.ranges.forEach((e=>this._dependencies.add(t.address,e.A1,null))));const l=[];if(s){const t=Math.round(-100*r/(n-r));i>=0?(l.push(`#00000000 ${t}%`),l.push(`#${e.cf.color} ${t}%`),l.push(`#${e.cf.color} ${a}%`),l.push(`#00000000 ${a}%`)):(l.push(`#00000000 ${a}%`),l.push(`#ff0000 ${a}%`),l.push(`#ff0000 ${t}%`),l.push(`#00000000 ${t}%`))}else l.push(`#${e.cf.color} ${a}%`),l.push(`#00000000 ${a}%`);return{cssStyle:{backgroundClip:"padding-box",backgroundImage:`linear-gradient(90deg, ${l.join(",")})`}}}evaluateFormulaFormat(t,e){if(!e.initialized&&e.cf.condition){e.initialized=!0;const i=t.address,o=new wv(e.cf.condition,this.model.calculations.tokenizer);e.f=o.shift({index:0,offset:t.c-e.cf.firstCell.c1,direction:"right"}).shift({index:0,offset:t.r-e.cf.firstCell.r1,direction:"down"}),o.cells.forEach((t=>this._dependencies.add(i,t[1].A1,t[2]))),o.ranges.forEach((t=>this._dependencies.add(i,t[1].A1,t[2]))),o.variables.forEach((([e,o])=>{const r=this.model.getCellByName(o,t.range);r&&this._dependencies.add(i,r.address,null)}))}if(e.f&&!this.model.calculations.evaluateFormula(e.f,t))return null;const i={...e.cf.style};return i.color||jr(Pr(Hr(e.cf.style.fgColor))),i}evaluateIconFormat(t,e){const i=t.value;if(null==i)return null;const[o,r]=this.getExtremes(e.cf);let n;for(let t=e.cf.thresh.length-1;t>=0;t--){const s=e.cf.thresh[t];if("percent"===s.t){if(null==n&&(n=100*(i-o)/(r-o)),n>=s.v)return{icon:mw(e.cf.v,t)}}else if("num"===s.t&&i>=s.v)return{icon:mw(e.cf.v,t)}}return null}evaluate(t){const e=t.address,i=this.cellFormatMap.get(e);if(!i)return null;let o=null,r=null;for(const e of i){try{switch(e.cf.type){case"formula":r=this.evaluateFormulaFormat(t,e);break;case"scale":r=this.evaluateScaleFormat(t,e);break;case"bar":r=this.evaluateBarFormat(t,e);break;case"icon":r=this.evaluateIconFormat(t,e);break;default:r=null}}catch(t){Sr().error(`Conditional format error: ${JSON.stringify(e)}`,t)}if(r&&(o=o?{...o,...r}:r,e.cf.stop))break}return o}initConditionalFormat(t){return t.firstCell=null,t.ranges.forEach((e=>{for(const i of new Sw(e.intersect(this.model.gridRange))){const e=i.A1;"formula"===t.type&&(t.firstCell||(t.firstCell=i,t.formula=t.condition?new wv(t.condition,this.model.calculations.tokenizer):null)),(this.cellFormatMap.get(e)||this.cellFormatMap.set(e,[]).get(e)).push({cf:t})}})),t}add(t){const e={key:t.ranges,ranges:iv.fromA1s(t.ranges),type:t.type||"formula",firstCell:null,formula:null,style:t.style?this.model.styles.add(t.style):null,condition:t.condition,stop:!!t.stop,cmin:t.cmin,cmid:t.cmid,cmax:t.cmax,color:t.color,v:t.v,thresh:t.thresh};this.formats.push(this.initConditionalFormat(e))}getSourceData(){return this.formats.map((t=>({type:t.type,ranges:iv.toA1s(t.ranges),style:t.style,condition:t.condition,stop:t.stop,cmin:t.cmin,cmid:t.cmid,cmax:t.cmax,color:t.color,v:t.v,thresh:t.thresh})))}}const vw=(t,e)=>{const i=new RegExp(`${ut(t)}`,"ig");return t=>(i.lastIndex=0,i.test(ct((t[e]??"").toString())))},bw=(t,e)=>i=>!!i[e]===t,yw=(t,e)=>{const i=t.map((t=>t.key?.toString()));return t=>null!=t[e]&&i.includes(t[e].toString())},ww=(t,e)=>t=>!1,xw=(t,e,i)=>(i=i??"value","b"===t?bw(e,i):"s"===t&&Array.isArray(e)?yw(e,"value"):"s"===t?vw(e?.toString(),"formattedValue"):"m"===t&&Array.isArray(e)?ww(e,i):vw(e?.toString(),"d"===t?"formattedValue":i));class kw extends Event{constructor(){super("filter",{bubbles:!1,cancelable:!0,composed:!0})}}class Cw extends EventTarget{constructor(t){super(),this.model=t,this.settings=new Map,this.custom=!1}get(t){return this.settings.has(t)?this.settings.get(t):null}filter(t,e=!0){null===t.term||""===t.term?this.settings.delete(t.c):this.settings.set(t.c,t),this.custom||(this.settings.size>0?this.applyFilter(!1):this.resetFilter(!1)),e&&this.dispatchEvent(new kw)}applyFilter(t=!0){const e=[];this.settings.forEach(((t,i)=>{const o=this.model.columns[i];e.push({c:i,matcher:xw(o.type,t.term,o.filter?.property)})}));const i=e.length,o=this.model.options.filters?.includeParents??!0,r=this.model.options.filters?.includeChildren??!0,n=new Set;this.model.rows.forEach((t=>{const s=n.has(t.index);(t=>{if(!t.filterable)return!0;for(let o=0;o<i;o++)if(!e[o].matcher(t.cell(e[o].c)))return!1;return!0})(t)?(t.filterState=Er.Matched,o&&t.walkUp((t=>{if(n.has(t.index)&&t.filterState>0)return!1;t.filterState=Er.ChildMatched,n.add(t.index)})),r&&t.walk((t=>{if(n.has(t.index)&&t.filterState>0)return!1;t.filterState=Er.ParentMatched,n.add(t.index)}))):s||(t.filterState=Er.Filtered),n.add(t.index)})),this.model.indexRows(),t&&this.dispatchEvent(new kw)}resetFilter(t=!0){this.settings.clear(),this.model.rows.forEach((t=>t.filterState=Er.Matched)),this.model.indexRows(),t&&this.dispatchEvent(new kw)}}class Mw extends aw{constructor(t,e){super(t,"sparklines"),this.model=t,this.map=new Map,this.groups=new Map,this.extremes=new Map,this.maxIndex=0,this.updateRangeMap=!1,this.populate(e)}populate(t){t?.forEach((t=>{try{this.add(iv.fromA1(t.location),Array.isArray(t.data)?t.data.map((t=>[iv.fromA1(t)])):t.data.split(",").map((t=>[iv.fromA1(t)])),ot({},$f.DEFAULT_SPARKLINE_OPTIONS,t.options))}catch(e){this.model.logger.error(`sparkline error: ${JSON.stringify(t)}`,e)}}))}getSourceData(){const t=[];return this.groups.forEach((e=>{t.push({location:e.locRange.A1,data:e.dataRanges.map((t=>t[0].A1)).join(","),options:{minValue:e.minValue,maxValue:e.maxValue,type:e.type,style:e.style,marker:e.marker}})})),t}has(t){return this.map.has(t)}get(t){return this.map.get(t)}createDependencies(t){this.map.get(t)[1].forEach((e=>this._dependencies.add(t,e[0].A1,e[1])))}updateRangeMaps(){this.dependencies.clear(),this.map.clear(),this.groups.forEach(((t,e)=>this.createRangeMap(e,t.locRange,t.dataRanges)))}getValues(t){this.updateRangeMap&&this.updateRangeMaps();const e=this.map.get(t),i=e[1][0][1]?this.model.getConnectedModel(e[1][0][1]):this.model;return this._dependencies.has(t)||this.createDependencies(t),e[1].flatMap((t=>i.getValuesInRange(t[0])[0]))}getExtremes(t){const e=this.map.get(t),i=e[1][0][1]?this.model.getConnectedModel(e[1][0][1]):this.model,o=this.groups.get(e[0]);let r,n,s,a;return null==o.minValue||Q(o.minValue)?"auto"==(o.minValue||"auto")?(r=r??lt(...e[1].map((t=>i.getValuesInRange(t[0])))),s=r[0]):(this.extremes.has(e[0])||this.extremes.set(e[0],lt(...o.dataRanges.map((t=>i.getValuesInRange(t[0]))))),n=this.extremes.get(e[0]),s=n[0]):s=o.minValue,null==o.maxValue||Q(o.maxValue)?"auto"==(o.maxValue||"auto")?(r=r??lt(...e[1].map((t=>i.getValuesInRange(t[0])))),a=r[1]):(this.extremes.has(e[0])||this.extremes.set(e[0],lt(...o.dataRanges.map((t=>i.getValuesInRange(t[0]))))),n=this.extremes.get(e[0]),a=n[1]):a=o.maxValue,[s,a]}createRangeMap(t,e,i){e=e.intersect(this.model.gridRange);const o=i[0][0].size,r=e.size;if(r.columns>1&&r.rows>1)return void this.model.logger?.error(`invalid sparkline location range: ${e.A1}`);let n=!1;if(n=1==r.columns&&1==r.rows?o.rows>1:r.columns>1,n)for(let o=e.c1;o<=e.c2;o++)this.map.set(new iv(o,e.r1).A1,[t,i.map((([t,i])=>[new iv(t.c1+o-e.c1,t.r1,t.c1+o-e.c1,t.r2),i]))]);else for(let o=e.r1;o<=e.r2;o++)this.map.set(new iv(e.c1,o).A1,[t,i.map((([t,i])=>[new iv(t.c1,t.r1+o-e.r1,t.c2,t.r1+o-e.r1),i]))])}add(t,e,i){const o=++this.maxIndex;t&&e&&this.createRangeMap(o,t,e),this.groups.set(o,Object.assign({dataRanges:e,locRange:t},JSON.parse(JSON.stringify($f.DEFAULT_SPARKLINE_OPTIONS)),i))}update(t,e,i,o){const r=this.groups.get(t);Object.assign(r,{dataRanges:i,locRange:e},o),this.updateRangeMap=!0}delete(t){this.groups.delete(t),this.updateRangeMap=!0}shift(t){this.groups.forEach((e=>{e.dataRanges.forEach((([e])=>e.shift(t))),e.locRange.shift(t)})),this.updateRangeMaps()}}class _w extends iv{constructor(t,e,i=!1){super(e.c1,e.r1,e.c2,e.r2),this.model=t,this.initializedOnly=i,this.r=0,this.c=-1,this.done=!1}[Symbol.iterator](){return this}nextInitialized(){let t;for(;!this.done&&!t;)this.c<this.size.columns-1?this.c++:this.r<this.size.rows-1&&(this.c=0,this.r++),t=this.model.rows[this.r].cells[this.c],this.done=this.c>=this.size.columns-1&&this.r>=this.size.rows-1;return t}next(){if(this.done)return{done:!0};this.c<this.size.columns-1?this.c++:this.r<this.size.rows-1&&(this.c=0,this.r++),this.done=this.c>=this.size.columns-1&&this.r>=this.size.rows-1;const t=this.model.rows[this.r+this.r1],e=this.c+this.c1,i=this.initializedOnly&&!t.isCellInitialized(e)?this.nextInitialized():t?.cell(e);return i?{done:!1,value:i}:{done:!0}}forEach(t){let e;for(;e=this.next().value;)t(e)}}class Sw extends iv{constructor(t){super(t.c1,t.r1,t.c2,t.r2),this.r=0,this.c=-1,this.done=!1}[Symbol.iterator](){return this}next(){return this.done?{done:!0}:(this.c<this.size.columns-1?this.c++:this.r<this.size.rows-1&&(this.c=0,this.r++),this.done=this.c==this.size.columns-1&&this.r==this.size.rows-1,{done:!1,value:new iv(this.c+this.c1,this.r+this.r1)})}}class Ew extends iv{constructor(t,e,i){super(e.c1,e.r1,e.c2,e.r2),this.model=t,this.i=0,this.done=!1,this.axis=i,this.key="rows"===i?"r1":"c1"}[Symbol.iterator](){return this}next(){if(this.done)return{done:!0};this.i<this.size[this.axis]-1&&this.i++,this.done=this.i>=this.size[this.axis]-1;const t=this.model[this.axis][this.i+this[this.key]];return t?{done:!1,value:t}:{done:!0}}forEach(t){let e;for(;e=this.next().value;)t(e)}}class zw{constructor(t,e){this.model=t,this.names=new Map,this.rangeMap=new Map,e&&this.populate(e)}populate(t){t.forEach((({name:t,ref:e})=>this.set(t,Z(e)?iv.fromCoords(e):iv.fromA1(e))))}set(t,e){this.names.set(t,e),this.rangeMap.set(e.A1,t)}delete(t){const e=this.names.get(t);e&&(this.rangeMap.delete(e.A1),this.names.delete(t))}findCellByName(t){let e;const i=this.model.rows,o=this.model.columns.length;for(let r=0;r<i.length;r++){e=i[r];for(let i=0;i<o;i++)if(e.hasCellName(i)){const o=e.cell(i);if(o.name==t)return o.range}}return null}getCellByName(t,e){const i=this.names.get(t)??this.findCellByName(t);return i?i.isColumn?this.model.rows.length>e.r1?this.model.columns[i.c1].cell(e.r1):null:i.isRow?this.model.columns.length>e.c1?this.model.rows[i.r1].cell(e.c1):null:this.model.rows[i.r1].cell(i.c1):null}getRangeByName(t,e=!0){const i=this.names.get(t);return e?i?.intersect(this.model.gridRange):i}shift(t){this.names.forEach(((e,i)=>{const o=e.A1;e.shift(t);const r=e.A1;o!=r&&(this.rangeMap.delete(o),this.rangeMap.set(r,i))}))}}function Lw(t,e=null){const i=ot({},$f.DEFAULT_OPTIONS,e,en(t,e));return i.numberFormat?i.numberFormatter=ur(i.formatLocale,i.numberFormat):i.numberFormatter||(i.numberFormatter=ur(i.formatLocale)),i.dateFormat?i.dateFormatter=Zo(i.formatLocale,i.dateFormat):i.dateFormatter||(i.dateFormatter=Zo(i.formatLocale)),i.columnSorting&&(i.sorting=i.sorting||{enabled:!0}),"boolean"==typeof i.filters&&(i.filters={enabled:i.filters}),i.filters=Object.assign({},Af,i.filters),"boolean"==typeof i.rowTree&&(i.rowTree={enabled:i.rowTree}),i.rowTree=Object.assign({},Of,i.rowTree),"boolean"==typeof i.columnTree&&(i.columnTree={enabled:i.columnTree}),i.columnTree=Object.assign({},Of,i.columnTree),i.cellValidation&&(i.cellValidation=Ay(i.cellValidation)),i}class Iw extends(Lr($y)){get cells(){return this._cells}get data(){return this._data}set data(t){this._data=t}get height(){return this._height??this.model.options.rowHeight}set height(t){this._height=t}get priority(){return this._priority}set priority(t){this._priority=t}get address(){return ov(this.index)}get range(){return new iv(null,this.index,null,this.index)}get hasFormula(){return!!this._formula}get formula(){return this._formula}set formula(t){super.formula=t,this.model.columns.forEach((t=>this.cell(t.index).refreshFormula()))}get values(){return this.model.columns.map((t=>this.cell(t.index).value))}cell(t,e){if(this.model.options.singleCellModel)return this._singleCell||(this._singleCell=new Zy(this.model,{c:t,r:this.index})),this._singleCell.row=this,this._singleCell.column=this.model.columns[t],this._singleCell;let i=this._cells[t];if((e||!i)&&this.model.columns[t]){if(i=new Zy(this.model,e??{c:t,r:this.index}),this._data){const e=this.model.columns[t].data;if(null!=e){const t=this._data[e];Z(t)?(t.comment&&this.model.comments.set(i.address,[t.comment]),i.populate(t)):i.hasValue||(i.value=t)}}i.name&&this.model.names.set(i.name,i.range),this._cells[t]=i}return i}constructor(t,e){super(t,e),this.isCellInitialized=t=>!!this.cells[t],this._cells=[],null==this._priority&&(this._priority=t.options.rowPriority)}populate(t){super.populate(t),this._height=null==t.h||"auto"==t.h?this.model.options.rowHeight:t.h,t.data&&(Array.isArray(t.data)?this._data=[...t.data]:this._data={...t.data}),null!=t.priority&&(this._priority=t.priority)}getSourceData(){const t=super.getSourceData();return null!=this._height&&this._height!=this.model.options.rowHeight&&(t.h=this._height),t}expand(t){super.expand(t),this.model.indexVisibleRows()}collapse(){super.collapse(),this.model.indexVisibleRows()}get prev(){return this.model.rows[this.index-1]}get next(){return this.model.rows[this.index+1]}get prevVisible(){let t=this.prev;for(;t&&!t.visible;)t=t.prev;return t}get nextVisible(){let t=this.next;for(;t&&!t.visible;)t=t.next;return t}hasCellFormula(t){return this.cells[t]&&this.cells[t].hasFormula||this._data&&this._data[this.model.columns[t].data]&&this._data[this.model.columns[t].data].f}hasCellName(t){return this.cells[t]&&null!=this.cells[t].name||this._data&&this._data[this.model.columns[t].data]&&null!=this._data[this.model.columns[t].data].name}insertColumns(t,e,i=!1){let o;const r=this.model.columns.length,n=this.model.calculations;if(i)for(let i=0;i<r;i++)this.hasCellFormula(i)&&(o=this.cell(i),o.formula=n.getFormula(o).shift({index:t,offset:e,direction:"right"}).createFormulaString(!1));t<this.cells.length&&this.cells.splice(t,0,...Array(e).fill(null))}deleteColumns(t,e,i=!1){let o;const r=this.model.columns.length,n=this.model.calculations;if(i)for(let i=0;i<r;i++)this.hasCellFormula(i)&&(o=this.cell(i),o.formula=n.getFormula(o).shift({index:t,offset:e,direction:"left"}).createFormulaString(!1));return t<this.cells.length?this.cells.splice(t,e):null}clearCalculatedValues(){this.cells.forEach((t=>t&&this.model.calculations.refreshFormula(t)))}}var Rw=i(4418),Tw=i.n(Rw);const Aw=t=>t?"1":"0",Ow=t=>null==t?"_":t,$w=t=>null==t?"_":t.toString(),Dw=t=>null==t?"_":JSON.stringify(t),Nw=t=>Ow(t&&t.color?t.color:"_")+Ow(t&&t.style?t.style:"_"),Pw=t=>Ow(t?t.horizontal:null)+Ow(t?t.vertical:null)+Ow(t?t.horizontal:null)+$w(t?t.indent:null)+Aw(t?t.wrapText:null)+$w(t?t.textRotation:null),jw=t=>Tw()("s_"+Aw(t.bold)+Aw(t.italic)+Aw(t.underline)+$w(t.sz)+Ow(t.font)+Ow(t.color)+Nw(t.top)+Nw(t.right)+Nw(t.bottom)+Nw(t.left)+Ow(t.patternType)+Ow(t.fgColor)+Ow(t.bgColor)+Pw(t.alignment)+$w(t.angle)+Dw(t.stops)+Aw(t.hidden)+Aw(t.editable)+Dw(t.cssStyle)+Dw(t.icon));function Hw(t){const e={...t};return delete e.id,delete e.hash,e}class Bw{constructor(t){this.model=t,this._count=0,this.hashmap=new Map,this.map=new Map}add(t){if(!isNaN(t))return this.get(t);const e=this.model.options.cssStyles?Gy(t):t,i=e.hash?e.hash:jw(e);return this.hashmap.has(i)?this.map.get(this.hashmap.get(i)):(null==e.id&&(e.id=this._count),this._count=Math.max(e.id+1,this._count+1),e.hash=i,this.hashmap.set(i,e.id),this.map.set(e.id,e),e)}populate(t){t.forEach((t=>this.add(t)))}get(t){return this.map.has(t)?this.map.get(t):null}remove(t){const e="object"==typeof t?t:this.map.get(t);this.hashmap.delete(e.hash),this.map.delete(e.id)}merge(...t){const e=Object.assign({},...t.map((t=>Z(t)?t:this.get(t))));return this.add(Hw(e))}duplicate(t,e){const i=this.get(t);return this.add(Hw({...i,...e}))}set(t,e){let i=this.map.has(t)?this.map.get(t):{};for(const t in e)i[t]=e[t];return i=i.id?i:this.add(i),i}unset(t,e){if(this.map.has(t)){const i=this.map.get(t);for(const t of e)delete i[t]}}getSourceData(){return Array.from(this.map.values())}clean(){const t=new Map(Array.from(this.map.entries()).map((([t])=>[t,0])));this.model.columns.forEach((e=>{const i=t.get(e.style);null!=i&&t.set(e.style,i+1)})),this.model.rows.forEach((e=>{const i=t.get(e.style);null!=i&&t.set(e.style,i+1),e.cells.forEach((e=>{const i=t.get(e.style);null!=i&&t.set(e.style,i+1)}))})),t.forEach(((t,e)=>{0==t&&this.remove(e)}))}}function Fw(t,e,i,o){const r=o??("rows"==i?e.rows:e.columns),n=function(t){const e=new Map;for(const i of t)e.has(i.level)||e.set(i.level,[]),e.get(i.level).push(i);return e}(r),s=t[i]??[];for(const t of s){let o;if(o=t.index>-1?[r[t.index]]:t.level>-1?n.get(t.level):r,t.name){const e=t.name instanceof RegExp?t.name:new RegExp(ut(t.name));o=o.filter((t=>e.test(t.name)))}o?.forEach((o=>{null!=t.priority&&(o.priority=t.priority),t.type?e.conditionalFormats.add(Object.assign({ranges:`${o.address}:${o.address}`},t)):(o.style=e.styles.add(t.style).id,"rows"==i&&null!=t.height?o.height=t.height:"columns"==i&&null!=t.width&&(o.width=t.width))}))}}function Ww(t,e){for(const i of t)if(e[i.property]!=i.value)return!1;return!0}function Vw(t,e,i){const o=t.cells??[];for(const t of o)if(t.conditions?.length){const o=e.getRangeIterator(i??e.gridRange);for(const i of o)Ww(t.conditions,i)&&(i.style=e.styles.add(t.style).id)}else if(t.type)e.conditionalFormats.add(Object.assign({ranges:"A:"+e.columns[e.columns.length-1].address},t));else for(const i of e.columns)null==i.style&&(i.style=e.styles.add(t.style).id)}function Uw(t,e,i){Fw(t,e,"columns",i)}function Gw(t,e,i){Fw(t,e,"rows",i)}function qw(t,e){Vw(t,e),Uw(t,e),Gw(t,e)}var Yw;!function(t){t[t.NONE=0]="NONE",t[t.MERGED=1]="MERGED",t[t.HIDDEN=2]="HIDDEN"}(Yw||(Yw={}));class Zw{get mergedCells(){return this._mergedCells}get hiddenCells(){return this._hiddenCells}constructor(t){this.model=t,this._mergedCells=new Map,this._hiddenCells=new Map}clear(){this._mergedCells.clear(),this._hiddenCells.clear(),this.model.rows.forEach((t=>{t.cells.forEach((t=>{t.rowspan=1,t.colspan=1}))}))}getMergeState(t){return this._mergedCells.has(t)?Yw.MERGED:this._hiddenCells.has(t)?Yw.HIDDEN:Yw.NONE}indexMergedCells(t){const e=t.A1,i=this._mergedCells.get(e);if(!i)return;const o=i.r,r=i.c,n=t.clone(),s=this.model.rows[o].cell(r);s.rowspan=i.rs,s.colspan=i.cs;for(let t=0;t<i.rs;t++)for(let e=0;e<i.cs;e++)0==t&&0==e||(n.r1=o+t,n.c1=r+e,n.r2=n.r1,n.c2=n.c1,this._hiddenCells.set(n.A1,i))}add(t){const e=new iv(t.c,t.r),i=e.A1;if(this._mergedCells.has(i))this.remove(i);else if(this._hiddenCells.has(i))return;this._mergedCells.set(i,t),this.indexMergedCells(e)}remove(t){const e=this._mergedCells.get(t);if(!e)return;const i=e.r,o=e.c,r=new iv(o,i),n=this.model.rows[i].cell(o);n.rowspan=1,n.colspan=1,this._hiddenCells.delete(t);for(let t=0;t<e.rs;t++)for(let n=0;n<e.cs;n++)0==t&&0==n||(r.r1=i+t,r.c1=o+n,r.r2=r.r1,r.c2=r.c1,this._hiddenCells.delete(r.A1))}shift(t){const{index:e,offset:i,direction:o}=t,r={down:t=>{e<=t.r?t.r+=i:e>t.r&&e<t.r+t.rs&&(t.rs+=i)},up:t=>{e<=t.r?t.r-=i:e>t.r&&e<t.r+t.rs&&(t.rs-=i)},right:t=>{e<=t.c?t.c+=i:e>t.c&&e<t.c+t.cs&&(t.cs+=i)},left:t=>{e<=t.c?t.c-=i:e>t.c&&e<t.c+t.cs&&(t.cs-=i)}};this.mergedCells.forEach((t=>{const e=new iv(t.c,t.r);this.remove(e.A1),r[o](t),this.add(t)}))}}const Xw=["index","name","rows","columns","cells","options","sparklines","rules","comments","styles","names","props","tab","theme"];class Qw{get mergedHeaders(){return this._mergedHeaders}get hasFilter(){return this._filter}get hasRowTree(){return this._maxRowLevel>0}get hasRowTreeEnabled(){return this.hasRowTree&&this.options.rowTree.enabled}get maxRowLevel(){return this._maxRowLevel}get hasColumnTree(){return this._maxColumnLevel>0}get hasColumnTreeEnabled(){return this.hasColumnTree&&this.options.columnTree.enabled}get maxColumnLevel(){return this._maxColumnLevel}get headerCount(){return this._headerCount}get columnHeaderCount(){return this.headerCount+(this.hasColumnTreeEnabled?1:0)+(this.hasFilter?1:0)}get properties(){return this._properties}set properties(t){this._properties=t}get theme(){return this._theme}set theme(t){this._theme=t}constructor(t,e,i){this.otherModels={},this.autofitColumns=new Set,this.autofitRows=new Set,this.merges=new Zw(this),this.styles=new Bw(this),this.comments=new rw(this),this.calculations=new cw(this),this.names=new zw(this),this.sorting=new iw(this),this.sparklines=new Mw(this),this.conditionalFormats=new fw(this),this._filter=!1,this._maxRowLevel=0,this._maxColumnLevel=0,this._headerCount=0,this._levelBasedRowTree=!0,this._levelBasedColTree=!0,this.clearRows=()=>(this.rowRoot.clearChildren(),this.rows=[],this.rows),this.clearColumns=()=>this.columns=[],this.logger=i,this.options=e??Lw(t.options),this.populate(t)}getConnectedModel(t){return this.group?this.group.get(t):null}getModelByRange(t){return t.sheet?this.getConnectedModel(t.sheet):this}getCellByA1(t){return this.getCellByRange(iv.fromA1(t))}getCellByRange(t){return this.getCellByCoords(t.r1,t.c1)}getCellByCoords(t,e){return this.rows[t]?.cell(e)}cell(t,e){return isNaN(t)?t instanceof iv?this.getCellByRange(t):"string"==typeof t?this.getCellByA1(t):null:this.getCellByCoords(t,e||0)}createRows(t,e=new Iw(this,{l:-1}),i=0){let o=!1,r=!1;this.autofitRows.clear();const n=t.map(((t,e)=>{t||(t={}),isNaN(t.l)||(o=!0),null!=t.p&&(r=!0),"auto"==t.h&&this.autofitRows.add(e);const n=new Iw(this,t);return n.origIndex=e+i,n.name&&this.names.set(n.name,iv.fullRow(e)),n}));let s=-1;return o?s=Ir(n,e,{reverse:this.options.rowTree.reversed}):r?s=Rr(n,e):e.children=n,r||(o=!0),[e,n,s,o]}insertRowData(t,e,i){const o=this.createRows(i,new Iw(this,{l:t.level}),e);if(this._maxRowLevel=Math.max(this._maxRowLevel,o[2]),t.insertChildren(o[0].children,e),this.indexRowsByTree(),this.theme){const t=o[1];Gw(this.theme,this,t),Vw(this.theme,this,new iv(0,t[0].index,1/0,t[t.length-1].index))}}applyTheme(t,e){if(e)for(const t of this.getInitializedCellIterator())t.invalidateStyle();qw(t,this)}populate(t){this.index=t.index,this.name=t.name??this.name,this.tab=t.tab;let e=!1,i=!1;if(t.columns||(t.columns=new Array(this.options.columns).fill({})),t.rows||(t.rows=new Array(this.options.rows).fill({})),t.styles&&this.styles.populate(t.styles),this.autofitColumns.clear(),this.columns=t.columns.map(((t,o)=>{t||(t={}),t.l>0&&(e=!0),null!=t.p&&(i=!0),"auto"==t.w&&this.autofitColumns.add(o);const r=new Qy(this,t);return this._filter=r.hasFilter||this._filter,r.name&&this.names.set(r.name,iv.fullColumn(o)),r})),this._levelBasedColTree=e,this._maxColumnLevel=-1,this.colRoot=new Qy(this,{l:-1}),e?this._maxColumnLevel=Ir(this.columns,this.colRoot,{reverse:this.options.columnTree.reversed}):i?this._maxColumnLevel=Rr(this.columns,this.colRoot):this.colRoot.children=this.columns,i||(this._levelBasedColTree=!0),this.indexColumns(),this.indexVisibleColumns(),[this.rowRoot,this.rows,this._maxRowLevel,this._levelBasedRowTree]=this.createRows(t.rows),this.indexRows(),this.indexVisibleRows(),this.options.pageSize&&this.options.pageSize<=this.rows.length&&(this.rowRoot.count=1/0),this.merges.clear(),t.comments=t.comments||[],t.cells?.forEach(((e,i)=>{const o=this.rows[e.r]?this.rows[e.r].cell(e.c,e):null;o?(o.colspan>1||o.rowspan>1)&&this.merges.add({r:o.r,c:o.c,rs:o.rowspan,cs:o.colspan}):this.logger?.error(`invalid cell definition (index ${i}): ${JSON.stringify(e)}`),o&&e.comment&&t.comments.push(Object.assign(e.comment,{c:e.c,r:e.r}))})),t.sparklines)try{this.sparklines.populate(t.sparklines)}catch(t){Sr().error(`Sparkline init error: ${t}`)}if(t.names)try{this.names.populate(t.names)}catch(t){Sr().error(`Named range init error: ${t}`)}if(t.rules)try{this.conditionalFormats.populate(t.rules)}catch(t){Sr().error(`Conditional formats init error: ${t}`)}if(t.theme)try{this.applyTheme(t.theme),this._theme=t.theme}catch(t){Sr().error(`Theme init error: ${t}`)}if(t.comments)try{this.comments.populate(t.comments)}catch(t){Sr().error(`Comment init error: ${t}`)}this._properties=t.props,this.otherSourceData={};const o=new Set(Xw),r=Object.keys(t).filter((t=>!o.has(t)));r.forEach((e=>this.otherSourceData[e]=t[e])),this.options.sorting?.defaultSettings&&(this.sorting.settings=this.options.sorting.defaultSettings),this.calcHeaderHeights()}getSourceData(){const t={index:this.index,name:this.name,tab:this.tab,columns:this.columns.map((t=>t.getSourceData())),rows:this.rows.map((t=>t.getSourceData())),styles:this.styles.getSourceData(),rules:this.conditionalFormats.getSourceData(),sparklines:this.sparklines.getSourceData(),options:this.options};this._properties&&(t.props=this._properties);const e=[];let i;for(let t=0;t<this.rows.length;t++)for(let o=0;o<this.columns.length;o++)i=this.rows[t].cell(o).getSourceData(),Object.keys(i).length>0&&(i.r=t,i.c=o,e.push(i));e.length>0&&(t.cells=e);const o=[];return this.styles.clean(),this.styles.map.forEach((t=>o.push(t))),o.length>0&&(t.styles=o),new Set([...Object.keys(this.otherModels??{}),...Object.keys(this.otherSourceData??{})]).forEach((e=>t[e]=this.otherModels[e]?Array.from(this.otherModels[e]).map((t=>t.getSourceData())):this.otherSourceData[e])),t}calcHeaderHeights(){this._headerCount=0,this._headerHeights=[],this.columns.forEach((t=>{this._headerCount=t.header?t.header.length:this._headerCount,this._headerHeights.length<this._headerCount&&this._headerHeights.push(...Array(this._headerCount-this._headerHeights.length).fill(0)),t.header?.forEach(((t,e)=>{e>=this._headerHeights.length&&this._headerHeights.push(0),this._headerHeights[e]=Math.max(this._headerHeights[e],t.height??0)}))}))}indexRows(){this.visibleRows=[],this.rows.forEach(((t,e)=>{t.index=e,t.isLoaded||(t.collapsed=!0),t.hidden||t.filterState==Er.Filtered||(t.visibleIndex=this.visibleRows.length,this.visibleRows.push(t))}))}indexVisibleRows(){this.visibleRows=[];let t=0;if(this._levelBasedRowTree){if(this.rowRoot.walkVisible((e=>{e.visibleIndex=t++,this.visibleRows.push(e)})),this.options.rowTree.reversed){const e=new Array(this.visibleRows.length);this.visibleRows.forEach(((i,o)=>{t=this.visibleRows.length-o-1,i.visibleIndex=t,e[t]=i})),this.visibleRows=e}}else this.rowRoot.walkVisible((t=>this.visibleRows[t.index]=t)),this.visibleRows=this.visibleRows.filter((e=>!!e&&(e.visibleIndex=t++,!0)))}indexRowsByTree(){this.rows=[];let t=0;this.rowRoot.walk((e=>{e.index=t++,this.rows.push(e)})),this.options.rowTree.reversed&&this.rows.reverse(),this.indexVisibleRows()}indexColumns(){this.visibleColumns=[],this.columns.forEach(((t,e)=>{t.index=e,t.hidden||this.visibleColumns.push(t)}))}indexVisibleColumns(){this.visibleColumns=[],this.visibleColumnIndex={};let t=0;if(this.colRoot.walkVisible((e=>{e.visibleIndex=t,this.visibleColumnIndex[e.index]=t++,this.visibleColumns.push(e)})),this.options.columnTree.reversed){this.visibleColumnIndex={};const e=new Array(this.visibleColumns.length);this.visibleColumns.forEach(((i,o)=>{t=this.visibleColumns.length-o-1,i.visibleIndex=t,this.visibleColumnIndex[i.index]=t,e[t]=i})),this.visibleColumns=e}this.indexHeaders()}indexHeaders(){this._mergedHeaders=[],this._headerCount=0,this.colRoot.walkVisible((t=>{this._headerCount=Math.max(t.header?t.header.length:0,this._headerCount),t.mergedHeaders.forEach((e=>this._mergedHeaders.push({h:e,c:t.index,r:e.r,cs:t.calculateRealColspan(e.cs??1),rs:e.rs??1})))})),this._mergedHeaders.forEach((t=>{if(!t.h.hidden)for(let e=t.c;e<t.c+t.cs;e++)for(let i=t.r;i<t.r+t.rs;i++)(i>t.r||e>t.c)&&this.columns[e]&&this.columns[e].header[i]&&(this.columns[e].header[i].hidden=!0)})),this.calcHeaderHeights()}removeHeader(t){this.columns.forEach((e=>{t<e.header.length&&e.header.splice(t,1)})),this.indexHeaders()}clear(){this.clearRows(),this.clearColumns(),this.resetViewport()}resetViewport(){return this._viewport=null,this}getViewport(t,e,i){const o=[],r=[];let n,s,a=e.h,l=0;for(l=0;l<i.t;l++)n=this.visibleRows[l],a-=n.height,o.push(n);for(l=this.visibleRows.length-i.b;l<this.visibleRows.length;l++)n=this.visibleRows[l],a-=n.height;for(l=i.t+t.r;a>0&&l<this.visibleRows.length;)n=this.visibleRows[l++],a-=n.height,o.push(n);for(l=this.visibleRows.length-i.b;l<this.visibleRows.length;l++)o.push(this.visibleRows[l]);let c=e.w,h=0;for(h=0;h<i.l;h++)s=this.visibleColumns[h],c-=s.width,r.push(s);for(h=this.visibleColumns.length-i.r;h<this.visibleColumns.length;h++)s=this.visibleColumns[h],c-=s.width;for(h=i.l+t.c;c>0&&h<this.visibleColumns.length;)s=this.visibleColumns[h++],c-=s.width,r.push(s);for(h=this.visibleColumns.length-i.r;h<this.visibleColumns.length;h++)r.push(this.visibleColumns[h]);return this._viewport={rows:o,columns:r}}calculateViewport(){return this._viewport?this.calculations.calculateViewport(this._viewport):[]}getValuesInRange(t,e=!1){if(!(t=t.intersect(this.gridRange)))return[];const{columns:i,rows:o}=t.size,r=new Array(o);let n,s=0,a=0;for(let o=t.r1;o<=t.r2;o++){r[s]=new Array(i),a=0,n=this.rows[o];for(let i=t.c1;i<=t.c2;i++)r[s][a++]=e?n.cell(i).formattedValue:n.cell(i).value;++s}return r}setRowExpandLevel(t){this.rows.forEach((e=>{e.collapsed=!e.isLoaded&&!e.isPartialyLoaded||e.level>=t,e.level<=t&&(e.hidden=!1)})),this.indexVisibleRows()}setColumnExpandLevel(t){this.columns.forEach((e=>e.collapsed=e.level>=t)),this.indexVisibleColumns()}getViewportRange(){return this._viewport?new iv(this._viewport.columns[0].index,this._viewport.rows[0].index,this._viewport.columns[this._viewport.columns.length-1].index,this._viewport.rows[this._viewport.rows.length-1].index):null}get gridRange(){return new iv(0,0,this.columns.length-1,this.rows.length-1)}getRangeIterator(t,e=!1){return new _w(this,e&&this._viewport?t.intersect(this.getViewportRange()):t.intersect(this.gridRange))}getInitializedCellIterator(){return new _w(this,this.gridRange,!0)}getRowIterator(t,e=!1){return t=e&&this._viewport?t.intersect(this.getViewportRange()):t.intersect(this.gridRange),new Ew(this,t,"rows")}getColumnIterator(t,e=!1){return t=e&&this._viewport?t.intersect(this.getViewportRange()):t.intersect(this.gridRange),new Ew(this,t,"columns")}getCellArray(t){const e=[];for(const i of this.getRangeIterator(t))e.push(i);return e}transformRangeToMatrix(t,e){let i,o,r;const n=[];for(let s=(t=t.intersect(this.gridRange)).r1;s<=t.r2;s++)if(i=this.rows[s],i){r=[];for(let n=t.c1;n<=t.c2;n++)o=i.cell(n),o&&r.push(e(o));n.push(r)}return n}getCellMatrix(t){return this.getModelByRange(t)?.transformRangeToMatrix(t,(t=>t))}getValueMatrix(t){return this.getModelByRange(t)?.transformRangeToMatrix(t,(t=>t.value))}shift(t){t.sheet=this.name,this.merges.shift(t),this.calculations.shift(t),this.names.shift(t),this.comments.shift(t),this.sparklines.shift(t)}clearCalculations(t=!1){t&&this.group?this.group.models.forEach((t=>t.calculations.refresh())):this.calculations.refresh()}refreshSparklines(){this.sparklines.updateRangeMaps();for(const t of this.getInitializedCellIterator())t.invalidateStyle()}clearCalculatedStyles(){this.conditionalFormats.refresh();const t=[];for(const e of this.getInitializedCellIterator())t.push(e),e.invalidateStyle()}insertColumns(t,e,i=!1){const o=this.columns[Math.min(this.columns.length-1,t)].parent;i&&++t,this.shift({index:t,offset:e,direction:"right"});for(let i=0;i<this.rows.length;i++)this.rows[i].insertColumns(t,e,!1);const r=new Array(e).fill(null).map((()=>new Qy(this)));return this.columns.splice(t,0,...r),this.maxColumnLevel>0&&o.insertChildren(r,t-(o.index||-1)-1),this.indexColumns(),this.clearCalculations(!0),r}deleteColumns(t,e){const i=this.columns[t].parent;this.shift({index:t,offset:e,direction:"left"});const o=[];for(let i=0;i<this.rows.length;i++)o.push(this.rows[i].deleteColumns(t,e,!1));const r=this.columns.splice(t,e);return i?.deleteChildren(r),this.indexColumns(),this.clearCalculations(!0),r}insertRows(t,e,i=!1){const o=Math.min(this.rows.length-1,t),r=o<0?this.rowRoot:this.rows[o].parent;i&&++t;const n=isNaN(e)?e.length:e;this.shift({index:t,offset:n,direction:"down"});const s=isNaN(e)?e:new Array(n).fill(null).map((()=>new Iw(this)));return this.rows.splice(t,0,...s),this.maxRowLevel>0&&r.insertChildren(s,t-(r.index||-1)-1),this.indexRows(),this.theme&&(Gw(this.theme,this,s),Vw(this.theme,this,new iv(0,s[0].index,1/0,s[s.length-1].index))),this.clearCalculations(!0),s}deleteRows(t,e){const i=this.rows[t].parent;this.shift({index:t,offset:e,direction:"up"});const o=this.rows.splice(t,e);return i?.deleteChildren(o),this.indexRows(),this.clearCalculations(!0),o}moveRows(t,e,i){const o=this.rows.splice(t,e);return this.rows.splice(i,0,...o),this.shift({index:t,offset:i-t,direction:"down",maxIndex:t+e-1}),this.indexRows(),this.clearCalculations(!0),o}moveColumns(t,e,i){const o=this.columns.splice(t,e);return this.columns.splice(i,0,...o),this.shift({index:t,offset:i-t,direction:"right",maxIndex:t+e-1}),this.indexColumns(),this.clearCalculations(!0),o}spillValues(t){const{cell:e,values:i,displayValues:o,propertyCell:r}=t,n=[],s=[],a=0===i.length||0===i[0].length;let l,c;const h=a?null:new iv(e.c,e.r,e.c+i[0].length-1,e.r+i.length-1);if(e.spillRange&&this.getRangeIterator(e.spillRange,!0).forEach((t=>{e==t||h?.contains(t.range)||t.clearSpilledValue()})),e.spillRange=h,a)return{cells:n,oldValues:s,range:null};for(let t=h.r1;t<=h.r2;t++){if(l=this.rows[t],!l)continue;const a=t-h.r1;for(let t=h.c1;t<=h.c2;t++){const d=t-h.c1;c=l.cell(t),c.editable&&(s.push(c.value2),c.spillValue(i[a][d],e),r&&(c.format=r.format,c.type=r.type),o&&null!=o[a][d]&&(c.displayValue=o[a][d]),n.push(c))}}return{cells:n,oldValues:s,range:h}}getCellByName(t,e,i=!0){return this.names.getCellByName(t,e)||(this.group&&i?this.group.getCellByName(t,e):null)}getRangeByName(t,e=!0){return this.names.getRangeByName(t)||(this.group&&e?this.group.getRangeByName(t):null)}getValueMatrixByName(t,e=!0){const i=this.names.getRangeByName(t);return i?this.getValueMatrix(i):this.group&&e?this.group.getValueMatrixByName(t):null}rebuildRowTree(){const t=this._levelBasedRowTree?Ir:Rr;this._maxRowLevel=t(this.rows,this.rowRoot,{reverse:this.options.rowTree.reversed}),this.indexRowsByTree()}rebuildColumnTree(){const t=this._levelBasedColTree?Ir:Rr;this._maxColumnLevel=t(this.columns,this.colRoot,{reverse:this.options.columnTree.reversed}),this.indexColumns()}calculateCellOffset(t){let e=0,i=0;for(let i=0;i<t.c1&&this.columns[i];i++)e+=this.columns[i].width;for(let e=0;e<t.r1&&this.rows[e];e++)i+=this.rows[e].height;return{x:e,y:i}}}class Kw{get errors(){return this._errors}get(t){return this.models.get(t)}has(t){return this.models.has(t)}getNewName(){let t;do{t=`sheet${this._max}`}while(this.models.has(t));return t}add(t){if(t.index=t.index??this._max,++this._max,t.name=t.name||this.getNewName(),this.models.has(t.name))throw Error(`sheet "${t.name}" already exists`);return this.models.set(t.name,t),t.group=this,t}duplicate(t){const e=this.get(t);if(!e)return;const i=new Qw(e.getSourceData(),e.options);let o=1;for(;this.models.has(`${t}_${o}`);)++o;return i.name=`${t}_${o}`,this.add(i),i}remove(t){return this.models.delete(t),this}rename(t,e){if(this.has(t)){if(this.has(e))throw new Error(`Model '${e}' already exists`);const i=this.get(t);i.name=e,this.models.set(e,i),this.models.delete(t),this.models.forEach((i=>{i.calculations.renameSheet(t,e)&&i.calculateViewport()}))}return this}clear(){this.models.clear(),this._errors=[]}constructor(t){this._max=0,this.models=new Map,this.themes=new Map,this._errors=[],t&&this.populate(t)}populate(t){this.clear(),t.models.forEach((t=>{const e=new Qw(t);try{this.add(e)}catch(t){this.errors.push(t)}})),t.themes&&t.themes.forEach((t=>this.themes.set(t.name,t)))}getSourceData(){const t={models:[]};return this.models.forEach((e=>t.models.push(e.getSourceData()))),t}getCellByName(t,e){for(const i of this.models.values()){const o=i.getCellByName(t,e,!1);if(o)return o}return null}getRangeByName(t){for(const e of this.models.values()){const i=e.getRangeByName(t,!1);if(i)return i}return null}getValueMatrixByName(t){for(const e of this.models.values()){const i=e.getValueMatrixByName(t,!1);if(i)return i}return null}}class Jw{constructor(t){this.model=t,this.stack=[],this.restack=[]}push(t){return this.restack=[],t.timestamp||(t.timestamp=Date.now()),this.stack.push(t),this}pop(t=1){let e=0;const i=[];for(;e++<t&&this.stack.length>0;){const t=this.stack.pop();i.push(t),this.restack.push(t)}return i}pop2(t=1){let e=0;const i=[];for(;e++<t&&this.restack.length>0;){const t=this.restack.pop();i.push(t),this.stack.push(t)}return i}}class tx{get activeCellCoords(){return{c:this.range.c1+this.activeCell.c1,r:this.range.r1+this.activeCell.r1}}constructor(t,e,i,o){this.hidden=!1,this.range=new iv(t,e,i,o),this.activeCell=new iv(0,0)}static fromRange(t){return new tx(t.c1,t.r1,t.c2,t.r2)}setCoords(t,e,i,o){this.range.setCoords(t,e,i,o),this.activeCell.setCoords(0,0)}setRange(t){"string"==typeof t&&(t=iv.fromA1(t)),this.range.setCoords(t.c1,t.r1,t.c2,t.r2),this.activeCell.setCoords(0,0)}move(t,e,i,o){this.range.setCoords(this.range.c1+this.activeCell.c1,this.range.r1+this.activeCell.r1,this.range.c1+this.activeCell.c2,this.range.r1+this.activeCell.r2),this.range.move(t,e,i,o,!1),this.activeCell.setCoords(0,0)}moveRange(t,e,i,o){this.range.move(t,e,i,o,!0)}moveActiveCell(t,e){const{columns:i,rows:o}=this.range.size;this.activeCell.move(t,e,i,o,!0)}}const ex={...$f,CUSTOM_CLIPBOARD_TYPE:"web application/json"};class ix{constructor(t,e,i=ex.MAX_CACHE_ITEMS){this.maxCacheItems=i,this.queue=[],this.disabled=!1,this.table=new Array(e).fill(null).map((()=>new Array(t)))}get(t,e){return this.table[e][t]}delete(t,e){return this.table[e][t]=null,this}deleteColumn(t){for(let e=0;e<this.table.length;e++)this.table[e][t]=null;return this}deleteRow(t){return this.table[t]=new Array(this.table[0].length).fill(null),this}set(t,e,i){this.disabled||(this.get(t,e)||this.queue.push([e,t]),this.table[e][t]=i)}clear(){this.queue=[],this.table=this.table.map((t=>new Array(t.length)))}clean(){if(this.maxCacheItems>0&&this.queue.length>this.maxCacheItems){let t=this.queue.length;for(let e=0;e<this.queue.length;e++){const i=this.queue[e];if(!this.table[i[0]][i[1]].parentNode&&(this.queue[e]=null,this.table[i[0]][i[1]]=null,--t<=this.maxCacheItems))break}t<this.queue.length&&(this.queue=this.queue.filter((t=>t)))}}}var ox=function(t,e,i,o){var r,n=arguments.length,s=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s};let rx=class extends xs{constructor(){super(),this.render=()=>es`
|
|
3434
|
+
`,Af={enabled:!1,includeChildren:!0,includeParents:!0},Of={enabled:!0,reversed:!1},$f={ROW_HEIGHT:22,RESIZE_TRESHOLD:10,ROW_HEADER_WIDTH:60,SLIDER_SIZE:12,EXPANDER_SIZE:13,MAX_CACHE_ITEMS:5e3,CACHE_CLEAN_INTERVAL:30,COMMENT_HIDE_TIMEOUT:1e3,SELECTOR_BORDER_WIDTH:2,MIN_ROW_HEIGHT:5,MIN_COL_WIDTH:5,SPARKLINE_GAP:4,AUTOSCROLL_TRESHOLD:100,AUTOSCROLL_RATIO:1.1,AUTOSCROLL_INTERVAL:100,DEFAULT_SPARKLINE_OPTIONS:{minValue:"auto",maxValue:"auto",type:"line",style:{color:"0094FF",weight:1},marker:{color:"ff0000"}},DEFAULT_OPTIONS:{rows:100,columns:20,readOnly:!1,rowNumbers:!0,rowPriority:2,rowTree:{enabled:!0},columnTree:{enabled:!0},colLetters:!0,emptyPlaceholder:!0,freezeTop:0,fontSize:12,rowHeight:22,rowResize:!0,columnWidth:100,columnResize:!0,columnPriority:1,freezeLeft:0,freezeRight:0,freezeBottom:0,maxSortingColumns:3,numberFormat:null,levelIndentFactor:2,cellIndentFactor:10,emptyClickable:!1,grid:!0,autofill:!0,undoRedo:!0,commandWindow:!0,cellCache:!0,singleCellModel:!1,zoom:1,editing:{rowInsertion:!0,rowDeletion:!0,colInsertion:!0,colDeletion:!0,rowOutline:!0,colOutline:!0,dateCalendarEditor:!1},comments:{hideTimeout:1e3,offsetX:30,offsetY:-30,zIndex:500,headerPosition:"top"},scrolling:{verticalOverscroll:!0,horizontalOverscroll:!0,scrollbarVisibilityTreshold:100},selecting:{enabled:!0,multiSelect:!0},events:{click:{mouseMoveTreshold:10}},clipboard:{pasteProps:["v","dv"],rowPasteMode:"rewrite_append",columnPasteMode:"rewrite"},print:{dpi:600,margins:{left:6.35,right:6.35,top:19.05,bottom:19.05,header:7.62,footer:7.62},orientation:"portrait",paper:"A4"}},MAX_COMMENT_AUTOHEIGHT:300,MIN_COMMENT_AUTOHEIGHT:25,...G},Df=/^(?!.*[\\\/\*\[\]\:\?"])(.{1,31})$/;function Nf(t){return Df.test(t)}function Pf(t){return["\\","/","*","[","]",":","?",'"'].forEach((e=>t=t.replace(new RegExp(`\\${e}`,"g"),""))),t}function jf(t,e){return!isNaN(t)&&null!=t||!isNaN(e)&&null!=e||(t=null==t?"":ct(t.toString()).toLowerCase(),e=null==e?"":ct(e.toString()).toLowerCase()),t>e?1:t<e?-1:0}function Hf(t,e){const i=Q(e);return Q(t)?(t=t.toString().trim()).startsWith("=")?0==jf(e,i?t.substring(1):parseFloat(t.substring(1))):t.startsWith(">=")?jf(e,i?t.substring(2):parseFloat(t.substring(2)))>=0:t.startsWith("<=")?jf(e,i?t.substring(2):parseFloat(t.substring(2)))<=0:t.startsWith(">")?jf(e,i?t.substring(1):parseFloat(t.substring(1)))>0:t.startsWith("<")?jf(e,i?t.substring(1):parseFloat(t.substring(1)))<0:0==jf(e,i?t:isNaN(t)?t||"":parseFloat(t)):e==t}const Bf=new Map([["=",["==",1,0]],[">",[">",1,0]],["<",["<",1,0]],[">=",[">=",1,0]],["<=",["<=",1,0]],["+",["+",2,0]],["-",["-",2,0]],["*",["*",3,0]],["/",["/",3,0]]]),Ff=t=>["=",">","<",">=","<="].includes(t),Wf=t=>["+","-","*","/"].includes(t),Vf=t=>Wf(t)||Ff(t);function Uf(t,e,i){switch(i){case"+":return t+e;case"-":return t-e;case"*":return t*e;case"/":return t/e;case"=":return 0==jf(t,e);case">":return jf(t,e)>0;case"<":return jf(t,e)<0;case">=":return jf(t,e)>=0;case"<=":return jf(t,e)<=0;default:throw new Error(`Invalid operator: ${i}`)}}function Gf(t,e,i){const o=Array.isArray(t),r=Array.isArray(e);if(!o&&!r)return[[Uf(t,e,i)]];const n=Math.max(o?t.length:0,r?e.length:0),s=Math.max(o?t[0].length:0,r?e[0].length:0),a=[];for(let l=0;l<n;l++){const n=[];for(let a=0;a<s;a++){const s=o?t[l]?.[a]:t,c=r?e[l]?.[a]:e,h=null==s&&null==c?null:Uf(s,c,i);n.push(h)}a.push(n)}return a}var qf;!function(t){t[t.Number=0]="Number",t[t.Boolean=1]="Boolean",t[t.String=2]="String",t[t.StringQuote=3]="StringQuote",t[t.Function=4]="Function",t[t.ArgumentSeparator=5]="ArgumentSeparator",t[t.OpenBracket=6]="OpenBracket",t[t.CloseBracket=7]="CloseBracket",t[t.Operator=8]="Operator",t[t.Cell=9]="Cell",t[t.Variable=10]="Variable",t[t.Range=11]="Range",t[t.Sheet=12]="Sheet",t[t.SheetQuote=13]="SheetQuote",t[t.SheetSeparator=14]="SheetSeparator",t[t.Unknown=15]="Unknown",t[t.Operand=16]="Operand"}(qf||(qf={}));const Yf=t=>t===qf.Number||t===qf.Boolean||t===qf.String||t===qf.Cell||t===qf.Variable||t===qf.Range,Zf=t=>t>=48&&t<=57,Xf=t=>"true"===(t=t.toLowerCase())||"false"===t,Qf=t=>t>=65&&t<=90||t>=97&&t<=122||t>=192&&t<=687,Kf={decimalPoint:".",stringQuote:'"',sheetQuote:"'",argumentSeparator:","};class Jf{constructor(t){this.options=Object.assign(Kf,t)}tokenize(t){const e=[],i=t.length;let o,r,n,s,a=0,l="",c=!1,h=!1,d=!1;for(;a<i;){if(o=t.charAt(a),r=o.charCodeAt(0),"="==o&&0==a)++a;else if(Zf(r)){for(l=(d?"-":"")+o,++a;a<i;)if(o=t.charAt(a),r=o.charCodeAt(0),Zf(r))l+=o,++a;else{if(o!==this.options.decimalPoint)break;l+=".",++a}d=!1,e.push([l,qf.Number])}else if(Qf(r)||"$"==o){l=o,n=null,++a;do{if(o=t.charAt(a),r=o.charCodeAt(0),Qf(r)||Zf(r)||"."===o||"$"===o||"_"===o)"_"==o?n=qf.Variable:Zf(r)&&!c&&null==n&&(n=qf.Cell),l+=o,++a,a==i&&e.push([l,n||qf.Variable]);else{if("("==o){e.push([l.toUpperCase(),qf.Function]),e.push([o,qf.OpenBracket]),++a;break}if("'"==o)e.push([l,qf.Sheet]),l="",e.push([o,qf.SheetQuote]),c=!0,++a;else if(":"==o)n=qf.Range,l+=o,++a;else{if(!c||" "!=o){if("!"==o){""!==l&&e.push([l,qf.Sheet]),e.push([o,qf.SheetSeparator]),c=!1,l="",++a;break}e.push([l,n||(Xf(l)?qf.Boolean:qf.Variable)]);break}l+=o,++a}}}while(a<i)}else if(Vf(o)){if("-"===o&&Zf(t.charCodeAt(a+1))&&(null==s||"("==s[0]||Ff(s[0])||s[1]==qf.ArgumentSeparator))d=!0;else{for(l=o;Ff(t.charAt(a+1));)l+=t.charAt(++a);e.push([l,qf.Operator])}++a}else if("("===o)e.push([o,qf.OpenBracket]),++a;else if(")"===o)e.push([o,qf.CloseBracket]),++a;else if("'"===o)e.push([o,qf.SheetQuote]),c=!0,++a;else if(o===this.options.argumentSeparator)e.push([o,qf.ArgumentSeparator]),++a;else if(o===this.options.stringQuote){for(h=!1,e.push([o,qf.StringQuote]),l="";++a<i;){if(o=t.charAt(a),o===this.options.stringQuote){h=!0,++a;break}l+=o}e.push([l,qf.String]),h&&e.push([this.options.stringQuote,qf.StringQuote])}else e.push([o,qf.Unknown]),++a;s=e[e.length-1]}return e}}function tv(t,e,i=null,o=!0){return t+=e,0==e?t:t>=0?i?o?t%i:Math.min(t,i-1):t:o&&i?i+t%i:Math.max(t,0)}const ev=/(?:'?([\w\s]*)'?!)?(\$?)([a-z]*)(\$?)(\d*)(?::(\$?)([a-z]*)(\$?)(\d*))?/i;class iv{constructor(t,e,i,o,r){this.setCoords(t,e,i,o),this.sheet=r}setCoords(t,e,i,o){this.c1=null==t&&null==i?0:t,this.r1=null==e&&null==o?0:e,this.c2=null==o&&null!=t||null!=i?null==i?t:i:1/0,this.r2=null==i&&null!=e||null!=o?null==o?e:o:1/0,this.normalize()}get size(){return{columns:this.c2-this.c1+1,rows:this.r2-this.r1+1}}get count(){const{columns:t,rows:e}=this.size;return t*e}normalize(){const[t,e]=[Math.min(this.c1,this.c2),Math.max(this.c1,this.c2)],[i,o]=[Math.min(this.r1,this.r2),Math.max(this.r1,this.r2)];return this.c1=t,this.c2=e,this.r1=i,this.r2=o,this}move(t,e,i=null,o=null,r=!0){const n=tv(this.c1,t,i,r);r&&(e+=this.c1+t!=n&&0!=t?t>0?1:-1:0),this.c1=n,this.r1=tv(this.r1,e,o,r),this.c2=tv(this.c2,t,i,r),this.r2=tv(this.r2,e,o,r)}contains(t){return t.c1>=this.c1&&t.c2<=this.c2&&t.r1>=this.r1&&t.r2<=this.r2}containsColumn(t){return this.c1<=t&&this.c2>=t}containsRow(t){return this.r1<=t&&this.r2>=t}removeAnchors(){return this.c1Anchor=!1,this.c2Anchor=!1,this.r1Anchor=!1,this.r2Anchor=!1,this}addAnchors(){return this.c1Anchor=!0,this.c2Anchor=!0,this.r1Anchor=!0,this.r2Anchor=!0,this}shiftLeft(t,e=1,i=null,o=!1){return t<=this.c1&&(o||!this.c1Anchor)&&(null==i||this.c1<=i)&&(this.c1-=e),t<=this.c2&&(o||!this.c2Anchor)&&(null==i||this.c2<=i)&&(this.c2-=e),this}shiftRight(t,e=1,i=null,o=!1){return t<=this.c1&&(o||!this.c1Anchor)&&(null==i||this.c1<=i)&&(this.c1+=e),t<=this.c2&&(o||!this.c2Anchor)&&(null==i||this.c2<=i)&&(this.c2+=e),this}shiftUp(t,e=1,i=null,o=!1){return t<=this.r1&&(o||!this.r1Anchor)&&(null==i||this.r1<=i)&&(this.r1-=e),t<=this.r2&&(o||!this.r2Anchor)&&(null==i||this.r2<=i)&&(this.r2-=e),this}shiftDown(t,e=1,i=null,o=!1){return t<=this.r1&&(o||!this.r1Anchor)&&(null==i||this.r1<=i)&&(this.r1+=e),t<=this.r2&&(o||!this.r2Anchor)&&(null==i||this.r2<=i)&&(this.r2+=e),this}shift(t){const{index:e,offset:i,direction:o,maxIndex:r,ignoreAnchors:n}=t;switch(o){case"down":return this.shiftDown(e,i,r,n);case"up":return this.shiftUp(e,i,r,n);case"left":return this.shiftLeft(e,i,r,n);case"right":return this.shiftRight(e,i,r,n)}}intersect(t){this.normalize(),t.normalize();const e=Math.max(t.c1,this.c1),i=Math.min(t.c2,this.c2),o=Math.max(t.r1,this.r1),r=Math.min(t.r2,this.r2);return e<=i&&o<=r?new iv(e,o,i,r,this.sheet):null}unite(t){return this.normalize(),t.normalize(),new iv(Math.min(this.c1,t.c1),Math.min(this.r1,t.r1),Math.max(this.c2,t.c2),Math.max(this.r2,t.r2),this.sheet)}clone(){const t=new iv(this.c1,this.r1,this.c2,this.r2,this.sheet);return t.c1Anchor=this.c1Anchor,t.r1Anchor=this.r1Anchor,t.c2Anchor=this.c2Anchor,t.r2Anchor=this.r2Anchor,t}equals(t,e=!1){return t.c1==this.c1&&t.r1==this.r1&&t.c2==this.c2&&t.r2==this.r2&&(0==e||t.c1Anchor==this.c1Anchor&&t.r1Anchor==this.r1Anchor&&t.c2Anchor==this.c2Anchor&&t.r2Anchor==this.r2Anchor)}get isCell(){return this.c2==this.c2&&this.r2==this.r1}get isRange(){return this.c2!=this.c1||this.r2!=this.r1}get isColumn(){return 0==this.r1&&this.r2==1/0}get isRow(){return 0==this.c1&&this.c2==1/0}get A1(){const t=this.isRange,e=(this.c1Anchor?"$":"")+(0!==this.c1||this.c2!==1/0?nv(this.c1):"")+(0===this.r1&&this.r2===1/0?"":(this.r1Anchor?"$":"")+ov(this.r1)),i=t?(this.c2Anchor?"$":"")+(!isNaN(this.c2)&&this.c2<1/0?nv(this.c2):"")+(this.r2Anchor?"$":"")+(!isNaN(this.r2)&&this.r2<1/0?ov(this.r2):""):e;return(null==this.sheet?"":((o=this.sheet).indexOf(" ")>-1?"'"+o+"'":o)+"!")+(e==i?e:e+":"+i);var o}get bounds(){return[[new iv(this.c1,this.r1),this.c2<1/0?new iv(this.c2,this.r1):null],[this.r2<1/0?new iv(this.c1,this.r2):null,this.r2<1/0&&this.c2<1/0?new iv(this.c2,this.r2):null]]}*cells(){for(let t=this.r1;t<=this.r2;t++)for(let e=this.c1;e<=this.c2;e++)yield new iv(e,t)}static fromA1(t){const e=ev.exec(t),i=new iv(e[3]?sv(e[3]):null,e[5]?rv(e[5]):null,e[7]?sv(e[7]):null,e[9]?rv(e[9]):null,e[1]||null);return!e[2]&&e[3]||(i.c1Anchor=!0),!e[4]&&e[5]||(i.r1Anchor=!0),(e[6]||e[2]&&!e[7])&&(i.c2Anchor=!0),(e[8]||e[4]&&!e[9])&&(i.r2Anchor=!0),i}}function ov(t){return(t+1).toString()}function rv(t){return parseInt(t)-1}function nv(t){++t;let e,i="";for(;t>0;)e=(t-1)%26,i=String.fromCharCode(e+65)+i,t=(t-e-1)/26;return i}function sv(t){const e=t.length;let i=0;for(let o=0;o<e;o++)i+=(t.charCodeAt(o)-64)*Math.pow(26,e-o-1);return i-1}function av(t){return t.sort(((t,e)=>{const i=Math.min(t.r1,t.r2),o=Math.min(e.r1,e.r2),r=Math.min(t.c1,t.c2),n=Math.min(e.c1,e.c2);return i<o?-1:i>o?1:r<n?-1:n>r?1:0}))}function lv(t){return t.formula.cells.map((e=>t.cell.model.getCellByRange(e[1])))}function cv(t){let e=t;for(;Array.isArray(e);)e=e.length>0?e[0]:null;return e}function hv(t){return Array.isArray(t)?t:[[t]]}function dv(t,e,i,o){if(!Array.isArray(t))return e(t,i,o);for(let o=0;o<t.length;o++)if(!1===dv(t[o],e,null==i?o:i,null==i?void 0:o))return!1}iv.fromA1s=(t,e=";")=>t.split(e).map((t=>iv.fromA1(t))),iv.toA1s=(t,e=";")=>t.map((t=>t.A1)).join(e),iv.fromCoords=t=>new iv(t.c1,t.r1,t.c2,t.r2),iv.fullColumn=t=>new iv(t,0,t,1/0),iv.fullRow=t=>new iv(0,t,1/0,t);const uv=new Set(["SUMPRODUCT","FILTER"]),pv=t=>uv.has(t),gv=t=>!!(t&&t.length>0&&"="==t.charAt(0)),mv=t=>gv(t)?t:"="+(t??""),fv=t=>gv(t)?t.substring(1):t,vv=["#5B97FF","#FF616B","#B77CFF","#00B02C","#FC58BE","#FF9000","#2EB0B3"],bv=t=>vv[t%vv.length],yv=new Map([["FORMULATEXT","_xlfn."],["CONCAT","_xlfn."],["INDIRECT","_xlfn."],["ISOWEEKNUM","_xlfn."],["SWITCH","_xlfn."],["XOR","_xlfn."]]);class wv{get fn(){return this._fn??(this._fn=new Function("t","ctx","return "+this.compile()))}get tokens(){return this._tokens}get variables(){return this._variables}get cells(){return this._cells}get ranges(){return this._ranges}get colors(){if(!this._colors){let t;this._colors=new Map,this._tokens.forEach(((e,i)=>{if([qf.Cell,qf.Range].includes(e[1])){const o=(t?"'"+t+"'!":"")+e[0];this._colors.set(o,{color:bv(this._colors.size),address:e[0],sheet:t,type:e[1],tokenIndex:i}),t=null}else e[1]==qf.Sheet&&(t=e[0])}))}return this._colors}constructor(t,e){this.expression=t,this.tokenizer=e,this._tokens=e.tokenize(this.expression),this.updateDependecies()}findTokenIndexAtPosition(t){let e=0;return this._tokens.findIndex((i=>{const o=i[0].length;if(t>=e&&t<=e+o)return!0;e+=o}))}findSheetTokenIndex(t){const e=this._tokens[t];if(![qf.Cell,qf.Range].includes(e[1]))return-1;if(0==t||this._tokens[t-1][1]!=qf.SheetSeparator)return-1;let i=t-2;for(;i>=0;){if(this._tokens[i][1]==qf.Sheet)return i;i--}return-1}removeSheetToken(t){if(this._tokens[t][1]!=qf.Sheet&&(t=this.findSheetTokenIndex(t)),t>-1){t>0&&this._tokens[t-1][1]==qf.SheetQuote&&t--;let e=t;for(;e<this._tokens.length&&[qf.SheetSeparator,qf.SheetQuote,qf.Sheet].includes(this._tokens[e][1]);)e++;return this._tokens.splice(t,e-t),e-t}return 0}getNamedColor(t){return this.colors.get(t)?.color??"inherit"}getTokenPosition(t){let e=0;for(let i=0;i<t;i++)e+=this._tokens[i][0].length;return{min:e,max:e+this._tokens[t][0].length}}updateToken(t,e){this._fn=null,this._formula=null,this._xlFormula=null,this._tokens[t][0]=e}removeToken(t){this._fn=null,this._formula=null,this._xlFormula=null,this._tokens.splice(t,1)}insertToken(t,e,i){this._fn=null,this._formula=null,this._xlFormula=null;const o=[];return i==qf.Sheet&&/\s/.test(e)?(o.push([this.tokenizer.options.sheetQuote,qf.SheetQuote]),o.push([e,qf.Sheet]),o.push([this.tokenizer.options.sheetQuote,qf.SheetQuote])):o.push([e,i]),o.push(["!",qf.SheetSeparator]),this._tokens.splice(t,0,...o),o.length}clone(){return new wv(this.createFormulaString(),this.tokenizer)}updateDependecies(){let t;this._variables=[],this._cells=[],this._ranges=[],this._tokens.forEach(((e,i)=>{switch(e[1]){case qf.Sheet:t=e[0];break;case qf.Variable:this._variables.push([i,e[0],t]),t=void 0;break;case qf.Cell:this._cells.push([i,iv.fromA1(e[0]),t]),t=void 0;break;case qf.Range:this._ranges.push([i,iv.fromA1(e[0]),t]),t=void 0}}))}createFormulaString(t=!1,e=!1){const i=this.tokenizer.options;let o,r,n,s="";for(let l=0;l<this._tokens.length;l++)switch(o=this._tokens[l],o[1]){case qf.SheetQuote:s+="'";break;case qf.SheetSeparator:s+="!";break;case qf.Sheet:r=o[0],s+=t?`<span style="font-style:italic">${r}</span>`:r;break;case qf.Variable:s+=o[0];break;case qf.Range:case qf.Cell:n=(r?"'"+r+"'!":"")+o[0],s+=t?`<span style="color:${this.getNamedColor(n)}">${o[0]}</span>`:o[0],r=null;break;case qf.StringQuote:s+=i.stringQuote;break;case qf.String:s+=o[0].replace(new RegExp(i.stringQuote,"g"),"\\"+i.stringQuote);break;case qf.ArgumentSeparator:s+=i.argumentSeparator;break;case qf.Function:s+=(e?(a=o[0],yv.get(a)??""):"")+o[0];break;case qf.Unknown:s+=t?`<span style="background:#f00;color:#fff">${o[0]}</span>`:o[0];break;default:s+=o[0]}var a;return s}createExpressionTree(){const t=[],e=[],i=this.tokens;let o,r,n,s,a,l=null;for(let c=0;c<i.length;c++)switch(o=i[c],o[1]){case qf.Sheet:l=o[0];break;case qf.Cell:case qf.Range:t.push({t:o[0],tt:o[1],s:l}),l=null;break;case qf.Number:case qf.String:case qf.Boolean:case qf.Variable:t.push({t:o[0],tt:o[1]});break;case qf.Operator:for(0==t.length&&t.push({t:"",tt:qf.Operand}),n=Bf.get(o[0]);e.length>0&&(s=Bf.get(e[e.length-1][0]),s)&&(0===n[2]&&n[1]<=s[1]||1===n[2]&&n[1]<s[1]);)r=e.pop(),a=[t.pop(),t.pop()].reverse(),t.push({t:r[0],tt:r[1],c:a});e.push(o);break;case qf.Function:case qf.OpenBracket:e.push(o);break;case qf.ArgumentSeparator:for(;e.length>0&&(r=e[e.length-1],![qf.OpenBracket,qf.ArgumentSeparator].includes(r[1]));)r=e.pop(),a=[t.pop(),t.pop()].reverse(),t.push({t:r[0],tt:r[1],c:a});e.push(o);break;case qf.CloseBracket:for(a=[];e.length>0&&e[e.length-1][1]!==qf.OpenBracket;)r=e.pop(),r[1]==qf.Operator?a.push({t:r[0],tt:r[1],c:[t.pop(),t.pop()].reverse()}):r[1]==qf.ArgumentSeparator&&t.length>0&&a.push(t.pop());e.pop(),e.length>0&&e[e.length-1][1]===qf.Function?(r=e.pop(),a=a.reverse(),t.length>0&&i[c-1][1]!==qf.OpenBracket&&a.unshift(t.pop()),t.push({t:r[0],tt:r[1],c:a})):t.push(...a)}for(;e.length>0;)r=e.pop(),t.push({t:r[0],tt:r[1],c:[t.pop(),t.pop()].reverse()});return t.pop()}createExpressionJSCode(t,e,i){let o;switch(t.tt){case qf.Range:return"t.rn('"+t.t+"'"+(t.s?",'"+t.s+"'":"")+")";case qf.Cell:return"t.cl('"+t.t+"'"+(t.s?",'"+t.s+"'":"")+")";case qf.Operand:return"t.cl()";case qf.Variable:return i||e?.tt===qf.Function?"t.nr('"+t.t+"'"+(t.s?",'"+t.s+"'":"")+")":"t.nv('"+t.t+"'"+(t.s?",'"+t.s+"'":"")+")";case qf.String:return"'"+t.t.replace(/'/g,"\\'")+"'";case qf.Boolean:return"T"==t.t[0].toUpperCase()?"1":"0";case qf.Function:return o=t.c.map((e=>this.createExpressionJSCode(e,t,i||pv(t.t)))),"t.fn('"+t.t+"').call(ctx"+(o.length>0?","+o.join(","):"")+")";case qf.Operator:return i?(o=t.c.map((e=>this.createExpressionJSCode(e,t,i||pv(t.t)))),"t.op("+o[0]+","+o[1]+",'"+t.t+"')"):Bf.has(t.t)?"("+t.c.map((e=>this.createExpressionJSCode(e,t,i))).join(Bf.get(t.t)[0])+")":null;default:return t.t}}compile(){const t=this.createExpressionTree();return this.createExpressionJSCode(t)}toString(t=!1){return(t?"=":"")+(this._formula??(this._formula=this.createFormulaString()))}toExcelString(){return this._xlFormula??(this._xlFormula=this.createFormulaString(!1,!0))}shift(t){const{index:e,offset:i,direction:o,maxIndex:r,sheet:n,allSheets:s}=t;return this._cells&&this._cells.forEach((t=>{if(s||null==t[2]||t[2]==n){switch(o){case"up":t[1].shiftUp(e,i,r);break;case"right":t[1].shiftRight(e,i,r);break;case"down":t[1].shiftDown(e,i,r);break;case"left":t[1].shiftLeft(e,i,r)}this._tokens[t[0]][0]=t[1].A1}})),this._ranges&&this._ranges.forEach((t=>{if(s||null==t[2]||t[2]==n){switch(o){case"up":t[1].shiftUp(e,i,r);break;case"right":t[1].shiftRight(e,i,r);break;case"down":t[1].shiftDown(e,i,r);break;case"left":t[1].shiftLeft(e,i,r)}this._tokens[t[0]][0]=t[1].A1}})),this}hasSheetReference(t){for(const e of this._cells)if(e[2]==t)return!0;for(const e of this._ranges)if(e[2]==t)return!0;for(const e of this._variables)if(e[2]==t)return!0;return!1}renameSheet(t,e){let i=!1;return this._tokens.forEach((o=>{o[1]==qf.Sheet&&o[0]==t&&(o[0]=e,i=!0)})),i}}function xv(t,e){return e&&(t=ur(this.cell.model.options.locale,vr(e,"d"),!1)(t)),null==t?"":t.toString()}function kv(t,e){return(t=null==t?"":t.toString()).substring(0,e)}function Cv(t,e){return(t=null==t?"":t.toString()).substring(Math.max(0,t.length-e),t.length)}function Mv(t,e,i){return(t=null==t?"":t.toString()).substring(e,e+i)}function _v(...t){let e="";return dv(t,(t=>e+=null==t?"":t.toString())),e}function Sv(t){return t instanceof Date?t:Q(t)?Yo(t,Eo()):rr(t)}function Ev(t){return tt(t)?t:or(t instanceof Date?t:Yo(t,Eo()))}function zv(t){return Q(t)?Ev(t):t}function Lv(t,e){const i=Sv(t).getDay();switch(e){case 2:return i;case 3:return i-1;default:return i%7+1}}function Iv(t,e,i){return nr(Ev(cv(t)),e)}function Rv(){return or(se(new Date))}function Tv(t){return null==(t=cv(t))||""===t}function Av(t,e,i){return or(new Date(t,e-1,i))}function Ov(t){return Sv(t).getFullYear()}function $v(t){return Sv(t).getMonth()+1}function Dv(t){return Sv(t).getDate()}function Nv(t,e){const i=Sv(t);return i.setMonth(i.getMonth()+e+1),i.setDate(0),or(i)}function Pv(t){return xi(Sv(t))}function jv(t){return Math.acos(t)}function Hv(t){return Math.acosh(t)}function Bv(t){return Math.PI/2-Math.atan(t)}function Fv(t){return.5*Math.log((t+1)/(t-1))}function Wv(t){return Math.asin(t)}function Vv(t){return Math.asinh(t)}function Uv(t){return Math.atan(t)}function Gv(t){return Math.atanh(t)}function qv(t){return Math.cos(t)}function Yv(t){return Math.cosh(t)}function Zv(t){return 1/Math.tan(t)}function Xv(t){return 1/Math.tanh(t)}function Qv(t){return 1/Math.sin(t)}function Kv(t){return 1/Math.sinh(t)}function Jv(t){return 180*t/Math.PI}function tb(){return Math.PI}function eb(t){return 1/Math.cos(t)}function ib(t){return 1/Math.cosh(t)}function ob(t){return Math.sin(t)}function rb(t){return Math.sinh(t)}function nb(t){return Math.tan(t)}function sb(t){return Math.tanh(t)}function ab(t){return Math.abs(t)}function lb(t){if(t<0)throw new Error("#NUM");return Math.ceil(t)}function cb(t){return(t=Math.ceil(t))%2==0?t:t+1}function hb(t){return Math.pow(Math.E,t)}function db(t){return t<0?-1:0==t?1:t*db(t-1)}function ub(t){return t<=0?1:t*ub(t-2)}function pb(t){return Math.floor(t)}function gb(t){return t%1!=0}function mb(t){return!gb(t)&&t%2==0}function fb(t){return gb(t)||t%2==1}function vb(t){return Math.log(t)}function bb(t,e){return Math.log(t)/Math.log(e)}function yb(t){return Math.log10(t)}function wb(t,e){return t%e}function xb(t){return(t=Math.ceil(t))%2==0?t+1:t}function kb(t,e){return Math.pow(t,e)}function Cb(...t){let e=1;return dv(t,(t=>e*=t||1)),e}function Mb(t,e){return Math.floor(t/e)}function _b(t){return t*Math.PI/180}function Sb(){return Math.random()}function Eb(t,e){const i=Array(t).fill(null).map((()=>Array(e)));for(let o=0;o<t;o++)for(let t=0;t<e;t++)i[o][t]=Math.random();return i}function zb(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}function Lb(t,e){return t.toFixed(e)}function Ib(t,e){return e=e||0,Math.floor(t*Math.pow(10,e))/Math.pow(10,e)}function Rb(t,e){return e=e||0,Math.ceil(t*Math.pow(10,e))/Math.pow(10,e)}function Tb(t,e,i=1,o=1){const r=Array(t).fill(null).map((()=>Array(e)));let n=i;for(let i=0;i<t;i++)for(let t=0;t<e;t++)r[i][t]=n,n+=o;return r}function Ab(t){return t<0?-1:t>0?1:0}function Ob(t){return Math.sqrt(t)}function $b(t){return Math.sqrt(Math.PI*t)}function Db(...t){let e=0;return dv(t,(t=>e+=null==t?0:1)),e}function Nb(...t){let e=0;return dv(t,(t=>e+=null==t?1:0)),e}function Pb(t,e){let i=0;return dv(t,(t=>i+=Hf(e,t)?1:0)),i}function jb(...t){let e=0;const i=new Map;return dv(t,(t=>{i.has(t)||(i.set(t,t),++e)})),e}function Hb(...t){let e=0;return dv(t,(t=>e+=isNaN(t)||null==t||""===t?0:t)),e}function Bb(t,e,i){let o=0;if(i){const r=hv(i);dv(t,((t,i,n)=>o+=Hf(e,t)&&r[i]&&r[i][n]&&!isNaN(r[i][n])?r[i][n]:0))}else dv(t,(t=>o+=Hf(e,t)&&!isNaN(t)?t:0));return o}function Fb(t,e){let i=0;return dv(t,(t=>i+=Hf(e,t)&&!isNaN(t)?t*t:0)),i}function Wb(...t){let e=0;const i=t.shift();if(0===t.length)dv(i,(t=>e+=isNaN(t)?0:t));else{const o=hv(t[0]);dv(i,((t,i,r)=>e+=o[i]&&o[i][r]&&!isNaN(t)&&!isNaN(o[i][r])?t*o[i][r]:0))}return e}function Vb(t,e){return t=null==t?"":t.toString(),e?e=>e==t:(t=t.toLowerCase(),e=>(e??"").toString().toLowerCase()==t)}function Ub(t,e,i=1){const o=new iv(Math.max((e||0)-1,0),Math.max((t||0)-1,0));return 1!=i&&2!=i||(o.r1Anchor=!0),1!=i&&3!=i||(o.c1Anchor=!0),o.A1}function Gb(t,e,i,o=!1){let r,n;const s=Vb(t,o);for(r=0;r<e.length;r++)for(n=0;n<e[r].length;n++)if(s(e[r][n]))return e[r][i-1];return null}function qb(t,e,i,o=!1){let r,n;const s=Vb(t,o);for(r=0;r<e.length;r++)for(n=0;n<e[r].length;n++)if(s(e[r][n]))return e[i-1][n];return null}function Yb(t,e,i){let o,r;t:for(o=0;o<e.length;o++)for(r=0;r<e[o].length;r++)if(e[o][r]==t)break t;return i?i[o]?i[o][r]:null:e[o][e[o].length-1]}function Zb(t,...e){let i=null,o=0;return dv(e,(e=>{if(t==++o)return i=e,!1})),i}function Xb(t){return(t?iv.fromA1(t).c1:this.cell.c)+1}function Qb(t){return(t?iv.fromA1(t).r1:this.cell.r)+1}function Kb(t){return Array.isArray(t)?t[0]?.length:1}function Jb(t){return Array.isArray(t)?t.length:1}function ty(){const t=lv(this)[0];return t&&t.hasFormula?" "+mv(t.formula):""}function ey(t,e,i){return e=e||1,i=i||1,Array.isArray(t)?t[e-1]?t[e-1][i-1]:null:1==e&&1==i?t:null}function iy(t){const e=this.cell,i=e.model,o=i.getCellByA1(t);let r;return i.calculations.dependencies.cellDependencies.has(e.address)?r=i.calculations.dependencies.cellDependencies.get(e.address):(r=new Map,i.calculations.dependencies.cellDependencies.set(e.address,r)),r.set(o.address,[o.range]),i.calculations.dependencies.cellDependants.has(o.address)?r=i.calculations.dependencies.cellDependants.get(o.address):(r=new Map,i.calculations.dependencies.cellDependants.set(o.address,r)),r.set(e.address,[e.range]),o.value}function oy(t,e,i=0){let o,r;for(o=0;o<e.length;o++)for(r=0;r<e[o].length;r++){if(0==i&&e[o][r]==t)return Math.max(o+1,r+1);if(1==i&&e[o][r]>t)return Math.max(o+1,r+1);if(-1==i&&e[o][r]<t)return Math.max(o+1,r+1)}return null}function ry(t,e,i,o,r){const n=lv(this)[0],s=[];o=o||1,r=r||1;for(let t=0;t<o;t++){const o=[];for(let s=0;s<r;s++){const r=n.model.rows[n.r+t+e].cell(n.c+s+i);o.push(r?n.value:null)}s.push(o)}return s}function ny(t,e){const i=[];if(t.length==e.length)for(let o=0;o<t.length;o++){let r=!0;for(let t=0;t<e[o].length;t++)if(!e[o][t]){r=!1;break}r&&i.push(t[o])}return i}const sy=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,2.1531153547440383e-8],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],ay=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]];function ly(t){const e=t*t;let i,o=sy[0][4]*e,r=e;for(i=0;i<3;i+=1)o=(o+sy[0][i])*e,r=(r+ay[0][i])*e;return t*(o+sy[0][3])/(r+ay[0][3])}function cy(...t){let e=!0;return dv(t,(t=>{if(!t)return e=!1})),e}function hy(...t){let e=!1;return dv(t,(t=>{if(t)return e=!0})),e}function dy(...t){let e=null;return dv(t,(t=>{e=null===e?!!t:!!t!=e})),e}function uy(...t){const e=t[0];for(let i=1;i<t.length;i+=2){if(i==t.length-1)return t[i];if(e==t[i])return t[i+1]}return null}function py(t,e,i){return t?e:i}function gy(t){return!t}function my(){return!1}function fy(){return!0}function vy(t,e){return e=""===e?null:e,this.cell.hasError?(this.cell.error.handled=!0,e):t===1/0||t===-1/0||Number.isNaN(t)?e:t}var by=i(235),yy=i.n(by),wy=i(5949),xy=i.n(wy);function ky(...t){let e=0,i=0;return dv(t,(t=>{null==t||isNaN(t)||(e+=t||0,++i)})),e/i}function Cy(t,e){const i=xy()(),o=hv(t),r=hv(e);for(let t=0;t<o.length;t++)for(let e=0;e<o[t].length;e++)i(o[t][e],(r[t]?r[t][e]:1)??1);return i()}function My(...t){const e=function(t){const e=[];return dv(t,(t=>e.push(t))),e}(t),i=yy()(e.length,e,1);return e.reduce(((t,e)=>t+Math.abs(e-i)),0)/e.length}function _y(...t){let e=1/0;return dv(t,(t=>e=Math.min(e,t))),e}function Sy(...t){let e=-1/0;return dv(t,(t=>e=Math.max(e,t))),e}function Ey(t,e){Object.keys(e).forEach((i=>t.set(st(i,"_").replace(/_/g,".").toUpperCase(),e[i])))}const zy=new Map;Ey(zy,_),Ey(zy,S),Ey(zy,E),Ey(zy,z),Ey(zy,I),Ey(zy,L),Ey(zy,R);class Ly{constructor(t){this.model=t,this.getModel=t=>{const e=t?this.model.getConnectedModel(t):this.model;if(e)return e;throw new Error(`Sheet "${t}" not found`)},this.cl=(t,e)=>{const i=this.getModel(e);if(null==t)return this.currentCell.value;const o=i.getCellByA1(t);return o?o.value:(this.currentCell.error={message:`undefined cell ${t}`},null)},this.rn=(t,e)=>this.getModel(e).getValuesInRange(iv.fromA1(t)),this.nv=(t,e)=>this.getModel(e).getCellByName(t,this.currentCell.range).value,this.nr=(t,e)=>{const i=this.getModel(e).getValueMatrixByName(t);return 1===i.length&&1===i[0].length?i[0][0]:i},this.fn=t=>{const e=zy.get(t);if(e)return e;throw new Error(`Function "${t}" not found`)},this.op=(t,e,i)=>Gf(t,e,i)}}function Iy(t,e){const i=Array(e).fill(null);let o=0,r=[];if(t.length>1){r=t.map((t=>parseFloat(t.value)||0)),o=r[1]-r[0];for(let t=2;t<r.length;t++)if(r[t]-r[t-1]!==o){o=0;break}}if(0==o)for(let o=0;o<e;o++)i[o]=t[o%t.length]?.value;else{let t=r[r.length-1];for(let r=0;r<e;r++)t=i[r]=t+o}return i}function Ry(t,e,i){const o=new wv(t.formula,t.model.calculations.tokenizer),r=[];for(let t=0;t<i;t++)r.push(mv(o.shift({index:0,offset:1,direction:e,allSheets:!0}).createFormulaString()));return r}function Ty(t,e,i,o){const r=t.getCellMatrix(e);let n;"right"==o?n=Gr(r):"down"==o?n=Ur(r):"left"==o?n=Wr(r):"up"==o&&(n=Wr(Ur(r)));const s=new Array(i.size.rows);for(let t=0;t<i.size.rows;t++){s[t]=new Array(i.size.columns);for(let e=0;e<i.size.columns;e++){const i=r.length>t?r[t][r[t].length>e?e:0]:r[0][e];s[t][e]=i.hasDisplayValue?i.displayValue:null}}const a=i.size["down"==o||"up"==o?"rows":"columns"];let l=n.map((t=>t[t.length-1].hasFormula?Ry(t[t.length-1],o,a):Iy(t,a)));return"down"==o?l=Ur(l):"left"==o?l=Wr(l):"up"==o&&(l=Vr(Ur(l))),t.spillValues({cell:t.getCellByRange(i.bounds[0][0]),values:l,propertyCell:t.getCellByRange(e.bounds[0][0]),displayValues:s})}function Ay(t){return t.pattern&&"string"==typeof t.pattern&&(t.pattern=new RegExp(t.pattern)),t}function Oy(t,e){const i=t.validation;if(!i)return!0;if(i.allowInvalid)return!0;let o=!0;return i.pattern&&(i.pattern.test((e??"").toString())||(o=!1)),i.validate&&(i.validate(t,e)||(o=!1)),o}class $y{get address(){return null}get renderer(){return this._renderer}set renderer(t){this._renderer=t}get afterRenderer(){return this._afterRenderer}set afterRenderer(t){this._afterRenderer=t}get commentRenderer(){return this._commentRenderer}set commentRenderer(t){this._commentRenderer=t}get type(){return this._type}set type(t){this._type=t}get name(){return this._name}set name(t){this._name=t}get style(){return this._style}set style(t){this._style=t}get commentable(){return this._commentable}set commentable(t){this._commentable=t}get clickable(){return this._clickable}set clickable(t){this._clickable=t}get editable(){return this._editable}set editable(t){this._editable=t}get validation(){return this._validation}set validation(t){this._validation=t}get hasFormula(){return!!this._formula}get formula(){return this._formula}set formula(t){this._formula=t?t.replace(/^=/,""):null}get value2(){return this.hasFormula?mv(this.formula):null}get editorContent(){return this._editorContent}set editorContent(t){this._editorContent=t}get adapter(){return this._adapter}set adapter(t){this._adapter=t}get properties(){return this._properties}set properties(t){this._properties=t}getProperty(t){return this._properties?.[t]}setProperty(t,e){this._properties||(this._properties={}),this._properties[t]=e}get format(){return this._format}set format(t){this._format=t,this._valueFormatter=null}get valueFormatter(){return this._valueFormatter}constructor(t,e){this.model=t,this._type=null,this._clickable=!1,e&&this.populate(e)}populate(t){this._renderer=t.renderer,this._afterRenderer=t.afterRenderer,this._commentRenderer=t.commentRenderer,this._name=t.name,this._type=t.t,this._editorContent=t.content,this._adapter=t.adapter,this._format=t.z,this._formula=t.f,this._editable=t.e,this._commentable=t.commentable,this._clickable=t.clickable,this._validation=t.validation?Ay(t.validation):null,this._properties=t.props,this._style=null==t.s?null:this.model.styles.add(t.s)?.id}update(t){const e={};if("renderer"in t&&(e.renderer=this._renderer,this._renderer=t.renderer),"afterRenderer"in t&&(this._afterRenderer=t.afterRenderer),"commentRenderer"in t&&(this._commentRenderer=t.commentRenderer),"name"in t&&(e.name=this._name,this._name=t.name),"t"in t&&(e.t=this._type,this._type=t.t),"content"in t&&(e.content=this._editorContent,this._editorContent=t.content),"adapter"in t&&(e.adapter=this._adapter,this._adapter=t.adapter),"z"in t&&(e.z=this._format,this._format=t.z),"f"in t&&(e.f=this._formula,this._formula=t.f),"e"in t&&(e.e=this._editable,this._editable=t.e),"commentable"in t&&(e.commentable=this._commentable,this._commentable=t.commentable),"clickable"in t&&(e.clickable=this._clickable,this._clickable=t.clickable),"validation"in t&&(e.validation=this._validation,this._validation=Ay(t.validation)),"props"in t&&(e.props=this._properties,this._properties=t.props),"s"in t){const i=this.model.styles.add(t.s).id;this._style!==i&&(e.s=this._style,this._style=i)}return e}getSourceData(){const t={};return null!=this._type&&(t.t=this._type),null!=this._format&&(t.z=this._format),null!=this._formula&&(t.f=this._formula),null!=this._editable&&(t.e=this._editable),null!=this._commentable&&(t.commentable=this._commentable),null!=this._clickable&&(t.clickable=this._clickable),this._properties&&(t.props=rt(this._properties)),null!=this._editorContent&&(t.content=Z(this._editorContent)?rt(this._editorContent):this._editorContent),null!=this._style&&(t.s=this._style),null!=this._name&&(t.name=this._name),t}setStyleProperties(t,e=!1){this.style=e?this.model.styles.set(this.style,t).id:this.model.styles.duplicate(this.style,t).id}removeStyleProperties(t){null!==this.style&&this.model.styles.unset(this.style,t)}get composedStyle(){return this.model.styles.get(this.style)}}function Dy(t){const e={};return t.split(";").forEach((t=>{const[i,o]=t.split(":");e[i]=o.trim()})),e}const Ny=new Map([["thin",{width:1.5,style:"solid"}],["medium",{width:2,style:"solid"}],["thick",{width:3,style:"solid"}],["double",{width:3,style:"double"}],["dotted",{width:1.5,style:"dotted"}],["hair",{width:1,style:"solid"}],["dashed",{width:1.5,style:"dashed"}],["mediumDashed",{width:2,style:"dashed"}],["dashDot",{width:1.5,style:"dashed"}],["mediumDashDot",{width:2,style:"dashed"}],["dashDotDot",{width:1.5,style:"dotted"}],["mediumDashDotDot",{width:2,style:"dotted"}],["slantDashDot",{width:1.5,style:"dashed"}],["none",{width:1.5,style:"solid"}]]),Py=(()=>{const t=new Map;return Ny.forEach(((e,i)=>{let o=t.get(e.style);o||(o=t.set(e.style,new Map).get(e.style)),o.set(e.width,i)})),t})();function jy(t){return"middle"==t?"center":t}function Hy(t){return 3==(t="#"==t.charAt(0)?t.substring(1):t).length?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t}const By=t=>{if("none"==t)return null;const e=t.split(" "),i=parseInt(e[0].charAt(0))||1,o=e.length>1?e[1]:"solid",r=Py.get(o);return{style:(r?r.get(i):null)??"thin",color:e.length>2?Hy(e[2]):"CCCCCC"}},Fy=t=>{const e=Ny.get(t.style||"none");return e?[Dt(e.width),e.style,"none"==t.style?"var(--og-cell-background)":t.color?`#${t.color}`:"var(--og-border-color)"].join(" "):"none"},Wy=(t,e)=>{const i="#"+(e.fgColor||"000000"),o="#"+(e.bgColor||"FFFFFF");switch(e.patternType){case"solid":t.backgroundColor=i||o;break;case"darkGray":t.backgroundColor=Or(o,.75);break;case"mediumGray":t.backgroundColor=Or(o,.5);break;case"lightGray":t.backgroundColor=Or(o,.25);break;case"gray125":t.backgroundColor=Or(o,.125);break;case"gray0625":t.backgroundColor=Or(o,.0625);break;case"darkHorizontal":t.backgroundImage=`linear-gradient(0deg, ${i} 33.33%, ${o} 33.33%, ${o} 50%, ${i} 50%, ${i} 83.33%, ${o} 83.33%, ${o} 100%)`,t.backgroundSize="6px 6px";break;case"darkVertical":t.backgroundImage=`linear-gradient(90deg, ${i} 33.33%, ${o} 33.33%, ${o} 50%, ${i} 50%, ${i} 83.33%, ${o} 83.33%, ${o} 100%)`,t.backgroundSize="6px 6px";break;case"darkDown":t.backgroundImage=`linear-gradient(45deg, ${i} 33.33%, ${o} 33.33%, ${o} 50%, ${i} 50%, ${i} 83.33%, ${o} 83.33%, ${o} 100%)`,t.backgroundSize="6px 6px";break;case"darkUp":t.backgroundImage=`linear-gradient(-45deg, ${i} 33.33%, ${o} 33.33%, ${o} 50%, ${i} 50%, ${i} 83.33%, ${o} 83.33%, ${o} 100%)`,t.backgroundSize="6px 6px";break;case"lightHorizontal":t.backgroundImage=`linear-gradient(0deg, ${o} 25%, ${i} 25%, ${i} 50%, ${o} 50%, ${o} 75%, ${i} 75%, ${i} 100%)`,t.backgroundSize="4px 4px";break;case"lightVertical":t.backgroundImage=`linear-gradient(90deg, ${o} 25%, ${i} 25%, ${i} 50%, ${o} 50%, ${o} 75%, ${i} 75%, ${i} 100%)`,t.backgroundSize="4px 4px";break;case"lightDown":t.backgroundImage=`linear-gradient(45deg, ${o} 25%, ${i} 25%, ${i} 50%, ${o} 50%, ${o} 75%, ${i} 75%, ${i} 100%)`,t.backgroundSize="4px 4px";break;case"lightUp":t.backgroundImage=`linear-gradient(-45deg, ${o} 25%, ${i} 25%, ${i} 50%, ${o} 50%, ${o} 75%, ${i} 75%, ${i} 100%)`,t.backgroundSize="4px 4px";break;case"darkGrid":t.backgroundImage=`linear-gradient(${o} 0.5px, transparent 0.5px), linear-gradient(90deg, ${o} 0.5px, transparent 0.5px)`,t.backgroundSize="2px 2px";break;case"lightGrid":t.backgroundImage=`linear-gradient(${o} 0.5px, transparent 0.5px), linear-gradient(90deg, ${o} 0.5px, transparent 0.5px)`,t.backgroundSize="1px 1px";break;case"darkTrellis":t.backgroundImage=`linear-gradient(45deg, ${o} 0.5px, transparent 0.5px), linear-gradient(90deg, ${o} 0.5px, transparent 0.5px)`,t.backgroundSize="2px 2px";break;case"lightTrellis":t.backgroundImage=`linear-gradient(45deg, ${o} 0.5px, transparent 0.5px), linear-gradient(90deg, ${o} 0.5px, transparent 0.5px)`,t.backgroundSize="1px 1px"}return t},Vy=(t,e)=>(t.backgroundImage=`linear-gradient(${(e.angle??0)+90}deg,${e.stops.map((t=>`#${t.rgb} ${100*t.v}%`)).join(",")})`,t),Uy=t=>{const e=t.cssStyle?{...t.cssStyle}:{};return null!=t.bold&&(e.fontWeight=t.bold?"bold":"normal"),t.italic&&(e.fontStyle="italic"),t.underline?e.textDecoration="underline":t.strike&&(e.textDecoration="line-through"),t.sz&&(e.fontSize=$t(t.sz)),t.color&&(e.color="#"+t.color),t.top&&(e.borderTop=Fy(t.top)),t.right&&(e.borderRight=Fy(t.right)),t.bottom&&(e.borderBottom=Fy(t.bottom)),t.left&&(e.borderLeft=Fy(t.left)),(t.top||t.right||t.bottom||t.left)&&(e.zIndex="1"),t.alignment&&t.alignment.vertical&&(e.display="flex",e.justifyContent=t.alignment.horizontal,e.alignItems="top"==t.alignment.vertical?"start":"bottom"==t.alignment.vertical?"end":"center"),t.alignment&&t.alignment.horizontal&&(e.textAlign=t.alignment.horizontal),t.alignment&&t.alignment.wrapText&&(e.display="flex",e.justifyContent=e.justifyContent??e.textAlign??"left",e.alignItems=e.alignItems??"center",e.whiteSpace="pre-wrap"),t.patternType?Wy(e,t):t.stops&&t.stops.length?Vy(e,t):t.fgColor?e.backgroundColor="#"+t.fgColor:t.bgColor&&(e.backgroundColor="#"+t.bgColor),e},Gy=t=>{const e=Z(t)?t:Dy(t),i={};let o;for(const t in e){const r=e[t];if(null!=r)switch(t){case"borderTop":case"border-top":i.top=By(r);break;case"borderTopColor":case"border-top-color":i.top?i.top.color=Hy(r):i.top={style:"thin",color:Hy(r)};break;case"borderRight":case"border-right":i.right=By(r);break;case"borderRightColor":case"border-right-color":i.right?i.right.color=Hy(r):i.right={style:"thin",color:Hy(r)};break;case"borderBottom":case"border-bottom":i.bottom=By(r);break;case"borderBottomColor":case"border-bottom-color":i.bottom?i.bottom.color=Hy(r):i.bottom={style:"thin",color:Hy(r)};break;case"borderLeft":case"border-left":i.left=By(r);break;case"borderLeftColor":case"border-left-color":i.left?i.left.color=Hy(r):i.left={style:"thin",color:Hy(r)};break;case"border":o=By(r),i.top=i.top||o,i.right=i.right||o,i.bottom=i.bottom||o,i.left=i.left||o;break;case"textAlign":case"text-align":i.alignment=i.alignment||{},i.alignment.horizontal=r;break;case"verticalAlign":case"vertical-align":i.alignment=i.alignment||{},i.alignment.vertical=jy(r);break;case"whiteSpace":case"white-space":i.alignment=i.alignment||{},i.alignment.wrapText=r&&"nowrap"!=r;break;case"color":i.color=Hy(r);break;case"background":case"backgroundColor":i.fgColor=Hy(r);break;case"fontSize":case"font-size":i.sz=parseFloat(r);break;case"fontWeight":case"font-weight":i.bold="bold"==r;break;case"fontStyle":case"font-style":i.italic="italic"==r;break;default:i[t]=r}}return i},qy={n:t=>{const e=Q(t)?parseFloat(t):t;return Number.isNaN(e)?t:e},t:t=>t,d:(t,e)=>{if(null==t||""===t)return null;if(Q(t))try{return K(t)?J(t):or(Yo(t,e.model.options.formatLocale))}catch(i){return e.model.logger.error(`Invalid date value in cell ${e.address}: ${t}`),null}return t instanceof Date?or(t):t},tm:t=>Q(t)?new Date(t):t,dt:t=>Q(t)?new Date(t):t,b:t=>!!t&&"0"!==t&&"false"!==t.toString().toLowerCase(),s:t=>t,m:t=>t,g:t=>{if(null==t||""===t)return null;const e=parseFloat(t);return isNaN(e)?t:e},a:t=>Q(t)&&""!==t?JSON.parse(t):t,h:t=>t},Yy=new Map;class Zy extends $y{get tooltip(){return this._tooltip}set tooltip(t){this._tooltip=t}get hasTooltip(){return null!=this._tooltip}get rowspan(){return this._rowspan}set rowspan(t){this._rowspan=t}get colspan(){return this._colspan}set colspan(t){this._colspan=t}get row(){return this._row}set row(t){this._row=t}get r(){return this._row.index}get column(){return this._column}set column(t){this._column=t}get c(){return this._column.index}get hasValue(){return null!=this._value}get value(){return this._evaluated||this.evaluate(),this._value}set value(t){if(t&&gv(t.toString()))this._value=void 0,this.formula=t;else{let e=qy[this.type](t,this);Oy(this,e)||(e=void 0),e!==this._value&&(this._value=e,this._displayValue=void 0),this.row.data&&this.column.data&&(this.row.data[this.column.data]=this._value)}}evaluate(){return this._value=qy[this.type](this.model.calculations.evaluate(this),this),this._evaluated=!0,this._value}get value2(){return this.hasFormula?mv(this.formula):this.value}get hasDisplayValue(){return null!=this._displayValue}get displayValue(){return this._displayValue}set displayValue(t){this._displayValue=t}get prefersDisplayValue(){return["s","m"].includes(this.type)}get error(){return this._error}set error(t){this._error=t}get hasError(){return!!this._error}clearError(){this._error=void 0}get spillRange(){return this._spillRange}get prevSpillRange(){return this._prevSpillRange}set spillRange(t){!this._spillRange||t&&this._spillRange.equals(t)||(this._prevSpillRange=this._spillRange),this._spillRange=t}get isSpillSource(){return null!=this._spillRange}get spillSource(){return this._spillSource}get isSpilled(){return null!=this._spillSource}spillValue(t,e){this.value=t,this._spillSource=e}clearSpilledValue(){this._spillSource=void 0,this._value=void 0}get hasSparkline(){return null===this._sparkline?this._sparkline=this.model.sparklines.has(this.address):this._sparkline}get hasComment(){return null===this._hasComment?this._hasComment=(this.model.comments.get(this.address)??[]).length>0:this._hasComment}get comments(){return this.model.comments.get(this.address)}get valueFormatter(){const t=super.valueFormatter??this.row.valueFormatter??this.column.valueFormatter;if(t)return t;const e=this.type,i=this.format,{formatLocale:o,fixNumberFormat:r}=this.model.options,n=this.value;if(null==n||""===n)return null;if("n"==e)return null!=i?ur(o,i,r):this.model.options.numberFormatter;if("g"==e){if(null!=i)return ur(o,i,r);if(tt(n))return this.model.options.numberFormatter}else{if("t"==e)return null==i?null:ur(o,i,!1);if("d"==e)return i?Zo(o,i):this.model.options.dateFormatter;if("s"==e&&this.editorContent)return(t=>{if(t=t||null,!Yy.has(t))if(t){const e=t.reduce(((t,e)=>t.set(e.k,e.v)),new Map);Yy.set(t,(t=>e.has(t)?e.get(t):t))}else Yy.set(t,(t=>t));return Yy.get(t)})(this.editorContent)}return null}get formattedValue(){return null==this.value?"":this.hasDisplayValue?this.displayValue:this.valueFormatter?this.valueFormatter(this.value):this.value.toString()}get elm1(){return this.row.priority>=this.column.priority?this.row:this.column}get elm2(){return this.row.priority<this.column.priority?this.row:this.column}get clickable(){return super.clickable??this.elm1.clickable??this.elm2.clickable}get type(){return super.type??this.elm1.type??this.elm2.type??"g"}set type(t){this._type=t}get editorContent(){return super.editorContent??this.elm1.editorContent??this.elm2.editorContent??null}get adapter(){return super.adapter??this.elm1.adapter??this.elm2.adapter}set adapter(t){this._adapter=t}get address(){return this.column.address+this.row.address}get range(){return iv.fromA1(this.address)}get validation(){return super.validation??this.elm1.validation??this.elm2.validation??this.model.options.cellValidation}get editable(){return super.editable??this.elm1.editable??this.elm2.editable??this.model.options.editable}set editable(t){this._editable=t}get commentable(){return super.commentable??this.elm1.commentable??this.elm2.commentable??this.model.options.commentable}get renderer(){return super.renderer??this.elm1.renderer??this.elm2.renderer}get afterRenderer(){return super.afterRenderer??this.elm1.afterRenderer??this.elm2.afterRenderer??this.model.options.afterRenderer}get commentRenderer(){return super.commentRenderer??this.elm1.commentRenderer??this.elm2.commentRenderer??this.model.options.comments.renderer}get format(){return super.format??this.elm1.format??this.elm2.format}set format(t){super.format=t}get hyperlink(){return this._hyperlink}set hyperlink(t){this._hyperlink=t}get hasOwnFormula(){return!!this._formula}get hasFormula(){return null==this._hasFormula&&(this._hasFormula=!!this.formula),this._hasFormula}get formula(){return this._formula??this.elm1.formula??this.elm2.formula}set formula(t){super.formula=t,this.refreshFormula()}invalidateValue(){this.hasFormula?(this._value=void 0,this._evaluated=!1):this._evaluated=!0,this.clearError()}refreshFormula(){this.invalidateValue(),this._hasFormula=null}clearFormula(){this._formula=null,this._hasFormula=!1,this._evaluated=!0}constructor(t,e){super(t),this._evaluated=!0,this._sparkline=null,this._hasComment=null,this._hasStyle=null,this.row=t.rows[e.r],this.column=t.columns[e.c],this.populate(e)}populate(t){super.populate(t),this._colspan=t.cs??1,this._rowspan=t.rs??1,this._tooltip=t.tooltip,this._hyperlink=t.hl,null!=t.f&&""!==t.f?this._evaluated=!1:null!=t.v&&(this.value=t.v),this._displayValue=t.dv}update(t){const e=super.update(t);return"cs"in t&&(e.cs=this._colspan,this._colspan=t.cs),"rs"in t&&(e.rs=this._rowspan,this._rowspan=t.rs),"tooltip"in t&&(e.tooltip=this._tooltip,this._tooltip=t.tooltip),"hl"in t&&(e.hl=this._hyperlink,this._hyperlink=t.hl),"f"in t?this._evaluated=!1:"v"in t&&(e.v=this.value,this.value=t.v),"dv"in t&&(e.dv=this._displayValue,this._displayValue=t.dv),e}getSourceData(t){const e=super.getSourceData();return this._colspan>1&&(e.cs=this._colspan),this._rowspan>1&&(e.rs=this._rowspan),null!=this.value&&(e.v=this.value),this.hasTooltip&&(e.tooltip=this._tooltip),this._hyperlink&&(e.hl=this._hyperlink),t&&t.displayValue&&this.hasDisplayValue&&(e.dv=this._displayValue),e}createComposedStyle(t,e,i){const o=[];return t=t||this.column.style,e=e||this.row.style,null!=t&&null!=e?this.column.priority>this.row.priority?o.push(e,t):o.push(t,e):null!=t?o.push(t):null!=e&&o.push(e),null!=this.style&&o.push(this.style),null!=i&&o.push(i),o.length>0?this.model.styles.merge(...o):null}get composedStyle(){if(null===this._hasStyle){const t=this.createComposedStyle(null,null,this.model.conditionalFormats.evaluate(this));this._hasStyle=null!=t,this._composedStyle=t}return this._composedStyle}get calculatedIndent(){const t=this.composedStyle;return t?.alignment?.indent?t.alignment.indent:this.column.levelIndent&&this.row.level>0?this.row.level*this.model.options.levelIndentFactor:null}get cssStyle(){if(!1===this._hasStyle)return null;if(!this._cssStyle){const t=this.composedStyle;t&&(this._cssStyle=Uy(t))}return this._cssStyle}invalidateStyle(){this._hasComment=null,this._hasStyle=null,this._composedStyle=null,this._cssStyle=null,this._sparkline=null}setStyleProperties(t){super.setStyleProperties(t),this.invalidateStyle()}removeStyleProperties(t){super.removeStyleProperties(t),this.invalidateStyle()}previewStyleProperties(t,e="cell"){const i=Object.assign({},this.createComposedStyle("column"==e?t:null,"row"==e?t:null)??{});if("cell"==e)for(const e in t)i[e]=t[e];this._hasStyle=!0,this._cssStyle=Uy(i)}validate(){return!this.validation||Oy(this,this.value)}toString(){return this.address}}const Xy={property:"value",enabled:!0};class Qy extends(Lr($y)){get comparer(){return this._comparer}set comparer(t){this._comparer=t}get filter(){return this._filter??(this.model.options.filters?.enabled?Xy:{enabled:!1})}set filter(t){this._filter=t}get hasFilter(){return this.filter.enabled}get sorting(){return this._sorting??this.model.options.columnSorting}set sorting(t){this._sorting=t}get width(){return this._width??this.model.options.columnWidth}set width(t){this._width=t}get levelIndent(){return this._levelIndent}set levelIndent(t){this._levelIndent=t}get levelButtons(){return this._levelButtons}set levelButtons(t){this._levelButtons=t}get priority(){return this._priority}set priority(t){this._priority=t}get address(){return nv(this.index)}get range(){return new iv(this.index,null,this.index,null)}get hasFormula(){return!!this._formula}get formula(){return this._formula}set formula(t){super.formula=t;const e=this.index;this.model.rows.forEach((t=>t.cells[e]?.refreshFormula()))}constructor(t,e){super(t,e),null==this._priority&&(this._priority=t.options.columnPriority)}get mergedHeaders(){return this._mergedHeaders??(this._mergedHeaders=this._header?.filter((t=>t.cs>1||t.rs>1))??[])}updateMergedHeaders(){this._mergedHeaders=null}set header(t){this._mergedHeaders=null,this._header=t}get header(){if(!this._header||this._header.length<this.model.headerCount){this._header=this._header??[];for(let t=this._header.length;t<this.model.headerCount;t++)this._header.push({r:t})}return this._header}convertSourceHeader(t){return Array.isArray(t)?t.map(((t,e)=>(null==(t=t??{r:e}).height&&(t.height=t.h),t.r=e,null==t.style&&(t.style=t.s),t._style=null==t.style?null:this.model.styles.add(t.style).id,t))):Q(t)?[{label:t,r:0}]:null}populate(t){super.populate(t),this._width=null==t.w||"auto"==t.w?null:t.w,this._levelIndent=t.levelIndent,this._levelButtons=t.levelButtons,this._header=this.convertSourceHeader(t.header),this._sorting=t.sorting,this._filter=Z(t.filter)?Object.assign({enabled:!0},t.filter):t.filter?Xy:!1===t.filter?{enabled:!1}:null,this._comparer=t.comparer,this.data=t.data,this._mergedHeaders=null,null!=t.priority&&(this._priority=t.priority)}getSourceData(){const t=super.getSourceData();return null!=this._width&&(t.w=this._width),null!=this._levelIndent&&(t.levelIndent=this._levelIndent),null!=this._levelButtons&&(t.levelButtons=this._levelButtons),null!=this._header&&(t.header=this._header),null!=this._sorting&&(t.sorting=this._sorting),null!=this._filter&&(t.filter=this._filter),null!=this.data&&(t.data=this.data),t}expand(t){super.expand(t),this.model.indexVisibleColumns()}collapse(){super.collapse(),this.model.indexVisibleColumns()}get prev(){return this.model.columns[this.index-1]}get next(){return this.model.columns[this.index+1]}get prevVisible(){const t=this.model.visibleColumnIndex[this.index];return null==t||0===t?null:this.model.visibleColumns[t-1]}get nextVisible(){const t=this.model.visibleColumnIndex[this.index];return null==t?null:this.model.visibleColumns[t+1]}calculateRealColspan(t){let e=1,i=this.nextVisible;for(;i&&i.index-this.index<t&&e<t;)++e,i=i.nextVisible;return e}cell(t){return this.model.rows[t].cell(this.index)}clearCalculatedValues(){this.model.rows.forEach((t=>{const e=t.cells[this.index];e&&this.model.calculations.refreshFormula(e)}))}}var Ky;!function(t){t[t.Asc=1]="Asc",t[t.Desc=-1]="Desc"}(Ky||(Ky={}));const Jy={g:(t,e)=>t.value==e.value?0:t.value>e.value?1:-1,t:(t,e)=>(t.value||"").toString().localeCompare((e.value||"").toString()),s:(t,e)=>t.value==e.value?0:t.value>e.value?1:-1,m:(t,e)=>t.value==e.value?0:t.value>e.value?1:-1,n:(t,e)=>t.value-e.value,d:(t,e)=>(t.value instanceof Date?t.value.getTime():0)-(e.value instanceof Date?e.value.getTime():0),tm:(t,e)=>(t.value instanceof Date?t.value.getTime():0)-(e.value instanceof Date?e.value.getTime():0),dt:(t,e)=>(t.value instanceof Date?t.value.getTime():0)-(e.value instanceof Date?e.value.getTime():0),b:(t,e)=>t.value-e.value,h:(t,e)=>(t.value||"").localeCompare(e.value),a:()=>0},tw={g:(t,e)=>e.value==t.value?0:e.value>t.value?1:-1,t:(t,e)=>(e.value||"").toString().localeCompare((t.value||"").toString()),s:(t,e)=>e.value==t.value?0:e.value>t.value?1:-1,m:(t,e)=>e.value==t.value?0:e.value>t.value?1:-1,n:(t,e)=>e.value-t.value,d:(t,e)=>(e.value instanceof Date?e.value.getTime():0)-(t.value instanceof Date?t.value.getTime():0),tm:(t,e)=>(e.value instanceof Date?e.value.getTime():0)-(t.value instanceof Date?t.value.getTime():0),dt:(t,e)=>(e.value instanceof Date?e.value.getTime():0)-(t.value instanceof Date?t.value.getTime():0),b:(t,e)=>e.value-t.value,h:(t,e)=>(e.value||"").localeCompare(t.value),a:()=>0},ew=(t,e)=>t.origIndex-e.origIndex;class iw{get settings(){return this._settings}set settings(t){this._settings=t,this.colMap.clear(),this.settings.length>0&&(this.settings.forEach(((t,e)=>this.colMap.set(t.c,e))),this.applySort(),Sr().info(`sorting applied: ${JSON.stringify(this.settings)}`))}constructor(t,e=[]){this.model=t,this.colMap=new Map,this._settings=[],this.settings=e}get(t){return this.colMap.has(t)?this.settings[this.colMap.get(t)]:null}sort(t,e=null,i=!1){let o=this.get(t);return o&&o.ord==Ky.Desc&&null===e?(this.settings.splice(this.colMap.get(t),1),o=null):o?(o.ord=Ky.Desc,this.settings.splice(this.colMap.get(t),1)):o={c:t,ord:Ky.Asc},o&&(null!==e&&(o.ord=e),this.colMap.set(t,0),this.settings.unshift(o)),this.settings.length>this.model.options.maxSortingColumns&&this.settings.pop(),this.colMap.clear(),this.settings.forEach(((t,e)=>{t.index=e,this.colMap.set(t.c,e)})),i||(this.settings.length>0?this.applySort():this.resetSort()),o}applySort(){const t=this.model,e=this.settings.map((e=>{const i=t.columns[e.c];return i?i.comparer?e.ord==Ky.Asc?i.comparer:(t,e)=>-i.comparer(t,e):e.ord==Ky.Asc?Jy[i.type??"t"]:tw[i.type??"t"]:(Sr().warn(`Column sorting: Column with index ${e.c} not found`),null)})).filter((t=>t)),i=e.length;let o,r,n;t.rowRoot.sort(((t,s)=>{if(!1===t.sortable||!1===s.sortable)return t.origIndex-s.origIndex;for(r=0;r<i;r++)if(n=this.settings[r].c,o=e[r](t.cell(n),s.cell(n)),0!=o)return o;return 0})),t.indexRowsByTree()}resetSort(){this.settings=[],this.colMap.clear(),this.model.rowRoot.sort(ew),this.model.indexRowsByTree()}persistSort(){this.model.rows.forEach(((t,e)=>t.origIndex=e))}}class ow{get properties(){return this._properties}set properties(t){this._properties=t}constructor(t){t&&this.pupulate(t)}pupulate(t){this.author=t.author,this.text=t.text,this.date=t.date?new Date(t.date):null,this.data=t.data,this.readOnly=!!t.readOnly,this._properties=t.props}getSourceData(){const t={};return this._properties&&(t.props=this._properties),this.author&&(t.author=this.author),this.text&&(t.text=this.text),this.data&&(t.data=this.data),null!==this.readOnly&&(t.readOnly=this.readOnly),this.date&&(t.date=Zo("en-US")(this.date,"yyyy-MM-dd HH:mm:ss")),t}}class rw{constructor(t,e){this.model=t,this._commentMap=new Map,this.has=t=>this._commentMap.has(t),this.delete=t=>this._commentMap.delete(t),this.cleanCell=t=>{this.has(t)&&this._commentMap.set(t,this.get(t).filter((t=>(t.text??"").length>0||null!=t.data)))},this.get=t=>(this.has(t)||this._commentMap.set(t,[]),this._commentMap.get(t)),this.set=(t,e)=>{this._commentMap.set(t,e?.map((t=>t instanceof ow?t:new ow(t)))||[]),this.cleanCell(t)},e&&this.populate(e)}populate(t){t.forEach((t=>{const e=t.a1||new iv(t.c,t.r).A1;this._commentMap.has(e)||this._commentMap.set(e,[]),this._commentMap.get(e).push(new ow(t))})),this._commentMap.forEach((t=>{t.sort(((t,e)=>(e.date?e.date.getTime():0)-(t.date?t.date.getTime():0)))}))}shift(t){Array.from(this._commentMap.keys()).forEach((e=>{const i=iv.fromA1(e);i.shift(t),i.A1!=e&&(this._commentMap.set(i.A1,this._commentMap.get(e)),this._commentMap.delete(e))}))}}function nw(t,e,i){t.forEach((t=>t.forEach((t=>{t[1]==e&&(t[1]=i)}))))}class sw{get cellDependencies(){return this._cellDependencies}get cellDependants(){return this._cellDependants}get rangeDependencies(){return this._rangeDependencies}get rangeDependants(){return this._rangeDependants}get sheetDependencies(){return this._sheetDependencies}get sheetDependants(){return this._sheetDependants}constructor(t,e="calculations"){this.model=t,this.modelPart=e,this._cellDependencies=new Map,this._cellDependants=new Map,this._rangeDependencies=new Map,this._rangeDependants=new Map,this._sheetDependencies=new Map,this._sheetDependants=new Map}clear(){this._cellDependants.clear(),this._cellDependencies.clear(),this._rangeDependencies.clear(),this._rangeDependants.clear()}clearCellDependecies(t){return this._cellDependencies.has(t)&&this._cellDependencies.delete(t),this._rangeDependencies.has(t)&&this._rangeDependants.delete(t),this}has(t){return this._cellDependencies.has(t)||this._rangeDependencies.has(t)}add(t,e,i){const o=iv.fromA1(t).removeAnchors(),r=iv.fromA1(e).removeAnchors();e=r.A1;const n=r.isRange,s=n?this._rangeDependencies:this._cellDependencies;let a=null;if((s.has(t)?s.get(t):s.set(t,new Map).get(t)).set(e,[r,i]),i){const t=this.model.getConnectedModel(i);t&&(t.calculations.dependencies.sheetDependants.set(this.model.name,this.model.name),this.sheetDependencies.set(i,i),a=n?t.calculations.dependencies.rangeDependants:t.calculations.dependencies.cellDependants),i=this.model.name}else a=n?this._rangeDependants:this._cellDependants;a&&(a.has(e)||a.set(e,new Map),a.get(e).set(t,[o,i]))}getDependants(t,e=null){let i,o;const r=t.A1;return e=e??new Map,this._cellDependants.has(r)&&this._cellDependants.get(r).forEach((([t,n])=>{e.has(t)||(n&&(o=this.model.getConnectedModel(n)),i=o||this.model,e.set(t,[i.getCellByRange(t),n]),o?o[this.modelPart].dependencies.getDependants(t).forEach(((t,i)=>{e.set(i,[t[0],t[1]??n])})):(t.A1!=r||o)&&i.calculations.dependencies.getDependants(t,e))})),this._rangeDependants.forEach(((i,o)=>{iv.fromA1(o).contains(t)&&i.forEach((([t,i])=>{e.has(t)||(e.delete(t),this.getDependants(t,e.set(t,[(i?this.model.getConnectedModel(i):this.model).getCellByRange(t),i])))}))})),e}renameSheet(t,e){this._sheetDependants.has(t)&&(this._sheetDependants.delete(t),this._sheetDependants.set(e,e)),this._sheetDependencies.has(t)&&(this._sheetDependencies.delete(t),this._sheetDependencies.set(e,e)),nw(this._cellDependants,t,e),nw(this._cellDependencies,t,e),nw(this._rangeDependants,t,e),nw(this._rangeDependencies,t,e)}}class aw{get dependencies(){return this._dependencies}constructor(t,e){this.model=t,this._dependencies=new sw(t,e)}}function lw(t){return t instanceof RangeError?"Maximum call stack size exceeded"==t.message?"infinite loop":t.message:t.toString()}class cw extends aw{get tokenizer(){return this._tokenizer}get formulas(){return this._formulas}constructor(t){super(t,"calculations"),this._tokenizer=new Jf,this._formulas=new Map,this.context=new Ly(t)}createFormula(t){const e=new wv(t.formula,this.tokenizer);return this._formulas.set(t.address,e),t.hasOwnFormula&&(t.formula=e.createFormulaString()),this.createDependecies(t),e}createDependecies(t){const e=t.address;if(this.formulas.has(e)){const i=this.formulas.get(e);i.ranges.forEach((([t,i,o])=>this._dependencies.add(e,i.A1,o))),i.cells.forEach((([t,i,o])=>this._dependencies.add(e,i.A1,o))),i.variables.forEach((([i,o])=>{const r=this.model.getCellByName(o,t.range);r&&this._dependencies.add(e,r.address,null)}))}return this}refreshFormula(t){return t.refreshFormula(),this.formulas.delete(t.address),this.clearDependecies(t),this}updateDependencies(t){return this.clearDependecies(t).getFormula(t),this}getFormula(t){return this._formulas.has(t.address)?this._formulas.get(t.address):this.createFormula(t)}refresh(){this.dependencies.clear(),this._formulas.clear()}clearDependecies(t){const e=t.address;return this.dependencies.clearCellDependecies(e),this.formulas.delete(e),this}evaluateFormula(t,e){return this.context.currentCell=e,t.fn(this.context,{cell:e,formula:t})}evaluateExpression(t,e){this.context.currentCell=e;const i=new wv(t,this.tokenizer);return i.fn(this.context,{cell:e,formula:i})}evaluate(t,e){if(!t)return null;let i=null;if(t.hasFormula){const o=this.getFormula(t);try{t.clearError(),this.context.currentCell=t,i=o.fn(this.context,{cell:t,formula:o}),Array.isArray(i)?(e||this.model.spillValues({cell:t,values:i}).range,i=i.length>0&&i[0].length>0?i[0][0]:null,e&&(t.value=i)):t.value=i}catch(e){t.error={message:lw(e)}}}else i=t.value;return i}evaluateAll(){this.model.rows.forEach((t=>this.model.columns.forEach(((e,i)=>t.cell(i).evaluate()))))}calculateViewport(t){const e=[];return t.rows.forEach((t=>t.cells.forEach((t=>{if(t.hasFormula){if(!t.hasValue&&(this.evaluate(t),t.spillRange))for(const i of this.model.getRangeIterator(t.spillRange))e.push(i);e.push(t)}})))),e}shift(t){this.getFormulaCells().forEach((e=>{e.formula=this.getFormula(e).shift(t).createFormulaString(!1),this.updateDependencies(e)}));const e=this.model.name;return this.dependencies.sheetDependants.forEach((i=>{const o=this.model.getConnectedModel(i);o?.calculations.getFormulaCells().forEach((i=>{const r=o.calculations.getFormula(i);r.hasSheetReference(e)&&(i.formula=r.shift(t).createFormulaString(!1),o.calculations.updateDependencies(i))}))})),this}getFormulaCells(){const t=this.model,e=[];let i;const o=t.rows.length,r=t.columns.length;for(let n=0;n<o;n++){i=t.rows[n];for(let t=0;t<r;t++)i.hasCellFormula(t)&&e.push(i.cell(t))}return e}renameSheet(t,e){let i=!1;return this.dependencies.renameSheet(t,e),this.getFormulaCells().forEach((o=>{const r=this.getFormula(o);r.renameSheet(t,e)&&(o.formula=r.createFormulaString(),this.refreshFormula(o),i=!0)})),i}invalidateCellDependants(t){const e=[];return this.dependencies.getDependants(t.range).forEach((([t,i])=>{e.push([t,i]),t.invalidateValue()})),e}invalidateDependants(t){const e=new Map,i=new Map;for(const i of t)this.invalidateCellDependants(i).forEach((([t,i])=>e.set(t,i)));e.forEach(((t,e)=>i.set(e,t)));for(const i of t)e.set(i,null);return e.forEach(((t,e)=>{this.model.sparklines.dependencies.getDependants(e.range).forEach((([t,e])=>{i.set(t,e)})),this.model.conditionalFormats.dependencies.getDependants(e.range).forEach((([t,e])=>{this.model.conditionalFormats.invalidateExtremes(t),t.invalidateStyle(),i.set(t,e)}))})),i}}const hw="#ff0000",dw="#fcd53f",uw="#00bb5e",pw="#555555",gw=new Map([["3Arrows",[{icon:["fas","down"],color:hw},{icon:["fas","right"],color:dw},{icon:["fas","up"],color:uw}]],["3ArrowsGray",[{icon:["fas","down"],color:pw},{icon:["fas","right"],color:pw},{icon:["fas","up"],color:pw}]],["3Flags",[{icon:["fas","flag-pennant"],color:hw},{icon:["fas","flag-pennant"],color:dw},{icon:["fas","flag-pennant"],color:uw}]],["3TrafficLights1",[{icon:["fas","circle"],color:hw},{icon:["fas","circle"],color:dw},{icon:["fas","circle"],color:uw}]],["3TrafficLights2",[{icon:["fas","square-o"],color:hw},{icon:["fas","square-o"],color:dw},{icon:["fas","square-o"],color:uw}]],["3Signs",[{icon:["fas","square"],rotation:45,color:hw},{icon:["fas","triangle"],color:dw},{icon:["fas","circle"],color:uw}]],["3Symbols",[{icon:["fas","circle-xmark"],color:hw},{icon:["fas","circle-exclamation"],color:dw},{icon:["fas","circle-check"],color:uw}]],["3Symbols2",[{icon:["fas","xmark"],color:hw},{icon:["fas","exclamation"],color:dw},{icon:["fas","check"],color:uw}]],["3Stars",[{icon:["fal","star"],color:dw},{icon:["fas","star-half-stroke"],color:dw},{icon:["fas","star"],color:dw}]],["3Triangles",[{icon:"caret-down",color:hw},{icon:"dash",color:dw},{icon:"caret-up",color:uw}]],["4Arrows",[{icon:["fas","down"],color:hw},{icon:["fas","down-right"],color:dw},{icon:["fas","up-right"],color:dw},{icon:["fas","up"],color:uw}]],["4ArrowsGray",[{icon:["fas","down"],color:pw},{icon:["fas","down-right"],color:pw},{icon:["fas","up-right"],color:pw},{icon:["fas","up"],color:pw}]],["4RedToBlack",[{icon:["fas","circle"],color:"#000000"},{icon:["fas","circle"],color:"#b1b1b1"},{icon:["fas","circle"],color:"#edb2a3"},{icon:["fas","circle"],color:hw}]],["4Rating",[{icon:"signal-bars-weak",color:"#4a7db1"},{icon:"signal-bars-fair",color:"#4a7db1"},{icon:"signal-bars-good",color:"#4a7db1"},{icon:["fas","signal-bars"],color:"#4a7db1"}]],["4TrafficLights",[{icon:["fas","circle"],color:"#000000"},{icon:["fas","circle"],color:hw},{icon:["fas","circle"],color:dw},{icon:["fas","circle"],color:uw}]],["5Arrows",[{icon:["fas","down"],color:hw},{icon:["fas","down-right"],color:dw},{icon:["fas","right"],color:dw},{icon:["fas","up-right"],color:dw},{icon:["fas","up"],color:uw}]],["5ArrowsGray",[{icon:["fas","down"],color:pw},{icon:["fas","down-right"],color:pw},{icon:["fas","right"],color:pw},{icon:["fas","up-right"],color:pw},{icon:["fas","up"],color:pw}]],["5Rating",[{icon:["fal","signal-bars"]},{icon:["fal","signal-bars-weak"],color:"#4a7db1"},{icon:["fal","signal-bars-fair"],color:"#4a7db1"},{icon:["fal","signal-bars-good"],color:"#4a7db1"},{icon:["fas","signal-bars"],color:"#4a7db1"}]],["5Quarters",[{icon:["fal","circle"],color:"#505050"},{icon:["fas","circle-quarter-stroke"],color:"#505050"},{icon:["fas","circle-half-stroke"],color:"#505050"},{icon:["fas","circle-three-quarters-stroke"],color:"#505050"},{icon:["fas","circle"],color:"#505050"}]]]),mw=(t,e)=>{const i=gw.get(t);return i?i[e]:null};class fw extends aw{constructor(t,e){super(t,"conditionalFormats"),this.formats=[],this.cellFormatMap=new Map,this.extremes=new Map,e&&this.populate(e)}populate(t){t.forEach((t=>{try{this.add(t)}catch(e){Sr().error(`conditional format error: ${JSON.stringify(t)}`,e)}}))}refresh(){this.dependencies.clear(),this.cellFormatMap.clear(),this.extremes.clear(),this.formats.forEach((t=>this.initConditionalFormat(t)))}clearCellDependecies(t){const e=t.address;return this.dependencies.clearCellDependecies(e),this.cellFormatMap.get(e).forEach((t=>({cf:t.cf}))),this}getExtremes(t){if(this.extremes.has(t.key))return this.extremes.get(t.key);const e=[1/0,-1/0];return t.ranges.forEach((t=>{for(const i of this.model.getValuesInRange(t))for(const t of i)null!=t&&(isNaN(t)||(e[0]=Math.min(e[0],t),e[1]=Math.max(e[1],t)))})),t.cmin&&("num"==t.cmin.t?e[0]=t.cmin.v:"percent"==t.cmin.t&&(e[0]=e[0]+(e[1]-e[0])*t.cmin.v/100)),t.cmax&&("num"==t.cmax.t?e[1]=t.cmax.v:"percent"==t.cmax.t&&(e[1]=e[0]+(e[1]-e[0])*t.cmax.v/100)),this.extremes.set(t.key,e),e}invalidateExtremes(t){this.cellFormatMap.get(t.address).forEach((t=>this.extremes.delete(t.cf.key)))}evaluateScaleFormat(t,e){const i=t.value;if(null==i)return null;const[o,r]=this.getExtremes(e.cf);let n;const s=(i-o)/(r-o);if(e.cf.cmid?.color)n=.5==s?"#"+e.cf.cmid.color:s>.5?Nr("#"+e.cf.cmid.color,"#"+e.cf.cmax.color,2*(s-.5)):Nr("#"+e.cf.cmin.color,"#"+e.cf.cmid.color,2*s);else{if(!e.cf.cmin?.color||!e.cf.cmax?.color)return null;n=Nr("#"+e.cf.cmin.color,"#"+e.cf.cmax.color,s)}return{color:Pr(n).substring(1),fgColor:n.substring(1)}}evaluateBarFormat(t,e){const i=t.value;if(null==i)return null;const o=this.getExtremes(e.cf);let r=o[0];const n=o[1],s=r<0;s||(r-=.1*(n-r));const a=Math.round(100*(i-r)/(n-r));e.initialized||(e.initialized=!0,e.cf.ranges.forEach((e=>this._dependencies.add(t.address,e.A1,null))));const l=[];if(s){const t=Math.round(-100*r/(n-r));i>=0?(l.push(`#00000000 ${t}%`),l.push(`#${e.cf.color} ${t}%`),l.push(`#${e.cf.color} ${a}%`),l.push(`#00000000 ${a}%`)):(l.push(`#00000000 ${a}%`),l.push(`#ff0000 ${a}%`),l.push(`#ff0000 ${t}%`),l.push(`#00000000 ${t}%`))}else l.push(`#${e.cf.color} ${a}%`),l.push(`#00000000 ${a}%`);return{cssStyle:{backgroundClip:"padding-box",backgroundImage:`linear-gradient(90deg, ${l.join(",")})`}}}evaluateFormulaFormat(t,e){if(!e.initialized&&e.cf.condition){e.initialized=!0;const i=t.address,o=new wv(e.cf.condition,this.model.calculations.tokenizer);e.f=o.shift({index:0,offset:t.c-e.cf.firstCell.c1,direction:"right"}).shift({index:0,offset:t.r-e.cf.firstCell.r1,direction:"down"}),o.cells.forEach((t=>this._dependencies.add(i,t[1].A1,t[2]))),o.ranges.forEach((t=>this._dependencies.add(i,t[1].A1,t[2]))),o.variables.forEach((([e,o])=>{const r=this.model.getCellByName(o,t.range);r&&this._dependencies.add(i,r.address,null)}))}if(e.f&&!this.model.calculations.evaluateFormula(e.f,t))return null;const i={...e.cf.style};return i.color||jr(Pr(Hr(e.cf.style.fgColor))),i}evaluateIconFormat(t,e){const i=t.value;if(null==i)return null;const[o,r]=this.getExtremes(e.cf);let n;for(let t=e.cf.thresh.length-1;t>=0;t--){const s=e.cf.thresh[t];if("percent"===s.t){if(null==n&&(n=100*(i-o)/(r-o)),n>=s.v)return{icon:mw(e.cf.v,t)}}else if("num"===s.t&&i>=s.v)return{icon:mw(e.cf.v,t)}}return null}evaluate(t){const e=t.address,i=this.cellFormatMap.get(e);if(!i)return null;let o=null,r=null;for(const e of i){try{switch(e.cf.type){case"formula":r=this.evaluateFormulaFormat(t,e);break;case"scale":r=this.evaluateScaleFormat(t,e);break;case"bar":r=this.evaluateBarFormat(t,e);break;case"icon":r=this.evaluateIconFormat(t,e);break;default:r=null}}catch(t){Sr().error(`Conditional format error: ${JSON.stringify(e)}`,t)}if(r&&(o=o?{...o,...r}:r,e.cf.stop))break}return o}initConditionalFormat(t){return t.firstCell=null,t.ranges.forEach((e=>{for(const i of new Sw(e.intersect(this.model.gridRange))){const e=i.A1;"formula"===t.type&&(t.firstCell||(t.firstCell=i,t.formula=t.condition?new wv(t.condition,this.model.calculations.tokenizer):null)),(this.cellFormatMap.get(e)||this.cellFormatMap.set(e,[]).get(e)).push({cf:t})}})),t}add(t){const e={key:t.ranges,ranges:iv.fromA1s(t.ranges),type:t.type||"formula",firstCell:null,formula:null,style:t.style?this.model.styles.add(t.style):null,condition:t.condition,stop:!!t.stop,cmin:t.cmin,cmid:t.cmid,cmax:t.cmax,color:t.color,v:t.v,thresh:t.thresh};this.formats.push(this.initConditionalFormat(e))}getSourceData(){return this.formats.map((t=>({type:t.type,ranges:iv.toA1s(t.ranges),style:t.style,condition:t.condition,stop:t.stop,cmin:t.cmin,cmid:t.cmid,cmax:t.cmax,color:t.color,v:t.v,thresh:t.thresh})))}}const vw=(t,e)=>{const i=new RegExp(`${ut(t)}`,"ig");return t=>(i.lastIndex=0,i.test(ct((t[e]??"").toString())))},bw=(t,e)=>i=>!!i[e]===t,yw=(t,e)=>{const i=t.map((t=>t.key?.toString()));return t=>null!=t[e]&&i.includes(t[e].toString())},ww=(t,e)=>t=>!1,xw=(t,e,i)=>(i=i??"value","b"===t?bw(e,i):"s"===t&&Array.isArray(e)?yw(e,"value"):"s"===t?vw(e?.toString(),"formattedValue"):"m"===t&&Array.isArray(e)?ww(e,i):vw(e?.toString(),"d"===t?"formattedValue":i));class kw extends Event{constructor(){super("filter",{bubbles:!1,cancelable:!0,composed:!0})}}class Cw extends EventTarget{constructor(t){super(),this.model=t,this.settings=new Map,this.custom=!1}get(t){return this.settings.has(t)?this.settings.get(t):null}filter(t,e=!0){null===t.term||""===t.term?this.settings.delete(t.c):this.settings.set(t.c,t),this.custom||(this.settings.size>0?this.applyFilter(!1):this.resetFilter(!1)),e&&this.dispatchEvent(new kw)}applyFilter(t=!0){const e=[];this.settings.forEach(((t,i)=>{const o=this.model.columns[i];e.push({c:i,matcher:xw(o.type,t.term,o.filter?.property)})}));const i=e.length,o=this.model.options.filters?.includeParents??!0,r=this.model.options.filters?.includeChildren??!0,n=new Set;this.model.rows.forEach((t=>{const s=n.has(t.index);(t=>{if(!t.filterable)return!0;for(let o=0;o<i;o++)if(!e[o].matcher(t.cell(e[o].c)))return!1;return!0})(t)?(t.filterState=Er.Matched,o&&t.walkUp((t=>{if(n.has(t.index)&&t.filterState>0)return!1;t.filterState=Er.ChildMatched,n.add(t.index)})),r&&t.walk((t=>{if(n.has(t.index)&&t.filterState>0)return!1;t.filterState=Er.ParentMatched,n.add(t.index)}))):s||(t.filterState=Er.Filtered),n.add(t.index)})),this.model.indexRows(),t&&this.dispatchEvent(new kw)}resetFilter(t=!0){this.settings.clear(),this.model.rows.forEach((t=>t.filterState=Er.Matched)),this.model.indexRows(),t&&this.dispatchEvent(new kw)}}class Mw extends aw{constructor(t,e){super(t,"sparklines"),this.model=t,this.map=new Map,this.groups=new Map,this.extremes=new Map,this.maxIndex=0,this.updateRangeMap=!1,this.populate(e)}populate(t){t?.forEach((t=>{try{this.add(iv.fromA1(t.location),Array.isArray(t.data)?t.data.map((t=>[iv.fromA1(t)])):t.data.split(",").map((t=>[iv.fromA1(t)])),ot({},$f.DEFAULT_SPARKLINE_OPTIONS,t.options))}catch(e){this.model.logger.error(`sparkline error: ${JSON.stringify(t)}`,e)}}))}getSourceData(){const t=[];return this.groups.forEach((e=>{t.push({location:e.locRange.A1,data:e.dataRanges.map((t=>t[0].A1)).join(","),options:{minValue:e.minValue,maxValue:e.maxValue,type:e.type,style:e.style,marker:e.marker}})})),t}has(t){return this.map.has(t)}get(t){return this.map.get(t)}createDependencies(t){this.map.get(t)[1].forEach((e=>this._dependencies.add(t,e[0].A1,e[1])))}updateRangeMaps(){this.dependencies.clear(),this.map.clear(),this.groups.forEach(((t,e)=>this.createRangeMap(e,t.locRange,t.dataRanges)))}getValues(t){this.updateRangeMap&&this.updateRangeMaps();const e=this.map.get(t),i=e[1][0][1]?this.model.getConnectedModel(e[1][0][1]):this.model;return this._dependencies.has(t)||this.createDependencies(t),e[1].flatMap((t=>i.getValuesInRange(t[0])[0]))}getExtremes(t){const e=this.map.get(t),i=e[1][0][1]?this.model.getConnectedModel(e[1][0][1]):this.model,o=this.groups.get(e[0]);let r,n,s,a;return null==o.minValue||Q(o.minValue)?"auto"==(o.minValue||"auto")?(r=r??lt(...e[1].map((t=>i.getValuesInRange(t[0])))),s=r[0]):(this.extremes.has(e[0])||this.extremes.set(e[0],lt(...o.dataRanges.map((t=>i.getValuesInRange(t[0]))))),n=this.extremes.get(e[0]),s=n[0]):s=o.minValue,null==o.maxValue||Q(o.maxValue)?"auto"==(o.maxValue||"auto")?(r=r??lt(...e[1].map((t=>i.getValuesInRange(t[0])))),a=r[1]):(this.extremes.has(e[0])||this.extremes.set(e[0],lt(...o.dataRanges.map((t=>i.getValuesInRange(t[0]))))),n=this.extremes.get(e[0]),a=n[1]):a=o.maxValue,[s,a]}createRangeMap(t,e,i){e=e.intersect(this.model.gridRange);const o=i[0][0].size,r=e.size;if(r.columns>1&&r.rows>1)return void this.model.logger?.error(`invalid sparkline location range: ${e.A1}`);let n=!1;if(n=1==r.columns&&1==r.rows?o.rows>1:r.columns>1,n)for(let o=e.c1;o<=e.c2;o++)this.map.set(new iv(o,e.r1).A1,[t,i.map((([t,i])=>[new iv(t.c1+o-e.c1,t.r1,t.c1+o-e.c1,t.r2),i]))]);else for(let o=e.r1;o<=e.r2;o++)this.map.set(new iv(e.c1,o).A1,[t,i.map((([t,i])=>[new iv(t.c1,t.r1+o-e.r1,t.c2,t.r1+o-e.r1),i]))])}add(t,e,i){const o=++this.maxIndex;t&&e&&this.createRangeMap(o,t,e),this.groups.set(o,Object.assign({dataRanges:e,locRange:t},JSON.parse(JSON.stringify($f.DEFAULT_SPARKLINE_OPTIONS)),i))}update(t,e,i,o){const r=this.groups.get(t);Object.assign(r,{dataRanges:i,locRange:e},o),this.updateRangeMap=!0}delete(t){this.groups.delete(t),this.updateRangeMap=!0}shift(t){this.groups.forEach((e=>{e.dataRanges.forEach((([e])=>e.shift(t))),e.locRange.shift(t)})),this.updateRangeMaps()}}class _w extends iv{constructor(t,e,i=!1){super(e.c1,e.r1,e.c2,e.r2),this.model=t,this.initializedOnly=i,this.r=0,this.c=-1,this.done=!1}[Symbol.iterator](){return this}nextInitialized(){let t;for(;!this.done&&!t;)this.c<this.size.columns-1?this.c++:this.r<this.size.rows-1&&(this.c=0,this.r++),t=this.model.rows[this.r].cells[this.c],this.done=this.c>=this.size.columns-1&&this.r>=this.size.rows-1;return t}next(){if(this.done)return{done:!0};this.c<this.size.columns-1?this.c++:this.r<this.size.rows-1&&(this.c=0,this.r++),this.done=this.c>=this.size.columns-1&&this.r>=this.size.rows-1;const t=this.model.rows[this.r+this.r1],e=this.c+this.c1,i=this.initializedOnly&&!t.isCellInitialized(e)?this.nextInitialized():t?.cell(e);return i?{done:!1,value:i}:{done:!0}}forEach(t){let e;for(;e=this.next().value;)t(e)}}class Sw extends iv{constructor(t){super(t.c1,t.r1,t.c2,t.r2),this.r=0,this.c=-1,this.done=!1}[Symbol.iterator](){return this}next(){return this.done?{done:!0}:(this.c<this.size.columns-1?this.c++:this.r<this.size.rows-1&&(this.c=0,this.r++),this.done=this.c==this.size.columns-1&&this.r==this.size.rows-1,{done:!1,value:new iv(this.c+this.c1,this.r+this.r1)})}}class Ew extends iv{constructor(t,e,i){super(e.c1,e.r1,e.c2,e.r2),this.model=t,this.i=0,this.done=!1,this.axis=i,this.key="rows"===i?"r1":"c1"}[Symbol.iterator](){return this}next(){if(this.done)return{done:!0};this.i<this.size[this.axis]-1&&this.i++,this.done=this.i>=this.size[this.axis]-1;const t=this.model[this.axis][this.i+this[this.key]];return t?{done:!1,value:t}:{done:!0}}forEach(t){let e;for(;e=this.next().value;)t(e)}}class zw{constructor(t,e){this.model=t,this.names=new Map,this.rangeMap=new Map,e&&this.populate(e)}populate(t){t.forEach((({name:t,ref:e})=>this.set(t,Z(e)?iv.fromCoords(e):iv.fromA1(e))))}set(t,e){this.names.set(t,e),this.rangeMap.set(e.A1,t)}delete(t){const e=this.names.get(t);e&&(this.rangeMap.delete(e.A1),this.names.delete(t))}findCellByName(t){let e;const i=this.model.rows,o=this.model.columns.length;for(let r=0;r<i.length;r++){e=i[r];for(let i=0;i<o;i++)if(e.hasCellName(i)){const o=e.cell(i);if(o.name==t)return o.range}}return null}getCellByName(t,e){const i=this.names.get(t)??this.findCellByName(t);return i?i.isColumn?this.model.rows.length>e.r1?this.model.columns[i.c1].cell(e.r1):null:i.isRow?this.model.columns.length>e.c1?this.model.rows[i.r1].cell(e.c1):null:this.model.rows[i.r1].cell(i.c1):null}getRangeByName(t,e=!0){const i=this.names.get(t);return e?i?.intersect(this.model.gridRange):i}shift(t){this.names.forEach(((e,i)=>{const o=e.A1;e.shift(t);const r=e.A1;o!=r&&(this.rangeMap.delete(o),this.rangeMap.set(r,i))}))}}function Lw(t,e=null){const i=ot({},$f.DEFAULT_OPTIONS,e,en(t,e));return i.numberFormat?i.numberFormatter=ur(i.formatLocale,i.numberFormat):i.numberFormatter||(i.numberFormatter=ur(i.formatLocale)),i.dateFormat?i.dateFormatter=Zo(i.formatLocale,i.dateFormat):i.dateFormatter||(i.dateFormatter=Zo(i.formatLocale)),i.columnSorting&&(i.sorting=i.sorting||{enabled:!0}),"boolean"==typeof i.filters&&(i.filters={enabled:i.filters}),i.filters=Object.assign({},Af,i.filters),"boolean"==typeof i.rowTree&&(i.rowTree={enabled:i.rowTree}),i.rowTree=Object.assign({},Of,i.rowTree),"boolean"==typeof i.columnTree&&(i.columnTree={enabled:i.columnTree}),i.columnTree=Object.assign({},Of,i.columnTree),i.cellValidation&&(i.cellValidation=Ay(i.cellValidation)),i}class Iw extends(Lr($y)){get cells(){return this._cells}get data(){return this._data}set data(t){this._data=t}get height(){return this._height??this.model.options.rowHeight}set height(t){this._height=t}get priority(){return this._priority}set priority(t){this._priority=t}get address(){return ov(this.index)}get range(){return new iv(null,this.index,null,this.index)}get hasFormula(){return!!this._formula}get formula(){return this._formula}set formula(t){super.formula=t,this.model.columns.forEach((t=>this.cell(t.index).refreshFormula()))}get values(){return this.model.columns.map((t=>this.cell(t.index).value))}cell(t,e){if(this.model.options.singleCellModel)return this._singleCell||(this._singleCell=new Zy(this.model,{c:t,r:this.index})),this._singleCell.row=this,this._singleCell.column=this.model.columns[t],this._singleCell;let i=this._cells[t];if((e||!i)&&this.model.columns[t]){if(i=new Zy(this.model,e??{c:t,r:this.index}),this._data){const e=this.model.columns[t].data;if(null!=e){const t=this._data[e];Z(t)?(t.comment&&this.model.comments.set(i.address,[t.comment]),i.populate(t)):i.hasValue||(i.value=t)}}i.name&&this.model.names.set(i.name,i.range),this._cells[t]=i}return i}constructor(t,e){super(t,e),this.isCellInitialized=t=>!!this.cells[t],this._cells=[],null==this._priority&&(this._priority=t.options.rowPriority)}populate(t){super.populate(t),this._height=null==t.h||"auto"==t.h?this.model.options.rowHeight:t.h,t.data&&(Array.isArray(t.data)?this._data=[...t.data]:this._data={...t.data}),null!=t.priority&&(this._priority=t.priority)}getSourceData(){const t=super.getSourceData();return null!=this._height&&this._height!=this.model.options.rowHeight&&(t.h=this._height),t}expand(t){super.expand(t),this.model.indexVisibleRows()}collapse(){super.collapse(),this.model.indexVisibleRows()}get prev(){return this.model.rows[this.index-1]}get next(){return this.model.rows[this.index+1]}get prevVisible(){let t=this.prev;for(;t&&!t.visible;)t=t.prev;return t}get nextVisible(){let t=this.next;for(;t&&!t.visible;)t=t.next;return t}hasCellFormula(t){return this.cells[t]&&this.cells[t].hasFormula||this._data&&this._data[this.model.columns[t].data]&&this._data[this.model.columns[t].data].f}hasCellName(t){return this.cells[t]&&null!=this.cells[t].name||this._data&&this._data[this.model.columns[t].data]&&null!=this._data[this.model.columns[t].data].name}insertColumns(t,e,i=!1){let o;const r=this.model.columns.length,n=this.model.calculations;if(i)for(let i=0;i<r;i++)this.hasCellFormula(i)&&(o=this.cell(i),o.formula=n.getFormula(o).shift({index:t,offset:e,direction:"right"}).createFormulaString(!1));t<this.cells.length&&this.cells.splice(t,0,...Array(e).fill(null))}deleteColumns(t,e,i=!1){let o;const r=this.model.columns.length,n=this.model.calculations;if(i)for(let i=0;i<r;i++)this.hasCellFormula(i)&&(o=this.cell(i),o.formula=n.getFormula(o).shift({index:t,offset:e,direction:"left"}).createFormulaString(!1));return t<this.cells.length?this.cells.splice(t,e):null}clearCalculatedValues(){this.cells.forEach((t=>t&&this.model.calculations.refreshFormula(t)))}}var Rw=i(4418),Tw=i.n(Rw);const Aw=t=>t?"1":"0",Ow=t=>null==t?"_":t,$w=t=>null==t?"_":t.toString(),Dw=t=>null==t?"_":JSON.stringify(t),Nw=t=>Ow(t&&t.color?t.color:"_")+Ow(t&&t.style?t.style:"_"),Pw=t=>Ow(t?t.horizontal:null)+Ow(t?t.vertical:null)+Ow(t?t.horizontal:null)+$w(t?t.indent:null)+Aw(t?t.wrapText:null)+$w(t?t.textRotation:null),jw=t=>Tw()("s_"+Aw(t.bold)+Aw(t.italic)+Aw(t.underline)+$w(t.sz)+Ow(t.font)+Ow(t.color)+Nw(t.top)+Nw(t.right)+Nw(t.bottom)+Nw(t.left)+Ow(t.patternType)+Ow(t.fgColor)+Ow(t.bgColor)+Pw(t.alignment)+$w(t.angle)+Dw(t.stops)+Aw(t.hidden)+Aw(t.editable)+Dw(t.cssStyle)+Dw(t.icon));function Hw(t){const e={...t};return delete e.id,delete e.hash,e}class Bw{constructor(t){this.model=t,this._count=0,this.hashmap=new Map,this.map=new Map}add(t){if(!isNaN(t))return this.get(t);const e=this.model.options.cssStyles?Gy(t):t,i=e.hash?e.hash:jw(e);return this.hashmap.has(i)?this.map.get(this.hashmap.get(i)):(null==e.id&&(e.id=this._count),this._count=Math.max(e.id+1,this._count+1),e.hash=i,this.hashmap.set(i,e.id),this.map.set(e.id,e),e)}populate(t){t.forEach((t=>this.add(t)))}get(t){return this.map.has(t)?this.map.get(t):null}remove(t){const e="object"==typeof t?t:this.map.get(t);this.hashmap.delete(e.hash),this.map.delete(e.id)}merge(...t){const e=Object.assign({},...t.map((t=>Z(t)?t:this.get(t))));return this.add(Hw(e))}duplicate(t,e){const i=this.get(t);return this.add(Hw({...i,...e}))}set(t,e){let i=this.map.has(t)?this.map.get(t):{};for(const t in e)i[t]=e[t];return i=i.id?i:this.add(i),i}unset(t,e){if(this.map.has(t)){const i=this.map.get(t);for(const t of e)delete i[t]}}getSourceData(){return Array.from(this.map.values())}clean(){const t=new Map(Array.from(this.map.entries()).map((([t])=>[t,0])));this.model.columns.forEach((e=>{const i=t.get(e.style);null!=i&&t.set(e.style,i+1)})),this.model.rows.forEach((e=>{const i=t.get(e.style);null!=i&&t.set(e.style,i+1),e.cells.forEach((e=>{const i=t.get(e.style);null!=i&&t.set(e.style,i+1)}))})),t.forEach(((t,e)=>{0==t&&this.remove(e)}))}}function Fw(t,e,i,o){const r=o??("rows"==i?e.rows:e.columns),n=function(t){const e=new Map;for(const i of t)e.has(i.level)||e.set(i.level,[]),e.get(i.level).push(i);return e}(r),s=t[i]??[];for(const t of s){let o;if(o=t.index>-1?[r[t.index]]:t.level>-1?n.get(t.level):r,t.name){const e=t.name instanceof RegExp?t.name:new RegExp(ut(t.name));o=o.filter((t=>e.test(t.name)))}o?.forEach((o=>{null!=t.priority&&(o.priority=t.priority),t.type?e.conditionalFormats.add(Object.assign({ranges:`${o.address}:${o.address}`},t)):(o.style=e.styles.add(t.style).id,"rows"==i&&null!=t.height?o.height=t.height:"columns"==i&&null!=t.width&&(o.width=t.width))}))}}function Ww(t,e){for(const i of t)if(e[i.property]!=i.value)return!1;return!0}function Vw(t,e,i){const o=t.cells??[];for(const t of o)if(t.conditions?.length){const o=e.getRangeIterator(i??e.gridRange);for(const i of o)Ww(t.conditions,i)&&(i.style=e.styles.add(t.style).id)}else if(t.type)e.conditionalFormats.add(Object.assign({ranges:"A:"+e.columns[e.columns.length-1].address},t));else for(const i of e.columns)null==i.style&&(i.style=e.styles.add(t.style).id)}function Uw(t,e,i){Fw(t,e,"columns",i)}function Gw(t,e,i){Fw(t,e,"rows",i)}function qw(t,e){Vw(t,e),Uw(t,e),Gw(t,e)}var Yw;!function(t){t[t.NONE=0]="NONE",t[t.MERGED=1]="MERGED",t[t.HIDDEN=2]="HIDDEN"}(Yw||(Yw={}));class Zw{get mergedCells(){return this._mergedCells}get hiddenCells(){return this._hiddenCells}constructor(t){this.model=t,this._mergedCells=new Map,this._hiddenCells=new Map}clear(){this._mergedCells.clear(),this._hiddenCells.clear(),this.model.rows.forEach((t=>{t.cells.forEach((t=>{t.rowspan=1,t.colspan=1}))}))}getMergeState(t){return this._mergedCells.has(t)?Yw.MERGED:this._hiddenCells.has(t)?Yw.HIDDEN:Yw.NONE}indexMergedCells(t){const e=t.A1,i=this._mergedCells.get(e);if(!i)return;const o=i.r,r=i.c,n=t.clone(),s=this.model.rows[o].cell(r);s.rowspan=i.rs,s.colspan=i.cs;for(let t=0;t<i.rs;t++)for(let e=0;e<i.cs;e++)0==t&&0==e||(n.r1=o+t,n.c1=r+e,n.r2=n.r1,n.c2=n.c1,this._hiddenCells.set(n.A1,i))}add(t){const e=new iv(t.c,t.r),i=e.A1;if(this._mergedCells.has(i))this.remove(i);else if(this._hiddenCells.has(i))return;this._mergedCells.set(i,t),this.indexMergedCells(e)}remove(t){const e=this._mergedCells.get(t);if(!e)return;const i=e.r,o=e.c,r=new iv(o,i),n=this.model.rows[i].cell(o);n.rowspan=1,n.colspan=1,this._hiddenCells.delete(t);for(let t=0;t<e.rs;t++)for(let n=0;n<e.cs;n++)0==t&&0==n||(r.r1=i+t,r.c1=o+n,r.r2=r.r1,r.c2=r.c1,this._hiddenCells.delete(r.A1))}shift(t){const{index:e,offset:i,direction:o}=t,r={down:t=>{e<=t.r?t.r+=i:e>t.r&&e<t.r+t.rs&&(t.rs+=i)},up:t=>{e<=t.r?t.r-=i:e>t.r&&e<t.r+t.rs&&(t.rs-=i)},right:t=>{e<=t.c?t.c+=i:e>t.c&&e<t.c+t.cs&&(t.cs+=i)},left:t=>{e<=t.c?t.c-=i:e>t.c&&e<t.c+t.cs&&(t.cs-=i)}};this.mergedCells.forEach((t=>{const e=new iv(t.c,t.r);this.remove(e.A1),r[o](t),this.add(t)}))}}const Xw=["index","name","rows","columns","cells","options","sparklines","rules","comments","styles","names","props","tab","theme"];class Qw{get mergedHeaders(){return this._mergedHeaders}get hasFilter(){return this._filter}get hasRowTree(){return this._maxRowLevel>0}get hasRowTreeEnabled(){return this.hasRowTree&&this.options.rowTree.enabled}get maxRowLevel(){return this._maxRowLevel}get hasColumnTree(){return this._maxColumnLevel>0}get hasColumnTreeEnabled(){return this.hasColumnTree&&this.options.columnTree.enabled}get maxColumnLevel(){return this._maxColumnLevel}get headerCount(){return this._headerCount}get columnHeaderCount(){return this.headerCount+(this.hasColumnTreeEnabled?1:0)+(this.hasFilter?1:0)}get properties(){return this._properties}set properties(t){this._properties=t}get theme(){return this._theme}set theme(t){this._theme=t}constructor(t,e,i){this.otherModels={},this.autofitColumns=new Set,this.autofitRows=new Set,this.merges=new Zw(this),this.styles=new Bw(this),this.comments=new rw(this),this.calculations=new cw(this),this.names=new zw(this),this.sorting=new iw(this),this.sparklines=new Mw(this),this.conditionalFormats=new fw(this),this._filter=!1,this._maxRowLevel=0,this._maxColumnLevel=0,this._headerCount=0,this._levelBasedRowTree=!0,this._levelBasedColTree=!0,this.clearRows=()=>(this.rowRoot.clearChildren(),this.rows=[],this.rows),this.clearColumns=()=>this.columns=[],this.logger=i,this.options=e??Lw(t.options),this.populate(t)}getConnectedModel(t){return this.group?this.group.get(t):null}getModelByRange(t){return t.sheet?this.getConnectedModel(t.sheet):this}getCellByA1(t){return this.getCellByRange(iv.fromA1(t))}getCellByRange(t){return this.getCellByCoords(t.r1,t.c1)}getCellByCoords(t,e){return this.rows[t]?.cell(e)}cell(t,e){return isNaN(t)?t instanceof iv?this.getCellByRange(t):"string"==typeof t?this.getCellByA1(t):null:this.getCellByCoords(t,e||0)}createRows(t,e=new Iw(this,{l:-1}),i=0){let o=!1,r=!1;this.autofitRows.clear();const n=t.map(((t,e)=>{t||(t={}),isNaN(t.l)||(o=!0),null!=t.p&&(r=!0),"auto"==t.h&&this.autofitRows.add(e);const n=new Iw(this,t);return n.origIndex=e+i,n.name&&this.names.set(n.name,iv.fullRow(e)),n}));let s=-1;return o?s=Ir(n,e,{reverse:this.options.rowTree.reversed}):r?s=Rr(n,e):e.children=n,r||(o=!0),[e,n,s,o]}insertRowData(t,e,i){const o=this.createRows(i,new Iw(this,{l:t.level}),e);if(this._maxRowLevel=Math.max(this._maxRowLevel,o[2]),t.insertChildren(o[0].children,e),this.indexRowsByTree(),this.theme){const t=o[1];Gw(this.theme,this,t),Vw(this.theme,this,new iv(0,t[0].index,1/0,t[t.length-1].index))}}applyTheme(t,e){if(e)for(const t of this.getInitializedCellIterator())t.invalidateStyle();qw(t,this)}populate(t){this.index=t.index,this.name=t.name??this.name,this.tab=t.tab;let e=!1,i=!1;if(t.columns||(t.columns=new Array(this.options.columns).fill({})),t.rows||(t.rows=new Array(this.options.rows).fill({})),t.styles&&this.styles.populate(t.styles),this.autofitColumns.clear(),this.columns=t.columns.map(((t,o)=>{t||(t={}),t.l>0&&(e=!0),null!=t.p&&(i=!0),"auto"==t.w&&this.autofitColumns.add(o);const r=new Qy(this,t);return this._filter=r.hasFilter||this._filter,r.name&&this.names.set(r.name,iv.fullColumn(o)),r})),this._levelBasedColTree=e,this._maxColumnLevel=-1,this.colRoot=new Qy(this,{l:-1}),e?this._maxColumnLevel=Ir(this.columns,this.colRoot,{reverse:this.options.columnTree.reversed}):i?this._maxColumnLevel=Rr(this.columns,this.colRoot):this.colRoot.children=this.columns,i||(this._levelBasedColTree=!0),this.indexColumns(),this.indexVisibleColumns(),[this.rowRoot,this.rows,this._maxRowLevel,this._levelBasedRowTree]=this.createRows(t.rows),this.indexRows(),this.indexVisibleRows(),this.options.pageSize&&this.options.pageSize<=this.rows.length&&(this.rowRoot.count=1/0),this.merges.clear(),t.comments=t.comments||[],t.cells?.forEach(((e,i)=>{const o=this.rows[e.r]?this.rows[e.r].cell(e.c,e):null;o?(o.colspan>1||o.rowspan>1)&&this.merges.add({r:o.r,c:o.c,rs:o.rowspan,cs:o.colspan}):this.logger?.error(`invalid cell definition (index ${i}): ${JSON.stringify(e)}`),o&&e.comment&&t.comments.push(Object.assign(e.comment,{c:e.c,r:e.r}))})),t.sparklines)try{this.sparklines.populate(t.sparklines)}catch(t){Sr().error(`Sparkline init error: ${t}`)}if(t.names)try{this.names.populate(t.names)}catch(t){Sr().error(`Named range init error: ${t}`)}if(t.rules)try{this.conditionalFormats.populate(t.rules)}catch(t){Sr().error(`Conditional formats init error: ${t}`)}if(t.theme)try{this.applyTheme(t.theme),this._theme=t.theme}catch(t){Sr().error(`Theme init error: ${t}`)}if(t.comments)try{this.comments.populate(t.comments)}catch(t){Sr().error(`Comment init error: ${t}`)}this._properties=t.props,this.otherSourceData={};const o=new Set(Xw),r=Object.keys(t).filter((t=>!o.has(t)));r.forEach((e=>this.otherSourceData[e]=t[e])),this.options.sorting?.defaultSettings&&(this.sorting.settings=this.options.sorting.defaultSettings),this.calcHeaderHeights()}getSourceData(){const t={index:this.index,name:this.name,tab:this.tab,columns:this.columns.map((t=>t.getSourceData())),rows:this.rows.map((t=>t.getSourceData())),styles:this.styles.getSourceData(),rules:this.conditionalFormats.getSourceData(),sparklines:this.sparklines.getSourceData(),options:this.options};this._properties&&(t.props=this._properties);const e=[];let i;for(let t=0;t<this.rows.length;t++)for(let o=0;o<this.columns.length;o++)i=this.rows[t].cell(o).getSourceData(),Object.keys(i).length>0&&(i.r=t,i.c=o,e.push(i));e.length>0&&(t.cells=e);const o=[];return this.styles.clean(),this.styles.map.forEach((t=>o.push(t))),o.length>0&&(t.styles=o),new Set([...Object.keys(this.otherModels??{}),...Object.keys(this.otherSourceData??{})]).forEach((e=>t[e]=this.otherModels[e]?Array.from(this.otherModels[e]).map((t=>t.getSourceData())):this.otherSourceData[e])),t}calcHeaderHeights(){this._headerCount=0,this._headerHeights=[],this.columns.forEach((t=>{this._headerCount=t.header?t.header.length:this._headerCount,this._headerHeights.length<this._headerCount&&this._headerHeights.push(...Array(this._headerCount-this._headerHeights.length).fill(0)),t.header?.forEach(((t,e)=>{e>=this._headerHeights.length&&this._headerHeights.push(0),this._headerHeights[e]=Math.max(this._headerHeights[e],t.height??0)}))}))}indexRows(){this.visibleRows=[],this.rows.forEach(((t,e)=>{t.index=e,t.isLoaded||(t.collapsed=!0),t.hidden||t.filterState==Er.Filtered||(t.visibleIndex=this.visibleRows.length,this.visibleRows.push(t))}))}indexVisibleRows(){this.visibleRows=[];let t=0;if(this._levelBasedRowTree){if(this.rowRoot.walkVisible((e=>{e.visibleIndex=t++,this.visibleRows.push(e)})),this.options.rowTree.reversed){const e=new Array(this.visibleRows.length);this.visibleRows.forEach(((i,o)=>{t=this.visibleRows.length-o-1,i.visibleIndex=t,e[t]=i})),this.visibleRows=e}}else this.rowRoot.walkVisible((t=>this.visibleRows[t.index]=t)),this.visibleRows=this.visibleRows.filter((e=>!!e&&(e.visibleIndex=t++,!0)))}indexRowsByTree(){this.rows=[];let t=0;this.rowRoot.walk((e=>{e.index=t++,this.rows.push(e)})),this.options.rowTree.reversed&&this.rows.reverse(),this.indexVisibleRows()}indexColumns(){this.visibleColumns=[],this.columns.forEach(((t,e)=>{t.index=e,t.hidden||this.visibleColumns.push(t)}))}indexVisibleColumns(){this.visibleColumns=[],this.visibleColumnIndex={};let t=0;if(this.colRoot.walkVisible((e=>{e.visibleIndex=t,this.visibleColumnIndex[e.index]=t++,this.visibleColumns.push(e)})),this.options.columnTree.reversed){this.visibleColumnIndex={};const e=new Array(this.visibleColumns.length);this.visibleColumns.forEach(((i,o)=>{t=this.visibleColumns.length-o-1,i.visibleIndex=t,this.visibleColumnIndex[i.index]=t,e[t]=i})),this.visibleColumns=e}this.indexHeaders()}indexHeaders(){this._mergedHeaders=[],this._headerCount=0,this.colRoot.walkVisible((t=>{this._headerCount=Math.max(t.header?t.header.length:0,this._headerCount),t.mergedHeaders.forEach((e=>this._mergedHeaders.push({h:e,c:t.index,r:e.r,cs:t.calculateRealColspan(e.cs??1),rs:e.rs??1})))})),this._mergedHeaders.forEach((t=>{if(!t.h.hidden)for(let e=t.c;e<t.c+t.cs;e++)for(let i=t.r;i<t.r+t.rs;i++)(i>t.r||e>t.c)&&this.columns[e]&&this.columns[e].header[i]&&(this.columns[e].header[i].hidden=!0)})),this.calcHeaderHeights()}removeHeader(t){this.columns.forEach((e=>{t<e.header.length&&e.header.splice(t,1)})),this.indexHeaders()}clear(){this.clearRows(),this.clearColumns(),this.resetViewport()}resetViewport(){return this._viewport=null,this}getViewport(t,e,i){const o=[],r=[];let n,s,a=e.h,l=0;for(l=0;l<i.t;l++)n=this.visibleRows[l],a-=n.height,o.push(n);for(l=this.visibleRows.length-i.b;l<this.visibleRows.length;l++)n=this.visibleRows[l],a-=n.height;for(l=i.t+t.r;a>0&&l<this.visibleRows.length;)n=this.visibleRows[l++],a-=n.height,o.push(n);for(l=this.visibleRows.length-i.b;l<this.visibleRows.length;l++)o.push(this.visibleRows[l]);let c=e.w,h=0;for(h=0;h<i.l;h++)s=this.visibleColumns[h],c-=s.width,r.push(s);for(h=this.visibleColumns.length-i.r;h<this.visibleColumns.length;h++)s=this.visibleColumns[h],c-=s.width;for(h=i.l+t.c;c>0&&h<this.visibleColumns.length;)s=this.visibleColumns[h++],c-=s.width,r.push(s);for(h=this.visibleColumns.length-i.r;h<this.visibleColumns.length;h++)r.push(this.visibleColumns[h]);return this._viewport={rows:o,columns:r}}calculateViewport(){return this._viewport?this.calculations.calculateViewport(this._viewport):[]}getValuesInRange(t,e=!1){if(!(t=t.intersect(this.gridRange)))return[];const{columns:i,rows:o}=t.size,r=new Array(o);let n,s=0,a=0;for(let o=t.r1;o<=t.r2;o++){r[s]=new Array(i),a=0,n=this.rows[o];for(let i=t.c1;i<=t.c2;i++)r[s][a++]=e?n.cell(i).formattedValue:n.cell(i).value;++s}return r}setRowExpandLevel(t){this.rows.forEach((e=>{e.collapsed=!e.isLoaded&&!e.isPartialyLoaded||e.level>=t,e.level<=t&&(e.hidden=!1)})),this.indexVisibleRows()}setColumnExpandLevel(t){this.columns.forEach((e=>e.collapsed=e.level>=t)),this.indexVisibleColumns()}getViewportRange(){return this._viewport?new iv(this._viewport.columns[0].index,this._viewport.rows[0].index,this._viewport.columns[this._viewport.columns.length-1].index,this._viewport.rows[this._viewport.rows.length-1].index):null}get gridRange(){return new iv(0,0,this.columns.length-1,this.rows.length-1)}getRangeIterator(t,e=!1){return new _w(this,e&&this._viewport?t.intersect(this.getViewportRange()):t.intersect(this.gridRange))}getInitializedCellIterator(){return new _w(this,this.gridRange,!0)}getRowIterator(t,e=!1){return t=e&&this._viewport?t.intersect(this.getViewportRange()):t.intersect(this.gridRange),new Ew(this,t,"rows")}getColumnIterator(t,e=!1){return t=e&&this._viewport?t.intersect(this.getViewportRange()):t.intersect(this.gridRange),new Ew(this,t,"columns")}getCellArray(t){const e=[];for(const i of this.getRangeIterator(t))e.push(i);return e}transformRangeToMatrix(t,e){let i,o,r;const n=[];for(let s=(t=t.intersect(this.gridRange)).r1;s<=t.r2;s++)if(i=this.rows[s],i){r=[];for(let n=t.c1;n<=t.c2;n++)o=i.cell(n),o&&r.push(e(o));n.push(r)}return n}getCellMatrix(t){return this.getModelByRange(t)?.transformRangeToMatrix(t,(t=>t))}getValueMatrix(t){return this.getModelByRange(t)?.transformRangeToMatrix(t,(t=>t.value))}shift(t){t.sheet=this.name,this.merges.shift(t),this.calculations.shift(t),this.names.shift(t),this.comments.shift(t),this.sparklines.shift(t)}clearCalculations(t=!1){t&&this.group?this.group.models.forEach((t=>t.calculations.refresh())):this.calculations.refresh()}refreshSparklines(){this.sparklines.updateRangeMaps();for(const t of this.getInitializedCellIterator())t.invalidateStyle()}clearCalculatedStyles(){this.conditionalFormats.refresh();const t=[];for(const e of this.getInitializedCellIterator())t.push(e),e.invalidateStyle()}insertColumns(t,e,i=!1){const o=this.columns[Math.min(this.columns.length-1,t)].parent;i&&++t,this.shift({index:t,offset:e,direction:"right"});for(let i=0;i<this.rows.length;i++)this.rows[i].insertColumns(t,e,!1);const r=new Array(e).fill(null).map((()=>new Qy(this)));return this.columns.splice(t,0,...r),this.maxColumnLevel>0&&o.insertChildren(r,t-(o.index||-1)-1),this.indexColumns(),this.clearCalculations(!0),r}deleteColumns(t,e){const i=this.columns[t].parent;this.shift({index:t,offset:e,direction:"left"});const o=[];for(let i=0;i<this.rows.length;i++)o.push(this.rows[i].deleteColumns(t,e,!1));const r=this.columns.splice(t,e);return i?.deleteChildren(r),this.indexColumns(),this.clearCalculations(!0),r}insertRows(t,e,i=!1){const o=Math.min(this.rows.length-1,t),r=o<0?this.rowRoot:this.rows[o].parent;i&&++t;const n=isNaN(e)?e.length:e;this.shift({index:t,offset:n,direction:"down"});const s=isNaN(e)?e:new Array(n).fill(null).map((()=>new Iw(this)));return this.rows.splice(t,0,...s),this.maxRowLevel>0&&r.insertChildren(s,t-(r.index||-1)-1),this.indexRows(),this.theme&&(Gw(this.theme,this,s),Vw(this.theme,this,new iv(0,s[0].index,1/0,s[s.length-1].index))),this.clearCalculations(!0),s}deleteRows(t,e){const i=this.rows[t].parent;this.shift({index:t,offset:e,direction:"up"});const o=this.rows.splice(t,e);return i?.deleteChildren(o),this.indexRows(),this.clearCalculations(!0),o}moveRows(t,e,i){const o=this.rows.splice(t,e);return this.rows.splice(i,0,...o),this.shift({index:t,offset:i-t,direction:"down",maxIndex:t+e-1}),this.indexRows(),this.clearCalculations(!0),o}moveColumns(t,e,i){const o=this.columns.splice(t,e);return this.columns.splice(i,0,...o),this.shift({index:t,offset:i-t,direction:"right",maxIndex:t+e-1}),this.indexColumns(),this.clearCalculations(!0),o}spillValues(t){const{cell:e,values:i,displayValues:o,propertyCell:r}=t,n=[],s=[],a=0===i.length||0===i[0].length;let l,c;const h=a?null:new iv(e.c,e.r,e.c+i[0].length-1,e.r+i.length-1);if(e.spillRange&&this.getRangeIterator(e.spillRange,!0).forEach((t=>{e==t||h?.contains(t.range)||t.clearSpilledValue()})),e.spillRange=h,a)return{cells:n,oldValues:s,range:null};for(let t=h.r1;t<=h.r2;t++){if(l=this.rows[t],!l)continue;const a=t-h.r1;for(let t=h.c1;t<=h.c2;t++){const d=t-h.c1;c=l.cell(t),c.editable&&(s.push(c.value2),c.spillValue(i[a][d],e),r&&(c.format=r.format,c.type=r.type),o&&null!=o[a][d]&&(c.displayValue=o[a][d]),n.push(c))}}return{cells:n,oldValues:s,range:h}}getCellByName(t,e,i=!0){return this.names.getCellByName(t,e)||(this.group&&i?this.group.getCellByName(t,e):null)}getRangeByName(t,e=!0){return this.names.getRangeByName(t)||(this.group&&e?this.group.getRangeByName(t):null)}getValueMatrixByName(t,e=!0){const i=this.names.getRangeByName(t);return i?this.getValueMatrix(i):this.group&&e?this.group.getValueMatrixByName(t):null}rebuildRowTree(){const t=this._levelBasedRowTree?Ir:Rr;this._maxRowLevel=t(this.rows,this.rowRoot,{reverse:this.options.rowTree.reversed}),this.indexRowsByTree()}rebuildColumnTree(){const t=this._levelBasedColTree?Ir:Rr;this._maxColumnLevel=t(this.columns,this.colRoot,{reverse:this.options.columnTree.reversed}),this.indexColumns()}calculateCellOffset(t){let e=0,i=0;for(let i=0;i<t.c1&&this.columns[i];i++)e+=this.columns[i].width;for(let e=0;e<t.r1&&this.rows[e];e++)i+=this.rows[e].height;return{x:e,y:i}}}class Kw{get errors(){return this._errors}get(t){return this.models.get(t)}has(t){return this.models.has(t)}getNewName(){let t;do{t=`sheet${this._max}`}while(this.models.has(t));return t}add(t){if(t.index=t.index??this._max,++this._max,t.name=t.name||this.getNewName(),this.models.has(t.name))throw Error(`sheet "${t.name}" already exists`);return this.models.set(t.name,t),t.group=this,t}duplicate(t){const e=this.get(t);if(!e)return;const i=new Qw(e.getSourceData(),e.options);let o=1;for(;this.models.has(`${t}_${o}`);)++o;return i.name=`${t}_${o}`,this.add(i),i}remove(t){return this.models.delete(t),this}rename(t,e){if(this.has(t)){if(this.has(e))throw new Error(`Model '${e}' already exists`);const i=this.get(t);i.name=e,this.models.set(e,i),this.models.delete(t),this.models.forEach((i=>{i.calculations.renameSheet(t,e)&&i.calculateViewport()}))}return this}clear(){this.models.clear(),this._errors=[]}constructor(t){this._max=0,this.models=new Map,this.themes=new Map,this._errors=[],t&&this.populate(t)}populate(t){this.clear(),t.models.forEach((t=>{const e=new Qw(t);try{this.add(e)}catch(t){this.errors.push(t)}})),t.themes&&t.themes.forEach((t=>this.themes.set(t.name,t)))}getSourceData(){const t={models:[]};return this.models.forEach((e=>t.models.push(e.getSourceData()))),t}getCellByName(t,e){for(const i of this.models.values()){const o=i.getCellByName(t,e,!1);if(o)return o}return null}getRangeByName(t){for(const e of this.models.values()){const i=e.getRangeByName(t,!1);if(i)return i}return null}getValueMatrixByName(t){for(const e of this.models.values()){const i=e.getValueMatrixByName(t,!1);if(i)return i}return null}}class Jw{constructor(t){this.model=t,this.stack=[],this.restack=[]}push(t){return this.restack=[],t.timestamp||(t.timestamp=Date.now()),this.stack.push(t),this}pop(t=1){let e=0;const i=[];for(;e++<t&&this.stack.length>0;){const t=this.stack.pop();i.push(t),this.restack.push(t)}return i}pop2(t=1){let e=0;const i=[];for(;e++<t&&this.restack.length>0;){const t=this.restack.pop();i.push(t),this.stack.push(t)}return i}}class tx{get activeCellCoords(){return{c:this.range.c1+this.activeCell.c1,r:this.range.r1+this.activeCell.r1}}constructor(t,e,i,o){this.hidden=!1,this.range=new iv(t,e,i,o),this.activeCell=new iv(0,0)}static fromRange(t){return new tx(t.c1,t.r1,t.c2,t.r2)}setCoords(t,e,i,o){this.range.setCoords(t,e,i,o),this.activeCell.setCoords(0,0)}setRange(t){"string"==typeof t&&(t=iv.fromA1(t)),this.range.setCoords(t.c1,t.r1,t.c2,t.r2),this.activeCell.setCoords(0,0)}move(t,e,i,o){this.range.setCoords(this.range.c1+this.activeCell.c1,this.range.r1+this.activeCell.r1,this.range.c1+this.activeCell.c2,this.range.r1+this.activeCell.r2),this.range.move(t,e,i,o,!1),this.activeCell.setCoords(0,0)}moveRange(t,e,i,o){this.range.move(t,e,i,o,!0)}moveActiveCell(t,e){const{columns:i,rows:o}=this.range.size;this.activeCell.move(t,e,i,o,!0)}}const ex={...$f,CUSTOM_CLIPBOARD_TYPE:"web application/json"};class ix{constructor(t,e,i=ex.MAX_CACHE_ITEMS){this.maxCacheItems=i,this.queue=[],this.disabled=!1,this.table=new Array(e).fill(null).map((()=>new Array(t)))}get(t,e){return this.table[e][t]}delete(t,e){return this.table[e][t]=null,this}deleteColumn(t){for(let e=0;e<this.table.length;e++)this.table[e][t]=null;return this}deleteRow(t){return this.table[t]=new Array(this.table[0].length).fill(null),this}set(t,e,i){this.disabled||(this.get(t,e)||this.queue.push([e,t]),this.table[e][t]=i)}clear(){this.queue=[],this.table=this.table.map((t=>new Array(t.length)))}clean(){if(this.maxCacheItems>0&&this.queue.length>this.maxCacheItems){let t=this.queue.length;for(let e=0;e<this.queue.length;e++){const i=this.queue[e];if(!this.table[i[0]][i[1]].parentNode&&(this.queue[e]=null,this.table[i[0]][i[1]]=null,--t<=this.maxCacheItems))break}t<this.queue.length&&(this.queue=this.queue.filter((t=>t)))}}}var ox=function(t,e,i,o){var r,n=arguments.length,s=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s};let rx=class extends xs{constructor(){super(),this.render=()=>es`
|
|
3435
3435
|
<og-icon id="filterIcon" .icon="${{icon:"filter"}}"></og-icon>
|
|
3436
3436
|
<div class="text">${Y(this.value)?es`
|
|
3437
3437
|
<og-icon .icon="${this.value?"square-check":"square"}"></og-icon>
|
|
@@ -4459,7 +4459,7 @@
|
|
|
4459
4459
|
</og-button>
|
|
4460
4460
|
`))}
|
|
4461
4461
|
</div>
|
|
4462
|
-
`,t),zk.call(this,t,e)},h:function(t,e,i){return t.innerHTML=e.value,zk.call(this,t,e,i)}};function Nk(t){return t.renderer||Dk[t.type]||$k}class Pk extends Gd{getCells(t){return null}getStyles(){return null}getRules(){return null}getComments(){return null}getSparklines(){return null}getOptions(){return null}}function jk(t,e){const i=ce(),o=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,r=ne(t),n=r.getDay(),s=6+(n<o?-7:0)-(n-o);return r.setDate(r.getDate()+s),r.setHours(23,59,59,999),r}const Hk={minDate:new Date(1900,0,1,0,0,0),maxDate:new Date(2100,11,31,0,0,0),weekStart:1,todayButton:!0,controlsPosition:"top"};function Bk(t,e=null){const i={...en(t,e),...Hk,...e,...t};return i.minDate=fi(i.minDate,{weekStartsOn:i.weekStart}),i.maxDate=jk(i.maxDate,{weekStartsOn:i.weekStart}),i}function Fk(t,e){const i=ne(t.start),o=ne(t.end);let r=+i>+o;const n=r?+i:+o,s=r?o:i;s.setHours(0,0,0,0);let a=e?.step??1;if(!a)return[];a<0&&(a=-a,r=!r);const l=[];for(;+s<=n;)l.push(ne(s)),s.setDate(s.getDate()+a),s.setHours(0,0,0,0);return r?l.reverse():l}function Wk(t){return Math.ceil(co(t.maxDate,t.minDate)/7)}function Vk(t,e,i){return Um(i.minDate,{days:7*t+e})}function Uk(t,e){return{row:Math.floor(co(t,e.minDate)/7),column:co(t,e.minDate)%7}}const Gk=t=>(t=>null!=t?._$litType$?.h)(t)?t._$litType$.h:t.strings,qk=Us(class extends Gs{constructor(t){super(t),this.et=new WeakMap}render(t){return[t]}update(t,[e]){const i=js(this.it)?Gk(this.it):null,o=js(e)?Gk(e):null;if(null!==i&&(null===o||i!==o)){const e=Vs(t).pop();let o=this.et.get(i);if(void 0===o){const t=document.createDocumentFragment();o=ws(rs,t),o.setConnected(!1),this.et.set(i,o)}Ws(o,[e]),Bs(o,void 0,e)}if(null!==o){if(null===i||i!==o){const e=this.et.get(o);if(void 0!==e){const i=Vs(e).pop();(t=>{t._$AR()})(t),Bs(t,void 0,i),Ws(t,[i])}}this.it=e}else this.it=void 0;return this.render(e)}});var Yk,Zk,Xk,Qk,Kk,Jk,tC,eC,iC,oC,rC,nC,sC,aC,lC=function(t,e,i,o){var r,n=arguments.length,s=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s},cC=function(t,e,i,o){if("a"===i&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?o:"a"===i?o.call(t):o?o.value:e.get(t)},hC=function(t,e,i,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(t,i):r?r.value=i:e.set(t,i),i};let dC=class extends Zd{constructor(){super(...arguments),Yk.add(this),this.date=se(new Date),this.year=(new Date).getFullYear(),this.month=(new Date).getMonth()+1,Zk.set(this,void 0),Xk.set(this,(()=>this.dispatchEvent(new qr({value:this.date})))),Qk.set(this,(()=>this.body.clientWidth/7)),Kk.set(this,(()=>(this.body.clientHeight-Rf.HEADER_HEIGHT)/6)),Jk.set(this,void 0),tC.set(this,!1),eC.set(this,void 0),iC.set(this,((t,e)=>{const i=Vk(e.r,e.c,this.options);
|
|
4462
|
+
`,t),zk.call(this,t,e)},h:function(t,e,i){return t.innerHTML=e.value,zk.call(this,t,e,i)}};function Nk(t){return t.renderer||Dk[t.type]||$k}class Pk extends Gd{getCells(t){return null}getStyles(){return null}getRules(){return null}getComments(){return null}getSparklines(){return null}getOptions(){return null}}function jk(t,e){const i=ce(),o=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,r=ne(t),n=r.getDay(),s=6+(n<o?-7:0)-(n-o);return r.setDate(r.getDate()+s),r.setHours(23,59,59,999),r}const Hk={minDate:new Date(1900,0,1,0,0,0),maxDate:new Date(2100,11,31,0,0,0),weekStart:1,todayButton:!0,controlsPosition:"top"};function Bk(t,e=null){const i={...en(t,e),...Hk,...e,...t};return i.minDate=fi(i.minDate,{weekStartsOn:i.weekStart}),i.maxDate=jk(i.maxDate,{weekStartsOn:i.weekStart}),i}function Fk(t,e){const i=ne(t.start),o=ne(t.end);let r=+i>+o;const n=r?+i:+o,s=r?o:i;s.setHours(0,0,0,0);let a=e?.step??1;if(!a)return[];a<0&&(a=-a,r=!r);const l=[];for(;+s<=n;)l.push(ne(s)),s.setDate(s.getDate()+a),s.setHours(0,0,0,0);return r?l.reverse():l}function Wk(t){return Math.ceil(co(t.maxDate,t.minDate)/7)}function Vk(t,e,i){return Um(i.minDate,{days:7*t+e})}function Uk(t,e){return{row:Math.floor(co(t,e.minDate)/7),column:co(t,e.minDate)%7}}const Gk=t=>(t=>null!=t?._$litType$?.h)(t)?t._$litType$.h:t.strings,qk=Us(class extends Gs{constructor(t){super(t),this.et=new WeakMap}render(t){return[t]}update(t,[e]){const i=js(this.it)?Gk(this.it):null,o=js(e)?Gk(e):null;if(null!==i&&(null===o||i!==o)){const e=Vs(t).pop();let o=this.et.get(i);if(void 0===o){const t=document.createDocumentFragment();o=ws(rs,t),o.setConnected(!1),this.et.set(i,o)}Ws(o,[e]),Bs(o,void 0,e)}if(null!==o){if(null===i||i!==o){const e=this.et.get(o);if(void 0!==e){const i=Vs(e).pop();(t=>{t._$AR()})(t),Bs(t,void 0,i),Ws(t,[i])}}this.it=e}else this.it=void 0;return this.render(e)}});var Yk,Zk,Xk,Qk,Kk,Jk,tC,eC,iC,oC,rC,nC,sC,aC,lC=function(t,e,i,o){var r,n=arguments.length,s=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s},cC=function(t,e,i,o){if("a"===i&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?o:"a"===i?o.call(t):o?o.value:e.get(t)},hC=function(t,e,i,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(t,i):r?r.value=i:e.set(t,i),i};let dC=class extends Zd{constructor(){super(...arguments),Yk.add(this),this.date=se(new Date),this.year=(new Date).getFullYear(),this.month=(new Date).getMonth()+1,Zk.set(this,void 0),Xk.set(this,(()=>this.dispatchEvent(new qr({value:this.date})))),Qk.set(this,(()=>this.body.clientWidth/7)),Kk.set(this,(()=>(this.body.clientHeight-Rf.HEADER_HEIGHT)/6)),Jk.set(this,void 0),tC.set(this,!1),eC.set(this,void 0),iC.set(this,((t,e)=>{const i=Vk(e.r,e.c,this.options);t.innerHTML=ro(i,"d"),t.style.lineHeight=Dt(e.row.height),t.style.textAlign="center";const o=i.getMonth();return null==cC(this,eC,"f")&&(hC(this,eC,(o+(i.getDate()<10?0:1))%12,"f"),this.month=cC(this,eC,"f")+1,i.setDate(i.getDate()+10),this.year=i.getFullYear()),cC(this,eC,"f")==o?t.style.backgroundColor="initial":t.style.backgroundColor="var(--og-background-color-3)",t})),nC.set(this,(t=>{t.selection.activeCell&&this.updateDate(Vk(t.selection.range.r1,t.selection.range.c1,this.options))})),sC.set(this,(()=>hC(this,eC,null,"f"))),aC.set(this,(async()=>{this.month=this.monthDropdown.value,this.year=this.yearDropdown.value,await this.updateComplete,this.gotoCurrentSelection()})),this.renderControls=()=>es`
|
|
4463
4463
|
<div class="header">
|
|
4464
4464
|
${this.date?es`
|
|
4465
4465
|
<og-button
|
|
@@ -9040,4 +9040,4 @@ milkdown-block-handle {
|
|
|
9040
9040
|
`:null}
|
|
9041
9041
|
</div>
|
|
9042
9042
|
</og-panel>
|
|
9043
|
-
`:null,this.addEventListener("mousedown",(t=>t.stopPropagation()))}getTypeIndex(t){const e=this.types.findIndex((e=>e.type==t.type&&e.grouping==(t.grouping||"standard")));return e>-1?e:null}updateModel(){if(this.editTitle=!1,!this.model)return;this.titleInput&&(this.model.title=this.titleInput.value);const t=this.types[this.typeList.value];this.model.type=t.type,this.model.grouping=t.grouping,this.model.categoriesRange=this.categoryRangeInput?.value?iv.fromA1(this.categoryRangeInput.value):null,this.model.seriesRange=this.seriesRangeInput?.value?iv.fromA1(this.seriesRangeInput.value):null,this.model.dataRange=iv.fromA1(this.dataRangeInput.value),this.dispatchEvent(new qr({value:this.model}))}async updated(){this.editTitle&&this.titleInput&&(await this.titleInput.updateComplete,this.titleInput.focus(),this.titleInput.selectAll())}};Rz.styles=[Lz],Iz([Ss({type:Object})],Rz.prototype,"model",void 0),Iz([Es()],Rz.prototype,"editTitle",void 0),Iz([Ls("#title")],Rz.prototype,"titleInput",void 0),Iz([Ls("#type")],Rz.prototype,"typeList",void 0),Iz([Ls("#dataRange")],Rz.prototype,"dataRangeInput",void 0),Iz([Ls("#seriesRange")],Rz.prototype,"seriesRangeInput",void 0),Iz([Ls("#categoryRange")],Rz.prototype,"categoryRangeInput",void 0),Rz=Iz([Cs("og-plugin-chart-form")],Rz);const Tz=Aa().themes.get("dark");Object.assign(Tz.definition,{"highcharts-title-font-size":"16px","highcharts-subtitle-font-size":"14px","highcharts-color-0":"#2caffe","highcharts-color-1":"#544fc5","highcharts-color-2":"#00e272","highcharts-color-3":"#fe6a35","highcharts-color-4":"#6b8abc","highcharts-color-5":"#d568fb","highcharts-color-6":"#2ee0ca","highcharts-color-7":"#fa4b42","highcharts-color-8":"#feb56a","highcharts-color-9":"#91e8e1","highcharts-background-color":"rgb(48, 48, 48)","highcharts-neutral-color-100":"rgb(255, 255, 255)","highcharts-neutral-color-80":"rgb(214, 214, 214)","highcharts-neutral-color-60":"rgb(173, 173, 173)","highcharts-neutral-color-40":"rgb(133, 133, 133)","highcharts-neutral-color-20":"rgb(92, 92, 92)","highcharts-neutral-color-10":"rgb(71, 71, 71)","highcharts-neutral-color-5":"rgb(61, 61, 61)","highcharts-neutral-color-3":"rgb(57, 57, 57)","highcharts-highlight-color-100":"rgb(122, 167, 255)","highcharts-highlight-color-80":"rgb(108, 144, 214)","highcharts-highlight-color-60":"rgb(94, 121, 173)","highcharts-highlight-color-20":"rgb(65, 74, 92)","highcharts-highlight-color-10":"rgb(58, 63, 71)"});const Az=Aa().themes.get("light");Object.assign(Az.definition,{"highcharts-title-font-size":"16px","chart-background-color":"#2a2a2b","highcharts-color-0":"#2caffe","highcharts-color-1":"#544fc5","highcharts-color-2":"#00e272","highcharts-color-3":"#fe6a35","highcharts-color-4":"#6b8abc","highcharts-color-5":"#d568fb","highcharts-color-6":"#2ee0ca","highcharts-color-7":"#fa4b42","highcharts-color-8":"#feb56a","highcharts-color-9":"#91e8e1","highcharts-background-color":"#ffffff","highcharts-neutral-color-100":"#000000","highcharts-neutral-color-80":"#333333","highcharts-neutral-color-60":"#666666","highcharts-neutral-color-40":"#999999","highcharts-neutral-color-20":"#cccccc","highcharts-neutral-color-10":"#e6e6e6","highcharts-neutral-color-5":"#f2f2f2","highcharts-neutral-color-3":"#f7f7f7","highcharts-highlight-color-100":"#0022ff","highcharts-highlight-color-80":"#334eff","highcharts-highlight-color-60":"#667aff","highcharts-highlight-color-20":"#ccd3ff","highcharts-highlight-color-10":"#e6e9ff","highcharts-positive-color":"#06b535","highcharts-negative-color":"#f21313","highcharts-annotation-color-0":"rgba(130, 170, 255, 0.4)","highcharts-annotation-color-1":"rgba(139, 191, 216, 0.4)","highcharts-annotation-color-2":"rgba(150, 216, 192, 0.4)","highcharts-annotation-color-3":"rgba(156, 229, 161, 0.4)","highcharts-annotation-color-4":"rgba(162, 241, 130, 0.4)","highcharts-annotation-color-5":"rgba(169, 255, 101, 0.4)"});var Oz=i(6946),$z=i(6471),Dz=i(4969),Nz=i(9502),Pz=i(7706),jz=i(1480),Hz=i(2006),Bz=i(7503),Fz=i(8746),Wz=i(2570),Vz=i(8815),Uz=i(6390),Gz=i(6593),qz=i(895),Yz=i(9083),Zz=i(6093),Xz=i(9685),Qz=i(9849),Kz=i(8268),Jz=i(4693),tL=i(3599),eL=i(782),iL=i(754),oL=i(5700),rL=i(4731),nL=i(7291),sL=i(597),aL=i(1474),lL=i(6224),cL=i(6239),hL=i(6828),dL=i(2212),uL=i(863),pL=i(3602),gL=i(1985),mL=i(886),fL=i(7201),vL=i(9937),bL=i(8450),yL=i(9630),wL=i(9766),xL=i(388),kL=i(1903),CL=i(398),ML=i(6105),_L=i(6147),SL=i(5722),EL=i(5576),zL=i(3131),LL=i(6308),IL=i(9645),RL=i(3199),TL=i(871),AL=i(5251),OL=i(6426),$L=i(2643),DL=i(8522),NL=i(6398),PL=i(2525),jL=i(8434),HL=i(6138),BL=i(5835),FL=i(5654),WL=i(6659),VL=i(2977),UL=i(4480),GL=i(9886),qL=i(6815),YL=i(1582),ZL=i(2968),XL=i(394),QL=i(7024),KL=i(7853),JL=i(8249),tI=i(2869),eI=i(486),iI=i(5735),oI=i(470),rI=i(4612),nI=i(4018),sI=i(1476),aI=i(3194),lI=i(3525),cI=i(7541),hI=i(4104),dI=i(6686),uI=i(7719),pI=i(3898),gI=i(8153),mI=i(3690),fI=i(1776),vI=i(4980),bI=i(5578),yI=i(9613),wI=i(1119),xI=i(8444),kI=i(2978),CI=i(9130),MI=i(2127),_I=i(2732),SI=i(4287),EI=i(4045),zI=i(7642),LI=i(1367),II=i(320),RI=i(821),TI=i(102),AI=i(7683),OI=i(3980),$I=i(576),DI=i(654),NI=i(73),PI=i(140),jI=i(8129),HI=i(5087),BI=i(6992),FI=i(8247),WI=i(8038),VI=i(5286),UI=i(9179),GI=i(1808),qI=i(9459),YI=i(2883),ZI=i(9111),XI=i(9318),QI=i(7294),KI=i(4479),JI=i(2409),tR=i(3091),eR=i(5789),iR=i(5890),oR=i(2907),rR=i(1175),nR=i(1686),sR=i(703),aR=i(6606),lR=i(4194),cR=i(6228),hR=i(62),dR=i(2072),uR=i(9744),pR=i(25),gR=i(2618),mR=i(1988),fR=i(8013),vR=i(1133),bR=i(362),yR=i(6845),wR=i(6800),xR=i(1103),kR=i(4933),CR=i(7284),MR=i(2620),_R=i(2366),SR=i(7457),ER=i(2449),zR=i(2),LR=i(5697),IR=i(7069),RR=i(4716),TR=i(4740),AR=i(4557),OR=i(1868),$R=i(8647),DR=i(5127),NR=i(4816),PR=i(4009),jR=i(5104),HR=i(2830),BR=i(3093),FR=i(5029),WR=i(3514),VR=i(2142),UR=i(4999),GR=i(7523),qR=i(346),YR=i(7917),ZR=i(3976),XR=i(9801),QR=i(2464),KR=i(5511),JR=i(5210),tT=i(5815),eT=i(3339),iT=i(7472),oT=i(8811),rT=i(8548),nT=i(6880),sT=i(1840),aT=i(5547),lT=i(4788),cT=i(9467),hT=i(9187),dT=i(9217),uT=i(7897),pT=i(2644),gT=i(6204),mT=i(1472),fT=i(1247),vT=i(7406),bT=i(925),yT=i(7455),wT=i(3771),xT=i(1549),kT=i(3541),CT=i(3140),MT=i(9800),_T=i(229),ST=i(2677),ET=i(1844),zT=i(3245),LT=i(9056),IT=i(7535),RT=i(2359),TT=i(15),AT=i(5569),OT=i(2014),$T=i(1599),DT=i(6521),NT=i(232),PT=i(9745),jT=i(9594),HT=i(6979),BT=i(4494),FT=i(312),WT=i(4983),VT=i(1258),UT=i(6313),GT=i(12),qT=i(8003),YT=i(7830),ZT=i(8875),XT=i(3911),QT=i(1817),KT=i(478),JT=i(2585),tA=i(6564),eA=i(2884),iA=i(3825),oA=i(7348),rA=i(9277),nA=i(4118),sA=i(9200),aA=i(51),lA=i(2872),cA=i(4702);const hA=[Oz.mw,$z.mw,Dz.mw,Nz.mw,Pz.mw,jz.mw,Hz.mw,Bz.mw,Fz.mw,Vz.mw,Wz.mw,Uz.mw,Gz.mw,qz.mw,Yz.mw,Zz.mw,Xz.mw,Qz.mw,Kz.mw,Jz.mw,tL.mw,eL.mw,iL.mw,oL.mw,rL.mw,nL.mw,sL.mw,aL.mw,lL.mw,hL.mw,dL.mw,uL.mw,pL.mw,gL.mw,mL.mw,fL.mw,vL.mw,bL.mw,yL.mw,wL.mw,xL.mw,kL.mw,ML.mw,CL.mw,_L.mw,SL.mw,EL.mw,zL.mw,LL.mw,IL.mw,RL.mw,TL.mw,AL.mw,OL.mw,$L.mw,DL.mw,PL.mw,jL.mw,HL.mw,BL.mw,FL.mw,WL.mw,VL.mw,UL.mw,GL.mw,qL.mw,YL.mw,ZL.mw,XL.mw,QL.mw,KL.mw,JL.mw,tI.mw,eI.mw,iI.mw,NL.mw,oI.mw,rI.mw,nI.mw,sI.mw,aI.mw,lI.mw,cI.mw,hI.mw,dI.mw,uI.mw,pI.mw,gI.mw,mI.mw,fI.mw,vI.mw,bI.mw,yI.mw,wI.mw,xI.mw,kI.mw,CI.mw,MI.mw,_I.mw,SI.mw,EI.mw,zI.mw,LI.mw,II.mw,RI.mw,TI.mw,AI.mw,OI.mw,$I.mw,DI.mw,NI.mw,PI.mw,jI.mw,HI.mw,BI.mw,FI.mw,WI.mw,cL.mw,VI.mw,UI.mw,GI.mw,qI.mw,YI.mw],dA=[ZI.mw,XI.mw,QI.mw,KI.mw,JI.mw,tR.mw,eR.mw,iR.mw,oR.mw,nR.mw,rR.mw,aR.mw,sR.mw,lR.mw,cR.mw,hR.mw,dR.mw,uR.mw,pR.mw,gR.mw,mR.mw,fR.mw,xR.mw,kR.mw,CR.mw,MR.mw,_R.mw,SR.mw,ER.mw,LR.mw,IR.mw,RR.mw,DR.mw,NR.mw,PR.mw,jR.mw,HR.mw,BR.mw,FR.mw,WR.mw,vR.mw,bR.mw,wR.mw,yR.mw,VR.mw,UR.mw,GR.mw,qR.mw,YR.mw,ZR.mw,XR.mw,QR.mw,TR.mw,AR.mw,OR.mw,$R.mw,JR.mw,tT.mw,eT.mw,iT.mw,oT.mw,rT.mw,nT.mw,sT.mw,aT.mw,lT.mw,cT.mw,hT.mw,dT.mw,uT.mw,pT.mw,gT.mw,mT.mw,fT.mw,vT.mw,KR.mw,bT.mw,yT.mw,wT.mw,xT.mw,kT.mw,CT.mw,MT.mw,_T.mw,ST.mw,ET.mw,zT.mw,LT.mw,IT.mw,RT.mw,TT.mw,AT.mw,OT.mw,$T.mw,DT.mw,NT.mw,PT.mw,jT.mw,HT.mw,BT.mw,FT.mw,WT.mw,VT.mw,UT.mw,GT.mw,qT.mw,YT.mw,ZT.mw,XT.mw,QT.mw,KT.mw,JT.mw,tA.mw,eA.mw,iA.mw,oA.mw,rA.mw,zR.mw,nA.mw,sA.mw,aA.mw,lA.mw,cA.mw],uA={xlsx:B,charts:F},pA={name:"@omegagrid/bundle",version:"0.7.
|
|
9043
|
+
`:null,this.addEventListener("mousedown",(t=>t.stopPropagation()))}getTypeIndex(t){const e=this.types.findIndex((e=>e.type==t.type&&e.grouping==(t.grouping||"standard")));return e>-1?e:null}updateModel(){if(this.editTitle=!1,!this.model)return;this.titleInput&&(this.model.title=this.titleInput.value);const t=this.types[this.typeList.value];this.model.type=t.type,this.model.grouping=t.grouping,this.model.categoriesRange=this.categoryRangeInput?.value?iv.fromA1(this.categoryRangeInput.value):null,this.model.seriesRange=this.seriesRangeInput?.value?iv.fromA1(this.seriesRangeInput.value):null,this.model.dataRange=iv.fromA1(this.dataRangeInput.value),this.dispatchEvent(new qr({value:this.model}))}async updated(){this.editTitle&&this.titleInput&&(await this.titleInput.updateComplete,this.titleInput.focus(),this.titleInput.selectAll())}};Rz.styles=[Lz],Iz([Ss({type:Object})],Rz.prototype,"model",void 0),Iz([Es()],Rz.prototype,"editTitle",void 0),Iz([Ls("#title")],Rz.prototype,"titleInput",void 0),Iz([Ls("#type")],Rz.prototype,"typeList",void 0),Iz([Ls("#dataRange")],Rz.prototype,"dataRangeInput",void 0),Iz([Ls("#seriesRange")],Rz.prototype,"seriesRangeInput",void 0),Iz([Ls("#categoryRange")],Rz.prototype,"categoryRangeInput",void 0),Rz=Iz([Cs("og-plugin-chart-form")],Rz);const Tz=Aa().themes.get("dark");Object.assign(Tz.definition,{"highcharts-title-font-size":"16px","highcharts-subtitle-font-size":"14px","highcharts-color-0":"#2caffe","highcharts-color-1":"#544fc5","highcharts-color-2":"#00e272","highcharts-color-3":"#fe6a35","highcharts-color-4":"#6b8abc","highcharts-color-5":"#d568fb","highcharts-color-6":"#2ee0ca","highcharts-color-7":"#fa4b42","highcharts-color-8":"#feb56a","highcharts-color-9":"#91e8e1","highcharts-background-color":"rgb(48, 48, 48)","highcharts-neutral-color-100":"rgb(255, 255, 255)","highcharts-neutral-color-80":"rgb(214, 214, 214)","highcharts-neutral-color-60":"rgb(173, 173, 173)","highcharts-neutral-color-40":"rgb(133, 133, 133)","highcharts-neutral-color-20":"rgb(92, 92, 92)","highcharts-neutral-color-10":"rgb(71, 71, 71)","highcharts-neutral-color-5":"rgb(61, 61, 61)","highcharts-neutral-color-3":"rgb(57, 57, 57)","highcharts-highlight-color-100":"rgb(122, 167, 255)","highcharts-highlight-color-80":"rgb(108, 144, 214)","highcharts-highlight-color-60":"rgb(94, 121, 173)","highcharts-highlight-color-20":"rgb(65, 74, 92)","highcharts-highlight-color-10":"rgb(58, 63, 71)"});const Az=Aa().themes.get("light");Object.assign(Az.definition,{"highcharts-title-font-size":"16px","chart-background-color":"#2a2a2b","highcharts-color-0":"#2caffe","highcharts-color-1":"#544fc5","highcharts-color-2":"#00e272","highcharts-color-3":"#fe6a35","highcharts-color-4":"#6b8abc","highcharts-color-5":"#d568fb","highcharts-color-6":"#2ee0ca","highcharts-color-7":"#fa4b42","highcharts-color-8":"#feb56a","highcharts-color-9":"#91e8e1","highcharts-background-color":"#ffffff","highcharts-neutral-color-100":"#000000","highcharts-neutral-color-80":"#333333","highcharts-neutral-color-60":"#666666","highcharts-neutral-color-40":"#999999","highcharts-neutral-color-20":"#cccccc","highcharts-neutral-color-10":"#e6e6e6","highcharts-neutral-color-5":"#f2f2f2","highcharts-neutral-color-3":"#f7f7f7","highcharts-highlight-color-100":"#0022ff","highcharts-highlight-color-80":"#334eff","highcharts-highlight-color-60":"#667aff","highcharts-highlight-color-20":"#ccd3ff","highcharts-highlight-color-10":"#e6e9ff","highcharts-positive-color":"#06b535","highcharts-negative-color":"#f21313","highcharts-annotation-color-0":"rgba(130, 170, 255, 0.4)","highcharts-annotation-color-1":"rgba(139, 191, 216, 0.4)","highcharts-annotation-color-2":"rgba(150, 216, 192, 0.4)","highcharts-annotation-color-3":"rgba(156, 229, 161, 0.4)","highcharts-annotation-color-4":"rgba(162, 241, 130, 0.4)","highcharts-annotation-color-5":"rgba(169, 255, 101, 0.4)"});var Oz=i(6946),$z=i(6471),Dz=i(4969),Nz=i(9502),Pz=i(7706),jz=i(1480),Hz=i(2006),Bz=i(7503),Fz=i(8746),Wz=i(2570),Vz=i(8815),Uz=i(6390),Gz=i(6593),qz=i(895),Yz=i(9083),Zz=i(6093),Xz=i(9685),Qz=i(9849),Kz=i(8268),Jz=i(4693),tL=i(3599),eL=i(782),iL=i(754),oL=i(5700),rL=i(4731),nL=i(7291),sL=i(597),aL=i(1474),lL=i(6224),cL=i(6239),hL=i(6828),dL=i(2212),uL=i(863),pL=i(3602),gL=i(1985),mL=i(886),fL=i(7201),vL=i(9937),bL=i(8450),yL=i(9630),wL=i(9766),xL=i(388),kL=i(1903),CL=i(398),ML=i(6105),_L=i(6147),SL=i(5722),EL=i(5576),zL=i(3131),LL=i(6308),IL=i(9645),RL=i(3199),TL=i(871),AL=i(5251),OL=i(6426),$L=i(2643),DL=i(8522),NL=i(6398),PL=i(2525),jL=i(8434),HL=i(6138),BL=i(5835),FL=i(5654),WL=i(6659),VL=i(2977),UL=i(4480),GL=i(9886),qL=i(6815),YL=i(1582),ZL=i(2968),XL=i(394),QL=i(7024),KL=i(7853),JL=i(8249),tI=i(2869),eI=i(486),iI=i(5735),oI=i(470),rI=i(4612),nI=i(4018),sI=i(1476),aI=i(3194),lI=i(3525),cI=i(7541),hI=i(4104),dI=i(6686),uI=i(7719),pI=i(3898),gI=i(8153),mI=i(3690),fI=i(1776),vI=i(4980),bI=i(5578),yI=i(9613),wI=i(1119),xI=i(8444),kI=i(2978),CI=i(9130),MI=i(2127),_I=i(2732),SI=i(4287),EI=i(4045),zI=i(7642),LI=i(1367),II=i(320),RI=i(821),TI=i(102),AI=i(7683),OI=i(3980),$I=i(576),DI=i(654),NI=i(73),PI=i(140),jI=i(8129),HI=i(5087),BI=i(6992),FI=i(8247),WI=i(8038),VI=i(5286),UI=i(9179),GI=i(1808),qI=i(9459),YI=i(2883),ZI=i(9111),XI=i(9318),QI=i(7294),KI=i(4479),JI=i(2409),tR=i(3091),eR=i(5789),iR=i(5890),oR=i(2907),rR=i(1175),nR=i(1686),sR=i(703),aR=i(6606),lR=i(4194),cR=i(6228),hR=i(62),dR=i(2072),uR=i(9744),pR=i(25),gR=i(2618),mR=i(1988),fR=i(8013),vR=i(1133),bR=i(362),yR=i(6845),wR=i(6800),xR=i(1103),kR=i(4933),CR=i(7284),MR=i(2620),_R=i(2366),SR=i(7457),ER=i(2449),zR=i(2),LR=i(5697),IR=i(7069),RR=i(4716),TR=i(4740),AR=i(4557),OR=i(1868),$R=i(8647),DR=i(5127),NR=i(4816),PR=i(4009),jR=i(5104),HR=i(2830),BR=i(3093),FR=i(5029),WR=i(3514),VR=i(2142),UR=i(4999),GR=i(7523),qR=i(346),YR=i(7917),ZR=i(3976),XR=i(9801),QR=i(2464),KR=i(5511),JR=i(5210),tT=i(5815),eT=i(3339),iT=i(7472),oT=i(8811),rT=i(8548),nT=i(6880),sT=i(1840),aT=i(5547),lT=i(4788),cT=i(9467),hT=i(9187),dT=i(9217),uT=i(7897),pT=i(2644),gT=i(6204),mT=i(1472),fT=i(1247),vT=i(7406),bT=i(925),yT=i(7455),wT=i(3771),xT=i(1549),kT=i(3541),CT=i(3140),MT=i(9800),_T=i(229),ST=i(2677),ET=i(1844),zT=i(3245),LT=i(9056),IT=i(7535),RT=i(2359),TT=i(15),AT=i(5569),OT=i(2014),$T=i(1599),DT=i(6521),NT=i(232),PT=i(9745),jT=i(9594),HT=i(6979),BT=i(4494),FT=i(312),WT=i(4983),VT=i(1258),UT=i(6313),GT=i(12),qT=i(8003),YT=i(7830),ZT=i(8875),XT=i(3911),QT=i(1817),KT=i(478),JT=i(2585),tA=i(6564),eA=i(2884),iA=i(3825),oA=i(7348),rA=i(9277),nA=i(4118),sA=i(9200),aA=i(51),lA=i(2872),cA=i(4702);const hA=[Oz.mw,$z.mw,Dz.mw,Nz.mw,Pz.mw,jz.mw,Hz.mw,Bz.mw,Fz.mw,Vz.mw,Wz.mw,Uz.mw,Gz.mw,qz.mw,Yz.mw,Zz.mw,Xz.mw,Qz.mw,Kz.mw,Jz.mw,tL.mw,eL.mw,iL.mw,oL.mw,rL.mw,nL.mw,sL.mw,aL.mw,lL.mw,hL.mw,dL.mw,uL.mw,pL.mw,gL.mw,mL.mw,fL.mw,vL.mw,bL.mw,yL.mw,wL.mw,xL.mw,kL.mw,ML.mw,CL.mw,_L.mw,SL.mw,EL.mw,zL.mw,LL.mw,IL.mw,RL.mw,TL.mw,AL.mw,OL.mw,$L.mw,DL.mw,PL.mw,jL.mw,HL.mw,BL.mw,FL.mw,WL.mw,VL.mw,UL.mw,GL.mw,qL.mw,YL.mw,ZL.mw,XL.mw,QL.mw,KL.mw,JL.mw,tI.mw,eI.mw,iI.mw,NL.mw,oI.mw,rI.mw,nI.mw,sI.mw,aI.mw,lI.mw,cI.mw,hI.mw,dI.mw,uI.mw,pI.mw,gI.mw,mI.mw,fI.mw,vI.mw,bI.mw,yI.mw,wI.mw,xI.mw,kI.mw,CI.mw,MI.mw,_I.mw,SI.mw,EI.mw,zI.mw,LI.mw,II.mw,RI.mw,TI.mw,AI.mw,OI.mw,$I.mw,DI.mw,NI.mw,PI.mw,jI.mw,HI.mw,BI.mw,FI.mw,WI.mw,cL.mw,VI.mw,UI.mw,GI.mw,qI.mw,YI.mw],dA=[ZI.mw,XI.mw,QI.mw,KI.mw,JI.mw,tR.mw,eR.mw,iR.mw,oR.mw,nR.mw,rR.mw,aR.mw,sR.mw,lR.mw,cR.mw,hR.mw,dR.mw,uR.mw,pR.mw,gR.mw,mR.mw,fR.mw,xR.mw,kR.mw,CR.mw,MR.mw,_R.mw,SR.mw,ER.mw,LR.mw,IR.mw,RR.mw,DR.mw,NR.mw,PR.mw,jR.mw,HR.mw,BR.mw,FR.mw,WR.mw,vR.mw,bR.mw,wR.mw,yR.mw,VR.mw,UR.mw,GR.mw,qR.mw,YR.mw,ZR.mw,XR.mw,QR.mw,TR.mw,AR.mw,OR.mw,$R.mw,JR.mw,tT.mw,eT.mw,iT.mw,oT.mw,rT.mw,nT.mw,sT.mw,aT.mw,lT.mw,cT.mw,hT.mw,dT.mw,uT.mw,pT.mw,gT.mw,mT.mw,fT.mw,vT.mw,KR.mw,bT.mw,yT.mw,wT.mw,xT.mw,kT.mw,CT.mw,MT.mw,_T.mw,ST.mw,ET.mw,zT.mw,LT.mw,IT.mw,RT.mw,TT.mw,AT.mw,OT.mw,$T.mw,DT.mw,NT.mw,PT.mw,jT.mw,HT.mw,BT.mw,FT.mw,WT.mw,VT.mw,UT.mw,GT.mw,qT.mw,YT.mw,ZT.mw,XT.mw,QT.mw,KT.mw,JT.mw,tA.mw,eA.mw,iA.mw,oA.mw,rA.mw,zR.mw,nA.mw,sA.mw,aA.mw,lA.mw,cA.mw],uA={xlsx:B,charts:F},pA={name:"@omegagrid/bundle",version:"0.7.10"};Aa().activate("light"),kd.styleDefault="fal",Cd.add(hA),Cd.add(dA)})(),window.Omegagrid=o})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omegagrid/bundle",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.10",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "Distribution package for Omegagrid library",
|
|
6
6
|
"main": "omegagrid.js",
|
|
@@ -19,23 +19,23 @@
|
|
|
19
19
|
"@fortawesome/fontawesome-svg-core": "^7.0.1",
|
|
20
20
|
"@fortawesome/pro-light-svg-icons": "^7.0.1",
|
|
21
21
|
"@fortawesome/pro-solid-svg-icons": "^7.0.1",
|
|
22
|
-
"@omegagrid/bucket": "^0.7.
|
|
23
|
-
"@omegagrid/calendar": "^0.7.
|
|
24
|
-
"@omegagrid/code": "^0.7.
|
|
25
|
-
"@omegagrid/commands": "^0.7.
|
|
26
|
-
"@omegagrid/core": "^0.7.
|
|
27
|
-
"@omegagrid/dialog": "^0.7.
|
|
28
|
-
"@omegagrid/editor": "^0.7.
|
|
29
|
-
"@omegagrid/form": "^0.7.
|
|
30
|
-
"@omegagrid/grid": "^0.7.
|
|
31
|
-
"@omegagrid/localize": "^0.7.
|
|
32
|
-
"@omegagrid/markdown": "^0.7.
|
|
33
|
-
"@omegagrid/plugin-charts": "^0.7.
|
|
34
|
-
"@omegagrid/plugin-xlsx": "^0.7.
|
|
35
|
-
"@omegagrid/statusbar": "^0.7.
|
|
36
|
-
"@omegagrid/tabs": "^0.7.
|
|
37
|
-
"@omegagrid/toolbar": "^0.7.
|
|
38
|
-
"@omegagrid/tree": "^0.7.
|
|
22
|
+
"@omegagrid/bucket": "^0.7.10",
|
|
23
|
+
"@omegagrid/calendar": "^0.7.10",
|
|
24
|
+
"@omegagrid/code": "^0.7.10",
|
|
25
|
+
"@omegagrid/commands": "^0.7.10",
|
|
26
|
+
"@omegagrid/core": "^0.7.10",
|
|
27
|
+
"@omegagrid/dialog": "^0.7.10",
|
|
28
|
+
"@omegagrid/editor": "^0.7.10",
|
|
29
|
+
"@omegagrid/form": "^0.7.10",
|
|
30
|
+
"@omegagrid/grid": "^0.7.10",
|
|
31
|
+
"@omegagrid/localize": "^0.7.10",
|
|
32
|
+
"@omegagrid/markdown": "^0.7.10",
|
|
33
|
+
"@omegagrid/plugin-charts": "^0.7.10",
|
|
34
|
+
"@omegagrid/plugin-xlsx": "^0.7.10",
|
|
35
|
+
"@omegagrid/statusbar": "^0.7.10",
|
|
36
|
+
"@omegagrid/tabs": "^0.7.10",
|
|
37
|
+
"@omegagrid/toolbar": "^0.7.10",
|
|
38
|
+
"@omegagrid/tree": "^0.7.10",
|
|
39
39
|
"lit": "^3.1.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|