@sheetxl/sdk 0.2.6 → 0.3.1

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 (112) hide show
  1. package/LICENSE.md +11 -11
  2. package/README.md +28 -28
  3. package/browser/cjs/{CGZGNjsBxID1puTh.cjs → 15AOcGpF9P2PgE8n.cjs} +1 -1
  4. package/browser/cjs/{C-hZNDAwWuxBFIL6.cjs → 57X1Mb81YIQgsw4g.cjs} +1 -1
  5. package/browser/cjs/{DmZ4H5WXrLU8_ULc.cjs → B0Mgg7I6p1ceY3rN.cjs} +1 -1
  6. package/browser/cjs/{DREJZJuBE505tfIa.cjs → BBOV5cemxNXMsT5e.cjs} +1 -1
  7. package/browser/cjs/{B2O3RNuGifH03sly.cjs → BqwLZnCcokB0gJUg.cjs} +1 -1
  8. package/browser/cjs/{D9VWafL4GO91s-ss.cjs → BvI7tcol77xoHIM4.cjs} +1 -1
  9. package/browser/cjs/{Ib1rBKg28o0eoK5d.cjs → Bxag54-yDHHST3Wd.cjs} +1 -1
  10. package/browser/cjs/{B-H7eMELHIPn-bzr.cjs → CeFdVjSCXrLYCXCU.cjs} +2 -2
  11. package/browser/cjs/{CorV6bYZuJtzRl_o.cjs → CeipDJjIRwQ790Ca.cjs} +1 -1
  12. package/browser/cjs/{BMR7gbu-c18QBWPt.cjs → CfouDIlYV1rbE7L-.cjs} +1 -1
  13. package/browser/cjs/{CbkB0mQ12rY_vVQA.cjs → Ch4ZGmjKP0WTpVhB.cjs} +1 -1
  14. package/browser/cjs/{Bu47JGsCj17hmXc_.cjs → CtaQiu1oagSXCXXK.cjs} +14 -34
  15. package/browser/cjs/{BCpPSYDEqyb04P1R.cjs → CxaFOlRqTSy7Jlc9.cjs} +1 -1
  16. package/browser/cjs/D2mGoMelJkvbn0dS.cjs +6 -0
  17. package/browser/cjs/{BsTj3RQ6ZEGPgKcQ.cjs → D4DJUbHguXQO7MqG.cjs} +4 -14
  18. package/browser/cjs/{CkNaOiSUo75nvWtM.cjs → D7IBYt0m3kE9Dgab.cjs} +3 -3
  19. package/browser/cjs/{BqNVHurf7quGcU6z.cjs → D7n5QHfgHMN7Ubsh.cjs} +1 -1
  20. package/browser/cjs/{Dvs5Vm4RFD3Taixm.cjs → D_AVSJSxbexl5_Qc.cjs} +1 -1
  21. package/browser/cjs/{CTwmDtiXYiM_eVmk.cjs → DdmOYUEsRqX0HKiE.cjs} +9 -19
  22. package/browser/cjs/{qAMXqcWKLU1dQ_3h.cjs → DdvRZSHU07d0SJND.cjs} +1 -1
  23. package/browser/cjs/{BLG6_L_HCAO81YQL.cjs → DhAXete205u1BUF9.cjs} +1 -1
  24. package/browser/cjs/{BuGJzOcaTQHrFpAi.cjs → Dp_0GxjE3JGmxJ__.cjs} +2 -7
  25. package/browser/cjs/{DNwyFP0z1WUsz7Mv.cjs → DqgIZPp7jtFutMPR.cjs} +1 -1
  26. package/browser/cjs/{mv0n6HW37Bg9vbEq.cjs → ImOEyTGPkbtm6yWG.cjs} +1 -1
  27. package/browser/cjs/{CzyTW1VE-AUeXvey.cjs → JWZZpQcTBYdqmuUW.cjs} +3 -13
  28. package/browser/cjs/{r9g18mieulrXQm1L.cjs → KQNpeB5hbqIYjp_r.cjs} +1 -1
  29. package/browser/cjs/{CCT2GkFj7ICxXUES.cjs → LRzcJjMh_2Sg2Iyq.cjs} +1 -1
  30. package/browser/cjs/NQji61IYyDBithp9.cjs +6 -0
  31. package/browser/cjs/{lXdOsnm-jZHQBBBW.cjs → W7UjTQi6GYOYRGPH.cjs} +1 -1
  32. package/browser/cjs/{BjgRUxx-XDOpnPL-.cjs → WVaevsWmtJcDkHzf.cjs} +1 -1
  33. package/browser/cjs/{CFzPZOhjGf04KRj4.cjs → Xss-dNJjqGh-xGja.cjs} +2 -2
  34. package/browser/cjs/{DilLEdPuHqLbh5sf.cjs → ZvgpcQAvYAnvCwhP.cjs} +1 -1
  35. package/browser/cjs/index.cjs +2 -2
  36. package/browser/cjs/{Dl_4SDyZOgkXMEJC.cjs → rx448m2c_2rk-ZL2.cjs} +1 -1
  37. package/browser/esm/{B4BJ7t94Wpnv9a7S.mjs → A2KtAgZ1ZZzlKqrW.mjs} +1 -1
  38. package/{node/esm/ItKMvN0XCstp_nYY.mjs → browser/esm/BMvMKpCuQ7OMhb6D.mjs} +1 -1
  39. package/{node/esm/THIuEtMdfBrL-HBu.mjs → browser/esm/BYP_vBrtrJmMosg3.mjs} +1 -1
  40. package/browser/esm/BfA0oeliVjmuULjo.mjs +24 -0
  41. package/browser/esm/{D9hXALGej55nUIBr.mjs → BfqVWbuZPVip1p2y.mjs} +1 -1
  42. package/browser/esm/{DGdd1TuOoJRgFv5y.mjs → BldbegDy2Im9Vwy_.mjs} +1 -1
  43. package/browser/esm/{CmzSf5DNJLoOtMk-.mjs → BxKrVCe67zQZXaFe.mjs} +1 -1
  44. package/browser/esm/{CxsDCCCIZ3izAWpc.mjs → CFIAFeV-kbKIMGaW.mjs} +1 -1
  45. package/browser/esm/{BOb7v1vx9lJiStYh.mjs → CP02kAnVHwlz71EV.mjs} +1 -1
  46. package/browser/esm/{U-qXg8d0XjmxJPf5.mjs → CR8ryNaQrZTwbWLQ.mjs} +1 -1
  47. package/browser/esm/{ulV_OiYC8RR24mou.mjs → CRX2fvd3JBNH1inQ.mjs} +8 -19
  48. package/browser/esm/{BQSylQaIn2seUkRP.mjs → CeTz_0h7mzzs7S6d.mjs} +12 -4
  49. package/browser/esm/{DAF3pLo9IAXpgj0b.mjs → CkA378qg7LQEqeV4.mjs} +3 -15
  50. package/browser/esm/CpERAbkVKi6v2R5z.mjs +21 -0
  51. package/browser/esm/{Buj1qRrPX5ma7rP2.mjs → Cuc9gxubXUidHefW.mjs} +2 -8
  52. package/browser/esm/{DgVxyg7Pr4Gn7KI7.mjs → D3qT4ckeVdUIf8KG.mjs} +1 -1
  53. package/browser/esm/{AGVzrwoDbttD6w4x.mjs → D57eR1LljugozA9Z.mjs} +1 -1
  54. package/{node/esm/B7pyjq8tI7V7pcwy.mjs → browser/esm/D7W3PNn-2IoFru0l.mjs} +1 -1
  55. package/browser/esm/{D2bYWgsB0IswGpK7.mjs → DRd9s4gIGWuK5-R-.mjs} +3 -10
  56. package/browser/esm/{C7BBC6ZgCeDtER3f.mjs → DZcFAGNYJO5qYnjh.mjs} +1 -1
  57. package/browser/esm/{EW--St9c361BTpnI.mjs → DfKwAoUuV9f4j0gn.mjs} +1 -1
  58. package/browser/esm/{C_xLg294X_US_kYm.mjs → Dm-yHuQ_8smSK8zh.mjs} +1 -1
  59. package/browser/esm/{Bqmgcdzk45VxX6Iz.mjs → DowOxK5s6W8Hs5qU.mjs} +4 -16
  60. package/browser/esm/{BhfmggeeGS_CFF11.mjs → DwXGwKlOzkVh3sXn.mjs} +2060 -2073
  61. package/browser/esm/{B5coyTQHreqWfXTL.mjs → EWLavRuO7BMH3CES.mjs} +2 -2
  62. package/{node/esm/MTsxZkvH_SRJmSFp.mjs → browser/esm/Ep2xp_qq1WnkwQ-4.mjs} +1 -1
  63. package/{node/esm/528R85wwImPG1QAx.mjs → browser/esm/MsUATmonUEbmdGEg.mjs} +1 -1
  64. package/{node/esm/BwUpLF3TBx5yV5Lj.mjs → browser/esm/Of5ubKFb9FmEEPGu.mjs} +1 -1
  65. package/browser/esm/{D9-gfxTwv_8KGH0J.mjs → XXbCXuFAJplwT_i6.mjs} +1 -1
  66. package/browser/esm/{_6Pn6ZxxA5IHC32O.mjs → YuK71EKhaf-WleSP.mjs} +1 -1
  67. package/browser/esm/{BONMqgKB8XepwVUP.mjs → _eNY2dP2qQ62235I.mjs} +1 -1
  68. package/browser/esm/index.mjs +2 -2
  69. package/{node/esm/B93nGRWqezVAe82d.mjs → browser/esm/m_0OUN7zT7-GCOZI.mjs} +1 -1
  70. package/browser/esm/{BU8yIdTQ6we6k-KG.mjs → qxyhqVpudmxAVheL.mjs} +1 -1
  71. package/licenses/dependencies.txt +33 -33
  72. package/node/esm/{B-S0zOSFMqvUzORJ.mjs → 4p4QkPdpTSnxhcYT.mjs} +1 -1
  73. package/node/esm/{DWYkJQ-eVYboYKz5.mjs → A-93HEOUDI4JpIFE.mjs} +11 -3
  74. package/node/esm/{B4BJ7t94Wpnv9a7S.mjs → A2KtAgZ1ZZzlKqrW.mjs} +1 -1
  75. package/node/esm/{TjmQUpBzdM6KL24x.mjs → B849dDAbNzcAWdIf.mjs} +1 -1
  76. package/node/esm/BH4FTFTTaalZge5L.mjs +14 -0
  77. package/{browser/esm/ItKMvN0XCstp_nYY.mjs → node/esm/BMvMKpCuQ7OMhb6D.mjs} +1 -1
  78. package/node/esm/{DVvO7Cmr6-3USkj5.mjs → BQC0F5ietGENZKyH.mjs} +1 -1
  79. package/node/esm/{krHJwUyEoybVhk5D.mjs → BVURFQqE_KXN-Uqn.mjs} +2 -8
  80. package/{browser/esm/THIuEtMdfBrL-HBu.mjs → node/esm/BYP_vBrtrJmMosg3.mjs} +1 -1
  81. package/node/esm/{Dp9yDBXx_7cwTY-p.mjs → B_8H9Q2rpNm2_tP3.mjs} +1 -7
  82. package/node/esm/{DGdd1TuOoJRgFv5y.mjs → BldbegDy2Im9Vwy_.mjs} +1 -1
  83. package/node/esm/{CxsDCCCIZ3izAWpc.mjs → CFIAFeV-kbKIMGaW.mjs} +1 -1
  84. package/node/esm/{BOb7v1vx9lJiStYh.mjs → CP02kAnVHwlz71EV.mjs} +1 -1
  85. package/node/esm/{U-qXg8d0XjmxJPf5.mjs → CR8ryNaQrZTwbWLQ.mjs} +1 -1
  86. package/node/esm/{CITMKf4A3oqmkDlo.mjs → CjDTYU6purjPsTGz.mjs} +1 -1
  87. package/node/esm/{BaX81ieKgh6x9n3-.mjs → CjedKP1Ap009z7yH.mjs} +4 -16
  88. package/node/esm/{DgVxyg7Pr4Gn7KI7.mjs → D3qT4ckeVdUIf8KG.mjs} +1 -1
  89. package/node/esm/{BfRPN7DBXGwgEl0p.mjs → D4ZDjjk2WHyCqHIe.mjs} +1 -1
  90. package/node/esm/{DosKYfaNY0o9gZ-R.mjs → D767fK1WoXC3YeeO.mjs} +1 -1
  91. package/{browser/esm/B7pyjq8tI7V7pcwy.mjs → node/esm/D7W3PNn-2IoFru0l.mjs} +1 -1
  92. package/node/esm/{D3qKeWp3MQKMP2h_.mjs → DDAppiOAzrEy_PcS.mjs} +1 -1
  93. package/node/esm/{BKKWEXTAHQcnW_xk.mjs → DdQ4X9e7ES69T_kv.mjs} +3 -15
  94. package/node/esm/{EW--St9c361BTpnI.mjs → DfKwAoUuV9f4j0gn.mjs} +1 -1
  95. package/node/esm/DvW1-4E92rqMluYF.mjs +80 -0
  96. package/{browser/esm/MTsxZkvH_SRJmSFp.mjs → node/esm/Ep2xp_qq1WnkwQ-4.mjs} +1 -1
  97. package/node/esm/{BmfPbR-U7zbLWgfh.mjs → LRiYR8hkfLZA1lud.mjs} +1 -1
  98. package/{browser/esm/528R85wwImPG1QAx.mjs → node/esm/MsUATmonUEbmdGEg.mjs} +1 -1
  99. package/{browser/esm/BwUpLF3TBx5yV5Lj.mjs → node/esm/Of5ubKFb9FmEEPGu.mjs} +1 -1
  100. package/node/esm/{D9-gfxTwv_8KGH0J.mjs → XXbCXuFAJplwT_i6.mjs} +1 -1
  101. package/node/esm/{BONMqgKB8XepwVUP.mjs → _eNY2dP2qQ62235I.mjs} +1 -1
  102. package/node/esm/index.mjs +2869 -2858
  103. package/{browser/esm/B93nGRWqezVAe82d.mjs → node/esm/m_0OUN7zT7-GCOZI.mjs} +1 -1
  104. package/package.json +4 -7
  105. package/types/index.d.ts +3 -1
  106. package/types/scripting.d.ts +34176 -0
  107. package/browser/cjs/Ci-LITf7FutalLC4.cjs +0 -11
  108. package/browser/cjs/dJ-MSsMtF8KRc16n.cjs +0 -11
  109. package/browser/esm/-P8qNXxTWhuiSr9M.mjs +0 -28
  110. package/browser/esm/ucCvrtg0NIVDPCMF.mjs +0 -30
  111. package/node/esm/BQotQDQoybuUcFTS.mjs +0 -86
  112. package/node/esm/BvhUvPTEIyACj5zc.mjs +0 -20
@@ -1,5 +1,5 @@
1
1
  "use strict";/**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.2.6
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.3.1
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -1,5 +1,5 @@
1
1
  "use strict";/**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.2.6
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.3.1
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -1,15 +1,10 @@
1
1
  "use strict";/**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.2.6
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.3.1
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
- */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});/**
7
- * @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.2.6
8
- *
9
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
10
- * License: The license can be found at https://www.sheetxl.com/license.
11
- */let c=class{constructor(e){this._worker=null,this._nextId=1,this._pendingRequests=new Map,this._workerFactory=e}start(){if(typeof Worker>"u")throw new Error("Web Workers are not supported in this environment.");return this._worker||(this._worker=this._workerFactory(),this._worker.onmessage=e=>{const{id:n,result:t,error:r}=e.data,o=this._pendingRequests.get(n);if(o)if(this._pendingRequests.delete(n),r){const i=new Error(r.message);i.stack=r.stack,r.cause&&(i.cause=r.cause),o.reject(i)}else o.resolve(t)},this._worker.onerror=e=>{console.error("Worker error:",e),this._pendingRequests.forEach(n=>{n.reject(new Error(`Worker failed: ${e.message}`))}),this._pendingRequests.clear(),this._worker=null}),Promise.resolve()}execute(e){if(!this._worker)throw new Error("Worker is not initialized. Call start() first.");const n=this._nextId++;return new Promise((t,r)=>{this._pendingRequests.set(n,{resolve:t,reject:r}),this._worker.postMessage({id:n,params:e})})}terminate(){this._worker&&(this._worker.terminate(),this._worker=null)}};class u{constructor(n){this._onExecute=n}execute(n){return this._onExecute(n)}start(){return Promise.resolve()}terminate(){}}const s=`/**
12
- * @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.2.6
6
+ */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let c=class{constructor(e){this._worker=null,this._nextId=1,this._pendingRequests=new Map,this._workerFactory=e}start(){if(typeof Worker>"u")throw new Error("Web Workers are not supported in this environment.");return this._worker||(this._worker=this._workerFactory(),this._worker.onmessage=e=>{const{id:n,result:t,error:r}=e.data,o=this._pendingRequests.get(n);if(o)if(this._pendingRequests.delete(n),r){const i=new Error(r.message);i.stack=r.stack,r.cause&&(i.cause=r.cause),o.reject(i)}else o.resolve(t)},this._worker.onerror=e=>{console.error("Worker error:",e),this._pendingRequests.forEach(n=>{n.reject(new Error(`Worker failed: ${e.message}`))}),this._pendingRequests.clear(),this._worker=null}),Promise.resolve()}execute(e){if(!this._worker)throw new Error("Worker is not initialized. Call start() first.");const n=this._nextId++;return new Promise((t,r)=>{this._pendingRequests.set(n,{resolve:t,reject:r}),this._worker.postMessage({id:n,params:e})})}terminate(){this._worker&&(this._worker.terminate(),this._worker=null)}};class u{constructor(n){this._onExecute=n}execute(n){return this._onExecute(n)}start(){return Promise.resolve()}terminate(){}}const s=`/**
7
+ * @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.3.1
13
8
  *
14
9
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
15
10
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -228,7 +223,7 @@ var v;
228
223
  return n = typeof e == "string" ? tt.get(e) : rt.get(e), n || (n = v.Unknown), new n(t, r);
229
224
  }, v.getBuiltInById = (e) => Te.get(e) || Et;
230
225
  /**
231
- * @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.2.6
226
+ * @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.3.1
232
227
  *
233
228
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
234
229
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -512,7 +507,7 @@ const qe = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeEl
512
507
  }, findNextStep: (e, t = !0, r = 15, n = 10, o = 400) => {
513
508
  const i = Math.max(e - n, 0) + (t ? 1 : -1);
514
509
  return Math.min(o, Math[t ? "ceil" : "floor"](i / r) * r + n);
515
- }, getBuildEnv: () => "browser2-build", getDPI: () => {
510
+ }, getDPI: () => {
516
511
  let e = 1;
517
512
  return typeof window == "object" && (e = window.devicePixelRatio || 1), e;
518
513
  }, getFromPath: (e, t) => {
@@ -1467,21 +1462,17 @@ let ce = null;
1467
1462
  async function tr() {
1468
1463
  return ce || (ce = new Promise(async (e, t) => {
1469
1464
  try {
1470
- const r = "0.20.2", n = \`https://esm.sh/esbuild-wasm@\${r}\`, o = \`https://esm.sh/esbuild-wasm@\${r}/esbuild.wasm\`;
1471
- console.log("🔄 Initializing esbuild...", o);
1472
- const i = await import(
1465
+ const r = "0.20.2", n = \`https://esm.sh/esbuild-wasm@\${r}\`, o = \`https://esm.sh/esbuild-wasm@\${r}/esbuild.wasm\`, a = (await import(
1473
1466
  /* webpackIgnore: true */
1474
1467
  /* @vite-ignore */
1475
1468
  n
1476
- );
1477
- console.log("🔄 Got esm...", o);
1478
- const a = i.default;
1469
+ )).default;
1479
1470
  await a.initialize({
1480
1471
  wasmURL: o,
1481
1472
  // Provide the specific WASM URL
1482
1473
  worker: !1
1483
1474
  // Keep processing on the current thread
1484
- }), console.log("🔄 Initialized esm...", o), e(a);
1475
+ }), e(a);
1485
1476
  } catch (r) {
1486
1477
  console.error("Error initializing esbuild:", r), t(r);
1487
1478
  }
@@ -1494,7 +1485,6 @@ var rr = /* @__PURE__ */ Object.freeze({
1494
1485
  let ue = null;
1495
1486
  async function nr() {
1496
1487
  return ue || (ue = new Promise(async (e, t) => {
1497
- console.log("🔄 Initializing Browser TypeScript module...");
1498
1488
  let r = null;
1499
1489
  try {
1500
1490
  r = await import("https://esm.sh/typescript@5.7.2");
@@ -1508,4 +1498,4 @@ var or = /* @__PURE__ */ Object.freeze({
1508
1498
  __proto__: null,
1509
1499
  initialize: nr
1510
1500
  });
1511
- `,a=typeof self<"u"&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",s],{type:"text/javascript;charset=utf-8"});function d(e){let n;try{if(n=a&&(self.URL||self.webkitURL).createObjectURL(a),!n)throw"";const t=new Worker(n,{type:"module",name:e?.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(n)}),t}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(s),{type:"module",name:e?.name})}}const l=async()=>{const{compileModule:e}=await Promise.resolve().then(()=>require("./BsTj3RQ6ZEGPgKcQ.cjs")),n=new u(t=>e(t));return await n.start(),n};exports.createCompilerWorker=async function(){if(typeof process<"u"&&process.versions?.node&&typeof Worker>"u")return await l();if(typeof Worker<"u"){const e=new c(()=>new d);try{return await e.start(),e}catch(n){console.error("Failed to start TypescriptCompiler worker reverting to fallback:",n)}}return await l()};
1501
+ `,a=typeof self<"u"&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",s],{type:"text/javascript;charset=utf-8"});function d(e){let n;try{if(n=a&&(self.URL||self.webkitURL).createObjectURL(a),!n)throw"";const t=new Worker(n,{type:"module",name:e?.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(n)}),t}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(s),{type:"module",name:e?.name})}}const l=async()=>{const{compileModule:e}=await Promise.resolve().then(()=>require("./D4DJUbHguXQO7MqG.cjs")),n=new u(t=>e(t));return await n.start(),n};exports.createCompilerWorker=async function(){if(typeof process<"u"&&process.versions?.node&&typeof Worker>"u")return await l();if(typeof Worker<"u"){const e=new c(()=>new d);try{return await e.start(),e}catch(n){console.error("Failed to start TypescriptCompiler worker reverting to fallback:",n)}}return await l()};
@@ -1,5 +1,5 @@
1
1
  "use strict";/**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.2.6
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.3.1
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -1,5 +1,5 @@
1
1
  "use strict";/**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.2.6
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.3.1
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -1,14 +1,9 @@
1
1
  "use strict";/**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.2.6
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.3.1
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
- */const yt=require("./Bu47JGsCj17hmXc_.cjs");function kt(Y,H){for(var k=0;k<H.length;k++){const P=H[k];if(typeof P!="string"&&!Array.isArray(P)){for(const N in P)if(N!=="default"&&!(N in Y)){const Q=Object.getOwnPropertyDescriptor(P,N);Q&&Object.defineProperty(Y,N,Q.get?Q:{enumerable:!0,get:()=>P[N]})}}}return Object.freeze(Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"}))}var ct,pt={exports:{}};/* @license
7
- Papa Parse
8
- v5.5.3
9
- https://github.com/mholt/PapaParse
10
- License: MIT
11
- */var gt=(ct||(ct=1,pt.exports=function Y(){var H,k=typeof self<"u"?self:typeof window<"u"?window:k!==void 0?k:{},P=!k.document&&!!k.postMessage,N=k.IS_PAPA_WORKER||!1,Q={},mt=0,o={};function B(t){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(e){var i=at(e);i.chunkSize=parseInt(i.chunkSize),e.step||e.chunk||(i.chunkSize=null),this._handle=new ht(i),(this._handle.streamer=this)._config=i}.call(this,t),this.parseChunk=function(e,i){var n=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<n){let c=this._config.newline;c||(r=this._config.quoteChar||'"',c=this._handle.guessLineEndings(e,r)),e=[...e.split(c).slice(n)].join(c)}this.isFirstChunk&&_(this._config.beforeFirstChunk)&&(r=this._config.beforeFirstChunk(e))!==void 0&&(e=r),this.isFirstChunk=!1,this._halted=!1,n=this._partialLine+e;var r=(this._partialLine="",this._handle.parse(n,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(e=r.meta.cursor,this._finished||(this._partialLine=n.substring(e-this._baseIndex),this._baseIndex=e),r&&r.data&&(this._rowCount+=r.data.length),n=this._finished||this._config.preview&&this._rowCount>=this._config.preview,N)k.postMessage({results:r,workerId:o.WORKER_ID,finished:n});else if(_(this._config.chunk)&&!i){if(this._config.chunk(r,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=r=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(r.data),this._completeResults.errors=this._completeResults.errors.concat(r.errors),this._completeResults.meta=r.meta),this._completed||!n||!_(this._config.complete)||r&&r.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),n||r&&r.meta.paused||this._nextChunk(),r}this._halted=!0},this._sendError=function(e){_(this._config.error)?this._config.error(e):N&&this._config.error&&k.postMessage({workerId:o.WORKER_ID,error:e,finished:!1})}}function it(t){var e;(t=t||{}).chunkSize||(t.chunkSize=o.RemoteChunkSize),B.call(this,t),this._nextChunk=P?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(i){this._input=i,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(e=new XMLHttpRequest,this._config.withCredentials&&(e.withCredentials=this._config.withCredentials),P||(e.onload=J(this._chunkLoaded,this),e.onerror=J(this._chunkError,this)),e.open(this._config.downloadRequestBody?"POST":"GET",this._input,!P),this._config.downloadRequestHeaders){var i,n=this._config.downloadRequestHeaders;for(i in n)e.setRequestHeader(i,n[i])}var r;this._config.chunkSize&&(r=this._start+this._config.chunkSize-1,e.setRequestHeader("Range","bytes="+this._start+"-"+r));try{e.send(this._config.downloadRequestBody)}catch(c){this._chunkError(c.message)}P&&e.status===0&&this._chunkError()}},this._chunkLoaded=function(){e.readyState===4&&(e.status<200||400<=e.status?this._chunkError():(this._start+=this._config.chunkSize||e.responseText.length,this._finished=!this._config.chunkSize||this._start>=(i=>(i=i.getResponseHeader("Content-Range"))!==null?parseInt(i.substring(i.lastIndexOf("/")+1)):-1)(e),this.parseChunk(e.responseText)))},this._chunkError=function(i){i=e.statusText||i,this._sendError(new Error(i))}}function rt(t){(t=t||{}).chunkSize||(t.chunkSize=o.LocalChunkSize),B.call(this,t);var e,i,n=typeof FileReader<"u";this.stream=function(r){this._input=r,i=r.slice||r.webkitSlice||r.mozSlice,n?((e=new FileReader).onload=J(this._chunkLoaded,this),e.onerror=J(this._chunkError,this)):e=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var r=this._input,c=(this._config.chunkSize&&(c=Math.min(this._start+this._config.chunkSize,this._input.size),r=i.call(r,this._start,c)),e.readAsText(r,this._config.encoding));n||this._chunkLoaded({target:{result:c}})},this._chunkLoaded=function(r){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(r.target.result)},this._chunkError=function(){this._sendError(e.error)}}function X(t){var e;B.call(this,t=t||{}),this.stream=function(i){return e=i,this._nextChunk()},this._nextChunk=function(){var i,n;if(!this._finished)return i=this._config.chunkSize,e=i?(n=e.substring(0,i),e.substring(i)):(n=e,""),this._finished=!e,this.parseChunk(n)}}function nt(t){B.call(this,t=t||{});var e=[],i=!0,n=!1;this.pause=function(){B.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){B.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(r){this._input=r,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){n&&e.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),e.length?this.parseChunk(e.shift()):i=!0},this._streamData=J(function(r){try{e.push(typeof r=="string"?r:r.toString(this._config.encoding)),i&&(i=!1,this._checkIsFinished(),this.parseChunk(e.shift()))}catch(c){this._streamError(c)}},this),this._streamError=J(function(r){this._streamCleanUp(),this._sendError(r)},this),this._streamEnd=J(function(){this._streamCleanUp(),n=!0,this._streamData("")},this),this._streamCleanUp=J(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function ht(t){var e,i,n,r,c=Math.pow(2,53),R=-c,I=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,z=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,p=this,E=0,a=0,F=!1,u=!1,g=[],s={data:[],errors:[],meta:{}};function O(h){return t.skipEmptyLines==="greedy"?h.join("").trim()==="":h.length===1&&h[0].length===0}function C(){if(s&&n&&(M("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+o.DefaultDelimiter+"'"),n=!1),t.skipEmptyLines&&(s.data=s.data.filter(function(l){return!O(l)})),T()){let l=function(S,L){_(t.transformHeader)&&(S=t.transformHeader(S,L)),g.push(S)};if(s)if(Array.isArray(s.data[0])){for(var h=0;T()&&h<s.data.length;h++)s.data[h].forEach(l);s.data.splice(0,1)}else s.data.forEach(l)}function d(l,S){for(var L=t.header?{}:[],b=0;b<l.length;b++){var y=b,m=l[b];m=((U,f)=>(v=>(t.dynamicTypingFunction&&t.dynamicTyping[v]===void 0&&(t.dynamicTyping[v]=t.dynamicTypingFunction(v)),(t.dynamicTyping[v]||t.dynamicTyping)===!0))(U)?f==="true"||f==="TRUE"||f!=="false"&&f!=="FALSE"&&((v=>{if(I.test(v)&&(v=parseFloat(v),R<v&&v<c))return 1})(f)?parseFloat(f):z.test(f)?new Date(f):f===""?null:f):f)(y=t.header?b>=g.length?"__parsed_extra":g[b]:y,m=t.transform?t.transform(m,y):m),y==="__parsed_extra"?(L[y]=L[y]||[],L[y].push(m)):L[y]=m}return t.header&&(b>g.length?M("FieldMismatch","TooManyFields","Too many fields: expected "+g.length+" fields but parsed "+b,a+S):b<g.length&&M("FieldMismatch","TooFewFields","Too few fields: expected "+g.length+" fields but parsed "+b,a+S)),L}var w;s&&(t.header||t.dynamicTyping||t.transform)&&(w=1,!s.data.length||Array.isArray(s.data[0])?(s.data=s.data.map(d),w=s.data.length):s.data=d(s.data,0),t.header&&s.meta&&(s.meta.fields=g),a+=w)}function T(){return t.header&&g.length===0}function M(h,d,w,l){h={type:h,code:d,message:w},l!==void 0&&(h.row=l),s.errors.push(h)}_(t.step)&&(r=t.step,t.step=function(h){s=h,T()?C():(C(),s.data.length!==0&&(E+=h.data.length,t.preview&&E>t.preview?i.abort():(s.data=s.data[0],r(s,p))))}),this.parse=function(h,d,w){var l=t.quoteChar||'"';return t.newline||(t.newline=this.guessLineEndings(h,l)),n=!1,t.delimiter?_(t.delimiter)&&(t.delimiter=t.delimiter(h),s.meta.delimiter=t.delimiter):((l=((S,L,b,y,m)=>{var U,f,v,$;m=m||[","," ","|",";",o.RECORD_SEP,o.UNIT_SEP];for(var Z=0;Z<m.length;Z++){for(var K,tt=m[Z],A=0,D=0,x=0,j=(v=void 0,new st({comments:y,delimiter:tt,newline:L,preview:10}).parse(S)),W=0;W<j.data.length;W++)b&&O(j.data[W])?x++:(D+=K=j.data[W].length,v===void 0?v=K:0<K&&(A+=Math.abs(K-v),v=K));0<j.data.length&&(D/=j.data.length-x),(f===void 0||A<=f)&&($===void 0||$<D)&&1.99<D&&(f=A,U=tt,$=D)}return{successful:!!(t.delimiter=U),bestDelimiter:U}})(h,t.newline,t.skipEmptyLines,t.comments,t.delimitersToGuess)).successful?t.delimiter=l.bestDelimiter:(n=!0,t.delimiter=o.DefaultDelimiter),s.meta.delimiter=t.delimiter),l=at(t),t.preview&&t.header&&l.preview++,e=h,i=new st(l),s=i.parse(e,d,w),C(),F?{meta:{paused:!0}}:s||{meta:{paused:!1}}},this.paused=function(){return F},this.pause=function(){F=!0,i.abort(),e=_(t.chunk)?"":e.substring(i.getCharIndex())},this.resume=function(){p.streamer._halted?(F=!1,p.streamer.parseChunk(e,!0)):setTimeout(p.resume,3)},this.aborted=function(){return u},this.abort=function(){u=!0,i.abort(),s.meta.aborted=!0,_(t.complete)&&t.complete(s),e=""},this.guessLineEndings=function(h,d){h=h.substring(0,1048576),d=new RegExp(V(d)+"([^]*?)"+V(d),"gm");var w=(h=h.replace(d,"")).split("\r");if(h=1<(d=h.split(`
6
+ */const yt=require("./CtaQiu1oagSXCXXK.cjs");function kt(Y,H){for(var k=0;k<H.length;k++){const P=H[k];if(typeof P!="string"&&!Array.isArray(P)){for(const N in P)if(N!=="default"&&!(N in Y)){const Q=Object.getOwnPropertyDescriptor(P,N);Q&&Object.defineProperty(Y,N,Q.get?Q:{enumerable:!0,get:()=>P[N]})}}}return Object.freeze(Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"}))}var ct,pt={exports:{}},gt=(ct||(ct=1,pt.exports=function Y(){var H,k=typeof self<"u"?self:typeof window<"u"?window:k!==void 0?k:{},P=!k.document&&!!k.postMessage,N=k.IS_PAPA_WORKER||!1,Q={},mt=0,o={};function B(t){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(e){var i=at(e);i.chunkSize=parseInt(i.chunkSize),e.step||e.chunk||(i.chunkSize=null),this._handle=new ht(i),(this._handle.streamer=this)._config=i}.call(this,t),this.parseChunk=function(e,i){var n=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<n){let c=this._config.newline;c||(r=this._config.quoteChar||'"',c=this._handle.guessLineEndings(e,r)),e=[...e.split(c).slice(n)].join(c)}this.isFirstChunk&&_(this._config.beforeFirstChunk)&&(r=this._config.beforeFirstChunk(e))!==void 0&&(e=r),this.isFirstChunk=!1,this._halted=!1,n=this._partialLine+e;var r=(this._partialLine="",this._handle.parse(n,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(e=r.meta.cursor,this._finished||(this._partialLine=n.substring(e-this._baseIndex),this._baseIndex=e),r&&r.data&&(this._rowCount+=r.data.length),n=this._finished||this._config.preview&&this._rowCount>=this._config.preview,N)k.postMessage({results:r,workerId:o.WORKER_ID,finished:n});else if(_(this._config.chunk)&&!i){if(this._config.chunk(r,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=r=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(r.data),this._completeResults.errors=this._completeResults.errors.concat(r.errors),this._completeResults.meta=r.meta),this._completed||!n||!_(this._config.complete)||r&&r.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),n||r&&r.meta.paused||this._nextChunk(),r}this._halted=!0},this._sendError=function(e){_(this._config.error)?this._config.error(e):N&&this._config.error&&k.postMessage({workerId:o.WORKER_ID,error:e,finished:!1})}}function it(t){var e;(t=t||{}).chunkSize||(t.chunkSize=o.RemoteChunkSize),B.call(this,t),this._nextChunk=P?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(i){this._input=i,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(e=new XMLHttpRequest,this._config.withCredentials&&(e.withCredentials=this._config.withCredentials),P||(e.onload=J(this._chunkLoaded,this),e.onerror=J(this._chunkError,this)),e.open(this._config.downloadRequestBody?"POST":"GET",this._input,!P),this._config.downloadRequestHeaders){var i,n=this._config.downloadRequestHeaders;for(i in n)e.setRequestHeader(i,n[i])}var r;this._config.chunkSize&&(r=this._start+this._config.chunkSize-1,e.setRequestHeader("Range","bytes="+this._start+"-"+r));try{e.send(this._config.downloadRequestBody)}catch(c){this._chunkError(c.message)}P&&e.status===0&&this._chunkError()}},this._chunkLoaded=function(){e.readyState===4&&(e.status<200||400<=e.status?this._chunkError():(this._start+=this._config.chunkSize||e.responseText.length,this._finished=!this._config.chunkSize||this._start>=(i=>(i=i.getResponseHeader("Content-Range"))!==null?parseInt(i.substring(i.lastIndexOf("/")+1)):-1)(e),this.parseChunk(e.responseText)))},this._chunkError=function(i){i=e.statusText||i,this._sendError(new Error(i))}}function rt(t){(t=t||{}).chunkSize||(t.chunkSize=o.LocalChunkSize),B.call(this,t);var e,i,n=typeof FileReader<"u";this.stream=function(r){this._input=r,i=r.slice||r.webkitSlice||r.mozSlice,n?((e=new FileReader).onload=J(this._chunkLoaded,this),e.onerror=J(this._chunkError,this)):e=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var r=this._input,c=(this._config.chunkSize&&(c=Math.min(this._start+this._config.chunkSize,this._input.size),r=i.call(r,this._start,c)),e.readAsText(r,this._config.encoding));n||this._chunkLoaded({target:{result:c}})},this._chunkLoaded=function(r){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(r.target.result)},this._chunkError=function(){this._sendError(e.error)}}function X(t){var e;B.call(this,t=t||{}),this.stream=function(i){return e=i,this._nextChunk()},this._nextChunk=function(){var i,n;if(!this._finished)return i=this._config.chunkSize,e=i?(n=e.substring(0,i),e.substring(i)):(n=e,""),this._finished=!e,this.parseChunk(n)}}function nt(t){B.call(this,t=t||{});var e=[],i=!0,n=!1;this.pause=function(){B.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){B.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(r){this._input=r,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){n&&e.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),e.length?this.parseChunk(e.shift()):i=!0},this._streamData=J(function(r){try{e.push(typeof r=="string"?r:r.toString(this._config.encoding)),i&&(i=!1,this._checkIsFinished(),this.parseChunk(e.shift()))}catch(c){this._streamError(c)}},this),this._streamError=J(function(r){this._streamCleanUp(),this._sendError(r)},this),this._streamEnd=J(function(){this._streamCleanUp(),n=!0,this._streamData("")},this),this._streamCleanUp=J(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function ht(t){var e,i,n,r,c=Math.pow(2,53),R=-c,I=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,z=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,p=this,E=0,a=0,F=!1,u=!1,g=[],s={data:[],errors:[],meta:{}};function O(h){return t.skipEmptyLines==="greedy"?h.join("").trim()==="":h.length===1&&h[0].length===0}function C(){if(s&&n&&(M("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+o.DefaultDelimiter+"'"),n=!1),t.skipEmptyLines&&(s.data=s.data.filter(function(l){return!O(l)})),T()){let l=function(S,L){_(t.transformHeader)&&(S=t.transformHeader(S,L)),g.push(S)};if(s)if(Array.isArray(s.data[0])){for(var h=0;T()&&h<s.data.length;h++)s.data[h].forEach(l);s.data.splice(0,1)}else s.data.forEach(l)}function d(l,S){for(var L=t.header?{}:[],b=0;b<l.length;b++){var y=b,m=l[b];m=((U,f)=>(v=>(t.dynamicTypingFunction&&t.dynamicTyping[v]===void 0&&(t.dynamicTyping[v]=t.dynamicTypingFunction(v)),(t.dynamicTyping[v]||t.dynamicTyping)===!0))(U)?f==="true"||f==="TRUE"||f!=="false"&&f!=="FALSE"&&((v=>{if(I.test(v)&&(v=parseFloat(v),R<v&&v<c))return 1})(f)?parseFloat(f):z.test(f)?new Date(f):f===""?null:f):f)(y=t.header?b>=g.length?"__parsed_extra":g[b]:y,m=t.transform?t.transform(m,y):m),y==="__parsed_extra"?(L[y]=L[y]||[],L[y].push(m)):L[y]=m}return t.header&&(b>g.length?M("FieldMismatch","TooManyFields","Too many fields: expected "+g.length+" fields but parsed "+b,a+S):b<g.length&&M("FieldMismatch","TooFewFields","Too few fields: expected "+g.length+" fields but parsed "+b,a+S)),L}var w;s&&(t.header||t.dynamicTyping||t.transform)&&(w=1,!s.data.length||Array.isArray(s.data[0])?(s.data=s.data.map(d),w=s.data.length):s.data=d(s.data,0),t.header&&s.meta&&(s.meta.fields=g),a+=w)}function T(){return t.header&&g.length===0}function M(h,d,w,l){h={type:h,code:d,message:w},l!==void 0&&(h.row=l),s.errors.push(h)}_(t.step)&&(r=t.step,t.step=function(h){s=h,T()?C():(C(),s.data.length!==0&&(E+=h.data.length,t.preview&&E>t.preview?i.abort():(s.data=s.data[0],r(s,p))))}),this.parse=function(h,d,w){var l=t.quoteChar||'"';return t.newline||(t.newline=this.guessLineEndings(h,l)),n=!1,t.delimiter?_(t.delimiter)&&(t.delimiter=t.delimiter(h),s.meta.delimiter=t.delimiter):((l=((S,L,b,y,m)=>{var U,f,v,$;m=m||[","," ","|",";",o.RECORD_SEP,o.UNIT_SEP];for(var Z=0;Z<m.length;Z++){for(var K,tt=m[Z],A=0,D=0,x=0,j=(v=void 0,new st({comments:y,delimiter:tt,newline:L,preview:10}).parse(S)),W=0;W<j.data.length;W++)b&&O(j.data[W])?x++:(D+=K=j.data[W].length,v===void 0?v=K:0<K&&(A+=Math.abs(K-v),v=K));0<j.data.length&&(D/=j.data.length-x),(f===void 0||A<=f)&&($===void 0||$<D)&&1.99<D&&(f=A,U=tt,$=D)}return{successful:!!(t.delimiter=U),bestDelimiter:U}})(h,t.newline,t.skipEmptyLines,t.comments,t.delimitersToGuess)).successful?t.delimiter=l.bestDelimiter:(n=!0,t.delimiter=o.DefaultDelimiter),s.meta.delimiter=t.delimiter),l=at(t),t.preview&&t.header&&l.preview++,e=h,i=new st(l),s=i.parse(e,d,w),C(),F?{meta:{paused:!0}}:s||{meta:{paused:!1}}},this.paused=function(){return F},this.pause=function(){F=!0,i.abort(),e=_(t.chunk)?"":e.substring(i.getCharIndex())},this.resume=function(){p.streamer._halted?(F=!1,p.streamer.parseChunk(e,!0)):setTimeout(p.resume,3)},this.aborted=function(){return u},this.abort=function(){u=!0,i.abort(),s.meta.aborted=!0,_(t.complete)&&t.complete(s),e=""},this.guessLineEndings=function(h,d){h=h.substring(0,1048576),d=new RegExp(V(d)+"([^]*?)"+V(d),"gm");var w=(h=h.replace(d,"")).split("\r");if(h=1<(d=h.split(`
12
7
  `)).length&&d[0].length<w[0].length,w.length===1||h)return`
13
8
  `;for(var l=0,S=0;S<w.length;S++)w[S][0]===`
14
9
  `&&l++;return l>=w.length/2?`\r
@@ -1,5 +1,5 @@
1
1
  "use strict";/**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.2.6
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.3.1
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -1,5 +1,5 @@
1
1
  "use strict";/**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.2.6
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.3.1
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -1,23 +1,13 @@
1
1
  "use strict";/**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.2.6
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.3.1
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
- *//**
7
- * @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.2.6
8
- *
9
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
10
- * License: The license can be found at https://www.sheetxl.com/license.
11
- *//**
12
- * @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.2.6
13
- *
14
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
15
- * License: The license can be found at https://www.sheetxl.com/license.
16
- */const h="text/html",b="text/plain",L="image/png",Ct=Object.freeze({left:0,top:0}),Mt=Object.freeze({left:0,top:0,bottom:0,right:0}),Rt=Object.freeze({x:0,y:0,width:0,height:0});Object.freeze(Object.defineProperty({__proto__:null,EmptyBounds:Rt,EmptyRect:Mt,EmptyTopLeft:Ct},Symbol.toStringTag,{value:"Module"}));const m="column",j="row",At=Object.freeze({colIndex:0,rowIndex:0}),Ft=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,Lt=(e,t)=>e.rowEnd===t.rowEnd?t.colEnd-e.colEnd:t.rowEnd-e.rowEnd,Ut=(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?Lt:Ut: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)=>{if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!D(e[r],t[r]))return!1;return!0},U=(e,t,r)=>{if(!e&&!t)return null;if(!e)return r?t:{...t};if(!t)return r?e:{...e};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);let l=r;return l?(l.colStart=n,l.rowStart=o,l.colEnd=a,l.rowEnd=i):l={colStart:n,rowStart:o,colEnd:a,rowEnd:i},l},Z=(e,t)=>{if(!t||t.length===0)return e;const r={...e};for(let n=0;n<t.length;n++){const o=t[n];$(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))}return r},Pt=[null,null],kt=(e,t,r)=>{if(e[0].value===e[1].value)return t};function X(e,t=2,r,n=j,o){let a=[...e];if(t<=0||e.length<=1)return a;let i=n===m,l=0,s=!1;do{const c=a.sort(bt(i?j:m));a=[],a.push(c[0]);const d=c.length;let w=0,u=c[0],f=u.colStart,p=u.rowStart,x=u.colEnd,_=u.rowEnd;for(let A=1;A<d;A++){const g=c[A];let G=!1;if(G=i?u&&p===g.rowStart&&_===g.rowEnd&&x+1===g.colStart:u&&f===g.colStart&&x===g.colEnd&&_+1===g.rowStart,G){let S={colStart:f,rowStart:p,colEnd:i?g.colEnd:x,rowEnd:i?_:g.rowEnd};if(u.value!==void 0&&(S.value=u.value),r){const F=o??[null,null];F[0]=u,F[1]=g,S=r(F,S,n)}if(S){a[w]=S,s=!0,u=S,f=u.colStart,p=u.rowStart,x=u.colEnd,_=u.rowEnd;continue}}a[++w]=g,u=g,f=u.colStart,p=u.rowStart,x=u.colEnd,_=u.rowEnd}l++,i=!i,l===1&&(s=!0)}while(l<t&&s&&a.length>1);return a}Object.freeze(Object.defineProperty({__proto__:null,EmptyCell:At,EmptyRange:Ft,cellToRange:(e,t)=>{if(!e)return null;let r=t;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},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)=>{const r=[];let n,o,a=Number.MIN_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER;return{append:(l,s,c)=>{let d=!0;const w=c!==void 0;if(w){const p=e?e(o,c,t):o===c?c:void 0;p===void 0?d=!1:c=p}if(d&&s===i+1&&l===a)return t?n.rowEnd=s:n.colEnd=s,i=s,void(o=c);n&&r.push(n);const u=t?l:s,f=t?s:l;n={colStart:u,rowStart:f,colEnd:u,rowEnd:f},w&&(n.value=c),a=l,i=s,o=c},done:l=>(n&&(r.push(n),n=null),l?X(r,3,l===!0?kt:l,t?m:j,Pt):r)}},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)=>{if(!t||t.length===0)return e;let r=e,n=null;for(;!D(r,n);)n=r,r=Z(n,t);return r},indexOfCoords:(e,t)=>{const r={colStart:e.colIndex,rowStart:e.rowIndex,colEnd:e.colIndex,rowEnd:e.rowIndex};for(let n=t.length-1;n>=0;n--)if($(r,t[n]))return n;return-1},intersectRanges:(e,t,r)=>{if(!e)return r?t:{...t};if(!t)return r?e:{...e};if(!e&&!t||e.rowStart>t.rowEnd||e.rowEnd<t.rowStart||e.colStart>t.colEnd||e.colEnd<t.colStart)return null;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);let l=r;return l?(l.colStart=n,l.rowStart=o,l.colEnd=a,l.rowEnd=i):l={colStart:n,rowStart:o,colEnd:a,rowEnd:i},l},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)=>{if(!e||e.length===0)return null;if(e.length===1&&!t)return e[0];let n=e[0];for(let o=1;o<e.length;o++)n=U(n,e[o],r);return t&&(n=U(n,t,r)),n}},Symbol.toStringTag,{value:"Module"}));const Nt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Bt(e){return function(t){return!!t&&typeof t=="object"}(e)&&!function(t){const r=Object.prototype.toString.call(t);return r==="[object RegExp]"||r==="[object Date]"||t.$$typeof===Nt}(e)}function I(e,t){return t.clone!==!1&&t.isMergeableObject(e)?E((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function zt(e,t,r){return e.concat(t).map(function(n){return I(n,r)})}function Q(e){return Object.keys(e).concat((t=e,Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(r){return Object.propertyIsEnumerable.call(t,r)}):[]));var t}function tt(e,t){try{return t in e}catch{return!1}}function E(e,t,r){(r=r||{}).arrayMerge=r.arrayMerge||zt,r.isMergeableObject=r.isMergeableObject||Bt,r.cloneUnlessOtherwiseSpecified=I;const n=Array.isArray(t);return n===Array.isArray(e)?n?r.arrayMerge(e,t,r):function(o,a,i){const l={};return i.isMergeableObject(o)&&Q(o).forEach(function(s){l[s]=I(o[s],i)}),Q(a).forEach(function(s){var c,d;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){if(!u.customMerge)return E;const f=u.customMerge(w);return typeof f=="function"?f:E}(s,i)(o[s],a[s],i):l[s]=I(a[s],i))}),l}(e,t,r):I(t,r)}E.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(r,n){return E(r,n,t)},{})};const qt=Object.freeze([]),Dt=Object.freeze({}),et=e=>e,R=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return(e==="x"?t:3&t|8).toString(16)}),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){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]}),Object.keys(e).length===0?null:e),$t=(e,t)=>!(e!==t&&!mt(e,t)&&!e.isEqual?.(t)),St=(e,t,r=$t)=>{if(e==null||e===t)return null;if(!e||typeof e!="object"||Array.isArray(e)||e.isImmutable?.())return r(e,t)?null:e;const n=Object.keys(e);if(n.length===0)return null;let o=!1;for(let a=0;a<n.length;a++){const i=n[a];St(e[i],t?.[i],r)===null&&(o=!0,delete e[i])}return o&&Object.keys(e).length===0?null:void 0},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=()=>{if(vt())return y.Node;const e=globalThis.navigator!==void 0&&globalThis.navigator.userAgent?globalThis.navigator.userAgent.toLowerCase():"";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};function vt(){return typeof process<"u"&&process.release?.name==="node"||(typeof process<"u"&&process.browser,!1)}const it=(e,t=!1)=>(document.hasFocus()||t)&&(e===document.activeElement||e?.contains(document.activeElement)),xt=Object.freeze(Object.defineProperty({__proto__:null,EmptyArray:qt,EmptyObject:Dt,OSType:y,arrayMove:function(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n},asNumber:e=>{const t=1*e;return Number.isFinite(t)?t:0},camelToPrettyCase:e=>e.length===1?e.toUpperCase():e.replace(/([A-Z])/g," $1").replace(/^./,function(t){return t.toUpperCase()}).trim(),canUseDOM:at,cancelTimeout:e=>{cancelAnimationFrame(e.id)},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=>{setTimeout(()=>{Function("console.log.apply(console, arguments)").apply(null,e),t()})}),debounce:function(e,t=300,r=!1){let n,o,a,i,l=0;function s(){let d=Date.now()-l;d<t&&d>=0?n=setTimeout(s,t-d):(n=null,r||(i=e.apply(a,o),a=o=null))}t==null&&(t=100);const c=function(){a=globalThis,o=arguments,l=Date.now();var d=r&&!n;return n||(n=setTimeout(s,t)),d&&(i=e.apply(a,o),a=o=null),i};return c.clear=function(){n&&(clearTimeout(n),n=null)},c.flush=function(){n&&(i=e.apply(a,o),a=o=null,clearTimeout(n),n=null)},c},deepEqual:function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;let n,o,a;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(o of t.entries())if(!r.has(o[0]))return!1;for(o of t.entries())if(!e(o[1],r.get(o[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(o of t.entries())if(!r.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(t[o]!==r[o])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(a=Object.keys(t),n=a.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;for(o=n;o--!==0;){let i=a[o];if(!(i==="_owner"&&t.$$typeof||e(t[i],r[i])))return!1}return!0}return t!=t&&r!=r},deepFreeze:function e(t){return Object.freeze(t),Object.keys(t).forEach(r=>{typeof t[r]!="object"||t[r]===null||Object.isFrozen(t[r])||e(t[r])}),t},deepMerge:E,diffValues:(e,t)=>{const r={},n=Object.keys(t),o=n.length;for(let a=0;a<o;a++){const i=n[a];e[i]!==t[i]&&(e[i]===void 0?r[i]=t[i]:r[i]=e[i])}return Object.keys(r).length===0?null:r},findEqualOrGreater:function(e,t,r=et){let n=0,o=e.length-1;for(;n<=o;){let a=Math.floor((n+o)/2),i=r(e[a]);if(i===t)return a;i<t?n=a+1:o=a-1}return n},findEqualOrLesser:function(e,t,r=et){let n=e.length-1,o=0;for(;n>=o;){let a=Math.floor((n+o)/2),i=r(e[a]);if(i===t)return a;i>t?n=a-1:o=a+1}return n},findNextStep:(e,t=!0,r=15,n=10,o=400)=>{const a=Math.max(e-n,0)+(t?1:-1);return Math.min(o,Math[t?"ceil":"floor"](a/r)*r+n)},getBuildEnv:()=>"browser2-build",getDPI:()=>{let e=1;return typeof window=="object"&&(e=window.devicePixelRatio||1),e},getFromPath:(e,t)=>{const r=t.split(".");let n=e;for(let o=0;o<r.length;o++){const a=r[o];if(!n)return null;let i=n[a];if(typeof i=="function"&&(i=i.bind(n)()),!i||!O(i))return i;n=i}return n??null},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)=>{if(e===t)return!0;if(e&&!t||t&&!e)return!1;const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let n=0;n<r.length;n++)if(e[r[n]]!==t[r[n]])return!1;return!0},isNode:vt,isNullOrUndefined:nt,isNumeric:e=>{const t=1*e;return Number.isFinite(t)&&typeof t=="number"},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)=>{const t=e.length;if(t>0&&e[t-1]!==void 0&&!O(e[t-1]))return e[t-1];let r=e[0]||{};for(let n=1;n<t;n++)r=E(r,e[n]||{},{arrayMerge:(o,a)=>[...a]});return r},nextTick:e=>{typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(()=>{e()}):(typeof setImmediate=="function"?setImmediate:setTimeout)(()=>{e()})},openFileDialog:(e="*.*")=>new Promise((t,r)=>{if(!at)return void r("Unable to open dialog with no dom.");const n=document.createElement("input");n.type="file",n.accept=e;let o=null,a=!1;globalThis.addEventListener?.("focus",()=>{setTimeout(()=>{o||a||(a=!0,t(null))},1e3)},{once:!0,passive:!0}),n.onchange=()=>{if(o=n.files[0],o){if(a)return void console.warn("File open detected after faux cancel.",o);t(o)}},n.autofocus=!0,n.click()}),rafThrottle:e=>{let t,r=!1,n=function(){r=!1,e(t)};return function(o){t=o,t&&t.persist&&t.persist(),r||(r=!0,requestAnimationFrame(n))}},removeEmptyProperties:Et,removeEqualValues:St,removeListenerAll:e=>{if(!e)return[];for(let t=0;t<e.length;t++)e[t]&&e[t]();return[]},requestTimeout:(e,t)=>{const r=rt(),n={id:requestAnimationFrame(function o(){rt()-r>=t?e.call(null):n.id=requestAnimationFrame(o)})};return n},roundAccurately:(e,t=0)=>{if(e==null||!isFinite(e))return null;const r=10**t;return Number(Math.round(e*r)/r)},setToPath:(e,t,r)=>{const n=t.split(".");let o=e;if(!o)throw new Error("Can not set path to a null path.");for(let a=0;o&&a<n.length-1;a++){const i=n[a];let l=o[i];if(l==null&&(l={},o[i]=l),!O(l))throw new Error("Can not set path to a non object path.");o=l}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.`);return o[n[n.length-1]]=r,e},splitNumber:e=>{let t=Math.abs(e);if(isNaN(t)||!isFinite(e))return null;let r=0|t,n=t-r,o=0,a=0,i=1;if(n>5e-8)for(;a<8&&Math.abs(o/i-n)>5e-8;)a++,i*=10,o=Math.round(n*i);return{ip:Math.trunc(e),fp:o,ipLength:Math.ceil(Math.log10(r+1)),fpLength:a}},subtractRect:(e,t,r=!1)=>{if(!t)return[e];if(!ot(e,t))return[];const n=[];let o=e;const a=()=>{t.top>o.top&&t.top<o.bottom&&(n.push({...o,bottom:t.top}),o={...o,top:t.top})},i=()=>{t.bottom>o.top&&t.bottom<o.bottom&&(n.push({...o,top:t.bottom}),o={...o,bottom:t.bottom})},l=()=>{t.right>o.left&&t.right<o.right&&(n.push({...o,left:t.right}),o={...o,right:t.right})},s=()=>{t.left>o.left&&t.left<o.right&&(n.push({...o,right:t.left}),o={...o,left:t.left})};return r?(s(),l(),a(),i()):(a(),i(),l(),s()),n},textToKey:e=>e.replace(/[^a-zA-Z0-9]/g,"").toLowerCase(),throttle:function(e,t){let r=null;return(...n)=>{const o=Date.now();(!r||o-r>=t)&&(r=o,e(...n))}},toSafeJSON:function e(t){if(t===null||typeof t!="object")return t;if(typeof t.toJSON=="function")return t.toJSON();if(Array.isArray(t))return t.map(n=>e(n));if(typeof t.toString=="function"&&t.toString!==Object.prototype.toString)return t.toString();const r={};for(const n in t)t.hasOwnProperty(n)&&(r[n]=e(t[n]));return r},transpose:e=>{if(!e)return e;const t=e.length,r=e[0].length,n=[];for(let o=0;o<r;o++)n[o]=Array(t);for(let o=0;o<t;o++)for(let a=0;a<r;a++)n[a][o]=e[o][a];return n},uuidV4:R,validEnumValue:(e,t)=>{if(!Object.values(e).includes(t))throw new Error(`Invalid type: ${t??"null"}. Must be one of: ${Object.values(t).join(", ")}.`)},whenFocus:async(e,t=!1)=>new Promise(r=>{it(e,t)?r(!0):e.addEventListener("focusin",()=>{r(!0)},{once:!0}),e.focus()})},Symbol.toStringTag,{value:"Module"}));Object.freeze(Object.defineProperty({__proto__:null,MESSAGE_ERROR_INVALID_ARG:e=>`Invalid argument: '${e}'.`},Symbol.toStringTag,{value:"Module"}));const _t=e=>{const t=new Uint8Array(e),r=t.byteLength;let n="";for(let o=0;o<r;o++)n+=String.fromCharCode(t[o]);if(typeof window<"u"&&typeof globalThis.btoa=="function")return globalThis.btoa(n);if(typeof Buffer<"u")return Buffer.from(n,"binary").toString("base64");throw new Error("Unsupported environment")},W=e=>new Promise((t,r)=>{if(e)if(typeof FileReader<"u"){const n=new FileReader;n.onload=()=>{t(n.result)},n.onerror=()=>{r(n.error)},n.readAsText(e)}else if(typeof Buffer<"u"){const n=o=>Buffer.from(o).toString("utf-8");e.arrayBuffer().then(o=>{t(n(o))}).catch(o=>{r(o)})}else r(new Error("Unsupported environment"));else t("")});Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_MIME_TYPE:"*/*",arrayBufferToBase64:_t,base64ToArrayBuffer:e=>{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);for(let o=0;o<r;o++)n[o]=t.charCodeAt(o);return n.buffer},blobToString:W},Symbol.toStringTag,{value:"Module"}));const Ot="data:image/png;base64,",It="Unable to resolve image.",lt=e=>new Promise(async(t,r)=>{let n=null;try{n=new Image,n.src=e,n.addEventListener("load",function(){t({width:n.naturalWidth,height:n.naturalHeight})},{once:!0}),n.addEventListener("error",function(){URL.revokeObjectURL(e),r("Invalid Image")},{once:!0}),await n.decode("sync")}catch{n?.src&&URL.revokeObjectURL(n.src)}n||r(It)}),P="image/svg+xml";var st,ct;Object.freeze(Object.defineProperty({__proto__:null,DATA_URL_PNG_PREFIX:Ot,getImageDataUrl:(e,t=1)=>new Promise(async(r,n)=>{let o=null;try{o=new Image,o.src=e,o.addEventListener("load",function(){try{const a=document.createElement("canvas");a.width=o.naturalWidth,a.height=o.naturalHeight,a.getContext("2d").drawImage(o,0,0);const i=a.toDataURL("image/png",t);r({elemImg:o,dataUrl:i})}catch(a){URL.revokeObjectURL(e),n(a)}},{once:!0}),o.addEventListener("error",function(){URL.revokeObjectURL(e),n("Invalid Image")},{once:!0}),await o.decode("sync")}catch{o?.src&&URL.revokeObjectURL(o.src)}o||n(It)}),loadImageDetails:async(e,t=null)=>{let r=null;const n=async()=>{try{const a=t??"image/*",i=URL.createObjectURL(new Blob([e],{type:a})),l=await lt(i);r={mimeType:a,naturalDimensions:l,asUrl:i}}catch{}},o=async()=>{try{const a=new TextDecoder().decode(e),i=URL.createObjectURL(new Blob([a],{type:P})),l=await lt(i);r={mimeType:t??P,naturalDimensions:l,asUrl:i,asSVGText:a}}catch{}};if(t===P?await o():t.startsWith("image/")?await n():(await n(),r||await o()),!r)throw new Error("Failed to load image");return r}},Symbol.toStringTag,{value:"Module"})),(ct=st||(st={})).resolveTypedUpdates=(e,t,r,n)=>{if(e===null)return e;if(e===void 0)return n;let o=e;if(t?.shorthand){const s=t?.shorthand(e,r);s!==void 0&&(o=s)}if(o!==null&&t?.getSubType){const s=t.getSubType(o);s&&(t=s)}const a=t?.properties,i=t?.arrayType??!1;let l=o;if(t&&t.merge&&l&&n)l=t.merge(l,n,r);else if(!i&&a){const s=Object.keys({...o,...n});l=null;for(let c=0;c<s.length;c++){const d=s[c];let w,u=o[d];if(u!==void 0){const f=a[d];w=f?(0,ct.resolveTypedUpdates)(u,f,r,n?.[d]):u}else w=n?.[d];w!=null&&(l=l??{},l[d]=w)}}return l};const ut=`The Safari browser does not support advanced copy and paste.
6
+ */const h="text/html",b="text/plain",L="image/png",Ct=Object.freeze({left:0,top:0}),Mt=Object.freeze({left:0,top:0,bottom:0,right:0}),Rt=Object.freeze({x:0,y:0,width:0,height:0});Object.freeze(Object.defineProperty({__proto__:null,EmptyBounds:Rt,EmptyRect:Mt,EmptyTopLeft:Ct},Symbol.toStringTag,{value:"Module"}));const m="column",j="row",At=Object.freeze({colIndex:0,rowIndex:0}),Ft=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,Lt=(e,t)=>e.rowEnd===t.rowEnd?t.colEnd-e.colEnd:t.rowEnd-e.rowEnd,Ut=(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?Lt:Ut: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)=>{if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!D(e[r],t[r]))return!1;return!0},U=(e,t,r)=>{if(!e&&!t)return null;if(!e)return r?t:{...t};if(!t)return r?e:{...e};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);let l=r;return l?(l.colStart=n,l.rowStart=o,l.colEnd=a,l.rowEnd=i):l={colStart:n,rowStart:o,colEnd:a,rowEnd:i},l},Z=(e,t)=>{if(!t||t.length===0)return e;const r={...e};for(let n=0;n<t.length;n++){const o=t[n];$(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))}return r},Pt=[null,null],kt=(e,t,r)=>{if(e[0].value===e[1].value)return t};function X(e,t=2,r,n=j,o){let a=[...e];if(t<=0||e.length<=1)return a;let i=n===m,l=0,s=!1;do{const c=a.sort(bt(i?j:m));a=[],a.push(c[0]);const d=c.length;let w=0,u=c[0],f=u.colStart,p=u.rowStart,x=u.colEnd,_=u.rowEnd;for(let A=1;A<d;A++){const g=c[A];let G=!1;if(G=i?u&&p===g.rowStart&&_===g.rowEnd&&x+1===g.colStart:u&&f===g.colStart&&x===g.colEnd&&_+1===g.rowStart,G){let S={colStart:f,rowStart:p,colEnd:i?g.colEnd:x,rowEnd:i?_:g.rowEnd};if(u.value!==void 0&&(S.value=u.value),r){const F=o??[null,null];F[0]=u,F[1]=g,S=r(F,S,n)}if(S){a[w]=S,s=!0,u=S,f=u.colStart,p=u.rowStart,x=u.colEnd,_=u.rowEnd;continue}}a[++w]=g,u=g,f=u.colStart,p=u.rowStart,x=u.colEnd,_=u.rowEnd}l++,i=!i,l===1&&(s=!0)}while(l<t&&s&&a.length>1);return a}Object.freeze(Object.defineProperty({__proto__:null,EmptyCell:At,EmptyRange:Ft,cellToRange:(e,t)=>{if(!e)return null;let r=t;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},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)=>{const r=[];let n,o,a=Number.MIN_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER;return{append:(l,s,c)=>{let d=!0;const w=c!==void 0;if(w){const p=e?e(o,c,t):o===c?c:void 0;p===void 0?d=!1:c=p}if(d&&s===i+1&&l===a)return t?n.rowEnd=s:n.colEnd=s,i=s,void(o=c);n&&r.push(n);const u=t?l:s,f=t?s:l;n={colStart:u,rowStart:f,colEnd:u,rowEnd:f},w&&(n.value=c),a=l,i=s,o=c},done:l=>(n&&(r.push(n),n=null),l?X(r,3,l===!0?kt:l,t?m:j,Pt):r)}},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)=>{if(!t||t.length===0)return e;let r=e,n=null;for(;!D(r,n);)n=r,r=Z(n,t);return r},indexOfCoords:(e,t)=>{const r={colStart:e.colIndex,rowStart:e.rowIndex,colEnd:e.colIndex,rowEnd:e.rowIndex};for(let n=t.length-1;n>=0;n--)if($(r,t[n]))return n;return-1},intersectRanges:(e,t,r)=>{if(!e)return r?t:{...t};if(!t)return r?e:{...e};if(!e&&!t||e.rowStart>t.rowEnd||e.rowEnd<t.rowStart||e.colStart>t.colEnd||e.colEnd<t.colStart)return null;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);let l=r;return l?(l.colStart=n,l.rowStart=o,l.colEnd=a,l.rowEnd=i):l={colStart:n,rowStart:o,colEnd:a,rowEnd:i},l},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)=>{if(!e||e.length===0)return null;if(e.length===1&&!t)return e[0];let n=e[0];for(let o=1;o<e.length;o++)n=U(n,e[o],r);return t&&(n=U(n,t,r)),n}},Symbol.toStringTag,{value:"Module"}));const Nt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Bt(e){return function(t){return!!t&&typeof t=="object"}(e)&&!function(t){const r=Object.prototype.toString.call(t);return r==="[object RegExp]"||r==="[object Date]"||t.$$typeof===Nt}(e)}function I(e,t){return t.clone!==!1&&t.isMergeableObject(e)?E((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function zt(e,t,r){return e.concat(t).map(function(n){return I(n,r)})}function Q(e){return Object.keys(e).concat((t=e,Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(r){return Object.propertyIsEnumerable.call(t,r)}):[]));var t}function tt(e,t){try{return t in e}catch{return!1}}function E(e,t,r){(r=r||{}).arrayMerge=r.arrayMerge||zt,r.isMergeableObject=r.isMergeableObject||Bt,r.cloneUnlessOtherwiseSpecified=I;const n=Array.isArray(t);return n===Array.isArray(e)?n?r.arrayMerge(e,t,r):function(o,a,i){const l={};return i.isMergeableObject(o)&&Q(o).forEach(function(s){l[s]=I(o[s],i)}),Q(a).forEach(function(s){var c,d;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){if(!u.customMerge)return E;const f=u.customMerge(w);return typeof f=="function"?f:E}(s,i)(o[s],a[s],i):l[s]=I(a[s],i))}),l}(e,t,r):I(t,r)}E.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(r,n){return E(r,n,t)},{})};const qt=Object.freeze([]),Dt=Object.freeze({}),et=e=>e,R=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return(e==="x"?t:3&t|8).toString(16)}),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){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]}),Object.keys(e).length===0?null:e),$t=(e,t)=>!(e!==t&&!mt(e,t)&&!e.isEqual?.(t)),St=(e,t,r=$t)=>{if(e==null||e===t)return null;if(!e||typeof e!="object"||Array.isArray(e)||e.isImmutable?.())return r(e,t)?null:e;const n=Object.keys(e);if(n.length===0)return null;let o=!1;for(let a=0;a<n.length;a++){const i=n[a];St(e[i],t?.[i],r)===null&&(o=!0,delete e[i])}return o&&Object.keys(e).length===0?null:void 0},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=()=>{if(vt())return y.Node;const e=globalThis.navigator!==void 0&&globalThis.navigator.userAgent?globalThis.navigator.userAgent.toLowerCase():"";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};function vt(){return typeof process<"u"&&process.release?.name==="node"||(typeof process<"u"&&process.browser,!1)}const it=(e,t=!1)=>(document.hasFocus()||t)&&(e===document.activeElement||e?.contains(document.activeElement)),xt=Object.freeze(Object.defineProperty({__proto__:null,EmptyArray:qt,EmptyObject:Dt,OSType:y,arrayMove:function(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n},asNumber:e=>{const t=1*e;return Number.isFinite(t)?t:0},camelToPrettyCase:e=>e.length===1?e.toUpperCase():e.replace(/([A-Z])/g," $1").replace(/^./,function(t){return t.toUpperCase()}).trim(),canUseDOM:at,cancelTimeout:e=>{cancelAnimationFrame(e.id)},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=>{setTimeout(()=>{Function("console.log.apply(console, arguments)").apply(null,e),t()})}),debounce:function(e,t=300,r=!1){let n,o,a,i,l=0;function s(){let d=Date.now()-l;d<t&&d>=0?n=setTimeout(s,t-d):(n=null,r||(i=e.apply(a,o),a=o=null))}t==null&&(t=100);const c=function(){a=globalThis,o=arguments,l=Date.now();var d=r&&!n;return n||(n=setTimeout(s,t)),d&&(i=e.apply(a,o),a=o=null),i};return c.clear=function(){n&&(clearTimeout(n),n=null)},c.flush=function(){n&&(i=e.apply(a,o),a=o=null,clearTimeout(n),n=null)},c},deepEqual:function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;let n,o,a;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(o of t.entries())if(!r.has(o[0]))return!1;for(o of t.entries())if(!e(o[1],r.get(o[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(o of t.entries())if(!r.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(t[o]!==r[o])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(a=Object.keys(t),n=a.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;for(o=n;o--!==0;){let i=a[o];if(!(i==="_owner"&&t.$$typeof||e(t[i],r[i])))return!1}return!0}return t!=t&&r!=r},deepFreeze:function e(t){return Object.freeze(t),Object.keys(t).forEach(r=>{typeof t[r]!="object"||t[r]===null||Object.isFrozen(t[r])||e(t[r])}),t},deepMerge:E,diffValues:(e,t)=>{const r={},n=Object.keys(t),o=n.length;for(let a=0;a<o;a++){const i=n[a];e[i]!==t[i]&&(e[i]===void 0?r[i]=t[i]:r[i]=e[i])}return Object.keys(r).length===0?null:r},findEqualOrGreater:function(e,t,r=et){let n=0,o=e.length-1;for(;n<=o;){let a=Math.floor((n+o)/2),i=r(e[a]);if(i===t)return a;i<t?n=a+1:o=a-1}return n},findEqualOrLesser:function(e,t,r=et){let n=e.length-1,o=0;for(;n>=o;){let a=Math.floor((n+o)/2),i=r(e[a]);if(i===t)return a;i>t?n=a-1:o=a+1}return n},findNextStep:(e,t=!0,r=15,n=10,o=400)=>{const a=Math.max(e-n,0)+(t?1:-1);return Math.min(o,Math[t?"ceil":"floor"](a/r)*r+n)},getDPI:()=>{let e=1;return typeof window=="object"&&(e=window.devicePixelRatio||1),e},getFromPath:(e,t)=>{const r=t.split(".");let n=e;for(let o=0;o<r.length;o++){const a=r[o];if(!n)return null;let i=n[a];if(typeof i=="function"&&(i=i.bind(n)()),!i||!O(i))return i;n=i}return n??null},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)=>{if(e===t)return!0;if(e&&!t||t&&!e)return!1;const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let n=0;n<r.length;n++)if(e[r[n]]!==t[r[n]])return!1;return!0},isNode:vt,isNullOrUndefined:nt,isNumeric:e=>{const t=1*e;return Number.isFinite(t)&&typeof t=="number"},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)=>{const t=e.length;if(t>0&&e[t-1]!==void 0&&!O(e[t-1]))return e[t-1];let r=e[0]||{};for(let n=1;n<t;n++)r=E(r,e[n]||{},{arrayMerge:(o,a)=>[...a]});return r},nextTick:e=>{typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(()=>{e()}):(typeof setImmediate=="function"?setImmediate:setTimeout)(()=>{e()})},openFileDialog:(e="*.*")=>new Promise((t,r)=>{if(!at)return void r("Unable to open dialog with no dom.");const n=document.createElement("input");n.type="file",n.accept=e;let o=null,a=!1;globalThis.addEventListener?.("focus",()=>{setTimeout(()=>{o||a||(a=!0,t(null))},1e3)},{once:!0,passive:!0}),n.onchange=()=>{if(o=n.files[0],o){if(a)return void console.warn("File open detected after faux cancel.",o);t(o)}},n.autofocus=!0,n.click()}),rafThrottle:e=>{let t,r=!1,n=function(){r=!1,e(t)};return function(o){t=o,t&&t.persist&&t.persist(),r||(r=!0,requestAnimationFrame(n))}},removeEmptyProperties:Et,removeEqualValues:St,removeListenerAll:e=>{if(!e)return[];for(let t=0;t<e.length;t++)e[t]&&e[t]();return[]},requestTimeout:(e,t)=>{const r=rt(),n={id:requestAnimationFrame(function o(){rt()-r>=t?e.call(null):n.id=requestAnimationFrame(o)})};return n},roundAccurately:(e,t=0)=>{if(e==null||!isFinite(e))return null;const r=10**t;return Number(Math.round(e*r)/r)},setToPath:(e,t,r)=>{const n=t.split(".");let o=e;if(!o)throw new Error("Can not set path to a null path.");for(let a=0;o&&a<n.length-1;a++){const i=n[a];let l=o[i];if(l==null&&(l={},o[i]=l),!O(l))throw new Error("Can not set path to a non object path.");o=l}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.`);return o[n[n.length-1]]=r,e},splitNumber:e=>{let t=Math.abs(e);if(isNaN(t)||!isFinite(e))return null;let r=0|t,n=t-r,o=0,a=0,i=1;if(n>5e-8)for(;a<8&&Math.abs(o/i-n)>5e-8;)a++,i*=10,o=Math.round(n*i);return{ip:Math.trunc(e),fp:o,ipLength:Math.ceil(Math.log10(r+1)),fpLength:a}},subtractRect:(e,t,r=!1)=>{if(!t)return[e];if(!ot(e,t))return[];const n=[];let o=e;const a=()=>{t.top>o.top&&t.top<o.bottom&&(n.push({...o,bottom:t.top}),o={...o,top:t.top})},i=()=>{t.bottom>o.top&&t.bottom<o.bottom&&(n.push({...o,top:t.bottom}),o={...o,bottom:t.bottom})},l=()=>{t.right>o.left&&t.right<o.right&&(n.push({...o,left:t.right}),o={...o,right:t.right})},s=()=>{t.left>o.left&&t.left<o.right&&(n.push({...o,right:t.left}),o={...o,left:t.left})};return r?(s(),l(),a(),i()):(a(),i(),l(),s()),n},textToKey:e=>e.replace(/[^a-zA-Z0-9]/g,"").toLowerCase(),throttle:function(e,t){let r=null;return(...n)=>{const o=Date.now();(!r||o-r>=t)&&(r=o,e(...n))}},toSafeJSON:function e(t){if(t===null||typeof t!="object")return t;if(typeof t.toJSON=="function")return t.toJSON();if(Array.isArray(t))return t.map(n=>e(n));if(typeof t.toString=="function"&&t.toString!==Object.prototype.toString)return t.toString();const r={};for(const n in t)t.hasOwnProperty(n)&&(r[n]=e(t[n]));return r},transpose:e=>{if(!e)return e;const t=e.length,r=e[0].length,n=[];for(let o=0;o<r;o++)n[o]=Array(t);for(let o=0;o<t;o++)for(let a=0;a<r;a++)n[a][o]=e[o][a];return n},uuidV4:R,validEnumValue:(e,t)=>{if(!Object.values(e).includes(t))throw new Error(`Invalid type: ${t??"null"}. Must be one of: ${Object.values(t).join(", ")}.`)},whenFocus:async(e,t=!1)=>new Promise(r=>{it(e,t)?r(!0):e.addEventListener("focusin",()=>{r(!0)},{once:!0}),e.focus()})},Symbol.toStringTag,{value:"Module"}));Object.freeze(Object.defineProperty({__proto__:null,MESSAGE_ERROR_INVALID_ARG:e=>`Invalid argument: '${e}'.`},Symbol.toStringTag,{value:"Module"}));const _t=e=>{const t=new Uint8Array(e),r=t.byteLength;let n="";for(let o=0;o<r;o++)n+=String.fromCharCode(t[o]);if(typeof window<"u"&&typeof globalThis.btoa=="function")return globalThis.btoa(n);if(typeof Buffer<"u")return Buffer.from(n,"binary").toString("base64");throw new Error("Unsupported environment")},W=e=>new Promise((t,r)=>{if(e)if(typeof FileReader<"u"){const n=new FileReader;n.onload=()=>{t(n.result)},n.onerror=()=>{r(n.error)},n.readAsText(e)}else if(typeof Buffer<"u"){const n=o=>Buffer.from(o).toString("utf-8");e.arrayBuffer().then(o=>{t(n(o))}).catch(o=>{r(o)})}else r(new Error("Unsupported environment"));else t("")});Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_MIME_TYPE:"*/*",arrayBufferToBase64:_t,base64ToArrayBuffer:e=>{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);for(let o=0;o<r;o++)n[o]=t.charCodeAt(o);return n.buffer},blobToString:W},Symbol.toStringTag,{value:"Module"}));const Ot="data:image/png;base64,",It="Unable to resolve image.",lt=e=>new Promise(async(t,r)=>{let n=null;try{n=new Image,n.src=e,n.addEventListener("load",function(){t({width:n.naturalWidth,height:n.naturalHeight})},{once:!0}),n.addEventListener("error",function(){URL.revokeObjectURL(e),r("Invalid Image")},{once:!0}),await n.decode("sync")}catch{n?.src&&URL.revokeObjectURL(n.src)}n||r(It)}),P="image/svg+xml";var st,ct;Object.freeze(Object.defineProperty({__proto__:null,DATA_URL_PNG_PREFIX:Ot,getImageDataUrl:(e,t=1)=>new Promise(async(r,n)=>{let o=null;try{o=new Image,o.src=e,o.addEventListener("load",function(){try{const a=document.createElement("canvas");a.width=o.naturalWidth,a.height=o.naturalHeight,a.getContext("2d").drawImage(o,0,0);const i=a.toDataURL("image/png",t);r({elemImg:o,dataUrl:i})}catch(a){URL.revokeObjectURL(e),n(a)}},{once:!0}),o.addEventListener("error",function(){URL.revokeObjectURL(e),n("Invalid Image")},{once:!0}),await o.decode("sync")}catch{o?.src&&URL.revokeObjectURL(o.src)}o||n(It)}),loadImageDetails:async(e,t=null)=>{let r=null;const n=async()=>{try{const a=t??"image/*",i=URL.createObjectURL(new Blob([e],{type:a})),l=await lt(i);r={mimeType:a,naturalDimensions:l,asUrl:i}}catch{}},o=async()=>{try{const a=new TextDecoder().decode(e),i=URL.createObjectURL(new Blob([a],{type:P})),l=await lt(i);r={mimeType:t??P,naturalDimensions:l,asUrl:i,asSVGText:a}}catch{}};if(t===P?await o():t.startsWith("image/")?await n():(await n(),r||await o()),!r)throw new Error("Failed to load image");return r}},Symbol.toStringTag,{value:"Module"})),(ct=st||(st={})).resolveTypedUpdates=(e,t,r,n)=>{if(e===null)return e;if(e===void 0)return n;let o=e;if(t?.shorthand){const s=t?.shorthand(e,r);s!==void 0&&(o=s)}if(o!==null&&t?.getSubType){const s=t.getSubType(o);s&&(t=s)}const a=t?.properties,i=t?.arrayType??!1;let l=o;if(t&&t.merge&&l&&n)l=t.merge(l,n,r);else if(!i&&a){const s=Object.keys({...o,...n});l=null;for(let c=0;c<s.length;c++){const d=s[c];let w,u=o[d];if(u!==void 0){const f=a[d];w=f?(0,ct.resolveTypedUpdates)(u,f,r,n?.[d]):u}else w=n?.[d];w!=null&&(l=l??{},l[d]=w)}}return l};const ut=`The Safari browser does not support advanced copy and paste.
17
7
  Copy and paste will be limited to within the browser tab.
18
8
 
19
9
  Please use Chrome or Edge if external copy and paste is required.`,k=`You do not have permissions to access the clipboard.
20
10
  All copy and paste operations will be limited to the browser tab.`,jt={Safari:`The Safari browser does not support advanced copy and paste.
21
11
  Copy and paste will be limited to within the browser tab.
22
12
 
23
- 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=>{document.hasFocus()?e():globalThis.addEventListener?.("focus",()=>{e()},{once:!0}),document.activeElement.focus?.()}),B=async(e,t,r)=>{if(T()===y.Safari)return await r(new Error(jt.Safari));try{const n=async i=>{try{return await i()}catch(l){if(l.message?.includes("Document is not focused"))return!1;throw l}},o=await globalThis?.navigator?.permissions?.query({name:e,allowWithoutGesture:!0,allowWithoutSanitization:!0});let a=!1;if(o.state==="prompt"&&(a=await n(t)),a||o.state!=="granted"||(a=await t()),!a)return await r(new Error(o.state))}catch(n){return n.message==="No valid data on clipboard"||n.name==="DataError"?void 0:await r(n)}},Tt=async e=>{try{return await e.read({unsanitized:[h]})}catch{}return await e.read()};if(!globalThis.ClipboardItem){const e=(r,n)=>new Blob([n],{type:r});class t{constructor(n,o){this._items={},this._types=Object.keys(n);const a={},i=Object.keys(n);for(let l=0;l<i.length;l++){const s=i[l];let c=n[s];a[s]=typeof c=="string"?e(s,c):c}this._items=a,this._presentationStyle=o?.presentationStyle??"unspecified"}get types(){return this._types}getType(n){return Promise.resolve(this._items[n])}supports(n){return!0}}globalThis.ClipboardItem=t}const V=async(e,t=h)=>new Promise(async(r,n)=>{try{const o=await(async(a,i)=>{if(!a)return null;const l=await Tt(a);let s=!1;for(let c=0;!s&&l&&c<l.length;c++)if(s=l[c].types.includes(i),s)return await l[c].getType(i);return s?void 0:null})(e,t);if(o){const a=new FileReader;a.onload=()=>{r(a.result)},a.onerror=()=>{r("")},a.readAsText(o)}else r("")}catch(o){n(o)}}),dt=async(e,t=h)=>{const r=await V(e,t);if(!r)return null;let n=null;try{n=new DOMParser().parseFromString(r,h)}catch{console.warn("Can't parse html from clipboard.")}return n},C="clipboard-uuid",v="web text/uuid",ft=e=>`<div style="display:none" ${C}="${e}"/>`,Wt=(e,t)=>{let r=null;try{const n=new DOMParser().parseFromString(t,h);n.body.firstElementChild.setAttribute(C,e),r=n.getElementsByTagName("body")[0].innerHTML}catch(n){console.warn("Can't embed uuid.",n)}return r},pt=(e,t)=>{if(!t||!e)return!1;try{const r=t.querySelectorAll(`[${C}="${e}"]`);if(r&&r.length===1)return!0;if(t.querySelector("parsererror"))throw new Error("We are unable to parse node");return!1}catch{return!1}};class wt{constructor(t){if(t?.nativeClipboard===void 0||t?.nativeClipboard===!0)try{this._nativeClipboard=globalThis?.navigator.clipboard}catch{t?.nativeClipboard===!0&&console.warn("NativeClipboard option set to true but no native clipboard available.")}else this._nativeClipboard=t?.nativeClipboard===!1?null:t?.nativeClipboard;this._disableCheckOnFocus=t?.disableCheckOnFocus??!1,this._init()}async _checkForChanges(){this._nativeClipboard&&this._state&&!this._disableCheckOnFocus&&await B("clipboard-read",async()=>{await N();const t=await V(this._nativeClipboard,v);if(!this._state||t&&t===this._state.uuid)return!0;const r=await dt(this._nativeClipboard,h);return!this._state||(pt(this._state.uuid,r)||this.clear(),!0)},async t=>{t?.message==="denied"||t.message?.includes("Document is not focused")||T()===y.Safari||console.warn("Unable to detect clipboard changes: ",t)})}_init(){const t=this;this._listeners=new Map,this._listenersCapture=new Map,this._state=null,this._nativeClipboard&&(this._onFocus=()=>{t._checkForChanges()},this._onBlur=()=>{globalThis.addEventListener?.("focus",t._onFocus,{once:!0})},globalThis.addEventListener?.("blur",this._onBlur),this._nativeClipboard.addEventListener("clipboardchange",r=>{t._checkForChanges()}))}async read(){if(!this._nativeClipboard)return this._state?.items??null;const t=this;return await B("clipboard-read",async()=>{if(await N(),this._state?.uuid){const r=await V(this._nativeClipboard,v);if(r&&r===t._state.uuid)return!0;const n=await dt(this._nativeClipboard,h);if(pt(t._state?.uuid,n))return!0}return t._state={items:await Tt(this._nativeClipboard),uuid:null,ref:null},this.dispatchEvent(new Event("clipboardread")),!0},async r=>{this.dispatchEvent(new Event("clipboarderrorread"))}),this._state?.items??[]}async write(t){return this._write({uuid:R(),items:t,ref:null})}async _write(t){if(!this._nativeClipboard)return this._state=t,this.dispatchEvent(new Event("clipboardwrite")),this.dispatchEvent(new Event("clipboardchange")),null;const r=this,n=[],o=t.uuid;let a=t.items??[];const i=()=>{r._state={uuid:o,ref:t.ref,items:n},r.dispatchEvent(new Event("clipboardwrite")),r.dispatchEvent(new Event("clipboardchange"))};await B("clipboard-write",async()=>{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})})));for(let l=0;l<Math.min(1,a.length);l++){const s=a[l];let c=s.types.indexOf(h),d=null;if(c!==-1){const f=await s.getType(h);d=await W(f),d&&(d=Wt(o,d))}if(!d&&s.types.includes(b)){const f=await s.getType(b);if(f){let p=null;typeof f=="string"?(console.warn("text as string",f),p=f):p=await W(f),p&&(d=`<div ${C}="${o}">${p}</div>`)}}if(!d&&s.types.includes(L)){const f=await s.getType(L),p=_t(await f.arrayBuffer());d=`<div ${C}="${o}"><img src="${Ot+p}"/></div>`}!d&&o&&(d=ft(o));const w=new Blob([d??""],{type:h}),u={};for(let f=0;f<s.types.length;f++){const p=s.types[f];u[p]=f===c?w:s.getType(p)}d&&c===-1&&(u[h]=w),o&&(u[v]=new Blob([o],{type:v})),n.push(new ClipboardItem(u))}try{n&&n.length!==0?await this._nativeClipboard.write(n):await(async l=>{l&&await l.writeText("")})(this._nativeClipboard)}catch(l){l.message?.includes("Document is not focused")||console.warn("Unable to write to native clipboard: ",l)}return i(),!0},async l=>{this.dispatchEvent(new Event("clipboarderrorwrite")),i()})}async writeReference(t){if(!t)return void this.clear();let r=null;const n={};try{const a=await t.toText?.()??null;a&&(n[b]=new Blob([a??""],{type:b}))}catch(a){r=a}try{const a=await t.toHtml?.()??null;a&&(n[h]=new Blob([a],{type:h}))}catch(a){r=a,console.warn("export to html",a)}try{const a=await t.toImage?.()??null;a&&(n[L]=a)}catch(a){r=a,console.warn("export to png",a)}const o=this._write({uuid:R(),ref:t,items:Object.keys(n).length>0?[new ClipboardItem(n)]:null});if(r)throw r;return o}clear(t=!1){this._state&&(this._state=null,t&&this._write({uuid:null,ref:null,items:null}),this.dispatchEvent(new Event("clipboardwrite")),this.dispatchEvent(new Event("clipboardchange")))}async readReference(){return await this.read(),this._state?.ref??null}readText(){return new Promise(async(t,r)=>{const n=await this.read();let o=null;for(let i=0;!o&&n&&i<n.length;i++)n[i].types.includes(b)&&(o=await n[i].getType(b));if(!o)return void t("");const a=new FileReader;a.onload=()=>{t(a.result)},a.readAsText(o),a.onerror=i=>{r(i)}})}async writeText(t){const r=[new ClipboardItem({[b]:new Blob([t],{type:b})})];return this._write({uuid:R(),items:r,ref:null})}addEventListener(t,r,n={}){const o=n?.capture?this._listenersCapture:this._listeners;let a=o.get(t);a||(a=new Map,o.set(t,a)),a.set(r,typeof n=="boolean"?{}:n)}dispatchEvent(t){if(!t)return;const r=n=>{const o=n.get(t.type);o&&o.forEach((a,i)=>{try{typeof i=="function"?i(t):i.handleEvent&&i.handleEvent(t),a.once&&o.delete(i)}catch(l){console.warn(l)}})};return r(this._listenersCapture),r(this._listeners),!0}removeEventListener(t,r,n){const o=n?.capture?this._listenersCapture:this._listeners,a=o.get(t);a&&(a.delete(r),a.size===0&&o.delete(t))}close(){globalThis.removeEventListener?.("focus",this._onFocus),globalThis.removeEventListener?.("blur",this._onBlur)}}var z;(z=wt||(wt={})).ErrorMessages=jt,z.Global=new z;let ht=null,q=null,M=null;const Vt=Object.freeze({compileTypescript:async function(e){if(!e?.source)return null;if(q&&xt.deepEqual(q,e))return ht;const t=await async function(){if(M)return M;const{TypeScriptCompiler:n}=await Promise.resolve().then(()=>require("./B-H7eMELHIPn-bzr.cjs"));return M=new n,M}(),r=await t.compileModule(e);return ht=r,q=e,r}}),Gt=Object.freeze(Object.defineProperty({__proto__:null,ScriptingUtils:Vt},Symbol.toStringTag,{value:"Module"}));exports.$t=xt,exports.index=Gt;
13
+ 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=>{document.hasFocus()?e():globalThis.addEventListener?.("focus",()=>{e()},{once:!0}),document.activeElement.focus?.()}),B=async(e,t,r)=>{if(T()===y.Safari)return await r(new Error(jt.Safari));try{const n=async i=>{try{return await i()}catch(l){if(l.message?.includes("Document is not focused"))return!1;throw l}},o=await globalThis?.navigator?.permissions?.query({name:e,allowWithoutGesture:!0,allowWithoutSanitization:!0});let a=!1;if(o.state==="prompt"&&(a=await n(t)),a||o.state!=="granted"||(a=await t()),!a)return await r(new Error(o.state))}catch(n){return n.message==="No valid data on clipboard"||n.name==="DataError"?void 0:await r(n)}},Tt=async e=>{try{return await e.read({unsanitized:[h]})}catch{}return await e.read()};if(!globalThis.ClipboardItem){const e=(r,n)=>new Blob([n],{type:r});class t{constructor(n,o){this._items={},this._types=Object.keys(n);const a={},i=Object.keys(n);for(let l=0;l<i.length;l++){const s=i[l];let c=n[s];a[s]=typeof c=="string"?e(s,c):c}this._items=a,this._presentationStyle=o?.presentationStyle??"unspecified"}get types(){return this._types}getType(n){return Promise.resolve(this._items[n])}supports(n){return!0}}globalThis.ClipboardItem=t}const V=async(e,t=h)=>new Promise(async(r,n)=>{try{const o=await(async(a,i)=>{if(!a)return null;const l=await Tt(a);let s=!1;for(let c=0;!s&&l&&c<l.length;c++)if(s=l[c].types.includes(i),s)return await l[c].getType(i);return s?void 0:null})(e,t);if(o){const a=new FileReader;a.onload=()=>{r(a.result)},a.onerror=()=>{r("")},a.readAsText(o)}else r("")}catch(o){n(o)}}),dt=async(e,t=h)=>{const r=await V(e,t);if(!r)return null;let n=null;try{n=new DOMParser().parseFromString(r,h)}catch{console.warn("Can't parse html from clipboard.")}return n},C="clipboard-uuid",v="web text/uuid",ft=e=>`<div style="display:none" ${C}="${e}"/>`,Wt=(e,t)=>{let r=null;try{const n=new DOMParser().parseFromString(t,h);n.body.firstElementChild.setAttribute(C,e),r=n.getElementsByTagName("body")[0].innerHTML}catch(n){console.warn("Can't embed uuid.",n)}return r},pt=(e,t)=>{if(!t||!e)return!1;try{const r=t.querySelectorAll(`[${C}="${e}"]`);if(r&&r.length===1)return!0;if(t.querySelector("parsererror"))throw new Error("We are unable to parse node");return!1}catch{return!1}};class wt{constructor(t){if(t?.nativeClipboard===void 0||t?.nativeClipboard===!0)try{this._nativeClipboard=globalThis?.navigator.clipboard}catch{t?.nativeClipboard===!0&&console.warn("NativeClipboard option set to true but no native clipboard available.")}else this._nativeClipboard=t?.nativeClipboard===!1?null:t?.nativeClipboard;this._disableCheckOnFocus=t?.disableCheckOnFocus??!1,this._init()}async _checkForChanges(){this._nativeClipboard&&this._state&&!this._disableCheckOnFocus&&await B("clipboard-read",async()=>{await N();const t=await V(this._nativeClipboard,v);if(!this._state||t&&t===this._state.uuid)return!0;const r=await dt(this._nativeClipboard,h);return!this._state||(pt(this._state.uuid,r)||this.clear(),!0)},async t=>{t?.message==="denied"||t.message?.includes("Document is not focused")||T()===y.Safari||console.warn("Unable to detect clipboard changes: ",t)})}_init(){const t=this;this._listeners=new Map,this._listenersCapture=new Map,this._state=null,this._nativeClipboard&&(this._onFocus=()=>{t._checkForChanges()},this._onBlur=()=>{globalThis.addEventListener?.("focus",t._onFocus,{once:!0})},globalThis.addEventListener?.("blur",this._onBlur),this._nativeClipboard.addEventListener("clipboardchange",r=>{t._checkForChanges()}))}async read(){if(!this._nativeClipboard)return this._state?.items??null;const t=this;return await B("clipboard-read",async()=>{if(await N(),this._state?.uuid){const r=await V(this._nativeClipboard,v);if(r&&r===t._state.uuid)return!0;const n=await dt(this._nativeClipboard,h);if(pt(t._state?.uuid,n))return!0}return t._state={items:await Tt(this._nativeClipboard),uuid:null,ref:null},this.dispatchEvent(new Event("clipboardread")),!0},async r=>{this.dispatchEvent(new Event("clipboarderrorread"))}),this._state?.items??[]}async write(t){return this._write({uuid:R(),items:t,ref:null})}async _write(t){if(!this._nativeClipboard)return this._state=t,this.dispatchEvent(new Event("clipboardwrite")),this.dispatchEvent(new Event("clipboardchange")),null;const r=this,n=[],o=t.uuid;let a=t.items??[];const i=()=>{r._state={uuid:o,ref:t.ref,items:n},r.dispatchEvent(new Event("clipboardwrite")),r.dispatchEvent(new Event("clipboardchange"))};await B("clipboard-write",async()=>{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})})));for(let l=0;l<Math.min(1,a.length);l++){const s=a[l];let c=s.types.indexOf(h),d=null;if(c!==-1){const f=await s.getType(h);d=await W(f),d&&(d=Wt(o,d))}if(!d&&s.types.includes(b)){const f=await s.getType(b);if(f){let p=null;typeof f=="string"?(console.warn("text as string",f),p=f):p=await W(f),p&&(d=`<div ${C}="${o}">${p}</div>`)}}if(!d&&s.types.includes(L)){const f=await s.getType(L),p=_t(await f.arrayBuffer());d=`<div ${C}="${o}"><img src="${Ot+p}"/></div>`}!d&&o&&(d=ft(o));const w=new Blob([d??""],{type:h}),u={};for(let f=0;f<s.types.length;f++){const p=s.types[f];u[p]=f===c?w:s.getType(p)}d&&c===-1&&(u[h]=w),o&&(u[v]=new Blob([o],{type:v})),n.push(new ClipboardItem(u))}try{n&&n.length!==0?await this._nativeClipboard.write(n):await(async l=>{l&&await l.writeText("")})(this._nativeClipboard)}catch(l){l.message?.includes("Document is not focused")||console.warn("Unable to write to native clipboard: ",l)}return i(),!0},async l=>{this.dispatchEvent(new Event("clipboarderrorwrite")),i()})}async writeReference(t){if(!t)return void this.clear();let r=null;const n={};try{const a=await t.toText?.()??null;a&&(n[b]=new Blob([a??""],{type:b}))}catch(a){r=a}try{const a=await t.toHtml?.()??null;a&&(n[h]=new Blob([a],{type:h}))}catch(a){r=a,console.warn("export to html",a)}try{const a=await t.toImage?.()??null;a&&(n[L]=a)}catch(a){r=a,console.warn("export to png",a)}const o=this._write({uuid:R(),ref:t,items:Object.keys(n).length>0?[new ClipboardItem(n)]:null});if(r)throw r;return o}clear(t=!1){this._state&&(this._state=null,t&&this._write({uuid:null,ref:null,items:null}),this.dispatchEvent(new Event("clipboardwrite")),this.dispatchEvent(new Event("clipboardchange")))}async readReference(){return await this.read(),this._state?.ref??null}readText(){return new Promise(async(t,r)=>{const n=await this.read();let o=null;for(let i=0;!o&&n&&i<n.length;i++)n[i].types.includes(b)&&(o=await n[i].getType(b));if(!o)return void t("");const a=new FileReader;a.onload=()=>{t(a.result)},a.readAsText(o),a.onerror=i=>{r(i)}})}async writeText(t){const r=[new ClipboardItem({[b]:new Blob([t],{type:b})})];return this._write({uuid:R(),items:r,ref:null})}addEventListener(t,r,n={}){const o=n?.capture?this._listenersCapture:this._listeners;let a=o.get(t);a||(a=new Map,o.set(t,a)),a.set(r,typeof n=="boolean"?{}:n)}dispatchEvent(t){if(!t)return;const r=n=>{const o=n.get(t.type);o&&o.forEach((a,i)=>{try{typeof i=="function"?i(t):i.handleEvent&&i.handleEvent(t),a.once&&o.delete(i)}catch(l){console.warn(l)}})};return r(this._listenersCapture),r(this._listeners),!0}removeEventListener(t,r,n){const o=n?.capture?this._listenersCapture:this._listeners,a=o.get(t);a&&(a.delete(r),a.size===0&&o.delete(t))}close(){globalThis.removeEventListener?.("focus",this._onFocus),globalThis.removeEventListener?.("blur",this._onBlur)}}var z;(z=wt||(wt={})).ErrorMessages=jt,z.Global=new z;let ht=null,q=null,M=null;const Vt=Object.freeze({compileTypescript:async function(e){if(!e?.source)return null;if(q&&xt.deepEqual(q,e))return ht;const t=await async function(){if(M)return M;const{TypeScriptCompiler:n}=await Promise.resolve().then(()=>require("./CeFdVjSCXrLYCXCU.cjs"));return M=new n,M}(),r=await t.compileModule(e);return ht=r,q=e,r}}),Gt=Object.freeze(Object.defineProperty({__proto__:null,ScriptingUtils:Vt},Symbol.toStringTag,{value:"Module"}));exports.$t=xt,exports.index=Gt;
@@ -1,5 +1,5 @@
1
1
  "use strict";/**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.2.6
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.3.1
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -1,5 +1,5 @@
1
1
  "use strict";/**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.2.6
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.3.1
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -0,0 +1,6 @@
1
+ "use strict";var c=Object.create;var n=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var p=(e,r,t,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of s(r))!y.call(e,i)&&i!==t&&n(e,i,{get:()=>r[i],enumerable:!(l=a(r,i))||l.enumerable});return e};var g=(e,r,t)=>(t=e!=null?c(u(e)):{},p(r||!e||!e.__esModule?n(t,"default",{value:e,enumerable:!0}):t,e));/**
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.3.1
3
+ *
4
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
+ * License: The license can be found at https://www.sheetxl.com/license.
6
+ */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let o=null;exports.initialize=async function(){return o||(o=new Promise(async(e,r)=>{let t=null;try{t=await import("https://esm.sh/typescript@5.7.2")}catch(l){console.error("Error initializing Browser TypeScript module:",l)}t||console.log("use script fallback"),e(t)}),o)};
@@ -1,5 +1,5 @@
1
1
  "use strict";/**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.2.6
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.3.1
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -1,5 +1,5 @@
1
1
  "use strict";/**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.2.6
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.3.1
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.