@sheetxl/sdk 0.4.13 → 0.4.14

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 (166) hide show
  1. package/browser/cjs/8JuguQ-v_wjzRAJQ.cjs +6 -0
  2. package/browser/cjs/B06_i0NVsMlV7sL3.cjs +15 -0
  3. package/browser/cjs/BMzm6e19THp5R5SS.cjs +6 -0
  4. package/browser/{esm/bC-pS6WlvqHBcNXl.mjs → cjs/BSQ6GwaDgEhp4-Jm.cjs} +3 -4
  5. package/browser/cjs/BSaEFx_1qH-bqkxA.cjs +32 -0
  6. package/browser/cjs/BeFLdMQtixEQOMIf.cjs +6 -0
  7. package/browser/cjs/Bypbx3PA2wZ-MxR7.cjs +1501 -0
  8. package/browser/cjs/C4rkyi5ne70h0eUM.cjs +13 -0
  9. package/browser/cjs/CK7GKaY19eDwb72K.cjs +6 -0
  10. package/browser/cjs/CQtudwvjokdRI8w7.cjs +6 -0
  11. package/browser/cjs/CZpCJ_mGf8uvTyHs.cjs +6 -0
  12. package/browser/cjs/CeW7HtHiebPU1ZrI.cjs +6 -0
  13. package/browser/cjs/CpD5wln4iVlrPfkY.cjs +6 -0
  14. package/browser/cjs/CxNcIlUbtVSt64Tm.cjs +6 -0
  15. package/browser/cjs/D0KawW_CBCzUbAwf.cjs +6 -0
  16. package/browser/cjs/D1hmSqsrlX7CR2o_.cjs +6 -0
  17. package/browser/cjs/D4c1Sr1XvF3nMs-j.cjs +6 -0
  18. package/browser/cjs/D6h0MMq-X27_iD6g.cjs +6 -0
  19. package/browser/cjs/DE3tCi_X6QIZF8tS.cjs +6 -0
  20. package/browser/cjs/DNRSQjR0UdY_4fl9.cjs +6 -0
  21. package/browser/cjs/DSUl7vRzR8mV1Myf.cjs +6 -0
  22. package/browser/cjs/DTAOALsCBhuSuEiG.cjs +6 -0
  23. package/browser/cjs/DaV0-3D2kIZdcEfA.cjs +6 -0
  24. package/browser/cjs/DejSF-jvG3xB_8YE.cjs +60 -0
  25. package/browser/cjs/Depd1YehybNaiyCe.cjs +6 -0
  26. package/browser/cjs/Dq9JXD1VUC_eXNv8.cjs +7 -0
  27. package/browser/cjs/DveSU-1M1dKih8ss.cjs +6 -0
  28. package/browser/cjs/QgxQTHhUBOvKb5Sp.cjs +6 -0
  29. package/browser/cjs/index.cjs +3 -4
  30. package/browser/cjs/is67OzV6HSQv8hND.cjs +6 -0
  31. package/browser/cjs/mD326DVwUY2qz53z.cjs +6 -0
  32. package/browser/cjs/p9-P5tsRY2aEac88.cjs +124 -0
  33. package/browser/cjs/rdaInA-ytvORY7dI.cjs +6 -0
  34. package/browser/cjs/v59Hlj7XX2HjAklI.cjs +6 -0
  35. package/{node/esm/CoowIrBw0vTXnosY.mjs → browser/esm/0y8470lJoPLFzYRG.mjs} +1 -1
  36. package/{node/esm/DQvu2JlpO07Yqcvx.mjs → browser/esm/6ofNyUJ2bff5hQAb.mjs} +1 -1
  37. package/browser/esm/8jrILMSMxtRYp4Ml.mjs +10 -0
  38. package/browser/esm/{DQ6InIROOs1_L5ez.mjs → B1U-ZkWRkC7EsWhJ.mjs} +7 -2
  39. package/browser/esm/BaQ-kJ0S48-mIDOB.mjs +10 -0
  40. package/browser/esm/Bg1s7CT60pr7m6Wv.mjs +24266 -0
  41. package/browser/esm/BjMYkedmgsLBSeIL.mjs +24 -0
  42. package/{node/esm/Dlftv7TykJRVk7Wx.mjs → browser/esm/BwAtcwzMrBFQsJrt.mjs} +1 -1
  43. package/browser/esm/CA81BqhGVQdWnnU-.mjs +3974 -0
  44. package/browser/esm/CASK_saDBb0E8-gc.mjs +5651 -0
  45. package/browser/esm/CEPVn5ObLgMnhFuG.mjs +10 -0
  46. package/{node/esm/cWKERSoNy_Mo5gOQ.mjs → browser/esm/CJSlOHcd-GRplhJb.mjs} +1 -1
  47. package/browser/esm/CXCFBAK8GNqcf4NZ.mjs +426 -0
  48. package/browser/esm/CZH9NjmkPt5qOZvo.mjs +10 -0
  49. package/{node/esm/axtXmmwYm1aHBXjg.mjs → browser/esm/Co_XNsi04fa0kXfc.mjs} +1 -1
  50. package/browser/esm/D2d6F8a0L2i5KG9B.mjs +1575 -0
  51. package/{node/esm/DMhTOGJLYCiHGnjP.mjs → browser/esm/D5MCJciGCVt9S3_d.mjs} +1 -1
  52. package/{node/esm/CBdo244r3xwae4_o.mjs → browser/esm/D5m4uOGT4rzpeawH.mjs} +1 -1
  53. package/browser/esm/D799n_-syMIKHsZB.mjs +21 -0
  54. package/browser/esm/D7vGd1TA1pYs2r8i.mjs +10 -0
  55. package/{node/esm/dRD2c-s3aQJNoK6m.mjs → browser/esm/DDcxalm5bxkWR6yr.mjs} +1 -1
  56. package/{node/esm/DLDt1F5JzQq5aKdG.mjs → browser/esm/DGSd15RAMHKU4TTh.mjs} +1 -1
  57. package/browser/esm/DML06qJVWAeMmTeF.mjs +29 -0
  58. package/{node/esm/C6FEsnCdmUvcIDzA.mjs → browser/esm/Dq1c2fRK8fy1wIZ0.mjs} +1 -1
  59. package/{node/esm/DZl6ZagrmdiXKi9x.mjs → browser/esm/Ds3gLJ0AViDNAZBb.mjs} +1 -1
  60. package/{node/esm/Bb5FApoZ10dDGlM-.mjs → browser/esm/Dv-eMLsSU3GgM0IG.mjs} +1 -1
  61. package/{node/esm/j5mlBPjSlgnHX9pH.mjs → browser/esm/IF7Bu3bAljYlYAhG.mjs} +1 -1
  62. package/browser/esm/Ijz2AYZo5041p_E0.mjs +820 -0
  63. package/{node/esm/L0bRh78pniyMZ_3v.mjs → browser/esm/_9LudTdmURafvtbM.mjs} +1 -1
  64. package/{node/esm/tw0tbG4pvPai6vfe.mjs → browser/esm/c0yMyZrKHAQcuk34.mjs} +1 -1
  65. package/browser/esm/c8TPaGQuorNwRY5P.mjs +472 -0
  66. package/browser/esm/flS4x_DXemCnqZYx.mjs +10 -0
  67. package/browser/esm/index.mjs +84 -2
  68. package/{node/esm/Bq3GEYeFkbO3vHHx.mjs → browser/esm/utnJnW2cCjLr_J5j.mjs} +1 -1
  69. package/licenses/dependencies.txt +3 -3
  70. package/node/esm/0y8470lJoPLFzYRG.mjs +10 -0
  71. package/node/esm/6ofNyUJ2bff5hQAb.mjs +10 -0
  72. package/node/esm/{BmkbBs1Yla2RsZ_s.mjs → BAJg2qwLifwsMs48.mjs} +1 -1
  73. package/node/esm/{Dxqu9uwKDQHBrAqJ.mjs → BVwiUEUE8Kq6Q-Md.mjs} +2 -2
  74. package/node/esm/{DOdqJUKquKrouyJg.mjs → Be8IGMeEVQrqyIbz.mjs} +1 -1
  75. package/node/esm/{CKO3kzDC1TBjmP6a.mjs → BkSSbBdHw5fSDT9u.mjs} +1 -1
  76. package/node/esm/{n0CrIZcZCwIu-yiw.mjs → BlMT23s2F34fCyyF.mjs} +1 -1
  77. package/node/esm/BwAtcwzMrBFQsJrt.mjs +10 -0
  78. package/node/esm/CJSlOHcd-GRplhJb.mjs +10 -0
  79. package/node/esm/{CsI4IQyunxqLyMWY.mjs → Cg0Rg6HBC4czGxnY.mjs} +1 -1
  80. package/node/esm/{B-cEaNMrVscFjP28.mjs → Ciz3vgy9vMXs8dGv.mjs} +1 -1
  81. package/node/esm/{DNLKWsIB7wfMRm8a.mjs → CmZcNpOTEY__HcNE.mjs} +2 -2
  82. package/node/esm/Co_XNsi04fa0kXfc.mjs +10 -0
  83. package/node/esm/{moaVD3gybeaMfy_q.mjs → D-ebNw7-IJtP0UVf.mjs} +1 -1
  84. package/node/esm/{BZScF0z5mvap-tCk.mjs → D1IiK4HwSFrtL98j.mjs} +1 -1
  85. package/node/esm/D5MCJciGCVt9S3_d.mjs +10 -0
  86. package/node/esm/D5m4uOGT4rzpeawH.mjs +10 -0
  87. package/node/esm/DDcxalm5bxkWR6yr.mjs +10 -0
  88. package/{browser/cjs/DOptrVmGD_5mAjIJ.cjs → node/esm/DGSd15RAMHKU4TTh.mjs} +5 -2
  89. package/node/esm/Dbv1kS3xRdworJhn.mjs +80 -0
  90. package/node/esm/{DHJoU9KsVtSXERyd.mjs → DmYC6rfHbxzRi-xv.mjs} +4 -4
  91. package/node/esm/Dq1c2fRK8fy1wIZ0.mjs +10 -0
  92. package/node/esm/Ds3gLJ0AViDNAZBb.mjs +10 -0
  93. package/node/esm/Dv-eMLsSU3GgM0IG.mjs +10 -0
  94. package/node/esm/{G0slAplR6jB1csaY.mjs → Dw228_AFFTiN-qSG.mjs} +1 -1
  95. package/node/esm/{o47K-SM01hvIUrc0.mjs → HHRD6y1sXoRYiRM-.mjs} +2 -2
  96. package/node/esm/IF7Bu3bAljYlYAhG.mjs +10 -0
  97. package/node/esm/_9LudTdmURafvtbM.mjs +10 -0
  98. package/node/esm/c0yMyZrKHAQcuk34.mjs +10 -0
  99. package/node/esm/{DNTdUrrAs4YsX782.mjs → igBKvoiyyirwpnsa.mjs} +1 -1
  100. package/node/esm/index.mjs +3449 -3206
  101. package/node/esm/utnJnW2cCjLr_J5j.mjs +10 -0
  102. package/package.json +4 -4
  103. package/browser/cjs/99FHKXLdlCef5nfT.cjs +0 -7
  104. package/browser/cjs/B5eveWag0dzzgkgX.cjs +0 -7
  105. package/browser/cjs/BJA1_CndBCMNr53J.cjs +0 -7
  106. package/browser/cjs/BVE8RsCx6dH-PJ3G.cjs +0 -7
  107. package/browser/cjs/BbvyF-KASTBWusEs.cjs +0 -7
  108. package/browser/cjs/BfAJd561Nzaudhz_.cjs +0 -7
  109. package/browser/cjs/BlgZLqYSIZleOo8h.cjs +0 -7
  110. package/browser/cjs/BpoOeB751mnCS6V-.cjs +0 -7
  111. package/browser/cjs/CE7l7CfFaLMonVMB.cjs +0 -7
  112. package/browser/cjs/CHBhqMbMhjW9YdAF.cjs +0 -7
  113. package/browser/cjs/CIJiAsckzAZgx8n4.cjs +0 -7
  114. package/browser/cjs/CgOy3BgHFueAFAeL.cjs +0 -7
  115. package/browser/cjs/Cl0gNER1w9A58kbc.cjs +0 -13
  116. package/browser/cjs/CmBrJtijpbCUSPWR.cjs +0 -10
  117. package/browser/cjs/CuYGUMy7ROX5G_sm.cjs +0 -7
  118. package/browser/cjs/Czqso66RMuDka4LC.cjs +0 -7
  119. package/browser/cjs/D-NvwNeGLHGiv00z.cjs +0 -7
  120. package/browser/cjs/DHVBvApvjbLRsOju.cjs +0 -7
  121. package/browser/cjs/DORshTQEHNF0VHvp.cjs +0 -7
  122. package/browser/cjs/DRKq7WhWW37UIj1Q.cjs +0 -7
  123. package/browser/cjs/DhWK7BDP7ZhYYPga.cjs +0 -7
  124. package/browser/cjs/DpSwAPYhahtG5EKw.cjs +0 -7
  125. package/browser/cjs/DvioTOgF2jNUKBcT.cjs +0 -7
  126. package/browser/cjs/DwSf7lami5Uh2Uh6.cjs +0 -7
  127. package/browser/cjs/Dy6R4NfGavsHaUnQ.cjs +0 -10
  128. package/browser/cjs/HEI6Q0oyMX2A1gth.cjs +0 -7
  129. package/browser/cjs/_Lz_D28ElE-H04r8.cjs +0 -7
  130. package/browser/cjs/hONph4eRHAvmiEYv.cjs +0 -7
  131. package/browser/cjs/nQYA0VPzyPNFcvaF.cjs +0 -7
  132. package/browser/cjs/pPrxgr769sUGB5WL.cjs +0 -7
  133. package/browser/cjs/sqCd-isdKO-WsW_F.cjs +0 -7
  134. package/browser/cjs/xobXrowL2Qx-kWv9.cjs +0 -7
  135. package/browser/esm/4lHZjpF3_ugmKKui.mjs +0 -7
  136. package/browser/esm/67bnWHzYa5DZMY6A.mjs +0 -7
  137. package/browser/esm/BDYJEEaksgeY1UaE.mjs +0 -7
  138. package/browser/esm/BG0zhw4ripZzsL-w.mjs +0 -7
  139. package/browser/esm/BOfILXwwP1BW8Bsw.mjs +0 -7
  140. package/browser/esm/BPEwv5xX4DLnd-8o.mjs +0 -7
  141. package/browser/esm/BUeaoQihd7nbjV5D.mjs +0 -7
  142. package/browser/esm/Bb8asJ4COo3sy4Gt.mjs +0 -7
  143. package/browser/esm/BbJAEyq0pAF7biF-.mjs +0 -7
  144. package/browser/esm/BuoPWoEzsXvQsZFU.mjs +0 -7
  145. package/browser/esm/By_8JXNSh9nnHyBW.mjs +0 -7
  146. package/browser/esm/C4K5CBXvVExqCdpa.mjs +0 -7
  147. package/browser/esm/CKUiTXSrn9Xg_ph1.mjs +0 -10
  148. package/browser/esm/CLP8NgXNjnLl-iMQ.mjs +0 -7
  149. package/browser/esm/CVGuaXPdnO65bXE5.mjs +0 -7
  150. package/browser/esm/ClgHaEbC8eHvV73x.mjs +0 -7
  151. package/browser/esm/CoZh7nD_zQLfTNcp.mjs +0 -7
  152. package/browser/esm/D2jQMy8XvCDNeRaM.mjs +0 -7
  153. package/browser/esm/D3D_Ad9RkEvBe7Wz.mjs +0 -7
  154. package/browser/esm/D5dJ7VFFZvIOU2As.mjs +0 -7
  155. package/browser/esm/D8vW0N6EH97lDhnP.mjs +0 -7
  156. package/browser/esm/DB9YIl5l53cTx_qf.mjs +0 -7
  157. package/browser/esm/DFbUKmUyr8XjG6uR.mjs +0 -7
  158. package/browser/esm/DROuUTBh0ijsxsde.mjs +0 -7
  159. package/browser/esm/Dq1V1gMAXsC87zqO.mjs +0 -13
  160. package/browser/esm/Ds_YxbxItIu7PKA-.mjs +0 -7
  161. package/browser/esm/Ho-V23ZRWrnAVftS.mjs +0 -7
  162. package/browser/esm/j21djw_rEjBtpjRd.mjs +0 -7
  163. package/browser/esm/kXWocze33jAxVJq6.mjs +0 -10
  164. package/browser/esm/qi0568hNwcdjIMy6.mjs +0 -7
  165. package/browser/esm/yVExwiZwWE8vLSFO.mjs +0 -7
  166. package/node/esm/k3luU7uFD82_cpo4.mjs +0 -80
@@ -1,7 +0,0 @@
1
- /**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.13
3
- *
4
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */
7
- let n=class{constructor(n){this._worker=null,this._nextId=1,this._pendingRequests=new Map,this._workerFactory=n}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=n=>{const{id:e,result:t,error:r}=n.data,o=this._pendingRequests.get(e);if(o)if(this._pendingRequests.delete(e),r){const n=new Error(r.message);n.stack=r.stack,r.cause&&(n.cause=r.cause),o.reject(n)}else o.resolve(t)},this._worker.onerror=n=>{console.error("Worker error:",n),this._pendingRequests.forEach(e=>{e.reject(new Error(`Worker failed: ${n.message}`))}),this._pendingRequests.clear(),this._worker=null}),Promise.resolve()}execute(n){if(!this._worker)throw new Error("Worker is not initialized. Call start() first.");const e=this._nextId++;return new Promise((t,r)=>{this._pendingRequests.set(e,{resolve:t,reject:r}),this._worker.postMessage({id:e,params:n})})}terminate(){this._worker&&(this._worker.terminate(),this._worker=null)}};class e{constructor(n){this._onExecute=n}execute(n){return this._onExecute(n)}start(){return Promise.resolve()}terminate(){}}const t='/**\n * @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.4.13\n *\n * (C) 2025-present SheetXL Inc. & Michael T. Ford\n * License: The license can be found at https://www.sheetxl.com/license.\n */\nconst W = { Number: "n", String: "s", Boolean: "b", Error: "e", Null: "z" };\nvar Re, ae, d;\n(ae = Re || (Re = {})).Orientation = { Column: "column", Row: "row" }, ae.Orientations = { ...ae.Orientation, Both: "both" }, ae.Direction = { Up: "up", Down: "down", Left: "left", Right: "right" }, ((e) => {\n e.Code = { Parse: 0, Null: 1, Div0: 2, Value: 3, Ref: 4, Name: 5, Num: 6, NA: 7, GettingData: 8, Spill: 9, Connect: 10, Blocked: 11, Unknown: 12, Field: 13, Calc: 14, Busy: 16, Python: 19, Timeout: 20 }, e.Label = { Parse: "#PARSE!", Null: "#NULL!", Div0: "#DIV/0!", Value: "#VALUE!", Ref: "#REF!", Name: "#NAME?", Num: "#NUM!", NA: "#N/A", GettingData: "#GETTING_DATA", Spill: "#SPILL!", Connect: "#CONNECT!", Blocked: "#BLOCKED!", Unknown: "#UNKNOWN!", Field: "#FIELD!", Calc: "#CALC!", Busy: "#BUSY!", Python: "#PYTHON!", Timeout: "#TIMEOUT!" };\n class t extends Error {\n constructor(c, m, fe, B) {\n super(fe, B), this._label = m, this._code = c, this.details = B;\n }\n static {\n this.code = e.Code.Unknown;\n }\n get isFormulaError() {\n return !0;\n }\n getLabel() {\n return this._label;\n }\n getCode() {\n return this._code;\n }\n equals(c) {\n return !!c && (this._code === c._code || this._code === c.code);\n }\n get [Symbol.toStringTag]() {\n return "[FormulaError]";\n }\n toString() {\n return this.message || this._label;\n }\n }\n e.Known = t;\n class n extends t {\n constructor(c, m) {\n super(e.Code.Parse, e.Label.Parse, c, m);\n }\n static {\n this.code = e.Code.Parse;\n }\n getDetails() {\n const c = this.details;\n return { line: c?.line ?? 1, column: c?.column ?? 1, offset: c?.offset ?? 0, length: c?.length ?? 0 };\n }\n }\n e.Parse = n;\n class r extends t {\n constructor(c, m) {\n super(e.Code.Null, e.Label.Null, c, m);\n }\n static {\n this.code = e.Code.Null;\n }\n }\n e.Null = r;\n class o extends t {\n constructor(c, m) {\n super(e.Code.Div0, e.Label.Div0, c, m);\n }\n static {\n this.code = e.Code.Div0;\n }\n }\n e.Div0 = o;\n class i extends t {\n constructor(c, m) {\n super(e.Code.Value, e.Label.Value, c, m);\n }\n static {\n this.code = e.Code.Value;\n }\n }\n e.Value = i;\n class a extends t {\n constructor(c, m) {\n super(e.Code.Ref, e.Label.Ref, c, m);\n }\n static {\n this.code = e.Code.Ref;\n }\n }\n e.Ref = a;\n class l extends t {\n constructor(c, m) {\n super(e.Code.Name, e.Label.Name, c, m);\n }\n static {\n this.code = e.Code.Name;\n }\n }\n e.Name = l;\n class u extends t {\n constructor(c, m) {\n super(e.Code.Num, e.Label.Num, c, m);\n }\n static {\n this.code = e.Code.Num;\n }\n }\n e.Num = u;\n class f extends t {\n constructor(c, m) {\n super(e.Code.NA, e.Label.NA, c, m);\n }\n static {\n this.code = e.Code.NA;\n }\n }\n e.NA = f;\n class h extends t {\n constructor(c, m) {\n super(e.Code.GettingData, e.Label.GettingData, c, m);\n }\n static {\n this.code = e.Code.GettingData;\n }\n }\n e.GettingData = h;\n class g extends t {\n constructor(c, m) {\n super(e.Code.Spill, e.Label.Spill, c, m);\n }\n static {\n this.code = e.Code.Spill;\n }\n }\n e.Spill = g;\n class p extends t {\n constructor(c, m) {\n super(e.Code.Connect, e.Label.Connect, c, m);\n }\n static {\n this.code = e.Code.Connect;\n }\n }\n e.Connect = p;\n class y extends t {\n constructor(c, m) {\n super(e.Code.Blocked, e.Label.Blocked, c, m);\n }\n static {\n this.code = e.Code.Blocked;\n }\n }\n e.Blocked = y;\n class T extends t {\n constructor(c, m) {\n super(e.Code.Unknown, e.Label.Unknown, c, m);\n }\n static {\n this.code = e.Code.Unknown;\n }\n }\n e.Unknown = T;\n class A extends t {\n constructor(c, m) {\n super(e.Code.Field, e.Label.Field, c, m);\n }\n static {\n this.code = e.Code.Field;\n }\n }\n e.Field = A;\n class D extends t {\n constructor(c, m) {\n super(e.Code.Calc, e.Label.Calc, c, m);\n }\n static {\n this.code = e.Code.Calc;\n }\n }\n e.Calc = D;\n class U extends t {\n constructor(c, m) {\n super(e.Code.Busy, e.Label.Busy, c, m);\n }\n static {\n this.code = e.Code.Busy;\n }\n }\n e.Busy = U;\n class I extends t {\n constructor(c, m) {\n super(e.Code.Python, e.Label.Python, c, m);\n }\n static {\n this.code = e.Code.Python;\n }\n }\n e.Python = I;\n class J extends t {\n constructor(c, m) {\n super(e.Code.Timeout, e.Label.Timeout, c, m);\n }\n static {\n this.code = e.Code.Timeout;\n }\n }\n e.Timeout = J;\n})(d || (d = {}));\nconst _ = {};\n_[d.Code.Parse] = d.Parse, _[d.Code.Null] = d.Null, _[d.Code.Div0] = d.Div0, _[d.Code.Value] = d.Value, _[d.Code.Ref] = d.Ref, _[d.Code.Name] = d.Name, _[d.Code.Num] = d.Num, _[d.Code.NA] = d.NA, _[d.Code.GettingData] = d.GettingData, _[d.Code.Spill] = d.Spill, _[d.Code.Connect] = d.Connect, _[d.Code.Blocked] = d.Blocked, _[d.Code.Unknown] = d.Unknown, _[d.Code.Field] = d.Field, _[d.Code.Calc] = d.Calc, _[d.Code.Busy] = d.Busy, _[d.Code.Python] = d.Python, _[d.Code.Timeout] = d.Timeout;\nconst et = /* @__PURE__ */ new Map(), Te = /* @__PURE__ */ new Map(), tt = /* @__PURE__ */ new Map(), nt = /* @__PURE__ */ new Map(), ke = Object.keys(_);\nfor (let e = 0; e < ke.length; e++) {\n const t = ke[e], n = _[t];\n tt.set(d.Label[t], n), nt.set(d.Code[t], n);\n const r = new n();\n et.set(r.getLabel(), r), Te.set(r.getCode(), r);\n}\nconst Et = Te.get(d.Code.Unknown);\nvar v;\n(v = d || (d = {})).BuiltIn = { Parse: new v.Parse(), Null: new v.Null(), Div0: new v.Div0(), Value: new v.Value(), Ref: new v.Ref(), Name: new v.Name(), Num: new v.Num(), NA: new v.NA(), GettingData: new v.GettingData(), Spill: new v.Spill(), Connect: new v.Connect(), Blocked: new v.Blocked(), Unknown: new v.Unknown(), Field: new v.Field(), Calc: new v.Calc(), Busy: new v.Busy(), Python: new v.Python(), Timeout: new v.Timeout() }, v.getBuiltInByLabel = (e) => et.get(e), v.newTypedError = (e, t, n) => {\n let r;\n return r = typeof e == "string" ? tt.get(e) : nt.get(e), r || (r = v.Unknown), new r(t, n);\n}, v.getBuiltInById = (e) => Te.get(e) || Et;\n/**\n * @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.4.13\n *\n * (C) 2025-present SheetXL Inc. & Michael T. Ford\n * License: The license can be found at https://www.sheetxl.com/license.\n */\nconst S = { html: "text/html", plain: "text/plain", png: "image/png" }, St = Object.freeze({ left: 0, top: 0 }), xt = Object.freeze({ left: 0, top: 0, bottom: 0, right: 0 }), Ct = Object.freeze({ x: 0, y: 0, width: 0, height: 0 });\nObject.freeze(Object.defineProperty({ __proto__: null, EmptyBounds: Ct, EmptyRect: xt, EmptyTopLeft: St }, Symbol.toStringTag, { value: "Module" }));\nconst j = { Column: "column", Row: "row" }, vt = Object.freeze({ colIndex: 0, rowIndex: 0 }), Tt = Object.freeze({ colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 }), rt = (e, t) => e.colStart === t.colStart ? e.rowStart - t.rowStart : e.colStart - t.colStart, ot = (e, t) => e.rowStart === t.rowStart ? e.colStart - t.colStart : e.rowStart - t.rowStart, _t = (e, t) => e.rowEnd === t.rowEnd ? t.colEnd - e.colEnd : t.rowEnd - e.rowEnd, Ot = (e, t) => e.colEnd === t.colEnd ? t.rowEnd - e.rowEnd : t.colEnd - e.colEnd, Le = (e, t) => e.colIndex === t.colIndex ? e.rowIndex - t.rowIndex : e.colIndex - t.colIndex, Ae = (e, t) => e.rowIndex === t.rowIndex ? e.colIndex - t.colIndex : e.rowIndex - t.rowIndex, it = (e = j.Row, t = !1) => t ? e !== j.Column ? _t : Ot : e !== j.Column ? ot : rt, Me = (e, t) => e === t || !(!e || !t) && e.rowIndex === t.rowIndex && e.colIndex === t.colIndex, Se = (e, t) => e === t || !(!e || !t) && e.rowStart === t.rowStart && e.rowEnd === t.rowEnd && e.colStart === t.colStart && e.colEnd === t.colEnd, xe = (e, t) => !(!e || !t) && !(e.colStart > t.colEnd || t.colStart > e.colEnd) && !(e.rowStart > t.rowEnd || t.rowStart > e.rowEnd), je = (e, t) => {\n if (e === t) return !0;\n if (!e || !t || e.length !== t.length) return !1;\n for (let n = 0; n < e.length; n++) if (!Se(e[n], t[n])) return !1;\n return !0;\n}, he = (e, t, n) => {\n if (!e && !t) return null;\n if (!e) return n ? t : { ...t };\n if (!t) return n ? e : { ...e };\n const r = Math.min(e.colStart, t.colStart), o = Math.min(e.rowStart, t.rowStart), i = Math.max(e.colEnd, t.colEnd), a = Math.max(e.rowEnd, t.rowEnd);\n let l = n;\n return l ? (l.colStart = r, l.rowStart = o, l.colEnd = i, l.rowEnd = a) : l = { colStart: r, rowStart: o, colEnd: i, rowEnd: a }, l;\n}, Pe = (e, t) => {\n if (!t || t.length === 0) return e;\n const n = { ...e };\n for (let r = 0; r < t.length; r++) {\n const o = t[r];\n xe(n, o) && (n.rowStart = Math.min(n.rowStart, o.rowStart), n.colStart = Math.min(n.colStart, o.colStart), n.rowEnd = Math.max(n.rowEnd, o.rowEnd), n.colEnd = Math.max(n.colEnd, o.colEnd));\n }\n return n;\n}, It = [null, null], Nt = (e, t, n) => {\n if (e[0].value === e[1].value) return t;\n};\nfunction Fe(e, t = 2, n, r = j.Row, o) {\n let i = [...e];\n if (t <= 0 || e.length <= 1) return i;\n let a = r === j.Column, l = 0, u = !1;\n do {\n const f = i.sort(it(a ? j.Row : j.Column));\n i = [], i.push(f[0]);\n const h = f.length;\n let g = 0, p = f[0], y = p.colStart, T = p.rowStart, A = p.colEnd, D = p.rowEnd;\n for (let U = 1; U < h; U++) {\n const I = f[U];\n let J = !1;\n if (J = a ? p && T === I.rowStart && D === I.rowEnd && A + 1 === I.colStart : p && y === I.colStart && A === I.colEnd && D + 1 === I.rowStart, J) {\n let E = { colStart: y, rowStart: T, colEnd: a ? I.colEnd : A, rowEnd: a ? D : I.rowEnd };\n if (p.value !== void 0 && (E.value = p.value), n) {\n const c = o ?? [null, null];\n c[0] = p, c[1] = I, E = n(c, E, r);\n }\n if (E) {\n i[g] = E, u = !0, p = E, y = p.colStart, T = p.rowStart, A = p.colEnd, D = p.rowEnd;\n continue;\n }\n }\n i[++g] = I, p = I, y = p.colStart, T = p.rowStart, A = p.colEnd, D = p.rowEnd;\n }\n l++, a = !a, l === 1 && (u = !0);\n } while (l < t && u && i.length > 1);\n return i;\n}\nObject.freeze(Object.defineProperty({ __proto__: null, EmptyCell: vt, EmptyRange: Tt, cellToRange: (e, t) => {\n if (!e) return null;\n let n = t;\n return n || (n = { ...e }, delete n.colIndex, delete n.rowIndex), n.colStart = e.colIndex ?? 0, n.rowStart = e.rowIndex ?? 0, n.colEnd = e.colIndex ?? 0, n.rowEnd = e.rowIndex ?? 0, n;\n}, columnFirstCellComparator: Le, columnFirstRangeComparator: rt, createCellComparator: (e = j.Row, t = !1) => t ? e !== j.Column ? (n, r) => n.rowIndex === r.rowIndex ? r.colIndex - n.colIndex : r.rowIndex - n.rowIndex : (n, r) => n.colIndex === r.colIndex ? r.rowIndex - n.rowIndex : r.colIndex - n.colIndex : e !== j.Column ? Ae : Le, createConflatingRanges: (e, t = !1) => {\n const n = [];\n let r, o, i = Number.MIN_SAFE_INTEGER, a = Number.MIN_SAFE_INTEGER;\n return { append: (l, u, f) => {\n let h = !0;\n const g = f !== void 0;\n if (g) {\n const T = e ? e(o, f, t) : o === f ? f : void 0;\n T === void 0 ? h = !1 : f = T;\n }\n if (h && u === a + 1 && l === i) return t ? r.rowEnd = u : r.colEnd = u, a = u, void (o = f);\n r && n.push(r);\n const p = t ? l : u, y = t ? u : l;\n r = { colStart: p, rowStart: y, colEnd: p, rowEnd: y }, g && (r.value = f), i = l, a = u, o = f;\n }, done: (l) => (r && (n.push(r), r = null), l ? Fe(n, 3, l === !0 ? Nt : l, t ? j.Column : j.Row, It) : n) };\n}, createRangeComparator: it, defaultRange: (e, t, n) => e ? n ? (n.colStart = e.colStart ?? t.colStart, n.rowStart = e.rowStart ?? t.rowStart, n.colEnd = e.colEnd ?? t.colEnd, n.rowEnd = e.rowEnd ?? t.rowEnd, n) : { colStart: e.colStart ?? t.colStart, rowStart: e.rowStart ?? t.rowStart, colEnd: e.colEnd ?? t.colEnd, rowEnd: e.rowEnd ?? t.rowEnd } : t, extendRangeToIntersectingRanges: Pe, extendRangeToUnionRanges: (e, t) => {\n if (!t || t.length === 0) return e;\n let n = e, r = null;\n for (; !Se(n, r); ) r = n, n = Pe(r, t);\n return n;\n}, indexOfCoords: (e, t) => {\n const n = { colStart: e.colIndex, rowStart: e.rowIndex, colEnd: e.colIndex, rowEnd: e.rowIndex };\n for (let r = t.length - 1; r >= 0; r--) if (xe(n, t[r])) return r;\n return -1;\n}, intersectRanges: (e, t, n) => {\n if (!e) return n ? t : { ...t };\n if (!t) return n ? e : { ...e };\n if (!e && !t || e.rowStart > t.rowEnd || e.rowEnd < t.rowStart || e.colStart > t.colEnd || e.colEnd < t.colStart) return null;\n const r = Math.max(e.colStart, t.colStart), o = Math.max(e.rowStart, t.rowStart), i = Math.min(e.colEnd, t.colEnd), a = Math.min(e.rowEnd, t.rowEnd);\n let l = n;\n return l ? (l.colStart = r, l.rowStart = o, l.colEnd = i, l.rowEnd = a) : l = { colStart: r, rowStart: o, colEnd: i, rowEnd: a }, l;\n}, isCellWithinRange: (e, t) => !(!e || !t) && !(e.rowIndex < t.rowStart || e.rowIndex > t.rowEnd) && !(e.colIndex < t.colStart || e.colIndex > t.colEnd), isEqualCells: Me, isEqualRanges: Se, isEqualRangesArrays: je, isEqualSelectionCoords: (e, t) => e === t || !(!e || !t) && e.rangeIndex === t.rangeIndex && !!Me(e.cell, t.cell) && je(e.ranges, t.ranges), isRangeWithinRange: (e, t) => !(e.rowStart < t.rowStart || e.rowEnd > t.rowEnd) && !(e.colStart < t.colStart || e.colEnd > t.colEnd), isRangesIntersect: xe, 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: Fe, rowFirstCellComparator: Ae, rowFirstRangeComparator: ot, 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, n = -e.colStart, r) => r ? (r.colStart = e.colStart + n, r.rowStart = e.rowStart + t, r.colEnd = e.colEnd + n, r.rowEnd = e.rowEnd + t, r) : { colStart: e.colStart + n, rowStart: e.rowStart + t, colEnd: e.colEnd + n, rowEnd: e.rowEnd + t }, unionRanges: he, unionRangesArrays: (e, t, n) => {\n if (!e || e.length === 0) return null;\n if (e.length === 1 && !t) return e[0];\n let r = e[0];\n for (let o = 1; o < e.length; o++) r = he(r, e[o], n);\n return t && (r = he(r, t, n)), r;\n} }, Symbol.toStringTag, { value: "Module" }));\nfunction Rt(e) {\n const t = Object.prototype.toString.call(e);\n return t === "[object RegExp]" || t === "[object Date]" || function(n) {\n return n.$$typeof === kt;\n }(e);\n}\nconst kt = typeof Symbol == "function" && Symbol.for ? Symbol.for("react.element") : 60103;\nfunction Lt(e) {\n return /* @__PURE__ */ function(t) {\n return !!t && typeof t == "object";\n }(e) && !Rt(e);\n}\nfunction re(e, t) {\n return t.clone !== !1 && t.isMergeableObject(e) ? Y((n = e, Array.isArray(n) ? [] : {}), e, t) : e;\n var n;\n}\nfunction At(e, t, n) {\n return e.concat(t).map(function(r) {\n return re(r, n);\n });\n}\nfunction De(e) {\n return Object.keys(e).concat(function(t) {\n return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(t).filter(function(n) {\n return Object.propertyIsEnumerable.call(t, n);\n }) : [];\n }(e));\n}\nfunction Ue(e, t) {\n try {\n return t in e;\n } catch {\n return !1;\n }\n}\nfunction Mt(e, t, n) {\n const r = {};\n return n.isMergeableObject(e) && De(e).forEach(function(o) {\n r[o] = re(e[o], n);\n }), De(t).forEach(function(o) {\n (function(i, a) {\n return Ue(i, a) && !(Object.hasOwnProperty.call(i, a) && Object.propertyIsEnumerable.call(i, a));\n })(e, o) || (Ue(e, o) && n.isMergeableObject(t[o]) ? r[o] = function(i, a) {\n if (!a.customMerge) return Y;\n const l = a.customMerge(i);\n return typeof l == "function" ? l : Y;\n }(o, n)(e[o], t[o], n) : r[o] = re(t[o], n));\n }), r;\n}\nfunction Y(e, t, n) {\n (n = n || {}).arrayMerge = n.arrayMerge || At, n.isMergeableObject = n.isMergeableObject || Lt, n.cloneUnlessOtherwiseSpecified = re;\n const r = Array.isArray(t);\n return r === Array.isArray(e) ? r ? n.arrayMerge(e, t, n) : Mt(e, t, n) : re(t, n);\n}\nY.all = function(e, t) {\n if (!Array.isArray(e)) throw new Error("first argument should be an array");\n return e.reduce(function(n, r) {\n return Y(n, r, t);\n }, {});\n};\nconst jt = Object.freeze([]), Pt = Object.freeze({}), Be = (e) => e, de = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {\n let t = 16 * Math.random() | 0;\n return (e === "x" ? t : 3 & t | 8).toString(16);\n}), Ft = (e) => 1 * e, at = (e, t) => e === t || !(!Array.isArray(e) || !Array.isArray(t) || e.length !== t.length) && e.every((n, r) => n === t[r]), ne = (e) => typeof e == "object" && !Array.isArray(e) && e !== null, lt = (e) => typeof e != "object" || Array.isArray(e) || e === null ? e : (Object.keys(e).forEach(function(t) {\n e[t] && typeof e[t] == "object" ? lt(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];\n}), Object.keys(e).length === 0 ? null : e), Dt = (e, t) => !(e !== t && !at(e, t)) || !!e.isEqual?.(t), st = (e, t, n = Dt) => {\n if (e == null || e === t) return null;\n if (!e || typeof e != "object" || Array.isArray(e) || e.isImmutable?.()) return n(e, t) ? null : e;\n const r = Object.keys(e);\n if (r.length === 0) return null;\n let o = !1;\n for (let i = 0; i < r.length; i++) {\n const a = r[i];\n st(e[a], t?.[a], n) === null && (o = !0, delete e[a]);\n }\n return o && Object.keys(e).length === 0 ? null : void 0;\n}, $e = typeof performance == "object" && typeof performance.now == "function" ? () => performance.now() : () => Date.now(), ze = (e) => e == null, Ke = (e, t) => !(t.left > e.right || t.right < e.left || t.top > e.bottom || t.bottom < e.top), Ve = !(typeof window > "u" || !window.document || !window.document.createElement), k = { Windows: "windows", MacOS: "macos", IOS: "ios", Linux: "linux", Android: "android", Safari: "safari", Firefox: "firefox", Node: "node", Unknown: "unknown" }, oe = () => {\n if (ct()) return k.Node;\n const e = globalThis.navigator !== void 0 && globalThis.navigator.userAgent ? globalThis.navigator.userAgent.toLowerCase() : "";\n return e ? /(win32|win64|windows|wince)/i.test(e) ? k.Windows : /(macintosh|macintel|macppc|mac68k|macos)/i.test(e) ? k.MacOS : /(iphone|ipad|ipod)/i.test(e) ? k.IOS : /android/.test(e) ? k.Android : /linux/.test(e) ? k.Linux : /^((?!chrome|android|).)*safari/i.test(e) ? k.Safari : /^((?!chrome|android|Seamonkey).)*firefox/i.test(e) ? k.Firefox : k.Unknown : k.Unknown;\n};\nfunction ct() {\n return typeof process < "u" && process.release?.name === "node" || (typeof process < "u" && process.browser, !1);\n}\nconst qe = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeElement || e?.contains(document.activeElement)), Ut = Object.freeze(Object.defineProperty({ __proto__: null, EmptyArray: jt, EmptyObject: Pt, OSType: k, arrayMove: function(e, t, n) {\n const r = e.slice();\n return r.splice(n < 0 ? r.length + n : n, 0, r.splice(t, 1)[0]), r;\n}, asNumber: (e) => {\n const t = Ft(e);\n return Number.isFinite(t) ? t : 0;\n}, camelToPrettyCase: (e) => e.length === 1 ? e.toUpperCase() : e.replace(/([A-Z])/g, " $1").replace(/^./, function(t) {\n return t.toUpperCase();\n}).trim(), canUseDOM: Ve, cancelTimeout: (e) => {\n cancelAnimationFrame(e.id);\n}, castToString: (e) => e == null || e === void 0 ? "" : typeof e != "string" ? "" + e : e, cloneObject: (e) => ze(e) ? e : JSON.parse(JSON.stringify(e)), consoleWithNoSource: (...e) => new Promise((t) => {\n setTimeout(() => {\n Function("console.log.apply(console, arguments)").apply(null, e), t();\n });\n}), debounce: function(e, t = 300, n = !1) {\n let r, o, i, a, l = 0;\n function u() {\n let h = Date.now() - l;\n h < t && h >= 0 ? r = setTimeout(u, t - h) : (r = null, n || (a = e.apply(i, o), i = o = null));\n }\n t == null && (t = 100);\n const f = function() {\n i = globalThis, o = arguments, l = Date.now();\n var h = n && !r;\n return r || (r = setTimeout(u, t)), h && (a = e.apply(i, o), i = o = null), a;\n };\n return f.clear = function() {\n r && (clearTimeout(r), r = null);\n }, f.flush = function() {\n r && (a = e.apply(i, o), i = o = null, clearTimeout(r), r = null);\n }, f;\n}, deepEqual: function e(t, n) {\n if (t === n) return !0;\n if (t && n && typeof t == "object" && typeof n == "object") {\n if (t.constructor !== n.constructor) return !1;\n let r, o, i;\n if (Array.isArray(t)) {\n if (r = t.length, r != n.length) return !1;\n for (o = r; o-- !== 0; ) if (!e(t[o], n[o])) return !1;\n return !0;\n }\n if (t instanceof Map && n instanceof Map) {\n if (t.size !== n.size) return !1;\n for (o of t.entries()) if (!n.has(o[0])) return !1;\n for (o of t.entries()) if (!e(o[1], n.get(o[0]))) return !1;\n return !0;\n }\n if (t instanceof Set && n instanceof Set) {\n if (t.size !== n.size) return !1;\n for (o of t.entries()) if (!n.has(o[0])) return !1;\n return !0;\n }\n if (ArrayBuffer.isView(t) && ArrayBuffer.isView(n)) {\n if (r = t.length, r != n.length) return !1;\n for (o = r; o-- !== 0; ) if (t[o] !== n[o]) return !1;\n return !0;\n }\n if (t.constructor === RegExp) return t.source === n.source && t.flags === n.flags;\n if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === n.valueOf();\n if (t.toString !== Object.prototype.toString) return t.toString() === n.toString();\n if (i = Object.keys(t), r = i.length, r !== Object.keys(n).length) return !1;\n for (o = r; o-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(n, i[o])) return !1;\n for (o = r; o-- !== 0; ) {\n let a = i[o];\n if ((a !== "_owner" || !t.$$typeof) && !e(t[a], n[a])) return !1;\n }\n return !0;\n }\n return t != t && n != n;\n}, deepFreeze: function e(t) {\n return Object.freeze(t), Object.keys(t).forEach((n) => {\n typeof t[n] != "object" || t[n] === null || Object.isFrozen(t[n]) || e(t[n]);\n }), t;\n}, deepMerge: Y, diffValues: (e, t) => {\n const n = {}, r = Object.keys(t), o = r.length;\n for (let i = 0; i < o; i++) {\n const a = r[i];\n e[a] !== t[a] && (e[a] === void 0 ? n[a] = t[a] : n[a] = e[a]);\n }\n return Object.keys(n).length === 0 ? null : n;\n}, findEqualOrGreater: function(e, t, n = Be) {\n let r = 0, o = e.length - 1;\n for (; r <= o; ) {\n let i = Math.floor((r + o) / 2), a = n(e[i]);\n if (a === t) return i;\n a < t ? r = i + 1 : o = i - 1;\n }\n return r;\n}, findEqualOrLesser: function(e, t, n = Be) {\n let r = e.length - 1, o = 0;\n for (; r >= o; ) {\n let i = Math.floor((r + o) / 2), a = n(e[i]);\n if (a === t) return i;\n a > t ? r = i - 1 : o = i + 1;\n }\n return r;\n}, findNextStep: (e, t = !0, n = 15, r = 10, o = 400) => {\n const i = Math.max(e - r, 0) + (t ? 1 : -1);\n return Math.min(o, Math[t ? "ceil" : "floor"](i / n) * n + r);\n}, getDPI: () => {\n let e = 1;\n return typeof window == "object" && (e = window.devicePixelRatio || 1), e;\n}, getFromPath: (e, t) => {\n const n = t.split(".");\n let r = e;\n for (let o = 0; o < n.length; o++) {\n const i = n[o];\n if (!r) return null;\n let a = r[i];\n if (typeof a == "function" && (a = a.bind(r)()), !a || !ne(a)) return a;\n r = a;\n }\n return r ?? null;\n}, getOS: oe, hasFocus: qe, isDefined: (e) => e != null, isEmpty: (e) => e == null || e === "", isEqualArrays: at, 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) => {\n if (e === t) return !0;\n if (e && !t || t && !e) return !1;\n const n = Object.keys(e);\n if (n.length !== Object.keys(t).length) return !1;\n for (let r = 0; r < n.length; r++) if (e[n[r]] !== t[n[r]]) return !1;\n return !0;\n}, isNode: ct, isNullOrUndefined: ze, isNumeric: (e) => {\n const t = 1 * e;\n return Number.isFinite(t) && typeof t == "number";\n}, isObject: ne, 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: Ke, mergeContentful: (...e) => {\n const t = e.length;\n if (t > 0 && e[t - 1] !== void 0 && !ne(e[t - 1])) return e[t - 1];\n let n = e[0] || {};\n for (let r = 1; r < t; r++) n = Y(n, e[r] || {}, { arrayMerge: (o, i) => [...i] });\n return n;\n}, nextTick: (e) => {\n typeof window < "u" && typeof window.requestAnimationFrame == "function" ? window.requestAnimationFrame(() => {\n e();\n }) : (typeof setImmediate == "function" ? setImmediate : setTimeout)(() => {\n e();\n });\n}, openFileDialog: (e = "*.*") => new Promise((t, n) => {\n if (!Ve) return void n("Unable to open dialog with no dom.");\n const r = document.createElement("input");\n r.type = "file", r.accept = e;\n let o = null, i = !1;\n globalThis.addEventListener?.("focus", () => {\n setTimeout(() => {\n o || i || (i = !0, t(null));\n }, 1e3);\n }, { once: !0, passive: !0 }), r.onchange = () => {\n if (o = r.files[0], o) {\n if (i) return void console.warn("File open detected after faux cancel.", o);\n t(o);\n }\n }, r.autofocus = !0, r.click();\n}), rafThrottle: (e) => {\n let t, n = !1, r = function() {\n n = !1, e(t);\n };\n return function(o) {\n t = o, t && t.persist && t.persist(), n || (n = !0, requestAnimationFrame(r));\n };\n}, removeEmptyProperties: lt, removeEqualValues: st, removeListenerAll: (e) => {\n if (!e) return [];\n for (let t = 0; t < e.length; t++) e[t] && e[t]();\n return [];\n}, requestTimeout: (e, t) => {\n const n = $e(), r = { id: requestAnimationFrame(function o() {\n $e() - n >= t ? e.call(null) : r.id = requestAnimationFrame(o);\n }) };\n return r;\n}, roundAccurately: (e, t = 0) => {\n if (e == null || !isFinite(e)) return null;\n const n = 10 ** t;\n return Number(Math.round(e * n) / n);\n}, setToPath: (e, t, n) => {\n const r = t.split(".");\n let o = e;\n if (!o) throw new Error("Can not set path to a null path.");\n for (let i = 0; o && i < r.length - 1; i++) {\n const a = r[i];\n let l = o[a];\n if (l == null && (l = {}, o[a] = l), !ne(l)) throw new Error("Can not set path to a non object path.");\n o = l;\n }\n if (typeof n != "number" && typeof n != "boolean" && typeof n != "string" && !ne(n)) throw new Error(`Can not set path to ${n} that is not a a supported primitive.`);\n return o[r[r.length - 1]] = n, e;\n}, splitNumber: (e) => {\n let t = Math.abs(e);\n if (isNaN(t) || !isFinite(e)) return null;\n let n = 0 | t, r = t - n, o = 0, i = 0, a = 1;\n if (r > 5e-8) for (; i < 8 && Math.abs(o / a - r) > 5e-8; ) i++, a *= 10, o = Math.round(r * a);\n return { ip: Math.trunc(e), fp: o, ipLength: Math.ceil(Math.log10(n + 1)), fpLength: i };\n}, subtractRect: (e, t, n = !1) => {\n if (!t) return [e];\n if (!Ke(e, t)) return [];\n const r = [];\n let o = e;\n const i = () => {\n t.top > o.top && t.top < o.bottom && (r.push({ ...o, bottom: t.top }), o = { ...o, top: t.top });\n }, a = () => {\n t.bottom > o.top && t.bottom < o.bottom && (r.push({ ...o, top: t.bottom }), o = { ...o, bottom: t.bottom });\n }, l = () => {\n t.right > o.left && t.right < o.right && (r.push({ ...o, left: t.right }), o = { ...o, right: t.right });\n }, u = () => {\n t.left > o.left && t.left < o.right && (r.push({ ...o, right: t.left }), o = { ...o, left: t.left });\n };\n return n ? (u(), l(), i(), a()) : (i(), a(), l(), u()), r;\n}, textToKey: (e) => e.replace(/[^a-zA-Z0-9]/g, "").toLowerCase(), throttle: function(e, t) {\n let n = null;\n return (...r) => {\n const o = Date.now();\n (!n || o - n >= t) && (n = o, e(...r));\n };\n}, toSafeJSON: function e(t) {\n if (t === null || typeof t != "object") return t;\n if (typeof t.toJSON == "function") return t.toJSON();\n if (Array.isArray(t)) return t.map((r) => e(r));\n if (typeof t.toString == "function" && t.toString !== Object.prototype.toString) return t.toString();\n const n = {};\n for (const r in t) t.hasOwnProperty(r) && (n[r] = e(t[r]));\n return n;\n}, transpose: (e) => {\n if (!e) return e;\n const t = e.length, n = e[0].length, r = [];\n for (let o = 0; o < n; o++) r[o] = Array(t);\n for (let o = 0; o < t; o++) for (let i = 0; i < n; i++) r[i][o] = e[o][i];\n return r;\n}, uuidV4: de, validEnumValue: (e, t) => {\n if (!Object.values(e).includes(t)) throw new Error(`Invalid type: ${t ?? "null"}. Must be one of: ${Object.values(t).join(", ")}.`);\n}, whenFocus: async (e, t = !1) => new Promise((n) => {\n qe(e, t) ? n(!0) : e.addEventListener("focusin", () => {\n n(!0);\n }, { once: !0 }), e.focus();\n}) }, Symbol.toStringTag, { value: "Module" }));\nObject.freeze(Object.defineProperty({ __proto__: null, MESSAGE_ERROR_INVALID_ARG: (e) => `Invalid argument: \'${e}\'.` }, Symbol.toStringTag, { value: "Module" }));\nconst ut = (e) => {\n const t = new Uint8Array(e), n = t.byteLength;\n let r = "";\n for (let o = 0; o < n; o++) r += String.fromCharCode(t[o]);\n if (typeof window < "u" && typeof globalThis.btoa == "function") return globalThis.btoa(r);\n if (typeof Buffer < "u") return Buffer.from(r, "binary").toString("base64");\n throw new Error("Unsupported environment");\n}, Ce = (e) => new Promise((t, n) => {\n if (e) if (typeof FileReader < "u") {\n const r = new FileReader();\n r.onload = () => {\n t(r.result);\n }, r.onerror = () => {\n n(r.error);\n }, r.readAsText(e);\n } else if (typeof Buffer < "u") {\n const r = (o) => Buffer.from(o).toString("utf-8");\n e.arrayBuffer().then((o) => {\n t(r(o));\n }).catch((o) => {\n n(o);\n });\n } else n(new Error("Unsupported environment"));\n else t("");\n});\nObject.freeze(Object.defineProperty({ __proto__: null, DEFAULT_MIME_TYPE: "*/*", arrayBufferToBase64: ut, base64ToArrayBuffer: (e) => {\n const t = typeof window < "u" && typeof globalThis.atob == "function" ? globalThis.atob(e) : Buffer.from(e, "base64").toString("binary"), n = t.length, r = new Uint8Array(n);\n for (let o = 0; o < n; o++) r[o] = t.charCodeAt(o);\n return r.buffer;\n}, blobToString: Ce }, Symbol.toStringTag, { value: "Module" }));\nconst dt = "data:image/png;base64,", ft = "Unable to resolve image.", Ge = (e) => new Promise(async (t, n) => {\n let r = null;\n try {\n r = new Image(), r.src = e, r.addEventListener("load", function() {\n t({ width: r.naturalWidth, height: r.naturalHeight });\n }, { once: !0 }), r.addEventListener("error", function() {\n URL.revokeObjectURL(e), n("Invalid Image");\n }, { once: !0 }), await r.decode("sync");\n } catch {\n r?.src && URL.revokeObjectURL(r.src);\n }\n r || n(ft);\n}), we = "image/svg+xml";\nObject.freeze(Object.defineProperty({ __proto__: null, DATA_URL_PNG_PREFIX: dt, getImageDataUrl: (e, t = 1) => new Promise(async (n, r) => {\n let o = null;\n try {\n o = new Image(), o.src = e, o.addEventListener("load", function() {\n try {\n const i = document.createElement("canvas");\n i.width = o.naturalWidth, i.height = o.naturalHeight, i.getContext("2d").drawImage(o, 0, 0);\n const a = i.toDataURL("image/png", t);\n n({ elemImg: o, dataUrl: a });\n } catch (i) {\n URL.revokeObjectURL(e), r(i);\n }\n }, { once: !0 }), o.addEventListener("error", function() {\n URL.revokeObjectURL(e), r("Invalid Image");\n }, { once: !0 }), await o.decode("sync");\n } catch {\n o?.src && URL.revokeObjectURL(o.src);\n }\n o || r(ft);\n}), loadImageDetails: async (e, t = null) => {\n let n = null;\n const r = async () => {\n try {\n const i = t ?? "image/*", a = URL.createObjectURL(new Blob([e], { type: i })), l = await Ge(a);\n n = { mimeType: i, naturalDimensions: l, asUrl: a };\n } catch {\n }\n }, o = async () => {\n try {\n const i = new TextDecoder().decode(e), a = URL.createObjectURL(new Blob([i], { type: we })), l = await Ge(a);\n n = { mimeType: t ?? we, naturalDimensions: l, asUrl: a, asSVGText: i };\n } catch {\n }\n };\n if (t === we ? await o() : t.startsWith("image/") ? await r() : (await r(), n || await o()), !n) throw new Error("Failed to load image");\n return n;\n} }, Symbol.toStringTag, { value: "Module" }));\nvar We, Ye;\n(Ye = We || (We = {})).resolveTypedUpdates = (e, t, n, r) => {\n if (e === null) return e;\n if (e === void 0) return r;\n let o = e;\n if (t?.shorthand) {\n const u = t?.shorthand(e, n);\n u !== void 0 && (o = u);\n }\n if (o !== null && t?.getSubType) {\n const u = t.getSubType(o);\n u && (t = u);\n }\n const i = t?.properties, a = t?.arrayType ?? !1;\n let l = o;\n if (t && t.merge && l && r) l = t.merge(l, r, n);\n else if (!a) {\n if (i) {\n const u = Object.keys({ ...o, ...r });\n l = null;\n for (let f = 0; f < u.length; f++) {\n const h = u[f];\n let g, p = o[h];\n if (p !== void 0) {\n const y = i[h];\n g = y ? (0, Ye.resolveTypedUpdates)(p, y, n, r?.[h]) : p;\n } else g = r?.[h];\n g != null && (l = l ?? {}, l[h] = g);\n }\n }\n }\n return l;\n};\nconst Je = `The Safari browser does not support advanced copy and paste.\nCopy and paste will be limited to within the browser tab.\n\nPlease use Chrome or Edge if external copy and paste is required.`, ye = `You do not have permissions to access the clipboard.\nAll copy and paste operations will be limited to the browser tab.`, pt = { Safari: `The Safari browser does not support advanced copy and paste.\nCopy and paste will be limited to within the browser tab.\n\nPlease use Chrome or Edge if external copy and paste is required.`, Perms: ye, PermsWrite: oe() === k.Safari ? Je : ye, PermsRead: oe() === k.Safari ? Je : ye }, ge = async () => new Promise((e) => {\n document.hasFocus() ? e() : globalThis.addEventListener?.("focus", () => {\n e();\n }, { once: !0 }), document.activeElement.focus?.();\n}), be = async (e, t, n) => {\n if (oe() === k.Safari) return await n(new Error(pt.Safari));\n try {\n const r = async (a) => {\n try {\n return await a();\n } catch (l) {\n if (l.message?.includes("Document is not focused")) return !1;\n throw l;\n }\n }, o = await globalThis?.navigator?.permissions?.query({ name: e, allowWithoutGesture: !0, allowWithoutSanitization: !0 });\n let i = !1;\n if (o.state === "prompt" && (i = await r(t)), i || o.state !== "granted" || (i = await t()), !i) return await n(new Error(o.state));\n } catch (r) {\n return r.message === "No valid data on clipboard" || r.name === "DataError" ? void 0 : await n(r);\n }\n}, mt = async (e) => {\n try {\n return await e.read({ unsanitized: [S.html] });\n } catch {\n }\n return await e.read();\n}, Bt = async (e, t) => {\n if (!e) return null;\n const n = await mt(e);\n let r = !1;\n for (let o = 0; !r && n && o < n.length; o++) if (r = n[o].types.includes(t), r)\n return await n[o].getType(t);\n return r ? void 0 : null;\n};\nif (!globalThis.ClipboardItem) {\n const e = (n, r) => new Blob([r], { type: n });\n class t {\n constructor(r, o) {\n this._items = {}, this._types = Object.keys(r);\n const i = {}, a = Object.keys(r);\n for (let l = 0; l < a.length; l++) {\n const u = a[l];\n let f = r[u];\n i[u] = typeof f == "string" ? e(u, f) : f;\n }\n this._items = i, this._presentationStyle = o?.presentationStyle ?? "unspecified";\n }\n get types() {\n return this._types;\n }\n getType(r) {\n return Promise.resolve(this._items[r]);\n }\n supports(r) {\n return !0;\n }\n }\n globalThis.ClipboardItem = t;\n}\nconst ve = async (e, t = S.html) => new Promise(async (n, r) => {\n try {\n const o = await Bt(e, t);\n if (o) {\n const i = new FileReader();\n i.onload = () => {\n n(i.result);\n }, i.onerror = () => {\n n("");\n }, i.readAsText(o);\n } else n("");\n } catch (o) {\n r(o);\n }\n}), He = async (e, t = S.html) => {\n const n = await ve(e, t);\n if (!n) return null;\n let r = null;\n try {\n r = new DOMParser().parseFromString(n, S.html);\n } catch {\n console.warn("Can\'t parse html from clipboard.");\n }\n return r;\n}, $t = async (e) => {\n e && await e.writeText("");\n}, ie = "clipboard-uuid", Q = "web text/uuid", Xe = (e) => `<div style="display:none" ${ie}="${e}"/>`, zt = (e, t) => {\n let n = null;\n try {\n const r = new DOMParser().parseFromString(t, S.html);\n r.body.firstElementChild.setAttribute(ie, e), n = r.getElementsByTagName("body")[0].innerHTML;\n } catch (r) {\n console.warn("Can\'t embed uuid.", r);\n }\n return n;\n}, Ze = (e, t) => {\n if (!t || !e) return !1;\n try {\n const n = t.querySelectorAll(`[${ie}="${e}"]`);\n if (n && n.length === 1) return !0;\n if (t.querySelector("parsererror")) throw new Error("We are unable to parse node");\n return !1;\n } catch {\n return !1;\n }\n};\nclass Qe {\n constructor(t) {\n if (t?.nativeClipboard === void 0 || t?.nativeClipboard === !0) try {\n this._nativeClipboard = globalThis?.navigator.clipboard;\n } catch {\n t?.nativeClipboard === !0 && console.warn("NativeClipboard option set to true but no native clipboard available.");\n }\n else this._nativeClipboard = t?.nativeClipboard === !1 ? null : t?.nativeClipboard;\n this._disableCheckOnFocus = t?.disableCheckOnFocus ?? !1, this._init();\n }\n async _checkForChanges() {\n this._nativeClipboard && this._state && !this._disableCheckOnFocus && await be("clipboard-read", async () => {\n await ge();\n const t = await ve(this._nativeClipboard, Q);\n if (!this._state || t && t === this._state.uuid) return !0;\n const n = await He(this._nativeClipboard, S.html);\n return !this._state || (Ze(this._state.uuid, n) || this.clear(), !0);\n }, async (t) => {\n t?.message === "denied" || t.message?.includes("Document is not focused") || oe() === k.Safari || console.warn("Unable to detect clipboard changes: ", t);\n });\n }\n _init() {\n const t = this;\n this._listeners = /* @__PURE__ */ new Map(), this._listenersCapture = /* @__PURE__ */ new Map(), this._state = null, this._nativeClipboard && (this._onFocus = () => {\n t._checkForChanges();\n }, this._onBlur = () => {\n globalThis.addEventListener?.("focus", t._onFocus, { once: !0 });\n }, globalThis.addEventListener?.("blur", this._onBlur), this._nativeClipboard.addEventListener("clipboardchange", (n) => {\n t._checkForChanges();\n }));\n }\n async read() {\n if (!this._nativeClipboard) return this._state?.items ?? null;\n const t = this;\n return await be("clipboard-read", async () => {\n if (await ge(), this._state?.uuid) {\n const n = await ve(this._nativeClipboard, Q);\n if (n && n === t._state.uuid) return !0;\n const r = await He(this._nativeClipboard, S.html);\n if (Ze(t._state?.uuid, r)) return !0;\n }\n return t._state = { items: await mt(this._nativeClipboard), uuid: null, ref: null }, this.dispatchEvent(new Event("clipboardread")), !0;\n }, async (n) => {\n this.dispatchEvent(new Event("clipboarderrorread"));\n }), this._state?.items ?? [];\n }\n async write(t) {\n return this._write({ uuid: de(), items: t, ref: null });\n }\n async _write(t) {\n if (!this._nativeClipboard) return this._state = t, this.dispatchEvent(new Event("clipboardwrite")), this.dispatchEvent(new Event("clipboardchange")), null;\n const n = this, r = [], o = t.uuid;\n let i = t.items ?? [];\n const a = () => {\n n._state = { uuid: o, ref: t.ref, items: r }, n.dispatchEvent(new Event("clipboardwrite")), n.dispatchEvent(new Event("clipboardchange"));\n };\n await be("clipboard-write", async () => {\n await ge(), o && i.length === 0 && (i.push(new ClipboardItem({ [Q]: new Blob([o], { type: Q }) })), i.push(new ClipboardItem({ [S.html]: new Blob([Xe(o)], { type: S.html }) })));\n for (let l = 0; l < Math.min(1, i.length); l++) {\n const u = i[l];\n let f = u.types.indexOf(S.html), h = null;\n if (f !== -1) {\n const y = await u.getType(S.html);\n h = await Ce(y), h && (h = zt(o, h));\n }\n if (!h && u.types.includes(S.plain)) {\n const y = await u.getType(S.plain);\n if (y) {\n let T = null;\n typeof y == "string" ? (console.warn("text as string", y), T = y) : T = await Ce(y), T && (h = `<div ${ie}="${o}">${T}</div>`);\n }\n }\n if (!h && u.types.includes(S.png)) {\n const y = await u.getType(S.png), T = ut(await y.arrayBuffer());\n h = `<div ${ie}="${o}"><img src="${dt + T}"/></div>`;\n }\n !h && o && (h = Xe(o));\n const g = new Blob([h ?? ""], { type: S.html }), p = {};\n for (let y = 0; y < u.types.length; y++) {\n const T = u.types[y];\n p[T] = y === f ? g : u.getType(T);\n }\n h && f === -1 && (p[S.html] = g), o && (p[Q] = new Blob([o], { type: Q })), r.push(new ClipboardItem(p));\n }\n try {\n r && r.length !== 0 ? await this._nativeClipboard.write(r) : await $t(this._nativeClipboard);\n } catch (l) {\n l.message?.includes("Document is not focused") || console.warn("Unable to write to native clipboard: ", l);\n }\n return a(), !0;\n }, async (l) => {\n this.dispatchEvent(new Event("clipboarderrorwrite")), a();\n });\n }\n async writeReference(t) {\n if (!t) return void this.clear();\n let n = null;\n const r = {};\n try {\n const i = await t.toText?.() ?? null;\n i && (r[S.plain] = new Blob([i ?? ""], { type: S.plain }));\n } catch (i) {\n n = i;\n }\n try {\n const i = await t.toHtml?.() ?? null;\n i && (r[S.html] = new Blob([i], { type: S.html }));\n } catch (i) {\n n = i, console.warn("export to html", i);\n }\n try {\n const i = await t.toImage?.() ?? null;\n i && (r[S.png] = i);\n } catch (i) {\n n = i, console.warn("export to png", i);\n }\n const o = this._write({ uuid: de(), ref: t, items: Object.keys(r).length > 0 ? [new ClipboardItem(r)] : null });\n if (n) throw n;\n return o;\n }\n clear(t = !1) {\n this._state && (this._state = null, t && this._write({ uuid: null, ref: null, items: null }), this.dispatchEvent(new Event("clipboardwrite")), this.dispatchEvent(new Event("clipboardchange")));\n }\n async readReference() {\n return await this.read(), this._state?.ref ?? null;\n }\n readText() {\n return new Promise(async (t, n) => {\n const r = await this.read();\n let o = null;\n for (let a = 0; !o && r && a < r.length; a++) r[a].types.includes(S.plain) && (o = await r[a].getType(S.plain));\n if (!o) return void t("");\n const i = new FileReader();\n i.onload = () => {\n t(i.result);\n }, i.readAsText(o), i.onerror = (a) => {\n n(a);\n };\n });\n }\n async writeText(t) {\n const n = [new ClipboardItem({ [S.plain]: new Blob([t], { type: S.plain }) })];\n return this._write({ uuid: de(), items: n, ref: null });\n }\n addEventListener(t, n, r = {}) {\n const o = r?.capture ? this._listenersCapture : this._listeners;\n let i = o.get(t);\n i || (i = /* @__PURE__ */ new Map(), o.set(t, i)), i.set(n, typeof r == "boolean" ? {} : r);\n }\n dispatchEvent(t) {\n if (!t) return;\n const n = (r) => {\n const o = r.get(t.type);\n o && o.forEach((i, a) => {\n try {\n typeof a == "function" ? a(t) : a.handleEvent && a.handleEvent(t), i.once && o.delete(a);\n } catch (l) {\n console.warn(l);\n }\n });\n };\n return n(this._listenersCapture), n(this._listeners), !0;\n }\n removeEventListener(t, n, r) {\n const o = r?.capture ? this._listenersCapture : this._listeners, i = o.get(t);\n i && (i.delete(n), i.size === 0 && o.delete(t));\n }\n close() {\n globalThis.removeEventListener?.("focus", this._onFocus), globalThis.removeEventListener?.("blur", this._onBlur);\n }\n}\nvar Ee;\n(Ee = Qe || (Qe = {})).ErrorMessages = pt, Ee.Global = new Ee();\nconst Kt = "__SHEETXL";\nlet ee = null, le = null;\nasync function Vt() {\n if (ee)\n return ee;\n if (le) {\n if (await le, !ee)\n throw new Error("ESBuild initialization promise resolved, but instance is not available.");\n return ee;\n }\n let e, t;\n le = new Promise((n, r) => {\n e = n, t = r;\n });\n try {\n const { initialize: n } = await Promise.resolve().then(function() {\n return nn;\n });\n return ee = await n(), e(), ee;\n } catch (n) {\n throw console.error("Failed to import or initialize esbuild:", n), le = null, t(n), n;\n }\n}\nconst qt = {\n // ESBuild.TsconfigRaw =\n compilerOptions: {\n target: "esnext"\n }\n};\nasync function Gt(e, t, n = "/script.js", r = Kt) {\n try {\n const o = await Vt(), i = "@sheetxl/primitives", a = `\n export const FormulaContext = globalThis.${r}?.FormulaContext;\n export const ScalarType = globalThis.${r}?.ScalarType;\n export const Observable = globalThis.${r}?.Observable;\n export const IRange = globalThis.${r}?.IRange;\n export const FormulaError = globalThis.${r}?.FormulaError;\n // Add more exports as needed\n `, l = {\n // ESBuild.Plugin = {\n name: "sheetxl-esbuild-in-memory",\n setup(f) {\n const h = "sheetxl-" + (/* @__PURE__ */ new Date()).getTime();\n f.onResolve({ filter: new RegExp(`^(${n.replace("/", "\\\\/")}|${i})$`) }, (g) => ({\n path: g.path,\n namespace: h\n })), f.onResolve({ filter: /.*/ }, (g) => {\n if (g.namespace !== h)\n return console.warn(`esbuild: Treating import "${g.path}" as external.`), { path: g.path, external: !0 };\n }), f.onLoad({ filter: /.*/, namespace: h }, (g) => {\n let p;\n if (g.path === n)\n p = t;\n else if (g.path === i)\n p = a;\n else\n return {\n errors: [{ text: `Cannot load unknown path in ${h}: ${g.path}` }]\n };\n return {\n contents: p,\n loader: "ts"\n // leave this as \'ts\' so esbuild generates proper sourcemaps\n };\n });\n }\n }, u = await o.build({\n entryPoints: [n],\n // Use the virtual entry point\n bundle: !0,\n // IMPORTANT: Enable bundling\n write: !1,\n // IMPORTANT: Return result in memory\n format: "esm",\n // Output format\n plugins: [l],\n // TODO - later change to external and prepend when executing from ui\n sourcemap: "inline",\n // Generate separate source map string\n tsconfigRaw: qt,\n // Pass the mapped options\n minify: !0,\n // sourcemap: \'external\', // Generate separate source map string\n // Or use \'inline\' if you prefer data URLs embedded in the code\n // To suppress warnings about dynamic import() if esbuild complains:\n // supported: { \'dynamic-import\': true },\n platform: "neutral"\n // not really needed\n });\n if (u.outputFiles && u.outputFiles.length > 0)\n return u.outputFiles[0].text;\n throw u.errors && u.errors.length > 0 ? new Error(`esbuild bundling failed: ${u.errors.map((f) => f.text).join(`\n`)}`) : new Error("esbuild did not produce an output file.");\n } catch (o) {\n throw console.error("esbuild bundling process failed:", o), o;\n }\n}\nconst Wt = `\n/**\n * Represents the completion of an asynchronous operation\n */\ninterface Promise<T> {\n /**\n * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The\n * resolved value cannot be modified from the callback.\n * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).\n * @returns A Promise for the completion of the callback.\n */\n finally(onfinally?: (() => void) | undefined | null): Promise<T>;\n}\n`, Yt = `\n interface FirstTest {\n isTrue?: boolean;\n }\n`, Jt = async () => Yt, ht = /* @__PURE__ */ new Map([\n ["IReferenceRange", "r"],\n ["IRange", "l"]\n]), wt = /* @__PURE__ */ new Map([\n ["IWorkbook", "workbook"],\n ["ISheet", "sheet"],\n ["ICellRanges", "ranges"],\n ["ICellRange", "range"],\n ["IFormulaContext", "context"]\n]), _e = (e, t) => {\n Array.from(t.keys()).forEach((r) => {\n const o = t.get(r);\n t.set(`${e}.${r}`, o);\n });\n}, Ht = /* @__PURE__ */ new Map([\n ["Scalar", "*"],\n ["FormulaError.Known", W.Error],\n ["Date", "Date"],\n ["JSON", "JSON"]\n]), Xt = /* @__PURE__ */ new Map([\n // Repeating\n]), Oe = "SheetXL";\n_e(Oe, ht);\n_e(Oe, wt);\n_e(Oe, Xt);\nconst Zt = /* @__PURE__ */ new Map([\n ["Promise", () => ({ async: !0 })],\n // [\'PromiseLike\', (): Partial<IFunction.ReturnTypeJSON> => {\n // return { async: true };\n // }],\n ["Observable", () => ({ stream: !0 })]\n]);\nlet se = null;\nasync function Qt() {\n if (se)\n return se;\n try {\n return await (await Promise.resolve().then(function() {\n return on;\n })).initialize();\n } catch (e) {\n throw se = null, e;\n } finally {\n se = null;\n }\n}\nasync function en(e) {\n const t = e?.source ?? null;\n if (!t) return null;\n const n = (e.disableBundle || e.declarationsOnly) ?? !1, r = [\n Jt(),\n //import(\'typescript\'), // when bundled, but node check causes issues. We could bundle replace isNode but felt hacky\n Qt()\n ], o = await Promise.all(r), i = o[0], a = o[1];\n let l = "", u = null;\n const f = [], h = {\n allowJs: !0,\n declaration: !1,\n sourceMap: !1,\n // was true but now bundler will do this\n inlineSourceMap: !1,\n inlineSources: !1,\n isolatedModules: !0,\n preserveConstEnums: !1,\n // types: [\'WebWorker\'],\n module: 99,\n //"esNext",\n noResolve: !0,\n emitDeclarationOnly: !1,\n target: a.ScriptTarget.ES2020\n // lib: [\'webworker\', \'es2020\', \'esnext.asynciterable\'], // Use the webworker lib instead of dom\n }, g = "script", p = `${g}.ts`, y = "lib.d.ts", T = "global.d.ts", A = {\n [p]: t,\n [y]: Wt,\n [T]: i\n }, D = {\n getSourceFile: (s, w, L, P) => a.createSourceFile(s, A[s], a.ScriptTarget.Latest, !0),\n fileExists: (s) => A[s] !== void 0,\n readFile: (s) => A[s],\n writeFile: (s, w) => {\n A[s] = w;\n },\n // not used\n getCurrentDirectory: () => "./",\n getCanonicalFileName: (s) => s,\n useCaseSensitiveFileNames: () => !0,\n getDefaultLibFileName: (s) => y,\n getNewLine: () => `\n`\n }, U = a.createProgram([p, T], h, D), I = U.getTypeChecker(), J = U.getSourceFile(p), E = U.emit();\n E.diagnostics.length > 0 && console.warn(E.diagnostics), l = A[`${g}.js`];\n const c = (s, w, L, P) => {\n if (!s) {\n $(s, new Error(`Type is not defined for \'${w?.name ?? "return"}\'.`));\n return;\n }\n if (s.kind === a.SyntaxKind.NumberKeyword)\n w.scalar = W.Number;\n else if (s.kind === a.SyntaxKind.StringKeyword)\n w.scalar = W.String;\n else if (s.kind === a.SyntaxKind.BooleanKeyword)\n w.scalar = W.Boolean;\n else if (s.kind === a.SyntaxKind.UndefinedKeyword || s.kind === a.SyntaxKind.NullKeyword || s.kind === a.SyntaxKind.VoidKeyword) {\n if (P) {\n $(s, new Error(`\'undefined\' is not a valid type for input: \'${s?.parent?.name?.escapedText}\'.`));\n return;\n }\n w.scalar = W.Null;\n } else if (s.kind === a.SyntaxKind.BigIntKeyword)\n w.scalar = W.Number;\n else if (s.kind === a.SyntaxKind.AnyKeyword)\n w.scalar = W.Null;\n else if (s.kind === a.SyntaxKind.ArrayType) {\n const M = s.elementType;\n if (!M) {\n $(s, new Error(`\'Array\' must be typed: \'${s?.parent?.name?.escapedText}\'.`));\n return;\n }\n w.arrayDepth = (w.arrayDepth ?? 0) + 1, c(M, w, L, P);\n } else if (s.kind !== a.SyntaxKind.TupleType) {\n if (s.kind === a.SyntaxKind.TypeReference) {\n const M = s.typeName?.getText?.() ?? null, K = ht.get(M);\n let V = !1;\n K && (w.range = K, V = !0);\n const q = Ht.get(M);\n if (q && (w.scalar = q), q !== void 0 && (V = !0), P) {\n const R = wt.get(M);\n if (R)\n return R;\n } else {\n const R = Zt.get(M);\n if (R) {\n const b = { ...w, ...R() };\n let N = 0;\n if (b.async && N++, b.stream && N++, N > 1) {\n $(s, new Error(`\'${M}\' cannot have multiple modifiers: \'${s?.parent?.name?.escapedText}\'.`));\n return;\n }\n w = b, V = !0;\n }\n }\n if (!V) {\n $("node", new Error(`\'${M}\' is not a valid type: \'${s?.parent?.name?.escapedText}\'.`));\n return;\n }\n const H = s.typeArguments;\n if (H) {\n if (H.length !== 1) {\n $(s, new Error(`\'${M}\' must be typed with exactly 1 type: \'${s?.parent?.name?.escapedText}\'.`));\n return;\n }\n c(H[0], w, L, P);\n }\n }\n }\n }, m = (s) => (a.getCombinedModifierFlags(s) & a.ModifierFlags.Export) !== 0, fe = (s) => (a.getCombinedModifierFlags(s) & a.ModifierFlags.Default) !== 0, B = [], $ = (s, w) => {\n B.push(w);\n };\n if (a.forEachChild(J, (s) => {\n if (m(s) && a.isFunctionDeclaration(s)) {\n const w = {}, L = {\n parameters: {}\n }, P = s?.name?.getText();\n try {\n w.name = P;\n const K = I.getSymbolAtLocation(s.name).getDocumentationComment(I);\n if (K && K.length > 0 && K[0].text) {\n let R = K[0].text;\n R = R.replace(/[\\r\\n]+/g, "\\\\n").trim(), L.summary = R;\n }\n const V = {};\n c(s.type, V, w, !1), w.returnType = V;\n const q = {};\n fe(s) && (q.default = !0, u = P), Object.keys(q).length > 0 && (w.behavior = q), w.parameters = [];\n const H = /* @__PURE__ */ new Map();\n for (let R = 0; R < s.parameters.length; R++) {\n const b = s.parameters[R], N = {};\n N.name = b.name?.getText();\n const X = c(b.type, N, w, !0);\n if (X) {\n if (w.parameters.length !== 0) {\n const F = s?.parent?.name?.getText();\n $(s, new Error(`\'${w.name}\' contexts must be the first parameter: \'${F}\'.`));\n return;\n }\n w.context = X;\n continue;\n }\n const z = !((b.initializer === void 0 || b.initializer === null) && (b.questionToken === void 0 || b.questionToken === null));\n let C;\n if (z && (N.optional = !0, b.initializer))\n try {\n b.initializer.kind === a.SyntaxKind.StringLiteral ? C = b.initializer.text : b.initializer.kind === a.SyntaxKind.NumericLiteral ? C = parseFloat(b.initializer.text) : b.initializer.kind === a.SyntaxKind.TrueKeyword || b.initializer.kind === a.SyntaxKind.FalseKeyword ? C = b.initializer.kind === a.SyntaxKind.TrueKeyword : b.initializer.kind === a.SyntaxKind.NullKeyword ? C = null : b.initializer.kind === a.SyntaxKind.ObjectLiteralExpression || b.initializer.kind === a.SyntaxKind.ArrayLiteralExpression ? C = b.initializer.getText() : C = b.initializer.getText?.();\n } catch (O) {\n console.warn(`Couldn\'t extract default value for parameter \'${N.name}\'`, O);\n }\n b.dotDotDotToken && (N.rest = !0), w.parameters.push(N);\n const x = { description: "" };\n L.parameters[N.name] = x;\n const G = I.getSymbolAtLocation(b.name).getDocumentationComment(I);\n G && G.length > 0 && G[0].text && (x.description = G[0].text), C !== void 0 && (x.defaultValue = C), H.set(N.name, N);\n }\n if (s.jsDoc && s.jsDoc.length > 0) {\n const R = s.jsDoc;\n for (let b = 0; b < R.length; b++) {\n const N = R[b]?.tags;\n if (N)\n for (let X = 0; X < N.length; X++) {\n const z = N[X];\n let C = z?.tagName?.text;\n if (!C) continue;\n C = C.toLowerCase();\n let x = z.comment;\n const G = C === "hidden";\n if (!(typeof x != "string" && !G) && (typeof x == "string" && (x = x.replace(/[\\r\\n]+/g, "\\\\n").trim()), !(!G && x && (x = x.split(/\\\\n/)[0], !x || x.length === 0)))) {\n if (x && typeof x == "string") {\n const O = /\\{@link(code|plain)?\\s+([^}|]+)(?:\\s*\\|\\s*([^}]+))?\\}/g;\n let F, Z = x, te = [];\n for (; (F = O.exec(x)) !== null; ) {\n const [pe, me, gt, Ne] = F, bt = [gt.trim()];\n Ne && bt.push(Ne.trim());\n }\n x = Z, te.length > 0 && C === "see" && (L.links || (L.links = []), L.links.push(...te));\n }\n if (C === "name") {\n const O = x;\n O !== P && (L.name = O);\n } else if (C === "description") {\n const O = x;\n } else if (C === "summary") {\n const O = x;\n O && (L.summary = O);\n } else if (C === "param") {\n const O = z.name?.text, F = H.get(O);\n if (!F) {\n B.push(new Error(`Parameter \'${O}\' not found in function \'${P}\'.`));\n continue;\n }\n if (z.typeExpression && z.typeExpression.type)\n try {\n const Z = z.typeExpression.type;\n if (Z.kind === a.SyntaxKind.UnionType) {\n const te = [];\n F.enums = te, Z.types.forEach((pe) => {\n if (pe.kind === a.SyntaxKind.LiteralType) {\n const me = pe.literal.text;\n me && te.push(me);\n }\n });\n }\n } catch (Z) {\n console.warn("Error parsing JSDoc type expression:", Z);\n }\n } else if (C === "returns" || C === "return")\n w.returnType.description = x;\n else if (C === "category")\n L.category = x;\n else if (C === "hidden") {\n let O = !0;\n const F = x?.toLowerCase();\n F === "false" ? O = !1 : F !== "true" && (O = x), O !== !1 && (L.hidden = O ?? !0);\n }\n }\n }\n }\n }\n Object.keys(w.returnType).length === 0 && delete w.returnType, f.push([w, L]);\n } catch (M) {\n $(s, new Error(`\'${P}\': ${M.message}`));\n }\n }\n }), B.length > 0)\n throw console.warn(B), new Error("There were compilation errors.", { cause: B });\n if (f.length === 0)\n throw new Error("No exported functions.");\n const yt = `${Ut.uuidV4()}-script`;\n try {\n !n && B.length === 0 && (l = await Gt(a, l, g));\n } catch {\n console.warn("Error bundling script");\n }\n const Ie = {\n functions: f,\n commitId: yt,\n source: t,\n name: "Script",\n language: "typescript",\n // default\n compiled: l\n };\n return u && (Ie.autoRun = u), Ie;\n}\nself.addEventListener("message", async (e) => {\n const { id: t, params: n } = e.data;\n try {\n const r = await en(n);\n self.postMessage({ id: t, result: r, error: null });\n } catch (r) {\n self.postMessage({\n id: t,\n result: null,\n error: {\n message: r.message,\n stack: r.stack,\n cause: r.cause\n }\n });\n }\n});\nlet ce = null;\nasync function tn() {\n return ce || (ce = new Promise(async (e, t) => {\n try {\n const n = "0.20.2", r = `https://esm.sh/esbuild-wasm@${n}`, o = `https://esm.sh/esbuild-wasm@${n}/esbuild.wasm`, a = (await import(\n /* webpackIgnore: true */\n /* @vite-ignore */\n r\n )).default;\n await a.initialize({\n wasmURL: o,\n // Provide the specific WASM URL\n worker: !1\n // Keep processing on the current thread\n }), e(a);\n } catch (n) {\n console.error("Error initializing esbuild:", n), t(n);\n }\n }), ce);\n}\nvar nn = /* @__PURE__ */ Object.freeze({\n __proto__: null,\n initialize: tn\n});\nlet ue = null;\nasync function rn() {\n return ue || (ue = new Promise(async (e, t) => {\n let n = null;\n try {\n n = await import("https://esm.sh/typescript@5.7.2");\n } catch (r) {\n console.error("Error initializing Browser TypeScript module:", r);\n }\n n || console.log("use script fallback"), e(n);\n }), ue);\n}\nvar on = /* @__PURE__ */ Object.freeze({\n __proto__: null,\n initialize: rn\n});\n',r=typeof self<"u"&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",t],{type:"text/javascript;charset=utf-8"});function o(n){let e;try{if(e=r&&(self.URL||self.webkitURL).createObjectURL(r),!e)throw"";const t=new Worker(e,{type:"module",name:n?.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(t),{type:"module",name:n?.name})}}async function i(){if(typeof process<"u"&&process.versions?.node&&typeof Worker>"u")return await a();if(typeof Worker<"u"){const e=new n(()=>new o);try{return await e.start(),e}catch(n){console.error("Failed to start TypescriptCompiler worker reverting to fallback:",n)}}return await a()}const a=async()=>{const{compileModule:n}=await import("./Ho-V23ZRWrnAVftS.mjs"),t=new e(e=>n(e));return await t.start(),t};export{i as createCompilerWorker};
@@ -1,7 +0,0 @@
1
- /**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.13
3
- *
4
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */
7
- const e={ABS:{s:"Returns the absolute value of a number, a number without its sign",p:{number:{d:"is the real number for which you want the absolute value"}}},AGGREGATE:{s:"Returns information about the cell.",p:{functionNum:{d:"Is the number 1 to 19 that specifies the summary function for the aggregate."},options:{d:"Is the number 0 to 78 that specified the values to ignore for the aggregate."},array:{d:"Is the array or range of numerical data on which to calculate the aggregate."},K:{d:"indicates the position of the array; it is k-th largest, k-th smallest, k-th percentile, or k-th quartile."}},h:"Unimplemented"},ARABIC:{s:"Converts a Roman numeral to Arabic",p:{text:{d:"is the Roman numeral you want to convert"}}},BASE:{s:"Converts a number into a text representation with the given radix (base)",p:{number:{d:"is the number that you want to convert"},radix:{d:"is the base Radix that you want to convert the number into"},minLength:{d:"is the minimum length of the returned string",v:0}}},CEILING:{s:"Rounds a number up, to the nearest multiple of significance",p:{number:{d:"is the value you want to round"},significance:{d:"is the multiple to which you want to round",v:"undefined"}},c:"Compatible"},"CEILING.MATH":{s:"Rounds a number up, to the nearest integer or to the nearest multiple of significance",p:{number:{d:"is the real number you want to round"},significance:{d:"when given and nonzero this function will round away from zero",v:"undefined"},mode:{v:0}}},"CEILING.PRECISE":{s:"Rounds a number up to the nearest integer or to the nearest multiple of significance",p:{number:{d:"is the real number you want to round"},significance:{d:"is the multiple to which you want to round",v:1}},c:"Compatible"},COMBIN:{s:"Returns the number of combinations for a given number of items",p:{number:{d:"is the total number of items"},numberChosen:{d:"is the number of items in each combination"}}},COMBINA:{s:"Returns the number of combinations with repetitions for a given number of items",p:{number:{d:"is the total number of items"},numberChosen:{d:"is the number of items in each combination"}}},DECIMAL:{s:"Converts a text representation of a number in a given base into a decimal number",p:{number:{d:"is the number that you want to convert"},radix:{d:"is the base Radix of the number you are converting"}}},DEGREES:{s:"Converts radians to degrees",p:{angle:{d:"is the angle in radians that you want to convert"}}},EVEN:{s:"Rounds a positive number up and negative number down to the nearest even integer",p:{number:{d:"is the value to round"}}},EXP:{s:"Returns e raised to the power of a given number",p:{number:{d:"is the exponent applied to the base e. The constant e equals 2.71828182845904, the base of the natural logarithm"}}},FACT:{s:"Returns the factorial of a number, equal to 1*2*3*...* Number",p:{number:{d:"is the nonnegative number you want the factorial of"}}},FACTDOUBLE:{s:"Returns the double factorial of a number",p:{number:{d:"is the value for which to return the double factorial"}}},FLOOR:{s:"Rounds a number down to the nearest multiple of significance",p:{number:{d:"is the real number you want to round"},significance:{d:"is the multiple to which you want to round. Number and Significance must either both be positive or both be negative",v:"undefined"}},c:"Compatible"},"FLOOR.MATH":{s:"Rounds a number down, to the nearest integer or to the nearest multiple of significance",p:{number:{d:"is the real number you want to round"},significance:{d:"is the multiple to which you want to round",v:"undefined"},mode:{d:"when given and nonzero this function will round towards zero",v:0}}},"FLOOR.PRECISE":{s:"Rounds a number down to the nearest integer or to the nearest multiple of significance",p:{number:{d:"is the real number you want to round"},significance:{d:"is the multiple to which you want to round",v:1}}},GCD:{s:"Returns the greatest common divisor",p:{number:{d:"number1,number2,... are 1 to 255 values"}}},INT:{s:"Rounds a number down to the nearest integer",p:{number:{d:"is the real number you want to round down to an integer"}}},"ISO.CEILING":{s:"Rounds a number up to the nearest integer",p:{number:{d:"is the real number you want to round up to an integer"},significance:{d:"is the multiple to which you want to round number",v:"undefined"}},c:"Compatible"},LCM:{s:"Returns the least common multiple",p:{number:{d:"number1,number2,... are 1 to 255 values for which you want the least common multiple"}}},LN:{s:"Returns the natural logarithm of a number",p:{number:{d:"is the positive real number for which you want the natural logarithm"}}},LOG:{s:"Returns the logarithm of a number to the base you specify",p:{number:{d:"is the positive real number for which you want the logarithm"},base:{d:"is the base of the logarithm",v:10}}},LOG10:{s:"Returns the base-10 logarithm of a number",p:{number:{d:"is the positive real number for which you want the base-10 logarithm"}}},MDETERM:{s:"Returns the matrix determinant of an array",p:{array:{d:"is a numeric array with an equal number of rows and columns, either a cell range or an array constant"}}},MINVERSE:{s:"Returns the inverse matrix for the matrix stored in an array",p:{array:{d:"is a numeric array with an equal number of rows and columns, either a cell range or an array constant"}}},MMULT:{s:"Returns the matrix product of two arrays, an array with the same number of rows as array1 and columns as array2",p:{array1:{d:"is the first array of numbers to multiply and must have the same number of columns as Array2 has rows"},array2:{d:"is the second array of numbers to multiply and must have the same number of columns as Array1 has rows"}}},MOD:{s:"Returns the remainder after a number is divided by a divisor",p:{number:{d:"is the number for which you want to find the remainder after the division is performed"},divisor:{d:"is the number by which you want to divide Number"}}},MROUND:{s:"Returns a number rounded to the desired multiple",p:{number:{d:"is the value to round"},multiple:{d:"is the multiple to which you want to round number"}}},MULTINOMIAL:{s:"Returns the multinomial of a set of numbers",p:{number:{d:"number1,number2,... are 1 to 255 values for which you want the multinomial"}}},MUNIT:{s:"Returns the unit matrix for the specified dimension",p:{dimension:{d:"is an integer specifying the dimension of the unit matrix that you want to return"}}},ODD:{s:"Rounds a positive number up and negative number down to the nearest odd integer",p:{number:{d:"is the value to round"}}},PI:{s:"Returns the value of Pi, 3.14159265358979, accurate to 15 digits",p:{}},POWER:{s:"Returns the result of a number raised to a power",p:{number:{d:"is the base number, any real number"},power:{d:"is the exponent, to which the base number is raised"}}},PRODUCT:{s:"Multiplies all the numbers given as arguments",p:{number:{d:"number1,number2,... are 1 to 255 numbers, logical values, or text representations of numbers that you want to multiply"}}},QUOTIENT:{s:"Returns the integer portion of a division",p:{numerator:{d:"is the dividend"},denominator:{d:"is the divisor"}}},RADIANS:{s:"Converts degrees to radians",p:{angle:{d:"is an angle in degrees that you want to convert"}}},RAND:{s:"Returns a random number greater than or equal to 0 and less than 1, evenly distributed (changes on recalculation)",p:{}},RANDARRAY:{s:"Returns an array of random numbers",p:{rows:{d:"the number of rows in the returned array",v:1},columns:{d:"the number of columns in the returned array",v:1},min:{d:"the minimum number you would like returned",v:0},max:{d:"the maximum number you would like returned",v:1},integer:{d:"return an integer or a decimal value. TRUE for an integer, FALSE for a decimal number",v:!1}}},RANDBETWEEN:{s:"Returns a random number between the numbers you specify",p:{bottom:{d:"is the smallest integer RANDBETWEEN will return"},top:{d:"is the largest integer RANDBETWEEN will return"}}},ROMAN:{s:"Converts an Arabic numeral to Roman, as text",p:{number:{d:"is the Arabic numeral you want to convert"},form:{d:"is the number specifying the type of Roman numeral you want.",v:0}}},ROUND:{s:"Rounds a number to a specified number of digits",p:{number:{d:"is the number you want to round"},numDigits:{d:"is the number of digits to which you want to round. Negative rounds to the left of the decimal point to the nearest integer"}}},ROUNDDOWN:{s:"Rounds a number down, toward zero",p:{number:{d:"is any real number that you want rounded down"},numDigits:{d:"is the number of digits to which you want to round. Negative rounds to the left of the decimal point to the nearest integer"}}},ROUNDUP:{s:"Rounds a number up, away from zero",p:{number:{d:"is any real number that you want rounded up"},numDigits:{d:"is the number of digits to which you want to round. Negative rounds to the left of the decimal point to the nearest integer"}}},SEQUENCE:{s:"Returns a sequence of numbers",p:{rows:{d:"the number of rows to return"},columns:{d:"the number of columns to return",v:1},start:{d:"the first number in the sequence",v:1},step:{d:"the amount to increment each subsequent value in the sequence",v:1}}},SERIESSUM:{s:"Returns the sum of a power series based on the formula",p:{x:{d:"is the input value to the power series"},n:{d:"is the initial power to which you want to raise x"},m:{d:"is the step by which to increase n for each term in the series"},coefficients:{d:"is a set of coefficients by which each successive power of x is multiplied"}}},SIGN:{s:"Returns the sign of a number: 1 if the number is positive, zero if the number is zero, or -1 if the number is negative",p:{number:{d:"is any real number"}}},SQRT:{s:"Returns the square root of a number",p:{number:{d:"is the number for which you want the square root"}}},SQRTPI:{s:"Returns the square root of (number * Pi)",p:{number:{d:"is the number by which p is multiplied"}}},SUBTOTAL:{s:"Returns a subtotal in a list or database",p:{functionNum:{d:"is the number 1 to 11 that specifies the summary function for the subtotal."},ref:{d:"ref1,ref2,... are 1 to 254 ranges or references for which you want the subtotal"}},h:"Unimplemented"},SUM:{s:"Adds all the numbers in a range of cells",p:{number:{d:"number1,number2,... are 1 to 255 numbers to sum. Logical values and text are ignored in cells, included if typed as arguments"}}},SUMIF:{s:"Adds the cells specified by a given condition or criteria",p:{range:{d:"is the range of cells you want evaluated"},criteria:{d:"is the condition or criteria in the form of a number, expression, or text that defines which cells will be added"},sumRange:{d:"are the actual cells to sum. If omitted, the cells in range are used"}},h:"Unimplemented"},SUMIFS:{s:"Adds the cells specified by a given set of conditions or criteria",p:{sumRange:{d:"are the actual cells to sum."},criteriaRange:{d:"criteria_range1,criteria_range2,... is the range of cells you want evaluated for the particular condition"},criteria:{d:"criteria1,criteria2,... is the condition or criteria in the form of a number, expression, or text that defines which cells will be added"}},h:"Unimplemented"},SUMPRODUCT:{s:"Returns the sum of the products of corresponding ranges or arrays",p:{array1:{d:"array1,array2,... are 2 to 255 arrays for which you want to multiply and then add components. All arrays must have the same dimensions"},rest:{}}},SUMSQ:{s:"Returns the sum of the squares of the arguments. The arguments can be numbers, arrays, names, or references to cells that contain numbers",p:{number:{d:"number1,number2,... are 1 to 255 numbers, arrays, names, or references to arrays for which you want the sum of the squares"}}},SUMX2MY2:{s:"Sums the differences between the squares of two corresponding ranges or arrays",p:{arrayX:{d:"is the first range or array of numbers and can be a number or name, array, or reference that contains numbers"},arrayY:{d:"is the second range or array of numbers and can be a number or name, array, or reference that contains numbers"}}},SUMX2PY2:{s:"Returns the sum total of the sums of squares of numbers in two corresponding ranges or arrays",p:{arrayX:{d:"is the first range or array of numbers and can be a number or name, array, or reference that contains numbers"},arrayY:{d:"is the second range or array of numbers and can be a number or name, array, or reference that contains numbers"}}},SUMXMY2:{s:"Sums the squares of the differences in two corresponding ranges or arrays",p:{arrayX:{d:"is the first range or array of numbers and can be a number or name, array, or reference that contains numbers"},arrayY:{d:"is the second range or array of numbers and can be a number or name, array, or reference that contains numbers"}}},TRUNC:{s:"Truncates a number to an integer by removing the decimal, or fractional, part of the number",p:{number:{d:"is the number you want to truncate"},numDigits:{d:"is a number specifying the precision of the truncation",v:0}}}};export{e as default};
@@ -1,80 +0,0 @@
1
- /**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.13
3
- *
4
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */
7
- let n = class {
8
- constructor(n2) {
9
- this._worker = null, this._nextId = 1, this._pendingRequests = /* @__PURE__ */ new Map(), this._workerFactory = n2;
10
- }
11
- start() {
12
- if (typeof Worker > "u") throw new Error("Web Workers are not supported in this environment.");
13
- return this._worker || (this._worker = this._workerFactory(), this._worker.onmessage = (n2) => {
14
- const { id: e2, result: t2, error: r2 } = n2.data, o2 = this._pendingRequests.get(e2);
15
- if (o2) if (this._pendingRequests.delete(e2), r2) {
16
- const n3 = new Error(r2.message);
17
- n3.stack = r2.stack, r2.cause && (n3.cause = r2.cause), o2.reject(n3);
18
- } else o2.resolve(t2);
19
- }, this._worker.onerror = (n2) => {
20
- console.error("Worker error:", n2), this._pendingRequests.forEach((e2) => {
21
- e2.reject(new Error(`Worker failed: ${n2.message}`));
22
- }), this._pendingRequests.clear(), this._worker = null;
23
- }), Promise.resolve();
24
- }
25
- execute(n2) {
26
- if (!this._worker) throw new Error("Worker is not initialized. Call start() first.");
27
- const e2 = this._nextId++;
28
- return new Promise((t2, r2) => {
29
- this._pendingRequests.set(e2, { resolve: t2, reject: r2 }), this._worker.postMessage({ id: e2, params: n2 });
30
- });
31
- }
32
- terminate() {
33
- this._worker && (this._worker.terminate(), this._worker = null);
34
- }
35
- };
36
- class e {
37
- constructor(n2) {
38
- this._onExecute = n2;
39
- }
40
- execute(n2) {
41
- return this._onExecute(n2);
42
- }
43
- start() {
44
- return Promise.resolve();
45
- }
46
- terminate() {
47
- }
48
- }
49
- const t = '/**\n * @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.4.13\n *\n * (C) 2025-present SheetXL Inc. & Michael T. Ford\n * License: The license can be found at https://www.sheetxl.com/license.\n */\nconst W = { Number: "n", String: "s", Boolean: "b", Error: "e", Null: "z" };\nvar Re, ae, d;\n(ae = Re || (Re = {})).Orientation = { Column: "column", Row: "row" }, ae.Orientations = { ...ae.Orientation, Both: "both" }, ae.Direction = { Up: "up", Down: "down", Left: "left", Right: "right" }, ((e) => {\n e.Code = { Parse: 0, Null: 1, Div0: 2, Value: 3, Ref: 4, Name: 5, Num: 6, NA: 7, GettingData: 8, Spill: 9, Connect: 10, Blocked: 11, Unknown: 12, Field: 13, Calc: 14, Busy: 16, Python: 19, Timeout: 20 }, e.Label = { Parse: "#PARSE!", Null: "#NULL!", Div0: "#DIV/0!", Value: "#VALUE!", Ref: "#REF!", Name: "#NAME?", Num: "#NUM!", NA: "#N/A", GettingData: "#GETTING_DATA", Spill: "#SPILL!", Connect: "#CONNECT!", Blocked: "#BLOCKED!", Unknown: "#UNKNOWN!", Field: "#FIELD!", Calc: "#CALC!", Busy: "#BUSY!", Python: "#PYTHON!", Timeout: "#TIMEOUT!" };\n class t extends Error {\n constructor(c, m, fe, B) {\n super(fe, B), this._label = m, this._code = c, this.details = B;\n }\n static {\n this.code = e.Code.Unknown;\n }\n get isFormulaError() {\n return !0;\n }\n getLabel() {\n return this._label;\n }\n getCode() {\n return this._code;\n }\n equals(c) {\n return !!c && (this._code === c._code || this._code === c.code);\n }\n get [Symbol.toStringTag]() {\n return "[FormulaError]";\n }\n toString() {\n return this.message || this._label;\n }\n }\n e.Known = t;\n class n extends t {\n constructor(c, m) {\n super(e.Code.Parse, e.Label.Parse, c, m);\n }\n static {\n this.code = e.Code.Parse;\n }\n getDetails() {\n const c = this.details;\n return { line: c?.line ?? 1, column: c?.column ?? 1, offset: c?.offset ?? 0, length: c?.length ?? 0 };\n }\n }\n e.Parse = n;\n class r extends t {\n constructor(c, m) {\n super(e.Code.Null, e.Label.Null, c, m);\n }\n static {\n this.code = e.Code.Null;\n }\n }\n e.Null = r;\n class o extends t {\n constructor(c, m) {\n super(e.Code.Div0, e.Label.Div0, c, m);\n }\n static {\n this.code = e.Code.Div0;\n }\n }\n e.Div0 = o;\n class i extends t {\n constructor(c, m) {\n super(e.Code.Value, e.Label.Value, c, m);\n }\n static {\n this.code = e.Code.Value;\n }\n }\n e.Value = i;\n class a extends t {\n constructor(c, m) {\n super(e.Code.Ref, e.Label.Ref, c, m);\n }\n static {\n this.code = e.Code.Ref;\n }\n }\n e.Ref = a;\n class l extends t {\n constructor(c, m) {\n super(e.Code.Name, e.Label.Name, c, m);\n }\n static {\n this.code = e.Code.Name;\n }\n }\n e.Name = l;\n class u extends t {\n constructor(c, m) {\n super(e.Code.Num, e.Label.Num, c, m);\n }\n static {\n this.code = e.Code.Num;\n }\n }\n e.Num = u;\n class f extends t {\n constructor(c, m) {\n super(e.Code.NA, e.Label.NA, c, m);\n }\n static {\n this.code = e.Code.NA;\n }\n }\n e.NA = f;\n class h extends t {\n constructor(c, m) {\n super(e.Code.GettingData, e.Label.GettingData, c, m);\n }\n static {\n this.code = e.Code.GettingData;\n }\n }\n e.GettingData = h;\n class g extends t {\n constructor(c, m) {\n super(e.Code.Spill, e.Label.Spill, c, m);\n }\n static {\n this.code = e.Code.Spill;\n }\n }\n e.Spill = g;\n class p extends t {\n constructor(c, m) {\n super(e.Code.Connect, e.Label.Connect, c, m);\n }\n static {\n this.code = e.Code.Connect;\n }\n }\n e.Connect = p;\n class y extends t {\n constructor(c, m) {\n super(e.Code.Blocked, e.Label.Blocked, c, m);\n }\n static {\n this.code = e.Code.Blocked;\n }\n }\n e.Blocked = y;\n class T extends t {\n constructor(c, m) {\n super(e.Code.Unknown, e.Label.Unknown, c, m);\n }\n static {\n this.code = e.Code.Unknown;\n }\n }\n e.Unknown = T;\n class A extends t {\n constructor(c, m) {\n super(e.Code.Field, e.Label.Field, c, m);\n }\n static {\n this.code = e.Code.Field;\n }\n }\n e.Field = A;\n class D extends t {\n constructor(c, m) {\n super(e.Code.Calc, e.Label.Calc, c, m);\n }\n static {\n this.code = e.Code.Calc;\n }\n }\n e.Calc = D;\n class U extends t {\n constructor(c, m) {\n super(e.Code.Busy, e.Label.Busy, c, m);\n }\n static {\n this.code = e.Code.Busy;\n }\n }\n e.Busy = U;\n class I extends t {\n constructor(c, m) {\n super(e.Code.Python, e.Label.Python, c, m);\n }\n static {\n this.code = e.Code.Python;\n }\n }\n e.Python = I;\n class J extends t {\n constructor(c, m) {\n super(e.Code.Timeout, e.Label.Timeout, c, m);\n }\n static {\n this.code = e.Code.Timeout;\n }\n }\n e.Timeout = J;\n})(d || (d = {}));\nconst _ = {};\n_[d.Code.Parse] = d.Parse, _[d.Code.Null] = d.Null, _[d.Code.Div0] = d.Div0, _[d.Code.Value] = d.Value, _[d.Code.Ref] = d.Ref, _[d.Code.Name] = d.Name, _[d.Code.Num] = d.Num, _[d.Code.NA] = d.NA, _[d.Code.GettingData] = d.GettingData, _[d.Code.Spill] = d.Spill, _[d.Code.Connect] = d.Connect, _[d.Code.Blocked] = d.Blocked, _[d.Code.Unknown] = d.Unknown, _[d.Code.Field] = d.Field, _[d.Code.Calc] = d.Calc, _[d.Code.Busy] = d.Busy, _[d.Code.Python] = d.Python, _[d.Code.Timeout] = d.Timeout;\nconst et = /* @__PURE__ */ new Map(), Te = /* @__PURE__ */ new Map(), tt = /* @__PURE__ */ new Map(), nt = /* @__PURE__ */ new Map(), ke = Object.keys(_);\nfor (let e = 0; e < ke.length; e++) {\n const t = ke[e], n = _[t];\n tt.set(d.Label[t], n), nt.set(d.Code[t], n);\n const r = new n();\n et.set(r.getLabel(), r), Te.set(r.getCode(), r);\n}\nconst Et = Te.get(d.Code.Unknown);\nvar v;\n(v = d || (d = {})).BuiltIn = { Parse: new v.Parse(), Null: new v.Null(), Div0: new v.Div0(), Value: new v.Value(), Ref: new v.Ref(), Name: new v.Name(), Num: new v.Num(), NA: new v.NA(), GettingData: new v.GettingData(), Spill: new v.Spill(), Connect: new v.Connect(), Blocked: new v.Blocked(), Unknown: new v.Unknown(), Field: new v.Field(), Calc: new v.Calc(), Busy: new v.Busy(), Python: new v.Python(), Timeout: new v.Timeout() }, v.getBuiltInByLabel = (e) => et.get(e), v.newTypedError = (e, t, n) => {\n let r;\n return r = typeof e == "string" ? tt.get(e) : nt.get(e), r || (r = v.Unknown), new r(t, n);\n}, v.getBuiltInById = (e) => Te.get(e) || Et;\n/**\n * @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.4.13\n *\n * (C) 2025-present SheetXL Inc. & Michael T. Ford\n * License: The license can be found at https://www.sheetxl.com/license.\n */\nconst S = { html: "text/html", plain: "text/plain", png: "image/png" }, St = Object.freeze({ left: 0, top: 0 }), xt = Object.freeze({ left: 0, top: 0, bottom: 0, right: 0 }), Ct = Object.freeze({ x: 0, y: 0, width: 0, height: 0 });\nObject.freeze(Object.defineProperty({ __proto__: null, EmptyBounds: Ct, EmptyRect: xt, EmptyTopLeft: St }, Symbol.toStringTag, { value: "Module" }));\nconst j = { Column: "column", Row: "row" }, vt = Object.freeze({ colIndex: 0, rowIndex: 0 }), Tt = Object.freeze({ colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 }), rt = (e, t) => e.colStart === t.colStart ? e.rowStart - t.rowStart : e.colStart - t.colStart, ot = (e, t) => e.rowStart === t.rowStart ? e.colStart - t.colStart : e.rowStart - t.rowStart, _t = (e, t) => e.rowEnd === t.rowEnd ? t.colEnd - e.colEnd : t.rowEnd - e.rowEnd, Ot = (e, t) => e.colEnd === t.colEnd ? t.rowEnd - e.rowEnd : t.colEnd - e.colEnd, Le = (e, t) => e.colIndex === t.colIndex ? e.rowIndex - t.rowIndex : e.colIndex - t.colIndex, Ae = (e, t) => e.rowIndex === t.rowIndex ? e.colIndex - t.colIndex : e.rowIndex - t.rowIndex, it = (e = j.Row, t = !1) => t ? e !== j.Column ? _t : Ot : e !== j.Column ? ot : rt, Me = (e, t) => e === t || !(!e || !t) && e.rowIndex === t.rowIndex && e.colIndex === t.colIndex, Se = (e, t) => e === t || !(!e || !t) && e.rowStart === t.rowStart && e.rowEnd === t.rowEnd && e.colStart === t.colStart && e.colEnd === t.colEnd, xe = (e, t) => !(!e || !t) && !(e.colStart > t.colEnd || t.colStart > e.colEnd) && !(e.rowStart > t.rowEnd || t.rowStart > e.rowEnd), je = (e, t) => {\n if (e === t) return !0;\n if (!e || !t || e.length !== t.length) return !1;\n for (let n = 0; n < e.length; n++) if (!Se(e[n], t[n])) return !1;\n return !0;\n}, he = (e, t, n) => {\n if (!e && !t) return null;\n if (!e) return n ? t : { ...t };\n if (!t) return n ? e : { ...e };\n const r = Math.min(e.colStart, t.colStart), o = Math.min(e.rowStart, t.rowStart), i = Math.max(e.colEnd, t.colEnd), a = Math.max(e.rowEnd, t.rowEnd);\n let l = n;\n return l ? (l.colStart = r, l.rowStart = o, l.colEnd = i, l.rowEnd = a) : l = { colStart: r, rowStart: o, colEnd: i, rowEnd: a }, l;\n}, Pe = (e, t) => {\n if (!t || t.length === 0) return e;\n const n = { ...e };\n for (let r = 0; r < t.length; r++) {\n const o = t[r];\n xe(n, o) && (n.rowStart = Math.min(n.rowStart, o.rowStart), n.colStart = Math.min(n.colStart, o.colStart), n.rowEnd = Math.max(n.rowEnd, o.rowEnd), n.colEnd = Math.max(n.colEnd, o.colEnd));\n }\n return n;\n}, It = [null, null], Nt = (e, t, n) => {\n if (e[0].value === e[1].value) return t;\n};\nfunction Fe(e, t = 2, n, r = j.Row, o) {\n let i = [...e];\n if (t <= 0 || e.length <= 1) return i;\n let a = r === j.Column, l = 0, u = !1;\n do {\n const f = i.sort(it(a ? j.Row : j.Column));\n i = [], i.push(f[0]);\n const h = f.length;\n let g = 0, p = f[0], y = p.colStart, T = p.rowStart, A = p.colEnd, D = p.rowEnd;\n for (let U = 1; U < h; U++) {\n const I = f[U];\n let J = !1;\n if (J = a ? p && T === I.rowStart && D === I.rowEnd && A + 1 === I.colStart : p && y === I.colStart && A === I.colEnd && D + 1 === I.rowStart, J) {\n let E = { colStart: y, rowStart: T, colEnd: a ? I.colEnd : A, rowEnd: a ? D : I.rowEnd };\n if (p.value !== void 0 && (E.value = p.value), n) {\n const c = o ?? [null, null];\n c[0] = p, c[1] = I, E = n(c, E, r);\n }\n if (E) {\n i[g] = E, u = !0, p = E, y = p.colStart, T = p.rowStart, A = p.colEnd, D = p.rowEnd;\n continue;\n }\n }\n i[++g] = I, p = I, y = p.colStart, T = p.rowStart, A = p.colEnd, D = p.rowEnd;\n }\n l++, a = !a, l === 1 && (u = !0);\n } while (l < t && u && i.length > 1);\n return i;\n}\nObject.freeze(Object.defineProperty({ __proto__: null, EmptyCell: vt, EmptyRange: Tt, cellToRange: (e, t) => {\n if (!e) return null;\n let n = t;\n return n || (n = { ...e }, delete n.colIndex, delete n.rowIndex), n.colStart = e.colIndex ?? 0, n.rowStart = e.rowIndex ?? 0, n.colEnd = e.colIndex ?? 0, n.rowEnd = e.rowIndex ?? 0, n;\n}, columnFirstCellComparator: Le, columnFirstRangeComparator: rt, createCellComparator: (e = j.Row, t = !1) => t ? e !== j.Column ? (n, r) => n.rowIndex === r.rowIndex ? r.colIndex - n.colIndex : r.rowIndex - n.rowIndex : (n, r) => n.colIndex === r.colIndex ? r.rowIndex - n.rowIndex : r.colIndex - n.colIndex : e !== j.Column ? Ae : Le, createConflatingRanges: (e, t = !1) => {\n const n = [];\n let r, o, i = Number.MIN_SAFE_INTEGER, a = Number.MIN_SAFE_INTEGER;\n return { append: (l, u, f) => {\n let h = !0;\n const g = f !== void 0;\n if (g) {\n const T = e ? e(o, f, t) : o === f ? f : void 0;\n T === void 0 ? h = !1 : f = T;\n }\n if (h && u === a + 1 && l === i) return t ? r.rowEnd = u : r.colEnd = u, a = u, void (o = f);\n r && n.push(r);\n const p = t ? l : u, y = t ? u : l;\n r = { colStart: p, rowStart: y, colEnd: p, rowEnd: y }, g && (r.value = f), i = l, a = u, o = f;\n }, done: (l) => (r && (n.push(r), r = null), l ? Fe(n, 3, l === !0 ? Nt : l, t ? j.Column : j.Row, It) : n) };\n}, createRangeComparator: it, defaultRange: (e, t, n) => e ? n ? (n.colStart = e.colStart ?? t.colStart, n.rowStart = e.rowStart ?? t.rowStart, n.colEnd = e.colEnd ?? t.colEnd, n.rowEnd = e.rowEnd ?? t.rowEnd, n) : { colStart: e.colStart ?? t.colStart, rowStart: e.rowStart ?? t.rowStart, colEnd: e.colEnd ?? t.colEnd, rowEnd: e.rowEnd ?? t.rowEnd } : t, extendRangeToIntersectingRanges: Pe, extendRangeToUnionRanges: (e, t) => {\n if (!t || t.length === 0) return e;\n let n = e, r = null;\n for (; !Se(n, r); ) r = n, n = Pe(r, t);\n return n;\n}, indexOfCoords: (e, t) => {\n const n = { colStart: e.colIndex, rowStart: e.rowIndex, colEnd: e.colIndex, rowEnd: e.rowIndex };\n for (let r = t.length - 1; r >= 0; r--) if (xe(n, t[r])) return r;\n return -1;\n}, intersectRanges: (e, t, n) => {\n if (!e) return n ? t : { ...t };\n if (!t) return n ? e : { ...e };\n if (!e && !t || e.rowStart > t.rowEnd || e.rowEnd < t.rowStart || e.colStart > t.colEnd || e.colEnd < t.colStart) return null;\n const r = Math.max(e.colStart, t.colStart), o = Math.max(e.rowStart, t.rowStart), i = Math.min(e.colEnd, t.colEnd), a = Math.min(e.rowEnd, t.rowEnd);\n let l = n;\n return l ? (l.colStart = r, l.rowStart = o, l.colEnd = i, l.rowEnd = a) : l = { colStart: r, rowStart: o, colEnd: i, rowEnd: a }, l;\n}, isCellWithinRange: (e, t) => !(!e || !t) && !(e.rowIndex < t.rowStart || e.rowIndex > t.rowEnd) && !(e.colIndex < t.colStart || e.colIndex > t.colEnd), isEqualCells: Me, isEqualRanges: Se, isEqualRangesArrays: je, isEqualSelectionCoords: (e, t) => e === t || !(!e || !t) && e.rangeIndex === t.rangeIndex && !!Me(e.cell, t.cell) && je(e.ranges, t.ranges), isRangeWithinRange: (e, t) => !(e.rowStart < t.rowStart || e.rowEnd > t.rowEnd) && !(e.colStart < t.colStart || e.colEnd > t.colEnd), isRangesIntersect: xe, 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: Fe, rowFirstCellComparator: Ae, rowFirstRangeComparator: ot, 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, n = -e.colStart, r) => r ? (r.colStart = e.colStart + n, r.rowStart = e.rowStart + t, r.colEnd = e.colEnd + n, r.rowEnd = e.rowEnd + t, r) : { colStart: e.colStart + n, rowStart: e.rowStart + t, colEnd: e.colEnd + n, rowEnd: e.rowEnd + t }, unionRanges: he, unionRangesArrays: (e, t, n) => {\n if (!e || e.length === 0) return null;\n if (e.length === 1 && !t) return e[0];\n let r = e[0];\n for (let o = 1; o < e.length; o++) r = he(r, e[o], n);\n return t && (r = he(r, t, n)), r;\n} }, Symbol.toStringTag, { value: "Module" }));\nfunction Rt(e) {\n const t = Object.prototype.toString.call(e);\n return t === "[object RegExp]" || t === "[object Date]" || function(n) {\n return n.$$typeof === kt;\n }(e);\n}\nconst kt = typeof Symbol == "function" && Symbol.for ? Symbol.for("react.element") : 60103;\nfunction Lt(e) {\n return /* @__PURE__ */ function(t) {\n return !!t && typeof t == "object";\n }(e) && !Rt(e);\n}\nfunction re(e, t) {\n return t.clone !== !1 && t.isMergeableObject(e) ? Y((n = e, Array.isArray(n) ? [] : {}), e, t) : e;\n var n;\n}\nfunction At(e, t, n) {\n return e.concat(t).map(function(r) {\n return re(r, n);\n });\n}\nfunction De(e) {\n return Object.keys(e).concat(function(t) {\n return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(t).filter(function(n) {\n return Object.propertyIsEnumerable.call(t, n);\n }) : [];\n }(e));\n}\nfunction Ue(e, t) {\n try {\n return t in e;\n } catch {\n return !1;\n }\n}\nfunction Mt(e, t, n) {\n const r = {};\n return n.isMergeableObject(e) && De(e).forEach(function(o) {\n r[o] = re(e[o], n);\n }), De(t).forEach(function(o) {\n (function(i, a) {\n return Ue(i, a) && !(Object.hasOwnProperty.call(i, a) && Object.propertyIsEnumerable.call(i, a));\n })(e, o) || (Ue(e, o) && n.isMergeableObject(t[o]) ? r[o] = function(i, a) {\n if (!a.customMerge) return Y;\n const l = a.customMerge(i);\n return typeof l == "function" ? l : Y;\n }(o, n)(e[o], t[o], n) : r[o] = re(t[o], n));\n }), r;\n}\nfunction Y(e, t, n) {\n (n = n || {}).arrayMerge = n.arrayMerge || At, n.isMergeableObject = n.isMergeableObject || Lt, n.cloneUnlessOtherwiseSpecified = re;\n const r = Array.isArray(t);\n return r === Array.isArray(e) ? r ? n.arrayMerge(e, t, n) : Mt(e, t, n) : re(t, n);\n}\nY.all = function(e, t) {\n if (!Array.isArray(e)) throw new Error("first argument should be an array");\n return e.reduce(function(n, r) {\n return Y(n, r, t);\n }, {});\n};\nconst jt = Object.freeze([]), Pt = Object.freeze({}), Be = (e) => e, de = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {\n let t = 16 * Math.random() | 0;\n return (e === "x" ? t : 3 & t | 8).toString(16);\n}), Ft = (e) => 1 * e, at = (e, t) => e === t || !(!Array.isArray(e) || !Array.isArray(t) || e.length !== t.length) && e.every((n, r) => n === t[r]), ne = (e) => typeof e == "object" && !Array.isArray(e) && e !== null, lt = (e) => typeof e != "object" || Array.isArray(e) || e === null ? e : (Object.keys(e).forEach(function(t) {\n e[t] && typeof e[t] == "object" ? lt(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];\n}), Object.keys(e).length === 0 ? null : e), Dt = (e, t) => !(e !== t && !at(e, t)) || !!e.isEqual?.(t), st = (e, t, n = Dt) => {\n if (e == null || e === t) return null;\n if (!e || typeof e != "object" || Array.isArray(e) || e.isImmutable?.()) return n(e, t) ? null : e;\n const r = Object.keys(e);\n if (r.length === 0) return null;\n let o = !1;\n for (let i = 0; i < r.length; i++) {\n const a = r[i];\n st(e[a], t?.[a], n) === null && (o = !0, delete e[a]);\n }\n return o && Object.keys(e).length === 0 ? null : void 0;\n}, $e = typeof performance == "object" && typeof performance.now == "function" ? () => performance.now() : () => Date.now(), ze = (e) => e == null, Ke = (e, t) => !(t.left > e.right || t.right < e.left || t.top > e.bottom || t.bottom < e.top), Ve = !(typeof window > "u" || !window.document || !window.document.createElement), k = { Windows: "windows", MacOS: "macos", IOS: "ios", Linux: "linux", Android: "android", Safari: "safari", Firefox: "firefox", Node: "node", Unknown: "unknown" }, oe = () => {\n if (ct()) return k.Node;\n const e = globalThis.navigator !== void 0 && globalThis.navigator.userAgent ? globalThis.navigator.userAgent.toLowerCase() : "";\n return e ? /(win32|win64|windows|wince)/i.test(e) ? k.Windows : /(macintosh|macintel|macppc|mac68k|macos)/i.test(e) ? k.MacOS : /(iphone|ipad|ipod)/i.test(e) ? k.IOS : /android/.test(e) ? k.Android : /linux/.test(e) ? k.Linux : /^((?!chrome|android|).)*safari/i.test(e) ? k.Safari : /^((?!chrome|android|Seamonkey).)*firefox/i.test(e) ? k.Firefox : k.Unknown : k.Unknown;\n};\nfunction ct() {\n return typeof process < "u" && process.release?.name === "node" || (typeof process < "u" && process.browser, !1);\n}\nconst qe = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeElement || e?.contains(document.activeElement)), Ut = Object.freeze(Object.defineProperty({ __proto__: null, EmptyArray: jt, EmptyObject: Pt, OSType: k, arrayMove: function(e, t, n) {\n const r = e.slice();\n return r.splice(n < 0 ? r.length + n : n, 0, r.splice(t, 1)[0]), r;\n}, asNumber: (e) => {\n const t = Ft(e);\n return Number.isFinite(t) ? t : 0;\n}, camelToPrettyCase: (e) => e.length === 1 ? e.toUpperCase() : e.replace(/([A-Z])/g, " $1").replace(/^./, function(t) {\n return t.toUpperCase();\n}).trim(), canUseDOM: Ve, cancelTimeout: (e) => {\n cancelAnimationFrame(e.id);\n}, castToString: (e) => e == null || e === void 0 ? "" : typeof e != "string" ? "" + e : e, cloneObject: (e) => ze(e) ? e : JSON.parse(JSON.stringify(e)), consoleWithNoSource: (...e) => new Promise((t) => {\n setTimeout(() => {\n Function("console.log.apply(console, arguments)").apply(null, e), t();\n });\n}), debounce: function(e, t = 300, n = !1) {\n let r, o, i, a, l = 0;\n function u() {\n let h = Date.now() - l;\n h < t && h >= 0 ? r = setTimeout(u, t - h) : (r = null, n || (a = e.apply(i, o), i = o = null));\n }\n t == null && (t = 100);\n const f = function() {\n i = globalThis, o = arguments, l = Date.now();\n var h = n && !r;\n return r || (r = setTimeout(u, t)), h && (a = e.apply(i, o), i = o = null), a;\n };\n return f.clear = function() {\n r && (clearTimeout(r), r = null);\n }, f.flush = function() {\n r && (a = e.apply(i, o), i = o = null, clearTimeout(r), r = null);\n }, f;\n}, deepEqual: function e(t, n) {\n if (t === n) return !0;\n if (t && n && typeof t == "object" && typeof n == "object") {\n if (t.constructor !== n.constructor) return !1;\n let r, o, i;\n if (Array.isArray(t)) {\n if (r = t.length, r != n.length) return !1;\n for (o = r; o-- !== 0; ) if (!e(t[o], n[o])) return !1;\n return !0;\n }\n if (t instanceof Map && n instanceof Map) {\n if (t.size !== n.size) return !1;\n for (o of t.entries()) if (!n.has(o[0])) return !1;\n for (o of t.entries()) if (!e(o[1], n.get(o[0]))) return !1;\n return !0;\n }\n if (t instanceof Set && n instanceof Set) {\n if (t.size !== n.size) return !1;\n for (o of t.entries()) if (!n.has(o[0])) return !1;\n return !0;\n }\n if (ArrayBuffer.isView(t) && ArrayBuffer.isView(n)) {\n if (r = t.length, r != n.length) return !1;\n for (o = r; o-- !== 0; ) if (t[o] !== n[o]) return !1;\n return !0;\n }\n if (t.constructor === RegExp) return t.source === n.source && t.flags === n.flags;\n if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === n.valueOf();\n if (t.toString !== Object.prototype.toString) return t.toString() === n.toString();\n if (i = Object.keys(t), r = i.length, r !== Object.keys(n).length) return !1;\n for (o = r; o-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(n, i[o])) return !1;\n for (o = r; o-- !== 0; ) {\n let a = i[o];\n if ((a !== "_owner" || !t.$$typeof) && !e(t[a], n[a])) return !1;\n }\n return !0;\n }\n return t != t && n != n;\n}, deepFreeze: function e(t) {\n return Object.freeze(t), Object.keys(t).forEach((n) => {\n typeof t[n] != "object" || t[n] === null || Object.isFrozen(t[n]) || e(t[n]);\n }), t;\n}, deepMerge: Y, diffValues: (e, t) => {\n const n = {}, r = Object.keys(t), o = r.length;\n for (let i = 0; i < o; i++) {\n const a = r[i];\n e[a] !== t[a] && (e[a] === void 0 ? n[a] = t[a] : n[a] = e[a]);\n }\n return Object.keys(n).length === 0 ? null : n;\n}, findEqualOrGreater: function(e, t, n = Be) {\n let r = 0, o = e.length - 1;\n for (; r <= o; ) {\n let i = Math.floor((r + o) / 2), a = n(e[i]);\n if (a === t) return i;\n a < t ? r = i + 1 : o = i - 1;\n }\n return r;\n}, findEqualOrLesser: function(e, t, n = Be) {\n let r = e.length - 1, o = 0;\n for (; r >= o; ) {\n let i = Math.floor((r + o) / 2), a = n(e[i]);\n if (a === t) return i;\n a > t ? r = i - 1 : o = i + 1;\n }\n return r;\n}, findNextStep: (e, t = !0, n = 15, r = 10, o = 400) => {\n const i = Math.max(e - r, 0) + (t ? 1 : -1);\n return Math.min(o, Math[t ? "ceil" : "floor"](i / n) * n + r);\n}, getDPI: () => {\n let e = 1;\n return typeof window == "object" && (e = window.devicePixelRatio || 1), e;\n}, getFromPath: (e, t) => {\n const n = t.split(".");\n let r = e;\n for (let o = 0; o < n.length; o++) {\n const i = n[o];\n if (!r) return null;\n let a = r[i];\n if (typeof a == "function" && (a = a.bind(r)()), !a || !ne(a)) return a;\n r = a;\n }\n return r ?? null;\n}, getOS: oe, hasFocus: qe, isDefined: (e) => e != null, isEmpty: (e) => e == null || e === "", isEqualArrays: at, 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) => {\n if (e === t) return !0;\n if (e && !t || t && !e) return !1;\n const n = Object.keys(e);\n if (n.length !== Object.keys(t).length) return !1;\n for (let r = 0; r < n.length; r++) if (e[n[r]] !== t[n[r]]) return !1;\n return !0;\n}, isNode: ct, isNullOrUndefined: ze, isNumeric: (e) => {\n const t = 1 * e;\n return Number.isFinite(t) && typeof t == "number";\n}, isObject: ne, 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: Ke, mergeContentful: (...e) => {\n const t = e.length;\n if (t > 0 && e[t - 1] !== void 0 && !ne(e[t - 1])) return e[t - 1];\n let n = e[0] || {};\n for (let r = 1; r < t; r++) n = Y(n, e[r] || {}, { arrayMerge: (o, i) => [...i] });\n return n;\n}, nextTick: (e) => {\n typeof window < "u" && typeof window.requestAnimationFrame == "function" ? window.requestAnimationFrame(() => {\n e();\n }) : (typeof setImmediate == "function" ? setImmediate : setTimeout)(() => {\n e();\n });\n}, openFileDialog: (e = "*.*") => new Promise((t, n) => {\n if (!Ve) return void n("Unable to open dialog with no dom.");\n const r = document.createElement("input");\n r.type = "file", r.accept = e;\n let o = null, i = !1;\n globalThis.addEventListener?.("focus", () => {\n setTimeout(() => {\n o || i || (i = !0, t(null));\n }, 1e3);\n }, { once: !0, passive: !0 }), r.onchange = () => {\n if (o = r.files[0], o) {\n if (i) return void console.warn("File open detected after faux cancel.", o);\n t(o);\n }\n }, r.autofocus = !0, r.click();\n}), rafThrottle: (e) => {\n let t, n = !1, r = function() {\n n = !1, e(t);\n };\n return function(o) {\n t = o, t && t.persist && t.persist(), n || (n = !0, requestAnimationFrame(r));\n };\n}, removeEmptyProperties: lt, removeEqualValues: st, removeListenerAll: (e) => {\n if (!e) return [];\n for (let t = 0; t < e.length; t++) e[t] && e[t]();\n return [];\n}, requestTimeout: (e, t) => {\n const n = $e(), r = { id: requestAnimationFrame(function o() {\n $e() - n >= t ? e.call(null) : r.id = requestAnimationFrame(o);\n }) };\n return r;\n}, roundAccurately: (e, t = 0) => {\n if (e == null || !isFinite(e)) return null;\n const n = 10 ** t;\n return Number(Math.round(e * n) / n);\n}, setToPath: (e, t, n) => {\n const r = t.split(".");\n let o = e;\n if (!o) throw new Error("Can not set path to a null path.");\n for (let i = 0; o && i < r.length - 1; i++) {\n const a = r[i];\n let l = o[a];\n if (l == null && (l = {}, o[a] = l), !ne(l)) throw new Error("Can not set path to a non object path.");\n o = l;\n }\n if (typeof n != "number" && typeof n != "boolean" && typeof n != "string" && !ne(n)) throw new Error(`Can not set path to ${n} that is not a a supported primitive.`);\n return o[r[r.length - 1]] = n, e;\n}, splitNumber: (e) => {\n let t = Math.abs(e);\n if (isNaN(t) || !isFinite(e)) return null;\n let n = 0 | t, r = t - n, o = 0, i = 0, a = 1;\n if (r > 5e-8) for (; i < 8 && Math.abs(o / a - r) > 5e-8; ) i++, a *= 10, o = Math.round(r * a);\n return { ip: Math.trunc(e), fp: o, ipLength: Math.ceil(Math.log10(n + 1)), fpLength: i };\n}, subtractRect: (e, t, n = !1) => {\n if (!t) return [e];\n if (!Ke(e, t)) return [];\n const r = [];\n let o = e;\n const i = () => {\n t.top > o.top && t.top < o.bottom && (r.push({ ...o, bottom: t.top }), o = { ...o, top: t.top });\n }, a = () => {\n t.bottom > o.top && t.bottom < o.bottom && (r.push({ ...o, top: t.bottom }), o = { ...o, bottom: t.bottom });\n }, l = () => {\n t.right > o.left && t.right < o.right && (r.push({ ...o, left: t.right }), o = { ...o, right: t.right });\n }, u = () => {\n t.left > o.left && t.left < o.right && (r.push({ ...o, right: t.left }), o = { ...o, left: t.left });\n };\n return n ? (u(), l(), i(), a()) : (i(), a(), l(), u()), r;\n}, textToKey: (e) => e.replace(/[^a-zA-Z0-9]/g, "").toLowerCase(), throttle: function(e, t) {\n let n = null;\n return (...r) => {\n const o = Date.now();\n (!n || o - n >= t) && (n = o, e(...r));\n };\n}, toSafeJSON: function e(t) {\n if (t === null || typeof t != "object") return t;\n if (typeof t.toJSON == "function") return t.toJSON();\n if (Array.isArray(t)) return t.map((r) => e(r));\n if (typeof t.toString == "function" && t.toString !== Object.prototype.toString) return t.toString();\n const n = {};\n for (const r in t) t.hasOwnProperty(r) && (n[r] = e(t[r]));\n return n;\n}, transpose: (e) => {\n if (!e) return e;\n const t = e.length, n = e[0].length, r = [];\n for (let o = 0; o < n; o++) r[o] = Array(t);\n for (let o = 0; o < t; o++) for (let i = 0; i < n; i++) r[i][o] = e[o][i];\n return r;\n}, uuidV4: de, validEnumValue: (e, t) => {\n if (!Object.values(e).includes(t)) throw new Error(`Invalid type: ${t ?? "null"}. Must be one of: ${Object.values(t).join(", ")}.`);\n}, whenFocus: async (e, t = !1) => new Promise((n) => {\n qe(e, t) ? n(!0) : e.addEventListener("focusin", () => {\n n(!0);\n }, { once: !0 }), e.focus();\n}) }, Symbol.toStringTag, { value: "Module" }));\nObject.freeze(Object.defineProperty({ __proto__: null, MESSAGE_ERROR_INVALID_ARG: (e) => `Invalid argument: \'${e}\'.` }, Symbol.toStringTag, { value: "Module" }));\nconst ut = (e) => {\n const t = new Uint8Array(e), n = t.byteLength;\n let r = "";\n for (let o = 0; o < n; o++) r += String.fromCharCode(t[o]);\n if (typeof window < "u" && typeof globalThis.btoa == "function") return globalThis.btoa(r);\n if (typeof Buffer < "u") return Buffer.from(r, "binary").toString("base64");\n throw new Error("Unsupported environment");\n}, Ce = (e) => new Promise((t, n) => {\n if (e) if (typeof FileReader < "u") {\n const r = new FileReader();\n r.onload = () => {\n t(r.result);\n }, r.onerror = () => {\n n(r.error);\n }, r.readAsText(e);\n } else if (typeof Buffer < "u") {\n const r = (o) => Buffer.from(o).toString("utf-8");\n e.arrayBuffer().then((o) => {\n t(r(o));\n }).catch((o) => {\n n(o);\n });\n } else n(new Error("Unsupported environment"));\n else t("");\n});\nObject.freeze(Object.defineProperty({ __proto__: null, DEFAULT_MIME_TYPE: "*/*", arrayBufferToBase64: ut, base64ToArrayBuffer: (e) => {\n const t = typeof window < "u" && typeof globalThis.atob == "function" ? globalThis.atob(e) : Buffer.from(e, "base64").toString("binary"), n = t.length, r = new Uint8Array(n);\n for (let o = 0; o < n; o++) r[o] = t.charCodeAt(o);\n return r.buffer;\n}, blobToString: Ce }, Symbol.toStringTag, { value: "Module" }));\nconst dt = "data:image/png;base64,", ft = "Unable to resolve image.", Ge = (e) => new Promise(async (t, n) => {\n let r = null;\n try {\n r = new Image(), r.src = e, r.addEventListener("load", function() {\n t({ width: r.naturalWidth, height: r.naturalHeight });\n }, { once: !0 }), r.addEventListener("error", function() {\n URL.revokeObjectURL(e), n("Invalid Image");\n }, { once: !0 }), await r.decode("sync");\n } catch {\n r?.src && URL.revokeObjectURL(r.src);\n }\n r || n(ft);\n}), we = "image/svg+xml";\nObject.freeze(Object.defineProperty({ __proto__: null, DATA_URL_PNG_PREFIX: dt, getImageDataUrl: (e, t = 1) => new Promise(async (n, r) => {\n let o = null;\n try {\n o = new Image(), o.src = e, o.addEventListener("load", function() {\n try {\n const i = document.createElement("canvas");\n i.width = o.naturalWidth, i.height = o.naturalHeight, i.getContext("2d").drawImage(o, 0, 0);\n const a = i.toDataURL("image/png", t);\n n({ elemImg: o, dataUrl: a });\n } catch (i) {\n URL.revokeObjectURL(e), r(i);\n }\n }, { once: !0 }), o.addEventListener("error", function() {\n URL.revokeObjectURL(e), r("Invalid Image");\n }, { once: !0 }), await o.decode("sync");\n } catch {\n o?.src && URL.revokeObjectURL(o.src);\n }\n o || r(ft);\n}), loadImageDetails: async (e, t = null) => {\n let n = null;\n const r = async () => {\n try {\n const i = t ?? "image/*", a = URL.createObjectURL(new Blob([e], { type: i })), l = await Ge(a);\n n = { mimeType: i, naturalDimensions: l, asUrl: a };\n } catch {\n }\n }, o = async () => {\n try {\n const i = new TextDecoder().decode(e), a = URL.createObjectURL(new Blob([i], { type: we })), l = await Ge(a);\n n = { mimeType: t ?? we, naturalDimensions: l, asUrl: a, asSVGText: i };\n } catch {\n }\n };\n if (t === we ? await o() : t.startsWith("image/") ? await r() : (await r(), n || await o()), !n) throw new Error("Failed to load image");\n return n;\n} }, Symbol.toStringTag, { value: "Module" }));\nvar We, Ye;\n(Ye = We || (We = {})).resolveTypedUpdates = (e, t, n, r) => {\n if (e === null) return e;\n if (e === void 0) return r;\n let o = e;\n if (t?.shorthand) {\n const u = t?.shorthand(e, n);\n u !== void 0 && (o = u);\n }\n if (o !== null && t?.getSubType) {\n const u = t.getSubType(o);\n u && (t = u);\n }\n const i = t?.properties, a = t?.arrayType ?? !1;\n let l = o;\n if (t && t.merge && l && r) l = t.merge(l, r, n);\n else if (!a) {\n if (i) {\n const u = Object.keys({ ...o, ...r });\n l = null;\n for (let f = 0; f < u.length; f++) {\n const h = u[f];\n let g, p = o[h];\n if (p !== void 0) {\n const y = i[h];\n g = y ? (0, Ye.resolveTypedUpdates)(p, y, n, r?.[h]) : p;\n } else g = r?.[h];\n g != null && (l = l ?? {}, l[h] = g);\n }\n }\n }\n return l;\n};\nconst Je = `The Safari browser does not support advanced copy and paste.\nCopy and paste will be limited to within the browser tab.\n\nPlease use Chrome or Edge if external copy and paste is required.`, ye = `You do not have permissions to access the clipboard.\nAll copy and paste operations will be limited to the browser tab.`, pt = { Safari: `The Safari browser does not support advanced copy and paste.\nCopy and paste will be limited to within the browser tab.\n\nPlease use Chrome or Edge if external copy and paste is required.`, Perms: ye, PermsWrite: oe() === k.Safari ? Je : ye, PermsRead: oe() === k.Safari ? Je : ye }, ge = async () => new Promise((e) => {\n document.hasFocus() ? e() : globalThis.addEventListener?.("focus", () => {\n e();\n }, { once: !0 }), document.activeElement.focus?.();\n}), be = async (e, t, n) => {\n if (oe() === k.Safari) return await n(new Error(pt.Safari));\n try {\n const r = async (a) => {\n try {\n return await a();\n } catch (l) {\n if (l.message?.includes("Document is not focused")) return !1;\n throw l;\n }\n }, o = await globalThis?.navigator?.permissions?.query({ name: e, allowWithoutGesture: !0, allowWithoutSanitization: !0 });\n let i = !1;\n if (o.state === "prompt" && (i = await r(t)), i || o.state !== "granted" || (i = await t()), !i) return await n(new Error(o.state));\n } catch (r) {\n return r.message === "No valid data on clipboard" || r.name === "DataError" ? void 0 : await n(r);\n }\n}, mt = async (e) => {\n try {\n return await e.read({ unsanitized: [S.html] });\n } catch {\n }\n return await e.read();\n}, Bt = async (e, t) => {\n if (!e) return null;\n const n = await mt(e);\n let r = !1;\n for (let o = 0; !r && n && o < n.length; o++) if (r = n[o].types.includes(t), r)\n return await n[o].getType(t);\n return r ? void 0 : null;\n};\nif (!globalThis.ClipboardItem) {\n const e = (n, r) => new Blob([r], { type: n });\n class t {\n constructor(r, o) {\n this._items = {}, this._types = Object.keys(r);\n const i = {}, a = Object.keys(r);\n for (let l = 0; l < a.length; l++) {\n const u = a[l];\n let f = r[u];\n i[u] = typeof f == "string" ? e(u, f) : f;\n }\n this._items = i, this._presentationStyle = o?.presentationStyle ?? "unspecified";\n }\n get types() {\n return this._types;\n }\n getType(r) {\n return Promise.resolve(this._items[r]);\n }\n supports(r) {\n return !0;\n }\n }\n globalThis.ClipboardItem = t;\n}\nconst ve = async (e, t = S.html) => new Promise(async (n, r) => {\n try {\n const o = await Bt(e, t);\n if (o) {\n const i = new FileReader();\n i.onload = () => {\n n(i.result);\n }, i.onerror = () => {\n n("");\n }, i.readAsText(o);\n } else n("");\n } catch (o) {\n r(o);\n }\n}), He = async (e, t = S.html) => {\n const n = await ve(e, t);\n if (!n) return null;\n let r = null;\n try {\n r = new DOMParser().parseFromString(n, S.html);\n } catch {\n console.warn("Can\'t parse html from clipboard.");\n }\n return r;\n}, $t = async (e) => {\n e && await e.writeText("");\n}, ie = "clipboard-uuid", Q = "web text/uuid", Xe = (e) => `<div style="display:none" ${ie}="${e}"/>`, zt = (e, t) => {\n let n = null;\n try {\n const r = new DOMParser().parseFromString(t, S.html);\n r.body.firstElementChild.setAttribute(ie, e), n = r.getElementsByTagName("body")[0].innerHTML;\n } catch (r) {\n console.warn("Can\'t embed uuid.", r);\n }\n return n;\n}, Ze = (e, t) => {\n if (!t || !e) return !1;\n try {\n const n = t.querySelectorAll(`[${ie}="${e}"]`);\n if (n && n.length === 1) return !0;\n if (t.querySelector("parsererror")) throw new Error("We are unable to parse node");\n return !1;\n } catch {\n return !1;\n }\n};\nclass Qe {\n constructor(t) {\n if (t?.nativeClipboard === void 0 || t?.nativeClipboard === !0) try {\n this._nativeClipboard = globalThis?.navigator.clipboard;\n } catch {\n t?.nativeClipboard === !0 && console.warn("NativeClipboard option set to true but no native clipboard available.");\n }\n else this._nativeClipboard = t?.nativeClipboard === !1 ? null : t?.nativeClipboard;\n this._disableCheckOnFocus = t?.disableCheckOnFocus ?? !1, this._init();\n }\n async _checkForChanges() {\n this._nativeClipboard && this._state && !this._disableCheckOnFocus && await be("clipboard-read", async () => {\n await ge();\n const t = await ve(this._nativeClipboard, Q);\n if (!this._state || t && t === this._state.uuid) return !0;\n const n = await He(this._nativeClipboard, S.html);\n return !this._state || (Ze(this._state.uuid, n) || this.clear(), !0);\n }, async (t) => {\n t?.message === "denied" || t.message?.includes("Document is not focused") || oe() === k.Safari || console.warn("Unable to detect clipboard changes: ", t);\n });\n }\n _init() {\n const t = this;\n this._listeners = /* @__PURE__ */ new Map(), this._listenersCapture = /* @__PURE__ */ new Map(), this._state = null, this._nativeClipboard && (this._onFocus = () => {\n t._checkForChanges();\n }, this._onBlur = () => {\n globalThis.addEventListener?.("focus", t._onFocus, { once: !0 });\n }, globalThis.addEventListener?.("blur", this._onBlur), this._nativeClipboard.addEventListener("clipboardchange", (n) => {\n t._checkForChanges();\n }));\n }\n async read() {\n if (!this._nativeClipboard) return this._state?.items ?? null;\n const t = this;\n return await be("clipboard-read", async () => {\n if (await ge(), this._state?.uuid) {\n const n = await ve(this._nativeClipboard, Q);\n if (n && n === t._state.uuid) return !0;\n const r = await He(this._nativeClipboard, S.html);\n if (Ze(t._state?.uuid, r)) return !0;\n }\n return t._state = { items: await mt(this._nativeClipboard), uuid: null, ref: null }, this.dispatchEvent(new Event("clipboardread")), !0;\n }, async (n) => {\n this.dispatchEvent(new Event("clipboarderrorread"));\n }), this._state?.items ?? [];\n }\n async write(t) {\n return this._write({ uuid: de(), items: t, ref: null });\n }\n async _write(t) {\n if (!this._nativeClipboard) return this._state = t, this.dispatchEvent(new Event("clipboardwrite")), this.dispatchEvent(new Event("clipboardchange")), null;\n const n = this, r = [], o = t.uuid;\n let i = t.items ?? [];\n const a = () => {\n n._state = { uuid: o, ref: t.ref, items: r }, n.dispatchEvent(new Event("clipboardwrite")), n.dispatchEvent(new Event("clipboardchange"));\n };\n await be("clipboard-write", async () => {\n await ge(), o && i.length === 0 && (i.push(new ClipboardItem({ [Q]: new Blob([o], { type: Q }) })), i.push(new ClipboardItem({ [S.html]: new Blob([Xe(o)], { type: S.html }) })));\n for (let l = 0; l < Math.min(1, i.length); l++) {\n const u = i[l];\n let f = u.types.indexOf(S.html), h = null;\n if (f !== -1) {\n const y = await u.getType(S.html);\n h = await Ce(y), h && (h = zt(o, h));\n }\n if (!h && u.types.includes(S.plain)) {\n const y = await u.getType(S.plain);\n if (y) {\n let T = null;\n typeof y == "string" ? (console.warn("text as string", y), T = y) : T = await Ce(y), T && (h = `<div ${ie}="${o}">${T}</div>`);\n }\n }\n if (!h && u.types.includes(S.png)) {\n const y = await u.getType(S.png), T = ut(await y.arrayBuffer());\n h = `<div ${ie}="${o}"><img src="${dt + T}"/></div>`;\n }\n !h && o && (h = Xe(o));\n const g = new Blob([h ?? ""], { type: S.html }), p = {};\n for (let y = 0; y < u.types.length; y++) {\n const T = u.types[y];\n p[T] = y === f ? g : u.getType(T);\n }\n h && f === -1 && (p[S.html] = g), o && (p[Q] = new Blob([o], { type: Q })), r.push(new ClipboardItem(p));\n }\n try {\n r && r.length !== 0 ? await this._nativeClipboard.write(r) : await $t(this._nativeClipboard);\n } catch (l) {\n l.message?.includes("Document is not focused") || console.warn("Unable to write to native clipboard: ", l);\n }\n return a(), !0;\n }, async (l) => {\n this.dispatchEvent(new Event("clipboarderrorwrite")), a();\n });\n }\n async writeReference(t) {\n if (!t) return void this.clear();\n let n = null;\n const r = {};\n try {\n const i = await t.toText?.() ?? null;\n i && (r[S.plain] = new Blob([i ?? ""], { type: S.plain }));\n } catch (i) {\n n = i;\n }\n try {\n const i = await t.toHtml?.() ?? null;\n i && (r[S.html] = new Blob([i], { type: S.html }));\n } catch (i) {\n n = i, console.warn("export to html", i);\n }\n try {\n const i = await t.toImage?.() ?? null;\n i && (r[S.png] = i);\n } catch (i) {\n n = i, console.warn("export to png", i);\n }\n const o = this._write({ uuid: de(), ref: t, items: Object.keys(r).length > 0 ? [new ClipboardItem(r)] : null });\n if (n) throw n;\n return o;\n }\n clear(t = !1) {\n this._state && (this._state = null, t && this._write({ uuid: null, ref: null, items: null }), this.dispatchEvent(new Event("clipboardwrite")), this.dispatchEvent(new Event("clipboardchange")));\n }\n async readReference() {\n return await this.read(), this._state?.ref ?? null;\n }\n readText() {\n return new Promise(async (t, n) => {\n const r = await this.read();\n let o = null;\n for (let a = 0; !o && r && a < r.length; a++) r[a].types.includes(S.plain) && (o = await r[a].getType(S.plain));\n if (!o) return void t("");\n const i = new FileReader();\n i.onload = () => {\n t(i.result);\n }, i.readAsText(o), i.onerror = (a) => {\n n(a);\n };\n });\n }\n async writeText(t) {\n const n = [new ClipboardItem({ [S.plain]: new Blob([t], { type: S.plain }) })];\n return this._write({ uuid: de(), items: n, ref: null });\n }\n addEventListener(t, n, r = {}) {\n const o = r?.capture ? this._listenersCapture : this._listeners;\n let i = o.get(t);\n i || (i = /* @__PURE__ */ new Map(), o.set(t, i)), i.set(n, typeof r == "boolean" ? {} : r);\n }\n dispatchEvent(t) {\n if (!t) return;\n const n = (r) => {\n const o = r.get(t.type);\n o && o.forEach((i, a) => {\n try {\n typeof a == "function" ? a(t) : a.handleEvent && a.handleEvent(t), i.once && o.delete(a);\n } catch (l) {\n console.warn(l);\n }\n });\n };\n return n(this._listenersCapture), n(this._listeners), !0;\n }\n removeEventListener(t, n, r) {\n const o = r?.capture ? this._listenersCapture : this._listeners, i = o.get(t);\n i && (i.delete(n), i.size === 0 && o.delete(t));\n }\n close() {\n globalThis.removeEventListener?.("focus", this._onFocus), globalThis.removeEventListener?.("blur", this._onBlur);\n }\n}\nvar Ee;\n(Ee = Qe || (Qe = {})).ErrorMessages = pt, Ee.Global = new Ee();\nconst Kt = "__SHEETXL";\nlet ee = null, le = null;\nasync function Vt() {\n if (ee)\n return ee;\n if (le) {\n if (await le, !ee)\n throw new Error("ESBuild initialization promise resolved, but instance is not available.");\n return ee;\n }\n let e, t;\n le = new Promise((n, r) => {\n e = n, t = r;\n });\n try {\n const { initialize: n } = await Promise.resolve().then(function() {\n return nn;\n });\n return ee = await n(), e(), ee;\n } catch (n) {\n throw console.error("Failed to import or initialize esbuild:", n), le = null, t(n), n;\n }\n}\nconst qt = {\n // ESBuild.TsconfigRaw =\n compilerOptions: {\n target: "esnext"\n }\n};\nasync function Gt(e, t, n = "/script.js", r = Kt) {\n try {\n const o = await Vt(), i = "@sheetxl/primitives", a = `\n export const FormulaContext = globalThis.${r}?.FormulaContext;\n export const ScalarType = globalThis.${r}?.ScalarType;\n export const Observable = globalThis.${r}?.Observable;\n export const IRange = globalThis.${r}?.IRange;\n export const FormulaError = globalThis.${r}?.FormulaError;\n // Add more exports as needed\n `, l = {\n // ESBuild.Plugin = {\n name: "sheetxl-esbuild-in-memory",\n setup(f) {\n const h = "sheetxl-" + (/* @__PURE__ */ new Date()).getTime();\n f.onResolve({ filter: new RegExp(`^(${n.replace("/", "\\\\/")}|${i})$`) }, (g) => ({\n path: g.path,\n namespace: h\n })), f.onResolve({ filter: /.*/ }, (g) => {\n if (g.namespace !== h)\n return console.warn(`esbuild: Treating import "${g.path}" as external.`), { path: g.path, external: !0 };\n }), f.onLoad({ filter: /.*/, namespace: h }, (g) => {\n let p;\n if (g.path === n)\n p = t;\n else if (g.path === i)\n p = a;\n else\n return {\n errors: [{ text: `Cannot load unknown path in ${h}: ${g.path}` }]\n };\n return {\n contents: p,\n loader: "ts"\n // leave this as \'ts\' so esbuild generates proper sourcemaps\n };\n });\n }\n }, u = await o.build({\n entryPoints: [n],\n // Use the virtual entry point\n bundle: !0,\n // IMPORTANT: Enable bundling\n write: !1,\n // IMPORTANT: Return result in memory\n format: "esm",\n // Output format\n plugins: [l],\n // TODO - later change to external and prepend when executing from ui\n sourcemap: "inline",\n // Generate separate source map string\n tsconfigRaw: qt,\n // Pass the mapped options\n minify: !0,\n // sourcemap: \'external\', // Generate separate source map string\n // Or use \'inline\' if you prefer data URLs embedded in the code\n // To suppress warnings about dynamic import() if esbuild complains:\n // supported: { \'dynamic-import\': true },\n platform: "neutral"\n // not really needed\n });\n if (u.outputFiles && u.outputFiles.length > 0)\n return u.outputFiles[0].text;\n throw u.errors && u.errors.length > 0 ? new Error(`esbuild bundling failed: ${u.errors.map((f) => f.text).join(`\n`)}`) : new Error("esbuild did not produce an output file.");\n } catch (o) {\n throw console.error("esbuild bundling process failed:", o), o;\n }\n}\nconst Wt = `\n/**\n * Represents the completion of an asynchronous operation\n */\ninterface Promise<T> {\n /**\n * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The\n * resolved value cannot be modified from the callback.\n * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).\n * @returns A Promise for the completion of the callback.\n */\n finally(onfinally?: (() => void) | undefined | null): Promise<T>;\n}\n`, Yt = `\n interface FirstTest {\n isTrue?: boolean;\n }\n`, Jt = async () => Yt, ht = /* @__PURE__ */ new Map([\n ["IReferenceRange", "r"],\n ["IRange", "l"]\n]), wt = /* @__PURE__ */ new Map([\n ["IWorkbook", "workbook"],\n ["ISheet", "sheet"],\n ["ICellRanges", "ranges"],\n ["ICellRange", "range"],\n ["IFormulaContext", "context"]\n]), _e = (e, t) => {\n Array.from(t.keys()).forEach((r) => {\n const o = t.get(r);\n t.set(`${e}.${r}`, o);\n });\n}, Ht = /* @__PURE__ */ new Map([\n ["Scalar", "*"],\n ["FormulaError.Known", W.Error],\n ["Date", "Date"],\n ["JSON", "JSON"]\n]), Xt = /* @__PURE__ */ new Map([\n // Repeating\n]), Oe = "SheetXL";\n_e(Oe, ht);\n_e(Oe, wt);\n_e(Oe, Xt);\nconst Zt = /* @__PURE__ */ new Map([\n ["Promise", () => ({ async: !0 })],\n // [\'PromiseLike\', (): Partial<IFunction.ReturnTypeJSON> => {\n // return { async: true };\n // }],\n ["Observable", () => ({ stream: !0 })]\n]);\nlet se = null;\nasync function Qt() {\n if (se)\n return se;\n try {\n return await (await Promise.resolve().then(function() {\n return on;\n })).initialize();\n } catch (e) {\n throw se = null, e;\n } finally {\n se = null;\n }\n}\nasync function en(e) {\n const t = e?.source ?? null;\n if (!t) return null;\n const n = (e.disableBundle || e.declarationsOnly) ?? !1, r = [\n Jt(),\n //import(\'typescript\'), // when bundled, but node check causes issues. We could bundle replace isNode but felt hacky\n Qt()\n ], o = await Promise.all(r), i = o[0], a = o[1];\n let l = "", u = null;\n const f = [], h = {\n allowJs: !0,\n declaration: !1,\n sourceMap: !1,\n // was true but now bundler will do this\n inlineSourceMap: !1,\n inlineSources: !1,\n isolatedModules: !0,\n preserveConstEnums: !1,\n // types: [\'WebWorker\'],\n module: 99,\n //"esNext",\n noResolve: !0,\n emitDeclarationOnly: !1,\n target: a.ScriptTarget.ES2020\n // lib: [\'webworker\', \'es2020\', \'esnext.asynciterable\'], // Use the webworker lib instead of dom\n }, g = "script", p = `${g}.ts`, y = "lib.d.ts", T = "global.d.ts", A = {\n [p]: t,\n [y]: Wt,\n [T]: i\n }, D = {\n getSourceFile: (s, w, L, P) => a.createSourceFile(s, A[s], a.ScriptTarget.Latest, !0),\n fileExists: (s) => A[s] !== void 0,\n readFile: (s) => A[s],\n writeFile: (s, w) => {\n A[s] = w;\n },\n // not used\n getCurrentDirectory: () => "./",\n getCanonicalFileName: (s) => s,\n useCaseSensitiveFileNames: () => !0,\n getDefaultLibFileName: (s) => y,\n getNewLine: () => `\n`\n }, U = a.createProgram([p, T], h, D), I = U.getTypeChecker(), J = U.getSourceFile(p), E = U.emit();\n E.diagnostics.length > 0 && console.warn(E.diagnostics), l = A[`${g}.js`];\n const c = (s, w, L, P) => {\n if (!s) {\n $(s, new Error(`Type is not defined for \'${w?.name ?? "return"}\'.`));\n return;\n }\n if (s.kind === a.SyntaxKind.NumberKeyword)\n w.scalar = W.Number;\n else if (s.kind === a.SyntaxKind.StringKeyword)\n w.scalar = W.String;\n else if (s.kind === a.SyntaxKind.BooleanKeyword)\n w.scalar = W.Boolean;\n else if (s.kind === a.SyntaxKind.UndefinedKeyword || s.kind === a.SyntaxKind.NullKeyword || s.kind === a.SyntaxKind.VoidKeyword) {\n if (P) {\n $(s, new Error(`\'undefined\' is not a valid type for input: \'${s?.parent?.name?.escapedText}\'.`));\n return;\n }\n w.scalar = W.Null;\n } else if (s.kind === a.SyntaxKind.BigIntKeyword)\n w.scalar = W.Number;\n else if (s.kind === a.SyntaxKind.AnyKeyword)\n w.scalar = W.Null;\n else if (s.kind === a.SyntaxKind.ArrayType) {\n const M = s.elementType;\n if (!M) {\n $(s, new Error(`\'Array\' must be typed: \'${s?.parent?.name?.escapedText}\'.`));\n return;\n }\n w.arrayDepth = (w.arrayDepth ?? 0) + 1, c(M, w, L, P);\n } else if (s.kind !== a.SyntaxKind.TupleType) {\n if (s.kind === a.SyntaxKind.TypeReference) {\n const M = s.typeName?.getText?.() ?? null, K = ht.get(M);\n let V = !1;\n K && (w.range = K, V = !0);\n const q = Ht.get(M);\n if (q && (w.scalar = q), q !== void 0 && (V = !0), P) {\n const R = wt.get(M);\n if (R)\n return R;\n } else {\n const R = Zt.get(M);\n if (R) {\n const b = { ...w, ...R() };\n let N = 0;\n if (b.async && N++, b.stream && N++, N > 1) {\n $(s, new Error(`\'${M}\' cannot have multiple modifiers: \'${s?.parent?.name?.escapedText}\'.`));\n return;\n }\n w = b, V = !0;\n }\n }\n if (!V) {\n $("node", new Error(`\'${M}\' is not a valid type: \'${s?.parent?.name?.escapedText}\'.`));\n return;\n }\n const H = s.typeArguments;\n if (H) {\n if (H.length !== 1) {\n $(s, new Error(`\'${M}\' must be typed with exactly 1 type: \'${s?.parent?.name?.escapedText}\'.`));\n return;\n }\n c(H[0], w, L, P);\n }\n }\n }\n }, m = (s) => (a.getCombinedModifierFlags(s) & a.ModifierFlags.Export) !== 0, fe = (s) => (a.getCombinedModifierFlags(s) & a.ModifierFlags.Default) !== 0, B = [], $ = (s, w) => {\n B.push(w);\n };\n if (a.forEachChild(J, (s) => {\n if (m(s) && a.isFunctionDeclaration(s)) {\n const w = {}, L = {\n parameters: {}\n }, P = s?.name?.getText();\n try {\n w.name = P;\n const K = I.getSymbolAtLocation(s.name).getDocumentationComment(I);\n if (K && K.length > 0 && K[0].text) {\n let R = K[0].text;\n R = R.replace(/[\\r\\n]+/g, "\\\\n").trim(), L.summary = R;\n }\n const V = {};\n c(s.type, V, w, !1), w.returnType = V;\n const q = {};\n fe(s) && (q.default = !0, u = P), Object.keys(q).length > 0 && (w.behavior = q), w.parameters = [];\n const H = /* @__PURE__ */ new Map();\n for (let R = 0; R < s.parameters.length; R++) {\n const b = s.parameters[R], N = {};\n N.name = b.name?.getText();\n const X = c(b.type, N, w, !0);\n if (X) {\n if (w.parameters.length !== 0) {\n const F = s?.parent?.name?.getText();\n $(s, new Error(`\'${w.name}\' contexts must be the first parameter: \'${F}\'.`));\n return;\n }\n w.context = X;\n continue;\n }\n const z = !((b.initializer === void 0 || b.initializer === null) && (b.questionToken === void 0 || b.questionToken === null));\n let C;\n if (z && (N.optional = !0, b.initializer))\n try {\n b.initializer.kind === a.SyntaxKind.StringLiteral ? C = b.initializer.text : b.initializer.kind === a.SyntaxKind.NumericLiteral ? C = parseFloat(b.initializer.text) : b.initializer.kind === a.SyntaxKind.TrueKeyword || b.initializer.kind === a.SyntaxKind.FalseKeyword ? C = b.initializer.kind === a.SyntaxKind.TrueKeyword : b.initializer.kind === a.SyntaxKind.NullKeyword ? C = null : b.initializer.kind === a.SyntaxKind.ObjectLiteralExpression || b.initializer.kind === a.SyntaxKind.ArrayLiteralExpression ? C = b.initializer.getText() : C = b.initializer.getText?.();\n } catch (O) {\n console.warn(`Couldn\'t extract default value for parameter \'${N.name}\'`, O);\n }\n b.dotDotDotToken && (N.rest = !0), w.parameters.push(N);\n const x = { description: "" };\n L.parameters[N.name] = x;\n const G = I.getSymbolAtLocation(b.name).getDocumentationComment(I);\n G && G.length > 0 && G[0].text && (x.description = G[0].text), C !== void 0 && (x.defaultValue = C), H.set(N.name, N);\n }\n if (s.jsDoc && s.jsDoc.length > 0) {\n const R = s.jsDoc;\n for (let b = 0; b < R.length; b++) {\n const N = R[b]?.tags;\n if (N)\n for (let X = 0; X < N.length; X++) {\n const z = N[X];\n let C = z?.tagName?.text;\n if (!C) continue;\n C = C.toLowerCase();\n let x = z.comment;\n const G = C === "hidden";\n if (!(typeof x != "string" && !G) && (typeof x == "string" && (x = x.replace(/[\\r\\n]+/g, "\\\\n").trim()), !(!G && x && (x = x.split(/\\\\n/)[0], !x || x.length === 0)))) {\n if (x && typeof x == "string") {\n const O = /\\{@link(code|plain)?\\s+([^}|]+)(?:\\s*\\|\\s*([^}]+))?\\}/g;\n let F, Z = x, te = [];\n for (; (F = O.exec(x)) !== null; ) {\n const [pe, me, gt, Ne] = F, bt = [gt.trim()];\n Ne && bt.push(Ne.trim());\n }\n x = Z, te.length > 0 && C === "see" && (L.links || (L.links = []), L.links.push(...te));\n }\n if (C === "name") {\n const O = x;\n O !== P && (L.name = O);\n } else if (C === "description") {\n const O = x;\n } else if (C === "summary") {\n const O = x;\n O && (L.summary = O);\n } else if (C === "param") {\n const O = z.name?.text, F = H.get(O);\n if (!F) {\n B.push(new Error(`Parameter \'${O}\' not found in function \'${P}\'.`));\n continue;\n }\n if (z.typeExpression && z.typeExpression.type)\n try {\n const Z = z.typeExpression.type;\n if (Z.kind === a.SyntaxKind.UnionType) {\n const te = [];\n F.enums = te, Z.types.forEach((pe) => {\n if (pe.kind === a.SyntaxKind.LiteralType) {\n const me = pe.literal.text;\n me && te.push(me);\n }\n });\n }\n } catch (Z) {\n console.warn("Error parsing JSDoc type expression:", Z);\n }\n } else if (C === "returns" || C === "return")\n w.returnType.description = x;\n else if (C === "category")\n L.category = x;\n else if (C === "hidden") {\n let O = !0;\n const F = x?.toLowerCase();\n F === "false" ? O = !1 : F !== "true" && (O = x), O !== !1 && (L.hidden = O ?? !0);\n }\n }\n }\n }\n }\n Object.keys(w.returnType).length === 0 && delete w.returnType, f.push([w, L]);\n } catch (M) {\n $(s, new Error(`\'${P}\': ${M.message}`));\n }\n }\n }), B.length > 0)\n throw console.warn(B), new Error("There were compilation errors.", { cause: B });\n if (f.length === 0)\n throw new Error("No exported functions.");\n const yt = `${Ut.uuidV4()}-script`;\n try {\n !n && B.length === 0 && (l = await Gt(a, l, g));\n } catch {\n console.warn("Error bundling script");\n }\n const Ie = {\n functions: f,\n commitId: yt,\n source: t,\n name: "Script",\n language: "typescript",\n // default\n compiled: l\n };\n return u && (Ie.autoRun = u), Ie;\n}\nself.addEventListener("message", async (e) => {\n const { id: t, params: n } = e.data;\n try {\n const r = await en(n);\n self.postMessage({ id: t, result: r, error: null });\n } catch (r) {\n self.postMessage({\n id: t,\n result: null,\n error: {\n message: r.message,\n stack: r.stack,\n cause: r.cause\n }\n });\n }\n});\nlet ce = null;\nasync function tn() {\n return ce || (ce = new Promise(async (e, t) => {\n try {\n const n = "0.20.2", r = `https://esm.sh/esbuild-wasm@${n}`, o = `https://esm.sh/esbuild-wasm@${n}/esbuild.wasm`, a = (await import(\n /* webpackIgnore: true */\n /* @vite-ignore */\n r\n )).default;\n await a.initialize({\n wasmURL: o,\n // Provide the specific WASM URL\n worker: !1\n // Keep processing on the current thread\n }), e(a);\n } catch (n) {\n console.error("Error initializing esbuild:", n), t(n);\n }\n }), ce);\n}\nvar nn = /* @__PURE__ */ Object.freeze({\n __proto__: null,\n initialize: tn\n});\nlet ue = null;\nasync function rn() {\n return ue || (ue = new Promise(async (e, t) => {\n let n = null;\n try {\n n = await import("https://esm.sh/typescript@5.7.2");\n } catch (r) {\n console.error("Error initializing Browser TypeScript module:", r);\n }\n n || console.log("use script fallback"), e(n);\n }), ue);\n}\nvar on = /* @__PURE__ */ Object.freeze({\n __proto__: null,\n initialize: rn\n});\n', r = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", t], { type: "text/javascript;charset=utf-8" });
50
- function o(n2) {
51
- let e2;
52
- try {
53
- if (e2 = r && (self.URL || self.webkitURL).createObjectURL(r), !e2) throw "";
54
- const t2 = new Worker(e2, { type: "module", name: n2?.name });
55
- return t2.addEventListener("error", () => {
56
- (self.URL || self.webkitURL).revokeObjectURL(e2);
57
- }), t2;
58
- } catch {
59
- return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(t), { type: "module", name: n2?.name });
60
- }
61
- }
62
- async function i() {
63
- if (typeof process < "u" && process.versions?.node && typeof Worker > "u") return await a();
64
- if (typeof Worker < "u") {
65
- const e2 = new n(() => new o());
66
- try {
67
- return await e2.start(), e2;
68
- } catch (n2) {
69
- console.error("Failed to start TypescriptCompiler worker reverting to fallback:", n2);
70
- }
71
- }
72
- return await a();
73
- }
74
- const a = async () => {
75
- const { compileModule: n2 } = await import("./DHJoU9KsVtSXERyd.mjs"), t2 = new e((e2) => n2(e2));
76
- return await t2.start(), t2;
77
- };
78
- export {
79
- i as createCompilerWorker
80
- };