@sheetxl/mcp 0.8.0-beta.14 → 0.8.0-beta.16
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/LICENSE.md +8 -7
- package/assets/{DnmjS548g7nY6EUS.js → -PtBguqpLi7Nr4Df.js} +2 -2
- package/assets/{hRLLK6I6m0uGKWo8.js → 2GLqCzpAJP6jbaRx.js} +12 -12
- package/assets/{DPazQ_nZv-sXUwO3.js → 3_NofB4A4Qhl-4YY.js} +2 -2
- package/assets/{BOcWUnxWSG1d5Ljc.js → 3t-I20nDzFHBd5UJ.js} +2 -2
- package/assets/{B9QlqO6n3MCBsvoj.js → 4vS8pASPZSU7QcRZ.js} +4 -4
- package/assets/{DTlvhtB9hvPdbdxu.js → 5B_tapYOcjOv1wGO.js} +35382 -29921
- package/assets/{Dg7xy50qHwqkYd4g.js → 8NrxfSWBHDaEJvhz.js} +2 -2
- package/assets/{KpCEdfpsHnfkyqjx.js → 9MXt8KXdWlbEJNc2.js} +2 -2
- package/assets/{DuZ6DXQGttY3Lrhd.js → AjWB-QdIkr07kToW.js} +189 -189
- package/assets/{Du_JrYiYGJo5_B9H.js → B16N6VSLY5HPgVkD.js} +2 -2
- package/assets/{PmooYGqWqoTxPExF.js → B2YEEPHIkNcezk9T.js} +3 -3
- package/assets/{CDGeuGB9CBXeCIm6.js → B3MqN3t5naY3moOk.js} +2 -2
- package/assets/{DZZ5R3msiytVNCqK.js → BBPjYcS8XKQREith.js} +49 -49
- package/assets/{CHHJZPAuM3OjbzF6.js → BCSRsSAEPlwR59H5.js} +5 -5
- package/assets/{GnXTzeDYWWeEf5yV.js → BIUUGUhypimIDg2a.js} +2 -2
- package/assets/{B-1_xSqUFCJ6jNjn.js → BNrpvJZtIL0Ex_wE.js} +996 -995
- package/assets/{BW8XjynUqlfvuQUV.js → BR66nPIzyzlOcP10.js} +2 -2
- package/assets/{BmxgDCZk_aMDms4i.js → BRLA4pJWiYdpW-69.js} +75 -75
- package/assets/{BiAEoWSl8c6jcUnS.js → BUAq-ENCmL0XGLIu.js} +2 -2
- package/assets/{DoIU_ohoCBwTZV9G.js → BYqyNLuwXl7GKuzh.js} +43 -41
- package/assets/{zu-72oKE_gCkrozc.js → BZbxPclVVopktv3l.js} +2 -2
- package/assets/{OU7gC5JF-lyDOOid.js → B_nQLUWaxp-Q1IfV.js} +3 -3
- package/assets/{yNiBIhsMP9BCWd67.js → BbDKWV_FQAICqZjP.js} +2 -2
- package/assets/{CH9M37mRwnS0t9wM.js → BbXlmp8W_cbr75FN.js} +6 -6
- package/assets/{PRSerWiAGYu8MVnd.js → BdMebk9YSA0oxQ_d.js} +78 -78
- package/assets/{BwisWvPpXRhyIP4O.js → Bdt9nQs8gDIzu_IG.js} +2 -2
- package/assets/{CVFTQ0OwsUt03r4o.js → BiE9M6RctwQ339_7.js} +2 -2
- package/assets/{UX2ywz3gr7q-MlHr.js → BiGm1tKvxUh8oWbD.js} +2 -2
- package/assets/{CgjR_TiVOcuxg5tO.js → BjDsx_FHl0mShqHX.js} +2 -2
- package/assets/{CXM1IYmE-TDInPwr.js → BlIrJwQGEASCgJdZ.js} +2 -2
- package/assets/{C55MTJ_5qW94RElE.js → BlWfQ5HPEehB_lPz.js} +3298 -2140
- package/assets/BpgPKKZwxXklRyo7.js +7 -0
- package/assets/{DUzaW_op2vBTwOOI.js → BrtLeTsrulaU6osB.js} +2 -2
- package/assets/{Cm3Q_-DDdnVHRBxr.js → BsFWmVYPrLyh5Dre.js} +34 -34
- package/assets/{BMnNvUCJu35tT_aO.js → BtNRIFE92ka4hATo.js} +2 -2
- package/assets/{BOF64A2D2KKcv_fo.js → BuhHuKVWppW4L8AV.js} +2 -2
- package/assets/{Dl87mJoXDkCkzBi7.js → C-AIgWmHugqMcl9J.js} +3 -3
- package/assets/{DihigEGfNCLR8UPN.js → C-gN7uBg-MWHRo4g.js} +2 -2
- package/assets/{B6b9ytNrHR-ijcOa.js → C0JSC9gVwR1QxopD.js} +2 -2
- package/assets/{ThqyayHHaBxzfaAt.js → C2dG4GHThf9O-IJy.js} +2 -2
- package/assets/{CjwzOAnab_dpAqiG.js → C3Wibs7QGFZ1FI7W.js} +2 -2
- package/assets/{w8YWSMNTTn45ImnB.js → C75i_5ip7OhGkuiF.js} +2 -2
- package/assets/{CpOhY88x6AgVxvTz.js → C95HXhZkkhnUx_aE.js} +3 -3
- package/assets/{CeDqeFLuUfN8UIGx.js → CAEhAL7-0FG7jdzN.js} +2 -2
- package/assets/{CtpcYuBFU6fxsUhs.js → CAMrW5ypKhgn105y.js} +2 -2
- package/assets/{2zIY9Xuml4y8NI05.js → CBPkPTmeaEokFPSI.js} +2 -2
- package/assets/{DZRp3_yqPS6Lshho.js → CDqG64rXHp9-2tXr.js} +2 -2
- package/assets/{CcLPa6zB5PH3OG2O.js → CFdJvXLSbUrvNera.js} +2435 -2447
- package/assets/{mcFLzsOH35mvmd3C.js → CG8zvnxueimOY7wm.js} +2 -2
- package/assets/{B9qiPx_BXxo1jgcx.js → CIqJdIUKSLZkNwHy.js} +353 -243
- package/assets/{BoTScfjgygCozDVi.js → CJa8JVvKGVBz8Q7q.js} +3 -3
- package/assets/{Dfd7kvLIFNqu-m-r.js → CK9h6iDOreaI8GEt.js} +4 -4
- package/assets/CL1-ziDI0aAaVbhJ.js +7 -0
- package/assets/{DBFXsbIHDxbMBrzV.js → CVRc6jQcH155Z89u.js} +2 -2
- package/assets/{a7BoASyT8yQZY9hJ.js → CVbRpT7QPHOMgwTx.js} +2 -2
- package/assets/CW-ivE6pl3V7vKuT.js +2563 -0
- package/assets/{D2w3KjYuONW1G1kX.js → CX-6eYkcr5y0VmQm.js} +4 -4
- package/assets/{DSSrCrejjpWoszj7.js → CZepo1lDTQp1myg6.js} +2 -2
- package/assets/{DkPXpv81Y5teMd-R.js → C_0RM0w6Pw70Bx_Y.js} +2 -2
- package/assets/{aqguaobnu61szXWM.js → Ci7-PIIhZwb2mVv5.js} +2 -2
- package/assets/{eHAVGCUcMAfNjEGt.js → Cl98sBOj9GM2XnFe.js} +3 -3
- package/assets/{BNfBq8Eic3Cl-f6A.js → CoIjAX2gECGb3Wxl.js} +2 -2
- package/assets/{ZTEO4JX22YIOkrJg.js → Co_y6GfwJTYtOmlt.js} +8 -8
- package/assets/{DkFK1iu4vqjLZMja.js → CrwtgrD7BbXyCkx0.js} +2 -2
- package/assets/{DCHsM8bfVisYJFTT.js → CsjjeeOHE2624pGt.js} +2 -2
- package/assets/Ct5VTtdW77k-WcP_.js +529 -0
- package/assets/{BXC6616BWEWNZ2-D.js → CvJkwRgwm80S2bcd.js} +2 -2
- package/assets/{C2Rgsb69SnMOohGt.js → D-irgQZ2WmkP9dnK.js} +2 -2
- package/assets/{D94hlZEaHtGHdN_K.js → D1g6IOzdvInVLV-x.js} +7 -7
- package/assets/{BYtBi8vLoB41QkV8.js → D2YdqNWXwSHJMPbA.js} +109 -109
- package/assets/{CBNNl8igIyeHY4St.js → D3bxrF1Ys2GSVfQH.js} +25 -19
- package/assets/{st-UQngeBG4hwKoy.js → D7iU4kaxzl_PojNt.js} +2 -2
- package/assets/{B-jE7tAMA559MtNt.js → D7ibkNIu_Pn4TeBD.js} +4 -4
- package/assets/DBANZf_eAzaCFdIj.js +4676 -0
- package/assets/{BWsXOU_jh_cA8m8I.js → DBMZF6PRHCko9K9R.js} +2 -2
- package/assets/{CwJyw5Yxpj4PGh14.js → DEIkGoOZ_WeuY0Lj.js} +2 -2
- package/assets/{HKLw8b2xTdu5c1w5.js → DFAqI-o57Kd_Azlt.js} +2 -2
- package/assets/{EeSGsbh_r4N-qs4w.js → DFn_thWGK0_EZI5k.js} +2 -2
- package/assets/{DvD_K4M5HgJ4uJ8L.js → DFvs1LVzXKm1N5M2.js} +3 -3
- package/assets/{Df2IAW-O7Gwl7V1l.js → DJdRl2yX9DP_D8kh.js} +3 -3
- package/assets/{D3BAmD-1AfFtHdC6.js → DKRa_Oc4XqB3DABB.js} +9 -9
- package/assets/{Doqy_uDSQTCv6a6X.js → DLhlBqwsDnmscAuL.js} +2 -2
- package/assets/{DpGuA6U12gwyGHEM.js → DMhtIFfkX-DZT_e3.js} +4 -4
- package/assets/{cdIvC9t9tYtVn4nc.js → DNhfziNrJGdL8BYs.js} +82 -81
- package/assets/{BDZ1FGc1zFqO1nK7.js → DOZ40EyxD3m0gCos.js} +810 -495
- package/assets/{BkBCkgPNrFR5N9fo.js → DQcus4X_kTKIIyX6.js} +2 -2
- package/assets/{ByziR0Anm39Bw0Bc.js → DR9xHYH6v5G0lOqf.js} +4 -4
- package/assets/{C-5LlJ5qhC7Ef0gV.js → DTLbKr_XIJMwQJmk.js} +52 -52
- package/assets/{8vRAQlvTcvMLeio0.js → DaILIYfy-jPVTXjz.js} +3 -3
- package/assets/{B66aeGYrHLbGpuN9.js → Dd8CHUZz7xuYTfp-.js} +1443 -1355
- package/assets/{B5xHa5bjZu5ONrm5.js → DdrsYdX3bLixdb_9.js} +2 -2
- package/assets/DfWWAHOjmhqvN3m_.js +7166 -0
- package/assets/{DIy1659Yv5-fD69E.js → DfzLOnWTNL_2J90y.js} +2 -2
- package/assets/{CfiVUfpeONJ3rf31.js → Dg4JXbd1yPGNZOtL.js} +2 -2
- package/assets/Di4ehJD7muvtcrN3.js +169 -0
- package/assets/{CPDkdp0yI4DwUHGZ.js → DmLbqbAez7Dzwyl7.js} +2 -2
- package/assets/{CMTDUipnLiOj5pbe.js → Dp-dLoOaBndV2N5i.js} +3 -3
- package/assets/DsTi7zHk_Xl37bAD.js +14 -0
- package/assets/{9dbZwzIWefGss7is.js → DvFwVzuc5YfagNnH.js} +2 -2
- package/assets/{D81iH5MJJfq2t9FP.js → Dy67BUF2yd8VRPwL.js} +2 -2
- package/assets/{C-CNmTrzNS-ZlQ8j.js → DzkccbbE6iXMqQDO.js} +410 -406
- package/assets/{DWTpPijG5yeNFR0W.js → Gqh12ggLm5KlvN3v.js} +2 -2
- package/assets/{ZBYHyJs7CQgnnHfR.js → JC8UUcu6m23qqrr3.js} +3 -4
- package/assets/{B9w1dNK8pNq-Z1P3.js → LwFDS0HxPZKiiEnN.js} +2 -2
- package/assets/{QXKcNTuZqOauSidr.js → POdlv6cpSx6ftJxx.js} +2 -2
- package/assets/{DK0VM9-qrEXBm8Ud.js → QVWayvB03YMyTKt3.js} +3 -3
- package/assets/{C1rIlmARlinuie5E.js → SB2aKOIVln0EkgXR.js} +2 -2
- package/assets/SaCo3me4_hw2b1L4.js +2039 -0
- package/assets/{BFwNQZVRnbNt-gRJ.js → TNQaiw20sEAEUiK5.js} +386 -372
- package/assets/{CutEBbZl8oFbTlXZ.js → W2FU69Pfo4chpqtk.js} +2 -2
- package/assets/{ddJqSu7gXUkXjGxZ.js → YXC__Myl-BuIFW6s.js} +2 -2
- package/assets/{B_-VPqfsse8AlCTm.js → Z01wJImjl6lBMpf4.js} +2 -2
- package/assets/{C1w8NQeox7_92swz.js → h6EQSu5n2vTsu2yd.js} +2 -2
- package/assets/{TzsPqmpG77I4ewVt.js → iULnLPcNKVpz00r7.js} +2 -2
- package/assets/{cv7k-VAIJtYeL9k4.js → iqQWGoJaPha0_8lU.js} +2 -2
- package/assets/{DUUt1z6Y_cpxEpYY.js → nDmE2I07HvkpRdR0.js} +2 -2
- package/assets/{9MRZ5Yc2RBgcqZSp.js → nmB0nnkFQf5NWo0i.js} +3 -3
- package/assets/{33QTHR3r6ZujxFx8.js → pQUJKbHGetb7dcOr.js} +2 -2
- package/assets/{DUYoUViqY5U6uQX3.js → rfwqMukKbJBeJBuC.js} +3 -3
- package/assets/{CULV-2mwmqYYpAjM.js → soSlr334Fv1j5t2m.js} +2 -2
- package/index.js +2013 -1947
- package/lib.js +2 -2
- package/licenses/dependencies.txt +281 -216
- package/package.json +4 -9
- package/resources/locales/@sheetxl/sdk/de/model.msg.json +82 -1
- package/resources/locales/@sheetxl/sdk/en/model.msg.json +80 -1
- package/screenshot-page/assets/{CSUd8n1H0VBfREnk.js → -N4OYIMgf6f5vgNy.js} +1 -1
- package/screenshot-page/assets/{B4PbXdzBe9BsoZ0e.js → B7eQ3rE-7Vayb_4O.js} +1 -1
- package/screenshot-page/assets/B8i4Sr2kMQAXp0rb.js +4 -0
- package/screenshot-page/assets/{DQWHkaQeNXft9j8b.js → B8qybUclSjEYP5FJ.js} +2 -2
- package/screenshot-page/assets/BIHbD4jMsk3NetOd.js +1 -0
- package/screenshot-page/assets/BIrVK5hdDCUYmxGO.js +1 -0
- package/screenshot-page/assets/{BRqSWCr2mTVNFquQ.js → BJ2r2WfEL3SgkBAX.js} +1 -1
- package/screenshot-page/assets/BJviQwDXR5L6l1DA.js +1 -0
- package/screenshot-page/assets/BM78thqEW6HwXFAK.js +13 -0
- package/screenshot-page/assets/{BcOdl17EeFSxnAiq.js → BMf827t1Ul65MHd5.js} +1 -1
- package/screenshot-page/assets/BMwQInar0xVS5FRu.js +1 -0
- package/screenshot-page/assets/{BUjI304IvdJnFXH3.js → BU5S8KEzPmIA_Flm.js} +1 -1
- package/screenshot-page/assets/{D6Jpaz2YkhOfzxDB.js → BYQZ8o8k3-MDoNat.js} +1 -1
- package/screenshot-page/assets/{CZf9s6otzzoaBlSs.js → BftXEPOuf5Uwxpud.js} +1 -1
- package/screenshot-page/assets/Bir0SSOHX0w2yo8h.js +1 -0
- package/screenshot-page/assets/{CykecBozGGFl26KA.js → Btgo0VFTT0JxuaP3.js} +74 -68
- package/screenshot-page/assets/C2H2lX8eyKpxpP6M.js +2 -0
- package/screenshot-page/assets/{B-KIwD5F_5S-NsPg.js → C71ZZMVLfHdPl441.js} +1 -1
- package/screenshot-page/assets/CFfgJlXaIS8QMx5O.js +1 -0
- package/screenshot-page/assets/{DGXDfjkGZjMRAXPg.js → CN8u05DjKwNHbUHN.js} +1 -1
- package/screenshot-page/assets/CQFj5AGXfIA9z9zI.js +1 -0
- package/screenshot-page/assets/{gG0AFZ45VxS_moMw.js → CRsTnamLrPN5-Dsi.js} +1 -1
- package/screenshot-page/assets/CYfkL98Zu43S8-50.js +42 -0
- package/screenshot-page/assets/{DDpAoGAPzo1c4vl5.js → CZa1rha3RnQUWyOk.js} +7 -7
- package/screenshot-page/assets/{CpbohdgEaEsVDi9J.js → C_vPl50T1L5HWnhv.js} +1 -1
- package/screenshot-page/assets/{CbUDukmvDZmVfhJH.js → CfkssmHURDicfYvR.js} +1 -1
- package/screenshot-page/assets/{Bor_tayB4yBfNOH5.js → CguXw0IcKNPbmAbj.js} +2 -2
- package/screenshot-page/assets/{DmbuCapSSCYIa3yk.js → ClzJdxlUDDtBYjH8.js} +1 -1
- package/screenshot-page/assets/{Miyn0clMq0rovRIo.js → CqyMYduWKFvmMs_Z.js} +1 -1
- package/screenshot-page/assets/CzsoLbEIUVK5ia1C.js +1 -0
- package/screenshot-page/assets/D2IHCJ1QWDKwmhge.js +1 -0
- package/screenshot-page/assets/D6CzedWHXTesD55R.js +1 -0
- package/screenshot-page/assets/D7biuwkvm3zAwsBa.js +39 -0
- package/screenshot-page/assets/D8s3sJnhFxbI3Dqn.js +1 -0
- package/screenshot-page/assets/{CE0MnsfMjqV2ICzk.js → DDkL9PZPXAggW2Yr.js} +13 -13
- package/screenshot-page/assets/DEpn6VGd30cHEJOS.js +1 -0
- package/screenshot-page/assets/{CIged53b3hHKxa-o.js → DLFFFQjTi5Ji1940.js} +1 -1
- package/screenshot-page/assets/DMxrNtfw275en7pm.js +1 -0
- package/screenshot-page/assets/{CqR3hGrC956TkCMj.js → DRncpwDkZZX8rL9S.js} +1 -1
- package/screenshot-page/assets/DTrnAtpccj55fGg5.js +1 -0
- package/screenshot-page/assets/D_kJ3WunvjIINcHC.js +1 -0
- package/screenshot-page/assets/{BFaiQZKle44Rhyou.js → D_rtIYQ7FDC2CoEn.js} +1 -1
- package/screenshot-page/assets/{Bf7xq8PyF4ohjMzP.js → Db6bZVJ-184DJIoe.js} +2 -2
- package/screenshot-page/assets/{DyLWQxXXTw5uwPVy.js → DeyRZ5rprDbRbuf4.js} +1 -1
- package/screenshot-page/assets/{D47ePD4x1lVazNdl.js → DgtqX4DiBgkepVZZ.js} +1 -1
- package/screenshot-page/assets/DhB6GjSJIeTmIODk.js +1 -0
- package/screenshot-page/assets/Dn5PwRw7rrTKNnql.js +586 -0
- package/screenshot-page/assets/{BYRwTzX1q407lHUS.js → Dq7wGcTrNIshovlT.js} +2 -2
- package/screenshot-page/assets/{BUGXf2DEBog16Slb.js → DqXO_Zw1Cp7rAQ04.js} +2 -2
- package/screenshot-page/assets/{21oAESJyBGXeHegm.js → DtihumgXQ7ETaN0A.js} +2 -2
- package/screenshot-page/assets/DuYb_otrRZZDq6-f.js +2 -0
- package/screenshot-page/assets/DyiVrm8mEnEaoZHa.js +3 -0
- package/screenshot-page/assets/{BHqg55S-4_OoAu3P.js → LYyM_ig973jLdOU0.js} +2 -2
- package/screenshot-page/assets/TilS2JSBGVkd1za3.js +3 -0
- package/screenshot-page/assets/Tph2vYqw17-NBCtd.js +1 -0
- package/screenshot-page/assets/UKFgEuwI1UMhPqKF.js +2 -0
- package/screenshot-page/assets/XgsioU5Px1T5gKAY.js +1 -0
- package/screenshot-page/assets/cTMKPkmZF8FWQaMn.js +1 -0
- package/screenshot-page/assets/hlxJ87-H830aSZBQ.js +1 -0
- package/screenshot-page/assets/{DDQWM8rNYCYzKa9R.js → lgeNUp9cU20IAotv.js} +1 -1
- package/screenshot-page/assets/nM1r2xslndIMKlI2.js +2 -0
- package/screenshot-page/assets/{BCl5buf87xUgIfEB.js → rOzyaU7hqchMbhRL.js} +1 -1
- package/screenshot-page/index.html +12 -12
- package/screenshot-page/resources/locales/@sheetxl/sdk/de/model.msg.json +82 -1
- package/screenshot-page/resources/locales/@sheetxl/sdk/en/model.msg.json +80 -1
- package/types/scripting-api.json +9967 -9497
- package/types/scripting-enums.json +27 -0
- package/types/scripting.d.ts +2282 -166
- package/assets/B6BP5l2qmeZhqVV7.js +0 -7
- package/assets/COFze3jkZDQRSij9.js +0 -4437
- package/assets/CdF5MxGnISAZ41oQ.js +0 -359
- package/assets/Cfvhcua4c6onouhP.js +0 -14
- package/assets/CwdOInoJwCxXnhog.js +0 -7
- package/assets/D2_T0KSaye0ncjQa.js +0 -6294
- package/assets/W-MzzQHZuRxr8adc.js +0 -2346
- package/screenshot-page/assets/04d8koPx6lzeMYRQ.js +0 -39
- package/screenshot-page/assets/0MTaPYjKud2Q9QG9.js +0 -1
- package/screenshot-page/assets/BQfe-XTIOGeUnD9B.js +0 -1
- package/screenshot-page/assets/BksaQEoZr5OWq-_d.js +0 -3
- package/screenshot-page/assets/Bwql3QifB2cv7Mqp.js +0 -3
- package/screenshot-page/assets/Bz2U7weS0spa8Xbh.js +0 -1
- package/screenshot-page/assets/C2Wh2h27c7FUb8Yk.js +0 -1
- package/screenshot-page/assets/C81mK8aZKZAAS-AB.js +0 -1
- package/screenshot-page/assets/CFOaI8g7pJuPzsyk.js +0 -1
- package/screenshot-page/assets/Ca6nxdhEuLLty3d7.js +0 -2
- package/screenshot-page/assets/CnZJ44ncMxZ4ivcB.js +0 -586
- package/screenshot-page/assets/Cv8FG9PPBkkPw86e.js +0 -1
- package/screenshot-page/assets/CvL9XK3Ht1mP-rGz.js +0 -4
- package/screenshot-page/assets/DUJzubL4qqOyizfu.js +0 -1
- package/screenshot-page/assets/DWiI5I3RtoKvVT66.js +0 -1
- package/screenshot-page/assets/DZDRRw-62D6Zw7qs.js +0 -1
- package/screenshot-page/assets/D_H2dlsQ8PJ0r1WD.js +0 -10
- package/screenshot-page/assets/DeAKjatTVaZ0u_FY.js +0 -1
- package/screenshot-page/assets/DqM1wwsmN1J4MXMm.js +0 -1
- package/screenshot-page/assets/DsL71n5SxCVjL6Ho.js +0 -2
- package/screenshot-page/assets/DzZRUd0p22CBa27b.js +0 -1
- package/screenshot-page/assets/IRtoU5oVgBWu9rnK.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/fGlPAximvsxzPzGA.js +0 -1
- package/screenshot-page/assets/qm3VY0bH7F7EgSdi.js +0 -2
- package/screenshot-page/assets/rPOkVKdPbFpTG6AY.js +0 -1
- package/screenshot-page/assets/zHHZFbk5RXnrxbOc.js +0 -42
|
@@ -0,0 +1,4676 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/mcp - MCP server exposing SheetXL spreadsheet operations as tools and resources. - v0.8.0-beta.16
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
6
|
+
*/
|
|
7
|
+
import { r as t } from "./pQUJKbHGetb7dcOr.js";
|
|
8
|
+
import { Q as e, Z as o, h as s, ht as r, ot as n, tt as i, xt as a } from "./CrwtgrD7BbXyCkx0.js";
|
|
9
|
+
import { G as l, ht as c, lt as h, v as u } from "./BNrpvJZtIL0Ex_wE.js";
|
|
10
|
+
import { d, m as p, o as f } from "./D3bxrF1Ys2GSVfQH.js";
|
|
11
|
+
import { It as g, Ri as m, Yi as b, _ as y, ea as v, no as x, r as w, rt as T, st as S, ti as C } from "./5B_tapYOcjOv1wGO.js";
|
|
12
|
+
import { N as A, P as k, d as E, g as I } from "./DOZ40EyxD3m0gCos.js";
|
|
13
|
+
import { F as P, ft as O, vt as D, yt as N } from "./TNQaiw20sEAEUiK5.js";
|
|
14
|
+
import { $ as _, B as $, Bt as M, Cr as R, Ct as V, D as L, Dt as j, E as B, Er as F, Fn as H, Ft as W, G as z, H as X, Hn as q, In as U, J as K, Jn as J, Lt as Z, N as Q, Nn as Y, Nt as tt, On as et, Rt as ot, S as st, Sr as rt, St as nt, T as it, Vn as at, W as lt, Xt as ct, Zn as ht, Zt as ut, _ as dt, _t as pt, a as ft, b as gt, bn as mt, bt, cr as yt, ct as vt, d as xt, dt as wt, en as Tt, er as St, fn as Ct, fr as At, gn as kt, gr as Et, gt as It, hn as Pt, i as Ot, in as Dt, k as Nt, l as _t, ln as $t, lr as Mt, m as Rt, mr as Vt, n as Lt, nt as jt, or as Bt, ot as Ft, q as Ht, rr as Wt, tt as zt, v as Xt, vn as qt, w as Ut, wr as Gt, wt as Kt, xn as Jt, xt as Zt, yn as Qt, zn as Yt, zt as te } from "./BlWfQ5HPEehB_lPz.js";
|
|
15
|
+
var ee = {
|
|
16
|
+
ascending: "ascending",
|
|
17
|
+
descending: "descending",
|
|
18
|
+
natural: "dataSource"
|
|
19
|
+
};
|
|
20
|
+
function oe(t, e) {
|
|
21
|
+
const o = t.sheets ?? [], s = /* @__PURE__ */ new Map();
|
|
22
|
+
for (let t = 0; t < o.length; t++) {
|
|
23
|
+
const e = o[t], r = W(e)?.tables ?? [];
|
|
24
|
+
for (let t = 0; t < r.length; t++) {
|
|
25
|
+
const e = r[t], o = Array.isArray(e) ? e[1] : e?.v;
|
|
26
|
+
if (!o?.id) continue;
|
|
27
|
+
const n = (o.columns ?? []).map((t) => "string" == typeof t ? { name: t } : t);
|
|
28
|
+
s.set(String(o.id), {
|
|
29
|
+
name: o.name ?? "",
|
|
30
|
+
columns: n
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const r = /* @__PURE__ */ new Map();
|
|
35
|
+
for (let t = 0; t < o.length; t++) {
|
|
36
|
+
const e = o[t];
|
|
37
|
+
void 0 !== e?.sheetId && e.name && r.set(String(e.sheetId), e.name);
|
|
38
|
+
}
|
|
39
|
+
const n = function(t) {
|
|
40
|
+
const e = /* @__PURE__ */ new Map(), o = t.pivotCaches ?? [];
|
|
41
|
+
for (let t = 0; t < o.length; t++) {
|
|
42
|
+
const s = o[t].part?.xml, r = s ? /<(?:\w+:)?pivotCacheDefinition\b[^>]*?\spivotCacheId="(\d+)"[^>]*\/?>\s*<\/(?:\w+:)?ext>/.exec(s)?.[1] : void 0;
|
|
43
|
+
void 0 !== r && e.set(r, o[t].cacheId);
|
|
44
|
+
}
|
|
45
|
+
return e;
|
|
46
|
+
}(t), i = /* @__PURE__ */ new Map();
|
|
47
|
+
for (let t = 0; t < o.length; t++) {
|
|
48
|
+
const e = W(o[t])?.pivotTables ?? [];
|
|
49
|
+
for (let s = 0; s < e.length; s++) i.set(`${o[t].name}\0${e[s].name}`, e[s]);
|
|
50
|
+
}
|
|
51
|
+
const a = new Set((t.pivotCaches ?? []).flatMap((t) => t.fields ? [t.cacheId] : [])), l = /* @__PURE__ */ new Set();
|
|
52
|
+
for (let t = 0; t < o.length; t++) {
|
|
53
|
+
const c = o[t], h = W(c);
|
|
54
|
+
if (!h) continue;
|
|
55
|
+
const u = h.slicers, d = h.movables;
|
|
56
|
+
if (u && d) for (let t = d.length - 1; t >= 0; t--) {
|
|
57
|
+
const o = d[t].content;
|
|
58
|
+
if ("slicer" !== o?.type || o.json?.source) continue;
|
|
59
|
+
const c = o.name ?? "", h = u[c];
|
|
60
|
+
if (!h) continue;
|
|
61
|
+
if (!h.tableId) {
|
|
62
|
+
if (void 0 === h.pivotBody) continue;
|
|
63
|
+
o.json = ne(h, o.json), o.json.pivot = re(h, r, n, i, a), l.add(c), h.cachePath && e.markAbsorbed(h.cachePath);
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
const p = s.get(String(h.tableId)), f = p ? se(p.columns, h.columnId) : null;
|
|
67
|
+
p && f ? (o.json = ne(h, o.json, y.structuredReference(p.name, f.name)), l.add(c), h.cachePath && e.markAbsorbed(h.cachePath)) : (e.warn("A slicer names no table; it was not imported.", "xlsx.slicer.cacheDefinition"), d.splice(t, 1));
|
|
68
|
+
}
|
|
69
|
+
delete h.slicers;
|
|
70
|
+
}
|
|
71
|
+
e.slicerParts.forEach((t, o) => {
|
|
72
|
+
const s = Object.keys(t);
|
|
73
|
+
s.length > 0 && s.every((t) => l.has(t)) && e.markAbsorbed(o);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function se(t, e) {
|
|
77
|
+
if (!e) return null;
|
|
78
|
+
for (let o = 0; o < t.length; o++) if (void 0 !== t[o].id && String(t[o].id) === e) return t[o];
|
|
79
|
+
const o = Number(e);
|
|
80
|
+
return Number.isInteger(o) && o >= 1 && o <= t.length ? t[o - 1] : null;
|
|
81
|
+
}
|
|
82
|
+
function re(t, e, o, s, r) {
|
|
83
|
+
const n = [], i = t.pivotTables ?? [];
|
|
84
|
+
for (let t = 0; t < i.length; t++) {
|
|
85
|
+
const o = e.get(i[t].tabId);
|
|
86
|
+
o && n.push({
|
|
87
|
+
sheet: o,
|
|
88
|
+
name: i[t].name
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
const a = {
|
|
92
|
+
sourceName: t.sourceName ?? "",
|
|
93
|
+
tables: n,
|
|
94
|
+
body: t.pivotBody ?? ""
|
|
95
|
+
};
|
|
96
|
+
let l = void 0 !== t.pivotCacheId ? o.get(t.pivotCacheId) : void 0;
|
|
97
|
+
if (t.tabular) {
|
|
98
|
+
const e = n.length > 0 ? s.get(`${n[0].sheet}\0${n[0].name}`) : void 0;
|
|
99
|
+
l ??= e?.cacheId, e?.fields && void 0 !== l && r.has(l) ? a.tabular = !1 === t.showMissing ? { hideMissing: !0 } : {} : a.body = (t.pivotData ?? "") + a.body;
|
|
100
|
+
}
|
|
101
|
+
return void 0 !== l && (a.cacheId = l), t.timelineAttributes && (a.timeline = {
|
|
102
|
+
attributes: t.timelineAttributes,
|
|
103
|
+
body: t.timelineBody ?? ""
|
|
104
|
+
}), a;
|
|
105
|
+
}
|
|
106
|
+
function ne(t, e, o) {
|
|
107
|
+
const s = { ...e };
|
|
108
|
+
if (void 0 !== o && (s.source = o), void 0 !== t.caption && t.caption !== t.sourceName && (s.caption = t.caption), !1 === t.showCaption && (s.hiddenCaption = !0), void 0 !== t.columnCount && t.columnCount > 1 && (s.columnCount = t.columnCount), void 0 !== t.rowHeight) {
|
|
109
|
+
const e = Math.round(t.rowHeight / 9525);
|
|
110
|
+
e > 0 && 27 !== e && (s.rowHeight = e);
|
|
111
|
+
}
|
|
112
|
+
t.style && "SlicerStyleLight1" !== t.style && (s.style = t.style);
|
|
113
|
+
const r = t.sortOrder ? ee[t.sortOrder] : void 0;
|
|
114
|
+
return r && "ascending" !== r && (s.sortOrder = r), t.crossFilter && "showItemsWithDataAtTop" !== t.crossFilter && (s.crossFilter = t.crossFilter), t.lockedPosition && (s.lockedPosition = !0), !1 === t.customListSort && (s.disabledCustomListSort = !0), t.cacheName && (s.cacheName = t.cacheName), t.startItem && (s.startItem = t.startItem), void 0 !== t.level && (s.level = t.level), t.uid && (s.uid = t.uid), s;
|
|
115
|
+
}
|
|
116
|
+
var ie = (t, e) => {
|
|
117
|
+
const o = [], s = t?.childNodes, r = s?.length ?? 0;
|
|
118
|
+
for (let t = 0; t < r; t++) {
|
|
119
|
+
const r = s.item(t);
|
|
120
|
+
1 !== r.nodeType || e && r.localName !== e || o.push(r);
|
|
121
|
+
}
|
|
122
|
+
return o;
|
|
123
|
+
}, ae = (t) => ie(t, "k").map((t) => [t.getAttribute("n") ?? "", t.getAttribute("t") || null]), le = (t) => ie(t, "v").map((t) => ({
|
|
124
|
+
t: t.getAttribute("t") || null,
|
|
125
|
+
text: t.textContent ?? ""
|
|
126
|
+
})), ce = (t) => {
|
|
127
|
+
const e = /* @__PURE__ */ new Map();
|
|
128
|
+
for (const o of ie(t, "key")) {
|
|
129
|
+
const t = /* @__PURE__ */ new Map();
|
|
130
|
+
for (const e of ie(o, "flag")) t.set(e.getAttribute("name") ?? "", e.getAttribute("value") ?? "");
|
|
131
|
+
e.set(o.getAttribute("name") ?? "", t);
|
|
132
|
+
}
|
|
133
|
+
return e;
|
|
134
|
+
}, he = /* @__PURE__ */ new Uint8Array(0), ue = class t {
|
|
135
|
+
constructor(t, e, o) {
|
|
136
|
+
this.buffers = /* @__PURE__ */ new Map(), this.zip = t, this.entries = e, this.rawBuffer = o;
|
|
137
|
+
}
|
|
138
|
+
static normalize(t) {
|
|
139
|
+
return t.startsWith("/") ? t.slice(1) : t;
|
|
140
|
+
}
|
|
141
|
+
static async create(e) {
|
|
142
|
+
const o = e instanceof Blob ? he : e instanceof Uint8Array ? e : new Uint8Array(e), s = e instanceof Blob ? new O(e) : new D(o), r = new P(s), n = /* @__PURE__ */ new Map();
|
|
143
|
+
for (const t of await r.getEntries()) t.directory || n.set(t.filename, t);
|
|
144
|
+
return new t(r, n, o);
|
|
145
|
+
}
|
|
146
|
+
getNames() {
|
|
147
|
+
return [...this.entries.keys()];
|
|
148
|
+
}
|
|
149
|
+
has(e) {
|
|
150
|
+
return this.entries.has(t.normalize(e));
|
|
151
|
+
}
|
|
152
|
+
uncompressedSize(e) {
|
|
153
|
+
return this.entries.get(t.normalize(e))?.uncompressedSize ?? 0;
|
|
154
|
+
}
|
|
155
|
+
async getBuffer(e) {
|
|
156
|
+
const o = t.normalize(e), s = this.buffers.get(o);
|
|
157
|
+
if (s) return s;
|
|
158
|
+
const r = this.entries.get(o);
|
|
159
|
+
if (!r) return null;
|
|
160
|
+
const n = await r.getData(new N());
|
|
161
|
+
return this.buffers.set(o, n), n;
|
|
162
|
+
}
|
|
163
|
+
async prefetch(t) {
|
|
164
|
+
const e = [];
|
|
165
|
+
for (const [o, s] of this.entries) !this.buffers.has(o) && t(o, s) && e.push(s.getData(new N()).then((t) => {
|
|
166
|
+
this.buffers.set(o, t);
|
|
167
|
+
}));
|
|
168
|
+
await Promise.all(e);
|
|
169
|
+
}
|
|
170
|
+
getEntry(e) {
|
|
171
|
+
return this.buffers.get(t.normalize(e)) ?? null;
|
|
172
|
+
}
|
|
173
|
+
async getTextStream(e, o) {
|
|
174
|
+
const s = this.entries.get(t.normalize(e));
|
|
175
|
+
if (!s) return null;
|
|
176
|
+
const r = new TransformStream();
|
|
177
|
+
s.getData(r.writable).catch(() => {});
|
|
178
|
+
const n = r.readable.getReader(), i = new TextDecoder("utf-8");
|
|
179
|
+
return new ReadableStream({ async pull(t) {
|
|
180
|
+
const { value: e, done: s } = await n.read();
|
|
181
|
+
if (s) {
|
|
182
|
+
const e = i.decode();
|
|
183
|
+
e && t.enqueue(e), t.close();
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
o?.(e.byteLength);
|
|
187
|
+
const r = i.decode(e, { stream: !0 });
|
|
188
|
+
r && t.enqueue(r);
|
|
189
|
+
} }).getReader();
|
|
190
|
+
}
|
|
191
|
+
getRawEntry(e) {
|
|
192
|
+
const o = this.entries.get(t.normalize(e));
|
|
193
|
+
if (!o || o.encrypted || void 0 === o.crc32) return null;
|
|
194
|
+
const s = o.offset;
|
|
195
|
+
if (s + 30 > this.rawBuffer.byteLength) return null;
|
|
196
|
+
const r = new DataView(this.rawBuffer.buffer, this.rawBuffer.byteOffset + s, 30);
|
|
197
|
+
if (67324752 !== r.getUint32(0, !0)) return null;
|
|
198
|
+
const n = s + 30 + r.getUint16(26, !0) + r.getUint16(28, !0), i = n + o.compressedSize;
|
|
199
|
+
return i > this.rawBuffer.byteLength ? null : {
|
|
200
|
+
data: this.rawBuffer.subarray(n, i),
|
|
201
|
+
compressionMethod: o.compressionMethod,
|
|
202
|
+
signature: o.crc32
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
async close() {
|
|
206
|
+
await this.zip.close();
|
|
207
|
+
}
|
|
208
|
+
}, de = class {
|
|
209
|
+
constructor(t) {
|
|
210
|
+
this._sink = t, this._samples = [], this._t0 = pe(), this._tPrev = this._t0, this._heapPrev = fe();
|
|
211
|
+
}
|
|
212
|
+
mark(t) {
|
|
213
|
+
const e = pe(), o = fe(), s = {
|
|
214
|
+
label: t,
|
|
215
|
+
tMs: e - this._t0,
|
|
216
|
+
dtMs: e - this._tPrev,
|
|
217
|
+
heapBytes: o,
|
|
218
|
+
dHeapBytes: void 0 !== o && void 0 !== this._heapPrev ? o - this._heapPrev : void 0,
|
|
219
|
+
rssBytes: ge()
|
|
220
|
+
};
|
|
221
|
+
this._tPrev = e, this._heapPrev = o, this._samples.push(s), this._sink?.(s);
|
|
222
|
+
}
|
|
223
|
+
samples() {
|
|
224
|
+
return this._samples;
|
|
225
|
+
}
|
|
226
|
+
toTable() {
|
|
227
|
+
return this._samples.map((t) => ({
|
|
228
|
+
phase: t.label,
|
|
229
|
+
tMs: Math.round(t.tMs),
|
|
230
|
+
dtMs: Math.round(t.dtMs),
|
|
231
|
+
heapMB: void 0 !== t.heapBytes ? me(t.heapBytes / 1048576) : "—",
|
|
232
|
+
dHeapMB: void 0 !== t.dHeapBytes ? me(t.dHeapBytes / 1048576) : "—",
|
|
233
|
+
rssMB: void 0 !== t.rssBytes ? me(t.rssBytes / 1048576) : "—"
|
|
234
|
+
}));
|
|
235
|
+
}
|
|
236
|
+
}, pe = "object" == typeof performance && "function" == typeof performance.now ? () => performance.now() : () => Date.now();
|
|
237
|
+
function fe() {
|
|
238
|
+
const t = "object" == typeof performance ? performance.memory : void 0;
|
|
239
|
+
if (t && "number" == typeof t.usedJSHeapSize) return t.usedJSHeapSize;
|
|
240
|
+
const e = globalThis.process;
|
|
241
|
+
return "object" == typeof e && "function" == typeof e.memoryUsage ? e.memoryUsage().heapUsed : void 0;
|
|
242
|
+
}
|
|
243
|
+
function ge() {
|
|
244
|
+
const t = globalThis.process;
|
|
245
|
+
if ("object" == typeof t && "function" == typeof t.memoryUsage) return t.memoryUsage().rss;
|
|
246
|
+
}
|
|
247
|
+
function me(t) {
|
|
248
|
+
return Math.round(10 * t) / 10;
|
|
249
|
+
}
|
|
250
|
+
var be = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-", ye = `-${be}.0-9·̀-ͯ‿-⁀`, ve = (new RegExp(`^[${be}]$`, "u"), new RegExp(`^[${ye}]$`, "u"), new RegExp(`^[${be}][${ye}]*$`, "u")), xe = (new RegExp(`^[${ye}]+$`, "u"), [
|
|
251
|
+
32,
|
|
252
|
+
10,
|
|
253
|
+
13,
|
|
254
|
+
9
|
|
255
|
+
]);
|
|
256
|
+
function we(t) {
|
|
257
|
+
return t >= 65 && t <= 90 || t >= 97 && t <= 122 || 58 === t || 95 === t || 8204 === t || 8205 === t || t >= 192 && t <= 214 || t >= 216 && t <= 246 || t >= 248 && t <= 767 || t >= 880 && t <= 893 || t >= 895 && t <= 8191 || t >= 8304 && t <= 8591 || t >= 11264 && t <= 12271 || t >= 12289 && t <= 55295 || t >= 63744 && t <= 64975 || t >= 65008 && t <= 65533 || t >= 65536 && t <= 983039;
|
|
258
|
+
}
|
|
259
|
+
var Te = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-", Se = `-${Te}.0-9·̀-ͯ‿-⁀`;
|
|
260
|
+
new RegExp(`^[${Te}]$`, "u"), new RegExp(`^[${Se}]$`, "u"), new RegExp(`^[${Te}][${Se}]*$`, "u"), new RegExp(`^[${Se}]+$`, "u");
|
|
261
|
+
var Ce = "A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-", Ae = `-${Ce}.0-9·̀-ͯ‿-⁀`, ke = (new RegExp(`^[${Ce}]$`, "u"), new RegExp(`^[${Ae}]$`, "u"), new RegExp(`^[${Ce}][${Ae}]*$`, "u"));
|
|
262
|
+
function Ee(t) {
|
|
263
|
+
return t >= 65 && t <= 90 || 95 === t || t >= 97 && t <= 122 || t >= 192 && t <= 214 || t >= 216 && t <= 246 || t >= 248 && t <= 767 || t >= 880 && t <= 893 || t >= 895 && t <= 8191 || t >= 8204 && t <= 8205 || t >= 8304 && t <= 8591 || t >= 11264 && t <= 12271 || t >= 12289 && t <= 55295 || t >= 63744 && t <= 64975 || t >= 65008 && t <= 65533 || t >= 65536 && t <= 983039;
|
|
264
|
+
}
|
|
265
|
+
var Ie, Pe = function(t) {
|
|
266
|
+
return 32 === t || 10 === t || 13 === t || 9 === t;
|
|
267
|
+
}, Oe = function(t) {
|
|
268
|
+
return t >= 32 && t <= 55295 || 10 === t || 13 === t || 9 === t || t >= 57344 && t <= 65533 || t >= 65536 && t <= 1114111;
|
|
269
|
+
}, De = we, Ne = function(t) {
|
|
270
|
+
return we(t) || t >= 48 && t <= 57 || 45 === t || 46 === t || 183 === t || t >= 768 && t <= 879 || t >= 8255 && t <= 8256;
|
|
271
|
+
}, _e = xe, $e = ve, Me = function(t) {
|
|
272
|
+
return t >= 1 && t <= 55295 || t >= 57344 && t <= 65533 || t >= 65536 && t <= 1114111;
|
|
273
|
+
}, Re = Ee, Ve = function(t) {
|
|
274
|
+
return Ee(t) || 45 === t || 46 === t || t >= 48 && t <= 57 || 183 === t || t >= 768 && t <= 879 || t >= 8255 && t <= 8256;
|
|
275
|
+
}, Le = ke, je = "http://www.w3.org/XML/1998/namespace", Be = "http://www.w3.org/2000/xmlns/", Fe = {
|
|
276
|
+
__proto__: null,
|
|
277
|
+
xml: je,
|
|
278
|
+
xmlns: Be
|
|
279
|
+
}, He = {
|
|
280
|
+
__proto__: null,
|
|
281
|
+
amp: "&",
|
|
282
|
+
gt: ">",
|
|
283
|
+
lt: "<",
|
|
284
|
+
quot: "\"",
|
|
285
|
+
apos: "'"
|
|
286
|
+
}, We = -1, ze = -2, Xe = 13, qe = 33, Ue = 10, Ge = 60, Ke = 61, Je = 62, Ze = 63, Qe = 93, Ye = (t) => 34 === t || 39 === t, to = [34, 39], eo = [
|
|
287
|
+
...to,
|
|
288
|
+
91,
|
|
289
|
+
Je
|
|
290
|
+
], oo = [
|
|
291
|
+
...to,
|
|
292
|
+
Ge,
|
|
293
|
+
Qe
|
|
294
|
+
], so = [
|
|
295
|
+
Ke,
|
|
296
|
+
Ze,
|
|
297
|
+
..._e
|
|
298
|
+
], ro = [
|
|
299
|
+
..._e,
|
|
300
|
+
Je,
|
|
301
|
+
38,
|
|
302
|
+
Ge
|
|
303
|
+
];
|
|
304
|
+
function no(t, e, o) {
|
|
305
|
+
switch (e) {
|
|
306
|
+
case "xml":
|
|
307
|
+
o !== je && t.fail(`xml prefix must be bound to ${je}.`);
|
|
308
|
+
break;
|
|
309
|
+
case "xmlns": o !== Be && t.fail(`xmlns prefix must be bound to ${Be}.`);
|
|
310
|
+
}
|
|
311
|
+
switch (o) {
|
|
312
|
+
case Be:
|
|
313
|
+
t.fail("" === e ? `the default namespace may not be set to ${o}.` : `may not assign a prefix (even "xmlns") to the URI ${Be}.`);
|
|
314
|
+
break;
|
|
315
|
+
case je: switch (e) {
|
|
316
|
+
case "xml": break;
|
|
317
|
+
case "":
|
|
318
|
+
t.fail(`the default namespace may not be set to ${o}.`);
|
|
319
|
+
break;
|
|
320
|
+
default: t.fail("may not assign the xml namespace to another prefix.");
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
var io = (t) => Le.test(t), ao = (t) => $e.test(t), lo = {
|
|
325
|
+
xmldecl: "xmlDeclHandler",
|
|
326
|
+
text: "textHandler",
|
|
327
|
+
processinginstruction: "piHandler",
|
|
328
|
+
doctype: "doctypeHandler",
|
|
329
|
+
comment: "commentHandler",
|
|
330
|
+
opentagstart: "openTagStartHandler",
|
|
331
|
+
attribute: "attributeHandler",
|
|
332
|
+
opentag: "openTagHandler",
|
|
333
|
+
closetag: "closeTagHandler",
|
|
334
|
+
cdata: "cdataHandler",
|
|
335
|
+
error: "errorHandler",
|
|
336
|
+
end: "endHandler",
|
|
337
|
+
ready: "readyHandler"
|
|
338
|
+
}, co = class {
|
|
339
|
+
get closed() {
|
|
340
|
+
return this._closed;
|
|
341
|
+
}
|
|
342
|
+
constructor(t) {
|
|
343
|
+
this.i = 0, this.prevI = 0, this.opt = t ?? {}, this.fragmentOpt = !!this.opt.fragment;
|
|
344
|
+
const e = this.xmlnsOpt = !!this.opt.xmlns;
|
|
345
|
+
if (this.trackPosition = !1 !== this.opt.position, this.fileName = this.opt.fileName, e) {
|
|
346
|
+
this.nameStartCheck = Re, this.nameCheck = Ve, this.isName = io, this.processAttribs = this.processAttribsNS, this.pushAttrib = this.pushAttribNS, this.ns = {
|
|
347
|
+
__proto__: null,
|
|
348
|
+
...Fe
|
|
349
|
+
};
|
|
350
|
+
const t = this.opt.additionalNamespaces;
|
|
351
|
+
null != t && (function(t, e) {
|
|
352
|
+
for (const o of Object.keys(e)) no(t, o, e[o]);
|
|
353
|
+
}(this, t), Object.assign(this.ns, t));
|
|
354
|
+
} else this.nameStartCheck = De, this.nameCheck = Ne, this.isName = ao, this.processAttribs = this.processAttribsPlain, this.pushAttrib = this.pushAttribPlain;
|
|
355
|
+
this.stateTable = [
|
|
356
|
+
this.sBegin,
|
|
357
|
+
this.sBeginWhitespace,
|
|
358
|
+
this.sDoctype,
|
|
359
|
+
this.sDoctypeQuote,
|
|
360
|
+
this.sDTD,
|
|
361
|
+
this.sDTDQuoted,
|
|
362
|
+
this.sDTDOpenWaka,
|
|
363
|
+
this.sDTDOpenWakaBang,
|
|
364
|
+
this.sDTDComment,
|
|
365
|
+
this.sDTDCommentEnding,
|
|
366
|
+
this.sDTDCommentEnded,
|
|
367
|
+
this.sDTDPI,
|
|
368
|
+
this.sDTDPIEnding,
|
|
369
|
+
this.sText,
|
|
370
|
+
this.sEntity,
|
|
371
|
+
this.sOpenWaka,
|
|
372
|
+
this.sOpenWakaBang,
|
|
373
|
+
this.sComment,
|
|
374
|
+
this.sCommentEnding,
|
|
375
|
+
this.sCommentEnded,
|
|
376
|
+
this.sCData,
|
|
377
|
+
this.sCDataEnding,
|
|
378
|
+
this.sCDataEnding2,
|
|
379
|
+
this.sPIFirstChar,
|
|
380
|
+
this.sPIRest,
|
|
381
|
+
this.sPIBody,
|
|
382
|
+
this.sPIEnding,
|
|
383
|
+
this.sXMLDeclNameStart,
|
|
384
|
+
this.sXMLDeclName,
|
|
385
|
+
this.sXMLDeclEq,
|
|
386
|
+
this.sXMLDeclValueStart,
|
|
387
|
+
this.sXMLDeclValue,
|
|
388
|
+
this.sXMLDeclSeparator,
|
|
389
|
+
this.sXMLDeclEnding,
|
|
390
|
+
this.sOpenTag,
|
|
391
|
+
this.sOpenTagSlash,
|
|
392
|
+
this.sAttrib,
|
|
393
|
+
this.sAttribName,
|
|
394
|
+
this.sAttribNameSawWhite,
|
|
395
|
+
this.sAttribValue,
|
|
396
|
+
this.sAttribValueQuoted,
|
|
397
|
+
this.sAttribValueClosed,
|
|
398
|
+
this.sAttribValueUnquoted,
|
|
399
|
+
this.sCloseTag,
|
|
400
|
+
this.sCloseTagSawWhite
|
|
401
|
+
], this._init();
|
|
402
|
+
}
|
|
403
|
+
_init() {
|
|
404
|
+
this.openWakaBang = "", this.text = "", this.name = "", this.piTarget = "", this.entity = "", this.q = null, this.tags = [], this.tag = null, this.topNS = null, this.chunk = "", this.chunkPosition = 0, this.i = 0, this.prevI = 0, this.carriedFromPrevious = void 0, this.forbiddenState = 0, this.attribList = [];
|
|
405
|
+
const { fragmentOpt: t } = this;
|
|
406
|
+
this.state = t ? Xe : 0, this.reportedTextBeforeRoot = this.reportedTextAfterRoot = this.closedRoot = this.sawRoot = t, this.xmlDeclPossible = !t, this.xmlDeclExpects = ["version"], this.entityReturnState = void 0;
|
|
407
|
+
let { defaultXMLVersion: e } = this.opt;
|
|
408
|
+
if (void 0 === e) {
|
|
409
|
+
if (!0 === this.opt.forceXMLVersion) throw new Error("forceXMLVersion set but defaultXMLVersion is not set");
|
|
410
|
+
e = "1.0";
|
|
411
|
+
}
|
|
412
|
+
this.setXMLVersion(e), this.positionAtNewLine = 0, this.doctype = !1, this._closed = !1, this.xmlDecl = {
|
|
413
|
+
version: void 0,
|
|
414
|
+
encoding: void 0,
|
|
415
|
+
standalone: void 0
|
|
416
|
+
}, this.line = 1, this.column = 0, this.ENTITIES = Object.create(He), this.readyHandler?.();
|
|
417
|
+
}
|
|
418
|
+
get position() {
|
|
419
|
+
return this.chunkPosition + this.i;
|
|
420
|
+
}
|
|
421
|
+
get columnIndex() {
|
|
422
|
+
return this.position - this.positionAtNewLine;
|
|
423
|
+
}
|
|
424
|
+
on(t, e) {
|
|
425
|
+
this[lo[t]] = e;
|
|
426
|
+
}
|
|
427
|
+
off(t) {
|
|
428
|
+
this[lo[t]] = void 0;
|
|
429
|
+
}
|
|
430
|
+
makeError(t) {
|
|
431
|
+
let e = this.fileName ?? "";
|
|
432
|
+
return this.trackPosition && (e.length > 0 && (e += ":"), e += `${this.line}:${this.column}`), e.length > 0 && (e += ": "), new Error(e + t);
|
|
433
|
+
}
|
|
434
|
+
fail(t) {
|
|
435
|
+
const e = this.makeError(t), o = this.errorHandler;
|
|
436
|
+
if (void 0 === o) throw e;
|
|
437
|
+
return o(e), this;
|
|
438
|
+
}
|
|
439
|
+
write(t) {
|
|
440
|
+
if (this.closed) return this.fail("cannot write after close.");
|
|
441
|
+
let e = !1;
|
|
442
|
+
null === t ? (e = !0, t = "") : "object" == typeof t && (t = t.toString()), void 0 !== this.carriedFromPrevious && (t = `${this.carriedFromPrevious}${t}`, this.carriedFromPrevious = void 0);
|
|
443
|
+
let o = t.length;
|
|
444
|
+
const s = t.charCodeAt(o - 1);
|
|
445
|
+
!e && (13 === s || s >= 55296 && s <= 56319) && (this.carriedFromPrevious = t[o - 1], o--, t = t.slice(0, o));
|
|
446
|
+
const { stateTable: r } = this;
|
|
447
|
+
for (this.chunk = t, this.i = 0; this.i < o;) r[this.state].call(this);
|
|
448
|
+
return this.chunkPosition += o, e ? this.end() : this;
|
|
449
|
+
}
|
|
450
|
+
close() {
|
|
451
|
+
return this.write(null);
|
|
452
|
+
}
|
|
453
|
+
getCode10() {
|
|
454
|
+
const t = this.chunk, e = this.i;
|
|
455
|
+
if (this.prevI = e, this.i++, e >= t.length) return We;
|
|
456
|
+
const o = t.charCodeAt(e);
|
|
457
|
+
if (this.column++, o < 55296) {
|
|
458
|
+
if (o >= 32 || 9 === o) return o;
|
|
459
|
+
switch (o) {
|
|
460
|
+
case Ue: return this.line++, this.column = 0, this.positionAtNewLine = this.position, Ue;
|
|
461
|
+
case 13: return t.charCodeAt(e + 1) === Ue && (this.i = e + 2), this.line++, this.column = 0, this.positionAtNewLine = this.position, ze;
|
|
462
|
+
default: return this.fail("disallowed character."), o;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
if (o > 56319) return o >= 57344 && o <= 65533 || this.fail("disallowed character."), o;
|
|
466
|
+
const s = 65536 + 1024 * (o - 55296) + (t.charCodeAt(e + 1) - 56320);
|
|
467
|
+
return this.i = e + 2, s > 1114111 && this.fail("disallowed character."), s;
|
|
468
|
+
}
|
|
469
|
+
getCode11() {
|
|
470
|
+
const { chunk: t, i: e } = this;
|
|
471
|
+
if (this.prevI = e, this.i = e + 1, e >= t.length) return We;
|
|
472
|
+
const o = t.charCodeAt(e);
|
|
473
|
+
if (this.column++, o < 55296) {
|
|
474
|
+
if (o > 31 && o < 127 || o > 159 && 8232 !== o || 9 === o) return o;
|
|
475
|
+
switch (o) {
|
|
476
|
+
case Ue: return this.line++, this.column = 0, this.positionAtNewLine = this.position, Ue;
|
|
477
|
+
case 13: {
|
|
478
|
+
const o = t.charCodeAt(e + 1);
|
|
479
|
+
o !== Ue && 133 !== o || (this.i = e + 2);
|
|
480
|
+
}
|
|
481
|
+
case 133:
|
|
482
|
+
case 8232: return this.line++, this.column = 0, this.positionAtNewLine = this.position, ze;
|
|
483
|
+
default: return this.fail("disallowed character."), o;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
if (o > 56319) return o >= 57344 && o <= 65533 || this.fail("disallowed character."), o;
|
|
487
|
+
const s = 65536 + 1024 * (o - 55296) + (t.charCodeAt(e + 1) - 56320);
|
|
488
|
+
return this.i = e + 2, s > 1114111 && this.fail("disallowed character."), s;
|
|
489
|
+
}
|
|
490
|
+
getCodeNorm() {
|
|
491
|
+
const t = this.getCode();
|
|
492
|
+
return t === ze ? Ue : t;
|
|
493
|
+
}
|
|
494
|
+
unGet() {
|
|
495
|
+
this.i = this.prevI, this.column--;
|
|
496
|
+
}
|
|
497
|
+
captureTo(t) {
|
|
498
|
+
let { i: e } = this;
|
|
499
|
+
const { chunk: o } = this;
|
|
500
|
+
for (;;) {
|
|
501
|
+
const s = this.getCode(), r = s === ze, n = r ? Ue : s;
|
|
502
|
+
if (n === We || t.includes(n)) return this.text += o.slice(e, this.prevI), n;
|
|
503
|
+
r && (this.text += `${o.slice(e, this.prevI)}\n`, e = this.i);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
captureToChar(t) {
|
|
507
|
+
let { i: e } = this;
|
|
508
|
+
const { chunk: o } = this;
|
|
509
|
+
for (;;) {
|
|
510
|
+
let s = this.getCode();
|
|
511
|
+
switch (s) {
|
|
512
|
+
case ze:
|
|
513
|
+
this.text += `${o.slice(e, this.prevI)}\n`, e = this.i, s = Ue;
|
|
514
|
+
break;
|
|
515
|
+
case We: return this.text += o.slice(e), !1;
|
|
516
|
+
}
|
|
517
|
+
if (s === t) return this.text += o.slice(e, this.prevI), !0;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
captureNameChars() {
|
|
521
|
+
const { chunk: t, i: e } = this;
|
|
522
|
+
for (;;) {
|
|
523
|
+
const o = this.getCode();
|
|
524
|
+
if (o === We) return this.name += t.slice(e), We;
|
|
525
|
+
if (!Ne(o)) return this.name += t.slice(e, this.prevI), o === ze ? Ue : o;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
skipSpaces() {
|
|
529
|
+
for (;;) {
|
|
530
|
+
const t = this.getCodeNorm();
|
|
531
|
+
if (t === We || !Pe(t)) return t;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
setXMLVersion(t) {
|
|
535
|
+
this.currentXMLVersion = t, "1.0" === t ? (this.isChar = Oe, this.getCode = this.getCode10) : (this.isChar = Me, this.getCode = this.getCode11);
|
|
536
|
+
}
|
|
537
|
+
sBegin() {
|
|
538
|
+
65279 === this.chunk.charCodeAt(0) && (this.i++, this.column++), this.state = 1;
|
|
539
|
+
}
|
|
540
|
+
sBeginWhitespace() {
|
|
541
|
+
const t = this.i, e = this.skipSpaces();
|
|
542
|
+
switch (this.prevI !== t && (this.xmlDeclPossible = !1), e) {
|
|
543
|
+
case Ge:
|
|
544
|
+
if (this.state = 15, 0 !== this.text.length) throw new Error("no-empty text at start");
|
|
545
|
+
break;
|
|
546
|
+
case We: break;
|
|
547
|
+
default: this.unGet(), this.state = Xe, this.xmlDeclPossible = !1;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
sDoctype() {
|
|
551
|
+
const t = this.captureTo(eo);
|
|
552
|
+
switch (t) {
|
|
553
|
+
case Je:
|
|
554
|
+
this.doctypeHandler?.(this.text), this.text = "", this.state = Xe, this.doctype = !0;
|
|
555
|
+
break;
|
|
556
|
+
case We: break;
|
|
557
|
+
default: this.text += String.fromCodePoint(t), 91 === t ? this.state = 4 : Ye(t) && (this.state = 3, this.q = t);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
sDoctypeQuote() {
|
|
561
|
+
const t = this.q;
|
|
562
|
+
this.captureToChar(t) && (this.text += String.fromCodePoint(t), this.q = null, this.state = 2);
|
|
563
|
+
}
|
|
564
|
+
sDTD() {
|
|
565
|
+
const t = this.captureTo(oo);
|
|
566
|
+
t !== We && (this.text += String.fromCodePoint(t), t === Qe ? this.state = 2 : t === Ge ? this.state = 6 : Ye(t) && (this.state = 5, this.q = t));
|
|
567
|
+
}
|
|
568
|
+
sDTDQuoted() {
|
|
569
|
+
const t = this.q;
|
|
570
|
+
this.captureToChar(t) && (this.text += String.fromCodePoint(t), this.state = 4, this.q = null);
|
|
571
|
+
}
|
|
572
|
+
sDTDOpenWaka() {
|
|
573
|
+
const t = this.getCodeNorm();
|
|
574
|
+
switch (this.text += String.fromCodePoint(t), t) {
|
|
575
|
+
case 33:
|
|
576
|
+
this.state = 7, this.openWakaBang = "";
|
|
577
|
+
break;
|
|
578
|
+
case Ze:
|
|
579
|
+
this.state = 11;
|
|
580
|
+
break;
|
|
581
|
+
default: this.state = 4;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
sDTDOpenWakaBang() {
|
|
585
|
+
const t = String.fromCodePoint(this.getCodeNorm()), e = this.openWakaBang += t;
|
|
586
|
+
this.text += t, "-" !== e && (this.state = "--" === e ? 8 : 4, this.openWakaBang = "");
|
|
587
|
+
}
|
|
588
|
+
sDTDComment() {
|
|
589
|
+
this.captureToChar(45) && (this.text += "-", this.state = 9);
|
|
590
|
+
}
|
|
591
|
+
sDTDCommentEnding() {
|
|
592
|
+
const t = this.getCodeNorm();
|
|
593
|
+
this.text += String.fromCodePoint(t), this.state = 45 === t ? 10 : 8;
|
|
594
|
+
}
|
|
595
|
+
sDTDCommentEnded() {
|
|
596
|
+
const t = this.getCodeNorm();
|
|
597
|
+
this.text += String.fromCodePoint(t), t === Je ? this.state = 4 : (this.fail("malformed comment."), this.state = 8);
|
|
598
|
+
}
|
|
599
|
+
sDTDPI() {
|
|
600
|
+
this.captureToChar(Ze) && (this.text += "?", this.state = 12);
|
|
601
|
+
}
|
|
602
|
+
sDTDPIEnding() {
|
|
603
|
+
const t = this.getCodeNorm();
|
|
604
|
+
this.text += String.fromCodePoint(t), t === Je && (this.state = 4);
|
|
605
|
+
}
|
|
606
|
+
sText() {
|
|
607
|
+
0 !== this.tags.length ? this.handleTextInRoot() : this.handleTextOutsideRoot();
|
|
608
|
+
}
|
|
609
|
+
sEntity() {
|
|
610
|
+
let { i: t } = this;
|
|
611
|
+
const { chunk: e } = this;
|
|
612
|
+
t: for (;;) switch (this.getCode()) {
|
|
613
|
+
case ze:
|
|
614
|
+
this.entity += `${e.slice(t, this.prevI)}\n`, t = this.i;
|
|
615
|
+
break;
|
|
616
|
+
case 59: {
|
|
617
|
+
const { entityReturnState: o } = this, s = this.entity + e.slice(t, this.prevI);
|
|
618
|
+
let r;
|
|
619
|
+
this.state = o, "" === s ? (this.fail("empty entity name."), r = "&;") : (r = this.parseEntity(s), this.entity = ""), o === Xe && void 0 === this.textHandler || (this.text += r);
|
|
620
|
+
break t;
|
|
621
|
+
}
|
|
622
|
+
case We:
|
|
623
|
+
this.entity += e.slice(t);
|
|
624
|
+
break t;
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
sOpenWaka() {
|
|
628
|
+
const t = this.getCode();
|
|
629
|
+
if (De(t)) this.state = 34, this.unGet(), this.xmlDeclPossible = !1;
|
|
630
|
+
else switch (t) {
|
|
631
|
+
case 47:
|
|
632
|
+
this.state = 43, this.xmlDeclPossible = !1;
|
|
633
|
+
break;
|
|
634
|
+
case 33:
|
|
635
|
+
this.state = 16, this.openWakaBang = "", this.xmlDeclPossible = !1;
|
|
636
|
+
break;
|
|
637
|
+
case Ze:
|
|
638
|
+
this.state = 23;
|
|
639
|
+
break;
|
|
640
|
+
default: this.fail("disallowed character in tag name"), this.state = Xe, this.xmlDeclPossible = !1;
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
sOpenWakaBang() {
|
|
644
|
+
switch (this.openWakaBang += String.fromCodePoint(this.getCodeNorm()), this.openWakaBang) {
|
|
645
|
+
case "[CDATA[":
|
|
646
|
+
this.sawRoot || this.reportedTextBeforeRoot || (this.fail("text data outside of root node."), this.reportedTextBeforeRoot = !0), this.closedRoot && !this.reportedTextAfterRoot && (this.fail("text data outside of root node."), this.reportedTextAfterRoot = !0), this.state = 20, this.openWakaBang = "";
|
|
647
|
+
break;
|
|
648
|
+
case "--":
|
|
649
|
+
this.state = 17, this.openWakaBang = "";
|
|
650
|
+
break;
|
|
651
|
+
case "DOCTYPE":
|
|
652
|
+
this.state = 2, (this.doctype || this.sawRoot) && this.fail("inappropriately located doctype declaration."), this.openWakaBang = "";
|
|
653
|
+
break;
|
|
654
|
+
default: this.openWakaBang.length >= 7 && this.fail("incorrect syntax.");
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
sComment() {
|
|
658
|
+
this.captureToChar(45) && (this.state = 18);
|
|
659
|
+
}
|
|
660
|
+
sCommentEnding() {
|
|
661
|
+
const t = this.getCodeNorm();
|
|
662
|
+
45 === t ? (this.state = 19, this.commentHandler?.(this.text), this.text = "") : (this.text += `-${String.fromCodePoint(t)}`, this.state = 17);
|
|
663
|
+
}
|
|
664
|
+
sCommentEnded() {
|
|
665
|
+
const t = this.getCodeNorm();
|
|
666
|
+
t !== Je ? (this.fail("malformed comment."), this.text += `--${String.fromCodePoint(t)}`, this.state = 17) : this.state = Xe;
|
|
667
|
+
}
|
|
668
|
+
sCData() {
|
|
669
|
+
this.captureToChar(Qe) && (this.state = 21);
|
|
670
|
+
}
|
|
671
|
+
sCDataEnding() {
|
|
672
|
+
const t = this.getCodeNorm();
|
|
673
|
+
t === Qe ? this.state = 22 : (this.text += `]${String.fromCodePoint(t)}`, this.state = 20);
|
|
674
|
+
}
|
|
675
|
+
sCDataEnding2() {
|
|
676
|
+
const t = this.getCodeNorm();
|
|
677
|
+
switch (t) {
|
|
678
|
+
case Je:
|
|
679
|
+
this.cdataHandler?.(this.text), this.text = "", this.state = Xe;
|
|
680
|
+
break;
|
|
681
|
+
case Qe:
|
|
682
|
+
this.text += "]";
|
|
683
|
+
break;
|
|
684
|
+
default: this.text += `]]${String.fromCodePoint(t)}`, this.state = 20;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
sPIFirstChar() {
|
|
688
|
+
const t = this.getCodeNorm();
|
|
689
|
+
this.nameStartCheck(t) ? (this.piTarget += String.fromCodePoint(t), this.state = 24) : t === Ze || Pe(t) ? (this.fail("processing instruction without a target."), this.state = t === Ze ? 26 : 25) : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(t), this.state = 24);
|
|
690
|
+
}
|
|
691
|
+
sPIRest() {
|
|
692
|
+
const { chunk: t, i: e } = this;
|
|
693
|
+
for (;;) {
|
|
694
|
+
const o = this.getCodeNorm();
|
|
695
|
+
if (o === We) return void (this.piTarget += t.slice(e));
|
|
696
|
+
if (!this.nameCheck(o)) {
|
|
697
|
+
this.piTarget += t.slice(e, this.prevI);
|
|
698
|
+
const s = o === Ze;
|
|
699
|
+
s || Pe(o) ? "xml" === this.piTarget ? (this.xmlDeclPossible || this.fail("an XML declaration must be at the start of the document."), this.state = s ? qe : 27) : this.state = s ? 26 : 25 : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(o));
|
|
700
|
+
break;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
sPIBody() {
|
|
705
|
+
if (0 === this.text.length) {
|
|
706
|
+
const t = this.getCodeNorm();
|
|
707
|
+
t === Ze ? this.state = 26 : Pe(t) || (this.text = String.fromCodePoint(t));
|
|
708
|
+
} else this.captureToChar(Ze) && (this.state = 26);
|
|
709
|
+
}
|
|
710
|
+
sPIEnding() {
|
|
711
|
+
const t = this.getCodeNorm();
|
|
712
|
+
if (t === Je) {
|
|
713
|
+
const { piTarget: t } = this;
|
|
714
|
+
"xml" === t.toLowerCase() && this.fail("the XML declaration must appear at the start of the document."), this.piHandler?.({
|
|
715
|
+
target: t,
|
|
716
|
+
body: this.text
|
|
717
|
+
}), this.piTarget = this.text = "", this.state = Xe;
|
|
718
|
+
} else t === Ze ? this.text += "?" : (this.text += `?${String.fromCodePoint(t)}`, this.state = 25);
|
|
719
|
+
this.xmlDeclPossible = !1;
|
|
720
|
+
}
|
|
721
|
+
sXMLDeclNameStart() {
|
|
722
|
+
const t = this.skipSpaces();
|
|
723
|
+
t !== Ze ? t !== We && (this.state = 28, this.name = String.fromCodePoint(t)) : this.state = qe;
|
|
724
|
+
}
|
|
725
|
+
sXMLDeclName() {
|
|
726
|
+
const t = this.captureTo(so);
|
|
727
|
+
if (t === Ze) return this.state = qe, this.name += this.text, this.text = "", void this.fail("XML declaration is incomplete.");
|
|
728
|
+
if (Pe(t) || t === Ke) {
|
|
729
|
+
if (this.name += this.text, this.text = "", !this.xmlDeclExpects.includes(this.name)) switch (this.name.length) {
|
|
730
|
+
case 0:
|
|
731
|
+
this.fail("did not expect any more name/value pairs.");
|
|
732
|
+
break;
|
|
733
|
+
case 1:
|
|
734
|
+
this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);
|
|
735
|
+
break;
|
|
736
|
+
default: this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`);
|
|
737
|
+
}
|
|
738
|
+
this.state = t === Ke ? 30 : 29;
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
sXMLDeclEq() {
|
|
742
|
+
const t = this.getCodeNorm();
|
|
743
|
+
if (t === Ze) return this.state = qe, void this.fail("XML declaration is incomplete.");
|
|
744
|
+
Pe(t) || (t !== Ke && this.fail("value required."), this.state = 30);
|
|
745
|
+
}
|
|
746
|
+
sXMLDeclValueStart() {
|
|
747
|
+
const t = this.getCodeNorm();
|
|
748
|
+
if (t === Ze) return this.state = qe, void this.fail("XML declaration is incomplete.");
|
|
749
|
+
Pe(t) || (Ye(t) ? this.q = t : (this.fail("value must be quoted."), this.q = 32), this.state = 31);
|
|
750
|
+
}
|
|
751
|
+
sXMLDeclValue() {
|
|
752
|
+
const t = this.captureTo([this.q, Ze]);
|
|
753
|
+
if (t === Ze) return this.state = qe, this.text = "", void this.fail("XML declaration is incomplete.");
|
|
754
|
+
if (t === We) return;
|
|
755
|
+
const e = this.text;
|
|
756
|
+
switch (this.text = "", this.name) {
|
|
757
|
+
case "version": {
|
|
758
|
+
this.xmlDeclExpects = ["encoding", "standalone"];
|
|
759
|
+
const t = e;
|
|
760
|
+
this.xmlDecl.version = t, /^1\.[0-9]+$/.test(t) ? this.opt.forceXMLVersion || this.setXMLVersion(t) : this.fail("version number must match /^1\\.[0-9]+$/.");
|
|
761
|
+
break;
|
|
762
|
+
}
|
|
763
|
+
case "encoding":
|
|
764
|
+
/^[A-Za-z][A-Za-z0-9._-]*$/.test(e) || this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."), this.xmlDeclExpects = ["standalone"], this.xmlDecl.encoding = e;
|
|
765
|
+
break;
|
|
766
|
+
case "standalone": "yes" !== e && "no" !== e && this.fail("standalone value must match \"yes\" or \"no\"."), this.xmlDeclExpects = [], this.xmlDecl.standalone = e;
|
|
767
|
+
}
|
|
768
|
+
this.name = "", this.state = 32;
|
|
769
|
+
}
|
|
770
|
+
sXMLDeclSeparator() {
|
|
771
|
+
const t = this.getCodeNorm();
|
|
772
|
+
t !== Ze ? (Pe(t) || (this.fail("whitespace required."), this.unGet()), this.state = 27) : this.state = qe;
|
|
773
|
+
}
|
|
774
|
+
sXMLDeclEnding() {
|
|
775
|
+
this.getCodeNorm() === Je ? ("xml" !== this.piTarget ? this.fail("processing instructions are not allowed before root.") : "version" !== this.name && this.xmlDeclExpects.includes("version") && this.fail("XML declaration must contain a version."), this.xmlDeclHandler?.(this.xmlDecl), this.name = "", this.piTarget = this.text = "", this.state = Xe) : this.fail("The character ? is disallowed anywhere in XML declarations."), this.xmlDeclPossible = !1;
|
|
776
|
+
}
|
|
777
|
+
sOpenTag() {
|
|
778
|
+
const t = this.captureNameChars();
|
|
779
|
+
if (t === We) return;
|
|
780
|
+
const e = this.tag = {
|
|
781
|
+
name: this.name,
|
|
782
|
+
attributes: Object.create(null)
|
|
783
|
+
};
|
|
784
|
+
switch (this.name = "", this.xmlnsOpt && (this.topNS = e.ns = Object.create(null)), this.openTagStartHandler?.(e), this.sawRoot = !0, !this.fragmentOpt && this.closedRoot && this.fail("documents may contain only one root."), t) {
|
|
785
|
+
case Je:
|
|
786
|
+
this.openTag();
|
|
787
|
+
break;
|
|
788
|
+
case 47:
|
|
789
|
+
this.state = 35;
|
|
790
|
+
break;
|
|
791
|
+
default: Pe(t) || this.fail("disallowed character in tag name."), this.state = 36;
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
sOpenTagSlash() {
|
|
795
|
+
this.getCode() === Je ? this.openSelfClosingTag() : (this.fail("forward-slash in opening tag not followed by >."), this.state = 36);
|
|
796
|
+
}
|
|
797
|
+
sAttrib() {
|
|
798
|
+
const t = this.skipSpaces();
|
|
799
|
+
t !== We && (De(t) ? (this.unGet(), this.state = 37) : t === Je ? this.openTag() : 47 === t ? this.state = 35 : this.fail("disallowed character in attribute name."));
|
|
800
|
+
}
|
|
801
|
+
sAttribName() {
|
|
802
|
+
const t = this.captureNameChars();
|
|
803
|
+
t === Ke ? this.state = 39 : Pe(t) ? this.state = 38 : t === Je ? (this.fail("attribute without value."), this.pushAttrib(this.name, this.name), this.name = this.text = "", this.openTag()) : t !== We && this.fail("disallowed character in attribute name.");
|
|
804
|
+
}
|
|
805
|
+
sAttribNameSawWhite() {
|
|
806
|
+
const t = this.skipSpaces();
|
|
807
|
+
switch (t) {
|
|
808
|
+
case We: return;
|
|
809
|
+
case Ke:
|
|
810
|
+
this.state = 39;
|
|
811
|
+
break;
|
|
812
|
+
default: this.fail("attribute without value."), this.text = "", this.name = "", t === Je ? this.openTag() : De(t) ? (this.unGet(), this.state = 37) : (this.fail("disallowed character in attribute name."), this.state = 36);
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
sAttribValue() {
|
|
816
|
+
const t = this.getCodeNorm();
|
|
817
|
+
Ye(t) ? (this.q = t, this.state = 40) : Pe(t) || (this.fail("unquoted attribute value."), this.state = 42, this.unGet());
|
|
818
|
+
}
|
|
819
|
+
sAttribValueQuoted() {
|
|
820
|
+
const { q: t, chunk: e } = this;
|
|
821
|
+
let { i: o } = this;
|
|
822
|
+
for (;;) switch (this.getCode()) {
|
|
823
|
+
case t:
|
|
824
|
+
this.pushAttrib(this.name, this.text + e.slice(o, this.prevI)), this.name = this.text = "", this.q = null, this.state = 41;
|
|
825
|
+
return;
|
|
826
|
+
case 38:
|
|
827
|
+
this.text += e.slice(o, this.prevI), this.state = 14, this.entityReturnState = 40;
|
|
828
|
+
return;
|
|
829
|
+
case Ue:
|
|
830
|
+
case ze:
|
|
831
|
+
case 9:
|
|
832
|
+
this.text += `${e.slice(o, this.prevI)} `, o = this.i;
|
|
833
|
+
break;
|
|
834
|
+
case Ge:
|
|
835
|
+
this.text += e.slice(o, this.prevI), this.fail("disallowed character.");
|
|
836
|
+
return;
|
|
837
|
+
case We:
|
|
838
|
+
this.text += e.slice(o);
|
|
839
|
+
return;
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
sAttribValueClosed() {
|
|
843
|
+
const t = this.getCodeNorm();
|
|
844
|
+
Pe(t) ? this.state = 36 : t === Je ? this.openTag() : 47 === t ? this.state = 35 : De(t) ? (this.fail("no whitespace between attributes."), this.unGet(), this.state = 37) : this.fail("disallowed character in attribute name.");
|
|
845
|
+
}
|
|
846
|
+
sAttribValueUnquoted() {
|
|
847
|
+
const t = this.captureTo(ro);
|
|
848
|
+
switch (t) {
|
|
849
|
+
case 38:
|
|
850
|
+
this.state = 14, this.entityReturnState = 42;
|
|
851
|
+
break;
|
|
852
|
+
case Ge:
|
|
853
|
+
this.fail("disallowed character.");
|
|
854
|
+
break;
|
|
855
|
+
case We: break;
|
|
856
|
+
default: this.text.includes("]]>") && this.fail("the string \"]]>\" is disallowed in char data."), this.pushAttrib(this.name, this.text), this.name = this.text = "", t === Je ? this.openTag() : this.state = 36;
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
sCloseTag() {
|
|
860
|
+
const t = this.captureNameChars();
|
|
861
|
+
t === Je ? this.closeTag() : Pe(t) ? this.state = 44 : t !== We && this.fail("disallowed character in closing tag.");
|
|
862
|
+
}
|
|
863
|
+
sCloseTagSawWhite() {
|
|
864
|
+
switch (this.skipSpaces()) {
|
|
865
|
+
case Je:
|
|
866
|
+
this.closeTag();
|
|
867
|
+
break;
|
|
868
|
+
case We: break;
|
|
869
|
+
default: this.fail("disallowed character in closing tag.");
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
handleTextInRoot() {
|
|
873
|
+
let { i: t, forbiddenState: e } = this;
|
|
874
|
+
const { chunk: o, textHandler: s } = this;
|
|
875
|
+
t: for (;;) switch (this.getCode()) {
|
|
876
|
+
case Ge:
|
|
877
|
+
if (this.state = 15, void 0 !== s) {
|
|
878
|
+
const { text: e } = this, r = o.slice(t, this.prevI);
|
|
879
|
+
0 !== e.length ? (s(e + r), this.text = "") : 0 !== r.length && s(r);
|
|
880
|
+
}
|
|
881
|
+
e = 0;
|
|
882
|
+
break t;
|
|
883
|
+
case 38:
|
|
884
|
+
this.state = 14, this.entityReturnState = Xe, void 0 !== s && (this.text += o.slice(t, this.prevI)), e = 0;
|
|
885
|
+
break t;
|
|
886
|
+
case Qe:
|
|
887
|
+
switch (e) {
|
|
888
|
+
case 0:
|
|
889
|
+
e = 1;
|
|
890
|
+
break;
|
|
891
|
+
case 1:
|
|
892
|
+
e = 2;
|
|
893
|
+
break;
|
|
894
|
+
case 2: break;
|
|
895
|
+
default: throw new Error("impossible state");
|
|
896
|
+
}
|
|
897
|
+
break;
|
|
898
|
+
case Je:
|
|
899
|
+
2 === e && this.fail("the string \"]]>\" is disallowed in char data."), e = 0;
|
|
900
|
+
break;
|
|
901
|
+
case ze:
|
|
902
|
+
void 0 !== s && (this.text += `${o.slice(t, this.prevI)}\n`), t = this.i, e = 0;
|
|
903
|
+
break;
|
|
904
|
+
case We:
|
|
905
|
+
void 0 !== s && (this.text += o.slice(t));
|
|
906
|
+
break t;
|
|
907
|
+
default: e = 0;
|
|
908
|
+
}
|
|
909
|
+
this.forbiddenState = e;
|
|
910
|
+
}
|
|
911
|
+
handleTextOutsideRoot() {
|
|
912
|
+
let { i: t } = this;
|
|
913
|
+
const { chunk: e, textHandler: o } = this;
|
|
914
|
+
let s = !1;
|
|
915
|
+
t: for (;;) {
|
|
916
|
+
const r = this.getCode();
|
|
917
|
+
switch (r) {
|
|
918
|
+
case Ge:
|
|
919
|
+
if (this.state = 15, void 0 !== o) {
|
|
920
|
+
const { text: s } = this, r = e.slice(t, this.prevI);
|
|
921
|
+
0 !== s.length ? (o(s + r), this.text = "") : 0 !== r.length && o(r);
|
|
922
|
+
}
|
|
923
|
+
break t;
|
|
924
|
+
case 38:
|
|
925
|
+
this.state = 14, this.entityReturnState = Xe, void 0 !== o && (this.text += e.slice(t, this.prevI)), s = !0;
|
|
926
|
+
break t;
|
|
927
|
+
case ze:
|
|
928
|
+
void 0 !== o && (this.text += `${e.slice(t, this.prevI)}\n`), t = this.i;
|
|
929
|
+
break;
|
|
930
|
+
case We:
|
|
931
|
+
void 0 !== o && (this.text += e.slice(t));
|
|
932
|
+
break t;
|
|
933
|
+
default: Pe(r) || (s = !0);
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
s && (this.sawRoot || this.reportedTextBeforeRoot || (this.fail("text data outside of root node."), this.reportedTextBeforeRoot = !0), this.closedRoot && !this.reportedTextAfterRoot && (this.fail("text data outside of root node."), this.reportedTextAfterRoot = !0));
|
|
937
|
+
}
|
|
938
|
+
pushAttribNS(t, e) {
|
|
939
|
+
const { prefix: o, local: s } = this.qName(t), r = {
|
|
940
|
+
name: t,
|
|
941
|
+
prefix: o,
|
|
942
|
+
local: s,
|
|
943
|
+
value: e
|
|
944
|
+
};
|
|
945
|
+
if (this.attribList.push(r), this.attributeHandler?.(r), "xmlns" === o) {
|
|
946
|
+
const t = e.trim();
|
|
947
|
+
"1.0" === this.currentXMLVersion && "" === t && this.fail("invalid attempt to undefine prefix in XML 1.0"), this.topNS[s] = t, no(this, s, t);
|
|
948
|
+
} else if ("xmlns" === t) {
|
|
949
|
+
const t = e.trim();
|
|
950
|
+
this.topNS[""] = t, no(this, "", t);
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
pushAttribPlain(t, e) {
|
|
954
|
+
const o = {
|
|
955
|
+
name: t,
|
|
956
|
+
value: e
|
|
957
|
+
};
|
|
958
|
+
this.attribList.push(o), this.attributeHandler?.(o);
|
|
959
|
+
}
|
|
960
|
+
end() {
|
|
961
|
+
this.sawRoot || this.fail("document must contain a root element.");
|
|
962
|
+
const { tags: t } = this;
|
|
963
|
+
for (; t.length > 0;) {
|
|
964
|
+
const e = t.pop();
|
|
965
|
+
this.fail(`unclosed tag: ${e.name}`);
|
|
966
|
+
}
|
|
967
|
+
0 !== this.state && this.state !== Xe && this.fail("unexpected end.");
|
|
968
|
+
const { text: e } = this;
|
|
969
|
+
return 0 !== e.length && (this.textHandler?.(e), this.text = ""), this._closed = !0, this.endHandler?.(), this._init(), this;
|
|
970
|
+
}
|
|
971
|
+
resolve(t) {
|
|
972
|
+
let e = this.topNS[t];
|
|
973
|
+
if (void 0 !== e) return e;
|
|
974
|
+
const { tags: o } = this;
|
|
975
|
+
for (let s = o.length - 1; s >= 0; s--) if (e = o[s].ns[t], void 0 !== e) return e;
|
|
976
|
+
return e = this.ns[t], void 0 !== e ? e : this.opt.resolvePrefix?.(t);
|
|
977
|
+
}
|
|
978
|
+
qName(t) {
|
|
979
|
+
const e = t.indexOf(":");
|
|
980
|
+
if (-1 === e) return {
|
|
981
|
+
prefix: "",
|
|
982
|
+
local: t
|
|
983
|
+
};
|
|
984
|
+
const o = t.slice(e + 1), s = t.slice(0, e);
|
|
985
|
+
return ("" === s || "" === o || o.includes(":")) && this.fail(`malformed name: ${t}.`), {
|
|
986
|
+
prefix: s,
|
|
987
|
+
local: o
|
|
988
|
+
};
|
|
989
|
+
}
|
|
990
|
+
processAttribsNS() {
|
|
991
|
+
const { attribList: t } = this, e = this.tag;
|
|
992
|
+
{
|
|
993
|
+
const { prefix: t, local: o } = this.qName(e.name);
|
|
994
|
+
e.prefix = t, e.local = o;
|
|
995
|
+
const s = e.uri = this.resolve(t) ?? "";
|
|
996
|
+
"" !== t && ("xmlns" === t && this.fail("tags may not have \"xmlns\" as prefix."), "" === s && (this.fail(`unbound namespace prefix: ${JSON.stringify(t)}.`), e.uri = t));
|
|
997
|
+
}
|
|
998
|
+
if (0 === t.length) return;
|
|
999
|
+
const { attributes: o } = e, s = /* @__PURE__ */ new Set();
|
|
1000
|
+
for (const e of t) {
|
|
1001
|
+
const { name: t, prefix: r, local: n } = e;
|
|
1002
|
+
let i, a;
|
|
1003
|
+
"" === r ? (i = "xmlns" === t ? Be : "", a = t) : (i = this.resolve(r), void 0 === i && (this.fail(`unbound namespace prefix: ${JSON.stringify(r)}.`), i = r), a = `{${i}}${n}`), s.has(a) && this.fail(`duplicate attribute: ${a}.`), s.add(a), e.uri = i, o[t] = e;
|
|
1004
|
+
}
|
|
1005
|
+
this.attribList = [];
|
|
1006
|
+
}
|
|
1007
|
+
processAttribsPlain() {
|
|
1008
|
+
const { attribList: t } = this, e = this.tag.attributes;
|
|
1009
|
+
for (const { name: o, value: s } of t) void 0 !== e[o] && this.fail(`duplicate attribute: ${o}.`), e[o] = s;
|
|
1010
|
+
this.attribList = [];
|
|
1011
|
+
}
|
|
1012
|
+
openTag() {
|
|
1013
|
+
this.processAttribs();
|
|
1014
|
+
const { tags: t } = this, e = this.tag;
|
|
1015
|
+
e.isSelfClosing = !1, this.openTagHandler?.(e), t.push(e), this.state = Xe, this.name = "";
|
|
1016
|
+
}
|
|
1017
|
+
openSelfClosingTag() {
|
|
1018
|
+
this.processAttribs();
|
|
1019
|
+
const { tags: t } = this, e = this.tag;
|
|
1020
|
+
e.isSelfClosing = !0, this.openTagHandler?.(e), this.closeTagHandler?.(e), null === (this.tag = t[t.length - 1] ?? null) && (this.closedRoot = !0), this.state = Xe, this.name = "";
|
|
1021
|
+
}
|
|
1022
|
+
closeTag() {
|
|
1023
|
+
const { tags: t, name: e } = this;
|
|
1024
|
+
if (this.state = Xe, this.name = "", "" === e) return this.fail("weird empty close tag."), void (this.text += "</>");
|
|
1025
|
+
const o = this.closeTagHandler;
|
|
1026
|
+
let s = t.length;
|
|
1027
|
+
for (; s-- > 0;) {
|
|
1028
|
+
const s = this.tag = t.pop();
|
|
1029
|
+
if (this.topNS = s.ns, o?.(s), s.name === e) break;
|
|
1030
|
+
this.fail(`unexpected close tag: ${e}.`);
|
|
1031
|
+
}
|
|
1032
|
+
0 === s ? this.closedRoot = !0 : s < 0 && (this.fail(`unmatched closing tag: ${e}.`), this.text += `</${e}>`);
|
|
1033
|
+
}
|
|
1034
|
+
parseEntity(t) {
|
|
1035
|
+
if ("#" !== t[0]) {
|
|
1036
|
+
const e = this.ENTITIES[t];
|
|
1037
|
+
return void 0 !== e ? e : (this.fail(this.isName(t) ? "undefined entity." : "disallowed character in entity name."), `&${t};`);
|
|
1038
|
+
}
|
|
1039
|
+
let e = NaN;
|
|
1040
|
+
return "x" === t[1] && /^#x[0-9a-f]+$/i.test(t) ? e = parseInt(t.slice(2), 16) : /^#[0-9]+$/.test(t) && (e = parseInt(t.slice(1), 10)), this.isChar(e) ? String.fromCodePoint(e) : (this.fail("malformed character entity."), `&${t};`);
|
|
1041
|
+
}
|
|
1042
|
+
}, ho = /&(#x[0-9a-fA-F]+|#[0-9]+|amp|lt|gt|quot|apos);/g, uo = {
|
|
1043
|
+
amp: "&",
|
|
1044
|
+
lt: "<",
|
|
1045
|
+
gt: ">",
|
|
1046
|
+
quot: "\"",
|
|
1047
|
+
apos: "'"
|
|
1048
|
+
}, po = (t, e) => {
|
|
1049
|
+
const o = uo[e];
|
|
1050
|
+
if (void 0 !== o) return o;
|
|
1051
|
+
const s = 120 === e.charCodeAt(1) ? parseInt(e.slice(2), 16) : parseInt(e.slice(1), 10);
|
|
1052
|
+
return s > 0 && s <= 1114111 ? String.fromCodePoint(s) : t;
|
|
1053
|
+
}, fo = (t) => {
|
|
1054
|
+
let e = t;
|
|
1055
|
+
return -1 !== e.indexOf("\r") && (e = e.replace(/\r\n?/g, "\n")), -1 !== e.indexOf("&") && (e = e.replace(ho, po)), e;
|
|
1056
|
+
}, go = (t) => {
|
|
1057
|
+
let e = t;
|
|
1058
|
+
const o = e.length;
|
|
1059
|
+
for (let t = 0; t < o; t++) {
|
|
1060
|
+
const o = e.charCodeAt(t);
|
|
1061
|
+
if (9 === o || 10 === o || 13 === o) {
|
|
1062
|
+
e = e.replace(/\r\n|[\t\n\r]/g, " ");
|
|
1063
|
+
break;
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
return -1 !== e.indexOf("&") && (e = e.replace(ho, po)), e;
|
|
1067
|
+
}, mo = (t) => 32 === t || 9 === t || 10 === t || 13 === t, bo = class t {
|
|
1068
|
+
constructor() {
|
|
1069
|
+
this._openTagHandler = void 0, this._closeTagHandler = void 0, this._textHandler = void 0, this._cdataHandler = void 0, this._errorHandler = void 0, this._endHandler = void 0, this._scanners = null, this._carry = "", this._text = "", this._tags = [], this._sawRoot = !1, this._closed = !1;
|
|
1070
|
+
}
|
|
1071
|
+
static {
|
|
1072
|
+
this.NEED_MORE = -1;
|
|
1073
|
+
}
|
|
1074
|
+
static {
|
|
1075
|
+
this.NOT_HANDLED = -2;
|
|
1076
|
+
}
|
|
1077
|
+
static decodeText(t) {
|
|
1078
|
+
return fo(t);
|
|
1079
|
+
}
|
|
1080
|
+
on(t, e) {
|
|
1081
|
+
switch (t) {
|
|
1082
|
+
case "opentag":
|
|
1083
|
+
this._openTagHandler = e;
|
|
1084
|
+
break;
|
|
1085
|
+
case "closetag":
|
|
1086
|
+
this._closeTagHandler = e;
|
|
1087
|
+
break;
|
|
1088
|
+
case "text":
|
|
1089
|
+
this._textHandler = e;
|
|
1090
|
+
break;
|
|
1091
|
+
case "cdata":
|
|
1092
|
+
this._cdataHandler = e;
|
|
1093
|
+
break;
|
|
1094
|
+
case "error":
|
|
1095
|
+
this._errorHandler = e;
|
|
1096
|
+
break;
|
|
1097
|
+
case "end": this._endHandler = e;
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
setElementScanners(t) {
|
|
1101
|
+
if (!t || 0 === t.length) return void (this._scanners = null);
|
|
1102
|
+
const e = new Array(128);
|
|
1103
|
+
for (const o of t) {
|
|
1104
|
+
const t = o.name.charCodeAt(0);
|
|
1105
|
+
if (!(t < 128) || void 0 !== e[t]) throw new Error(`Element scanner '${o.name}' needs an ASCII first character no other scanner uses.`);
|
|
1106
|
+
e[t] = o;
|
|
1107
|
+
}
|
|
1108
|
+
this._scanners = e;
|
|
1109
|
+
}
|
|
1110
|
+
fail(t) {
|
|
1111
|
+
const e = new Error(t), o = this._errorHandler;
|
|
1112
|
+
if (void 0 === o) throw e;
|
|
1113
|
+
o(e);
|
|
1114
|
+
}
|
|
1115
|
+
write(t) {
|
|
1116
|
+
if (this._closed) return this.fail("cannot write after close."), this;
|
|
1117
|
+
let e = t;
|
|
1118
|
+
0 !== this._carry.length && (e = this._carry + t, this._carry = "");
|
|
1119
|
+
const o = e.length;
|
|
1120
|
+
let s = 0;
|
|
1121
|
+
for (; s < o;) {
|
|
1122
|
+
const t = e.indexOf("<", s);
|
|
1123
|
+
if (-1 === t) return this._text += e.slice(s), this;
|
|
1124
|
+
t > s && (this._text += e.slice(s, t));
|
|
1125
|
+
const r = this._markup(e, t, o);
|
|
1126
|
+
if (-1 === r) return this._carry = e.slice(t), this;
|
|
1127
|
+
s = r;
|
|
1128
|
+
}
|
|
1129
|
+
return this;
|
|
1130
|
+
}
|
|
1131
|
+
close() {
|
|
1132
|
+
0 !== this._carry.length && (this.fail("unexpected end."), this._carry = ""), this._sawRoot || this.fail("document must contain a root element.");
|
|
1133
|
+
const t = this._tags;
|
|
1134
|
+
for (; t.length > 0;) {
|
|
1135
|
+
const e = t.pop();
|
|
1136
|
+
this.fail(`unclosed tag: ${e.name}`);
|
|
1137
|
+
}
|
|
1138
|
+
return this._flushText(), this._closed = !0, this._endHandler?.(), this;
|
|
1139
|
+
}
|
|
1140
|
+
_flushText() {
|
|
1141
|
+
const t = this._text;
|
|
1142
|
+
if (0 === t.length) return;
|
|
1143
|
+
this._text = "";
|
|
1144
|
+
const e = this._textHandler;
|
|
1145
|
+
void 0 !== e && 0 !== this._tags.length && e(fo(t));
|
|
1146
|
+
}
|
|
1147
|
+
_markup(e, o, s) {
|
|
1148
|
+
if (o + 1 >= s) return -1;
|
|
1149
|
+
const r = e.charCodeAt(o + 1);
|
|
1150
|
+
if (47 === r) {
|
|
1151
|
+
const t = e.indexOf(">", o + 2);
|
|
1152
|
+
return -1 === t ? -1 : (this._flushText(), this._closeTag(e.slice(o + 2, t).trimEnd()), t + 1);
|
|
1153
|
+
}
|
|
1154
|
+
if (63 === r) {
|
|
1155
|
+
const t = e.indexOf("?>", o + 2);
|
|
1156
|
+
return -1 === t ? -1 : t + 2;
|
|
1157
|
+
}
|
|
1158
|
+
if (33 === r) {
|
|
1159
|
+
if (o + 4 > s) return -1;
|
|
1160
|
+
if (45 === e.charCodeAt(o + 2) && 45 === e.charCodeAt(o + 3)) {
|
|
1161
|
+
const t = e.indexOf("-->", o + 4);
|
|
1162
|
+
return -1 === t ? -1 : t + 3;
|
|
1163
|
+
}
|
|
1164
|
+
if (o + 9 > s) return -1;
|
|
1165
|
+
if (e.startsWith("[CDATA[", o + 2)) {
|
|
1166
|
+
const t = e.indexOf("]]>", o + 9);
|
|
1167
|
+
return -1 === t ? -1 : (this._flushText(), this._cdataHandler?.(e.slice(o + 9, t)), t + 3);
|
|
1168
|
+
}
|
|
1169
|
+
const t = e.indexOf("[", o + 2), r = e.indexOf(">", o + 2);
|
|
1170
|
+
if (-1 === r) return -1;
|
|
1171
|
+
if (-1 !== t && t < r) {
|
|
1172
|
+
const o = e.indexOf("]>", t);
|
|
1173
|
+
return -1 === o ? -1 : o + 2;
|
|
1174
|
+
}
|
|
1175
|
+
return r + 1;
|
|
1176
|
+
}
|
|
1177
|
+
const n = this._scanners;
|
|
1178
|
+
if (null !== n) {
|
|
1179
|
+
const i = r < 128 ? n[r] : void 0;
|
|
1180
|
+
if (void 0 !== i && e.startsWith(i.name, o + 1)) {
|
|
1181
|
+
const r = o + 1 + i.name.length;
|
|
1182
|
+
if (r >= s) return -1;
|
|
1183
|
+
const n = e.charCodeAt(r);
|
|
1184
|
+
if (62 === n || 47 === n || mo(n)) {
|
|
1185
|
+
this._flushText();
|
|
1186
|
+
const r = i.scan(e, o, s);
|
|
1187
|
+
if (r !== t.NOT_HANDLED) {
|
|
1188
|
+
if (r !== t.NEED_MORE) {
|
|
1189
|
+
this._sawRoot = !0;
|
|
1190
|
+
const t = i.openTag;
|
|
1191
|
+
void 0 !== t && this._tags.push(t);
|
|
1192
|
+
}
|
|
1193
|
+
return r;
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
return this._openTag(e, o, s);
|
|
1199
|
+
}
|
|
1200
|
+
_openTag(t, e, o) {
|
|
1201
|
+
let s = e + 1, r = 0;
|
|
1202
|
+
for (; s < o && (r = t.charCodeAt(s), 62 !== r && 47 !== r && !mo(r));) s++;
|
|
1203
|
+
if (s >= o) return -1;
|
|
1204
|
+
const n = t.slice(e + 1, s), i = {};
|
|
1205
|
+
let a = !1;
|
|
1206
|
+
for (;;) {
|
|
1207
|
+
for (; s < o && mo(r = t.charCodeAt(s));) s++;
|
|
1208
|
+
if (s >= o) return -1;
|
|
1209
|
+
if (62 === r) {
|
|
1210
|
+
s++;
|
|
1211
|
+
break;
|
|
1212
|
+
}
|
|
1213
|
+
if (47 === r) {
|
|
1214
|
+
if (s + 1 >= o) return -1;
|
|
1215
|
+
if (62 !== t.charCodeAt(s + 1)) {
|
|
1216
|
+
this.fail("forward-slash in opening tag not followed by >."), s++;
|
|
1217
|
+
continue;
|
|
1218
|
+
}
|
|
1219
|
+
a = !0, s += 2;
|
|
1220
|
+
break;
|
|
1221
|
+
}
|
|
1222
|
+
const e = s;
|
|
1223
|
+
for (; s < o && (r = t.charCodeAt(s), 61 !== r && 62 !== r && 47 !== r && !mo(r));) s++;
|
|
1224
|
+
if (s >= o) return -1;
|
|
1225
|
+
const n = t.slice(e, s);
|
|
1226
|
+
for (; s < o && mo(r = t.charCodeAt(s));) s++;
|
|
1227
|
+
if (s >= o) return -1;
|
|
1228
|
+
if (61 !== r) {
|
|
1229
|
+
this.fail("attribute without value.");
|
|
1230
|
+
continue;
|
|
1231
|
+
}
|
|
1232
|
+
for (s++; s < o && mo(r = t.charCodeAt(s));) s++;
|
|
1233
|
+
if (s >= o) return -1;
|
|
1234
|
+
if (34 !== r && 39 !== r) {
|
|
1235
|
+
this.fail("unquoted attribute value.");
|
|
1236
|
+
continue;
|
|
1237
|
+
}
|
|
1238
|
+
const l = t.indexOf(34 === r ? "\"" : "'", s + 1);
|
|
1239
|
+
if (-1 === l) return -1;
|
|
1240
|
+
"__proto__" !== n && (i[n] = go(t.slice(s + 1, l))), s = l + 1;
|
|
1241
|
+
}
|
|
1242
|
+
this._flushText(), this._sawRoot = !0;
|
|
1243
|
+
const l = {
|
|
1244
|
+
name: n,
|
|
1245
|
+
attributes: i,
|
|
1246
|
+
isSelfClosing: a
|
|
1247
|
+
};
|
|
1248
|
+
return this._openTagHandler?.(l), a ? this._closeTagHandler?.(l) : this._tags.push(l), s;
|
|
1249
|
+
}
|
|
1250
|
+
_closeTag(t) {
|
|
1251
|
+
if ("" === t) return void this.fail("weird empty close tag.");
|
|
1252
|
+
const e = this._tags, o = this._closeTagHandler;
|
|
1253
|
+
let s = e.length;
|
|
1254
|
+
for (; s-- > 0;) {
|
|
1255
|
+
const s = e.pop();
|
|
1256
|
+
if (o?.(s), s.name === t) return;
|
|
1257
|
+
this.fail(`unexpected close tag: ${t}.`);
|
|
1258
|
+
}
|
|
1259
|
+
this.fail(`unmatched closing tag: ${t}.`);
|
|
1260
|
+
}
|
|
1261
|
+
};
|
|
1262
|
+
(function(t) {
|
|
1263
|
+
t.Events = {
|
|
1264
|
+
XmlDecl: "xmldecl",
|
|
1265
|
+
Text: "text",
|
|
1266
|
+
ProcessingInstruction: "processinginstruction",
|
|
1267
|
+
Doctype: "doctype",
|
|
1268
|
+
Comment: "comment",
|
|
1269
|
+
OpenTagStart: "opentagstart",
|
|
1270
|
+
Attribute: "attribute",
|
|
1271
|
+
OpenTag: "opentag",
|
|
1272
|
+
CloseTag: "closetag",
|
|
1273
|
+
CDdata: "cdata",
|
|
1274
|
+
Error: "error",
|
|
1275
|
+
End: "end",
|
|
1276
|
+
Ready: "ready"
|
|
1277
|
+
}, t.parseStream = async (t, e, o) => {
|
|
1278
|
+
if (o?.lean) return (async (t, e) => {
|
|
1279
|
+
const o = new bo();
|
|
1280
|
+
let s;
|
|
1281
|
+
e.elementScanners && o.setElementScanners(e.elementScanners), e.onOpenTag && o.on("opentag", e.onOpenTag), e.onCloseTag && o.on("closetag", e.onCloseTag), e.onText && o.on("text", e.onText), e.onError && o.on("error", e.onError);
|
|
1282
|
+
const r = e.onEnd;
|
|
1283
|
+
for (r && o.on("end", () => {
|
|
1284
|
+
s = r();
|
|
1285
|
+
});;) {
|
|
1286
|
+
const { value: e, done: s } = await t.read();
|
|
1287
|
+
if (s) break;
|
|
1288
|
+
o.write(e);
|
|
1289
|
+
}
|
|
1290
|
+
return o.close(), s;
|
|
1291
|
+
})(t, e);
|
|
1292
|
+
const s = new co({
|
|
1293
|
+
position: !1,
|
|
1294
|
+
...o
|
|
1295
|
+
});
|
|
1296
|
+
let r;
|
|
1297
|
+
e.onOpenTagStart && s.on(Ie.Events.OpenTagStart, e.onOpenTagStart), e.onOpenTag && s.on(Ie.Events.OpenTag, e.onOpenTag), e.onCloseTag && s.on(Ie.Events.CloseTag, e.onCloseTag), e.onAttribute && s.on(Ie.Events.Attribute, e.onAttribute), e.onText && s.on(Ie.Events.Text, e.onText), e.onError && s.on(Ie.Events.Error, e.onError);
|
|
1298
|
+
const n = e.onEnd;
|
|
1299
|
+
if (n) {
|
|
1300
|
+
const t = () => {
|
|
1301
|
+
r = n();
|
|
1302
|
+
};
|
|
1303
|
+
s.on(Ie.Events.End, t);
|
|
1304
|
+
}
|
|
1305
|
+
for (;;) {
|
|
1306
|
+
const { value: e, done: o } = await t.read();
|
|
1307
|
+
if (o) break;
|
|
1308
|
+
s.write(e);
|
|
1309
|
+
}
|
|
1310
|
+
return s.close(), r;
|
|
1311
|
+
};
|
|
1312
|
+
})(Ie || (Ie = {}));
|
|
1313
|
+
var yo = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t && "0" !== t && "off" !== t && "false" !== t && null, vo = (t) => {
|
|
1314
|
+
const e = parseInt(t);
|
|
1315
|
+
return isNaN(e) ? null : e;
|
|
1316
|
+
}, xo = (t) => {
|
|
1317
|
+
const e = parseFloat(t);
|
|
1318
|
+
return isNaN(e) ? null : e;
|
|
1319
|
+
}, wo = null, To = (t) => t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), So = (t) => To(t).replace(/"/g, """), Co = class {
|
|
1320
|
+
constructor() {
|
|
1321
|
+
this._registeredVisitors = /* @__PURE__ */ new Map();
|
|
1322
|
+
}
|
|
1323
|
+
registerVisitor(t) {
|
|
1324
|
+
this._registeredVisitors.set(t.from, t);
|
|
1325
|
+
}
|
|
1326
|
+
createEventHandler(t, e, o) {
|
|
1327
|
+
const s = this._registeredVisitors, r = [], n = [];
|
|
1328
|
+
let i = null, a = null, l = null, c = null;
|
|
1329
|
+
const h = [], u = {
|
|
1330
|
+
key: null,
|
|
1331
|
+
source: t,
|
|
1332
|
+
parent: null
|
|
1333
|
+
};
|
|
1334
|
+
let d = null, p = !1, f = null, g = null, m = null;
|
|
1335
|
+
const b = (t, e) => {
|
|
1336
|
+
let o = l.attributes[t];
|
|
1337
|
+
if (e) if (Array.isArray(e)) {
|
|
1338
|
+
const t = e.length;
|
|
1339
|
+
for (let s = 0; s < t; s++) {
|
|
1340
|
+
if (null == o) return;
|
|
1341
|
+
if (o = e[s](o), null == o) return;
|
|
1342
|
+
}
|
|
1343
|
+
} else {
|
|
1344
|
+
if (null == o) return;
|
|
1345
|
+
if (o = e(o), null == o) return;
|
|
1346
|
+
}
|
|
1347
|
+
return o;
|
|
1348
|
+
}, y = {
|
|
1349
|
+
getSource: () => d?.source ?? null,
|
|
1350
|
+
setSource: (t) => {
|
|
1351
|
+
d.source = t;
|
|
1352
|
+
},
|
|
1353
|
+
setKey: (t) => {
|
|
1354
|
+
d.key = t;
|
|
1355
|
+
},
|
|
1356
|
+
getFrom: () => l,
|
|
1357
|
+
getAttribute: (t, e) => b(t, e) ?? null,
|
|
1358
|
+
hasAttribute: (t) => null !== y.getAttribute(t),
|
|
1359
|
+
getParent: () => {
|
|
1360
|
+
const t = h[h.length - 2];
|
|
1361
|
+
return t.parent ?? t.source;
|
|
1362
|
+
},
|
|
1363
|
+
getPath: () => {
|
|
1364
|
+
const t = [], e = n.length;
|
|
1365
|
+
for (let o = 0; o < e; o++) t.push(n[o].local);
|
|
1366
|
+
return t.join("\\");
|
|
1367
|
+
},
|
|
1368
|
+
parseAttribute: b,
|
|
1369
|
+
getRawXml: () => m,
|
|
1370
|
+
copyToObject: (t, e, o, s) => {
|
|
1371
|
+
const r = b(s ?? e, o);
|
|
1372
|
+
void 0 !== r && (t[e] = r);
|
|
1373
|
+
},
|
|
1374
|
+
copyTo: (t, e, o) => {
|
|
1375
|
+
const s = b(o ?? t, e);
|
|
1376
|
+
void 0 !== s && (d.source[t] = s);
|
|
1377
|
+
},
|
|
1378
|
+
warn: (t, e) => {
|
|
1379
|
+
o ? o(t, void 0, e?.onceKey) : console.warn(t);
|
|
1380
|
+
}
|
|
1381
|
+
};
|
|
1382
|
+
return {
|
|
1383
|
+
onOpenTag: (t) => {
|
|
1384
|
+
let e = t.name;
|
|
1385
|
+
const o = e.indexOf(":");
|
|
1386
|
+
if (-1 !== o && (e = e.slice(o + 1)), f) return f.push(((t) => {
|
|
1387
|
+
const e = t.attributes ?? {};
|
|
1388
|
+
let o = `<${t.name}`;
|
|
1389
|
+
for (const t in e) {
|
|
1390
|
+
const s = e[t];
|
|
1391
|
+
o += ` ${t}="${So("string" == typeof s ? s : s?.value ?? "")}"`;
|
|
1392
|
+
}
|
|
1393
|
+
return o + ">";
|
|
1394
|
+
})(t)), i = {
|
|
1395
|
+
local: e,
|
|
1396
|
+
tag: t,
|
|
1397
|
+
destination: null
|
|
1398
|
+
}, n.push(i), a = e, void (l = t);
|
|
1399
|
+
const m = (r.length > 0 ? r[r.length - 1] : s).get(e);
|
|
1400
|
+
if (i = {
|
|
1401
|
+
local: e,
|
|
1402
|
+
visitor: m,
|
|
1403
|
+
tag: t,
|
|
1404
|
+
destination: null
|
|
1405
|
+
}, p) return n.push(i), a = e, void (l = t);
|
|
1406
|
+
c = i?.visitor ?? null, a = e, l = t;
|
|
1407
|
+
let b = !!m && null === m.to;
|
|
1408
|
+
if (m && !b && m.scope) {
|
|
1409
|
+
const t = m.scope(y);
|
|
1410
|
+
null === t ? b = !0 : t && (r.push(t), i.pushedScope = !0);
|
|
1411
|
+
}
|
|
1412
|
+
m && (0 === n.length ? (d = u, i.destination = d, i.pushedDestination = !0, h.push(d)) : b ? (d = null, i.destination = null) : m.transparent ? i.destination = d : (d = {
|
|
1413
|
+
key: null,
|
|
1414
|
+
source: {},
|
|
1415
|
+
parent: null
|
|
1416
|
+
}, i.destination = d, i.pushedDestination = !0, h.push(d))), n.push(i), p = b;
|
|
1417
|
+
const v = c?.openTag?.(y);
|
|
1418
|
+
void 0 !== v && (d.parent = v), m?.raw && !b && (f = [], g = i);
|
|
1419
|
+
},
|
|
1420
|
+
onCloseTag: (t) => {
|
|
1421
|
+
let e = t.name;
|
|
1422
|
+
const s = e.indexOf(":");
|
|
1423
|
+
if (-1 !== s && (e = e.slice(s + 1)), e !== a) throw new Error(`mismatch open/close tag: '${e}'/'${a}'`);
|
|
1424
|
+
let b = !1;
|
|
1425
|
+
if (f) {
|
|
1426
|
+
if (n[n.length - 1] !== g) return f.push(`</${t.name}>`), n.pop(), i = n[n.length - 1] ?? null, a = i?.local ?? null, void (l = i?.tag ?? null);
|
|
1427
|
+
m = f.join(""), f = null, g = null, b = !0;
|
|
1428
|
+
}
|
|
1429
|
+
p || c?.closeTag?.(y), b && (m = null);
|
|
1430
|
+
const v = n.pop() ?? null;
|
|
1431
|
+
i = n[n.length - 1] ?? null, v?.pushedScope && r.pop();
|
|
1432
|
+
const x = v?.destination;
|
|
1433
|
+
if (x && v.pushedDestination) {
|
|
1434
|
+
h.pop(), d = h[h.length - 1] ?? u;
|
|
1435
|
+
const t = v.visitor;
|
|
1436
|
+
t && t.to && void 0 !== x.source && (Array.isArray(t.to) ? d.source.push ? d.source.push(x.source) : o?.(`Unable to parse array for ${t.from} at ${y.getPath()}`) : x.key ? d.source[x.key] = x.source : "string" == typeof t.to && (d.source[t.to] = x.source));
|
|
1437
|
+
} else x || (d = h[h.length - 1] ?? u);
|
|
1438
|
+
a = i?.local ?? null, l = i?.tag ?? null, c = i?.visitor ?? null, p = !i?.destination;
|
|
1439
|
+
},
|
|
1440
|
+
onText: (t) => {
|
|
1441
|
+
f ? f.push(To(t)) : c?.text?.(t, y);
|
|
1442
|
+
},
|
|
1443
|
+
onEnd: e
|
|
1444
|
+
};
|
|
1445
|
+
}
|
|
1446
|
+
}, Ao = `IFERROR(${H}(`, ko = Ao.toUpperCase(), Eo = te.toUpperCase(), Io = { kind: "none" }, Po = { kind: "spilled" }, Oo = (t, e) => {
|
|
1447
|
+
if (34 !== t.charCodeAt(e)) return null;
|
|
1448
|
+
let o = "", s = e + 1;
|
|
1449
|
+
for (; s < t.length;) if (34 === t.charCodeAt(s)) {
|
|
1450
|
+
if (34 !== t.charCodeAt(s + 1)) return {
|
|
1451
|
+
value: o,
|
|
1452
|
+
end: s + 1
|
|
1453
|
+
};
|
|
1454
|
+
o += "\"", s += 2;
|
|
1455
|
+
} else o += t[s], s++;
|
|
1456
|
+
return null;
|
|
1457
|
+
}, Do = (t) => {
|
|
1458
|
+
const e = [];
|
|
1459
|
+
let o = 0;
|
|
1460
|
+
for (; o < t.length;) {
|
|
1461
|
+
const s = t.charCodeAt(o);
|
|
1462
|
+
if (34 === s) {
|
|
1463
|
+
const e = Oo(t, o);
|
|
1464
|
+
if (null === e) break;
|
|
1465
|
+
o = e.end;
|
|
1466
|
+
continue;
|
|
1467
|
+
}
|
|
1468
|
+
if (!(s >= 65 && s <= 90 || s >= 97 && s <= 122 || 95 === s)) {
|
|
1469
|
+
o++;
|
|
1470
|
+
continue;
|
|
1471
|
+
}
|
|
1472
|
+
let r = o + 1;
|
|
1473
|
+
for (; r < t.length;) {
|
|
1474
|
+
const e = t.charCodeAt(r);
|
|
1475
|
+
if (!(e >= 65 && e <= 90 || e >= 97 && e <= 122 || e >= 48 && e <= 57 || 95 === e || 46 === e)) break;
|
|
1476
|
+
r++;
|
|
1477
|
+
}
|
|
1478
|
+
40 === t.charCodeAt(r) && e.push(t.slice(o, r).toUpperCase().replace(/^_XLFN\./, "").replace(/^_XLWS\./, "")), o = r;
|
|
1479
|
+
}
|
|
1480
|
+
return e;
|
|
1481
|
+
}, No = class {
|
|
1482
|
+
constructor(t) {
|
|
1483
|
+
this._restored = [], this._byColumn = /* @__PURE__ */ new Map(), this._isKnown = t;
|
|
1484
|
+
}
|
|
1485
|
+
anchor(t, e, o) {
|
|
1486
|
+
const s = this._byColumn.get(e);
|
|
1487
|
+
s && t === s.rowEnd + 1 && t > s.rowStart && (s.closed = !0);
|
|
1488
|
+
const r = Do(o);
|
|
1489
|
+
let n = !0;
|
|
1490
|
+
for (let t = 0; t < r.length && n; t++) n = this._isKnown(r[t]);
|
|
1491
|
+
const i = {
|
|
1492
|
+
rowStart: t,
|
|
1493
|
+
colStart: e,
|
|
1494
|
+
rowEnd: t,
|
|
1495
|
+
colEnd: e,
|
|
1496
|
+
closed: !1,
|
|
1497
|
+
restored: n
|
|
1498
|
+
};
|
|
1499
|
+
return this._byColumn.set(e, i), n && this._restored.push(i), n;
|
|
1500
|
+
}
|
|
1501
|
+
placeholder(t, e) {
|
|
1502
|
+
const o = this._byColumn.get(e);
|
|
1503
|
+
if (o && !o.closed && t > o.rowStart && t <= o.rowEnd + 1 && e >= o.colStart && e <= o.colEnd) return o.rowEnd = t, o.restored;
|
|
1504
|
+
const s = this._byColumn.get(e - 1);
|
|
1505
|
+
return !(!s || s.rowStart !== t || s.colEnd !== e - 1) && (s.colEnd = e, this._byColumn.set(e, s), s.restored);
|
|
1506
|
+
}
|
|
1507
|
+
getFormulaArray() {
|
|
1508
|
+
return this._restored.map((t) => [C.rangeToString(t), "dynamic"]);
|
|
1509
|
+
}
|
|
1510
|
+
}, _o = /^\s*TABLE\s*\(([^()]*)\)\s*$/i, $o = /^\s*(\$?)([A-Za-z]{1,3})(\$?)(\d{1,7})\s*$/, Mo = (t) => {
|
|
1511
|
+
const e = $o.exec(t);
|
|
1512
|
+
if (!e) return null;
|
|
1513
|
+
const o = C.fastStringToCol(e[2]), s = parseInt(e[4], 10) - 1;
|
|
1514
|
+
return o < 0 || s < 0 ? null : {
|
|
1515
|
+
row: s,
|
|
1516
|
+
col: o,
|
|
1517
|
+
colAbsolute: "$" === e[1],
|
|
1518
|
+
rowAbsolute: "$" === e[3]
|
|
1519
|
+
};
|
|
1520
|
+
}, Ro = (t) => C.cellToString({
|
|
1521
|
+
rowIndex: t.row,
|
|
1522
|
+
colIndex: t.col
|
|
1523
|
+
}), Vo = (t, e) => {
|
|
1524
|
+
const o = _o.exec(t);
|
|
1525
|
+
if (!o) return null;
|
|
1526
|
+
const s = o[1].split(",");
|
|
1527
|
+
if (3 !== s.length && 5 !== s.length) return null;
|
|
1528
|
+
const r = [];
|
|
1529
|
+
for (let t = 0; t < s.length; t++) {
|
|
1530
|
+
const e = Mo(s[t]);
|
|
1531
|
+
if (!e) return null;
|
|
1532
|
+
r.push(e);
|
|
1533
|
+
}
|
|
1534
|
+
const n = e.rowStart, i = e.colStart, a = (t) => t.colAbsolute && !t.rowAbsolute && t.col === i - 1 && t.row === n, l = (t) => t.rowAbsolute && !t.colAbsolute && t.row === n - 1 && t.col === i, c = {
|
|
1535
|
+
rowStart: n,
|
|
1536
|
+
colStart: i,
|
|
1537
|
+
rowEnd: e.rowEnd,
|
|
1538
|
+
colEnd: e.colEnd
|
|
1539
|
+
}, h = r[0];
|
|
1540
|
+
if (3 === r.length) {
|
|
1541
|
+
const [, t, e] = r;
|
|
1542
|
+
return a(e) && l(h) ? {
|
|
1543
|
+
ref: c,
|
|
1544
|
+
columnInput: Ro(t)
|
|
1545
|
+
} : l(e) && a(h) ? {
|
|
1546
|
+
ref: c,
|
|
1547
|
+
rowInput: Ro(t)
|
|
1548
|
+
} : null;
|
|
1549
|
+
}
|
|
1550
|
+
if (!h.rowAbsolute || !h.colAbsolute || h.row !== n - 1 || h.col !== i - 1) return null;
|
|
1551
|
+
const [, u, d, p, f] = r;
|
|
1552
|
+
return a(d) && l(f) ? {
|
|
1553
|
+
ref: c,
|
|
1554
|
+
rowInput: Ro(p),
|
|
1555
|
+
columnInput: Ro(u)
|
|
1556
|
+
} : l(d) && a(f) ? {
|
|
1557
|
+
ref: c,
|
|
1558
|
+
rowInput: Ro(u),
|
|
1559
|
+
columnInput: Ro(p)
|
|
1560
|
+
} : null;
|
|
1561
|
+
}, Lo = /^(?:(\d{4})-(\d{2})-(\d{2}))?T?(?:(\d{2}):(\d{2})(?::(\d{2})(\.\d+)?)?)?(?:Z|[+-]\d{2}:?\d{2})?$/, jo = /^PT(?:(\d+(?:\.\d+)?)H)?(?:(\d+(?:\.\d+)?)M)?(?:(\d+(?:\.\d+)?)S)?$/, Bo = (t, e, o) => {
|
|
1562
|
+
const s = Math.floor((14 - e) / 12), r = t + 4800 - s, n = e + 12 * s - 3;
|
|
1563
|
+
return o + Math.floor((153 * n + 2) / 5) + 365 * r + Math.floor(r / 4) - Math.floor(r / 100) + Math.floor(r / 400) - 32045;
|
|
1564
|
+
}, Fo = Bo(1899, 12, 30), Ho = (t) => {
|
|
1565
|
+
const e = t.indexOf(":");
|
|
1566
|
+
return -1 === e ? t : t.slice(e + 1);
|
|
1567
|
+
}, Wo = class {
|
|
1568
|
+
constructor() {
|
|
1569
|
+
this._runs = null, this._text = "", this._font = null, this._inRun = !1, this._inRPr = !1;
|
|
1570
|
+
}
|
|
1571
|
+
reset() {
|
|
1572
|
+
this._runs = null, this._inRun = !1, this._inRPr = !1;
|
|
1573
|
+
}
|
|
1574
|
+
onOpenTag(t, e) {
|
|
1575
|
+
"r" === t ? (this._inRun = !0, this._text = "", this._font = null, this._runs ??= []) : "rPr" === t ? this._inRun && (this._inRPr = !0) : this._inRPr && function(t, e, o) {
|
|
1576
|
+
switch (t) {
|
|
1577
|
+
case "b":
|
|
1578
|
+
o.weight = qo(e) ? 700 : 400;
|
|
1579
|
+
break;
|
|
1580
|
+
case "i":
|
|
1581
|
+
o.style = qo(e) ? l.Style.Italic : l.Style.Normal;
|
|
1582
|
+
break;
|
|
1583
|
+
case "strike":
|
|
1584
|
+
o.strike = z(qo(e));
|
|
1585
|
+
break;
|
|
1586
|
+
case "outline":
|
|
1587
|
+
o.outline = qo(e);
|
|
1588
|
+
break;
|
|
1589
|
+
case "shadow":
|
|
1590
|
+
o.shadow = qo(e);
|
|
1591
|
+
break;
|
|
1592
|
+
case "condense":
|
|
1593
|
+
case "extend": {
|
|
1594
|
+
const s = $(t, qo(e));
|
|
1595
|
+
void 0 !== s && (o.letterSpacing = s);
|
|
1596
|
+
break;
|
|
1597
|
+
}
|
|
1598
|
+
case "u":
|
|
1599
|
+
o.underline = it(e.val);
|
|
1600
|
+
break;
|
|
1601
|
+
case "vertAlign": {
|
|
1602
|
+
const t = zt(e.val);
|
|
1603
|
+
void 0 !== t && (o.baseline = t);
|
|
1604
|
+
break;
|
|
1605
|
+
}
|
|
1606
|
+
case "sz": {
|
|
1607
|
+
const t = parseFloat(e.val ?? "");
|
|
1608
|
+
isNaN(t) || (o.size = t);
|
|
1609
|
+
break;
|
|
1610
|
+
}
|
|
1611
|
+
case "rFont": {
|
|
1612
|
+
const t = e.val;
|
|
1613
|
+
t && (o.family = t);
|
|
1614
|
+
break;
|
|
1615
|
+
}
|
|
1616
|
+
case "family": {
|
|
1617
|
+
const t = Xo[e.val ?? ""];
|
|
1618
|
+
t && (o.fallbacks = [t]);
|
|
1619
|
+
break;
|
|
1620
|
+
}
|
|
1621
|
+
case "charset": {
|
|
1622
|
+
const t = parseInt(e.val ?? "", 10);
|
|
1623
|
+
isNaN(t) || (o.charset = t);
|
|
1624
|
+
break;
|
|
1625
|
+
}
|
|
1626
|
+
case "scheme":
|
|
1627
|
+
K(o, e.val);
|
|
1628
|
+
break;
|
|
1629
|
+
case "color": {
|
|
1630
|
+
const t = e.rgb;
|
|
1631
|
+
if (t && void 0 === e.theme) {
|
|
1632
|
+
o.color = "#" + (8 === t.length ? t.substring(2) : t).toUpperCase();
|
|
1633
|
+
break;
|
|
1634
|
+
}
|
|
1635
|
+
const s = Et((t) => e[t]);
|
|
1636
|
+
s && (o.color = s);
|
|
1637
|
+
break;
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
}(t, e, this._font ??= {});
|
|
1641
|
+
}
|
|
1642
|
+
onText(t) {
|
|
1643
|
+
this._inRun && (this._text += t);
|
|
1644
|
+
}
|
|
1645
|
+
onCloseTag(t) {
|
|
1646
|
+
if ("rPr" === t) this._inRPr = !1, this._font ??= {};
|
|
1647
|
+
else if ("r" === t && this._inRun) {
|
|
1648
|
+
const t = Ut(this._text), e = this._font;
|
|
1649
|
+
this._runs.push(e ? {
|
|
1650
|
+
text: t,
|
|
1651
|
+
font: e
|
|
1652
|
+
} : { text: t }), this._inRun = !1;
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
take() {
|
|
1656
|
+
const t = this._runs;
|
|
1657
|
+
if (this.reset(), !t) return null;
|
|
1658
|
+
for (let e = 0; e < t.length; e++) if (t[e].font) return t;
|
|
1659
|
+
return null;
|
|
1660
|
+
}
|
|
1661
|
+
};
|
|
1662
|
+
function zo(t, e) {
|
|
1663
|
+
const o = {
|
|
1664
|
+
family: "Calibri",
|
|
1665
|
+
size: 11,
|
|
1666
|
+
...e,
|
|
1667
|
+
weight: 400,
|
|
1668
|
+
style: l.Style.Normal,
|
|
1669
|
+
underline: l.UnderlineStyle.None,
|
|
1670
|
+
strike: l.StrikeStyle.None,
|
|
1671
|
+
baseline: 0
|
|
1672
|
+
}, s = new Array(t.length);
|
|
1673
|
+
for (let e = 0; e < t.length; e++) {
|
|
1674
|
+
const r = t[e];
|
|
1675
|
+
if (!r.font) {
|
|
1676
|
+
s[e] = r;
|
|
1677
|
+
continue;
|
|
1678
|
+
}
|
|
1679
|
+
const n = {
|
|
1680
|
+
...o,
|
|
1681
|
+
...r.font
|
|
1682
|
+
};
|
|
1683
|
+
s[e] = {
|
|
1684
|
+
text: r.text,
|
|
1685
|
+
font: n
|
|
1686
|
+
};
|
|
1687
|
+
}
|
|
1688
|
+
return s;
|
|
1689
|
+
}
|
|
1690
|
+
var Xo = {
|
|
1691
|
+
1: "serif",
|
|
1692
|
+
2: "sans-serif",
|
|
1693
|
+
3: "monospace",
|
|
1694
|
+
4: "cursive",
|
|
1695
|
+
5: "fantasy"
|
|
1696
|
+
}, qo = (t) => {
|
|
1697
|
+
const e = t.val;
|
|
1698
|
+
return void 0 === e || "1" === e || "true" === e;
|
|
1699
|
+
}, Uo = (t) => {
|
|
1700
|
+
const e = (e) => {
|
|
1701
|
+
if (t) return new RegExp(`<(?:[\\w.-]+:)?${e}\\b[^>]*>([^<]*)<`).exec(t)?.[1];
|
|
1702
|
+
}, o = (t) => {
|
|
1703
|
+
const e = parseInt(t ?? "", 10);
|
|
1704
|
+
return isNaN(e) ? 0 : e;
|
|
1705
|
+
};
|
|
1706
|
+
return {
|
|
1707
|
+
c: o(e("col")),
|
|
1708
|
+
r: o(e("row")),
|
|
1709
|
+
x: tt(e("colOff") ?? "0") ?? 0,
|
|
1710
|
+
y: tt(e("rowOff") ?? "0") ?? 0
|
|
1711
|
+
};
|
|
1712
|
+
}, Go = "formulaDialect", Ko = "isKnownFunction", Jo = "date1904", Zo = "richStrings", Qo = "defaultFont", Yo = (t, e, o, s, r, n, i, a) => {
|
|
1713
|
+
const l = new Co(), c = (t) => {
|
|
1714
|
+
const e = t.getAttribute("dxfId", vo);
|
|
1715
|
+
if (null !== e) return s?.get(e) || (n?.(`A color filter or sort names a format that does not exist (dxfId '${e}').`), {});
|
|
1716
|
+
};
|
|
1717
|
+
let h = !1;
|
|
1718
|
+
const u = a?.get("parseInlineDxf"), d = a?.get(Go), f = (t) => d && t ? d.readDetached(t) : t, y = new b.TransposedBuilder();
|
|
1719
|
+
let x = null, w = "topLeft";
|
|
1720
|
+
l.registerVisitor({
|
|
1721
|
+
from: "autoFilter",
|
|
1722
|
+
to: "autoTable",
|
|
1723
|
+
openTag: (t) => {
|
|
1724
|
+
const e = t.getAttribute("ref"), o = C.fastStringToRange(e);
|
|
1725
|
+
t.getSource().r = o, t.getSource().v = {};
|
|
1726
|
+
},
|
|
1727
|
+
closeTag: (t) => {
|
|
1728
|
+
const e = t.getSource(), o = e.v, s = o.hiddenButtons;
|
|
1729
|
+
if (Array.isArray(s)) {
|
|
1730
|
+
const t = s.length, r = e.r, n = r.colEnd - r.colStart + 1;
|
|
1731
|
+
0 === t ? o.hiddenButtons = !1 : t === n && (o.hiddenButtons = !0);
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
}), l.registerVisitor({
|
|
1735
|
+
from: "conditionalFormatting",
|
|
1736
|
+
to: {},
|
|
1737
|
+
openTag: (t) => {
|
|
1738
|
+
const e = t.getParent();
|
|
1739
|
+
e.conditionals || (e.conditionals = []);
|
|
1740
|
+
let o = t.getAttribute("sqref");
|
|
1741
|
+
o && (o = o.trim().split(/\s+/).join(","));
|
|
1742
|
+
const s = {
|
|
1743
|
+
r: o,
|
|
1744
|
+
conditionals: e.conditionals
|
|
1745
|
+
}, r = t.getAttribute("pivot", yo);
|
|
1746
|
+
null !== r && (s.pivot = r), t.setSource(s);
|
|
1747
|
+
}
|
|
1748
|
+
}), l.registerVisitor({
|
|
1749
|
+
from: "cfRule",
|
|
1750
|
+
to: {},
|
|
1751
|
+
openTag: (t) => {
|
|
1752
|
+
const e = t.getParent();
|
|
1753
|
+
if (!e?.r) return;
|
|
1754
|
+
const o = t.getSource() ?? {};
|
|
1755
|
+
void 0 !== e.pivot && (o.pivot = e.pivot), e.conditionals.push({
|
|
1756
|
+
r: e.r,
|
|
1757
|
+
v: null,
|
|
1758
|
+
rule: o
|
|
1759
|
+
}), t.copyToObject(o, "type", wo), t.copyToObject(o, "priority", vo), t.copyToObject(o, "stopIfTrue", yo);
|
|
1760
|
+
const r = t.getAttribute("dxfId", vo);
|
|
1761
|
+
if (null !== r) {
|
|
1762
|
+
let e = s?.get(r);
|
|
1763
|
+
e || (n?.(`Unable to load conditional color. Invalid dxfI: '${r}' at '${t.getPath()}'.`), e = {}), o.style = e;
|
|
1764
|
+
}
|
|
1765
|
+
t.copyToObject(o, "aboveAverage", yo), t.copyToObject(o, "equalAverage", yo), t.copyToObject(o, "stdDev", vo), t.copyToObject(o, "bottom", yo), t.copyToObject(o, "percent", yo), t.copyToObject(o, "rank", vo), t.copyToObject(o, "operator", wo), t.copyToObject(o, "text", wo), t.copyToObject(o, "timePeriod", wo);
|
|
1766
|
+
},
|
|
1767
|
+
closeTag: (t) => {
|
|
1768
|
+
const e = t.getParent();
|
|
1769
|
+
if (!e?.r) return;
|
|
1770
|
+
const o = e.conditionals[e.conditionals.length - 1], s = o?.rule;
|
|
1771
|
+
if (!s) return;
|
|
1772
|
+
const r = {}, i = F(s, n);
|
|
1773
|
+
i && (r.condition = i), s.style && (r.style = s.style), s.scale && (r.scale = s.scale), s.stopIfTrue && (r.stopIfTrue = !0), s.pivot && "number" == typeof s.priority && (r.pivotKey = s.priority), o.v = r, o.priority = s.priority, s.x14Id && (o.x14Id = s.x14Id), delete o.rule;
|
|
1774
|
+
}
|
|
1775
|
+
});
|
|
1776
|
+
const T = (t) => {
|
|
1777
|
+
const e = t.conditions ?? [], o = [];
|
|
1778
|
+
for (let t = 0; t < e.length; t++) {
|
|
1779
|
+
const s = e[t], r = {};
|
|
1780
|
+
s.type && (r.type = s.type), void 0 !== s.value && (r.value = s.value), s.exclusive && (r.exclusive = !0), o.push(r);
|
|
1781
|
+
}
|
|
1782
|
+
return o;
|
|
1783
|
+
};
|
|
1784
|
+
l.registerVisitor({
|
|
1785
|
+
from: "colorScale",
|
|
1786
|
+
to: {},
|
|
1787
|
+
openTag: (t) => {},
|
|
1788
|
+
closeTag: (t) => {
|
|
1789
|
+
const e = t.getSource(), o = e.colors ?? [], s = T(e);
|
|
1790
|
+
for (let t = 0; t < s.length; t++) s[t].color = o[t];
|
|
1791
|
+
t.getParent().scale = {
|
|
1792
|
+
type: v.ScaleType.ColorScale,
|
|
1793
|
+
stops: s
|
|
1794
|
+
};
|
|
1795
|
+
}
|
|
1796
|
+
}), l.registerVisitor({
|
|
1797
|
+
from: "dataBar",
|
|
1798
|
+
to: {},
|
|
1799
|
+
openTag: (t) => {
|
|
1800
|
+
t.copyTo("maxLength", vo), t.copyTo("minLength", vo), t.copyTo("showValue", yo);
|
|
1801
|
+
},
|
|
1802
|
+
closeTag: (t) => {
|
|
1803
|
+
const e = t.getSource(), o = {
|
|
1804
|
+
type: v.ScaleType.DataBar,
|
|
1805
|
+
stops: T(e)
|
|
1806
|
+
}, s = e.colors?.[0];
|
|
1807
|
+
s && (o.color = s), void 0 !== e.minLength && (o.minLength = e.minLength), void 0 !== e.maxLength && (o.maxLength = e.maxLength), void 0 !== e.showValue && (o.showValue = e.showValue), t.getParent().scale = o;
|
|
1808
|
+
}
|
|
1809
|
+
}), l.registerVisitor({
|
|
1810
|
+
from: "iconSet",
|
|
1811
|
+
to: {},
|
|
1812
|
+
openTag: (t) => {
|
|
1813
|
+
t.copyTo("iconSet", wo), t.copyTo("reverse", yo), t.copyTo("showValue", yo);
|
|
1814
|
+
},
|
|
1815
|
+
closeTag: (t) => {
|
|
1816
|
+
const e = t.getSource(), o = {
|
|
1817
|
+
type: v.ScaleType.IconSet,
|
|
1818
|
+
stops: T(e)
|
|
1819
|
+
};
|
|
1820
|
+
void 0 !== e.iconSet && (o.iconSet = e.iconSet), void 0 !== e.reverse && (o.reverse = e.reverse), void 0 !== e.showValue && (o.showValue = e.showValue), t.getParent().scale = o;
|
|
1821
|
+
}
|
|
1822
|
+
}), l.registerVisitor({
|
|
1823
|
+
from: "formula",
|
|
1824
|
+
to: {},
|
|
1825
|
+
text: (t, e) => {
|
|
1826
|
+
const o = e.getParent();
|
|
1827
|
+
let s = o.formulas;
|
|
1828
|
+
s || (s = [], o.formulas = s), s.push(f(t));
|
|
1829
|
+
}
|
|
1830
|
+
}), l.registerVisitor({
|
|
1831
|
+
from: "cfvo",
|
|
1832
|
+
to: {},
|
|
1833
|
+
openTag: (t) => {
|
|
1834
|
+
const e = t.getParent();
|
|
1835
|
+
e.conditions || (e.conditions = []);
|
|
1836
|
+
const o = t.getSource();
|
|
1837
|
+
if (e.conditions.push(o), t.copyTo("type", wo), o.type === v.ColorStopType.Formula) {
|
|
1838
|
+
const e = t.getAttribute("val");
|
|
1839
|
+
null != e && (o.value = f(String(e)));
|
|
1840
|
+
} else t.copyTo("value", xo, "val");
|
|
1841
|
+
!1 === t.getAttribute("gte", yo) && (o.exclusive = !0);
|
|
1842
|
+
}
|
|
1843
|
+
}), l.registerVisitor({
|
|
1844
|
+
from: "color",
|
|
1845
|
+
to: {},
|
|
1846
|
+
openTag: (t) => {
|
|
1847
|
+
const e = t.getParent();
|
|
1848
|
+
e.colors || (e.colors = []);
|
|
1849
|
+
const o = Et((e) => t.getAttribute(e));
|
|
1850
|
+
e.colors.push(o);
|
|
1851
|
+
}
|
|
1852
|
+
}), l.registerVisitor({
|
|
1853
|
+
from: "filterColumn",
|
|
1854
|
+
to: {},
|
|
1855
|
+
openTag: (t) => {
|
|
1856
|
+
const e = t.getParent().v, o = parseInt(t.getAttribute("colId")), s = t.getSource();
|
|
1857
|
+
s.index = o;
|
|
1858
|
+
let r = e.filter;
|
|
1859
|
+
r || (r = { conditions: [] }, e.filter = r);
|
|
1860
|
+
let n = r.conditions;
|
|
1861
|
+
if (n || (n = [], r.conditions = n), n.push(s), t.getAttribute("hiddenButton", yo) && e) {
|
|
1862
|
+
let t = e.hiddenButtons;
|
|
1863
|
+
t || (t = [], e.hiddenButtons = t), t.push(o);
|
|
1864
|
+
}
|
|
1865
|
+
if (t.getAttribute("showButton", yo) && e) {
|
|
1866
|
+
let t = e.showButtons;
|
|
1867
|
+
t || (t = [], e.showButtons = t), t.push(o);
|
|
1868
|
+
}
|
|
1869
|
+
return s;
|
|
1870
|
+
}
|
|
1871
|
+
}), l.registerVisitor({
|
|
1872
|
+
from: "colorFilter",
|
|
1873
|
+
openTag: (t) => {
|
|
1874
|
+
const e = t.getParent(), o = {};
|
|
1875
|
+
e.operator = m.BuiltInOperatorNames.Color, e.param = o, t.copyToObject(o, "cellColor", yo);
|
|
1876
|
+
const s = c(t);
|
|
1877
|
+
s && (o.style = s);
|
|
1878
|
+
}
|
|
1879
|
+
}), l.registerVisitor({
|
|
1880
|
+
from: "iconFilter",
|
|
1881
|
+
openTag: (t) => {
|
|
1882
|
+
const e = t.getParent(), o = {};
|
|
1883
|
+
e.operator = m.BuiltInOperatorNames.Icon, e.param = o, t.copyToObject(o, "iconId", vo), t.copyToObject(o, "iconSet", wo);
|
|
1884
|
+
}
|
|
1885
|
+
}), l.registerVisitor({
|
|
1886
|
+
from: "top10",
|
|
1887
|
+
openTag: (t) => {
|
|
1888
|
+
const e = t.getParent(), o = {};
|
|
1889
|
+
e.operator = m.BuiltInOperatorNames.TopN, e.param = o, t.copyToObject(o, "filterVal", xo), t.copyToObject(o, "percent", yo), t.copyToObject(o, "top", yo), t.copyToObject(o, "limit", xo, "val");
|
|
1890
|
+
}
|
|
1891
|
+
}), l.registerVisitor({
|
|
1892
|
+
from: "dynamicFilter",
|
|
1893
|
+
openTag: (t) => {
|
|
1894
|
+
const e = t.getParent(), o = ot(t.getAttribute("type"), t.getAttribute("val"), t.getAttribute("maxVal"));
|
|
1895
|
+
e.operator = o.operator, e.param = o.param;
|
|
1896
|
+
}
|
|
1897
|
+
});
|
|
1898
|
+
const S = {
|
|
1899
|
+
from: "filters",
|
|
1900
|
+
to: {},
|
|
1901
|
+
openTag: (t) => {
|
|
1902
|
+
const e = t.getParent(), o = {};
|
|
1903
|
+
return e.selector = m.BuiltInSelectorNames.Display, e.operator = m.BuiltInOperatorNames.InSet, e.param = o, t.copyToObject(o, "blank", yo), t.copyToObject(o, "calendarType", wo), o;
|
|
1904
|
+
}
|
|
1905
|
+
};
|
|
1906
|
+
l.registerVisitor(S);
|
|
1907
|
+
const A = {
|
|
1908
|
+
from: "filter",
|
|
1909
|
+
openTag: (t) => {
|
|
1910
|
+
const e = t.getParent();
|
|
1911
|
+
let o = e.items;
|
|
1912
|
+
o || (o = [], e.items = o), o.push(t.getAttribute("val", wo));
|
|
1913
|
+
}
|
|
1914
|
+
};
|
|
1915
|
+
l.registerVisitor(A);
|
|
1916
|
+
const k = {
|
|
1917
|
+
from: "dateGroupItem",
|
|
1918
|
+
to: {},
|
|
1919
|
+
openTag: (t) => {
|
|
1920
|
+
const e = t.getParent();
|
|
1921
|
+
let o = e.dateGroups;
|
|
1922
|
+
o || (o = [], e.dateGroups = o), o.push(t.getSource()), t.copyTo("group", wo, "dateTimeGrouping"), t.copyTo("day", vo), t.copyTo("hour", vo), t.copyTo("minute", vo), t.copyTo("month", vo), t.copyTo("second", vo), t.copyTo("year", vo);
|
|
1923
|
+
}
|
|
1924
|
+
};
|
|
1925
|
+
l.registerVisitor(k);
|
|
1926
|
+
const E = /* @__PURE__ */ new Map();
|
|
1927
|
+
E.set("filterColumn", {
|
|
1928
|
+
from: "filterColumn",
|
|
1929
|
+
transparent: !0
|
|
1930
|
+
}), E.set("filters", S), E.set("filter", A), E.set("dateGroupItem", k), l.registerVisitor({
|
|
1931
|
+
from: "customFilters",
|
|
1932
|
+
openTag: (t) => {
|
|
1933
|
+
const e = t.getParent(), o = t.getAttribute("and"), s = "and" === o || "1" === o, r = [];
|
|
1934
|
+
return e.operator = s ? m.BuiltInOperatorNames.And : m.BuiltInOperatorNames.Or, e.param = r, t.setSource(e), r;
|
|
1935
|
+
},
|
|
1936
|
+
closeTag: (t) => {
|
|
1937
|
+
const e = t.getSource(), o = e?.param;
|
|
1938
|
+
if (!e || !o) return;
|
|
1939
|
+
const s = 1 === o.length ? o[0] : Tt(e);
|
|
1940
|
+
s !== e && (e.operator = s.operator, e.param = s.param);
|
|
1941
|
+
}
|
|
1942
|
+
}), l.registerVisitor({
|
|
1943
|
+
from: "customFilter",
|
|
1944
|
+
openTag: (t) => {
|
|
1945
|
+
const e = t.getParent();
|
|
1946
|
+
let o;
|
|
1947
|
+
Array.isArray(e) ? (o = {}, e.push(o)) : o = e;
|
|
1948
|
+
const s = q({
|
|
1949
|
+
operator: t.getAttribute("operator"),
|
|
1950
|
+
val: t.getAttribute("val")
|
|
1951
|
+
}, (e) => t.warn(e));
|
|
1952
|
+
s && (o.operator = s.operator, o.param = s.param);
|
|
1953
|
+
}
|
|
1954
|
+
});
|
|
1955
|
+
let I = {}, P = null;
|
|
1956
|
+
l.registerVisitor({
|
|
1957
|
+
from: "sortState",
|
|
1958
|
+
to: {},
|
|
1959
|
+
openTag: (t) => {
|
|
1960
|
+
const e = t.getParent();
|
|
1961
|
+
let o = e.v;
|
|
1962
|
+
if (!o) return;
|
|
1963
|
+
const s = {};
|
|
1964
|
+
I = {};
|
|
1965
|
+
const r = t.getAttribute("caseSensitive", yo);
|
|
1966
|
+
null != r && (I.collatorOptions = r ? g.CaseSensitiveOptions : g.CaseInsensitiveOptions);
|
|
1967
|
+
const n = t.getAttribute("sortMethod");
|
|
1968
|
+
"stroke" !== n && "pinYin" !== n || (I.collatorOptions = {
|
|
1969
|
+
...I.collatorOptions,
|
|
1970
|
+
collation: "stroke" === n ? "stroke" : "pinyin"
|
|
1971
|
+
}), t.getAttribute("columnSort", yo) && (s.axis = p.Axis.Column);
|
|
1972
|
+
const i = t.getAttribute("ref"), a = e.r;
|
|
1973
|
+
P = i && a ? C.fastStringToRange(i) : null, P && (s.extent = { range: Ot(a, P) }), o.sort = s, t.setSource(e);
|
|
1974
|
+
}
|
|
1975
|
+
}), l.registerVisitor({
|
|
1976
|
+
from: "sortCondition",
|
|
1977
|
+
to: {},
|
|
1978
|
+
openTag: (t) => {
|
|
1979
|
+
const e = t.getParent(), o = e.v;
|
|
1980
|
+
if (!o) return;
|
|
1981
|
+
const s = o.sort;
|
|
1982
|
+
if (!s) return;
|
|
1983
|
+
let r = s.sorts;
|
|
1984
|
+
r || (r = [], s.sorts = r);
|
|
1985
|
+
const n = t.getAttribute("ref");
|
|
1986
|
+
let i = 0, a = null;
|
|
1987
|
+
if (n) {
|
|
1988
|
+
const t = C.fastStringToRange(n, ss), o = t.colStart, s = e.r, r = s.colStart;
|
|
1989
|
+
i = s ? o - r : o, s && P && (a = R(s, P, t));
|
|
1990
|
+
}
|
|
1991
|
+
s.extent && (s.extent.sorts ??= []).push(a);
|
|
1992
|
+
const l = { ...I }, h = st(t.getAttribute("sortBy"));
|
|
1993
|
+
h && (l.sortOn = h);
|
|
1994
|
+
const u = c(t);
|
|
1995
|
+
u && (l.style = u), t.copyToObject(l, "iconSet", wo), t.copyToObject(l, "customList", wo), l.reverse = t.getAttribute("descending", yo) ?? !1;
|
|
1996
|
+
const d = {
|
|
1997
|
+
index: i,
|
|
1998
|
+
criteria: l
|
|
1999
|
+
};
|
|
2000
|
+
r.push(d);
|
|
2001
|
+
}
|
|
2002
|
+
});
|
|
2003
|
+
const O = (t) => {
|
|
2004
|
+
x = t.getSource(), w = "topLeft", t.copyTo("topLeft", wo, "topLeftCell");
|
|
2005
|
+
const e = ht(t.getAttribute("defaultGridColor")), o = t.getAttribute("colorId");
|
|
2006
|
+
null === o || e || (t.getSource().gridLineColor = "index" + parseFloat(o)), t.copyTo("showZeros", yo), t.copyTo("showFormulas", yo), t.copyTo("zoomScale", vo), t.copyTo("viewMode", wo, "view");
|
|
2007
|
+
const s = {};
|
|
2008
|
+
for (const [e, o] of Lt) {
|
|
2009
|
+
const r = t.getAttribute(o, vo);
|
|
2010
|
+
r && (s[e] = Math.min(400, Math.max(10, r)));
|
|
2011
|
+
}
|
|
2012
|
+
Object.keys(s).length > 0 && (t.getSource().zoomScales = s), t.copyTo("showRuler", yo), t.copyTo("showWhitespace", yo, "showWhiteSpace"), t.copyTo("windowProtection", yo), t.copyTo("showRowHeaders", yo, "showRowColHeaders"), t.copyTo("showColumnHeaders", yo, "showRowColHeaders"), t.copyTo("showRowGridlines", yo, "showGridLines"), t.copyTo("showColumnGridlines", yo, "showGridLines"), t.copyTo("rightToLeft", yo), t.copyTo("showOutlineSymbols", yo);
|
|
2013
|
+
};
|
|
2014
|
+
l.registerVisitor({
|
|
2015
|
+
from: "sheetView",
|
|
2016
|
+
to: "view",
|
|
2017
|
+
openTag: (t) => {
|
|
2018
|
+
O(t);
|
|
2019
|
+
},
|
|
2020
|
+
closeTag: () => {
|
|
2021
|
+
x = null;
|
|
2022
|
+
}
|
|
2023
|
+
}), l.registerVisitor({
|
|
2024
|
+
from: "customSheetViews",
|
|
2025
|
+
to: "customSheetViews",
|
|
2026
|
+
openTag: (t) => {
|
|
2027
|
+
t.setSource([]);
|
|
2028
|
+
}
|
|
2029
|
+
}), l.registerVisitor({
|
|
2030
|
+
from: "customSheetView",
|
|
2031
|
+
to: [],
|
|
2032
|
+
openTag: (t) => {
|
|
2033
|
+
D = !0, O(t);
|
|
2034
|
+
},
|
|
2035
|
+
closeTag: () => {
|
|
2036
|
+
D = !1, x = null;
|
|
2037
|
+
}
|
|
2038
|
+
}), l.registerVisitor({
|
|
2039
|
+
from: "selection",
|
|
2040
|
+
to: null,
|
|
2041
|
+
openTag: (t) => {
|
|
2042
|
+
if (!x) return;
|
|
2043
|
+
const e = t.getAttribute("activeCell")?.replace(/\$/g, ""), o = t.getAttribute("sqref")?.replace(/\$/g, ""), s = t.getAttribute("pane") ?? "topLeft";
|
|
2044
|
+
if (s !== w) {
|
|
2045
|
+
const t = x.freezePanes;
|
|
2046
|
+
if (t && e) {
|
|
2047
|
+
const r = { activeCell: e };
|
|
2048
|
+
o && o !== e && (r.sqref = o), (t.paneSelections ??= {})[s] = r;
|
|
2049
|
+
}
|
|
2050
|
+
return;
|
|
2051
|
+
}
|
|
2052
|
+
const r = {};
|
|
2053
|
+
e && (r.cell = e);
|
|
2054
|
+
const n = t.getAttribute("activeCellId", vo);
|
|
2055
|
+
null !== n && (r.rangeIndex = n), o && o !== e && (r.ranges = o.trim().split(/\s+/)), x.selection = r;
|
|
2056
|
+
}
|
|
2057
|
+
}), l.registerVisitor({
|
|
2058
|
+
from: "pane",
|
|
2059
|
+
to: null,
|
|
2060
|
+
openTag: (t) => {
|
|
2061
|
+
if (!x) return;
|
|
2062
|
+
w = t.getAttribute("activePane") ?? "topLeft";
|
|
2063
|
+
const e = t.getAttribute("state");
|
|
2064
|
+
if ("frozen" === e || "frozenSplit" === e) {
|
|
2065
|
+
const e = {};
|
|
2066
|
+
x.freezePanes = e, t.copyToObject(e, "topLeft", wo, "topLeftCell");
|
|
2067
|
+
const o = (x.topLeft ? C.fastStringToCell(x.topLeft) : void 0) ?? {
|
|
2068
|
+
colIndex: 0,
|
|
2069
|
+
rowIndex: 0
|
|
2070
|
+
}, s = {
|
|
2071
|
+
colIndex: 0,
|
|
2072
|
+
rowIndex: 0
|
|
2073
|
+
};
|
|
2074
|
+
t.copyToObject(s, "colIndex", vo, "xSplit"), t.copyToObject(s, "rowIndex", vo, "ySplit");
|
|
2075
|
+
const r = {
|
|
2076
|
+
colIndex: o.colIndex + s.colIndex,
|
|
2077
|
+
rowIndex: o.rowIndex + s.rowIndex
|
|
2078
|
+
};
|
|
2079
|
+
e.coords = C.cellToString(r);
|
|
2080
|
+
}
|
|
2081
|
+
}
|
|
2082
|
+
}), l.registerVisitor({
|
|
2083
|
+
from: "sheetPr",
|
|
2084
|
+
transparent: !0,
|
|
2085
|
+
openTag: (e) => {
|
|
2086
|
+
const o = e.getAttribute("codeName");
|
|
2087
|
+
o && (t.codeName = o), !1 === e.getAttribute("enableFormatConditionsCalculation", yo) && (t.conditionalFormatCalculation = !1), !0 === e.getAttribute("transitionEvaluation", yo) && (t.transitionFormulaEvaluation = !0), !0 === e.getAttribute("transitionEntry", yo) && (t.transitionFormulaEntry = !0), !1 === e.getAttribute("published", yo) && (t.excludeFromPublishing = !0);
|
|
2088
|
+
const s = {};
|
|
2089
|
+
!0 === e.getAttribute("syncHorizontal", yo) && (s.horizontal = !0), !0 === e.getAttribute("syncVertical", yo) && (s.vertical = !0);
|
|
2090
|
+
const r = e.getAttribute("syncRef");
|
|
2091
|
+
r && (s.anchor = r), Object.keys(s).length > 0 && (t.syncScroll = s);
|
|
2092
|
+
}
|
|
2093
|
+
}), l.registerVisitor({
|
|
2094
|
+
from: "tabColor",
|
|
2095
|
+
to: null,
|
|
2096
|
+
openTag: (e) => {
|
|
2097
|
+
const o = Et((t) => e.getAttribute(t));
|
|
2098
|
+
o && (t.tabColor = o);
|
|
2099
|
+
}
|
|
2100
|
+
});
|
|
2101
|
+
let D = !1;
|
|
2102
|
+
const N = () => t.pageLayout ??= {};
|
|
2103
|
+
l.registerVisitor({
|
|
2104
|
+
from: "pageSetUpPr",
|
|
2105
|
+
to: null,
|
|
2106
|
+
openTag: (t) => {
|
|
2107
|
+
!0 === t.getAttribute("fitToPage", yo) && (N().fitToPage = !0), !1 === t.getAttribute("autoPageBreaks", yo) && (N().hideAutoPageBreaks = !0);
|
|
2108
|
+
}
|
|
2109
|
+
}), l.registerVisitor({
|
|
2110
|
+
from: "outlinePr",
|
|
2111
|
+
to: null,
|
|
2112
|
+
openTag: (e) => {
|
|
2113
|
+
const o = (t) => {
|
|
2114
|
+
const o = e.getAttribute(t);
|
|
2115
|
+
return "0" === o || "false" === o;
|
|
2116
|
+
}, s = {};
|
|
2117
|
+
o("summaryBelow") && (s.summaryRow = "up"), o("summaryRight") && (s.summaryColumn = "left"), (() => {
|
|
2118
|
+
const t = e.getAttribute("applyStyles");
|
|
2119
|
+
return "1" === t || "true" === t;
|
|
2120
|
+
})() && (s.automaticStyles = !0), Object.keys(s).length > 0 && (t.outline = s);
|
|
2121
|
+
}
|
|
2122
|
+
}), l.registerVisitor({
|
|
2123
|
+
from: "pageMargins",
|
|
2124
|
+
to: null,
|
|
2125
|
+
openTag: (t) => {
|
|
2126
|
+
if (D) return;
|
|
2127
|
+
const e = (e, o) => t.getAttribute(e, xo) ?? o, o = {
|
|
2128
|
+
left: e("left", .7),
|
|
2129
|
+
right: e("right", .7),
|
|
2130
|
+
top: e("top", .75),
|
|
2131
|
+
bottom: e("bottom", .75),
|
|
2132
|
+
header: e("header", .3),
|
|
2133
|
+
footer: e("footer", .3)
|
|
2134
|
+
};
|
|
2135
|
+
.7 === o.left && .7 === o.right && .75 === o.top && .75 === o.bottom && .3 === o.header && .3 === o.footer || (N().margins = o);
|
|
2136
|
+
}
|
|
2137
|
+
}), l.registerVisitor({
|
|
2138
|
+
from: "pageSetup",
|
|
2139
|
+
to: null,
|
|
2140
|
+
openTag: (t) => {
|
|
2141
|
+
if (D) return;
|
|
2142
|
+
const o = N(), s = (e) => t.getAttribute(e, vo) ?? void 0, r = (e) => t.getAttribute(e, yo), n = t.getAttribute("orientation");
|
|
2143
|
+
"landscape" !== n && "portrait" !== n || (o.orientation = n);
|
|
2144
|
+
for (const t of [
|
|
2145
|
+
"paperSize",
|
|
2146
|
+
"scale",
|
|
2147
|
+
"fitToWidth",
|
|
2148
|
+
"fitToHeight",
|
|
2149
|
+
"firstPageNumber",
|
|
2150
|
+
"horizontalDpi",
|
|
2151
|
+
"verticalDpi",
|
|
2152
|
+
"copies"
|
|
2153
|
+
]) {
|
|
2154
|
+
const e = s(t);
|
|
2155
|
+
void 0 !== e && (o[t] = e);
|
|
2156
|
+
}
|
|
2157
|
+
const i = t.getAttribute("paperHeight");
|
|
2158
|
+
i && (o.paperHeight = i);
|
|
2159
|
+
const a = t.getAttribute("paperWidth");
|
|
2160
|
+
a && (o.paperWidth = a), "overThenDown" === t.getAttribute("pageOrder") && (o.printOrder = "overThenDown"), !0 === r("blackAndWhite") && (o.blackAndWhite = !0), !0 === r("draft") && (o.draftMode = !0), !0 === r("useFirstPageNumber") && (o.useFirstPageNumber = !0), !1 === r("usePrinterDefaults") && (o.ignorePrinterDefaults = !0);
|
|
2161
|
+
const l = t.getAttribute("cellComments"), c = pt.find(([t]) => t === l)?.[1];
|
|
2162
|
+
c && (o.printComments = c);
|
|
2163
|
+
const h = t.getAttribute("errors"), u = bt.find(([t]) => t === h)?.[1];
|
|
2164
|
+
u && (o.printErrors = u);
|
|
2165
|
+
const d = t.getAttribute("r:id"), p = d ? e(d, "part") : null;
|
|
2166
|
+
p && (o.printerSettings = p);
|
|
2167
|
+
}
|
|
2168
|
+
}), l.registerVisitor({
|
|
2169
|
+
from: "printOptions",
|
|
2170
|
+
to: null,
|
|
2171
|
+
openTag: (t) => {
|
|
2172
|
+
if (D) return;
|
|
2173
|
+
const e = (e) => !0 === t.getAttribute(e, yo);
|
|
2174
|
+
e("horizontalCentered") && (N().centerHorizontally = !0), e("verticalCentered") && (N().centerVertically = !0), e("gridLines") && (N().printGridlines = !0), e("headings") && (N().printHeadings = !0);
|
|
2175
|
+
}
|
|
2176
|
+
}), l.registerVisitor({
|
|
2177
|
+
from: "headerFooter",
|
|
2178
|
+
to: {},
|
|
2179
|
+
openTag: (t) => {
|
|
2180
|
+
if (D) return;
|
|
2181
|
+
const e = {}, o = (e) => t.getAttribute(e, yo);
|
|
2182
|
+
!0 === o("differentOddEven") && (e.differentOddEven = !0), !0 === o("differentFirst") && (e.differentFirst = !0), !1 === o("scaleWithDoc") && (e.ignoreSheetScale = !0), !1 === o("alignWithMargins") && (e.ignoreSheetMargins = !0), Object.keys(e).length > 0 && (N().headerFooter = e);
|
|
2183
|
+
}
|
|
2184
|
+
});
|
|
2185
|
+
for (const t of Nt) l.registerVisitor({
|
|
2186
|
+
from: t,
|
|
2187
|
+
to: {},
|
|
2188
|
+
text: (e, o) => {
|
|
2189
|
+
if (D) return;
|
|
2190
|
+
const s = N(), r = s.headerFooter ??= {};
|
|
2191
|
+
r[t] = (r[t] ?? "") + Ut(e);
|
|
2192
|
+
}
|
|
2193
|
+
});
|
|
2194
|
+
let _ = "rowBreaks";
|
|
2195
|
+
for (const [t, e] of [["rowBreaks", "rowBreaks"], ["colBreaks", "columnBreaks"]]) l.registerVisitor({
|
|
2196
|
+
from: t,
|
|
2197
|
+
to: {},
|
|
2198
|
+
openTag: () => {
|
|
2199
|
+
_ = e;
|
|
2200
|
+
}
|
|
2201
|
+
});
|
|
2202
|
+
l.registerVisitor({
|
|
2203
|
+
from: "brk",
|
|
2204
|
+
to: null,
|
|
2205
|
+
openTag: (t) => {
|
|
2206
|
+
if (D) return;
|
|
2207
|
+
const e = t.getAttribute("id", vo);
|
|
2208
|
+
if (null == e) return;
|
|
2209
|
+
const o = { index: e }, s = t.getAttribute("min", vo);
|
|
2210
|
+
null != s && (o.min = s);
|
|
2211
|
+
const r = t.getAttribute("max", vo);
|
|
2212
|
+
null != r && (o.max = r), !0 !== t.getAttribute("man", yo) && (o.automatic = !0), !0 === t.getAttribute("pt", yo) && (o.pivot = !0);
|
|
2213
|
+
const n = N();
|
|
2214
|
+
(n[_] ??= []).push(o);
|
|
2215
|
+
}
|
|
2216
|
+
}), l.registerVisitor({
|
|
2217
|
+
from: "ignoredErrors",
|
|
2218
|
+
transparent: !0
|
|
2219
|
+
}), l.registerVisitor({
|
|
2220
|
+
from: "ignoredError",
|
|
2221
|
+
to: null,
|
|
2222
|
+
openTag: (e) => {
|
|
2223
|
+
const o = e.getAttribute("sqref");
|
|
2224
|
+
if (!o) return;
|
|
2225
|
+
const s = [];
|
|
2226
|
+
for (const t of J) !0 === e.getAttribute(t, yo) && s.push(t);
|
|
2227
|
+
if (0 !== s.length) for (const e of o.trim().split(/\s+/)) (t.ignoredErrors ??= []).push({
|
|
2228
|
+
r: e,
|
|
2229
|
+
v: s
|
|
2230
|
+
});
|
|
2231
|
+
}
|
|
2232
|
+
}), l.registerVisitor({
|
|
2233
|
+
from: "mergeCells",
|
|
2234
|
+
to: "merges",
|
|
2235
|
+
openTag: (t) => {
|
|
2236
|
+
t.setSource([]);
|
|
2237
|
+
}
|
|
2238
|
+
}), l.registerVisitor({
|
|
2239
|
+
from: "dataValidations",
|
|
2240
|
+
to: "validations",
|
|
2241
|
+
openTag: (e) => {
|
|
2242
|
+
e.setSource([]);
|
|
2243
|
+
const o = {};
|
|
2244
|
+
!0 === e.getAttribute("disablePrompts", yo) && (o.disablePrompts = !0);
|
|
2245
|
+
const s = e.getAttribute("xWindow", vo);
|
|
2246
|
+
null !== s && (o.windowX = s);
|
|
2247
|
+
const r = e.getAttribute("yWindow", vo);
|
|
2248
|
+
null !== r && (o.windowY = r), Object.keys(o).length > 0 && (t.validationSettings = {
|
|
2249
|
+
...t.validationSettings,
|
|
2250
|
+
...o
|
|
2251
|
+
});
|
|
2252
|
+
}
|
|
2253
|
+
});
|
|
2254
|
+
const $ = {
|
|
2255
|
+
from: "dataValidation",
|
|
2256
|
+
to: [],
|
|
2257
|
+
openTag: (t) => {
|
|
2258
|
+
let e = t.getAttribute("sqref");
|
|
2259
|
+
e && (e = e.trim().split(/\s+/).join(","));
|
|
2260
|
+
const o = {}, s = {
|
|
2261
|
+
r: e,
|
|
2262
|
+
v: o,
|
|
2263
|
+
rule: {
|
|
2264
|
+
type: t.getAttribute("type") ?? void 0,
|
|
2265
|
+
operator: t.getAttribute("operator") ?? void 0
|
|
2266
|
+
}
|
|
2267
|
+
};
|
|
2268
|
+
!0 === t.getAttribute("showDropDown", yo) && (o.hideDropdown = !0), t.copyToObject(o, "alert", wo, "error"), t.copyToObject(o, "alertTitle", wo, "errorTitle"), t.copyToObject(o, "showAlertMessage", yo, "showErrorMessage"), o.alertStyle = t.getAttribute("errorStyle") ?? "stop", t.copyToObject(o, "imeMode"), t.copyToObject(o, "prompt"), t.copyToObject(o, "promptTitle"), t.copyToObject(o, "showPromptMessage", yo, "showInputMessage"), t.setSource(s);
|
|
2269
|
+
},
|
|
2270
|
+
closeTag: (t) => {
|
|
2271
|
+
const e = t.getSource();
|
|
2272
|
+
if (!e?.rule) return;
|
|
2273
|
+
const o = Zt(e.rule, n);
|
|
2274
|
+
o && (t.getAttribute("allowBlank", yo) && (o.includeBlanks = !0), e.v.condition = o), delete e.rule;
|
|
2275
|
+
}
|
|
2276
|
+
};
|
|
2277
|
+
l.registerVisitor($), l.registerVisitor({
|
|
2278
|
+
from: "formula1",
|
|
2279
|
+
to: {},
|
|
2280
|
+
text: (t, e) => {
|
|
2281
|
+
const o = e.getParent().rule;
|
|
2282
|
+
o?.type && (o.formula1 = It(f(t), o.type));
|
|
2283
|
+
}
|
|
2284
|
+
}), l.registerVisitor({
|
|
2285
|
+
from: "formula2",
|
|
2286
|
+
to: {},
|
|
2287
|
+
text: (t, e) => {
|
|
2288
|
+
const o = e.getParent().rule;
|
|
2289
|
+
o?.type && (o.formula2 = It(f(t), o.type));
|
|
2290
|
+
}
|
|
2291
|
+
}), l.registerVisitor({
|
|
2292
|
+
from: "picture",
|
|
2293
|
+
to: "picture",
|
|
2294
|
+
openTag: (t) => {
|
|
2295
|
+
const o = t.getAttribute("r:id");
|
|
2296
|
+
if (!o) return void t.warn("A picture names no image; it was not imported.", { onceKey: "xlsx.sheet.picture.noRel" });
|
|
2297
|
+
const s = e(o, "resource");
|
|
2298
|
+
t.getSource().resId = s;
|
|
2299
|
+
}
|
|
2300
|
+
});
|
|
2301
|
+
const V = {
|
|
2302
|
+
from: "slicer",
|
|
2303
|
+
to: {},
|
|
2304
|
+
openTag: (t) => {
|
|
2305
|
+
const o = t.getAttribute("r:id");
|
|
2306
|
+
if (!o) return void t.warn("A slicer names no cache; it was not imported.", { onceKey: "xlsx.sheet.slicer.noRel" });
|
|
2307
|
+
const s = e(o)?.slicers, r = t.getParent();
|
|
2308
|
+
r.slicers || (r.slicers = {});
|
|
2309
|
+
const n = Object.keys(s);
|
|
2310
|
+
for (const t of n) r.slicers[t] = s[t];
|
|
2311
|
+
}
|
|
2312
|
+
};
|
|
2313
|
+
l.registerVisitor(V);
|
|
2314
|
+
const L = {
|
|
2315
|
+
from: "timelineRef",
|
|
2316
|
+
to: {},
|
|
2317
|
+
openTag: (t) => {
|
|
2318
|
+
const o = t.getAttribute("r:id"), s = o ? e(o)?.slicers : void 0;
|
|
2319
|
+
if (!s) return void t.warn("A timeline names no part; it was not imported.", { onceKey: "xlsx.sheet.timeline.noRel" });
|
|
2320
|
+
const r = t.getParent();
|
|
2321
|
+
r.slicers ??= {};
|
|
2322
|
+
for (const t of Object.keys(s)) r.slicers[t] = s[t];
|
|
2323
|
+
}
|
|
2324
|
+
}, j = (t, e) => ({
|
|
2325
|
+
from: t,
|
|
2326
|
+
to: {},
|
|
2327
|
+
openTag: (t) => {
|
|
2328
|
+
t.setSource("");
|
|
2329
|
+
},
|
|
2330
|
+
text: (t, e) => {
|
|
2331
|
+
e.setSource((e.getSource() ?? "") + t);
|
|
2332
|
+
},
|
|
2333
|
+
closeTag: (t) => {
|
|
2334
|
+
e(String(t.getSource() ?? ""), t);
|
|
2335
|
+
}
|
|
2336
|
+
}), B = /* @__PURE__ */ new Map();
|
|
2337
|
+
B.set("dataValidations", {
|
|
2338
|
+
from: "dataValidations",
|
|
2339
|
+
to: "validations",
|
|
2340
|
+
openTag: (t) => {
|
|
2341
|
+
const e = t.getParent();
|
|
2342
|
+
t.setSource(e.validations ?? []);
|
|
2343
|
+
},
|
|
2344
|
+
closeTag: (t) => {
|
|
2345
|
+
0 === (t.getSource()?.length ?? 0) && t.setSource(void 0);
|
|
2346
|
+
}
|
|
2347
|
+
}), B.set("dataValidation", {
|
|
2348
|
+
...$,
|
|
2349
|
+
closeTag: (t) => {
|
|
2350
|
+
$.closeTag(t);
|
|
2351
|
+
const e = t.getSource();
|
|
2352
|
+
e && !e.r && (t.warn("x14 dataValidation with no xm:sqref was dropped."), t.setSource(void 0));
|
|
2353
|
+
}
|
|
2354
|
+
});
|
|
2355
|
+
const H = (t) => ({
|
|
2356
|
+
from: t,
|
|
2357
|
+
to: {},
|
|
2358
|
+
openTag: (e) => {
|
|
2359
|
+
e.setSource({
|
|
2360
|
+
rule: e.getParent()?.rule,
|
|
2361
|
+
key: t
|
|
2362
|
+
});
|
|
2363
|
+
}
|
|
2364
|
+
});
|
|
2365
|
+
B.set("formula1", H("formula1")), B.set("formula2", H("formula2")), B.set("f", j("f", (t, e) => {
|
|
2366
|
+
const o = e.getParent(), s = o?.rule;
|
|
2367
|
+
s && (s[o.key] = It(f(t), s.type));
|
|
2368
|
+
})), B.set("sqref", j("sqref", (t, e) => {
|
|
2369
|
+
const o = e.getParent(), s = t.trim();
|
|
2370
|
+
o && s && (o.r = s.split(/\s+/).join(","));
|
|
2371
|
+
}));
|
|
2372
|
+
const W = /* @__PURE__ */ new Map(), z = [], X = /* @__PURE__ */ new Map();
|
|
2373
|
+
X.set("conditionalFormattings", {
|
|
2374
|
+
from: "conditionalFormattings",
|
|
2375
|
+
transparent: !0
|
|
2376
|
+
}), X.set("conditionalFormatting", {
|
|
2377
|
+
from: "conditionalFormatting",
|
|
2378
|
+
to: {},
|
|
2379
|
+
openTag: (t) => {
|
|
2380
|
+
t.setSource({ rules: [] });
|
|
2381
|
+
},
|
|
2382
|
+
closeTag: (t) => {
|
|
2383
|
+
const e = t.getSource(), o = e?.rules ?? [];
|
|
2384
|
+
for (let t = 0; t < o.length; t++) {
|
|
2385
|
+
const s = o[t];
|
|
2386
|
+
s.sqref = e.sqref, s.id ? W.set(s.id, s) : z.push(s);
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2389
|
+
}), X.set("cfRule", {
|
|
2390
|
+
from: "cfRule",
|
|
2391
|
+
to: {},
|
|
2392
|
+
openTag: (t) => {
|
|
2393
|
+
t.copyTo("id", wo), t.copyTo("type", wo), t.copyTo("priority", vo), t.copyTo("stopIfTrue", yo), t.copyTo("operator", wo), t.copyTo("text", wo), t.copyTo("timePeriod", wo), t.copyTo("aboveAverage", yo), t.copyTo("equalAverage", yo), t.copyTo("stdDev", vo), t.copyTo("bottom", yo), t.copyTo("percent", yo), t.copyTo("rank", vo);
|
|
2394
|
+
},
|
|
2395
|
+
closeTag: (t) => {
|
|
2396
|
+
const e = t.getSource();
|
|
2397
|
+
e && t.getParent()?.rules?.push(e);
|
|
2398
|
+
}
|
|
2399
|
+
}), X.set("sqref", j("sqref", (t, e) => {
|
|
2400
|
+
const o = e.getParent(), s = t.trim();
|
|
2401
|
+
o && s && (o.sqref = s);
|
|
2402
|
+
})), X.set("dataBar", {
|
|
2403
|
+
from: "dataBar",
|
|
2404
|
+
to: {},
|
|
2405
|
+
openTag: (t) => {
|
|
2406
|
+
t.copyTo("minLength", vo), t.copyTo("maxLength", vo), t.copyTo("gradient", yo), t.copyTo("border", yo), t.copyTo("direction", wo), t.copyTo("axisPosition", wo), t.copyTo("negativeBarColorSameAsPositive", yo), t.copyTo("negativeBarBorderColorSameAsPositive", yo);
|
|
2407
|
+
},
|
|
2408
|
+
closeTag: (t) => {
|
|
2409
|
+
t.getParent().dataBar = t.getSource();
|
|
2410
|
+
}
|
|
2411
|
+
}), X.set("iconSet", {
|
|
2412
|
+
from: "iconSet",
|
|
2413
|
+
to: {},
|
|
2414
|
+
openTag: (t) => {
|
|
2415
|
+
t.copyTo("iconSet", wo), t.copyTo("custom", yo), t.copyTo("reverse", yo), t.copyTo("showValue", yo);
|
|
2416
|
+
},
|
|
2417
|
+
closeTag: (t) => {
|
|
2418
|
+
t.getParent().iconSet = t.getSource();
|
|
2419
|
+
}
|
|
2420
|
+
});
|
|
2421
|
+
const U = /* @__PURE__ */ new Map();
|
|
2422
|
+
U.set("f", j("f", (t, e) => {
|
|
2423
|
+
const o = e.getParent();
|
|
2424
|
+
if (!o) return;
|
|
2425
|
+
const s = t.trim(), r = Number(s);
|
|
2426
|
+
o.value = s.length > 0 && Number.isFinite(r) ? r : f(t);
|
|
2427
|
+
})), X.set("cfvo", {
|
|
2428
|
+
from: "cfvo",
|
|
2429
|
+
to: {},
|
|
2430
|
+
scope: () => U,
|
|
2431
|
+
openTag: (t) => {
|
|
2432
|
+
const e = t.getParent();
|
|
2433
|
+
e.conditions || (e.conditions = []);
|
|
2434
|
+
const o = t.getSource();
|
|
2435
|
+
e.conditions.push(o), t.copyTo("type", wo), !1 === t.getAttribute("gte", yo) && (o.exclusive = !0);
|
|
2436
|
+
}
|
|
2437
|
+
}), X.set("f", j("f", (t, e) => {
|
|
2438
|
+
const o = e.getParent();
|
|
2439
|
+
o && (o.formulas ??= []).push(f(t));
|
|
2440
|
+
})), X.set("dxf", {
|
|
2441
|
+
from: "dxf",
|
|
2442
|
+
to: {},
|
|
2443
|
+
raw: !0,
|
|
2444
|
+
closeTag: (t) => {
|
|
2445
|
+
if (!u) return;
|
|
2446
|
+
const e = t.getParent();
|
|
2447
|
+
if (!e) return;
|
|
2448
|
+
const o = u(t.getRawXml() ?? "");
|
|
2449
|
+
o && (e.style = o);
|
|
2450
|
+
}
|
|
2451
|
+
});
|
|
2452
|
+
const G = (t) => ({
|
|
2453
|
+
from: t,
|
|
2454
|
+
to: {},
|
|
2455
|
+
openTag: (e) => {
|
|
2456
|
+
const o = Et((t) => e.getAttribute(t));
|
|
2457
|
+
o && (e.getParent()[t] = o);
|
|
2458
|
+
}
|
|
2459
|
+
});
|
|
2460
|
+
X.set("borderColor", G("borderColor")), X.set("negativeFillColor", G("negativeFillColor")), X.set("negativeBorderColor", G("negativeBorderColor")), X.set("axisColor", G("axisColor")), X.set("cfIcon", {
|
|
2461
|
+
from: "cfIcon",
|
|
2462
|
+
to: {},
|
|
2463
|
+
openTag: (t) => {
|
|
2464
|
+
const e = t.getAttribute("iconSet"), o = t.getAttribute("iconId", vo);
|
|
2465
|
+
if (null === e || null === o) return;
|
|
2466
|
+
const s = t.getParent();
|
|
2467
|
+
s.icons || (s.icons = []), s.icons.push({
|
|
2468
|
+
set: e,
|
|
2469
|
+
id: o
|
|
2470
|
+
});
|
|
2471
|
+
}
|
|
2472
|
+
});
|
|
2473
|
+
const K = /* @__PURE__ */ new Map();
|
|
2474
|
+
K.set("id", j("id", (t, e) => {
|
|
2475
|
+
const o = e.getParent(), s = t.trim();
|
|
2476
|
+
o && s && (o.x14Id = s);
|
|
2477
|
+
}));
|
|
2478
|
+
const Z = /* @__PURE__ */ new Map();
|
|
2479
|
+
Z.set("slicerList", {
|
|
2480
|
+
from: "slicerList",
|
|
2481
|
+
transparent: !0
|
|
2482
|
+
}), Z.set("slicer", V);
|
|
2483
|
+
const Q = /* @__PURE__ */ new Map();
|
|
2484
|
+
Q.set("timelineRefs", {
|
|
2485
|
+
from: "timelineRefs",
|
|
2486
|
+
transparent: !0
|
|
2487
|
+
}), Q.set("timelineRef", L);
|
|
2488
|
+
const Y = /* @__PURE__ */ new Map([
|
|
2489
|
+
[Gt(M), B],
|
|
2490
|
+
[Gt(St), X],
|
|
2491
|
+
[Gt(kt), X],
|
|
2492
|
+
[Gt(et), K],
|
|
2493
|
+
[Gt(Bt), Z],
|
|
2494
|
+
[Gt(at), Z],
|
|
2495
|
+
[Gt($t), Q],
|
|
2496
|
+
[Gt(wt), E]
|
|
2497
|
+
]), tt = /* @__PURE__ */ new Set();
|
|
2498
|
+
l.registerVisitor({
|
|
2499
|
+
from: "extLst",
|
|
2500
|
+
transparent: !0
|
|
2501
|
+
}), l.registerVisitor({
|
|
2502
|
+
from: "ext",
|
|
2503
|
+
transparent: !0,
|
|
2504
|
+
scope: (t) => {
|
|
2505
|
+
const e = t.getAttribute("uri"), o = Gt(e), s = Y.get(o);
|
|
2506
|
+
if (s) return s;
|
|
2507
|
+
if (!Ft.has(o) && !tt.has(o)) {
|
|
2508
|
+
tt.add(o);
|
|
2509
|
+
const s = ft[o];
|
|
2510
|
+
t.warn(s ? `Extension content '${s}' (${e}) is not read; it will be lost on resave.` : `Unknown extension content (uri ${e}) is not read; it will be lost on resave.`);
|
|
2511
|
+
}
|
|
2512
|
+
return null;
|
|
2513
|
+
}
|
|
2514
|
+
}), l.registerVisitor({
|
|
2515
|
+
from: "mergeCell",
|
|
2516
|
+
to: [],
|
|
2517
|
+
openTag: (t) => {
|
|
2518
|
+
const e = t.getAttribute("ref");
|
|
2519
|
+
t.setSource(e);
|
|
2520
|
+
}
|
|
2521
|
+
}), l.registerVisitor({
|
|
2522
|
+
from: "hyperlinks",
|
|
2523
|
+
to: "hyperlinks",
|
|
2524
|
+
openTag: (t) => {
|
|
2525
|
+
t.setSource([]);
|
|
2526
|
+
}
|
|
2527
|
+
}), l.registerVisitor({
|
|
2528
|
+
from: "hyperlink",
|
|
2529
|
+
to: [],
|
|
2530
|
+
openTag: (t) => {
|
|
2531
|
+
const o = t.getAttribute("r:id"), s = t.getAttribute("ref");
|
|
2532
|
+
if (!s) return void t.warn("A hyperlink has no ref; it was dropped.", { onceKey: "xlsx.sheet.hyperlink.noRef" });
|
|
2533
|
+
t.setKey(s);
|
|
2534
|
+
let r = o ? e(o) : "";
|
|
2535
|
+
if ("string" != typeof r) return void t.warn("A hyperlink has an invalid address; it was dropped.", { onceKey: "xlsx.sheet.hyperlink.address" });
|
|
2536
|
+
r.endsWith("\\") && (r = r.substring(0, r.length - 1));
|
|
2537
|
+
const n = t.getAttribute("location");
|
|
2538
|
+
if (n && (r += "#" + n), !r) return void t.warn("A hyperlink has no address; it was dropped.", { onceKey: "xlsx.sheet.hyperlink.address" });
|
|
2539
|
+
let i;
|
|
2540
|
+
const a = t.getAttribute("tooltip"), l = t.getAttribute("display");
|
|
2541
|
+
a || l ? (i = { address: r }, a && (i.screenTip = a), l && (i.display = l)) : i = r, t.setSource({
|
|
2542
|
+
r: s,
|
|
2543
|
+
v: i
|
|
2544
|
+
});
|
|
2545
|
+
}
|
|
2546
|
+
}), l.registerVisitor({
|
|
2547
|
+
from: "drawing",
|
|
2548
|
+
to: "movables",
|
|
2549
|
+
openTag: (t) => {
|
|
2550
|
+
const o = t.getAttribute("r:id");
|
|
2551
|
+
if (!o) return;
|
|
2552
|
+
const s = e(o);
|
|
2553
|
+
s ? t.setSource(s.movables) : t.warn("A drawing part is missing; its shapes were not imported.", { onceKey: "xlsx.sheet.drawing.missing" });
|
|
2554
|
+
}
|
|
2555
|
+
}), l.registerVisitor({
|
|
2556
|
+
from: "legacyDrawing",
|
|
2557
|
+
to: "legacyDrawing",
|
|
2558
|
+
openTag: (t) => {
|
|
2559
|
+
t.setSource(e(t.getAttribute("r:id"), "legacyDrawing") ?? void 0);
|
|
2560
|
+
}
|
|
2561
|
+
}), l.registerVisitor({
|
|
2562
|
+
from: "legacyDrawingHF",
|
|
2563
|
+
to: "legacyDrawingHF",
|
|
2564
|
+
openTag: (t) => {
|
|
2565
|
+
t.setSource(e(t.getAttribute("r:id"), "legacyDrawing") ?? void 0);
|
|
2566
|
+
}
|
|
2567
|
+
});
|
|
2568
|
+
let rt = null, nt = !1;
|
|
2569
|
+
const it = /* @__PURE__ */ new Map(), ct = {
|
|
2570
|
+
from: "Fallback",
|
|
2571
|
+
to: null
|
|
2572
|
+
}, ut = {
|
|
2573
|
+
from: "Choice",
|
|
2574
|
+
transparent: !0
|
|
2575
|
+
};
|
|
2576
|
+
it.set("Fallback", ct), it.set("Choice", ut), it.set("control", {
|
|
2577
|
+
from: "control",
|
|
2578
|
+
transparent: !0,
|
|
2579
|
+
openTag: (t) => {
|
|
2580
|
+
const o = t.getAttribute("name"), s = t.getAttribute("r:id"), r = s ? e(s, "formControl") : null;
|
|
2581
|
+
if (!r) return t.warn(`The form control '${o ?? ""}' has no properties and was not read.`, { onceKey: "xlsx.sheet.control.noProperties" }), void (rt = null);
|
|
2582
|
+
const n = r.json, i = parseInt(t.getAttribute("shapeId") ?? "", 10);
|
|
2583
|
+
isNaN(i) || (n.shapeId = i);
|
|
2584
|
+
const a = {
|
|
2585
|
+
anchor: {
|
|
2586
|
+
tl: {
|
|
2587
|
+
c: 0,
|
|
2588
|
+
r: 0,
|
|
2589
|
+
x: 0,
|
|
2590
|
+
y: 0
|
|
2591
|
+
},
|
|
2592
|
+
br: {
|
|
2593
|
+
c: 0,
|
|
2594
|
+
r: 0,
|
|
2595
|
+
x: 0,
|
|
2596
|
+
y: 0
|
|
2597
|
+
}
|
|
2598
|
+
},
|
|
2599
|
+
content: {
|
|
2600
|
+
type: r.type,
|
|
2601
|
+
json: n
|
|
2602
|
+
}
|
|
2603
|
+
};
|
|
2604
|
+
o && (a.content.name = o), rt = {
|
|
2605
|
+
movable: a,
|
|
2606
|
+
control: n
|
|
2607
|
+
};
|
|
2608
|
+
},
|
|
2609
|
+
closeTag: () => {
|
|
2610
|
+
rt && (t.movables || (t.movables = []), t.movables.push(rt.movable), rt = null);
|
|
2611
|
+
}
|
|
2612
|
+
}), it.set("controlPr", {
|
|
2613
|
+
from: "controlPr",
|
|
2614
|
+
transparent: !0,
|
|
2615
|
+
raw: !0,
|
|
2616
|
+
openTag: (t) => {
|
|
2617
|
+
if (!rt) return;
|
|
2618
|
+
const e = t.getFrom().attributes ?? {}, o = {};
|
|
2619
|
+
for (const t in e) {
|
|
2620
|
+
const s = e[t];
|
|
2621
|
+
o[t] = "string" == typeof s ? s : s?.value ?? "";
|
|
2622
|
+
}
|
|
2623
|
+
Dt(o, rt.control);
|
|
2624
|
+
},
|
|
2625
|
+
closeTag: (t) => {
|
|
2626
|
+
if (!rt) return;
|
|
2627
|
+
const e = ((t) => {
|
|
2628
|
+
const e = /<(?:[\w.-]+:)?anchor\b([^>]*)>([\s\S]*?)<\/(?:[\w.-]+:)?anchor>/.exec(t);
|
|
2629
|
+
if (!e) return null;
|
|
2630
|
+
const o = e[2], s = (t) => new RegExp(`<(?:[\\w.-]+:)?${t}\\b[^>]*>([\\s\\S]*?)<\\/(?:[\\w.-]+:)?${t}>`).exec(o)?.[1], r = e[1], n = /\bmoveWithCells="(?:1|true)"/.test(r), i = /\bsizeWithCells="(?:1|true)"/.test(r);
|
|
2631
|
+
return {
|
|
2632
|
+
anchor: {
|
|
2633
|
+
tl: Uo(s("from")),
|
|
2634
|
+
br: Uo(s("to"))
|
|
2635
|
+
},
|
|
2636
|
+
anchorType: n ? i ? "twoCell" : "oneCell" : "absolute",
|
|
2637
|
+
rest: (t.slice(0, e.index) + t.slice(e.index + e[0].length)).trim()
|
|
2638
|
+
};
|
|
2639
|
+
})(t.getRawXml() ?? "");
|
|
2640
|
+
e ? (rt.movable.anchor = e.anchor, "twoCell" !== e.anchorType && (rt.movable.anchorType = e.anchorType), e.rest && (rt.control.xml = e.rest)) : nt || (nt = !0, t.warn("A form control has no anchor; it is placed at the top left of the sheet."));
|
|
2641
|
+
}
|
|
2642
|
+
});
|
|
2643
|
+
const dt = {
|
|
2644
|
+
from: "controls",
|
|
2645
|
+
transparent: !0,
|
|
2646
|
+
scope: () => it
|
|
2647
|
+
};
|
|
2648
|
+
l.registerVisitor(dt);
|
|
2649
|
+
const gt = /* @__PURE__ */ new Map([
|
|
2650
|
+
["Choice", ut],
|
|
2651
|
+
["Fallback", ct],
|
|
2652
|
+
["controls", dt]
|
|
2653
|
+
]);
|
|
2654
|
+
l.registerVisitor({
|
|
2655
|
+
from: "AlternateContent",
|
|
2656
|
+
transparent: !0,
|
|
2657
|
+
scope: () => gt
|
|
2658
|
+
}), l.registerVisitor({
|
|
2659
|
+
from: "tableParts",
|
|
2660
|
+
to: "tables",
|
|
2661
|
+
openTag: (t) => {
|
|
2662
|
+
t.setSource([]);
|
|
2663
|
+
}
|
|
2664
|
+
}), l.registerVisitor({
|
|
2665
|
+
from: "tablePart",
|
|
2666
|
+
to: [],
|
|
2667
|
+
openTag: (t) => {
|
|
2668
|
+
const o = t.getAttribute("r:id");
|
|
2669
|
+
if (!o) return;
|
|
2670
|
+
const s = e(o);
|
|
2671
|
+
s ? t.setSource(s) : t.warn("A table part is missing; the table was not imported.", { onceKey: "xlsx.sheet.table.missing" });
|
|
2672
|
+
}
|
|
2673
|
+
});
|
|
2674
|
+
const mt = (t, e) => {
|
|
2675
|
+
e.conditions?.length && (t.stops = T(e)), void 0 !== e.minLength && (t.minLength = e.minLength), void 0 !== e.maxLength && (t.maxLength = e.maxLength), (e.gradient ?? 1) && (t.gradient = !0), e.border && e.borderColor && (t.borderColor = e.borderColor), !e.negativeBarColorSameAsPositive && e.negativeFillColor && (t.negativeFillColor = e.negativeFillColor), !(e.negativeBarBorderColorSameAsPositive ?? 1) && e.negativeBorderColor && (t.negativeBorderColor = e.negativeBorderColor), e.axisColor && (t.axisColor = e.axisColor), "middle" !== e.axisPosition && "none" !== e.axisPosition || (t.axisPosition = e.axisPosition), "leftToRight" !== e.direction && "rightToLeft" !== e.direction || (t.direction = e.direction);
|
|
2676
|
+
}, yt = (t, e) => {
|
|
2677
|
+
e.conditions?.length && (t.stops = T(e)), e.iconSet && e.iconSet !== t.iconSet && (t.iconSet = e.iconSet), e.icons?.length && (t.icon = e.icons), void 0 !== e.reverse && (t.reverse = e.reverse), void 0 !== e.showValue && (t.showValue = e.showValue);
|
|
2678
|
+
}, vt = (t) => {
|
|
2679
|
+
if (!t.sqref) return null;
|
|
2680
|
+
const e = t.sqref.split(/\s+/).join(",");
|
|
2681
|
+
if ("iconSet" === t.type) {
|
|
2682
|
+
if (!t.iconSet) return null;
|
|
2683
|
+
const o = {
|
|
2684
|
+
type: v.ScaleType.IconSet,
|
|
2685
|
+
stops: []
|
|
2686
|
+
};
|
|
2687
|
+
return yt(o, t.iconSet), {
|
|
2688
|
+
r: e,
|
|
2689
|
+
v: { scale: o },
|
|
2690
|
+
priority: t.priority
|
|
2691
|
+
};
|
|
2692
|
+
}
|
|
2693
|
+
const o = F(t, n);
|
|
2694
|
+
if (!o) return null;
|
|
2695
|
+
const s = { condition: o };
|
|
2696
|
+
return t.style && (s.style = t.style), t.stopIfTrue && (s.stopIfTrue = !0), {
|
|
2697
|
+
r: e,
|
|
2698
|
+
v: s,
|
|
2699
|
+
priority: t.priority
|
|
2700
|
+
};
|
|
2701
|
+
};
|
|
2702
|
+
l.registerVisitor({
|
|
2703
|
+
from: "worksheet",
|
|
2704
|
+
to: {},
|
|
2705
|
+
openTag: (t) => {},
|
|
2706
|
+
closeTag: (t) => {
|
|
2707
|
+
const e = t.getSource();
|
|
2708
|
+
let o = e?.conditionals;
|
|
2709
|
+
if (o) for (let t = 0; t < o.length; t++) {
|
|
2710
|
+
const e = o[t], s = e.x14Id;
|
|
2711
|
+
if (!s) continue;
|
|
2712
|
+
delete e.x14Id;
|
|
2713
|
+
const r = W.get(s);
|
|
2714
|
+
if (!r) continue;
|
|
2715
|
+
W.delete(s);
|
|
2716
|
+
const n = e.v?.scale;
|
|
2717
|
+
r.dataBar && n?.type === v.ScaleType.DataBar ? mt(n, r.dataBar) : r.iconSet && n?.type === v.ScaleType.IconSet && yt(n, r.iconSet);
|
|
2718
|
+
}
|
|
2719
|
+
const s = [...W.values(), ...z], r = /* @__PURE__ */ new Set();
|
|
2720
|
+
let i = 0;
|
|
2721
|
+
for (let t = 0; t < s.length; t++) {
|
|
2722
|
+
const n = vt(s[t]);
|
|
2723
|
+
n ? (o || (o = [], e.conditionals = o), o.push(n)) : (r.add(s[t].type ?? "unknown"), i++);
|
|
2724
|
+
}
|
|
2725
|
+
if (i > 0) {
|
|
2726
|
+
const t = [...r].map((t) => `'${t}'`).join(", ");
|
|
2727
|
+
n?.(1 === i ? `An x14-only conditional formatting rule (type ${t}) is not read and will be lost on resave.` : `${i} x14-only conditional formatting rules (types ${t}) are not read and will be lost on resave.`);
|
|
2728
|
+
}
|
|
2729
|
+
if (o) {
|
|
2730
|
+
o.length > 1 && o.sort((t, e) => (t.priority ?? 1 / 0) - (e.priority ?? 1 / 0));
|
|
2731
|
+
for (let t = 0; t < o.length; t++) delete o[t].priority;
|
|
2732
|
+
}
|
|
2733
|
+
}
|
|
2734
|
+
}), l.registerVisitor({
|
|
2735
|
+
from: "customProperties",
|
|
2736
|
+
to: "customProperties",
|
|
2737
|
+
openTag: (t) => {
|
|
2738
|
+
t.setSource([]);
|
|
2739
|
+
},
|
|
2740
|
+
closeTag: (t) => {
|
|
2741
|
+
const e = t.getSource();
|
|
2742
|
+
e.length > 0 && (t.getParent().customProperties = e);
|
|
2743
|
+
}
|
|
2744
|
+
}), l.registerVisitor({
|
|
2745
|
+
from: "customPr",
|
|
2746
|
+
to: {},
|
|
2747
|
+
openTag: (t) => {
|
|
2748
|
+
const o = t.getParent();
|
|
2749
|
+
t.copyTo("name");
|
|
2750
|
+
const s = t.getAttribute("r:id");
|
|
2751
|
+
if (!s) return void t.warn("A custom property names no part; it was not imported.", { onceKey: "xlsx.sheet.customProperty.noRel" });
|
|
2752
|
+
const r = e(s, "resource"), n = t.getSource();
|
|
2753
|
+
n.resId = r, o.push(n);
|
|
2754
|
+
}
|
|
2755
|
+
}), l.registerVisitor({
|
|
2756
|
+
from: "sheetProtection",
|
|
2757
|
+
to: "protection",
|
|
2758
|
+
openTag: (t) => {
|
|
2759
|
+
const e = t.getSource();
|
|
2760
|
+
for (const o of lt) {
|
|
2761
|
+
const s = t.hasAttribute(o.attribute) ? t.getAttribute(o.attribute) : null;
|
|
2762
|
+
e[o.key] = xt(o, s);
|
|
2763
|
+
}
|
|
2764
|
+
if (e.sheet) return;
|
|
2765
|
+
const o = {};
|
|
2766
|
+
t.copyToObject(o, "hash", wo, "hashValue"), t.copyToObject(o, "algorithm", wo, "algorithmName"), t.copyToObject(o, "salt", wo, "saltValue"), t.copyToObject(o, "spinCount", vo), t.copyToObject(o, "legacyHash", wo, "password"), Object.keys(o).length > 0 && (t.getSource().password = o);
|
|
2767
|
+
}
|
|
2768
|
+
}), l.registerVisitor({
|
|
2769
|
+
from: "protectedRanges",
|
|
2770
|
+
to: "protectedRanges",
|
|
2771
|
+
openTag: (t) => {
|
|
2772
|
+
t.setSource([]);
|
|
2773
|
+
}
|
|
2774
|
+
}), l.registerVisitor({
|
|
2775
|
+
from: "protectedRange",
|
|
2776
|
+
to: [],
|
|
2777
|
+
openTag: (t) => {
|
|
2778
|
+
let e = t.getAttribute("sqref");
|
|
2779
|
+
e && (e = e.trim().split(/\s+/).join(","));
|
|
2780
|
+
const o = {}, s = {
|
|
2781
|
+
r: e,
|
|
2782
|
+
v: o
|
|
2783
|
+
};
|
|
2784
|
+
t.copyToObject(o, "name"), t.copyToObject(o, "securityDescriptor");
|
|
2785
|
+
const r = {};
|
|
2786
|
+
t.copyToObject(r, "hash", wo, "hashValue"), t.copyToObject(r, "algorithm", wo, "algorithmName"), t.copyToObject(r, "salt", wo, "saltValue"), t.copyToObject(r, "spinCount", vo), t.copyToObject(r, "legacyHash", wo, "password"), Object.keys(r).length > 0 && (o.password = r), t.setSource(s);
|
|
2787
|
+
},
|
|
2788
|
+
closeTag: (t) => {
|
|
2789
|
+
const e = t.getSource();
|
|
2790
|
+
e?.r && e.v.name || t.setSource(void 0);
|
|
2791
|
+
}
|
|
2792
|
+
}), l.registerVisitor({
|
|
2793
|
+
from: "sheetFormatPr",
|
|
2794
|
+
to: "sheetFormatPr",
|
|
2795
|
+
openTag: (e) => {
|
|
2796
|
+
e.copyToObject(t, "defaultColSize", xo, "defaultColWidth");
|
|
2797
|
+
const o = e.getAttribute("customHeight");
|
|
2798
|
+
"1" !== o && "true" !== o || e.copyToObject(t, "defaultRowSize", xo, "defaultRowHeight");
|
|
2799
|
+
const s = e.getAttribute("baseColWidth", vo);
|
|
2800
|
+
s && 8 !== s && (t.baseColSize = s), h = !!e.getAttribute("zeroHeight", yo);
|
|
2801
|
+
}
|
|
2802
|
+
}), l.registerVisitor({
|
|
2803
|
+
from: "cols",
|
|
2804
|
+
to: "cols",
|
|
2805
|
+
openTag: (t) => {
|
|
2806
|
+
t.setSource([]);
|
|
2807
|
+
}
|
|
2808
|
+
}), l.registerVisitor({
|
|
2809
|
+
from: "col",
|
|
2810
|
+
to: [],
|
|
2811
|
+
openTag: (t) => {
|
|
2812
|
+
const e = t.getSource(), o = t.getAttribute("min"), s = t.getAttribute("max"), r = void 0 === o ? 0 : parseInt(o) - 1, n = void 0 === s ? r : parseInt(s) - 1;
|
|
2813
|
+
e.r = C.runToString(r, n, !0);
|
|
2814
|
+
const i = {};
|
|
2815
|
+
e.v = i, t.copyToObject(i, "sz", xo, "width"), t.copyToObject(i, "csz", yo, "customWidth"), t.copyToObject(i, "h", yo, "hidden"), t.copyToObject(i, "l", vo, "outlineLevel"), t.copyToObject(i, "cl", yo, "collapsed"), t.getAttribute("bestFit", yo) && (i.bf = !0), t.copyToObject(i, "s", vo, "style");
|
|
2816
|
+
}
|
|
2817
|
+
}), l.registerVisitor({
|
|
2818
|
+
from: "oleObjects",
|
|
2819
|
+
to: null,
|
|
2820
|
+
openTag: (t) => {
|
|
2821
|
+
t.warn("'OLE Objects' are not supported.");
|
|
2822
|
+
}
|
|
2823
|
+
});
|
|
2824
|
+
let Ct = !1, At = !1, Pt = 0, _t = "", Mt = "";
|
|
2825
|
+
const Rt = (t) => {
|
|
2826
|
+
const e = t.indexOf(":");
|
|
2827
|
+
return -1 === e ? t : t.slice(e + 1);
|
|
2828
|
+
}, Vt = new Wo();
|
|
2829
|
+
return ns(y, t, l.createEventHandler(t, r, n), n, i, {
|
|
2830
|
+
onOpenTag: (t) => {
|
|
2831
|
+
Ct = !0;
|
|
2832
|
+
const e = Rt(t.name);
|
|
2833
|
+
"t" === e || "v" === e ? 0 === Pt && (At = !0) : "rPh" === e || "phoneticPr" === e ? Pt++ : 0 === Pt && Vt.onOpenTag(e, t.attributes);
|
|
2834
|
+
},
|
|
2835
|
+
onText: (t) => {
|
|
2836
|
+
At && (_t += t, Vt.onText(t));
|
|
2837
|
+
},
|
|
2838
|
+
onCloseTag: (t) => {
|
|
2839
|
+
const e = Rt(t.name);
|
|
2840
|
+
"t" === e || "v" === e ? At = !1 : "rPh" === e || "phoneticPr" === e ? Pt > 0 && Pt-- : Vt.onCloseTag(e);
|
|
2841
|
+
},
|
|
2842
|
+
onEnd: () => {
|
|
2843
|
+
if (!Ct) return;
|
|
2844
|
+
const t = Vt.take();
|
|
2845
|
+
Ct = !1, At = !1, Pt = 0;
|
|
2846
|
+
const e = Ut(_t);
|
|
2847
|
+
return _t = "", Mt = e, t ? {
|
|
2848
|
+
t: "r",
|
|
2849
|
+
v: {
|
|
2850
|
+
type: "richText",
|
|
2851
|
+
data: { runs: zo(t, a?.get(Qo)) }
|
|
2852
|
+
}
|
|
2853
|
+
} : o(e);
|
|
2854
|
+
},
|
|
2855
|
+
onError: (t) => {}
|
|
2856
|
+
}, a, o, () => h, () => Mt);
|
|
2857
|
+
}, ts = class {
|
|
2858
|
+
static {
|
|
2859
|
+
this.Collapsed = 1;
|
|
2860
|
+
}
|
|
2861
|
+
static {
|
|
2862
|
+
this.CustomFormat = 2;
|
|
2863
|
+
}
|
|
2864
|
+
static {
|
|
2865
|
+
this.CustomHeight = 4;
|
|
2866
|
+
}
|
|
2867
|
+
static {
|
|
2868
|
+
this.Hidden = 8;
|
|
2869
|
+
}
|
|
2870
|
+
static {
|
|
2871
|
+
this.Ht = 16;
|
|
2872
|
+
}
|
|
2873
|
+
static {
|
|
2874
|
+
this.OutlineLevel = 32;
|
|
2875
|
+
}
|
|
2876
|
+
static {
|
|
2877
|
+
this.Ph = 64;
|
|
2878
|
+
}
|
|
2879
|
+
static {
|
|
2880
|
+
this.R = 128;
|
|
2881
|
+
}
|
|
2882
|
+
static {
|
|
2883
|
+
this.S = 256;
|
|
2884
|
+
}
|
|
2885
|
+
static {
|
|
2886
|
+
this.Spans = 512;
|
|
2887
|
+
}
|
|
2888
|
+
}, es = (t, e, o) => {
|
|
2889
|
+
if (t[0].value[0] === t[1].value[0]) return e;
|
|
2890
|
+
}, os = /^\s*TABLE\s*\(/i, ss = {
|
|
2891
|
+
colStart: 0,
|
|
2892
|
+
colEnd: 0,
|
|
2893
|
+
rowStart: 0,
|
|
2894
|
+
rowEnd: 0
|
|
2895
|
+
}, rs = (t) => "1" === t || "true" === t, ns = (t, e, o, s, i, a, l, c, h, u) => {
|
|
2896
|
+
let g = !1;
|
|
2897
|
+
const m = [], b = l?.get(Zo), y = l?.get(Qo), v = /* @__PURE__ */ new Map();
|
|
2898
|
+
let x = !1, w = [], S = !1, k = null, E = null, I = null, P = null, O = null, D = null;
|
|
2899
|
+
const N = l?.get("richData") ?? r.EmptyArray;
|
|
2900
|
+
let _ = null, $ = !1;
|
|
2901
|
+
const M = C.normalizeA1ToR1C1, R = n.createConflatingRanges(), V = /* @__PURE__ */ new Map(), L = [], j = [];
|
|
2902
|
+
let B = !1, F = !1, H = null;
|
|
2903
|
+
const W = (t) => {
|
|
2904
|
+
const e = (l?.get("metadata"))?.values;
|
|
2905
|
+
if (!e) return;
|
|
2906
|
+
const o = parseInt(t, 10);
|
|
2907
|
+
if (!Number.isFinite(o) || o < 1) return;
|
|
2908
|
+
const s = e[o - 1]?.get("XLRICHVALUE");
|
|
2909
|
+
return void 0 !== s?.richValueIndex ? N[s.richValueIndex] : void 0;
|
|
2910
|
+
};
|
|
2911
|
+
let z = !1;
|
|
2912
|
+
const X = n.createConflatingRanges();
|
|
2913
|
+
let q, U = !1, G = -1, K = -1, J = null, Z = null;
|
|
2914
|
+
const Q = (t) => ({
|
|
2915
|
+
t: "r",
|
|
2916
|
+
v: {
|
|
2917
|
+
type: "hyperlink",
|
|
2918
|
+
data: {
|
|
2919
|
+
address: q,
|
|
2920
|
+
friendly: t
|
|
2921
|
+
}
|
|
2922
|
+
}
|
|
2923
|
+
});
|
|
2924
|
+
let Y = null;
|
|
2925
|
+
const tt = [];
|
|
2926
|
+
let et = null, ot = -2, st = 0, nt = "", it = "", at = "", lt = "", ct = "", ht = "", dt = "", pt = "", ft = "", gt = "", mt = "", bt = "", yt = "", vt = "", xt = !0, wt = null, Tt = !1, St = !1, Ct = !1, At = null, kt = 0;
|
|
2927
|
+
const Et = (t) => {
|
|
2928
|
+
let s = t.name;
|
|
2929
|
+
const r = s.indexOf(":");
|
|
2930
|
+
if (-1 !== r && (s = s.slice(r + 1)), kt++, kt % 196608 == 0 && i?.(kt), Z) {
|
|
2931
|
+
const e = t.attributes;
|
|
2932
|
+
switch (s) {
|
|
2933
|
+
case "v":
|
|
2934
|
+
x = !0;
|
|
2935
|
+
break;
|
|
2936
|
+
case "f":
|
|
2937
|
+
switch (S = !0, e.t ?? null) {
|
|
2938
|
+
case null:
|
|
2939
|
+
case "normal": break;
|
|
2940
|
+
case "shared":
|
|
2941
|
+
const t = e.si;
|
|
2942
|
+
E = e.ref, k = t;
|
|
2943
|
+
break;
|
|
2944
|
+
case "array":
|
|
2945
|
+
E = e.ref, H = E;
|
|
2946
|
+
break;
|
|
2947
|
+
case "dataTable": {
|
|
2948
|
+
const t = ((t, e, o) => {
|
|
2949
|
+
const s = t.r1, r = rs(t.del1);
|
|
2950
|
+
if (!s && !r) return null;
|
|
2951
|
+
const n = t.ref ?? C.cellToString({
|
|
2952
|
+
rowIndex: e,
|
|
2953
|
+
colIndex: o
|
|
2954
|
+
}), i = C.fastStringToRange(n);
|
|
2955
|
+
if (!i) return null;
|
|
2956
|
+
const a = { ref: {
|
|
2957
|
+
rowStart: i.rowStart,
|
|
2958
|
+
colStart: i.colStart,
|
|
2959
|
+
rowEnd: i.rowEnd,
|
|
2960
|
+
colEnd: i.colEnd
|
|
2961
|
+
} }, l = rs(t.dt2D);
|
|
2962
|
+
if (l || rs(t.dtr) ? (s && (a.rowInput = s), r && (a.rowInputDeleted = !0)) : (s && (a.columnInput = s), r && (a.columnInputDeleted = !0)), l) {
|
|
2963
|
+
const e = t.r2;
|
|
2964
|
+
e && (a.columnInput = e), rs(t.del2) && (a.columnInputDeleted = !0);
|
|
2965
|
+
}
|
|
2966
|
+
return a;
|
|
2967
|
+
})(e, G, K);
|
|
2968
|
+
t && (j.push(t), rs(e.ca) && X.append(G, K));
|
|
2969
|
+
return;
|
|
2970
|
+
}
|
|
2971
|
+
}
|
|
2972
|
+
const t = e.ca;
|
|
2973
|
+
void 0 !== t && (z = "1" === t);
|
|
2974
|
+
break;
|
|
2975
|
+
case "is":
|
|
2976
|
+
U = !0;
|
|
2977
|
+
return;
|
|
2978
|
+
}
|
|
2979
|
+
U && !S && a?.onOpenTag?.(t);
|
|
2980
|
+
return;
|
|
2981
|
+
}
|
|
2982
|
+
if (g) {
|
|
2983
|
+
if ("c" === s) {
|
|
2984
|
+
Z = t, q = void 0;
|
|
2985
|
+
const e = t.attributes, o = e.r;
|
|
2986
|
+
K = void 0 !== o ? C.fastStringToCol(o) : K + 1;
|
|
2987
|
+
const s = e.t;
|
|
2988
|
+
void 0 === s ? Y = null : (Y = s, "str" === Y && (U = !0));
|
|
2989
|
+
let r = e.s;
|
|
2990
|
+
void 0 === r && (null !== At || Ct) && (r = "0"), void 0 !== r && (r = parseInt(r), wt && wt.value === r && wt.colEnd + 1 === K ? wt.colEnd = K : (wt = {
|
|
2991
|
+
colStart: K,
|
|
2992
|
+
rowStart: G,
|
|
2993
|
+
colEnd: K,
|
|
2994
|
+
rowEnd: G,
|
|
2995
|
+
value: r
|
|
2996
|
+
}, w.push(wt))), H = null, F = !1, $ = !1;
|
|
2997
|
+
const n = e.cm;
|
|
2998
|
+
B = void 0 !== n && ((t) => {
|
|
2999
|
+
const e = (l?.get("metadata"))?.cells;
|
|
3000
|
+
if (!e) return !1;
|
|
3001
|
+
const o = parseInt(t, 10);
|
|
3002
|
+
return !(!Number.isFinite(o) || o < 1) && !0 === (e[o - 1]?.get("XLDAPR"))?.fDynamic;
|
|
3003
|
+
})(n);
|
|
3004
|
+
const i = e.vm;
|
|
3005
|
+
if (void 0 !== i) {
|
|
3006
|
+
const t = W(i);
|
|
3007
|
+
if (d.isError(t)) {
|
|
3008
|
+
const e = t.getCode();
|
|
3009
|
+
J = {
|
|
3010
|
+
t: "e",
|
|
3011
|
+
v: e
|
|
3012
|
+
}, B && e === d.Code.Spill && (F = !0);
|
|
3013
|
+
}
|
|
3014
|
+
}
|
|
3015
|
+
}
|
|
3016
|
+
} else {
|
|
3017
|
+
if (St && "row" === s) {
|
|
3018
|
+
g = !0;
|
|
3019
|
+
const e = t.attributes.r;
|
|
3020
|
+
if (G = void 0 !== e ? parseInt(e) - 1 : G + 1, K = -1, h?.()) {
|
|
3021
|
+
const t = m[m.length - 1];
|
|
3022
|
+
t && t.max + 1 === G ? t.max = G : m.push({
|
|
3023
|
+
min: G,
|
|
3024
|
+
max: G
|
|
3025
|
+
});
|
|
3026
|
+
}
|
|
3027
|
+
if (st = 0, it = t.attributes.customHeight, void 0 !== it && (st |= ts.CustomHeight), it !== ft && (xt = !0, ft = it), nt = t.attributes.ht, void 0 !== nt && (st |= ts.Ht), nt !== pt && (xt = !0, pt = nt), at = t.attributes.hidden, void 0 !== at && (st |= ts.Hidden), at !== gt && (xt = !0, gt = at), ct = t.attributes.s, void 0 !== ct && (st |= ts.S), ct !== bt && (xt = !0, bt = ct), lt = t.attributes.customFormat, void 0 !== lt && (st |= ts.CustomFormat), lt !== mt && (xt = !0, mt = lt), ht = t.attributes.outlineLevel, void 0 !== ht && (st |= ts.OutlineLevel), ht !== yt && (xt = !0, yt = ht), dt = t.attributes.collapsed, void 0 !== dt && (st |= ts.Collapsed), dt !== vt && (xt = !0, vt = dt), 0 !== st) if (ot + 1 !== G || xt) {
|
|
3028
|
+
const t = void 0 !== it && ("1" === it || "true" === it), e = void 0 !== lt && ("1" === lt || "true" === lt);
|
|
3029
|
+
At = e && void 0 !== ct ? ct : null, e && null === At && (At = "0"), et = {
|
|
3030
|
+
min: G,
|
|
3031
|
+
max: G,
|
|
3032
|
+
value: {
|
|
3033
|
+
sz: void 0 === nt ? -1 : parseFloat(nt),
|
|
3034
|
+
csz: t,
|
|
3035
|
+
h: void 0 !== at && ("1" === at || "true" === at),
|
|
3036
|
+
s: null === At ? void 0 : "0" === At ? 0 : parseInt(At),
|
|
3037
|
+
l: void 0 === ht || "0" === ht ? 0 : parseInt(ht),
|
|
3038
|
+
cl: void 0 !== dt && ("1" === dt || "true" === dt)
|
|
3039
|
+
}
|
|
3040
|
+
}, tt.push(et);
|
|
3041
|
+
} else et.max = G;
|
|
3042
|
+
ot = G, xt = !1;
|
|
3043
|
+
return;
|
|
3044
|
+
}
|
|
3045
|
+
if ("sheetData" === s && (St = !0), !Tt && "sheetData" === s) {
|
|
3046
|
+
Tt = !0;
|
|
3047
|
+
const t = e.cols, o = t ? t.length : 0;
|
|
3048
|
+
for (let e = 0; !Ct && e < o; e++) t[e].v.s && (Ct = !0);
|
|
3049
|
+
}
|
|
3050
|
+
o?.onOpenTag?.(t);
|
|
3051
|
+
}
|
|
3052
|
+
}, It = (e) => {
|
|
3053
|
+
let s = e.name;
|
|
3054
|
+
if ("sheetData" === s && (St = !1), !S || "c" !== s && "f" !== s || (k && (P = V.get(k) ?? null), P && (q = ((t) => {
|
|
3055
|
+
if (t.length < 11 || 104 != (32 | t.charCodeAt(0))) return;
|
|
3056
|
+
if (!/^HYPERLINK\(/i.test(t)) return;
|
|
3057
|
+
let e = 1, o = !1, s = 10;
|
|
3058
|
+
for (; s < t.length && e > 0; s++) {
|
|
3059
|
+
const r = t.charCodeAt(s);
|
|
3060
|
+
o ? 34 === r && (34 === t.charCodeAt(s + 1) ? s++ : o = !1) : 34 === r ? o = !0 : 40 === r ? e++ : 41 === r && e--;
|
|
3061
|
+
}
|
|
3062
|
+
if (0 !== e || t.slice(s).trim().length > 0) return;
|
|
3063
|
+
const r = /^HYPERLINK\(\s*"((?:[^"]|"")*)"\s*[,)]/i.exec(t);
|
|
3064
|
+
return r ? r[1].replace(/""/g, "\"") : null;
|
|
3065
|
+
})(P[2]), R.append(G, K, P), z && X.append(G, K)), null !== H && L.push([H, B ? F ? "error" : "dynamic" : "fixed"]), S = !1, P = null, k = null, E = null, x = !1, z = !1, H = null, B = !1, F = !1), Z) {
|
|
3066
|
+
const o = s.indexOf(":");
|
|
3067
|
+
if (-1 !== o && (s = s.slice(o + 1)), U) if ("is" === s || "v" === s) {
|
|
3068
|
+
const e = a?.onEnd?.();
|
|
3069
|
+
null == e || $ && "" === u?.() || t.pushAt(G, K, void 0 !== q && "number" == typeof e ? Q(u?.() ?? "") : "number" == typeof e ? "" + e : e);
|
|
3070
|
+
} else "f" !== s && a?.onCloseTag?.(e);
|
|
3071
|
+
x && (x = !1), "c" === s && (Z = null, U = !1);
|
|
3072
|
+
return;
|
|
3073
|
+
}
|
|
3074
|
+
if (g) return g = !1, void (wt = null);
|
|
3075
|
+
o?.onCloseTag?.(e);
|
|
3076
|
+
}, Pt = (e) => {
|
|
3077
|
+
const r = e.trim();
|
|
3078
|
+
if (x) {
|
|
3079
|
+
switch (J = null, Y) {
|
|
3080
|
+
case null:
|
|
3081
|
+
case "n":
|
|
3082
|
+
J = f.flushSubnormal(parseFloat(r));
|
|
3083
|
+
break;
|
|
3084
|
+
case "b":
|
|
3085
|
+
J = "1" === r || "true" === r;
|
|
3086
|
+
break;
|
|
3087
|
+
case "s": {
|
|
3088
|
+
const t = parseInt(r, 10);
|
|
3089
|
+
let e = v.get(t);
|
|
3090
|
+
if (void 0 === e) {
|
|
3091
|
+
const o = b?.get(t);
|
|
3092
|
+
e = o ? zo(o, y) : null, v.set(t, e);
|
|
3093
|
+
}
|
|
3094
|
+
J = e ? {
|
|
3095
|
+
t: "r",
|
|
3096
|
+
v: {
|
|
3097
|
+
type: "richText",
|
|
3098
|
+
data: { runs: e }
|
|
3099
|
+
}
|
|
3100
|
+
} : r;
|
|
3101
|
+
break;
|
|
3102
|
+
}
|
|
3103
|
+
case "d": {
|
|
3104
|
+
const t = ((t, e = !1) => {
|
|
3105
|
+
if (!t) return null;
|
|
3106
|
+
const o = jo.exec(t);
|
|
3107
|
+
if (o) {
|
|
3108
|
+
const [, t, e, s] = o;
|
|
3109
|
+
return void 0 === t && void 0 === e && void 0 === s ? null : (3600 * parseFloat(t ?? "0") + 60 * parseFloat(e ?? "0") + parseFloat(s ?? "0")) / 86400;
|
|
3110
|
+
}
|
|
3111
|
+
const s = Lo.exec(t);
|
|
3112
|
+
if (!s) return null;
|
|
3113
|
+
const [, r, n, i, a, l, c, h] = s;
|
|
3114
|
+
if (void 0 === r && void 0 === a) return null;
|
|
3115
|
+
let u = 0;
|
|
3116
|
+
if (void 0 !== r) {
|
|
3117
|
+
const t = parseInt(r, 10), o = parseInt(n, 10), s = parseInt(i, 10);
|
|
3118
|
+
if (o < 1 || o > 12 || s < 1 || s > 31) return null;
|
|
3119
|
+
const a = Bo(t, o, s) - Fo;
|
|
3120
|
+
if (u = a <= 60 ? a - 1 : a, e && (u -= 1462), u < 0) return null;
|
|
3121
|
+
}
|
|
3122
|
+
return void 0 !== a && (u += (3600 * parseInt(a, 10) + 60 * parseInt(l, 10) + (void 0 !== c ? parseInt(c, 10) : 0) + (void 0 !== h ? parseFloat(h) : 0)) / 86400), u;
|
|
3123
|
+
})(r, !0 === l?.get(Jo));
|
|
3124
|
+
null !== t ? J = t : c && (s?.(`Date '${r}' in cell ${C.cellToString({
|
|
3125
|
+
colIndex: K,
|
|
3126
|
+
rowIndex: G
|
|
3127
|
+
})} is not a date this workbook can hold; kept as text.`, void 0, "xlsx.cell.isoDateText"), J = "" + c(r));
|
|
3128
|
+
break;
|
|
3129
|
+
}
|
|
3130
|
+
case "e":
|
|
3131
|
+
if ("#VALUE!" === r) {
|
|
3132
|
+
const t = Z.attributes.vm;
|
|
3133
|
+
if (void 0 !== t) {
|
|
3134
|
+
const e = W(t);
|
|
3135
|
+
if (d.isError(e)) {
|
|
3136
|
+
J = {
|
|
3137
|
+
t: "e",
|
|
3138
|
+
v: e.getCode()
|
|
3139
|
+
};
|
|
3140
|
+
break;
|
|
3141
|
+
}
|
|
3142
|
+
if (T.isJSON(e)) {
|
|
3143
|
+
J = {
|
|
3144
|
+
t: "r",
|
|
3145
|
+
v: e
|
|
3146
|
+
};
|
|
3147
|
+
break;
|
|
3148
|
+
}
|
|
3149
|
+
}
|
|
3150
|
+
}
|
|
3151
|
+
const t = d.getBuiltInByLabel(r);
|
|
3152
|
+
t ? J = {
|
|
3153
|
+
t: "e",
|
|
3154
|
+
v: t.getCode()
|
|
3155
|
+
} : (J = r, s?.(`Unknown formula error '${r}' in cell ${C.cellToString({
|
|
3156
|
+
colIndex: K,
|
|
3157
|
+
rowIndex: G
|
|
3158
|
+
})}`));
|
|
3159
|
+
break;
|
|
3160
|
+
case "str":
|
|
3161
|
+
case "inlineStr": U = !0;
|
|
3162
|
+
}
|
|
3163
|
+
null !== J && t.pushAt(G, K, void 0 === q || "number" != typeof J && "boolean" != typeof J ? J : Q(J));
|
|
3164
|
+
}
|
|
3165
|
+
const n = null !== k;
|
|
3166
|
+
if (k) {
|
|
3167
|
+
if (O === k) P = D;
|
|
3168
|
+
else {
|
|
3169
|
+
if (P = V.get(k) ?? null, !P) {
|
|
3170
|
+
const t = [];
|
|
3171
|
+
I = M(r, G, K, t), P = [
|
|
3172
|
+
I,
|
|
3173
|
+
t,
|
|
3174
|
+
r
|
|
3175
|
+
], V.set(k, P);
|
|
3176
|
+
}
|
|
3177
|
+
O = k, D = P;
|
|
3178
|
+
}
|
|
3179
|
+
k = null;
|
|
3180
|
+
}
|
|
3181
|
+
if (S) {
|
|
3182
|
+
let t = r;
|
|
3183
|
+
const e = n ? void 0 : l?.get(Ko);
|
|
3184
|
+
if (e) {
|
|
3185
|
+
const o = ((t) => {
|
|
3186
|
+
if (t.length < Ao.length) return Io;
|
|
3187
|
+
if (t.slice(0, Ao.length).toUpperCase() !== ko) return Io;
|
|
3188
|
+
const e = Oo(t, Ao.length);
|
|
3189
|
+
if (null === e) return Io;
|
|
3190
|
+
if (41 !== t.charCodeAt(e.end)) return Io;
|
|
3191
|
+
if (44 !== t.charCodeAt(e.end + 1)) return Io;
|
|
3192
|
+
if (41 !== t.charCodeAt(t.length - 1)) return Io;
|
|
3193
|
+
const o = e.value;
|
|
3194
|
+
return o.toUpperCase() === Eo ? Po : 0 === o.length ? Io : {
|
|
3195
|
+
kind: "formula",
|
|
3196
|
+
formula: o
|
|
3197
|
+
};
|
|
3198
|
+
})(r);
|
|
3199
|
+
"none" !== o.kind && (_ ??= new No(e), "spilled" === o.kind ? $ = _.placeholder(G, K) : _.anchor(G, K, o.formula) && (t = o.formula, z ||= ((t) => Do(t).some((t) => rt(t) || !0 === A.get(t)?.getDeclaration().getReturnType()?.isVolatile()))(t)));
|
|
3200
|
+
}
|
|
3201
|
+
if ($) z = !1;
|
|
3202
|
+
else {
|
|
3203
|
+
const e = [];
|
|
3204
|
+
I = M(t, G, K, e), P = [
|
|
3205
|
+
I,
|
|
3206
|
+
e,
|
|
3207
|
+
t
|
|
3208
|
+
];
|
|
3209
|
+
}
|
|
3210
|
+
}
|
|
3211
|
+
U ? a?.onText?.(e) : g || o?.onText?.(r);
|
|
3212
|
+
}, Ot = {
|
|
3213
|
+
r: void 0,
|
|
3214
|
+
t: void 0,
|
|
3215
|
+
s: void 0,
|
|
3216
|
+
cm: void 0,
|
|
3217
|
+
vm: void 0
|
|
3218
|
+
}, Dt = {
|
|
3219
|
+
name: "c",
|
|
3220
|
+
attributes: Ot,
|
|
3221
|
+
isSelfClosing: !1
|
|
3222
|
+
}, Nt = {
|
|
3223
|
+
t: void 0,
|
|
3224
|
+
si: void 0,
|
|
3225
|
+
ref: void 0,
|
|
3226
|
+
ca: void 0
|
|
3227
|
+
}, _t = {
|
|
3228
|
+
name: "f",
|
|
3229
|
+
attributes: Nt,
|
|
3230
|
+
isSelfClosing: !1
|
|
3231
|
+
}, $t = {
|
|
3232
|
+
name: "v",
|
|
3233
|
+
attributes: {},
|
|
3234
|
+
isSelfClosing: !1
|
|
3235
|
+
}, Mt = {
|
|
3236
|
+
r: void 0,
|
|
3237
|
+
s: void 0,
|
|
3238
|
+
ht: void 0,
|
|
3239
|
+
hidden: void 0,
|
|
3240
|
+
collapsed: void 0,
|
|
3241
|
+
customHeight: void 0,
|
|
3242
|
+
customFormat: void 0,
|
|
3243
|
+
outlineLevel: void 0
|
|
3244
|
+
}, Rt = {
|
|
3245
|
+
name: "row",
|
|
3246
|
+
attributes: Mt,
|
|
3247
|
+
isSelfClosing: !1
|
|
3248
|
+
}, Vt = bo.NEED_MORE, Lt = bo.NOT_HANDLED, jt = bo.decodeText;
|
|
3249
|
+
let Bt = !1;
|
|
3250
|
+
const Ft = (t, e, o, s) => {
|
|
3251
|
+
for (;;) {
|
|
3252
|
+
let r = 0;
|
|
3253
|
+
for (; e < o && (32 === (r = t.charCodeAt(e)) || 9 === r || 10 === r || 13 === r);) e++;
|
|
3254
|
+
if (e >= o) return Vt;
|
|
3255
|
+
if (62 === r) return Bt = !1, e + 1;
|
|
3256
|
+
if (47 === r) return e + 1 >= o ? Vt : 62 !== t.charCodeAt(e + 1) ? Lt : (Bt = !0, e + 2);
|
|
3257
|
+
const n = e;
|
|
3258
|
+
for (; e < o && 61 !== (r = t.charCodeAt(e));) {
|
|
3259
|
+
if (62 === r || 47 === r || 32 === r || 9 === r || 10 === r || 13 === r) return Lt;
|
|
3260
|
+
e++;
|
|
3261
|
+
}
|
|
3262
|
+
if (e + 1 >= o) return Vt;
|
|
3263
|
+
const i = e - n, a = t.charCodeAt(e + 1);
|
|
3264
|
+
if (34 !== a && 39 !== a) return Lt;
|
|
3265
|
+
const l = e + 2;
|
|
3266
|
+
let c = l;
|
|
3267
|
+
for (; c < o && (r = t.charCodeAt(c)) !== a;) {
|
|
3268
|
+
if (38 === r || r < 32) return Lt;
|
|
3269
|
+
c++;
|
|
3270
|
+
}
|
|
3271
|
+
if (c >= o) return Vt;
|
|
3272
|
+
e = c + 1;
|
|
3273
|
+
const h = t.charCodeAt(n);
|
|
3274
|
+
if (2 === s) switch (i) {
|
|
3275
|
+
case 1:
|
|
3276
|
+
114 === h ? Mt.r = t.slice(l, c) : 115 === h && (Mt.s = t.slice(l, c));
|
|
3277
|
+
break;
|
|
3278
|
+
case 2:
|
|
3279
|
+
t.startsWith("ht", n) && (Mt.ht = t.slice(l, c));
|
|
3280
|
+
break;
|
|
3281
|
+
case 6:
|
|
3282
|
+
t.startsWith("hidden", n) && (Mt.hidden = t.slice(l, c));
|
|
3283
|
+
break;
|
|
3284
|
+
case 9:
|
|
3285
|
+
t.startsWith("collapsed", n) && (Mt.collapsed = t.slice(l, c));
|
|
3286
|
+
break;
|
|
3287
|
+
case 12: t.startsWith("customHeight", n) ? Mt.customHeight = t.slice(l, c) : t.startsWith("customFormat", n) ? Mt.customFormat = t.slice(l, c) : t.startsWith("outlineLevel", n) && (Mt.outlineLevel = t.slice(l, c));
|
|
3288
|
+
}
|
|
3289
|
+
else if (0 === s) 1 === i ? 114 === h ? Ot.r = t.slice(l, c) : 116 === h ? Ot.t = t.slice(l, c) : 115 === h && (Ot.s = t.slice(l, c)) : 2 === i && 109 === t.charCodeAt(n + 1) && (99 === h ? Ot.cm = t.slice(l, c) : 118 === h && (Ot.vm = t.slice(l, c)));
|
|
3290
|
+
else if (1 === i) 116 === h && (Nt.t = t.slice(l, c));
|
|
3291
|
+
else if (2 === i) {
|
|
3292
|
+
const e = t.charCodeAt(n + 1);
|
|
3293
|
+
115 === h && 105 === e ? Nt.si = t.slice(l, c) : 99 === h && 97 === e && (Nt.ca = t.slice(l, c));
|
|
3294
|
+
} else 3 === i && t.startsWith("ref", n) && (Nt.ref = t.slice(l, c));
|
|
3295
|
+
}
|
|
3296
|
+
}, Ht = (t, e, o) => 47 === t.charCodeAt(e + 1) && t.charCodeAt(e + 2) === o && 62 === t.charCodeAt(e + 3);
|
|
3297
|
+
return {
|
|
3298
|
+
...o,
|
|
3299
|
+
onEnd: () => {
|
|
3300
|
+
if (h?.()) {
|
|
3301
|
+
let t = 0;
|
|
3302
|
+
const e = [], o = (t, e) => ({
|
|
3303
|
+
min: t,
|
|
3304
|
+
max: e,
|
|
3305
|
+
value: {
|
|
3306
|
+
sz: -1,
|
|
3307
|
+
csz: !1,
|
|
3308
|
+
h: !0,
|
|
3309
|
+
s: void 0,
|
|
3310
|
+
l: 0,
|
|
3311
|
+
cl: !1
|
|
3312
|
+
}
|
|
3313
|
+
});
|
|
3314
|
+
for (const s of m) s.min > t && e.push(o(t, s.min - 1)), t = Math.max(t, s.max + 1);
|
|
3315
|
+
t <= 1048575 && e.push(o(t, 1048575)), e.length > 0 && (tt.push(...e), tt.sort((t, e) => t.min - e.min));
|
|
3316
|
+
}
|
|
3317
|
+
tt.length > 0 && (e.rows = C.runsToRefs(tt, !1));
|
|
3318
|
+
let s = R.done(es);
|
|
3319
|
+
s = ((t, e) => {
|
|
3320
|
+
let o = null;
|
|
3321
|
+
for (let e = 0; e < t.length; e++) {
|
|
3322
|
+
const s = t[e];
|
|
3323
|
+
if (!os.test(s.value[2])) continue;
|
|
3324
|
+
o ??= /* @__PURE__ */ new Map();
|
|
3325
|
+
const r = s.value[0], n = o.get(r);
|
|
3326
|
+
n ? n.push(s) : o.set(r, [s]);
|
|
3327
|
+
}
|
|
3328
|
+
if (null === o) return t;
|
|
3329
|
+
const s = /* @__PURE__ */ new Set();
|
|
3330
|
+
for (const t of o.values()) {
|
|
3331
|
+
const o = t[0], r = {
|
|
3332
|
+
rowStart: o.rowStart,
|
|
3333
|
+
colStart: o.colStart,
|
|
3334
|
+
rowEnd: o.rowEnd,
|
|
3335
|
+
colEnd: o.colEnd
|
|
3336
|
+
};
|
|
3337
|
+
let n = 0;
|
|
3338
|
+
for (let e = 0; e < t.length; e++) {
|
|
3339
|
+
const o = t[e];
|
|
3340
|
+
o.rowStart < r.rowStart && (r.rowStart = o.rowStart), o.colStart < r.colStart && (r.colStart = o.colStart), o.rowEnd > r.rowEnd && (r.rowEnd = o.rowEnd), o.colEnd > r.colEnd && (r.colEnd = o.colEnd), n += (o.rowEnd - o.rowStart + 1) * (o.colEnd - o.colStart + 1);
|
|
3341
|
+
}
|
|
3342
|
+
if (n !== (r.rowEnd - r.rowStart + 1) * (r.colEnd - r.colStart + 1)) continue;
|
|
3343
|
+
const i = Vo(C.resolveRelativeToA1(o.value[1], r.rowStart, r.colStart), r);
|
|
3344
|
+
if (i) {
|
|
3345
|
+
e.push(i);
|
|
3346
|
+
for (let e = 0; e < t.length; e++) s.add(t[e]);
|
|
3347
|
+
}
|
|
3348
|
+
}
|
|
3349
|
+
return 0 === s.size ? t : t.filter((t) => !s.has(t));
|
|
3350
|
+
})(s, j);
|
|
3351
|
+
const r = s.length;
|
|
3352
|
+
if (r > 0 || j.length > 0) {
|
|
3353
|
+
const t = new Array(r);
|
|
3354
|
+
for (let e = 0; e < r; e++) {
|
|
3355
|
+
const o = s[e], r = C.rangeToString(o), n = o.value[1], i = C.resolveRelativeToA1(n, o.rowStart, o.colStart);
|
|
3356
|
+
t[e] = [r, i];
|
|
3357
|
+
}
|
|
3358
|
+
for (let e = 0; e < j.length; e++) {
|
|
3359
|
+
const o = j[e], s = o.ref;
|
|
3360
|
+
t.push([C.cellToString({
|
|
3361
|
+
rowIndex: s.rowStart,
|
|
3362
|
+
colIndex: s.colStart
|
|
3363
|
+
}), ut(o)]), L.push([C.rangeToString(s), "dynamic"]);
|
|
3364
|
+
}
|
|
3365
|
+
e.formulas = t;
|
|
3366
|
+
}
|
|
3367
|
+
const i = X.done(!0), a = i.length;
|
|
3368
|
+
if (a > 0) {
|
|
3369
|
+
const t = new Array(a);
|
|
3370
|
+
for (let e = 0; e < a; e++) {
|
|
3371
|
+
const o = i[e], s = C.rangeToString(o);
|
|
3372
|
+
t[e] = s;
|
|
3373
|
+
}
|
|
3374
|
+
e.volatile = t;
|
|
3375
|
+
}
|
|
3376
|
+
_ && L.push(..._.getFormulaArray()), L.length > 0 && (e.formulaArray = [...L]);
|
|
3377
|
+
const l = w.length;
|
|
3378
|
+
if (l > 0) {
|
|
3379
|
+
w.sort(n.createRangeComparator(p.Axis.Column));
|
|
3380
|
+
let t = w[0], o = t.colStart, s = t.colEnd, r = t.rowEnd, i = t.value;
|
|
3381
|
+
const a = [];
|
|
3382
|
+
a.push(t);
|
|
3383
|
+
let c = null;
|
|
3384
|
+
for (let e = 1; e < l; e++) c = w[e], i !== c.value || o !== c.colStart || s !== c.colEnd || r + 1 !== c.rowEnd ? (a.push(c), t = c, o = t.colStart, s = t.colEnd, r = t.rowEnd, i = t.value) : (r = c.rowEnd, t.rowEnd = r);
|
|
3385
|
+
const h = a.length, u = new Array(h);
|
|
3386
|
+
for (let t = 0; t < h; t++) {
|
|
3387
|
+
const e = a[t], o = C.rangeToString(e);
|
|
3388
|
+
u[t] = [o, e.value];
|
|
3389
|
+
}
|
|
3390
|
+
e.directStyles = u;
|
|
3391
|
+
}
|
|
3392
|
+
const c = t.build();
|
|
3393
|
+
c && (e.data = c.tuples), o?.onEnd?.();
|
|
3394
|
+
},
|
|
3395
|
+
onOpenTag: Et,
|
|
3396
|
+
onCloseTag: It,
|
|
3397
|
+
onText: Pt,
|
|
3398
|
+
elementScanners: [{
|
|
3399
|
+
name: "c",
|
|
3400
|
+
scan: (t, e, o) => {
|
|
3401
|
+
if (!g || null !== Z) return Lt;
|
|
3402
|
+
Ot.r = Ot.t = Ot.s = Ot.cm = Ot.vm = void 0;
|
|
3403
|
+
let s = Ft(t, e + 2, o, 0);
|
|
3404
|
+
if (s < 0) return s;
|
|
3405
|
+
const r = Ot.t;
|
|
3406
|
+
if (void 0 === Ot.r || "str" === r || "inlineStr" === r) return Lt;
|
|
3407
|
+
let n = !1, i = -1, a = -1, l = -1, c = -1, h = s;
|
|
3408
|
+
if (!Bt) for (Nt.t = Nt.si = Nt.ref = Nt.ca = void 0;;) {
|
|
3409
|
+
const e = t.indexOf("<", s);
|
|
3410
|
+
if (-1 === e || e + 3 >= o) return Vt;
|
|
3411
|
+
for (let o = s; o < e; o++) {
|
|
3412
|
+
const e = t.charCodeAt(o);
|
|
3413
|
+
if (32 !== e && 9 !== e && 10 !== e && 13 !== e) return Lt;
|
|
3414
|
+
}
|
|
3415
|
+
const r = t.charCodeAt(e + 1), u = t.charCodeAt(e + 2);
|
|
3416
|
+
if (47 === r) {
|
|
3417
|
+
if (!Ht(t, e, 99)) return Lt;
|
|
3418
|
+
h = e + 4;
|
|
3419
|
+
break;
|
|
3420
|
+
}
|
|
3421
|
+
if (102 === r && !n && -1 === l && (32 === u || 62 === u || 47 === u)) {
|
|
3422
|
+
if (n = !0, s = Ft(t, e + 2, o, 1), s < 0) return s;
|
|
3423
|
+
if ("dataTable" === Nt.t) return Lt;
|
|
3424
|
+
if (Bt) continue;
|
|
3425
|
+
const r = t.indexOf("<", s);
|
|
3426
|
+
if (-1 === r || r + 3 >= o) return Vt;
|
|
3427
|
+
if (!Ht(t, r, 102)) return Lt;
|
|
3428
|
+
i = s, a = r, s = r + 4;
|
|
3429
|
+
continue;
|
|
3430
|
+
}
|
|
3431
|
+
if (118 === r && 62 === u && -1 === l) {
|
|
3432
|
+
const r = t.indexOf("<", e + 3);
|
|
3433
|
+
if (-1 === r || r + 3 >= o) return Vt;
|
|
3434
|
+
if (!Ht(t, r, 118)) return Lt;
|
|
3435
|
+
l = e + 3, c = r, s = r + 4;
|
|
3436
|
+
continue;
|
|
3437
|
+
}
|
|
3438
|
+
return Lt;
|
|
3439
|
+
}
|
|
3440
|
+
return Et(Dt), n && (Et(_t), a > i && Pt(jt(t.slice(i, a))), It(_t)), -1 !== l && (Et($t), c > l && Pt(jt(t.slice(l, c))), It($t)), It(Dt), h;
|
|
3441
|
+
}
|
|
3442
|
+
}, {
|
|
3443
|
+
name: "row",
|
|
3444
|
+
openTag: Rt,
|
|
3445
|
+
scan: (t, e, o) => {
|
|
3446
|
+
if (!St || g || null !== Z) return Lt;
|
|
3447
|
+
Mt.r = Mt.s = Mt.ht = Mt.hidden = Mt.collapsed = Mt.customHeight = Mt.customFormat = Mt.outlineLevel = void 0;
|
|
3448
|
+
const s = Ft(t, e + 4, o, 2);
|
|
3449
|
+
return s < 0 ? s : Bt || void 0 === Mt.r ? Lt : (Et(Rt), s);
|
|
3450
|
+
}
|
|
3451
|
+
}]
|
|
3452
|
+
};
|
|
3453
|
+
}, is = /* @__PURE__ */ new Map([
|
|
3454
|
+
["urn:schemas-microsoft-com:vml", "v"],
|
|
3455
|
+
["urn:schemas-microsoft-com:office:office", "o"],
|
|
3456
|
+
["urn:schemas-microsoft-com:office:excel", "x"]
|
|
3457
|
+
]), as = [...is].map(([t, e]) => ` xmlns:${e}="${t}"`).join(""), ls = /<(\/?)([A-Za-z_][\w.-]*(?::[\w.-]+)?)((?:[^>"']|"[^"]*"|'[^']*')*?)(\/?)>/g, cs = /(\s+)([A-Za-z_][\w.-]*(?::[\w.-]+)?)(\s*=\s*)("[^"]*"|'[^']*')/g, hs = /\sxmlns(?::([\w.-]+))?\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
|
|
3458
|
+
function us(t) {
|
|
3459
|
+
if (!t || !((t) => {
|
|
3460
|
+
let e;
|
|
3461
|
+
for (hs.lastIndex = 0; null !== (e = hs.exec(t));) {
|
|
3462
|
+
const t = is.get(e[2] ?? e[3] ?? "");
|
|
3463
|
+
if (t && t !== (e[1] ?? "")) return !0;
|
|
3464
|
+
}
|
|
3465
|
+
return !1;
|
|
3466
|
+
})(t)) return t;
|
|
3467
|
+
const e = [], o = (t, o, s) => {
|
|
3468
|
+
const r = t.indexOf(":");
|
|
3469
|
+
if (-1 === r && s) return null;
|
|
3470
|
+
const n = -1 === r ? "" : t.substring(0, r);
|
|
3471
|
+
if ("xmlns" === n) return null;
|
|
3472
|
+
const i = ((t, o) => {
|
|
3473
|
+
const s = o?.get(t);
|
|
3474
|
+
if (void 0 !== s) return s;
|
|
3475
|
+
for (let o = e.length - 1; o >= 0; o--) {
|
|
3476
|
+
const s = e[o].bindings.get(t);
|
|
3477
|
+
if (void 0 !== s) return s;
|
|
3478
|
+
}
|
|
3479
|
+
})(n, o), a = void 0 !== i ? is.get(i) : void 0;
|
|
3480
|
+
return a ? `${a}:${-1 === r ? t : t.substring(r + 1)}` : null;
|
|
3481
|
+
};
|
|
3482
|
+
let s = !1, r = !1;
|
|
3483
|
+
const n = t.replace(ls, (t, n, i, a, l) => {
|
|
3484
|
+
if (n) {
|
|
3485
|
+
const s = e[e.length - 1], r = o(i, null, !1);
|
|
3486
|
+
return s && s.name === i && (s.nested > 0 ? s.nested-- : e.pop()), r ? `</${r}>` : t;
|
|
3487
|
+
}
|
|
3488
|
+
const c = ((t) => {
|
|
3489
|
+
let e, o = null;
|
|
3490
|
+
for (hs.lastIndex = 0; null !== (e = hs.exec(t));) (o ??= /* @__PURE__ */ new Map()).set(e[1] ?? "", e[2] ?? e[3] ?? "");
|
|
3491
|
+
return o;
|
|
3492
|
+
})(a);
|
|
3493
|
+
c?.forEach((t, e) => {
|
|
3494
|
+
const o = [...is].find(([, t]) => t === e)?.[0];
|
|
3495
|
+
o && o !== t && (s = !0);
|
|
3496
|
+
});
|
|
3497
|
+
const h = o(i, c, !1);
|
|
3498
|
+
let u = a.replace(cs, (t, e, s, r, n) => {
|
|
3499
|
+
if ("xmlns" === s || s.startsWith("xmlns:")) {
|
|
3500
|
+
const e = n.slice(1, -1);
|
|
3501
|
+
return is.has(e) ? "" : t;
|
|
3502
|
+
}
|
|
3503
|
+
const i = o(s, c, !0);
|
|
3504
|
+
return i ? `${e}${i}${r}${n}` : t;
|
|
3505
|
+
});
|
|
3506
|
+
if (r || (r = !0, u = u.replace(/\s+$/, "") + as), !l) {
|
|
3507
|
+
const t = e[e.length - 1];
|
|
3508
|
+
c ? e.push({
|
|
3509
|
+
name: i,
|
|
3510
|
+
bindings: c,
|
|
3511
|
+
nested: 0
|
|
3512
|
+
}) : t && t.name === i && t.nested++;
|
|
3513
|
+
}
|
|
3514
|
+
return `<${h ?? i}${u}${l}>`;
|
|
3515
|
+
});
|
|
3516
|
+
return s ? t : n;
|
|
3517
|
+
}
|
|
3518
|
+
var ds = {
|
|
3519
|
+
creator: "author",
|
|
3520
|
+
category: "category",
|
|
3521
|
+
description: "comments",
|
|
3522
|
+
contentStatus: "contentStatus",
|
|
3523
|
+
created: "creationDate",
|
|
3524
|
+
keywords: "keywords",
|
|
3525
|
+
lastModifiedBy: "lastAuthor",
|
|
3526
|
+
modified: "lastModifiedDate",
|
|
3527
|
+
lastPrinted: "lastPrinted",
|
|
3528
|
+
revision: "revisionNumber",
|
|
3529
|
+
subject: "subject",
|
|
3530
|
+
title: "title"
|
|
3531
|
+
}, ps = {
|
|
3532
|
+
Company: "company",
|
|
3533
|
+
Manager: "manager"
|
|
3534
|
+
}, fs = {
|
|
3535
|
+
lpwstr: I.Type.String,
|
|
3536
|
+
lpstr: I.Type.String,
|
|
3537
|
+
bstr: I.Type.String,
|
|
3538
|
+
i1: I.Type.Number,
|
|
3539
|
+
i2: I.Type.Number,
|
|
3540
|
+
i4: I.Type.Number,
|
|
3541
|
+
i8: I.Type.Number,
|
|
3542
|
+
int: I.Type.Number,
|
|
3543
|
+
ui1: I.Type.Number,
|
|
3544
|
+
ui2: I.Type.Number,
|
|
3545
|
+
ui4: I.Type.Number,
|
|
3546
|
+
ui8: I.Type.Number,
|
|
3547
|
+
uint: I.Type.Number,
|
|
3548
|
+
r4: I.Type.Float,
|
|
3549
|
+
r8: I.Type.Float,
|
|
3550
|
+
decimal: I.Type.Float,
|
|
3551
|
+
bool: I.Type.Boolean,
|
|
3552
|
+
filetime: I.Type.Date,
|
|
3553
|
+
date: I.Type.Date
|
|
3554
|
+
}, gs = (t) => {
|
|
3555
|
+
const e = t.kind ? fs[t.kind] : void 0;
|
|
3556
|
+
if (!e) return null;
|
|
3557
|
+
const o = t.value.trim();
|
|
3558
|
+
let s;
|
|
3559
|
+
if (e === I.Type.String) s = {
|
|
3560
|
+
key: t.key,
|
|
3561
|
+
type: e,
|
|
3562
|
+
value: t.value
|
|
3563
|
+
};
|
|
3564
|
+
else if (e === I.Type.Boolean) {
|
|
3565
|
+
if ("true" !== o && "false" !== o && "1" !== o && "0" !== o) return null;
|
|
3566
|
+
s = {
|
|
3567
|
+
key: t.key,
|
|
3568
|
+
type: e,
|
|
3569
|
+
value: "true" === o || "1" === o
|
|
3570
|
+
};
|
|
3571
|
+
} else if (e === I.Type.Date) {
|
|
3572
|
+
const r = new Date(o);
|
|
3573
|
+
if (!o || isNaN(r.getTime())) return null;
|
|
3574
|
+
s = {
|
|
3575
|
+
key: t.key,
|
|
3576
|
+
type: e,
|
|
3577
|
+
value: r.toISOString()
|
|
3578
|
+
};
|
|
3579
|
+
} else {
|
|
3580
|
+
const r = Number(o);
|
|
3581
|
+
if (!o || !Number.isFinite(r)) return null;
|
|
3582
|
+
const n = e === I.Type.Number && r >= -2147483648 && r <= 2147483647;
|
|
3583
|
+
s = {
|
|
3584
|
+
key: t.key,
|
|
3585
|
+
type: n ? e : I.Type.Float,
|
|
3586
|
+
value: r
|
|
3587
|
+
};
|
|
3588
|
+
}
|
|
3589
|
+
return t.linkTarget && (s.linkTarget = t.linkTarget), s;
|
|
3590
|
+
}, ms = "hiddenXfs", bs = (t) => (Array.isArray(t) ? t[1] : t?.v)?.s, ys = (t) => {
|
|
3591
|
+
if (!t || 0 === t.length) return !1;
|
|
3592
|
+
const e = C.refsToRuns(t, !0);
|
|
3593
|
+
let o = 0;
|
|
3594
|
+
for (const t of e) {
|
|
3595
|
+
if (t.min > o || void 0 === t.value?.s) return !1;
|
|
3596
|
+
o = Math.max(o, t.max + 1);
|
|
3597
|
+
}
|
|
3598
|
+
return o > mt;
|
|
3599
|
+
}, vs = (t, e) => {
|
|
3600
|
+
t.protection = {
|
|
3601
|
+
...t.protection,
|
|
3602
|
+
showFormulas: e
|
|
3603
|
+
};
|
|
3604
|
+
}, xs = "pivotButtonXfs", ws = (t, e) => {
|
|
3605
|
+
const o = w(t, e);
|
|
3606
|
+
if (!o || !t.location) return null;
|
|
3607
|
+
const s = C.fastStringToRange(t.location), r = {
|
|
3608
|
+
rowIndex: s.rowStart - o.top,
|
|
3609
|
+
colIndex: s.colStart
|
|
3610
|
+
};
|
|
3611
|
+
return r.rowIndex < 0 || s.rowEnd !== r.rowIndex + o.rows - 1 ? null : {
|
|
3612
|
+
coords: {
|
|
3613
|
+
rowStart: r.rowIndex,
|
|
3614
|
+
colStart: r.colIndex,
|
|
3615
|
+
rowEnd: s.rowEnd,
|
|
3616
|
+
colEnd: r.colIndex + o.columns - 1
|
|
3617
|
+
},
|
|
3618
|
+
origin: r,
|
|
3619
|
+
formats: o
|
|
3620
|
+
};
|
|
3621
|
+
}, Ts = (t, e, o, s) => {
|
|
3622
|
+
let r = t;
|
|
3623
|
+
const n = s?.numberFormat ?? e ?? 0;
|
|
3624
|
+
if (void 0 !== t.numberFormat && Ss(t.numberFormat, n)) {
|
|
3625
|
+
const { numberFormat: t, ...e } = r;
|
|
3626
|
+
r = e;
|
|
3627
|
+
}
|
|
3628
|
+
const i = r.alignment;
|
|
3629
|
+
if (null !== o && i?.horizontal === h.HorizontalAlignment.Left && (i.indent ?? 0) === o) {
|
|
3630
|
+
const { horizontal: t, indent: e, ...o } = i, { alignment: s, ...n } = r;
|
|
3631
|
+
r = Is(o) ? n : {
|
|
3632
|
+
...n,
|
|
3633
|
+
alignment: o
|
|
3634
|
+
};
|
|
3635
|
+
}
|
|
3636
|
+
if (s) {
|
|
3637
|
+
const { numberFormat: t, ...e } = s;
|
|
3638
|
+
if (r = ks(r, e), r.alignment && Is(r.alignment)) {
|
|
3639
|
+
const { alignment: t, ...e } = r;
|
|
3640
|
+
r = e;
|
|
3641
|
+
}
|
|
3642
|
+
}
|
|
3643
|
+
if (r === t) return t;
|
|
3644
|
+
for (const t of Object.keys(r)) if (void 0 !== r[t] && ("named" !== t || r.named !== u.BuiltInName.Normal)) return r;
|
|
3645
|
+
return null;
|
|
3646
|
+
}, Ss = (t, e) => t === e || c.toBuiltInID(t) === c.toBuiltInID(e), Cs = (t) => "object" == typeof t && null !== t && !Array.isArray(t), As = (t, e) => !(!Cs(t) || !Cs(e)) && ("solid" === t.patternType && "solid" === e.patternType ? t.foreground === e.foreground : a.JSONStableStringify(t) === a.JSONStableStringify(e)), ks = (t, e) => {
|
|
3647
|
+
let o = null;
|
|
3648
|
+
const s = (e, s) => {
|
|
3649
|
+
o ??= { ...t }, void 0 === s ? delete o[e] : o[e] = s;
|
|
3650
|
+
};
|
|
3651
|
+
for (const o of Object.keys(t)) {
|
|
3652
|
+
const r = t[o], n = e[o];
|
|
3653
|
+
if (void 0 !== n && void 0 !== r) if ("fill" === o) As(r, n) && s(o);
|
|
3654
|
+
else if (Cs(r) && Cs(n)) {
|
|
3655
|
+
const t = ks(r, n);
|
|
3656
|
+
t !== r && s(o, Object.keys(t).some((e) => void 0 !== t[e]) ? t : void 0);
|
|
3657
|
+
} else r === n && s(o);
|
|
3658
|
+
}
|
|
3659
|
+
return o ?? t;
|
|
3660
|
+
}, Es = {
|
|
3661
|
+
vertical: h.VerticalAlignment.Bottom,
|
|
3662
|
+
relativeIndent: 0,
|
|
3663
|
+
overflow: h.Overflow.Visible,
|
|
3664
|
+
rotation: 0
|
|
3665
|
+
}, Is = (t) => Object.keys(t).every((e) => void 0 === t[e] || Es[e] === t[e]), Ps = (t, e) => {
|
|
3666
|
+
const o = Math.max(t.rowStart, e.rowStart), s = Math.min(t.rowEnd, e.rowEnd), r = Math.max(t.colStart, e.colStart), n = Math.min(t.colEnd, e.colEnd);
|
|
3667
|
+
return o <= s && r <= n ? {
|
|
3668
|
+
rowStart: o,
|
|
3669
|
+
rowEnd: s,
|
|
3670
|
+
colStart: r,
|
|
3671
|
+
colEnd: n
|
|
3672
|
+
} : null;
|
|
3673
|
+
}, Os = (t, e) => {
|
|
3674
|
+
const o = [];
|
|
3675
|
+
return t.rowStart < e.rowStart && o.push({
|
|
3676
|
+
...t,
|
|
3677
|
+
rowEnd: e.rowStart - 1
|
|
3678
|
+
}), t.rowEnd > e.rowEnd && o.push({
|
|
3679
|
+
...t,
|
|
3680
|
+
rowStart: e.rowEnd + 1
|
|
3681
|
+
}), t.colStart < e.colStart && o.push({
|
|
3682
|
+
rowStart: e.rowStart,
|
|
3683
|
+
rowEnd: e.rowEnd,
|
|
3684
|
+
colStart: t.colStart,
|
|
3685
|
+
colEnd: e.colStart - 1
|
|
3686
|
+
}), t.colEnd > e.colEnd && o.push({
|
|
3687
|
+
rowStart: e.rowStart,
|
|
3688
|
+
rowEnd: e.rowEnd,
|
|
3689
|
+
colStart: e.colEnd + 1,
|
|
3690
|
+
colEnd: t.colEnd
|
|
3691
|
+
}), o;
|
|
3692
|
+
}, Ds = "xfComplements", Ns = (t, e) => {
|
|
3693
|
+
if ("string" == typeof t) return void e.push(t);
|
|
3694
|
+
const o = Array.isArray(t) ? t : [t];
|
|
3695
|
+
for (let t = 0; t < o.length; t++) {
|
|
3696
|
+
const s = C.rangeToString(o[t]);
|
|
3697
|
+
s && e.push(s);
|
|
3698
|
+
}
|
|
3699
|
+
}, _s = (t) => {
|
|
3700
|
+
const e = Array.isArray(t) ? t[1] : t.v;
|
|
3701
|
+
if (!e || !("s" in e)) return;
|
|
3702
|
+
const o = e.s;
|
|
3703
|
+
return delete e.s, o;
|
|
3704
|
+
}, $s = (t, e, o, s) => {
|
|
3705
|
+
if (!t) return;
|
|
3706
|
+
const r = e ? 2 : 1, n = e ? o.rowStart : o.colStart, i = e ? o.rowEnd : o.colEnd;
|
|
3707
|
+
let a, l = -1;
|
|
3708
|
+
for (const o of t) {
|
|
3709
|
+
const t = C.refToRun(o, e), c = _s(o);
|
|
3710
|
+
t && void 0 !== c ? c !== l || (e ? a.colEnd : a.rowEnd) + 1 !== t.min ? (a = {
|
|
3711
|
+
colStart: e ? t.min : n,
|
|
3712
|
+
rowStart: e ? n : t.min,
|
|
3713
|
+
colEnd: e ? t.max : i,
|
|
3714
|
+
rowEnd: e ? i : t.max,
|
|
3715
|
+
value: {
|
|
3716
|
+
kind: r,
|
|
3717
|
+
index: c
|
|
3718
|
+
}
|
|
3719
|
+
}, l = c, s.push(a)) : e ? a.colEnd = t.max : a.rowEnd = t.max : l = -1;
|
|
3720
|
+
}
|
|
3721
|
+
}, Ms = {
|
|
3722
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": "workbooks",
|
|
3723
|
+
"application/vnd.ms-excel.sheet.macroEnabled.main+xml": "workbooks",
|
|
3724
|
+
"application/vnd.ms-excel.sheet.binary.macroEnabled.main": "workbooks",
|
|
3725
|
+
"application/vnd.ms-excel.addin.macroEnabled.main+xml": "workbooks",
|
|
3726
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": "workbooks",
|
|
3727
|
+
"application/vnd.ms-excel.template.macroEnabled.main+xml": "workbooks",
|
|
3728
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": "sheets",
|
|
3729
|
+
"application/vnd.ms-excel.worksheet": "sheets",
|
|
3730
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": "charts",
|
|
3731
|
+
"application/vnd.ms-excel.chartsheet": "charts",
|
|
3732
|
+
"application/vnd.ms-excel.macrosheet+xml": "macros",
|
|
3733
|
+
"application/vnd.ms-excel.macrosheet": "macros",
|
|
3734
|
+
"application/vnd.ms-excel.intlmacrosheet+xml": "macros",
|
|
3735
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": "dialogs",
|
|
3736
|
+
"application/vnd.ms-excel.dialogsheet": "dialogs",
|
|
3737
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml": "strs",
|
|
3738
|
+
"application/vnd.ms-excel.sharedStrings": "strs",
|
|
3739
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": "styles",
|
|
3740
|
+
"application/vnd.ms-excel.styles": "styles",
|
|
3741
|
+
"application/vnd.openxmlformats-package.core-properties+xml": "coreprops",
|
|
3742
|
+
"application/vnd.openxmlformats-officedocument.custom-properties+xml": "custprops",
|
|
3743
|
+
"application/vnd.openxmlformats-officedocument.extended-properties+xml": "extprops",
|
|
3744
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": "comments",
|
|
3745
|
+
"application/vnd.ms-excel.comments": "comments",
|
|
3746
|
+
"application/vnd.ms-excel.threadedcomments+xml": "threadedcomments",
|
|
3747
|
+
"application/vnd.ms-excel.person+xml": "people",
|
|
3748
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml": "metadata",
|
|
3749
|
+
"application/vnd.ms-excel.sheetMetadata": "metadata",
|
|
3750
|
+
"application/vnd.ms-excel.featurepropertybag+xml": "featurePropertyBag",
|
|
3751
|
+
"application/vnd.ms-excel.externalLink": "links",
|
|
3752
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml": "links",
|
|
3753
|
+
"application/vnd.openxmlformats-officedocument.theme+xml": "themes"
|
|
3754
|
+
}, Rs = Vt({ readXLSX: () => Fs }), Vs = (t) => t.startsWith("/") ? t.slice(1) : t, Ls = [
|
|
3755
|
+
208,
|
|
3756
|
+
207,
|
|
3757
|
+
17,
|
|
3758
|
+
224,
|
|
3759
|
+
161,
|
|
3760
|
+
177,
|
|
3761
|
+
26,
|
|
3762
|
+
225
|
|
3763
|
+
], js = /^xl\/worksheets\/[^/]+\.xml$/i, Bs = (t) => "string" == typeof t ? t : (t?.runs ?? []).map((t) => t.text ?? "").join(""), Fs = async (n, l) => {
|
|
3764
|
+
const { password: c, onVBA: h, profile: d, calcOnLoad: p = "auto", createWorkbookOptions: f = {}, ...g } = l ?? {};
|
|
3765
|
+
await y.load();
|
|
3766
|
+
const m = !!f.origin && "string" != typeof f.origin, b = d ? new de("function" == typeof d ? d : void 0) : null, v = [], w = (t, e, o) => {
|
|
3767
|
+
v.push([
|
|
3768
|
+
t,
|
|
3769
|
+
e ?? "",
|
|
3770
|
+
o
|
|
3771
|
+
]);
|
|
3772
|
+
}, T = { onWarning: w }, I = l?.progress, P = I?.onProgress ? I.onProgress.bind(I) : void 0, O = n.byteLength;
|
|
3773
|
+
let D = 0, N = 0;
|
|
3774
|
+
const $ = P ? (t) => {
|
|
3775
|
+
if (D <= 0) return;
|
|
3776
|
+
N += t;
|
|
3777
|
+
const e = Math.min(O, Math.round(N / D * O));
|
|
3778
|
+
P(e, O);
|
|
3779
|
+
} : void 0, M = import("./CIqJdIUKSLZkNwHy.js");
|
|
3780
|
+
let R = null;
|
|
3781
|
+
try {
|
|
3782
|
+
R = new DOMParser();
|
|
3783
|
+
} catch (n) {}
|
|
3784
|
+
let F = null;
|
|
3785
|
+
try {
|
|
3786
|
+
F = new XMLSerializer();
|
|
3787
|
+
} catch (n) {}
|
|
3788
|
+
let H, z, q, G = null;
|
|
3789
|
+
R || (G = import("./C-AIgWmHugqMcl9J.js").then((e) => t(e.default, 1)));
|
|
3790
|
+
try {
|
|
3791
|
+
const [t, e] = await Promise.all([G, M]);
|
|
3792
|
+
H = new e.DOMTransformer(), z = R ?? new t.DOMParser(), q = F ?? new t.XMLSerializer();
|
|
3793
|
+
} catch (n) {
|
|
3794
|
+
throw new Error("Unable to load XLSX parser.", { cause: n });
|
|
3795
|
+
}
|
|
3796
|
+
const K = (t) => q.serializeToString(t);
|
|
3797
|
+
if (((t) => {
|
|
3798
|
+
if (t.byteLength < Ls.length) return !1;
|
|
3799
|
+
const e = new Uint8Array(t, 0, Ls.length);
|
|
3800
|
+
return Ls.every((t, o) => e[o] === t);
|
|
3801
|
+
})(n)) throw new i("This is an Excel 97-2003 workbook (.xls), which cannot be read. Save it as '.xlsx' and try again.");
|
|
3802
|
+
let J;
|
|
3803
|
+
try {
|
|
3804
|
+
J = await ue.create(n);
|
|
3805
|
+
} catch (n) {
|
|
3806
|
+
throw new i("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.", { cause: n });
|
|
3807
|
+
}
|
|
3808
|
+
b?.mark("zip-open");
|
|
3809
|
+
try {
|
|
3810
|
+
if (!J.has("[Content_Types].xml")) throw new i("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
|
|
3811
|
+
const t = (t) => {
|
|
3812
|
+
const e = J.getEntry(t);
|
|
3813
|
+
return e ? { content: e } : void 0;
|
|
3814
|
+
}, o = {
|
|
3815
|
+
workbooks: [],
|
|
3816
|
+
sheets: [],
|
|
3817
|
+
charts: [],
|
|
3818
|
+
dialogs: [],
|
|
3819
|
+
macros: [],
|
|
3820
|
+
strs: [],
|
|
3821
|
+
comments: [],
|
|
3822
|
+
threadedcomments: [],
|
|
3823
|
+
links: [],
|
|
3824
|
+
coreprops: [],
|
|
3825
|
+
extprops: [],
|
|
3826
|
+
custprops: [],
|
|
3827
|
+
themes: [],
|
|
3828
|
+
styles: [],
|
|
3829
|
+
metadata: [],
|
|
3830
|
+
people: [],
|
|
3831
|
+
featurePropertyBag: [],
|
|
3832
|
+
overrides: {},
|
|
3833
|
+
sst: "",
|
|
3834
|
+
style: "",
|
|
3835
|
+
defaults: {}
|
|
3836
|
+
};
|
|
3837
|
+
{
|
|
3838
|
+
const t = ((t) => ({
|
|
3839
|
+
onOpenTag: (e) => {
|
|
3840
|
+
const o = ((t) => {
|
|
3841
|
+
const e = t.indexOf(":");
|
|
3842
|
+
return -1 === e ? t : t.slice(e + 1);
|
|
3843
|
+
})(e.name), s = e.attributes;
|
|
3844
|
+
if ("Override" === o) {
|
|
3845
|
+
const e = s.ContentType, o = s.PartName;
|
|
3846
|
+
if (!e || !o) return;
|
|
3847
|
+
t.overrides[o.startsWith("/") ? o.slice(1) : o] = e;
|
|
3848
|
+
const r = Ms[e], n = r ? t[r] : void 0;
|
|
3849
|
+
Array.isArray(n) && n.push(o);
|
|
3850
|
+
} else if ("Default" === o) {
|
|
3851
|
+
const e = s.Extension, o = s.ContentType;
|
|
3852
|
+
e && (t.defaults[e.toLowerCase()] = o);
|
|
3853
|
+
}
|
|
3854
|
+
},
|
|
3855
|
+
onEnd: () => {
|
|
3856
|
+
t.sst = t.strs.length > 0 ? t.strs[0] : "", t.style = t.styles.length > 0 ? t.styles[0] : "";
|
|
3857
|
+
},
|
|
3858
|
+
onError: (t) => {
|
|
3859
|
+
((t) => {
|
|
3860
|
+
v.push([t, "[Content_Types].xml"]);
|
|
3861
|
+
})(`Error parsing content types: ${t?.message ?? t}`);
|
|
3862
|
+
}
|
|
3863
|
+
}))(o), e = await J.getTextStream("[Content_Types].xml");
|
|
3864
|
+
if (!e) throw new Error("Error parsing content types: '[Content_Types].xml'");
|
|
3865
|
+
try {
|
|
3866
|
+
await Ie.parseStream(e, t, { xmlns: !1 });
|
|
3867
|
+
} catch (n) {
|
|
3868
|
+
throw new Error("Error parsing content types: '[Content_Types].xml'", { cause: n });
|
|
3869
|
+
}
|
|
3870
|
+
m && await J.getBuffer("[Content_Types].xml");
|
|
3871
|
+
}
|
|
3872
|
+
b?.mark("content-types");
|
|
3873
|
+
const l = o.sst, c = /* @__PURE__ */ new Set();
|
|
3874
|
+
for (const t of o.sheets) c.add(Vs(t));
|
|
3875
|
+
l && c.add(Vs(l));
|
|
3876
|
+
for (const t of c) D += J.uncompressedSize(t);
|
|
3877
|
+
if (await J.prefetch((t) => !c.has(t) && !js.test(t)), b?.mark("prefetch-side-parts"), 0 === o.workbooks.length) {
|
|
3878
|
+
const e = Rt("_rels/.rels", t, z, H, T), s = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument";
|
|
3879
|
+
if (e) {
|
|
3880
|
+
for (const t of e.values()) if (t.type === s && t.target) {
|
|
3881
|
+
o.workbooks.push(t.target);
|
|
3882
|
+
break;
|
|
3883
|
+
}
|
|
3884
|
+
}
|
|
3885
|
+
}
|
|
3886
|
+
if (0 === o.workbooks.length) throw new i("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
|
|
3887
|
+
const g = f?.resources ?? new S(), y = g.beginPersist(), N = {}, M = /* @__PURE__ */ new Set(), R = /* @__PURE__ */ new Map();
|
|
3888
|
+
R.set("parseInlineDxf", (t) => {
|
|
3889
|
+
if (!t) return;
|
|
3890
|
+
const e = z.parseFromString(`<dxf xmlns:x14="${Y}" xmlns:xm="${U}">${t}</dxf>`, "text/xml")?.documentElement;
|
|
3891
|
+
if (!e) return;
|
|
3892
|
+
const o = H.parseDxf(e, "", T);
|
|
3893
|
+
return Object.keys(o).length > 0 ? o : void 0;
|
|
3894
|
+
});
|
|
3895
|
+
const F = Ht("metadata", o, t, z, H, T).entries().next()?.value?.[1]?.metadata;
|
|
3896
|
+
F && R.set("metadata", F), R.set(Go, ct());
|
|
3897
|
+
const q = /* @__PURE__ */ new Map(), G = [], tt = /* @__PURE__ */ new Set(), et = (t) => {
|
|
3898
|
+
tt.add(Vs(t));
|
|
3899
|
+
}, ot = (e, o = q) => {
|
|
3900
|
+
const s = e.lastIndexOf("/"), r = e.substring(0, s + 1) + "_rels/" + e.substring(s + 1, e.length) + ".rels";
|
|
3901
|
+
let n = o.get(r);
|
|
3902
|
+
return n || (n = Rt(r, t, z, H, wt), o.set(r, n)), n;
|
|
3903
|
+
}, st = (e, o, s, r = q) => {
|
|
3904
|
+
let n = ot(o, r).get(e), i = n?.target;
|
|
3905
|
+
if (!i) return null;
|
|
3906
|
+
if ("External" === n.targetMode) {
|
|
3907
|
+
if (!s) return n.target;
|
|
3908
|
+
const t = g.add({ source: { external: n.target } });
|
|
3909
|
+
return t.addReference(N), M.add(t), y.toResourceId(t);
|
|
3910
|
+
}
|
|
3911
|
+
const a = o.lastIndexOf("/"), l = o.substring(0, a + 1);
|
|
3912
|
+
i.startsWith("/") || (i = l + i), i = dt(i);
|
|
3913
|
+
const c = H?.getVisitorParamsState().get("dxfs");
|
|
3914
|
+
let h = r.get(i);
|
|
3915
|
+
if (!h) {
|
|
3916
|
+
const e = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet", o = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink";
|
|
3917
|
+
if (n.type === e) {
|
|
3918
|
+
const t = {};
|
|
3919
|
+
h = t;
|
|
3920
|
+
const e = async () => {
|
|
3921
|
+
const e = Yo(t, (t, e) => "legacyDrawing" === e ? at(t, i) : "formControl" === e ? lt(t, i) : "part" === e ? ht(t, i) : st(t, i, "resource" === e) ?? null, Ot, c, () => {}, (t, e, o) => {
|
|
3922
|
+
w(t, e ? `${e} (${i})` : i, o);
|
|
3923
|
+
}, void 0, R), o = await J.getTextStream(i, $);
|
|
3924
|
+
if (o) try {
|
|
3925
|
+
await Ie.parseStream(o, e, {
|
|
3926
|
+
xmlns: !1,
|
|
3927
|
+
lean: !0
|
|
3928
|
+
});
|
|
3929
|
+
} catch (t) {
|
|
3930
|
+
throw new Error(`Error parsing sheet: '${i}'`, { cause: t });
|
|
3931
|
+
}
|
|
3932
|
+
const s = ot(i, r);
|
|
3933
|
+
if (s) {
|
|
3934
|
+
it(t, i, s, r), gt(t), Jt(t);
|
|
3935
|
+
const e = [];
|
|
3936
|
+
s.forEach((t, o) => {
|
|
3937
|
+
if ("http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable" !== t.type) return;
|
|
3938
|
+
const s = ht(o, i, t.type, (t) => "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition" !== t);
|
|
3939
|
+
if (!s?.xml) return;
|
|
3940
|
+
const r = /<pivotTableDefinition\b[^>]*>/.exec(s.xml)?.[0] ?? "", n = parseInt(/\scacheId="(\d+)"/.exec(r)?.[1] ?? "", 10);
|
|
3941
|
+
if (isNaN(n)) return void v.push([`Pivot table '${s.name}' names no cache and was dropped.`, i]);
|
|
3942
|
+
const a = /\sname="([^"]*)"/.exec(r)?.[1], l = Xt(s.xml);
|
|
3943
|
+
if (!l) return void v.push([`Pivot table '${s.name}' states no location and was dropped.`, i]);
|
|
3944
|
+
const c = H?.getVisitorParamsState(), h = Kt(c?.get("numFmts"), c?.get("dxfs")), u = X(s.xml, h), d = u ? void 0 : yt(s.xml, h);
|
|
3945
|
+
e.push({
|
|
3946
|
+
...a ? { name: qt(a) } : {},
|
|
3947
|
+
cacheId: n,
|
|
3948
|
+
location: l,
|
|
3949
|
+
part: s,
|
|
3950
|
+
...d ? { partFormats: d } : {},
|
|
3951
|
+
...u
|
|
3952
|
+
});
|
|
3953
|
+
}), e.length > 0 && (t.pivotTables = e);
|
|
3954
|
+
}
|
|
3955
|
+
};
|
|
3956
|
+
G.push(e());
|
|
3957
|
+
} else if (n.type === o) {
|
|
3958
|
+
const e = jt(i, t, z, H, wt);
|
|
3959
|
+
if (e && 0 !== Object.keys(e).length) {
|
|
3960
|
+
const t = e, o = t.__bookRelId, s = t.__absoluteUrlRelId;
|
|
3961
|
+
delete t.__bookRelId, delete t.__absoluteUrlRelId;
|
|
3962
|
+
const n = [];
|
|
3963
|
+
ot(i, r)?.forEach((t, e) => {
|
|
3964
|
+
if ("External" === t.targetMode && t.type && t.target) {
|
|
3965
|
+
const r = {
|
|
3966
|
+
type: t.type,
|
|
3967
|
+
target: t.target
|
|
3968
|
+
};
|
|
3969
|
+
e === o ? r.role = "book" : e === s && (r.role = "absoluteUrl"), n.push(r);
|
|
3970
|
+
}
|
|
3971
|
+
}), n.sort((t, e) => ("book" === t.role ? 0 : 1) - ("book" === e.role ? 0 : 1)), t.sources = n, et(i), h = t;
|
|
3972
|
+
} else h = null;
|
|
3973
|
+
} else h = s ? Q(i, t, (t, e) => {
|
|
3974
|
+
const o = g.add({ source: { buffer: t } });
|
|
3975
|
+
return o.addReference(N), M.add(o), y.toResourceId(o);
|
|
3976
|
+
}, wt) : jt(i, t, z, H, wt);
|
|
3977
|
+
}
|
|
3978
|
+
return h;
|
|
3979
|
+
}, rt = (t, e) => {
|
|
3980
|
+
if (!t) return null;
|
|
3981
|
+
const o = ot(e, q)?.get(t);
|
|
3982
|
+
if (!o?.target || "External" === o.targetMode) return null;
|
|
3983
|
+
let s = o.target;
|
|
3984
|
+
return s.startsWith("/") || (s = e.substring(0, e.lastIndexOf("/") + 1) + s), dt(s);
|
|
3985
|
+
}, it = (t, e, o, s) => {
|
|
3986
|
+
const n = [], i = /* @__PURE__ */ new Map(), a = [];
|
|
3987
|
+
o.forEach((t, o) => {
|
|
3988
|
+
if ("http://schemas.microsoft.com/office/2017/10/relationships/threadedComment" !== t.type) return;
|
|
3989
|
+
const r = st(o, e, !1, s)?.comments;
|
|
3990
|
+
if (!r) return;
|
|
3991
|
+
for (let t = 0; t < r.length; t++) {
|
|
3992
|
+
const e = r[t];
|
|
3993
|
+
if (!e?.v?.id) continue;
|
|
3994
|
+
const { parentId: o, done: s, content: l, ...c } = e.v, h = {
|
|
3995
|
+
...c,
|
|
3996
|
+
content: Bs(l)
|
|
3997
|
+
};
|
|
3998
|
+
o ? a.push({
|
|
3999
|
+
parentId: o,
|
|
4000
|
+
json: h
|
|
4001
|
+
}) : (s && (h.done = !0), i.set(h.id, h), n.push({
|
|
4002
|
+
r: e.r,
|
|
4003
|
+
v: h
|
|
4004
|
+
}));
|
|
4005
|
+
}
|
|
4006
|
+
const l = rt(o, e);
|
|
4007
|
+
l && et(l);
|
|
4008
|
+
});
|
|
4009
|
+
for (let t = 0; t < a.length; t++) {
|
|
4010
|
+
const { parentId: e, json: o } = a[t], s = i.get(e);
|
|
4011
|
+
s && (s.replies ??= []).push(o);
|
|
4012
|
+
}
|
|
4013
|
+
const l = [];
|
|
4014
|
+
if (o.forEach((t, o) => {
|
|
4015
|
+
if ("http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments" !== t.type) return;
|
|
4016
|
+
const n = st(o, e, !1, s), a = n?.comments;
|
|
4017
|
+
if (!a) return;
|
|
4018
|
+
const c = n?.authors;
|
|
4019
|
+
for (let t = 0; t < a.length; t++) {
|
|
4020
|
+
const e = a[t];
|
|
4021
|
+
if (!e?.r) continue;
|
|
4022
|
+
let o = c && void 0 !== e.v.authorId ? c[e.v.authorId] : void 0;
|
|
4023
|
+
if (o && o.startsWith("tc=")) {
|
|
4024
|
+
if (i.has(B(o.substring(3)))) continue;
|
|
4025
|
+
o = void 0;
|
|
4026
|
+
}
|
|
4027
|
+
const s = {
|
|
4028
|
+
id: r.uuidV4().toUpperCase(),
|
|
4029
|
+
asNote: !0,
|
|
4030
|
+
content: e.v.content ?? ""
|
|
4031
|
+
}, n = o ? xt({ displayName: o }) : void 0;
|
|
4032
|
+
n && (s.personId = n.id), l.push({
|
|
4033
|
+
r: e.r,
|
|
4034
|
+
v: s
|
|
4035
|
+
});
|
|
4036
|
+
}
|
|
4037
|
+
const h = rt(o, e);
|
|
4038
|
+
h && et(h);
|
|
4039
|
+
}), 0 === n.length && 0 === l.length) return;
|
|
4040
|
+
const c = [...n, ...l], h = t.legacyDrawing;
|
|
4041
|
+
if (h?.xml) {
|
|
4042
|
+
const { rest: e, notes: o } = L(h.xml);
|
|
4043
|
+
if (o.length > 0) {
|
|
4044
|
+
const s = /* @__PURE__ */ new Map();
|
|
4045
|
+
for (let t = 0; t < o.length; t++) {
|
|
4046
|
+
const e = o[t];
|
|
4047
|
+
s.set(C.cellToString({
|
|
4048
|
+
rowIndex: e.row,
|
|
4049
|
+
colIndex: e.col
|
|
4050
|
+
}), e);
|
|
4051
|
+
}
|
|
4052
|
+
for (let t = 0; t < c.length; t++) {
|
|
4053
|
+
const e = c[t], o = s.get(String(e.r).toUpperCase());
|
|
4054
|
+
if (!o) continue;
|
|
4055
|
+
if (s.delete(String(e.r).toUpperCase()), !e.v.asNote) continue;
|
|
4056
|
+
const r = Z(o.xml), n = {};
|
|
4057
|
+
if (r.anchor) {
|
|
4058
|
+
const [t, e, s, i, a, l, c, h] = r.anchor;
|
|
4059
|
+
n.anchor = {
|
|
4060
|
+
tl: {
|
|
4061
|
+
c: t - o.col,
|
|
4062
|
+
x: e,
|
|
4063
|
+
r: s - o.row,
|
|
4064
|
+
y: i
|
|
4065
|
+
},
|
|
4066
|
+
br: {
|
|
4067
|
+
c: a - o.col,
|
|
4068
|
+
x: l,
|
|
4069
|
+
r: c - o.row,
|
|
4070
|
+
y: h
|
|
4071
|
+
}
|
|
4072
|
+
};
|
|
4073
|
+
} else r.bounds && (n.bounds = r.bounds);
|
|
4074
|
+
r.style.fill && (n.fill = r.style.fill), r.style.stroke && (n.stroke = r.style.stroke), r.xml && (n.xml = r.xml), (n.anchor || n.bounds || n.fill || n.stroke || n.xml) && (e.v.box = n), r.visible && (e.v.shown = !0), r.alt && (e.v.description = r.alt);
|
|
4075
|
+
}
|
|
4076
|
+
const r = [];
|
|
4077
|
+
s.forEach((t) => {
|
|
4078
|
+
r.push(t.xml);
|
|
4079
|
+
});
|
|
4080
|
+
const n = V(e, r);
|
|
4081
|
+
n ? h.xml = n : delete t.legacyDrawing;
|
|
4082
|
+
}
|
|
4083
|
+
}
|
|
4084
|
+
t.comments = c;
|
|
4085
|
+
}, at = (e, o) => {
|
|
4086
|
+
const s = rt(e, o);
|
|
4087
|
+
if (!s) return null;
|
|
4088
|
+
const r = t(Vs(s));
|
|
4089
|
+
if (!r) return null;
|
|
4090
|
+
const n = { xml: us(new TextDecoder("utf-8").decode(r.content)) }, i = [];
|
|
4091
|
+
return ot(s, q)?.forEach((t, e) => {
|
|
4092
|
+
if ("http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" !== t.type) return;
|
|
4093
|
+
const o = st(e, s, !0);
|
|
4094
|
+
"number" == typeof o && i.push({
|
|
4095
|
+
id: e,
|
|
4096
|
+
resId: o
|
|
4097
|
+
});
|
|
4098
|
+
}), i.length > 0 && (n.images = i), et(s), n;
|
|
4099
|
+
}, lt = (e, o) => {
|
|
4100
|
+
const s = rt(e, o);
|
|
4101
|
+
if (!s) return null;
|
|
4102
|
+
const r = jt(s, t, z, H, wt)?.formControl ?? null;
|
|
4103
|
+
return r && et(s), r;
|
|
4104
|
+
}, ht = (e, s, r, n, i = /* @__PURE__ */ new Set()) => {
|
|
4105
|
+
const a = rt(e, s);
|
|
4106
|
+
if (!a || i.has(a)) return null;
|
|
4107
|
+
const l = r ?? ot(s, q)?.get(e)?.type;
|
|
4108
|
+
if (!l) return null;
|
|
4109
|
+
const c = t(Vs(a));
|
|
4110
|
+
if (!c) return null;
|
|
4111
|
+
i.add(a);
|
|
4112
|
+
const h = a.substring(a.lastIndexOf("/") + 1), u = o.overrides[Vs(a)] ?? o.defaults[h.substring(h.lastIndexOf(".") + 1).toLowerCase()], d = {
|
|
4113
|
+
id: e,
|
|
4114
|
+
type: l,
|
|
4115
|
+
name: h
|
|
4116
|
+
};
|
|
4117
|
+
if (u && (d.contentType = u), ((t, e) => t ? t.endsWith("+xml") || "application/xml" === t : /\.(xml|rels|vml)$/i.test(e))(u, h)) d.xml = new TextDecoder("utf-8").decode(c.content);
|
|
4118
|
+
else {
|
|
4119
|
+
const t = st(e, s, !0);
|
|
4120
|
+
if ("number" != typeof t) return null;
|
|
4121
|
+
d.resId = t;
|
|
4122
|
+
}
|
|
4123
|
+
const p = [];
|
|
4124
|
+
return ot(a, q)?.forEach((t, e) => {
|
|
4125
|
+
if (!t?.type) return;
|
|
4126
|
+
if (n && !n(t.type)) return;
|
|
4127
|
+
if ("External" === t.targetMode) {
|
|
4128
|
+
const o = st(e, a, !0);
|
|
4129
|
+
"number" == typeof o && p.push({
|
|
4130
|
+
id: e,
|
|
4131
|
+
type: t.type,
|
|
4132
|
+
resId: o
|
|
4133
|
+
});
|
|
4134
|
+
return;
|
|
4135
|
+
}
|
|
4136
|
+
const o = ht(e, a, t.type, n, i);
|
|
4137
|
+
o && p.push(o);
|
|
4138
|
+
}), p.length > 0 && (d.parts = p), et(a), d;
|
|
4139
|
+
}, ut = Ht("coreprops", o, t, z, H, T), pt = Ht("extprops", o, t, z, H, T), ft = Ht("custprops", o, t, z, H, T);
|
|
4140
|
+
ft.forEach((t, e) => {
|
|
4141
|
+
t?.custom && et(e);
|
|
4142
|
+
});
|
|
4143
|
+
const mt = new k(), bt = Ht("people", o, t, z, H, T);
|
|
4144
|
+
if (bt.size > 0) {
|
|
4145
|
+
const [t, e] = bt.entries().next().value;
|
|
4146
|
+
mt.fromJSON(e?.persons), et(t);
|
|
4147
|
+
}
|
|
4148
|
+
const xt = (t) => {
|
|
4149
|
+
if (t) return mt.add(t).toJSON();
|
|
4150
|
+
}, wt = {
|
|
4151
|
+
paramMap: R,
|
|
4152
|
+
getRefs: ot,
|
|
4153
|
+
getRef: st,
|
|
4154
|
+
parsedRefs: q,
|
|
4155
|
+
readEmbeddedPart: (t, e) => ht(t, e),
|
|
4156
|
+
addPerson: xt,
|
|
4157
|
+
serializeElement: K,
|
|
4158
|
+
onWarning: w
|
|
4159
|
+
}, Tt = [], St = /* @__PURE__ */ new Map();
|
|
4160
|
+
if (R.set(Zo, St), l) {
|
|
4161
|
+
const t = await J.getTextStream(l, $);
|
|
4162
|
+
if (t) {
|
|
4163
|
+
const e = ((t, e) => {
|
|
4164
|
+
let o = !1, s = !1, r = 0, n = "";
|
|
4165
|
+
const i = new Wo();
|
|
4166
|
+
return {
|
|
4167
|
+
onOpenTag: (t) => {
|
|
4168
|
+
const e = Ho(t.name);
|
|
4169
|
+
"t" === e ? o && 0 === r && (s = !0) : "si" === e ? (o = !0, n = "", i.reset(), r = 0) : "rPh" === e || "phoneticPr" === e ? r++ : o && 0 === r && i.onOpenTag(e, t.attributes);
|
|
4170
|
+
},
|
|
4171
|
+
onText: (t) => {
|
|
4172
|
+
s && (n += t, i.onText(t));
|
|
4173
|
+
},
|
|
4174
|
+
onCloseTag: (t) => {
|
|
4175
|
+
const e = Ho(t.name);
|
|
4176
|
+
"t" === e ? s = !1 : "si" === e ? (((t, e) => {
|
|
4177
|
+
e && St.set(Tt.length, e), Tt.push(t);
|
|
4178
|
+
})(Ut(n), i.take() ?? void 0), o = !1, n = "") : "rPh" === e || "phoneticPr" === e ? r > 0 && r-- : i.onCloseTag(e);
|
|
4179
|
+
},
|
|
4180
|
+
onError: (t) => {
|
|
4181
|
+
e?.(`Error parsing shared strings: ${t?.message ?? t}`);
|
|
4182
|
+
}
|
|
4183
|
+
};
|
|
4184
|
+
})(0, (t) => {
|
|
4185
|
+
w(t, l);
|
|
4186
|
+
});
|
|
4187
|
+
try {
|
|
4188
|
+
await Ie.parseStream(t, e, { xmlns: !1 });
|
|
4189
|
+
} catch (n) {
|
|
4190
|
+
throw new Error(`Error parsing shared strings: '${l}'`, { cause: n });
|
|
4191
|
+
}
|
|
4192
|
+
}
|
|
4193
|
+
}
|
|
4194
|
+
b?.mark("shared-strings");
|
|
4195
|
+
let kt = Tt.length;
|
|
4196
|
+
const Et = /* @__PURE__ */ new Map();
|
|
4197
|
+
let It = kt;
|
|
4198
|
+
const Ot = (t) => {
|
|
4199
|
+
const e = Et.get(t);
|
|
4200
|
+
if (void 0 !== e) return e;
|
|
4201
|
+
const o = It;
|
|
4202
|
+
return Et.set(t, It++), Tt.push(t), o;
|
|
4203
|
+
}, Dt = [];
|
|
4204
|
+
o.slicersCache = Dt;
|
|
4205
|
+
const Nt = J.getNames(), $t = Nt.length;
|
|
4206
|
+
for (let t = 0; t < $t; t++) {
|
|
4207
|
+
const e = Nt[t];
|
|
4208
|
+
e && (e.startsWith("xl/slicerCache") || e.startsWith("xl/timelineCaches/") && e.endsWith(".xml")) && Dt.push(`/${e}`);
|
|
4209
|
+
}
|
|
4210
|
+
const Vt = Ht("slicersCache", o, t, z, H, wt), Lt = /* @__PURE__ */ new Map();
|
|
4211
|
+
Vt.forEach((t, e) => {
|
|
4212
|
+
t?.cacheName && (t.cachePath = e, Lt.set(t.cacheName, t));
|
|
4213
|
+
}), R.set("slicerCaches", Lt);
|
|
4214
|
+
const Bt = [];
|
|
4215
|
+
o.slicers = Bt;
|
|
4216
|
+
for (let t = 0; t < $t; t++) {
|
|
4217
|
+
const e = Nt[t];
|
|
4218
|
+
e && (e.startsWith("xl/slicers/") || e.startsWith("xl/timelines/")) && e.endsWith(".xml") && Bt.push(`/${e}`);
|
|
4219
|
+
}
|
|
4220
|
+
const Ft = {
|
|
4221
|
+
getFile: t,
|
|
4222
|
+
domParser: z,
|
|
4223
|
+
getAddress: (t, e) => {
|
|
4224
|
+
const o = st(e, t, !1);
|
|
4225
|
+
return "string" == typeof o ? o : null;
|
|
4226
|
+
},
|
|
4227
|
+
getBytes: (e, o) => {
|
|
4228
|
+
const s = rt(o, e), r = s ? t(s.substring(1))?.content : void 0;
|
|
4229
|
+
return r ? r.slice().buffer : null;
|
|
4230
|
+
},
|
|
4231
|
+
addFetched: (t, e) => {
|
|
4232
|
+
const o = g.add({
|
|
4233
|
+
source: { buffer: t },
|
|
4234
|
+
fetchedFrom: e
|
|
4235
|
+
});
|
|
4236
|
+
return o.addReference(N), M.add(o), y.toResourceId(o);
|
|
4237
|
+
},
|
|
4238
|
+
markAbsorbed: et
|
|
4239
|
+
}, zt = /* @__PURE__ */ new Map();
|
|
4240
|
+
for (const t of At.getAll()) zt.set(t.structure, t.beginRead(Ft));
|
|
4241
|
+
const Gt = ((t, e) => {
|
|
4242
|
+
const o = (o) => {
|
|
4243
|
+
const s = t(o);
|
|
4244
|
+
return s ? e.parseFromString(new TextDecoder().decode(s.content), "text/xml").documentElement ?? null : null;
|
|
4245
|
+
}, s = ie(o("xl/richData/rdrichvaluestructure.xml"), "s").map((t) => ({
|
|
4246
|
+
t: t.getAttribute("t") ?? "",
|
|
4247
|
+
keys: ae(t)
|
|
4248
|
+
})), r = ie(o("xl/richData/rdrichvalue.xml"), "rv").map((t) => {
|
|
4249
|
+
const e = ie(t, "fb")[0];
|
|
4250
|
+
return {
|
|
4251
|
+
s: parseInt(t.getAttribute("s") ?? "-1", 10),
|
|
4252
|
+
values: ie(t, "v").map((t) => t.textContent ?? ""),
|
|
4253
|
+
fb: e ? e.textContent ?? "" : null
|
|
4254
|
+
};
|
|
4255
|
+
}), n = ie(o("xl/richData/rdarray.xml"), "a").map((t) => {
|
|
4256
|
+
const e = le(t), o = parseInt(t.getAttribute("r") ?? "", 10), s = parseInt(t.getAttribute("c") ?? "", 10), r = o > 0 ? o : e.length;
|
|
4257
|
+
return {
|
|
4258
|
+
rows: r,
|
|
4259
|
+
columns: s > 0 ? s : Math.max(1, Math.ceil(e.length / Math.max(1, r))),
|
|
4260
|
+
items: e
|
|
4261
|
+
};
|
|
4262
|
+
}), i = ie(o("xl/richData/rdsupportingpropertybagstructure.xml"), "s").map(ae), a = o("xl/richData/rdsupportingpropertybag.xml"), l = ie(ie(a, "spbArrays")[0], "a").map(le), c = ie(ie(a, "spbData")[0], "spb").map((t) => ({
|
|
4263
|
+
s: parseInt(t.getAttribute("s") ?? "-1", 10),
|
|
4264
|
+
values: ie(t, "v").map((t) => t.textContent ?? "")
|
|
4265
|
+
})), h = o("xl/richData/rdRichValueTypes.xml"), u = ce(ie(ie(h, "global")[0], "keyFlags")[0]), d = /* @__PURE__ */ new Map();
|
|
4266
|
+
for (const t of ie(ie(h, "types")[0], "type")) d.set(t.getAttribute("name") ?? "", ce(ie(t, "keyFlags")[0]));
|
|
4267
|
+
const p = o("xl/richData/richStyles.xml"), f = ie(ie(p, "dxfs")[0], "dxf").map((t) => ie(t, "numFmt")[0]?.getAttribute("formatCode") ?? null), g = ie(ie(p, "richProperties")[0], "rPr").map((t) => t.getAttribute("n") ?? "");
|
|
4268
|
+
return {
|
|
4269
|
+
structures: s,
|
|
4270
|
+
values: r,
|
|
4271
|
+
arrays: n,
|
|
4272
|
+
bagStructures: i,
|
|
4273
|
+
bagArrays: l,
|
|
4274
|
+
bags: c,
|
|
4275
|
+
globalKeyFlags: u,
|
|
4276
|
+
typeKeyFlags: d,
|
|
4277
|
+
richStyles: ie(ie(p, "richStyles")[0], "rSty").map((t) => {
|
|
4278
|
+
const e = /* @__PURE__ */ new Map();
|
|
4279
|
+
for (const o of ie(t, "rpv")) {
|
|
4280
|
+
const t = g[parseInt(o.getAttribute("i") ?? "-1", 10)];
|
|
4281
|
+
t && e.set(t, o.textContent ?? "");
|
|
4282
|
+
}
|
|
4283
|
+
const o = parseInt(t.getAttribute("dxfid") ?? "", 10);
|
|
4284
|
+
return {
|
|
4285
|
+
numberFormat: e.get("NumberFormat") ?? (o >= 0 ? f[o] ?? null : null),
|
|
4286
|
+
isTitle: "1" === e.get("IsTitleField"),
|
|
4287
|
+
isHero: "1" === e.get("IsHeroField")
|
|
4288
|
+
};
|
|
4289
|
+
})
|
|
4290
|
+
};
|
|
4291
|
+
})(t, z), Zt = Yt(Gt, zt, (t) => {
|
|
4292
|
+
w(t, "/xl/richData/rdrichvalue.xml");
|
|
4293
|
+
});
|
|
4294
|
+
R.set("richData", Gt.values.map((t, e) => Zt.cellValue(e)));
|
|
4295
|
+
for (let t = 0; t < $t; t++) {
|
|
4296
|
+
const e = Nt[t];
|
|
4297
|
+
e.startsWith("xl/richData/") && !e.includes("/_rels/") && et(e);
|
|
4298
|
+
}
|
|
4299
|
+
const te = Ht("themes", o, t, z, H, wt);
|
|
4300
|
+
let ee = null;
|
|
4301
|
+
if (te && te.entries) {
|
|
4302
|
+
let t = te.entries().next();
|
|
4303
|
+
t?.value?.[1] && (ee = t.value[1]);
|
|
4304
|
+
}
|
|
4305
|
+
const se = new x(ee);
|
|
4306
|
+
let re = Ht("styles", o, t, z, H, wt).entries().next()?.value?.[1];
|
|
4307
|
+
re && (re = JSON.parse(a.JSONStableStringify(re)));
|
|
4308
|
+
const ne = Ht("workbooks", o, t, z, H, wt);
|
|
4309
|
+
R.set(Jo, !0 === ne.entries().next().value?.[1]?.date1904), "none" !== (f.calcOnLoad ?? p) && R.set(Ko, ((t, e) => {
|
|
4310
|
+
const o = /* @__PURE__ */ new Set();
|
|
4311
|
+
if (t) for (let e = 0; e < t.length; e++) o.add(String(t[e]?.name).toUpperCase());
|
|
4312
|
+
if (e) for (let t = 0; t < e.length; t++) try {
|
|
4313
|
+
const s = e[t](() => {
|
|
4314
|
+
throw new Error("Not evaluating.");
|
|
4315
|
+
}, (t, e, s, r) => {
|
|
4316
|
+
for (const t of Object.keys(r)) o.add(t.toUpperCase());
|
|
4317
|
+
}, /* @__PURE__ */ new Map());
|
|
4318
|
+
for (const t of s.keys()) o.add(t.toUpperCase());
|
|
4319
|
+
} catch {}
|
|
4320
|
+
return (t) => o.has(t) || A.has(t);
|
|
4321
|
+
})(ne.entries().next().value?.[1]?.names, f.functions)), b?.mark("side-parts-json"), await Promise.all(G);
|
|
4322
|
+
{
|
|
4323
|
+
const t = ne.entries().next().value?.[1], e = ct(t?.names), o = t?.sheets ?? [];
|
|
4324
|
+
for (let t = 0; t < o.length; t++) {
|
|
4325
|
+
const s = o[t], r = Qt(s);
|
|
4326
|
+
if ("macro" === s?.kind && r?.part.xml) {
|
|
4327
|
+
r.part.xml = Wt(r.part.xml, Tt);
|
|
4328
|
+
continue;
|
|
4329
|
+
}
|
|
4330
|
+
const n = W(s);
|
|
4331
|
+
n && Mt(n, e);
|
|
4332
|
+
}
|
|
4333
|
+
const s = t?.names;
|
|
4334
|
+
if (s) for (let t = 0; t < s.length; t++) {
|
|
4335
|
+
const o = s[t]?.ref;
|
|
4336
|
+
"string" == typeof o && (s[t].ref = e.readDetached(o));
|
|
4337
|
+
}
|
|
4338
|
+
}
|
|
4339
|
+
P && D > 0 && (P(O, O), await new Promise((t) => setTimeout(t, 0))), b?.mark("sheets");
|
|
4340
|
+
const he = {
|
|
4341
|
+
...ne.entries().next().value?.[1],
|
|
4342
|
+
styles: re,
|
|
4343
|
+
theme: se.toJSON()
|
|
4344
|
+
}, ue = ((t, e, o, s) => {
|
|
4345
|
+
const r = {}, n = (t, e) => {
|
|
4346
|
+
if (t) for (const { key: o, value: s } of t) {
|
|
4347
|
+
const t = e[o];
|
|
4348
|
+
if (t && s) if ("revisionNumber" === t) {
|
|
4349
|
+
const t = parseInt(s, 10);
|
|
4350
|
+
Number.isFinite(t) && (r.revisionNumber = t);
|
|
4351
|
+
} else r[t] = s;
|
|
4352
|
+
}
|
|
4353
|
+
};
|
|
4354
|
+
if (n(t, ds), n(e, ps), o) {
|
|
4355
|
+
const t = [];
|
|
4356
|
+
for (const e of o) {
|
|
4357
|
+
const o = gs(e);
|
|
4358
|
+
o ? t.push(o) : s?.(`The custom document property '${e.key}' holds a value of a kind that is not read (${e.kind ? "vt:" + e.kind : "none"}); it was dropped.`, "xlsx.docProps.custom.kind");
|
|
4359
|
+
}
|
|
4360
|
+
t.length > 0 && (r.custom = t);
|
|
4361
|
+
}
|
|
4362
|
+
return Object.keys(r).length > 0 ? r : void 0;
|
|
4363
|
+
})(ut.values().next().value?.properties, pt.values().next().value?.properties, ft.values().next().value?.custom, (t, e) => {
|
|
4364
|
+
w(t, "docProps/custom.xml", e);
|
|
4365
|
+
});
|
|
4366
|
+
ue && (he.properties = ue), ((t, e) => {
|
|
4367
|
+
if (!e || 0 === e.size) return;
|
|
4368
|
+
const o = t.styles;
|
|
4369
|
+
if (!o) return;
|
|
4370
|
+
const s = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
4371
|
+
for (const o of t.sheets ?? []) {
|
|
4372
|
+
const t = W(o);
|
|
4373
|
+
if (!t) continue;
|
|
4374
|
+
const n = /* @__PURE__ */ new Set();
|
|
4375
|
+
ys(t.cols) || n.add(0);
|
|
4376
|
+
for (const e of t.directStyles ?? []) n.add(Array.isArray(e) ? e[1] : e.v);
|
|
4377
|
+
for (const e of t.rows ?? []) {
|
|
4378
|
+
const t = bs(e);
|
|
4379
|
+
void 0 !== t && n.add(t);
|
|
4380
|
+
}
|
|
4381
|
+
for (const e of t.cols ?? []) {
|
|
4382
|
+
const t = bs(e);
|
|
4383
|
+
void 0 !== t && n.add(t);
|
|
4384
|
+
}
|
|
4385
|
+
let i = !1;
|
|
4386
|
+
for (const t of n) if (e.has(t)) {
|
|
4387
|
+
i = !0;
|
|
4388
|
+
break;
|
|
4389
|
+
}
|
|
4390
|
+
if (i) {
|
|
4391
|
+
t.protection = {
|
|
4392
|
+
...t.protection ?? { sheet: !0 },
|
|
4393
|
+
showFormulas: !1
|
|
4394
|
+
};
|
|
4395
|
+
for (const t of n) (e.has(t) ? r : s).add(t);
|
|
4396
|
+
}
|
|
4397
|
+
}
|
|
4398
|
+
if (0 === s.size) return;
|
|
4399
|
+
const n = o.direct ?? (o.direct = []);
|
|
4400
|
+
for (const t of s) 0 !== t && vs(n[t] ?? (n[t] = {}), !0);
|
|
4401
|
+
for (const t of r) 0 !== t && vs(n[t] ?? (n[t] = {}), !1);
|
|
4402
|
+
if (s.has(0)) {
|
|
4403
|
+
const t = o.named ?? (o.named = []), e = u.BuiltInName.Normal.toLowerCase();
|
|
4404
|
+
let s = t.find((t) => t.name?.toLowerCase() === e);
|
|
4405
|
+
s || (s = {
|
|
4406
|
+
name: u.BuiltInName.Normal,
|
|
4407
|
+
style: {}
|
|
4408
|
+
}, t.push(s)), vs(s.style, !0);
|
|
4409
|
+
}
|
|
4410
|
+
})(he, R.get(ms)), ((t, e) => {
|
|
4411
|
+
if (e && 0 !== e.size) for (const o of t.sheets ?? []) {
|
|
4412
|
+
const t = W(o), s = t?.pivotTables;
|
|
4413
|
+
if (!t || !s || 0 === s.length) continue;
|
|
4414
|
+
const r = s.map(j), n = s.map(() => []);
|
|
4415
|
+
for (const [o, s] of t.directStyles ?? []) {
|
|
4416
|
+
if (!e.has(s)) continue;
|
|
4417
|
+
const t = C.fastStringToRange(o);
|
|
4418
|
+
for (let e = 0; e < r.length; e++) {
|
|
4419
|
+
const o = r[e];
|
|
4420
|
+
if (!o) continue;
|
|
4421
|
+
const s = Math.max(t.rowStart, o.rowStart), i = Math.min(t.rowEnd, o.rowEnd), a = Math.max(t.colStart, o.colStart), l = Math.min(t.colEnd, o.colEnd);
|
|
4422
|
+
if (s > i || a > l) continue;
|
|
4423
|
+
const c = C.rangeToString({
|
|
4424
|
+
rowStart: s - o.rowStart,
|
|
4425
|
+
rowEnd: i - o.rowStart,
|
|
4426
|
+
colStart: a - o.colStart,
|
|
4427
|
+
colEnd: l - o.colStart
|
|
4428
|
+
});
|
|
4429
|
+
c && n[e].push(c);
|
|
4430
|
+
}
|
|
4431
|
+
}
|
|
4432
|
+
for (let t = 0; t < s.length; t++) n[t].length > 0 && (s[t].buttons = n[t]);
|
|
4433
|
+
}
|
|
4434
|
+
})(he, R.get(xs));
|
|
4435
|
+
const de = R.get(Ds);
|
|
4436
|
+
((t, e) => {
|
|
4437
|
+
const o = t.styles?.direct;
|
|
4438
|
+
if (!o || 0 === o.length) return;
|
|
4439
|
+
let s = null;
|
|
4440
|
+
const r = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), i = (t, i, l, c) => {
|
|
4441
|
+
let h = "";
|
|
4442
|
+
c && (h = n.get(c) ?? a.JSONStableStringify(c), n.set(c, h));
|
|
4443
|
+
const u = `${t}|${i ?? ""}|${l ?? ""}|${h}`;
|
|
4444
|
+
let d = r.get(u);
|
|
4445
|
+
if (void 0 !== d) return d;
|
|
4446
|
+
const p = o[t], f = p ? Ts(p, i, l, c) : null, g = e?.get(t);
|
|
4447
|
+
return d = f === p ? t : f || void 0 !== g ? ((t, r) => {
|
|
4448
|
+
if (!s) {
|
|
4449
|
+
s = /* @__PURE__ */ new Map();
|
|
4450
|
+
for (let t = 0; t < o.length; t++) {
|
|
4451
|
+
let r = a.JSONStableStringify(o[t]);
|
|
4452
|
+
const n = e?.get(t);
|
|
4453
|
+
void 0 !== n && (r += `|${n}`), s.has(r) || s.set(r, t);
|
|
4454
|
+
}
|
|
4455
|
+
}
|
|
4456
|
+
let n = a.JSONStableStringify(t);
|
|
4457
|
+
void 0 !== r && (n += `|${r}`);
|
|
4458
|
+
let i = s.get(n);
|
|
4459
|
+
return void 0 === i && (i = o.length, o.push(t), s.set(n, i), void 0 !== r && e.set(i, r)), i;
|
|
4460
|
+
})(f ?? {}, g) : null, r.set(u, d), d;
|
|
4461
|
+
}, l = new Map((t.pivotCaches ?? []).map((t) => [t.cacheId, t.fields]));
|
|
4462
|
+
for (const e of t.sheets ?? []) {
|
|
4463
|
+
const t = W(e), o = t?.pivotTables, s = t?.directStyles;
|
|
4464
|
+
if (!t || !o || 0 === o.length || !s || 0 === s.length) continue;
|
|
4465
|
+
let r = s, n = !1;
|
|
4466
|
+
for (const t of o) {
|
|
4467
|
+
const e = ws(t, l.get(t.cacheId));
|
|
4468
|
+
if (!e) continue;
|
|
4469
|
+
const o = [];
|
|
4470
|
+
for (const t of r) {
|
|
4471
|
+
const s = C.fastStringToRange(t[0]), r = Ps(s, e.coords);
|
|
4472
|
+
if (!r) {
|
|
4473
|
+
o.push(t);
|
|
4474
|
+
continue;
|
|
4475
|
+
}
|
|
4476
|
+
n = !0;
|
|
4477
|
+
for (const e of Os(s, r)) o.push([C.rangeToString(e), t[1]]);
|
|
4478
|
+
const { rowIndex: a, colIndex: l } = e.origin;
|
|
4479
|
+
for (let s = r.rowStart; s <= r.rowEnd; s++) {
|
|
4480
|
+
let n = r.colStart, c = null;
|
|
4481
|
+
const h = (t) => {
|
|
4482
|
+
null !== c && o.push([C.rangeToString({
|
|
4483
|
+
rowStart: s,
|
|
4484
|
+
rowEnd: s,
|
|
4485
|
+
colStart: n,
|
|
4486
|
+
colEnd: t
|
|
4487
|
+
}), c]);
|
|
4488
|
+
};
|
|
4489
|
+
for (let o = r.colStart; o <= r.colEnd; o++) {
|
|
4490
|
+
const { numberFormat: u, labelIndent: d, user: p } = e.formats.formatAt(s - a, o - l), f = i(t[1], u, d, p);
|
|
4491
|
+
o !== r.colStart && f === c || (o !== r.colStart && h(o - 1), n = o, c = f);
|
|
4492
|
+
}
|
|
4493
|
+
h(r.colEnd);
|
|
4494
|
+
}
|
|
4495
|
+
}
|
|
4496
|
+
r = o;
|
|
4497
|
+
}
|
|
4498
|
+
n && (t.directStyles = r);
|
|
4499
|
+
}
|
|
4500
|
+
})(he, de), ((t) => {
|
|
4501
|
+
const o = {
|
|
4502
|
+
colStart: 0,
|
|
4503
|
+
rowStart: 0,
|
|
4504
|
+
colEnd: 16383,
|
|
4505
|
+
rowEnd: 1048575
|
|
4506
|
+
};
|
|
4507
|
+
for (const r of t.sheets ?? []) {
|
|
4508
|
+
const t = W(r);
|
|
4509
|
+
if (!t) continue;
|
|
4510
|
+
const n = [];
|
|
4511
|
+
if ($s(t.cols, !0, o, n), $s(t.rows, !1, o, n), 0 === n.length) continue;
|
|
4512
|
+
const i = [];
|
|
4513
|
+
for (const [e, o] of t.directStyles ?? []) i.push({
|
|
4514
|
+
...C.fastStringToRange(e),
|
|
4515
|
+
value: {
|
|
4516
|
+
kind: 0,
|
|
4517
|
+
index: o
|
|
4518
|
+
}
|
|
4519
|
+
});
|
|
4520
|
+
i.push(...n);
|
|
4521
|
+
const a = [], l = new s.IteratorInstance(i, { axis: e.Column });
|
|
4522
|
+
for (let t = l.next(); !t.done; t = l.next()) {
|
|
4523
|
+
const e = t.value.overlaps;
|
|
4524
|
+
let s;
|
|
4525
|
+
if (1 === e.length) {
|
|
4526
|
+
if (s = e[0].value, 0 === s.index) continue;
|
|
4527
|
+
} else {
|
|
4528
|
+
let t, o, r;
|
|
4529
|
+
for (let s = 0; !t && s < e.length; s++) {
|
|
4530
|
+
const n = e[s].value;
|
|
4531
|
+
0 === n.kind ? t = n : 1 === n.kind ? o = n : r = n;
|
|
4532
|
+
}
|
|
4533
|
+
s = t ?? o ?? r;
|
|
4534
|
+
}
|
|
4535
|
+
a.push([C.rangeToString(t.value.range, o), s.index]);
|
|
4536
|
+
}
|
|
4537
|
+
a.length > 0 ? t.directStyles = a : delete t.directStyles;
|
|
4538
|
+
}
|
|
4539
|
+
})(he), de && ((t, e, o) => {
|
|
4540
|
+
if (!e || 0 === e.size || !o) return;
|
|
4541
|
+
const s = (t) => {
|
|
4542
|
+
if (void 0 === t || 0 === t) return null;
|
|
4543
|
+
const s = e.get(t);
|
|
4544
|
+
return void 0 !== s ? o.controls[s] ?? null : null;
|
|
4545
|
+
};
|
|
4546
|
+
for (const e of t.sheets ?? []) {
|
|
4547
|
+
const t = W(e);
|
|
4548
|
+
if (!t) continue;
|
|
4549
|
+
const o = /* @__PURE__ */ new Map();
|
|
4550
|
+
for (const e of t.directStyles ?? []) {
|
|
4551
|
+
const t = Array.isArray(e) ? e[0] : e.r, r = s(Array.isArray(e) ? e[1] : e.v);
|
|
4552
|
+
if (!r) continue;
|
|
4553
|
+
const n = JSON.stringify(r);
|
|
4554
|
+
let i = o.get(n);
|
|
4555
|
+
i || (i = {
|
|
4556
|
+
control: r,
|
|
4557
|
+
addresses: []
|
|
4558
|
+
}, o.set(n, i)), Ns(t, i.addresses);
|
|
4559
|
+
}
|
|
4560
|
+
if (0 === o.size) continue;
|
|
4561
|
+
const r = [...t.cellControls ?? []];
|
|
4562
|
+
for (const { control: t, addresses: e } of o.values()) r.push({
|
|
4563
|
+
r: e.join(","),
|
|
4564
|
+
v: t
|
|
4565
|
+
});
|
|
4566
|
+
t.cellControls = r;
|
|
4567
|
+
}
|
|
4568
|
+
})(he, de, Ht("featurePropertyBag", o, t, z, H, wt).values().next().value?.featurePropertyBag);
|
|
4569
|
+
{
|
|
4570
|
+
const e = /* @__PURE__ */ new Map();
|
|
4571
|
+
Ht("slicers", o, t, z, H, wt).forEach((t, o) => {
|
|
4572
|
+
t?.slicers && e.set(o, t.slicers);
|
|
4573
|
+
}), oe(he, {
|
|
4574
|
+
warn: (t, e) => {
|
|
4575
|
+
w(t, "xl/slicers", e);
|
|
4576
|
+
},
|
|
4577
|
+
markAbsorbed: et,
|
|
4578
|
+
slicerParts: e
|
|
4579
|
+
});
|
|
4580
|
+
}
|
|
4581
|
+
he.calc = {
|
|
4582
|
+
...he.calc ?? {},
|
|
4583
|
+
legacyIntersect: !0
|
|
4584
|
+
}, Tt.length > 0 && (he.strings = Tt);
|
|
4585
|
+
const pe = mt.toJSON();
|
|
4586
|
+
pe && pe.length > 0 && (he.people = pe);
|
|
4587
|
+
const fe = J.getEntry("xl/vbaProject.bin");
|
|
4588
|
+
if (fe) try {
|
|
4589
|
+
const { VBAProject: t } = await import("./QVWayvB03YMyTKt3.js"), e = t.extract(fe);
|
|
4590
|
+
if (e) {
|
|
4591
|
+
const o = /* @__PURE__ */ new Map();
|
|
4592
|
+
for (const t of he.sheets ?? []) {
|
|
4593
|
+
const e = W(t), s = e?.codeName;
|
|
4594
|
+
s && o.set(s, e);
|
|
4595
|
+
}
|
|
4596
|
+
for (const s of e.modules) {
|
|
4597
|
+
const e = { language: "vba" }, { header: r, body: n } = t.splitAttributes(s.code);
|
|
4598
|
+
n && (e.source = n), r && (e.sourceHeader = r);
|
|
4599
|
+
const i = "document" === s.type ? o.get(s.name) : void 0;
|
|
4600
|
+
i || "document" !== s.type || (e.scope = "workbook");
|
|
4601
|
+
const a = i ? i.modules ??= {} : he.modules ??= {};
|
|
4602
|
+
a[s.name] || (a[s.name] = e);
|
|
4603
|
+
}
|
|
4604
|
+
h?.(e);
|
|
4605
|
+
} else v.push(["Unable to parse VBA project.", "xl/vbaProject.bin"]);
|
|
4606
|
+
} catch (n) {
|
|
4607
|
+
v.push([`Error extracting VBA: ${n?.message ?? n}`, "xl/vbaProject.bin"]);
|
|
4608
|
+
}
|
|
4609
|
+
const ge = R.get("calcId"), me = void 0 === ge || !(Number(ge) >= 191029), be = f.calcOnLoad ?? ("auto" === p && me ? "full" : p), ye = {
|
|
4610
|
+
...f,
|
|
4611
|
+
calcOnLoad: be,
|
|
4612
|
+
resources: g,
|
|
4613
|
+
json: he
|
|
4614
|
+
};
|
|
4615
|
+
if (void 0 === ye.disableLoadAutoFit) {
|
|
4616
|
+
const t = R.get(nt);
|
|
4617
|
+
ye.disableLoadAutoFit = !!t?.declared && t.normalIsThemeFont && await _(t.faces);
|
|
4618
|
+
}
|
|
4619
|
+
b?.mark("json-assembled");
|
|
4620
|
+
const ve = new E(ye);
|
|
4621
|
+
if (b?.mark("workbook-constructed"), M.forEach((t) => {
|
|
4622
|
+
t.deleteReference(N);
|
|
4623
|
+
}), y.endPersist(), m) {
|
|
4624
|
+
vt(ve);
|
|
4625
|
+
const t = /* @__PURE__ */ new Map();
|
|
4626
|
+
let e = 0;
|
|
4627
|
+
for (const o of J.getNames()) {
|
|
4628
|
+
const s = J.getEntry(o);
|
|
4629
|
+
if (!s) continue;
|
|
4630
|
+
const r = J.getRawEntry(o), n = r ? {
|
|
4631
|
+
data: s,
|
|
4632
|
+
uncompressedSize: J.uncompressedSize(o),
|
|
4633
|
+
raw: {
|
|
4634
|
+
compressedData: r.data,
|
|
4635
|
+
compressionMethod: r.compressionMethod,
|
|
4636
|
+
signature: r.signature
|
|
4637
|
+
}
|
|
4638
|
+
} : {
|
|
4639
|
+
data: s,
|
|
4640
|
+
uncompressedSize: J.uncompressedSize(o)
|
|
4641
|
+
};
|
|
4642
|
+
t.set(o, n), e += s.byteLength;
|
|
4643
|
+
}
|
|
4644
|
+
if (e > 67108864) v.push([`Source package too large to retain (${e} bytes, limit ${Ct}); unmodeled parts will be dropped on save.`, "SourcePackage"]);
|
|
4645
|
+
else if (t.size > 0) {
|
|
4646
|
+
const e = new Pt(t, tt);
|
|
4647
|
+
_t(ve, e);
|
|
4648
|
+
let o = ve.getWorksheets().getItems();
|
|
4649
|
+
const s = ve.getTransactions().addListener({ onCommitEnd: (t) => {
|
|
4650
|
+
const o = t.getOperation()?.name;
|
|
4651
|
+
"insertCells" !== o && "deleteCells" !== o || e.markStructuralChange();
|
|
4652
|
+
} }), r = ve.addListeners({ onSheetsChange: () => {
|
|
4653
|
+
const t = ve.getWorksheets().getItems();
|
|
4654
|
+
(t.length !== o.length || t.some((t, e) => t !== o[e])) && e.markStructuralChange(), o = t;
|
|
4655
|
+
} });
|
|
4656
|
+
ve.addListeners({ onClose: () => {
|
|
4657
|
+
s(), r(), vt(ve);
|
|
4658
|
+
} });
|
|
4659
|
+
}
|
|
4660
|
+
}
|
|
4661
|
+
if (v.length && I?.onWarning) {
|
|
4662
|
+
const t = /* @__PURE__ */ new Set();
|
|
4663
|
+
for (const e of v) {
|
|
4664
|
+
const [o, s, r] = e, n = r ?? o;
|
|
4665
|
+
t.has(n) || (t.add(n), I.onWarning(o, s));
|
|
4666
|
+
}
|
|
4667
|
+
}
|
|
4668
|
+
return b && !0 === d && console.table(b.toTable()), await ve.whenFontsReady(), ve;
|
|
4669
|
+
} catch (n) {
|
|
4670
|
+
let t = "Unable to parse XLSX.";
|
|
4671
|
+
throw n instanceof o && (t = "Unable to open XLSX. There are too many rows or columns."), new Error(t, { cause: n });
|
|
4672
|
+
} finally {
|
|
4673
|
+
await J.close().catch(() => {});
|
|
4674
|
+
}
|
|
4675
|
+
};
|
|
4676
|
+
export { Qo as a, Fs as i, Ds as n, Rs as o, xs as r, ms as t };
|