@sheetxl/studio-vanilla 0.1.98

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.
Files changed (184) hide show
  1. package/LICENSE.md +11 -0
  2. package/README.md +100 -0
  3. package/build/browser/cjs/1q6_3-jGNZllbF3R.cjs +6 -0
  4. package/build/browser/cjs/5KDindu3wyLVvG7F.cjs +6 -0
  5. package/build/browser/cjs/87m5i_TKPbDn6tke.cjs +30 -0
  6. package/build/browser/cjs/B0L2YQ9agsyHWOu2.cjs +6 -0
  7. package/build/browser/cjs/B3HvYH5kqySWdJ0f.cjs +6 -0
  8. package/build/browser/cjs/B6AOUko0HYRy2MPw.cjs +6 -0
  9. package/build/browser/cjs/BC5MKXBhHGdPeiJ3.cjs +21 -0
  10. package/build/browser/cjs/BG0RxkPyZY6Be7Lk.cjs +6 -0
  11. package/build/browser/cjs/BJsJYwvFiJBFxTov.cjs +6 -0
  12. package/build/browser/cjs/BMVMyi5NiMBuQrl9.cjs +52 -0
  13. package/build/browser/cjs/BS_QXQWoKRl_7MiR.cjs +17 -0
  14. package/build/browser/cjs/BZPhmHWsFBTIA3BQ.cjs +210 -0
  15. package/build/browser/cjs/B_5ro-VEKfZDMSn_.cjs +6 -0
  16. package/build/browser/cjs/B_c3i0fXSlX7dH12.cjs +1521 -0
  17. package/build/browser/cjs/BarieqwSecnaFn0d.cjs +6 -0
  18. package/build/browser/cjs/BfNo_1u55uW2HhAa.cjs +6 -0
  19. package/build/browser/cjs/Bl6FyLoMkFiQqhvc.cjs +7 -0
  20. package/build/browser/cjs/Bsyzteo6tD31A45e.cjs +11 -0
  21. package/build/browser/cjs/Btzizuqo7zQ_grdS.cjs +16 -0
  22. package/build/browser/cjs/BxBOlXY9P3Ymi6oT.cjs +6 -0
  23. package/build/browser/cjs/C0AP85yKTJU5XzPW.cjs +6 -0
  24. package/build/browser/cjs/C0Pjx18ua-OCdtpy.cjs +6 -0
  25. package/build/browser/cjs/CA2wSX6txFrM5nXD.cjs +6 -0
  26. package/build/browser/cjs/CB3jEtNo5ZsjfE5p.cjs +6 -0
  27. package/build/browser/cjs/CDiYZ1cSoLW8U5Mz.cjs +6 -0
  28. package/build/browser/cjs/CHD5c5FdcMm6vLyG.cjs +155 -0
  29. package/build/browser/cjs/COCpf8tSdkj2O19V.cjs +134 -0
  30. package/build/browser/cjs/CTV1KRGhkieiY4Rf.cjs +42 -0
  31. package/build/browser/cjs/CUw8AoM-rVbp1W3s.cjs +6 -0
  32. package/build/browser/cjs/CVTydWBioXRZeoNf.cjs +6 -0
  33. package/build/browser/cjs/C_uXPPlfjY68-QA8.cjs +6 -0
  34. package/build/browser/cjs/CaNR-X0TWW9OF1S0.cjs +33 -0
  35. package/build/browser/cjs/CiySKEsfDr8XnkZh.cjs +6 -0
  36. package/build/browser/cjs/CtBikymnhpcCzP3X.cjs +6 -0
  37. package/build/browser/cjs/CyF7bxA0DO13ETpx.cjs +30 -0
  38. package/build/browser/cjs/D-vkFAlNHXwUvmUT.cjs +16 -0
  39. package/build/browser/cjs/D2OU29-ZPOAWFVJB.cjs +22 -0
  40. package/build/browser/cjs/DFX31uXp449or-Xs.cjs +6 -0
  41. package/build/browser/cjs/DLqNXuHYff_kQuj1.cjs +6 -0
  42. package/build/browser/cjs/DMKZDMHHXLePvLy3.cjs +524 -0
  43. package/build/browser/cjs/DP8biA0GQqyPKLyq.cjs +6 -0
  44. package/build/browser/cjs/DcYrNx0uy99yQNMl.cjs +21 -0
  45. package/build/browser/cjs/Dcyg_YxTfBgi_6cp.cjs +26 -0
  46. package/build/browser/cjs/DeR9YbwO2xDBKVWN.cjs +21 -0
  47. package/build/browser/cjs/DfNbgyjaLMn81dqP.cjs +6 -0
  48. package/build/browser/cjs/DirazCTz5IsFWrUv.cjs +22 -0
  49. package/build/browser/cjs/Dix4vuDuOzj4WGCJ.cjs +19 -0
  50. package/build/browser/cjs/DqbTRjj97q78RuGC.cjs +6 -0
  51. package/build/browser/cjs/Dy28YI90qj65PHFO.cjs +17 -0
  52. package/build/browser/cjs/Nkl33Tt1_oEy9kjk.cjs +6 -0
  53. package/build/browser/cjs/S1S-AvD0w8s-LV8O.cjs +6 -0
  54. package/build/browser/cjs/bnPgbgGBTq7DESzd.cjs +6 -0
  55. package/build/browser/cjs/d9tJGmGw-3KZjpAx.cjs +17 -0
  56. package/build/browser/cjs/dke2gbIUS44QXwEl.cjs +6 -0
  57. package/build/browser/cjs/index.cjs +6 -0
  58. package/build/browser/cjs/mPpQR06-jf99r2jM.cjs +6 -0
  59. package/build/browser/cjs/wq0Sm3fu9rxt43OK.cjs +6 -0
  60. package/build/browser/cjs/xM54FRmGddZFVTTI.cjs +6 -0
  61. package/build/browser/cjs/xgGpGg5b8fu3GAnL.cjs +33 -0
  62. package/build/browser/esm/1Jl9rrRJdbPsUP_1.mjs +13222 -0
  63. package/build/browser/esm/3RX6dP_O-47yXKHQ.mjs +1492 -0
  64. package/build/browser/esm/5F5MTh8R-sIiPq0h.mjs +22 -0
  65. package/build/browser/esm/B3_l6_TLa9ImyRmW.mjs +5572 -0
  66. package/build/browser/esm/B7odLLxNfEmKGWX6.mjs +49 -0
  67. package/build/browser/esm/BAjCWyggrIkCz6wr.mjs +22 -0
  68. package/build/browser/esm/BE4io65W825i_dzC.mjs +58 -0
  69. package/build/browser/esm/BEZ41ST3hkC4W-_9.mjs +22 -0
  70. package/build/browser/esm/BKkD05hqNTBap4Oc.mjs +22 -0
  71. package/build/browser/esm/BOiR2dTlvcgYjz8P.mjs +402 -0
  72. package/build/browser/esm/BOjAZRs_NVerYv4t.mjs +22 -0
  73. package/build/browser/esm/BRkMPyIUXMixnL8d.mjs +22 -0
  74. package/build/browser/esm/BSS_RvWzDRX8_EJd.mjs +1684 -0
  75. package/build/browser/esm/BXC9rQVV2gq5x8br.mjs +22 -0
  76. package/build/browser/esm/BYmMkbrRTsNuR3aY.mjs +1358 -0
  77. package/build/browser/esm/BaSzK17p3_gCvNVV.mjs +24 -0
  78. package/build/browser/esm/BdtlmF31h4Y7RgUj.mjs +22 -0
  79. package/build/browser/esm/Be3zRnYQ13HUcsRW.mjs +150 -0
  80. package/build/browser/esm/BiSk8LRROMF0Bl4-.mjs +92 -0
  81. package/build/browser/esm/BlfHOASL_bJ6Hy0y.mjs +40 -0
  82. package/build/browser/esm/C-jC-wgAoMOxrVvv.mjs +1377 -0
  83. package/build/browser/esm/C0Lw5hMgKbooA6Jl.mjs +22 -0
  84. package/build/browser/esm/C32FpMEFLbDnBtO3.mjs +22 -0
  85. package/build/browser/esm/C9uN8RnLjnGSimTA.mjs +439 -0
  86. package/build/browser/esm/CB0UHheTgg0735hj.mjs +52 -0
  87. package/build/browser/esm/CU55zbw8Xbwap6Tl.mjs +22 -0
  88. package/build/browser/esm/CWRCdxOg103AFis3.mjs +3926 -0
  89. package/build/browser/esm/CpJdzwQYkBw7IPnN.mjs +22 -0
  90. package/build/browser/esm/CprFmxuwGvaUtLG2.mjs +22 -0
  91. package/build/browser/esm/CtZxtE4tRmMGFT5o.mjs +22 -0
  92. package/build/browser/esm/D-Oj36iQScXAKSMA.mjs +53 -0
  93. package/build/browser/esm/D2yyUr4KbJEFsxKC.mjs +21 -0
  94. package/build/browser/esm/D8HF2X8hvAkV29oq.mjs +55 -0
  95. package/build/browser/esm/DCauh523moR7slpq.mjs +22 -0
  96. package/build/browser/esm/DIA-Gy5mdjefjUaA.mjs +22 -0
  97. package/build/browser/esm/DJjdfX9aUyVGMkri.mjs +47 -0
  98. package/build/browser/esm/DMWb8cCaNVRcm-tT.mjs +2352 -0
  99. package/build/browser/esm/DP7HVKT0w_4L2vMQ.mjs +844 -0
  100. package/build/browser/esm/DToiYU1jffn1g7TH.mjs +639 -0
  101. package/build/browser/esm/DgSuz0WKGy36a2cp.mjs +22 -0
  102. package/build/browser/esm/Dgw3FTbNKuo2CIxP.mjs +22 -0
  103. package/build/browser/esm/DnV_Y9xoMPSav0-o.mjs +56 -0
  104. package/build/browser/esm/Do7pHqmnwO45_ymt.mjs +22 -0
  105. package/build/browser/esm/DqvZDTDIyX-qv4r9.mjs +29 -0
  106. package/build/browser/esm/Ds8V__cRAClpmjZn.mjs +1714 -0
  107. package/build/browser/esm/DtQdtXJDZgNEIz9d.mjs +440 -0
  108. package/build/browser/esm/DtpBQqwK7XXBMTB-.mjs +1598 -0
  109. package/build/browser/esm/DuzJ1k0LbZ29l8oN.mjs +945 -0
  110. package/build/browser/esm/Dxl4WJXcEhDAw_yE.mjs +42 -0
  111. package/build/browser/esm/LblYfFi1ns9H1ueN.mjs +28 -0
  112. package/build/browser/esm/NBkvFJzfLU32Pkup.mjs +496 -0
  113. package/build/browser/esm/SrBQAOpMKiDW0mGB.mjs +22 -0
  114. package/build/browser/esm/VLa1cYMb7h6UD253.mjs +64 -0
  115. package/build/browser/esm/YOEDF-U1QTzbXeMV.mjs +3826 -0
  116. package/build/browser/esm/a3tuiJ83MwzLMWaL.mjs +22 -0
  117. package/build/browser/esm/ai2Jw3PRL29E1T8h.mjs +22 -0
  118. package/build/browser/esm/ajBoEmoL9hCBQYYm.mjs +2175 -0
  119. package/build/browser/esm/index.mjs +13 -0
  120. package/build/browser/esm/k9kWmEk0ZT8y9Gii.mjs +48740 -0
  121. package/build/cdn/assets/1Jl9rrRJdbPsUP_1.js +13222 -0
  122. package/build/cdn/assets/4u46flV9M6Bwb7d3.js +29 -0
  123. package/build/cdn/assets/5F5MTh8R-sIiPq0h.js +22 -0
  124. package/build/cdn/assets/B3oMCEEls1lRVrGd.js +5572 -0
  125. package/build/cdn/assets/B4QYfmNd300iFLAx.js +945 -0
  126. package/build/cdn/assets/BAjCWyggrIkCz6wr.js +22 -0
  127. package/build/cdn/assets/BEZ41ST3hkC4W-_9.js +22 -0
  128. package/build/cdn/assets/BJIsFTUdHtUKsFJs.js +28 -0
  129. package/build/cdn/assets/BKkD05hqNTBap4Oc.js +22 -0
  130. package/build/cdn/assets/BOiR2dTlvcgYjz8P.js +402 -0
  131. package/build/cdn/assets/BOjAZRs_NVerYv4t.js +22 -0
  132. package/build/cdn/assets/BPFW3UexkNNh1lLK.js +2352 -0
  133. package/build/cdn/assets/BRkMPyIUXMixnL8d.js +22 -0
  134. package/build/cdn/assets/BSS_RvWzDRX8_EJd.js +1684 -0
  135. package/build/cdn/assets/BXC9rQVV2gq5x8br.js +22 -0
  136. package/build/cdn/assets/BY2sO3ExW1ShzKnX.js +1714 -0
  137. package/build/cdn/assets/BYmMkbrRTsNuR3aY.js +1358 -0
  138. package/build/cdn/assets/BaSzK17p3_gCvNVV.js +24 -0
  139. package/build/cdn/assets/BbpmcI-KEp3PqrdL.js +496 -0
  140. package/build/cdn/assets/BdtlmF31h4Y7RgUj.js +22 -0
  141. package/build/cdn/assets/BjgtkLR9U00HgSRn.js +58 -0
  142. package/build/cdn/assets/BlfHOASL_bJ6Hy0y.js +40 -0
  143. package/build/cdn/assets/C-jC-wgAoMOxrVvv.js +1377 -0
  144. package/build/cdn/assets/C0Lw5hMgKbooA6Jl.js +22 -0
  145. package/build/cdn/assets/C32FpMEFLbDnBtO3.js +22 -0
  146. package/build/cdn/assets/C7CDwp-nhN2WFzUs.js +844 -0
  147. package/build/cdn/assets/C9uN8RnLjnGSimTA.js +439 -0
  148. package/build/cdn/assets/CEq_C1Sim0pQ6fj0.js +56 -0
  149. package/build/cdn/assets/CLdcRW7BQK3JCguC.js +48587 -0
  150. package/build/cdn/assets/CU55zbw8Xbwap6Tl.js +22 -0
  151. package/build/cdn/assets/C_L_pvQemfhI00iS.js +150 -0
  152. package/build/cdn/assets/CkhSGQneqlTRflfQ.js +47 -0
  153. package/build/cdn/assets/CpJdzwQYkBw7IPnN.js +22 -0
  154. package/build/cdn/assets/CprFmxuwGvaUtLG2.js +22 -0
  155. package/build/cdn/assets/CtZxtE4tRmMGFT5o.js +22 -0
  156. package/build/cdn/assets/CvbyGDitUPabmYBl.js +64 -0
  157. package/build/cdn/assets/D06aHumWZLILF489.js +3926 -0
  158. package/build/cdn/assets/D2pceTwrS_dagByu.js +21 -0
  159. package/build/cdn/assets/D4ZBjoUG2QO1RO3t.js +1492 -0
  160. package/build/cdn/assets/DARyg_kqL8Eu81Fa.js +2175 -0
  161. package/build/cdn/assets/DCauh523moR7slpq.js +22 -0
  162. package/build/cdn/assets/DIA-Gy5mdjefjUaA.js +22 -0
  163. package/build/cdn/assets/DLHK1pMyNN3B2g-j.js +52 -0
  164. package/build/cdn/assets/DMoEzt3UKZedfext.js +1598 -0
  165. package/build/cdn/assets/DMwOymY267-LxmJ_.js +49 -0
  166. package/build/cdn/assets/DToiYU1jffn1g7TH.js +639 -0
  167. package/build/cdn/assets/DUUO52IRQCve_iCM.js +440 -0
  168. package/build/cdn/assets/DgSuz0WKGy36a2cp.js +22 -0
  169. package/build/cdn/assets/Dgw3FTbNKuo2CIxP.js +22 -0
  170. package/build/cdn/assets/Do7pHqmnwO45_ymt.js +22 -0
  171. package/build/cdn/assets/Dxl4WJXcEhDAw_yE.js +42 -0
  172. package/build/cdn/assets/QXzPuadwi3BBJC2-.js +53 -0
  173. package/build/cdn/assets/SrBQAOpMKiDW0mGB.js +22 -0
  174. package/build/cdn/assets/W3SqjN4yIzwYTvvj.js +55 -0
  175. package/build/cdn/assets/YOEDF-U1QTzbXeMV.js +3826 -0
  176. package/build/cdn/assets/a3tuiJ83MwzLMWaL.js +22 -0
  177. package/build/cdn/assets/ai2Jw3PRL29E1T8h.js +22 -0
  178. package/build/cdn/assets/fWcbv7BXhriCYeod.js +92 -0
  179. package/build/cdn/index.js +171 -0
  180. package/build/cdn/loader.js +6 -0
  181. package/build/licenses/dependencies.txt +1 -0
  182. package/build/package.json +61 -0
  183. package/build/types/index.d.ts +151 -0
  184. package/package.json +92 -0
@@ -0,0 +1,1492 @@
1
+ import { j as Pt, a as Vt, k as be, n as xe, o as Rt, S as wt, r as re, I as we, p as ve, i as Se, t as Ce, c as te, q as ke, y as pe, A as Ae, M as De } from "./CLdcRW7BQK3JCguC.js";
2
+ /**
3
+ * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.0.0
4
+ *
5
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
6
+ * License: The license can be found at https://www.sheetxl.com/license.
7
+ */
8
+ /**
9
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.0.0
10
+ *
11
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
12
+ * License: The license can be found at https://www.sheetxl.com/license.
13
+ */
14
+ /**
15
+ * @license @sheetxl/io - IO - Import/Export Libraries for SheetXL. - v0.0.0
16
+ *
17
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
18
+ * License: The license can be found at https://www.sheetxl.com/license.
19
+ */
20
+ const ne = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", Ee = new RegExp(`^[${ne}][-${ne}.0-9·̀-ͯ‿-⁀]*$`, "u");
21
+ /**
22
+ * Character classes and associated utilities for the 5th edition of XML 1.0.
23
+ *
24
+ * @author Louis-Dominique Dubeau
25
+ * @license MIT
26
+ * @copyright Louis-Dominique Dubeau
27
+ */
28
+ function ge(i) {
29
+ return i >= 65 && i <= 90 || i >= 97 && i <= 122 || i === 58 || i === 95 || i === 8204 || i === 8205 || i >= 192 && i <= 214 || i >= 216 && i <= 246 || i >= 248 && i <= 767 || i >= 880 && i <= 893 || i >= 895 && i <= 8191 || i >= 8304 && i <= 8591 || i >= 11264 && i <= 12271 || i >= 12289 && i <= 55295 || i >= 63744 && i <= 64975 || i >= 65008 && i <= 65533 || i >= 65536 && i <= 983039;
30
+ }
31
+ /**
32
+ * Character class utilities for XML NS 1.0 edition 3.
33
+ *
34
+ * @author Louis-Dominique Dubeau
35
+ * @license MIT
36
+ * @copyright Louis-Dominique Dubeau
37
+ */
38
+ const ae = "A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", Pe = new RegExp(`^[${ae}][-${ae}.0-9·̀-ͯ‿-⁀]*$`, "u");
39
+ function fe(i) {
40
+ return i >= 65 && i <= 90 || i === 95 || i >= 97 && i <= 122 || i >= 192 && i <= 214 || i >= 216 && i <= 246 || i >= 248 && i <= 767 || i >= 880 && i <= 893 || i >= 895 && i <= 8191 || i >= 8204 && i <= 8205 || i >= 8304 && i <= 8591 || i >= 11264 && i <= 12271 || i >= 12289 && i <= 55295 || i >= 63744 && i <= 64975 || i >= 65008 && i <= 65533 || i >= 65536 && i <= 983039;
41
+ }
42
+ const rt = function(i) {
43
+ return i === 32 || i === 10 || i === 13 || i === 9;
44
+ }, Oe = function(i) {
45
+ return i >= 32 && i <= 55295 || i === 10 || i === 13 || i === 9 || i >= 57344 && i <= 65533 || i >= 65536 && i <= 1114111;
46
+ }, zt = ge, le = function(i) {
47
+ return ge(i) || i >= 48 && i <= 57 || i === 45 || i === 46 || i === 183 || i >= 768 && i <= 879 || i >= 8255 && i <= 8256;
48
+ }, me = [32, 10, 13, 9], Ie = Ee, Ve = function(i) {
49
+ return i >= 1 && i <= 55295 || i >= 57344 && i <= 65533 || i >= 65536 && i <= 1114111;
50
+ }, Le = fe, Ne = function(i) {
51
+ return fe(i) || i === 45 || i === 46 || i >= 48 && i <= 57 || i === 183 || i >= 768 && i <= 879 || i >= 8255 && i <= 8256;
52
+ }, Re = Pe, Yt = "http://www.w3.org/XML/1998/namespace", Ht = "http://www.w3.org/2000/xmlns/", $e = { __proto__: null, xml: Yt, xmlns: Ht }, Me = { __proto__: null, amp: "&", gt: ">", lt: "<", quot: '"', apos: "'" }, N = -1, bt = -2, tt = 13, Ot = 33, pt = 10, At = 60, Mt = 61, B = 62, z = 63, jt = 93, Kt = (i) => i === 34 || i === 39, Te = [34, 39], je = [...Te, 91, B], He = [...Te, At, jt], Fe = [Mt, z, ...me], Xe = [...me, B, 38, At];
53
+ function ee(i, t, s) {
54
+ switch (t) {
55
+ case "xml":
56
+ s !== Yt && i.fail(`xml prefix must be bound to ${Yt}.`);
57
+ break;
58
+ case "xmlns":
59
+ s !== Ht && i.fail(`xmlns prefix must be bound to ${Ht}.`);
60
+ }
61
+ switch (s) {
62
+ case Ht:
63
+ i.fail(t === "" ? `the default namespace may not be set to ${s}.` : `may not assign a prefix (even "xmlns") to the URI ${Ht}.`);
64
+ break;
65
+ case Yt:
66
+ switch (t) {
67
+ case "xml":
68
+ break;
69
+ case "":
70
+ i.fail(`the default namespace may not be set to ${s}.`);
71
+ break;
72
+ default:
73
+ i.fail("may not assign the xml namespace to another prefix.");
74
+ }
75
+ }
76
+ }
77
+ const Be = (i) => Re.test(i), We = (i) => Ie.test(i), ce = { xmldecl: "xmldeclHandler", text: "textHandler", processinginstruction: "piHandler", doctype: "doctypeHandler", comment: "commentHandler", opentagstart: "openTagStartHandler", attribute: "attributeHandler", opentag: "openTagHandler", closetag: "closeTagHandler", cdata: "cdataHandler", error: "errorHandler", end: "endHandler", ready: "readyHandler" };
78
+ class _e {
79
+ constructor(t) {
80
+ this.i = 0, this.prevI = 0, this.opt = t ?? {}, this.fragmentOpt = !!this.opt.fragment;
81
+ const s = this.xmlnsOpt = !!this.opt.xmlns;
82
+ if (this.trackPosition = this.opt.position !== !1, this.fileName = this.opt.fileName, s) {
83
+ this.nameStartCheck = Le, this.nameCheck = Ne, this.isName = Be, this.processAttribs = this.processAttribsNS, this.pushAttrib = this.pushAttribNS, this.ns = { __proto__: null, ...$e };
84
+ const o = this.opt.additionalNamespaces;
85
+ o != null && (function(n, a) {
86
+ for (const l of Object.keys(a)) ee(n, l, a[l]);
87
+ }(this, o), Object.assign(this.ns, o));
88
+ } else this.nameStartCheck = zt, this.nameCheck = le, this.isName = We, this.processAttribs = this.processAttribsPlain, this.pushAttrib = this.pushAttribPlain;
89
+ this.stateTable = [this.sBegin, this.sBeginWhitespace, this.sDoctype, this.sDoctypeQuote, this.sDTD, this.sDTDQuoted, this.sDTDOpenWaka, this.sDTDOpenWakaBang, this.sDTDComment, this.sDTDCommentEnding, this.sDTDCommentEnded, this.sDTDPI, this.sDTDPIEnding, this.sText, this.sEntity, this.sOpenWaka, this.sOpenWakaBang, this.sComment, this.sCommentEnding, this.sCommentEnded, this.sCData, this.sCDataEnding, this.sCDataEnding2, this.sPIFirstChar, this.sPIRest, this.sPIBody, this.sPIEnding, this.sXMLDeclNameStart, this.sXMLDeclName, this.sXMLDeclEq, this.sXMLDeclValueStart, this.sXMLDeclValue, this.sXMLDeclSeparator, this.sXMLDeclEnding, this.sOpenTag, this.sOpenTagSlash, this.sAttrib, this.sAttribName, this.sAttribNameSawWhite, this.sAttribValue, this.sAttribValueQuoted, this.sAttribValueClosed, this.sAttribValueUnquoted, this.sCloseTag, this.sCloseTagSawWhite], this._init();
90
+ }
91
+ get closed() {
92
+ return this._closed;
93
+ }
94
+ _init() {
95
+ this.openWakaBang = "", this.text = "", this.name = "", this.piTarget = "", this.entity = "", this.q = null, this.tags = [], this.tag = null, this.topNS = null, this.chunk = "", this.chunkPosition = 0, this.i = 0, this.prevI = 0, this.carriedFromPrevious = void 0, this.forbiddenState = 0, this.attribList = [];
96
+ const { fragmentOpt: t } = this;
97
+ this.state = t ? tt : 0, this.reportedTextBeforeRoot = this.reportedTextAfterRoot = this.closedRoot = this.sawRoot = t, this.xmlDeclPossible = !t, this.xmlDeclExpects = ["version"], this.entityReturnState = void 0;
98
+ let { defaultXMLVersion: s } = this.opt;
99
+ if (s === void 0) {
100
+ if (this.opt.forceXMLVersion === !0) throw new Error("forceXMLVersion set but defaultXMLVersion is not set");
101
+ s = "1.0";
102
+ }
103
+ this.setXMLVersion(s), this.positionAtNewLine = 0, this.doctype = !1, this._closed = !1, this.xmlDecl = { version: void 0, encoding: void 0, standalone: void 0 }, this.line = 1, this.column = 0, this.ENTITIES = Object.create(Me), this.readyHandler?.();
104
+ }
105
+ get position() {
106
+ return this.chunkPosition + this.i;
107
+ }
108
+ get columnIndex() {
109
+ return this.position - this.positionAtNewLine;
110
+ }
111
+ on(t, s) {
112
+ this[ce[t]] = s;
113
+ }
114
+ off(t) {
115
+ this[ce[t]] = void 0;
116
+ }
117
+ makeError(t) {
118
+ let s = this.fileName ?? "";
119
+ return this.trackPosition && (s.length > 0 && (s += ":"), s += `${this.line}:${this.column}`), s.length > 0 && (s += ": "), new Error(s + t);
120
+ }
121
+ fail(t) {
122
+ const s = this.makeError(t), o = this.errorHandler;
123
+ if (o === void 0) throw s;
124
+ return o(s), this;
125
+ }
126
+ write(t) {
127
+ if (this.closed) return this.fail("cannot write after close; assign an onready handler.");
128
+ let s = !1;
129
+ t === null ? (s = !0, t = "") : typeof t == "object" && (t = t.toString()), this.carriedFromPrevious !== void 0 && (t = `${this.carriedFromPrevious}${t}`, this.carriedFromPrevious = void 0);
130
+ let o = t.length;
131
+ const n = t.charCodeAt(o - 1);
132
+ !s && (n === 13 || n >= 55296 && n <= 56319) && (this.carriedFromPrevious = t[o - 1], o--, t = t.slice(0, o));
133
+ const { stateTable: a } = this;
134
+ for (this.chunk = t, this.i = 0; this.i < o; ) a[this.state].call(this);
135
+ return this.chunkPosition += o, s ? this.end() : this;
136
+ }
137
+ close() {
138
+ return this.write(null);
139
+ }
140
+ getCode10() {
141
+ const t = this.chunk, s = this.i;
142
+ if (this.prevI = s, this.i++, s >= t.length) return N;
143
+ const o = t.charCodeAt(s);
144
+ if (this.column++, o < 55296) {
145
+ if (o >= 32 || o === 9) return o;
146
+ switch (o) {
147
+ case pt:
148
+ return this.line++, this.column = 0, this.positionAtNewLine = this.position, pt;
149
+ case 13:
150
+ return t.charCodeAt(s + 1) === pt && (this.i = s + 2), this.line++, this.column = 0, this.positionAtNewLine = this.position, bt;
151
+ default:
152
+ return this.fail("disallowed character."), o;
153
+ }
154
+ }
155
+ if (o > 56319) return o >= 57344 && o <= 65533 || this.fail("disallowed character."), o;
156
+ const n = 65536 + 1024 * (o - 55296) + (t.charCodeAt(s + 1) - 56320);
157
+ return this.i = s + 2, n > 1114111 && this.fail("disallowed character."), n;
158
+ }
159
+ getCode11() {
160
+ const { chunk: t, i: s } = this;
161
+ if (this.prevI = s, this.i = s + 1, s >= t.length) return N;
162
+ const o = t.charCodeAt(s);
163
+ if (this.column++, o < 55296) {
164
+ if (o > 31 && o < 127 || o > 159 && o !== 8232 || o === 9) return o;
165
+ switch (o) {
166
+ case pt:
167
+ return this.line++, this.column = 0, this.positionAtNewLine = this.position, pt;
168
+ case 13: {
169
+ const a = t.charCodeAt(s + 1);
170
+ a !== pt && a !== 133 || (this.i = s + 2);
171
+ }
172
+ case 133:
173
+ case 8232:
174
+ return this.line++, this.column = 0, this.positionAtNewLine = this.position, bt;
175
+ default:
176
+ return this.fail("disallowed character."), o;
177
+ }
178
+ }
179
+ if (o > 56319) return o >= 57344 && o <= 65533 || this.fail("disallowed character."), o;
180
+ const n = 65536 + 1024 * (o - 55296) + (t.charCodeAt(s + 1) - 56320);
181
+ return this.i = s + 2, n > 1114111 && this.fail("disallowed character."), n;
182
+ }
183
+ getCodeNorm() {
184
+ const t = this.getCode();
185
+ return t === bt ? pt : t;
186
+ }
187
+ unget() {
188
+ this.i = this.prevI, this.column--;
189
+ }
190
+ captureTo(t) {
191
+ let { i: s } = this;
192
+ const { chunk: o } = this;
193
+ for (; ; ) {
194
+ const n = this.getCode(), a = n === bt, l = a ? pt : n;
195
+ if (l === N || t.includes(l)) return this.text += o.slice(s, this.prevI), l;
196
+ a && (this.text += `${o.slice(s, this.prevI)}
197
+ `, s = this.i);
198
+ }
199
+ }
200
+ captureToChar(t) {
201
+ let { i: s } = this;
202
+ const { chunk: o } = this;
203
+ for (; ; ) {
204
+ let n = this.getCode();
205
+ switch (n) {
206
+ case bt:
207
+ this.text += `${o.slice(s, this.prevI)}
208
+ `, s = this.i, n = pt;
209
+ break;
210
+ case N:
211
+ return this.text += o.slice(s), !1;
212
+ }
213
+ if (n === t) return this.text += o.slice(s, this.prevI), !0;
214
+ }
215
+ }
216
+ captureNameChars() {
217
+ const { chunk: t, i: s } = this;
218
+ for (; ; ) {
219
+ const o = this.getCode();
220
+ if (o === N) return this.name += t.slice(s), N;
221
+ if (!le(o)) return this.name += t.slice(s, this.prevI), o === bt ? pt : o;
222
+ }
223
+ }
224
+ skipSpaces() {
225
+ for (; ; ) {
226
+ const t = this.getCodeNorm();
227
+ if (t === N || !rt(t)) return t;
228
+ }
229
+ }
230
+ setXMLVersion(t) {
231
+ this.currentXMLVersion = t, t === "1.0" ? (this.isChar = Oe, this.getCode = this.getCode10) : (this.isChar = Ve, this.getCode = this.getCode11);
232
+ }
233
+ sBegin() {
234
+ this.chunk.charCodeAt(0) === 65279 && (this.i++, this.column++), this.state = 1;
235
+ }
236
+ sBeginWhitespace() {
237
+ const t = this.i, s = this.skipSpaces();
238
+ switch (this.prevI !== t && (this.xmlDeclPossible = !1), s) {
239
+ case At:
240
+ if (this.state = 15, this.text.length !== 0) throw new Error("no-empty text at start");
241
+ break;
242
+ case N:
243
+ break;
244
+ default:
245
+ this.unget(), this.state = tt, this.xmlDeclPossible = !1;
246
+ }
247
+ }
248
+ sDoctype() {
249
+ const t = this.captureTo(je);
250
+ switch (t) {
251
+ case B:
252
+ this.doctypeHandler?.(this.text), this.text = "", this.state = tt, this.doctype = !0;
253
+ break;
254
+ case N:
255
+ break;
256
+ default:
257
+ this.text += String.fromCodePoint(t), t === 91 ? this.state = 4 : Kt(t) && (this.state = 3, this.q = t);
258
+ }
259
+ }
260
+ sDoctypeQuote() {
261
+ const t = this.q;
262
+ this.captureToChar(t) && (this.text += String.fromCodePoint(t), this.q = null, this.state = 2);
263
+ }
264
+ sDTD() {
265
+ const t = this.captureTo(He);
266
+ t !== N && (this.text += String.fromCodePoint(t), t === jt ? this.state = 2 : t === At ? this.state = 6 : Kt(t) && (this.state = 5, this.q = t));
267
+ }
268
+ sDTDQuoted() {
269
+ const t = this.q;
270
+ this.captureToChar(t) && (this.text += String.fromCodePoint(t), this.state = 4, this.q = null);
271
+ }
272
+ sDTDOpenWaka() {
273
+ const t = this.getCodeNorm();
274
+ switch (this.text += String.fromCodePoint(t), t) {
275
+ case 33:
276
+ this.state = 7, this.openWakaBang = "";
277
+ break;
278
+ case z:
279
+ this.state = 11;
280
+ break;
281
+ default:
282
+ this.state = 4;
283
+ }
284
+ }
285
+ sDTDOpenWakaBang() {
286
+ const t = String.fromCodePoint(this.getCodeNorm()), s = this.openWakaBang += t;
287
+ this.text += t, s !== "-" && (this.state = s === "--" ? 8 : 4, this.openWakaBang = "");
288
+ }
289
+ sDTDComment() {
290
+ this.captureToChar(45) && (this.text += "-", this.state = 9);
291
+ }
292
+ sDTDCommentEnding() {
293
+ const t = this.getCodeNorm();
294
+ this.text += String.fromCodePoint(t), this.state = t === 45 ? 10 : 8;
295
+ }
296
+ sDTDCommentEnded() {
297
+ const t = this.getCodeNorm();
298
+ this.text += String.fromCodePoint(t), t === B ? this.state = 4 : (this.fail("malformed comment."), this.state = 8);
299
+ }
300
+ sDTDPI() {
301
+ this.captureToChar(z) && (this.text += "?", this.state = 12);
302
+ }
303
+ sDTDPIEnding() {
304
+ const t = this.getCodeNorm();
305
+ this.text += String.fromCodePoint(t), t === B && (this.state = 4);
306
+ }
307
+ sText() {
308
+ this.tags.length !== 0 ? this.handleTextInRoot() : this.handleTextOutsideRoot();
309
+ }
310
+ sEntity() {
311
+ let { i: t } = this;
312
+ const { chunk: s } = this;
313
+ t: for (; ; ) switch (this.getCode()) {
314
+ case bt:
315
+ this.entity += `${s.slice(t, this.prevI)}
316
+ `, t = this.i;
317
+ break;
318
+ case 59: {
319
+ const { entityReturnState: o } = this, n = this.entity + s.slice(t, this.prevI);
320
+ let a;
321
+ this.state = o, n === "" ? (this.fail("empty entity name."), a = "&;") : (a = this.parseEntity(n), this.entity = ""), o === tt && this.textHandler === void 0 || (this.text += a);
322
+ break t;
323
+ }
324
+ case N:
325
+ this.entity += s.slice(t);
326
+ break t;
327
+ }
328
+ }
329
+ sOpenWaka() {
330
+ const t = this.getCode();
331
+ if (zt(t)) this.state = 34, this.unget(), this.xmlDeclPossible = !1;
332
+ else switch (t) {
333
+ case 47:
334
+ this.state = 43, this.xmlDeclPossible = !1;
335
+ break;
336
+ case 33:
337
+ this.state = 16, this.openWakaBang = "", this.xmlDeclPossible = !1;
338
+ break;
339
+ case z:
340
+ this.state = 23;
341
+ break;
342
+ default:
343
+ this.fail("disallowed character in tag name"), this.state = tt, this.xmlDeclPossible = !1;
344
+ }
345
+ }
346
+ sOpenWakaBang() {
347
+ switch (this.openWakaBang += String.fromCodePoint(this.getCodeNorm()), this.openWakaBang) {
348
+ case "[CDATA[":
349
+ this.sawRoot || this.reportedTextBeforeRoot || (this.fail("text data outside of root node."), this.reportedTextBeforeRoot = !0), this.closedRoot && !this.reportedTextAfterRoot && (this.fail("text data outside of root node."), this.reportedTextAfterRoot = !0), this.state = 20, this.openWakaBang = "";
350
+ break;
351
+ case "--":
352
+ this.state = 17, this.openWakaBang = "";
353
+ break;
354
+ case "DOCTYPE":
355
+ this.state = 2, (this.doctype || this.sawRoot) && this.fail("inappropriately located doctype declaration."), this.openWakaBang = "";
356
+ break;
357
+ default:
358
+ this.openWakaBang.length >= 7 && this.fail("incorrect syntax.");
359
+ }
360
+ }
361
+ sComment() {
362
+ this.captureToChar(45) && (this.state = 18);
363
+ }
364
+ sCommentEnding() {
365
+ const t = this.getCodeNorm();
366
+ t === 45 ? (this.state = 19, this.commentHandler?.(this.text), this.text = "") : (this.text += `-${String.fromCodePoint(t)}`, this.state = 17);
367
+ }
368
+ sCommentEnded() {
369
+ const t = this.getCodeNorm();
370
+ t !== B ? (this.fail("malformed comment."), this.text += `--${String.fromCodePoint(t)}`, this.state = 17) : this.state = tt;
371
+ }
372
+ sCData() {
373
+ this.captureToChar(jt) && (this.state = 21);
374
+ }
375
+ sCDataEnding() {
376
+ const t = this.getCodeNorm();
377
+ t === jt ? this.state = 22 : (this.text += `]${String.fromCodePoint(t)}`, this.state = 20);
378
+ }
379
+ sCDataEnding2() {
380
+ const t = this.getCodeNorm();
381
+ switch (t) {
382
+ case B:
383
+ this.cdataHandler?.(this.text), this.text = "", this.state = tt;
384
+ break;
385
+ case jt:
386
+ this.text += "]";
387
+ break;
388
+ default:
389
+ this.text += `]]${String.fromCodePoint(t)}`, this.state = 20;
390
+ }
391
+ }
392
+ sPIFirstChar() {
393
+ const t = this.getCodeNorm();
394
+ this.nameStartCheck(t) ? (this.piTarget += String.fromCodePoint(t), this.state = 24) : t === z || rt(t) ? (this.fail("processing instruction without a target."), this.state = t === z ? 26 : 25) : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(t), this.state = 24);
395
+ }
396
+ sPIRest() {
397
+ const { chunk: t, i: s } = this;
398
+ for (; ; ) {
399
+ const o = this.getCodeNorm();
400
+ if (o === N) return void (this.piTarget += t.slice(s));
401
+ if (!this.nameCheck(o)) {
402
+ this.piTarget += t.slice(s, this.prevI);
403
+ const n = o === z;
404
+ n || rt(o) ? this.piTarget === "xml" ? (this.xmlDeclPossible || this.fail("an XML declaration must be at the start of the document."), this.state = n ? Ot : 27) : this.state = n ? 26 : 25 : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(o));
405
+ break;
406
+ }
407
+ }
408
+ }
409
+ sPIBody() {
410
+ if (this.text.length === 0) {
411
+ const t = this.getCodeNorm();
412
+ t === z ? this.state = 26 : rt(t) || (this.text = String.fromCodePoint(t));
413
+ } else this.captureToChar(z) && (this.state = 26);
414
+ }
415
+ sPIEnding() {
416
+ const t = this.getCodeNorm();
417
+ if (t === B) {
418
+ const { piTarget: s } = this;
419
+ s.toLowerCase() === "xml" && this.fail("the XML declaration must appear at the start of the document."), this.piHandler?.({ target: s, body: this.text }), this.piTarget = this.text = "", this.state = tt;
420
+ } else t === z ? this.text += "?" : (this.text += `?${String.fromCodePoint(t)}`, this.state = 25);
421
+ this.xmlDeclPossible = !1;
422
+ }
423
+ sXMLDeclNameStart() {
424
+ const t = this.skipSpaces();
425
+ t !== z ? t !== N && (this.state = 28, this.name = String.fromCodePoint(t)) : this.state = Ot;
426
+ }
427
+ sXMLDeclName() {
428
+ const t = this.captureTo(Fe);
429
+ if (t === z) return this.state = Ot, this.name += this.text, this.text = "", void this.fail("XML declaration is incomplete.");
430
+ if (rt(t) || t === Mt) {
431
+ if (this.name += this.text, this.text = "", !this.xmlDeclExpects.includes(this.name)) switch (this.name.length) {
432
+ case 0:
433
+ this.fail("did not expect any more name/value pairs.");
434
+ break;
435
+ case 1:
436
+ this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);
437
+ break;
438
+ default:
439
+ this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`);
440
+ }
441
+ this.state = t === Mt ? 30 : 29;
442
+ }
443
+ }
444
+ sXMLDeclEq() {
445
+ const t = this.getCodeNorm();
446
+ if (t === z) return this.state = Ot, void this.fail("XML declaration is incomplete.");
447
+ rt(t) || (t !== Mt && this.fail("value required."), this.state = 30);
448
+ }
449
+ sXMLDeclValueStart() {
450
+ const t = this.getCodeNorm();
451
+ if (t === z) return this.state = Ot, void this.fail("XML declaration is incomplete.");
452
+ rt(t) || (Kt(t) ? this.q = t : (this.fail("value must be quoted."), this.q = 32), this.state = 31);
453
+ }
454
+ sXMLDeclValue() {
455
+ const t = this.captureTo([this.q, z]);
456
+ if (t === z) return this.state = Ot, this.text = "", void this.fail("XML declaration is incomplete.");
457
+ if (t === N) return;
458
+ const s = this.text;
459
+ switch (this.text = "", this.name) {
460
+ case "version": {
461
+ this.xmlDeclExpects = ["encoding", "standalone"];
462
+ const o = s;
463
+ this.xmlDecl.version = o, /^1\.[0-9]+$/.test(o) ? this.opt.forceXMLVersion || this.setXMLVersion(o) : this.fail("version number must match /^1\\.[0-9]+$/.");
464
+ break;
465
+ }
466
+ case "encoding":
467
+ /^[A-Za-z][A-Za-z0-9._-]*$/.test(s) || this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."), this.xmlDeclExpects = ["standalone"], this.xmlDecl.encoding = s;
468
+ break;
469
+ case "standalone":
470
+ s !== "yes" && s !== "no" && this.fail('standalone value must match "yes" or "no".'), this.xmlDeclExpects = [], this.xmlDecl.standalone = s;
471
+ }
472
+ this.name = "", this.state = 32;
473
+ }
474
+ sXMLDeclSeparator() {
475
+ const t = this.getCodeNorm();
476
+ t !== z ? (rt(t) || (this.fail("whitespace required."), this.unget()), this.state = 27) : this.state = Ot;
477
+ }
478
+ sXMLDeclEnding() {
479
+ this.getCodeNorm() === B ? (this.piTarget !== "xml" ? this.fail("processing instructions are not allowed before root.") : this.name !== "version" && this.xmlDeclExpects.includes("version") && this.fail("XML declaration must contain a version."), this.xmldeclHandler?.(this.xmlDecl), this.name = "", this.piTarget = this.text = "", this.state = tt) : this.fail("The character ? is disallowed anywhere in XML declarations."), this.xmlDeclPossible = !1;
480
+ }
481
+ sOpenTag() {
482
+ const t = this.captureNameChars();
483
+ if (t === N) return;
484
+ const s = this.tag = { name: this.name, attributes: /* @__PURE__ */ Object.create(null) };
485
+ switch (this.name = "", this.xmlnsOpt && (this.topNS = s.ns = /* @__PURE__ */ Object.create(null)), this.openTagStartHandler?.(s), this.sawRoot = !0, !this.fragmentOpt && this.closedRoot && this.fail("documents may contain only one root."), t) {
486
+ case B:
487
+ this.openTag();
488
+ break;
489
+ case 47:
490
+ this.state = 35;
491
+ break;
492
+ default:
493
+ rt(t) || this.fail("disallowed character in tag name."), this.state = 36;
494
+ }
495
+ }
496
+ sOpenTagSlash() {
497
+ this.getCode() === B ? this.openSelfClosingTag() : (this.fail("forward-slash in opening tag not followed by >."), this.state = 36);
498
+ }
499
+ sAttrib() {
500
+ const t = this.skipSpaces();
501
+ t !== N && (zt(t) ? (this.unget(), this.state = 37) : t === B ? this.openTag() : t === 47 ? this.state = 35 : this.fail("disallowed character in attribute name."));
502
+ }
503
+ sAttribName() {
504
+ const t = this.captureNameChars();
505
+ t === Mt ? this.state = 39 : rt(t) ? this.state = 38 : t === B ? (this.fail("attribute without value."), this.pushAttrib(this.name, this.name), this.name = this.text = "", this.openTag()) : t !== N && this.fail("disallowed character in attribute name.");
506
+ }
507
+ sAttribNameSawWhite() {
508
+ const t = this.skipSpaces();
509
+ switch (t) {
510
+ case N:
511
+ return;
512
+ case Mt:
513
+ this.state = 39;
514
+ break;
515
+ default:
516
+ this.fail("attribute without value."), this.text = "", this.name = "", t === B ? this.openTag() : zt(t) ? (this.unget(), this.state = 37) : (this.fail("disallowed character in attribute name."), this.state = 36);
517
+ }
518
+ }
519
+ sAttribValue() {
520
+ const t = this.getCodeNorm();
521
+ Kt(t) ? (this.q = t, this.state = 40) : rt(t) || (this.fail("unquoted attribute value."), this.state = 42, this.unget());
522
+ }
523
+ sAttribValueQuoted() {
524
+ const { q: t, chunk: s } = this;
525
+ let { i: o } = this;
526
+ for (; ; ) switch (this.getCode()) {
527
+ case t:
528
+ return this.pushAttrib(this.name, this.text + s.slice(o, this.prevI)), this.name = this.text = "", this.q = null, void (this.state = 41);
529
+ case 38:
530
+ return this.text += s.slice(o, this.prevI), this.state = 14, void (this.entityReturnState = 40);
531
+ case pt:
532
+ case bt:
533
+ case 9:
534
+ this.text += `${s.slice(o, this.prevI)} `, o = this.i;
535
+ break;
536
+ case At:
537
+ return this.text += s.slice(o, this.prevI), void this.fail("disallowed character.");
538
+ case N:
539
+ return void (this.text += s.slice(o));
540
+ }
541
+ }
542
+ sAttribValueClosed() {
543
+ const t = this.getCodeNorm();
544
+ rt(t) ? this.state = 36 : t === B ? this.openTag() : t === 47 ? this.state = 35 : zt(t) ? (this.fail("no whitespace between attributes."), this.unget(), this.state = 37) : this.fail("disallowed character in attribute name.");
545
+ }
546
+ sAttribValueUnquoted() {
547
+ const t = this.captureTo(Xe);
548
+ switch (t) {
549
+ case 38:
550
+ this.state = 14, this.entityReturnState = 42;
551
+ break;
552
+ case At:
553
+ this.fail("disallowed character.");
554
+ break;
555
+ case N:
556
+ break;
557
+ default:
558
+ this.text.includes("]]>") && this.fail('the string "]]>" is disallowed in char data.'), this.pushAttrib(this.name, this.text), this.name = this.text = "", t === B ? this.openTag() : this.state = 36;
559
+ }
560
+ }
561
+ sCloseTag() {
562
+ const t = this.captureNameChars();
563
+ t === B ? this.closeTag() : rt(t) ? this.state = 44 : t !== N && this.fail("disallowed character in closing tag.");
564
+ }
565
+ sCloseTagSawWhite() {
566
+ switch (this.skipSpaces()) {
567
+ case B:
568
+ this.closeTag();
569
+ break;
570
+ case N:
571
+ break;
572
+ default:
573
+ this.fail("disallowed character in closing tag.");
574
+ }
575
+ }
576
+ handleTextInRoot() {
577
+ let { i: t, forbiddenState: s } = this;
578
+ const { chunk: o, textHandler: n } = this;
579
+ t: for (; ; ) switch (this.getCode()) {
580
+ case At:
581
+ if (this.state = 15, n !== void 0) {
582
+ const { text: a } = this, l = o.slice(t, this.prevI);
583
+ a.length !== 0 ? (n(a + l), this.text = "") : l.length !== 0 && n(l);
584
+ }
585
+ s = 0;
586
+ break t;
587
+ case 38:
588
+ this.state = 14, this.entityReturnState = tt, n !== void 0 && (this.text += o.slice(t, this.prevI)), s = 0;
589
+ break t;
590
+ case jt:
591
+ switch (s) {
592
+ case 0:
593
+ s = 1;
594
+ break;
595
+ case 1:
596
+ s = 2;
597
+ break;
598
+ case 2:
599
+ break;
600
+ default:
601
+ throw new Error("impossible state");
602
+ }
603
+ break;
604
+ case B:
605
+ s === 2 && this.fail('the string "]]>" is disallowed in char data.'), s = 0;
606
+ break;
607
+ case bt:
608
+ n !== void 0 && (this.text += `${o.slice(t, this.prevI)}
609
+ `), t = this.i, s = 0;
610
+ break;
611
+ case N:
612
+ n !== void 0 && (this.text += o.slice(t));
613
+ break t;
614
+ default:
615
+ s = 0;
616
+ }
617
+ this.forbiddenState = s;
618
+ }
619
+ handleTextOutsideRoot() {
620
+ let { i: t } = this;
621
+ const { chunk: s, textHandler: o } = this;
622
+ let n = !1;
623
+ t: for (; ; ) {
624
+ const a = this.getCode();
625
+ switch (a) {
626
+ case At:
627
+ if (this.state = 15, o !== void 0) {
628
+ const { text: l } = this, g = s.slice(t, this.prevI);
629
+ l.length !== 0 ? (o(l + g), this.text = "") : g.length !== 0 && o(g);
630
+ }
631
+ break t;
632
+ case 38:
633
+ this.state = 14, this.entityReturnState = tt, o !== void 0 && (this.text += s.slice(t, this.prevI)), n = !0;
634
+ break t;
635
+ case bt:
636
+ o !== void 0 && (this.text += `${s.slice(t, this.prevI)}
637
+ `), t = this.i;
638
+ break;
639
+ case N:
640
+ o !== void 0 && (this.text += s.slice(t));
641
+ break t;
642
+ default:
643
+ rt(a) || (n = !0);
644
+ }
645
+ }
646
+ n && (this.sawRoot || this.reportedTextBeforeRoot || (this.fail("text data outside of root node."), this.reportedTextBeforeRoot = !0), this.closedRoot && !this.reportedTextAfterRoot && (this.fail("text data outside of root node."), this.reportedTextAfterRoot = !0));
647
+ }
648
+ pushAttribNS(t, s) {
649
+ const { prefix: o, local: n } = this.qname(t), a = { name: t, prefix: o, local: n, value: s };
650
+ if (this.attribList.push(a), this.attributeHandler?.(a), o === "xmlns") {
651
+ const l = s.trim();
652
+ this.currentXMLVersion === "1.0" && l === "" && this.fail("invalid attempt to undefine prefix in XML 1.0"), this.topNS[n] = l, ee(this, n, l);
653
+ } else if (t === "xmlns") {
654
+ const l = s.trim();
655
+ this.topNS[""] = l, ee(this, "", l);
656
+ }
657
+ }
658
+ pushAttribPlain(t, s) {
659
+ const o = { name: t, value: s };
660
+ this.attribList.push(o), this.attributeHandler?.(o);
661
+ }
662
+ end() {
663
+ this.sawRoot || this.fail("document must contain a root element.");
664
+ const { tags: t } = this;
665
+ for (; t.length > 0; ) {
666
+ const o = t.pop();
667
+ this.fail(`unclosed tag: ${o.name}`);
668
+ }
669
+ this.state !== 0 && this.state !== tt && this.fail("unexpected end.");
670
+ const { text: s } = this;
671
+ return s.length !== 0 && (this.textHandler?.(s), this.text = ""), this._closed = !0, this.endHandler?.(), this._init(), this;
672
+ }
673
+ resolve(t) {
674
+ let s = this.topNS[t];
675
+ if (s !== void 0) return s;
676
+ const { tags: o } = this;
677
+ for (let n = o.length - 1; n >= 0; n--) if (s = o[n].ns[t], s !== void 0) return s;
678
+ return s = this.ns[t], s !== void 0 ? s : this.opt.resolvePrefix?.(t);
679
+ }
680
+ qname(t) {
681
+ const s = t.indexOf(":");
682
+ if (s === -1) return { prefix: "", local: t };
683
+ const o = t.slice(s + 1), n = t.slice(0, s);
684
+ return (n === "" || o === "" || o.includes(":")) && this.fail(`malformed name: ${t}.`), { prefix: n, local: o };
685
+ }
686
+ processAttribsNS() {
687
+ const { attribList: t } = this, s = this.tag;
688
+ {
689
+ const { prefix: a, local: l } = this.qname(s.name);
690
+ s.prefix = a, s.local = l;
691
+ const g = s.uri = this.resolve(a) ?? "";
692
+ a !== "" && (a === "xmlns" && this.fail('tags may not have "xmlns" as prefix.'), g === "" && (this.fail(`unbound namespace prefix: ${JSON.stringify(a)}.`), s.uri = a));
693
+ }
694
+ if (t.length === 0) return;
695
+ const { attributes: o } = s, n = /* @__PURE__ */ new Set();
696
+ for (const a of t) {
697
+ const { name: l, prefix: g, local: S } = a;
698
+ let b, x;
699
+ g === "" ? (b = l === "xmlns" ? Ht : "", x = l) : (b = this.resolve(g), b === void 0 && (this.fail(`unbound namespace prefix: ${JSON.stringify(g)}.`), b = g), x = `{${b}}${S}`), n.has(x) && this.fail(`duplicate attribute: ${x}.`), n.add(x), a.uri = b, o[l] = a;
700
+ }
701
+ this.attribList = [];
702
+ }
703
+ processAttribsPlain() {
704
+ const { attribList: t } = this, s = this.tag.attributes;
705
+ for (const { name: o, value: n } of t) s[o] !== void 0 && this.fail(`duplicate attribute: ${o}.`), s[o] = n;
706
+ this.attribList = [];
707
+ }
708
+ openTag() {
709
+ this.processAttribs();
710
+ const { tags: t } = this, s = this.tag;
711
+ s.isSelfClosing = !1, this.openTagHandler?.(s), t.push(s), this.state = tt, this.name = "";
712
+ }
713
+ openSelfClosingTag() {
714
+ this.processAttribs();
715
+ const { tags: t } = this, s = this.tag;
716
+ s.isSelfClosing = !0, this.openTagHandler?.(s), this.closeTagHandler?.(s), (this.tag = t[t.length - 1] ?? null) === null && (this.closedRoot = !0), this.state = tt, this.name = "";
717
+ }
718
+ closeTag() {
719
+ const { tags: t, name: s } = this;
720
+ if (this.state = tt, this.name = "", s === "") return this.fail("weird empty close tag."), void (this.text += "</>");
721
+ const o = this.closeTagHandler;
722
+ let n = t.length;
723
+ for (; n-- > 0; ) {
724
+ const a = this.tag = t.pop();
725
+ if (this.topNS = a.ns, o?.(a), a.name === s) break;
726
+ this.fail("unexpected close tag.");
727
+ }
728
+ n === 0 ? this.closedRoot = !0 : n < 0 && (this.fail(`unmatched closing tag: ${s}.`), this.text += `</${s}>`);
729
+ }
730
+ parseEntity(t) {
731
+ if (t[0] !== "#") {
732
+ const o = this.ENTITIES[t];
733
+ return o !== void 0 ? o : (this.fail(this.isName(t) ? "undefined entity." : "disallowed character in entity name."), `&${t};`);
734
+ }
735
+ let s = NaN;
736
+ return t[1] === "x" && /^#x[0-9a-f]+$/i.test(t) ? s = parseInt(t.slice(2), 16) : /^#[0-9]+$/.test(t) && (s = parseInt(t.slice(1), 10)), this.isChar(s) ? String.fromCodePoint(s) : (this.fail("malformed character entity."), `&${t};`);
737
+ }
738
+ }
739
+ var se, Ct;
740
+ (Ct = se || (se = {})).Events = { XmlDecl: "xmldecl", Text: "text", ProcessingInstruction: "processinginstruction", Doctype: "doctype", Comment: "comment", OpenTagStart: "opentagstart", Attribute: "attribute", OpenTag: "opentag", CloseTag: "closetag", CDdata: "cdata", Error: "error", End: "end", Ready: "ready" }, Ct.parseStream = async (i, t, s) => {
741
+ const o = new _e({ position: !1, ...s });
742
+ let n;
743
+ if (t.onOpenTagStart && o.on(Ct.Events.OpenTagStart, t.onOpenTagStart), t.onOpenTag && o.on(Ct.Events.OpenTag, t.onOpenTag), t.onCloseTag && o.on(Ct.Events.CloseTag, t.onCloseTag), t.onAttribute && o.on(Ct.Events.Attribute, t.onAttribute), t.onText && o.on(Ct.Events.Text, t.onText), t.onError && o.on(Ct.Events.Error, t.onError), t.onEnd) {
744
+ t.onEnd;
745
+ const a = () => {
746
+ n = t.onEnd();
747
+ };
748
+ o.on(Ct.Events.End, a);
749
+ }
750
+ for (; ; ) {
751
+ const { value: a, done: l } = await i.read();
752
+ if (l) break;
753
+ o.write(a);
754
+ }
755
+ return o.close(), n;
756
+ };
757
+ const P = (i) => i === !0 || i === "1" || i === "on" || i === "true" || i !== !1 && i !== "0" && i !== "off" && i !== "false" && null, L = (i) => {
758
+ const t = parseInt(i);
759
+ return isNaN(t) ? null : t;
760
+ }, xt = (i) => {
761
+ const t = parseFloat(i);
762
+ return isNaN(t) ? null : t;
763
+ }, O = null;
764
+ class qe {
765
+ constructor() {
766
+ this._registeredVisitors = /* @__PURE__ */ new Map();
767
+ }
768
+ registerVisitor(t) {
769
+ this._registeredVisitors.set(t.from, t);
770
+ }
771
+ createEventHandler(t, s, o) {
772
+ const n = this._registeredVisitors, a = [];
773
+ let l = null, g = null, S = null, b = null;
774
+ const x = [], C = { key: null, source: t };
775
+ let w = null, u = !1;
776
+ const A = (T, m) => {
777
+ let I = S.attributes[T];
778
+ if (m) {
779
+ if (Array.isArray(m)) {
780
+ for (let H = 0; H < m.length; H++) if (I == null || (I = m[H](I), I == null)) return;
781
+ } else if (I == null || (I = m(I), I == null)) return;
782
+ }
783
+ return I;
784
+ }, f = { getSource: () => w.source, setSource: (T) => {
785
+ w.source = T;
786
+ }, setKey: (T) => {
787
+ w.key = T;
788
+ }, getFrom: () => S, getAttribute: (T, m) => A(T, m) ?? null, hasAttribute: (T) => f.getAttribute(T) !== null, getParent: () => x[x.length - 2].source, getPath: () => {
789
+ const T = [];
790
+ for (let m = 0; m < a.length; m++) T.push(a[m].local);
791
+ return T.join("\\");
792
+ }, parseAttribute: A, copyToObject: (T, m, I, H) => {
793
+ const W = A(H ?? m, I);
794
+ W !== void 0 && (T[m] = W);
795
+ }, copyTo: (T, m, I) => {
796
+ const H = A(I ?? T, m);
797
+ H !== void 0 && (w.source[T] = H);
798
+ }, warn: (T) => {
799
+ o ? o?.(T) : console.warn(T);
800
+ } };
801
+ return { onOpenTag: (T) => {
802
+ let m = T.name;
803
+ const I = m.indexOf(":");
804
+ I !== -1 && (m = m.slice(I + 1));
805
+ const H = n.get(m);
806
+ if (l = { local: m, visitor: H, tag: T, destination: null }, u) return a.push(l), g = m, void (S = T);
807
+ b = l?.visitor ?? null, H && (w = a.length === 0 ? C : b?.to !== null ? { key: null, source: {} } : null, l.destination = w, w && x.push(w)), a.push(l), g = m, S = T, u = b?.to === null, b?.openTag?.(f);
808
+ }, onCloseTag: (T) => {
809
+ let m = T.name;
810
+ const I = m.indexOf(":");
811
+ if (I !== -1 && (m = m.slice(I + 1)), m !== g) throw new Error(`mismatch open/close tag: '${m}'/'${g}'`);
812
+ u || b?.closeTag?.(f);
813
+ const H = a.pop() ?? null;
814
+ l = a[a.length - 1] ?? null;
815
+ const W = H?.destination;
816
+ if (W) {
817
+ x.pop(), w = x[x.length - 1] ?? C;
818
+ const Z = H.visitor;
819
+ Z && Z.to && W.source !== void 0 && (Array.isArray(Z.to) ? w.source.push ? w.source.push(W.source) : o?.(`Unable to parse array for ${Z.from} at ${f.getPath()}`) : W.key ? w.source[W.key] = W.source : typeof Z.to == "string" && (w.source[Z.to] = W.source));
820
+ }
821
+ g = l?.local ?? null, S = l?.tag ?? null, b = l?.visitor ?? null, u = !l?.destination;
822
+ }, onText: (T) => {
823
+ b?.text?.(T, f);
824
+ }, onEnd: s };
825
+ }
826
+ }
827
+ const he = (i, t, s, o = null) => {
828
+ if (!i) return null;
829
+ let n = i;
830
+ n.startsWith("/") && (n = n.substring(1));
831
+ let a = o?.parsedRefs?.get(i);
832
+ if (a !== void 0) return a;
833
+ const l = t(n);
834
+ if (!l) return null;
835
+ let g = l.content;
836
+ try {
837
+ s && (g = s(g));
838
+ } catch (S) {
839
+ console.warn(S);
840
+ }
841
+ return o?.parsedRefs?.set(i, g), g;
842
+ }, ie = (i, t, s, o, n = null) => {
843
+ if (!i) return null;
844
+ let a = i;
845
+ a.startsWith("/") && (a = a.substring(1));
846
+ let l = n?.parsedRefs?.get(i);
847
+ if (l !== void 0) return l;
848
+ const g = t(a);
849
+ if (!g) return null;
850
+ const S = g.content;
851
+ try {
852
+ const b = new TextDecoder().decode(S), x = s.parseFromString(b, "text/xml"), C = o.convert(x, i, n);
853
+ return n?.parsedRefs?.set(i, C), C;
854
+ } catch (b) {
855
+ console.warn(b);
856
+ }
857
+ return null;
858
+ }, $t = (i, t, s, o, n = null) => {
859
+ const a = /* @__PURE__ */ new Map();
860
+ let l = t.Directory[i];
861
+ const g = l ? l.length : 0;
862
+ for (let S = 0; S < g; S++) {
863
+ const b = l[S];
864
+ if (!b) continue;
865
+ let x = b;
866
+ x.startsWith("/") && (x = x.substring(1));
867
+ const C = ie(x, (w) => t.files[w], s, o, n);
868
+ a.set(x, C);
869
+ }
870
+ return a;
871
+ }, ze = ["lt1", "dk1", "lt2", "dk2", "accent1", "accent2", "accent3", "accent4", "accent5", "accent6", "hlink", "folHlink"], ue = (i, t = "dk1") => {
872
+ let s;
873
+ const o = i("auto");
874
+ o === void 0 || o !== "1" && o !== "true" || (s = t);
875
+ const n = i("indexed");
876
+ n && (s = `index${n}`);
877
+ const a = i("rgb");
878
+ a && (s = a.toLowerCase(), a.length !== 8 || a.startsWith("FF") || (s = "FF" + a.substring(2, a.length)));
879
+ const l = i("theme");
880
+ l && (s = ze[l]);
881
+ let g = i("tint");
882
+ if (g && (s += ` ${Ce.AdjustmentType.ETint} ${parseFloat(g)}`), s) return s;
883
+ }, Ue = (i) => i && i.replace(/^\{([\s\S]+)\}$/, "$1"), Ke = (i) => i ? pe.roundAccurately(parseFloat(i) / 12700, 4) : null, Ye = (i) => i ? pe.roundAccurately(parseFloat(i) / 9525, 1) : null, ts = (i) => parseFloat(i) / 1e3, es = (i) => parseFloat(i) / 6e4, Ge = (i) => i === "true" || i === "1";
884
+ class It {
885
+ static {
886
+ this.Collapsed = 1;
887
+ }
888
+ static {
889
+ this.CustomFormat = 2;
890
+ }
891
+ static {
892
+ this.CustomHeight = 4;
893
+ }
894
+ static {
895
+ this.Hidden = 8;
896
+ }
897
+ static {
898
+ this.Ht = 16;
899
+ }
900
+ static {
901
+ this.OutlineLevel = 32;
902
+ }
903
+ static {
904
+ this.Ph = 64;
905
+ }
906
+ static {
907
+ this.R = 128;
908
+ }
909
+ static {
910
+ this.S = 256;
911
+ }
912
+ static {
913
+ this.Spans = 512;
914
+ }
915
+ static {
916
+ this.ThickBot = 1024;
917
+ }
918
+ static {
919
+ this.ThickTop = 2048;
920
+ }
921
+ }
922
+ const Ze = (i, t, s) => {
923
+ if (i[0].value[0] === i[1].value[0]) return t;
924
+ }, de = { colStart: 0, colEnd: 0, rowStart: 0, rowEnd: 0 }, Qe = (i, t, s, o, n, a) => {
925
+ let l = !1, g = !1, S = [], b = !1, x = null, C = null, w = null, u = null, A = null, f = null;
926
+ const T = a?.get("richData") ?? [], m = wt.normalizeA1ToR1C1, I = te.createConflatingRanges(), H = /* @__PURE__ */ new Map(), W = [];
927
+ let Z = null;
928
+ const Ft = te.createConflatingRanges();
929
+ let gt, ct = !1, F = -1, $ = -1, et = null, vt = null;
930
+ const Xt = [];
931
+ let Lt = null, Bt = -2, ht = 0, ut = "", ft = "", mt = "", Q = "", dt = "", Tt = "", St = "", Dt = "", Ut = "", Nt = "", Gt = "", Zt = "", D = "", U = "", M = !0, q = null;
932
+ return { ...s, onEnd: () => {
933
+ Xt.length > 0 && (t.rows = Xt);
934
+ let d = I.done(Ze);
935
+ const p = d.length;
936
+ if (p > 0) {
937
+ const E = new Array(p);
938
+ for (let v = 0; v < p; v++) {
939
+ const R = d[v], G = wt.rangeToString(R), st = R.value[1], it = wt.resolveRelativeToA1(st, R.rowStart, R.colStart);
940
+ E[v] = [G, it];
941
+ }
942
+ t.formulas = E;
943
+ }
944
+ const J = Ft.done(!0), V = J.length;
945
+ if (V > 0) {
946
+ const E = new Array(V);
947
+ for (let v = 0; v < V; v++) {
948
+ const R = J[v], G = wt.rangeToString(R);
949
+ E[v] = G;
950
+ }
951
+ t.volatile = E;
952
+ }
953
+ if (W.length > 0 && (t.dynamicArray = [...W]), S.length > 0) {
954
+ S.sort(te.createRangeComparator(ke.Orientation.Column));
955
+ const E = [];
956
+ let v = null, R = -1, G = -1, st = -1, it = -1, Y = null;
957
+ const yt = S.length;
958
+ yt > 0 && (v = S[0], R = v.colStart, G = v.colEnd, st = v.rowEnd, it = v.value, E.push(v));
959
+ for (let k = 1; k < yt; k++) Y = S[k], it !== Y.value || R !== Y.colStart || G !== Y.colEnd || st + 1 !== Y.rowEnd ? (E.push(Y), v = Y, R = v.colStart, G = v.colEnd, st = v.rowEnd, it = v.value) : (st = Y.rowEnd, v.rowEnd = st);
960
+ let Wt = [];
961
+ for (let k = 0; k < E.length; k++) {
962
+ const X = E[k];
963
+ Wt.push({ r: { colStart: X.colStart, colEnd: X.colEnd, rowStart: X.rowStart, rowEnd: X.rowEnd }, v: X.value });
964
+ }
965
+ t.directStyles = Wt;
966
+ }
967
+ const K = i.build();
968
+ if (K) {
969
+ const E = K.tuples;
970
+ t.data = E;
971
+ }
972
+ s?.onEnd?.();
973
+ }, onOpenTag: (d) => {
974
+ let p = d.name;
975
+ const J = p.indexOf(":");
976
+ if (J !== -1 && (p = p.slice(J + 1)), gt) {
977
+ const V = d.attributes;
978
+ switch (p) {
979
+ case "v":
980
+ g = !0;
981
+ break;
982
+ case "f":
983
+ switch (V.t ?? null) {
984
+ case null:
985
+ case "normal":
986
+ b = !0;
987
+ break;
988
+ case "shared":
989
+ const K = V.si;
990
+ C = V.ref, x = K;
991
+ break;
992
+ case "array":
993
+ b = !0, C = V.ref, Z = [C, !1];
994
+ break;
995
+ case "datatable":
996
+ b = !0, C = V.ref, b = !0;
997
+ }
998
+ V.ca !== void 0 && Ft.append(F, $);
999
+ break;
1000
+ case "is":
1001
+ return void (ct = !0);
1002
+ }
1003
+ return void (ct && n?.onOpenTag(d));
1004
+ }
1005
+ if (l) {
1006
+ if (p === "c") {
1007
+ gt = d;
1008
+ const V = d.attributes.r;
1009
+ $ = wt.fastStringToCol(V);
1010
+ const K = d.attributes.t;
1011
+ K === void 0 ? vt = null : (vt = K, vt === "str" && (ct = !0));
1012
+ let E = d.attributes.s;
1013
+ E !== void 0 && (E = parseInt(E), q && q.value === E && q.colEnd + 1 === $ ? q.colEnd = $ : (q = { colStart: $, rowStart: F, colEnd: $, rowEnd: F, value: E }, S.push(q)));
1014
+ }
1015
+ } else {
1016
+ if (p === "row") {
1017
+ l = !0;
1018
+ const V = d.attributes.r;
1019
+ if (F = parseInt(V) - 1, ht = 0, ft = d.attributes.customHeight, ft !== void 0 && (ht |= It.CustomHeight), ft !== Ut && (M = !0, Ut = ft), ut = d.attributes.ht, ut !== void 0 && (ht |= It.Ht), ut !== Dt && (M = !0, Dt = ut), mt = d.attributes.hidden, mt !== void 0 && (ht |= It.Hidden), mt !== Nt && (M = !0, Nt = mt), dt = d.attributes.s, dt !== void 0 && (ht |= It.S), dt !== Zt && (M = !0, Zt = dt), Q = d.attributes.customFormat, Q !== void 0 && (ht |= It.CustomFormat), Q !== Gt && (M = !0, Gt = Q), Tt = d.attributes.outlineLevel, Tt !== void 0 && (ht |= It.OutlineLevel), Tt !== D && (M = !0, D = Tt), St = d.attributes.collapsed, St !== void 0 && (ht |= It.Collapsed), St !== U && (M = !0, U = St), ht !== 0) if (Bt + 1 !== F || M) {
1020
+ const K = ft !== void 0 && (ft === "1" || ft === "true"), E = Q !== void 0 && (Q === "1" || Q === "true");
1021
+ Lt = { min: F, max: F, sz: K && ut !== void 0 ? parseFloat(ut) : -1, csz: K, h: mt !== void 0 && (mt === "1" || mt === "true"), s: K && dt !== void 0 && dt !== "0" ? parseInt(dt) : 0, cs: E, l: Tt === void 0 || Tt === "0" ? 0 : parseInt(Tt), cl: St !== void 0 && (St === "1" || St === "true") }, Xt.push(Lt);
1022
+ } else Lt.max = F;
1023
+ return Bt = F, void (M = !1);
1024
+ }
1025
+ s?.onOpenTag(d);
1026
+ }
1027
+ }, onCloseTag: (d) => {
1028
+ if (gt) {
1029
+ let p = d.name;
1030
+ const J = p.indexOf(":");
1031
+ if (J !== -1 && (p = p.slice(J + 1)), ct) if (p === "is" || p === "v") {
1032
+ const V = n?.onEnd();
1033
+ V !== null && i.addValue(F, $, "" + V);
1034
+ } else n?.onCloseTag?.(d);
1035
+ return g && (g = !1), void (p === "c" && (gt = null, ct = !1));
1036
+ }
1037
+ if (l) return l = !1, void (q = null);
1038
+ s?.onCloseTag(d);
1039
+ }, onText: (d) => {
1040
+ if (d = d.trim(), g) {
1041
+ switch (et = null, vt) {
1042
+ case null:
1043
+ case "n":
1044
+ et = parseFloat(d);
1045
+ break;
1046
+ case "b":
1047
+ et = d === "1" || d === "true";
1048
+ break;
1049
+ case "s":
1050
+ et = d;
1051
+ break;
1052
+ case "e":
1053
+ if (d === "#VALUE!") {
1054
+ const J = gt.attributes.vm;
1055
+ if (J !== void 0) {
1056
+ const V = T[parseInt(J) - 1];
1057
+ if (V && V.isFormulaError) {
1058
+ et = { t: Vt.Error, v: V.getCode() };
1059
+ break;
1060
+ }
1061
+ }
1062
+ }
1063
+ const p = De.getBuiltInByLabel(d);
1064
+ p ? et = { t: Vt.Error, v: p.getCode() } : (et = d, o?.(`Unknown formula error '${d}' in cell ${wt.cellToString({ colIndex: $, rowIndex: F })}`));
1065
+ break;
1066
+ case "str":
1067
+ case "inlineStr":
1068
+ ct = !0;
1069
+ }
1070
+ et !== null && i.addValue(F, $, et);
1071
+ }
1072
+ if (Z && (vt === "e" && (Z[1] = !0), W.push(Z), Z = null), x) if (A === x) u = f;
1073
+ else {
1074
+ if (u = H.get(x), !u) {
1075
+ const p = [];
1076
+ w = m(d, F, $, p), u = [w, p, d], H.set(x, u);
1077
+ }
1078
+ A = x, f = u;
1079
+ }
1080
+ if (b) {
1081
+ const p = [];
1082
+ w = m(d, F, $, p), u = [w, p, d];
1083
+ }
1084
+ if (u) return I.append(F, $, u), u = null, b = !1, x = null, void (C = null);
1085
+ ct ? n?.onText(d) : l || s?.onText(d);
1086
+ } };
1087
+ }, ss = Object.freeze(Object.defineProperty({ __proto__: null, fromBufferXLSX: async (i, t) => {
1088
+ const { password: s, onWarning: o, constructorOptions: n = {}, ...a } = t ?? {}, l = import("./1Jl9rrRJdbPsUP_1.js"), g = import("./BY2sO3ExW1ShzKnX.js");
1089
+ let S = null;
1090
+ try {
1091
+ S = new DOMParser();
1092
+ } catch {
1093
+ }
1094
+ let b = null;
1095
+ S || (b = import("./BYmMkbrRTsNuR3aY.js").then((u) => u.i));
1096
+ let x = null, C = null, w = null;
1097
+ try {
1098
+ const u = await Promise.all([l, g, b]);
1099
+ x = u[0], C = u[1], w = u[2];
1100
+ } catch (u) {
1101
+ throw new Error("Unable to load XLSX parser.", { cause: u });
1102
+ }
1103
+ try {
1104
+ const u = x.read(i, { type: "array", sheets: [], cellStyles: !1, bookFiles: !0 });
1105
+ if (!u.Directory) throw new Error("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
1106
+ u.Directory.richstructure = ["/xl/richData/rdrichvaluestructure.xml"], u.Directory.richdata = ["/xl/richData/rdrichvalue.xml"];
1107
+ const A = new C.FromOOXMLConverter(), f = S ?? new w.DOMParser(), T = n?.resources ?? new be(), m = T.beginPersist(), I = {}, H = /* @__PURE__ */ new Set(), W = /* @__PURE__ */ new Map();
1108
+ W.set("richTypes", []);
1109
+ const Z = /* @__PURE__ */ new Map(), Ft = [], gt = (D) => u.files[D], ct = (D, U) => {
1110
+ const M = D.lastIndexOf("/"), q = D.substring(0, M + 1) + "_rels/" + D.substring(M + 1, D.length) + ".rels";
1111
+ let d = U.get(q);
1112
+ return d || (d = ((p, J, V, K, E = null) => {
1113
+ if (!p) return null;
1114
+ const v = ie(p, J, V, K, E);
1115
+ if (!v) return null;
1116
+ const R = /* @__PURE__ */ new Map(), G = Object.keys(v), st = G.length;
1117
+ for (let it = 0; it < st; it++) {
1118
+ const Y = G[it], yt = v[Y];
1119
+ R.set(Y, yt);
1120
+ }
1121
+ return R;
1122
+ })(q, gt, f, A, $), U.set(q, d)), d;
1123
+ }, F = (D, U, M, q = Z) => {
1124
+ let d = ct(U, q).get(D), p = d?.target;
1125
+ if (!p) return null;
1126
+ if (d.targetMode === "External") return d.target;
1127
+ const J = U.lastIndexOf("/"), V = U.substring(0, J + 1);
1128
+ p.startsWith("/") || (p = V + p), p = ((v) => {
1129
+ const R = v.split(/\/+/);
1130
+ return R.reduce((G, st, it) => (st === "." ? G.splice(it, 1) : st === ".." && G.splice(it - 1, 2), G), R).join("/");
1131
+ })(p);
1132
+ const K = A?.getVisitorParamsState().get("dxfs");
1133
+ let E = q.get(p);
1134
+ if (!E) if (d.type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet") {
1135
+ const v = {};
1136
+ E = v;
1137
+ const R = async () => {
1138
+ const G = ((k, X, _t, ot, nt, at, kt) => {
1139
+ const h = new qe(), lt = new xe.TransposedBuilder();
1140
+ let _ = null;
1141
+ h.registerVisitor({ from: "autoFilter", to: "filter", openTag: (e) => {
1142
+ e.copyTo("ref", O);
1143
+ } }), h.registerVisitor({ from: "conditionalFormatting", to: {}, openTag: (e) => {
1144
+ const r = e.getParent();
1145
+ r.conditionals || (r.conditionals = []), r.conditionals.push(e.getSource());
1146
+ const c = e.getAttribute("sqref");
1147
+ c && (e.getSource().ref = c.split(" ").join(",")), e.copyTo("pivot", P);
1148
+ }, closeTag: (e) => {
1149
+ const r = e.getSource();
1150
+ if (r.rule) {
1151
+ const c = Object.keys(r.rule);
1152
+ for (let y = 0; y < c.length; y++) {
1153
+ const j = c[y];
1154
+ j !== "rule" && (r[j] = r.rule[j]);
1155
+ }
1156
+ }
1157
+ delete r.rule;
1158
+ } }), h.registerVisitor({ from: "cfRule", to: "rule", openTag: (e) => {
1159
+ const r = e.getParent();
1160
+ e.copyToObject(r, "type", O), e.copyToObject(r, "priority", L), e.copyToObject(r, "stopIfTrue", P);
1161
+ const c = e.getAttribute("dxfId", L);
1162
+ if (c !== null) {
1163
+ let y = ot?.get(c);
1164
+ y || (at?.(`Unable to load conditional color. Invalid dxfI: '${c}' at '${e.getPath()}'.`), y = {}), r.style = y;
1165
+ }
1166
+ e.copyToObject(r, "aboveAverage", P), e.copyToObject(r, "equalAverage", P), e.copyToObject(r, "stdDev", L), e.copyToObject(r, "bottom", P), e.copyToObject(r, "percent", P), e.copyToObject(r, "rank", L), e.copyToObject(r, "operator", O), e.copyToObject(r, "text", O), e.copyToObject(r, "timePeriod", O);
1167
+ } }), h.registerVisitor({ from: "colorScale", to: "colorScale" }), h.registerVisitor({ from: "dataBar", to: "dataBar", openTag: (e) => {
1168
+ e.copyTo("maxLength", L), e.copyTo("minLength", L), e.copyTo("showValue", P);
1169
+ } }), h.registerVisitor({ from: "iconSet", to: "iconSet", openTag: (e) => {
1170
+ e.copyTo("iconSet", O), e.copyTo("reverse", P), e.copyTo("showValue", P);
1171
+ } }), h.registerVisitor({ from: "formula", to: null, text: (e, r) => {
1172
+ const c = r.getParent();
1173
+ let y = c.formulas;
1174
+ y || (y = [], c.formulas = y), y.push(e);
1175
+ } }), h.registerVisitor({ from: "cfvo", to: {}, openTag: (e) => {
1176
+ const r = e.getParent();
1177
+ r.conditions || (r.conditions = []), r.conditions.push(e.getSource()), e.copyTo("type", O), e.copyTo("value", xt, "val"), e.copyTo("gte", P);
1178
+ } }), h.registerVisitor({ from: "color", to: {}, openTag: (e) => {
1179
+ const r = e.getParent();
1180
+ r.colors || (r.colors = []);
1181
+ const c = ue((y) => e.getAttribute(y));
1182
+ r.colors.push(c);
1183
+ } }), h.registerVisitor({ from: "filterColumn", to: "filterColumn", openTag: (e) => {
1184
+ const r = e.getParent();
1185
+ r.fields || (r.fields = []), r.fields.push(e.getSource()), e.copyTo("offset", L, "colId"), e.copyTo("hiddenButton", P), e.copyTo("showButton", P);
1186
+ } }), h.registerVisitor({ from: "colorFilter", to: "colorFilter", openTag: (e) => {
1187
+ const r = e.getParent();
1188
+ r.criteria || (r.criteria = []), r.criteria.push(e.getSource()), e.getSource().type = Rt.Type.Color, e.copyTo("cellColor", P), e.copyTo("styleId", L, "dxfId");
1189
+ } }), h.registerVisitor({ from: "dynamicFilter", to: "dynamicFilter", openTag: (e) => {
1190
+ const r = e.getParent();
1191
+ r.criteria || (r.criteria = []), r.criteria.push(e.getSource()), e.getSource().type = Rt.Type.Dynamic, e.copyTo("dynamicType", O, "type"), e.copyTo("val", xt), e.copyTo("maxVal", xt, "maxVal");
1192
+ } }), h.registerVisitor({ from: "iconFilter", to: "iconFilter", openTag: (e) => {
1193
+ const r = e.getParent();
1194
+ r.criteria || (r.criteria = []), r.criteria.push(e.getSource()), e.getSource().type = Rt.Type.Icon, e.copyTo("iconId", L), e.copyTo("iconSet", O);
1195
+ } }), h.registerVisitor({ from: "top10", to: "top10", openTag: (e) => {
1196
+ const r = e.getParent();
1197
+ r.criteria || (r.criteria = []), r.criteria.push(e.getSource()), e.getSource().type = Rt.Type.Top10, e.copyTo("filterVal", xt), e.copyTo("percent", P), e.copyTo("top", P), e.copyTo("val", xt);
1198
+ } }), h.registerVisitor({ from: "filters", to: "filters", openTag: (e) => {
1199
+ const r = e.getParent();
1200
+ r.criteria || (r.criteria = []), r.criteria.push(e.getSource()), e.getSource().type = Rt.Type.Items, e.copyTo("blank", P), e.copyTo("calendarType", O);
1201
+ } }), h.registerVisitor({ from: "dateGroupItem", to: "dateGroupItem", openTag: (e) => {
1202
+ const r = e.getParent();
1203
+ r.dateGroups || (r.dateGroups = []), r.dateGroups.push(e.getSource()), e.copyTo("group", O, "dateTimeGrouping"), e.copyTo("day", L), e.copyTo("hour", L), e.copyTo("minute", L), e.copyTo("month", L), e.copyTo("second", L), e.copyTo("year", L);
1204
+ } }), h.registerVisitor({ from: "filter", to: "filter", openTag: (e) => {
1205
+ const r = e.getParent();
1206
+ r.items || (r.items = []), r.items.push(e.getAttribute("val", xt));
1207
+ } }), h.registerVisitor({ from: "customFilters", to: "customFilters", openTag: (e) => {
1208
+ const r = e.getParent();
1209
+ r.criteria || (r.criteria = []), r.criteria.push(e.getSource()), e.getSource().type = Rt.Type.Custom, e.copyTo("and", P);
1210
+ } }), h.registerVisitor({ from: "customFilter", to: "customFilter", openTag: (e) => {
1211
+ const r = e.getParent();
1212
+ r.filters || (r.filters = []), r.filters.push(e.getSource()), e.copyTo("operator", O), e.copyTo("value", xt, "val");
1213
+ } }), h.registerVisitor({ from: "sortState", to: "sort", openTag: (e) => {
1214
+ e.copyTo("ref", O);
1215
+ } }), h.registerVisitor({ from: "sortCondition", to: "sortCondition", openTag: (e) => {
1216
+ const r = e.getParent();
1217
+ r.fields || (r.fields = []);
1218
+ const c = e.getSource();
1219
+ r.fields.push(c), e.copyTo("sortOn", O, "sortBy"), e.copyTo("dxfId", O, "sortBy"), e.copyTo("iconSet", O), e.copyTo("customList", O);
1220
+ const y = e.getAttribute("ref");
1221
+ if (y) {
1222
+ const j = wt.fastStringToRange(y, de).colStart, Et = wt.fastStringToRange(r.ref, de), Jt = Et.colStart;
1223
+ c.offset = Et ? j - Jt : j;
1224
+ }
1225
+ c.reverse = e.getAttribute("descending", P) ?? !1;
1226
+ } }), h.registerVisitor({ from: "AlternateContent", to: null });
1227
+ const Qt = (e) => {
1228
+ _ = e.getSource(), e.copyTo("topLeft", O, "topLeftCell");
1229
+ const r = Ge(e.getAttribute("defaultGridColor")), c = e.getAttribute("colorId");
1230
+ c === null || r || (e.getSource().gridLineColor = "index" + parseFloat(c)), e.copyTo("showZeros", P), e.copyTo("showFormulas", P), e.copyTo("zoomScale", L), e.copyTo("showRowHeaders", P, "showRowColHeaders"), e.copyTo("showColumnHeaders", P, "showRowColHeaders"), e.copyTo("showRowGridlines", P, "showGridLines"), e.copyTo("showColumnGridlines", P, "showGridLines");
1231
+ };
1232
+ h.registerVisitor({ from: "sheetView", to: "view", openTag: (e) => {
1233
+ Qt(e);
1234
+ }, closeTag: () => {
1235
+ _ = null;
1236
+ } }), h.registerVisitor({ from: "customSheetViews", to: "customSheetViews", openTag: (e) => {
1237
+ e.setSource([]);
1238
+ } }), h.registerVisitor({ from: "customSheetView", to: [], openTag: (e) => {
1239
+ Qt(e);
1240
+ }, closeTag: () => {
1241
+ _ = null;
1242
+ } }), h.registerVisitor({ from: "selection", to: "selection", openTag: (e) => {
1243
+ if (!_) return;
1244
+ e.copyTo("cell", O, "activeCell"), e.copyTo("rangeIndex", L, "activeCellId");
1245
+ const r = e.getAttribute("activeCell"), c = e.getAttribute("sqref");
1246
+ c && c !== r && (e.getSource().ranges = c.split(" "));
1247
+ } }), h.registerVisitor({ from: "pane", to: "pane", openTag: (e) => {
1248
+ if (_ && e.getAttribute("state") === "frozen") {
1249
+ const r = {};
1250
+ _.freezePanes = r, e.copyToObject(r, "topLeft", O, "topLeftCell");
1251
+ const c = _.topLeft ? wt.fastStringToCell(_.topLeft) : { colIndex: 0, rowIndex: 0 }, y = { colIndex: 0, rowIndex: 0 };
1252
+ e.copyToObject(y, "colIndex", L, "xSplit"), e.copyToObject(y, "rowIndex", L, "ySplit");
1253
+ const j = { colIndex: c.colIndex + y.colIndex, rowIndex: c.rowIndex + y.rowIndex };
1254
+ r.coords = wt.cellToString(j);
1255
+ }
1256
+ } }), h.registerVisitor({ from: "tabColor", to: null, openTag: (e) => {
1257
+ const r = ue((c) => e.getAttribute(c));
1258
+ r && (k.tabColor = r);
1259
+ } }), h.registerVisitor({ from: "pageSetUpPr", to: "pageSetUpPr", openTag: (e) => {
1260
+ } }), h.registerVisitor({ from: "outlinePr", to: "outlinePr", openTag: (e) => {
1261
+ } }), h.registerVisitor({ from: "pageMargins", to: "pageMargins", openTag: (e) => {
1262
+ } }), h.registerVisitor({ from: "pageSetup", to: "pageSetup", openTag: (e) => {
1263
+ } }), h.registerVisitor({ from: "printOptions", to: "printOptions", openTag: (e) => {
1264
+ } }), h.registerVisitor({ from: "mergeCells", to: "merges", openTag: (e) => {
1265
+ e.setSource([]);
1266
+ } }), h.registerVisitor({ from: "mergeCell", to: [], openTag: (e) => {
1267
+ const r = e.getAttribute("ref");
1268
+ e.setSource(r);
1269
+ } }), h.registerVisitor({ from: "hyperlinks", to: "hyperlinks", openTag: (e) => {
1270
+ e.setSource([]);
1271
+ } }), h.registerVisitor({ from: "hyperlink", to: [], openTag: (e) => {
1272
+ const r = e.getAttribute("r:id"), c = e.getAttribute("ref");
1273
+ if (!c) return void console.warn("No ref found for hyperlink");
1274
+ e.setKey(c);
1275
+ let y = r ? X(r) : "";
1276
+ if (typeof y != "string") return void console.warn("Invalid address ", y);
1277
+ const j = e.getAttribute("location");
1278
+ y.endsWith("\\") && (y = y.substring(0, y.length - 1));
1279
+ const Et = e.getAttribute("location");
1280
+ if (Et && (j && j !== Et && console.warn("display and location are different", j, Et), y += "#" + Et), !y) return void console.warn("No address found for hyperlink. r:id", r);
1281
+ let Jt;
1282
+ const oe = e.getAttribute("tooltip");
1283
+ Jt = oe ? { address: y, tooltip: oe } : y, e.setSource({ r: c, v: Jt });
1284
+ } }), h.registerVisitor({ from: "drawing", to: "movables", openTag: (e) => {
1285
+ const r = e.getAttribute("r:id");
1286
+ if (!r) return;
1287
+ const c = X(r);
1288
+ c ? e.setSource(c.movables) : console.warn("no drawing found for rId", r);
1289
+ } }), h.registerVisitor({ from: "tableParts", to: "tables", openTag: (e) => {
1290
+ e.setSource([]);
1291
+ } }), h.registerVisitor({ from: "tablePart", to: [], openTag: (e) => {
1292
+ const r = e.getAttribute("r:id");
1293
+ if (!r) return;
1294
+ const c = X(r);
1295
+ c ? e.setSource(c) : console.warn("no table found for rId", r);
1296
+ } }), h.registerVisitor({ from: "worksheet", to: "worksheet", openTag: (e) => {
1297
+ } }), h.registerVisitor({ from: "sheetProtection", to: "protection", openTag: (e) => {
1298
+ let r = !1;
1299
+ if (e.hasAttribute("sheet") && P(e.getAttribute("sheet")) && (r = !0), !r) return void e.setSource(void 0);
1300
+ const c = (j) => j === !0 || j === "1" || j === "on" || j === "true" || j === !1 || j === "0" || j === "off" || j === "false" || null;
1301
+ e.copyTo("autoFilter", c), e.copyTo("deleteColumns", c), e.copyTo("formatCells", c), e.copyTo("formatColumns", c), e.copyTo("formatRows", c), e.copyTo("insertColumns", c), e.copyTo("insertHyperlinks", c), e.copyTo("insertRows", c), e.copyTo("objects", c), e.copyTo("pivotTables", c), e.copyTo("scenarios", c), e.copyTo("selectUnlockedCells", c), e.copyTo("selectUnlockedCells", c), e.copyTo("sort", c);
1302
+ const y = {};
1303
+ e.copyToObject(y, "hash", O, "hashValue"), e.copyToObject(y, "algorithm", O, "algorithmName"), e.copyToObject(y, "salt", O, "saltValue"), e.copyToObject(y, "spinCount", L), Object.keys(y).length > 0 && (e.getSource().password = y);
1304
+ } }), h.registerVisitor({ from: "protectedRanges", to: "protectedRanges", openTag: (e) => {
1305
+ e.setSource({});
1306
+ } }), h.registerVisitor({ from: "protectedRange", to: {}, openTag: (e) => {
1307
+ const r = e.getAttribute("sqref");
1308
+ e.setKey(r), e.copyTo("name"), e.copyTo("securityDescriptor");
1309
+ const c = {};
1310
+ e.copyToObject(c, "hash", O, "hashValue"), e.copyToObject(c, "algorithm", O, "algorithmName"), e.copyToObject(c, "salt", O, "saltValue"), e.copyToObject(c, "spinCount", L), Object.keys(c).length > 0 && (e.getSource().password = c);
1311
+ } }), h.registerVisitor({ from: "sheetFormatPr", to: "sheetFormatPr", openTag: (e) => {
1312
+ e.copyToObject(k, "defaultColSize", xt, "defaultColWidth"), e.copyToObject(k, "outlineLevelCol", L, "outlineLevelCol");
1313
+ const r = e.getAttribute("customHeight");
1314
+ r !== "1" && r !== "true" || e.copyToObject(k, "defaultRowSize", xt, "defaultRowHeight"), e.copyToObject(k, "outlineLevelRow", L, "outlineLevelRow");
1315
+ } }), h.registerVisitor({ from: "cols", to: "cols", openTag: (e) => {
1316
+ e.setSource([]);
1317
+ } }), h.registerVisitor({ from: "col", to: [], openTag: (e) => {
1318
+ e.copyTo("min", (r) => parseInt(r) - 1), e.copyTo("max", (r) => parseInt(r) - 1), e.copyTo("sz", xt, "width"), e.copyTo("cs", P, "customWidth"), e.copyTo("h", P, "hidden"), e.copyTo("l", L, "outlineLevel"), e.copyTo("s", L, "style");
1319
+ } }), h.registerVisitor({ from: "oleObjects", to: null, openTag: (e) => {
1320
+ e.warn("'OLE Objects' are not supported.");
1321
+ } });
1322
+ let qt = null;
1323
+ const ye = { onOpenTag: (e) => {
1324
+ qt === null && (qt = "");
1325
+ }, onText: (e) => {
1326
+ qt += e;
1327
+ }, onEnd: () => {
1328
+ const e = _t(qt);
1329
+ return qt = null, e;
1330
+ }, onError: (e) => {
1331
+ } };
1332
+ return Qe(lt, k, h.createEventHandler(k, () => {
1333
+ }, at), at, ye, kt);
1334
+ })(v, (k, X = !1) => F(k, p, X) ?? null, ht, K, 0, (k) => {
1335
+ o && (k = p + ": " + k, o?.(k));
1336
+ }, W), st = he(p, gt), it = await (async (k, X = 8388608) => {
1337
+ await (async () => {
1338
+ if (typeof ReadableStream > "u") if (typeof window > "u") {
1339
+ const { ReadableStream: at } = await import("./BSS_RvWzDRX8_EJd.js");
1340
+ global.ReadableStream = at;
1341
+ } else console.warn("Browser does not support ReadableStream; consider loading a polyfill.");
1342
+ })();
1343
+ const _t = new TextDecoder("utf-8");
1344
+ let ot = 0;
1345
+ const nt = k instanceof Uint8Array ? k : new Uint8Array(k);
1346
+ return new ReadableStream({ pull(at) {
1347
+ if (ot >= nt.byteLength) return void at.close();
1348
+ const kt = nt.subarray(ot, Math.min(ot + X, nt.byteLength)), h = _t.decode(kt, { stream: ot + X < nt.byteLength });
1349
+ at.enqueue(h), ot += kt.length;
1350
+ } }).getReader();
1351
+ })(st);
1352
+ try {
1353
+ await se.parseStream(it, G, { xmlns: !1 });
1354
+ } catch (k) {
1355
+ throw console.warn(`Error parsing sheet: '${p}'`, k), new Error(`Error parsing sheet: '${p}'`, { cause: k });
1356
+ }
1357
+ const Y = ct(p, q);
1358
+ let yt, Wt = /* @__PURE__ */ new Map();
1359
+ if (Y) {
1360
+ const k = "http://schemas.microsoft.com/office/2017/10/relationships/threadedComment";
1361
+ let X;
1362
+ Y.forEach((ot, nt) => {
1363
+ ot.type === k && (yt = F(nt, p, !1, q)?.comments, yt && yt.forEach((at) => {
1364
+ Wt.set(at.id, at);
1365
+ }));
1366
+ });
1367
+ const _t = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";
1368
+ if (Y.forEach((ot, nt) => {
1369
+ ot.type === _t && (X = F(nt, p, !1, q));
1370
+ }), X || yt) {
1371
+ const ot = yt ?? [], nt = X?.comments;
1372
+ if (nt) {
1373
+ const at = X?.authors;
1374
+ for (let kt = 0; kt < nt.length; kt++) {
1375
+ const h = nt[kt];
1376
+ let lt = h.authorId !== void 0 ? at[h.authorId] : void 0;
1377
+ if ((!lt || lt.startsWith("tc=")) && (lt = Ue(lt.substring(3)), Wt.has(lt))) continue;
1378
+ let _ = ut.get(lt);
1379
+ _ || (_ = ft.get(lt)), _ || (_ = { id: re.uuidV4(), displayName: lt }, ft.set(_.displayName, _), ut.set(_.id, _)), lt = _?.id ?? null;
1380
+ const Qt = { id: re.uuidV4(), personId: lt, ref: h.ref, done: !1, asNote: !0, content: h.content };
1381
+ ot.push(Qt);
1382
+ }
1383
+ }
1384
+ v.comments = ot;
1385
+ }
1386
+ }
1387
+ };
1388
+ Ft.push(R());
1389
+ } else E = M ? he(p, gt, (v) => {
1390
+ const R = T.add({ buffer: v });
1391
+ return R.addReference(I), H.add(R), m.toResourceId(R);
1392
+ }, $) : ie(p, gt, f, A, $);
1393
+ return E;
1394
+ }, $ = { paramMap: W, getRefs: ct, getRef: F, parsedRefs: Z, onWarning: o, addPerson: (D) => null }, et = [];
1395
+ let vt = 0;
1396
+ u.Strings && (vt = parseInt(u.Strings.Unique ?? u.Strings.length ?? 0));
1397
+ const Xt = u.Strings ?? [];
1398
+ for (let D = 0; D < vt; D++) et.push(Xt[D]?.t ?? "");
1399
+ const Lt = /* @__PURE__ */ new Map();
1400
+ let Bt = vt;
1401
+ const ht = (D) => {
1402
+ const U = Lt.get(D);
1403
+ if (U !== void 0) return U;
1404
+ const M = Bt;
1405
+ return Lt.set(D, Bt++), et.push(D), M;
1406
+ }, ut = ($t("richstructure", u, f, A, $), $t("richdata", u, f, A, $), /* @__PURE__ */ new Map()), ft = /* @__PURE__ */ new Map(), mt = $t("people", u, f, A);
1407
+ let Q = null;
1408
+ if (mt.size > 0 && (Q = mt.entries().next()?.value?.[1]?.persons, Q)) {
1409
+ const D = Q.length;
1410
+ for (let U = 0; U < D; U++) {
1411
+ const M = Q[U];
1412
+ ut.set(M.id, M), ut.set(M.displayName, M);
1413
+ }
1414
+ }
1415
+ const dt = $t("themes", u, f, A, $);
1416
+ let Tt = null;
1417
+ if (dt && dt.entries) {
1418
+ let D = dt.entries().next();
1419
+ D?.value?.[1] && (Tt = D.value[1]);
1420
+ }
1421
+ const St = new we(Tt);
1422
+ let Dt = $t("styles", u, f, A, $).entries().next()?.value[1];
1423
+ Dt && (Dt = JSON.parse(ve(Dt)));
1424
+ const Ut = $t("workbooks", u, f, A, $);
1425
+ await Promise.all(Ft);
1426
+ const Nt = { ...Ut.entries().next().value[1], styles: Dt, theme: St.toJSON() };
1427
+ et.length > 0 && (Nt.strings = et), Q && Q.length > 0 && (Nt.people = Q);
1428
+ const Gt = { ...n, resources: T, json: Nt }, Zt = new Se(Gt);
1429
+ return H.forEach((D) => {
1430
+ D.deleteReference(I);
1431
+ }), m.endPersist(), Zt;
1432
+ } catch (u) {
1433
+ let A = "Unable to parse XLSX.";
1434
+ throw u instanceof Ae && (A = "Unable to open XLSX. There are too many rows or columns."), new Error(A, { cause: u });
1435
+ }
1436
+ }, toBufferXLSX: async (i, t) => {
1437
+ const s = await import("./1Jl9rrRJdbPsUP_1.js"), o = await i.toJSON(!0), n = s.utils.book_new();
1438
+ for (let a = 0; a < o.sheets.length; a++) {
1439
+ const l = o.sheets[a], g = s.utils.json_to_sheet([{}]);
1440
+ s.utils.book_append_sheet(n, g, l.name);
1441
+ const S = l.sheet, b = i.getSheetAt(a), x = b.getUsedRange();
1442
+ if (x ? (g["!ref"] = x.getA1(), x.forEach((C, w) => {
1443
+ const u = { t: "z" }, A = w.getCell().getStyle();
1444
+ if (!A.isNormal()) {
1445
+ let f = A.getNumberFormat();
1446
+ f !== Pt.Type.General && (f === Pt.Type.ShortDate ? f = "m/d/yyyy" : f === Pt.Type.MediumDate ? f = "d-mmm-yy" : f === Pt.Type.LongDate ? f = "[$-x-sysdate]dddd, mmmm dd, yyyy" : f === Pt.Type.ShortTime ? f = "h:mm" : f === Pt.Type.MediumTime ? f = "h:mm AM/PM" : f === Pt.Type.LongTime && (f = "h:mm:ss AM/PM"), u.z = f);
1447
+ }
1448
+ if (C !== null) switch (w.getType()) {
1449
+ case Vt.Number:
1450
+ u.t = "n", u.v = C;
1451
+ break;
1452
+ case Vt.String:
1453
+ u.t = "s", u.v = C;
1454
+ break;
1455
+ case Vt.Boolean:
1456
+ u.t = "b", u.v = C;
1457
+ break;
1458
+ case Vt.Error:
1459
+ u.t = "e", u.v = C.toString();
1460
+ case Vt.RichData:
1461
+ }
1462
+ g[w.getA1()] = u;
1463
+ })) : g["!ref"] = "A1:A1", S.merges?.length > 0) {
1464
+ const C = [];
1465
+ g["!merges"] = C;
1466
+ for (let w = 0; w < S.merges.length; w++) C.push(s.utils.decode_range(S.merges[w]));
1467
+ }
1468
+ if (S.cols?.length > 0) {
1469
+ const C = [];
1470
+ g["!cols"] = C;
1471
+ const w = S.cols, u = { width: S.defaultColSize ?? b.getColumnWidthAsFontUnit(b.getColumnHeaders().getDefaultSize()) };
1472
+ for (let A = 0; A < w.length; A++) {
1473
+ const f = w[A];
1474
+ for (let m = C.length; m <= f.min - 1; m++) C.push(u);
1475
+ const T = {};
1476
+ f.sz !== void 0 && (T.width = f.sz), f.h !== void 0 && (T.hidden = f.h), f.l !== void 0 && (T.level = f.l);
1477
+ for (let m = f.min; m <= f.max; m++) C.push(T);
1478
+ }
1479
+ }
1480
+ }
1481
+ return s.write(n, { type: "array", bookType: "xlsx" }), s.write(n, { type: "array", bookType: "xlsx" });
1482
+ } }, Symbol.toStringTag, { value: "Module" }));
1483
+ export {
1484
+ ts as a,
1485
+ Ge as b,
1486
+ Ye as c,
1487
+ ue as d,
1488
+ ss as i,
1489
+ es as p,
1490
+ Ue as r,
1491
+ Ke as t
1492
+ };