@sheetxl/mcp 0.8.0-beta.17 → 0.8.0-beta.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{Dzz3yrKbECzg6caR.js → -iaCg5U9jrEDEl_O.js} +1 -1
- package/assets/{Bcak_hZpcIkB2gJD.js → 0hHP9xpWzhkDrCTL.js} +1 -1
- package/assets/{B7OyFSpBb1eBvMVd.js → 1bm0Yqgfehw1Z2QU.js} +13 -13
- package/assets/{BodrfKIAhDFD-X3t.js → 2nx2Wljhbuct4aKx.js} +1 -1
- package/assets/{IGAV8DdYH32cW8XU.js → 7MIo82Ay8jEFMBH-.js} +1 -1
- package/assets/{CJF3P7U7yBQVF2Cg.js → ArL5bPq60ZcPcwU9.js} +1 -1
- package/assets/{C2NPIWe0pLs3PAZM.js → B6A2URH-mIs7J54h.js} +2 -2
- package/assets/{CfA8o-FNret9-D6Y.js → B7vRFm79CUJ1VvFw.js} +1 -1
- package/assets/{4qMP71Fe1Ep8kbOX.js → B8Z4-80QEORmYOJ9.js} +1 -1
- package/assets/{Jd71-QCmFEcDcYSw.js → BGLlbVFS6J3lt9Lw.js} +1 -1
- package/assets/{BS4ZsfH5D6aemSpO.js → BHsQeg6najGesUM4.js} +1 -1
- package/assets/{DsCNtBR5jCeqmLBS.js → BPctZbHQFoqJNYzC.js} +2 -2
- package/assets/{B6NnxkSmEzCGZEZA.js → BQkQNqRh5xxYhBy4.js} +1 -1
- package/assets/{B8JX7a6VZlBNA_Bd.js → BSNegq0YcivZJmkf.js} +1663 -1663
- package/assets/{DE4xC78p5UtS7wH6.js → BTnTQBSbzYU7cwra.js} +1 -1
- package/assets/{qgW-p2sFhMtuu5yw.js → BUHEmX1fseJVV65_.js} +1 -1
- package/assets/{CwRhhoL5ynbe78dB.js → Bbky1A_gIgE8i0Oy.js} +1 -1
- package/assets/{z24-oIqP_fu2hsOt.js → BbvOmnXrmBNjeWjQ.js} +1 -1
- package/assets/{DPKeRb9GKmh_WCPv.js → Bbxkz6vmyZJftTd-.js} +1 -1
- package/assets/{CqwEHSKivMYw7tRZ.js → BcYdUKmFOf5rn2VZ.js} +1 -1
- package/assets/{Mgs_OJP41a-Nfac3.js → BfIJP4H3I51jnIVR.js} +1 -1
- package/assets/{Xe7sA_mEwDQpJjcF.js → BgUHR-HVjZDY4SaH.js} +2 -2
- package/assets/{DrHVew6gwOB6oxCn.js → BgVW1icycJewsx77.js} +1 -1
- package/assets/{lcIaYgz4tQGBlzlo.js → Bgi6ubwGkGYsILci.js} +86 -86
- package/assets/{BebXDUnlrDDRGW60.js → BiOrM24CFYL1JGFE.js} +2 -2
- package/assets/{CqjNsZ2OB4Kx6J3s.js → Bj1WHx6LIEq6RVGw.js} +8 -8
- package/assets/{dcvgOfBmWFTsXoT8.js → Bk6A5eONxLTBIA_p.js} +4 -4
- package/assets/{B7Nqa7V-v0cxGBux.js → Bk6SeqUJkn7ft1y1.js} +1 -1
- package/assets/{D6ON3ZLcTAXV3fO6.js → BkhdNc3LdmcyAjwk.js} +9803 -7812
- package/assets/{D5L35C8cbX16BSCF.js → Bl77DvFa09DuVVuj.js} +1147 -1082
- package/assets/{Dre79rTMoYYikNuB.js → Bpf9jHj5AFY9543y.js} +19 -19
- package/assets/{oJNJQJEDQCsjHSmo.js → Bq6ocyztkvzKxMMC.js} +1 -1
- package/assets/{DF7-oRscXc_vkMo8.js → Bw2Nxye4Qj10uA3o.js} +1 -1
- package/assets/{C4deMY87Q_haYyLF.js → Bz1lp0mtNAoPuPve.js} +1 -1
- package/assets/{C2ZX6ffXsMaEr2d2.js → BzkTa7l_e7R--ejo.js} +448 -448
- package/assets/{iBgLe32XErisaUSr.js → C06iKc7jZ6affk2m.js} +1 -1
- package/assets/{BMJhHHX2LWgOJWGz.js → C17Wflhw5IFSgFFY.js} +1 -1
- package/assets/{PbBzI4PlKpCgULLd.js → C53f6C0pAU7_9FI-.js} +1 -1
- package/assets/{UH_biJmLrI9SvckA.js → C7Q4V5mU0wsErspO.js} +3 -3
- package/assets/{kpS1vY0DcE9p8JnI.js → CA_22AL82sRhLAko.js} +2 -2
- package/assets/{BT8AGlSg2t7V1QNj.js → CBSSZrizrucIG_9i.js} +764 -767
- package/assets/{YQtUMMGmb1_WFsh_.js → CE4VYOniMmY8sXQ_.js} +1 -1
- package/assets/{CaJ9j3l0cERnYqDS.js → CIOlYUuBZat8FhHa.js} +1 -1
- package/assets/{BvDcHHJvQMRHthm-.js → CIxf9Y_JsuEEO7Nu.js} +1 -1
- package/assets/{Bw_FtA-1886HMCLJ.js → CKvP54bJ4GkUqcZi.js} +3 -3
- package/assets/{DnTfXqCnRCe-1QYI.js → CNPUPTd9h7hwijpZ.js} +64 -64
- package/assets/{DoBvgI3Ry8DlGzwQ.js → CQZq4cA5kbES6htE.js} +1 -1
- package/assets/{BjnQVl1lb1KEbt2D.js → CQiv3YkDRDxTjy0r.js} +23 -23
- package/assets/{BSY9Tbmz6VEY_F_x.js → CWHuM2GYuKmi0rZx.js} +1 -1
- package/assets/{Dgi2xwb2DN2Gybj3.js → CYTPpV3lqNGOwme7.js} +2 -2
- package/assets/{CLze192iF2o-aETZ.js → C_v4hb9WXIt639Cm.js} +1 -1
- package/assets/{-cMvbaW1kvHslPKX.js → CcGrcjoI12MaDmwV.js} +2 -2
- package/assets/{BJBoygm-gY68bLAP.js → Cgf5GQVN-D8SlQ7A.js} +15 -15
- package/assets/{D336KioeSjd-T8n3.js → CiJq0zSDKpaKhL3y.js} +2 -2
- package/assets/{1feDuXw6tBXu2XFg.js → Cj4MYfqHewu8IOOL.js} +1 -1
- package/assets/{BUV7BlOZcuPgDZ__.js → CjoRkjB9NzS4LaFy.js} +1 -1
- package/assets/{BjhAYfsKC8iEbtgn.js → CjrzyKFdie6KYfsG.js} +30 -30
- package/assets/{Cl7HHR6Vc9S4n3AP.js → CkMXAUkUuJ2LJUBE.js} +1 -1
- package/assets/{G2Wjyx_ETCAcofwm.js → CoXgI3MEnvkXeshj.js} +1294 -1267
- package/assets/{YFiGplEq1G4XdCJ2.js → CqOzqRIQFCnEegoB.js} +1 -1
- package/assets/{CshK6Ew7OQ7mngI3.js → CqvcgwQ0UcKndrhO.js} +2 -2
- package/assets/{CMRLNLqYkiqCLMRa.js → CrjUfkCuRaXUC8X8.js} +3 -3
- package/assets/{FvxN6PPps-rNPDo8.js → CubwsTFIaEVf039H.js} +1 -1
- package/assets/{BmM-nHMAAuNatCcN.js → Cur_-XiBPijLpwxX.js} +1 -1
- package/assets/{7TRx0dMYnL2i4tqL.js → Curuj_knAdRpMy1L.js} +265 -265
- package/assets/{DDhPOQPc-lpyZrUJ.js → Cz7tKgNBbnr4DZCb.js} +4 -4
- package/assets/{C3Q-fjiZZ15waCq_.js → D-LrOz3Yvp17bUT8.js} +2 -2
- package/assets/{0kfwZuOHUkJmVjg6.js → D005GbIBowRGfwed.js} +6 -6
- package/assets/{BKRLtOdVOUTrLjQN.js → D06A3fKIe3WCTFru.js} +28 -28
- package/assets/{8cVPexxAVrFJ9QLX.js → D1ZekPxeTGzhFy2L.js} +1 -1
- package/assets/{C46RpMrfF6FiEFI7.js → D1kI9nJRL1RUF3-E.js} +1 -1
- package/assets/{B2UxLSteMiPlg8Uu.js → D1nQ_BminCM0cyH0.js} +1 -1
- package/assets/{Dkg-LQVsZlrHk7A8.js → D4p9Pv82ECKCOlua.js} +1 -1
- package/assets/{DSsH28SW8CMrSL-q.js → D5OYqo56iGB-5gFG.js} +1 -1
- package/assets/{COa691om4fLN4CUy.js → D6fQheA4qCS5CxYQ.js} +1 -1
- package/assets/{OHBzl-tZOi9Ni8YV.js → D990KjcBrCaAEz5k.js} +1 -1
- package/assets/{BQYpVYbvfWuUJgdx.js → DAnSdO8615XsOPNe.js} +1 -1
- package/assets/{z7nDK_gfX7G37XbZ.js → DFlL4pAqxaQ_hVe1.js} +115 -115
- package/assets/{Cr6lm0oXZJaaoAmD.js → DHL-ZmN5GzB4pIrM.js} +1 -1
- package/assets/{BKjovBsLpX2Fkhov.js → DIPDNtbm8FAru-FQ.js} +120 -120
- package/assets/{Cz4H3Qge2u8er3Ny.js → DLJH6ppG9VHjHe_z.js} +3 -3
- package/assets/{DMuOMpgIhVgB3eG8.js → DNtWf9lfGjzoB9Hy.js} +1 -1
- package/assets/{DeEZvPW-VvlE28oE.js → DOg_zvSkhsKmw4q1.js} +3 -3
- package/assets/{C7iHn3y3HVBHflpA.js → DS9HD6_BPxzdun0X.js} +33 -33
- package/assets/{BgldX21zhey2aR9D.js → DSNaHPvgqymqpsko.js} +1 -1
- package/assets/{CUbCBf24Ie4A2l4R.js → DT_kCIZ600UsFy4t.js} +2 -2
- package/assets/{B2BfjRdJGZs6afVL.js → DXORLAVmseFlsxkG.js} +2 -2
- package/assets/{CWLleOolFzyT0COW.js → DXe8SG12UJoGbbWR.js} +1 -1
- package/assets/{DV6WSFmSEKfb3d2s.js → D_6TeeMN5zmoQPTm.js} +108 -108
- package/assets/{CLgvdaqeFlESLvbF.js → Di_C31GTbBJ_xVOK.js} +1 -1
- package/assets/{BGZ_ltNFYvnAmbVR.js → DnMDfty7pU96BIEJ.js} +1 -1
- package/assets/{BlbxiLf1zD6_fWZs.js → DngcuWO2cSuMCMu1.js} +1 -1
- package/assets/{D_peM8fbRgGaWvpq.js → DppU35gFSUPaiCQH.js} +1 -1
- package/assets/{BdijGsy5W7yZ_I_n.js → DrkfG324qZRPckuC.js} +1 -1
- package/assets/{BhCbCEPpDzhg5nqL.js → Ds6LQkRDwXsJ-CFR.js} +1 -1
- package/assets/{nQbVdQrfdz3osBdi.js → DtD0J-7IetHv5o6E.js} +3 -3
- package/assets/{CsiIgnb_L2x2Go6g.js → DwWcXC4pUR3U2WXU.js} +1 -1
- package/assets/{Ljri8sTW3dWT4clD.js → DwcKSqV5YEBBA8hY.js} +1 -1
- package/assets/{CyI1eGGzJX8nJXaT.js → DxKZjKyewqvj46S2.js} +2 -2
- package/assets/{Bj4BFLBC9Tf6SGSt.js → DxTzG7VM8v4WJ6cI.js} +1 -1
- package/assets/{BX5xFncPLyeN7TqA.js → EkavVNuGWG95UggH.js} +5 -5
- package/assets/{AnF1Kh3Vo2AniIYO.js → GZJ4AFFt8qKRADOa.js} +2 -2
- package/assets/{DYJcfrNUUJQtxXWX.js → Gd_0grQd-3D1VPXW.js} +1 -1
- package/assets/{B9M_sgHpoc-op6FF.js → HVm22OJ1gEeY8kii.js} +1 -1
- package/assets/{BSAdmOdx3brRE9LW.js → LV6tvjnxRzrWaFb8.js} +1 -1
- package/assets/{Bz1ImBvJwPwBrA5j.js → Ln7XTzksutZHFpml.js} +1 -1
- package/assets/{CtmrBbpapaNwjwNB.js → Se9JmvmEtu4MfXJh.js} +52 -52
- package/assets/{B3mh2tuvP-lMP6f_.js → b6GPrIkdzfTW4f2j.js} +1 -1
- package/assets/{MW2nt7se27FlH9Yb.js → bJ-XKvDf7IkAafUI.js} +3 -7
- package/assets/{Bni-y4FJS4rkFYtn.js → exNO4fmccU8Aq8cE.js} +2227 -2121
- package/assets/gCkru9Vv-Ban4DCD.js +14 -0
- package/assets/{B9J8nV-dh6jHpzZI.js → ht0UxaAlRnuYUvpx.js} +1 -1
- package/assets/{D0OQ6ka8so0BWPwL.js → iP-shs7tsDGMVvQh.js} +1 -1
- package/assets/{BBC_WF8BcAH-k_cQ.js → jPim6WG_KS-ZDker.js} +1 -1
- package/assets/{BOx4Ut_Rme7NH34X.js → mrif6ZBbTbZKYaLJ.js} +1 -1
- package/assets/{DidhZpf9qJAei29Y.js → rT5f4v0Q_61nHkff.js} +1 -1
- package/assets/{APP8AzsNgQXHTalA.js → udbHvSLquJ5xGK3R.js} +2 -2
- package/assets/{Bxkx8QokmRNyXbOI.js → vb-L2Q2jyjjgDvJy.js} +6 -6
- package/assets/{BJdWgj1hv57eGVl4.js → zEyWjY3NhC8w_spQ.js} +436 -436
- package/assets/{D5VFuX1h50V2jLmZ.js → zkoJXSxpRzqfbG8k.js} +201 -200
- package/index.js +1164 -1093
- package/lib.js +1 -1
- package/licenses/dependencies.txt +59 -59
- package/package.json +2 -2
- package/resources/locales/@sheetxl/sdk/de/model.msg.json +15 -0
- package/resources/locales/@sheetxl/sdk/en/model.msg.json +15 -0
- package/screenshot-page/assets/{C71ZZMVLfHdPl441.js → 1yHlU53ypZZelMPx.js} +1 -1
- package/screenshot-page/assets/A_-Jwzwmm3lkcm2f.js +586 -0
- package/screenshot-page/assets/{Btgo0VFTT0JxuaP3.js → B-8IMo2f1yGNXOyz.js} +86 -90
- package/screenshot-page/assets/BF6igzahAW9pl35p.js +1 -0
- package/screenshot-page/assets/{Bh33WyohJvbKZVQN.js → BU5vg917ZnXC04e-.js} +2 -2
- package/screenshot-page/assets/BWDqL5_mwspr6CjI.js +3 -0
- package/screenshot-page/assets/BX9VkTqZoroo08EG.js +13 -0
- package/screenshot-page/assets/BdDouZl3VrM4yBP5.js +2 -0
- package/screenshot-page/assets/{CB2mQ5rbaSw2W4ik.js → BqlVqRKpsFGl-elI.js} +3 -3
- package/screenshot-page/assets/{CfkssmHURDicfYvR.js → BuzI4z8RJGOw8BZD.js} +1 -1
- package/screenshot-page/assets/{DqXO_Zw1Cp7rAQ04.js → C7mXat-6esc1AmRD.js} +2 -2
- package/screenshot-page/assets/{B8qybUclSjEYP5FJ.js → CFl15-2FAF9f3V7L.js} +2 -2
- package/screenshot-page/assets/{CUZobZ3mfNAdEisS.js → CJmdRzGWq0FZMrp5.js} +1 -1
- package/screenshot-page/assets/{CTjUtxDw6Z2I9OGc.js → CLcTX_nmvaVPsxDl.js} +1 -1
- package/screenshot-page/assets/COpZTXe_J1mSpeYD.js +5 -0
- package/screenshot-page/assets/{BMf827t1Ul65MHd5.js → CQukCzhuewMuFOlO.js} +1 -1
- package/screenshot-page/assets/CZq2dMHs2MHHyyBl.js +1 -0
- package/screenshot-page/assets/CaTGa2NvuuE3qJAV.js +1 -0
- package/screenshot-page/assets/Cb8ORg9ENgscK6yl.js +2 -0
- package/screenshot-page/assets/Chq6rvtA5qZAwYG4.js +1 -0
- package/screenshot-page/assets/ClWDZixRy4DFZdI5.js +1 -0
- package/screenshot-page/assets/CmNlzN3DCl87wNU2.js +1 -0
- package/screenshot-page/assets/CoPUxkU9zZy0dXti.js +2 -0
- package/screenshot-page/assets/{DXaM3CulPA3aPGV1.js → Cpwg3bWAqBBcgBmv.js} +2 -2
- package/screenshot-page/assets/{BE8ea8S0Q-qogeEs.js → CqogMOf7MzkOk7as.js} +2 -2
- package/screenshot-page/assets/{BKwVcuWOKeH2xREA.js → CrUIo7hXByCWY7in.js} +1 -1
- package/screenshot-page/assets/Cv-YUArreXqhafcU.js +2 -0
- package/screenshot-page/assets/{DgtqX4DiBgkepVZZ.js → Cx1kZ2u_8JFV2Q8D.js} +1 -1
- package/screenshot-page/assets/{BD96fN2dSVuoME09.js → Cx9lvo3Q1xOwYkRK.js} +4 -4
- package/screenshot-page/assets/D0nZlczIH0ULuSyL.js +3 -0
- package/screenshot-page/assets/D1ZZiOS7_HFjpZCA.js +1 -0
- package/screenshot-page/assets/D23_69pojBfIh4nV.js +5 -0
- package/screenshot-page/assets/D24UBy2L73pOCPPw.js +1 -0
- package/screenshot-page/assets/D2q4M3I5Jmxm85P2.js +1 -0
- package/screenshot-page/assets/D6LmZnV2h3Kg7G3e.js +1 -0
- package/screenshot-page/assets/{BYQZ8o8k3-MDoNat.js → D6Yv5cc1JE7DGd6j.js} +1 -1
- package/screenshot-page/assets/DAkSmFRVds51vhiy.js +1 -0
- package/screenshot-page/assets/DMhOGCTy8V0N14gY.js +1 -0
- package/screenshot-page/assets/DUFPgv-3CtD_sCVO.js +1 -0
- package/screenshot-page/assets/{CSMEGhAHxl5-4FxB.js → DeGMS3crYErjsRrw.js} +1 -1
- package/screenshot-page/assets/{D_rtIYQ7FDC2CoEn.js → DegZKTNqt1LRnSxY.js} +1 -1
- package/screenshot-page/assets/{CT7cY57t9j1sBhAy.js → DjVxI3p3ssmCtYky.js} +1 -1
- package/screenshot-page/assets/DknSteOdQ6CdF0RT.js +1 -0
- package/screenshot-page/assets/Dt1A-DUBfvyouz_T.js +1 -0
- package/screenshot-page/assets/{DcUOAH274IbYOuK1.js → DwNHMH9f_lQyn50d.js} +1 -1
- package/screenshot-page/assets/{D0koRjO2KnWQ1fNV.js → DwuLl9Ua1k8m9KcK.js} +1 -1
- package/screenshot-page/assets/DzlbsQ0qqdQEl80f.js +1 -0
- package/screenshot-page/assets/EY31tFQrw7iYFrr6.js +4 -0
- package/screenshot-page/assets/{B1W17rc9ilPFCh31.js → MzJpKWgPrxR1UN-Y.js} +1 -1
- package/screenshot-page/assets/{-N4OYIMgf6f5vgNy.js → RutPv2GFWmeBiWvn.js} +1 -1
- package/screenshot-page/assets/{DeyRZ5rprDbRbuf4.js → Tj3B5At0OAN3tDza.js} +1 -1
- package/screenshot-page/assets/fQ13z3k3bntY-jfw.js +1 -0
- package/screenshot-page/assets/oO6aFwepb3DDkGYF.js +39 -0
- package/screenshot-page/assets/{DdXSKhFUAsKUsQ1u.js → pH9rKZYDE8xrhkC4.js} +1 -1
- package/screenshot-page/assets/qFyplGXRu7IepHio.js +1 -0
- package/screenshot-page/assets/w7IQEh1FiqZA6o5y.js +42 -0
- package/screenshot-page/assets/zEVoxCTt-ZW8Aowg.js +16 -0
- package/screenshot-page/assets/{DtihumgXQ7ETaN0A.js → zvxBjll3jnL0-vNn.js} +2 -2
- package/screenshot-page/index.html +12 -11
- package/screenshot-page/resources/locales/@sheetxl/sdk/de/model.msg.json +15 -0
- package/screenshot-page/resources/locales/@sheetxl/sdk/en/model.msg.json +15 -0
- package/types/scripting-api.json +11444 -11299
- package/types/scripting-enums.json +22 -1
- package/types/scripting.d.ts +631 -15
- package/assets/CSLLHl-zum7m1CJl.js +0 -14
- package/screenshot-page/assets/7Xk_eQAcM_HgWrOC.js +0 -1
- package/screenshot-page/assets/B8UkvH0o9n_G5UO9.js +0 -3
- package/screenshot-page/assets/BMwQInar0xVS5FRu.js +0 -1
- package/screenshot-page/assets/BNMBa8EZgWX2Eb3c.js +0 -1
- package/screenshot-page/assets/BQCyH9YbEgnH78Ke.js +0 -2
- package/screenshot-page/assets/BcDxaEii3arJqOym.js +0 -1
- package/screenshot-page/assets/Be-rukvcufhLamH5.js +0 -1
- package/screenshot-page/assets/C2ty_K_uix4ooip6.js +0 -1
- package/screenshot-page/assets/C9mUKjQ3yEzRu9j2.js +0 -2
- package/screenshot-page/assets/CCVAsuUimIJOkBnk.js +0 -1
- package/screenshot-page/assets/CFfgJlXaIS8QMx5O.js +0 -1
- package/screenshot-page/assets/CN8u05DjKwNHbUHN.js +0 -5
- package/screenshot-page/assets/COoMVTzF50qBNFEu.js +0 -39
- package/screenshot-page/assets/C_OuKbe6z1it80cj.js +0 -1
- package/screenshot-page/assets/Cbcv49b9jWyY4HKj.js +0 -2
- package/screenshot-page/assets/CtZFqwLoeJOvwFrl.js +0 -42
- package/screenshot-page/assets/Cz6KFmsp267l_VZS.js +0 -1
- package/screenshot-page/assets/D6CzedWHXTesD55R.js +0 -1
- package/screenshot-page/assets/DCP8JXEeiwAMiVD2.js +0 -1
- package/screenshot-page/assets/DQAZPADvH5lhlMnK.js +0 -1
- package/screenshot-page/assets/DQBUH0j44Vtrykua.js +0 -13
- package/screenshot-page/assets/DRncpwDkZZX8rL9S.js +0 -20
- package/screenshot-page/assets/DSKOOgcJQeqIc9Us.js +0 -3
- package/screenshot-page/assets/DTrnAtpccj55fGg5.js +0 -1
- package/screenshot-page/assets/Djl40tfWoPJSvqtv.js +0 -1
- package/screenshot-page/assets/LYyM_ig973jLdOU0.js +0 -2
- package/screenshot-page/assets/TCImIYUUdVD4Z35I.js +0 -1
- package/screenshot-page/assets/Tph2vYqw17-NBCtd.js +0 -1
- package/screenshot-page/assets/dQsis-90Up-pIkSq.js +0 -4
- package/screenshot-page/assets/dXn1GWWjYmuLb1HF.js +0 -586
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./CbXtAM7H-Jg_J0dk.js";import{i as t,t as n}from"./-cpi3yOZYn6GsYN4.js";import{n as r}from"./CXGgKVbVXjWzE0p6.js";import{t as i}from"./BEwl-ucV9Jfr0RoC.js";import{Z as a}from"./ChSvXfVMLxZsP9zG.js";import{
|
|
1
|
+
import{n as e}from"./CbXtAM7H-Jg_J0dk.js";import{i as t,t as n}from"./-cpi3yOZYn6GsYN4.js";import{n as r}from"./CXGgKVbVXjWzE0p6.js";import{t as i}from"./BEwl-ucV9Jfr0RoC.js";import{Z as a}from"./ChSvXfVMLxZsP9zG.js";import{F as o,W as s,n as c}from"./D23_69pojBfIh4nV.js";import{n as l,r as u,t as d}from"./BowRIybLgENunTOT.js";import{D as f}from"./DuYb_otrRZZDq6-f.js";var p=e(t(),1),m=n(),h=()=>(0,m.jsxs)(`svg`,{viewBox:`0 0 16 16`,width:14,height:14,"aria-hidden":!0,children:[(0,m.jsx)(`path`,{d:`M1.5 2.5h10l-4 5v5l-2 1v-6z`,fill:`none`,stroke:`currentColor`,strokeWidth:1.2,strokeLinejoin:`round`}),(0,m.jsx)(`path`,{d:`M10.5 10l4 4M14.5 10l-4 4`,stroke:`currentColor`,strokeWidth:1.2})]}),g=()=>(0,m.jsxs)(`svg`,{viewBox:`0 0 16 16`,width:14,height:14,"aria-hidden":!0,children:[(0,m.jsx)(`path`,{d:`M1.5 3.5l1.5 1.5 2.5-3M1.5 10.5l1.5 1.5 2.5-3`,fill:`none`,stroke:`currentColor`,strokeWidth:1.2}),(0,m.jsx)(`path`,{d:`M8 4h7M8 11h7`,stroke:`currentColor`,strokeWidth:1.2})]}),_=e=>{let t=e?.getTheme().getFontScheme().getMinorFont();return{fontFamily:f.toCSSFontFamily(t??``,[`sans-serif`]),fontSize:`11pt`}},v=(0,p.memo)((0,p.forwardRef)((e,t)=>{let{children:n,disabled:a,style:f,slicer:v,movable:y,zoom:b=1,isDragging:x,onHide:S,onShow:C,onDragZone:w,adornmentHost:ee,flip:te,gesture:ne,...T}=e,E=s(),D=o(),O=(i()??v.getTable()?.getWorksheet()??null)?.getStyles()??null,[k,A]=(0,p.useReducer)(e=>e+1,0);r(v,{onAnyChange:A,onReferencesChange:A}),(0,p.useEffect)(()=>O?.addListeners({onAnyChange:A}),[O]);let[j,M]=(0,p.useState)([]);(0,p.useEffect)(()=>{let e=!0;if(!v.isDeleted())return v.getItems().then(t=>{e&&M(t)}).catch(()=>{e&&M([])}),()=>{e=!1}},[v,k]);let[N,P]=(0,p.useState)(!1),[F,I]=(0,p.useState)(null),L=(0,p.useRef)(null),R=(0,p.useRef)(null),z=(0,p.useRef)(null),[B,V]=(0,p.useState)(!1);(0,p.useLayoutEffect)(()=>{let e=z.current;if(!e)return;let t=()=>V(e.scrollHeight>e.clientHeight);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[j,v.getRowHeight(),v.getColumnCount(),v.isShowCaption()]),(0,p.useLayoutEffect)(()=>{w?.(e=>{let t=e.target;return!t||!z.current?.contains(t)&&!t.closest?.(`button`)})},[w]);let H=(0,p.useRef)(!1),U=v.getColumnCount(),W=v.getRowHeight();(0,p.useLayoutEffect)(()=>{if(H.current||j.length===0||!z.current)return;H.current=!0;let e=v.toJSON()?.startItem??0;e>0&&(z.current.scrollTop=Math.floor(e/U)*(W+4))},[j,U,W]);let G=(0,p.useCallback)(e=>{v.selectItems(e).catch(e=>D.showError(e))},[v,D]),K=(0,p.useCallback)((e,t)=>{if(a)return;let n=j.map(e=>e.key),r=v.isFilterCleared()?[]:j.filter(e=>e.isSelected).map(e=>e.key),i=L.current;if(t.shiftKey&&i!==null&&n.includes(i)){let a=n.indexOf(i),o=n.indexOf(e.key),s=n.slice(Math.min(a,o),Math.max(a,o)+1);G(t.ctrlKey||t.metaKey?[...new Set([...r,...s])]:s)}else L.current=e.key,t.ctrlKey||t.metaKey||N?r.length===0?G([e.key]):r.includes(e.key)?G(r.filter(t=>t!==e.key)):G([...r,e.key]):G([e.key])},[v,j,N,a,G]),q=c(t,()=>({isSlicerEditor:()=>!0}),[]),J=u(v.getStyle(),O),Y=(0,p.useMemo)(()=>l(J?.wholeTable,O),[J,O,k]),X=(0,p.useMemo)(()=>l(J?.headerRow,O),[J,O,k]);if(v.isDeleted())return null;let Z=v.isFilterCleared(),Q=v.isShowCaption(),$={display:`flex`,alignItems:`center`,justifyContent:`center`,width:22,height:22,padding:0,margin:0,border:`1px solid transparent`,borderRadius:2,background:`none`,color:`inherit`,cursor:`pointer`};return(0,m.jsxs)(`div`,{className:`slicer-editor`,...T,ref:q,style:{width:`100%`,height:`100%`,zoom:b,boxSizing:`border-box`,display:`flex`,flexDirection:`column`,overflow:`hidden`,position:`relative`,backgroundColor:`var(--sxl-color-base-100, white)`,border:`var(--sxl-color-neutral, grey) solid 1px`,..._(O),...Y,filter:a?`blur(1px)`:void 0,boxShadow:x?`1px 1px 2px var(--sxl-color-shadow, rgba(0,0,0,.15))`:void 0,...f},children:[Q?(0,m.jsxs)(`div`,{ref:R,className:`slicer-caption`,style:{display:`flex`,alignItems:`center`,gap:2,margin:`0 9px`,padding:`6px 0 4px 0`,flex:`none`,...X},children:[(0,m.jsx)(`span`,{style:{flex:`1 1 auto`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:v.getCaption()}),(0,m.jsx)(`button`,{type:`button`,className:`slicer-multi-select`,tabIndex:-1,title:E(`slicer.multiSelect`),"aria-label":E(`slicer.multiSelect`),"aria-pressed":N,style:{...$,borderColor:N?`var(--sxl-color-neutral, grey)`:`transparent`,backgroundColor:N?`var(--sxl-color-base-200, #eee)`:void 0},onClick:()=>P(e=>!e),children:(0,m.jsx)(g,{})}),(0,m.jsx)(`button`,{type:`button`,className:`slicer-clear`,tabIndex:-1,title:E(`slicer.clearFilter`),"aria-label":E(`slicer.clearFilter`),disabled:Z||a,style:{...$,opacity:Z?.4:1,cursor:Z?`default`:`pointer`},onClick:()=>{v.clearFilters().catch(e=>D.showError(e))},children:(0,m.jsx)(h,{})})]}):null,(0,m.jsx)(`div`,{ref:z,className:`slicer-items`,role:`listbox`,"aria-multiselectable":!0,"aria-label":v.getCaption(),style:{flex:`1 1 auto`,minHeight:0,overflowY:`auto`,overflowX:`hidden`,overscrollBehavior:`contain`,"--scrollbar-width":`8px`,"--scrollbar-border-width":`1px`,display:`grid`,gridTemplateColumns:`repeat(${U}, minmax(0, 1fr))`,gridAutoRows:`${W}px`,alignContent:`start`,gap:4,margin:(Q?4:9)+`px 9px 9px 9px`,paddingRight:B?3:0},onPointerLeave:()=>I(null),children:j.map(e=>{let t=d(e.isSelected,e.hasData,F===e.key);return(0,m.jsx)(`div`,{className:`slicer-item`,role:`option`,"aria-selected":e.isSelected,"data-key":e.key,"data-has-data":e.hasData||void 0,title:e.name,style:{boxSizing:`border-box`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:`0 4px`,overflow:`hidden`,whiteSpace:`nowrap`,textOverflow:`ellipsis`,userSelect:`none`,cursor:a?void 0:`pointer`,border:`1px solid transparent`,...l(J?.[t],O)},onPointerEnter:()=>I(e.key),onPointerDown:e=>{e.button===0&&(e.stopPropagation(),e.preventDefault(),y&&!y.isSelected()&&y.select())},onClick:t=>K(e,t),children:(0,m.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`},children:e.name})},e.key)})})]})}));v.displayName=`SlicerEditor`;var y={renderer:e=>(0,m.jsx)(v,{...e,slicer:e.movable.getContent()}),commands:(e,t)=>{let{sheet:n,movable:r}=t,i=r.getContent(),o=()=>({slicer:()=>i,styles:()=>n.getStyles()}),s=()=>{e.updateCommand(`formatSlicerStyle`,{callback:e=>{e&&i.setStyle(e)},state:i.getStyle(),context:o,disabledReasons:i.isReadOnly()?[a(`reason.sheetProtected`)]:[]})};return s(),i.addListeners({onAnyChange:s})}};export{y as SlicerKind};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Ci5NtzhJLll1kxGf.js","./9w0ECZmzGUyk3F_O.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{t as e}from"./HclGiUj8dZXDFmoM.js";import{c as t}from"./
|
|
2
|
+
import{t as e}from"./HclGiUj8dZXDFmoM.js";import{c as t}from"./CQukCzhuewMuFOlO.js";import{d as n}from"./EY31tFQrw7iYFrr6.js";import{t as r}from"./9w0ECZmzGUyk3F_O.js";var i=async(i,a)=>{let{papaParseConfig:o,setValuesOptions:s,createWorkbookOptions:c}=a??{},l=a?.progress,u=l?.onProgress?l.onProgress.bind(l):void 0,d=await e(()=>import(`./Ci5NtzhJLll1kxGf.js`).then(e=>r(e.default,1)),__vite__mapDeps([0,1]),import.meta.url),f=d.default??d,p=new TextDecoder().decode(i),m=-1,h=new n(c),g=h.getWorksheetAt(0),_=g.getEntireRange().getCoords(),v=_.colEnd,y=_.rowEnd,b=g.getEntireRange().createSparseBuilder({axis:t.Axis.Row}),x=0,S=0,C={...o,transform:(e,t)=>{o?.transform&&(e=o.transform(e,t));let n=t;n===0&&m++;let r=e??``;if(!(m>y||n>v))return b.pushAt(m,n,r),x++,x%1e5==0&&u?.(x),e;n===0&&S++}};return f.parse(p,C).data,b.apply({textParser:!0,autoFormat:!0,...s}),S>0&&l?.onWarning?.(`Ignored ${S} ${S===1?`row`:`rows`} that exceeded the maximum range of the sheet`),h};export{i as readCSV};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Gn as e,Pr as t,x as n,zn as r}from"./zEVoxCTt-ZW8Aowg.js";var i=!1;function a(e){let t=[];if(e.axis){let{from:n,to:r,color:i,width:a}=e.axis;t.push({type:`line`,shape:{x1:n.x,y1:n.y,x2:r.x,y2:r.y},style:{stroke:i,lineWidth:a},silent:!0})}for(let n of e.columns)t.push({type:`rect`,shape:{...n.rect},style:{fill:n.color},silent:!0});if(e.line){let{runs:n,color:r,width:i}=e.line;for(let e of n)e.length!==0&&e.length!==1&&t.push({type:`polyline`,shape:{points:e.map(e=>[e.x,e.y])},style:{stroke:r,lineWidth:i,fill:null,lineJoin:`round`,lineCap:`round`},silent:!0})}for(let n of e.markers)t.push({type:`circle`,shape:{cx:n.center.x,cy:n.center.y,r:n.radius},style:{fill:n.color},silent:!0});return t}function o(o){i||(i=!0,n([r,e]));let s=Math.max(1,o.width),c=Math.max(1,o.height),l=t(null,null,{renderer:`svg`,ssr:!0,width:s,height:c});try{return l.setOption({animation:!1,graphic:{elements:a(o)}}),l.renderToSVGString()}finally{l.dispose()}}export{o as renderSparklineToSVG,a as toGraphicElements};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as e}from"./ChSvXfVMLxZsP9zG.js";import{C as t,D as n,K as r,Ot as i,Z as a,ht as o,t as s}from"./DuYb_otrRZZDq6-f.js";import{c,i as l}from"./CQukCzhuewMuFOlO.js";import{$ as u,Bn as d,Br as f,dn as p,ti as m}from"./A_-Jwzwmm3lkcm2f.js";import{An as h,Ar as g,Cn as _,D as v,En as ee,Et as te,Hr as ne,K as re,Kt as ie,Ln as ae,Lr as oe,N as y,On as b,Or as x,Pn as se,Qt as ce,R as S,Rr as le,Rt as ue,Sn as de,V as C,Vt as fe,Xt as w,b as T,br as pe,bt as E,c as D,en as O,et as k,hr as A,it as j,jt as me,lt as M,on as he,pn as ge,r as N,sn as P,tn as F,vn as I,w as L,z as _e}from"./oO6aFwepb3DDkGYF.js";import"./D0nZlczIH0ULuSyL.js";import{a as ve,c as R,o as ye,s as be,t as xe}from"./BWDqL5_mwspr6CjI.js";var Se=class{constructor(e){this.list=e}get length(){return this.list.length}item(e){return this.list[e]}forEach(e,t){let n=this.list,r=n.length;for(let t=0;t<r;t++)e(n[t],t,this)}entries(){return this.list.entries()}keys(){return this.list.keys()}values(){return this.list.values()}[Symbol.iterator](){return this.list.values()}},Ce=e=>!0===e||e===`1`||e===`on`||e===`true`||!1!==e&&e!==`0`&&e!==`off`&&e!==`false`&&null,we=e=>{let t=parseInt(e);return isNaN(t)?null:t},Te=e=>{let t=parseFloat(e);return isNaN(t)?null:t},Ee=new Map,z=class{constructor(t,n,r,i,a,o=null,s=e.EmptyObject){this._fileLocation=``;let c=(e,t,n)=>s?.getRef?.(e,t,n,s?.parsedRefs),l=e=>s?.getRefs?.(e,s?.parsedRefs);this._parent=t,this.sharedShared=n,this.currentPath=r,this.elemRoot=i,this.jsonRoot=a,t?(this._fileLocation=t._fileLocation,this._getRef=t._getRef,this._getRefs=t._getRefs,this._serializeElement=t._serializeElement,this._readEmbeddedPart=t._readEmbeddedPart):(o&&(this._fileLocation=o),s?.getRef&&(this._getRef=c),s?.getRefs&&(this._getRefs=l),this._onWarning=s?.onWarning,this._addPerson=s?.addPerson,this._serializeElement=s?.serializeElement,this._readEmbeddedPart=s?.readEmbeddedPart)}getRef(e,t=!1){return this._getRef?.(e,this._fileLocation,t)??null}readEmbeddedPart(e){return this._readEmbeddedPart?.(e,this._fileLocation)??null}getRelationships(){return this._getRefs?.(this._fileLocation)??Ee}getPath(){return this.currentPath}getFileLocation(){return this._fileLocation}getElemRoot(){return this.elemRoot}getJsonRoot(){return this.jsonRoot}warn(e,t){this._raiseWarning(e,this.getFileLocation(),t?.onceKey)}_raiseWarning(e,t,n){this._onWarning?this._onWarning(e,t,n):this._parent?this._parent._raiseWarning(e,t,n):console.warn(e)}serializeElement(e){return this._serializeElement?.(e)??null}addPerson(e){return typeof e==`string`&&(e={displayName:e}),this._addPerson?this._addPerson(e):this._parent?this._parent?._addPerson?.(e)??null:null}getVisitorParamsState(){return this.sharedShared.getVisitorParamsState()}evaluate(e,t){if(!e)return t;let n=[t],r=e.split(`/`),i=r.length;for(let e=0;e<i;e++){let t=r[e];if(t===``||t===`.`)continue;let a=[],o=(t===`*`||t===`**`)&&e!==i-1;for(let i of n)if(i){if(o){let t=r[e+1];t&&t!==``&&t!==`.`&&(this._findDescendants(i,t,a),e++)}else if(t===`*`||t===`**`){if(!i.childNodes)continue;let e=i.childNodes,t=e.length;for(let n=0;n<t;n++){let t=e[n];t.nodeType===1&&a.push(t)}}else{if(!i.childNodes)continue;let e=i.childNodes,n=e.length;for(let r=0;r<n;r++){let n=e[r];if(n.nodeType!==1)continue;let i=n;this._matchesElementName(i,t)&&a.push(i)}}}if(n=a,n.length===0)return null}return n.length===1?n[0]:n.length===0?null:new Se(n)}_matchesElementName(e,t){return t.includes(`:`)?(e.tagName||e.nodeName)===t:e.localName===t}_findDescendants(e,t,n){if(!e||!e.childNodes)return;let r=e.childNodes,i=r.length;for(let e=0;e<i;e++){let i=r[e];if(i.nodeType!==1)continue;let a=i;this._matchesElementName(a,t)&&n.push(a),this._findDescendants(a,t,n)}}getFromPath(t,n){return e.getFromPath(t,n)}setToPath(t,n,r){return e.setToPath(t,n,r)}getValAttrAsString(e,t){let n=this.evaluate(e,t);return n&&n.hasAttribute(`val`)?n.getAttribute(`val`)??null:null}getValAttrAsBoolean(e,t,n=!1){let r=this.evaluate(e,t);if(!r)return null;let i=r.hasAttribute(`val`)?r.getAttribute(`val`):void 0;return i==null?n:i===`1`||i===`on`||i===`true`||i!==`0`&&i!==`off`&&i!==`false`&&n}getValAttrAsInteger(e,t){let n=this.evaluate(e,t);return n&&n.hasAttribute(`val`)?parseInt(n.getAttribute(`val`))??null:null}getValAttrAsFloat(e,t){let n=this.evaluate(e,t);return n&&n.hasAttribute(`val`)?parseFloat(n.getAttribute(`val`))??null:null}get BOOLEAN_COPY(){return Ce}get INT_COPY(){return we}get FLOAT_COPY(){return Te}copyFromAttribute(e,t,n,r=t,i=null){if(!e||!n||!e.hasAttribute(t))return;let a=e.getAttribute(t);if(i){if(Array.isArray(i)){let e=i.length;for(let t=0;t<e;t++)if(a==null||(a=i[t](a),a==null))return}else if(a==null||(a=i(a),a==null))return}this.setToPath(n,r,a)}},B=(e,t)=>{let n=[],r=e.childNodes,i=r.length;for(let e=0;e<i;e++){let i=r.item(e);i.nodeType===1&&i.localName===t&&n.push(i)}return n},De=[[`fillRef`,`fill`],[`lnRef`,`stroke`],[`effectRef`,`effect`]],V=(e,t)=>{let n=new j,r={};for(let[i,a]of De){let o=e.evaluate(i,t);if(!o)continue;let s={index:parseInt(o.getAttribute(`idx`)??`0`,10)||0},c=n.processAdjColor(e,o);c&&(s.color=c),r[a]=s}let i=e.evaluate(`fontRef`,t);if(i){let t={index:i.getAttribute(`idx`)??`none`},a=n.processAdjColor(e,i);a&&(t.color=a),r.font=t}return r},H=class{visit(e,t,n){if(!t)return;let r=e.evaluate(`*/cNvPr`,t);return r.item&&(r=r.item(0)),r&&(e.copyFromAttribute(r,`name`,n),e.copyFromAttribute(r,`descr`,n,`description`),e.copyFromAttribute(r,`hidden`,n,`hidden`,e.BOOLEAN_COPY),this.readNonVisualDetails(e,r,n),e.copyFromAttribute(r,`id`,n)),n}readNonVisualDetails(e,t,n){t.hasAttribute(`title`)&&(n.title=t.getAttribute(`title`));let r=e.evaluate(`hlinkClick`,t);r&&(n.hyperlink=y(e,r));let i=e.evaluate(`hlinkHover`,t);i&&(n.hoverHyperlink=y(e,i));let a=e.evaluate(`extLst`,t),o=a?e.serializeElement(a):null;o&&(n.extLst={...n.extLst,nonVisual:o})}setContent(e,t){let n=e;n.name!==void 0&&(t.name=n.name,delete n.name),n.description!==void 0&&(t.description=n.description,delete n.description);for(let e of[`title`,`hyperlink`,`hoverHyperlink`,`extLst`])n[e]!==void 0&&(t.json&&(t.json[e]=n[e]),delete n[e]);e.content=t}isGroupContent(e){return Array.isArray(e?.members)}readMemberHeader(e,t,n){let r={},i={anchor:void 0,content:{type:n,json:r}},a=e.evaluate(`*/cNvPr`,t);if(a?.item&&(a=a.item(0)),a){let n=a.getAttribute(`name`);n!==null&&(i.content.name=n);let o=a.getAttribute(`descr`);o&&(i.content.description=o),e.copyFromAttribute(a,`hidden`,i,`hidden`,e.BOOLEAN_COPY),this.readNonVisualDetails(e,a,r);let s=this.readSourceId(e,t);s!==void 0&&(r.sourceId=s)}return{movable:i,content:r}}readStyleRefs(e,t,n){let r=e.evaluate(`style`,t);if(!r)return void(n.style=null);let i=V(e,r),o=a.withoutDefaultStyleRefs({...n,style:i});o&&(n.style=o)}readLocks(e){let t=e?.attributes;if(!t||t.length===0)return;let n={};for(let e=0;e<t.length;e++){let r=t.item(e);r.name.startsWith(`xmlns`)||(n[r.localName??r.name]=A(r.value))}return Object.keys(n).length>0?n:void 0}readSourceId(e,t){let n=e.evaluate(`*/cNvPr`,t);n?.item&&(n=n.item(0));let r=n?.getAttribute?.(`id`),i=r?parseInt(r,10):void 0;return i===void 0||isNaN(i)?void 0:i}},Oe=[[`spDef`,`shape`],[`lnDef`,`line`],[`txDef`,`text`]],U=(e,t)=>{let n=t.getAttribute(`dxfId`);if(n===null)return;let r=parseInt(n);return e.getVisitorParamsState().get(`dxfs`)?.get(r)||(e.warn(`A color filter or sort names a format that does not exist (dxfId '${n}').`),{})},W=e=>e===`1`||e===`true`,G=class{visit(e,t,n){}processDataBarColor(e,t,n,r,i=`auto`){if(!t)return;let a=v(e=>t.getAttribute(e),i);return a&&(n[r]=a),n}processFonts(e,t,n){if(!t)return;let r=t.childNodes,i=0,a=r.length;for(let t=0;t<a;t++){let a=r.item(t);if(a.nodeType===1&&a.localName===`font`){let t={};this.processFont(e,a,t),n[i++]=t}}return n}processFont(e,t,r){e.getValAttrAsBoolean(`b`,t,!0)&&(r.weight=700),e.getValAttrAsBoolean(`i`,t,!0)&&(r.style=n.Style.Italic),e.getValAttrAsBoolean(`strike`,t,!0)&&(r.strike=M(!0));let i=e.evaluate(`u`,t);if(i){let e=i.getAttribute(`val`);r.underline=E(e)}let a=k(e.evaluate(`vertAlign`,t)?.getAttribute(`val`));a!==void 0&&(r.baseline=a),P(e,t,r,`sz`,`size`);let o=e.evaluate(`color`,t);this.processDataBarColor(e,o,r,`color`),r.color||=`auto`,w(e,t,r,`name`,`family`),w(e,t,r,`rFont`,`family`);let s=e.evaluate(`family`,t);if(s){let e=s.getAttribute(`val`);if(e)switch(e){case`1`:r.fallbacks=[`serif`];break;case`2`:r.fallbacks=[`sans-serif`];break;case`3`:r.fallbacks=[`monospace`];break;case`4`:r.fallbacks=[`cursive`];break;case`5`:r.fallbacks=[`fantasy`]}}D(r,e.evaluate(`scheme`,t)?.getAttribute(`val`)),x(e,t,r,`shadow`,`shadow`,!0),x(e,t,r,`outline`,`outline`,!0);for(let n of[`condense`,`extend`]){let i=C(n,!!e.getValAttrAsBoolean(n,t,!0));i!==void 0&&(r.letterSpacing=i)}return le(e,t,r,`charset`,`charset`),r}processFills(e,t,n){if(!t)return;let r=t.childNodes,i=0,a=r.length;for(let t=0;t<a;t++){let a=r.item(t);a.nodeType===1&&a.localName===`fill`&&this.processFill(e,a,n,i++)}return n}processFill(e,t,n,i){let a={type:r.Type.None},o=t.childNodes,s=!1,c=o.length;for(let t=0;!s&&t<c;t++){let n=o.item(t);n.nodeType===1&&(n.localName===`gradientFill`?(this.processGradientFill(e,n,a),s=!0):n.localName===`patternFill`&&(this.processPatternFill(e,n,a),s=!0))}return n[i]=a,n}processGradientFill(e,t,n){if(!t)return;n.type=r.Type.Gradient;let i=[];n.stops=i;let a=t.getAttribute(`type`);a&&(n.gradientType=a);let o=t.hasAttribute(`degree`)?parseFloat(t.getAttribute(`degree`)):0;(o+90)%360!=0&&(n.angle=(o+90)%360),(t.hasAttribute(`left`)||t.hasAttribute(`top`)||t.hasAttribute(`right`)||t.hasAttribute(`bottom`))&&(n.focus={left:K(t.getAttribute(`left`)),top:K(t.getAttribute(`top`)),right:K(t.getAttribute(`right`)),bottom:K(t.getAttribute(`bottom`))});let s=t.childNodes,c=s.length;for(let t=0;t<c;t++){let n=s.item(t);if(n.nodeType===1&&n.localName===`stop`){let t={};i.push(t),t.offset=parseFloat(n.getAttribute(`position`)??``);let r=e.evaluate(`color`,n);this.processDataBarColor(e,r,t,`color`)}}return n}processPatternFill(e,t,n){if(!t)return;let i=e.getVisitorParamsState().get(`processingDXFs`),a=t.getAttribute(`patternType`)||(i?r.BuiltInSheetPattern.Solid:r.BuiltInSheetPattern.None);if(a===r.BuiltInSheetPattern.None)return{none:!0};n.type=r.Type.Pattern,a&&(n.patternType=a);let o=`foreground`,s=`background`,c=n.patternType===r.BuiltInSheetPattern.Solid&&i,l=c?`dk1`:`lt1`,u=c?`lt1`:`dk1`;if(c){let e=o;o=s,s=e}let d=e.evaluate(`fgColor`,t);this.processDataBarColor(e,d,n,o,l);let f=e.evaluate(`bgColor`,t);return this.processDataBarColor(e,f,n,s,u),c&&(n.foreground||=`lt1`,n.background||=`dk1`),n}processBorders(e,t,n,r){if(!t)return;let i=t.childNodes,a=0,o=i.length;for(let t=0;t<o;t++){let o=i.item(t);o.nodeType===1&&o.localName===`border`&&this.processBorder(e,o,n,a++,r)}return n}processBorder(e,t,n,r,a){if(!t)return;let o={};this.processBorderStroke(e,t,o,i.Edge.Left),this.processBorderStroke(e,t,o,i.Edge.Right),a?(o.right||o.left)&&(o.vertical=o.right?{...o.right}:{...o.left}):this.processBorderStroke(e,t,o,i.Edge.Vertical),this.processBorderStroke(e,t,o,i.Edge.Top),this.processBorderStroke(e,t,o,i.Edge.Bottom),a?(o.bottom||o.top)&&(o.horizontal=o.bottom?{...o.bottom}:{...o.top}):this.processBorderStroke(e,t,o,i.Edge.Horizontal);let s=this.processBorderStroke(e,t,{},`diagonal`);return s&&(W(t.getAttribute(`diagonalUp`))&&(o.diagonalUp={...s}),W(t.getAttribute(`diagonalDown`))&&(o.diagonalDown={...s})),n[r]=o,n}processBorderStroke(e,t,n,r){if(!t)return;let a=e.evaluate(r,t);if(!a)return;let o={};a.hasAttribute(`style`)?o.style=a.getAttribute(`style`):e.getVisitorParamsState().get(`processingDXFs`)&&(o.style=i.StrokeStyle.None);let s=e.evaluate(`color`,a);return s&&this.processDataBarColor(e,s,o,`color`),Object.keys(o).length>0?n[r]=o:null}},K=e=>{if(!e)return 0;let t=parseFloat(e);return isNaN(t)?0:t},q=(e,t)=>{if(!e||e.nodeType!==1)return null;let n=e.childNodes;for(let e=0;e<n.length;e++){let r=n.item(e);if(r.nodeType===1&&r.localName===t)return r}return null},ke=new Set(Object.values(p.ElementType).filter(e=>e!==p.ElementType.WholeTable&&e!==p.ElementType.HeaderRow)),Ae={auto:`auto`,autoNoTable:`automaticExceptTables`,manual:`manual`},J=[`tableId`,`columnId`,`cacheName`,`cachePath`,`sourceName`,`sortOrder`,`customListSort`,`crossFilter`,`pivotTables`,`pivotCacheId`,`pivotBody`,`tabular`,`pivotData`,`showMissing`],je=new Set([`name`,`xr10:uid`,`cache`,`caption`]),Y=(e,t)=>{let n=e.content,r=n?.json;if(r){if(n.type===`shape`||n.type===`picture`){let{rotation:n,flipH:i,flipV:a,bounds:o}=r;delete r.rotation,delete r.flipH,delete r.flipV,delete r.bounds,n!==void 0&&n!==0&&(e.rotation=n),i&&(e.flipH=!0),a&&(e.flipV=!0),t&&o&&(e.anchor={tl:{x:o.x,y:o.y},br:{x:o.width,y:o.height}})}if(n.type===`group`)for(let e of r.members??[])Y(e,!0)}},X=class extends H{visit(e,t,n){if(t)return this.visitShape(e,t,n,`sp`,`nvSpPr/cNvSpPr/spLocks`)}visitShape(e,n,r,i,a){let o=F[i];if(this.isGroupContent(r)){if(e.getPath().includes(`Fallback`))return{};let{movable:s,content:c}=this.readMemberHeader(e,n,`shape`);o!==t.Type.Shape&&(c.type=o),this.readShapeDetails(e,n,i,a,c),this.readStyleRefs(e,n,c);let l=e.evaluate(a,n);l?.hasAttribute?.(`noChangeAspect`)&&(s.lockAspect=l.getAttribute(`noChangeAspect`)===`1`);let u=this.readTwinOf(e,n);return u!==void 0&&Object.assign(c,{twinOf:u}),r.members.push(s),c}if(e.getPath().includes(`Fallback`)&&r.content){let i=r.content.json;if(r.content.type===`shape`&&i&&(i.type??t.Type.Shape)===o){let t=e.evaluate(`txBody`,n),r=t?new O().readTextBody(e,t):null;r&&ie(r)!==``&&(i.text=r)}return{}}r=super.visit(e,n,r);let s=e.evaluate(a,n);s?.hasAttribute?.(`noChangeAspect`)&&(r.lockAspect=s.getAttribute(`noChangeAspect`)===`1`);let c=o===t.Type.Shape?{}:{type:o},l=this.readSourceId(e,n);l!==void 0&&(c.sourceId=l),this.readShapeDetails(e,n,i,a,c),this.readStyleRefs(e,n,c);let u=this.readTwinOf(e,n);return u!==void 0&&Object.assign(c,{twinOf:u}),this.setContent(r,{type:`shape`,json:c}),c}readTwinOf(e,t){let n=e.evaluate(`*/cNvPr/extLst/ext/compatExt`,t);n?.item&&(n=n.item(0));let r=/^_x0000_s(\d+)$/.exec(n?.getAttribute?.(`spid`)??``);return r?parseInt(r[1],10):void 0}readShapeDetails(e,t,n,r,i){let a=t.getAttribute(`macro`);a&&(i.macro=a);let o=t.getAttribute(`textlink`);o&&(i.textLink=o),t.hasAttribute(`fLocksText`)&&(i.locksText=A(t.getAttribute(`fLocksText`))),t.hasAttribute(`fPublished`)&&(i.published=A(t.getAttribute(`fPublished`)));let s=r.slice(0,r.lastIndexOf(`/`)),c=e.evaluate(s,t);c?.getAttribute?.(`txBox`)===`1`&&(i.textBox=!0);let l=this.readLocks(e.evaluate(r,t));if(l&&(i.locks=l),n===`cxnSp`&&c){let t=t=>{let n=e.evaluate(t,c);if(n?.getAttribute)return{id:parseInt(n.getAttribute(`id`)??`0`,10)||0,index:parseInt(n.getAttribute(`idx`)??`0`,10)||0}},n=t(`stCxn`),r=t(`endCxn`);(n||r)&&(i.connectorEnds={},n&&(i.connectorEnds.start=n),r&&(i.connectorEnds.end=r))}}},Me=/^<a:extLst(?:\s+xmlns:a="[^"]*")?><a:ext uri="\{28A0092B-C50C-407E-A947-70E740481C1C\}"><a14:useLocalDpi(?:\s+xmlns:a14="[^"]*")?\s+val="0"\s*\/><\/a:ext><\/a:extLst>$/,Z=(e,t,n,r)=>{let i=e.evaluate(n,t),a=e.evaluate(r,t);return i||a?{x:h(i?.getAttribute(`x`)??null)??0,y:h(i?.getAttribute(`y`)??null)??0,width:h(a?.getAttribute(`cx`)??null)??0,height:h(a?.getAttribute(`cy`)??null)??0}:null},Ne={Checkbox:`checkbox`},Q=e=>{let t=e.getAttribute(`val`);return t!==`0`&&t!==`false`},Pe={1:`serif`,2:`sans-serif`,3:`monospace`,4:`cursive`,5:`fantasy`};function Fe(e){let t={},r=e.childNodes;for(let e=0;e<r.length;e++){let i=r.item(e);if(i.nodeType===1)switch(i.localName){case`b`:t.weight=Q(i)?700:400;break;case`i`:t.style=Q(i)?n.Style.Italic:n.Style.Normal;break;case`strike`:t.strike=M(Q(i));break;case`outline`:t.outline=Q(i);break;case`shadow`:t.shadow=Q(i);break;case`condense`:case`extend`:{let e=C(i.localName,Q(i));e!==void 0&&(t.letterSpacing=e);break}case`u`:t.underline=E(i.getAttribute(`val`));break;case`vertAlign`:{let e=k(i.getAttribute(`val`));e!==void 0&&(t.baseline=e);break}case`sz`:{let e=parseFloat(i.getAttribute(`val`)??``);isNaN(e)||(t.size=e);break}case`rFont`:{let e=i.getAttribute(`val`);e&&(t.family=e);break}case`family`:{let e=Pe[i.getAttribute(`val`)??``];e&&(t.fallbacks=[e]);break}case`charset`:{let e=parseInt(i.getAttribute(`val`)??``,10);isNaN(e)||(t.charset=e);break}case`scheme`:D(t,i.getAttribute(`val`));break;case`color`:{let e=i.getAttribute(`rgb`);if(e&&!i.hasAttribute(`theme`)){t.color=`#`+(e.length===8?e.substring(2):e).toUpperCase();break}let n=v(e=>i.getAttribute(e));n&&(t.color=n);break}}}return Object.keys(t).length>0?t:null}var $={RelsVisitor:class{visit(e,t,n){if(!t)return;let r=t.childNodes,i=r.length;for(let t=0;t<i;t++){let i=r.item(t);i.nodeType===1&&i.localName===`Relationship`&&this.processRelationship(e,i,n)}return n}processRelationship(e,t,n){let r={};e.copyFromAttribute(t,`Target`,r,`target`),e.copyFromAttribute(t,`Type`,r,`type`),e.copyFromAttribute(t,`TargetMode`,r,`targetMode`),n[t.getAttribute(`Id`)]=r}},CorePropertiesVisitor:class{visit(e,t,n){let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);if(n.nodeType!==1)continue;let a=this.processProperty(e,n);a&&r.push(a)}return r.length>0&&(n.properties=r),r}processProperty(e,t){if(t)return t.getAttribute(`xsi:type`),{key:t.localName,value:t.textContent||``}}},AppPropertiesVisitor:class{visit(e,t,n){let r=t.childNodes,i=r.length;for(let e=0;e<i;e++)if(r.item(e).localName===`property`)return this.visitCustom(t,n);let a=[];for(let t=0;t<i;t++){let n=r.item(t);if(n.nodeType!==1)continue;let i=this.processProperty(e,n);i&&a.push(i)}return a.length>0&&(n.properties=a),a}visitCustom(e,t){let n=[],r=e.childNodes,i=r.length;for(let e=0;e<i;e++){let t=r.item(e);if(t.nodeType!==1||t.localName!==`property`)continue;let i=t.getAttribute(`name`);if(!i)continue;let a=null;for(let e=0;e<t.childNodes.length&&!a;e++){let n=t.childNodes.item(e);n.nodeType===1&&(a=n)}let o={key:i,kind:a?.localName??null,value:a?.textContent??``},s=t.getAttribute(`linkTarget`);s&&(o.linkTarget=s),n.push(o)}return n.length>0&&(t.custom=n),n}processProperty(e,t){if(t)return{key:t.localName,value:t.textContent||``}}},ShapePropertiesVisitor:S,TextPropertiesVisitor:re,ShapeTextVisitor:O,ThemeVisitor:class{visit(e,t,n){n.name=t.getAttribute(`name`),n.objectDefaults={};let r=B(t,`custClrLst`)[0];if(r){let t=new j,i=[];for(let n of B(r,`custClr`)){let r=t.processAdjColor(e,n);if(!r)continue;let a={color:r},o=n.getAttribute(`name`);o&&(a.name=o),i.push(a)}i.length&&(n.customColors=i)}for(let e of B(t,`extLst`))for(let t of B(e,`ext`)){if(t.getAttribute(`uri`)!==`{05A4C25C-085E-4340-85A3-A5531E510DB2}`)continue;let e=B(t,`themeFamily`)[0],r=e?.getAttribute(`id`);if(!r)continue;let i={name:e.getAttribute(`name`)??``,id:r},a=e.getAttribute(`vid`);a&&(i.vid=a),n.family=i}return n}},ClrSchemeVisitor:class extends j{visit(e,t,n){let r={};r.name=t.getAttribute(`name`);let i=t.childNodes,a=i.length;for(let n=0;n<a;n++){let a=i.item(n);if(a.nodeType===1){let n=a.localName,i=e.evaluate(n,t);r[n]=this.processAdjColor(e,i)}}return Object.keys(r).length>0&&(n.colors=r),r}},FontSchemeVisitor:class{visit(e,t,n){let r={};r.name=t.getAttribute(`name`);let i=this.processFontCollection(e,e.evaluate(`majorFont`,t));i&&(r.major=i);let a=this.processFontCollection(e,e.evaluate(`minorFont`,t));return a&&(r.minor=a),n.fonts=r,r}processFontCollection(e,t){if(!t)return;let n={},r=e.evaluate(`latin`,t),i=r?.getAttribute(`typeface`);i&&(n.latin=i);let a=r?.getAttribute(`panose`);a&&(n.panose=a);let o=e.evaluate(`ea`,t)?.getAttribute(`typeface`);o&&(n.eastAsian=o);let s=e.evaluate(`cs`,t)?.getAttribute(`typeface`),c;s&&(n.complexScript=s);let l=t.childNodes,u=l.length;for(let e=0;e<u;e++){let t=l.item(e);if(t.nodeType!==1||t.localName!==`font`)continue;let n=t.getAttribute(`script`);n&&((c??={})[n]=t.getAttribute(`typeface`)??``)}return c&&(n.scripts=c),n}},ObjectDefaultsVisitor:class{visit(e,t,n){let r={};for(let[n,i]of Oe){let a=e.evaluate(n,t);a&&(r[i]=this.processDefault(e,a))}return n.objectDefaults=r,{}}processDefault(e,t){let n={},r=e.evaluate(`spPr`,t);r&&new S().visit(e,r,n);let i=new O().readTextBody(e,t);(i.body||i.listStyle)&&(n.text=i);let a=e.evaluate(`style`,t);return a&&(n.style=V(e,a)),n}},FmtSchemeVisitor:class extends j{visit(e,t,n){let r=this.parseFillList(e,t,`fillStyleLst`),i=this.parseLnList(e,t,`lnStyleLst`),a=this.parseEffectStyleList(e,t,`effectStyleLst`),o=this.parseFillList(e,t,`bgFillStyleLst`);if(r&&(n.fillStyleLst=r),i&&(n.lnStyleLst=i),a&&(n.effectStyleLst=a),o&&(n.bgFillStyleLst=o),r&&i&&a&&o)return;let s=e.serializeElement(t);s&&(n.formatSchemeXml=s)}parseFillList(e,t,n){let r=e.evaluate(n,t);if(!r)return;let i=[],a=r.childNodes,o=a.length;for(let t=0;t<o;t++){let n=a.item(t);if(n.nodeType!==1)continue;let r=this.parseFillListItem(e,n);if(r===void 0)return;i.push(r)}return i}parseFillListItem(e,t){switch(t.localName){case`noFill`:return{type:r.Type.None};case`solidFill`:{let n=this.processAdjColor(e,t);return n?{type:r.Type.Solid,color:n}:void 0}case`gradFill`:return this.processGradFill(e,t);case`pattFill`:return this.processPatternFill(e,t);default:return}}parseLnList(e,t,n){let r=e.evaluate(n,t);if(!r)return;let i=[],a=r.childNodes,o=a.length;for(let t=0;t<o;t++){let n=a.item(t);n.nodeType===1&&i.push(this.parseLn(e,n))}return i}parseEffectStyleList(e,t,n){let r=e.evaluate(n,t);if(!r)return;let i=[],a=r.childNodes,o=a.length;for(let t=0;t<o;t++){let n=a.item(t);if(n.nodeType!==1)continue;if(e.evaluate(`scene3d`,n)||e.evaluate(`sp3d`,n))return;let r=this.getEffects(e,n);if(r===void 0)return;i.push(r??[])}return i}},AutoFilterVisitor:class{visit(e,t,n){if(!t)return;let r={},i=[];return this.processFilterColumns(e,t,i,n),i.length>0&&(r.conditions=i),Object.keys(r).length>0&&(n.filter=r),n}processColorFilter(e,t){let n={},r={operator:d.BuiltInOperatorNames.Color,param:n};e.copyFromAttribute(t,`cellColor`,n,`cellColor`,e.BOOLEAN_COPY);let i=U(e,t);return i&&(n.style=i),r}processCustomFilter(e,t){return oe({operator:t.getAttribute(`operator`),val:t.getAttribute(`val`)},t=>e.warn(t))}processCustomFilters(e,t){let n=t.getAttribute(`and`),r=n===`and`||n===`1`;t.getAttribute(`val`);let i=[],a={operator:r?d.BuiltInOperatorNames.And:d.BuiltInOperatorNames.Or,param:i},o=t.childNodes,s=o.length;for(let t=0;t<s;t++){let n=o.item(t);if(n.nodeType!==1)continue;let r=null;n.localName===`customFilter`&&(r=this.processCustomFilter(e,n)),r&&i.push(r)}return i.length===1?i[0]:he(a)}processDynamicFilter(e,t){return N(t.getAttribute(`type`),t.getAttribute(`val`),t.getAttribute(`maxVal`))}processDateGroupItem(e,t){let n={};return e.copyFromAttribute(t,`dateTimeGrouping`,n,`group`),e.copyFromAttribute(t,`day`,n,`day`,e.INT_COPY),e.copyFromAttribute(t,`hour`,n,`hour`,e.INT_COPY),e.copyFromAttribute(t,`minute`,n,`minute`,e.INT_COPY),e.copyFromAttribute(t,`month`,n,`month`,e.INT_COPY),e.copyFromAttribute(t,`second`,n,`second`,e.INT_COPY),e.copyFromAttribute(t,`year`,n,`year`,e.INT_COPY),n}processFilterItem(e,t){if(t.hasAttribute(`val`))return t.getAttribute(`val`)}processFilters(e,t){let n={},r={operator:d.BuiltInOperatorNames.InSet,param:n};r.selector=d.BuiltInSelectorNames.Display,e.copyFromAttribute(t,`blank`,n,`blank`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`calendarType`,n,`calendarType`);let i=[],a=[],o=t.childNodes,s=o.length;for(let t=0;t<s;t++){let n=o.item(t);if(n.nodeType===1){if(n.localName===`dateGroupItem`){let t=this.processDateGroupItem(e,n);t&&i.push(t)}else if(n.localName===`filter`){let t=this.processFilterItem(e,n);t!==void 0&&a.push(t)}}}return i.length>0&&(n.dateGroups=i),a.length>0&&(n.items=a),r}processIcon(e,t){let n={},r={operator:d.BuiltInOperatorNames.Icon,param:n};return e.copyFromAttribute(t,`iconId`,n,`iconId`,e.INT_COPY),e.copyFromAttribute(t,`iconSet`,n),r}processTop10(e,t){let n={},r={operator:d.BuiltInOperatorNames.TopN,param:n};return e.copyFromAttribute(t,`filterVal`,n,`filterVal`,e.FLOAT_COPY),e.copyFromAttribute(t,`percent`,n,`percent`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`top`,n,`top`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`val`,n,`limit`,e.FLOAT_COPY),r}processFilterColumnExt(e,t){let n=t.childNodes;for(let t=0;t<n.length;t++){let r=n.item(t);if(r.nodeType!==1||r.localName!==`ext`||b(r.getAttribute(`uri`))!==b(`{1AD28BCE-077C-4C59-8B6E-1921CE8616D4}`))continue;let i=r.childNodes;for(let t=0;t<i.length;t++){let n=i.item(t);if(n.nodeType!==1||n.localName!==`filterColumn`)continue;let r=n.childNodes;for(let t=0;t<r.length;t++){let n=r.item(t);if(n.nodeType===1&&n.localName===`filters`)return this.processFilters(e,n)}}}}processFilterCriteria(e,t){if(!t)return;let n=t.childNodes,r,i=n.length;for(let t=0;t<i;t++){let i=n.item(t);i.nodeType===1&&(i.localName===`colorFilter`?r=this.processColorFilter(e,i):i.localName===`customFilters`?r=this.processCustomFilters(e,i):i.localName===`dynamicFilter`?r=this.processDynamicFilter(e,i):i.localName===`filters`?r=this.processFilters(e,i):i.localName===`iconFilter`?r=this.processIcon(e,i):i.localName===`top10`?r=this.processTop10(e,i):i.localName===`extLst`&&(r=this.processFilterColumnExt(e,i)??r))}return r}processFilterColumn(e,t,n){if(!t)return null;if(!t.hasAttribute(`colId`))return;let r=parseInt(t.getAttribute(`colId`)),i=!1;if(t.hasAttribute(`hiddenButton`)&&(i=A(t.getAttribute(`hiddenButton`))),i&&n){let e=n.hiddenButtons;e||(e=[],n.hiddenButtons=e),e.push(r)}let a=!1;if(t.hasAttribute(`showButton`)&&(a=A(t.getAttribute(`showButton`))),a&&n){let e=n.showButtons;!0!==e&&(e||(e=[],n.showButtons=e),e[r]=!0)}let o=this.processFilterCriteria(e,t);return o?(o.index=r,o):null}processFilterColumns(e,t,n,r){if(!t)return;let i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let a=i.item(t);if(a.nodeType===1&&a.localName===`filterColumn`){let t=this.processFilterColumn(e,a,r);t&&n.push(t)}}return n}},SortStateVisitor:class{visit(e,t,n){if(!t)return;let r=t.getAttribute(`ref`),i={};t.hasAttribute(`caseSensitive`)&&(i.collatorOptions=A(t.getAttribute(`caseSensitive`))?m.CaseSensitiveOptions:m.CaseInsensitiveOptions);let a=t.getAttribute(`sortMethod`);a!=null&&a!==`none`&&(a===`stroke`?i.collatorOptions={...i.collatorOptions,collation:`stroke`}:a===`pinYin`&&(i.collatorOptions={...i.collatorOptions,collation:`pinyin`}));let o={};t.hasAttribute(`columnSort`)&&A(t.getAttribute(`columnSort`))&&(o.axis=c.Axis.Column);let s=f.fastStringToRange(r),l=[],u=[];this.processSortConditions(e,t,l,s,i,u),l.length>0&&(o.sorts=l);let d=e.getVisitorParamsState().get(`ref`);if(d&&r){let e=f.fastStringToRange(d);o.extent={range:g(e,s),sorts:u.map(t=>L(e,s,t))}}return Object.keys(l).length>0&&(n.sort=o),o}processSortCondition(e,t,n,r,i){if(!t)return null;let a={};if(!t.hasAttribute(`ref`))return void e.warn(`A sort condition has no ref; it was dropped.`,{onceKey:`xlsx.sheet.sort.noRef`});if(t.hasAttribute(`ref`)){let e=t.getAttribute(`ref`),r=f.fastStringToRange(e);a.index=n?r.colStart-n.colStart:r.colStart,i?.push(r)}let o={...r};a.criteria=o,o.reverse=!1,t.hasAttribute(`descending`)&&(o.reverse=A(t.getAttribute(`descending`)));let s=te(t.getAttribute(`sortBy`));s&&(o.sortOn=s);let c=U(e,t);return c&&(o.style=c),e.copyFromAttribute(t,`iconSet`,o),e.copyFromAttribute(t,`customList`,o),a}processSortConditions(e,t,n,r,i,a){if(!t)return;let o=t.childNodes,s=o.length;for(let t=0;t<s;t++){let s=o.item(t);if(s.nodeType===1&&s.localName===`sortCondition`){let t=this.processSortCondition(e,s,r,i,a);t&&n.push(t)}}}},SheetStyleVisitor:class extends G{visit(e,t,n){this.processNumFmts(e,e.evaluate(`numFmts`,t),null),e.getVisitorParamsState().set(`colorsToProcess`,new Set);let a={fills:{},fonts:{},borders:{}},o=e.evaluate(`fonts`,t);this.processFonts(e,o,a.fonts);let s=a.fonts[this.normalFontId(e,t)],c={declared:[`1`,`true`].includes(o?.getAttribute(`x14ac:knownFonts`)??``),normalIsThemeFont:ae(s?.family),faces:de(Object.values(a.fonts).map(e=>({...e,family:se(e?.family,e?.fallbacks,null,!1).name})))};e.getVisitorParamsState().set(ge,c),s&&e.getVisitorParamsState().set(`defaultFont`,s),this.processFills(e,e.evaluate(`fills`,t),a.fills),this.processBorders(e,e.evaluate(`borders`,t),a.borders,!0),a.fills[0]={type:r.Type.None},a.fills[1]={type:r.Type.Pattern,patternType:r.BuiltInSheetPattern.Gray125},a.borders[0]={bottom:{style:i.StrokeStyle.None},left:{style:i.StrokeStyle.None},right:{style:i.StrokeStyle.None},top:{style:i.StrokeStyle.None}};let l=[];this.processXFs(e,e.evaluate(`cellStyleXfs`,t),l,a,null,!1);let u=new Map;if(l.length>0){let r=[];this.processCellStyles(e,e.evaluate(`cellStyles`,t),r,l,u),n.named=r}let d=[];this.processXFs(e,e.evaluate(`cellXfs`,t),d,a,u),Object.keys(d).length>0&&(n.direct=d);let f=this.collectHiddenXfs(e.evaluate(`cellXfs`,t));f.size>0&&e.getVisitorParamsState().set(`hiddenXfs`,f);let p=this.collectPivotButtonXfs(e.evaluate(`cellXfs`,t));p.size>0&&e.getVisitorParamsState().set(`pivotButtonXfs`,p);let m=this.collectXfComplements(e.evaluate(`cellXfs`,t));m.size>0&&e.getVisitorParamsState().set(`xfComplements`,m);let h=[];return this.processDXFs(e,e.evaluate(`dxfs`,t),h),this.processTableStyles(e,e.evaluate(`tableStyles`,t),n,h),this.processSlicerStyles(e,e.evaluate(`extLst`,t),n),this.processIndexColors(e,e.evaluate(`colors/indexedColors`,t),n),this.processMruColors(e,e.evaluate(`colors/mruColors`,t),n),n}normalFontId(e,t){let n=e.evaluate(`cellStyles`,t)?.childNodes,r=0;for(let e=0;e<(n?.length??0);e++){let t=n.item(e);if(t.nodeType===1&&t.getAttribute(`builtinId`)===`0`){r=parseInt(t.getAttribute(`xfId`)??`0`,10)||0;break}}let i=e.evaluate(`cellStyleXfs`,t)?.childNodes,a=0;for(let e=0;e<(i?.length??0);e++){let t=i.item(e);if(t.nodeType===1&&a++===r)return parseInt(t.getAttribute(`fontId`)??`0`,10)||0}return 0}processIndexColors(e,t,n){if(!t)return;let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);if(n.nodeType===1&&n.localName===`rgbColor`){let t={color:null};this.processDataBarColor(e,n,t,`color`),t.color&&r.push(t.color)}}n.indexedColors=r}processMruColors(e,t,n){if(!t)return;let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);if(n.nodeType===1&&n.localName===`color`){let t={color:null};this.processDataBarColor(e,n,t,`color`),t.color&&r.push(t.color)}}r.length>0&&(n.mruColors=r)}processNumFmts(e,t,n){if(!t)return;let r=new Map;if(e.getVisitorParamsState().set(`numFmts`,r),!t)return;let i=t.childNodes,a=i.length;for(let e=0;e<a;e++){let t=i.item(e);if(t.nodeType===1&&t.localName===`numFmt`){let e=t.getAttribute(`numFmtId`),n=t.getAttribute(`formatCode`);if(e&&n){let t=n;r.set(parseInt(e),t)}}}}processXFs(e,t,n,r,i=null,a=!0){if(!t)return;let o=t.childNodes,s=o.length;for(let t=0;t<s;t++){let s=o.item(t);if(s.nodeType===1&&s.localName===`xf`){let t={};this.processXF(e,s,t,r,i,a),n.push(t)}}}processXF(e,t,n,r,i,a){if(!t)return;let o=t.getAttribute(`xfId`);if(o&&i){let e=i.get(parseInt(o));e&&e!==s.BuiltInName.Normal&&(n.named=e)}let c=e=>!(!a&&t.hasAttribute(e))||A(t.getAttribute(e)),l=e=>!a||t.hasAttribute(e)&&A(t.getAttribute(e)),u=a?`0`:void 0;if(c(`applyFont`)){let e=t.getAttribute(`fontId`)??u;if(e!==void 0&&(e!==`0`||l(`applyFont`))){let t=r.fonts[e];t!==void 0&&(n.font=t)}}if(c(`applyFill`)){let e=t.getAttribute(`fillId`)??u;if(e!==void 0&&(e!==`0`||l(`applyFill`))){let t=r.fills[e];t!==void 0&&Object.keys(t).length>0&&(n.fill=t)}}if(c(`applyBorder`)){let e=t.getAttribute(`borderId`)??u;if(e!==void 0&&(e!==`0`||l(`applyBorder`))){let t=r.borders[e];t!==void 0&&(n.borders=t)}}if(c(`applyNumberFormat`)){let r=t.getAttribute(`numFmtId`)??u;if(r!==void 0&&(r!==`0`||l(`applyNumberFormat`))){let t=parseInt(r),i,a=e.getVisitorParamsState();if(a){let e=a.get(`numFmts`);e&&(i=e.get(t)),n.numberFormat=i??t}else e.warn(`Number formats were unavailable; a cell format was not read.`,{onceKey:`xlsx.style.numberFormat.state`})}}if(c(`applyAlignment`)){let r=e.evaluate(`alignment`,t);(r||l(`applyAlignment`))&&this.processAlignment(e,r,n)}if(c(`applyProtection`)){let r=e.evaluate(`protection`,t);(r||l(`applyProtection`))&&this.processProtection(e,r,n)}let d=A(t.getAttribute(`quotePrefix`)??``);d&&(n.quotePrefix=d)}processAlignment(e,t,n){let r={};if(r.horizontal=t?.hasAttribute(`horizontal`)?t.getAttribute(`horizontal`):o.HorizontalAlignment.General,r.vertical=t?.hasAttribute(`vertical`)?t.getAttribute(`vertical`):o.VerticalAlignment.Bottom,r.indent=t?.hasAttribute(`indent`)?parseInt(t.getAttribute(`indent`)):0,r.relativeIndent=t?.hasAttribute(`relativeIndent`)?parseInt(t.getAttribute(`relativeIndent`)):0,r.overflow=A(t?.getAttribute(`wrapText`)??``)?o.Overflow.Wrap:o.Overflow.Visible,A(t?.getAttribute(`shrinkToFit`)??``)&&(r.overflow=o.Overflow.Shrink),t?.hasAttribute(`textRotation`)){let e=parseFloat(t.getAttribute(`textRotation`));e>0&&e<=90?e=360-e:e>90&&e<=180?e-=90:e===255&&(e=0,r.stacked=!0),r.rotation=e}else r.rotation=0;t?.hasAttribute(`justifyLastLine`)&&(r.justifyLastLine=A(t.getAttribute(`justifyLastLine`)));let i=t?.getAttribute(`readingOrder`);return i&&(i===`0`?r.readingDirection=o.ReadingDirection.Auto:i===`1`?r.readingDirection=o.ReadingDirection.LeftToRight:i===`2`?r.readingDirection=o.ReadingDirection.RightToLeft:e.warn(`Invalid readingOrder '${i}'; the direction was left automatic.`,{onceKey:`xlsx.style.readingOrder`})),Object.keys(r).length>0&&(n.alignment=r),n}collectHiddenXfs(e){let t=new Set;if(!e)return t;let n=e.childNodes,r=0;for(let e=0;e<n.length;e++){let i=n.item(e);if(i.nodeType!==1||i.localName!==`xf`)continue;let a=i.childNodes;for(let e=0;e<a.length;e++){let n=a.item(e);n.nodeType===1&&n.localName===`protection`&&A(n.getAttribute(`hidden`)??``)&&t.add(r)}r++}return t}collectPivotButtonXfs(e){let t=new Set;if(!e)return t;let n=e.childNodes,r=0;for(let e=0;e<n.length;e++){let i=n.item(e);i.nodeType===1&&i.localName===`xf`&&(A(i.getAttribute(`pivotButton`)??``)&&t.add(r),r++)}return t}collectXfComplements(e){let t=new Map;if(!e)return t;let n=e.childNodes,r=0;for(let e=0;e<n.length;e++){let i=n.item(e);if(i.nodeType!==1||i.localName!==`xf`)continue;let a=q(i,`extLst`);if(a){let e=a.childNodes;for(let n=0;n<e.length;n++){let i=q(e.item(n),`xfComplement`),a=parseInt(i?.getAttribute(`i`)??``,10);isNaN(a)||t.set(r,a)}}r++}return t}processProtection(e,t,n){if(!t)return;let r=t.getAttribute(`locked`);return n.protection={alwaysUnlocked:!!r&&!A(r)},n}processDXF(e,t,n){if(!t)return;let r=t.childNodes,i=r.length;for(let t=0;t<i;t++){let i=r.item(t);if(i.nodeType===1&&i.localName===`font`){let t={};this.processFont(e,i,t),n.font=t}else if(i.nodeType===1&&i.localName===`fill`){let t=[];this.processFill(e,i,t,0),t.length>0&&t[0]&&(n.fill=t[0])}else if(i.nodeType===1&&i.localName===`border`){let t=[];this.processBorder(e,i,t,0,!1),t.length>0&&t[0]&&(n.borders=t[0])}else if(i.nodeType===1&&i.localName===`numFmt`){let e=i.getAttribute(`formatCode`);if(e)n.numberFormat=e;else{let e=i.getAttribute(`numFmtId`);e&&(n.numberFormat=Number(e))}}else i.nodeType===1&&i.localName===`alignment`&&this.processAlignment(e,i,n)}}processDXFs(e,t,n){if(!t)return;e.getVisitorParamsState().set(`processingDXFs`,!0);let r=new Map;e.getVisitorParamsState().set(`dxfs`,r);let i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let a=i.item(t);if(a.nodeType===1&&a.localName===`dxf`){let t={};this.processDXF(e,a,t);let i=n.length;r.set(i,t),n.push(t)}}e.getVisitorParamsState().delete(`processingDXFs`)}processSlicerStyles(e,t,n){if(!t)return;let r=null,i=null,a=t.childNodes;for(let e=0;e<a.length;e++){let t=a.item(e);if(t.nodeType!==1||t.localName!==`ext`)continue;let n=t.childNodes;for(let e=0;e<n.length;e++){let t=n.item(e);t.nodeType===1&&(t.localName===`dxfs`?r=t:t.localName===`slicerStyles`&&(i=t))}}if(!i)return;let o=[];if(r){e.getVisitorParamsState().set(`processingDXFs`,!0);let t=r.childNodes;for(let n=0;n<t.length;n++){let r=t.item(n);if(r.nodeType!==1||r.localName!==`dxf`)continue;let i={};this.processDXF(e,r,i),o.push(i)}e.getVisitorParamsState().delete(`processingDXFs`)}let s={},c=i.getAttribute(`defaultSlicerStyle`);c&&c!==`SlicerStyleLight1`&&(s.defaultSlicerStyle=c);let l=n.tables?.styles,u=i.childNodes;for(let t=0;t<u.length;t++){let n=u.item(t);if(n.nodeType!==1||n.localName!==`slicerStyle`)continue;let r=n.getAttribute(`name`);if(!r)continue;let i={},a=l?.[r];a&&!1===a.table&&!a.pivot&&(a.wholeTable&&(i.wholeTable=a.wholeTable),a.headerRow&&(i.headerRow=a.headerRow),delete l[r]);let c=e.evaluate(`slicerStyleElements`,n)?.childNodes,d=c?.length??0;for(let t=0;t<d;t++){let n=c.item(t);if(n.nodeType!==1||n.localName!==`slicerStyleElement`)continue;let r=n.getAttribute(`type`);if(!r||!ke.has(r))continue;let a=n.getAttribute(`dxfId`),s=a==null?void 0:o[parseInt(a)];s?i[r]=s:e.warn(`A slicer style names a format that does not exist (dxfId '${a}').`,{onceKey:`xlsx.style.slicerStyle.dxf`})}(s.styles??={})[r]=i}l&&Object.keys(l).length===0&&(delete n.tables.styles,Object.keys(n.tables).length===0&&delete n.tables),Object.keys(s).length>0&&(n.slicers=s)}processTableStyle(e,t,n,r,i=!1){let a=t.getAttribute(`name`),o={name:a};t.hasAttribute(`table`)&&(o.table=A(t.getAttribute(`table`))),o.pivot=!t.hasAttribute(`pivot`)||A(t.getAttribute(`pivot`)),i&&!o.pivot&&r.unshift(null);let s=t.childNodes,c=s.length;for(let t=0;t<c;t++){let n=s.item(t);if(n.nodeType===1&&n.localName===`tableStyleElement`){let t=n.getAttribute(`type`),i=n.getAttribute(`dxfId`),a=i==null?void 0:r?.[i];a||=(e.warn(`A table style names a format that does not exist (dxfId '${i}').`,{onceKey:`xlsx.style.tableStyle.dxf`}),{}),o[t]=a;let s=null;n.hasAttribute(`size`)&&(s=parseInt(n.getAttribute(`size`))),s&&!isNaN(s)&&(a.size=s)}}delete o.name,n[a]=o}processTableStyles(e,t,n,r,i){if(!t)return;let a={},o=t.getAttribute(`defaultTableStyle`);o&&(a.defaultTableStyle=o);let s=t.getAttribute(`defaultPivotStyle`);s&&(a.defaultPivotStyle=s);let c=t.childNodes,l={},u=c.length;for(let t=0;t<u;t++){let n=c.item(t);n.nodeType===1&&n.localName===`tableStyle`&&this.processTableStyle(e,n,l,r,i)}return Object.keys(l).length>0&&(a.styles=l),Object.keys(a).length>0&&(n.tables=a),n}processCellStyles(e,t,n,r,i){if(!t)return;let a=t.childNodes,o=a.length;for(let e=0;e<o;e++){let t=a.item(e);if(t.nodeType===1&&t.localName===`cellStyle`){let e=parseInt(t.getAttribute(`xfId`)??``),a=t.getAttribute(`name`),o=t.getAttribute(`builtinId`),c=a;if(o!==null){let e=s.builtInNameFromId(parseInt(o));e!==void 0&&(c=e)}if(i.set(e,c),!r[e])continue;let l={name:c,style:r[e]};t.getAttribute(`hidden`)&&(l.hidden=A(t.getAttribute(`hidden`))),t.getAttribute(`iLevel`)&&(l.iLevel=parseInt(t.getAttribute(`iLevel`))),o!==null&&A(t.getAttribute(`customBuiltin`)??`0`)&&(l.customized=!0),n.push(l)}}}afterVisit(e,t,n){}},WorkbookVisitor:class extends G{visit(e,t,n){return this.processSheetRefs(e,e.evaluate(`sheets`,t),n),this.processExternalReferences(e,e.evaluate(`externalReferences`,t),n),this.processBookViews(e,e.evaluate(`bookViews`,t),n),this.processDefinedNames(e,e.evaluate(`definedNames`,t),n),this.processCalcPr(e,e.evaluate(`calcPr`,t),n),this.processPivotCaches(e,e.evaluate(`pivotCaches`,t),n),this.processWorkbookProtection(e,e.evaluate(`workbookProtection`,t),n),this.processWorkbookPr(e,e.evaluate(`workbookPr`,t),n),n}processPassword(e,t,n,r=`workbook`,i=`password`){if(!t)return;let a={};e.copyFromAttribute(t,`${r}AlgorithmName`,a,`algorithm`),e.copyFromAttribute(t,`${r}HashValue`,a,`hash`),e.copyFromAttribute(t,`${r}SaltValue`,a,`salt`),e.copyFromAttribute(t,`${r}SpinCount`,a,`spinCount`,e.INT_COPY),e.copyFromAttribute(t,`${r}Password`,a,`legacyHash`),Object.keys(a).length>0&&(n[i]=a)}processWorkbookProtection(e,t,n){if(!t)return;let r={};this.processPassword(e,t,r,`workbook`,`password`),this.processPassword(e,t,r,`revisions`,`revisionsPassword`);for(let e of ue)r[e.key]=_e(e,t.getAttribute(e.attribute));return n.protection=r,n}processCalcPr(e,t,n){if(!t)return;let r={};e.copyFromAttribute(t,`calcMode`,r,`calcMode`,e=>Ae[e]??null),e.copyFromAttribute(t,`fullCalcOnLoad`,r,`fullCalcOnLoad`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`calcOnSave`,r,`calcOnSave`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`calcCompleted`,r,`calcCompleted`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`fullPrecision`,r,`fullPrecision`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`forceFullCalc`,r,`forceFullCalc`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`concurrentCalc`,r,`concurrentCalc`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`concurrentManualCount`,r,`concurrentManualCount`,e.INT_COPY),e.copyFromAttribute(t,`refMode`,r,`refMode`),e.copyFromAttribute(t,`iterate`,r,`iterate`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`iterateCount`,r,`maxIteration`,e.INT_COPY),e.copyFromAttribute(t,`iterateDelta`,r,`maxIterateChange`,e.FLOAT_COPY);let i=t.getAttribute(`calcId`);i!==null&&e.getVisitorParamsState().set(`calcId`,i),n.calc=r}processSheetRefs(e,t,n){if(!t)return;let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);n.nodeType===1&&n.localName===`sheet`&&this.processSheetRef(e,n,r)}n.sheets=r}processSheetRef(e,t,n){let r={};e.copyFromAttribute(t,`name`,r,`name`),e.copyFromAttribute(t,`state`,r,`visibility`),e.copyFromAttribute(t,`sheetId`,r,`sheetId`,e.INT_COPY);let i=t.getAttribute(`r:id`),a=i?ne(e.getRelationships().get(i)?.type):null;if(a){let t=e.readEmbeddedPart(i);if(t?.xml){let e={part:t},i=fe(t.xml),o=i?v(e=>i.get(e)):void 0;o&&(e.tabColor=o),r.kind=a,r.sheet=e,n.push(r);return}e.warn(`The ${a} sheet '${r.name}' could not be read and was loaded as an empty worksheet.`),n.push(r);return}let o=i?e.getRef(i):null;o&&(r.sheet=o),n.push(r)}processExternalReferences(e,t,n){if(!t)return;let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);if(n.nodeType===1&&n.localName===`externalReference`){let t=n.getAttribute(`r:id`),i=t?e.getRef(t):null;r.push(i??null)}}r.length>0&&(n.externalBooks=r)}processPivotCaches(e,t,n){if(!t)return;let r=[],i=e.evaluate(`workbookPr`,t.parentNode)?.getAttribute?.(`date1904`),a=i===`1`||i===`true`,o=pe(e.getVisitorParamsState().get(`numFmts`),void 0),s=t.childNodes,c=s.length;for(let t=0;t<c;t++){let n=s.item(t);if(n.nodeType!==1||n.localName!==`pivotCache`)continue;let i=parseInt(n.getAttribute(`cacheId`)??``,10),c=n.getAttribute(`r:id`);if(isNaN(i)||!c)continue;let l=e.readEmbeddedPart(c);if(!l)continue;let u=be(l,a,e=>o.numberFormat(e)),d=!u&&l.xml?ce(l.xml,o):void 0,f=!u&&l.xml?ye(l.xml):void 0;r.push({cacheId:i,part:l,...d?{partFormats:d}:{},...f?{source:f}:{},...u})}r.length>0&&(n.pivotCaches=r)}processBookViews(e,t,n){if(!t)return;let r=t.childNodes,i=0,a=r.length;for(let t=0;i<1&&t<a;t++){let a=r.item(t);a.nodeType===1&&a.localName===`workbookView`&&(this.processWorkbookView(e,a,n),i++)}}processWorkbookView(e,t,n){if(!t)return;let r={},i=[`xWindow`,`yWindow`,`windowWidth`,`windowHeight`].map(e=>parseInt(t.getAttribute(e)??``,10));if(i.some(e=>Number.isFinite(e))){let[e,t,n,a]=i.map(e=>Number.isFinite(e)?e:0);r.windowBounds={left:e,top:t,width:n,height:a}}e.copyFromAttribute(t,`activeTab`,r,`activeSheetId`,[e.INT_COPY,e=>e]),t.hasAttribute(`activeTab`)||(r.activeSheetId=0),e.copyFromAttribute(t,`showHorizontalScroll`,r,`showHorizontalScrollbar`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`showVerticalScroll`,r,`showVerticalScrollbar`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`showSheetTabs`,r,`showTabs`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`tabRatio`,r,`tabRatio`,[e.FLOAT_COPY,e=>e]),e.copyFromAttribute(t,`firstSheet`,r,`firstTab`,[e.INT_COPY,e=>e]),e.copyFromAttribute(t,`minimized`,r,`minimized`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`autoFilterDateGrouping`,r,`autoFilterDateGrouping`,e.BOOLEAN_COPY);let a=t.getAttribute(`visibility`);a!==`hidden`&&a!==`veryHidden`||(r.visibility=a),Object.keys(r).length>0&&(n.view=r)}processDefineName(e,t,n,r){if(!t)return;let i={},a=t.firstChild;if(a&&a.nodeType===3&&(i.ref=a.textContent),e.copyFromAttribute(t,`name`,i),e.copyFromAttribute(t,`comment`,i),e.copyFromAttribute(t,`hidden`,i,`hidden`,e.BOOLEAN_COPY),t.hasAttribute(`localSheetId`)){let n=t.getAttribute(`localSheetId`);if(!r[n]?.name)return void e.warn(`Defined name '${t.getAttribute(`name`)}' references a sheet with localSheetId '${n}' which does not exist.`);i.scope=r[n].name}let o={};for(let n of ve)e.copyFromAttribute(t,n,o);for(let e of R){let n=t.getAttribute(e);n!==`1`&&n!==`true`||(o[e]=!0)}e.copyFromAttribute(t,`functionGroupId`,o,`functionGroupId`,e.INT_COPY),Object.keys(o).length>0&&(i.fileAttributes=o),Object.keys(i).length>0&&n.push(i)}processDefinedNames(e,t,n){if(!t)return;let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let a=i.item(t);a.nodeType===1&&a.localName===`definedName`&&this.processDefineName(e,a,r,n.sheets)}r.length>0&&(n.names=r)}processWorkbookPr(e,t,n){if(!t)return;e.copyFromAttribute(t,`date1904`,n,`date1904`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`codeName`,n,`codeName`),e.copyFromAttribute(t,`updateLinks`,n,`updateLinks`);let r=t.getAttribute(`hidePivotFieldList`);r!==`1`&&r!==`true`||(n.hiddenPivotFieldList=!0)}afterVisit(e,t,n){}},TableVisitor:class{visit(e,t,n){let r={};return e.copyFromAttribute(t,`ref`,n,`r`),e.getVisitorParamsState().set(`ref`,n.r),n.v=r,e.copyFromAttribute(t,`name`,r),e.copyFromAttribute(t,`displayName`,r,`name`),e.copyFromAttribute(t,`headerRowCount`,r,`headerRowCount`,e.INT_COPY),e.copyFromAttribute(t,`totalsRowCount`,r,`totalsRowCount`,e.INT_COPY),this.processTableColumns(e,t,r),this.processTableStyleInfo(e,t,r),e.copyFromAttribute(t,`id`,r),e.copyFromAttribute(t,`comment`,r,`description`),e.copyFromAttribute(t,`connectionId`,r,`connectionId`,e.INT_COPY),e.copyFromAttribute(t,`tableType`,r),e.copyFromAttribute(t,`published`,r,`published`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`insertRow`,r,`insertRow`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`insertRowShift`,r,`insertRowShift`,e.BOOLEAN_COPY),r.totalsRowShown=t.getAttribute(`totalsRowShown`)!==`0`,r}afterVisit(e,t,n){let r=n.v;if(e.evaluate(`autoFilter`,t)){if(Array.isArray(r.hiddenButtons)){let e=r.hiddenButtons.length;e===0?r.hiddenButtons=!1:e===r.columns?.length&&(r.hiddenButtons=!0)}}else r.hiddenButtons=!0,r.showButtons=!1;return r}processTableStyleInfo(e,t,n){if(!t)return;let r=t.childNodes,i={},a=r.length;for(let t=0;t<a;t++){let n=r.item(t);n.nodeType===1&&n.localName===`tableStyleInfo`&&(e.copyFromAttribute(n,`name`,i),e.copyFromAttribute(n,`showColumnStripes`,i,`showColumnStripes`,e.BOOLEAN_COPY),e.copyFromAttribute(n,`showFirstColumn`,i,`showFirstColumn`,e.BOOLEAN_COPY),e.copyFromAttribute(n,`showLastColumn`,i,`showLastColumn`,e.BOOLEAN_COPY),e.copyFromAttribute(n,`showRowStripes`,i,`showRowStripes`,e.BOOLEAN_COPY))}Object.keys(i).length>0&&(n.style=i)}processTableColumn(e,t,n){if(!t)return null;let r=t.childNodes,i=r.length;for(let t=0;t<i;t++){let i=r.item(t);if(i.nodeType===1&&i.localName===`tableColumn`){let t={};e.copyFromAttribute(i,`name`,t),e.copyFromAttribute(i,`id`,t),e.copyFromAttribute(i,`uniqueName`,t),e.copyFromAttribute(i,`queryTableFieldId`,t),e.copyFromAttribute(i,`totalsRowLabel`,t);let r=i.getAttribute(`totalsRowFunction`);if(r!==null){if(r===`custom`){let n=e.evaluate(`totalsRowFormula`,i);n&&(t.totalsRowFormula=n.textContent)}else t.totalsRowFormula=r}e.copyFromAttribute(i,`totalsRowLabel`,t);let a=e.evaluate(`calculatedColumnFormula`,i);a?.textContent&&(t.calculatedColumnFormula=a.textContent),n.push(t)}}return n}processTableColumns(e,t,n){let r=t.childNodes,i=[],a=r.length;for(let t=0;t<a;t++){let n=r.item(t);n.nodeType===1&&n.localName===`tableColumns`&&this.processTableColumn(e,n,i)}i.length>0&&(n.columns=i)}},TableX14Visitor:class{visit(e,t,n){let r=e.getVisitorParamsState().get(`ref`);if(r){let n=e.getVisitorParamsState().get(`descriptions`);n&&(n.add(r,t.getAttribute(`altText`)),n.add(r,t.getAttribute(`altTextSummary`)))}return e.copyFromAttribute(t,`altText`,n),e.copyFromAttribute(t,`altTextSummary`,n),n}},ExternalLinkVisitor:class{visit(e,t,n){let r=t.childNodes,i=r.length,a=null;for(let e=0;e<i;e++){let t=r.item(e);if(t.nodeType===1){t.localName===`externalBook`&&(a=t);break}}if(!a)return n;t.getAttribute(`mc:Ignorable`)&&(n.mceIgnorable=!0);let o=a.getAttribute(`r:id`);o&&(n.__bookRelId=o);let s=this._findAbsoluteUrlRelId(a);return s&&(n.__absoluteUrlRelId=s),n.sheetNames=[],this.processSheetNames(e,a,n),this.processDefinedNames(e,a,n),this.processSheetDataSet(e,a,n),n}processSheetNames(e,t,n){let r=this._findChild(t,`sheetNames`);if(!r)return;let i=r.childNodes,a=i.length;for(let e=0;e<a;e++){let t=i.item(e);t.nodeType===1&&t.localName===`sheetName`&&n.sheetNames.push(t.getAttribute(`val`)??``)}}processDefinedNames(e,t,n){let r=this._findChild(t,`definedNames`);if(!r)return;let i=[],a=r.childNodes,o=a.length;for(let e=0;e<o;e++){let t=a.item(e);if(t.nodeType!==1||t.localName!==`definedName`)continue;let n=t.getAttribute(`name`);if(!n)continue;let r={name:n,refersTo:t.getAttribute(`refersTo`)??``},o=t.getAttribute(`sheetId`);o!==null&&(r.sheetIndex=parseInt(o,10)),i.push(r)}i.length>0&&(n.definedNames=i)}processSheetDataSet(e,t,n){let r=this._findChild(t,`sheetDataSet`);if(!r)return;let i=[],a=r.childNodes,o=a.length;for(let t=0;t<o;t++){let n=a.item(t);if(n.nodeType!==1||n.localName!==`sheetData`)continue;let r=n.getAttribute(`sheetId`);if(r===null)continue;let o=this.processSheetData(e,n);o.sheetIndex=parseInt(r,10),n.getAttribute(`refreshError`)===`1`&&(o.refreshError=!0),i.push(o)}i.length>0&&(n.sheetDataSet=i)}processSheetData(e,t){let n=new u.Builder,r=t.childNodes,i=r.length;for(let e=0;e<i;e++){let t=r.item(e);if(t.nodeType!==1||t.localName!==`row`)continue;let i=t.childNodes,a=i.length;for(let e=0;e<a;e++){let t=i.item(e);if(t.nodeType!==1||t.localName!==`cell`)continue;let r=t.getAttribute(`r`);if(!r)continue;let a=f.fastStringToCell(r);if(a?.rowIndex===void 0||a?.colIndex===void 0)continue;let o=this._readCellValue(t);o!==void 0&&n.pushAt(a.rowIndex,a.colIndex,o)}}return{sheetIndex:-1,data:n.build()?.tuples??[]}}_readCellValue(e){let t=this._findChild(e,`v`)?.textContent?.trim();if(t!==void 0&&t!==``)switch(e.getAttribute(`t`)){case null:case`n`:return parseFloat(t);case`b`:return t===`1`||t===`true`;case`str`:default:return t;case`e`:{let e=l.getBuiltInByLabel(t);return e?{t:`e`,v:e.getCode()}:t}}}_findChild(e,t){let n=e.childNodes,r=n.length;for(let e=0;e<r;e++){let r=n.item(e);if(r.nodeType===1&&r.localName===t)return r}return null}_findAbsoluteUrlRelId(e){let t=this._findChild(e,`alternateUrls`);return t?this._findChild(t,`absoluteUrl`)?.getAttribute(`r:id`)??null:null}},SlicerCacheDefinitionVisitor:class{visit(e,t,n){e.copyFromAttribute(t,`name`,n,`cacheName`),e.copyFromAttribute(t,`sourceName`,n);let r=e.evaluate(`*/tableSlicerCache`,t);return r?(e.copyFromAttribute(r,`tableId`,n),e.copyFromAttribute(r,`column`,n,`columnId`),e.copyFromAttribute(r,`sortOrder`,n),e.copyFromAttribute(r,`customListSort`,n,`customListSort`,e.BOOLEAN_COPY),e.copyFromAttribute(r,`crossFilter`,n),n):(this.processPivot(e,t,n),n)}processPivot(e,t,n){let r=[],i=``,a=t.childNodes;for(let t=0;t<a.length;t++){let o=a.item(t);if(o.nodeType!==1)continue;if(o.localName===`pivotTables`){let e=o.childNodes;for(let t=0;t<e.length;t++){let n=e.item(t);n.nodeType===1&&n.localName===`pivotTable`&&r.push({tabId:n.getAttribute(`tabId`)??``,name:n.getAttribute(`name`)??``})}continue}let s=o.getAttribute(`pivotCacheId`);if(s&&(n.pivotCacheId=s),o.localName===`state`||o.localName===`timelinePivotFilter`){n.tabular=!0,n.pivotData=(n.pivotData??``)+(e.serializeElement(o)??``);continue}if(o.localName===`data`){let t=null,r=o.childNodes;for(let e=0;e<r.length;e++){let i=r.item(e);if(i.nodeType!==1)continue;let a=i.getAttribute(`pivotCacheId`);a&&(n.pivotCacheId=a),i.localName===`tabular`&&(t=i)}if(t){n.tabular=!0,e.copyFromAttribute(t,`sortOrder`,n),e.copyFromAttribute(t,`customListSort`,n,`customListSort`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`crossFilter`,n),e.copyFromAttribute(t,`showMissing`,n,`showMissing`,e.BOOLEAN_COPY),n.pivotData=e.serializeElement(o)??void 0;continue}}let c=e.serializeElement(o);if(c===null)return;i+=c}n.pivotTables=r,n.pivotBody=i}},SlicersVisitor:class{visit(e,t,n){let r=n.slicers;r||(r={},n.slicers=r);let i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);n.nodeType===1&&n.localName===`slicer`&&this.processSlicer(e,n,r)}return r}processSlicer(e,t,n){if(!t)return;let r={};n[t.getAttribute(`name`)]=r,e.copyFromAttribute(t,`xr10:uid`,r,`uid`);let i=t.getAttribute(`cache`),a=e.getVisitorParamsState().get(`slicerCaches`),o=i?a?.get(i):void 0;if(o)for(let e=0;e<J.length;e++){let t=J[e];o[t]!==void 0&&(r[t]=o[t])}e.copyFromAttribute(t,`caption`,r),e.copyFromAttribute(t,`startItem`,r,`startItem`,e.INT_COPY),e.copyFromAttribute(t,`columnCount`,r,`columnCount`,e.INT_COPY),e.copyFromAttribute(t,`showCaption`,r,`showCaption`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`level`,r,`level`,e.INT_COPY),e.copyFromAttribute(t,`style`,r),e.copyFromAttribute(t,`lockedPosition`,r,`lockedPosition`,e.BOOLEAN_COPY),e.copyFromAttribute(t,`rowHeight`,r,`rowHeight`,e.INT_COPY)}},TimelinesVisitor:class{visit(e,t,n){let r=n.slicers;r||(r={},n.slicers=r);let i=t.childNodes;for(let t=0;t<i.length;t++){let n=i.item(t);n.nodeType===1&&n.localName===`timeline`&&this.processTimeline(e,n,r)}return r}processTimeline(e,t,n){let r={};n[t.getAttribute(`name`)]=r,e.copyFromAttribute(t,`xr10:uid`,r,`uid`);let i=t.getAttribute(`cache`),a=e.getVisitorParamsState().get(`slicerCaches`),o=i?a?.get(i):void 0;if(o)for(let e=0;e<J.length;e++){let t=J[e];o[t]!==void 0&&(r[t]=o[t])}e.copyFromAttribute(t,`caption`,r);let s={};for(let e=0;e<t.attributes.length;e++){let n=t.attributes.item(e);je.has(n.name)||n.name.startsWith(`xmlns`)||(s[n.name]=n.value)}r.timelineAttributes=s;let c=``,l=t.childNodes;for(let t=0;t<l.length;t++){let n=l.item(t);n.nodeType===1&&(c+=e.serializeElement(n)??``)}r.timelineBody=c}},FormControlPrVisitor:class{visit(e,t,n){let r={},i=t.attributes;for(let e=0;e<i.length;e++){let t=i.item(e),n=t.name;n===`xmlns`||n.startsWith(`xmlns:`)||(r[n]=t.value)}let a=[],o,s=t.childNodes;for(let t=0;t<s.length;t++){let n=s.item(t);if(n.nodeType===1){if(n.localName===`itemLst`){let e=n.childNodes;for(let t=0;t<e.length;t++){let n=e.item(t);n.nodeType===1&&n.localName===`item`&&a.push(n.getAttribute(`val`)??``)}}else n.localName===`extLst`&&(o=e.serializeElement(n)??void 0)}}let c=me(r,a,o);return n.formControl=c,c}},DrawingVisitor:class{visit(e,t,n){return n}afterVisit(e,t,n){for(let e of n?.movables??[])Y(e,!1)}},DrawingAnchorVisitor:class{visit(e,t,n){if(!t)return;let r={};e.copyFromAttribute(t,`editAs`,r,`anchorType`),r.anchor={},t.localName===`absoluteAnchor`?(r.anchorType=`absolute`,this.processAbsoluteCoord(e,e.evaluate(`pos`,t),r.anchor,`from`,`x`,`y`),this.processAbsoluteCoord(e,e.evaluate(`ext`,t),r.anchor,`to`,`cx`,`cy`)):t.localName===`oneCellAnchor`?(this.processOffsetCoord(e,e.evaluate(`from`,t),r.anchor,`from`),this.processAbsoluteCoord(e,e.evaluate(`ext`,t),r.anchor,`to`,`cx`,`cy`)):(this.processOffsetCoord(e,e.evaluate(`from`,t),r.anchor,`from`),this.processOffsetCoord(e,e.evaluate(`to`,t),r.anchor,`to`));let i=e.evaluate(`clientData`,t),a=e=>{let t=i?.getAttribute(e);return t===`0`||t===`false`};return a(`fPrintsWithSheet`)&&(r.noPrint=!0),a(`fLocksWithSheet`)&&(r.unlocked=!0),n.movables||=[],n.movables.push(r),r}processAbsoluteCoord(e,t,n,r,i,a){if(!t)return;let o={x:0,y:0};return o.x=h(t.getAttribute(i)),o.y=h(t.getAttribute(a)),r===`from`?n.tl=o:n.br=o,n}processOffsetCoord(e,t,n,r){if(!t)return;let i={c:0,r:0,x:0,y:0};return e.evaluate(`col`,t)&&(i.c=parseInt(e.evaluate(`col`,t).textContent)),e.evaluate(`row`,t)&&(i.r=parseInt(e.evaluate(`row`,t).textContent)),e.evaluate(`colOff`,t)&&(i.x=h(e.evaluate(`colOff`,t).textContent)),e.evaluate(`rowOff`,t)&&(i.y=h(e.evaluate(`rowOff`,t).textContent)),r===`from`?n.tl=i:n.br=i,n}},DrawingGraphicFrameVisitor:class extends H{visit(e,t,n){if(!t)return;if(this.isGroupContent(n)){if(e.getPath().includes(`Fallback`))return{};let{movable:r}=this.readMemberHeader(e,t,`graphicFrame`),i=e.evaluate(`xfrm`,t);if(i){_(i,r);let t=e.evaluate(`off`,i),n=e.evaluate(`ext`,i);r.anchor={tl:{x:h(t?.getAttribute(`x`)??null)??0,y:h(t?.getAttribute(`y`)??null)??0},br:{x:h(n?.getAttribute(`cx`)??null)??0,y:h(n?.getAttribute(`cy`)??null)??0}}}let a=this.readGraphic(e,t),o=a.type===`chart`?{...r.content.json,...a.json}:a.json;return r.content={...r.content,type:a.type,json:o},n.members.push(r),a.json}n=super.visit(e,t,n);let r=e.evaluate(`nvGraphicFramePr/cNvGraphicFramePr`,t);if(r){let t=e.evaluate(`graphicFrameLocks`,r);t&&t.hasAttribute(`noChangeAspect`)&&(n.lockAspect=t.getAttribute(`noChangeAspect`)===`1`)}let i=this.readGraphic(e,t);return this.setContent(n,i),i}readGraphic(e,t){let n=e.evaluate(`graphic/graphicData`,t),r={type:`graphicFrame`,json:{}};if(!n)return r;let i=n.childNodes,a=i.length;for(let n=0;n<a;n++){let a=i.item(n);if(a.nodeType===1)try{let n=a.localName;n===`chart`?n=`chart`:n!==`slicer`&&n!==`timeslicer`||(n=`slicer`),r.type=n;let i=a.getAttribute(`r:id`);if(n===`chart`&&i){let n=this.readSourceId(e,t),a=e.readEmbeddedPart(i)??void 0,o;try{let t=a?.xml?xe(a.xml):null;o=t?.model,t?.lossy&&e.warn(`A chart states something its model does not; it is saved as it was until it is changed.`,{onceKey:`xlsx.chart.lossy`})}catch(t){e.warn(`A chart could not be read into the chart model; it is kept as its markup: ${t?.message??t}`,{onceKey:`xlsx.chart.model`})}r.json={sourceId:n,part:a,model:o}}else if(n===`slicer`){let n=this.readSourceId(e,t);n!==void 0&&(r.json={sourceId:n})}else i&&(r.json=e.getRef(i))}catch(t){e.warn(`Unable to read a graphic frame: ${t?.message??t}`,{onceKey:`xlsx.drawing.graphicFrame`})}}return r}},DrawingSpVisitor:X,DrawingPicVisitor:class extends H{visit(e,t,n){if(!t)return;if(this.isGroupContent(n)){if(e.getPath().includes(`Fallback`))return{};let{movable:r,content:i}=this.readMemberHeader(e,t,`picture`),a=this.readImage(e,t);return a?(this.readPictureDetails(e,t,a,r,i),n.members.push(r),i):{}}let r=super.visit(e,t,n),i=this.readImage(e,t);if(i===null)return;let a={},o=this.readSourceId(e,t);return o!==void 0&&(a.sourceId=o),this.readPictureDetails(e,t,i,r,a),this.setContent(r,{type:`picture`,json:a}),a}readPictureDetails(e,t,n,r,i){n?.resId!==void 0&&(i.resId=n.resId),n?.image&&(i.image=n.image);let a=t.getAttribute(`macro`);a&&(i.macro=a),t.hasAttribute(`fPublished`)&&(i.published=A(t.getAttribute(`fPublished`)));let o=e.evaluate(`nvPicPr/cNvPicPr`,t);if(o?.getAttribute){o.getAttribute(`preferRelativeResize`)===`0`&&(i.noRelativeResize=!0);let t=this.readLocks(e.evaluate(`picLocks`,o));t&&(i.locks=t),r.lockAspect=t?.noChangeAspect??!1}}readImage(e,t){let n=e.evaluate(`blipFill`,t),r=n?e.evaluate(`blip`,n):null;if(!r)return;if(!(r.getAttribute(`r:embed`)??r.getAttribute(`embed`)??r.getAttribute(`r:link`)??r.getAttribute(`link`)))return e.warn(`A picture names no image; it was not imported.`,{onceKey:`xlsx.drawing.picture.noRel`}),null;let{type:i,resId:a,...o}=new j().processImageFill(e,n);return!o.tile&&o.stretch&&Object.keys(o.stretch).length===0&&delete o.stretch,o.extLst&&Me.test(o.extLst)&&delete o.extLst,{resId:a,image:Object.keys(o).length>0?o:void 0}}},DrawingGrpSpVisitor:class extends H{constructor(...e){super(...e),this._fills=new j}visit(e,t,n){if(!t)return;let r=this.isGroupContent(n),i,a;if(r){if(e.getPath().includes(`Fallback`))return{};let r=this.readMemberHeader(e,t,`group`);i=r.movable,a=r.content,n.members.push(i)}else{if(e.getPath().includes(`Fallback`)&&n.content)return{};i=super.visit(e,t,n),a={};let r=this.readSourceId(e,t);r!==void 0&&(a.sourceId=r),this.setContent(i,{type:`group`,json:a})}a.members=[];let o=e.evaluate(`nvGrpSpPr/cNvGrpSpPr/grpSpLocks`,t);o?.hasAttribute?.(`noChangeAspect`)&&(i.lockAspect=o.getAttribute(`noChangeAspect`)===`1`);let s=this.readLocks(o);s&&(a.locks=s);let c=e.evaluate(`grpSpPr`,t);if(c){let t=e.evaluate(`xfrm`,c);if(t){_(t,i),t.getAttribute(`flipH`)===`1`&&(i.flipH=!0),t.getAttribute(`flipV`)===`1`&&(i.flipV=!0);let n=Z(e,t,`off`,`ext`),o=Z(e,t,`chOff`,`chExt`)??n;o&&(a.childBounds=o),r&&n&&(i.anchor={tl:{x:n.x,y:n.y},br:{x:n.width,y:n.height}})}let n=this._fills.getFill(e,c);n&&Object.keys(n).length>0&&(a.fill=n);let o=this._fills.getEffects(e,c);o&&(a.effects=o);let s=e.evaluate(`scene3d`,c),l=s?e.serializeElement(s):null;l&&(a.scene3d=l);let u=e.evaluate(`extLst`,c),d=u?e.serializeElement(u):null;d&&(a.extLst={...a.extLst,properties:d})}return a}},DrawingCxnSpVisitor:class extends X{visit(e,t,n){if(t)return this.visitShape(e,t,n,`cxnSp`,`nvCxnSpPr/cNvCxnSpPr/cxnSpLocks`)}},MetadataVisitor:class{visit(e,t,n){let r=[],i=new Map,a={cells:[],values:[]},o=t.childNodes;for(let e=0;e<o.length;e++){let t=o.item(e);if(t.nodeType===1)switch(t.localName){case`metadataTypes`:this._parseMetadataTypes(t,r,i);break;case`futureMetadata`:this._attachFutureMetadata(t,i);break;case`cellMetadata`:this._resolveBlocks(t,r,a.cells);break;case`valueMetadata`:this._resolveBlocks(t,r,a.values)}}return n.metadata=a,a}_parseMetadataTypes(e,t,n){let r=e.childNodes;for(let e=0;e<r.length;e++){let i=r.item(e);if(i.nodeType===1&&i.localName===`metadataType`){let e=this._parseMetadataType(i);t.push(e),n.set(e.name,e)}}}_parseMetadataType(e){let t={name:e.getAttribute(`name`)??``,_blocks:[]},n=e.getAttribute(`minSupportedVersion`);n!=null&&(t.minSupportedVersion=Number(n));for(let n of[`copy`,`pasteAll`,`pasteValues`,`merge`,`splitFirst`,`splitAll`,`rowColShift`,`clearFormats`,`clearComments`,`assign`,`coerce`,`cellMeta`,`adjust`,`trans`,`delete`,`edit`])e.getAttribute(n)===`1`&&(t[n]=!0);return t}_attachFutureMetadata(e,t){let n=e.getAttribute(`name`)??``,r=t.get(n);if(!r)return;let i=e.childNodes;for(let e=0;e<i.length;e++){let t=i.item(e);t.nodeType===1&&t.localName===`bk`&&r._blocks.push(this._parseFutureBlock(t))}}_parseFutureBlock(e){let t={},n=e.childNodes;for(let e=0;e<n.length;e++){let r=n.item(e);if(r.nodeType!==1||r.localName!==`extLst`)continue;let i=r.childNodes;for(let e=0;e<i.length;e++){let n=i.item(e);if(n.nodeType!==1||n.localName!==`ext`)continue;let r=n.childNodes;for(let e=0;e<r.length;e++){let n=r.item(e);n.nodeType===1&&(n.localName===`dynamicArrayProperties`?(t.fDynamic=n.getAttribute(`fDynamic`)===`1`,t.fCollapsed=n.getAttribute(`fCollapsed`)===`1`):n.localName===`rvb`&&(t.richValueIndex=Number(n.getAttribute(`i`)??`0`)))}}}return t}_resolveBlocks(e,t,n){let r=e.childNodes;for(let e=0;e<r.length;e++){let i=r.item(e);i.nodeType===1&&i.localName===`bk`&&n.push(this._resolveBlock(i,t))}}_resolveBlock(e,t){let n=new Map,r=e.childNodes;for(let e=0;e<r.length;e++){let i=r.item(e);if(i.nodeType!==1||i.localName!==`rc`)continue;let a=Number(i.getAttribute(`t`)),o=Number(i.getAttribute(`v`)),s=t[a-1];if(!s)continue;let{_blocks:c,...l}=s,u={...l};for(let e of Object.keys(u))u[e]===void 0&&delete u[e];let d=c[o];d&&(d.fDynamic!==void 0&&(u.fDynamic=d.fDynamic,u.fCollapsed=d.fCollapsed??!1),d.richValueIndex!==void 0&&(u.richValueIndex=d.richValueIndex)),n.set(s.name,u)}return n}},FeaturePropertyBagVisitor:class{visit(e,t,n){let r=[],i=t.childNodes;for(let e=0;e<i.length;e++){let t=i.item(e);t.nodeType===1&&t.localName===`bag`&&r.push(this._readBag(t))}let a=[],o=r.find(e=>e.type===`XFComplements`)?.arrays.get(`MappedFeaturePropertyBags`)??[];for(let t=0;t<o.length;t++){let n=r[o[t]]?.ids.get(`XFControls`),i=n===void 0?void 0:r[n]?.ids.get(`CellControl`),s=i===void 0?void 0:r[i]?.type,c=s?Ne[s]:void 0;c||e.warn(`A cell format's feature '${s??`unknown`}' is not read; its cells keep their values.`),a.push(c?{type:c}:null)}let s={controls:a};return n.featurePropertyBag=s,s}_readBag(e){let t={type:e.getAttribute(`type`)??``,ids:new Map,arrays:new Map},n=e.childNodes;for(let e=0;e<n.length;e++){let r=n.item(e);if(r.nodeType!==1)continue;let i=r.getAttribute(`k`)??``;if(r.localName===`bagId`){let e=parseInt(r.textContent??``,10);isNaN(e)||t.ids.set(i,e)}else if(r.localName===`a`){let e=[],n=r.childNodes;for(let t=0;t<n.length;t++){let r=n.item(t);if(r.nodeType!==1||r.localName!==`bagId`)continue;let i=parseInt(r.textContent??``,10);isNaN(i)||e.push(i)}t.arrays.set(i,e)}}return t}},CommentsVisitor:class{visit(e,t,n){if(!t)return;let r=[];this.processAuthors(e,e.evaluate(`authors`,t),r),r.length>0&&(n.authors=r);let i=[];return n.comments=i,i}processAuthors(e,t,n){if(!t)return;let r=t.childNodes,i=r.length;for(let e=0;e<i;e++){let t=r.item(e);if(t.nodeType===1&&t.localName===`author`){let e=t.firstChild;e&&e.nodeType===3&&n.push(e.textContent)}}}},CommentVisitor:class{visit(e,t,n){if(!t)return;let r=t.getAttribute(`ref`);if(!r)return;let i={content:``};if(t.hasAttribute(`authorId`)){let e=parseInt(t.getAttribute(`authorId`),10);isNaN(e)||(i.authorId=e)}return i.content=function(e){if(!e)return``;let t=[],n=!0,r=e.childNodes;for(let e=0;e<r.length;e++){let i=r.item(e);if(i.nodeType===1){if(i.localName===`t`)t.push({text:i.textContent??``});else if(i.localName===`r`){let e={text:``},r=i.childNodes;for(let t=0;t<r.length;t++){let n=r.item(t);if(n.nodeType===1){if(n.localName===`t`)e.text+=n.textContent??``;else if(n.localName===`rPr`){let t=Fe(n);t&&(e.font=t)}}}e.font&&(n=!1),t.push(e)}}}return t.length===0?e.textContent??``:n?t.map(e=>e.text).join(``):{runs:t}}(e.evaluate(`text`,t)),n.push({r,v:i}),i}},ThreadedCommentsVisitor:class{visit(e,t,n){if(!t)return;let r=[];return n.comments=r,r}},ThreadedCommentVisitor:class{visit(e,t,n){if(!t)return;let r={};e.copyFromAttribute(t,`id`,r,`id`,T);let i=t.getAttribute(`ref`);e.copyFromAttribute(t,`personId`,r,`personId`,T),e.copyFromAttribute(t,`parentId`,r,`parentId`,T);let a=t.getAttribute(`dT`);a&&(r.dt=function(e){let t=/^(.*T\d{2}:\d{2}:\d{2})(?:\.(\d+))?(Z|[+-]\d{2}:?\d{2})?$/i.exec(e.trim());if(!t)return e;let[,n,r,i]=t;return`${n}${r?`.${(r+`00`).substring(0,3)}`:``}${i??`Z`}`}(a)),t.hasAttribute(`done`)&&(r.done=A(t.getAttribute(`done`)));let o=function(e){let t,n=e.childNodes;for(let e=0;e<n.length;e++){let r=n.item(e);if(r.nodeType!==1||r.localName!==`mentions`)continue;let i=r.childNodes;for(let e=0;e<i.length;e++){let n=i.item(e);if(n.nodeType!==1||n.localName!==`mention`)continue;let r=n.getAttribute(`mentionId`),a=n.getAttribute(`mentionpersonId`);if(!r||!a)continue;let o={id:T(r),personId:T(a)},s=parseInt(n.getAttribute(`startIndex`)??``,10);isNaN(s)||(o.startIndex=s);let c=parseInt(n.getAttribute(`length`)??``,10);isNaN(c)||(o.length=c),(t??=[]).push(o)}}return t}(t);return o&&(r.mentions=o),n.push({r:i,v:r}),r}},PersonListVisitor:class{visit(e,t,n){let r=[],i=t.childNodes,a=i.length;for(let t=0;t<a;t++){let n=i.item(t);if(n.nodeType===1&&n.localName===`person`){let t={};e.copyFromAttribute(n,`id`,t,`id`,T),e.copyFromAttribute(n,`displayName`,t),e.copyFromAttribute(n,`userId`,t,`userId`,T),e.copyFromAttribute(n,`providerId`,t),r.push(t)}}return r.length>0&&(n.persons=r),r}}},Ie=class{constructor(e,t){this.path=e,this.visitor=t}},Le=class{constructor(){this.visitorsByXmlTagName=new Map,this.scopedVisitorsByXmlTagName=new Map,this.visitorParamsState=null,this.registerVisitor(`Relationships`,new $.RelsVisitor),this.registerVisitor(`cp:coreProperties`,new $.CorePropertiesVisitor),this.registerVisitor(`Properties`,new $.AppPropertiesVisitor),this.registerVisitor(`spPr`,new $.ShapePropertiesVisitor),this.registerVisitor(`txBody`,new $.ShapeTextVisitor),this.registerVisitor(`txPr`,new $.TextPropertiesVisitor),this.registerVisitor(`a:theme`,new $.ThemeVisitor),this.registerVisitor(`a:theme`,new $.ClrSchemeVisitor,`themeElements/clrScheme`),this.registerVisitor(`a:theme`,new $.FontSchemeVisitor,`themeElements/fontScheme`),this.registerVisitor(`a:theme`,new $.FmtSchemeVisitor,`themeElements/fmtScheme`),this.registerVisitor(`a:theme`,new $.ObjectDefaultsVisitor,`objectDefaults`),this.registerVisitor(`autoFilter`,new $.AutoFilterVisitor),this.registerVisitor(`sortState`,new $.SortStateVisitor),this.registerVisitor(`s:workbook`,new $.WorkbookVisitor),this.registerVisitor(`styleSheet`,new $.SheetStyleVisitor),this.registerVisitor(`x14:table`,new $.TableX14Visitor),this.registerVisitor(`table`,new $.TableVisitor),this.registerVisitor(`externalLink`,new $.ExternalLinkVisitor),this.registerVisitor(`wsDr`,new $.DrawingVisitor),this.registerVisitor(`twoCellAnchor`,new $.DrawingAnchorVisitor),this.registerVisitor(`oneCellAnchor`,new $.DrawingAnchorVisitor),this.registerVisitor(`absoluteAnchor`,new $.DrawingAnchorVisitor),this.registerVisitor(`graphicFrame`,new $.DrawingGraphicFrameVisitor),this.registerVisitor(`sp`,new $.DrawingSpVisitor),this.registerVisitor(`grpSp`,new $.DrawingGrpSpVisitor),this.registerVisitor(`cxnSp`,new $.DrawingCxnSpVisitor),this.registerVisitor(`pic`,new $.DrawingPicVisitor),this.registerVisitor(`metadata`,new $.MetadataVisitor),this.registerVisitor(`FeaturePropertyBags`,new $.FeaturePropertyBagVisitor),this.registerVisitor(`comments`,new $.CommentsVisitor),this.registerVisitor(`comment`,new $.CommentVisitor),this.registerVisitor(`ThreadedComments`,new $.ThreadedCommentsVisitor),this.registerVisitor(`threadedComment`,new $.ThreadedCommentVisitor),this.registerVisitor(`threadedComment`,new $.TextPropertiesVisitor(`content`),`text`),this.registerVisitor(`personList`,new $.PersonListVisitor),this.registerVisitor(`slicerCacheDefinition`,new $.SlicerCacheDefinitionVisitor),this.registerVisitor(`slicers`,new $.SlicersVisitor),this.registerVisitor(`timelineCacheDefinition`,new $.SlicerCacheDefinitionVisitor),this.registerVisitor(`timelines`,new $.TimelinesVisitor),this.registerVisitor(`formControlPr`,new $.FormControlPrVisitor)}registerVisitor(e,t,n=null){e.indexOf(`:`)===-1&&(e=`*:`+e);let r=e.split(`:`),i=r.length>1?r[1]:r[0];if(!n)return this.visitorsByXmlTagName.set(i,t),void this.visitorsByXmlTagName.set(e,t);let a=this.scopedVisitorsByXmlTagName.get(i);a||(a=[],this.scopedVisitorsByXmlTagName.set(i,a),this.scopedVisitorsByXmlTagName.set(e,a)),a.push(new Ie(n,t))}parseDxf(t,n=``,r=e.EmptyObject){this.visitorParamsState||=new Map;let i=this.visitorParamsState,a=i.get(`processingDXFs`);i.set(`processingDXFs`,!0);try{let e=new z(null,this,`/dxf`,t,{},n,r),i={};return new $.SheetStyleVisitor().processDXF(e,t,i),i}finally{a===void 0?i.delete(`processingDXFs`):i.set(`processingDXFs`,a)}}getVisitorParamsState(){return this.visitorParamsState}transform(t,n,r=e.EmptyObject){let i=t.documentElement;this.visitorParamsState&&!r?.paramMap||(this.visitorParamsState=r?.paramMap??new Map);let a={},o=this.visitorsByXmlTagName.get(i.nodeName);if(o||=this.visitorsByXmlTagName.get(i.localName),!o)throw Error(`A visitor for the root element: '${i.nodeName}' or '${i.localName}' must be registered.`);let s=`/`+i.localName,c=new z(null,this,s,i,a,n,r),l=[];this._doWalk(o,c,l,i,a,n,r);let u=l.length;for(let e=0;e<u;e++){let t=l[e];try{t.visitor?.afterVisit?.(t.context,t.elemParent,t.jsonParent)}catch(e){t.context.warn(`Unable to finish reading '${t.context.getPath()}': ${e?.message??e}`,{onceKey:`xlsx.transform.afterVisit`})}}return a}_walkScoped(e,t,n,r,i,a,o){let s=this.scopedVisitorsByXmlTagName.get(e),c=s?s.length:0;for(let l=0;l<c;l++){let c=s[l],u=null;try{u=t.evaluate(c.path,r)}catch{t.warn(`Invalid path '${c.path}' for '${e}'.`,{onceKey:`xlsx.transform.invalidPath`})}if(!u)continue;let d=e=>{let s=e.localName,l=e.parentNode;for(;l&&l!==r;)s=l.localName+`/`+s,l=l.parentNode;let u=t.getPath()+`/`+s;if(c.visitor){let r=new z(t,this,u,t.getElemRoot(),t.getJsonRoot(),a,o);this._doWalk(c.visitor,r,n,e,i,a,o)}};if(u.length>0){let e=u,t=e.length;for(let n=0;n<t;n++)d(e.item(n))}else d(u)}}_doWalk(e,t,n,r,i,a,o){let s=null;e&&(n.push({visitor:e,context:t,elemParent:r,jsonParent:i}),s=e.visit(t,r,i)),s||=i;let c=r.localName;this._walkScoped(c,t,n,r,s,a,o);let l=this.visitorsByXmlTagName,u=t.getElemRoot(),d=t.getJsonRoot(),f=r.childNodes,p=f.length;for(let e=0;e<p;e++){let r=f.item(e);if(r.nodeType!==1)continue;let c=r,p=c.nodeName,m=l.get(p);m||=(p=c.localName,l.get(p));let h=t.getPath()+`/`+p,g=new z(t,this,h,u,d,a,o);this._doWalk(m,g,n,c,s??i,a,o)}return s}};export{Le as DOMTransformer,z as ExecutionContext,I as NumberUtils,ee as VisitorUtils};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./HclGiUj8dZXDFmoM.js";async function t(){try{return(await e(async()=>{let{default:e}=await import(`./
|
|
1
|
+
import{t as e}from"./HclGiUj8dZXDFmoM.js";async function t(){try{return(await e(async()=>{let{default:e}=await import(`./DzlbsQ0qqdQEl80f.js`);return{default:e}},[],import.meta.url)).default}catch{let e=`@0.8.0-beta.19`;return e!==`@local`&&e!==`@0.0.0`||(e=``),async function(e){let t=await fetch(e);if(!t.ok)throw Error(`Unable to load script enum runtime (${t.status}) from ${e}.`);return t.json()}(`https://cdn.jsdelivr.net/npm/@sheetxl/sdk${e}/types/scripting-enums.json`)}}export{t as loadEnumManifest};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./CbXtAM7H-Jg_J0dk.js";import{i as t,t as n}from"./-cpi3yOZYn6GsYN4.js";import{n as r}from"./CXGgKVbVXjWzE0p6.js";import{
|
|
1
|
+
import{n as e}from"./CbXtAM7H-Jg_J0dk.js";import{i as t,t as n}from"./-cpi3yOZYn6GsYN4.js";import{n as r}from"./CXGgKVbVXjWzE0p6.js";import{K as i}from"./CoPUxkU9zZy0dXti.js";import{f as a,p as o,s}from"./Cb8ORg9ENgscK6yl.js";var c=e(t(),1),l=n(),u=(0,c.memo)((0,c.forwardRef)((e,t)=>{let{children:n,disabled:u,style:d,container:f,movable:p,zoom:m=1,isDragging:h,onHide:g,onShow:_,onDragZone:v,adornmentHost:y,flip:b,gesture:x,...S}=e,[,C]=(0,c.useReducer)(e=>e+1,0);r(p??null,{onBoundsChange:C,onSelectionChange:C,onAnyChange:C});let w=p?.getMovables()??null;r(w,{onCollectionChange:C});let[T]=i(`movable-drag`,null),E=(0,c.useContext)(s),D=w?.getItems({ignoreHidden:!0})??[];(0,c.useEffect)(()=>{let e=D.map(e=>e.addListeners({onBoundsChange:C,onAnyChange:C,onSelectionChange:C}));return()=>{for(let t of e)t()}},[D.map(e=>e.getId()).join(`|`)]);let O=p?.getBounds();if(f.isDeleted()||!p||!O)return null;let k=d?.pointerEvents===`none`,A=!k&&!u&&p.isSelected(),j=T?.[p.getId()]??null,M=j?.bounds??O,N=p.getFlip(),P=b??j?.flip??N,F=(O.width>0?M.width/O.width:1)*(P.horizontal===N.horizontal?1:-1),I=(O.height>0?M.height/O.height:1)*(P.vertical===N.vertical?1:-1),L=p.getRotation()||0,R=[`translate(${M.width*m/2}px, ${M.height*m/2}px)`,F!==1||I!==1?`scale(${F}, ${I})`:``,L?`rotate(${-L}deg)`:``,`translate(${-(O.x+O.width/2)*m}px, ${-(O.y+O.height/2)*m}px)`].filter(Boolean).join(` `);return(0,l.jsxs)(`div`,{className:`group-editor`,...S,ref:t,style:{width:`100%`,height:`100%`,position:`relative`,overflow:`visible`,...d,pointerEvents:`none`},children:[(0,l.jsx)(`div`,{className:`group-canvas`,style:{position:`absolute`,left:0,top:0,transformOrigin:`0 0`,transform:R,pointerEvents:`none`},children:D.map(e=>{let t=a(e.getContent().getType()),n=T?.[e.getId()]??null,r=n?.bounds??e.getBounds();if(!r||!t)return null;let i=n?.rotation??(e.getRotation()||0);return(0,l.jsx)(`div`,{className:`group-member`,[o]:e.getId(),style:{position:`absolute`,left:r.x*m,top:r.y*m,width:r.width*m,height:r.height*m,transform:i?`rotate(${i}deg)`:void 0,transformOrigin:`center`,opacity:n?.7:void 0,pointerEvents:`none`},children:(0,l.jsx)(t,{movable:e,zoom:m,flip:n?.flip??e.getFlip(),disabled:u,isDragging:h||!!n,adornmentHost:E.get(e)??null,style:{position:`relative`,left:0,top:0,width:`100%`,height:`100%`,pointerEvents:k?`none`:`auto`}})},e.getId())})}),A?(0,l.jsx)(`svg`,{className:`group-edge`,width:`100%`,height:`100%`,style:{position:`absolute`,left:0,top:0,overflow:`visible`,pointerEvents:`none`},children:(0,l.jsx)(`rect`,{x:0,y:0,width:`100%`,height:`100%`,fill:`none`,stroke:`transparent`,pointerEvents:`stroke`,style:{strokeWidth:`var(--sxl-handle-hit, 11px)`}})}):null]})}));u.displayName=`GroupEditor`;export{u as GroupEditor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={AnchorLocation:{Bottom:`b`,BottomLeft:`bl`,BottomRight:`br`,Center:`c`,Left:`l`,Right:`r`,Top:`t`,TopLeft:`tl`,TopRight:`tr`},AutoNumberingSchemeType:{alphaLcParenBoth:0,alphaLcParenRight:2,alphaLcPeriod:4,alphaUcParenBoth:1,alphaUcParenRight:3,alphaUcPeriod:5,arabic1Minus:28,arabic2Minus:29,arabicDbPeriod:19,arabicDbPlain:20,arabicParenBoth:6,arabicParenRight:7,arabicPeriod:8,arabicPlain:9,circleNumDbPlain:16,circleNumWdBlackPlain:17,circleNumWdWhitePlain:18,ea1ChsPeriod:21,ea1ChsPlain:22,ea1ChtPeriod:23,ea1ChtPlain:24,ea1JpnChsDbPeriod:25,ea1JpnKorPeriod:27,ea1JpnKorPlain:26,hebrew2Minus:30,hindiAlpha1Period:40,hindiAlphaPeriod:37,hindiNumParenRight:39,hindiNumPeriod:38,romanLcParenBoth:10,romanLcParenRight:12,romanLcPeriod:14,romanUcParenBoth:11,romanUcParenRight:13,romanUcPeriod:15,thaiAlphaParenBoth:33,thaiAlphaParenRight:32,thaiAlphaPeriod:31,thaiNumParenBoth:36,thaiNumParenRight:35,thaiNumPeriod:34},AxisSelection:{Both:`both`,Column:`column`,Row:`row`},DateUnit:{Day:`d`,Month:`m`,Weekday:`wd`,Year:`y`},Direction:{Down:`down`,Left:`left`,Right:`right`,Up:`up`},FormulaError:{Code:{Blocked:11,Busy:16,Calc:14,Connect:10,Div0:2,Field:13,GettingData:8,NA:7,Name:5,Null:1,Num:6,Parse:0,Python:19,Ref:4,Spill:9,Timeout:20,Unknown:12,Value:3},Label:{Blocked:`#BLOCKED!`,Busy:`#BUSY!`,Calc:`#CALC!`,Connect:`#CONNECT!`,Div0:`#DIV/0!`,Field:`#FIELD!`,GettingData:`#GETTING_DATA`,NA:`#N/A`,Name:`#NAME?`,Null:`#NULL!`,Num:`#NUM!`,Parse:`#PARSE!`,Python:`#PYTHON!`,Ref:`#REF!`,Spill:`#SPILL!`,Timeout:`#TIMEOUT!`,Unknown:`#UNKNOWN!`,Value:`#VALUE!`}},IAnchored:{Type:{Absolute:`absolute`,OneCell:`oneCell`,TwoCell:`twoCell`}},IBorders:{Edge:{Bottom:`bottom`,DiagonalDown:`diagonalDown`,DiagonalUp:`diagonalUp`,Horizontal:`horizontal`,Left:`left`,Right:`right`,Top:`top`,Vertical:`vertical`},StrokeStyle:{DashDot:`dashDot`,DashDotDot:`dashDotDot`,Dashed:`dashed`,Dotted:`dotted`,Double:`double`,Hair:`hair`,Medium:`medium`,MediumDashDot:`mediumDashDot`,MediumDashDotDot:`mediumDashDotDot`,MediumDashed:`mediumDashed`,None:`none`,SlantDashDot:`slantDashDot`,Thick:`thick`,Thin:`thin`}},ICalculation:{CalculationMode:{Automatic:`auto`,AutomaticExceptTables:`automaticExceptTables`,Manual:`manual`},CalculationState:{Calculating:`calculating`,Done:`done`,Pending:`pending`},ResultStatus:{Pending:`pending`,Ready:`ready`,Stale:`stale`,Waiting:`waiting`},Status:{Error:`error`,Off:`off`,Running:`running`,Starting:`starting`,Stopping:`stopping`}},ICell:{Content:{Comments:`comments`,DataValidations:`dataValidations`,Formats:`formats`,Formulas:`formulas`,Hyperlinks:`hyperlinks`,Notes:`notes`,Sparklines:`sparklines`,Tables:`tables`,Values:`values`},ErrorCheck:{ApproximateMatch:`approximateMatch`,ConstantFrequency:`constantFrequency`,DegenerateCall:`degenerateCall`,EmptyCellReference:`emptyCellReference`,ErrorConstant:`errorConstant`,EvaluatesToError:`evalError`,ExternalReference:`externalReference`,HardcodeInRun:`hardcodeInRun`,InconsistentFormula:`formula`,InconsistentListFormula:`calculatedColumn`,KeyLabelMismatch:`keyLabelMismatch`,LinkLabelMismatch:`linkLabelMismatch`,ListDataValidation:`listDataValidation`,LiteralMatchesInput:`literalMatchesInput`,LookupShape:`lookupShape`,MisalignedReference:`misalignedReference`,NumberAsText:`numberStoredAsText`,OmittedCells:`formulaRange`,RepeatedReference:`repeatedReference`,RowGap:`rowGap`,ScaleOutlier:`scaleOutlier`,SignVsSiblings:`signVsSiblings`,StyleBreak:`styleBreak`,StyleRole:`styleRole`,SumIncludesSubtotal:`sumIncludesSubtotal`,TextDate:`twoDigitTextYear`,TwinBlockDivergence:`twinBlockDivergence`,UnlockedFormula:`unlockedFormula`,UnreferencedInput:`unreferencedInput`},Role:{Computed:`computed`,Input:`input`,Label:`label`,Link:`link`,Output:`output`,Reference:`reference`}},ICellRange:{AnomalyFocus:{Average:`average`,ColorCoding:`colorCoding`,CrossSheetReference:`crossSheetReference`,DeletedRows:`deletedRows`,DoubleCounting:`doubleCounting`,EmbeddedHardcode:`embeddedHardcode`,Lookup:`lookup`,ReferenceAnchoring:`referenceAnchoring`,SignConvention:`signConvention`,UnitMismatch:`unitMismatch`},Feature:{Alignment:`alignment`,Anomalies:`anomalies`,AutoTable:`autoTable`,Borders:`borders`,CalcError:`calcError`,CalcStatus:`calcStatus`,CellControl:`cellControl`,Circular:`circular`,Comments:`comments`,Conditionals:`conditionals`,Contentful:`contentful`,DataValidations:`dataValidations`,DateFormat:`dateFormat`,Error:`error`,Fill:`fill`,Font:`font`,Formula:`formula`,Hyperlink:`hyperlink`,IgnoredErrors:`ignoredErrors`,Kind:`kind`,Merge:`merge`,NumberFormat:`numberFormat`,Pivot:`pivot`,Protection:`protection`,Role:`role`,Sparkline:`sparkline`,Spills:`spills`,Table:`table`,Unlock:`unlock`}},ICellStyle:{BuiltInName:{Accent1:`Accent1`,Accent1_20:`20% - Accent1`,Accent1_40:`40% - Accent1`,Accent1_60:`60% - Accent1`,Accent2:`Accent2`,Accent2_20:`20% - Accent2`,Accent2_40:`40% - Accent2`,Accent2_60:`60% - Accent2`,Accent3:`Accent3`,Accent3_20:`20% - Accent3`,Accent3_40:`40% - Accent3`,Accent3_60:`60% - Accent3`,Accent4:`Accent4`,Accent4_20:`20% - Accent4`,Accent4_40:`40% - Accent4`,Accent4_60:`60% - Accent4`,Accent5:`Accent5`,Accent5_20:`20% - Accent5`,Accent5_40:`40% - Accent5`,Accent5_60:`60% - Accent5`,Accent6:`Accent6`,Accent6_20:`20% - Accent6`,Accent6_40:`40% - Accent6`,Accent6_60:`60% - Accent6`,Bad:`Bad`,Calculation:`Calculation`,CheckCell:`Check Cell`,ColLevel:`ColLevel_#`,Comma:`Comma`,Comma0:`Comma [0]`,Currency:`Currency`,Currency0:`Currency [0]`,ExplanatoryText:`Explanatory Text`,FollowedHyperlink:`Followed Hyperlink`,Good:`Good`,Heading1:`Heading 1`,Heading2:`Heading 2`,Heading3:`Heading 3`,Heading4:`Heading 4`,Hyperlink:`Hyperlink`,Input:`Input`,LinkedCell:`Linked Cell`,Neutral:`Neutral`,Normal:`Normal`,Note:`Note`,Output:`Output`,Percent:`Percent`,RowLevel:`RowLevel_#`,Title:`Title`,Total:`Total`,Unknown12:`??-12`,Unknown13:`??-13`,Unknown14:`??-14`,WarningText:`Warning Text`},IconSet:{Arrows3:`3Arrows`,Arrows4:`4Arrows`,Arrows5:`5Arrows`,ArrowsGray3:`3ArrowsGray`,ArrowsGray4:`4ArrowsGray`,ArrowsGray5:`5ArrowsGray`,Boxes5:`5Boxes`,Flags3:`3Flags`,NoIcons:`NoIcons`,Quarters5:`5Quarters`,Rating4:`4Rating`,Rating5:`5Rating`,RedToBlack4:`4RedToBlack`,Signs3:`3Signs`,Stars3:`3Stars`,Symbols3:`3Symbols`,Symbols3_2:`3Symbols2`,TrafficLights3:`3TrafficLights1`,TrafficLights3_2:`3TrafficLights2`,TrafficLights4:`4TrafficLights`,Triangles3:`3Triangles`}},IColor:{AdjustmentType:{Alpha:`alpha`,AlphaMod:`alphaMod`,AlphaOff:`alphaOff`,Blue:`blue`,BlueMod:`blueMod`,BlueOff:`blueOff`,Comp:`comp`,ETint:`eTint`,Gamma:`gamma`,Gray:`gray`,Green:`green`,GreenMod:`greenMod`,GreenOff:`greenOff`,Hue:`hue`,HueMod:`hueMod`,HueOff:`hueOff`,Inv:`inv`,InvGamma:`invGamma`,Lum:`lum`,LumMod:`lumMod`,LumOff:`lumOff`,Red:`red`,RedMod:`redMod`,RedOff:`redOff`,Sat:`sat`,SatMod:`satMod`,SatOff:`satOff`,Shade:`shade`,Tint:`tint`},Named:{ActiveBorder:`activeBorder`,ActiveCaption:`activeCaption`,AliceBlue:`aliceBlue`,AntiqueWhite:`antiqueWhite`,AppWorkspace:`appWorkspace`,Aqua:`aqua`,Aquamarine:`aquamarine`,Azure:`azure`,Background:`background`,Beige:`beige`,Bisque:`bisque`,Black:`black`,BlanchedAlmond:`blanchedAlmond`,Blue:`blue`,BlueViolet:`blueViolet`,Brown:`brown`,BtnFace:`btnFace`,BtnHighlight:`btnHighlight`,BtnShadow:`btnShadow`,BtnText:`btnText`,BurlyWood:`burlyWood`,ButtonFace:`buttonFace`,ButtonHighlight:`buttonHighlight`,ButtonShadow:`buttonShadow`,CadetBlue:`cadetBlue`,CaptionText:`captionText`,Chartreuse:`chartreuse`,Chocolate:`chocolate`,Coral:`coral`,CornflowerBlue:`cornflowerBlue`,Cornsilk:`cornsilk`,Crimson:`crimson`,Cyan:`cyan`,DeepPink:`deepPink`,DeepSkyBlue:`deepSkyBlue`,DimGray:`dimGray`,DkBlue:`dkBlue`,DkCyan:`dkCyan`,DkGoldenrod:`dkGoldenrod`,DkGray:`dkGray`,DkGreen:`dkGreen`,DkKhaki:`dkKhaki`,DkMagenta:`dkMagenta`,DkOliveGreen:`dkOliveGreen`,DkOrange:`dkOrange`,DkOrchid:`dkOrchid`,DkRed:`dkRed`,DkSalmon:`dkSalmon`,DkSeaGreen:`dkSeaGreen`,DkShadow3d:`3dDkShadow`,DkSlateBlue:`dkSlateBlue`,DkSlateGray:`dkSlateGray`,DkTurquoise:`dkTurquoise`,DkViolet:`dkViolet`,DodgerBlue:`dodgerBlue`,Firebrick:`firebrick`,FloralWhite:`floralWhite`,ForestGreen:`forestGreen`,Fuchsia:`fuchsia`,Gainsboro:`gainsboro`,GhostWhite:`ghostWhite`,Gold:`gold`,Goldenrod:`goldenrod`,GradientActiveCaption:`gradientActiveCaption`,GradientInactiveCaption:`gradientInactiveCaption`,Gray:`gray`,GrayText:`grayText`,Green:`green`,GreenYellow:`greenYellow`,Grey:`grey`,Highlight:`highlight`,HighlightText:`highlightText`,Honeydew:`honeydew`,HotLight:`hotLight`,HotPink:`hotPink`,InactiveBorder:`inactiveBorder`,InactiveCaption:`inactiveCaption`,InactiveCaptionText:`inactiveCaptionText`,IndianRed:`indianRed`,Indigo:`indigo`,InfoBk:`infoBk`,InfoText:`infoText`,Ivory:`ivory`,Khaki:`khaki`,Lavender:`lavender`,LavenderBlush:`lavenderBlush`,LawnGreen:`lawnGreen`,LemonChiffon:`lemonChiffon`,Light3d:`3dLight`,Lime:`lime`,LimeGreen:`limeGreen`,Linen:`linen`,LtBlue:`ltBlue`,LtCoral:`ltCoral`,LtCyan:`ltCyan`,LtGoldenrodYellow:`ltGoldenrodYellow`,LtGray:`ltGray`,LtGreen:`ltGreen`,LtPink:`ltPink`,LtSalmon:`ltSalmon`,LtSeaGreen:`ltSeaGreen`,LtSkyBlue:`ltSkyBlue`,LtSlateGray:`ltSlateGray`,LtSteelBlue:`ltSteelBlue`,LtYellow:`ltYellow`,Magenta:`magenta`,Maroon:`maroon`,MedAquamarine:`medAquamarine`,MedBlue:`medBlue`,MedOrchid:`medOrchid`,MedPurple:`medPurple`,MedSeaGreen:`medSeaGreen`,MedSlateBlue:`medSlateBlue`,MedSpringGreen:`medSpringGreen`,MedTurquoise:`medTurquoise`,MedVioletRed:`medVioletRed`,Menu:`menu`,MenuBar:`menuBar`,MenuHighlight:`menuHighlight`,MenuText:`menuText`,MidnightBlue:`midnightBlue`,MintCream:`mintCream`,MistyRose:`mistyRose`,Moccasin:`moccasin`,NavajoWhite:`navajoWhite`,Navy:`navy`,OldLace:`oldLace`,Olive:`olive`,OliveDrab:`oliveDrab`,Orange:`orange`,OrangeRed:`orangeRed`,Orchid:`orchid`,PaleGoldenrod:`paleGoldenrod`,PaleGreen:`paleGreen`,PaleTurquoise:`paleTurquoise`,PaleVioletRed:`paleVioletRed`,PapayaWhip:`papayaWhip`,PeachPuff:`peachPuff`,Peru:`peru`,Pink:`pink`,Plum:`plum`,PowderBlue:`powderBlue`,Purple:`purple`,Red:`red`,RosyBrown:`rosyBrown`,RoyalBlue:`royalBlue`,SaddleBrown:`saddleBrown`,Salmon:`salmon`,SandyBrown:`sandyBrown`,ScrollBar:`scrollBar`,SeaGreen:`seaGreen`,SeaShell:`seaShell`,Sienna:`sienna`,Silver:`silver`,SkyBlue:`skyBlue`,SlateBlue:`slateBlue`,SlateGray:`slateGray`,Snow:`snow`,SpringGreen:`springGreen`,SteelBlue:`steelBlue`,Tan:`tan`,Teal:`teal`,Thistle:`thistle`,Tomato:`tomato`,Transparent:`transparent`,Turquoise:`turquoise`,Violet:`violet`,Wheat:`wheat`,White:`white`,WhiteSmoke:`whiteSmoke`,Window:`window`,WindowFrame:`windowFrame`,WindowText:`windowText`,Yellow:`yellow`,YellowGreen:`yellowGreen`},Scheme:{Accent1:`accent1`,Accent2:`accent2`,Accent3:`accent3`,Accent4:`accent4`,Accent5:`accent5`,Accent6:`accent6`,Bg1:`bg1`,Bg2:`bg2`,FolHlink:`folHlink`,Hlink:`hlink`,Tx1:`tx1`,Tx2:`tx2`},Type:{Auto:`auto`,Hex:`hex`,HSL:`hsl`,Index:`index`,LRGB:`lrgb`,Named:`named`,RGB:`rgb`,Scheme:`scheme`}},ICondition:{AverageType:{Above:`above`,AboveOrEqual:`aboveOrEqual`,Below:`below`,BelowOrEqual:`belowOrEqual`},BuiltInOperatorNames:{After:`after`,AfterEqualTo:`afterEqualTo`,And:`and`,Average:`average`,Before:`before`,BeforeEqualTo:`beforeEqualTo`,Between:`between`,Blank:`blank`,Color:`color`,EqualTo:`equalTo`,Error:`error`,Expression:`expression`,GreaterThan:`greaterThan`,GreaterThanEqualTo:`greaterThanEqualTo`,Icon:`icon`,InSet:`inSet`,LessThan:`lessThan`,LessThanEqualTo:`lessThanEqualTo`,Not:`not`,Or:`or`,TextContains:`textContains`,TextEmail:`textEmail`,TextEndsWith:`textEndsWith`,TextIsUrl:`textUrl`,TextMatches:`textMatches`,TextStartsWith:`textStartsWith`,TimePeriod:`timePeriod`,TopN:`topN`,Unique:`unique`},BuiltInSelectorNames:{Date:`date`,DateTime:`dateTime`,Display:`display`,Logical:`logical`,Number:`number`,Text:`text`,TextLength:`textLength`,Time:`time`,Whole:`wholeNumber`},DateItemGroupingType:{Day:`day`,Hour:`hour`,Minute:`minute`,Month:`month`,Second:`second`,Year:`year`},TimePeriodType:{Last7Days:`last7Days`,LastMonth:`lastMonth`,LastQuarter:`lastQuarter`,LastWeek:`lastWeek`,LastYear:`lastYear`,M1:`M1`,M10:`M10`,M11:`M11`,M12:`M12`,M2:`M2`,M3:`M3`,M4:`M4`,M5:`M5`,M6:`M6`,M7:`M7`,M8:`M8`,M9:`M9`,NextMonth:`nextMonth`,NextQuarter:`nextQuarter`,NextWeek:`nextWeek`,NextYear:`nextYear`,Null:`null`,Q1:`Q1`,Q2:`Q2`,Q3:`Q3`,Q4:`Q4`,ThisMonth:`thisMonth`,ThisQuarter:`thisQuarter`,ThisWeek:`thisWeek`,ThisYear:`thisYear`,Today:`today`,Tomorrow:`tomorrow`,YearToDate:`yearToDate`,Yesterday:`yesterday`}},IConditionalFormat:{ColorStopType:{AutoMax:`autoMax`,AutoMin:`autoMin`,Formula:`formula`,Max:`max`,Min:`min`,Num:`num`,Percent:`percent`,Percentile:`percentile`},ScaleType:{ColorScale:`colorScale`,DataBar:`dataBar`,IconSet:`iconSet`}},ICustomProperty:{Type:{Boolean:`boolean`,Date:`date`,Float:`float`,Number:`number`,String:`string`}},IDataValidation:{AlertStyle:{Information:`information`,Stop:`stop`,Warning:`warning`}},IDropDown:{DropStyle:{Combo:`combo`,ComboEdit:`comboEdit`,Simple:`simple`}},IEffect:{Type:{Glow:`glow`,InnerShadow:`innerShadow`,OuterShadow:`outerShadow`,PresetShadow:`presetShadow`,Reflection:`reflection`,SoftEdge:`softEdge`}},IFill:{BuiltInSheetPattern:{Custom:`custom`,DarkDown:`darkDown`,DarkGray:`darkGray`,DarkGrid:`darkGrid`,DarkHorizontal:`darkHorizontal`,DarkTrellis:`darkTrellis`,DarkUp:`darkUp`,DarkVertical:`darkVertical`,Gray0625:`gray0625`,Gray125:`gray125`,LightDown:`lightDown`,LightGray:`lightGray`,LightGrid:`lightGrid`,LightHorizontal:`lightHorizontal`,LightTrellis:`lightTrellis`,LightUp:`lightUp`,LightVertical:`lightVertical`,MediumGray:`mediumGray`,None:`none`,Solid:`solid`},GradientType:{Linear:`linear`,Path:`path`,Rect:`rect`,Shape:`shape`},TileFlip:{Both:`xy`,Horizontal:`x`,None:`none`,Vertical:`y`},Type:{Background:`background`,Custom:`custom`,Gradient:`gradient`,Group:`group`,Image:`image`,None:`none`,Pattern:`pattern`,Solid:`solid`}},IFont:{Charset:{Ansi:0,Arabic:178,Baltic:186,ChineseBig5:136,Default:1,EastEurope:238,GB2312:134,Greek:161,Hangul:129,Hebrew:177,Johab:130,Mac:77,Oem:255,Russian:204,ShiftJIS:128,Symbol:2,Thai:222,Turkish:162,Vietnamese:163},GenericName:{Cursive:`cursive`,Emoji:`emoji`,Fangsong:`fangsong`,Fantasy:`fantasy`,Math:`math`,MonoSpace:`monospace`,SanSerif:`sans-serif`,Serif:`serif`,SystemUI:`system-ui`,UIMonoSpace:`ui-monospace`,UIRounded:`ui-rounded`,UISanSerif:`ui-sans-serif`,UISerif:`ui-serif`,UISystem:`ui-system`},Scheme:{Major:`major`,Minor:`minor`,None:`none`},StrikeStyle:{Double:`double`,None:`none`,Single:`single`},Style:{Italic:`italic`,Normal:`normal`},UnderlineStyle:{Dash:`dash`,DashHeavy:`dashHeavy`,DashLong:`dashLong`,DashLongHeavy:`dashLongHeavy`,DotDash:`dotDash`,DotDashHeavy:`dotDashHeavy`,DotDotDash:`dotDotDash`,DotDotDashHeavy:`dotDotDashHeavy`,Dotted:`dotted`,DottedHeavy:`dottedHeavy`,Double:`double`,DoubleAccounting:`doubleAccounting`,Heavy:`heavy`,None:`none`,Single:`single`,SingleAccounting:`singleAccounting`,Wavy:`wavy`,WavyDouble:`wavyDouble`,WavyHeavy:`wavyHeavy`,Words:`words`}},IFontCollection:{FontStatus:{Error:`error`,Loaded:`loaded`,Loading:`loading`},ResolutionKind:{Classified:`classified`,Exact:`exact`,Generic:`generic`,Table:`table`}},IFontStyle:{Baseline:{Subscript:-25,Superscript:30},ThemeFamily:{Body:`theme:body`,Heading:`theme:heading`}},IFormControl:{Type:{Button:`button`,CheckBox:`checkBox`,Dialog:`dialog`,DropDown:`dropDown`,EditBox:`editBox`,GroupBox:`groupBox`,Label:`label`,ListBox:`listBox`,OptionButton:`optionButton`,ScrollBar:`scrollBar`,Spinner:`spinner`,Unknown:`formControl`}},IGeometry:{HandleType:{Polar:`polar`,XY:`xy`},PathLayer:{Fill:`fill`,Marker:`marker`,Stroke:`stroke`}},InteropScalarType:{Boolean:`boolean`,Date:`date`,Error:`error`,Null:`null`,Number:`number`,RichData:`richData`,String:`string`},IPageLayout:{HeaderFooterState:{Default:`default`,FirstAndDefault:`firstAndDefault`,FirstOddAndEven:`firstOddAndEven`,OddAndEven:`oddAndEven`},Orientation:{Landscape:`landscape`,Portrait:`portrait`},PaperType:{A3:`a3`,A4:`a4`,A4Small:`a4Small`,A5:`a5`,B4:`b4`,B5:`b5`,Csheet:`csheet`,Dsheet:`dsheet`,Envelope10:`envelope10`,Envelope11:`envelope11`,Envelope12:`envelope12`,Envelope14:`envelope14`,Envelope9:`envelope9`,EnvelopeB4:`envelopeB4`,EnvelopeB5:`envelopeB5`,EnvelopeB6:`envelopeB6`,EnvelopeC3:`envelopeC3`,EnvelopeC4:`envelopeC4`,EnvelopeC5:`envelopeC5`,EnvelopeC6:`envelopeC6`,EnvelopeC65:`envelopeC65`,EnvelopeDL:`envelopeDL`,EnvelopeItaly:`envelopeItaly`,EnvelopeMonarch:`envelopeMonarch`,EnvelopePersonal:`envelopePersonal`,Esheet:`esheet`,Executive:`executive`,FanfoldLegalGerman:`fanfoldLegalGerman`,FanfoldStdGerman:`fanfoldStdGerman`,FanfoldUS:`fanfoldUS`,Folio:`folio`,Ledger:`ledger`,Legal:`legal`,Letter:`letter`,LetterSmall:`letterSmall`,Note:`note`,Paper10x14:`paper10x14`,Paper11x17:`paper11x17`,Quatro:`quatro`,Statement:`statement`,Tabloid:`tabloid`},PrintComments:{EndSheet:`endSheet`,InPlace:`inPlace`,NoComments:`noComments`},PrintErrorType:{AsDisplayed:`asDisplayed`,Blank:`blank`,Dash:`dash`,NotAvailable:`notAvailable`},PrintMarginUnit:{Centimeters:`centimeters`,Inches:`inches`,Points:`points`},PrintOrder:{DownThenOver:`downThenOver`,OverThenDown:`overThenDown`}},IPivotTable:{Axis:{Column:`column`,Page:`page`,Row:`row`,Values:`values`}},IRange:{Axis:{Column:`column`,Row:`row`},AxisSelection:{Both:`both`,Column:`column`,Row:`row`},Direction:{Down:`down`,Left:`left`,Right:`right`,Up:`up`}},IRangeStats:{Aggregate:{Average:`average`,Count:`count`,Max:`max`,Min:`min`,NumericalCount:`numericalCount`,PopulationStdDev:`stdDevP`,PopulationVariance:`varP`,StdDev:`stdDev`,Sum:`sum`,Variance:`var`}},IShape:{ConnectorType:{Curved:`curved`,Elbow:`elbow`,Straight:`straight`},Type:{Connector:`connector`,Shape:`shape`}},ISheet:{Kind:{Chart:`chart`,Dialog:`dialog`,Macro:`macro`,Worksheet:`worksheet`},Visibility:{Hidden:`hidden`,VeryHidden:`veryHidden`,Visible:`visible`}},ISlicerStyle:{ElementType:{HeaderRow:`headerRow`,HoveredSelectedItemWithData:`hoveredSelectedItemWithData`,HoveredSelectedItemWithNoData:`hoveredSelectedItemWithNoData`,HoveredUnselectedItemWithData:`hoveredUnselectedItemWithData`,HoveredUnselectedItemWithNoData:`hoveredUnselectedItemWithNoData`,SelectedItemWithData:`selectedItemWithData`,SelectedItemWithNoData:`selectedItemWithNoData`,UnselectedItemWithData:`unselectedItemWithData`,UnselectedItemWithNoData:`unselectedItemWithNoData`,WholeTable:`wholeTable`}},ISort:{SortOn:{FillColor:`fillColor`,FontColor:`fontColor`,Icon:`icon`,Value:`value`}},ISparklineGroup:{AxisType:{Custom:`custom`,Group:`group`,Individual:`individual`},EmptyCellsAs:{Gap:`gap`,Span:`span`,Zero:`zero`},Type:{Column:`column`,Line:`line`,WinLoss:`winLoss`}},IStroke:{Align:{Center:`ctr`,Inset:`in`,Outset:`outset`},Compound:{Double:`dbl`,Single:`sng`,ThickThin:`thickThin`,ThinThick:`thinThick`,Triple:`tri`},DashStyle:{Dash:`dash`,DashDot:`dashDot`,Dot:`dot`,LongDash:`lgDash`,LongDashDot:`lgDashDot`,LongDashDotDot:`lgDashDotDot`,Solid:`solid`,SysDash:`sysDash`,SysDashDot:`sysDashDot`,SysDashDotDot:`sysDashDotDot`,SysDot:`sysDot`},LineCap:{Butt:`butt`,Round:`round`,Square:`square`},LineEndSize:{Large:`lg`,Medium:`med`,Small:`sm`},LineEndType:{Arrow:`arrow`,Diamond:`diamond`,None:`none`,Oval:`oval`,Stealth:`stealth`,Triangle:`triangle`},LineJoin:{Bevel:`bevel`,Miter:`miter`,Round:`round`}},ITable:{AutoExpand:{Both:`both`,Columns:`columns`,None:`none`,Rows:`rows`},FormulaBelow:{BelowTable:`belowTable`,InsideTable:`insideTable`,TotalsRow:`totalsRow`}},ITableStyle:{ElementType:{FirstColumn:`firstColumn`,FirstColumnStripe:`firstColumnStripe`,FirstHeaderCell:`firstHeaderCell`,FirstRowStripe:`firstRowStripe`,FirstTotalCell:`firstTotalCell`,HeaderRow:`headerRow`,LastColumn:`lastColumn`,LastHeaderCell:`lastHeaderCell`,LastTotalCell:`lastTotalCell`,SecondColumnStripe:`secondColumnStripe`,SecondRowStripe:`secondRowStripe`,TotalRow:`totalRow`,WholeTable:`wholeTable`},PivotElementType:{BlankRow:`blankRow`,FirstColumnSubheading:`firstColumnSubheading`,FirstRowSubheading:`firstRowSubheading`,FirstSubtotalColumn:`firstSubtotalColumn`,FirstSubtotalRow:`firstSubtotalRow`,PageFieldLabels:`pageFieldLabels`,PageFieldValues:`pageFieldValues`,SecondColumnSubheading:`secondColumnSubheading`,SecondRowSubheading:`secondRowSubheading`,SecondSubtotalColumn:`secondSubtotalColumn`,SecondSubtotalRow:`secondSubtotalRow`,ThirdColumnSubheading:`thirdColumnSubheading`,ThirdRowSubheading:`thirdRowSubheading`,ThirdSubtotalColumn:`thirdSubtotalColumn`,ThirdSubtotalRow:`thirdSubtotalRow`}},IText:{FontAlignment:{Auto:`auto`,Baseline:`baseline`,Bottom:`bottom`,Center:`center`,Top:`top`},ParagraphAlignment:{Center:`center`,Distributed:`distributed`,Justify:`justify`,JustifyLow:`justifyLow`,Left:`left`,Right:`right`,ThaiDistributed:`thaiDistributed`},SmallCaps:{All:`all`,None:`none`,Small:`small`}},ITextFrame:{Autofit:{None:`none`,Normal:`normal`,Shape:`shape`},HorizontalAlignment:{Center:`center`,CenterContinuous:`centerContinuous`,Distributed:`distributed`,Fill:`fill`,General:`general`,Justify:`justify`,Left:`left`,Right:`right`},Orientation:{Horizontal:`horizontal`,Stacked:`stacked`,Vertical:`90`,Vertical270:`270`},Overflow:{Clip:`clip`,Ellipsis:`ellipsis`,Shrink:`shrink`,Visible:`visible`,Wrap:`wrap`},ReadingDirection:{Auto:`auto`,LeftToRight:`ltr`,RightToLeft:`rtl`},TabStopAlignment:{Center:`center`,Decimal:`decimal`,Default:`default`,Left:`left`,Right:`right`},VerticalAlignment:{Bottom:`bottom`,Center:`center`,Distributed:`distributed`,Justify:`justify`,Top:`top`},WritingMode:{EastAsianVertical:`eastAsianVertical`,Horizontal:`horizontal`,MongolianVertical:`mongolianVertical`,Vertical:`vertical`,Vertical270:`vertical270`,WordArtVertical:`wordArtVertical`,WordArtVerticalRtl:`wordArtVerticalRtl`}},IThemeCollection:{BuiltInFilterType:{All:`all`,BuiltIn:`builtIn`,Custom:`custom`}},IWorkbookView:{Visibility:{Hidden:`hidden`,VeryHidden:`veryHidden`,Visible:`visible`}},IWorksheetView:{ColumnHeaderTableNames:{Hidden:`hidden`,None:`none`,Sticky:`sticky`},HeaderTextStyle:{A1:`a1`,One:`one`,Zero:`zero`},ViewMode:{Normal:`normal`,PageBreakPreview:`pageBreakPreview`,PageLayout:`pageLayout`}},MimeType:{Html:`text/html`,Plain:`text/plain`,Png:`image/png`},NumberFormat:{ParseRunType:{Repeat:`repeat`,Spacing:`spacing`,Text:`text`},Type:{Accounting:`Accounting`,Comma:`Comma`,Currency:`Currency`,Custom:`Custom`,Fraction:`Fraction`,General:`General`,LongDate:`Long Date`,LongTime:`Long Time`,MediumDate:`Medium Date`,MediumTime:`Medium Time`,Number:`Number`,Percentage:`Percentage`,Scientific:`Scientific`,ShortDate:`Short Date`,ShortTime:`Short Time`,Special:`Special`,Text:`Text`}},ParseRunType:{Repeat:`repeat`,Spacing:`spacing`,Text:`text`},RangeAxis:{Column:`column`,Row:`row`},RectAlignment:{Bottom:`b`,BottomLeft:`bl`,BottomRight:`br`,Center:`ctr`,Left:`l`,Right:`r`,Top:`t`,TopLeft:`tl`,TopRight:`tr`},ScalarType:{Boolean:`boolean`,Error:`error`,Null:`null`,Number:`number`,RichData:`richData`,String:`string`},Type:{Accounting:`Accounting`,Comma:`Comma`,Currency:`Currency`,Custom:`Custom`,Fraction:`Fraction`,General:`General`,LongDate:`Long Date`,LongTime:`Long Time`,MediumDate:`Medium Date`,MediumTime:`Medium Time`,Number:`Number`,Percentage:`Percentage`,Scientific:`Scientific`,ShortDate:`Short Date`,ShortTime:`Short Time`,Special:`Special`,Text:`Text`},ValueKind:{Array:`array`,Boolean:`boolean`,Error:`error`,Lambda:`lambda`,Null:`null`,Number:`number`,Omitted:`omitted`,Reference:`reference`,RichData:`richData`,String:`string`}};export{e as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./qFyplGXRu7IepHio.js","./CnXLpFE_vFrJ5Jbf.js","./Cx1kZ2u_8JFV2Q8D.js","./ChSvXfVMLxZsP9zG.js","./HclGiUj8dZXDFmoM.js","./CQukCzhuewMuFOlO.js","./zvxBjll3jnL0-vNn.js","./CnPgk3HcIziOcskY.js","./3Ls_kOvlQseMV8Q0.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./HclGiUj8dZXDFmoM.js";import{C as t,F as n,I as r,O as i,Z as a,_ as o,d as s,f as c,g as l,k as u,m as d,o as f,r as p,t as m,u as h,w as g,y as _}from"./ChSvXfVMLxZsP9zG.js";import{t as v}from"./3Ls_kOvlQseMV8Q0.js";import{c as y,i as b,s as x}from"./DcrVJCyDwGKeil2U.js";import{D as S,Dt as C,G as w,K as T,Kt as ee,Ut as te,W as E,Yt as D,d as ne,et as re,ht as O,k as ie,m as ae,rn as oe,rt as se,t as ce,v as le,xt as ue,yt as k}from"./DuYb_otrRZZDq6-f.js";import{i as A,t as j}from"./CQukCzhuewMuFOlO.js";import{$i as de,At as fe,Ei as pe,En as me,F as he,G as ge,Gn as _e,Hn as ve,Ht as ye,Jt as be,Ki as xe,Kn as Se,Kr as Ce,Li as we,Nn as Te,Nr as Ee,Ot as De,Pi as M,Pn as Oe,Pr as ke,Q as Ae,Qt as je,Ri as N,Tr as Me,Vr as P,Wr as Ne,Xn as Pe,Yi as Fe,Z as Ie,Zi as Le,Zn as F,an as Re,ba as ze,bn as I,ca as Be,da as Ve,fr as L,gi as R,gt as He,ha as Ue,hi as We,i as Ge,it as Ke,j as z,jn as B,ka as qe,ki as V,kn as Je,nt as Ye,pn as Xe,pr as Ze,q as Qe,qt as $e,r as et,rt as tt,si as nt,ui as rt,va as it,vi as at,vn as ot,wn as st,x as ct,xa as lt,ya as ut,yi as dt,yn as H,yt as ft,zi as pt}from"./A_-Jwzwmm3lkcm2f.js";var mt,ht=class extends u{constructor(e,t=50){super(t),this._transactions=e,this._floorId=e?e.getCurrentCommit(!1).getId():null,this._removeListener=e?.addListener({onCommitChange:()=>this._notifyOnStackChange()})}_undoCommits(e=this.maxStack){let t=this._transactions;if(!t)return[];let n=t.getLog(t.getCurrentCommit(!1).getId(),2**53-1),r=[];for(let t=0;t<n.length&&r.length<e;t++){let e=n[t];if(e.getId()===this._floorId||t===n.length-1)break;e.getDescription()&&r.push(e)}return r}_redoCommits(e=this.maxStack){let t=this._transactions;if(!t)return[];let n=t.getCurrentCommit(!1).getId(),r=t.getTipCommit().getId();if(r===n)return[];let i=t.getLog(r,2**53-1),a=[],o=!1;for(let e of i){if(e.getId()===n){o=!0;break}a.push(e)}if(!o)return[];a.reverse();let s=[];for(let t of a)if(t.getDescription()&&s.push(t),s.length>=e)break;return s}undo(e=1){let t=this._transactions;if(!t)return;let n=!1;try{for(let r=0;r<e;r++){let[e]=this._undoCommits(1);if(!e)break;t.revert(e.getId()),n=!0}}finally{n&&this._notifyOnStackChange()}}redo(e=1){let t=this._transactions;if(!t)return;let n=!1;try{for(let r=0;r<e;r++){let[e]=this._redoCommits(1);if(!e){r===0&&this._repeatOperation?.repeat();break}t.restore(e.getId()),n=!0}}finally{n&&this._notifyOnStackChange()}}hasUndo(){return this._undoCommits(1).length>0}hasRedo(){return this._redoCommits(1).length>0||this._repeatOperation!==null}getTopUndoDescription(){return this._undoCommits(1)[0]?.getDescription()??null}getTopRedoDescription(){return this._repeatOperation===null?this._redoCommits(1)[0]?.getDescription()??null:this._repeatOperation.description}getUndoDescriptions(){return this._undoCommits().map(e=>e.getDescription())}getRedoDescriptions(){let e=this._redoCommits().map(e=>e.getDescription());return e.length===0&&this._repeatOperation!==null&&e.push(this._repeatOperation.description),Object.freeze(e)}getUndoEntries(){return this._undoCommits().map(_t)}getRedoEntries(){let e=this._redoCommits().map(_t);return e.length===0&&this._repeatOperation!==null&&e.push({description:this._repeatOperation.description,author:null,meta:gt}),Object.freeze(e)}addUndoOperation(){throw Error(`TransactionUndoManager derives its stack from the commit log; commit a described transaction instead.`)}clear(e=!0){this._transactions&&(this._floorId=this._transactions.getCurrentCommit(!1).getId()),super.clear(e)}close(){this._removeListener?.()}},gt=Object.freeze({}),_t=e=>({description:e.getDescription(),author:e.getAuthor(),meta:e.getMeta()??gt});mt||={};var vt,U=class e{constructor(t,n={}){this._password=null,this._emitter=new b(this),this._path=t??null,this._name=n.name??null,this._format=n.format??null,this._size=n.size??null,this._lastModified=n.lastModified??null,this._canWrite=n.canWrite??e._defaultCanWrite(this._path),this._encryption=n.encryption??null}static _defaultCanWrite(e){return!!e&&!/^(https?:|data:|blob:)/i.test(e)}_cleanPath(){return this._path?this._path.split(/[?#]/)[0]:null}getName(){if(this._name!==null&&this._name!==void 0)return this._name;let e=this._cleanPath();return e&&N(e)||null}getPath(){return this._path}getFormat(){return this._format?this._format:this.getExtension()}getExtension(){let e=this._cleanPath();if(!e)return null;let t=R(e);return t?t.toLowerCase():null}getEncryption(){return this._encryption}isEncrypted(){return this._encryption!==null||this._password!==null}setPassword(e){this._password!==(e??null)&&(this._password=e??null,this._password===null&&(this._encryption=null),this._emitter.notify(`onChange`))}getPassword(){return this._password}getSize(){return this._size}getLastModified(){return this._lastModified}canWrite(){return this._canWrite}setName(e){this.update({name:e})}update(e){let t=!1;return e.lastModified!==void 0&&e.lastModified!==this._lastModified&&(this._lastModified=e.lastModified,t=!0),e.name!==void 0&&e.name!==this._name&&(this._name=e.name,t=!0),e.format!==void 0&&e.format!==this._format&&(this._format=e.format,t=!0),e.size!==void 0&&e.size!==this._size&&(this._size=e.size,t=!0),e.canWrite!==void 0&&e.canWrite!==this._canWrite&&(this._canWrite=e.canWrite,t=!0),e.encryption!==void 0&&e.encryption!==this._encryption&&(this._encryption=e.encryption,t=!0),t&&this._emitter.notify(`onChange`),this}addListeners(e,t){return this._emitter.addListeners(e,t)}get[Symbol.toStringTag](){return`[Origin]`}toString(){let e=this._cleanPath(),t=e?e.split(/[/\\]/).pop()||e:this._name??`(unbound)`,n=this._size;if(n==null)return t;if(n<1024)return`${t} ${n}B`;let r=Math.floor(Math.log(n)/Math.log(1024)),i=[`B`,`KB`,`MB`,`GB`,`TB`];return`${t} ${(n/1024**r).toFixed(2)}${i[Math.min(r,i.length-1)]}`}},W=new WeakMap,G=new Set,yt=e=>W.get(e)??null,bt=()=>Array.from(G,e=>e.getOrigin()),xt=class e{constructor(t){this._released=!1,e._assertFree(t),this._emitter=new b(this),this._origin=t,W.set(t,this),G.add(this)}getOrigin(){return this._origin}setOrigin(t){t!==this._origin&&(e._assertFree(t),this._released||(W.delete(this._origin),W.set(t,this)),this._origin=t,this._emitter.notify(`onOriginChange`))}release(){this._released||(this._released=!0,W.get(this._origin)===this&&W.delete(this._origin),G.delete(this))}addListeners(e,t){return this._emitter.addListeners(e,t)}static _assertFree(e){if(W.has(e))throw Error(`This origin already backs an open workbook; an origin backs one workbook at a time.`)}},St=class{constructor(){this._defaultStringSourceType=`filepath`}async read(e){let t=e.options??{},r=e.source;if(typeof r==`function`&&(r=r()),r&&typeof r==`object`&&typeof r.then==`function`&&(r=await Promise.resolve(r)),r==null&&(r=await this.resolveSource(e),r==null))return null;let i=r,a=await this.fileFromHandle(r);a&&(r=a);let o=t.format,s=this._detectSourceType(r);if(!s)throw Error(`Unable to detect source type from provided input.`);let c,l,u=!1;if(s===`filepath`){let e=typeof r==`string`&&r.startsWith(`file://`)?r.slice(7):r;r=await this.filePathToFile(e),s=`file`,u=!0}switch(s){case`file`:{let e=r,n=e?.name,i=n?`${N(n)}`:``;c=await e.arrayBuffer(),l={format:o,ext:R(n),name:i,absolutePath:n,size:e.size,lastModified:e.lastModified,canWrite:!t.asCopy&&(!!a||u&&this._canWriteLocalPath())};break}case`blob`:{let e=r;c=await e.arrayBuffer(),l={format:o,size:e.size};break}case`base64`:{let e;if(r&&typeof r==`object`&&`base64`in r)e=r.base64;else if(typeof r==`string`&&r.startsWith(`data:`)){let[,t]=r.split(`,`);e=t}else e=r;c=n.base64ToArrayBuffer(e),l={format:o,size:e.length};break}case`fetch`:{let e,t,n;if(typeof r==`string`)e=r;else{if(!r||typeof r!=`object`||!(`input`in r))throw Error(`Invalid fetch source provided.`);{let i=r;e=i.input,t=i.init,n=i.timeout}}let i=n||3e4,a=new AbortController,s=setTimeout(()=>a.abort(),i),u=typeof e==`string`?e:e.toString(),d=R(u);try{let n=await fetch(e,{...t,signal:a.signal});if(clearTimeout(s),!n.ok)throw Error(`Failed to fetch: ${n.status} ${n.statusText}`);let r=await n.arrayBuffer();if(!r)throw Error(`Unable to fetched content: ${u}`);c=r,l={format:o,ext:d,name:N(u,!0),absolutePath:u}}catch(e){throw clearTimeout(s),e.name===`AbortError`?Error(`Fetch timeout after ${i}ms: ${u}`):e}break}case`buffer`:c=r,l={format:o};break;case`stream`:{let e=r.getReader(),t=[],n=0;try{for(;;){let{done:r,value:i}=await e.read();if(r)break;t.push(i),n+=i.length}}finally{e.releaseLock()}let i=new ArrayBuffer(n),a=new Uint8Array(i),s=0;for(let e of t)a.set(e,s),s+=e.length;c=i,l={format:o};break}default:throw Error(`Unsupported source type: ${s}`)}l.canWrite&&await this.findOpenOrigin(i,l)&&(l.canWrite=!1);let d=await e.decode(c,{sourceType:s,...l});return d?(await this.onWorkbookRead(d,i),d):null}async findOpenOrigin(e,t){return t.absolutePath?this.findOpenPath(t.absolutePath):null}findOpenPath(e,t){return bt().find(n=>{if(n===t||!n.canWrite())return!1;let r=n.getPath();return!!r&&this.isSamePath(r,e)})??null}isSamePath(e,t){return e===t}async fileFromHandle(e){return null}async resolveSource(e){return null}async onWorkbookRead(e,t){}_canWriteLocalPath(){return!1}_detectSourceType(e){if(e&&typeof e==`object`&&`base64`in e)return`base64`;if(e&&typeof e==`object`&&`input`in e)return`fetch`;if(typeof e==`string`){if(e.startsWith(`data:`))return`base64`;if(e.startsWith(`http://`)||e.startsWith(`https://`))return`fetch`;if(e.startsWith(`file://`))return`filepath`;let t=this._defaultStringSourceType;return e.startsWith(`./`)||e.startsWith(`../`)||e.startsWith(`/`)||/^[a-zA-Z]:[/\\]/.test(e),t}if(typeof File<`u`&&e instanceof File)return`file`;if(typeof Blob<`u`&&e instanceof Blob)return`blob`;let t=e instanceof ArrayBuffer||Object.prototype.toString.call(e)===`[object ArrayBuffer]`,r=ArrayBuffer.isView(e),i=n.isNodeBuffer(e);return t||r||i?`buffer`:typeof ReadableStream<`u`&&e instanceof ReadableStream||Object.prototype.toString.call(e)===`[object ReadableStream]`||e&&typeof e.getReader==`function`&&e.locked!==void 0?`stream`:null}},Ct=class extends St{constructor(e,t){super(),this._getWriteFormats=e,this._getReadFormats=t,this._defaultStringSourceType=`fetch`,this._handleCache=new WeakMap}async fileFromHandle(e){return K(e)?e.getFile():null}async resolveSource(){let e=await this._getReadFormats?.()??[];if(typeof globalThis.showOpenFilePicker==`function`)try{let t=function(e){let t=wt(e);if(t.length<=1)return t;let n=new Set,r={};for(let e of t)for(let[t,i]of Object.entries(e.accept))for(let e of i)n.has(e)||(n.add(e),(r[t]??=[]).push(e));return[{description:`All Supported`,accept:r},...t]}(e),[n]=await globalThis.showOpenFilePicker(t.length?{types:t}:void 0);return n}catch(e){if(e?.name===`AbortError`)return null;throw e}let n=e.flatMap(e=>e.exts.map(e=>`.`+e)).join(`, `);return t.openFileDialog(n)}async findOpenOrigin(e){return K(e)?this._findOpenHandle(e):null}async _findOpenHandle(e,t){for(let n of bt()){if(n===t||!n.canWrite())continue;let r=this._handleCache.get(n);if(r&&typeof r.isSameEntry==`function`&&await r.isSameEntry(e))return n}return null}async onWorkbookRead(e,t){if(!K(t))return;let n=e.getOrigin?.();n?.canWrite()&&this._handleCache.set(n,t)}async filePathToFile(e){throw Error(`Cannot read local file path '${e}' in browser environment. Use a file input element or fetch for remote URLs.`)}async write(e){let{origin:t,suggestedName:n,format:r,encode:i,prompt:a}=e,o=[r,...(await this._getWriteFormats()).filter(e=>e.key!==r.key)],s=typeof globalThis.showSaveFilePicker==`function`,c=!a&&t.canWrite()?this._handleCache.get(t):void 0;if(s)try{if(c){let e=await async function(e){try{if(typeof e.queryPermission!=`function`)return`granted`;let t={mode:`readwrite`};return await e.queryPermission(t)===`granted`||await e.requestPermission(t)===`granted`?`granted`:`denied`}catch{return`unavailable`}}(c);if(e===`denied`)return null;e!==`granted`&&(c=void 0)}let a=!!c;if(!a){c=await globalThis.showSaveFilePicker({suggestedName:n,types:wt(o)});let t=await this._findOpenHandle(c,e.workbook?.getOrigin?.());if(t)throw new h(_(`error.io.openElsewhere`,{name:t.getName()??c.name??``}))}let s=Et(c.name??n),l=o.find(e=>e.exts.some(e=>e.toLowerCase()===s))??r,u=a?t:new U(c.name??n,{format:l.key,canWrite:!0}),d=await i(l.key,u);if(!d)return null;let f=new Blob([Tt(d)],{type:l.mimeType||`application/octet-stream`}),p=await c.createWritable();if(await p.write(f),await p.close(),this._handleCache.set(u,c),u instanceof U){let e=await Promise.resolve(c.getFile?.()).then(e=>e?.lastModified??null,()=>null);u.update({size:f.size,lastModified:e})}return u}catch(e){if(e?.name===`AbortError`)return null;if(e instanceof h)throw e}let l=t.getPath(),u=l?l.split(/[/\\]/).pop():null,d=u&&r.exts.some(e=>e.toLowerCase()===Et(u))?u:n,f=l!==d||t.canWrite()?new U(d,{format:r.key,canWrite:!1}):t,p=await i(r.key,f);if(!p)return null;let m=new Blob([Tt(p)],{type:r.mimeType||`application/octet-stream`});return function(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.style.display=`none`,r.href=n,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)}(m,d),f instanceof U&&f.update({size:m.size}),f}};function wt(e){return e.map(e=>{let t=e.mimeType&&e.mimeType.includes(`/`)?e.mimeType:`application/octet-stream`;return{description:e.description??e.key,accept:{[t]:e.exts.map(e=>`.`+e)}}})}function K(e){return!!e&&e.kind===`file`&&typeof e.getFile==`function`}function Tt(e){if(typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer){let t=new ArrayBuffer(e.byteLength);return new Uint8Array(t).set(new Uint8Array(e)),t}return e}function Et(e){let t=e.lastIndexOf(`.`);return t>=0?e.slice(t+1).toLowerCase():``}(vt||={}).SortOn={Value:`value`,FillColor:`fillColor`,FontColor:`fontColor`,Icon:`icon`};var Dt={TopLeft:`tl`,Top:`t`,TopRight:`tr`,Left:`l`,Center:`ctr`,Right:`r`,BottomLeft:`bl`,Bottom:`b`,BottomRight:`br`},q=ce.BuiltInName;q.Normal,a(`style.builtin.normal`),q.Comma,a(`style.builtin.comma`),q.Currency,a(`style.builtin.currency`),q.Percent,a(`style.builtin.percent`),q.Comma0,a(`style.builtin.comma0`),q.Currency0,a(`style.builtin.currency0`),q.Hyperlink,a(`style.builtin.hyperlink`),q.FollowedHyperlink,a(`style.builtin.followedHyperlink`),q.Note,a(`style.builtin.note`),q.WarningText,a(`style.builtin.warningText`),q.Title,a(`style.builtin.title`),q.Input,a(`style.builtin.input`),q.Output,a(`style.builtin.output`),q.Calculation,a(`style.builtin.calculation`),q.CheckCell,a(`style.builtin.checkCell`),q.LinkedCell,a(`style.builtin.linkedCell`),q.Total,a(`style.builtin.total`),q.Good,a(`style.builtin.good`),q.Bad,a(`style.builtin.bad`),q.Neutral,a(`style.builtin.neutral`),q.ExplanatoryText,a(`style.builtin.explanatoryText`),a(`style.builtin.heading`),a(`style.builtin.accent`),a(`style.builtin.accentTint`);var Ot,kt,At,jt,Mt=(e,t,n,r,i)=>{let a=JSON.parse(JSON.stringify(e.definition));a.adjs||=[];let o=``,s=0,c=0;t>0?(c=t,s=100-t,o=_(`op.lighterPercent`,{percent:t})):t<0&&(s=100+t,o=_(`op.darkerPercent`,{percent:-t})),s&&a.adjs.push({[le.AdjustmentType.LumMod]:s}),c&&a.adjs.push({[le.AdjustmentType.LumOff]:c});let l=new ee({val:a.val,adjs:a.adjs},n),u=l.toString();r?.set(u,l);let d=l.toRGBA().toString();return i?.set(d,l),{description:e.description+`, `+o,definition:a}};function Nt(e,t,n,r){let i=[];for(let a=0;a<e.length;a++){let o=[];i.push(o);let s=i=>{for(let s=0;s<i.length;s++)o.push(Mt(e[a],i[s],t,n,r))},c=new ee({val:e[a].definition.val,adjs:e[a].definition.adjs},t).toHSLA().lum;s(c===0?[50,35,25,15,5]:c===100?[-5,-15,-25,-35,-50]:c<=20?[90,75,50,25,10]:c>=80?[-10,-25,-50,-75,-90]:[80,60,40,-25,-50])}return i}(Ot||={}).buildPalette=Nt,kt||={},At||={},jt||={};var Pt;function Ft(e){return Ee.peek()?.readFormulaLiteral(e)}function It(e,t){let n=Lt(e),r=Lt(t);return n===r?e===t?0:typeof e==`number`&&typeof t==`number`?e<t?-1:1:typeof e==`string`&&typeof t==`string`?e<t?-1:+(e>t):typeof e==`boolean`?e?1:-1:A.isError(e)&&A.isError(t)?e.getCode()-t.getCode():0:n-r}function Lt(e){if(e===null)return 0;switch(typeof e){case`number`:return 1;case`string`:return 2;case`boolean`:return 3;default:return A.isError(e)?4:5}}(function(e){function t(e){return Ee.peek()?.getFunctionDeclaration(e)??null}e.get=t,e.has=function(e){return t(e)!==null}})(Pt||={});var Rt=class{constructor(e){this._children=e}getCoords(){let e=this._children,t=null;for(let n=0;n<e.length;n++){let r=e[n].getCoords();r&&(t=t?{rowStart:Math.min(t.rowStart,r.rowStart),colStart:Math.min(t.colStart,r.colStart),rowEnd:Math.max(t.rowEnd,r.rowEnd),colEnd:Math.max(t.colEnd,r.colEnd)}:r)}return t}getSize(){let e=this._children,t=e.length,n=0;for(let r=0;r<t;r++)n+=e[r].getSize();return n}getCount(){let e=this._children,t=e.length,n=0;for(let r=0;r<t;r++)n+=e[r].getCount();return n}getAggregates(e){if(e)return this._mergeAggregates(e);let t=this._aggregates;return t||(t=this._mergeAggregates(),this._aggregates=t),t}getSnappedSum(e){let t=e??this.getAggregates().sum??0,n=this._children;for(let e=n.length-1;e>=0;e--)if(n[e].getAggregates().numericalCount>0)return n[e].getSnappedSum(t);return t}getSortedNumbers(){let e=this._sortedNumbers;if(!e){let t=this._children,n=t.length,r=[];for(let e=0;e<n;e++){let n=t[e].getSortedNumbers().getValues();n.length>0&&r.push(n)}e=new Ue(function(e){let t=e.length;if(t===0)return zt;if(t===1)return e[0];let n=e[0];for(let r=1;r<t;r++)n=Bt(n,e[r]);return Object.freeze(n)}(r)),this._sortedNumbers=e}return e}getRanked(e){return lt(this._children,e,It)[Symbol.iterator]()}getFrequencies(e){if(e)return this._mergeFrequencies(e);let t=this._frequencies;return t||(t=this._mergeFrequencies(),this._frequencies=t),t}_mergeFrequencies(e){let t=e?.keyFn??rt,n=e?.limit,r=new Map,i=this._children,a=i.length,o=0,s=0,c=!1;for(let l=0;l<a;l++){let a=i[l].getFrequencies(e);o+=a.getVisitedCount(),s+=a.getTotalCount(),c||=a.isTruncated();let u=a.getValueCounts(),d=u.next();for(;!d.done;){let[e,i]=d.value,a=t(e),o=r.get(a);o?o.count+=i:n===void 0||r.size<n?r.set(a,{value:e,count:i}):c=!0,d=u.next()}}return pe.fromGroups(r,t,e,It,o,s,c)}getTypedCounts(e){let t=this._typedCounts;if(!t){let e={[j.Number]:0,[j.String]:0,[j.Boolean]:0,[j.Error]:0,[j.RichData]:0,[j.Null]:0},n=this._children,r=n.length;for(let t=0;t<r;t++){let r=n[t].getTypedCounts();e[j.Number]+=r[j.Number]??0,e[j.String]+=r[j.String]??0,e[j.Boolean]+=r[j.Boolean]??0,e[j.Error]+=r[j.Error]??0,e[j.RichData]+=r[j.RichData]??0,e[j.Null]+=r[j.Null]??0}t=Object.freeze(e),this._typedCounts=t}if(e===void 0)return t;let n={},r=e.length;for(let i=0;i<r;i++)n[e[i]]=t[e[i]]??0;return n}get isIRangeStats(){return!0}_mergeAggregates(e){let t=this._children,n=t.length,r={count:0,min:void 0,max:void 0,numericalCount:0,sum:0,sumSq:0,typed:{[j.Number]:0,[j.String]:0,[j.Boolean]:0,[j.Error]:0,[j.RichData]:0,[j.Null]:0}};for(let i=0;i<n;i++){let n=t[i].getAggregates(e);r.count+=n.count;let a=n.numericalCount;a<=0||(r.numericalCount+=a,r.sum+=n.sum,r.sumSq+=n.varP*a+n.sum*n.sum/a,(r.min===void 0||n.min<r.min)&&(r.min=n.min),(r.max===void 0||n.max>r.max)&&(r.max=n.max))}return Fe(r)}},zt=Object.freeze([]);function Bt(e,t){let n=e.length,r=t.length,i=Array(n+r),a=0,o=0,s=0;for(;a<n&&o<r;)i[s++]=e[a]<=t[o]?e[a++]:t[o++];for(;a<n;)i[s++]=e[a++];for(;o<r;)i[s++]=t[o++];return i}var J,Y=class e{constructor(e,t){this._source=null,this._fresh=new WeakSet,this._unwatch=null,this.cacheId=e,this._store=t,this._fresh.add(t.get())}static dataOf(t,n){let r=e.modelOf(t);return{part:M.fromJSON(t.part,n),model:r,partFormats:!r&&t.partFormats?t.partFormats:null,source:!r&&t.source?t.source:null}}static modelOf(e){if(!e.fields)return null;let{cacheId:t,part:n,partFormats:r,...i}=e;return i}get part(){return this._store.get().part}get _model(){return this._store.get().model}_getData(){return this._store.get()}_replace(e){let t={part:null,model:e,partFormats:null,source:null};this._store.set(t),this._fresh.add(t)}_restate(e){let t=this._fresh.has(this._store.get()),n={part:null,model:e,partFormats:null,source:null};this._store.set(n),t&&this._fresh.add(n)}_hold(e,t){if(this._source)return;let{ref:n,sheet:r,name:i}=this._sourceAsRead()??{},a=null,o=null;if(n&&r&&!n.includes(`#REF!`)?(a=e(r),o=`${Qe(r)}!${ge(n)}`):!i||n||r?i&&r&&!n&&(a=e(r),o=`${Qe(r)}!${i}`):(a=t(i),o=`${i}[#All]`),!a||!o)return;let s={formula:null,wired:null,last:null};this._source=s,a(o,e=>{s.formula=e.formula;let t=e.formula.getExpression();s.wired??=t,e.formula.hasRefError()||(s.last=t)})}_sourceAsRead(){let e=this._model?.source??this._store.get().source;return e?{ref:e.ref??null,sheet:e.sheet??null,name:e.name??null}:null}_watchSource(e,t,n){if(this._unwatch)return;let{ref:r,sheet:i,name:a}=this._sourceAsRead()??{},o=null,s=null;if(r&&i&&!r.includes(`#REF!`)?s=e(i,r):a&&!r&&(o=i?null:t(a),s=o?.getRange()??n(a,i??null)),!s||s.isInvalid())return;let c=e=>`${e.getRowCount()}x${e.getColumnCount()}`,l=c(s),u=[],d=()=>{this._fresh=new WeakSet},f=e=>{let t=l;return l=c(e),l!==t};u.push(s.addListener(e=>{if(e.getTrigger()===`data`)return void(e.getCommit()!==null&&d());let t=e.getSource();(t.isInvalid()||f(t))&&d()},{transactional:!1})),o&&u.push(s.getWorksheet().addListeners({onTablesChange:()=>{!o.isDeleted()&&f(o.getRange())&&d()}})),this._unwatch=()=>{this._unwatch=null;for(let e of u)e()}}_isStale(){return!this._fresh.has(this._store.get())}_moved(){let e=this._source;if(!e?.formula)return null;let t=e.formula.hasRefError()?e.last:e.formula.getExpression();if(t===null||t===e.wired)return null;let n=this._sourceAsRead();if(n?.name&&n.sheet){let e=P(t)?.sheet;return e?{sheet:e}:null}let r=/^(.+)\[#All\]$/.exec(t)?.[1];if(r)return{name:r};let i=P(t);return i?{name:null,ref:Xe(i.reference),sheet:i.sheet}:{ref:Xe(t)}}_getSource(){let e=this._sourceAsRead();if(!e)return null;let t={};e.ref&&(t.ref=e.ref),e.sheet&&(t.sheet=e.sheet),e.name&&(t.name=e.name);let n=this._moved();if(n)for(let e of[`ref`,`sheet`,`name`]){let r=n[e];r===null?delete t[e]:r!==void 0&&(t[e]=r)}return t}toJSON(e){let t={cacheId:this.cacheId},n=M.toJSON(this.part,e);if(n){t.part=n;let e=this._store.get().partFormats;e&&(t.partFormats=e)}let r=this._model;r&&Object.assign(t,r);let i=this._getSource();return i&&(t.source=i),t}},Vt=class{constructor(e,t){this._deleted=!1,this._json={...e},this._deleteFromCollection=t??null}getId(){return this._json.id}getDisplayName(){return this._json.displayName}getUserId(){return this._json.userId??null}getProviderId(){return this._json.providerId??null}delete(){this._deleted||(this._deleted=!0,this._deleteFromCollection?.(this))}isDeleted(){return this._deleted}toJSON(){return{...this._json}}get[Symbol.toStringTag](){return`[Person]`}toString(){return`Person:${this.getDisplayName()}`}get isIPerson(){return!0}},Ht=class extends Pe{constructor(e){super(),this._byId=new Map,this._byDisplayName=new Map,this._items=null,this._current=null,e&&this.fromJSON(e)}_getItems(){return this._items??=Array.from(this._byId.values())}getCount(){return this._byId.size}add(e){let t=typeof e==`string`?{displayName:e}:e,n=t.id;if(n){let e=this._byId.get(n);if(e)return e}let i=t.displayName??``;if(!n){let e=this._byDisplayName.get(i);if(e)return e}let a=new Vt({...t,displayName:i,id:n??r.uuidV4().toUpperCase()},e=>this._remove(e));return this._byId.set(a.getId(),a),i&&!this._byDisplayName.has(i)&&this._byDisplayName.set(i,a),this._items=null,this._notifyCollectionChange(),a}getById(e){return typeof e==`string`?this._byId.get(e)??null:null}getByDisplayName(e){return typeof e==`string`?this._byDisplayName.get(e)??null:null}getCurrent(){return this._current??=this.add(`Author`)}setCurrent(e){if(e!==null){if(typeof e==`object`&&e.isIPerson){let t=e;this._current=this.getById(t.getId())??this.add(t.toJSON());return}this._current=this.add(e)}else this._current=null}_remove(e){this._byId.get(e.getId())===e&&(this._byId.delete(e.getId()),this._byDisplayName.get(e.getDisplayName())===e&&this._byDisplayName.delete(e.getDisplayName()),this._current===e&&(this._current=null),this._items=null,this._notifyCollectionChange())}toJSON(){return this._byId.size===0?null:this._getItems().map(e=>e.toJSON())}fromJSON(e){if(!e)return;let t=e.length;for(let n=0;n<t;n++){let t=e[n];t&&typeof t.id==`string`&&this.add(t)}}get isIPersonCollection(){return!0}},Ut=(e,t)=>{let n=[0];for(let t=0;t<e.length;t++)e[t]===`
|
|
3
|
+
`&&n.push(t+1);let r=t.map(e=>` ${(e=>{let t=0,r=n.length-1;for(;t<r;){let i=t+r+1>>1;n[i]<=e?t=i:r=i-1}return`${t+1}:${e-n[t]+1}`})(e.start)} ${e.code}: ${e.message}`),i=t.length;return`Script has ${i} compile error${i===1?``:`s`}:\n${r.join(`
|
|
4
|
+
`)}`},Wt=class{constructor(e){this._options=e,this._emitter=new b(this),this._initState()}_initState(){}getModules(){return this._modules}_builtInNames(){try{let e=this._options.getBuiltInFunctions?.();if(!e)return r.EmptyArray;let t=[];for(let n of e.getItems({includeHidden:!0}))n.isBuiltIn()&&t.push(n.getName());return t}catch{return r.EmptyArray}}async createModule(t){let n=await(await e(async()=>{let{ScriptCompiler:e}=await import(`./qFyplGXRu7IepHio.js`);return{ScriptCompiler:e}},__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)).ScriptCompiler.compile({builtInNames:this._builtInNames(),minify:!0,...t});return n.module?await V(Oe.DEFAULT_MODULE,n.module,t?.declarationsOnly??!1,n.diagnostics):null}addModule(e,t,n){this._modules.add(e,t,n)}async addModuleFromJSON(e,t,n){let r=await V(e,t);return this.addModule(e,r,n),r}async executeMacro(e,t,n){await H.assertUsable(`scripts`);let r=this._modules.getItems({name:t}),i=r.length;for(let t=0;t<i;t++){let i=r[t].getFunctions().getByName(e);if(i)return i.execute(this._options.workbook,{applyResult:!0,...n})}throw Error(`No macro ${e} found.`)}async run(e,t){try{await H.assertUsable(`scripts`);let n=typeof e==`string`?await this.createModule({source:e}):await V(Oe.DEFAULT_MODULE,e),r=typeof e==`string`?e:e?.source??``;return await this._runModule(n,r,t)}catch(e){return{ok:!1,error:e}}}async _runModule(e,t,n){let r=this._options?.workbook;if(!e)return{ok:!1,error:Error(`The script did not compile to a module.`)};let i=e.getDiagnostics(),a=i.filter(e=>e.severity===`error`);if(a.length>0){let e=Error(Ut(t,a));return e.diagnostics=a,{ok:!1,error:e,diagnostics:i}}let o=e.getFunctions(),s=o.getItems({type:`autoRun`,includeHidden:!0})[0]??o.getItems({type:`macro`,includeHidden:!0})[0]??null;if(!s)return{ok:!1,error:Error("The script has no runnable entry. Export a default function taking the script context, e.g. `export default function run(ctx: IScript.ScriptContext) { ... }` (the workbook is `ctx.wb`; a macro may instead take its target first, e.g. `(sheet: IWorksheet, ctx)`).")};let c=await s.execute(r,n);return{ok:!0,result:c?.results,commitId:c?.commitId,diagnostics:i}}_searchable(e){let t=this._modules;return t&&t.getCount()!==0?(e?t.getItems({name:e}):t.getItems()).map(e=>e.getFunctions()):r.EmptyArray}async searchFunctions(e){await this._emitter.notify(`onBeforeSearch`,{async:!0});let t=this._searchable(e?.moduleName);if(t.length===0)return r.EmptyArray;if(t.length===1)return t[0].search(e);let n=e?.limit,i=n===void 0?e:{...e,limit:void 0},a,o=new Set;for(let e=0;e<t.length;e++){let n=await t[e].search(i);if(n.length!==0){a||=[];for(let e=0;e<n.length;e++){let t=n[e],r=t.getName().toUpperCase();o.has(r)||(o.add(r),a.push(t))}}}if(!a||a.length===0)return r.EmptyArray;let s=e?.text?e.text.trim().toUpperCase():null;return s?at(a,s):a.sort((e,t)=>{let n=e.getName().toUpperCase(),r=t.getName().toUpperCase();return n<r?-1:+(n>r)}),n!==void 0&&a.length>n?a.slice(0,n):a}async start(){return this._startPromise||(this._startPromise=this._doStart(),this._startPromise.catch(()=>{this._startPromise=void 0})),this._startPromise}_load(){return this._loadPromise||(this._loadPromise=this._doLoad(),this._loadPromise.catch(()=>{this._loadPromise=void 0})),this._loadPromise}async _doStart(){await this._load();let e=this._options?.workbook,t=this._modules.getItems(),n=t.length;for(let r=0;r<n;r++){let n=t[r];try{let t=n.getFunctions().getItems({type:`autoRun`,includeHidden:!0}),r=t.length;for(let n=0;n<r;n++)await t[n].execute(e)}catch(e){m.error(`Error executing autoRun script:`,e)}}}async _doLoad(){let e=this._options?.workbook,t=this._options?.json,n={};if(t){let r=Object.keys(t);for(let i=0;i<r.length;i++){let a=r[i],o=t[a];try{n[a]=await V(a,o,!1,[],o?.scope===`workbook`?e:null)}catch(e){m.error(`Could not load script '${a}'; it will be unavailable.`,e)}}}let r=this,i=new ct({transactions:this._options?.transactions,initial:n,isReadOnly:()=>r.isReadOnly(),onRemove:(e,t)=>{r._options?.onRemove?.(e,t)},onAdd:(e,t)=>{r._emitter.notify(`onChange`),r._options?.onAdd?.(e,t)}});this._modules=i}addListeners(e,t){return this._emitter.addListeners(e,t)}isReadOnly(){return this._options.workbook?._isStructureProtected?.()??!1}toJSON(){this._emitter.notify(`onBeforeSave`);let e=this._modules;if(!e)throw Error(`Scripts is initializing.`);return e.toJSON()}get isIScript(){return!0}},Gt=/^([a-z][a-z0-9+.-]*):/i,Kt=e=>{let t=e.toLowerCase();return t.endsWith(`:`)?t:t+`:`},qt=async(e,t)=>{try{return await globalThis.fetch(e,t)}catch(n){throw n instanceof TypeError&&await(async(e,t)=>{let n=globalThis.location;if(!n||t?.method&&t.method.toUpperCase()!==`GET`)return!1;let r=new AbortController,i=setTimeout(()=>r.abort(),5e3);try{return new URL(e,n.href).origin!==n.origin&&(await globalThis.fetch(e,{mode:`no-cors`,credentials:`omit`,signal:r.signal}),!0)}catch{return!1}finally{clearTimeout(i),r.abort()}})(e,t)?new A.Blocked(`This site is restricted: it doesn't allow web apps to read its data, so the browser blocked the request for security.`,{cause:n}):n}},Jt=class{constructor(){this._handlers=new Map([[`http:`,qt],[`https:`,qt]])}fetch(e,t){let n=Gt.exec(e)?.[1],r=this._handlers.get(n?Kt(n):`https:`);if(!r)return Promise.reject(TypeError(`No fetcher serves '${n}:'.`));try{return r(e,t)}catch(e){return Promise.reject(e)}}register(e,t){let n=Kt(e),r=this._handlers.get(n);return this._handlers.set(n,t),()=>{this._handlers.get(n)===t&&(r?this._handlers.set(n,r):this._handlers.delete(n))}}get isIFetcher(){return!0}},Yt=new Set([101,103,204,205,304]),X=e=>new Response(Yt.has(e.status)?null:e.body,{status:e.status,statusText:e.statusText,headers:e.headers}),Xt=class{constructor(e,t){this._kept=new Map,this._cached=new Map,this._inFlight=new Map,this._resources=e,this._fetcher=t}getFetcher(){return this._fetcher}async fetch(e,t){if((e=>!e||(!e.method||e.method.toUpperCase()===`GET`)&&!e.body)(t)&&t?.cache!==`reload`){let n=this._kept.get(e)??this._findHeld(e);if(n&&!n.isClosed())return this._fromKept(n);let r=this._cached.get(e);if(r)return X(r);let i=this._inFlight.get(e);return i||(i=this._request(e,{...t,signal:void 0}).finally(()=>{this._inFlight.delete(e)}),this._inFlight.set(e,i)),X(await((e,t)=>t?t.aborted?Promise.reject(t.reason):new Promise((n,r)=>{let i=()=>r(t.reason);t.addEventListener(`abort`,i,{once:!0}),e.then(n,r).finally(()=>t.removeEventListener(`abort`,i))}):e)(i,t?.signal))}return X(await this._request(e,t))}adopt(e){for(let t of e){let e=t.getFetchedFrom();e&&!t.isClosed()&&this.keep(e,t)}}keep(e,t){let n=this._kept.get(e);n!==t&&(t.addReference(this),this._kept.set(e,t),n&&!n.isClosed()&&n.deleteReference(this))}_findHeld(e){for(let t of this._resources.getItems())if(t.getFetchedFrom()===e&&!t.isClosed())return this.keep(e,t),t;return null}async _fromKept(e){let[t,n]=await Promise.all([e.toBuffer(),e.getType()]);return X({status:200,statusText:`OK`,headers:n?[[`content-type`,n.mime]]:[],body:t})}async _request(e,t){let n=await this._fetcher.fetch(e,t),r=Yt.has(n.status)?null:await n.arrayBuffer(),i=[];n.headers.forEach((e,t)=>{i.push([t,e])});let a={status:n.status,statusText:n.statusText,headers:i,body:r};if(n.ok&&r&&r.byteLength>0){let t=await new De({source:{buffer:r}}).getType();t?.mime.startsWith(`image/`)?(a.headers=i.filter(([e])=>e.toLowerCase()!==`content-type`),a.headers.push([`content-type`,t.mime])):this._cached.set(e,a)}return a}},Zt=class{constructor(e,t,n,r){this._mergedReading=[],this._colsReading=[],this._rowsReading=[],this._styles=n,this._topLeft=t??o.EmptyCell,this._sheet=new z({runtime:e,styles:this._styles,calcOnLoad:`none`,container:{getName:()=>r,getIndex:()=>1}}),this._builder=this._sheet.getEntireRange().createSparseBuilder()}applyCSSStyle(e,t){let n=!1;e.style||(e.style={},n=!0);let r=e.style,i={...t};if(t.msoIgnore){let e=t.msoIgnore.split(`,`),n=Object.keys(i);for(let t=0;t<n.length;t++){let r=n[t];e.includes(r)&&delete i[r]}}let a=oe(i.fontFamily);r.font={},a&&(r.font.family=a.family,r.font.fallbacks=a.fallbacks,r.font.size=a.size),r.font.size=i.fontSize,r.font.weight=i.fontWeight,r.font.style=i.fontStyle,r.font.color=i.color;let o=w(i.textDecoration);r.font.underline=o.underline,r.font.strike=o.strike?S.StrikeStyle.Single:S.StrikeStyle.None,i.textUnderlineStyle&&(r.font.underline=ae(i.textUnderlineStyle)),r.alignment={},i?.textAlign&&(r.alignment.horizontal=te(i.textAlign)),i?.textAlign&&!r.alignment.horizontal&&i?.textAlign!==`general`&&(i.textAlign===`center-across`?r.alignment.horizontal=O.HorizontalAlignment.CenterContinuous:i.textAlign===`fill`?r.alignment.horizontal=O.HorizontalAlignment.Fill:i.textAlign===`121`||i.textAlign===`010`?(r.alignment.horizontal=O.HorizontalAlignment.Distributed,r.alignment.justifyLastLine=i.textAlign===`121`):console.warn(`unknown text-align`,i.textAlign)),i.verticalAlign&&(i.verticalAlign.toLowerCase()===`super`?r.font.baseline=E.Baseline.Superscript:i.verticalAlign.toLowerCase()===`sub`?r.font.baseline=E.Baseline.Subscript:r.alignment.vertical=re(i.verticalAlign),r.alignment.vertical||(i.verticalAlign===`121`?r.alignment.vertical=O.VerticalAlignment.Distributed:console.warn(`unknown vertical-align`,i.verticalAlign))),i.msoCharIndentCount&&(r.alignment.indent=i.msoCharIndentCount),i.whiteSpace&&(r.alignment.overflow=i.whiteSpace===`no-wrap`||i.whiteSpace===`nowrap`?O.Overflow.Visible:O.Overflow.Wrap),i.msoTextControl===`shrinktofit`&&(r.alignment.overflow=O.Overflow.Shrink);let s=null;if(i.background?s=i.background:i.backgroundColor&&(s=i.backgroundColor),s&&(r.fill={color:s}),i.msoPattern){let e=ue(i.msoPattern);e&&(e.patternType===T.BuiltInSheetPattern.Solid?r.fill={color:e.foreground}:e.patternType!==T.BuiltInSheetPattern.None&&(s&&(e.background=s),r.fill=e))}i.layoutFlow===`vertical`||i.layoutFlow===`vertical-ideographic`?r.alignment.stacked=!0:i.msoRotate!==void 0&&(r.alignment.rotation=se(i.msoRotate));let c=(e,t)=>{e&&(r.borders||={},r.borders[e]=t)};i.border&&i.border!==`none`&&(c(`top`,i.border),c(`left`,i.border),c(`right`,i.border),c(`bottom`,i.border)),i.borderTop&&c(`top`,i.borderTop),i.borderLeft&&c(`left`,i.borderLeft),i.borderRight&&c(`right`,i.borderRight),i.borderBottom&&c(`bottom`,i.borderBottom),i.msoDiagonalUp&&c(`diagonalUp`,i.msoDiagonalUp),i.msoDiagonalDown&&c(`diagonalDown`,i.msoDiagonalDown);let l=r.numberFormat;i.msoNumberFormat&&(l=C(i.msoNumberFormat),l.includes(`\\`)?l=null:l===`Fixed`?l=D.Styles.lookupStyle(r.numberFormat).formatType===D.Type.Number?null:D.Type.Number:l===`Percent`&&(l=D.Styles.lookupStyle(r.numberFormat).formatType===D.Type.Percentage?null:D.Type.Percentage)),l&&(r.numberFormat=l),e.style=this._styles.normalize(r),n&&Object.keys(e.style).length===0&&delete e.style}onCell(e,t,n,r,i){let a=r(i),s={value:t===void 0?n??``:t};if(typeof s.value==`string`&&s.value.length===0&&(s.value=void 0),a&&this.applyCSSStyle(s,a),typeof s.value==`string`&&/^#+$/.test(s.value)){let e=s.style?.numberFormat;e&&(ne(e)||ie(e))&&(s.value=A.BuiltIn.Num)}if(i?.tagName.toUpperCase()===`TD`){let e=s.style,t=e?.font??{};(i.querySelectorAll(`s`).length>0||i.querySelectorAll(`strike`).length>0)&&(t.strike=S.StrikeStyle.Single),i.querySelectorAll(`sub`).length>0&&(t.baseline=E.Baseline.Subscript),i.querySelectorAll(`sup`).length>0&&(t.baseline=E.Baseline.Superscript),(i.querySelectorAll(`b`).length>0||i.querySelectorAll(`strong`).length>0)&&(t.weight=700),i.querySelectorAll(`i`).length>0&&(t.style=S.Style.Italic),i.querySelectorAll(`u`).length>0&&(t.underline=S.UnderlineStyle.Single),Object.keys(t).length>0&&(e||(e={},s.style=e),e.font||(e.font=t));let n=i.querySelectorAll(`a`);if(n.length>0){let e=n[0].getAttribute(`href`);e&&(s.hyperlink=e)}}if(!o.isSingleCell(e)){let t={rowStart:this._topLeft.rowIndex+e.rowStart,colStart:this._topLeft.colIndex+e.colStart,rowEnd:this._topLeft.rowIndex+e.rowEnd,colEnd:this._topLeft.colIndex+e.colEnd};this._mergedReading.push(t)}if(s.value===void 0&&!s.style&&Object.keys(s).length<=1)return;let c=this._builder,l=this._topLeft;if(c.pushAt(l.rowIndex+e.rowStart,l.colIndex+e.colStart,s),!o.isSingleCell(e)&&a.msoIgnore){if(a.msoIgnore.includes(`colspan`)){let t={};a&&this.applyCSSStyle(t,a);let n=e.colEnd-e.colStart,r=l.rowIndex+e.rowStart;for(let i=1;i<=n;i++)c.pushAt(r,l.colIndex+e.colStart+i,t);e={...e,colEnd:e.colStart}}a.msoIgnore.includes(`rowspan`)&&(e={...e,rowEnd:e.rowStart})}}onNoTable(e,t,n){this.onCell({rowStart:this._topLeft.rowIndex,colStart:this._topLeft.colIndex,rowEnd:this._topLeft.rowIndex,colEnd:this._topLeft.colIndex},e,null,t,n)}onRowStart(e,t,n,r){let i=n(r);if(i.msoHeightSource!==`userset`||!r)return;let a=r.getAttribute(`height`)??i.height,o=null;if(a&&(o=k(a,this._styles.getNormal().getFont().getSize(),`px`)),o===null)for(let e=0;e<r.cells.length;e++){let t=r.cells[e],i=t.getAttribute(`height`)??n(t).height,a=k(i,this._styles.getNormal().getFont().getSize(),`px`);a!==null&&(o=Math.max(a,o??0))}o!==null&&this._rowsReading.push({address:{min:this._topLeft.rowIndex+e,max:this._topLeft.rowIndex+e+t-1},update:{size:o*S.getDeviceScale()}})}onColumn(e,t,n,r){let i=n(r);if(i.msoWidthSource!==`userset`||!r)return;let a=r.getAttribute(`width`)??i.width,o=null;a&&(o=k(a,this._styles.getNormal().getFont().getSize(),`px`)),o!==null&&this._colsReading.push({address:{min:this._topLeft.colIndex+e,max:this._topLeft.colIndex+e+t-1},update:{size:o*S.getDeviceScale()}})}onDone(){this._colsReading.length>0&&this._sheet.getColumnHeaders().updateHeaderPairs(this._colsReading),this._rowsReading.length>0&&this._sheet.getRowHeaders().updateHeaderPairs(this._rowsReading),this._sheet.doBatch(()=>{this._builder.apply()}),this._mergedReading.length>0&&this._sheet.getRanges(this._mergedReading).merge()}sheet(){return this._sheet}},Qt=class{constructor(e){if(!e)throw new s(`snapshot is required.`);this._snapshot=e}getItemType(){return`range`}getItem(){return this._snapshot}editMode(){return this._snapshot?.getMarkOptions().editMode??null}isCut(){return this._snapshot?.getMarkOptions().isCut??!1}getName(){return this._snapshot.getName()}toText(){return this._snapshot.toText()}toHtml(){return this._snapshot.toHtml()}toImage(){return this._snapshot.toImage()}get isClipboardItem(){return!0}},$t=class{constructor(e,t,n,r,i){if(this._parsed=void 0,this._runtime=e,!t)throw new s(`nativeItems are required.`);this._topLeft=n??o.EmptyCell,this._native=t,this._markOptions=Object.freeze(r??{}),this._styles=i}getItemType(){return`range`}isCut(){return!1}toText(){return this._native?.text}toHtml(){return this._native?.html?.documentElement.outerHTML||null}toImage(){return this._native?.image}getItem(){let e=this._parsed;if(e===void 0)throw Error(`Must call 'parse()' before getItem().`);if(e===null)return null;if(this._snapshot)return this._snapshot;let t=this;return this._snapshot={prepare:(n,r)=>e.prepare?.(n,{...t._markOptions,...r}),copyTo:(n,r)=>e.copyTo(n,{...t._markOptions,...r}),getMarkOptions:()=>t._markOptions,getName:()=>e?.getName()??`Clipboard Data`,getCoords:()=>e?.getCoords?.()??null,toText:()=>t.toText(),toHtml:()=>t.toHtml(),toImage:()=>t.toImage(),getSource:()=>e?.getSource?.()??null,isISnapshot:!0},this._snapshot}async parse(){let e,t=this._native?.text,n=this._native.html;if(n===null&&t&&t.includes(`<table`))try{let e=new DOMParser().parseFromString(t,p.Html),r=e.querySelector(`parsererror`);if(r)throw new h(`Unable to parse: `+r);n=e,t=null}catch{console.warn(`Discovered text as html table but could could not parse.`)}try{let r=new Zt(this._runtime,this._topLeft,this._styles,n?`HTML`:`Text`),i=await Promise.resolve(t?Ye(t):[[]]),a;if(ve(n,i,r)?(e=r.sheet(),a=e.getUsedRange()):n=null,a){let t=a.getSnapshot();return this._parsed={prepare:(e,n)=>t.prepare?.(e,n),copyTo:(e,n)=>t.copyTo(e,n),getCoords:()=>a.getCoords(),getSource:()=>e,getName:()=>e.getName()},!0}}catch(e){throw e}if(!t&&!n&&this._native.image){let e=await this._native.image.arrayBuffer(),t=i.getPngStatedSize(e),n=null;return this._parsed={async prepare(r){let i=r.getWorksheet();n={sheet:i,options:await i.getMovables()._preparePicture({source:{buffer:e}},{type:`picture`,description:a(`op.copyImageFromClipboard`),autoSelect:!0,...t&&{bounds:t}})}},copyTo(e,t){let r=e.getWorksheet();if(n?.sheet!==r)throw Error(`The image was not prepared for this sheet.`);return r.getMovables()._insertNow(n.options),null},getName:()=>`Image`},!0}return this._parsed=null,!1}get isClipboardItem(){return!0}},en=class{constructor(e){this._closed=!1,this._kind=e.kind,this._id=e.id,this._part=e.part,this._styles=e.styles,this._tabColor=e.tabColor?this._styles.parseColor(e.tabColor):null,this._transactions=e.transactions,this._workbook=e.workbook??null,this._container=e.container,this._emitter=new b(this,this._transactions)}getKind(){return this._kind}getId(){return this._id}getName(){return this._container.getName()}setName(e,t){return this._assertOpen(),this._container.setName(e,t),this}getVisibility(){return this._closed?F.Visibility.VeryHidden:this._container.getVisibility()}setVisibility(e=!0,t){let n;return this._assertOpen(),n=!0===e?F.Visibility.Visible:!1===e?F.Visibility.Hidden:e,this._container.setVisibility(n,t),this}getIndex(){return this._container.getIndex()}setIndex(e,t){return this._assertOpen(),this._container.setIndex(e,t),this}getTabColor(){return this._tabColor}setTabColor(e){return this._assertOpen(),this._tabColor=typeof e==`string`?this._styles.parseColor(e):e??null,this._notify(`onTabColorChange`),this}getWorkbook(){return this._workbook}async select(e){return await this._container.requestSelect(e),this}delete(){if(this._closed)return;let e=this._transactions.beginCommit({description:_(`op.deleteSheet`,{name:this.getName()})});try{try{this._notify(`onBeforeDelete`)}catch(e){throw e instanceof Error?e:new h(e?.message??_(`error.sheet.modelDelete`))}this._notify(`onDelete`),e.commit()}catch(t){throw e.rollback(),t}}isDeleted(){return!this._container.isAttached()}addListeners(e,t){return this._emitter.addListeners(e,t)}close(){this._closed||=(this._notify(`onClose`),this._emitter.close(),!0)}isClosed(){return this._closed}_getPart(){return this._part}_notify(e){this._emitter.notify(e)}_assertOpen(){if(this._closed)throw Error(_(`error.sheet.modelClosed`))}get[Symbol.toStringTag](){return`[OpaqueSheet]`}toString(){return`[${this.getName()??`(untitled)`}]`}get isISheet(){return!0}get isIOpaqueSheet(){return!0}};(J||={}).Visibility={Visible:`visible`,Hidden:`hidden`,VeryHidden:`veryHidden`};var Z,tn={showFormulaBar:!0,showTabs:!0,tabRatio:600,showHorizontalScrollbar:!0,showVerticalScrollbar:!0,showStatusBar:!0,activeSheetId:0,firstTab:0,windowBounds:null,minimized:!1,visibility:J.Visibility.Visible,autoFilterDateGrouping:!0},nn=class{constructor(e){this._id=r.uuidV4(),this._emitter=new b(this),this._state={...tn},e?.json&&this._fromJSON(e?.json)}getId(){return this._id}isShowFormulaBar(){return this._state.showFormulaBar}setShowFormulaBar(e){return this._state.showFormulaBar=e,this._emitter.notify(`onViewChange`),this}isShowTabs(){return this._state.showTabs}setShowTabs(e){return this._state.showTabs=e,this._emitter.notify(`onViewChange`),this}getTabRatio(){return this._state.tabRatio}setTabRatio(e){return this._state.tabRatio=e,this._emitter.notify(`onViewChange`),this}isShowHorizontalScrollbar(){return this._state.showHorizontalScrollbar}setShowHorizontalScrollbar(e){return this._state.showHorizontalScrollbar=e,this._emitter.notify(`onViewChange`),this}isShowVerticalScrollbar(){return this._state.showVerticalScrollbar}setShowVerticalScrollbar(e){return this._state.showVerticalScrollbar=e,this._emitter.notify(`onViewChange`),this}isShowStatusBar(){return this._state.showStatusBar}setShowStatusBar(e){return this._state.showStatusBar=e,this._emitter.notify(`onViewChange`),this}getActiveSheetId(){return this._state.activeSheetId}setActiveSheetId(e){let t=this._state,n=t.activeSheetId;return t.activeSheetId=e,n!==e&&this._emitter.notify(`onViewChange`),this}getFirstTab(){return this._state.firstTab}setFirstTab(e){return this._set(`firstTab`,Math.max(0,Math.trunc(e)))}getWindowBounds(){return this._state.windowBounds}setWindowBounds(e){return this._set(`windowBounds`,e?Object.freeze({...e}):null)}isMinimized(){return this._state.minimized}setMinimized(e){return this._set(`minimized`,e)}getVisibility(){return this._state.visibility}setVisibility(e){return this._set(`visibility`,e)}isAutoFilterDateGrouping(){return this._state.autoFilterDateGrouping}setAutoFilterDateGrouping(e){return this._set(`autoFilterDateGrouping`,e)}_set(e,t){return this._state[e]===t||(this._state[e]=t,this._emitter.notify(`onViewChange`)),this}addListeners(e,t){return this._emitter.addListeners(e,t)}toJSON(){let e={},t=Object.keys(this._state),n=t.length;for(let r=0;r<n;r++){let n=t[r],i=this._state[n];i!=null&&i!==tn[n]&&(e[n]=i)}return Object.keys(e).length===0&&(e=null),e}_fromJSON(e,t=!0){let n=e||{};this.update(n,t)}update(e,t=!0){this._state={...tn,...this._state,...e},t&&this._emitter.notify(`onViewChange`)}get[Symbol.toStringTag](){return`[WorkbookView]`}toString(){let e=this.toJSON();return e?JSON.stringify(e):`DefaultWorkbookView`}get isIWorkbookView(){return!0}},rn=Object.freeze({structure:!1,windows:!1,revision:!0,password:null,revisionsPassword:null}),an=class extends ke{isWindowsAllowed(){return this._isPropertyAllowed(`windows`)}isRevisionAllowed(){return this.isLocked()&&this._properties?.revision===void 0?!this._isReadOnly:this._isPropertyAllowed(`revision`)}isStructureAllowed(){return this._isPropertyAllowed(`structure`)}_getAllowedKey(){return`workbook`}_fromJSON(e){this._properties=e}_toJSON(e){let t=this._properties;if(t){let n=Object.keys(t),r=n.length;for(let i=0;i<r;i++){let r=n[i],a=t[r];a!=null&&a!==rn[r]&&(e[r]=a)}}return super._toJSON(e)}get[Symbol.toStringTag](){return`[WorkbookProtection]`}get isIWorkbookProtection(){return!0}};(Z||={}).Type={Number:`number`,Boolean:`boolean`,Date:`date`,String:`string`,Float:`float`};var on=e=>{if(typeof e==`string`)return{type:Z.Type.String,value:e};if(typeof e==`boolean`)return{type:Z.Type.Boolean,value:e};if(typeof e==`number`){if(!Number.isFinite(e))throw Error(`A custom property value must be a finite number.`);return{type:Number.isInteger(e)&&e>=-2147483648&&e<=2147483647?Z.Type.Number:Z.Type.Float,value:e}}if(e instanceof Date){if(isNaN(e.getTime()))throw Error(`A custom property value must be a valid date.`);return{type:Z.Type.Date,value:e.toISOString()}}throw Error(`A custom property value must be a string, number, boolean or Date.`)},sn=class{constructor(e,t){this._json=e,this._owner=t}getKey(){return this._json.key}getType(){return this._json.type}getLinkTarget(){return this._json.linkTarget??null}getValue(){let{type:e,value:t}=this._json;return e===Z.Type.Date?new Date(t):t}setValue(e){this._owner._assertCustomEditable(this),this._json={...this._json,...on(e)}}delete(){this._owner._removeCustom(this)}toJSON(){return{...this._json}}},cn=class{constructor(e){this._json={},this._custom=[],this._assertOpen=e}_text(e){return this._json[e]??null}_setText(e,t){return this._assertOpen(),t==null||t===``?delete this._json[e]:this._json[e]=t,this}getAuthor(){return this._text(`author`)}setAuthor(e){return this._setText(`author`,e)}getCategory(){return this._text(`category`)}setCategory(e){return this._setText(`category`,e)}getComments(){return this._text(`comments`)}setComments(e){return this._setText(`comments`,e)}getCompany(){return this._text(`company`)}setCompany(e){return this._setText(`company`,e)}getContentStatus(){return this._text(`contentStatus`)}setContentStatus(e){return this._setText(`contentStatus`,e)}getCreationDate(){let e=this._json.creationDate;if(!e)return null;let t=new Date(e);return isNaN(t.getTime())?null:t}getKeywords(){return this._text(`keywords`)}setKeywords(e){return this._setText(`keywords`,e)}getLastAuthor(){return this._json.lastAuthor??null}getManager(){return this._text(`manager`)}setManager(e){return this._setText(`manager`,e)}getRevisionNumber(){return this._json.revisionNumber??null}setRevisionNumber(e){return this._assertOpen(),e!=null&&Number.isFinite(e)?this._json.revisionNumber=e:delete this._json.revisionNumber,this}getSubject(){return this._text(`subject`)}setSubject(e){return this._setText(`subject`,e)}getTitle(){return this._text(`title`)}setTitle(e){return this._setText(`title`,e)}getCustom(){return this._custom.slice()}getCustomProperty(e){let t=e.toLowerCase();return this._custom.find(e=>e.getKey().toLowerCase()===t)}addCustomProperty(e,t){if(this._assertOpen(),typeof e!=`string`||e===``)throw Error(`A custom property needs a name.`);let n=this.getCustomProperty(e);if(n)return n.setValue(t),n;let r=new sn({key:e,...on(t)},this);return this._custom.push(r),r}deleteAllCustomProperties(){this._assertOpen(),this._custom=[]}_assertCustomEditable(e){if(this._assertOpen(),!this._custom.includes(e))throw Error(`The custom property has been deleted.`)}_removeCustom(e){this._assertCustomEditable(e),this._custom=this._custom.filter(t=>t!==e)}fromJSON(e){let{custom:t,...n}=e??{};this._json=n,this._custom=(t??[]).map(e=>new sn({...e},this))}toJSON(){let e={...this._json};return this._custom.length>0&&(e.custom=this._custom.map(e=>e.toJSON())),e}};function ln(e){return _(`error.workbook.invalidSheetKey`,{key:e})}function un(e){return _(`error.workbook.sheetNameNotFound`,{sheetName:e})}function dn(e,t){return _(t===`chart`?`error.workbook.sheetIsChart`:t===`macro`?`error.workbook.sheetIsMacro`:`error.workbook.sheetIsDialog`,{sheetName:e})}function fn(e,t){return t===`chart`?_(`error.workbook.selectedIsChart`,{sheetName:e}):t===`macro`?_(`error.workbook.selectedIsMacro`,{sheetName:e}):t===`dialog`?_(`error.workbook.selectedIsDialog`,{sheetName:e}):_(`error.workbook.noWorksheet`)}var pn=class extends Pe{constructor(e,t,n,r){super(),this._add=e,this._get=t,this._addListeners=n,this._getSelected=r}getActive(){return this._getSelected()}getAt(e){return this.getItems()[e]??null}getByIndex(e){return this.getItems()[e]??null}getAll(){return this.getItems()}add(e){return this._add(e)}_getItems(e){return this._get(e?.name,e?.visibility)}getByName(e){return this._get(e)?.[0]??null}addListeners(e,t){return this._addListeners(e,t)}get isIWorksheetCollection(){return!0}},mn=new RegExp(/[\\/\\*?:[\]]+/),hn=new RegExp(/\(((\d+)(?!.*\d))\)$/,`g`);function gn(e){let t=_(a(`workbook.defaultSheetName`),{n:e+1});return t===`workbook.defaultSheetName`?`Sheet${e+1}`:t}function _n(e,t){return{...Ce,getWorksheet:()=>null,toString:()=>I(e,t)}}function vn(e,t=!1){if(!e)throw Error(_(`error.workbook.sheetNameBlank`));if(mn.test(e)){if(!t)throw Error(function(e){return e?_(`error.workbook.sheetNameInvalidCharsNamed`,{sheetName:e}):_(`error.workbook.sheetNameInvalidChars`)}(e));e=e.replace(mn,``)}if(e.length===0)throw Error(_(`error.workbook.sheetNameBlank`));let n=e.length;if(n>31){if(!t)throw Error(_(`error.workbook.sheetNameTooLong`));e=e.substring(0,31)}if(e.charAt(0)===`'`||e.charAt(n-1)===`'`){if(!t)throw Error(_(`error.workbook.sheetNameQuotes`));e=e.replace(/^'|'$/g,``)}return e}var yn=`workbook.activeSheet`,bn=class e extends Me{constructor(e,t,n,r){super(e,t,r),this._workbook=n}getSource(){return this._workbook}_createRanges(t,n){let r=this._options;return n&&(r={...this._options,getOptions:B(this._options?.getOptions,n)}),new e(t,this._internal,this._workbook,r)}_createRange(e,t){let n=e?{...e}:null,r=this._workbook,i=n?r._getSheetRef(n.scope,F.Visibility.VeryHidden):null;if(i&&!i.sheet.isIWorksheet)throw new h(dn(i.name,i.sheet.getKind()));if(!i){let e=r._anchorWorksheet();return delete n?.scope,_n(n,n?{scope:Ne,...e.getEntireRange().getCoords()}:null)}let a=this._options;return t&&(a={...this._options,getOptions:B(this._options.getOptions,t)}),new xn(e,L(i.sheet),this._workbook,a)}async select(e){let t=[],n=null,r=this.getCoords();for(let e=0;e<r.length;e++){let i=r[e];i&&(n||=i.scope,i&&i.scope===n&&t.push(i))}n||=this._workbook.getWorksheet().getName();let i=this._workbook.getWorksheets().getByName(n);if(!i)return;let a=await i.getRanges(t).select(e),o=this._workbook._rangesAddressToCoords(a.getCoords());return this._createRanges(o)}addListener(e,t){if(!this.getCoords())return()=>{};let n=this._workbook._sheetToWBEvent(e);return super.addListener(n,t)}get[Symbol.toStringTag](){return`[WorkbookRanges]`}getAddress(e){let t=this._internal.getSheet(),n=t.getEntireRange().getCoords();return Se(this.getCoords(),{...n,scope:t.getName()},I,he,e)}toString(){return this.getAddress()}},xn=class e extends de{constructor(e,t,n,r){super(e,t,r),this._workbook=n}_createRanges(e,t){let n=this._options;return t&&(n={...this._options,getOptions:B(this._options?.getOptions,t)}),new bn(e,this._internal,this._workbook,n)}_createRange(t,n){let r=this._internal;if(!t)return ze(r.getSheet(),r.getSheet().getEntireCoords());if(r.validateCoords(t),r.getSheet().isClosed())return ze(null,r.getSheet().getEntireCoords(),t);let i=this._options;return n&&(i={...this._options,getOptions:B(this._options?.getOptions,n)}),new e(t,this._internal,this._workbook,i)}addListener(e,t){if(!this.getCoords())return()=>{};let n=this._workbook._sheetToWBEvent(e);return super.addListener(n,t)}get[Symbol.toStringTag](){return`[WorkbookRange]`}getAddress(e){let t=this._internal.getSheet(),n=t?.getEntireRange().getCoords()??null;return I(this.getCoords(),{...n,scope:t.getName()})}toString(){return this.getAddress()}},Sn=e=>!!e&&typeof e==`object`&&typeof e.getOrigin==`function`,Cn=class{constructor(t){this._isLoadingSheets=!1,this._lastTransactionUUID=null,this._starting=null,this._closed=!1,this._listenerOriginProvider=null,this._listenerOrigin=null,this._lastOriginName=null,this._initializing=!0,this._pivotCaches=[],this._pivotTableCollection=new et(()=>{let e=[];for(let t of this.getWorksheets().getItems({visibility:F.Visibility.VeryHidden}))e.push(...t.getPivotTables());return e},(e,t)=>this.doBatch(e,t)),this._people=new Ht,this._commentCollection=new Ie(null,(e,t,n)=>{let r=[];for(let i of this.getWorksheets().getItems({visibility:F.Visibility.VeryHidden}))r.push(...i.getComments().getItems(e?{address:e,ignoreHidden:t,fullyContained:n}:{ignoreHidden:t,fullyContained:n}));return r},(e,t)=>this.addListeners({onSheetsChange:e.onCollectionChange?()=>{e.onCollectionChange(this._commentCollection)}:void 0},t)),this._isDate1904=!1,this._codeName=null,this._updateLinks=null,this._hiddenPivotFieldList=!1,this._documentProperties=new cn(()=>{if(this._closed)throw Error(_(`error.workbook.modelClosed`))}),this._locale=null,this._localeOverrides=null,this._startModules=new WeakSet;let n=typeof t==`string`?{origin:t}:{...t},i=n.origin;this._ownOriginProvider=!Sn(i),this._originProvider=Sn(i)?i:new xt(typeof i==`string`?new U(null,{name:i}):i??new U(null)),delete n.origin,this._bindOrigin(this._originProvider.getOrigin()),this._listenerOriginProvider=this._originProvider.addListeners({onOriginChange:()=>this._onOriginChange()});let o=n.json;delete n.json,this._transactions=n.transactions??new x,this._id=this._transactions.create(),this._ownTransactions=!n.transactions,this._emitter=new b(this,this._transactions),this._runtime=n.runtime??new _e(`Workbook Runtime`,{isDate1904:()=>this._isDate1904,getNow:()=>this._transactions.getCurrentCommit().getTimestamp(),getLocale:()=>this._locale??me()??tt(),getLocaleOverrides:()=>this._localeOverrides}),this._listenerLanguage=g.addChangeListener(()=>{this._closed||this._notifyAllChange()});let s=this,c=this._beginCommit({description:a(o?`op.openWorkbook`:`op.newWorkbook`)});try{this._strings=n.strings??new be,this._ownStrings=!n.strings,this._richValues=n.richData??new dt,this._resources=n.resources??new He,this._ownResources=!n.resources,this._fetch=new Xt(this._resources,n.fetcher??new Jt),this._createSheetName=n.createSheetNameCallback??gn;let t=n.createWorksheetCallback;t||=e=>new z(e),this._sheetOnNameChange=new Map,this._sheetOnVisibilityChange=new Map,this._sheetOnIndexChange=new Map,this._createSheet=(e,n,r,i,a,o,c)=>{let l=null,u={runtime:s._runtime,readonly:s._options.readonly??!1,disableLoadAutoFit:s._options.disableLoadAutoFit??!1,opener:s._options.opener,transactions:s._transactions,styles:s._styles,strings:s._strings,richData:s._richValues,resources:s._resources,names:s._names,workbook:s,calculation:s._calculation,resolveRange:e=>s._options.resolveRange?.(e)??s.getRange(e),container:{beforeFromJSON:t=>{l=t,s._addSheetRef({name:n,id:e,visibility:r??F.Visibility.Visible,sheetId:a,sheet:t},i)},getName:()=>{let e=s._getSheetRef(l);return e?e.name:n},setName:(e,t)=>{s._getSheetRef(l)&&s._setSheetName(l,e,t)},setNameChangeCallback:t=>{s._sheetOnNameChange.set(e,t)},getVisibility:()=>{let e=s._getSheetRef(l);return e?e.visibility:F.Visibility.Visible},setVisibility:(e,t)=>{s._setSheetVisibility(l,e,t)},setVisibilityCallback:t=>{s._sheetOnVisibilityChange.set(e,t)},duplicate:()=>s._duplicateSheet(l),getIndex:()=>{let e=s._getSheetRef(l);return e?s._getOffsetForId(e.id,s._getSheetRefs(F.Visibility.VeryHidden)):i},setIndex:(e,t)=>{let n=s._getSheetRef(l,F.Visibility.VeryHidden);return!!n&&(s._moveSheet(n,e,t),!0)},setIndexCallback:t=>{s._sheetOnIndexChange.set(e,t)},requestSelect:()=>s._requestSelect(l)}};return o&&(u.json=o),c!==void 0&&(u.uid=()=>c),l=t(u,n,i,r),l},this._namedTableSource=new We({getSheets:()=>s._sheets?s.getWorksheets().getItems({visibility:F.Visibility.VeryHidden}):r.EmptyArray,addSheetsListener:(e,t)=>s.addListeners({onSheetsChange:e},t)}),this._names=n.names??new ot({addressToRanges:e=>s.getRanges(e),getCurrentScope:()=>s.getSelectedWorksheet()?.getName()??null,isReadOnly:()=>(s._options.readonly??!1)||s._isStructureProtected(),transactions:s._transactions,getSources:()=>s._calculation?[s._calculation.getNamedFormulas(),s._namedTableSource]:r.EmptyArray}),this._ownNames=!n.names,this._calculation=n.calculation??new Ge({runtime:s._runtime,functions:n.functions,json:o?.calc,isNamesReadOnly:()=>s._isStructureProtected(),getActiveCell:()=>{let e=s.getSelectedWorksheet(),t=e?.getSelectedRange()?.getCoords();return e&&t?{rowIndex:t.rowStart,colIndex:t.colStart,scope:e.getId()}:null},getRange:s.getRange.bind(s),getRanges:s.getRanges.bind(s),createGraphRanges:(e,t)=>s._createGraphRanges(e,t),getSheetIndex:e=>{if(e===void 0){let e=s.getSelectedSheet();return e?this._getSheetRefs(F.Visibility.VeryHidden).findIndex(t=>t.sheet===e):-1}let t=this._getSheetRefs(F.Visibility.VeryHidden);e=e.toLowerCase();let n=t.length;for(let r=0;r<n;r++)if(t[r].name.toLowerCase()===e)return r;try{wn.address=e;let t=this._names.getItems(wn);if(!t||t.length===0)return-1;let n=t[0].getRanges?.()?.getCoords()?.[0]?.scope;if(!n)return-1;let r=this._getSheetRefs(F.Visibility.VeryHidden);n=n.toLowerCase();let i=r.length;for(let e=0;e<i;e++)if(r[e].name.toLowerCase()===n)return e}catch{return-1}return-1},getSheetCount:()=>s._getSheetRefs(F.Visibility.VeryHidden).length,externalBooks:o?.externalBooks,externalBookResolver:n.externalBookResolver,namedCollection:s._names,strings:s._strings,get resources(){return s._resources},fetch:(e,t)=>s._fetch.fetch(e,t),parseText:(t,n)=>(async(t,n,r)=>{let i=await e(()=>import(`./CnPgk3HcIziOcskY.js`).then(e=>v(e.default,1)),__vite__mapDeps([7,8]),import.meta.url),a=(i.default??i).parse(n,{delimiter:r?.delimiter??`,`,skipEmptyLines:!1}).data,o=a.length,s=a[o-1];s&&s.length===1&&s[0]===``&&o--;let c=0;for(let e=0;e<o;e++)a[e].length>c&&(c=a[e].length);let l=Array(o);for(let e=0;e<o;e++){let n=a[e],r=Array(c);for(let e=0;e<c;e++){let i=n[e];r[e]=i===void 0||i===``?null:je(t,i).value}l[e]=r}return l})(s._runtime,t,n),startFunctions:()=>s._startFunctions(),transactions:s._transactions,names:o?.names}),this._ownCalculation=!n.calculation,this._scripts=this._createScripts(o?.modules),this._ownNames=!n.names,this._options=Object.freeze({...n});let i=o?.sheets?.length?o.sheets.map(e=>e.name):[this._createSheetName(0)],a=i.map(e=>e+`-`+r.uuidV4()),l=e=>{let t=o?.sheets?.[e]?.kind;return!!t&&t!==F.Kind.Worksheet};this._calculation._setSheets(i.map((e,t)=>l(t)?[a[t],e,!0]:[a[t],e]));let u=n.calcOnLoad??`auto`,d=!1,f=(async()=>{try{if(this._ownCalculation&&u!==`none`&&(u===`full`||u===`auto`&&!0===o?.calc?.fullCalcOnLoad?await this._calculation._calculateForLoad():await this._calculation.start(),this._closed||(await this._refreshPivotCachesOnLoad(),this._closed)))return;await this._scripts.start()}finally{d=!0,this._starting=null}})();d||(this._starting=f),this._starting?.catch(()=>{}),o?this._fromJSON(o,a):(this._initState(),this._addSheet(!1,i[0],null,a[0])),this._sheets=new pn(e=>s._addSheetOptions(e),(e,t)=>{if(e){let n=this._getSheetRef(e,t);return n&&Q(n)?[n.sheet]:r.EmptyArray}return this._getWorksheets(t)},(e,t)=>{let n=e.onCollectionChange,r=e.onInvalidated;return s._emitter.addListeners({onSheetsChange:n?()=>{n(s._sheets)}:void 0,onInvalidated:r?()=>{r(s._sheets)}:void 0},t)},()=>s.getSelectedWorksheet()),this._ownCalculation&&(n.calcOnLoad??`auto`)!==`none`&&(this._calculation.hydrateNames(),this._holdPivotCaches()),this._emitter.notify(`onLoad`),this._ownTransactions?c.amend():c.commit()}catch(e){throw c.rollback(),e}this._initializing=!1}_initState(){let e=this._getSheetRefs();for(let t=(e?e.length:0)-1;t>=0;t--);let t=this._options;this._isDate1904=t.runtime?.isDate1904()??!1,this._locale=null,this._localeOverrides=null,this._theme=t.theme??new it().getDefaultTheme(),this._styles=t?.styles??new fe(this._theme),this._ownStyles=!t.styles,this._styles.getTheme()||this._styles.setTheme(this.getTheme()),this._activeSheetOffset=0,this.setView(new nn),this._listenerProtection?.(),this._protection=new an(void 0,this._options.readonly??!1),this._listenerProtection=this._protection.addListeners({onChange:e=>{n._emitter.notify(`onProtectionChange`)}});let n=this;this._transactionsRemoveListener=this._transactions.addStateListener(this._id,{async onAfterStateChange(e,t,r,i,a){let o=n._view,s=a?.[yn],c=r?s?.before:s?.after,l=s?.viewId===o.getId()&&c!=null,u=l?c:o.getActiveSheetId(),d=l&&t.getId()===n._lastTransactionUUID?n._getSheetRef({id:u}):null;d?await d.sheet.select():n._resyncActiveSheet(u,e),n._lastTransactionUUID=t.getId(),(r||i)&&n._emitter.notify(`onSheetsChange`),n._emitter.notify(`onSelectedSheetChange`),n._emitter.notify(`onViewChange`)},onRestoreOrRevert(){n._ownCalculation,n._emitter.notify(`onInvalidated`)}});let r=this._getState();r?.listenersSheets&&(r?.listenersSheets.forEach(e=>{e()}),r?.listenersSheets.clear()),this._updateState({sheetRefsAll:[],sheetRefsVisibleAndHidden:[],sheetRefsVisible:[],refsById:new Map,sheetsById:new Map,refsByLowerCaseName:new Map,sheetsByLowerCaseName:new Map,refsByInstance:new Map,lastId:-1,sheetsCreated:new Set,listenersSheets:new Map,pivotCacheData:new Map})}getId(){return this._id}getVersionId(){return this._transactions.getVersionId(this._id)}getName(){return this._closed?null:this._origin.getName()}getOrigin(){return this._originProvider.getOrigin()}_onOriginChange(){if(this._closed)return;let e=this._originProvider.getOrigin();if(e===this._origin)return;this._listenerOrigin?.();let t=this._lastOriginName;this._bindOrigin(e),this._emitter.notify(`onOriginChange`),this._lastOriginName!==t&&this._emitter.notify(`onNameChange`)}_bindOrigin(e){this._origin=e,this._lastOriginName=e.getName(),this._listenerOrigin=e.addListeners({onChange:()=>{if(this._closed)return;let t=e.getName();t!==this._lastOriginName&&(this._lastOriginName=t,this._emitter.notify(`onNameChange`))}})}getView(){return this._view}setView(e){if(this._closed)throw Error(_(`error.workbook.modelClosed`));if(!e)throw new h(_(`error.sheet.emptyView`));this._listenerWorkbookView?.();let t=this,n=-1;return this._listenerWorkbookView=e.addListeners({onViewChange:e=>{let r=t._getState(),i=this._view.getActiveSheetId(),a=r.sheetRefsVisible,o=this._getOffsetForId(i,a);this._activeSheetOffset=o,t._emitter.notify(`onViewChange`),n!==i&&(t._emitter.notify(`onSelectionChange`),t._emitter.notify(`onSelectedSheetChange`)),n=i}}),this._view=e,t._emitter.notify(`onViewChange`),this}getRuntime(){return this._runtime}setDate1904(e){if(this._closed)throw Error(_(`error.workbook.modelClosed`));return this._isDate1904===e||(this._isDate1904=e,this._emitter.notify(`onRegionalChange`)),this}getLocale(){return this._runtime.getLocale()}getPinnedLocale(){return this._locale}setLocale(e){if(this._closed)throw Error(_(`error.workbook.modelClosed`));if(e)try{new Intl.Locale(e)}catch{throw Error(_(`error.workbook.invalidLocale`,{locale:e}))}return this._locale===e||(this._locale=e,this._emitter.notify(`onRegionalChange`)),this}getLocaleOverrides(){return this._localeOverrides}setLocaleOverrides(e){if(this._closed)throw Error(_(`error.workbook.modelClosed`));let t=e&&Object.keys(e).length>0?e:null;return this._localeOverrides=t,this._emitter.notify(`onRegionalChange`),this}getStyles(){return this._styles}getResources(){return this._resources}getFetcher(){return this._fetch.getFetcher()}fetch(e,t){return this._fetch.fetch(e,t)}getTransactions(){return this._transactions}getChanges(e){let t=this._transactions,[n,r]=t.getLog(e??t.getCurrentCommit(!1).getId(),2),i=[],a=this.getWorksheets().getItems({visibility:F.Visibility.VeryHidden});for(let e=0;e<a.length;e++){let t=a[e];t instanceof z&&i.push(...t._changeEventsOf(n,r??null))}return i}getStrings(){return this._strings}getExternalBooks(){return this._calculation.getExternalBooks()}getUpdateLinks(){return this._updateLinks}setUpdateLinks(e){if(this._closed)throw Error(_(`error.workbook.modelClosed`));return this._updateLinks=e,this}getPivotTables(){return this._pivotTableCollection}getComments(){return this._commentCollection}getPeople(){return this._people}getTheme(){return this._theme}setTheme(e){if(this._closed)throw Error(_(`error.workbook.modelClosed`));if(!e)throw new h(_(`error.workbook.notSetValue`));let t=this._theme;return this._theme=e,this.getStyles().setTheme(e),this._emitter.notify(`onThemeChange`),t}getSelectedSheetIndex(){return this._activeSheetOffset}getSelectedSheet(){let e=this._getSheetRef(this.getSelectedSheetIndex());return e?e.sheet:null}getSelectedWorksheet(){let e=this._getSheetRef(this.getSelectedSheetIndex());return e&&Q(e)?e.sheet:null}getActiveSheet(){return this.getSelectedWorksheet()}getActiveWorksheet(){return this.getSelectedWorksheet()}getSheets(e){let t=this._getSheetRefs(e?.visibility??F.Visibility.Visible),n=Array(t.length);for(let e=0;e<t.length;e++)n[e]=t[e].sheet;return n}getSheet(e){if(e===void 0)return this.getSelectedSheet();if(!e)throw Error(_(`error.workbook.sheetNameNotProvided`));let t=this._getSheetRef(e);if(!t)throw new d(un(e));return t.sheet}getWorksheet(e,t=F.Visibility.Visible){if(typeof e==`number`)return this.getWorksheetAt(e,t);if(e===void 0)return this._requireSelectedWorksheet();if(!e)throw Error(_(`error.workbook.sheetNameNotProvided`));let n=this._getSheetRef(e,t);if(!n)throw new d(un(e));if(!Q(n))throw new d(dn(n.name,n.sheet.getKind()));return n.sheet}getWorksheetAt(e,t=F.Visibility.Visible){let n=this._getWorksheets(t)[e];if(!n)throw new d(function(e){return _(`error.workbook.sheetIndexNotFound`,{index:e})}(e));return n}_requireSelectedWorksheet(){let e=this.getSelectedWorksheet();if(e)return e;let t=this.getSelectedSheet();throw new h(fn(t?.getName()??``,t?.getKind()??F.Kind.Worksheet))}_anchorWorksheet(){return this.getSelectedWorksheet()||(this._getWorksheets(F.Visibility.VeryHidden)[0]??null)}getWorksheets(){return this._sheets}addWorksheet(e){return this.getWorksheets().add(e)}_getWorksheets(e=F.Visibility.Visible){let t=this._getSheetRefs(e),n=[],r=t.length;for(let e=0;e<r;e++){let r=t[e];Q(r)&&n.push(r.sheet)}return n}_getSheetRefs(e=F.Visibility.Visible){let t=this._getState();return t?e===F.Visibility.Visible?t.sheetRefsVisible:e===F.Visibility.Hidden?t.sheetRefsVisibleAndHidden:e===F.Visibility.VeryHidden?t.sheetRefsAll:r.EmptyArray:[]}_getSheetRef(e,t=F.Visibility.Visible){let n=null;return typeof e==`number`?this._getSheetRefs(t)[e]:(typeof e==`string`?n=this._getState().refsByLowerCaseName.get(e.toLowerCase()):!0===e?.isISheet?n=this._getState().refsByInstance.get(e):e?.id!==void 0&&(n=this._getState().refsById.get(e.id)),n)}_validateNewSheetName(e,t=!0){if(e==null)return e;if(vn(e),t&&this._getState().sheetsByLowerCaseName.has(e.toLowerCase()))throw new h(_(`error.workbook.nameTaken`));return e.substring(0,31)}findValidSheetName(e){e&&=vn(e,!0);try{return function(e,t){try{if(t(e))return e}catch{}let n,r,i=hn.exec(e);for(i===null?(n=e+` `,r=1):(n=e.substring(0,i.index),r=parseFloat(i[1]));r<256;){r++;let e=`(`+r+`)`,i=n.substring(0,31-e.length)+e;try{if(t(i))return i}catch{}}throw Error(e+` is not a valid sheet name`)}(e,e=>this._validateNewSheetName(e))}catch{return this._nextSheetName()}}isValidSheetNameCharacter(e){return!mn.test(e)}_isStructureProtected(){return!this._initializing&&!this.getProtection().isStructureAllowed()}_addSheetOptions(e){if(this._closed)throw Error(_(`error.workbook.modelClosed`));if(!this.getProtection().isStructureAllowed())throw new c(_(`error.workbook.protection`));let t,n=null;t=typeof e==`string`?{name:e}:typeof e==`number`?{index:e}:e,t={...t,description:t?.description??a(`op.addSheet`)};let r=this.beginCommit(t);try{let e=t?.autoSelect??!1;n=this._addSheet(!0,t.name,t.index??null);let i=this.getView().getActiveSheetId();if(e&&this._recordActiveSheet(r,i,this._getSheetRef(n).id),r.commit({description:_(`op.addSheetNamed`,{name:n.getName()})}),!1!==e){let t=typeof e==`boolean`?void 0:e;n.select(t)}}catch(e){throw r.rollback(),e}return n}_nextSheetName(e=null){let t=e?e.toLowerCase():null,n=this._getState(),r=n.sheetsByLowerCaseName;if(e&&r.has(t))throw new h(function(e){return _(`error.workbook.nameDuplicate`,{sheetName:e})}(e));t=(e=this._validateNewSheetName(e))?e.toLowerCase():null;let i=n.lastId+1;for(;!e;){let t=this._createSheetName(i),n=t.toLowerCase();r.has(n)?i++:e=t}return this._updateState({lastId:i}),e}_addSheet(e,t=null,n=null,r){t=this._nextSheetName(t);let i=this._getState(),a=this._createSheet(i.lastId,t,F.Visibility.Visible,n,void 0,null,r);if(!a)throw new h(_(`error.workbook.sheetNameBlank`));return e&&(this._tellSheets(),this._emitter.notify(`onSheetsChange`)),a}_createOpaqueSheet(e,t,n,i,a,o,s,c,l){let u=this,d=null;return d=new en({kind:o,id:l??t+`-`+r.uuidV4(),part:s,tabColor:c,styles:this._styles,transactions:this._transactions,workbook:this,container:{getName:()=>u._getSheetRef(d)?.name??t,setName:(e,t)=>{u._setSheetName(d,e,t)},getVisibility:()=>u._getSheetRef(d,F.Visibility.VeryHidden)?.visibility??F.Visibility.Visible,setVisibility:(e,t)=>{u._setSheetVisibility(d,e,t)},getIndex:()=>{let e=u._getSheetRef(d,F.Visibility.VeryHidden);return e?u._getOffsetForId(e.id,u._getSheetRefs(F.Visibility.VeryHidden)):-1},setIndex:(e,t)=>{let n=u._getSheetRef(d,F.Visibility.VeryHidden);n&&u._moveSheet(n,e,t)},requestSelect:()=>u._requestSelect(d),isAttached:()=>!!u._getSheetRef(d,F.Visibility.VeryHidden)}}),this._sheetOnNameChange.set(e,()=>d._notify(`onNameChange`)),this._sheetOnVisibilityChange.set(e,()=>d._notify(`onVisibilityChange`)),this._sheetOnIndexChange.set(e,()=>d._notify(`onIndexChange`)),this._addSheetRef({name:t,id:e,visibility:n??F.Visibility.Visible,sheetId:a,sheet:d},i),d}async _requestSelect(e){return this._setSelectedSheet(e),await this._emitter.notify(`onRequestSelect`,{source:this,params:e,async:!0}),this.getSelectedSheet()===e}_updateSheetRefStates(e){if(this._closed)throw Error(_(`error.workbook.modelClosed`));if(!this._initializing&&!this.getProtection().isStructureAllowed())throw new c(_(`error.workbook.protection`));let t=e,n=[],r=[],i=t.length;for(let e=0;e<i;e++)t[e].visibility===F.Visibility.Visible?(n.push(t[e]),r.push(t[e])):t[e].visibility===F.Visibility.Hidden&&r.push(t[e]);this._updateState({sheetRefsAll:t,sheetRefsVisible:n,sheetRefsVisibleAndHidden:r})}_tellSheets(){if(this._isLoadingSheets)return;let e=this._getState().sheetRefsAll;this._calculation._setSheets(e.map(e=>Q(e)?[e.sheet.getId(),e.name]:[e.sheet.getId(),e.name,!0]))}_addSheetRef(e,t=null){let n=this._getState(),r=n.sheetRefsAll,i=Math.max(0,Math.min(r.length,t??r.length)),a=[...r.slice(0,i),e,...r.slice(i)];this._updateSheetRefStates(a);let o=e.sheet,s=e.name.toLowerCase(),c=new Map(n.refsById);c.set(e.id,e);let l=new Map(n.refsByLowerCaseName);l.set(s,e);let u=new Map(n.refsByInstance);u.set(o,e);let d=new Map(n.sheetsById);d.set(e.id,o);let f=new Map(n.sheetsByLowerCaseName);f.set(s,o);let p=this,m=n.listenersSheets;if(o!==void 0){let t=o.addListeners({onBeforeDelete:e=>{p._validateDeleteSheet(e)},onDelete(e){let t=p._getSheetRef(e,F.Visibility.VeryHidden);if(!t)return;let n=p._beginCommit({description:_(`op.deleteSheet`,{name:t.name})});try{let r=p._getState(),i=r.sheetRefsAll,a=p._getOffsetForId(t.id,i),s=[...i];s.splice(a,1),p._updateSheetRefStates(s);let c=new Map(r.refsById);c.delete(t.id);let l=new Map(r.sheetsById);l.delete(t.id);let u=t.name.toLowerCase(),d=new Map(r.refsByLowerCaseName);d.delete(u);let f=new Map(r.sheetsByLowerCaseName);f.delete(u);let m=new Map(r.refsByInstance);m.delete(e),r.listenersSheets.get(t.id)();let h=new Map(r.listenersSheets);h.delete(t.id),p._adjustRemoveSelectionIfRequired(a,t.id),p._adjustSheetNamesIfRequired(),p._sheetOnNameChange.delete(t.id),p._sheetOnVisibilityChange.delete(t.id),p._sheetOnIndexChange.delete(t.id),p._tellSheets(),p._emitter.notify(`onSheetsChange`);let g=new Set(r.sheetsCreated);g.has(o)&&g.delete(o),p._updateState({refsById:c,sheetsById:l,refsByLowerCaseName:d,sheetsByLowerCaseName:f,refsByInstance:m,sheetsCreated:g,listenersSheets:h}),n.commit()}catch(e){throw n.rollback(),e}}},{transactional:!0}),r=Q(e)?e.sheet.addListeners({onSelectionChange:e=>{p.getView().getActiveSheetId()===p._getSheetRef(e)?.id&&p._emitter.notify(`onSelectionChange`,{source:p,params:e})}},{transactional:!1}):null;m=new Map(n.listenersSheets),m.set(e.id,()=>{t(),r?.()})}let h=n.lastId;h!==-1&&(h=Math.max(h,e.id)),this._updateState({lastId:h}),this._updateState({refsById:c,refsByLowerCaseName:l,refsByInstance:u,sheetsById:d,sheetsByLowerCaseName:f,listenersSheets:m}),this._adjustSheetNamesIfRequired();let g=new Set(this._getState().sheetsCreated);return g.add(e.sheet),this._updateState({sheetsCreated:g}),this._tellSheets(),e}_recordActiveSheet(e,t,n){let r=this.getView().getId();e.setIntent(yn,e=>({viewId:r,before:e?.before??t,after:n}))}_resyncActiveSheet(e,t){let n=t?.sheetRefsVisible;if(!n?.length)return;let r=-1,i=n.length;for(let t=0;t<i;t++)if(n[t].id===e){r=t;break}r===-1&&(r=Math.min(Math.max(this._activeSheetOffset,0),i-1));let a=n[r].id;this._view.getActiveSheetId()===a?this._activeSheetOffset=r:this._view.setActiveSheetId(a)}_adjustRemoveSelectionIfRequired(e,t){if(this._view.getActiveSheetId()===t){let t,n=this._getState().sheetRefsVisible;t=e<n.length?n[e].id:n[e-1].id,this._view.setActiveSheetId(t)}}_adjustSheetNamesIfRequired(){let e=this._getState(),t=e.lastId;if(t===-1)return;let n=this._view.getActiveSheetId();n??=(this._view.setActiveSheetId(t),t);let r=e.refsById.get(n);r||(this._view.setActiveSheetId(t),r=e.refsById.get(t),n=t),r.visibility===F.Visibility.Visible&&(this._activeSheetOffset=this._getOffsetForId(n,e.sheetRefsVisible))}_validateDeleteSheet(e){if(this._closed)throw Error(_(`error.workbook.modelClosed`));if(!this.getProtection().isStructureAllowed())throw new c(_(`error.workbook.protection`));let t=this._getSheetRef(e);if(!t)throw new h(function(e){return _(`error.workbook.deleteKey`,{key:e})}(e));let n=this._getState().sheetRefsVisible;if(n.length===1&&n[0].id===t.id)throw new h(_(`error.workbook.sheetOne`))}_getOffsetForId(e,t){let n=t.length;for(let r=0;r<n;r++)if(t[r].id===e)return r;throw new h(_(`error.workbook.noVisibleRefs`))}find(e){if(this._closed)throw Error(_(`error.workbook.modelClosed`));let t=this._getWorksheets();if(t.length===0)return{next:()=>Ve};if(t.length===1)return t[0].find(e);typeof e==`string`&&(e={text:e});let n=!e?.reverse,r=e?.disableWrap??!1,i=this._worksheetOffsetFrom(this.getSelectedSheetIndex(),t),a=i,s=t[a],c=!1;e={...e,disableWrap:!0};let l,u=s.find(e),d=u.next(),f=!1;if(e?.from){let t=this._rangesAddressToCoords(e?.from);l={colIndex:t[0].colStart,rowIndex:t[0].rowStart}}let p=o.createCellComparator(e?.axis,e?.reverse);delete(e={...e}).from;let m=()=>{if(!f&&d.done&&(c&&a===i?f=!0:n?(a++,a>t.length-1&&(a=0,c=!0)):(a--,a<0&&(a=t.length-1,c=!0)),r&&c&&(f=!0),f||l||!c||a!==i||(f=!0),!f)){s=t[a],u=s.find(e);let n=d;return d=u.next(),n}if(!f&&c&&a===i&&(d.done||!l||!d.done&&p(d.value.getCoords(),l)>=0)&&(f=!0),f){let e=d;return d=Ve,e}let o=d;return d=u.next(),o};return{next:()=>{let e=m();for(;!f&&e.done;)e=m();return e}}}replace(e,t,n){let r=0,i=null,o=typeof t==`function`,s=n?.maxCount??2**53-1,c=!n?.maxCount,l=``,u=typeof t==`string`?xe(t):null,d=n?.description??a(`op.replace`),f=this._transactions.beginCommit({description:d});try{let d=null,p=null,m=e.next();for(;!m.done&&r<s;){let a=m.value,s=a.getWorksheet();s!==d&&(d=s,p!==null&&p.apply(),p=d.getEntireRange().createSparseBuilder({axis:n?.axis,allowUnorderedWrites:!0}));let c=o?t(a):t;c!==void 0&&c!==a&&(p.push(a,c),r++,i=a),m=e.next()}p?.apply(),r===1&&s===1&&i&&(l=i.getAddress()),r===0?f.rollback():f.commit({description:n?.description??(c?u===null?a(`op.replaceAll`):_(`op.replaceAllWith`,{value:u}):l?u===null?_(`op.replaceAt`,{address:l}):_(`op.replaceAtWith`,{address:l,value:u}):u===null?a(`op.replace`):_(`op.replaceWith`,{value:u}))})}catch(e){throw f.rollback(),e}return{count:r,last:i}}_nextSheetIndex(e,t=this._getSheetRefs()){let n=t.length;return n===1?0:(e===void 0&&(e=this.getSelectedSheetIndex()),(e=Math.max(0,Math.min(e,n-1)))>=n-1?0:e+1)}_prevSheetIndex(e,t=this._getSheetRefs()){let n=t.length;return n===1?0:(e===void 0&&(e=this.getSelectedSheetIndex()),(e=Math.max(0,Math.min(e,n-1)))<=0?n-1:e-1)}_worksheetOffsetFrom(e,t){let n=this._getSheetRefs(),r=n.length;for(let i=0;i<r;i++){let a=n[(e+i)%r];if(!Q(a))continue;let o=t.indexOf(a.sheet);if(o!==-1)return o}return 0}getNextSheet(e){if(this._closed)throw Error(_(`error.workbook.modelClosed`));let t=this._getSheetRefs();return t[this._nextSheetIndex(e,t)]?.sheet??null}getPreviousSheet(e){if(this._closed)throw Error(_(`error.workbook.modelClosed`));let t=this._getSheetRefs();return t[this._prevSheetIndex(e,t)]?.sheet??null}async _duplicateSheet(e){if(this._closed)throw Error(_(`error.workbook.modelClosed`));if(!this.getProtection().isStructureAllowed())throw new c(_(`error.workbook.protection`));let t=this._getSheetRefs(),n=this.getSelectedSheetIndex(),r=null;if(e){if(r=this._getSheetRef(e),!r)throw new h(ln(r))}else r=t[n];if(!r)return null;if(!Q(r))throw new h((i=r.name,_(`error.workbook.sheetNotDuplicable`,{sheetName:i})));var i;let a=r.sheet,o=t.indexOf(r),s=this._strings.beginPersist(),l=this.getResources().beginPersist(),u=this.getStyles().beginPersist(),d=this._richValues.beginPersist(),f=null,p=this.beginCommit(_(`op.duplicateNamed`,{name:a.getName()}));try{let e=this._getState().refsByInstance.get(a),n=await a.toJSON(),r=t.length+1,i=this.findValidSheetName(e.name),s=this._createSheet(r,i,e.visibility,o,void 0,n);this._tellSheets(),this._emitter.notify(`onSheetsChange`),f=s,p.commit()}catch(e){throw p.rollback(),e}finally{d.endPersist(),u.endPersist(),l.endPersist(),s.endPersist()}return f}_createRange(e,t){let n=e?{...e}:null,r=n?this._getSheetRef(n.scope,F.Visibility.VeryHidden):null;if(r&&!Q(r))throw new h(dn(r.name,r.sheet.getKind()));if(!r){let e=this._anchorWorksheet();return e?(delete n?.scope,_n(n,n?{scope:Ne,...e.getEntireRange().getCoords()}:null)):void console.warn(_(`error.workbook.noVisibleRefs`))}let i=r.sheet,a=null;return t&&(a={getOptions:t}),new xn(e,L(i),this,a)}_createRanges(e,t){let n=this._anchorWorksheet();if(!n)throw new h(fn(``,F.Kind.Worksheet));let r=null;return t&&(r={getOptions:t}),new bn(e,L(n),this,r)}getRange(e,t){if(e===void 0)return this.getSelectedRange(t);typeof e==`number`&&(e=Le(arguments),t=void 0);try{let n=this._rangesAddressToCoords(e);if(n.length!==1)throw new h(_(`error.address.singleRangeOnlyAlt`));return this._createRange(n[0],t)}catch(t){throw t instanceof d?new d(t.message):new h(t.message??qe(e))}}getCell(e){if(e===void 0)return this.getSelectedCell();let t=this.getRange(e);if(t.size>1)throw new h(_(`error.address.singleCellOnly`));return t.getCell()}getRanges(e,t){let n=this._rangesAddressToCoords(e);if(n.length===0)throw new h(qe(e));return this._createRanges(n,t)}_createGraphRanges(e,t){let n=[],r=this.getCalculation()?.getNamedFormulas()??null;for(let e=0;e<t.length;e++){let i=t[e],a=i.sheetName?this._getSheetRef(i.sheetName,F.Visibility.VeryHidden):null,o=a&&Q(a)?a.sheet:this._anchorWorksheet();o&&n.push(new nt(i,r,L(o),null))}for(let t=0;t<e.length;t++)n.push(e[t]);let i=this._anchorWorksheet();return n.length!==0&&i?new bn(n,L(i),this,null):null}getAnomalies(e){if(this._closed)throw Error(_(`error.workbook.modelClosed`));let t=pt(e),n=this._getWorksheets(F.Visibility.VeryHidden).map(e=>{let t=L(e);return{bounds:t.getSheet().getEntireCoords(),internal:t,qualified:!0}});return new Ze(n,()=>(this.getSelectedWorksheet()??this._getWorksheets(F.Visibility.VeryHidden)[0]).getEntireRange(),t)}getStats(e){if(this._closed)throw Error(_(`error.workbook.modelClosed`));let t=this._getWorksheets(F.Visibility.VeryHidden),n=t.length;if(n===1)return t[0].getStats(e);let r=Array(n);for(let i=0;i<n;i++)r[i]=t[i].getStats(e);return new Rt(r)}_activeRangeCoords(){let e=this._requireSelectedWorksheet(),t=e.getSelection().getRanges().getCoords(),n=e.getName(),r=t.length,i=Array(r);for(let e=0;e<r;e++){let r=t[e];i[e]={colStart:r.colStart,colEnd:r.colEnd,rowStart:r.rowStart,rowEnd:r.rowEnd,scope:n}}return i}getSelectedRange(e){return this.getRange(this._activeRangeCoords()[0],e)}getSelectedRanges(e){return this.getRanges(this._activeRangeCoords(),e)}getSelectedCell(){return this._requireSelectedWorksheet().getSelectedCell()}_rangesAddressToCoords(e,t=!0,n=F.Visibility.Hidden){if(!e)throw new h(_(`error.address.noAddress`));let r=this.getSelectedWorksheet(),i={...(r??this._anchorWorksheet())?.getEntireRange().getCoords()},a=r?.getName();if(a&&(i.scope=a),typeof e==`string`){let t=e.trim().toLowerCase();if(t===`r`||t===`c`){let n=this.getSelectedCell().getCoords(),r={};t===`r`?r.rowStart=r.rowEnd=n.rowIndex:r.colStart=r.colEnd=n.colIndex,e=r}}let o=this,s=we(e,i,Ke,e=>{if(!t)return null;if(typeof e==`string`){let t=st(e,{getTable:e=>Te(o.getNames().getByName(e)),getAnchor:()=>r?{sheet:r,coords:r.getSelectedCell().getCoords()}:null});if(t)return[t];let n=o.getNames().getByName(e)?.getRanges?.();if(n)return n.getCoords()}throw new h(`Invalid sheet reference '${e}'.`)}),c=s.length;for(let e=0;e<c;e++)this._validateCoords(s[e],n);return s}_validateCoords(e,t=F.Visibility.Visible,n=_(`error.sheet.oobRange`)){if(e===null)return;let r=this.getWorksheet(e.scope??void 0,t).getEntireRange().getCoords();if(!o.isRangeWithinRange(e,r))throw new d(n);if(e.rowEnd<e.rowStart||e.colEnd<e.colStart)throw new h(_(`error.address.invalidRangeInverted`))}_updateSheetRef(e,t){let n=this._getState(),r=[...n.sheetRefsAll];r[this._getOffsetForId(e.id,n.sheetRefsAll)]=t,this._updateSheetRefStates(r);let i=new Map(n.refsById);i.set(e.id,t);let a=e.name.toLowerCase(),o=t.name.toLowerCase(),s=new Map(n.refsByLowerCaseName);s.delete(a),s.set(o,t);let c=new Map(n.sheetsByLowerCaseName),l=c.get(a);c.delete(a),c.set(o,l);let u=new Map(n.refsByInstance);return u.set(l,t),this._updateState({refsById:i,refsByLowerCaseName:s,sheetsByLowerCaseName:c,refsByInstance:u}),this._tellSheets(),t}_setSheetName(e,t,n){if(this._closed)throw Error(_(`error.workbook.modelClosed`));if(!this.getProtection().isStructureAllowed())throw new c(_(`error.workbook.protection`));let r=this._getSheetRef(e);if(!r)throw new h(ln(e));if(t===r.name)return r.sheet;if((t=this._validateNewSheetName(t))==null)throw new h(_(`error.workbook.sheetNameNotProvided`));let i=Object.freeze({...r,name:t}),o=null,s=this.beginCommit(a(`op.renameSheet`));try{let e=this._updateSheetRef(r,i);this._adjustSheetNamesIfRequired(),this._sheetOnNameChange.forEach((e,t)=>{r.id===t&&e()}),this._emitter.notify(`onSheetsChange`),r.id===this.getView().getActiveSheetId()&&this._emitter.notify(`onSelectionChange`),o=e.sheet,s.commit(n)}catch(e){throw s.rollback(),e}return o}_setSheetVisibility(e,t=F.Visibility.Visible,n){if(this._closed)throw Error(_(`error.workbook.modelClosed`));if(!this.getProtection().isStructureAllowed())throw new c(_(`error.workbook.protection`));let r=this._getSheetRef(e,F.Visibility.VeryHidden);if(!r)return null;if(t===r.visibility)return;let i=null,o=``;t===F.Visibility.Visible?o=a(`op.unhideSheet`):t===F.Visibility.Hidden?o=a(`op.hideSheet`):t===F.Visibility.VeryHidden&&(o=a(`op.veryHideSheet`));let s=this.beginCommit(o);try{let e=this._getState().sheetRefsVisible;if(t!==F.Visibility.Visible&&e.length===1&&e[0].id===r.id)throw new h(_(`error.workbook.sheetOne`));let a={...r,visibility:t},o=-1;t!==F.Visibility.Visible&&(o=this._getOffsetForId(r.id,e)),i=this._updateSheetRef(r,a).sheet,t!==F.Visibility.Visible&&this._adjustRemoveSelectionIfRequired(o,r.id),this._adjustSheetNamesIfRequired(),s.commit(n)}catch(e){throw s.rollback(),e}return this._sheetOnVisibilityChange.forEach((e,t)=>{r.id===t&&e()}),this._emitter.notify(`onSheetsChange`),i}_moveSheet(e,t,n){if(this._closed)throw Error(_(`error.workbook.modelClosed`));if(!this.getProtection().isStructureAllowed())throw new c(_(`error.workbook.protection`));let r=null,i=this.beginCommit(_(`op.moveSheetNamed`,{name:e.name}));try{let a=this._getState(),o=a.sheetRefsVisible;if(t<0||t>o.length-1)throw new h(`Invalid to index: ${t}`);let s=this.getView().getActiveSheetId(),c=a.sheetRefsAll,l=this._getOffsetForId(e.id,c),u=this._getOffsetForId(o[t].id,c);if(l===u)return;let d=c[l],f=[...c];f.splice(l,1),f.splice(u,0,d),this._updateSheetRefStates(f),this._calculation._replaceSheetSpans?.(c.map(e=>e.sheet.getId()),f.map(e=>e.sheet.getId()),d.sheet.getId()),this._adjustSheetNamesIfRequired(),this._sheetOnIndexChange.forEach((e,t)=>{t>=l&&t<=u&&e()}),this._tellSheets(),this._emitter.notify(`onSheetsChange`),r=d.sheet,this._recordActiveSheet(i,s,this.getView().getActiveSheetId()),i.commit(n)}catch(e){throw i.rollback(),e}return r}_setSelectedSheet(e){if(this._closed)throw Error(_(`error.workbook.modelClosed`));let t=this._getSheetRef(e);if(!t)throw new h(ln(e));let n=null;return t.visibility!==F.Visibility.Visible&&this._setSheetVisibility(t,F.Visibility.Visible),this._view.setActiveSheetId(t.id),n=t.sheet,n}getProtection(){return this._protection}getProperties(){return this._documentProperties}getCodeName(){return this._codeName}getNames(){return this._names}getCalculation(){return this._calculation}getFonts(){return Ae.getShared()}createFormula(e,t,n){return this.getCalculation().createFormula(e,t,n)}evaluate(e,t){return this.getCalculation().evaluate(e,t)}async whenCalculationReady(){let e=this._starting;return e?e.then(()=>this.getCalculation().ready()):this.getCalculation().ready()}whenFontsReady(){return this.getFonts().whenReady()}async whenReady(){await Promise.all([this.whenCalculationReady(),this.whenFontsReady()])}getScripts(){return this._scripts||=this._createScripts(),this._scripts}getModules(){return this.getScripts().getModules()}_notifyAllChange(){this._emitter.notify(`onSheetsChange`),this._emitter.notify(`onSelectedSheetChange`),this._emitter.notify(`onViewChange`)}addListeners(e,t){return this._emitter.addListeners(e,t)}_sheetToWBEvent(e){let t=this,n=e=>{if(e.isInvalid())return e;let n=e.getWorksheet().getName();if(e.isICellRanges){let r=e.getCoords().map(e=>e.scope?e:{...e,scope:n});return t.getRanges(r)}let r=e.getCoords();return t.getRange(r.scope?r:{...r,scope:n})};return t=>{e({getSource:()=>n(t.getSource()),getRanges:()=>{let e=t.getRanges();return e?n(e):null},getPreviousAddress:()=>t.getPreviousAddress(),getEdits:()=>t.getEdits(),getTrigger:()=>t.getTrigger(),isUndo:()=>t.isUndo(),getCommit:()=>t.getCommit(),toString:()=>`WorkbookRangeEvent: ('${t.getTrigger()}', ${n(t.getSource()).toString()})`,getTimeStamp:()=>t.getTimeStamp()})}}_holdPivotCaches(){let e=this._pivotCaches;if(e.length===0)return;let t=e=>{let t=this._getSheetRef(e),n=t&&Q(t)?t.sheet:null;return n?n._contentAddWatch(()=>null):null},n=e=>{for(let t of this._getSheetRefs(F.Visibility.VeryHidden)){if(!Q(t))continue;let n=t.sheet;if(n.getTables().getByName(e))return n._contentAddWatch(()=>null)}return null},r=(e,t)=>{let n=this._getSheetRef(e);return n&&Q(n)?n.sheet.getRange(t):null},i=e=>{for(let t of this._getSheetRefs(F.Visibility.VeryHidden)){if(!Q(t))continue;let n=t.sheet.getTables().getByName(e);if(n)return n}return null},a=(e,t)=>{let n=this._pivotSourceNamed(e,t)?.getValue(),i=typeof n==`string`?P(n):null;return i&&/^\$?[A-Za-z]+\$?\d+(?::\$?[A-Za-z]+\$?\d+)?$/.test(i.reference)?r(i.sheet,i.reference.replaceAll(`$`,``)):null};for(let o=0;o<e.length;o++)this._getState().pivotCacheData.has(e[o].cacheId)&&(e[o]._hold(t,n),e[o]._watchSource(r,i,a))}_pivotCacheStore(e){return{get:()=>this._getState().pivotCacheData.get(e),set:t=>{this._updateState(n=>({...n,pivotCacheData:new Map(n.pivotCacheData).set(e,t)}),a(`op.refreshPivotTable`))}}}_getPivotCache(e){return this._getState().pivotCacheData.has(e)?this._pivotCaches.find(t=>t.cacheId===e)??null:null}_pivotSourceOf(e,t){if(e.isITable)return{name:e.getName()};let n=null;if(typeof e==`string`){for(let t of this._getSheetRefs(F.Visibility.VeryHidden))if(Q(t)&&t.sheet.getTables().getByName(e))return{name:e};if(this.getNames().getByName(e))return{name:e};if(t.getNames().getByName(e)?.getScope())return{name:e,sheet:t.getName()};let r=P(e),i=r?this._getSheetRef(r.sheet):null;if(r&&(!i||!Q(i)))return null;try{n=r?i.sheet.getRange(r.reference):t.getRange(e)}catch(e){if(!(e instanceof h))throw e;return null}}else n=e.isICellRange?e:t.getRange(e);if(!n||n.isInvalid())return null;let{rowStart:r,colStart:i,rowEnd:a,colEnd:o}=n.getCoords();return{ref:$e({rowStart:r,colStart:i,rowEnd:a,colEnd:o}),sheet:n.getWorksheet().getName()}}_findPivotCache(e){let t=(e,t)=>(e??``).toLocaleLowerCase()===(t??``).toLocaleLowerCase();return this._pivotCaches.find(n=>{if(!this._getPivotCache(n.cacheId)||!n._getData().model||n._isStale())return!1;let r=n._getSource();return!!r&&t(r.ref,e.ref)&&t(r.sheet,e.sheet)&&t(r.name,e.name)})??null}_addPivotCache(e){let t=this._pivotCaches.reduce((e,t)=>Math.max(e,t.cacheId),-1)+1,n=this._pivotCacheStore(t);n.set({part:null,model:e,partFormats:null,source:null});let r=new Y(t,n);return this._pivotCaches.push(r),this._holdPivotCaches(),r}async _refreshPivotCaches(e,t){let n=[];for(let t of this._getSheetRefs(F.Visibility.VeryHidden))if(Q(t))for(let r of t.sheet.getPivotTables().getItems())e.has(r.getCacheId())&&n.push(r);for(let e of n)e._assertRefreshAllowed();for(let r of e){let e=this._getPivotCache(r),i=e?await this._pivotSourceRangeOf(e._getSource()):null;if(!e||!i)throw new h(_(`error.pivotTable.refreshSourceUnsupported`));if(i.getRowCount()<2)throw new h(_(`error.pivotTable.refreshSourceTooSmall`));i.getWorksheet()._cellBuffer?.release();let a=e.toJSON();if(!a.fields)throw new h(_(`error.pivotTable.refreshSourceUnsupported`));let{model:o,remap:s}=t.refreshPivotCache(a,t.readPivotSource(i),e._getSource()??void 0,this._isDate1904);e._replace(o);for(let e of n)e.getCacheId()===r&&e._remapCache(s,t)}for(let e of n)await e._prepareRelayout(t);for(let e of n)e._refresh(t)}async _refreshPivotCachesOnLoad(){let e=this._pivotCaches.filter(e=>!!e._getData().model?.refreshOnLoad);if(e.length===0)return;let t=await Be.load();for(let n of e){if(this._closed)return;try{await this._transactions.doBatch(()=>this._refreshPivotCaches(new Set([n.cacheId]),t))}catch(e){if(!(e instanceof h||e instanceof c))throw e}}}async _pivotSourceRangeOf(e){if(!e)return null;if(e.ref){if(!e.sheet||e.ref.includes(`#REF!`))return null;let t=this._getSheetRef(e.sheet);return t&&Q(t)?t.sheet.getRange(e.ref):null}if(!e.name)return null;if(!e.sheet)for(let t of this._getSheetRefs(F.Visibility.VeryHidden)){if(!Q(t))continue;let n=t.sheet.getTables().getByName(e.name);if(!n||n.isDeleted())continue;let{rowEnd:r}=n.getDataRange().getCoords();return t.sheet.getRange({...n.getRange().getCoords(),rowEnd:r})}let t=await this._pivotSourceNamed(e.name,e.sheet??null)?.evaluate(),n=t?.isIReferenceRange?t.getCoords():null;if(!n?.scope)return null;let r=this._getSheetRef(n.scope);return r&&Q(r)?r.sheet.getRange(n):null}_pivotSourceNamed(e,t){if(!t)return this.getNames().getByName(e);let n=this._getSheetRef(t);if(!n||!Q(n))return null;let r=n.sheet.getNames().getByName(e);return r?.getScope()?r:null}_holdPivotSlicers(){let e=(e,t)=>{let n=this._getSheetRef(e);return(n&&Q(n)?n.sheet:null)?.getPivotTables().getByName(t)??null};for(let t of this._getSheetRefs(F.Visibility.VeryHidden)){if(!Q(t))continue;let n=t.sheet.getMovables().getItems();for(let t=0;t<n.length;t++){let r=n[t].getContent();r.isISlicer&&r._holdPivotTables(e)}}}_fromJSON(e,t){if(this._emitter.notify(`onBeforeLoad`,{params:e}),this._initState(),!e.sheets||e.sheets.length===0)throw new h(_(`error.workbook.sheetOne`));e.theme&&(this._theme=new Re(e.theme),this._styles.setTheme(this._theme));let n=this._strings.beginPersist(),r=this._resources.beginPersist(),i=this._styles.beginPersist(),a=this._richValues.beginPersist();try{n.fromJSON(e.strings),r.fromJSON(e.resources),this._fetch.adopt(this._resources.getItems()),i.fromJSON(e.styles),a.fromJSON(e.richData,{resources:this._resources,strings:this._strings,fromResourceId:e=>r.fromResourceId(e)??null},e.richTypes),e.date1904&&(this._isDate1904=!0),this._codeName=e.codeName??null,this._updateLinks=e.updateLinks??null,this._hiddenPivotFieldList=!0===e.hiddenPivotFieldList,this._documentProperties.fromJSON(e.properties),e.locale&&(this._locale=e.locale),e.localeOverrides&&(this._localeOverrides=e.localeOverrides),e.view||={};let o=[],s=new Map,c=e.pivotCaches;if(c){let e=r.fromResourceId.bind(r);for(let t=0;t<c.length;t++){let n=c[t];n&&typeof n.cacheId==`number`&&!s.has(n.cacheId)&&s.set(n.cacheId,Y.dataOf(n,e))}}this._updateState({pivotCacheData:s});for(let e of s.keys())o.push(new Y(e,this._pivotCacheStore(e)));this._pivotCaches=o,this._people.fromJSON(e.people);let l=e.sheets,u=l.length,d=e.view.activeSheetId??null;d!==null&&(d=Math.min(Math.max(0,d),u-1));let f=null,p=null;this._isLoadingSheets=!0;for(let e=0;e<u;e++){let n=l[e],i=n.visibility||F.Visibility.Visible,a=e;p=a,i===F.Visibility.Visible?f===null&&(f=a):d!==null&&d===a&&(d=null);try{let o=n.kind??F.Kind.Worksheet;if(o!==F.Kind.Worksheet){let s=n.sheet,c=M.fromJSON(s?.part,r.fromResourceId.bind(r));if(!c)throw new h(_(`error.workbook.sheetPartMissing`,{sheetName:n.name}));this._createOpaqueSheet(a,n.name,i,e,n.sheetId,o,c,s?.tabColor??null,t?.[e])}else this._createSheet(a,n.name,i,e,n.sheetId,n.sheet,t?.[e])}catch(e){throw this._isLoadingSheets=!1,e}}this._isLoadingSheets=!1,this._tellSheets(),this._holdPivotCaches(),this._holdPivotSlicers();for(let e of this._getSheetRefs(F.Visibility.VeryHidden))Q(e)&&e.sheet._tellPivots();this._updateState({lastId:p}),e.view.activeSheetId=d??f,this.setView(new nn({json:e.view})),this._adjustSheetNamesIfRequired(),this._listenerProtection?.();let m=this;this._protection=new an(e?.protection,this._options?.readonly),this._listenerProtection=this._protection.addListeners({onChange:e=>{m._emitter.notify(`onProtectionChange`,{source:e})}}),this._emitter.notify(`onLoad`)}finally{a.endPersist(),i.endPersist(),r.endPersist(),n.endPersist()}}async _startFunctions(){let e=this._scripts;if(!e)return r.EmptyArray;await e._load();let t=[];for(let n of e.getModules().getItems())this._startModules.add(n),t.push(...n.getFunctions().getItems({type:`formula`,includeHidden:!0}));return t}_createScripts(e){let t=this;return new Wt({transactions:this._transactions,json:e,workbook:t,getBuiltInFunctions:()=>t._calculation?.getFunctions(),onAdd:(e,n)=>{let r=t._calculation;r.getStatus()!==ye.Status.Off&&r.start().then(async()=>{if(t._startModules.has(n))return;let e=n.getFunctions().getItems({type:`formula`,includeHidden:!0}),r=e.length;for(let t=0;t<r;t++){let n=e[t];try{await this._calculation.getFunctions().add(n)}catch(e){m.error(e?.message??String(e),e)}}}).catch(()=>{})},onRemove:(e,t)=>{}})}async toJSON(e){if(this._closed)throw Error(_(`error.workbook.modelClosed`));await Promise.resolve(this._starting);let t=this.getCalculation();t.getStatus()!==ye.Status.Off&&(await t.ready(),await t._whenRequestsSettled?.()),await this._emitter.notify(`onBeforeSave`,{async:!0});let n={sheets:[]},r=e?.ignoreStyles??!1;if(!r){let e=this._theme.toJSON();(e?Object.keys(e).length:0)>0&&(n.theme=e)}if(this._scripts){let e=this._scripts.toJSON();e&&Object.keys(e).length>0&&(n.modules=e)}this._isDate1904&&(n.date1904=!0),this._codeName&&(n.codeName=this._codeName),this._updateLinks&&(n.updateLinks=this._updateLinks),this._hiddenPivotFieldList&&(n.hiddenPivotFieldList=!0);let i=this._documentProperties.toJSON();Object.keys(i).length>0&&(n.properties=i),this._locale&&(n.locale=this._locale),this._localeOverrides&&(n.localeOverrides=this._localeOverrides);let a=e?.resources??`embed`,o=a===`ignore`,s=this._strings.beginPersist(),c=o?null:this._resources.beginPersist(),l=this._styles.beginPersist(),u=this._richValues.beginPersist();try{let t=this._getSheetRef(this.getSelectedSheetIndex()).id,i=t,d=null,f=this._getState(),p=f.sheetRefsAll,m=f.sheetsById,h=p.length;for(let r=0;r<h;r++){let a=p[r],o=r+1,s,l=m.get(a.id);if(Q(a))s={name:a.name,sheet:await a.sheet.toJSON(e)};else{let e=l,t=c?c.toResourceId.bind(c):()=>null,n={part:M.toJSON(e._getPart(),t)},r=e.getTabColor();r&&(n.tabColor=r.toString()),s={name:a.name,kind:e.getKind(),sheet:n}}a.sheetId!==void 0&&(s.sheetId=a.sheetId),a.visibility===F.Visibility.Visible?d===null&&(d=o):s.visibility=a.visibility,a.id===t&&(i=o),n.sheets.push(s)}if(!r){let e=l.toJSON();e&&Object.keys(e).length>0&&(n.styles=e)}let g=this.getProtection().toJSON();g&&(n.protection=g);let _=this._calculation.toJSON();Object.keys(_).length>0&&(n.calc=_);let v=await s.toJSONAsync();v&&v.length>0&&(n.strings=v);let y=await u.toJSONAsync(c?c.toResourceId.bind(c):void 0);if(y.length>0){n.richData=y;let e=u.toKindsJSON();e.length>0&&(n.richTypes=e)}let b=this._calculation.getExternalBooks().toJSON();b&&(n.externalBooks=b);let x=this._pivotCaches;if(x.length>0){let e=c?c.toResourceId.bind(c):()=>null,t=new Set;for(let e of this.getPivotTables())t.add(e.getCacheId());let r=ft(this);for(let e=0;e<r.length;e++){let n=r[e].toJSON()?.pivot?.cacheId;n!==void 0&&t.add(n)}let i=[];for(let n=0;n<x.length;n++)t.has(x[n].cacheId)&&i.push(x[n].toJSON(e));i.length>0&&(n.pivotCaches=i)}let S=this._people.toJSON();if(S&&(n.people=S),!o){let e=await c.toJSONAsync(typeof a==`function`?a:void 0);e&&e.length>0&&(n.resources=e)}let C=this._calculation.getNamedFormulas().toJSON();C&&C.length>0&&(n.names=C);let w=this._view.toJSON();w&&(i===d?delete w.activeSheetId:w.activeSheetId=i,Object.keys(w).length>0&&(n.view=w))}finally{u.endPersist(),l.endPersist(),o||c.endPersist(),s.endPersist()}return this._emitter.notify(`onSave`,{params:n}),n}isClosed(){return this._closed}close(){if(this._closed)return;this._emitter.notify(`onClose`);let e=this._getState();e.listenersSheets.forEach(e=>{e()}),e.listenersSheets.clear();let t=e.sheetRefsAll;for(let e=t.length-1;e>=0;e--)try{t[e].sheet.close()}catch(e){console.warn(`error on close`,e)}this._ownResources,this._ownNames&&this._names.close(),this._ownCalculation&&this._calculation.close(),this._ownStyles,this._transactionsRemoveListener?.(),this._listenerLanguage?.(),this._listenerOrigin?.(),this._listenerOriginProvider?.(),this._ownOriginProvider&&this._originProvider instanceof xt&&this._originProvider.release(),this._closed=!0}beginCommit(e){if(this._closed)throw Error(_(`error.workbook.modelClosed`));return this._beginCommit(typeof e==`string`?{description:e}:e)}doBatch(e,t){let n=this;t=typeof t==`string`?{description:t}:{description:a(`op.updateWorkbook`),...t};let r=y.bind(this._transactions,this,e);return this._transactions.doBatch(r.callback,{...t,onChildCommit:r.onChildCommit},(e,t)=>{r.close(),e.getDepth()===0&&(n._lastTransactionUUID=e.getId())})}_beginCommit(e){let t=this;return this._transactions.beginCommit(typeof e==`string`?{description:e}:e,e=>{e.getDepth()===0&&(t._lastTransactionUUID=e.getId())})}_getState(){return this._transactions.getState(this._id)}_updateState(e,t=a(`op.updateWorkbook`),n){if(!e)return;let r=this._beginCommit(t);try{r.updateState(this._id,e),r.commit(n)}catch(e){throw r.rollback(),e}}get options(){return this._options}get[Symbol.toStringTag](){return`[Workbook]`}toString(){return`[${this.getName()??`(untitled)`}]`}get isIWorkbook(){return!0}},wn={address:null},Q=e=>e.sheet.getKind()===F.Kind.Worksheet,Tn=class{constructor(){this._readFormats=[],this._writeFormats=[],this._encryptions=[]}async registerReadFormat(e){this._readFormats=await this._registerFormatType(e,this._readFormats)}async registerWriteFormat(e){this._writeFormats=await this._registerFormatType(e,this._writeFormats)}async registerEncryption(e){if(!e)throw Error(`encryption must be provided.`);if(!e.key)throw Error(`encryption.key must be provided.`);let t=e.key.toLowerCase(),n=this._encryptions.findIndex(e=>e.key.toLowerCase()===t);if(n!==-1){let t=[...this._encryptions];t[n]=e,this._encryptions=Object.freeze(t)}else this._encryptions=Object.freeze([...this._encryptions,e])}async getEncryption(e){return this.peekEncryption(e)}peekEncryption(e){if(!e)return this._encryptions[0]??null;let t=e.toLowerCase();return this._encryptions.find(e=>e.key.toLowerCase()===t)??null}async detectEncryption(e){for(let t of this._encryptions)if(await t.detect(e))return t;return null}async getReadFormats(e){return e?this._filterFormats(e,this._readFormats):[...this._readFormats]}async getWriteFormats(e){return this._writeFormats?e?this._filterFormats(e,this._writeFormats):[...this._writeFormats]:[]}async _registerFormatType(e,t){return this._registerFormatTypeSync(e,t)}_registerFormatTypeSync(e,t){if(!e)throw Error(`format must be provided.`);if(!e.key)throw Error(`format.key must be provided.`);let n=e.key.toLowerCase(),r=t.findIndex(e=>e.key.toLowerCase()===n);if(r!==-1){let n=[...t];return n[r]=e,Object.freeze(n)}return Object.freeze([...t,e])}_filterFormats(e,t,n){if(!e||Object.keys(e).length===0){if(!n)return[...t];e={ext:n}}let r=e.search?.toLocaleLowerCase();return t.filter(t=>{if(r){let e=t.key.toLocaleLowerCase().includes(r),n=!!t.exts&&t.exts.some(e=>e.toLocaleLowerCase().includes(r)),i=!!t.mimeType&&t.mimeType.toLocaleLowerCase().includes(r),a=!!t.tags&&t.tags.some(e=>e.toLocaleLowerCase().includes(r)),o=!!t.description&&t.description.toLocaleLowerCase().includes(r);if(!(e||n||i||a||o))return!1}let i=e.ext||n;if(i){let e=i.toLocaleLowerCase();if(!t.exts.some(t=>t.toLocaleLowerCase()===e))return!1}if(e.mimeType&&t.mimeType!==e.mimeType||e.key&&t.key.toLocaleLowerCase()!==e.key.toLocaleLowerCase())return!1;if(e.tags){let n=t.tags||[];if(!(typeof e.tags==`string`?[e.tags]:e.tags).every(e=>n.includes(e)))return!1}return!0})}},$=new WeakMap,En=e=>!!e&&typeof e==`object`&&typeof e.getPath==`function`&&typeof e.canWrite==`function`,Dn=new class{constructor(){this._setInstalled=new WeakSet,this._backingStore=null,this._emitter=new b(this),this._registry=new Tn,this._defaultStore=new Ct(()=>this.getWriteFormats(),()=>this.getReadFormats())}getBackingStore(){return this._backingStore??this._defaultStore}setBackingStore(e){this._backingStore=e??null}canWrite(){return typeof this.getBackingStore().write==`function`}canRead(){return typeof this.getBackingStore().read==`function`}async install(e){this._setInstalled.has(e)||(await e.register(this._registry),this._setInstalled.add(e))}addListeners(e,t){return this._emitter.addListeners(e,t)}addCommitListener(e){return this._emitter.addListeners({onWrite:(t,n)=>{n.save&&e.onCommit?.({store:n.workbook.getTransactions(),commitId:n.commitId})}})}async getReadFormats(e){return this._registry.getReadFormats(e)}async getWriteFormats(e){return this._registry.getWriteFormats(e)}getOrigin(e){return new U(e)}async read(e){let t=null;if(typeof e==`string`)e={source:e};else if(En(e)){let n=e.getPath();if(!n)throw Error(`Cannot read from an unbound origin (no path).`);yt(e)?e={source:n,asCopy:!0}:(t=e,e={source:n})}let n=e??{},{source:r=null,...i}=n,a=this.getBackingStore();return(a.read?a:this._defaultStore).read({source:r,options:i,decode:(e,r)=>this._decodeBuffer(e,r,n,t)})}async _decodeBuffer(e,t={},n,r=null){let i=t.format,a=t.ext;if(!i&&!a)throw Error(`Either format or file extension must be provided to determine read type.`);let o=(await this._registry.getReadFormats(i?{search:i}:{ext:a}))[0];if(!o)throw new h(_(`error.io.readFormatUnavailable`,{format:i??a}));let s=n?.typedCreateWorkbookOptions,c=s?Object.keys(s).find(e=>e.toLowerCase()===o.key.toLowerCase()):void 0,l={...n,...c===void 0?void 0:s[c]};delete l.typedCreateWorkbookOptions,delete l.source,delete l.asCopy;let u=r??new U(t.absolutePath??null,{name:t.name??null,format:o.key,size:t.size??null,lastModified:t.lastModified??null,canWrite:t.canWrite??!1});r instanceof U&&r.update({format:o.key,size:t.size??null,lastModified:t.lastModified??null}),l.createWorkbookOptions={...l.createWorkbookOptions||{},origin:u},l.readonly!==void 0&&(l.createWorkbookOptions={readonly:l.readonly,...l.createWorkbookOptions},delete l.readonly),l.calcOnly&&(l.createWorkbookOptions={disableLoadAutoFit:!0,...l.createWorkbookOptions});let d=await this._decrypt(e,u,l);if(d===null)return null;e=d.bytes;let f=l?.progress?.onStart?.bind(l.progress);f&&await Promise.resolve(f(u,t.size));try{let t=await this._readArrayBuffer(e,o,l);return d.password!==null&&u.setPassword(d.password),l?.progress?.onComplete?.(u),this._emitter.notify(`onRead`,{params:{workbook:t,origin:u},transactional:!1}),t}catch(e){throw l?.progress?.onError?.(e),l?.progress?.onComplete?.(null),e}}async _decrypt(e,t,n){let r=await this._registry.detectEncryption(e);if(t instanceof U&&t.update({encryption:r?r.key:null}),!r)return{bytes:e,password:null};let i=null,a=async t=>{try{return i=await r.decode(e,t),!0}catch(e){if(!(e instanceof f))throw e;return!1}};if(n?.password&&await a(n.password))return{bytes:i,password:n.password};if(!n?.onPassword){let e=t.getName();throw new l(e?_(`error.io.passwordRequired`,{name:e}):_(`error.io.passwordRequiredUnnamed`))}let o=await Promise.resolve(n.onPassword({origin:t,encryption:r.key,validate:a}));if(o==null)return null;if(i!==null||await a(o))return{bytes:i,password:o};throw new f(_(`error.io.passwordIncorrect`))}async writeArrayBuffer(e,t){if(!t?.format)throw Error(`A format must be specified to write to an ArrayBuffer (e.g. { format: 'xlsx' }).`);let n=(await this._registry.getWriteFormats({search:t.format}))[0];if(!n)throw new h(_(`error.io.writeFormatUnavailable`,{format:t.format}));return this._writeArrayBuffer(e,n,t)}async write(e,t,n){return typeof t==`string`||En(t)?this._write(e,t,!1,n):this._write(e,e?.getOrigin?.(),!0,t??n)}async writeAs(e,t,n){if(!t)throw Error(`A target must be provided for writeAs (use write(workbook) for a plain save).`);return this._write(e,t,!0,n)}async _write(e,t,n,r){if(!e)throw Error(`Workbook must be provided.`);if(!e.isIWorkbook)throw Error(`Invalid workbook model provided. Must be an instance of IWorkbook.`);let i=typeof t==`string`?this.getOrigin(t):t,a=i.getFormat(),o;if((r?.format||a)&&(o=(await this._registry.getWriteFormats({search:r?.format??a??void 0}))[0]),o||i.getPath()&&i.canWrite()&&i.getExtension()||(o=(await this._registry.getWriteFormats({ext:`sxl`}))[0]??(await this._registry.getWriteFormats())[0]),!o)throw new h(_(`error.io.writeFormatUnresolved`));let s=i.getExtension();if(r?.format&&s&&i.getPath()&&i.canWrite()&&!o.exts.includes(s)){let e=(await this._registry.getWriteFormats({ext:s}))[0];if(e&&e.key!==o.key){let e=i.getPath().split(/[/\\]/).pop();throw new h(_(`error.io.writeFormatMismatch`,{format:r.format,file:e}))}}if(typeof t==`string`){let e=i.getPath();i=new U(R(e)?e:`${e}.${o.exts[0]}`,{format:o.key})}let c=i.getEncryption(),u=e.getOrigin?.(),d=(i instanceof U?i.getPassword():null)??(u instanceof U?u.getPassword():null),f=i.isEncrypted()||(u?.isEncrypted()??!1),p=r?.password===void 0?d??(f?void 0:null):r.password,m=null;if(p===void 0){if(f){let e=i.getName();throw new l(e?_(`error.io.passwordRequiredSave`,{name:e}):_(`error.io.passwordRequiredSaveUnnamed`))}}else if(p!==null&&(m=await this._registry.getEncryption(c),!m))throw new h(_(`error.io.encryptionUnavailable`));let g=`${i.getName()??_(`workbook.defaultName`)}.${o.exts[0]}`,v=r?.progress,y=!i.getPath()||!i.canWrite()||!!r?.prompt,b=!1,x=this,S=null,C=[],w={workbook:e,format:o,origin:i,suggestedName:g,prompt:r?.prompt,async encode(t,a){let s=a??i;await(async e=>{b||(b=!0,v?.onStart&&await Promise.resolve(v.onStart(e)))})(s),S=e.getTransactions?.()?.getCurrentCommit()??S;let c=t?(await x._registry.getWriteFormats({search:t}))[0]??o:o,l=[],u=((e,t)=>({onStart:e?.onStart?(t,n)=>e.onStart(t,n):void 0,onProgress:e?.onProgress?(t,n)=>e.onProgress(t,n):void 0,onError:e?.onError?t=>e.onError(t):void 0,onComplete:e?.onComplete?t=>e.onComplete(t):void 0,onWarning:(n,r)=>{t.push({message:n??``,context:r}),e?.onWarning?.(n,r)}}))(v,l),d=await x._writeArrayBuffer(e,c,{...r,progress:u}),f=$.get(s);if(l.some(e=>!f?.has(e.message))&&r?.onWarnings){let t=await Promise.resolve(r.onWarnings({workbook:e,origin:s,warnings:l,save:n,canCancel:!y}));if(!y&&!1===t)return null}return C=l,m?m.encode(d,p):d}},T=null;try{let t=this.getBackingStore();if(!t.write)throw Error(`The active backing store is read-only (no write implementation).`);if(T=await t.write(w),T){if(p!==void 0&&T instanceof U&&(T.setPassword(p),T.update({encryption:m?m.key:null})),C.length){let e=$.get(T)??new Set;for(let t of C)e.add(t.message);$.set(T,e)}n&&T!==e.getOrigin()&&yt(e.getOrigin())?.setOrigin(T);let t=S??e.getTransactions?.()?.getCurrentCommit()??null;this._emitter.notify(`onWrite`,{params:{workbook:e,origin:T,commitId:t?.getId()??null,save:n},transactional:!1})}v?.onComplete&&await Promise.resolve(v.onComplete(T))}catch(e){let t=e instanceof Error?e:Error(String(e));throw v?.onError&&await Promise.resolve(v.onError(t)),v?.onComplete&&await Promise.resolve(v.onComplete(null)),t instanceof h?t:Error(_(`error.io.writeFailed`,{reason:t.message}),{cause:e})}return T}_stripExtension(e){let t=R(e);return t?e.slice(0,e.length-t.length-1):e}_baseName(e){if(!e)return null;let t=e.split(/[?#]/)[0],n=t.split(/[/\\]/).pop()??t;return this._stripExtension(n)||null}async _writeArrayBuffer(e,t,n){if(!t)throw Error(`A write format must be provided.`);let r=t.handler;if(!r)throw Error(`Unable to resolve a write handler for '${t.key}'.`);return Je(t.key)||await H.assertUsable(`exports`,0),r(e,{...n,format:t.key})}async _readArrayBuffer(e,t,n){if(!e)throw Error(`ArrayBuffer must be specified.`);if(!t)throw Error(`format must be specified.`);if(e.byteLength===0)return new Cn(n?.createWorkbookOptions);let r=t.handler;if(!r)throw Error(`Unable to resolve a read handler for '${t.key}'.`);let i;try{i=await r(e,n)}catch(e){throw e instanceof h?e:new h(_(`error.io.readFailed`,{format:t.description??t.key,reason:e?.message??String(e)}),{cause:e})}return await ut(),i}get isIWorkbookIO(){return!0}},On=[`.woff2`,`.woff`,`.ttf`,`.otf`,`.ttc`,`.otc`].map(e=>({suffix:e,place:(e,t)=>t?`${t}/${e}`:e})),kn={suffix:`.metrics.json`,async extract(e){let t=await e.readJson();return t?.format===`sheetxl-font-metrics/1`?{family:t.family,weight:t.weight,italic:t.italic}:null},place:(e,t)=>t?`${t}/${e}`:e};[kn.place,kn.place,...On];var An;An||={};var jn,Mn,Nn;jn||={},(Mn||={}).Type={Button:`button`,CheckBox:`checkBox`,OptionButton:`optionButton`,ListBox:`listBox`,DropDown:`dropDown`,ScrollBar:`scrollBar`,Spinner:`spinner`,GroupBox:`groupBox`,Label:`label`,EditBox:`editBox`,Dialog:`dialog`,Unknown:`formControl`},(Nn||={}).DropStyle={Combo:`combo`,ComboEdit:`comboEdit`,Simple:`simple`};export{ht as a,Dn as c,Cn as d,Ft as f,U as i,Dt as l,Qt as n,$t as o,Pt as p,J as r,Z as s,Ht as t,vt as u};
|