@sheetxl/mcp 0.8.0-beta.14 → 0.8.0-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{DIy1659Yv5-fD69E.js → 9U9XCqqdn-q3i2fj.js} +1 -1
- package/assets/{2zIY9Xuml4y8NI05.js → B-MqXm_7luDLwazY.js} +1 -1
- package/assets/{DUYoUViqY5U6uQX3.js → B2Ek-DWpZMGJ0V1Z.js} +2 -2
- package/assets/{CH9M37mRwnS0t9wM.js → B2udpZ-uIaql3AUh.js} +5 -5
- package/assets/{CHHJZPAuM3OjbzF6.js → B4VnJacrzr1x4PHR.js} +4 -4
- package/assets/{B5xHa5bjZu5ONrm5.js → B5lHOOQ_rkP4Mi2r.js} +1 -1
- package/assets/{DWTpPijG5yeNFR0W.js → B7gUyrfLln3TiyKM.js} +1 -1
- package/assets/{a7BoASyT8yQZY9hJ.js → B9US2ZrF93KOjmAx.js} +1 -1
- package/assets/{CdF5MxGnISAZ41oQ.js → BBb_3gEGzmEzbTIk.js} +24 -24
- package/assets/{33QTHR3r6ZujxFx8.js → BCy1zP97fsiIcvj6.js} +1 -1
- package/assets/{CwJyw5Yxpj4PGh14.js → BFXeoFUbuc4IKTz9.js} +1 -1
- package/assets/{D94hlZEaHtGHdN_K.js → BFdeov2e_xUQPEY_.js} +6 -6
- package/assets/{D3BAmD-1AfFtHdC6.js → BG5kgbDRXMc0re6W.js} +8 -8
- package/assets/{UX2ywz3gr7q-MlHr.js → BJxfinOazQqqByc-.js} +1 -1
- package/assets/{hRLLK6I6m0uGKWo8.js → BOPsJmq7v7HOKUkO.js} +5 -5
- package/assets/{DPazQ_nZv-sXUwO3.js → BPwmBu_aouERJjiW.js} +1 -1
- package/assets/{DkFK1iu4vqjLZMja.js → BQMDOjNBMjAx9WiW.js} +1 -1
- package/assets/{CBNNl8igIyeHY4St.js → BQbF1RkUH8WyXqSD.js} +1 -1
- package/assets/{DpGuA6U12gwyGHEM.js → BRzp6DEIYUgM3NkN.js} +3 -3
- package/assets/{W-MzzQHZuRxr8adc.js → BSxTn2BhkEEeF9x_.js} +2 -2
- package/assets/{CfiVUfpeONJ3rf31.js → BTQhJQ3e0hsiousD.js} +1 -1
- package/assets/{Doqy_uDSQTCv6a6X.js → BZPTaa0WjpoUAbgZ.js} +1 -1
- package/assets/{CPDkdp0yI4DwUHGZ.js → BbAmA46MhQSu3ZF_.js} +1 -1
- package/assets/{yNiBIhsMP9BCWd67.js → BbcUxIZe3YXywsQR.js} +1 -1
- package/assets/{QXKcNTuZqOauSidr.js → BeLr36oL3jmeXFFi.js} +1 -1
- package/assets/{9MRZ5Yc2RBgcqZSp.js → Bg95xYj5siqhHVEz.js} +2 -2
- package/assets/{DTlvhtB9hvPdbdxu.js → Bh0PNKlrR4VAqnP8.js} +5161 -5154
- package/assets/{ZBYHyJs7CQgnnHfR.js → BjqQjxBuoXza8oqg.js} +1 -1
- package/assets/{DSSrCrejjpWoszj7.js → BlPubAFi7DY7VrAo.js} +1 -1
- package/assets/{eHAVGCUcMAfNjEGt.js → BleMG0hAQgjE8fTa.js} +2 -2
- package/assets/{DoIU_ohoCBwTZV9G.js → Bn8D2bebQ2tFfwQt.js} +19 -19
- package/assets/{DUUt1z6Y_cpxEpYY.js → BrcQmHcE7Hcr1erJ.js} +1 -1
- package/assets/{B9qiPx_BXxo1jgcx.js → BsQZI1vXTRE63Zy-.js} +21 -21
- package/assets/{EeSGsbh_r4N-qs4w.js → BtjqpAKczftx91BQ.js} +1 -1
- package/assets/{BYtBi8vLoB41QkV8.js → Btys7KwtvV3hz2F6.js} +4 -4
- package/assets/{w8YWSMNTTn45ImnB.js → BuUEsifnQALe49uk.js} +1 -1
- package/assets/{CULV-2mwmqYYpAjM.js → By-7OWXShMlFFejV.js} +1 -1
- package/assets/{PmooYGqWqoTxPExF.js → C0CiMKC3lWK1z9p5.js} +2 -2
- package/assets/{aqguaobnu61szXWM.js → C2OrZ8LZ-TI6eYG0.js} +1 -1
- package/assets/{Dl87mJoXDkCkzBi7.js → C4z2IilWTuu2TWXw.js} +2 -2
- package/assets/{DBFXsbIHDxbMBrzV.js → C7ONfuYIWRmDu_vs.js} +1 -1
- package/assets/{ByziR0Anm39Bw0Bc.js → C7Z1li2XjWi6bkrp.js} +3 -3
- package/assets/{C1w8NQeox7_92swz.js → C97xDe_wBbLZh_uW.js} +1 -1
- package/assets/{BOcWUnxWSG1d5Ljc.js → CGBGyaCGdlZFQYK0.js} +1 -1
- package/assets/{DCHsM8bfVisYJFTT.js → CJ5WQnaoCsdr5gf4.js} +1 -1
- package/assets/{GnXTzeDYWWeEf5yV.js → CMK6tIDVqYYvK4GZ.js} +1 -1
- package/assets/{DK0VM9-qrEXBm8Ud.js → CMWAsUQ66V8fYrME.js} +2 -2
- package/assets/{CDGeuGB9CBXeCIm6.js → CNz3LdmvsOEJoLO9.js} +1 -1
- package/assets/{DZZ5R3msiytVNCqK.js → CWVWdbY1B1-WLl9k.js} +55 -55
- package/assets/{CeDqeFLuUfN8UIGx.js → CWl6oHiJxkNKRixk.js} +1 -1
- package/assets/{ddJqSu7gXUkXjGxZ.js → CXHslDxkWCuEcCSQ.js} +1 -1
- package/assets/{B6BP5l2qmeZhqVV7.js → CZTSZL3T_f-vSXqM.js} +2 -2
- package/assets/{DuZ6DXQGttY3Lrhd.js → CduNzsdbTigxH-ZK.js} +124 -124
- package/assets/{BFwNQZVRnbNt-gRJ.js → CecTe22WURiXbVdY.js} +1 -1
- package/assets/{CVFTQ0OwsUt03r4o.js → Cf2dcwmmmf13Rywg.js} +1 -1
- package/assets/{OU7gC5JF-lyDOOid.js → Cf9LpgZz-W5blzy_.js} +2 -2
- package/assets/{ThqyayHHaBxzfaAt.js → Cfhv_Yw_LT8VzAMt.js} +1 -1
- package/assets/{CjwzOAnab_dpAqiG.js → Cg51xaLRUkVOMdCZ.js} +1 -1
- package/assets/{B9w1dNK8pNq-Z1P3.js → ChWpsFGl-BYOnX_A.js} +1 -1
- package/assets/{CcLPa6zB5PH3OG2O.js → ClNQN3vEg5b5qUDp.js} +8 -8
- package/assets/{BiAEoWSl8c6jcUnS.js → Crt2kLdGIlBHANgg.js} +1 -1
- package/assets/{CMTDUipnLiOj5pbe.js → CudNpUD78SrtJIiy.js} +2 -2
- package/assets/{BmxgDCZk_aMDms4i.js → CvngwB17_ve4W49b.js} +27 -27
- package/assets/{Dfd7kvLIFNqu-m-r.js → CwPBmcY6xSP8dNlh.js} +11 -11
- package/assets/{PRSerWiAGYu8MVnd.js → CxjchwpiqxPM1XKd.js} +54 -54
- package/assets/{CtpcYuBFU6fxsUhs.js → D-ffk16w8c5w0mxI.js} +1 -1
- package/assets/{D81iH5MJJfq2t9FP.js → D0CHDsemn0S31ltt.js} +1 -1
- package/assets/{DUzaW_op2vBTwOOI.js → D7oUtYjetuykGhQ5.js} +1 -1
- package/assets/{DkPXpv81Y5teMd-R.js → D8J14MLlN2HRXdXB.js} +1 -1
- package/assets/{BW8XjynUqlfvuQUV.js → DA_ar3QKLKtJ9fJD.js} +1 -1
- package/assets/{CXM1IYmE-TDInPwr.js → DB-tkqI6wFXDKEfB.js} +1 -1
- package/assets/{C55MTJ_5qW94RElE.js → DD8HNAUFroTCuD-b.js} +96 -96
- package/assets/{CpOhY88x6AgVxvTz.js → DDnwKPJSznyfYDZS.js} +2 -2
- package/assets/{cv7k-VAIJtYeL9k4.js → DEW2GxfGYqVFvrfg.js} +1 -1
- package/assets/{CgjR_TiVOcuxg5tO.js → DH7sGHzxUqIQkDnd.js} +1 -1
- package/assets/{BMnNvUCJu35tT_aO.js → DJiLWtmPR2OQNjzi.js} +1 -1
- package/assets/{BOF64A2D2KKcv_fo.js → DKLm4nWzynGw1Kr9.js} +1 -1
- package/assets/{B_-VPqfsse8AlCTm.js → DPCKMM7sgWbrtB8z.js} +1 -1
- package/assets/{B-jE7tAMA559MtNt.js → DTfl-4Iboi6TQU5m.js} +3 -3
- package/assets/{Df2IAW-O7Gwl7V1l.js → DVchxwp6w6lu2Ihu.js} +2 -2
- package/assets/{COFze3jkZDQRSij9.js → DaoSWy3EFlqpZaLr.js} +196 -196
- package/assets/{ZTEO4JX22YIOkrJg.js → DcWTBOi_iBFc6U4J.js} +3 -3
- package/assets/Dht2mcOSyYlPY32b.js +14 -0
- package/assets/{9dbZwzIWefGss7is.js → Diee6f_qAmcZBd2_.js} +1 -1
- package/assets/{CwdOInoJwCxXnhog.js → DkibD_CEVePaoj_y.js} +2 -2
- package/assets/{DvD_K4M5HgJ4uJ8L.js → DlBdhv6NHgrNp5Yo.js} +2 -2
- package/assets/{BWsXOU_jh_cA8m8I.js → DoILAmhKUOlKWRVw.js} +1 -1
- package/assets/{cdIvC9t9tYtVn4nc.js → DpdHDTFOeuzDVNEe.js} +46 -46
- package/assets/{C-5LlJ5qhC7Ef0gV.js → DsCI_ZYm_jDjXF3J.js} +14 -14
- package/assets/{Du_JrYiYGJo5_B9H.js → DvUUArnZwoYOKOuk.js} +1 -1
- package/assets/{BXC6616BWEWNZ2-D.js → DwLZpYUp85UHBE3H.js} +1 -1
- package/assets/{BNfBq8Eic3Cl-f6A.js → DwWngYJTgC0KLbih.js} +1 -1
- package/assets/{C1rIlmARlinuie5E.js → Dz8UUJ7Xc2oN5PBG.js} +1 -1
- package/assets/{Dg7xy50qHwqkYd4g.js → FS9NbEKgQvz5wqvZ.js} +1 -1
- package/assets/{D2w3KjYuONW1G1kX.js → F_f0jJqM5MrXGbwC.js} +3 -3
- package/assets/{TzsPqmpG77I4ewVt.js → FzNG48GE_wso6RII.js} +1 -1
- package/assets/{BwisWvPpXRhyIP4O.js → JO3zH9hupFSV6vj2.js} +1 -1
- package/assets/{C-CNmTrzNS-ZlQ8j.js → LEJp05fjmflKgyqF.js} +148 -148
- package/assets/{Cm3Q_-DDdnVHRBxr.js → LyLlBk--VJD2V-f8.js} +4 -4
- package/assets/{DnmjS548g7nY6EUS.js → OVRdpPUzR0-ueTxE.js} +1 -1
- package/assets/{mcFLzsOH35mvmd3C.js → PpFbmF0DFeUdpb9I.js} +1 -1
- package/assets/{B66aeGYrHLbGpuN9.js → S16s2h9qoYVBlVEa.js} +320 -320
- package/assets/{BkBCkgPNrFR5N9fo.js → SHZe9VOU1prGs1F9.js} +1 -1
- package/assets/{DihigEGfNCLR8UPN.js → U1XXGEPuuqIAzYl1.js} +1 -1
- package/assets/{zu-72oKE_gCkrozc.js → ZuYfVKlp41IJnrOS.js} +1 -1
- package/assets/{8vRAQlvTcvMLeio0.js → _d5XJ7dn1CKKYrep.js} +2 -2
- package/assets/{BoTScfjgygCozDVi.js → _fUXIv6nKvgZkhxn.js} +2 -2
- package/assets/{C2Rgsb69SnMOohGt.js → fDMpDhXp36CatF-G.js} +1 -1
- package/assets/{B9QlqO6n3MCBsvoj.js → hulrR0PldUxMJm_F.js} +3 -3
- package/assets/{B-1_xSqUFCJ6jNjn.js → iujMYIEPx_v3sdPf.js} +15 -15
- package/assets/{CutEBbZl8oFbTlXZ.js → jPUOH4FHF4b-rapv.js} +1 -1
- package/assets/{BDZ1FGc1zFqO1nK7.js → jadLBUNBVR9mbZ35.js} +149 -149
- package/assets/{D2_T0KSaye0ncjQa.js → jiEe5eKV3BFPBWfi.js} +67 -67
- package/assets/{KpCEdfpsHnfkyqjx.js → oxjm7Yr7u7MeaO5P.js} +1 -1
- package/assets/{B6b9ytNrHR-ijcOa.js → vZZi_iKYHm05gAye.js} +1 -1
- package/assets/{st-UQngeBG4hwKoy.js → wfVh0olISLRWdv9Q.js} +1 -1
- package/assets/{HKLw8b2xTdu5c1w5.js → xmTQJJVyCrcq77WR.js} +1 -1
- package/assets/{DZRp3_yqPS6Lshho.js → xnhBSX6lAcmBM65y.js} +1 -1
- package/index.js +29 -29
- package/lib.js +1 -1
- package/licenses/dependencies.txt +57 -57
- package/package.json +8 -8
- package/screenshot-page/assets/B2MJPcMcsuv6FekC.js +1 -0
- package/screenshot-page/assets/{BCl5buf87xUgIfEB.js → BSdFVGZNhU6YHbMI.js} +1 -1
- package/screenshot-page/assets/{Cv8FG9PPBkkPw86e.js → BTMW3ukmc44U2fy7.js} +1 -1
- package/screenshot-page/assets/{Miyn0clMq0rovRIo.js → BTboCICZ-951XWsi.js} +1 -1
- package/screenshot-page/assets/B_W2QroTKADz3ABp.js +2 -0
- package/screenshot-page/assets/{Bor_tayB4yBfNOH5.js → Bj-vfAT28PK-tWWa.js} +2 -2
- package/screenshot-page/assets/{CvL9XK3Ht1mP-rGz.js → BnoVwUBEor8NgQNs.js} +2 -2
- package/screenshot-page/assets/{DzZRUd0p22CBa27b.js → BzQ5GyiXq8gTz-H-.js} +1 -1
- package/screenshot-page/assets/CwqNb7JYzC03lCj0.js +1 -0
- package/screenshot-page/assets/CzhH7lTYQrYGHct6.js +1 -0
- package/screenshot-page/assets/{CnZJ44ncMxZ4ivcB.js → D66vSE1ConAuENmB.js} +7 -7
- package/screenshot-page/assets/DCVUZ_ayOXFwV2d_.js +3 -0
- package/screenshot-page/assets/DFE-fKq5NV7_O8V6.js +1 -0
- package/screenshot-page/assets/{zHHZFbk5RXnrxbOc.js → DK_QSosKV62NDcuT.js} +9 -9
- package/screenshot-page/assets/{Bz2U7weS0spa8Xbh.js → DTFRGj188QuLKEXw.js} +1 -1
- package/screenshot-page/assets/{DDpAoGAPzo1c4vl5.js → DXQLzGmxoyN3kfQi.js} +3 -3
- package/screenshot-page/assets/DXWWyJlMSWgDFxs1.js +10 -0
- package/screenshot-page/assets/{DqM1wwsmN1J4MXMm.js → Dsx0NUmGIxS7SvZ8.js} +1 -1
- package/screenshot-page/assets/Q5EKmzoJZCE81Om-.js +2 -0
- package/screenshot-page/assets/{BYRwTzX1q407lHUS.js → TfhknTx8vxQkw4zV.js} +2 -2
- package/screenshot-page/assets/VvqAh6BWzaD5OUPF.js +1 -0
- package/screenshot-page/assets/{CE0MnsfMjqV2ICzk.js → hp_-JA1DMK4Yoztn.js} +12 -12
- package/screenshot-page/assets/{BRqSWCr2mTVNFquQ.js → l32n8O_A78Qqduv3.js} +1 -1
- package/screenshot-page/assets/sHBomL5R4-_px8rD.js +1 -0
- package/screenshot-page/assets/skRJ2qjA7kcmnOsh.js +39 -0
- package/screenshot-page/index.html +3 -3
- package/assets/Cfvhcua4c6onouhP.js +0 -14
- package/screenshot-page/assets/04d8koPx6lzeMYRQ.js +0 -39
- package/screenshot-page/assets/Bwql3QifB2cv7Mqp.js +0 -3
- package/screenshot-page/assets/CFOaI8g7pJuPzsyk.js +0 -1
- package/screenshot-page/assets/DUJzubL4qqOyizfu.js +0 -1
- package/screenshot-page/assets/DWiI5I3RtoKvVT66.js +0 -1
- package/screenshot-page/assets/D_H2dlsQ8PJ0r1WD.js +0 -10
- package/screenshot-page/assets/DsL71n5SxCVjL6Ho.js +0 -2
- package/screenshot-page/assets/IfF7Tv-nhz6Ikpn0.js +0 -1
- package/screenshot-page/assets/Rm5Sf5E6t8bk_Y3r.js +0 -1
- package/screenshot-page/assets/b3AbgxQkoaCiBi15.js +0 -1
- package/screenshot-page/assets/qm3VY0bH7F7EgSdi.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as e}from"./ChSvXfVMLxZsP9zG.js";import{D as t,G as n,I as r,K as i,Ot as a,ft as o,g as s}from"./Ca6nxdhEuLLty3d7.js";import{c,i as l}from"./BcOdl17EeFSxnAiq.js";import{Di as u,ci as d,kn as f,rn as p,rr as m}from"./CnZJ44ncMxZ4ivcB.js";import{Ct as h,Dn as g,Dt as _,En as v,G as ee,H as te,Mn as y,Mt as b,O as ne,Pn as x,Pt as re,Rt as ie,Tt as S,Ut as ae,Vt as C,W as w,Xn as oe,Xt as se,Zt as T,_n as E,a as D,an as O,ct as ce,d as le,er as ue,f as k,h as de,hn as A,it as j,ln as fe,m as M,mt as pe,nn as me,o as he,ot as ge,r as N,t as P,tn as F,xn as I}from"./04d8koPx6lzeMYRQ.js";import"./Bwql3QifB2cv7Mqp.js";import{a as L,o as _e,r as R}from"./BksaQEoZr5OWq-_d.js";var ve=class{constructor(e){this.list=e}get length(){return this.list.length}item(e){return this.list[e]}forEach(e,t){let n=this.list,r=n.length;for(let t=0;t<r;t++)e(n[t],t,this)}entries(){return this.list.entries()}keys(){return this.list.keys()}values(){return this.list.values()}[Symbol.iterator](){return this.list.values()}},ye=e=>!0===e||e===`1`||e===`on`||e===`true`||!1!==e&&e!==`0`&&e!==`off`&&e!==`false`&&null,be=e=>{let t=parseInt(e);return isNaN(t)?null:t},xe=e=>{let t=parseFloat(e);return isNaN(t)?null:t},Se=new Map,z=class{constructor(t,n,r,i,a,o=null,s=e.EmptyObject){this._fileLocation=``;let c=(e,t,n)=>s?.getRef?.(e,t,n,s?.parsedRefs),l=e=>s?.getRefs?.(e,s?.parsedRefs);this._parent=t,this.sharedShared=n,this.currentPath=r,this.elemRoot=i,this.jsonRoot=a,t?(this._fileLocation=t._fileLocation,this._getRef=t._getRef,this._getRefs=t._getRefs,this._serializeElement=t._serializeElement,this._readEmbeddedPart=t._readEmbeddedPart):(o&&(this._fileLocation=o),s?.getRef&&(this._getRef=c),s?.getRefs&&(this._getRefs=l),this._onWarning=s?.onWarning,this._addPerson=s?.addPerson,this._serializeElement=s?.serializeElement,this._readEmbeddedPart=s?.readEmbeddedPart)}getRef(e,t=!1){return this._getRef?.(e,this._fileLocation,t)??null}readEmbeddedPart(e){return this._readEmbeddedPart?.(e,this._fileLocation)??null}getRelationships(){return this._getRefs?.(this._fileLocation)??Se}getPath(){return this.currentPath}getFileLocation(){return this._fileLocation}getElemRoot(){return this.elemRoot}getJsonRoot(){return this.jsonRoot}warn(e,t){this._raiseWarning(e,this.getFileLocation(),t?.onceKey)}_raiseWarning(e,t,n){this._onWarning?this._onWarning(e,t,n):this._parent?this._parent._raiseWarning(e,t,n):console.warn(e)}serializeElement(e){return this._serializeElement?.(e)??null}addPerson(e){return typeof e==`string`&&(e={displayName:e}),this._addPerson?this._addPerson(e):this._parent?this._parent?._addPerson?.(e)??null:null}getVisitorParamsState(){return this.sharedShared.getVisitorParamsState()}evaluate(e,t){if(!e)return t;let n=[t],r=e.split(`/`),i=r.length;for(let e=0;e<i;e++){let t=r[e];if(t===``||t===`.`)continue;let a=[],o=(t===`*`||t===`**`)&&e!==i-1;for(let i of n)if(i){if(o){let t=r[e+1];t&&t!==``&&t!==`.`&&(this._findDescendants(i,t,a),e++)}else if(t===`*`||t===`**`){if(!i.childNodes)continue;let e=i.childNodes,t=e.length;for(let n=0;n<t;n++){let t=e[n];t.nodeType===1&&a.push(t)}}else{if(!i.childNodes)continue;let e=i.childNodes,n=e.length;for(let r=0;r<n;r++){let n=e[r];if(n.nodeType!==1)continue;let i=n;this._matchesElementName(i,t)&&a.push(i)}}}if(n=a,n.length===0)return null}return n.length===1?n[0]:n.length===0?null:new ve(n)}_matchesElementName(e,t){return t.includes(`:`)?(e.tagName||e.nodeName)===t:e.localName===t}_findDescendants(e,t,n){if(!e||!e.childNodes)return;let r=e.childNodes,i=r.length;for(let e=0;e<i;e++){let i=r[e];if(i.nodeType!==1)continue;let a=i;this._matchesElementName(a,t)&&n.push(a),this._findDescendants(a,t,n)}}getFromPath(t,n){return e.getFromPath(t,n)}setToPath(t,n,r){return e.setToPath(t,n,r)}getValAttrAsString(e,t){let n=this.evaluate(e,t);return n&&n.hasAttribute(`val`)?n.getAttribute(`val`)??null:null}getValAttrAsBoolean(e,t,n=!1){let r=this.evaluate(e,t);if(!r)return null;let i=r.hasAttribute(`val`)?r.getAttribute(`val`):void 0;return i==null?n:i===`1`||i===`on`||i===`true`||i!==`0`&&i!==`off`&&i!==`false`&&n}getValAttrAsInteger(e,t){let n=this.evaluate(e,t);return n&&n.hasAttribute(`val`)?parseInt(n.getAttribute(`val`))??null:null}getValAttrAsFloat(e,t){let n=this.evaluate(e,t);return n&&n.hasAttribute(`val`)?parseFloat(n.getAttribute(`val`))??null:null}get BOOLEAN_COPY(){return ye}get INT_COPY(){return be}get FLOAT_COPY(){return xe}copyFromAttribute(e,t,n,r=t,i=null){if(!e||!n||!e.hasAttribute(t))return;let a=e.getAttribute(t);if(i){if(Array.isArray(i)){let e=i.length;for(let t=0;t<e;t++)if(a==null||(a=i[t](a),a==null))return}else if(a==null||(a=i(a),a==null))return}this.setToPath(n,r,a)}},B=(e,t)=>{let n=[],r=e.childNodes,i=r.length;for(let e=0;e<i;e++){let i=r.item(e);i.nodeType===1&&i.localName===t&&n.push(i)}return n},Ce=[[`fillRef`,`fill`],[`lnRef`,`stroke`],[`effectRef`,`effect`]],V=(e,t)=>{let n=new h,r={};for(let[i,a]of Ce){let o=e.evaluate(i,t);if(!o)continue;let s={index:parseInt(o.getAttribute(`idx`)??`0`,10)||0},c=n.processAdjColor(e,o);c&&(s.color=c),r[a]=s}let i=e.evaluate(`fontRef`,t);if(i){let t={index:i.getAttribute(`idx`)??`none`},a=n.processAdjColor(e,i);a&&(t.color=a),r.font=t}return r},H=class{visit(e,t,n){if(!t)return;let r=e.evaluate(`*/cNvPr`,t);return r.item&&(r=r.item(0)),r&&(e.copyFromAttribute(r,`name`,n),e.copyFromAttribute(r,`descr`,n,`description`),e.copyFromAttribute(r,`hidden`,n,`hidden`,e.BOOLEAN_COPY),this.readNonVisualDetails(e,r,n),e.copyFromAttribute(r,`id`,n)),n}readNonVisualDetails(e,t,n){t.hasAttribute(`title`)&&(n.title=t.getAttribute(`title`));let r=e.evaluate(`hlinkClick`,t);r&&(n.hyperlink=O(e,r));let i=e.evaluate(`hlinkHover`,t);i&&(n.hoverHyperlink=O(e,i));let a=e.evaluate(`extLst`,t),o=a?e.serializeElement(a):null;o&&(n.extLst={...n.extLst,nonVisual:o})}setContent(e,t){let n=e;n.name!==void 0&&(t.name=n.name,delete n.name),n.description!==void 0&&(t.description=n.description,delete n.description);for(let e of[`title`,`hyperlink`,`hoverHyperlink`,`extLst`])n[e]!==void 0&&(t.json&&(t.json[e]=n[e]),delete n[e]);e.content=t}isGroupContent(e){return Array.isArray(e?.members)}readMemberHeader(e,t,n){let r={},i={anchor:void 0,content:{type:n,json:r}},a=e.evaluate(`*/cNvPr`,t);if(a?.item&&(a=a.item(0)),a){let n=a.getAttribute(`name`);n!==null&&(i.content.name=n);let o=a.getAttribute(`descr`);o&&(i.content.description=o),e.copyFromAttribute(a,`hidden`,i,`hidden`,e.BOOLEAN_COPY),this.readNonVisualDetails(e,a,r);let s=this.readSourceId(e,t);s!==void 0&&(r.sourceId=s)}return{movable:i,content:r}}readStyleRefs(e,t,n){let r=e.evaluate(`style`,t);if(!r)return void(n.style=null);let a=V(e,r),o=i.withoutDefaultStyleRefs({...n,style:a});o&&(n.style=o)}readLocks(e){let t=e?.attributes;if(!t||t.length===0)return;let n={};for(let e=0;e<t.length;e++){let r=t.item(e);r.name.startsWith(`xmlns`)||(n[r.localName??r.name]=D(r.value))}return Object.keys(n).length>0?n:void 0}readSourceId(e,t){let n=e.evaluate(`*/cNvPr`,t);n?.item&&(n=n.item(0));let r=n?.getAttribute?.(`id`),i=r?parseInt(r,10):void 0;return i===void 0||isNaN(i)?void 0:i}},we=[[`spDef`,`shape`],[`lnDef`,`line`],[`txDef`,`text`]],U=(e,t)=>{let n=t.getAttribute(`dxfId`);if(n===null)return;let r=parseInt(n);return e.getVisitorParamsState().get(`dxfs`)?.get(r)||(e.warn(`A color filter or sort names a format that does not exist (dxfId '${n}').`),{})},W=e=>e===`1`||e===`true`,G=class{visit(e,t,n){}processDataBarColor(e,t,n,r,i=`auto`){if(!t)return;let a=T(e=>t.getAttribute(e),i);return a&&(n[r]=a),n}processFonts(e,t,n){if(!t)return;let r=t.childNodes,i=0,a=r.length;for(let t=0;t<a;t++){let a=r.item(t);if(a.nodeType===1&&a.localName===`font`){let t={};this.processFont(e,a,t),n[i++]=t}}return n}processFont(e,n,r){e.getValAttrAsBoolean(`b`,n,!0)&&(r.weight=700),e.getValAttrAsBoolean(`i`,n,!0)&&(r.style=t.Style.Italic),e.getValAttrAsBoolean(`strike`,n,!0)&&(r.strike=v(!0));let i=e.evaluate(`u`,n);if(i){let e=i.getAttribute(`val`);r.underline=b(e)}let a=y(e.evaluate(`vertAlign`,n)?.getAttribute(`val`));a!==void 0&&(r.baseline=a),me(e,n,r,`sz`,`size`);let o=e.evaluate(`color`,n);this.processDataBarColor(e,o,r,`color`),r.color||=`auto`,x(e,n,r,`name`,`family`),x(e,n,r,`rFont`,`family`);let s=e.evaluate(`family`,n);if(s){let e=s.getAttribute(`val`);if(e)switch(e){case`1`:r.fallbacks=[`serif`];break;case`2`:r.fallbacks=[`sans-serif`];break;case`3`:r.fallbacks=[`monospace`];break;case`4`:r.fallbacks=[`cursive`];break;case`5`:r.fallbacks=[`fantasy`]}}P(r,e.evaluate(`scheme`,n)?.getAttribute(`val`)),A(e,n,r,`shadow`,`shadow`,!0),A(e,n,r,`outline`,`outline`,!0);for(let t of[`condense`,`extend`]){let i=E(t,!!e.getValAttrAsBoolean(t,n,!0));i!==void 0&&(r.letterSpacing=i)}return g(e,n,r,`charset`,`charset`),r}processFills(e,t,n){if(!t)return;let r=t.childNodes,i=0,a=r.length;for(let t=0;t<a;t++){let a=r.item(t);a.nodeType===1&&a.localName===`fill`&&this.processFill(e,a,n,i++)}return n}processFill(e,t,r,i){let a={type:n.Type.None},o=t.childNodes,s=!1,c=o.length;for(let t=0;!s&&t<c;t++){let n=o.item(t);n.nodeType===1&&(n.localName===`gradientFill`?(this.processGradientFill(e,n,a),s=!0):n.localName===`patternFill`&&(this.processPatternFill(e,n,a),s=!0))}return r[i]=a,r}processGradientFill(e,t,r){if(!t)return;r.type=n.Type.Gradient;let i=[];r.stops=i;let a=t.getAttribute(`type`);a&&(r.gradientType=a);let o=t.hasAttribute(`degree`)?parseFloat(t.getAttribute(`degree`)):0;(o+90)%360!=0&&(r.angle=(o+90)%360),(t.hasAttribute(`left`)||t.hasAttribute(`top`)||t.hasAttribute(`right`)||t.hasAttribute(`bottom`))&&(r.focus={left:K(t.getAttribute(`left`)),top:K(t.getAttribute(`top`)),right:K(t.getAttribute(`right`)),bottom:K(t.getAttribute(`bottom`))});let s=t.childNodes,c=s.length;for(let t=0;t<c;t++){let n=s.item(t);if(n.nodeType===1&&n.localName===`stop`){let t={};i.push(t),t.offset=parseFloat(n.getAttribute(`position`)??``);let r=e.evaluate(`color`,n);this.processDataBarColor(e,r,t,`color`)}}return r}processPatternFill(e,t,r){if(!t)return;let i=e.getVisitorParamsState().get(`processingDXFs`),a=t.getAttribute(`patternType`)||(i?n.BuiltInSheetPattern.Solid:n.BuiltInSheetPattern.None);if(a===n.BuiltInSheetPattern.None)return{none:!0};r.type=n.Type.Pattern,a&&(r.patternType=a);let o=`foreground`,s=`background`,c=r.patternType===n.BuiltInSheetPattern.Solid&&i,l=c?`dk1`:`lt1`,u=c?`lt1`:`dk1`;if(c){let e=o;o=s,s=e}let d=e.evaluate(`fgColor`,t);this.processDataBarColor(e,d,r,o,l);let f=e.evaluate(`bgColor`,t);return this.processDataBarColor(e,f,r,s,u),c&&(r.foreground||=`lt1`,r.background||=`dk1`),r}processBorders(e,t,n,r){if(!t)return;let i=t.childNodes,a=0,o=i.length;for(let t=0;t<o;t++){let o=i.item(t);o.nodeType===1&&o.localName===`border`&&this.processBorder(e,o,n,a++,r)}return n}processBorder(e,t,n,r,i){if(!t)return;let o={};this.processBorderStroke(e,t,o,a.Edge.Left),this.processBorderStroke(e,t,o,a.Edge.Right),i?(o.right||o.left)&&(o.vertical=o.right?{...o.right}:{...o.left}):this.processBorderStroke(e,t,o,a.Edge.Vertical),this.processBorderStroke(e,t,o,a.Edge.Top),this.processBorderStroke(e,t,o,a.Edge.Bottom),i?(o.bottom||o.top)&&(o.horizontal=o.bottom?{...o.bottom}:{...o.top}):this.processBorderStroke(e,t,o,a.Edge.Horizontal);let s=this.processBorderStroke(e,t,{},`diagonal`);return s&&(W(t.getAttribute(`diagonalUp`))&&(o.diagonalUp={...s}),W(t.getAttribute(`diagonalDown`))&&(o.diagonalDown={...s})),n[r]=o,n}processBorderStroke(e,t,n,r){if(!t)return;let i=e.evaluate(r,t);if(!i)return;let o={};i.hasAttribute(`style`)?o.style=i.getAttribute(`style`):e.getVisitorParamsState().get(`processingDXFs`)&&(o.style=a.StrokeStyle.None);let s=e.evaluate(`color`,i);return s&&this.processDataBarColor(e,s,o,`color`),Object.keys(o).length>0?n[r]=o:null}},K=e=>{if(!e)return 0;let t=parseFloat(e);return isNaN(t)?0:t},q=(e,t)=>{if(!e||e.nodeType!==1)return null;let n=e.childNodes;for(let e=0;e<n.length;e++){let r=n.item(e);if(r.nodeType===1&&r.localName===t)return r}return null},Te=new Set(Object.values(d.ElementType).filter(e=>e!==d.ElementType.WholeTable&&e!==d.ElementType.HeaderRow)),Ee={auto:`auto`,autoNoTable:`automaticExceptTables`,manual:`manual`},J=[`tableId`,`columnId`,`cacheName`,`cachePath`,`sourceName`,`sortOrder`,`customListSort`,`crossFilter`],Y=(e,t)=>{let n=e.content,r=n?.json;if(r){if(n.type===`shape`||n.type===`picture`){let{rotation:n,flipH:i,flipV:a,bounds:o}=r;delete r.rotation,delete r.flipH,delete r.flipV,delete r.bounds,n!==void 0&&n!==0&&(e.rotation=n),i&&(e.flipH=!0),a&&(e.flipV=!0),t&&o&&(e.anchor={tl:{x:o.x,y:o.y},br:{x:o.width,y:o.height}})}if(n.type===`group`)for(let e of r.members??[])Y(e,!0)}},X=class extends H{visit(e,t,n){if(t)return this.visitShape(e,t,n,`sp`,`nvSpPr/cNvSpPr/spLocks`)}visitShape(e,t,n,r,i){let a=ge[r];if(this.isGroupContent(n)){if(e.getPath().includes(`Fallback`))return{};let{movable:o,content:c}=this.readMemberHeader(e,t,`shape`);a!==s.Type.Shape&&(c.type=a),this.readShapeDetails(e,t,r,i,c),this.readStyleRefs(e,t,c);let l=e.evaluate(i,t);l?.hasAttribute?.(`noChangeAspect`)&&(o.lockAspect=l.getAttribute(`noChangeAspect`)===`1`);let u=this.readTwinOf(e,t);return u!==void 0&&Object.assign(c,{twinOf:u}),n.members.push(o),c}if(e.getPath().includes(`Fallback`)&&n.content){let r=n.content.json;if(n.content.type===`shape`&&r&&(r.type??s.Type.Shape)===a){let n=e.evaluate(`txBody`,t),i=n?new j().readTextBody(e,n):null;i&&de(i)!==``&&(r.text=i)}return{}}n=super.visit(e,t,n);let o=e.evaluate(i,t);o?.hasAttribute?.(`noChangeAspect`)&&(n.lockAspect=o.getAttribute(`noChangeAspect`)===`1`);let c=a===s.Type.Shape?{}:{type:a},l=this.readSourceId(e,t);l!==void 0&&(c.sourceId=l),this.readShapeDetails(e,t,r,i,c),this.readStyleRefs(e,t,c);let u=this.readTwinOf(e,t);return u!==void 0&&Object.assign(c,{twinOf:u}),this.setContent(n,{type:`shape`,json:c}),c}readTwinOf(e,t){let n=e.evaluate(`*/cNvPr/extLst/ext/compatExt`,t);n?.item&&(n=n.item(0));let r=/^_x0000_s(\d+)$/.exec(n?.getAttribute?.(`spid`)??``);return r?parseInt(r[1],10):void 0}readShapeDetails(e,t,n,r,i){let a=t.getAttribute(`macro`);a&&(i.macro=a);let o=t.getAttribute(`textlink`);o&&(i.textLink=o),t.hasAttribute(`fLocksText`)&&(i.locksText=D(t.getAttribute(`fLocksText`))),t.hasAttribute(`fPublished`)&&(i.published=D(t.getAttribute(`fPublished`)));let s=r.slice(0,r.lastIndexOf(`/`)),c=e.evaluate(s,t);c?.getAttribute?.(`txBox`)===`1`&&(i.textBox=!0);let l=this.readLocks(e.evaluate(r,t));if(l&&(i.locks=l),n===`cxnSp`&&c){let t=t=>{let n=e.evaluate(t,c);if(n?.getAttribute)return{id:parseInt(n.getAttribute(`id`)??`0`,10)||0,index:parseInt(n.getAttribute(`idx`)??`0`,10)||0}},n=t(`stCxn`),r=t(`endCxn`);(n||r)&&(i.connectorEnds={},n&&(i.connectorEnds.start=n),r&&(i.connectorEnds.end=r))}}},De=/^<a:extLst(?:\s+xmlns:a="[^"]*")?><a:ext uri="\{28A0092B-C50C-407E-A947-70E740481C1C\}"><a14:useLocalDpi(?:\s+xmlns:a14="[^"]*")?\s+val="0"\s*\/><\/a:ext><\/a:extLst>$/,Z=(e,t,n,r)=>{let i=e.evaluate(n,t),a=e.evaluate(r,t);return i||a?{x:k(i?.getAttribute(`x`)??null)??0,y:k(i?.getAttribute(`y`)??null)??0,width:k(a?.getAttribute(`cx`)??null)??0,height:k(a?.getAttribute(`cy`)??null)??0}:null},Oe={Checkbox:`checkbox`},Q=e=>{let t=e.getAttribute(`val`);return t!==`0`&&t!==`false`},ke={1:`serif`,2:`sans-serif`,3:`monospace`,4:`cursive`,5:`fantasy`};function Ae(e){let n={},r=e.childNodes;for(let e=0;e<r.length;e++){let i=r.item(e);if(i.nodeType===1)switch(i.localName){case`b`:n.weight=Q(i)?700:400;break;case`i`:n.style=Q(i)?t.Style.Italic:t.Style.Normal;break;case`strike`:n.strike=v(Q(i));break;case`outline`:n.outline=Q(i);break;case`shadow`:n.shadow=Q(i);break;case`condense`:case`extend`:{let e=E(i.localName,Q(i));e!==void 0&&(n.letterSpacing=e);break}case`u`:n.underline=b(i.getAttribute(`val`));break;case`vertAlign`:{let e=y(i.getAttribute(`val`));e!==void 0&&(n.baseline=e);break}case`sz`:{let e=parseFloat(i.getAttribute(`val`)??``);isNaN(e)||(n.size=e);break}case`rFont`:{let e=i.getAttribute(`val`);e&&(n.family=e);break}case`family`:{let e=ke[i.getAttribute(`val`)??``];e&&(n.fallbacks=[e]);break}case`charset`:{let e=parseInt(i.getAttribute(`val`)??``,10);isNaN(e)||(n.charset=e);break}case`scheme`:P(n,i.getAttribute(`val`));break;case`color`:{let e=i.getAttribute(`rgb`);if(e&&!i.hasAttribute(`theme`)){n.color=`#`+(e.length===8?e.substring(2):e).toUpperCase();break}let t=T(e=>i.getAttribute(e));t&&(n.color=t);break}}}return Object.keys(n).length>0?n:null}var $={RelsVisitor:class{visit(e,t,n){if(!t)return;let r=t.childNodes,i=r.length;for(let t=0;t<i;t++){let i=r.item(t);i.nodeType===1&&i.localName===`Relationship`&&this.processRelationship(e,i,n)}return n}processRelationship(e,t,n){let r={};e.copyFromAttribute(t,`Target`,r,`target`),e.copyFromAttribute(t,`Type`,r,`type`),e.copyFromAttribute(t,`TargetMode`,r,`targetMode`),n[t.getAttribute(`Id`)]=r}},CorePropertiesVisitor:class{visit(e,t,n){let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);if(n.nodeType!==1)continue;let a=this.processProperty(e,n);a&&r.push(a)}return r.length>0&&(n.properties=r),r}processProperty(e,t){if(t)return t.getAttribute(`xsi:type`),{key:t.localName,value:t.textContent||``}}},AppPropertiesVisitor:class{visit(e,t,n){let r=t.childNodes,i=r.length;for(let e=0;e<i;e++)if(r.item(e).localName===`property`)return this.visitCustom(t,n);let a=[];for(let t=0;t<i;t++){let n=r.item(t);if(n.nodeType!==1)continue;let i=this.processProperty(e,n);i&&a.push(i)}return a.length>0&&(n.properties=a),a}visitCustom(e,t){let n=[],r=e.childNodes,i=r.length;for(let e=0;e<i;e++){let t=r.item(e);if(t.nodeType!==1||t.localName!==`property`)continue;let i=t.getAttribute(`name`);if(!i)continue;let a=null;for(let e=0;e<t.childNodes.length&&!a;e++){let n=t.childNodes.item(e);n.nodeType===1&&(a=n)}let o={key:i,kind:a?.localName??null,value:a?.textContent??``},s=t.getAttribute(`linkTarget`);s&&(o.linkTarget=s),n.push(o)}return n.length>0&&(t.custom=n),n}processProperty(e,t){if(t)return{key:t.localName,value:t.textContent||``}}},ShapePropertiesVisitor:M,TextPropertiesVisitor:he,ShapeTextVisitor:j,ThemeVisitor:class{visit(e,t,n){n.name=t.getAttribute(`name`),n.objectDefaults={};let r=B(t,`custClrLst`)[0];if(r){let t=new h,i=[];for(let n of B(r,`custClr`)){let r=t.processAdjColor(e,n);if(!r)continue;let a={color:r},o=n.getAttribute(`name`);o&&(a.name=o),i.push(a)}i.length&&(n.customColors=i)}for(let e of B(t,`extLst`))for(let t of B(e,`ext`)){if(t.getAttribute(`uri`)!==`{05A4C25C-085E-4340-85A3-A5531E510DB2}`)continue;let e=B(t,`themeFamily`)[0],r=e?.getAttribute(`id`);if(!r)continue;let i={name:e.getAttribute(`name`)??``,id:r},a=e.getAttribute(`vid`);a&&(i.vid=a),n.family=i}return n}},ClrSchemeVisitor:class extends h{visit(e,t,n){let r={};r.name=t.getAttribute(`name`);let i=t.childNodes,a=i.length;for(let n=0;n<a;n++){let a=i.item(n);if(a.nodeType===1){let n=a.localName,i=e.evaluate(n,t);r[n]=this.processAdjColor(e,i)}}return Object.keys(r).length>0&&(n.colors=r),r}},FontSchemeVisitor:class{visit(e,t,n){let r={};r.name=t.getAttribute(`name`);let i=this.processFontCollection(e,e.evaluate(`majorFont`,t));i&&(r.major=i);let a=this.processFontCollection(e,e.evaluate(`minorFont`,t));return a&&(r.minor=a),n.fonts=r,r}processFontCollection(e,t){if(!t)return;let n={},r=e.evaluate(`latin`,t),i=r?.getAttribute(`typeface`);i&&(n.latin=i);let a=r?.getAttribute(`panose`);a&&(n.panose=a);let o=e.evaluate(`ea`,t)?.getAttribute(`typeface`);o&&(n.eastAsian=o);let s=e.evaluate(`cs`,t)?.getAttribute(`typeface`),c;s&&(n.complexScript=s);let l=t.childNodes,u=l.length;for(let e=0;e<u;e++){let t=l.item(e);if(t.nodeType!==1||t.localName!==`font`)continue;let n=t.getAttribute(`script`);n&&((c??={})[n]=t.getAttribute(`typeface`)??``)}return c&&(n.scripts=c),n}},ObjectDefaultsVisitor:class{visit(e,t,n){let r={};for(let[n,i]of we){let a=e.evaluate(n,t);a&&(r[i]=this.processDefault(e,a))}return n.objectDefaults=r,{}}processDefault(e,t){let n={},r=e.evaluate(`spPr`,t);r&&new M().visit(e,r,n);let i=new j().readTextBody(e,t);(i.body||i.listStyle)&&(n.text=i);let a=e.evaluate(`style`,t);return a&&(n.style=V(e,a)),n}},FmtSchemeVisitor:class extends h{visit(e,t,n){let r=this.parseFillList(e,t,`fillStyleLst`),i=this.parseLnList(e,t,`lnStyleLst`),a=this.parseEffectStyleList(e,t,`effectStyleLst`),o=this.parseFillList(e,t,`bgFillStyleLst`);if(r&&(n.fillStyleLst=r),i&&(n.lnStyleLst=i),a&&(n.effectStyleLst=a),o&&(n.bgFillStyleLst=o),r&&i&&a&&o)return;let s=e.serializeElement(t);s&&(n.formatSchemeXml=s)}parseFillList(e,t,n){let r=e.evaluate(n,t);if(!r)return;let i=[],a=r.childNodes,o=a.length;for(let t=0;t<o;t++){let n=a.item(t);if(n.nodeType!==1)continue;let r=this.parseFillListItem(e,n);if(r===void 0)return;i.push(r)}return i}parseFillListItem(e,t){switch(t.localName){case`noFill`:return{type:n.Type.None};case`solidFill`:{let r=this.processAdjColor(e,t);return r?{type:n.Type.Solid,color:r}:void 0}case`gradFill`:return this.processGradFill(e,t);case`pattFill`:return this.processPatternFill(e,t);default:return}}parseLnList(e,t,n){let r=e.evaluate(n,t);if(!r)return;let i=[],a=r.childNodes,o=a.length;for(let t=0;t<o;t++){let n=a.item(t);n.nodeType===1&&i.push(this.parseLn(e,n))}return i}parseEffectStyleList(e,t,n){let r=e.evaluate(n,t);if(!r)return;let i=[],a=r.childNodes,o=a.length;for(let t=0;t<o;t++){let n=a.item(t);if(n.nodeType!==1)continue;if(e.evaluate(`scene3d`,n)||e.evaluate(`sp3d`,n))return;let r=this.getEffects(e,n);if(r===void 0)return;i.push(r??[])}return i}},AutoFilterVisitor:class{visit(e,t,n){if(!t)return;let r={},i=[];return this.processFilterColumns(e,t,i,n),i.length>0&&(r.conditions=i),Object.keys(r).length>0&&(n.filter=r),n}processColorFilter(e,t){let n={},r={operator:p.BuiltInOperatorNames.Color,param:n};e.copyFromAttribute(t,`cellColor`,n,`cellColor`,e.BOOLEAN_COPY);let i=U(e,t);return i&&(n.style=i),r}processCustomFilter(e,t){return F({operator:t.getAttribute(`operator`),val:t.getAttribute(`val`)},t=>e.warn(t))}processCustomFilters(e,t){let n=t.getAttribute(`and`),r=n===`and`||n===`1`;t.getAttribute(`val`);let i=[],a={operator:r?p.BuiltInOperatorNames.And:p.BuiltInOperatorNames.Or,param:i},o=t.childNodes,s=o.length;for(let t=0;t<s;t++){let n=o.item(t);if(n.nodeType!==1)continue;let r=null;n.localName===`customFilter`&&(r=this.processCustomFilter(e,n)),r&&i.push(r)}return i.length===1?i[0]:se(a)}processDynamicFilter(e,t){return ee(t.getAttribute(`type`))}processDateGroupItem(e,t){let n={};return e.copyFromAttribute(t,`dateTimeGrouping`,n,`group`),e.copyFromAttribute(t,`day`,n,`day`,e.INT_COPY),e.copyFromAttribute(t,`hour`,n,`hour`,e.INT_COPY),e.copyFromAttribute(t,`minute`,n,`minute`,e.INT_COPY),e.copyFromAttribute(t,`month`,n,`month`,e.INT_COPY),e.copyFromAttribute(t,`second`,n,`second`,e.INT_COPY),e.copyFromAttribute(t,`year`,n,`year`,e.INT_COPY),n}processFilterItem(e,t){if(t.hasAttribute(`val`))return t.getAttribute(`val`)}processFilters(e,t){let n={},r={operator:p.BuiltInOperatorNames.InSet,param:n};r.selector=p.BuiltInSelectorNames.Display,e.copyFromAttribute(t,`blank`,n,`blank`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`calendarType`,n,`calendarType`);let i=[],a=[],o=t.childNodes,s=o.length;for(let t=0;t<s;t++){let n=o.item(t);if(n.nodeType===1){if(n.localName===`dateGroupItem`){let t=this.processDateGroupItem(e,n);t&&i.push(t)}else if(n.localName===`filter`){let t=this.processFilterItem(e,n);t!==void 0&&a.push(t)}}}return i.length>0&&(n.dateGroups=i),a.length>0&&(n.items=a),r}processIcon(e,t){let n={},r={operator:p.BuiltInOperatorNames.Icon,param:n};return e.copyFromAttribute(t,`iconId`,n,`iconId`,e.INT_COPY),e.copyFromAttribute(t,`iconSet`,n),r}processTop10(e,t){let n={},r={operator:p.BuiltInOperatorNames.TopN,param:n};return e.copyFromAttribute(t,`filterVal`,n,`filterVal`,e.FLOAT_COPY),e.copyFromAttribute(t,`percent`,n,`percent`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`top`,n,`top`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`val`,n,`limit`,e.FLOAT_COPY),r}processFilterColumnExt(e,t){let n=t.childNodes;for(let t=0;t<n.length;t++){let r=n.item(t);if(r.nodeType!==1||r.localName!==`ext`||_(r.getAttribute(`uri`))!==_(`{1AD28BCE-077C-4C59-8B6E-1921CE8616D4}`))continue;let i=r.childNodes;for(let t=0;t<i.length;t++){let n=i.item(t);if(n.nodeType!==1||n.localName!==`filterColumn`)continue;let r=n.childNodes;for(let t=0;t<r.length;t++){let n=r.item(t);if(n.nodeType===1&&n.localName===`filters`)return this.processFilters(e,n)}}}}processFilterCriteria(e,t){if(!t)return;let n=t.childNodes,r,i=n.length;for(let t=0;t<i;t++){let i=n.item(t);i.nodeType===1&&(i.localName===`colorFilter`?r=this.processColorFilter(e,i):i.localName===`customFilters`?r=this.processCustomFilters(e,i):i.localName===`dynamicFilter`?r=this.processDynamicFilter(e,i):i.localName===`filters`?r=this.processFilters(e,i):i.localName===`iconFilter`?r=this.processIcon(e,i):i.localName===`top10`?r=this.processTop10(e,i):i.localName===`extLst`&&(r=this.processFilterColumnExt(e,i)??r))}return r}processFilterColumn(e,t,n){if(!t)return null;if(!t.hasAttribute(`colId`))return;let r=parseInt(t.getAttribute(`colId`)),i=!1;if(t.hasAttribute(`hiddenButton`)&&(i=D(t.getAttribute(`hiddenButton`))),i&&n){let e=n.hiddenButtons;e||(e=[],n.hiddenButtons=e),e.push(r)}let a=!1;if(t.hasAttribute(`showButton`)&&(a=D(t.getAttribute(`showButton`))),a&&n){let e=n.showButtons;!0!==e&&(e||(e=[],n.showButtons=e),e[r]=!0)}let o=this.processFilterCriteria(e,t);return o?(o.index=r,o):null}processFilterColumns(e,t,n,r){if(!t)return;let i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let a=i.item(t);if(a.nodeType===1&&a.localName===`filterColumn`){let t=this.processFilterColumn(e,a,r);t&&n.push(t)}}return n}},SortStateVisitor:class{visit(e,t,n){if(!t)return;let r=t.getAttribute(`ref`),i={};t.hasAttribute(`caseSensitive`)&&(i.collatorOptions=D(t.getAttribute(`caseSensitive`))?m.CaseSensitiveOptions:m.CaseInsensitiveOptions);let a=t.getAttribute(`sortMethod`);a!=null&&a!==`none`&&(a===`stroke`?i.collatorOptions={...i.collatorOptions,collation:`stroke`}:a===`pinYin`&&(i.collatorOptions={...i.collatorOptions,collation:`pinyin`}));let o={};t.hasAttribute(`columnSort`)&&D(t.getAttribute(`columnSort`))&&(o.axis=c.Axis.Column);let s=u.fastStringToRange(r),l=[],d=[];this.processSortConditions(e,t,l,s,i,d),l.length>0&&(o.sorts=l);let f=e.getVisitorParamsState().get(`ref`);if(f&&r){let e=u.fastStringToRange(f);o.extent={range:I(e,s),sorts:d.map(t=>pe(e,s,t))}}return Object.keys(l).length>0&&(n.sort=o),o}processSortCondition(e,t,n,r,i){if(!t)return null;let a={};if(!t.hasAttribute(`ref`))return void e.warn(`A sort condition has no ref; it was dropped.`,{onceKey:`xlsx.sheet.sort.noRef`});if(t.hasAttribute(`ref`)){let e=t.getAttribute(`ref`),r=u.fastStringToRange(e);a.index=n?r.colStart-n.colStart:r.colStart,i?.push(r)}let o={...r};a.criteria=o,o.reverse=!1,t.hasAttribute(`descending`)&&(o.reverse=D(t.getAttribute(`descending`)));let s=oe(t.getAttribute(`sortBy`));s&&(o.sortOn=s);let c=U(e,t);return c&&(o.style=c),e.copyFromAttribute(t,`iconSet`,o),e.copyFromAttribute(t,`customList`,o),a}processSortConditions(e,t,n,r,i,a){if(!t)return;let o=t.childNodes,s=o.length;for(let t=0;t<s;t++){let s=o.item(t);if(s.nodeType===1&&s.localName===`sortCondition`){let t=this.processSortCondition(e,s,r,i,a);t&&n.push(t)}}}},SheetStyleVisitor:class extends G{visit(e,t,r){this.processNumFmts(e,e.evaluate(`numFmts`,t),null),e.getVisitorParamsState().set(`colorsToProcess`,new Set);let i={fills:{},fonts:{},borders:{}},o=e.evaluate(`fonts`,t);this.processFonts(e,o,i.fonts);let s=i.fonts[this.normalFontId(e,t)],c={declared:[`1`,`true`].includes(o?.getAttribute(`x14ac:knownFonts`)??``),normalIsThemeFont:w(s?.family),faces:ne(Object.values(i.fonts).map(e=>({...e,family:ie(e?.family,e?.fallbacks,null,!1).name})))};e.getVisitorParamsState().set(ce,c),s&&e.getVisitorParamsState().set(`defaultFont`,s),this.processFills(e,e.evaluate(`fills`,t),i.fills),this.processBorders(e,e.evaluate(`borders`,t),i.borders,!0),i.fills[0]={type:n.Type.None},i.fills[1]={type:n.Type.Pattern,patternType:n.BuiltInSheetPattern.Gray125},i.borders[0]={bottom:{style:a.StrokeStyle.None},left:{style:a.StrokeStyle.None},right:{style:a.StrokeStyle.None},top:{style:a.StrokeStyle.None}};let l=[];this.processXFs(e,e.evaluate(`cellStyleXfs`,t),l,i,null,!1);let u=new Map;if(l.length>0){let n=[];this.processCellStyles(e,e.evaluate(`cellStyles`,t),n,l,u),r.named=n}let d=[];this.processXFs(e,e.evaluate(`cellXfs`,t),d,i,u),Object.keys(d).length>0&&(r.direct=d);let f=this.collectHiddenXfs(e.evaluate(`cellXfs`,t));f.size>0&&e.getVisitorParamsState().set(`hiddenXfs`,f);let p=this.collectXfComplements(e.evaluate(`cellXfs`,t));p.size>0&&e.getVisitorParamsState().set(`xfComplements`,p);let m=[];return this.processDXFs(e,e.evaluate(`dxfs`,t),m),this.processTableStyles(e,e.evaluate(`tableStyles`,t),r,m),this.processSlicerStyles(e,e.evaluate(`extLst`,t),r),this.processIndexColors(e,e.evaluate(`colors/indexedColors`,t),r),this.processMruColors(e,e.evaluate(`colors/mruColors`,t),r),r}normalFontId(e,t){let n=e.evaluate(`cellStyles`,t)?.childNodes,r=0;for(let e=0;e<(n?.length??0);e++){let t=n.item(e);if(t.nodeType===1&&t.getAttribute(`builtinId`)===`0`){r=parseInt(t.getAttribute(`xfId`)??`0`,10)||0;break}}let i=e.evaluate(`cellStyleXfs`,t)?.childNodes,a=0;for(let e=0;e<(i?.length??0);e++){let t=i.item(e);if(t.nodeType===1&&a++===r)return parseInt(t.getAttribute(`fontId`)??`0`,10)||0}return 0}processIndexColors(e,t,n){if(!t)return;let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);if(n.nodeType===1&&n.localName===`rgbColor`){let t={color:null};this.processDataBarColor(e,n,t,`color`),t.color&&r.push(t.color)}}n.indexedColors=r}processMruColors(e,t,n){if(!t)return;let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);if(n.nodeType===1&&n.localName===`color`){let t={color:null};this.processDataBarColor(e,n,t,`color`),t.color&&r.push(t.color)}}r.length>0&&(n.mruColors=r)}processNumFmts(e,t,n){if(!t)return;let r=new Map;if(e.getVisitorParamsState().set(`numFmts`,r),!t)return;let i=t.childNodes,a=i.length;for(let e=0;e<a;e++){let t=i.item(e);if(t.nodeType===1&&t.localName===`numFmt`){let e=t.getAttribute(`numFmtId`),n=t.getAttribute(`formatCode`);if(e&&n){let t=n;r.set(parseInt(e),t)}}}}processXFs(e,t,n,r,i=null,a=!0){if(!t)return;let o=t.childNodes,s=o.length;for(let t=0;t<s;t++){let s=o.item(t);if(s.nodeType===1&&s.localName===`xf`){let t={};this.processXF(e,s,t,r,i,a),n.push(t)}}}processXF(e,t,n,i,a,o){if(!t)return;let s=t.getAttribute(`xfId`);if(s&&a){let e=a.get(parseInt(s));e&&e!==r.BuiltInName.Normal&&(n.named=e)}let c=e=>!(!o&&t.hasAttribute(e))||D(t.getAttribute(e)),l=e=>!o||t.hasAttribute(e)&&D(t.getAttribute(e)),u=o?`0`:void 0;if(c(`applyFont`)){let e=t.getAttribute(`fontId`)??u;if(e!==void 0&&(e!==`0`||l(`applyFont`))){let t=i.fonts[e];t!==void 0&&(n.font=t)}}if(c(`applyFill`)){let e=t.getAttribute(`fillId`)??u;if(e!==void 0&&(e!==`0`||l(`applyFill`))){let t=i.fills[e];t!==void 0&&Object.keys(t).length>0&&(n.fill=t)}}if(c(`applyBorder`)){let e=t.getAttribute(`borderId`)??u;if(e!==void 0&&(e!==`0`||l(`applyBorder`))){let t=i.borders[e];t!==void 0&&(n.borders=t)}}if(c(`applyNumberFormat`)){let r=t.getAttribute(`numFmtId`)??u;if(r!==void 0&&(r!==`0`||l(`applyNumberFormat`))){let t=parseInt(r),i,a=e.getVisitorParamsState();if(a){let e=a.get(`numFmts`);e&&(i=e.get(t)),n.numberFormat=i??t}else e.warn(`Number formats were unavailable; a cell format was not read.`,{onceKey:`xlsx.style.numberFormat.state`})}}if(c(`applyAlignment`)){let r=e.evaluate(`alignment`,t);(r||l(`applyAlignment`))&&this.processAlignment(e,r,n)}if(c(`applyProtection`)){let r=e.evaluate(`protection`,t);(r||l(`applyProtection`))&&this.processProtection(e,r,n)}let d=D(t.getAttribute(`quotePrefix`)??``);d&&(n.quotePrefix=d)}processAlignment(e,t,n){let r={};if(r.horizontal=t?.hasAttribute(`horizontal`)?t.getAttribute(`horizontal`):o.HorizontalAlignment.General,r.vertical=t?.hasAttribute(`vertical`)?t.getAttribute(`vertical`):o.VerticalAlignment.Bottom,r.indent=t?.hasAttribute(`indent`)?parseInt(t.getAttribute(`indent`)):0,r.relativeIndent=t?.hasAttribute(`relativeIndent`)?parseInt(t.getAttribute(`relativeIndent`)):0,r.overflow=D(t?.getAttribute(`wrapText`)??``)?o.Overflow.Wrap:o.Overflow.Visible,D(t?.getAttribute(`shrinkToFit`)??``)&&(r.overflow=o.Overflow.Shrink),t?.hasAttribute(`textRotation`)){let e=parseFloat(t.getAttribute(`textRotation`));e>0&&e<=90?e=360-e:e>90&&e<=180?e-=90:e===255&&(e=0,r.stacked=!0),r.rotation=e}else r.rotation=0;t?.hasAttribute(`justifyLastLine`)&&(r.justifyLastLine=D(t.getAttribute(`justifyLastLine`)));let i=t?.getAttribute(`readingOrder`);return i&&(i===`0`?r.readingDirection=o.ReadingDirection.Auto:i===`1`?r.readingDirection=o.ReadingDirection.LeftToRight:i===`2`?r.readingDirection=o.ReadingDirection.RightToLeft:e.warn(`Invalid readingOrder '${i}'; the direction was left automatic.`,{onceKey:`xlsx.style.readingOrder`})),Object.keys(r).length>0&&(n.alignment=r),n}collectHiddenXfs(e){let t=new Set;if(!e)return t;let n=e.childNodes,r=0;for(let e=0;e<n.length;e++){let i=n.item(e);if(i.nodeType!==1||i.localName!==`xf`)continue;let a=i.childNodes;for(let e=0;e<a.length;e++){let n=a.item(e);n.nodeType===1&&n.localName===`protection`&&D(n.getAttribute(`hidden`)??``)&&t.add(r)}r++}return t}collectXfComplements(e){let t=new Map;if(!e)return t;let n=e.childNodes,r=0;for(let e=0;e<n.length;e++){let i=n.item(e);if(i.nodeType!==1||i.localName!==`xf`)continue;let a=q(i,`extLst`);if(a){let e=a.childNodes;for(let n=0;n<e.length;n++){let i=q(e.item(n),`xfComplement`),a=parseInt(i?.getAttribute(`i`)??``,10);isNaN(a)||t.set(r,a)}}r++}return t}processProtection(e,t,n){if(!t)return;let r=t.getAttribute(`locked`);return n.protection={alwaysUnlocked:!!r&&!D(r)},n}processDXF(e,t,n){if(!t)return;let r=t.childNodes,i=r.length;for(let t=0;t<i;t++){let i=r.item(t);if(i.nodeType===1&&i.localName===`font`){let t={};this.processFont(e,i,t),n.font=t}else if(i.nodeType===1&&i.localName===`fill`){let t=[];this.processFill(e,i,t,0),t.length>0&&t[0]&&(n.fill=t[0])}else if(i.nodeType===1&&i.localName===`border`){let t=[];this.processBorder(e,i,t,0,!1),t.length>0&&t[0]&&(n.borders=t[0])}else if(i.nodeType===1&&i.localName===`numFmt`){let e=i.getAttribute(`formatCode`);if(e)n.numberFormat=e;else{let e=i.getAttribute(`numFmtId`);e&&(n.numberFormat=Number(e))}}else i.nodeType===1&&i.localName===`alignment`&&this.processAlignment(e,i,n)}}processDXFs(e,t,n){if(!t)return;e.getVisitorParamsState().set(`processingDXFs`,!0);let r=new Map;e.getVisitorParamsState().set(`dxfs`,r);let i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let a=i.item(t);if(a.nodeType===1&&a.localName===`dxf`){let t={};this.processDXF(e,a,t);let i=n.length;r.set(i,t),n.push(t)}}e.getVisitorParamsState().delete(`processingDXFs`)}processSlicerStyles(e,t,n){if(!t)return;let r=null,i=null,a=t.childNodes;for(let e=0;e<a.length;e++){let t=a.item(e);if(t.nodeType!==1||t.localName!==`ext`)continue;let n=t.childNodes;for(let e=0;e<n.length;e++){let t=n.item(e);t.nodeType===1&&(t.localName===`dxfs`?r=t:t.localName===`slicerStyles`&&(i=t))}}if(!i)return;let o=[];if(r){e.getVisitorParamsState().set(`processingDXFs`,!0);let t=r.childNodes;for(let n=0;n<t.length;n++){let r=t.item(n);if(r.nodeType!==1||r.localName!==`dxf`)continue;let i={};this.processDXF(e,r,i),o.push(i)}e.getVisitorParamsState().delete(`processingDXFs`)}let s={},c=i.getAttribute(`defaultSlicerStyle`);c&&c!==`SlicerStyleLight1`&&(s.defaultSlicerStyle=c);let l=n.tables?.styles,u=i.childNodes;for(let t=0;t<u.length;t++){let n=u.item(t);if(n.nodeType!==1||n.localName!==`slicerStyle`)continue;let r=n.getAttribute(`name`);if(!r)continue;let i={},a=l?.[r];a&&!1===a.table&&!a.pivot&&(a.wholeTable&&(i.wholeTable=a.wholeTable),a.headerRow&&(i.headerRow=a.headerRow),delete l[r]);let c=e.evaluate(`slicerStyleElements`,n)?.childNodes,d=c?.length??0;for(let t=0;t<d;t++){let n=c.item(t);if(n.nodeType!==1||n.localName!==`slicerStyleElement`)continue;let r=n.getAttribute(`type`);if(!r||!Te.has(r))continue;let a=n.getAttribute(`dxfId`),s=a==null?void 0:o[parseInt(a)];s?i[r]=s:e.warn(`A slicer style names a format that does not exist (dxfId '${a}').`,{onceKey:`xlsx.style.slicerStyle.dxf`})}(s.styles??={})[r]=i}l&&Object.keys(l).length===0&&(delete n.tables.styles,Object.keys(n.tables).length===0&&delete n.tables),Object.keys(s).length>0&&(n.slicers=s)}processTableStyle(e,t,n,r,i=!1){let a=t.getAttribute(`name`),o={name:a};t.hasAttribute(`table`)&&(o.table=D(t.getAttribute(`table`))),t.hasAttribute(`pivot`)&&(o.pivot=D(t.getAttribute(`pivot`))),i&&!o.pivot&&r.unshift(null);let s=t.childNodes,c=s.length;for(let t=0;t<c;t++){let n=s.item(t);if(n.nodeType===1&&n.localName===`tableStyleElement`){let t=n.getAttribute(`type`),i=n.getAttribute(`dxfId`),a=i==null?void 0:r?.[i];a||=(e.warn(`A table style names a format that does not exist (dxfId '${i}').`,{onceKey:`xlsx.style.tableStyle.dxf`}),{}),o[t]=a;let s=null;n.hasAttribute(`size`)&&(s=parseInt(n.getAttribute(`size`))),s&&!isNaN(s)&&(a.size=s)}}delete o.name,n[a]=o}processTableStyles(e,t,n,r,i){if(!t)return;let a={},o=t.getAttribute(`defaultTableStyle`);o&&(a.defaultTableStyle=o);let s=t.getAttribute(`defaultPivotStyle`);s&&(a.defaultPivotStyle=s);let c=t.childNodes,l={},u=c.length;for(let t=0;t<u;t++){let n=c.item(t);n.nodeType===1&&n.localName===`tableStyle`&&this.processTableStyle(e,n,l,r,i)}return Object.keys(l).length>0&&(a.styles=l),Object.keys(a).length>0&&(n.tables=a),n}processCellStyles(e,t,n,i,a){if(!t)return;let o=t.childNodes,s=o.length;for(let e=0;e<s;e++){let t=o.item(e);if(t.nodeType===1&&t.localName===`cellStyle`){let e=parseInt(t.getAttribute(`xfId`)??``),o=t.getAttribute(`name`),s=t.getAttribute(`builtinId`),c=o;if(s!==null){let e=r.builtInNameFromId(parseInt(s));e!==void 0&&(c=e)}if(a.set(e,c),!i[e])continue;let l={name:c,style:i[e]};t.getAttribute(`hidden`)&&(l.hidden=D(t.getAttribute(`hidden`))),t.getAttribute(`iLevel`)&&(l.iLevel=parseInt(t.getAttribute(`iLevel`))),s!==null&&D(t.getAttribute(`customBuiltin`)??`0`)&&(l.customized=!0),n.push(l)}}}afterVisit(e,t,n){}},WorkbookVisitor:class extends G{visit(e,t,n){return this.processSheetRefs(e,e.evaluate(`sheets`,t),n),this.processExternalReferences(e,e.evaluate(`externalReferences`,t),n),this.processBookViews(e,e.evaluate(`bookViews`,t),n),this.processDefinedNames(e,e.evaluate(`definedNames`,t),n),this.processCalcPr(e,e.evaluate(`calcPr`,t),n),this.processPivotCaches(e,e.evaluate(`pivotCaches`,t),n),this.processWorkbookProtection(e,e.evaluate(`workbookProtection`,t),n),this.processWorkbookPr(e,e.evaluate(`workbookPr`,t),n),n}processPassword(e,t,n,r=`workbook`,i=`password`){if(!t)return;let a={};e.copyFromAttribute(t,`${r}AlgorithmName`,a,`algorithm`),e.copyFromAttribute(t,`${r}HashValue`,a,`hash`),e.copyFromAttribute(t,`${r}SaltValue`,a,`salt`),e.copyFromAttribute(t,`${r}SpinCount`,a,`spinCount`,e.INT_COPY),e.copyFromAttribute(t,`${r}Password`,a,`legacyHash`),Object.keys(a).length>0&&(n[i]=a)}processWorkbookProtection(e,t,n){if(!t)return;let r={};this.processPassword(e,t,r,`workbook`,`password`),this.processPassword(e,t,r,`revisions`,`revisionsPassword`);for(let e of re)r[e.key]=ae(e,t.getAttribute(e.attribute));return n.protection=r,n}processCalcPr(e,t,n){if(!t)return;let r={};e.copyFromAttribute(t,`calcMode`,r,`calcMode`,e=>Ee[e]??null),e.copyFromAttribute(t,`fullCalcOnLoad`,r,`fullCalcOnLoad`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`calcOnSave`,r,`calcOnSave`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`calcCompleted`,r,`calcCompleted`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`fullPrecision`,r,`fullPrecision`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`forceFullCalc`,r,`forceFullCalc`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`concurrentCalc`,r,`concurrentCalc`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`concurrentManualCount`,r,`concurrentManualCount`,e.INT_COPY),e.copyFromAttribute(t,`refMode`,r,`refMode`),e.copyFromAttribute(t,`iterate`,r,`iterate`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`iterateCount`,r,`maxIteration`,e.INT_COPY),e.copyFromAttribute(t,`iterateDelta`,r,`maxIterateChange`,e.FLOAT_COPY);let i=t.getAttribute(`calcId`);i!==null&&e.getVisitorParamsState().set(`calcId`,i),n.calc=r}processSheetRefs(e,t,n){if(!t)return;let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);n.nodeType===1&&n.localName===`sheet`&&this.processSheetRef(e,n,r)}n.sheets=r}processSheetRef(e,t,n){let r={};e.copyFromAttribute(t,`name`,r,`name`),e.copyFromAttribute(t,`state`,r,`visibility`),e.copyFromAttribute(t,`sheetId`,r,`sheetId`,e.INT_COPY);let i=t.getAttribute(`r:id`),a=i?te(e.getRelationships().get(i)?.type):null;if(a){let t=e.readEmbeddedPart(i);if(t?.xml){let e={part:t},i=ue(t.xml),o=i?T(e=>i.get(e)):void 0;o&&(e.tabColor=o),r.kind=a,r.sheet=e,n.push(r);return}e.warn(`The ${a} sheet '${r.name}' could not be read and was loaded as an empty worksheet.`),n.push(r);return}let o=i?e.getRef(i):null;o&&(r.sheet=o),n.push(r)}processExternalReferences(e,t,n){if(!t)return;let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);if(n.nodeType===1&&n.localName===`externalReference`){let t=n.getAttribute(`r:id`),i=t?e.getRef(t):null;r.push(i??null)}}r.length>0&&(n.externalBooks=r)}processPivotCaches(e,t,n){if(!t)return;let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);if(n.nodeType!==1||n.localName!==`pivotCache`)continue;let a=parseInt(n.getAttribute(`cacheId`)??``,10),o=n.getAttribute(`r:id`);if(isNaN(a)||!o)continue;let s=e.readEmbeddedPart(o);s&&r.push({cacheId:a,part:s})}r.length>0&&(n.pivotCaches=r)}processBookViews(e,t,n){if(!t)return;let r=t.childNodes,i=0,a=r.length;for(let t=0;i<1&&t<a;t++){let a=r.item(t);a.nodeType===1&&a.localName===`workbookView`&&(this.processWorkbookView(e,a,n),i++)}}processWorkbookView(e,t,n){if(!t)return;let r={},i=[`xWindow`,`yWindow`,`windowWidth`,`windowHeight`].map(e=>parseInt(t.getAttribute(e)??``,10));if(i.some(e=>Number.isFinite(e))){let[e,t,n,a]=i.map(e=>Number.isFinite(e)?e:0);r.windowBounds={left:e,top:t,width:n,height:a}}e.copyFromAttribute(t,`activeTab`,r,`activeSheetId`,[e.INT_COPY,e=>e]),t.hasAttribute(`activeTab`)||(r.activeSheetId=0),e.copyFromAttribute(t,`showHorizontalScroll`,r,`showHorizontalScrollbar`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`showVerticalScroll`,r,`showVerticalScrollbar`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`showSheetTabs`,r,`showTabs`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`tabRatio`,r,`tabRatio`,[e.FLOAT_COPY,e=>e]),e.copyFromAttribute(t,`firstSheet`,r,`firstTab`,[e.INT_COPY,e=>e]),e.copyFromAttribute(t,`minimized`,r,`minimized`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`autoFilterDateGrouping`,r,`autoFilterDateGrouping`,e.BOOLEAN_COPY);let a=t.getAttribute(`visibility`);a!==`hidden`&&a!==`veryHidden`||(r.visibility=a),Object.keys(r).length>0&&(n.view=r)}processDefineName(e,t,n,r){if(!t)return;let i={},a=t.firstChild;if(a&&a.nodeType===3&&(i.ref=a.textContent),e.copyFromAttribute(t,`name`,i),e.copyFromAttribute(t,`comment`,i),e.copyFromAttribute(t,`hidden`,i,`hidden`,e.BOOLEAN_COPY),t.hasAttribute(`localSheetId`)){let n=t.getAttribute(`localSheetId`);if(!r[n]?.name)return void e.warn(`Defined name '${t.getAttribute(`name`)}' references a sheet with localSheetId '${n}' which does not exist.`);i.scope=r[n].name}let o={};for(let n of L)e.copyFromAttribute(t,n,o);for(let e of R){let n=t.getAttribute(e);n!==`1`&&n!==`true`||(o[e]=!0)}e.copyFromAttribute(t,`functionGroupId`,o,`functionGroupId`,e.INT_COPY),Object.keys(o).length>0&&(i.fileAttributes=o),Object.keys(i).length>0&&n.push(i)}processDefinedNames(e,t,n){if(!t)return;let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let a=i.item(t);a.nodeType===1&&a.localName===`definedName`&&this.processDefineName(e,a,r,n.sheets)}r.length>0&&(n.names=r)}processWorkbookPr(e,t,n){t&&(e.copyFromAttribute(t,`date1904`,n,`date1904`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`codeName`,n,`codeName`),e.copyFromAttribute(t,`updateLinks`,n,`updateLinks`))}afterVisit(e,t,n){}},TableVisitor:class{visit(e,t,n){let r={};return e.copyFromAttribute(t,`ref`,n,`r`),e.getVisitorParamsState().set(`ref`,n.r),n.v=r,e.copyFromAttribute(t,`name`,r),e.copyFromAttribute(t,`displayName`,r,`name`),e.copyFromAttribute(t,`headerRowCount`,r,`headerRowCount`,e.INT_COPY),e.copyFromAttribute(t,`totalsRowCount`,r,`totalsRowCount`,e.INT_COPY),this.processTableColumns(e,t,r),this.processTableStyleInfo(e,t,r),e.copyFromAttribute(t,`id`,r),e.copyFromAttribute(t,`comment`,r,`description`),e.copyFromAttribute(t,`connectionId`,r,`connectionId`,e.INT_COPY),e.copyFromAttribute(t,`tableType`,r),e.copyFromAttribute(t,`published`,r,`published`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`insertRow`,r,`insertRow`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`insertRowShift`,r,`insertRowShift`,e.BOOLEAN_COPY),r.totalsRowShown=t.getAttribute(`totalsRowShown`)!==`0`,r}afterVisit(e,t,n){let r=n.v;if(e.evaluate(`autoFilter`,t)){if(Array.isArray(r.hiddenButtons)){let e=r.hiddenButtons.length;e===0?r.hiddenButtons=!1:e===r.columns?.length&&(r.hiddenButtons=!0)}}else r.hiddenButtons=!0,r.showButtons=!1;return r}processTableStyleInfo(e,t,n){if(!t)return;let r=t.childNodes,i={},a=r.length;for(let t=0;t<a;t++){let n=r.item(t);n.nodeType===1&&n.localName===`tableStyleInfo`&&(e.copyFromAttribute(n,`name`,i),e.copyFromAttribute(n,`showColumnStripes`,i,`showColumnStripes`,e.BOOLEAN_COPY),e.copyFromAttribute(n,`showFirstColumn`,i,`showFirstColumn`,e.BOOLEAN_COPY),e.copyFromAttribute(n,`showLastColumn`,i,`showLastColumn`,e.BOOLEAN_COPY),e.copyFromAttribute(n,`showRowStripes`,i,`showRowStripes`,e.BOOLEAN_COPY))}Object.keys(i).length>0&&(n.style=i)}processTableColumn(e,t,n){if(!t)return null;let r=t.childNodes,i=r.length;for(let t=0;t<i;t++){let i=r.item(t);if(i.nodeType===1&&i.localName===`tableColumn`){let t={};e.copyFromAttribute(i,`name`,t),e.copyFromAttribute(i,`id`,t),e.copyFromAttribute(i,`uniqueName`,t),e.copyFromAttribute(i,`queryTableFieldId`,t),e.copyFromAttribute(i,`totalsRowLabel`,t);let r=i.getAttribute(`totalsRowFunction`);if(r!==null){if(r===`custom`){let n=e.evaluate(`totalsRowFormula`,i);n&&(t.totalsRowFormula=n.textContent)}else t.totalsRowFormula=r}e.copyFromAttribute(i,`totalsRowLabel`,t);let a=e.evaluate(`calculatedColumnFormula`,i);a?.textContent&&(t.calculatedColumnFormula=a.textContent),n.push(t)}}return n}processTableColumns(e,t,n){let r=t.childNodes,i=[],a=r.length;for(let t=0;t<a;t++){let n=r.item(t);n.nodeType===1&&n.localName===`tableColumns`&&this.processTableColumn(e,n,i)}i.length>0&&(n.columns=i)}},TableX14Visitor:class{visit(e,t,n){let r=e.getVisitorParamsState().get(`ref`);if(r){let n=e.getVisitorParamsState().get(`descriptions`);n&&(n.add(r,t.getAttribute(`altText`)),n.add(r,t.getAttribute(`altTextSummary`)))}return e.copyFromAttribute(t,`altText`,n),e.copyFromAttribute(t,`altTextSummary`,n),n}},ExternalLinkVisitor:class{visit(e,t,n){let r=t.childNodes,i=r.length,a=null;for(let e=0;e<i;e++){let t=r.item(e);if(t.nodeType===1){t.localName===`externalBook`&&(a=t);break}}if(!a)return n;t.getAttribute(`mc:Ignorable`)&&(n.mceIgnorable=!0);let o=a.getAttribute(`r:id`);o&&(n.__bookRelId=o);let s=this._findAbsoluteUrlRelId(a);return s&&(n.__absoluteUrlRelId=s),n.sheetNames=[],this.processSheetNames(e,a,n),this.processDefinedNames(e,a,n),this.processSheetDataSet(e,a,n),n}processSheetNames(e,t,n){let r=this._findChild(t,`sheetNames`);if(!r)return;let i=r.childNodes,a=i.length;for(let e=0;e<a;e++){let t=i.item(e);t.nodeType===1&&t.localName===`sheetName`&&n.sheetNames.push(t.getAttribute(`val`)??``)}}processDefinedNames(e,t,n){let r=this._findChild(t,`definedNames`);if(!r)return;let i=[],a=r.childNodes,o=a.length;for(let e=0;e<o;e++){let t=a.item(e);if(t.nodeType!==1||t.localName!==`definedName`)continue;let n=t.getAttribute(`name`);if(!n)continue;let r={name:n,refersTo:t.getAttribute(`refersTo`)??``},o=t.getAttribute(`sheetId`);o!==null&&(r.sheetIndex=parseInt(o,10)),i.push(r)}i.length>0&&(n.definedNames=i)}processSheetDataSet(e,t,n){let r=this._findChild(t,`sheetDataSet`);if(!r)return;let i=[],a=r.childNodes,o=a.length;for(let t=0;t<o;t++){let n=a.item(t);if(n.nodeType!==1||n.localName!==`sheetData`)continue;let r=n.getAttribute(`sheetId`);if(r===null)continue;let o=this.processSheetData(e,n);o.sheetIndex=parseInt(r,10),n.getAttribute(`refreshError`)===`1`&&(o.refreshError=!0),i.push(o)}i.length>0&&(n.sheetDataSet=i)}processSheetData(e,t){let n=new f.Builder,r=t.childNodes,i=r.length;for(let e=0;e<i;e++){let t=r.item(e);if(t.nodeType!==1||t.localName!==`row`)continue;let i=t.childNodes,a=i.length;for(let e=0;e<a;e++){let t=i.item(e);if(t.nodeType!==1||t.localName!==`cell`)continue;let r=t.getAttribute(`r`);if(!r)continue;let a=u.fastStringToCell(r);if(a?.rowIndex===void 0||a?.colIndex===void 0)continue;let o=this._readCellValue(t);o!==void 0&&n.pushAt(a.rowIndex,a.colIndex,o)}}return{sheetIndex:-1,data:n.build()?.tuples??[]}}_readCellValue(e){let t=this._findChild(e,`v`)?.textContent?.trim();if(t!==void 0&&t!==``)switch(e.getAttribute(`t`)){case null:case`n`:return parseFloat(t);case`b`:return t===`1`||t===`true`;case`str`:default:return t;case`e`:{let e=l.getBuiltInByLabel(t);return e?{t:`e`,v:e.getCode()}:t}}}_findChild(e,t){let n=e.childNodes,r=n.length;for(let e=0;e<r;e++){let r=n.item(e);if(r.nodeType===1&&r.localName===t)return r}return null}_findAbsoluteUrlRelId(e){let t=this._findChild(e,`alternateUrls`);return t?this._findChild(t,`absoluteUrl`)?.getAttribute(`r:id`)??null:null}},SlicerCacheDefinitionVisitor:class{visit(e,t,n){e.copyFromAttribute(t,`name`,n,`cacheName`),e.copyFromAttribute(t,`sourceName`,n);let r=e.evaluate(`*/tableSlicerCache`,t);return r?(e.copyFromAttribute(r,`tableId`,n),e.copyFromAttribute(r,`column`,n,`columnId`),e.copyFromAttribute(r,`sortOrder`,n),e.copyFromAttribute(r,`customListSort`,n,`customListSort`,e.BOOLEAN_COPY),e.copyFromAttribute(r,`crossFilter`,n),n):(e.warn(`A slicer names no table; it was not imported.`,{onceKey:`xlsx.slicer.cacheDefinition`}),n)}},SlicersVisitor:class{visit(e,t,n){let r=n.slicers;r||(r={},n.slicers=r);let i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);n.nodeType===1&&n.localName===`slicer`&&this.processSlicer(e,n,r)}return r}processSlicer(e,t,n){if(!t)return;let r={};n[t.getAttribute(`name`)]=r,e.copyFromAttribute(t,`xr10:uid`,r,`uid`);let i=t.getAttribute(`cache`),a=e.getVisitorParamsState().get(`slicerCaches`),o=i?a?.get(i):void 0;if(o)for(let e=0;e<J.length;e++){let t=J[e];o[t]!==void 0&&(r[t]=o[t])}e.copyFromAttribute(t,`caption`,r),e.copyFromAttribute(t,`startItem`,r,`startItem`,e.INT_COPY),e.copyFromAttribute(t,`columnCount`,r,`columnCount`,e.INT_COPY),e.copyFromAttribute(t,`showCaption`,r,`showCaption`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`level`,r,`level`,e.INT_COPY),e.copyFromAttribute(t,`style`,r),e.copyFromAttribute(t,`lockedPosition`,r,`lockedPosition`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`rowHeight`,r,`rowHeight`,e.INT_COPY)}},FormControlPrVisitor:class{visit(e,t,n){let r={},i=t.attributes;for(let e=0;e<i.length;e++){let t=i.item(e),n=t.name;n===`xmlns`||n.startsWith(`xmlns:`)||(r[n]=t.value)}let a=[],o,s=t.childNodes;for(let t=0;t<s.length;t++){let n=s.item(t);if(n.nodeType===1){if(n.localName===`itemLst`){let e=n.childNodes;for(let t=0;t<e.length;t++){let n=e.item(t);n.nodeType===1&&n.localName===`item`&&a.push(n.getAttribute(`val`)??``)}}else n.localName===`extLst`&&(o=e.serializeElement(n)??void 0)}}let c=fe(r,a,o);return n.formControl=c,c}},DrawingVisitor:class{visit(e,t,n){return n}afterVisit(e,t,n){for(let e of n?.movables??[])Y(e,!1)}},DrawingAnchorVisitor:class{visit(e,t,n){if(!t)return;let r={};e.copyFromAttribute(t,`editAs`,r,`anchorType`),r.anchor={},t.localName===`absoluteAnchor`?(r.anchorType=`absolute`,this.processAbsoluteCoord(e,e.evaluate(`pos`,t),r.anchor,`from`,`x`,`y`),this.processAbsoluteCoord(e,e.evaluate(`ext`,t),r.anchor,`to`,`cx`,`cy`)):t.localName===`oneCellAnchor`?(this.processOffsetCoord(e,e.evaluate(`from`,t),r.anchor,`from`),this.processAbsoluteCoord(e,e.evaluate(`ext`,t),r.anchor,`to`,`cx`,`cy`)):(this.processOffsetCoord(e,e.evaluate(`from`,t),r.anchor,`from`),this.processOffsetCoord(e,e.evaluate(`to`,t),r.anchor,`to`));let i=e.evaluate(`clientData`,t),a=e=>{let t=i?.getAttribute(e);return t===`0`||t===`false`};return a(`fPrintsWithSheet`)&&(r.noPrint=!0),a(`fLocksWithSheet`)&&(r.unlocked=!0),n.movables||=[],n.movables.push(r),r}processAbsoluteCoord(e,t,n,r,i,a){if(!t)return;let o={x:0,y:0};return o.x=k(t.getAttribute(i)),o.y=k(t.getAttribute(a)),r===`from`?n.tl=o:n.br=o,n}processOffsetCoord(e,t,n,r){if(!t)return;let i={c:0,r:0,x:0,y:0};return e.evaluate(`col`,t)&&(i.c=parseInt(e.evaluate(`col`,t).textContent)),e.evaluate(`row`,t)&&(i.r=parseInt(e.evaluate(`row`,t).textContent)),e.evaluate(`colOff`,t)&&(i.x=k(e.evaluate(`colOff`,t).textContent)),e.evaluate(`rowOff`,t)&&(i.y=k(e.evaluate(`rowOff`,t).textContent)),r===`from`?n.tl=i:n.br=i,n}},DrawingGraphicFrameVisitor:class extends H{visit(e,t,n){if(!t)return;if(this.isGroupContent(n)){if(e.getPath().includes(`Fallback`))return{};let{movable:r}=this.readMemberHeader(e,t,`graphicFrame`),i=e.evaluate(`xfrm`,t);if(i){C(i,r);let t=e.evaluate(`off`,i),n=e.evaluate(`ext`,i);r.anchor={tl:{x:k(t?.getAttribute(`x`)??null)??0,y:k(t?.getAttribute(`y`)??null)??0},br:{x:k(n?.getAttribute(`cx`)??null)??0,y:k(n?.getAttribute(`cy`)??null)??0}}}let a=this.readGraphic(e,t),o=a.type===`chart`?{...r.content.json,...a.json}:a.json;return r.content={...r.content,type:a.type,json:o},n.members.push(r),a.json}n=super.visit(e,t,n);let r=e.evaluate(`nvGraphicFramePr/cNvGraphicFramePr`,t);if(r){let t=e.evaluate(`graphicFrameLocks`,r);t&&t.hasAttribute(`noChangeAspect`)&&(n.lockAspect=t.getAttribute(`noChangeAspect`)===`1`)}let i=this.readGraphic(e,t);return this.setContent(n,i),i}readGraphic(e,t){let n=e.evaluate(`graphic/graphicData`,t),r={type:`graphicFrame`,json:{}};if(!n)return r;let i=n.childNodes,a=i.length;for(let n=0;n<a;n++){let a=i.item(n);if(a.nodeType===1)try{let n=a.localName;n===`chart`?n=`chart`:n===`slicer`&&(n=`slicer`),r.type=n;let i=a.getAttribute(`r:id`);if(n===`chart`&&i){let n=this.readSourceId(e,t),a=e.readEmbeddedPart(i)??void 0,o;try{let t=a?.xml?_e(a.xml):null;o=t?.model,t?.lossy&&e.warn(`A chart states something its model does not; it is saved as it was until it is changed.`,{onceKey:`xlsx.chart.lossy`})}catch(t){e.warn(`A chart could not be read into the chart model; it is kept as its markup: ${t?.message??t}`,{onceKey:`xlsx.chart.model`})}r.json={sourceId:n,part:a,model:o}}else if(n===`slicer`){let n=this.readSourceId(e,t);n!==void 0&&(r.json={sourceId:n})}else i&&(r.json=e.getRef(i))}catch(t){e.warn(`Unable to read a graphic frame: ${t?.message??t}`,{onceKey:`xlsx.drawing.graphicFrame`})}}return r}},DrawingSpVisitor:X,DrawingPicVisitor:class extends H{visit(e,t,n){if(!t)return;if(this.isGroupContent(n)){if(e.getPath().includes(`Fallback`))return{};let{movable:r,content:i}=this.readMemberHeader(e,t,`picture`),a=this.readImage(e,t);return a?(this.readPictureDetails(e,t,a,r,i),n.members.push(r),i):{}}let r=super.visit(e,t,n),i=this.readImage(e,t);if(i===null)return;let a={},o=this.readSourceId(e,t);return o!==void 0&&(a.sourceId=o),this.readPictureDetails(e,t,i,r,a),this.setContent(r,{type:`picture`,json:a}),a}readPictureDetails(e,t,n,r,i){n?.resId!==void 0&&(i.resId=n.resId),n?.image&&(i.image=n.image);let a=t.getAttribute(`macro`);a&&(i.macro=a),t.hasAttribute(`fPublished`)&&(i.published=D(t.getAttribute(`fPublished`)));let o=e.evaluate(`nvPicPr/cNvPicPr`,t);if(o?.getAttribute){o.getAttribute(`preferRelativeResize`)===`0`&&(i.noRelativeResize=!0);let t=this.readLocks(e.evaluate(`picLocks`,o));t&&(i.locks=t),r.lockAspect=t?.noChangeAspect??!1}}readImage(e,t){let n=e.evaluate(`blipFill`,t),r=n?e.evaluate(`blip`,n):null;if(!r)return;if(!(r.getAttribute(`r:embed`)??r.getAttribute(`embed`)??r.getAttribute(`r:link`)??r.getAttribute(`link`)))return e.warn(`A picture names no image; it was not imported.`,{onceKey:`xlsx.drawing.picture.noRel`}),null;let{type:i,resId:a,...o}=new h().processImageFill(e,n);return!o.tile&&o.stretch&&Object.keys(o.stretch).length===0&&delete o.stretch,o.extLst&&De.test(o.extLst)&&delete o.extLst,{resId:a,image:Object.keys(o).length>0?o:void 0}}},DrawingGrpSpVisitor:class extends H{constructor(...e){super(...e),this._fills=new h}visit(e,t,n){if(!t)return;let r=this.isGroupContent(n),i,a;if(r){if(e.getPath().includes(`Fallback`))return{};let r=this.readMemberHeader(e,t,`group`);i=r.movable,a=r.content,n.members.push(i)}else{if(e.getPath().includes(`Fallback`)&&n.content)return{};i=super.visit(e,t,n),a={};let r=this.readSourceId(e,t);r!==void 0&&(a.sourceId=r),this.setContent(i,{type:`group`,json:a})}a.members=[];let o=e.evaluate(`nvGrpSpPr/cNvGrpSpPr/grpSpLocks`,t);o?.hasAttribute?.(`noChangeAspect`)&&(i.lockAspect=o.getAttribute(`noChangeAspect`)===`1`);let s=this.readLocks(o);s&&(a.locks=s);let c=e.evaluate(`grpSpPr`,t);if(c){let t=e.evaluate(`xfrm`,c);if(t){C(t,i),t.getAttribute(`flipH`)===`1`&&(i.flipH=!0),t.getAttribute(`flipV`)===`1`&&(i.flipV=!0);let n=Z(e,t,`off`,`ext`),o=Z(e,t,`chOff`,`chExt`)??n;o&&(a.childBounds=o),r&&n&&(i.anchor={tl:{x:n.x,y:n.y},br:{x:n.width,y:n.height}})}let n=this._fills.getFill(e,c);n&&Object.keys(n).length>0&&(a.fill=n);let o=this._fills.getEffects(e,c);o&&(a.effects=o);let s=e.evaluate(`scene3d`,c),l=s?e.serializeElement(s):null;l&&(a.scene3d=l);let u=e.evaluate(`extLst`,c),d=u?e.serializeElement(u):null;d&&(a.extLst={...a.extLst,properties:d})}return a}},DrawingCxnSpVisitor:class extends X{visit(e,t,n){if(t)return this.visitShape(e,t,n,`cxnSp`,`nvCxnSpPr/cNvCxnSpPr/cxnSpLocks`)}},MetadataVisitor:class{visit(e,t,n){let r=[],i=new Map,a={cells:[],values:[]},o=t.childNodes;for(let e=0;e<o.length;e++){let t=o.item(e);if(t.nodeType===1)switch(t.localName){case`metadataTypes`:this._parseMetadataTypes(t,r,i);break;case`futureMetadata`:this._attachFutureMetadata(t,i);break;case`cellMetadata`:this._resolveBlocks(t,r,a.cells);break;case`valueMetadata`:this._resolveBlocks(t,r,a.values)}}return n.metadata=a,a}_parseMetadataTypes(e,t,n){let r=e.childNodes;for(let e=0;e<r.length;e++){let i=r.item(e);if(i.nodeType===1&&i.localName===`metadataType`){let e=this._parseMetadataType(i);t.push(e),n.set(e.name,e)}}}_parseMetadataType(e){let t={name:e.getAttribute(`name`)??``,_blocks:[]},n=e.getAttribute(`minSupportedVersion`);n!=null&&(t.minSupportedVersion=Number(n));for(let n of[`copy`,`pasteAll`,`pasteValues`,`merge`,`splitFirst`,`splitAll`,`rowColShift`,`clearFormats`,`clearComments`,`assign`,`coerce`,`cellMeta`,`adjust`,`trans`,`delete`,`edit`])e.getAttribute(n)===`1`&&(t[n]=!0);return t}_attachFutureMetadata(e,t){let n=e.getAttribute(`name`)??``,r=t.get(n);if(!r)return;let i=e.childNodes;for(let e=0;e<i.length;e++){let t=i.item(e);t.nodeType===1&&t.localName===`bk`&&r._blocks.push(this._parseFutureBlock(t))}}_parseFutureBlock(e){let t={},n=e.childNodes;for(let e=0;e<n.length;e++){let r=n.item(e);if(r.nodeType!==1||r.localName!==`extLst`)continue;let i=r.childNodes;for(let e=0;e<i.length;e++){let n=i.item(e);if(n.nodeType!==1||n.localName!==`ext`)continue;let r=n.childNodes;for(let e=0;e<r.length;e++){let n=r.item(e);n.nodeType===1&&(n.localName===`dynamicArrayProperties`?(t.fDynamic=n.getAttribute(`fDynamic`)===`1`,t.fCollapsed=n.getAttribute(`fCollapsed`)===`1`):n.localName===`rvb`&&(t.richValueIndex=Number(n.getAttribute(`i`)??`0`)))}}}return t}_resolveBlocks(e,t,n){let r=e.childNodes;for(let e=0;e<r.length;e++){let i=r.item(e);i.nodeType===1&&i.localName===`bk`&&n.push(this._resolveBlock(i,t))}}_resolveBlock(e,t){let n=new Map,r=e.childNodes;for(let e=0;e<r.length;e++){let i=r.item(e);if(i.nodeType!==1||i.localName!==`rc`)continue;let a=Number(i.getAttribute(`t`)),o=Number(i.getAttribute(`v`)),s=t[a-1];if(!s)continue;let{_blocks:c,...l}=s,u={...l};for(let e of Object.keys(u))u[e]===void 0&&delete u[e];let d=c[o];d&&(d.fDynamic!==void 0&&(u.fDynamic=d.fDynamic,u.fCollapsed=d.fCollapsed??!1),d.richValueIndex!==void 0&&(u.richValueIndex=d.richValueIndex)),n.set(s.name,u)}return n}},FeaturePropertyBagVisitor:class{visit(e,t,n){let r=[],i=t.childNodes;for(let e=0;e<i.length;e++){let t=i.item(e);t.nodeType===1&&t.localName===`bag`&&r.push(this._readBag(t))}let a=[],o=r.find(e=>e.type===`XFComplements`)?.arrays.get(`MappedFeaturePropertyBags`)??[];for(let t=0;t<o.length;t++){let n=r[o[t]]?.ids.get(`XFControls`),i=n===void 0?void 0:r[n]?.ids.get(`CellControl`),s=i===void 0?void 0:r[i]?.type,c=s?Oe[s]:void 0;c||e.warn(`A cell format's feature '${s??`unknown`}' is not read; its cells keep their values.`),a.push(c?{type:c}:null)}let s={controls:a};return n.featurePropertyBag=s,s}_readBag(e){let t={type:e.getAttribute(`type`)??``,ids:new Map,arrays:new Map},n=e.childNodes;for(let e=0;e<n.length;e++){let r=n.item(e);if(r.nodeType!==1)continue;let i=r.getAttribute(`k`)??``;if(r.localName===`bagId`){let e=parseInt(r.textContent??``,10);isNaN(e)||t.ids.set(i,e)}else if(r.localName===`a`){let e=[],n=r.childNodes;for(let t=0;t<n.length;t++){let r=n.item(t);if(r.nodeType!==1||r.localName!==`bagId`)continue;let i=parseInt(r.textContent??``,10);isNaN(i)||e.push(i)}t.arrays.set(i,e)}}return t}},CommentsVisitor:class{visit(e,t,n){if(!t)return;let r=[];this.processAuthors(e,e.evaluate(`authors`,t),r),r.length>0&&(n.authors=r);let i=[];return n.comments=i,i}processAuthors(e,t,n){if(!t)return;let r=t.childNodes,i=r.length;for(let e=0;e<i;e++){let t=r.item(e);if(t.nodeType===1&&t.localName===`author`){let e=t.firstChild;e&&e.nodeType===3&&n.push(e.textContent)}}}},CommentVisitor:class{visit(e,t,n){if(!t)return;let r=t.getAttribute(`ref`);if(!r)return;let i={content:``};if(t.hasAttribute(`authorId`)){let e=parseInt(t.getAttribute(`authorId`),10);isNaN(e)||(i.authorId=e)}return i.content=function(e){if(!e)return``;let t=[],n=!0,r=e.childNodes;for(let e=0;e<r.length;e++){let i=r.item(e);if(i.nodeType===1){if(i.localName===`t`)t.push({text:i.textContent??``});else if(i.localName===`r`){let e={text:``},r=i.childNodes;for(let t=0;t<r.length;t++){let n=r.item(t);if(n.nodeType===1){if(n.localName===`t`)e.text+=n.textContent??``;else if(n.localName===`rPr`){let t=Ae(n);t&&(e.font=t)}}}e.font&&(n=!1),t.push(e)}}}return t.length===0?e.textContent??``:n?t.map(e=>e.text).join(``):{runs:t}}(e.evaluate(`text`,t)),n.push({r,v:i}),i}},ThreadedCommentsVisitor:class{visit(e,t,n){if(!t)return;let r=[];return n.comments=r,r}},ThreadedCommentVisitor:class{visit(e,t,n){if(!t)return;let r={};e.copyFromAttribute(t,`id`,r,`id`,S);let i=t.getAttribute(`ref`);e.copyFromAttribute(t,`personId`,r,`personId`,S),e.copyFromAttribute(t,`parentId`,r,`parentId`,S);let a=t.getAttribute(`dT`);a&&(r.dt=function(e){let t=/^(.*T\d{2}:\d{2}:\d{2})(?:\.(\d+))?(Z|[+-]\d{2}:?\d{2})?$/i.exec(e.trim());if(!t)return e;let[,n,r,i]=t;return`${n}${r?`.${(r+`00`).substring(0,3)}`:``}${i??`Z`}`}(a)),t.hasAttribute(`done`)&&(r.done=D(t.getAttribute(`done`)));let o=function(e){let t,n=e.childNodes;for(let e=0;e<n.length;e++){let r=n.item(e);if(r.nodeType!==1||r.localName!==`mentions`)continue;let i=r.childNodes;for(let e=0;e<i.length;e++){let n=i.item(e);if(n.nodeType!==1||n.localName!==`mention`)continue;let r=n.getAttribute(`mentionId`),a=n.getAttribute(`mentionpersonId`);if(!r||!a)continue;let o={id:S(r),personId:S(a)},s=parseInt(n.getAttribute(`startIndex`)??``,10);isNaN(s)||(o.startIndex=s);let c=parseInt(n.getAttribute(`length`)??``,10);isNaN(c)||(o.length=c),(t??=[]).push(o)}}return t}(t);return o&&(r.mentions=o),n.push({r:i,v:r}),r}},PersonListVisitor:class{visit(e,t,n){let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);if(n.nodeType===1&&n.localName===`person`){let t={};e.copyFromAttribute(n,`id`,t,`id`,S),e.copyFromAttribute(n,`displayName`,t),e.copyFromAttribute(n,`userId`,t,`userId`,S),e.copyFromAttribute(n,`providerId`,t),r.push(t)}}return r.length>0&&(n.persons=r),r}}},je=class{constructor(e,t){this.path=e,this.visitor=t}},Me=class{constructor(){this.visitorsByXmlTagName=new Map,this.scopedVisitorsByXmlTagName=new Map,this.visitorParamsState=null,this.registerVisitor(`Relationships`,new $.RelsVisitor),this.registerVisitor(`cp:coreProperties`,new $.CorePropertiesVisitor),this.registerVisitor(`Properties`,new $.AppPropertiesVisitor),this.registerVisitor(`spPr`,new $.ShapePropertiesVisitor),this.registerVisitor(`txBody`,new $.ShapeTextVisitor),this.registerVisitor(`txPr`,new $.TextPropertiesVisitor),this.registerVisitor(`a:theme`,new $.ThemeVisitor),this.registerVisitor(`a:theme`,new $.ClrSchemeVisitor,`themeElements/clrScheme`),this.registerVisitor(`a:theme`,new $.FontSchemeVisitor,`themeElements/fontScheme`),this.registerVisitor(`a:theme`,new $.FmtSchemeVisitor,`themeElements/fmtScheme`),this.registerVisitor(`a:theme`,new $.ObjectDefaultsVisitor,`objectDefaults`),this.registerVisitor(`autoFilter`,new $.AutoFilterVisitor),this.registerVisitor(`sortState`,new $.SortStateVisitor),this.registerVisitor(`s:workbook`,new $.WorkbookVisitor),this.registerVisitor(`styleSheet`,new $.SheetStyleVisitor),this.registerVisitor(`x14:table`,new $.TableX14Visitor),this.registerVisitor(`table`,new $.TableVisitor),this.registerVisitor(`externalLink`,new $.ExternalLinkVisitor),this.registerVisitor(`wsDr`,new $.DrawingVisitor),this.registerVisitor(`twoCellAnchor`,new $.DrawingAnchorVisitor),this.registerVisitor(`oneCellAnchor`,new $.DrawingAnchorVisitor),this.registerVisitor(`absoluteAnchor`,new $.DrawingAnchorVisitor),this.registerVisitor(`graphicFrame`,new $.DrawingGraphicFrameVisitor),this.registerVisitor(`sp`,new $.DrawingSpVisitor),this.registerVisitor(`grpSp`,new $.DrawingGrpSpVisitor),this.registerVisitor(`cxnSp`,new $.DrawingCxnSpVisitor),this.registerVisitor(`pic`,new $.DrawingPicVisitor),this.registerVisitor(`metadata`,new $.MetadataVisitor),this.registerVisitor(`FeaturePropertyBags`,new $.FeaturePropertyBagVisitor),this.registerVisitor(`comments`,new $.CommentsVisitor),this.registerVisitor(`comment`,new $.CommentVisitor),this.registerVisitor(`ThreadedComments`,new $.ThreadedCommentsVisitor),this.registerVisitor(`threadedComment`,new $.ThreadedCommentVisitor),this.registerVisitor(`threadedComment`,new $.TextPropertiesVisitor(`content`),`text`),this.registerVisitor(`personList`,new $.PersonListVisitor),this.registerVisitor(`slicerCacheDefinition`,new $.SlicerCacheDefinitionVisitor),this.registerVisitor(`slicers`,new $.SlicersVisitor),this.registerVisitor(`formControlPr`,new $.FormControlPrVisitor)}registerVisitor(e,t,n=null){e.indexOf(`:`)===-1&&(e=`*:`+e);let r=e.split(`:`),i=r.length>1?r[1]:r[0];if(!n)return this.visitorsByXmlTagName.set(i,t),void this.visitorsByXmlTagName.set(e,t);let a=this.scopedVisitorsByXmlTagName.get(i);a||(a=[],this.scopedVisitorsByXmlTagName.set(i,a),this.scopedVisitorsByXmlTagName.set(e,a)),a.push(new je(n,t))}parseDxf(t,n=``,r=e.EmptyObject){this.visitorParamsState||=new Map;let i=this.visitorParamsState,a=i.get(`processingDXFs`);i.set(`processingDXFs`,!0);try{let e=new z(null,this,`/dxf`,t,{},n,r),i={};return new $.SheetStyleVisitor().processDXF(e,t,i),i}finally{a===void 0?i.delete(`processingDXFs`):i.set(`processingDXFs`,a)}}getVisitorParamsState(){return this.visitorParamsState}transform(t,n,r=e.EmptyObject){let i=t.documentElement;this.visitorParamsState&&!r?.paramMap||(this.visitorParamsState=r?.paramMap??new Map);let a={},o=this.visitorsByXmlTagName.get(i.nodeName);if(o||=this.visitorsByXmlTagName.get(i.localName),!o)throw Error(`A visitor for the root element: '${i.nodeName}' or '${i.localName}' must be registered.`);let s=`/`+i.localName,c=new z(null,this,s,i,a,n,r),l=[];this._doWalk(o,c,l,i,a,n,r);let u=l.length;for(let e=0;e<u;e++){let t=l[e];try{t.visitor?.afterVisit?.(t.context,t.elemParent,t.jsonParent)}catch(e){t.context.warn(`Unable to finish reading '${t.context.getPath()}': ${e?.message??e}`,{onceKey:`xlsx.transform.afterVisit`})}}return a}_walkScoped(e,t,n,r,i,a,o){let s=this.scopedVisitorsByXmlTagName.get(e),c=s?s.length:0;for(let l=0;l<c;l++){let c=s[l],u=null;try{u=t.evaluate(c.path,r)}catch{t.warn(`Invalid path '${c.path}' for '${e}'.`,{onceKey:`xlsx.transform.invalidPath`})}if(!u)continue;let d=e=>{let s=e.localName,l=e.parentNode;for(;l&&l!==r;)s=l.localName+`/`+s,l=l.parentNode;let u=t.getPath()+`/`+s;if(c.visitor){let r=new z(t,this,u,t.getElemRoot(),t.getJsonRoot(),a,o);this._doWalk(c.visitor,r,n,e,i,a,o)}};if(u.length>0){let e=u,t=e.length;for(let n=0;n<t;n++)d(e.item(n))}else d(u)}}_doWalk(e,t,n,r,i,a,o){let s=null;e&&(n.push({visitor:e,context:t,elemParent:r,jsonParent:i}),s=e.visit(t,r,i)),s||=i;let c=r.localName;this._walkScoped(c,t,n,r,s,a,o);let l=this.visitorsByXmlTagName,u=t.getElemRoot(),d=t.getJsonRoot(),f=r.childNodes,p=f.length;for(let e=0;e<p;e++){let r=f.item(e);if(r.nodeType!==1)continue;let c=r,p=c.nodeName,m=l.get(p);m||=(p=c.localName,l.get(p));let h=t.getPath()+`/`+p,g=new z(t,this,h,u,d,a,o);this._doWalk(m,g,n,c,s??i,a,o)}return s}};export{Me as DOMTransformer,z as ExecutionContext,le as NumberUtils,N as VisitorUtils};
|
|
1
|
+
import{I as e}from"./ChSvXfVMLxZsP9zG.js";import{D as t,G as n,I as r,K as i,Ot as a,ft as o,g as s}from"./Ca6nxdhEuLLty3d7.js";import{c,i as l}from"./BcOdl17EeFSxnAiq.js";import{$n as u,Bi as d,bn as f,ri as p,tn as m}from"./D66vSE1ConAuENmB.js";import{Ct as h,Dn as g,Dt as _,En as v,G as ee,H as te,Mn as y,Mt as b,O as ne,Pn as x,Pt as re,Rt as ie,Tt as S,Ut as ae,Vt as C,W as w,Xn as oe,Xt as se,Zt as T,_n as E,a as D,an as O,ct as ce,d as le,er as ue,f as k,h as de,hn as A,it as j,ln as fe,m as M,mt as pe,nn as me,o as he,ot as ge,r as N,t as P,tn as F,xn as I}from"./skRJ2qjA7kcmnOsh.js";import{a as L,o as _e,r as R}from"./BksaQEoZr5OWq-_d.js";import"./DCVUZ_ayOXFwV2d_.js";var ve=class{constructor(e){this.list=e}get length(){return this.list.length}item(e){return this.list[e]}forEach(e,t){let n=this.list,r=n.length;for(let t=0;t<r;t++)e(n[t],t,this)}entries(){return this.list.entries()}keys(){return this.list.keys()}values(){return this.list.values()}[Symbol.iterator](){return this.list.values()}},ye=e=>!0===e||e===`1`||e===`on`||e===`true`||!1!==e&&e!==`0`&&e!==`off`&&e!==`false`&&null,be=e=>{let t=parseInt(e);return isNaN(t)?null:t},xe=e=>{let t=parseFloat(e);return isNaN(t)?null:t},Se=new Map,z=class{constructor(t,n,r,i,a,o=null,s=e.EmptyObject){this._fileLocation=``;let c=(e,t,n)=>s?.getRef?.(e,t,n,s?.parsedRefs),l=e=>s?.getRefs?.(e,s?.parsedRefs);this._parent=t,this.sharedShared=n,this.currentPath=r,this.elemRoot=i,this.jsonRoot=a,t?(this._fileLocation=t._fileLocation,this._getRef=t._getRef,this._getRefs=t._getRefs,this._serializeElement=t._serializeElement,this._readEmbeddedPart=t._readEmbeddedPart):(o&&(this._fileLocation=o),s?.getRef&&(this._getRef=c),s?.getRefs&&(this._getRefs=l),this._onWarning=s?.onWarning,this._addPerson=s?.addPerson,this._serializeElement=s?.serializeElement,this._readEmbeddedPart=s?.readEmbeddedPart)}getRef(e,t=!1){return this._getRef?.(e,this._fileLocation,t)??null}readEmbeddedPart(e){return this._readEmbeddedPart?.(e,this._fileLocation)??null}getRelationships(){return this._getRefs?.(this._fileLocation)??Se}getPath(){return this.currentPath}getFileLocation(){return this._fileLocation}getElemRoot(){return this.elemRoot}getJsonRoot(){return this.jsonRoot}warn(e,t){this._raiseWarning(e,this.getFileLocation(),t?.onceKey)}_raiseWarning(e,t,n){this._onWarning?this._onWarning(e,t,n):this._parent?this._parent._raiseWarning(e,t,n):console.warn(e)}serializeElement(e){return this._serializeElement?.(e)??null}addPerson(e){return typeof e==`string`&&(e={displayName:e}),this._addPerson?this._addPerson(e):this._parent?this._parent?._addPerson?.(e)??null:null}getVisitorParamsState(){return this.sharedShared.getVisitorParamsState()}evaluate(e,t){if(!e)return t;let n=[t],r=e.split(`/`),i=r.length;for(let e=0;e<i;e++){let t=r[e];if(t===``||t===`.`)continue;let a=[],o=(t===`*`||t===`**`)&&e!==i-1;for(let i of n)if(i){if(o){let t=r[e+1];t&&t!==``&&t!==`.`&&(this._findDescendants(i,t,a),e++)}else if(t===`*`||t===`**`){if(!i.childNodes)continue;let e=i.childNodes,t=e.length;for(let n=0;n<t;n++){let t=e[n];t.nodeType===1&&a.push(t)}}else{if(!i.childNodes)continue;let e=i.childNodes,n=e.length;for(let r=0;r<n;r++){let n=e[r];if(n.nodeType!==1)continue;let i=n;this._matchesElementName(i,t)&&a.push(i)}}}if(n=a,n.length===0)return null}return n.length===1?n[0]:n.length===0?null:new ve(n)}_matchesElementName(e,t){return t.includes(`:`)?(e.tagName||e.nodeName)===t:e.localName===t}_findDescendants(e,t,n){if(!e||!e.childNodes)return;let r=e.childNodes,i=r.length;for(let e=0;e<i;e++){let i=r[e];if(i.nodeType!==1)continue;let a=i;this._matchesElementName(a,t)&&n.push(a),this._findDescendants(a,t,n)}}getFromPath(t,n){return e.getFromPath(t,n)}setToPath(t,n,r){return e.setToPath(t,n,r)}getValAttrAsString(e,t){let n=this.evaluate(e,t);return n&&n.hasAttribute(`val`)?n.getAttribute(`val`)??null:null}getValAttrAsBoolean(e,t,n=!1){let r=this.evaluate(e,t);if(!r)return null;let i=r.hasAttribute(`val`)?r.getAttribute(`val`):void 0;return i==null?n:i===`1`||i===`on`||i===`true`||i!==`0`&&i!==`off`&&i!==`false`&&n}getValAttrAsInteger(e,t){let n=this.evaluate(e,t);return n&&n.hasAttribute(`val`)?parseInt(n.getAttribute(`val`))??null:null}getValAttrAsFloat(e,t){let n=this.evaluate(e,t);return n&&n.hasAttribute(`val`)?parseFloat(n.getAttribute(`val`))??null:null}get BOOLEAN_COPY(){return ye}get INT_COPY(){return be}get FLOAT_COPY(){return xe}copyFromAttribute(e,t,n,r=t,i=null){if(!e||!n||!e.hasAttribute(t))return;let a=e.getAttribute(t);if(i){if(Array.isArray(i)){let e=i.length;for(let t=0;t<e;t++)if(a==null||(a=i[t](a),a==null))return}else if(a==null||(a=i(a),a==null))return}this.setToPath(n,r,a)}},B=(e,t)=>{let n=[],r=e.childNodes,i=r.length;for(let e=0;e<i;e++){let i=r.item(e);i.nodeType===1&&i.localName===t&&n.push(i)}return n},Ce=[[`fillRef`,`fill`],[`lnRef`,`stroke`],[`effectRef`,`effect`]],V=(e,t)=>{let n=new h,r={};for(let[i,a]of Ce){let o=e.evaluate(i,t);if(!o)continue;let s={index:parseInt(o.getAttribute(`idx`)??`0`,10)||0},c=n.processAdjColor(e,o);c&&(s.color=c),r[a]=s}let i=e.evaluate(`fontRef`,t);if(i){let t={index:i.getAttribute(`idx`)??`none`},a=n.processAdjColor(e,i);a&&(t.color=a),r.font=t}return r},H=class{visit(e,t,n){if(!t)return;let r=e.evaluate(`*/cNvPr`,t);return r.item&&(r=r.item(0)),r&&(e.copyFromAttribute(r,`name`,n),e.copyFromAttribute(r,`descr`,n,`description`),e.copyFromAttribute(r,`hidden`,n,`hidden`,e.BOOLEAN_COPY),this.readNonVisualDetails(e,r,n),e.copyFromAttribute(r,`id`,n)),n}readNonVisualDetails(e,t,n){t.hasAttribute(`title`)&&(n.title=t.getAttribute(`title`));let r=e.evaluate(`hlinkClick`,t);r&&(n.hyperlink=O(e,r));let i=e.evaluate(`hlinkHover`,t);i&&(n.hoverHyperlink=O(e,i));let a=e.evaluate(`extLst`,t),o=a?e.serializeElement(a):null;o&&(n.extLst={...n.extLst,nonVisual:o})}setContent(e,t){let n=e;n.name!==void 0&&(t.name=n.name,delete n.name),n.description!==void 0&&(t.description=n.description,delete n.description);for(let e of[`title`,`hyperlink`,`hoverHyperlink`,`extLst`])n[e]!==void 0&&(t.json&&(t.json[e]=n[e]),delete n[e]);e.content=t}isGroupContent(e){return Array.isArray(e?.members)}readMemberHeader(e,t,n){let r={},i={anchor:void 0,content:{type:n,json:r}},a=e.evaluate(`*/cNvPr`,t);if(a?.item&&(a=a.item(0)),a){let n=a.getAttribute(`name`);n!==null&&(i.content.name=n);let o=a.getAttribute(`descr`);o&&(i.content.description=o),e.copyFromAttribute(a,`hidden`,i,`hidden`,e.BOOLEAN_COPY),this.readNonVisualDetails(e,a,r);let s=this.readSourceId(e,t);s!==void 0&&(r.sourceId=s)}return{movable:i,content:r}}readStyleRefs(e,t,n){let r=e.evaluate(`style`,t);if(!r)return void(n.style=null);let a=V(e,r),o=i.withoutDefaultStyleRefs({...n,style:a});o&&(n.style=o)}readLocks(e){let t=e?.attributes;if(!t||t.length===0)return;let n={};for(let e=0;e<t.length;e++){let r=t.item(e);r.name.startsWith(`xmlns`)||(n[r.localName??r.name]=D(r.value))}return Object.keys(n).length>0?n:void 0}readSourceId(e,t){let n=e.evaluate(`*/cNvPr`,t);n?.item&&(n=n.item(0));let r=n?.getAttribute?.(`id`),i=r?parseInt(r,10):void 0;return i===void 0||isNaN(i)?void 0:i}},we=[[`spDef`,`shape`],[`lnDef`,`line`],[`txDef`,`text`]],U=(e,t)=>{let n=t.getAttribute(`dxfId`);if(n===null)return;let r=parseInt(n);return e.getVisitorParamsState().get(`dxfs`)?.get(r)||(e.warn(`A color filter or sort names a format that does not exist (dxfId '${n}').`),{})},W=e=>e===`1`||e===`true`,G=class{visit(e,t,n){}processDataBarColor(e,t,n,r,i=`auto`){if(!t)return;let a=T(e=>t.getAttribute(e),i);return a&&(n[r]=a),n}processFonts(e,t,n){if(!t)return;let r=t.childNodes,i=0,a=r.length;for(let t=0;t<a;t++){let a=r.item(t);if(a.nodeType===1&&a.localName===`font`){let t={};this.processFont(e,a,t),n[i++]=t}}return n}processFont(e,n,r){e.getValAttrAsBoolean(`b`,n,!0)&&(r.weight=700),e.getValAttrAsBoolean(`i`,n,!0)&&(r.style=t.Style.Italic),e.getValAttrAsBoolean(`strike`,n,!0)&&(r.strike=v(!0));let i=e.evaluate(`u`,n);if(i){let e=i.getAttribute(`val`);r.underline=b(e)}let a=y(e.evaluate(`vertAlign`,n)?.getAttribute(`val`));a!==void 0&&(r.baseline=a),me(e,n,r,`sz`,`size`);let o=e.evaluate(`color`,n);this.processDataBarColor(e,o,r,`color`),r.color||=`auto`,x(e,n,r,`name`,`family`),x(e,n,r,`rFont`,`family`);let s=e.evaluate(`family`,n);if(s){let e=s.getAttribute(`val`);if(e)switch(e){case`1`:r.fallbacks=[`serif`];break;case`2`:r.fallbacks=[`sans-serif`];break;case`3`:r.fallbacks=[`monospace`];break;case`4`:r.fallbacks=[`cursive`];break;case`5`:r.fallbacks=[`fantasy`]}}P(r,e.evaluate(`scheme`,n)?.getAttribute(`val`)),A(e,n,r,`shadow`,`shadow`,!0),A(e,n,r,`outline`,`outline`,!0);for(let t of[`condense`,`extend`]){let i=E(t,!!e.getValAttrAsBoolean(t,n,!0));i!==void 0&&(r.letterSpacing=i)}return g(e,n,r,`charset`,`charset`),r}processFills(e,t,n){if(!t)return;let r=t.childNodes,i=0,a=r.length;for(let t=0;t<a;t++){let a=r.item(t);a.nodeType===1&&a.localName===`fill`&&this.processFill(e,a,n,i++)}return n}processFill(e,t,r,i){let a={type:n.Type.None},o=t.childNodes,s=!1,c=o.length;for(let t=0;!s&&t<c;t++){let n=o.item(t);n.nodeType===1&&(n.localName===`gradientFill`?(this.processGradientFill(e,n,a),s=!0):n.localName===`patternFill`&&(this.processPatternFill(e,n,a),s=!0))}return r[i]=a,r}processGradientFill(e,t,r){if(!t)return;r.type=n.Type.Gradient;let i=[];r.stops=i;let a=t.getAttribute(`type`);a&&(r.gradientType=a);let o=t.hasAttribute(`degree`)?parseFloat(t.getAttribute(`degree`)):0;(o+90)%360!=0&&(r.angle=(o+90)%360),(t.hasAttribute(`left`)||t.hasAttribute(`top`)||t.hasAttribute(`right`)||t.hasAttribute(`bottom`))&&(r.focus={left:K(t.getAttribute(`left`)),top:K(t.getAttribute(`top`)),right:K(t.getAttribute(`right`)),bottom:K(t.getAttribute(`bottom`))});let s=t.childNodes,c=s.length;for(let t=0;t<c;t++){let n=s.item(t);if(n.nodeType===1&&n.localName===`stop`){let t={};i.push(t),t.offset=parseFloat(n.getAttribute(`position`)??``);let r=e.evaluate(`color`,n);this.processDataBarColor(e,r,t,`color`)}}return r}processPatternFill(e,t,r){if(!t)return;let i=e.getVisitorParamsState().get(`processingDXFs`),a=t.getAttribute(`patternType`)||(i?n.BuiltInSheetPattern.Solid:n.BuiltInSheetPattern.None);if(a===n.BuiltInSheetPattern.None)return{none:!0};r.type=n.Type.Pattern,a&&(r.patternType=a);let o=`foreground`,s=`background`,c=r.patternType===n.BuiltInSheetPattern.Solid&&i,l=c?`dk1`:`lt1`,u=c?`lt1`:`dk1`;if(c){let e=o;o=s,s=e}let d=e.evaluate(`fgColor`,t);this.processDataBarColor(e,d,r,o,l);let f=e.evaluate(`bgColor`,t);return this.processDataBarColor(e,f,r,s,u),c&&(r.foreground||=`lt1`,r.background||=`dk1`),r}processBorders(e,t,n,r){if(!t)return;let i=t.childNodes,a=0,o=i.length;for(let t=0;t<o;t++){let o=i.item(t);o.nodeType===1&&o.localName===`border`&&this.processBorder(e,o,n,a++,r)}return n}processBorder(e,t,n,r,i){if(!t)return;let o={};this.processBorderStroke(e,t,o,a.Edge.Left),this.processBorderStroke(e,t,o,a.Edge.Right),i?(o.right||o.left)&&(o.vertical=o.right?{...o.right}:{...o.left}):this.processBorderStroke(e,t,o,a.Edge.Vertical),this.processBorderStroke(e,t,o,a.Edge.Top),this.processBorderStroke(e,t,o,a.Edge.Bottom),i?(o.bottom||o.top)&&(o.horizontal=o.bottom?{...o.bottom}:{...o.top}):this.processBorderStroke(e,t,o,a.Edge.Horizontal);let s=this.processBorderStroke(e,t,{},`diagonal`);return s&&(W(t.getAttribute(`diagonalUp`))&&(o.diagonalUp={...s}),W(t.getAttribute(`diagonalDown`))&&(o.diagonalDown={...s})),n[r]=o,n}processBorderStroke(e,t,n,r){if(!t)return;let i=e.evaluate(r,t);if(!i)return;let o={};i.hasAttribute(`style`)?o.style=i.getAttribute(`style`):e.getVisitorParamsState().get(`processingDXFs`)&&(o.style=a.StrokeStyle.None);let s=e.evaluate(`color`,i);return s&&this.processDataBarColor(e,s,o,`color`),Object.keys(o).length>0?n[r]=o:null}},K=e=>{if(!e)return 0;let t=parseFloat(e);return isNaN(t)?0:t},q=(e,t)=>{if(!e||e.nodeType!==1)return null;let n=e.childNodes;for(let e=0;e<n.length;e++){let r=n.item(e);if(r.nodeType===1&&r.localName===t)return r}return null},Te=new Set(Object.values(p.ElementType).filter(e=>e!==p.ElementType.WholeTable&&e!==p.ElementType.HeaderRow)),Ee={auto:`auto`,autoNoTable:`automaticExceptTables`,manual:`manual`},J=[`tableId`,`columnId`,`cacheName`,`cachePath`,`sourceName`,`sortOrder`,`customListSort`,`crossFilter`],Y=(e,t)=>{let n=e.content,r=n?.json;if(r){if(n.type===`shape`||n.type===`picture`){let{rotation:n,flipH:i,flipV:a,bounds:o}=r;delete r.rotation,delete r.flipH,delete r.flipV,delete r.bounds,n!==void 0&&n!==0&&(e.rotation=n),i&&(e.flipH=!0),a&&(e.flipV=!0),t&&o&&(e.anchor={tl:{x:o.x,y:o.y},br:{x:o.width,y:o.height}})}if(n.type===`group`)for(let e of r.members??[])Y(e,!0)}},X=class extends H{visit(e,t,n){if(t)return this.visitShape(e,t,n,`sp`,`nvSpPr/cNvSpPr/spLocks`)}visitShape(e,t,n,r,i){let a=ge[r];if(this.isGroupContent(n)){if(e.getPath().includes(`Fallback`))return{};let{movable:o,content:c}=this.readMemberHeader(e,t,`shape`);a!==s.Type.Shape&&(c.type=a),this.readShapeDetails(e,t,r,i,c),this.readStyleRefs(e,t,c);let l=e.evaluate(i,t);l?.hasAttribute?.(`noChangeAspect`)&&(o.lockAspect=l.getAttribute(`noChangeAspect`)===`1`);let u=this.readTwinOf(e,t);return u!==void 0&&Object.assign(c,{twinOf:u}),n.members.push(o),c}if(e.getPath().includes(`Fallback`)&&n.content){let r=n.content.json;if(n.content.type===`shape`&&r&&(r.type??s.Type.Shape)===a){let n=e.evaluate(`txBody`,t),i=n?new j().readTextBody(e,n):null;i&&de(i)!==``&&(r.text=i)}return{}}n=super.visit(e,t,n);let o=e.evaluate(i,t);o?.hasAttribute?.(`noChangeAspect`)&&(n.lockAspect=o.getAttribute(`noChangeAspect`)===`1`);let c=a===s.Type.Shape?{}:{type:a},l=this.readSourceId(e,t);l!==void 0&&(c.sourceId=l),this.readShapeDetails(e,t,r,i,c),this.readStyleRefs(e,t,c);let u=this.readTwinOf(e,t);return u!==void 0&&Object.assign(c,{twinOf:u}),this.setContent(n,{type:`shape`,json:c}),c}readTwinOf(e,t){let n=e.evaluate(`*/cNvPr/extLst/ext/compatExt`,t);n?.item&&(n=n.item(0));let r=/^_x0000_s(\d+)$/.exec(n?.getAttribute?.(`spid`)??``);return r?parseInt(r[1],10):void 0}readShapeDetails(e,t,n,r,i){let a=t.getAttribute(`macro`);a&&(i.macro=a);let o=t.getAttribute(`textlink`);o&&(i.textLink=o),t.hasAttribute(`fLocksText`)&&(i.locksText=D(t.getAttribute(`fLocksText`))),t.hasAttribute(`fPublished`)&&(i.published=D(t.getAttribute(`fPublished`)));let s=r.slice(0,r.lastIndexOf(`/`)),c=e.evaluate(s,t);c?.getAttribute?.(`txBox`)===`1`&&(i.textBox=!0);let l=this.readLocks(e.evaluate(r,t));if(l&&(i.locks=l),n===`cxnSp`&&c){let t=t=>{let n=e.evaluate(t,c);if(n?.getAttribute)return{id:parseInt(n.getAttribute(`id`)??`0`,10)||0,index:parseInt(n.getAttribute(`idx`)??`0`,10)||0}},n=t(`stCxn`),r=t(`endCxn`);(n||r)&&(i.connectorEnds={},n&&(i.connectorEnds.start=n),r&&(i.connectorEnds.end=r))}}},De=/^<a:extLst(?:\s+xmlns:a="[^"]*")?><a:ext uri="\{28A0092B-C50C-407E-A947-70E740481C1C\}"><a14:useLocalDpi(?:\s+xmlns:a14="[^"]*")?\s+val="0"\s*\/><\/a:ext><\/a:extLst>$/,Z=(e,t,n,r)=>{let i=e.evaluate(n,t),a=e.evaluate(r,t);return i||a?{x:k(i?.getAttribute(`x`)??null)??0,y:k(i?.getAttribute(`y`)??null)??0,width:k(a?.getAttribute(`cx`)??null)??0,height:k(a?.getAttribute(`cy`)??null)??0}:null},Oe={Checkbox:`checkbox`},Q=e=>{let t=e.getAttribute(`val`);return t!==`0`&&t!==`false`},ke={1:`serif`,2:`sans-serif`,3:`monospace`,4:`cursive`,5:`fantasy`};function Ae(e){let n={},r=e.childNodes;for(let e=0;e<r.length;e++){let i=r.item(e);if(i.nodeType===1)switch(i.localName){case`b`:n.weight=Q(i)?700:400;break;case`i`:n.style=Q(i)?t.Style.Italic:t.Style.Normal;break;case`strike`:n.strike=v(Q(i));break;case`outline`:n.outline=Q(i);break;case`shadow`:n.shadow=Q(i);break;case`condense`:case`extend`:{let e=E(i.localName,Q(i));e!==void 0&&(n.letterSpacing=e);break}case`u`:n.underline=b(i.getAttribute(`val`));break;case`vertAlign`:{let e=y(i.getAttribute(`val`));e!==void 0&&(n.baseline=e);break}case`sz`:{let e=parseFloat(i.getAttribute(`val`)??``);isNaN(e)||(n.size=e);break}case`rFont`:{let e=i.getAttribute(`val`);e&&(n.family=e);break}case`family`:{let e=ke[i.getAttribute(`val`)??``];e&&(n.fallbacks=[e]);break}case`charset`:{let e=parseInt(i.getAttribute(`val`)??``,10);isNaN(e)||(n.charset=e);break}case`scheme`:P(n,i.getAttribute(`val`));break;case`color`:{let e=i.getAttribute(`rgb`);if(e&&!i.hasAttribute(`theme`)){n.color=`#`+(e.length===8?e.substring(2):e).toUpperCase();break}let t=T(e=>i.getAttribute(e));t&&(n.color=t);break}}}return Object.keys(n).length>0?n:null}var $={RelsVisitor:class{visit(e,t,n){if(!t)return;let r=t.childNodes,i=r.length;for(let t=0;t<i;t++){let i=r.item(t);i.nodeType===1&&i.localName===`Relationship`&&this.processRelationship(e,i,n)}return n}processRelationship(e,t,n){let r={};e.copyFromAttribute(t,`Target`,r,`target`),e.copyFromAttribute(t,`Type`,r,`type`),e.copyFromAttribute(t,`TargetMode`,r,`targetMode`),n[t.getAttribute(`Id`)]=r}},CorePropertiesVisitor:class{visit(e,t,n){let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);if(n.nodeType!==1)continue;let a=this.processProperty(e,n);a&&r.push(a)}return r.length>0&&(n.properties=r),r}processProperty(e,t){if(t)return t.getAttribute(`xsi:type`),{key:t.localName,value:t.textContent||``}}},AppPropertiesVisitor:class{visit(e,t,n){let r=t.childNodes,i=r.length;for(let e=0;e<i;e++)if(r.item(e).localName===`property`)return this.visitCustom(t,n);let a=[];for(let t=0;t<i;t++){let n=r.item(t);if(n.nodeType!==1)continue;let i=this.processProperty(e,n);i&&a.push(i)}return a.length>0&&(n.properties=a),a}visitCustom(e,t){let n=[],r=e.childNodes,i=r.length;for(let e=0;e<i;e++){let t=r.item(e);if(t.nodeType!==1||t.localName!==`property`)continue;let i=t.getAttribute(`name`);if(!i)continue;let a=null;for(let e=0;e<t.childNodes.length&&!a;e++){let n=t.childNodes.item(e);n.nodeType===1&&(a=n)}let o={key:i,kind:a?.localName??null,value:a?.textContent??``},s=t.getAttribute(`linkTarget`);s&&(o.linkTarget=s),n.push(o)}return n.length>0&&(t.custom=n),n}processProperty(e,t){if(t)return{key:t.localName,value:t.textContent||``}}},ShapePropertiesVisitor:M,TextPropertiesVisitor:he,ShapeTextVisitor:j,ThemeVisitor:class{visit(e,t,n){n.name=t.getAttribute(`name`),n.objectDefaults={};let r=B(t,`custClrLst`)[0];if(r){let t=new h,i=[];for(let n of B(r,`custClr`)){let r=t.processAdjColor(e,n);if(!r)continue;let a={color:r},o=n.getAttribute(`name`);o&&(a.name=o),i.push(a)}i.length&&(n.customColors=i)}for(let e of B(t,`extLst`))for(let t of B(e,`ext`)){if(t.getAttribute(`uri`)!==`{05A4C25C-085E-4340-85A3-A5531E510DB2}`)continue;let e=B(t,`themeFamily`)[0],r=e?.getAttribute(`id`);if(!r)continue;let i={name:e.getAttribute(`name`)??``,id:r},a=e.getAttribute(`vid`);a&&(i.vid=a),n.family=i}return n}},ClrSchemeVisitor:class extends h{visit(e,t,n){let r={};r.name=t.getAttribute(`name`);let i=t.childNodes,a=i.length;for(let n=0;n<a;n++){let a=i.item(n);if(a.nodeType===1){let n=a.localName,i=e.evaluate(n,t);r[n]=this.processAdjColor(e,i)}}return Object.keys(r).length>0&&(n.colors=r),r}},FontSchemeVisitor:class{visit(e,t,n){let r={};r.name=t.getAttribute(`name`);let i=this.processFontCollection(e,e.evaluate(`majorFont`,t));i&&(r.major=i);let a=this.processFontCollection(e,e.evaluate(`minorFont`,t));return a&&(r.minor=a),n.fonts=r,r}processFontCollection(e,t){if(!t)return;let n={},r=e.evaluate(`latin`,t),i=r?.getAttribute(`typeface`);i&&(n.latin=i);let a=r?.getAttribute(`panose`);a&&(n.panose=a);let o=e.evaluate(`ea`,t)?.getAttribute(`typeface`);o&&(n.eastAsian=o);let s=e.evaluate(`cs`,t)?.getAttribute(`typeface`),c;s&&(n.complexScript=s);let l=t.childNodes,u=l.length;for(let e=0;e<u;e++){let t=l.item(e);if(t.nodeType!==1||t.localName!==`font`)continue;let n=t.getAttribute(`script`);n&&((c??={})[n]=t.getAttribute(`typeface`)??``)}return c&&(n.scripts=c),n}},ObjectDefaultsVisitor:class{visit(e,t,n){let r={};for(let[n,i]of we){let a=e.evaluate(n,t);a&&(r[i]=this.processDefault(e,a))}return n.objectDefaults=r,{}}processDefault(e,t){let n={},r=e.evaluate(`spPr`,t);r&&new M().visit(e,r,n);let i=new j().readTextBody(e,t);(i.body||i.listStyle)&&(n.text=i);let a=e.evaluate(`style`,t);return a&&(n.style=V(e,a)),n}},FmtSchemeVisitor:class extends h{visit(e,t,n){let r=this.parseFillList(e,t,`fillStyleLst`),i=this.parseLnList(e,t,`lnStyleLst`),a=this.parseEffectStyleList(e,t,`effectStyleLst`),o=this.parseFillList(e,t,`bgFillStyleLst`);if(r&&(n.fillStyleLst=r),i&&(n.lnStyleLst=i),a&&(n.effectStyleLst=a),o&&(n.bgFillStyleLst=o),r&&i&&a&&o)return;let s=e.serializeElement(t);s&&(n.formatSchemeXml=s)}parseFillList(e,t,n){let r=e.evaluate(n,t);if(!r)return;let i=[],a=r.childNodes,o=a.length;for(let t=0;t<o;t++){let n=a.item(t);if(n.nodeType!==1)continue;let r=this.parseFillListItem(e,n);if(r===void 0)return;i.push(r)}return i}parseFillListItem(e,t){switch(t.localName){case`noFill`:return{type:n.Type.None};case`solidFill`:{let r=this.processAdjColor(e,t);return r?{type:n.Type.Solid,color:r}:void 0}case`gradFill`:return this.processGradFill(e,t);case`pattFill`:return this.processPatternFill(e,t);default:return}}parseLnList(e,t,n){let r=e.evaluate(n,t);if(!r)return;let i=[],a=r.childNodes,o=a.length;for(let t=0;t<o;t++){let n=a.item(t);n.nodeType===1&&i.push(this.parseLn(e,n))}return i}parseEffectStyleList(e,t,n){let r=e.evaluate(n,t);if(!r)return;let i=[],a=r.childNodes,o=a.length;for(let t=0;t<o;t++){let n=a.item(t);if(n.nodeType!==1)continue;if(e.evaluate(`scene3d`,n)||e.evaluate(`sp3d`,n))return;let r=this.getEffects(e,n);if(r===void 0)return;i.push(r??[])}return i}},AutoFilterVisitor:class{visit(e,t,n){if(!t)return;let r={},i=[];return this.processFilterColumns(e,t,i,n),i.length>0&&(r.conditions=i),Object.keys(r).length>0&&(n.filter=r),n}processColorFilter(e,t){let n={},r={operator:m.BuiltInOperatorNames.Color,param:n};e.copyFromAttribute(t,`cellColor`,n,`cellColor`,e.BOOLEAN_COPY);let i=U(e,t);return i&&(n.style=i),r}processCustomFilter(e,t){return F({operator:t.getAttribute(`operator`),val:t.getAttribute(`val`)},t=>e.warn(t))}processCustomFilters(e,t){let n=t.getAttribute(`and`),r=n===`and`||n===`1`;t.getAttribute(`val`);let i=[],a={operator:r?m.BuiltInOperatorNames.And:m.BuiltInOperatorNames.Or,param:i},o=t.childNodes,s=o.length;for(let t=0;t<s;t++){let n=o.item(t);if(n.nodeType!==1)continue;let r=null;n.localName===`customFilter`&&(r=this.processCustomFilter(e,n)),r&&i.push(r)}return i.length===1?i[0]:se(a)}processDynamicFilter(e,t){return ee(t.getAttribute(`type`))}processDateGroupItem(e,t){let n={};return e.copyFromAttribute(t,`dateTimeGrouping`,n,`group`),e.copyFromAttribute(t,`day`,n,`day`,e.INT_COPY),e.copyFromAttribute(t,`hour`,n,`hour`,e.INT_COPY),e.copyFromAttribute(t,`minute`,n,`minute`,e.INT_COPY),e.copyFromAttribute(t,`month`,n,`month`,e.INT_COPY),e.copyFromAttribute(t,`second`,n,`second`,e.INT_COPY),e.copyFromAttribute(t,`year`,n,`year`,e.INT_COPY),n}processFilterItem(e,t){if(t.hasAttribute(`val`))return t.getAttribute(`val`)}processFilters(e,t){let n={},r={operator:m.BuiltInOperatorNames.InSet,param:n};r.selector=m.BuiltInSelectorNames.Display,e.copyFromAttribute(t,`blank`,n,`blank`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`calendarType`,n,`calendarType`);let i=[],a=[],o=t.childNodes,s=o.length;for(let t=0;t<s;t++){let n=o.item(t);if(n.nodeType===1){if(n.localName===`dateGroupItem`){let t=this.processDateGroupItem(e,n);t&&i.push(t)}else if(n.localName===`filter`){let t=this.processFilterItem(e,n);t!==void 0&&a.push(t)}}}return i.length>0&&(n.dateGroups=i),a.length>0&&(n.items=a),r}processIcon(e,t){let n={},r={operator:m.BuiltInOperatorNames.Icon,param:n};return e.copyFromAttribute(t,`iconId`,n,`iconId`,e.INT_COPY),e.copyFromAttribute(t,`iconSet`,n),r}processTop10(e,t){let n={},r={operator:m.BuiltInOperatorNames.TopN,param:n};return e.copyFromAttribute(t,`filterVal`,n,`filterVal`,e.FLOAT_COPY),e.copyFromAttribute(t,`percent`,n,`percent`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`top`,n,`top`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`val`,n,`limit`,e.FLOAT_COPY),r}processFilterColumnExt(e,t){let n=t.childNodes;for(let t=0;t<n.length;t++){let r=n.item(t);if(r.nodeType!==1||r.localName!==`ext`||_(r.getAttribute(`uri`))!==_(`{1AD28BCE-077C-4C59-8B6E-1921CE8616D4}`))continue;let i=r.childNodes;for(let t=0;t<i.length;t++){let n=i.item(t);if(n.nodeType!==1||n.localName!==`filterColumn`)continue;let r=n.childNodes;for(let t=0;t<r.length;t++){let n=r.item(t);if(n.nodeType===1&&n.localName===`filters`)return this.processFilters(e,n)}}}}processFilterCriteria(e,t){if(!t)return;let n=t.childNodes,r,i=n.length;for(let t=0;t<i;t++){let i=n.item(t);i.nodeType===1&&(i.localName===`colorFilter`?r=this.processColorFilter(e,i):i.localName===`customFilters`?r=this.processCustomFilters(e,i):i.localName===`dynamicFilter`?r=this.processDynamicFilter(e,i):i.localName===`filters`?r=this.processFilters(e,i):i.localName===`iconFilter`?r=this.processIcon(e,i):i.localName===`top10`?r=this.processTop10(e,i):i.localName===`extLst`&&(r=this.processFilterColumnExt(e,i)??r))}return r}processFilterColumn(e,t,n){if(!t)return null;if(!t.hasAttribute(`colId`))return;let r=parseInt(t.getAttribute(`colId`)),i=!1;if(t.hasAttribute(`hiddenButton`)&&(i=D(t.getAttribute(`hiddenButton`))),i&&n){let e=n.hiddenButtons;e||(e=[],n.hiddenButtons=e),e.push(r)}let a=!1;if(t.hasAttribute(`showButton`)&&(a=D(t.getAttribute(`showButton`))),a&&n){let e=n.showButtons;!0!==e&&(e||(e=[],n.showButtons=e),e[r]=!0)}let o=this.processFilterCriteria(e,t);return o?(o.index=r,o):null}processFilterColumns(e,t,n,r){if(!t)return;let i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let a=i.item(t);if(a.nodeType===1&&a.localName===`filterColumn`){let t=this.processFilterColumn(e,a,r);t&&n.push(t)}}return n}},SortStateVisitor:class{visit(e,t,n){if(!t)return;let r=t.getAttribute(`ref`),i={};t.hasAttribute(`caseSensitive`)&&(i.collatorOptions=D(t.getAttribute(`caseSensitive`))?u.CaseSensitiveOptions:u.CaseInsensitiveOptions);let a=t.getAttribute(`sortMethod`);a!=null&&a!==`none`&&(a===`stroke`?i.collatorOptions={...i.collatorOptions,collation:`stroke`}:a===`pinYin`&&(i.collatorOptions={...i.collatorOptions,collation:`pinyin`}));let o={};t.hasAttribute(`columnSort`)&&D(t.getAttribute(`columnSort`))&&(o.axis=c.Axis.Column);let s=d.fastStringToRange(r),l=[],f=[];this.processSortConditions(e,t,l,s,i,f),l.length>0&&(o.sorts=l);let p=e.getVisitorParamsState().get(`ref`);if(p&&r){let e=d.fastStringToRange(p);o.extent={range:I(e,s),sorts:f.map(t=>pe(e,s,t))}}return Object.keys(l).length>0&&(n.sort=o),o}processSortCondition(e,t,n,r,i){if(!t)return null;let a={};if(!t.hasAttribute(`ref`))return void e.warn(`A sort condition has no ref; it was dropped.`,{onceKey:`xlsx.sheet.sort.noRef`});if(t.hasAttribute(`ref`)){let e=t.getAttribute(`ref`),r=d.fastStringToRange(e);a.index=n?r.colStart-n.colStart:r.colStart,i?.push(r)}let o={...r};a.criteria=o,o.reverse=!1,t.hasAttribute(`descending`)&&(o.reverse=D(t.getAttribute(`descending`)));let s=oe(t.getAttribute(`sortBy`));s&&(o.sortOn=s);let c=U(e,t);return c&&(o.style=c),e.copyFromAttribute(t,`iconSet`,o),e.copyFromAttribute(t,`customList`,o),a}processSortConditions(e,t,n,r,i,a){if(!t)return;let o=t.childNodes,s=o.length;for(let t=0;t<s;t++){let s=o.item(t);if(s.nodeType===1&&s.localName===`sortCondition`){let t=this.processSortCondition(e,s,r,i,a);t&&n.push(t)}}}},SheetStyleVisitor:class extends G{visit(e,t,r){this.processNumFmts(e,e.evaluate(`numFmts`,t),null),e.getVisitorParamsState().set(`colorsToProcess`,new Set);let i={fills:{},fonts:{},borders:{}},o=e.evaluate(`fonts`,t);this.processFonts(e,o,i.fonts);let s=i.fonts[this.normalFontId(e,t)],c={declared:[`1`,`true`].includes(o?.getAttribute(`x14ac:knownFonts`)??``),normalIsThemeFont:w(s?.family),faces:ne(Object.values(i.fonts).map(e=>({...e,family:ie(e?.family,e?.fallbacks,null,!1).name})))};e.getVisitorParamsState().set(ce,c),s&&e.getVisitorParamsState().set(`defaultFont`,s),this.processFills(e,e.evaluate(`fills`,t),i.fills),this.processBorders(e,e.evaluate(`borders`,t),i.borders,!0),i.fills[0]={type:n.Type.None},i.fills[1]={type:n.Type.Pattern,patternType:n.BuiltInSheetPattern.Gray125},i.borders[0]={bottom:{style:a.StrokeStyle.None},left:{style:a.StrokeStyle.None},right:{style:a.StrokeStyle.None},top:{style:a.StrokeStyle.None}};let l=[];this.processXFs(e,e.evaluate(`cellStyleXfs`,t),l,i,null,!1);let u=new Map;if(l.length>0){let n=[];this.processCellStyles(e,e.evaluate(`cellStyles`,t),n,l,u),r.named=n}let d=[];this.processXFs(e,e.evaluate(`cellXfs`,t),d,i,u),Object.keys(d).length>0&&(r.direct=d);let f=this.collectHiddenXfs(e.evaluate(`cellXfs`,t));f.size>0&&e.getVisitorParamsState().set(`hiddenXfs`,f);let p=this.collectXfComplements(e.evaluate(`cellXfs`,t));p.size>0&&e.getVisitorParamsState().set(`xfComplements`,p);let m=[];return this.processDXFs(e,e.evaluate(`dxfs`,t),m),this.processTableStyles(e,e.evaluate(`tableStyles`,t),r,m),this.processSlicerStyles(e,e.evaluate(`extLst`,t),r),this.processIndexColors(e,e.evaluate(`colors/indexedColors`,t),r),this.processMruColors(e,e.evaluate(`colors/mruColors`,t),r),r}normalFontId(e,t){let n=e.evaluate(`cellStyles`,t)?.childNodes,r=0;for(let e=0;e<(n?.length??0);e++){let t=n.item(e);if(t.nodeType===1&&t.getAttribute(`builtinId`)===`0`){r=parseInt(t.getAttribute(`xfId`)??`0`,10)||0;break}}let i=e.evaluate(`cellStyleXfs`,t)?.childNodes,a=0;for(let e=0;e<(i?.length??0);e++){let t=i.item(e);if(t.nodeType===1&&a++===r)return parseInt(t.getAttribute(`fontId`)??`0`,10)||0}return 0}processIndexColors(e,t,n){if(!t)return;let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);if(n.nodeType===1&&n.localName===`rgbColor`){let t={color:null};this.processDataBarColor(e,n,t,`color`),t.color&&r.push(t.color)}}n.indexedColors=r}processMruColors(e,t,n){if(!t)return;let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);if(n.nodeType===1&&n.localName===`color`){let t={color:null};this.processDataBarColor(e,n,t,`color`),t.color&&r.push(t.color)}}r.length>0&&(n.mruColors=r)}processNumFmts(e,t,n){if(!t)return;let r=new Map;if(e.getVisitorParamsState().set(`numFmts`,r),!t)return;let i=t.childNodes,a=i.length;for(let e=0;e<a;e++){let t=i.item(e);if(t.nodeType===1&&t.localName===`numFmt`){let e=t.getAttribute(`numFmtId`),n=t.getAttribute(`formatCode`);if(e&&n){let t=n;r.set(parseInt(e),t)}}}}processXFs(e,t,n,r,i=null,a=!0){if(!t)return;let o=t.childNodes,s=o.length;for(let t=0;t<s;t++){let s=o.item(t);if(s.nodeType===1&&s.localName===`xf`){let t={};this.processXF(e,s,t,r,i,a),n.push(t)}}}processXF(e,t,n,i,a,o){if(!t)return;let s=t.getAttribute(`xfId`);if(s&&a){let e=a.get(parseInt(s));e&&e!==r.BuiltInName.Normal&&(n.named=e)}let c=e=>!(!o&&t.hasAttribute(e))||D(t.getAttribute(e)),l=e=>!o||t.hasAttribute(e)&&D(t.getAttribute(e)),u=o?`0`:void 0;if(c(`applyFont`)){let e=t.getAttribute(`fontId`)??u;if(e!==void 0&&(e!==`0`||l(`applyFont`))){let t=i.fonts[e];t!==void 0&&(n.font=t)}}if(c(`applyFill`)){let e=t.getAttribute(`fillId`)??u;if(e!==void 0&&(e!==`0`||l(`applyFill`))){let t=i.fills[e];t!==void 0&&Object.keys(t).length>0&&(n.fill=t)}}if(c(`applyBorder`)){let e=t.getAttribute(`borderId`)??u;if(e!==void 0&&(e!==`0`||l(`applyBorder`))){let t=i.borders[e];t!==void 0&&(n.borders=t)}}if(c(`applyNumberFormat`)){let r=t.getAttribute(`numFmtId`)??u;if(r!==void 0&&(r!==`0`||l(`applyNumberFormat`))){let t=parseInt(r),i,a=e.getVisitorParamsState();if(a){let e=a.get(`numFmts`);e&&(i=e.get(t)),n.numberFormat=i??t}else e.warn(`Number formats were unavailable; a cell format was not read.`,{onceKey:`xlsx.style.numberFormat.state`})}}if(c(`applyAlignment`)){let r=e.evaluate(`alignment`,t);(r||l(`applyAlignment`))&&this.processAlignment(e,r,n)}if(c(`applyProtection`)){let r=e.evaluate(`protection`,t);(r||l(`applyProtection`))&&this.processProtection(e,r,n)}let d=D(t.getAttribute(`quotePrefix`)??``);d&&(n.quotePrefix=d)}processAlignment(e,t,n){let r={};if(r.horizontal=t?.hasAttribute(`horizontal`)?t.getAttribute(`horizontal`):o.HorizontalAlignment.General,r.vertical=t?.hasAttribute(`vertical`)?t.getAttribute(`vertical`):o.VerticalAlignment.Bottom,r.indent=t?.hasAttribute(`indent`)?parseInt(t.getAttribute(`indent`)):0,r.relativeIndent=t?.hasAttribute(`relativeIndent`)?parseInt(t.getAttribute(`relativeIndent`)):0,r.overflow=D(t?.getAttribute(`wrapText`)??``)?o.Overflow.Wrap:o.Overflow.Visible,D(t?.getAttribute(`shrinkToFit`)??``)&&(r.overflow=o.Overflow.Shrink),t?.hasAttribute(`textRotation`)){let e=parseFloat(t.getAttribute(`textRotation`));e>0&&e<=90?e=360-e:e>90&&e<=180?e-=90:e===255&&(e=0,r.stacked=!0),r.rotation=e}else r.rotation=0;t?.hasAttribute(`justifyLastLine`)&&(r.justifyLastLine=D(t.getAttribute(`justifyLastLine`)));let i=t?.getAttribute(`readingOrder`);return i&&(i===`0`?r.readingDirection=o.ReadingDirection.Auto:i===`1`?r.readingDirection=o.ReadingDirection.LeftToRight:i===`2`?r.readingDirection=o.ReadingDirection.RightToLeft:e.warn(`Invalid readingOrder '${i}'; the direction was left automatic.`,{onceKey:`xlsx.style.readingOrder`})),Object.keys(r).length>0&&(n.alignment=r),n}collectHiddenXfs(e){let t=new Set;if(!e)return t;let n=e.childNodes,r=0;for(let e=0;e<n.length;e++){let i=n.item(e);if(i.nodeType!==1||i.localName!==`xf`)continue;let a=i.childNodes;for(let e=0;e<a.length;e++){let n=a.item(e);n.nodeType===1&&n.localName===`protection`&&D(n.getAttribute(`hidden`)??``)&&t.add(r)}r++}return t}collectXfComplements(e){let t=new Map;if(!e)return t;let n=e.childNodes,r=0;for(let e=0;e<n.length;e++){let i=n.item(e);if(i.nodeType!==1||i.localName!==`xf`)continue;let a=q(i,`extLst`);if(a){let e=a.childNodes;for(let n=0;n<e.length;n++){let i=q(e.item(n),`xfComplement`),a=parseInt(i?.getAttribute(`i`)??``,10);isNaN(a)||t.set(r,a)}}r++}return t}processProtection(e,t,n){if(!t)return;let r=t.getAttribute(`locked`);return n.protection={alwaysUnlocked:!!r&&!D(r)},n}processDXF(e,t,n){if(!t)return;let r=t.childNodes,i=r.length;for(let t=0;t<i;t++){let i=r.item(t);if(i.nodeType===1&&i.localName===`font`){let t={};this.processFont(e,i,t),n.font=t}else if(i.nodeType===1&&i.localName===`fill`){let t=[];this.processFill(e,i,t,0),t.length>0&&t[0]&&(n.fill=t[0])}else if(i.nodeType===1&&i.localName===`border`){let t=[];this.processBorder(e,i,t,0,!1),t.length>0&&t[0]&&(n.borders=t[0])}else if(i.nodeType===1&&i.localName===`numFmt`){let e=i.getAttribute(`formatCode`);if(e)n.numberFormat=e;else{let e=i.getAttribute(`numFmtId`);e&&(n.numberFormat=Number(e))}}else i.nodeType===1&&i.localName===`alignment`&&this.processAlignment(e,i,n)}}processDXFs(e,t,n){if(!t)return;e.getVisitorParamsState().set(`processingDXFs`,!0);let r=new Map;e.getVisitorParamsState().set(`dxfs`,r);let i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let a=i.item(t);if(a.nodeType===1&&a.localName===`dxf`){let t={};this.processDXF(e,a,t);let i=n.length;r.set(i,t),n.push(t)}}e.getVisitorParamsState().delete(`processingDXFs`)}processSlicerStyles(e,t,n){if(!t)return;let r=null,i=null,a=t.childNodes;for(let e=0;e<a.length;e++){let t=a.item(e);if(t.nodeType!==1||t.localName!==`ext`)continue;let n=t.childNodes;for(let e=0;e<n.length;e++){let t=n.item(e);t.nodeType===1&&(t.localName===`dxfs`?r=t:t.localName===`slicerStyles`&&(i=t))}}if(!i)return;let o=[];if(r){e.getVisitorParamsState().set(`processingDXFs`,!0);let t=r.childNodes;for(let n=0;n<t.length;n++){let r=t.item(n);if(r.nodeType!==1||r.localName!==`dxf`)continue;let i={};this.processDXF(e,r,i),o.push(i)}e.getVisitorParamsState().delete(`processingDXFs`)}let s={},c=i.getAttribute(`defaultSlicerStyle`);c&&c!==`SlicerStyleLight1`&&(s.defaultSlicerStyle=c);let l=n.tables?.styles,u=i.childNodes;for(let t=0;t<u.length;t++){let n=u.item(t);if(n.nodeType!==1||n.localName!==`slicerStyle`)continue;let r=n.getAttribute(`name`);if(!r)continue;let i={},a=l?.[r];a&&!1===a.table&&!a.pivot&&(a.wholeTable&&(i.wholeTable=a.wholeTable),a.headerRow&&(i.headerRow=a.headerRow),delete l[r]);let c=e.evaluate(`slicerStyleElements`,n)?.childNodes,d=c?.length??0;for(let t=0;t<d;t++){let n=c.item(t);if(n.nodeType!==1||n.localName!==`slicerStyleElement`)continue;let r=n.getAttribute(`type`);if(!r||!Te.has(r))continue;let a=n.getAttribute(`dxfId`),s=a==null?void 0:o[parseInt(a)];s?i[r]=s:e.warn(`A slicer style names a format that does not exist (dxfId '${a}').`,{onceKey:`xlsx.style.slicerStyle.dxf`})}(s.styles??={})[r]=i}l&&Object.keys(l).length===0&&(delete n.tables.styles,Object.keys(n.tables).length===0&&delete n.tables),Object.keys(s).length>0&&(n.slicers=s)}processTableStyle(e,t,n,r,i=!1){let a=t.getAttribute(`name`),o={name:a};t.hasAttribute(`table`)&&(o.table=D(t.getAttribute(`table`))),t.hasAttribute(`pivot`)&&(o.pivot=D(t.getAttribute(`pivot`))),i&&!o.pivot&&r.unshift(null);let s=t.childNodes,c=s.length;for(let t=0;t<c;t++){let n=s.item(t);if(n.nodeType===1&&n.localName===`tableStyleElement`){let t=n.getAttribute(`type`),i=n.getAttribute(`dxfId`),a=i==null?void 0:r?.[i];a||=(e.warn(`A table style names a format that does not exist (dxfId '${i}').`,{onceKey:`xlsx.style.tableStyle.dxf`}),{}),o[t]=a;let s=null;n.hasAttribute(`size`)&&(s=parseInt(n.getAttribute(`size`))),s&&!isNaN(s)&&(a.size=s)}}delete o.name,n[a]=o}processTableStyles(e,t,n,r,i){if(!t)return;let a={},o=t.getAttribute(`defaultTableStyle`);o&&(a.defaultTableStyle=o);let s=t.getAttribute(`defaultPivotStyle`);s&&(a.defaultPivotStyle=s);let c=t.childNodes,l={},u=c.length;for(let t=0;t<u;t++){let n=c.item(t);n.nodeType===1&&n.localName===`tableStyle`&&this.processTableStyle(e,n,l,r,i)}return Object.keys(l).length>0&&(a.styles=l),Object.keys(a).length>0&&(n.tables=a),n}processCellStyles(e,t,n,i,a){if(!t)return;let o=t.childNodes,s=o.length;for(let e=0;e<s;e++){let t=o.item(e);if(t.nodeType===1&&t.localName===`cellStyle`){let e=parseInt(t.getAttribute(`xfId`)??``),o=t.getAttribute(`name`),s=t.getAttribute(`builtinId`),c=o;if(s!==null){let e=r.builtInNameFromId(parseInt(s));e!==void 0&&(c=e)}if(a.set(e,c),!i[e])continue;let l={name:c,style:i[e]};t.getAttribute(`hidden`)&&(l.hidden=D(t.getAttribute(`hidden`))),t.getAttribute(`iLevel`)&&(l.iLevel=parseInt(t.getAttribute(`iLevel`))),s!==null&&D(t.getAttribute(`customBuiltin`)??`0`)&&(l.customized=!0),n.push(l)}}}afterVisit(e,t,n){}},WorkbookVisitor:class extends G{visit(e,t,n){return this.processSheetRefs(e,e.evaluate(`sheets`,t),n),this.processExternalReferences(e,e.evaluate(`externalReferences`,t),n),this.processBookViews(e,e.evaluate(`bookViews`,t),n),this.processDefinedNames(e,e.evaluate(`definedNames`,t),n),this.processCalcPr(e,e.evaluate(`calcPr`,t),n),this.processPivotCaches(e,e.evaluate(`pivotCaches`,t),n),this.processWorkbookProtection(e,e.evaluate(`workbookProtection`,t),n),this.processWorkbookPr(e,e.evaluate(`workbookPr`,t),n),n}processPassword(e,t,n,r=`workbook`,i=`password`){if(!t)return;let a={};e.copyFromAttribute(t,`${r}AlgorithmName`,a,`algorithm`),e.copyFromAttribute(t,`${r}HashValue`,a,`hash`),e.copyFromAttribute(t,`${r}SaltValue`,a,`salt`),e.copyFromAttribute(t,`${r}SpinCount`,a,`spinCount`,e.INT_COPY),e.copyFromAttribute(t,`${r}Password`,a,`legacyHash`),Object.keys(a).length>0&&(n[i]=a)}processWorkbookProtection(e,t,n){if(!t)return;let r={};this.processPassword(e,t,r,`workbook`,`password`),this.processPassword(e,t,r,`revisions`,`revisionsPassword`);for(let e of re)r[e.key]=ae(e,t.getAttribute(e.attribute));return n.protection=r,n}processCalcPr(e,t,n){if(!t)return;let r={};e.copyFromAttribute(t,`calcMode`,r,`calcMode`,e=>Ee[e]??null),e.copyFromAttribute(t,`fullCalcOnLoad`,r,`fullCalcOnLoad`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`calcOnSave`,r,`calcOnSave`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`calcCompleted`,r,`calcCompleted`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`fullPrecision`,r,`fullPrecision`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`forceFullCalc`,r,`forceFullCalc`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`concurrentCalc`,r,`concurrentCalc`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`concurrentManualCount`,r,`concurrentManualCount`,e.INT_COPY),e.copyFromAttribute(t,`refMode`,r,`refMode`),e.copyFromAttribute(t,`iterate`,r,`iterate`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`iterateCount`,r,`maxIteration`,e.INT_COPY),e.copyFromAttribute(t,`iterateDelta`,r,`maxIterateChange`,e.FLOAT_COPY);let i=t.getAttribute(`calcId`);i!==null&&e.getVisitorParamsState().set(`calcId`,i),n.calc=r}processSheetRefs(e,t,n){if(!t)return;let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);n.nodeType===1&&n.localName===`sheet`&&this.processSheetRef(e,n,r)}n.sheets=r}processSheetRef(e,t,n){let r={};e.copyFromAttribute(t,`name`,r,`name`),e.copyFromAttribute(t,`state`,r,`visibility`),e.copyFromAttribute(t,`sheetId`,r,`sheetId`,e.INT_COPY);let i=t.getAttribute(`r:id`),a=i?te(e.getRelationships().get(i)?.type):null;if(a){let t=e.readEmbeddedPart(i);if(t?.xml){let e={part:t},i=ue(t.xml),o=i?T(e=>i.get(e)):void 0;o&&(e.tabColor=o),r.kind=a,r.sheet=e,n.push(r);return}e.warn(`The ${a} sheet '${r.name}' could not be read and was loaded as an empty worksheet.`),n.push(r);return}let o=i?e.getRef(i):null;o&&(r.sheet=o),n.push(r)}processExternalReferences(e,t,n){if(!t)return;let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);if(n.nodeType===1&&n.localName===`externalReference`){let t=n.getAttribute(`r:id`),i=t?e.getRef(t):null;r.push(i??null)}}r.length>0&&(n.externalBooks=r)}processPivotCaches(e,t,n){if(!t)return;let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);if(n.nodeType!==1||n.localName!==`pivotCache`)continue;let a=parseInt(n.getAttribute(`cacheId`)??``,10),o=n.getAttribute(`r:id`);if(isNaN(a)||!o)continue;let s=e.readEmbeddedPart(o);s&&r.push({cacheId:a,part:s})}r.length>0&&(n.pivotCaches=r)}processBookViews(e,t,n){if(!t)return;let r=t.childNodes,i=0,a=r.length;for(let t=0;i<1&&t<a;t++){let a=r.item(t);a.nodeType===1&&a.localName===`workbookView`&&(this.processWorkbookView(e,a,n),i++)}}processWorkbookView(e,t,n){if(!t)return;let r={},i=[`xWindow`,`yWindow`,`windowWidth`,`windowHeight`].map(e=>parseInt(t.getAttribute(e)??``,10));if(i.some(e=>Number.isFinite(e))){let[e,t,n,a]=i.map(e=>Number.isFinite(e)?e:0);r.windowBounds={left:e,top:t,width:n,height:a}}e.copyFromAttribute(t,`activeTab`,r,`activeSheetId`,[e.INT_COPY,e=>e]),t.hasAttribute(`activeTab`)||(r.activeSheetId=0),e.copyFromAttribute(t,`showHorizontalScroll`,r,`showHorizontalScrollbar`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`showVerticalScroll`,r,`showVerticalScrollbar`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`showSheetTabs`,r,`showTabs`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`tabRatio`,r,`tabRatio`,[e.FLOAT_COPY,e=>e]),e.copyFromAttribute(t,`firstSheet`,r,`firstTab`,[e.INT_COPY,e=>e]),e.copyFromAttribute(t,`minimized`,r,`minimized`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`autoFilterDateGrouping`,r,`autoFilterDateGrouping`,e.BOOLEAN_COPY);let a=t.getAttribute(`visibility`);a!==`hidden`&&a!==`veryHidden`||(r.visibility=a),Object.keys(r).length>0&&(n.view=r)}processDefineName(e,t,n,r){if(!t)return;let i={},a=t.firstChild;if(a&&a.nodeType===3&&(i.ref=a.textContent),e.copyFromAttribute(t,`name`,i),e.copyFromAttribute(t,`comment`,i),e.copyFromAttribute(t,`hidden`,i,`hidden`,e.BOOLEAN_COPY),t.hasAttribute(`localSheetId`)){let n=t.getAttribute(`localSheetId`);if(!r[n]?.name)return void e.warn(`Defined name '${t.getAttribute(`name`)}' references a sheet with localSheetId '${n}' which does not exist.`);i.scope=r[n].name}let o={};for(let n of L)e.copyFromAttribute(t,n,o);for(let e of R){let n=t.getAttribute(e);n!==`1`&&n!==`true`||(o[e]=!0)}e.copyFromAttribute(t,`functionGroupId`,o,`functionGroupId`,e.INT_COPY),Object.keys(o).length>0&&(i.fileAttributes=o),Object.keys(i).length>0&&n.push(i)}processDefinedNames(e,t,n){if(!t)return;let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let a=i.item(t);a.nodeType===1&&a.localName===`definedName`&&this.processDefineName(e,a,r,n.sheets)}r.length>0&&(n.names=r)}processWorkbookPr(e,t,n){t&&(e.copyFromAttribute(t,`date1904`,n,`date1904`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`codeName`,n,`codeName`),e.copyFromAttribute(t,`updateLinks`,n,`updateLinks`))}afterVisit(e,t,n){}},TableVisitor:class{visit(e,t,n){let r={};return e.copyFromAttribute(t,`ref`,n,`r`),e.getVisitorParamsState().set(`ref`,n.r),n.v=r,e.copyFromAttribute(t,`name`,r),e.copyFromAttribute(t,`displayName`,r,`name`),e.copyFromAttribute(t,`headerRowCount`,r,`headerRowCount`,e.INT_COPY),e.copyFromAttribute(t,`totalsRowCount`,r,`totalsRowCount`,e.INT_COPY),this.processTableColumns(e,t,r),this.processTableStyleInfo(e,t,r),e.copyFromAttribute(t,`id`,r),e.copyFromAttribute(t,`comment`,r,`description`),e.copyFromAttribute(t,`connectionId`,r,`connectionId`,e.INT_COPY),e.copyFromAttribute(t,`tableType`,r),e.copyFromAttribute(t,`published`,r,`published`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`insertRow`,r,`insertRow`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`insertRowShift`,r,`insertRowShift`,e.BOOLEAN_COPY),r.totalsRowShown=t.getAttribute(`totalsRowShown`)!==`0`,r}afterVisit(e,t,n){let r=n.v;if(e.evaluate(`autoFilter`,t)){if(Array.isArray(r.hiddenButtons)){let e=r.hiddenButtons.length;e===0?r.hiddenButtons=!1:e===r.columns?.length&&(r.hiddenButtons=!0)}}else r.hiddenButtons=!0,r.showButtons=!1;return r}processTableStyleInfo(e,t,n){if(!t)return;let r=t.childNodes,i={},a=r.length;for(let t=0;t<a;t++){let n=r.item(t);n.nodeType===1&&n.localName===`tableStyleInfo`&&(e.copyFromAttribute(n,`name`,i),e.copyFromAttribute(n,`showColumnStripes`,i,`showColumnStripes`,e.BOOLEAN_COPY),e.copyFromAttribute(n,`showFirstColumn`,i,`showFirstColumn`,e.BOOLEAN_COPY),e.copyFromAttribute(n,`showLastColumn`,i,`showLastColumn`,e.BOOLEAN_COPY),e.copyFromAttribute(n,`showRowStripes`,i,`showRowStripes`,e.BOOLEAN_COPY))}Object.keys(i).length>0&&(n.style=i)}processTableColumn(e,t,n){if(!t)return null;let r=t.childNodes,i=r.length;for(let t=0;t<i;t++){let i=r.item(t);if(i.nodeType===1&&i.localName===`tableColumn`){let t={};e.copyFromAttribute(i,`name`,t),e.copyFromAttribute(i,`id`,t),e.copyFromAttribute(i,`uniqueName`,t),e.copyFromAttribute(i,`queryTableFieldId`,t),e.copyFromAttribute(i,`totalsRowLabel`,t);let r=i.getAttribute(`totalsRowFunction`);if(r!==null){if(r===`custom`){let n=e.evaluate(`totalsRowFormula`,i);n&&(t.totalsRowFormula=n.textContent)}else t.totalsRowFormula=r}e.copyFromAttribute(i,`totalsRowLabel`,t);let a=e.evaluate(`calculatedColumnFormula`,i);a?.textContent&&(t.calculatedColumnFormula=a.textContent),n.push(t)}}return n}processTableColumns(e,t,n){let r=t.childNodes,i=[],a=r.length;for(let t=0;t<a;t++){let n=r.item(t);n.nodeType===1&&n.localName===`tableColumns`&&this.processTableColumn(e,n,i)}i.length>0&&(n.columns=i)}},TableX14Visitor:class{visit(e,t,n){let r=e.getVisitorParamsState().get(`ref`);if(r){let n=e.getVisitorParamsState().get(`descriptions`);n&&(n.add(r,t.getAttribute(`altText`)),n.add(r,t.getAttribute(`altTextSummary`)))}return e.copyFromAttribute(t,`altText`,n),e.copyFromAttribute(t,`altTextSummary`,n),n}},ExternalLinkVisitor:class{visit(e,t,n){let r=t.childNodes,i=r.length,a=null;for(let e=0;e<i;e++){let t=r.item(e);if(t.nodeType===1){t.localName===`externalBook`&&(a=t);break}}if(!a)return n;t.getAttribute(`mc:Ignorable`)&&(n.mceIgnorable=!0);let o=a.getAttribute(`r:id`);o&&(n.__bookRelId=o);let s=this._findAbsoluteUrlRelId(a);return s&&(n.__absoluteUrlRelId=s),n.sheetNames=[],this.processSheetNames(e,a,n),this.processDefinedNames(e,a,n),this.processSheetDataSet(e,a,n),n}processSheetNames(e,t,n){let r=this._findChild(t,`sheetNames`);if(!r)return;let i=r.childNodes,a=i.length;for(let e=0;e<a;e++){let t=i.item(e);t.nodeType===1&&t.localName===`sheetName`&&n.sheetNames.push(t.getAttribute(`val`)??``)}}processDefinedNames(e,t,n){let r=this._findChild(t,`definedNames`);if(!r)return;let i=[],a=r.childNodes,o=a.length;for(let e=0;e<o;e++){let t=a.item(e);if(t.nodeType!==1||t.localName!==`definedName`)continue;let n=t.getAttribute(`name`);if(!n)continue;let r={name:n,refersTo:t.getAttribute(`refersTo`)??``},o=t.getAttribute(`sheetId`);o!==null&&(r.sheetIndex=parseInt(o,10)),i.push(r)}i.length>0&&(n.definedNames=i)}processSheetDataSet(e,t,n){let r=this._findChild(t,`sheetDataSet`);if(!r)return;let i=[],a=r.childNodes,o=a.length;for(let t=0;t<o;t++){let n=a.item(t);if(n.nodeType!==1||n.localName!==`sheetData`)continue;let r=n.getAttribute(`sheetId`);if(r===null)continue;let o=this.processSheetData(e,n);o.sheetIndex=parseInt(r,10),n.getAttribute(`refreshError`)===`1`&&(o.refreshError=!0),i.push(o)}i.length>0&&(n.sheetDataSet=i)}processSheetData(e,t){let n=new f.Builder,r=t.childNodes,i=r.length;for(let e=0;e<i;e++){let t=r.item(e);if(t.nodeType!==1||t.localName!==`row`)continue;let i=t.childNodes,a=i.length;for(let e=0;e<a;e++){let t=i.item(e);if(t.nodeType!==1||t.localName!==`cell`)continue;let r=t.getAttribute(`r`);if(!r)continue;let a=d.fastStringToCell(r);if(a?.rowIndex===void 0||a?.colIndex===void 0)continue;let o=this._readCellValue(t);o!==void 0&&n.pushAt(a.rowIndex,a.colIndex,o)}}return{sheetIndex:-1,data:n.build()?.tuples??[]}}_readCellValue(e){let t=this._findChild(e,`v`)?.textContent?.trim();if(t!==void 0&&t!==``)switch(e.getAttribute(`t`)){case null:case`n`:return parseFloat(t);case`b`:return t===`1`||t===`true`;case`str`:default:return t;case`e`:{let e=l.getBuiltInByLabel(t);return e?{t:`e`,v:e.getCode()}:t}}}_findChild(e,t){let n=e.childNodes,r=n.length;for(let e=0;e<r;e++){let r=n.item(e);if(r.nodeType===1&&r.localName===t)return r}return null}_findAbsoluteUrlRelId(e){let t=this._findChild(e,`alternateUrls`);return t?this._findChild(t,`absoluteUrl`)?.getAttribute(`r:id`)??null:null}},SlicerCacheDefinitionVisitor:class{visit(e,t,n){e.copyFromAttribute(t,`name`,n,`cacheName`),e.copyFromAttribute(t,`sourceName`,n);let r=e.evaluate(`*/tableSlicerCache`,t);return r?(e.copyFromAttribute(r,`tableId`,n),e.copyFromAttribute(r,`column`,n,`columnId`),e.copyFromAttribute(r,`sortOrder`,n),e.copyFromAttribute(r,`customListSort`,n,`customListSort`,e.BOOLEAN_COPY),e.copyFromAttribute(r,`crossFilter`,n),n):(e.warn(`A slicer names no table; it was not imported.`,{onceKey:`xlsx.slicer.cacheDefinition`}),n)}},SlicersVisitor:class{visit(e,t,n){let r=n.slicers;r||(r={},n.slicers=r);let i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);n.nodeType===1&&n.localName===`slicer`&&this.processSlicer(e,n,r)}return r}processSlicer(e,t,n){if(!t)return;let r={};n[t.getAttribute(`name`)]=r,e.copyFromAttribute(t,`xr10:uid`,r,`uid`);let i=t.getAttribute(`cache`),a=e.getVisitorParamsState().get(`slicerCaches`),o=i?a?.get(i):void 0;if(o)for(let e=0;e<J.length;e++){let t=J[e];o[t]!==void 0&&(r[t]=o[t])}e.copyFromAttribute(t,`caption`,r),e.copyFromAttribute(t,`startItem`,r,`startItem`,e.INT_COPY),e.copyFromAttribute(t,`columnCount`,r,`columnCount`,e.INT_COPY),e.copyFromAttribute(t,`showCaption`,r,`showCaption`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`level`,r,`level`,e.INT_COPY),e.copyFromAttribute(t,`style`,r),e.copyFromAttribute(t,`lockedPosition`,r,`lockedPosition`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`rowHeight`,r,`rowHeight`,e.INT_COPY)}},FormControlPrVisitor:class{visit(e,t,n){let r={},i=t.attributes;for(let e=0;e<i.length;e++){let t=i.item(e),n=t.name;n===`xmlns`||n.startsWith(`xmlns:`)||(r[n]=t.value)}let a=[],o,s=t.childNodes;for(let t=0;t<s.length;t++){let n=s.item(t);if(n.nodeType===1){if(n.localName===`itemLst`){let e=n.childNodes;for(let t=0;t<e.length;t++){let n=e.item(t);n.nodeType===1&&n.localName===`item`&&a.push(n.getAttribute(`val`)??``)}}else n.localName===`extLst`&&(o=e.serializeElement(n)??void 0)}}let c=fe(r,a,o);return n.formControl=c,c}},DrawingVisitor:class{visit(e,t,n){return n}afterVisit(e,t,n){for(let e of n?.movables??[])Y(e,!1)}},DrawingAnchorVisitor:class{visit(e,t,n){if(!t)return;let r={};e.copyFromAttribute(t,`editAs`,r,`anchorType`),r.anchor={},t.localName===`absoluteAnchor`?(r.anchorType=`absolute`,this.processAbsoluteCoord(e,e.evaluate(`pos`,t),r.anchor,`from`,`x`,`y`),this.processAbsoluteCoord(e,e.evaluate(`ext`,t),r.anchor,`to`,`cx`,`cy`)):t.localName===`oneCellAnchor`?(this.processOffsetCoord(e,e.evaluate(`from`,t),r.anchor,`from`),this.processAbsoluteCoord(e,e.evaluate(`ext`,t),r.anchor,`to`,`cx`,`cy`)):(this.processOffsetCoord(e,e.evaluate(`from`,t),r.anchor,`from`),this.processOffsetCoord(e,e.evaluate(`to`,t),r.anchor,`to`));let i=e.evaluate(`clientData`,t),a=e=>{let t=i?.getAttribute(e);return t===`0`||t===`false`};return a(`fPrintsWithSheet`)&&(r.noPrint=!0),a(`fLocksWithSheet`)&&(r.unlocked=!0),n.movables||=[],n.movables.push(r),r}processAbsoluteCoord(e,t,n,r,i,a){if(!t)return;let o={x:0,y:0};return o.x=k(t.getAttribute(i)),o.y=k(t.getAttribute(a)),r===`from`?n.tl=o:n.br=o,n}processOffsetCoord(e,t,n,r){if(!t)return;let i={c:0,r:0,x:0,y:0};return e.evaluate(`col`,t)&&(i.c=parseInt(e.evaluate(`col`,t).textContent)),e.evaluate(`row`,t)&&(i.r=parseInt(e.evaluate(`row`,t).textContent)),e.evaluate(`colOff`,t)&&(i.x=k(e.evaluate(`colOff`,t).textContent)),e.evaluate(`rowOff`,t)&&(i.y=k(e.evaluate(`rowOff`,t).textContent)),r===`from`?n.tl=i:n.br=i,n}},DrawingGraphicFrameVisitor:class extends H{visit(e,t,n){if(!t)return;if(this.isGroupContent(n)){if(e.getPath().includes(`Fallback`))return{};let{movable:r}=this.readMemberHeader(e,t,`graphicFrame`),i=e.evaluate(`xfrm`,t);if(i){C(i,r);let t=e.evaluate(`off`,i),n=e.evaluate(`ext`,i);r.anchor={tl:{x:k(t?.getAttribute(`x`)??null)??0,y:k(t?.getAttribute(`y`)??null)??0},br:{x:k(n?.getAttribute(`cx`)??null)??0,y:k(n?.getAttribute(`cy`)??null)??0}}}let a=this.readGraphic(e,t),o=a.type===`chart`?{...r.content.json,...a.json}:a.json;return r.content={...r.content,type:a.type,json:o},n.members.push(r),a.json}n=super.visit(e,t,n);let r=e.evaluate(`nvGraphicFramePr/cNvGraphicFramePr`,t);if(r){let t=e.evaluate(`graphicFrameLocks`,r);t&&t.hasAttribute(`noChangeAspect`)&&(n.lockAspect=t.getAttribute(`noChangeAspect`)===`1`)}let i=this.readGraphic(e,t);return this.setContent(n,i),i}readGraphic(e,t){let n=e.evaluate(`graphic/graphicData`,t),r={type:`graphicFrame`,json:{}};if(!n)return r;let i=n.childNodes,a=i.length;for(let n=0;n<a;n++){let a=i.item(n);if(a.nodeType===1)try{let n=a.localName;n===`chart`?n=`chart`:n===`slicer`&&(n=`slicer`),r.type=n;let i=a.getAttribute(`r:id`);if(n===`chart`&&i){let n=this.readSourceId(e,t),a=e.readEmbeddedPart(i)??void 0,o;try{let t=a?.xml?_e(a.xml):null;o=t?.model,t?.lossy&&e.warn(`A chart states something its model does not; it is saved as it was until it is changed.`,{onceKey:`xlsx.chart.lossy`})}catch(t){e.warn(`A chart could not be read into the chart model; it is kept as its markup: ${t?.message??t}`,{onceKey:`xlsx.chart.model`})}r.json={sourceId:n,part:a,model:o}}else if(n===`slicer`){let n=this.readSourceId(e,t);n!==void 0&&(r.json={sourceId:n})}else i&&(r.json=e.getRef(i))}catch(t){e.warn(`Unable to read a graphic frame: ${t?.message??t}`,{onceKey:`xlsx.drawing.graphicFrame`})}}return r}},DrawingSpVisitor:X,DrawingPicVisitor:class extends H{visit(e,t,n){if(!t)return;if(this.isGroupContent(n)){if(e.getPath().includes(`Fallback`))return{};let{movable:r,content:i}=this.readMemberHeader(e,t,`picture`),a=this.readImage(e,t);return a?(this.readPictureDetails(e,t,a,r,i),n.members.push(r),i):{}}let r=super.visit(e,t,n),i=this.readImage(e,t);if(i===null)return;let a={},o=this.readSourceId(e,t);return o!==void 0&&(a.sourceId=o),this.readPictureDetails(e,t,i,r,a),this.setContent(r,{type:`picture`,json:a}),a}readPictureDetails(e,t,n,r,i){n?.resId!==void 0&&(i.resId=n.resId),n?.image&&(i.image=n.image);let a=t.getAttribute(`macro`);a&&(i.macro=a),t.hasAttribute(`fPublished`)&&(i.published=D(t.getAttribute(`fPublished`)));let o=e.evaluate(`nvPicPr/cNvPicPr`,t);if(o?.getAttribute){o.getAttribute(`preferRelativeResize`)===`0`&&(i.noRelativeResize=!0);let t=this.readLocks(e.evaluate(`picLocks`,o));t&&(i.locks=t),r.lockAspect=t?.noChangeAspect??!1}}readImage(e,t){let n=e.evaluate(`blipFill`,t),r=n?e.evaluate(`blip`,n):null;if(!r)return;if(!(r.getAttribute(`r:embed`)??r.getAttribute(`embed`)??r.getAttribute(`r:link`)??r.getAttribute(`link`)))return e.warn(`A picture names no image; it was not imported.`,{onceKey:`xlsx.drawing.picture.noRel`}),null;let{type:i,resId:a,...o}=new h().processImageFill(e,n);return!o.tile&&o.stretch&&Object.keys(o.stretch).length===0&&delete o.stretch,o.extLst&&De.test(o.extLst)&&delete o.extLst,{resId:a,image:Object.keys(o).length>0?o:void 0}}},DrawingGrpSpVisitor:class extends H{constructor(...e){super(...e),this._fills=new h}visit(e,t,n){if(!t)return;let r=this.isGroupContent(n),i,a;if(r){if(e.getPath().includes(`Fallback`))return{};let r=this.readMemberHeader(e,t,`group`);i=r.movable,a=r.content,n.members.push(i)}else{if(e.getPath().includes(`Fallback`)&&n.content)return{};i=super.visit(e,t,n),a={};let r=this.readSourceId(e,t);r!==void 0&&(a.sourceId=r),this.setContent(i,{type:`group`,json:a})}a.members=[];let o=e.evaluate(`nvGrpSpPr/cNvGrpSpPr/grpSpLocks`,t);o?.hasAttribute?.(`noChangeAspect`)&&(i.lockAspect=o.getAttribute(`noChangeAspect`)===`1`);let s=this.readLocks(o);s&&(a.locks=s);let c=e.evaluate(`grpSpPr`,t);if(c){let t=e.evaluate(`xfrm`,c);if(t){C(t,i),t.getAttribute(`flipH`)===`1`&&(i.flipH=!0),t.getAttribute(`flipV`)===`1`&&(i.flipV=!0);let n=Z(e,t,`off`,`ext`),o=Z(e,t,`chOff`,`chExt`)??n;o&&(a.childBounds=o),r&&n&&(i.anchor={tl:{x:n.x,y:n.y},br:{x:n.width,y:n.height}})}let n=this._fills.getFill(e,c);n&&Object.keys(n).length>0&&(a.fill=n);let o=this._fills.getEffects(e,c);o&&(a.effects=o);let s=e.evaluate(`scene3d`,c),l=s?e.serializeElement(s):null;l&&(a.scene3d=l);let u=e.evaluate(`extLst`,c),d=u?e.serializeElement(u):null;d&&(a.extLst={...a.extLst,properties:d})}return a}},DrawingCxnSpVisitor:class extends X{visit(e,t,n){if(t)return this.visitShape(e,t,n,`cxnSp`,`nvCxnSpPr/cNvCxnSpPr/cxnSpLocks`)}},MetadataVisitor:class{visit(e,t,n){let r=[],i=new Map,a={cells:[],values:[]},o=t.childNodes;for(let e=0;e<o.length;e++){let t=o.item(e);if(t.nodeType===1)switch(t.localName){case`metadataTypes`:this._parseMetadataTypes(t,r,i);break;case`futureMetadata`:this._attachFutureMetadata(t,i);break;case`cellMetadata`:this._resolveBlocks(t,r,a.cells);break;case`valueMetadata`:this._resolveBlocks(t,r,a.values)}}return n.metadata=a,a}_parseMetadataTypes(e,t,n){let r=e.childNodes;for(let e=0;e<r.length;e++){let i=r.item(e);if(i.nodeType===1&&i.localName===`metadataType`){let e=this._parseMetadataType(i);t.push(e),n.set(e.name,e)}}}_parseMetadataType(e){let t={name:e.getAttribute(`name`)??``,_blocks:[]},n=e.getAttribute(`minSupportedVersion`);n!=null&&(t.minSupportedVersion=Number(n));for(let n of[`copy`,`pasteAll`,`pasteValues`,`merge`,`splitFirst`,`splitAll`,`rowColShift`,`clearFormats`,`clearComments`,`assign`,`coerce`,`cellMeta`,`adjust`,`trans`,`delete`,`edit`])e.getAttribute(n)===`1`&&(t[n]=!0);return t}_attachFutureMetadata(e,t){let n=e.getAttribute(`name`)??``,r=t.get(n);if(!r)return;let i=e.childNodes;for(let e=0;e<i.length;e++){let t=i.item(e);t.nodeType===1&&t.localName===`bk`&&r._blocks.push(this._parseFutureBlock(t))}}_parseFutureBlock(e){let t={},n=e.childNodes;for(let e=0;e<n.length;e++){let r=n.item(e);if(r.nodeType!==1||r.localName!==`extLst`)continue;let i=r.childNodes;for(let e=0;e<i.length;e++){let n=i.item(e);if(n.nodeType!==1||n.localName!==`ext`)continue;let r=n.childNodes;for(let e=0;e<r.length;e++){let n=r.item(e);n.nodeType===1&&(n.localName===`dynamicArrayProperties`?(t.fDynamic=n.getAttribute(`fDynamic`)===`1`,t.fCollapsed=n.getAttribute(`fCollapsed`)===`1`):n.localName===`rvb`&&(t.richValueIndex=Number(n.getAttribute(`i`)??`0`)))}}}return t}_resolveBlocks(e,t,n){let r=e.childNodes;for(let e=0;e<r.length;e++){let i=r.item(e);i.nodeType===1&&i.localName===`bk`&&n.push(this._resolveBlock(i,t))}}_resolveBlock(e,t){let n=new Map,r=e.childNodes;for(let e=0;e<r.length;e++){let i=r.item(e);if(i.nodeType!==1||i.localName!==`rc`)continue;let a=Number(i.getAttribute(`t`)),o=Number(i.getAttribute(`v`)),s=t[a-1];if(!s)continue;let{_blocks:c,...l}=s,u={...l};for(let e of Object.keys(u))u[e]===void 0&&delete u[e];let d=c[o];d&&(d.fDynamic!==void 0&&(u.fDynamic=d.fDynamic,u.fCollapsed=d.fCollapsed??!1),d.richValueIndex!==void 0&&(u.richValueIndex=d.richValueIndex)),n.set(s.name,u)}return n}},FeaturePropertyBagVisitor:class{visit(e,t,n){let r=[],i=t.childNodes;for(let e=0;e<i.length;e++){let t=i.item(e);t.nodeType===1&&t.localName===`bag`&&r.push(this._readBag(t))}let a=[],o=r.find(e=>e.type===`XFComplements`)?.arrays.get(`MappedFeaturePropertyBags`)??[];for(let t=0;t<o.length;t++){let n=r[o[t]]?.ids.get(`XFControls`),i=n===void 0?void 0:r[n]?.ids.get(`CellControl`),s=i===void 0?void 0:r[i]?.type,c=s?Oe[s]:void 0;c||e.warn(`A cell format's feature '${s??`unknown`}' is not read; its cells keep their values.`),a.push(c?{type:c}:null)}let s={controls:a};return n.featurePropertyBag=s,s}_readBag(e){let t={type:e.getAttribute(`type`)??``,ids:new Map,arrays:new Map},n=e.childNodes;for(let e=0;e<n.length;e++){let r=n.item(e);if(r.nodeType!==1)continue;let i=r.getAttribute(`k`)??``;if(r.localName===`bagId`){let e=parseInt(r.textContent??``,10);isNaN(e)||t.ids.set(i,e)}else if(r.localName===`a`){let e=[],n=r.childNodes;for(let t=0;t<n.length;t++){let r=n.item(t);if(r.nodeType!==1||r.localName!==`bagId`)continue;let i=parseInt(r.textContent??``,10);isNaN(i)||e.push(i)}t.arrays.set(i,e)}}return t}},CommentsVisitor:class{visit(e,t,n){if(!t)return;let r=[];this.processAuthors(e,e.evaluate(`authors`,t),r),r.length>0&&(n.authors=r);let i=[];return n.comments=i,i}processAuthors(e,t,n){if(!t)return;let r=t.childNodes,i=r.length;for(let e=0;e<i;e++){let t=r.item(e);if(t.nodeType===1&&t.localName===`author`){let e=t.firstChild;e&&e.nodeType===3&&n.push(e.textContent)}}}},CommentVisitor:class{visit(e,t,n){if(!t)return;let r=t.getAttribute(`ref`);if(!r)return;let i={content:``};if(t.hasAttribute(`authorId`)){let e=parseInt(t.getAttribute(`authorId`),10);isNaN(e)||(i.authorId=e)}return i.content=function(e){if(!e)return``;let t=[],n=!0,r=e.childNodes;for(let e=0;e<r.length;e++){let i=r.item(e);if(i.nodeType===1){if(i.localName===`t`)t.push({text:i.textContent??``});else if(i.localName===`r`){let e={text:``},r=i.childNodes;for(let t=0;t<r.length;t++){let n=r.item(t);if(n.nodeType===1){if(n.localName===`t`)e.text+=n.textContent??``;else if(n.localName===`rPr`){let t=Ae(n);t&&(e.font=t)}}}e.font&&(n=!1),t.push(e)}}}return t.length===0?e.textContent??``:n?t.map(e=>e.text).join(``):{runs:t}}(e.evaluate(`text`,t)),n.push({r,v:i}),i}},ThreadedCommentsVisitor:class{visit(e,t,n){if(!t)return;let r=[];return n.comments=r,r}},ThreadedCommentVisitor:class{visit(e,t,n){if(!t)return;let r={};e.copyFromAttribute(t,`id`,r,`id`,S);let i=t.getAttribute(`ref`);e.copyFromAttribute(t,`personId`,r,`personId`,S),e.copyFromAttribute(t,`parentId`,r,`parentId`,S);let a=t.getAttribute(`dT`);a&&(r.dt=function(e){let t=/^(.*T\d{2}:\d{2}:\d{2})(?:\.(\d+))?(Z|[+-]\d{2}:?\d{2})?$/i.exec(e.trim());if(!t)return e;let[,n,r,i]=t;return`${n}${r?`.${(r+`00`).substring(0,3)}`:``}${i??`Z`}`}(a)),t.hasAttribute(`done`)&&(r.done=D(t.getAttribute(`done`)));let o=function(e){let t,n=e.childNodes;for(let e=0;e<n.length;e++){let r=n.item(e);if(r.nodeType!==1||r.localName!==`mentions`)continue;let i=r.childNodes;for(let e=0;e<i.length;e++){let n=i.item(e);if(n.nodeType!==1||n.localName!==`mention`)continue;let r=n.getAttribute(`mentionId`),a=n.getAttribute(`mentionpersonId`);if(!r||!a)continue;let o={id:S(r),personId:S(a)},s=parseInt(n.getAttribute(`startIndex`)??``,10);isNaN(s)||(o.startIndex=s);let c=parseInt(n.getAttribute(`length`)??``,10);isNaN(c)||(o.length=c),(t??=[]).push(o)}}return t}(t);return o&&(r.mentions=o),n.push({r:i,v:r}),r}},PersonListVisitor:class{visit(e,t,n){let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);if(n.nodeType===1&&n.localName===`person`){let t={};e.copyFromAttribute(n,`id`,t,`id`,S),e.copyFromAttribute(n,`displayName`,t),e.copyFromAttribute(n,`userId`,t,`userId`,S),e.copyFromAttribute(n,`providerId`,t),r.push(t)}}return r.length>0&&(n.persons=r),r}}},je=class{constructor(e,t){this.path=e,this.visitor=t}},Me=class{constructor(){this.visitorsByXmlTagName=new Map,this.scopedVisitorsByXmlTagName=new Map,this.visitorParamsState=null,this.registerVisitor(`Relationships`,new $.RelsVisitor),this.registerVisitor(`cp:coreProperties`,new $.CorePropertiesVisitor),this.registerVisitor(`Properties`,new $.AppPropertiesVisitor),this.registerVisitor(`spPr`,new $.ShapePropertiesVisitor),this.registerVisitor(`txBody`,new $.ShapeTextVisitor),this.registerVisitor(`txPr`,new $.TextPropertiesVisitor),this.registerVisitor(`a:theme`,new $.ThemeVisitor),this.registerVisitor(`a:theme`,new $.ClrSchemeVisitor,`themeElements/clrScheme`),this.registerVisitor(`a:theme`,new $.FontSchemeVisitor,`themeElements/fontScheme`),this.registerVisitor(`a:theme`,new $.FmtSchemeVisitor,`themeElements/fmtScheme`),this.registerVisitor(`a:theme`,new $.ObjectDefaultsVisitor,`objectDefaults`),this.registerVisitor(`autoFilter`,new $.AutoFilterVisitor),this.registerVisitor(`sortState`,new $.SortStateVisitor),this.registerVisitor(`s:workbook`,new $.WorkbookVisitor),this.registerVisitor(`styleSheet`,new $.SheetStyleVisitor),this.registerVisitor(`x14:table`,new $.TableX14Visitor),this.registerVisitor(`table`,new $.TableVisitor),this.registerVisitor(`externalLink`,new $.ExternalLinkVisitor),this.registerVisitor(`wsDr`,new $.DrawingVisitor),this.registerVisitor(`twoCellAnchor`,new $.DrawingAnchorVisitor),this.registerVisitor(`oneCellAnchor`,new $.DrawingAnchorVisitor),this.registerVisitor(`absoluteAnchor`,new $.DrawingAnchorVisitor),this.registerVisitor(`graphicFrame`,new $.DrawingGraphicFrameVisitor),this.registerVisitor(`sp`,new $.DrawingSpVisitor),this.registerVisitor(`grpSp`,new $.DrawingGrpSpVisitor),this.registerVisitor(`cxnSp`,new $.DrawingCxnSpVisitor),this.registerVisitor(`pic`,new $.DrawingPicVisitor),this.registerVisitor(`metadata`,new $.MetadataVisitor),this.registerVisitor(`FeaturePropertyBags`,new $.FeaturePropertyBagVisitor),this.registerVisitor(`comments`,new $.CommentsVisitor),this.registerVisitor(`comment`,new $.CommentVisitor),this.registerVisitor(`ThreadedComments`,new $.ThreadedCommentsVisitor),this.registerVisitor(`threadedComment`,new $.ThreadedCommentVisitor),this.registerVisitor(`threadedComment`,new $.TextPropertiesVisitor(`content`),`text`),this.registerVisitor(`personList`,new $.PersonListVisitor),this.registerVisitor(`slicerCacheDefinition`,new $.SlicerCacheDefinitionVisitor),this.registerVisitor(`slicers`,new $.SlicersVisitor),this.registerVisitor(`formControlPr`,new $.FormControlPrVisitor)}registerVisitor(e,t,n=null){e.indexOf(`:`)===-1&&(e=`*:`+e);let r=e.split(`:`),i=r.length>1?r[1]:r[0];if(!n)return this.visitorsByXmlTagName.set(i,t),void this.visitorsByXmlTagName.set(e,t);let a=this.scopedVisitorsByXmlTagName.get(i);a||(a=[],this.scopedVisitorsByXmlTagName.set(i,a),this.scopedVisitorsByXmlTagName.set(e,a)),a.push(new je(n,t))}parseDxf(t,n=``,r=e.EmptyObject){this.visitorParamsState||=new Map;let i=this.visitorParamsState,a=i.get(`processingDXFs`);i.set(`processingDXFs`,!0);try{let e=new z(null,this,`/dxf`,t,{},n,r),i={};return new $.SheetStyleVisitor().processDXF(e,t,i),i}finally{a===void 0?i.delete(`processingDXFs`):i.set(`processingDXFs`,a)}}getVisitorParamsState(){return this.visitorParamsState}transform(t,n,r=e.EmptyObject){let i=t.documentElement;this.visitorParamsState&&!r?.paramMap||(this.visitorParamsState=r?.paramMap??new Map);let a={},o=this.visitorsByXmlTagName.get(i.nodeName);if(o||=this.visitorsByXmlTagName.get(i.localName),!o)throw Error(`A visitor for the root element: '${i.nodeName}' or '${i.localName}' must be registered.`);let s=`/`+i.localName,c=new z(null,this,s,i,a,n,r),l=[];this._doWalk(o,c,l,i,a,n,r);let u=l.length;for(let e=0;e<u;e++){let t=l[e];try{t.visitor?.afterVisit?.(t.context,t.elemParent,t.jsonParent)}catch(e){t.context.warn(`Unable to finish reading '${t.context.getPath()}': ${e?.message??e}`,{onceKey:`xlsx.transform.afterVisit`})}}return a}_walkScoped(e,t,n,r,i,a,o){let s=this.scopedVisitorsByXmlTagName.get(e),c=s?s.length:0;for(let l=0;l<c;l++){let c=s[l],u=null;try{u=t.evaluate(c.path,r)}catch{t.warn(`Invalid path '${c.path}' for '${e}'.`,{onceKey:`xlsx.transform.invalidPath`})}if(!u)continue;let d=e=>{let s=e.localName,l=e.parentNode;for(;l&&l!==r;)s=l.localName+`/`+s,l=l.parentNode;let u=t.getPath()+`/`+s;if(c.visitor){let r=new z(t,this,u,t.getElemRoot(),t.getJsonRoot(),a,o);this._doWalk(c.visitor,r,n,e,i,a,o)}};if(u.length>0){let e=u,t=e.length;for(let n=0;n<t;n++)d(e.item(n))}else d(u)}}_doWalk(e,t,n,r,i,a,o){let s=null;e&&(n.push({visitor:e,context:t,elemParent:r,jsonParent:i}),s=e.visit(t,r,i)),s||=i;let c=r.localName;this._walkScoped(c,t,n,r,s,a,o);let l=this.visitorsByXmlTagName,u=t.getElemRoot(),d=t.getJsonRoot(),f=r.childNodes,p=f.length;for(let e=0;e<p;e++){let r=f.item(e);if(r.nodeType!==1)continue;let c=r,p=c.nodeName,m=l.get(p);m||=(p=c.localName,l.get(p));let h=t.getPath()+`/`+p,g=new z(t,this,h,u,d,a,o);this._doWalk(m,g,n,c,s??i,a,o)}return s}};export{Me as DOMTransformer,z as ExecutionContext,le as NumberUtils,N as VisitorUtils};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{I as e,Z as t,_ as n,u as r,y as i}from"./ChSvXfVMLxZsP9zG.js";import{a}from"./DcrVJCyDwGKeil2U.js";import{C as o,Dt as s,T as c,ot as l}from"./Ca6nxdhEuLLty3d7.js";import{$ as u,S as d,Wr as f,Y as p,mn as m,v as h,vt as g}from"./D66vSE1ConAuENmB.js";var _=class extends g{constructor(e){super(e),this._optionsMember=e}getParent(){return this._optionsMovable.getParent()}getRange(e){return this.getParent().getRange(e)}getRanges(e){return this.getParent().getRanges(e)}isDeleted(){return!!super.isDeleted()||((this._optionsMovable?.getParent?.())?.isDeleted()??!1)}getAnchorType(){return m.Type.Absolute}setAnchorType(e){return this}_getLocalPlacement(){let e=this._getState(),t=e?.pixelBounds;return t?{bounds:t,rotation:e.rotation??0,flip:{horizontal:e.flipH??!1,vertical:e.flipV??!1}}:null}_getDrawnPlacement(){let e=this._getLocalPlacement();return e?this._optionsMember.place(e):null}getBounds(){return this._getDrawnPlacement()?.bounds??null}getRotation(){return this._getDrawnPlacement()?.rotation??0}getFlip(){return this._getDrawnPlacement()?.flip??{horizontal:!1,vertical:!1}}setRotation(e=0){let n=this._acceptRotation(e);if(n===null)return this;e=n;let r=this._getDrawnPlacement();if(!r||e===r.rotation)return this;let i=this._optionsMember.unplace({...r,rotation:e});if(!i)return this;let a=t(`op.setMovableRotation`),o=this._beginCommit(a);try{this._updateState({rotation:i.rotation,pixelBounds:i.bounds},{description:a},[`onBoundsChange`]),this._optionsMember.onMemberPlacementChange?.(),this._notifyPlacementChange(),o.commit()}catch(e){throw o.rollback(),e}return this}setFlip(e,n){let r=this._getDrawnPlacement();if(!r)return this;let i=this._acceptFlip({horizontal:e.horizontal??r.flip.horizontal,vertical:e.vertical??r.flip.vertical});if(!i)return this;let{horizontal:a,vertical:o}=i;if(a===r.flip.horizontal&&o===r.flip.vertical)return this;let s=this._optionsMember.unplace({...r,flip:{horizontal:a,vertical:o}});if(!s)return this;let c=n?.description??t(`op.setMovableFlip`),l=this._beginCommit(c);try{this._updateState({flipH:s.flip.horizontal,flipV:s.flip.vertical},{description:c}),this._notifyPlacementChange(),l.commit()}catch(e){throw l.rollback(),e}return this}_getAnchorBounds(){let e=this._getDrawnPlacement();return e?s(e.bounds,e.rotation):null}_setAnchorBounds(e){let n=this._getDrawnPlacement();if(!n)return;let r=this._optionsMember.unplace({...n,bounds:s(e,n.rotation)});if(!r)return;let i=this._getLocalPlacement();i&&l.isSameBounds(i.bounds,r.bounds)||(this._updateState({pixelBounds:r.bounds},{description:t(`op.updateMovableBounds`)},[`onBoundsChange`]),this._optionsMember.onMemberPlacementChange?.())}_processContainerLayout(){this._getEmitter().notify(`onBoundsChange`),this._forwardLayout()}_fromJSON(n){let r=n.anchor?.tl??e.EmptyObject,i=n.anchor?.br??e.EmptyObject;this._updateState({offsets:{tl:{x:0,y:0},br:{x:0,y:0}},hidden:n.hidden??!1,rotation:n.rotation??0,flipH:n.flipH??!1,flipV:n.flipV??!1,lockAspectRatio:n.lockAspect??null,locks:n.locks??null,anchorType:m.Type.Absolute,pixelBounds:{x:r.x??0,y:r.y??0,width:i.x??0,height:i.y??0}},{description:t(`op.loadMovable`)})}_getAnchorJSON(){let t=this._getState()?.pixelBounds??{x:0,y:0,width:0,height:0},n=t=>e.roundAccurately(t,2);return{tl:{x:n(t.x),y:n(t.y)},br:{x:n(t.width),y:n(t.height)}}}toJSON(e){let t=super.toJSON(e);return delete t.anchorType,t}},v=class extends u{constructor(e,t){super(t),this._group=e}_getItems(e){let t=this._group._getMembers(),n=e?.type,r=n===void 0?null:Array.isArray(n)?n:[n],i=[];for(let n of t){if(e?.ignoreHidden&&n.isHidden())continue;r&&!r.includes(n.getContent().getType())||i.push(n);let t=e?.deep?n.getMovables():null;t&&i.push(...t.getItems(e))}return i}getCount(){return this._group._getMembers().length}add(e){if(!e)throw new r(`No movable options provided`);return this._group._addMember(e)}_prepare(e){if(!e)throw new r(`No movable options provided`);return this._group._prepareMember(e)}_preparePicture(e,n){let i=this._group.getMovable();if(!i)throw new r(`The group is not placed.`);let a=i.getRange().getWorksheet().getResources().add(e);return this._group._prepareMember({description:t(`op.insertImage`),...n,type:`picture`,json:{...n?.json,resId:0},fromResourceId:()=>a})}_insertNow(e){return this._group._insertMember(e)}async addPicture(e,t){return this._insertNow(await this._preparePicture(e,t))}group(e,t){return this._group._groupMembers(e,t)}updateSelected(e,n){let r=this._group._getMembers().filter(e=>e.isSelected());r.length!==0&&this._group.doBatch(()=>{for(let t of r)e(t)},{description:n??t(`op.updateMovables`)})}_notifyChange(){this._notifyCollectionChange()}get isIMovableCollection(){return!0}},y=e=>e,b=e=>e,x=Object.freeze([]),S=class extends a{constructor(e){super(e),this._memberCallbacks=new WeakMap,this._toldOrder=C,this._createOptions=e,this._members=new v(this,e.transactions);let{members:t,name:n,...r}=e.json??{},i=[];for(let n of t??[])try{i.push(this._createMember(n,e.fromResourceId))}catch(e){console.warn(`Unable to load a group member`,n,e)}this._updateState({data:r,members:i}),this._toldOrder=i}getType(){return`group`}getTypeDescription(){return`Group`}getMovables(){return this._members}_childBounds(){let e=this._getState()?.data?.childBounds;if(e)return e;let t=this.getMovable()?.getBounds();return{x:0,y:0,width:t?.width??0,height:t?.height??0}}_rebound(){let e=this.getMovable(),t=this._drawnPlacement();if(!e||!t)return;let n=[];for(let e of this._members_()){let t=e._getLocalPlacement();t&&n.push(s(t.bounds,t.rotation))}let r=l.unionBounds(n);if(!r)return;let i=this._childBounds();if(l.isSameBounds(r,i))return;let a=i.width>0?t.bounds.width/i.width:1,o=i.height>0?t.bounds.height/i.height:1,c=l.placeInParent(t,i,l.flatPlacement({x:r.x+r.width/2,y:r.y+r.height/2,width:0,height:0})).bounds,u=r.width*a,d=r.height*o,f=this._getState();this._updateState({data:{...f.data,childBounds:r}}),e.setBounds({x:c.x-u/2,y:c.y-d/2,width:u,height:d})}_drawnPlacement(){let e=this.getMovable();return e?l.placementOf(e):null}getFill(){return this._getState()?.data?.fill??null}getTextFrame(){let e=this._getMembers(),t=!1,n=[];for(let r of e){let e=r.getContent().getTextFrame?.()??null;if(!e)continue;t=!0;let i=e.getText();i!==``&&n.push(i)}if(!t)return null;let r=n.join(`
|
|
2
|
+
`);return Object.freeze({getText:()=>r})}get acceptRotation(){return this._isEveryMember(`acceptRotation`)?y:void 0}get acceptFlip(){return this._isEveryMember(`acceptFlip`)?b:void 0}_isEveryMember(e){let t=this._members_();for(let n=0;n<t.length;n++)if(!t[n].getContent()[e])return!1;return!0}async ungroup(e){let n=this.getMovable();if(!n||this.isDeleted())return[];let r=e?.description??t(`op.ungroupDrawings`);this._protectionCheck(r);let i=n.getRange().getWorksheet(),a=d(i.getView().getMovableSelection());return await this.doBatch(()=>{let t=this._free(this._members_(),r);this.delete(e);let n=this._transactions.getPendingTransaction();return n&&h(n,i,t,{autoSelect:e?.autoSelect??!0,autoSelectRestore:e?.autoSelectRestore},a),t},{description:r})}_free(e,t){let n=this.getMovable(),r=n.getParent()?.getMovables()??n.getRange().getWorksheet().getMovables(),i=n.getZIndex(),a=this._createOptions.beginPersistResource();try{return e.map((e,n)=>{let o=e.toJSON(a.toResourceId.bind(a)),s=l.placementOf(e),c=r._insertNow({type:o.content.type,json:o.content.json,name:o.content.name,altText:o.content.description,bounds:s.bounds,rotation:s.rotation,fromResourceId:a.fromResourceId.bind(a),autoSelect:!1,description:t,zIndex:i+n});return(s.flip.horizontal||s.flip.vertical)&&c.setFlip(s.flip),e.isHidden()&&c.setHidden(!0),o.lockAspect!==void 0&&c.setLockAspectRatio(o.lockAspect),c})}finally{a.endPersist()}}getConnections(){return x}toJSON(e){let t={...this._getState()?.data??{}},n=this._members_();return n.length>0&&(t.members=n.map(t=>t.toJSON(e))),t}_getDrawnRect(e,t,n){let r=this._members_();if(r.length===0)return null;let i=l.flatPlacement({x:0,y:0,width:e,height:t}),a=this._childBounds(),s=1/0,u=1/0,d=-1/0,f=-1/0,p=!1;for(let e of r){if(e.isHidden())continue;let t=e._getLocalPlacement();if(!t)continue;let r=l.placeInParent(i,a,t),m=e.getContent(),h=o(m)?m._getDrawnRect(r.bounds.width,r.bounds.height,n):null,g=c(r.bounds,h,r.rotation,r.flip);s=Math.min(s,g.x),u=Math.min(u,g.y),d=Math.max(d,g.x+g.width),f=Math.max(f,g.y+g.height),p=!0}return p?{l:s,t:u,r:d,b:f}:null}_getMembers(){return this._members_()}_members_(){return this._getState()?.members??C}async _addMember(e){return this._insertMember(await this._prepareMember(e))}async _prepareMember(e){if(!e?.type)throw new r(`A member needs a type.`);return this._protectionCheck(t(`op.insertDrawing`)),await f({type:e.type,json:e.json}),e}_insertMember(e){if(!e?.type)throw new r(`A member needs a type.`);this._protectionCheck(t(`op.insertDrawing`));let n=this._drawnPlacement(),i={...n?.bounds??this._childBounds(),...e.bounds},a=n?l.placeInChild(n,this._childBounds(),{bounds:i,rotation:e.rotation??0,flip:{horizontal:!1,vertical:!1}}):{bounds:i,rotation:e.rotation??0,flip:{horizontal:!1,vertical:!1}},o={anchor:{tl:{x:a.bounds.x,y:a.bounds.y},br:{x:a.bounds.width,y:a.bounds.height}},content:{type:e.type,json:e.json}};e.name&&(o.content.name=e.name);let s=e.altText;s&&(o.content.description=s),a.rotation&&(o.rotation=a.rotation),a.flip.horizontal&&(o.flipH=!0),a.flip.vertical&&(o.flipV=!0);let c=this._beginCommit(e.description??t(`op.insertDrawing`));try{let t=this._createMember(o,e.fromResourceId),n=this._members_().slice();return n.splice(Math.max(0,Math.min(n.length,e.zIndex??n.length)),0,t),this._updateState({members:n}),this._rebound(),c.commit(),this._members._notifyChange(),t}catch(e){throw c.rollback(),e}}async _groupMembers(e,n){let a=n?.description??t(`op.groupDrawings`);if(this._protectionCheck(a),!e||e.length<2)throw new r(i(`error.movable.groupTooFew`));let o=this._members_();for(let t of e)if(!o.includes(t))throw new r(i(`error.movable.groupNotSameGroup`));let c=o.filter(t=>e.includes(t));if(c.length===o.length)throw new r(i(`error.movable.groupWholeGroup`));let u=this.getMovable();if(!u)throw new r(`The group is not placed.`);let f=u.getRange().getWorksheet(),p=d(f.getView().getMovableSelection()),m=l.unionBounds(c.map(e=>{let t=e._getLocalPlacement();return s(t.bounds,t.rotation)})),g=this._createOptions.beginPersistResource();try{let e={anchor:{tl:{x:m.x,y:m.y},br:{x:m.width,y:m.height}},content:{type:`group`,json:{childBounds:{...m},members:c.map(e=>e.toJSON(g.toResourceId.bind(g)))}}};n?.name&&(e.content.name=n.name);let t=this._beginCommit(a);try{for(let e of c)e.unselect();let r=this._createMember(e,g.fromResourceId.bind(g)),i=c[c.length-1],a=[];for(let e of o)e===i?a.push(r):c.includes(e)||a.push(e);this._updateState({members:a});for(let e of c)e.getContent().delete();return this._rebound(),h(t,f,[r],{autoSelect:n?.autoSelect??!0,autoSelectRestore:n?.autoSelectRestore},p),t.commit(),this._members._notifyChange(),r}catch(e){throw t.rollback(),e}}finally{g.endPersist()}}_removeMember(e,n){let r=this._members_();if(!r.includes(e))return;e.unselect();let i=this._beginCommit(n?.description??t(`op.deleteDrawing`));try{let a=r.filter(t=>t!==e);if(this._updateState({members:a}),a.length===1&&this.getMovable()){let e=a[0],r=e.isSelected(),[o]=this._free(a,n?.description??t(`op.deleteDrawing`));this.delete(n),r&&h(i,o.getRange().getWorksheet(),[o],{autoSelect:!0},[e])}else a.length===0?this.delete(n):this._rebound();i.commit(),this._members._notifyChange()}catch(e){throw i.rollback(),e}}_moveMember(e,t,n){let r=this._members_(),i=r.indexOf(e);if(i===-1||(t=Math.max(0,Math.min(r.length-1,t)))===i)return;this._protectionCheck(n);let a=r.slice();a.splice(i,1),a.splice(t,0,e),this._updateState({members:a},{description:n}),this._members._notifyChange()}_createMember(e,r){let i=this,a=e.content?.type??`custom`,o=this._createOptions,s,c={type:a,transactions:o.transactions,beginPersistResource:o.beginPersistResource,fromResourceId:r,json:e.content?.json,name:e.content?.name??null,description:e.content?.description??null,isReadOnly:()=>i.isReadOnly(),deleteFromContainer:()=>{s?._deleteFromContent()},getMovable:()=>s,getStyles:o.getStyles,getRange:o.getRange,addWatch:o.addWatch},u=p(a,c,{getMovable:()=>s,amend:e=>i._amend(e),isClosed:()=>i._closed}),d=()=>i.getMovable(),f=()=>i._members_().indexOf(s),m;return s=new _({content:u,json:e,transactions:o.transactions,beginPersistResource:o.beginPersistResource,fromResourceId:r,getParent:d,onMemberPlacementChange:()=>i._rebound(),place:e=>{let t=i._drawnPlacement();return t?l.placeInParent(t,i._childBounds(),e):null},unplace:e=>{let t=i._drawnPlacement();return t?l.placeInChild(t,i._childBounds(),e):null},coords:n.EmptyRange,getRanges:e=>d().getRanges(),getContainerIndex:f,getZIndex:f,getBoundsAtCoords:()=>({x:0,y:0,width:0,height:0}),getCoordsAtBounds:()=>n.EmptyRange,isProtected:()=>i.isReadOnly(),moveToBackOnContainer:()=>i._moveMember(s,0,t(`op.moveToBack`)),moveBackwardOnContainer:()=>i._moveMember(s,f()-1,t(`op.moveBackwards`)),moveForwardOnContainer:()=>i._moveMember(s,f()+1,t(`op.moveForward`)),moveToFrontOnContainer:()=>i._moveMember(s,i._members_().length-1,t(`op.moveToFront`)),deleteFromContainer:e=>i._removeMember(s,e),setContainerCallbacks:e=>{e&&(m={...m,...e}),s&&m&&i._memberCallbacks.set(s,m)},invalidate:()=>{i._members._notifyChange()}}),m&&this._memberCallbacks.set(s,m),s}_tellZIndex(){let e=this._members_(),t=this._toldOrder;if(e!==t){this._toldOrder=e;for(let n=0;n<e.length;n++){let r=e[n];t[n]!==r&&this._memberCallbacks.get(r)?.processZIndex?.()}}}_amend(e){let t=this._transactions;return t.amend(t.getCurrentCommit(!1).getId(),()=>e())}_processAfterStateChange(e,t){super._processAfterStateChange(e,t),this._tellZIndex(),this._emitter.notify(`onAnyChange`),this._members?._notifyChange(),this.getMovable()?._forwardLayout()}get isIGroup(){return!0}get[Symbol.toStringTag](){return`[Group]`}toString(){return this.getTypeDescription()}},C=Object.freeze([]);export{S as Group};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./
|
|
2
|
-
import{t as e}from"./HclGiUj8dZXDFmoM.js";import{B as t}from"./ChSvXfVMLxZsP9zG.js";import{n}from"./
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./l32n8O_A78Qqduv3.js","./BnoVwUBEor8NgQNs.js","./HclGiUj8dZXDFmoM.js","./ChSvXfVMLxZsP9zG.js","./3Ls_kOvlQseMV8Q0.js","./DcrVJCyDwGKeil2U.js","./Ca6nxdhEuLLty3d7.js","./nHThFXCAZFOM_npq.js","./BcOdl17EeFSxnAiq.js","./D66vSE1ConAuENmB.js","./BQnELVV0uR4T4ItQ.js","./CnXLpFE_vFrJ5Jbf.js","./21oAESJyBGXeHegm.js","./Cenh1POxiGMxIQlv.js","./-i_fTASJeu9NdNH_.js","./BSdFVGZNhU6YHbMI.js","./9w0ECZmzGUyk3F_O.js","./KoxRo2J_cwB_yOd5.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./HclGiUj8dZXDFmoM.js";import{B as t}from"./ChSvXfVMLxZsP9zG.js";import{n}from"./Bj-vfAT28PK-tWWa.js";import{r}from"./9w0ECZmzGUyk3F_O.js";var i=r({MAX_WORKBOOK_NAME_SIZE:()=>96,isReservedFileNameChar:()=>s,isValidFileName:()=>c}),a=/^(con|prn|aux|nul|com\d|lpt\d)$/i,o=/[<>:"/\\|?*\u0000-\u001F]/,s=e=>o.test(e),c=e=>!(!e||e.length>255)&&!o.test(e)&&!a.test(e)&&e!==`.`&&e!==`..`,l=t(`io:sxlReader`,()=>e(()=>import(`./l32n8O_A78Qqduv3.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)),u=t(`io:sxlWriter`,()=>e(()=>import(`./-i_fTASJeu9NdNH_.js`),__vite__mapDeps([14,13]),import.meta.url)),d=async(e,t)=>(await l.load()).readSXL(e,t),f=e=>async(t,n)=>(await u.load()).writeSXL(t,{...n,compress:n?.compress??e.compress,whiteSpace:n?.whiteSpace??e.whiteSpace}),p={key:`SheetXL`,description:`SheetXL Workbook`,mimeType:`application/vnd.sheetxl.sheet`,exts:[`sxl`],handler:d},m={key:`JSON`,description:`SheetXL Workbook (JSON)`,mimeType:`application/json`,exts:[`json`],handler:d},h={key:`SheetXL`,mimeType:`application/vnd.sheetxl.sheet`,description:`SheetXL Workbook`,exts:[`sxl`],handler:f({compress:!0,whiteSpace:0})},g={key:`JSON`,mimeType:`application/json`,description:`SheetXL Workbook (JSON)`,exts:[`json`],advanced:!0,handler:f({compress:!1,whiteSpace:2})},_={name:`SXLPlugin`,version:`0.8.0-beta.15`,description:`Import and export SXL format`,author:`SheetXL`,async register(e){await e.registerReadFormat(p),await e.registerReadFormat(m),await e.registerWriteFormat(h),await e.registerWriteFormat(g)}},v=t(`io:csvReader`,()=>e(()=>import(`./BSdFVGZNhU6YHbMI.js`),__vite__mapDeps([15,2,8,1,3,4,5,6,7,9,10,11,12,16]),import.meta.url)),y=t(`io:csvWriter`,()=>e(()=>import(`./KoxRo2J_cwB_yOd5.js`),__vite__mapDeps([17,2,16]),import.meta.url)),b={key:`CSV`,description:`Comma Separated Values`,mimeType:`text/csv`,exts:[`csv`],handler:async(e,t)=>(await v.load()).readCSV(e,t)},x={key:`CSV`,mimeType:`text/csv`,description:`Comma Separated Values`,exts:[`csv`],handler:async(e,t)=>(await y.load()).writeCSV(e,t)},S={name:`CSVPlugin`,version:`0.8.0-beta.15`,description:`Import and export CSV format`,author:`SheetXL`,async register(e){await e.registerReadFormat(b),await e.registerWriteFormat(x)}},C={name:`@sheetxl/io`,version:`0.8.0-beta.15`,description:`Built-in I/O formats for SheetXL`,author:`SheetXL`,async register(e){await _.register(e),await S.register(e),await n.register(e)}};export{S as CSVPlugin,C as IOPlugin,i as IOUtils,_ as SXLPlugin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as e}from"./ChSvXfVMLxZsP9zG.js";import{i as t}from"./BcOdl17EeFSxnAiq.js";import{Vt as n,_t as r,fr as i}from"./D66vSE1ConAuENmB.js";import{A as a,C as o,D as s,O as c,S as l,T as u,a as d,b as f,c as p,g as m,h,j as g,m as _,r as v,v as y,x as b}from"./CwqNb7JYzC03lCj0.js";import{i as x,n as S,r as C}from"./hp_-JA1DMK4Yoztn.js";var w=class{constructor(e){e={...e},this._editing=e.profile===`editing`,this._parser=new C(e)}compile(e,n,i,_,C,w,E,D,O){if(_.length===0){let n=new t.Parse(x);return this._compileUnparsed(e,C,_,{input:_,cause:n,causes:[n]})}if(_.length>r.MAX_EXPRESSION_LENGTH){let n=new t.Parse(S(_.length,r.MAX_EXPRESSION_LENGTH));return this._compileUnparsed(e,C,_,{input:_,cause:n,causes:[n]})}let k,A,j=[];try{let e=this._parser.parse(n,i,_);k=e.root,j=e.errors,D&&k&&j.length===0&&(k.legacyIntersect=!0)}catch(e){A=t.isError(e,t.Code.Parse)?e:new t.Parse(e.message,e)}let M=[];for(let e of j)M.push(o(e));if(k){let e=p(k,w??null);typeof e==`string`?M.push(new t.Parse(e)):k=e,b(k,w??null)&&M.push(new t.Parse(`The implicit intersection operator ' ' requires a cell or range on both sides`)),c(k,w??null)&&M.push(new t.Parse(`The spill anchor operator '#' requires a cell or range`)),m(k,w??null)&&M.push(new t.Parse(`Expected a reference; a value cannot be converted to one.`));let n=l(k,w??null);n&&M.push(new t.Parse(n));let r=f(k,w??null);r&&M.push(new t.Parse(r));let i=h(k,w??null);i&&M.push(new t.Parse(i));let a=u(k);a&&M.push(new t.Parse(a))}M.length>0&&!A&&(A=M[0]);let N=null;if(A&&(N={input:_,cause:A,causes:M.length>0?M:[A]}),!k){if(this._editing){let t=this._recoverCompiled(e,n,i,_,C,N,E);if(t)return t}return this._compileUnparsed(e,C,_,N,this._editing,()=>T(C,E,n,i))}if(k=g(k,w??null),k=a(k,w??null),C){let e=this._editing?O:{mint:!O?.book,...O};k=v(k,C,E,e,{rowIndex:n,colIndex:i});let r=y(k,C);if(r){let e=new t.Parse(r);M.push(e),N={input:_,cause:N?.cause??e,causes:N?[...N.causes,e]:[e]}}}let P=s(e,C,k,this._editing,N,w??null);return this._editing&&N&&d(P.getTokens(),C)!==_?this._recoverCompiled(e,n,i,_,C,N,E)||this._compileUnparsed(e,C,_,N,!0):P}autoCorrect(e){let t=function(e){let t=0,n=null;for(let r=0;r<e.length;r++){let i=e[r];n?i===n&&(n=null):t>0?i===`'`?r++:i===`[`?t++:i===`]`&&t--:i===`"`||i===`'`?n=i:i===`[`&&t++}return n?0:t}(e),n=e+`]`.repeat(t),r;try{let e=this._parser.getLexer().tokenize(n,!1);if(e.errors.length>0)return null;r=e.tokens}catch{return null}let i=[];for(let e of r){let t=e.tokenType?.name;if(t===`OpenParen`)i.push(`)`);else if(t===`OpenCurlyParen`)i.push(`}`);else if((t===`CloseParen`||t===`CloseCurlyParen`)&&i.pop()!==(t===`CloseParen`?`)`:`}`))return null}return i.length===0&&t===0?null:n+i.reverse().join(``)}_compileUnparsed(t,r,i,a,o=!1,s){let c={runtime:t,symbols:r,getFunction:null,ast:null,evaluations:e.EmptyArray,executions:e.EmptyArray,bindings:e.EmptyArray,referencesAbsolute:e.EmptyArray,referencesExecute:e.EmptyArray,referencesRelative:e.EmptyArray,referencesRoot:e.EmptyArray,referenceIndices:e.EmptyArray,formatReferenceIndices:e.EmptyArray,getTokens:()=>{let e=[];return o&&k(e,i,void 0,s)?e:[{type:n.Unparsed,value:i,text:i}]},namedIds:e.EmptyArray,symbolIds:e.EmptyArray,hasTotals:!1,hasDataTable:!1,hasVolatile:!1,isBlankCacheable:!1,isBlankCacheableArray:!1,isReferenceOnly:!1,error:a,transform:()=>c};return c}_recoverCompiled(e,t,r,i,o,c,l){let u,f=i.length;try{let e=this._parser.getLexer().tokenize(i,!1);u=e.tokens,e.errors.length>0&&(f=Math.min(f,e.errors[0].offset))}catch{return null}let p=[];for(let e=u.length-1;e>=0&&p.length<24;e--){let t=(u[e].endOffset??-1)+1;t>0&&t<i.length&&t<=f&&p.push(t)}for(let u of p){let f=i.slice(0,u),p,m;try{p=this._parser.parse(t,r,f).root}catch{continue}if(!p||p.type===n.Unparsed)continue;try{let n=a(p,null),i=o?v(n,o,l,void 0,{rowIndex:t,colIndex:r}):n;m=s(e,o,i,!0,c)}catch{continue}if(d(m.getTokens(),o)!==f)continue;let h=i.slice(u);if(h.length===0)return m;let g,_={...m,getTokens:()=>(g||(g=[...m.getTokens()],this._appendUnparsedTail(g,h,()=>T(o,l,t,r))),g),transform:()=>_};return _}return null}_appendUnparsedTail(e,t,r){let i=[];for(let t of e){if(t.type===n.Whitespace)continue;let e=t.type===n.Paren||t.type===n.Type?t.text:void 0,r=i.length>0?i[i.length-1]:void 0;if(t.type===n.Separator&&r){let e=r.declared[r.declared.length-1];r.ctx?.type===`let`&&r.ctx.argIndex===-1&&r.lambda?.argTokens===r.argTokens&&e?.argIndex===r.argIndex-1&&(e.params=r.lambda.params),r.argIndex++,r.argTokens=0,r.lambda=void 0}else if(r&&r.argTokens++,e===`(`||e===`[`||e===`{`)i.push({ctx:t.context,argIndex:0,declared:[],argTokens:0,leadsArg:r?.argTokens===2});else if(e===`)`||e===`]`||e===`}`){let e=i.pop(),t=i.length>0?i[i.length-1]:void 0;t&&e?.leadsArg&&e.ctx?.type===`lambda`&&e.ctx.argIndex===-1&&(t.lambda={params:e.declared.map(({name:e,optional:t})=>t?{name:e,optional:t}:{name:e}),argTokens:t.argTokens})}else if(t.type===n.Parameter&&r&&t.value?.declaration){let e=t.value;r.declared.push(e.optional?{name:e.name,argIndex:r.argIndex,optional:!0}:{name:e.name,argIndex:r.argIndex})}}let a=i.length>0?i[i.length-1]:void 0,o=a?.ctx?{...a.ctx,argIndex:a.ctx.argIndex===-1?a.argIndex:a.ctx.argIndex}:void 0;if(o&&a.ctx.argIndex===-1&&(o.type===`let`||o.type===`lambda`)){let e=o.type===`let`?2:1,t=o.bound;for(let n of a.declared){if(o.argIndex<n.argIndex+e)continue;let{name:r,params:i}=n;t=_(t,i?{name:r,params:i}:{name:r})}t&&(o.bound=t)}let s=(t,r)=>{let i=r?{type:n.Named,value:{name:t},text:t}:{type:n.Unparsed,value:t,text:t};o&&(i.context=o),e.push(i)};if(k(e,t,o,r))return;let c=/[A-Za-z_][A-Za-z0-9_]*$/.exec(t),l=c?c.index:-1,u=l>0?t[l-1]:``;for(let t=e.length-1;l===0&&t>=0&&!u;t--)u=e[t].text?.at(-1)??``;l>=0&&!/[A-Za-z0-9_.]/.test(u)?(l>0&&s(t.slice(0,l)),s(t.slice(l),!0)):s(t)}};function T(e,t,n,r){if(!e||!t)return;let a=e.bind(i.Table,``,{at:{scope:t,rowIndex:n,colIndex:r}});return a?e.resolve(i.Table,a)?.toString():void 0}var E=/[A-Za-z_\\\u007F-\uFFFF][A-Za-z0-9_.\u007F-\uFFFF]*$/,D=/[A-Za-z0-9_.)\]}"'!#\u007F-\uFFFF]/;function O(e,t){for(let n=t+1;n<e.length;n++){let t=e[n];if(t!==`'`){if(t===`]`)return n+1;if(t===`[`)return null}else n++}return-1}function k(e,t,r,i){let a=0,o=-1;for(let e=0;e<t.length;e++){let n=t[e];a>0&&n===`'`?e++:n===`[`?(a===0&&(o=e),a++):n===`]`&&a>0&&a--}if(a===0)return!1;let s=t.slice(0,o);if((s.split(`"`).length-1)%2==1)return!1;let c=e.length>0?e[e.length-1]:void 0,l=``,u=!1,d=E.exec(s);if(d){let e=d.index>0?s[d.index-1]:c?.text?.at(-1)??``;if(/[A-Za-z0-9_.]/.test(e))return!1;l=d[0],s=s.slice(0,d.index)}else s.length===0&&c?.text&&E.exec(c.text)?.index===0&&(c.type===n.Named&&!c.value?.scope||c.type===n.TableReference)&&(l=c.text,u=!0);if(!u){let e=s.length>0?s[s.length-1]:c?.text?.at(-1)??``;if(e&&D.test(e))return!1}let f=l||(i?.()??``),p=[],m=(e,t,n)=>{p.push({type:e,value:t,text:t,context:{name:f,argIndex:n,type:`table`}})},h=(e,t,r,i)=>{let a=e.startsWith(`#`),o=r?i?`column`:a?`specifier`:e?`column`:`any`:void 0,s=o?{table:f,name:e,partial:o}:{table:f,name:e};p.push({type:a?n.TableSpecifier:n.TableColumn,value:s,text:e,context:{name:f,argIndex:t,type:`table`}})},g=(e,t,r,i)=>{m(n.Paren,`[`,r),h(e.slice(1,t?-1:void 0),r,!t,i),t&&m(n.Paren,`]`,r)};m(n.Paren,`[`,-1);let _=t.slice(o+1);if(_.startsWith(`[`)){let e=0,t=!1,r=0;for(;r<_.length;){let i=_[r];if(i===`[`){let n=O(_,r);if(n===null)return!1;let i=n!==-1;if(g(_.slice(r,i?n:_.length),i,e,t),t=!1,!i)break;r=n}else if(i===`,`)m(n.Separator,`,`,e++),r++;else if(i===`:`)m(n.Infix,`:`,e),r++;else if(i===`@`)m(n.Prefix,`@`,e),t=!0,r++;else{if(i!==` `)return!1;{let t=r;for(;_[t]===` `;)t++;m(n.Whitespace,_.slice(r,t),e),r=t}}}}else{let e=_,t=e.startsWith(`@`);if(t&&(m(n.Prefix,`@`,0),e=e.slice(1)),e.startsWith(`[`)){if(O(e,0)!==-1)return!1;g(e,!1,0,t)}else{if(/(^|[^'])[[\]]/.test(e)||e.startsWith(`#`)&&e.includes(`,`))return!1;h(e,0,!0,t)}}if(s){let t={type:n.Unparsed,value:s,text:s};r&&(t.context=r),e.push(t)}if(u){let t={...c,type:n.TableReference,value:l,text:l};delete t.referenceIndex,e[e.length-1]=t}else if(l){let t={type:n.TableReference,value:l,text:l};r&&(t.context=r),e.push(t)}for(let t of p)e.push(t);return!0}export{w as FormulaCompiler,k as appendPartialStructuredReference};
|