@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,844 @@
1
+ /**
2
+ * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.0.0
3
+ *
4
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
+ * License: The license can be found at https://www.sheetxl.com/license.
6
+ */
7
+ /**
8
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.0.0
9
+ *
10
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
11
+ * License: The license can be found at https://www.sheetxl.com/license.
12
+ */
13
+ /**
14
+ * @license @sheetxl/sdk - A high-performance, embeddable spreadsheet engine. - v0.0.0
15
+ *
16
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
17
+ * License: The license can be found at https://www.sheetxl.com/license.
18
+ */
19
+ /**
20
+ * @license @sheetxl/scripting - SheetXL scripting utilities including TypeScript compilation. - v0.0.0
21
+ *
22
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
23
+ * License: The license can be found at https://www.sheetxl.com/license.
24
+ */
25
+ /**
26
+ * @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.1.93
27
+ *
28
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
29
+ * License: The license can be found at https://www.sheetxl.com/license.
30
+ */
31
+ const h = "text/html", b = "text/plain", L = "image/png", Tt = Object.freeze({ left: 0, top: 0 }), Ct = Object.freeze({ left: 0, top: 0, bottom: 0, right: 0 }), Mt = Object.freeze({ x: 0, y: 0, width: 0, height: 0 });
32
+ Object.freeze(Object.defineProperty({ __proto__: null, EmptyBounds: Mt, EmptyRect: Ct, EmptyTopLeft: Tt }, Symbol.toStringTag, { value: "Module" }));
33
+ const m = "column", j = "row", Rt = Object.freeze({ colIndex: 0, rowIndex: 0 }), At = Object.freeze({ colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 }), yt = (e, t) => e.colStart === t.colStart ? e.rowStart - t.rowStart : e.colStart - t.colStart, gt = (e, t) => e.rowStart === t.rowStart ? e.colStart - t.colStart : e.rowStart - t.rowStart, Ft = (e, t) => e.rowEnd === t.rowEnd ? t.colEnd - e.colEnd : t.rowEnd - e.rowEnd, Lt = (e, t) => e.colEnd === t.colEnd ? t.rowEnd - e.rowEnd : t.colEnd - e.colEnd, J = (e, t) => e.colIndex === t.colIndex ? e.rowIndex - t.rowIndex : e.colIndex - t.colIndex, H = (e, t) => e.rowIndex === t.rowIndex ? e.colIndex - t.colIndex : e.rowIndex - t.rowIndex, bt = (e = j, t = !1) => t ? e !== m ? Ft : Lt : e !== m ? gt : yt, K = (e, t) => e === t || !(!e || !t) && e.rowIndex === t.rowIndex && e.colIndex === t.colIndex, D = (e, t) => e === t || !(!e || !t) && e.rowStart === t.rowStart && e.rowEnd === t.rowEnd && e.colStart === t.colStart && e.colEnd === t.colEnd, $ = (e, t) => !(!e || !t || e.colStart > t.colEnd || t.colStart > e.colEnd || e.rowStart > t.rowEnd || t.rowStart > e.rowEnd), Y = (e, t) => {
34
+ if (e === t) return !0;
35
+ if (!e || !t || e.length !== t.length) return !1;
36
+ for (let r = 0; r < e.length; r++) if (!D(e[r], t[r])) return !1;
37
+ return !0;
38
+ }, U = (e, t, r) => {
39
+ if (!e && !t) return null;
40
+ if (!e) return r ? t : { ...t };
41
+ if (!t) return r ? e : { ...e };
42
+ const n = Math.min(e.colStart, t.colStart), o = Math.min(e.rowStart, t.rowStart), a = Math.max(e.colEnd, t.colEnd), i = Math.max(e.rowEnd, t.rowEnd);
43
+ let l = r;
44
+ return l ? (l.colStart = n, l.rowStart = o, l.colEnd = a, l.rowEnd = i) : l = { colStart: n, rowStart: o, colEnd: a, rowEnd: i }, l;
45
+ }, Z = (e, t) => {
46
+ if (!t || t.length === 0) return e;
47
+ const r = { ...e };
48
+ for (let n = 0; n < t.length; n++) {
49
+ const o = t[n];
50
+ $(r, o) && (r.rowStart = Math.min(r.rowStart, o.rowStart), r.colStart = Math.min(r.colStart, o.colStart), r.rowEnd = Math.max(r.rowEnd, o.rowEnd), r.colEnd = Math.max(r.colEnd, o.colEnd));
51
+ }
52
+ return r;
53
+ }, Ut = [null, null], Pt = (e, t, r) => {
54
+ if (e[0].value === e[1].value) return t;
55
+ };
56
+ function X(e, t = 2, r, n = j, o) {
57
+ let a = [...e];
58
+ if (t <= 0 || e.length <= 1) return a;
59
+ let i = n === m, l = 0, s = !1;
60
+ do {
61
+ const c = a.sort(bt(i ? j : m));
62
+ a = [], a.push(c[0]);
63
+ const d = c.length;
64
+ let w = 0, u = c[0], f = u.colStart, p = u.rowStart, x = u.colEnd, _ = u.rowEnd;
65
+ for (let A = 1; A < d; A++) {
66
+ const g = c[A];
67
+ let G = !1;
68
+ if (G = i ? u && p === g.rowStart && _ === g.rowEnd && x + 1 === g.colStart : u && f === g.colStart && x === g.colEnd && _ + 1 === g.rowStart, G) {
69
+ let S = { colStart: f, rowStart: p, colEnd: i ? g.colEnd : x, rowEnd: i ? _ : g.rowEnd };
70
+ if (u.value !== void 0 && (S.value = u.value), r) {
71
+ const F = o ?? [null, null];
72
+ F[0] = u, F[1] = g, S = r(F, S, n);
73
+ }
74
+ if (S) {
75
+ a[w] = S, s = !0, u = S, f = u.colStart, p = u.rowStart, x = u.colEnd, _ = u.rowEnd;
76
+ continue;
77
+ }
78
+ }
79
+ a[++w] = g, u = g, f = u.colStart, p = u.rowStart, x = u.colEnd, _ = u.rowEnd;
80
+ }
81
+ l++, i = !i, l === 1 && (s = !0);
82
+ } while (l < t && s && a.length > 1);
83
+ return a;
84
+ }
85
+ Object.freeze(Object.defineProperty({ __proto__: null, EmptyCell: Rt, EmptyRange: At, cellToRange: (e, t) => {
86
+ if (!e) return null;
87
+ let r = t;
88
+ return r || (r = { ...e }, delete r.colIndex, delete r.rowIndex), r.colStart = e.colIndex ?? 0, r.rowStart = e.rowIndex ?? 0, r.colEnd = e.colIndex ?? 0, r.rowEnd = e.rowIndex ?? 0, r;
89
+ }, columnFirstCellComparator: J, columnFirstRangeComparator: yt, createCellComparator: (e = j, t = !1) => t ? e !== m ? (r, n) => r.rowIndex === n.rowIndex ? n.colIndex - r.colIndex : n.rowIndex - r.rowIndex : (r, n) => r.colIndex === n.colIndex ? n.rowIndex - r.rowIndex : n.colIndex - r.colIndex : e !== m ? H : J, createConflatingRanges: (e, t = !1) => {
90
+ const r = [];
91
+ let n, o, a = Number.MIN_SAFE_INTEGER, i = Number.MIN_SAFE_INTEGER;
92
+ return { append: (l, s, c) => {
93
+ let d = !0;
94
+ const w = c !== void 0;
95
+ if (w) {
96
+ const p = e ? e(o, c, t) : o === c ? c : void 0;
97
+ p === void 0 ? d = !1 : c = p;
98
+ }
99
+ if (d && s === i + 1 && l === a) return t ? n.rowEnd = s : n.colEnd = s, i = s, void (o = c);
100
+ n && r.push(n);
101
+ const u = t ? l : s, f = t ? s : l;
102
+ n = { colStart: u, rowStart: f, colEnd: u, rowEnd: f }, w && (n.value = c), a = l, i = s, o = c;
103
+ }, done: (l) => (n && (r.push(n), n = null), l ? X(r, 3, l === !0 ? Pt : l, t ? m : j, Ut) : r) };
104
+ }, createRangeComparator: bt, defaultRange: (e, t, r) => e ? r ? (r.colStart = e.colStart ?? t.colStart, r.rowStart = e.rowStart ?? t.rowStart, r.colEnd = e.colEnd ?? t.colEnd, r.rowEnd = e.rowEnd ?? t.rowEnd, r) : { colStart: e.colStart ?? t.colStart, rowStart: e.rowStart ?? t.rowStart, colEnd: e.colEnd ?? t.colEnd, rowEnd: e.rowEnd ?? t.rowEnd } : t, extendRangeToIntersectingRanges: Z, extendRangeToUnionRanges: (e, t) => {
105
+ if (!t || t.length === 0) return e;
106
+ let r = e, n = null;
107
+ for (; !D(r, n); ) n = r, r = Z(n, t);
108
+ return r;
109
+ }, indexOfCoords: (e, t) => {
110
+ const r = { colStart: e.colIndex, rowStart: e.rowIndex, colEnd: e.colIndex, rowEnd: e.rowIndex };
111
+ for (let n = t.length - 1; n >= 0; n--) if ($(r, t[n])) return n;
112
+ return -1;
113
+ }, intersectRanges: (e, t, r) => {
114
+ if (!e) return r ? t : { ...t };
115
+ if (!t) return r ? e : { ...e };
116
+ if (!e && !t || e.rowStart > t.rowEnd || e.rowEnd < t.rowStart || e.colStart > t.colEnd || e.colEnd < t.colStart) return null;
117
+ const n = Math.max(e.colStart, t.colStart), o = Math.max(e.rowStart, t.rowStart), a = Math.min(e.colEnd, t.colEnd), i = Math.min(e.rowEnd, t.rowEnd);
118
+ let l = r;
119
+ return l ? (l.colStart = n, l.rowStart = o, l.colEnd = a, l.rowEnd = i) : l = { colStart: n, rowStart: o, colEnd: a, rowEnd: i }, l;
120
+ }, isCellWithinRange: (e, t) => !(!e || !t || e.rowIndex < t.rowStart || e.rowIndex > t.rowEnd || e.colIndex < t.colStart || e.colIndex > t.colEnd), isEqualCells: K, isEqualRanges: D, isEqualRangesArrays: Y, isEqualSelectionCoords: (e, t) => e === t || !(!e || !t) && e.rangeIndex === t.rangeIndex && !!K(e.cell, t.cell) && Y(e.ranges, t.ranges), isRangeWithinRange: (e, t) => !(e.rowStart < t.rowStart || e.rowEnd > t.rowEnd || e.colStart < t.colStart || e.colEnd > t.colEnd), isRangesIntersect: $, isSingleCell: (e) => !!e && e.rowEnd === e.rowStart && e.colStart === e.colEnd, isValidRange: (e) => !(!e || typeof e.colStart != "number" || e.colStart < 0 || typeof e.colEnd != "number" || e.colEnd < e.colStart || typeof e.rowStart != "number" || e.rowStart < 0 || typeof e.rowEnd != "number" || e.rowEnd < e.rowStart), mergeRangedValues: X, rowFirstCellComparator: H, rowFirstRangeComparator: gt, sanitizeRange: (e) => e ? { colStart: e.colIndex ?? e.colStart ?? 0, rowStart: e.rowIndex ?? e.rowStart ?? 0, colEnd: e.colIndex ?? e.colEnd ?? 0, rowEnd: e.rowIndex ?? e.rowEnd ?? 0 } : null, translateRange: (e, t = -e.rowStart, r = -e.colStart, n) => n ? (n.colStart = e.colStart + r, n.rowStart = e.rowStart + t, n.colEnd = e.colEnd + r, n.rowEnd = e.rowEnd + t, n) : { colStart: e.colStart + r, rowStart: e.rowStart + t, colEnd: e.colEnd + r, rowEnd: e.rowEnd + t }, unionRanges: U, unionRangesArrays: (e, t, r) => {
121
+ if (!e || e.length === 0) return null;
122
+ if (e.length === 1 && !t) return e[0];
123
+ let n = e[0];
124
+ for (let o = 1; o < e.length; o++) n = U(n, e[o], r);
125
+ return t && (n = U(n, t, r)), n;
126
+ } }, Symbol.toStringTag, { value: "Module" }));
127
+ const kt = typeof Symbol == "function" && Symbol.for ? Symbol.for("react.element") : 60103;
128
+ function Nt(e) {
129
+ return /* @__PURE__ */ function(t) {
130
+ return !!t && typeof t == "object";
131
+ }(e) && !function(t) {
132
+ const r = Object.prototype.toString.call(t);
133
+ return r === "[object RegExp]" || r === "[object Date]" || t.$$typeof === kt;
134
+ }(e);
135
+ }
136
+ function I(e, t) {
137
+ return t.clone !== !1 && t.isMergeableObject(e) ? E((r = e, Array.isArray(r) ? [] : {}), e, t) : e;
138
+ var r;
139
+ }
140
+ function Bt(e, t, r) {
141
+ return e.concat(t).map(function(n) {
142
+ return I(n, r);
143
+ });
144
+ }
145
+ function Q(e) {
146
+ return Object.keys(e).concat((t = e, Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(t).filter(function(r) {
147
+ return Object.propertyIsEnumerable.call(t, r);
148
+ }) : []));
149
+ var t;
150
+ }
151
+ function tt(e, t) {
152
+ try {
153
+ return t in e;
154
+ } catch {
155
+ return !1;
156
+ }
157
+ }
158
+ function E(e, t, r) {
159
+ (r = r || {}).arrayMerge = r.arrayMerge || Bt, r.isMergeableObject = r.isMergeableObject || Nt, r.cloneUnlessOtherwiseSpecified = I;
160
+ const n = Array.isArray(t);
161
+ return n === Array.isArray(e) ? n ? r.arrayMerge(e, t, r) : function(o, a, i) {
162
+ const l = {};
163
+ return i.isMergeableObject(o) && Q(o).forEach(function(s) {
164
+ l[s] = I(o[s], i);
165
+ }), Q(a).forEach(function(s) {
166
+ var c, d;
167
+ tt(c = o, d = s) && (!Object.hasOwnProperty.call(c, d) || !Object.propertyIsEnumerable.call(c, d)) || (tt(o, s) && i.isMergeableObject(a[s]) ? l[s] = function(w, u) {
168
+ if (!u.customMerge) return E;
169
+ const f = u.customMerge(w);
170
+ return typeof f == "function" ? f : E;
171
+ }(s, i)(o[s], a[s], i) : l[s] = I(a[s], i));
172
+ }), l;
173
+ }(e, t, r) : I(t, r);
174
+ }
175
+ E.all = function(e, t) {
176
+ if (!Array.isArray(e)) throw new Error("first argument should be an array");
177
+ return e.reduce(function(r, n) {
178
+ return E(r, n, t);
179
+ }, {});
180
+ };
181
+ const zt = Object.freeze([]), qt = Object.freeze({}), et = (e) => e, R = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
182
+ let t = 16 * Math.random() | 0;
183
+ return (e === "x" ? t : 3 & t | 8).toString(16);
184
+ }), mt = (e, t) => e === t || !(!Array.isArray(e) || !Array.isArray(t) || e.length !== t.length) && e.every((r, n) => r === t[n]), O = (e) => typeof e == "object" && !Array.isArray(e) && e !== null, Et = (e) => typeof e != "object" || Array.isArray(e) || e === null ? e : (Object.keys(e).forEach(function(t) {
185
+ e[t] && typeof e[t] == "object" ? Et(e[t]) : e[t] !== null && e[t] !== void 0 || delete e[t], typeof e[t] == "object" && Object.keys(e[t]).length === 0 && delete e[t];
186
+ }), Object.keys(e).length === 0 ? null : e), Dt = (e, t) => !(e !== t && !mt(e, t) && !e.isEqual?.(t)), St = (e, t, r = Dt) => {
187
+ if (e == null || e === t) return null;
188
+ if (!e || typeof e != "object" || Array.isArray(e) || e.isImmutable?.()) return r(e, t) ? null : e;
189
+ const n = Object.keys(e);
190
+ if (n.length === 0) return null;
191
+ let o = !1;
192
+ for (let a = 0; a < n.length; a++) {
193
+ const i = n[a];
194
+ St(e[i], t?.[i], r) === null && (o = !0, delete e[i]);
195
+ }
196
+ return o && Object.keys(e).length === 0 ? null : void 0;
197
+ }, rt = typeof performance == "object" && typeof performance.now == "function" ? () => performance.now() : () => Date.now(), nt = (e) => e == null, ot = (e, t) => !(t.left > e.right || t.right < e.left || t.top > e.bottom || t.bottom < e.top), at = !(typeof window > "u" || !window.document || !window.document.createElement), y = { Windows: "windows", MacOS: "macos", IOS: "ios", Linux: "linux", Android: "android", Safari: "safari", Firefox: "firefox", Node: "node", Unknown: "unknown" }, T = () => {
198
+ if (vt()) return y.Node;
199
+ const e = globalThis.navigator !== void 0 && globalThis.navigator.userAgent ? globalThis.navigator.userAgent.toLowerCase() : "";
200
+ return e ? /(win32|win64|windows|wince)/i.test(e) ? y.Windows : /(macintosh|macintel|macppc|mac68k|macos)/i.test(e) ? y.MacOS : /(iphone|ipad|ipod)/i.test(e) ? y.IOS : /android/.test(e) ? y.Android : /linux/.test(e) ? y.Linux : /^((?!chrome|android|).)*safari/i.test(e) ? y.Safari : /^((?!chrome|android|Seamonkey).)*firefox/i.test(e) ? y.Firefox : y.Unknown : y.Unknown;
201
+ };
202
+ function vt() {
203
+ return typeof process < "u" && process.release?.name === "node" || (typeof process < "u" && process.browser, !1);
204
+ }
205
+ const it = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeElement || e?.contains(document.activeElement)), $t = Object.freeze(Object.defineProperty({ __proto__: null, EmptyArray: zt, EmptyObject: qt, OSType: y, arrayMove: function(e, t, r) {
206
+ const n = e.slice();
207
+ return n.splice(r < 0 ? n.length + r : r, 0, n.splice(t, 1)[0]), n;
208
+ }, asNumber: (e) => {
209
+ const t = 1 * e;
210
+ return Number.isFinite(t) ? t : 0;
211
+ }, camelToPrettyCase: (e) => e.length === 1 ? e.toUpperCase() : e.replace(/([A-Z])/g, " $1").replace(/^./, function(t) {
212
+ return t.toUpperCase();
213
+ }).trim(), canUseDOM: at, cancelTimeout: (e) => {
214
+ cancelAnimationFrame(e.id);
215
+ }, castToString: (e) => e == null || e === void 0 ? "" : typeof e != "string" ? "" + e : e, cloneObject: (e) => nt(e) ? e : JSON.parse(JSON.stringify(e)), consoleWithNoSource: (...e) => new Promise((t) => {
216
+ setTimeout(() => {
217
+ Function("console.log.apply(console, arguments)").apply(null, e), t();
218
+ });
219
+ }), debounce: function(e, t = 300, r = !1) {
220
+ let n, o, a, i, l = 0;
221
+ function s() {
222
+ let d = Date.now() - l;
223
+ d < t && d >= 0 ? n = setTimeout(s, t - d) : (n = null, r || (i = e.apply(a, o), a = o = null));
224
+ }
225
+ t == null && (t = 100);
226
+ const c = function() {
227
+ a = globalThis, o = arguments, l = Date.now();
228
+ var d = r && !n;
229
+ return n || (n = setTimeout(s, t)), d && (i = e.apply(a, o), a = o = null), i;
230
+ };
231
+ return c.clear = function() {
232
+ n && (clearTimeout(n), n = null);
233
+ }, c.flush = function() {
234
+ n && (i = e.apply(a, o), a = o = null, clearTimeout(n), n = null);
235
+ }, c;
236
+ }, deepEqual: function e(t, r) {
237
+ if (t === r) return !0;
238
+ if (t && r && typeof t == "object" && typeof r == "object") {
239
+ if (t.constructor !== r.constructor) return !1;
240
+ let n, o, a;
241
+ if (Array.isArray(t)) {
242
+ if (n = t.length, n != r.length) return !1;
243
+ for (o = n; o-- !== 0; ) if (!e(t[o], r[o])) return !1;
244
+ return !0;
245
+ }
246
+ if (t instanceof Map && r instanceof Map) {
247
+ if (t.size !== r.size) return !1;
248
+ for (o of t.entries()) if (!r.has(o[0])) return !1;
249
+ for (o of t.entries()) if (!e(o[1], r.get(o[0]))) return !1;
250
+ return !0;
251
+ }
252
+ if (t instanceof Set && r instanceof Set) {
253
+ if (t.size !== r.size) return !1;
254
+ for (o of t.entries()) if (!r.has(o[0])) return !1;
255
+ return !0;
256
+ }
257
+ if (ArrayBuffer.isView(t) && ArrayBuffer.isView(r)) {
258
+ if (n = t.length, n != r.length) return !1;
259
+ for (o = n; o-- !== 0; ) if (t[o] !== r[o]) return !1;
260
+ return !0;
261
+ }
262
+ if (t.constructor === RegExp) return t.source === r.source && t.flags === r.flags;
263
+ if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === r.valueOf();
264
+ if (t.toString !== Object.prototype.toString) return t.toString() === r.toString();
265
+ if (a = Object.keys(t), n = a.length, n !== Object.keys(r).length) return !1;
266
+ for (o = n; o-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(r, a[o])) return !1;
267
+ for (o = n; o-- !== 0; ) {
268
+ let i = a[o];
269
+ if (!(i === "_owner" && t.$$typeof || e(t[i], r[i]))) return !1;
270
+ }
271
+ return !0;
272
+ }
273
+ return t != t && r != r;
274
+ }, deepFreeze: function e(t) {
275
+ return Object.freeze(t), Object.keys(t).forEach((r) => {
276
+ typeof t[r] != "object" || t[r] === null || Object.isFrozen(t[r]) || e(t[r]);
277
+ }), t;
278
+ }, deepMerge: E, diffValues: (e, t) => {
279
+ const r = {}, n = Object.keys(t), o = n.length;
280
+ for (let a = 0; a < o; a++) {
281
+ const i = n[a];
282
+ e[i] !== t[i] && (e[i] === void 0 ? r[i] = t[i] : r[i] = e[i]);
283
+ }
284
+ return Object.keys(r).length === 0 ? null : r;
285
+ }, findEqualOrGreater: function(e, t, r = et) {
286
+ let n = 0, o = e.length - 1;
287
+ for (; n <= o; ) {
288
+ let a = Math.floor((n + o) / 2), i = r(e[a]);
289
+ if (i === t) return a;
290
+ i < t ? n = a + 1 : o = a - 1;
291
+ }
292
+ return n;
293
+ }, findEqualOrLesser: function(e, t, r = et) {
294
+ let n = e.length - 1, o = 0;
295
+ for (; n >= o; ) {
296
+ let a = Math.floor((n + o) / 2), i = r(e[a]);
297
+ if (i === t) return a;
298
+ i > t ? n = a - 1 : o = a + 1;
299
+ }
300
+ return n;
301
+ }, findNextStep: (e, t = !0, r = 15, n = 10, o = 400) => {
302
+ const a = Math.max(e - n, 0) + (t ? 1 : -1);
303
+ return Math.min(o, Math[t ? "ceil" : "floor"](a / r) * r + n);
304
+ }, getBuildEnv: () => "browser2-build", getDPI: () => {
305
+ let e = 1;
306
+ return typeof window == "object" && (e = window.devicePixelRatio || 1), e;
307
+ }, getFromPath: (e, t) => {
308
+ const r = t.split(".");
309
+ let n = e;
310
+ for (let o = 0; o < r.length; o++) {
311
+ const a = r[o];
312
+ if (!n) return null;
313
+ let i = n[a];
314
+ if (typeof i == "function" && (i = i.bind(n)()), !i || !O(i)) return i;
315
+ n = i;
316
+ }
317
+ return n ?? null;
318
+ }, getOS: T, hasFocus: it, isDefined: (e) => e != null, isEmpty: (e) => e == null || e === "", isEqualArrays: mt, isEqualBounds: (e, t) => e === t || !(e && !t || t && !e) && e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height, isEqualObjectKeys: (e, t) => {
319
+ if (e === t) return !0;
320
+ if (e && !t || t && !e) return !1;
321
+ const r = Object.keys(e);
322
+ if (r.length !== Object.keys(t).length) return !1;
323
+ for (let n = 0; n < r.length; n++) if (e[r[n]] !== t[r[n]]) return !1;
324
+ return !0;
325
+ }, isNode: vt, isNullOrUndefined: nt, isNumeric: (e) => {
326
+ const t = 1 * e;
327
+ return Number.isFinite(t) && typeof t == "number";
328
+ }, isObject: O, isPromiseLike: (e) => !!e && typeof e.then == "function", isRectInsideRect: (e, t) => e.top >= t.top && e.bottom <= t.bottom && e.left >= t.left && e.right <= t.right, isRectIntersect: ot, mergeContentful: (...e) => {
329
+ const t = e.length;
330
+ if (t > 0 && e[t - 1] !== void 0 && !O(e[t - 1])) return e[t - 1];
331
+ let r = e[0] || {};
332
+ for (let n = 1; n < t; n++) r = E(r, e[n] || {}, { arrayMerge: (o, a) => [...a] });
333
+ return r;
334
+ }, nextTick: (e) => {
335
+ typeof window < "u" && typeof window.requestAnimationFrame == "function" ? window.requestAnimationFrame(() => {
336
+ e();
337
+ }) : (typeof setImmediate == "function" ? setImmediate : setTimeout)(() => {
338
+ e();
339
+ });
340
+ }, openFileDialog: (e = "*.*") => new Promise((t, r) => {
341
+ if (!at) return void r("Unable to open dialog with no dom.");
342
+ const n = document.createElement("input");
343
+ n.type = "file", n.accept = e;
344
+ let o = null, a = !1;
345
+ globalThis.addEventListener?.("focus", () => {
346
+ setTimeout(() => {
347
+ o || a || (a = !0, t(null));
348
+ }, 1e3);
349
+ }, { once: !0, passive: !0 }), n.onchange = () => {
350
+ if (o = n.files[0], o) {
351
+ if (a) return void console.warn("File open detected after faux cancel.", o);
352
+ t(o);
353
+ }
354
+ }, n.autofocus = !0, n.click();
355
+ }), rafThrottle: (e) => {
356
+ let t, r = !1, n = function() {
357
+ r = !1, e(t);
358
+ };
359
+ return function(o) {
360
+ t = o, t && t.persist && t.persist(), r || (r = !0, requestAnimationFrame(n));
361
+ };
362
+ }, removeEmptyProperties: Et, removeEqualValues: St, removeListenerAll: (e) => {
363
+ if (!e) return [];
364
+ for (let t = 0; t < e.length; t++) e[t] && e[t]();
365
+ return [];
366
+ }, requestTimeout: (e, t) => {
367
+ const r = rt(), n = { id: requestAnimationFrame(function o() {
368
+ rt() - r >= t ? e.call(null) : n.id = requestAnimationFrame(o);
369
+ }) };
370
+ return n;
371
+ }, roundAccurately: (e, t = 0) => {
372
+ if (e == null || !isFinite(e)) return null;
373
+ const r = 10 ** t;
374
+ return Number(Math.round(e * r) / r);
375
+ }, setToPath: (e, t, r) => {
376
+ const n = t.split(".");
377
+ let o = e;
378
+ if (!o) throw new Error("Can not set path to a null path.");
379
+ for (let a = 0; o && a < n.length - 1; a++) {
380
+ const i = n[a];
381
+ let l = o[i];
382
+ if (l == null && (l = {}, o[i] = l), !O(l)) throw new Error("Can not set path to a non object path.");
383
+ o = l;
384
+ }
385
+ if (typeof r != "number" && typeof r != "boolean" && typeof r != "string" && !O(r)) throw new Error(`Can not set path to ${r} that is not a a supported primitive.`);
386
+ return o[n[n.length - 1]] = r, e;
387
+ }, splitNumber: (e) => {
388
+ let t = Math.abs(e);
389
+ if (isNaN(t) || !isFinite(e)) return null;
390
+ let r = 0 | t, n = t - r, o = 0, a = 0, i = 1;
391
+ if (n > 5e-8) for (; a < 8 && Math.abs(o / i - n) > 5e-8; ) a++, i *= 10, o = Math.round(n * i);
392
+ return { ip: Math.trunc(e), fp: o, ipLength: Math.ceil(Math.log10(r + 1)), fpLength: a };
393
+ }, subtractRect: (e, t, r = !1) => {
394
+ if (!t) return [e];
395
+ if (!ot(e, t)) return [];
396
+ const n = [];
397
+ let o = e;
398
+ const a = () => {
399
+ t.top > o.top && t.top < o.bottom && (n.push({ ...o, bottom: t.top }), o = { ...o, top: t.top });
400
+ }, i = () => {
401
+ t.bottom > o.top && t.bottom < o.bottom && (n.push({ ...o, top: t.bottom }), o = { ...o, bottom: t.bottom });
402
+ }, l = () => {
403
+ t.right > o.left && t.right < o.right && (n.push({ ...o, left: t.right }), o = { ...o, right: t.right });
404
+ }, s = () => {
405
+ t.left > o.left && t.left < o.right && (n.push({ ...o, right: t.left }), o = { ...o, left: t.left });
406
+ };
407
+ return r ? (s(), l(), a(), i()) : (a(), i(), l(), s()), n;
408
+ }, textToKey: (e) => e.replace(/[^a-zA-Z0-9]/g, "").toLowerCase(), throttle: function(e, t) {
409
+ let r = null;
410
+ return (...n) => {
411
+ const o = Date.now();
412
+ (!r || o - r >= t) && (r = o, e(...n));
413
+ };
414
+ }, toSafeJSON: function e(t) {
415
+ if (t === null || typeof t != "object") return t;
416
+ if (typeof t.toJSON == "function") return t.toJSON();
417
+ if (Array.isArray(t)) return t.map((n) => e(n));
418
+ if (typeof t.toString == "function" && t.toString !== Object.prototype.toString) return t.toString();
419
+ const r = {};
420
+ for (const n in t) t.hasOwnProperty(n) && (r[n] = e(t[n]));
421
+ return r;
422
+ }, transpose: (e) => {
423
+ if (!e) return e;
424
+ const t = e.length, r = e[0].length, n = [];
425
+ for (let o = 0; o < r; o++) n[o] = Array(t);
426
+ for (let o = 0; o < t; o++) for (let a = 0; a < r; a++) n[a][o] = e[o][a];
427
+ return n;
428
+ }, uuidV4: R, validEnumValue: (e, t) => {
429
+ if (!Object.values(e).includes(t)) throw new Error(`Invalid type: ${t ?? "null"}. Must be one of: ${Object.values(t).join(", ")}.`);
430
+ }, whenFocus: async (e, t = !1) => new Promise((r) => {
431
+ it(e, t) ? r(!0) : e.addEventListener("focusin", () => {
432
+ r(!0);
433
+ }, { once: !0 }), e.focus();
434
+ }) }, Symbol.toStringTag, { value: "Module" }));
435
+ Object.freeze(Object.defineProperty({ __proto__: null, MESSAGE_ERROR_INVALID_ARG: (e) => `Invalid argument: '${e}'.` }, Symbol.toStringTag, { value: "Module" }));
436
+ const xt = (e) => {
437
+ const t = new Uint8Array(e), r = t.byteLength;
438
+ let n = "";
439
+ for (let o = 0; o < r; o++) n += String.fromCharCode(t[o]);
440
+ if (typeof window < "u" && typeof globalThis.btoa == "function") return globalThis.btoa(n);
441
+ if (typeof Buffer < "u") return Buffer.from(n, "binary").toString("base64");
442
+ throw new Error("Unsupported environment");
443
+ }, W = (e) => new Promise((t, r) => {
444
+ if (e) if (typeof FileReader < "u") {
445
+ const n = new FileReader();
446
+ n.onload = () => {
447
+ t(n.result);
448
+ }, n.onerror = () => {
449
+ r(n.error);
450
+ }, n.readAsText(e);
451
+ } else if (typeof Buffer < "u") {
452
+ const n = (o) => Buffer.from(o).toString("utf-8");
453
+ e.arrayBuffer().then((o) => {
454
+ t(n(o));
455
+ }).catch((o) => {
456
+ r(o);
457
+ });
458
+ } else r(new Error("Unsupported environment"));
459
+ else t("");
460
+ });
461
+ Object.freeze(Object.defineProperty({ __proto__: null, DEFAULT_MIME_TYPE: "*/*", arrayBufferToBase64: xt, base64ToArrayBuffer: (e) => {
462
+ const t = typeof window < "u" && typeof globalThis.atob == "function" ? globalThis.atob(e) : Buffer.from(e, "base64").toString("binary"), r = t.length, n = new Uint8Array(r);
463
+ for (let o = 0; o < r; o++) n[o] = t.charCodeAt(o);
464
+ return n.buffer;
465
+ }, blobToString: W }, Symbol.toStringTag, { value: "Module" }));
466
+ const _t = "data:image/png;base64,", Ot = "Unable to resolve image.", lt = (e) => new Promise(async (t, r) => {
467
+ let n = null;
468
+ try {
469
+ n = new Image(), n.src = e, n.addEventListener("load", function() {
470
+ t({ width: n.naturalWidth, height: n.naturalHeight });
471
+ }, { once: !0 }), n.addEventListener("error", function() {
472
+ URL.revokeObjectURL(e), r("Invalid Image");
473
+ }, { once: !0 }), await n.decode("sync");
474
+ } catch {
475
+ n?.src && URL.revokeObjectURL(n.src);
476
+ }
477
+ n || r(Ot);
478
+ }), P = "image/svg+xml";
479
+ var st, ct;
480
+ Object.freeze(Object.defineProperty({ __proto__: null, DATA_URL_PNG_PREFIX: _t, getImageDataUrl: (e, t = 1) => new Promise(async (r, n) => {
481
+ let o = null;
482
+ try {
483
+ o = new Image(), o.src = e, o.addEventListener("load", function() {
484
+ try {
485
+ const a = document.createElement("canvas");
486
+ a.width = o.naturalWidth, a.height = o.naturalHeight, a.getContext("2d").drawImage(o, 0, 0);
487
+ const i = a.toDataURL("image/png", t);
488
+ r({ elemImg: o, dataUrl: i });
489
+ } catch (a) {
490
+ URL.revokeObjectURL(e), n(a);
491
+ }
492
+ }, { once: !0 }), o.addEventListener("error", function() {
493
+ URL.revokeObjectURL(e), n("Invalid Image");
494
+ }, { once: !0 }), await o.decode("sync");
495
+ } catch {
496
+ o?.src && URL.revokeObjectURL(o.src);
497
+ }
498
+ o || n(Ot);
499
+ }), loadImageDetails: async (e, t = null) => {
500
+ let r = null;
501
+ const n = async () => {
502
+ try {
503
+ const a = t ?? "image/*", i = URL.createObjectURL(new Blob([e], { type: a })), l = await lt(i);
504
+ r = { mimeType: a, naturalDimensions: l, asUrl: i };
505
+ } catch {
506
+ }
507
+ }, o = async () => {
508
+ try {
509
+ const a = new TextDecoder().decode(e), i = URL.createObjectURL(new Blob([a], { type: P })), l = await lt(i);
510
+ r = { mimeType: t ?? P, naturalDimensions: l, asUrl: i, asSVGText: a };
511
+ } catch {
512
+ }
513
+ };
514
+ if (t === P ? await o() : t.startsWith("image/") ? await n() : (await n(), r || await o()), !r) throw new Error("Failed to load image");
515
+ return r;
516
+ } }, Symbol.toStringTag, { value: "Module" })), (ct = st || (st = {})).resolveTypedUpdates = (e, t, r, n) => {
517
+ if (e === null) return e;
518
+ if (e === void 0) return n;
519
+ let o = e;
520
+ if (t?.shorthand) {
521
+ const s = t?.shorthand(e, r);
522
+ s !== void 0 && (o = s);
523
+ }
524
+ if (o !== null && t?.getSubType) {
525
+ const s = t.getSubType(o);
526
+ s && (t = s);
527
+ }
528
+ const a = t?.properties, i = t?.arrayType ?? !1;
529
+ let l = o;
530
+ if (t && t.merge && l && n) l = t.merge(l, n, r);
531
+ else if (!i && a) {
532
+ const s = Object.keys({ ...o, ...n });
533
+ l = null;
534
+ for (let c = 0; c < s.length; c++) {
535
+ const d = s[c];
536
+ let w, u = o[d];
537
+ if (u !== void 0) {
538
+ const f = a[d];
539
+ w = f ? (0, ct.resolveTypedUpdates)(u, f, r, n?.[d]) : u;
540
+ } else w = n?.[d];
541
+ w != null && (l = l ?? {}, l[d] = w);
542
+ }
543
+ }
544
+ return l;
545
+ };
546
+ const ut = `The Safari browser does not support advanced copy and paste.
547
+ Copy and paste will be limited to within the browser tab.
548
+
549
+ Please use Chrome or Edge if external copy and paste is required.`, k = `You do not have permissions to access the clipboard.
550
+ All copy and paste operations will be limited to the browser tab.`, It = { Safari: `The Safari browser does not support advanced copy and paste.
551
+ Copy and paste will be limited to within the browser tab.
552
+
553
+ Please use Chrome or Edge if external copy and paste is required.`, Perms: k, PermsWrite: T() === y.Safari ? ut : k, PermsRead: T() === y.Safari ? ut : k }, N = async () => new Promise((e) => {
554
+ document.hasFocus() ? e() : globalThis.addEventListener?.("focus", () => {
555
+ e();
556
+ }, { once: !0 }), document.activeElement.focus?.();
557
+ }), B = async (e, t, r) => {
558
+ if (T() === y.Safari) return await r(new Error(It.Safari));
559
+ try {
560
+ const n = async (i) => {
561
+ try {
562
+ return await i();
563
+ } catch (l) {
564
+ if (l.message?.includes("Document is not focused")) return !1;
565
+ throw l;
566
+ }
567
+ }, o = await globalThis?.navigator?.permissions?.query({ name: e, allowWithoutGesture: !0, allowWithoutSanitization: !0 });
568
+ let a = !1;
569
+ if (o.state === "prompt" && (a = await n(t)), a || o.state !== "granted" || (a = await t()), !a) return await r(new Error(o.state));
570
+ } catch (n) {
571
+ return n.message === "No valid data on clipboard" || n.name === "DataError" ? void 0 : await r(n);
572
+ }
573
+ }, jt = async (e) => {
574
+ try {
575
+ return await e.read({ unsanitized: [h] });
576
+ } catch {
577
+ }
578
+ return await e.read();
579
+ };
580
+ if (!globalThis.ClipboardItem) {
581
+ const e = (r, n) => new Blob([n], { type: r });
582
+ class t {
583
+ constructor(n, o) {
584
+ this._items = {}, this._types = Object.keys(n);
585
+ const a = {}, i = Object.keys(n);
586
+ for (let l = 0; l < i.length; l++) {
587
+ const s = i[l];
588
+ let c = n[s];
589
+ a[s] = typeof c == "string" ? e(s, c) : c;
590
+ }
591
+ this._items = a, this._presentationStyle = o?.presentationStyle ?? "unspecified";
592
+ }
593
+ get types() {
594
+ return this._types;
595
+ }
596
+ getType(n) {
597
+ return Promise.resolve(this._items[n]);
598
+ }
599
+ supports(n) {
600
+ return !0;
601
+ }
602
+ }
603
+ globalThis.ClipboardItem = t;
604
+ }
605
+ const V = async (e, t = h) => new Promise(async (r, n) => {
606
+ try {
607
+ const o = await (async (a, i) => {
608
+ if (!a) return null;
609
+ const l = await jt(a);
610
+ let s = !1;
611
+ for (let c = 0; !s && l && c < l.length; c++) if (s = l[c].types.includes(i), s) return await l[c].getType(i);
612
+ return s ? void 0 : null;
613
+ })(e, t);
614
+ if (o) {
615
+ const a = new FileReader();
616
+ a.onload = () => {
617
+ r(a.result);
618
+ }, a.onerror = () => {
619
+ r("");
620
+ }, a.readAsText(o);
621
+ } else r("");
622
+ } catch (o) {
623
+ n(o);
624
+ }
625
+ }), dt = async (e, t = h) => {
626
+ const r = await V(e, t);
627
+ if (!r) return null;
628
+ let n = null;
629
+ try {
630
+ n = new DOMParser().parseFromString(r, h);
631
+ } catch {
632
+ console.warn("Can't parse html from clipboard.");
633
+ }
634
+ return n;
635
+ }, C = "clipboard-uuid", v = "web text/uuid", ft = (e) => `<div style="display:none" ${C}="${e}"/>`, Wt = (e, t) => {
636
+ let r = null;
637
+ try {
638
+ const n = new DOMParser().parseFromString(t, h);
639
+ n.body.firstElementChild.setAttribute(C, e), r = n.getElementsByTagName("body")[0].innerHTML;
640
+ } catch (n) {
641
+ console.warn("Can't embed uuid.", n);
642
+ }
643
+ return r;
644
+ }, pt = (e, t) => {
645
+ if (!t || !e) return !1;
646
+ try {
647
+ const r = t.querySelectorAll(`[${C}="${e}"]`);
648
+ if (r && r.length === 1) return !0;
649
+ if (t.querySelector("parsererror")) throw new Error("We are unable to parse node");
650
+ return !1;
651
+ } catch {
652
+ return !1;
653
+ }
654
+ };
655
+ class wt {
656
+ constructor(t) {
657
+ if (t?.nativeClipboard === void 0 || t?.nativeClipboard === !0) try {
658
+ this._nativeClipboard = globalThis?.navigator.clipboard;
659
+ } catch {
660
+ t?.nativeClipboard === !0 && console.warn("NativeClipboard option set to true but no native clipboard available.");
661
+ }
662
+ else this._nativeClipboard = t?.nativeClipboard === !1 ? null : t?.nativeClipboard;
663
+ this._disableCheckOnFocus = t?.disableCheckOnFocus ?? !1, this._init();
664
+ }
665
+ async _checkForChanges() {
666
+ this._nativeClipboard && this._state && !this._disableCheckOnFocus && await B("clipboard-read", async () => {
667
+ await N();
668
+ const t = await V(this._nativeClipboard, v);
669
+ if (!this._state || t && t === this._state.uuid) return !0;
670
+ const r = await dt(this._nativeClipboard, h);
671
+ return !this._state || (pt(this._state.uuid, r) || this.clear(), !0);
672
+ }, async (t) => {
673
+ t?.message === "denied" || t.message?.includes("Document is not focused") || T() === y.Safari || console.warn("Unable to detect clipboard changes: ", t);
674
+ });
675
+ }
676
+ _init() {
677
+ const t = this;
678
+ this._listeners = /* @__PURE__ */ new Map(), this._listenersCapture = /* @__PURE__ */ new Map(), this._state = null, this._nativeClipboard && (this._onFocus = () => {
679
+ t._checkForChanges();
680
+ }, this._onBlur = () => {
681
+ globalThis.addEventListener?.("focus", t._onFocus, { once: !0 });
682
+ }, globalThis.addEventListener?.("blur", this._onBlur), this._nativeClipboard.addEventListener("clipboardchange", (r) => {
683
+ t._checkForChanges();
684
+ }));
685
+ }
686
+ async read() {
687
+ if (!this._nativeClipboard) return this._state?.items ?? null;
688
+ const t = this;
689
+ return await B("clipboard-read", async () => {
690
+ if (await N(), this._state?.uuid) {
691
+ const r = await V(this._nativeClipboard, v);
692
+ if (r && r === t._state.uuid) return !0;
693
+ const n = await dt(this._nativeClipboard, h);
694
+ if (pt(t._state?.uuid, n)) return !0;
695
+ }
696
+ return t._state = { items: await jt(this._nativeClipboard), uuid: null, ref: null }, this.dispatchEvent(new Event("clipboardread")), !0;
697
+ }, async (r) => {
698
+ this.dispatchEvent(new Event("clipboarderrorread"));
699
+ }), this._state?.items ?? [];
700
+ }
701
+ async write(t) {
702
+ return this._write({ uuid: R(), items: t, ref: null });
703
+ }
704
+ async _write(t) {
705
+ if (!this._nativeClipboard) return this._state = t, this.dispatchEvent(new Event("clipboardwrite")), this.dispatchEvent(new Event("clipboardchange")), null;
706
+ const r = this, n = [], o = t.uuid;
707
+ let a = t.items ?? [];
708
+ const i = () => {
709
+ r._state = { uuid: o, ref: t.ref, items: n }, r.dispatchEvent(new Event("clipboardwrite")), r.dispatchEvent(new Event("clipboardchange"));
710
+ };
711
+ await B("clipboard-write", async () => {
712
+ await N(), o && a.length === 0 && (a.push(new ClipboardItem({ [v]: new Blob([o], { type: v }) })), a.push(new ClipboardItem({ [h]: new Blob([ft(o)], { type: h }) })));
713
+ for (let l = 0; l < Math.min(1, a.length); l++) {
714
+ const s = a[l];
715
+ let c = s.types.indexOf(h), d = null;
716
+ if (c !== -1) {
717
+ const f = await s.getType(h);
718
+ d = await W(f), d && (d = Wt(o, d));
719
+ }
720
+ if (!d && s.types.includes(b)) {
721
+ const f = await s.getType(b);
722
+ if (f) {
723
+ let p = null;
724
+ typeof f == "string" ? (console.warn("text as string", f), p = f) : p = await W(f), p && (d = `<div ${C}="${o}">${p}</div>`);
725
+ }
726
+ }
727
+ if (!d && s.types.includes(L)) {
728
+ const f = await s.getType(L), p = xt(await f.arrayBuffer());
729
+ d = `<div ${C}="${o}"><img src="${_t + p}"/></div>`;
730
+ }
731
+ !d && o && (d = ft(o));
732
+ const w = new Blob([d ?? ""], { type: h }), u = {};
733
+ for (let f = 0; f < s.types.length; f++) {
734
+ const p = s.types[f];
735
+ u[p] = f === c ? w : s.getType(p);
736
+ }
737
+ d && c === -1 && (u[h] = w), o && (u[v] = new Blob([o], { type: v })), n.push(new ClipboardItem(u));
738
+ }
739
+ try {
740
+ n && n.length !== 0 ? await this._nativeClipboard.write(n) : await (async (l) => {
741
+ l && await l.writeText("");
742
+ })(this._nativeClipboard);
743
+ } catch (l) {
744
+ l.message?.includes("Document is not focused") || console.warn("Unable to write to native clipboard: ", l);
745
+ }
746
+ return i(), !0;
747
+ }, async (l) => {
748
+ this.dispatchEvent(new Event("clipboarderrorwrite")), i();
749
+ });
750
+ }
751
+ async writeReference(t) {
752
+ if (!t) return void this.clear();
753
+ let r = null;
754
+ const n = {};
755
+ try {
756
+ const a = await t.toText?.() ?? null;
757
+ a && (n[b] = new Blob([a ?? ""], { type: b }));
758
+ } catch (a) {
759
+ r = a;
760
+ }
761
+ try {
762
+ const a = await t.toHtml?.() ?? null;
763
+ a && (n[h] = new Blob([a], { type: h }));
764
+ } catch (a) {
765
+ r = a, console.warn("export to html", a);
766
+ }
767
+ try {
768
+ const a = await t.toImage?.() ?? null;
769
+ a && (n[L] = a);
770
+ } catch (a) {
771
+ r = a, console.warn("export to png", a);
772
+ }
773
+ const o = this._write({ uuid: R(), ref: t, items: Object.keys(n).length > 0 ? [new ClipboardItem(n)] : null });
774
+ if (r) throw r;
775
+ return o;
776
+ }
777
+ clear(t = !1) {
778
+ this._state && (this._state = null, t && this._write({ uuid: null, ref: null, items: null }), this.dispatchEvent(new Event("clipboardwrite")), this.dispatchEvent(new Event("clipboardchange")));
779
+ }
780
+ async readReference() {
781
+ return await this.read(), this._state?.ref ?? null;
782
+ }
783
+ readText() {
784
+ return new Promise(async (t, r) => {
785
+ const n = await this.read();
786
+ let o = null;
787
+ for (let i = 0; !o && n && i < n.length; i++) n[i].types.includes(b) && (o = await n[i].getType(b));
788
+ if (!o) return void t("");
789
+ const a = new FileReader();
790
+ a.onload = () => {
791
+ t(a.result);
792
+ }, a.readAsText(o), a.onerror = (i) => {
793
+ r(i);
794
+ };
795
+ });
796
+ }
797
+ async writeText(t) {
798
+ const r = [new ClipboardItem({ [b]: new Blob([t], { type: b }) })];
799
+ return this._write({ uuid: R(), items: r, ref: null });
800
+ }
801
+ addEventListener(t, r, n = {}) {
802
+ const o = n?.capture ? this._listenersCapture : this._listeners;
803
+ let a = o.get(t);
804
+ a || (a = /* @__PURE__ */ new Map(), o.set(t, a)), a.set(r, typeof n == "boolean" ? {} : n);
805
+ }
806
+ dispatchEvent(t) {
807
+ if (!t) return;
808
+ const r = (n) => {
809
+ const o = n.get(t.type);
810
+ o && o.forEach((a, i) => {
811
+ try {
812
+ typeof i == "function" ? i(t) : i.handleEvent && i.handleEvent(t), a.once && o.delete(i);
813
+ } catch (l) {
814
+ console.warn(l);
815
+ }
816
+ });
817
+ };
818
+ return r(this._listenersCapture), r(this._listeners), !0;
819
+ }
820
+ removeEventListener(t, r, n) {
821
+ const o = n?.capture ? this._listenersCapture : this._listeners, a = o.get(t);
822
+ a && (a.delete(r), a.size === 0 && o.delete(t));
823
+ }
824
+ close() {
825
+ globalThis.removeEventListener?.("focus", this._onFocus), globalThis.removeEventListener?.("blur", this._onBlur);
826
+ }
827
+ }
828
+ var z;
829
+ (z = wt || (wt = {})).ErrorMessages = It, z.Global = new z();
830
+ let ht = null, q = null, M = null;
831
+ const Vt = Object.freeze({ compileTypescript: async function(e) {
832
+ if (!e?.source) return null;
833
+ if (q && $t.deepEqual(q, e)) return ht;
834
+ const t = await async function() {
835
+ if (M) return M;
836
+ const { TypeScriptCompiler: n } = await import("./CkhSGQneqlTRflfQ.js");
837
+ return M = new n(), M;
838
+ }(), r = await t.compileModule(e);
839
+ return ht = r, q = e, r;
840
+ } }), Gt = Object.freeze(Object.defineProperty({ __proto__: null, ScriptingUtils: Vt }, Symbol.toStringTag, { value: "Module" }));
841
+ export {
842
+ $t as $,
843
+ Gt as i
844
+ };