@sheetxl/sdk 0.4.11 → 0.4.12

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 (102) hide show
  1. package/browser/cjs/{B_NhkERIkAJotIbp.cjs → 39ybckEYrSwofEL8.cjs} +1 -1
  2. package/browser/cjs/{DNv6ybWP5Fldgc2s.cjs → 7F9Y23ZviM83MrLB.cjs} +1 -1
  3. package/browser/cjs/{C06jNASkAfV7kAJt.cjs → 9OWmR6t6tmtR3HKs.cjs} +1 -1
  4. package/browser/cjs/{DDRgvBqROJxESdD7.cjs → AoftwE84s7sGV4YJ.cjs} +1 -1
  5. package/browser/cjs/{1aBi7EjSv7rlHImN.cjs → BJZM9I81r8nRPehZ.cjs} +2 -2
  6. package/browser/cjs/{Cv7d06asyk54h4qg.cjs → BLHJddfDq44WHNs6.cjs} +1 -1
  7. package/browser/cjs/{DHpCAbHLYqvLP0Z6.cjs → BdbcopQNFs0VAYoZ.cjs} +2 -2
  8. package/browser/cjs/{Bo-zjba28_CWMlTu.cjs → C2McR1ZSNpfPMaI1.cjs} +1 -1
  9. package/browser/cjs/{36TOhwWf_rpUol3H.cjs → CAC1euA3bA1IpMhZ.cjs} +1 -1
  10. package/browser/cjs/{2nOrVMTAGGx_9TGL.cjs → CDwPpmyZAYF_aBaX.cjs} +1 -1
  11. package/browser/cjs/{CMCnH7IuCm_auikF.cjs → CP2yuwDM2Fzm2bQy.cjs} +2 -2
  12. package/browser/cjs/{CVXGzVLWLx2CJQm9.cjs → CSn-hMrEUwFcYpBT.cjs} +3 -3
  13. package/browser/cjs/{ZJKVquWhB5WR-iPJ.cjs → CeuXJMoeKjSnby5j.cjs} +1 -1
  14. package/browser/cjs/{uyHKBD07R0GGZXep.cjs → Ch5W6IQIqcVy3CUV.cjs} +1 -1
  15. package/browser/cjs/{CaFJIY4BbuoM7WDD.cjs → CtaH9jllSQmzD2AZ.cjs} +2 -2
  16. package/browser/cjs/{2U_vaFrfcRohWzeU.cjs → Ctw9E_2VE0l2P6Yk.cjs} +1 -1
  17. package/browser/cjs/{Dl3IO1DS4B5jgpKI.cjs → Czl-z-_3jRiufzFq.cjs} +2 -2
  18. package/browser/cjs/{kyw6u7fpNVXpqgsI.cjs → D-HLMUqMDuHV5fFD.cjs} +1 -1
  19. package/browser/cjs/{trblZTDJ1nAz0rWR.cjs → D5pK8FbUHJmgHMVR.cjs} +1 -1
  20. package/browser/cjs/{BEsz-1T9Bb9AaMYL.cjs → DA7BmT8kgTnFcBps.cjs} +1 -1
  21. package/browser/cjs/{BdTk8Nhw8G_OzMbe.cjs → DBBaD9qGTCHmDZzt.cjs} +1 -1
  22. package/browser/cjs/{BAsFktGxZpUGmZLe.cjs → DD24B_zQQtT3iqLe.cjs} +1 -1
  23. package/browser/cjs/{Ch3tbUYQx16tKF7k.cjs → DKwnqzohEhfP9-D8.cjs} +1 -1
  24. package/browser/cjs/{ZcKbNkAX98aqbRl3.cjs → DO-igV-beWuURc9q.cjs} +1 -1
  25. package/browser/cjs/{B73Zu8_s9vFWOh_O.cjs → DR2yNdWmKOx4XEn_.cjs} +2 -2
  26. package/browser/cjs/{7sNFPxy75NuqCDQh.cjs → D_PNelhiuhC_pYQe.cjs} +1 -1
  27. package/browser/cjs/{CcEyzUYgzJ50PUJe.cjs → Dg4inQb_qTGcwKWj.cjs} +1 -1
  28. package/browser/cjs/{Yi2_Rw5GDVzd_VxU.cjs → KlMBkdsOI1TbINZi.cjs} +1 -1
  29. package/browser/cjs/{DtBxSbHruNTMTsh-.cjs → Me1cXPMFZnMqu9Ni.cjs} +3 -3
  30. package/browser/cjs/{nQY-7MdNrbTu3EmK.cjs → P1V-5yUNwU9r5yLw.cjs} +1 -1
  31. package/browser/cjs/{C9wOzvC_v6DonctC.cjs → Vkjfeba56sx1eWi0.cjs} +1 -1
  32. package/browser/cjs/{EU56rWjRMrkea9af.cjs → dwUVhGNDSgZfRm3P.cjs} +1 -1
  33. package/browser/cjs/index.cjs +2 -2
  34. package/browser/cjs/{5zykq8Nm9_DGD2DJ.cjs → txLIAZHRWIU9kf0I.cjs} +1 -1
  35. package/browser/esm/{PVTl6mvmxvLJIzh9.mjs → 30SRICLt1PAxlGS8.mjs} +1 -1
  36. package/browser/esm/{CM_TdYA35a4ZBdwx.mjs → 9jeiH8SVL_ZJYLxo.mjs} +1 -1
  37. package/browser/esm/{C-CL0OoNkb1zC70z.mjs → B-xoX7KIAUytU1_U.mjs} +1 -1
  38. package/browser/esm/{Dk8xANVVmSj4hMfy.mjs → B_bzVKesE_JRp6EW.mjs} +1 -1
  39. package/browser/esm/{CK55N2ZgYHqyYvC2.mjs → BbO1W_XgpJnqTSty.mjs} +1 -1
  40. package/browser/esm/{COIpRrbH0PIAxGAv.mjs → BngRU84kl6oeKeYG.mjs} +1 -1
  41. package/browser/esm/{BQCIUvZDEabV77HK.mjs → BuJVzVii6s-ETLFo.mjs} +2 -2
  42. package/browser/esm/{DTfK5ukJi2A2cG4a.mjs → ByHA0yF73W3Lubv1.mjs} +3 -3
  43. package/browser/esm/{1RkwhM87R80gyTMd.mjs → C9XmeyBj3CidGuuQ.mjs} +2 -2
  44. package/browser/esm/{DkBcYI5GMfGWjMpw.mjs → CGlSMtRCaIAn2kcK.mjs} +1 -1
  45. package/browser/esm/{ChEVz9V1woVRX6WL.mjs → CNZEHpuUipSLJnir.mjs} +1 -1
  46. package/browser/esm/{Du5u3LhdTaqIps_D.mjs → CUDgLpRqpHPjfaCi.mjs} +1 -1
  47. package/browser/esm/{BsDRByzxyMQ1n9k6.mjs → ChB6ZgoNr49oUuh9.mjs} +2 -2
  48. package/browser/esm/{CuVRE_tWXcHiZiqD.mjs → D0HYMuygnYvY7Atx.mjs} +1 -1
  49. package/browser/esm/{BVi-ZLSVMKE-zvx4.mjs → D1PWaFTHEZfGGXTb.mjs} +1 -1
  50. package/browser/esm/{BuUARF4geX1QlFaV.mjs → D2zmZcBdOoyixeUA.mjs} +1 -1
  51. package/browser/esm/{BHc7eG4nZizeMBb5.mjs → D525g_2eyexUf3Zf.mjs} +1 -1
  52. package/browser/esm/{iKCrpPPbOnKlkUDb.mjs → DMJw8DmfeX6u2glN.mjs} +1 -1
  53. package/browser/esm/{BO0ncqgpx-62w_oX.mjs → DfHQEyIlLlv5P49Q.mjs} +2 -2
  54. package/browser/esm/{Y5czqevaHtgUcl4L.mjs → Dhvtq8jHg8BxOR0C.mjs} +1 -1
  55. package/browser/esm/{s7QvhDE2kJkgBcZ8.mjs → DkPPc6PpShDjAHJV.mjs} +1 -1
  56. package/browser/esm/{5w39mZuW-sWnmmdV.mjs → DqEqprkW8poZvfjh.mjs} +1 -1
  57. package/browser/esm/{DoolQNF8KdKfxJym.mjs → DtSj65a0yyYL8HUw.mjs} +1 -1
  58. package/browser/esm/{DCgtfzoZVReua9he.mjs → Dw0Okzcg5hIcHUcc.mjs} +1 -1
  59. package/browser/esm/{CW0tmrVd5h3U4RZa.mjs → Dzo7yK5H2NRkocTa.mjs} +1 -1
  60. package/browser/esm/{Bv47rNz3qnYylQjD.mjs → G_2bOLOa20d7iobX.mjs} +1 -1
  61. package/browser/esm/{B9JgD2n0XcFJj3bo.mjs → MRXgg6FvbB08Ze4M.mjs} +2 -2
  62. package/browser/esm/{A8C5de6v1CBMgJZq.mjs → SePiM6uWrcY09dym.mjs} +1 -1
  63. package/browser/esm/{BEs22-ynP5XGO3w2.mjs → eCZnrKI7SxPgdErZ.mjs} +2 -2
  64. package/browser/esm/index.mjs +2 -2
  65. package/browser/esm/{CV82qaLuZfxcBBSy.mjs → nE8H93zlwoi3F8Ii.mjs} +3 -3
  66. package/browser/esm/{DS7nkzMuzXOAIPF2.mjs → ui3SG2ZyuCKIR0An.mjs} +1 -1
  67. package/browser/esm/{DyvAZkeumXN8GHi4.mjs → vk7TdrD0zPqtT8_n.mjs} +1 -1
  68. package/browser/esm/{lfu13YaazVLqtmeU.mjs → yM_d2jrPPN_EupI0.mjs} +1 -1
  69. package/licenses/dependencies.txt +3 -3
  70. package/node/esm/{DSPiPnJGbhnNKLaY.mjs → BJvhZja9zXr81ch6.mjs} +1 -1
  71. package/node/esm/{QvMgUimFvzdL6-mo.mjs → BK_7sJa3fTDIKVsK.mjs} +2 -2
  72. package/node/esm/{D90o-RTQ6VATF0Rk.mjs → BPhIhbwKpbuhJ5n5.mjs} +1 -1
  73. package/node/esm/{p6tOM2g4fibuTbKy.mjs → BQb_TIMVKb4ap8qn.mjs} +1 -1
  74. package/node/esm/{C9U5rfU-8XoDc_V8.mjs → BW1-l-HQdvRTQ7Bm.mjs} +4 -4
  75. package/node/esm/{DLdBwr1RlyAhJCV0.mjs → Bkj8joA7ej1p4iQv.mjs} +1 -1
  76. package/node/esm/{CFWQqFvDJMGXn8Qq.mjs → BnQS3_N8ZEyMLfgn.mjs} +1 -1
  77. package/node/esm/{Ck1Jwm7rnsCLVeO1.mjs → Bs1vmYEblngyWvkW.mjs} +1 -1
  78. package/node/esm/{sroYp2c6WrIr_3vO.mjs → BtDgmaUXSuZwZauR.mjs} +2 -2
  79. package/node/esm/{KATYAmh0NIiQ-uaD.mjs → C2nQBB-2yJ1qfKsG.mjs} +1 -1
  80. package/node/esm/{BmYqJNOwK3UJW3Xe.mjs → CEBBIejO4nn_eoLE.mjs} +1 -1
  81. package/node/esm/{uUNVoKRRBhW28hYx.mjs → CEBaRGnJ6Pau61Z3.mjs} +1 -1
  82. package/node/esm/{VINTYbFQolKKX9Cn.mjs → CSr4e1I9DtTv2w79.mjs} +1 -1
  83. package/node/esm/{3LAM4nbl-SF93GnL.mjs → CWUmgm7_b5VypIPN.mjs} +3 -3
  84. package/node/esm/{jqWzWUQAPXE6S4pP.mjs → Cb2A-sSxQbrq7_st.mjs} +1 -1
  85. package/node/esm/{BMXFtr-jXZGBZS1-.mjs → CfSD4cLmkg0FqnhQ.mjs} +1 -1
  86. package/node/esm/{CW0oFlrKt5Uj6nuK.mjs → ChgW0mo5gCgLQ4qn.mjs} +1 -1
  87. package/node/esm/{JIc401vM9srbtF9d.mjs → Cl6j-EVdzk8MvmYu.mjs} +1 -1
  88. package/node/esm/{D8Hpg5A5WcmsFCPu.mjs → Cvzp8bwJnKvjvZSp.mjs} +1 -1
  89. package/node/esm/{CFsZ2V-cxUHf5_Sy.mjs → D-7D30G3TPv5yZHW.mjs} +1 -1
  90. package/node/esm/{COCgGLfPgG-NG4Ei.mjs → DPWAK-dKa7BGHzhV.mjs} +1 -1
  91. package/node/esm/{CnhQwEj214g59Jgw.mjs → DaA9EfLaa4eAL5v5.mjs} +1 -1
  92. package/node/esm/{DbLo1yZBy3dKaDrf.mjs → DdQQdRO6WRU-o7fW.mjs} +1 -1
  93. package/node/esm/{DpmEPBmhU3gneOpb.mjs → DqzaLjnlgJ73P6fj.mjs} +1 -1
  94. package/node/esm/{DUlT61b-CgdPCdu7.mjs → KTvP9pq_hIePsIcs.mjs} +1 -1
  95. package/node/esm/{DRM7eoEZII5c6Rbr.mjs → R6sbyZ3F8U46a2pT.mjs} +1 -1
  96. package/node/esm/{Cuk6l5jbAp5qG99L.mjs → RjYTditNvvkkhvec.mjs} +1 -1
  97. package/node/esm/{DWlgrg4IlFnKTR6y.mjs → Ru2U-PXJ-wtFJVIi.mjs} +1 -1
  98. package/node/esm/{CfeR1dXEw7Hep352.mjs → _50UNzbNjsJJ5JeA.mjs} +1 -1
  99. package/node/esm/{Cn1RL1hYSYnF25uZ.mjs → ebMdiumtVWrujqaH.mjs} +1 -1
  100. package/node/esm/index.mjs +7 -7
  101. package/node/esm/{CXrQQnxTwsX0wNvN.mjs → wYdBXNtyuqNnNqw7.mjs} +2 -2
  102. package/package.json +4 -4
@@ -1,7 +1,7 @@
1
1
  /**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.11
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.12
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
6
  */
7
- import{$ as e}from"./B9JgD2n0XcFJj3bo.mjs";var t,n,o;(n=t||(t={})).Orientation={Column:"column",Row:"row"},n.Orientations={...n.Orientation,Both:"both"},n.Direction={Up:"up",Down:"down",Left:"left",Right:"right"},(e=>{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!"};class t extends Error{constructor(e,t,n,o){super(n,o),this._label=t,this._code=e,this.details=o}static{this.code=e.Code.Unknown}get isFormulaError(){return!0}getLabel(){return this._label}getCode(){return this._code}equals(e){return!!e&&(this._code===e._code||this._code===e.code)}get[Symbol.toStringTag](){return"[FormulaError]"}toString(){return this.message||this._label}}e.Known=t;class n extends t{constructor(t,n){super(e.Code.Parse,e.Label.Parse,t,n)}static{this.code=e.Code.Parse}getDetails(){const e=this.details;return{line:e?.line??1,column:e?.column??1,offset:e?.offset??0,length:e?.length??0}}}e.Parse=n;class o extends t{constructor(t,n){super(e.Code.Null,e.Label.Null,t,n)}static{this.code=e.Code.Null}}e.Null=o;class i extends t{constructor(t,n){super(e.Code.Div0,e.Label.Div0,t,n)}static{this.code=e.Code.Div0}}e.Div0=i;class r extends t{constructor(t,n){super(e.Code.Value,e.Label.Value,t,n)}static{this.code=e.Code.Value}}e.Value=r;class a extends t{constructor(t,n){super(e.Code.Ref,e.Label.Ref,t,n)}static{this.code=e.Code.Ref}}e.Ref=a;class s extends t{constructor(t,n){super(e.Code.Name,e.Label.Name,t,n)}static{this.code=e.Code.Name}}e.Name=s;class l extends t{constructor(t,n){super(e.Code.Num,e.Label.Num,t,n)}static{this.code=e.Code.Num}}e.Num=l;class c extends t{constructor(t,n){super(e.Code.NA,e.Label.NA,t,n)}static{this.code=e.Code.NA}}e.NA=c;class d extends t{constructor(t,n){super(e.Code.GettingData,e.Label.GettingData,t,n)}static{this.code=e.Code.GettingData}}e.GettingData=d;class u extends t{constructor(t,n){super(e.Code.Spill,e.Label.Spill,t,n)}static{this.code=e.Code.Spill}}e.Spill=u;class p extends t{constructor(t,n){super(e.Code.Connect,e.Label.Connect,t,n)}static{this.code=e.Code.Connect}}e.Connect=p;class m extends t{constructor(t,n){super(e.Code.Blocked,e.Label.Blocked,t,n)}static{this.code=e.Code.Blocked}}e.Blocked=m;class y extends t{constructor(t,n){super(e.Code.Unknown,e.Label.Unknown,t,n)}static{this.code=e.Code.Unknown}}e.Unknown=y;class f extends t{constructor(t,n){super(e.Code.Field,e.Label.Field,t,n)}static{this.code=e.Code.Field}}e.Field=f;class h extends t{constructor(t,n){super(e.Code.Calc,e.Label.Calc,t,n)}static{this.code=e.Code.Calc}}e.Calc=h;class g extends t{constructor(t,n){super(e.Code.Busy,e.Label.Busy,t,n)}static{this.code=e.Code.Busy}}e.Busy=g;class w extends t{constructor(t,n){super(e.Code.Python,e.Label.Python,t,n)}static{this.code=e.Code.Python}}e.Python=w;class C extends t{constructor(t,n){super(e.Code.Timeout,e.Label.Timeout,t,n)}static{this.code=e.Code.Timeout}}e.Timeout=C})(o||(o={}));const i={};i[o.Code.Parse]=o.Parse,i[o.Code.Null]=o.Null,i[o.Code.Div0]=o.Div0,i[o.Code.Value]=o.Value,i[o.Code.Ref]=o.Ref,i[o.Code.Name]=o.Name,i[o.Code.Num]=o.Num,i[o.Code.NA]=o.NA,i[o.Code.GettingData]=o.GettingData,i[o.Code.Spill]=o.Spill,i[o.Code.Connect]=o.Connect,i[o.Code.Blocked]=o.Blocked,i[o.Code.Unknown]=o.Unknown,i[o.Code.Field]=o.Field,i[o.Code.Calc]=o.Calc,i[o.Code.Busy]=o.Busy,i[o.Code.Python]=o.Python,i[o.Code.Timeout]=o.Timeout;const r=new Map,a=new Map,s=new Map,l=new Map,c=Object.keys(i);for(let e=0;e<c.length;e++){const t=c[e],n=i[t];s.set(o.Label[t],n),l.set(o.Code[t],n);const d=new n;r.set(d.getLabel(),d),a.set(d.getCode(),d)}const d=a.get(o.Code.Unknown);var u;(u=o||(o={})).BuiltIn={Parse:new u.Parse,Null:new u.Null,Div0:new u.Div0,Value:new u.Value,Ref:new u.Ref,Name:new u.Name,Num:new u.Num,NA:new u.NA,GettingData:new u.GettingData,Spill:new u.Spill,Connect:new u.Connect,Blocked:new u.Blocked,Unknown:new u.Unknown,Field:new u.Field,Calc:new u.Calc,Busy:new u.Busy,Python:new u.Python,Timeout:new u.Timeout},u.getBuiltInByLabel=e=>r.get(e),u.newTypedError=(e,t,n)=>{let o;return o="string"==typeof e?s.get(e):l.get(e),o||(o=u.Unknown),new o(t,n)},u.getBuiltInById=e=>a.get(e)||d;let p=null,m=null;const y={compilerOptions:{target:"esnext"}};const f=async()=>"\n interface FirstTest {\n isTrue?: boolean;\n }\n",h=new Map([["IReferenceRange","r"],["IRange","l"]]),g=new Map([["IWorkbook","workbook"],["ISheet","sheet"],["ICellRanges","ranges"],["ICellRange","range"],["IFormulaContext","context"]]),w=(e,t)=>{Array.from(t.keys()).forEach(n=>{const o=t.get(n);t.set(`${e}.${n}`,o)})},C=new Map([["Scalar","*"],["FormulaError.Known","e"],["Date","Date"],["JSON","JSON"]]),x=new Map([]),b="SheetXL";w(b,h),w(b,g),w(b,x);const T=new Map([["Promise",()=>({async:!0})],["Observable",()=>({stream:!0})]]);let k=null;async function N(){if(k)return k;try{return await(await import("./Y5czqevaHtgUcl4L.mjs")).initialize()}catch(e){throw k=null,e}finally{k=null}}async function S(t){const n=t?.source??null;if(!n)return null;const o=(t.disableBundle||t.declarationsOnly)??!1,i=[f(),N()],r=await Promise.all(i),a=r[0],s=r[1];let l="",c=null;const d=[],u={allowJs:!0,declaration:!1,sourceMap:!1,inlineSourceMap:!1,inlineSources:!1,isolatedModules:!0,preserveConstEnums:!1,module:99,noResolve:!0,emitDeclarationOnly:!1,target:s.ScriptTarget.ES2020},w="script",x=`${w}.ts`,b="lib.d.ts",k="global.d.ts",S={[x]:n,[b]:"\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",[k]:a},E={getSourceFile:(e,t,n,o)=>s.createSourceFile(e,S[e],s.ScriptTarget.Latest,!0),fileExists:e=>void 0!==S[e],readFile:e=>S[e],writeFile:(e,t)=>{S[e]=t},getCurrentDirectory:()=>"./",getCanonicalFileName:e=>e,useCaseSensitiveFileNames:()=>!0,getDefaultLibFileName:e=>b,getNewLine:()=>"\n"},L=s.createProgram([x,k],u,E),D=L.getTypeChecker(),v=L.getSourceFile(x),F=L.emit();F.diagnostics.length>0&&console.warn(F.diagnostics),l=S[`${w}.js`];const K=(e,t,n,o)=>{if(e){if(e.kind===s.SyntaxKind.NumberKeyword)t.scalar="n";else if(e.kind===s.SyntaxKind.StringKeyword)t.scalar="s";else if(e.kind===s.SyntaxKind.BooleanKeyword)t.scalar="b";else if(e.kind===s.SyntaxKind.UndefinedKeyword||e.kind===s.SyntaxKind.NullKeyword||e.kind===s.SyntaxKind.VoidKeyword){if(o)return void $(e,new Error(`'undefined' is not a valid type for input: '${e?.parent?.name?.escapedText}'.`));t.scalar="z"}else if(e.kind===s.SyntaxKind.BigIntKeyword)t.scalar="n";else if(e.kind===s.SyntaxKind.AnyKeyword)t.scalar="z";else if(e.kind===s.SyntaxKind.ArrayType){const i=e.elementType;if(!i)return void $(e,new Error(`'Array' must be typed: '${e?.parent?.name?.escapedText}'.`));t.arrayDepth=(t.arrayDepth??0)+1,K(i,t,n,o)}else if(e.kind!==s.SyntaxKind.TupleType&&e.kind===s.SyntaxKind.TypeReference){const i=e.typeName?.getText?.()??null,r=h.get(i);let a=!1;r&&(t.range=r,a=!0);const s=C.get(i);if(s&&(t.scalar=s),void 0!==s&&(a=!0),o){const e=g.get(i);if(e)return e}else{const n=T.get(i);if(n){const o={...t,...n()};let r=0;if(o.async&&r++,o.stream&&r++,r>1)return void $(e,new Error(`'${i}' cannot have multiple modifiers: '${e?.parent?.name?.escapedText}'.`));t=o,a=!0}}if(!a)return void $("node",new Error(`'${i}' is not a valid type: '${e?.parent?.name?.escapedText}'.`));const l=e.typeArguments;if(l){if(1!==l.length)return void $(e,new Error(`'${i}' must be typed with exactly 1 type: '${e?.parent?.name?.escapedText}'.`));K(l[0],t,n,o)}}}else $(e,new Error(`Type is not defined for '${t?.name??"return"}'.`))},P=[],$=(e,t)=>{P.push(t)};if(s.forEachChild(v,e=>{if(n=e,0!==(s.getCombinedModifierFlags(n)&s.ModifierFlags.Export)&&s.isFunctionDeclaration(e)){const n={},o={parameters:{}},i=e?.name?.getText();try{n.name=i;const r=D.getSymbolAtLocation(e.name).getDocumentationComment(D);if(r&&r.length>0&&r[0].text){let e=r[0].text;e=e.replace(/[\r\n]+/g,"\\n").trim(),o.summary=e}const a={};K(e.type,a,n,!1),n.returnType=a;const l={};t=e,0!==(s.getCombinedModifierFlags(t)&s.ModifierFlags.Default)&&(l.default=!0,c=i),Object.keys(l).length>0&&(n.behavior=l),n.parameters=[];const u=new Map;for(let t=0;t<e.parameters.length;t++){const i=e.parameters[t],r={};r.name=i.name?.getText();const a=K(i.type,r,n,!0);if(a){if(0!==n.parameters.length){const t=e?.parent,o=t?.name?.getText();return void $(e,new Error(`'${n.name}' contexts must be the first parameter: '${o}'.`))}n.context=a;continue}let l;if((void 0!==i.initializer&&null!==i.initializer||void 0!==i.questionToken&&null!==i.questionToken)&&(r.optional=!0,i.initializer))try{l=i.initializer.kind===s.SyntaxKind.StringLiteral?i.initializer.text:i.initializer.kind===s.SyntaxKind.NumericLiteral?parseFloat(i.initializer.text):i.initializer.kind===s.SyntaxKind.TrueKeyword||i.initializer.kind===s.SyntaxKind.FalseKeyword?i.initializer.kind===s.SyntaxKind.TrueKeyword:i.initializer.kind===s.SyntaxKind.NullKeyword?null:i.initializer.kind===s.SyntaxKind.ObjectLiteralExpression||i.initializer.kind===s.SyntaxKind.ArrayLiteralExpression?i.initializer.getText():i.initializer.getText?.()}catch(e){console.warn(`Couldn't extract default value for parameter '${r.name}'`,e)}i.dotDotDotToken&&(r.rest=!0),n.parameters.push(r);const c={description:""};o.parameters[r.name]=c;const d=D.getSymbolAtLocation(i.name).getDocumentationComment(D);d&&d.length>0&&d[0].text&&(c.description=d[0].text),void 0!==l&&(c.defaultValue=l),u.set(r.name,r)}if(e.jsDoc&&e.jsDoc.length>0){const t=e.jsDoc;for(let e=0;e<t.length;e++){const r=t[e]?.tags;if(r)for(let e=0;e<r.length;e++){const t=r[e];let a=t?.tagName?.text;if(!a)continue;a=a.toLowerCase();let l=t.comment;const c="hidden"===a;if(("string"==typeof l||c)&&("string"==typeof l&&(l=l.replace(/[\r\n]+/g,"\\n").trim()),c||!l||(l=l.split(/\\n/)[0],l&&0!==l.length))){if(l&&"string"==typeof l){const e=/\{@link(code|plain)?\s+([^}|]+)(?:\s*\|\s*([^}]+))?\}/g;let t,n=l,i=[];for(;null!==(t=e.exec(l));){const[e,n,o,i]=t,r=[o.trim()];i&&r.push(i.trim())}l=n,i.length>0&&"see"===a&&(o.links||(o.links=[]),o.links.push(...i))}if("name"===a){const e=l;e!==i&&(o.name=e)}else if("description"!==a)if("summary"===a){const e=l;e&&(o.summary=e)}else if("param"===a){const e=t.name?.text,n=u.get(e);if(!n){P.push(new Error(`Parameter '${e}' not found in function '${i}'.`));continue}if(t.typeExpression&&t.typeExpression.type)try{const e=t.typeExpression.type;if(e.kind===s.SyntaxKind.UnionType){const t=[];n.enums=t,e.types.forEach(e=>{if(e.kind===s.SyntaxKind.LiteralType){const n=e.literal.text;n&&t.push(n)}})}}catch(e){console.warn("Error parsing JSDoc type expression:",e)}}else if("returns"===a||"return"===a)n.returnType.description=l;else if("category"===a)o.category=l;else if("hidden"===a){let e=!0;const t=l?.toLowerCase();"false"===t?e=!1:"true"!==t&&(e=l),!1!==e&&(o.hidden=e??!0)}}}}}0===Object.keys(n.returnType).length&&delete n.returnType,d.push([n,o])}catch(t){$(e,new Error(`'${i}': ${t.message}`))}}var t,n}),P.length>0)throw console.warn(P),new Error("There were compilation errors.",{cause:P});if(0===d.length)throw new Error("No exported functions.");const B=`${e.uuidV4()}-script`;try{o||0!==P.length||(l=await async function(e,t,n="/script.js",o="__SHEETXL"){try{const e=await async function(){if(p)return p;if(m){if(await m,!p)throw new Error("ESBuild initialization promise resolved, but instance is not available.");return p}let e,t;m=new Promise((n,o)=>{e=n,t=o});try{const{initialize:t}=await import("./lfu13YaazVLqtmeU.mjs");return p=await t(),e(),p}catch(e){throw console.error("Failed to import or initialize esbuild:",e),m=null,t(e),e}}(),i="@sheetxl/primitives",r=`\n export const FormulaContext = globalThis.${o}?.FormulaContext;\n export const ScalarType = globalThis.${o}?.ScalarType;\n export const Observable = globalThis.${o}?.Observable;\n export const IRange = globalThis.${o}?.IRange;\n export const FormulaError = globalThis.${o}?.FormulaError;\n // Add more exports as needed\n `,a={name:"sheetxl-esbuild-in-memory",setup(e){const o="sheetxl-"+(new Date).getTime();e.onResolve({filter:new RegExp(`^(${n.replace("/","\\/")}|${i})$`)},e=>({path:e.path,namespace:o})),e.onResolve({filter:/.*/},e=>{if(e.namespace!==o)return console.warn(`esbuild: Treating import "${e.path}" as external.`),{path:e.path,external:!0}}),e.onLoad({filter:/.*/,namespace:o},e=>{let a;if(e.path===n)a=t;else{if(e.path!==i)return{errors:[{text:`Cannot load unknown path in ${o}: ${e.path}`}]};a=r}return{contents:a,loader:"ts"}})}},s=await e.build({entryPoints:[n],bundle:!0,write:!1,format:"esm",plugins:[a],sourcemap:"inline",tsconfigRaw:y,minify:!0,platform:"neutral"});if(s.outputFiles&&s.outputFiles.length>0)return s.outputFiles[0].text;throw s.errors&&s.errors.length>0?new Error(`esbuild bundling failed: ${s.errors.map(e=>e.text).join("\n")}`):new Error("esbuild did not produce an output file.")}catch(e){throw console.error("esbuild bundling process failed:",e),e}}(0,l,w))}catch{console.warn("Error bundling script")}const R={functions:d,commitId:B,source:n,name:"Script",language:"typescript",compiled:l};return c&&(R.autoRun=c),R}export{S as compileModule};
7
+ import{$ as e}from"./MRXgg6FvbB08Ze4M.mjs";var t,n,o;(n=t||(t={})).Orientation={Column:"column",Row:"row"},n.Orientations={...n.Orientation,Both:"both"},n.Direction={Up:"up",Down:"down",Left:"left",Right:"right"},(e=>{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!"};class t extends Error{constructor(e,t,n,o){super(n,o),this._label=t,this._code=e,this.details=o}static{this.code=e.Code.Unknown}get isFormulaError(){return!0}getLabel(){return this._label}getCode(){return this._code}equals(e){return!!e&&(this._code===e._code||this._code===e.code)}get[Symbol.toStringTag](){return"[FormulaError]"}toString(){return this.message||this._label}}e.Known=t;class n extends t{constructor(t,n){super(e.Code.Parse,e.Label.Parse,t,n)}static{this.code=e.Code.Parse}getDetails(){const e=this.details;return{line:e?.line??1,column:e?.column??1,offset:e?.offset??0,length:e?.length??0}}}e.Parse=n;class o extends t{constructor(t,n){super(e.Code.Null,e.Label.Null,t,n)}static{this.code=e.Code.Null}}e.Null=o;class i extends t{constructor(t,n){super(e.Code.Div0,e.Label.Div0,t,n)}static{this.code=e.Code.Div0}}e.Div0=i;class r extends t{constructor(t,n){super(e.Code.Value,e.Label.Value,t,n)}static{this.code=e.Code.Value}}e.Value=r;class a extends t{constructor(t,n){super(e.Code.Ref,e.Label.Ref,t,n)}static{this.code=e.Code.Ref}}e.Ref=a;class s extends t{constructor(t,n){super(e.Code.Name,e.Label.Name,t,n)}static{this.code=e.Code.Name}}e.Name=s;class l extends t{constructor(t,n){super(e.Code.Num,e.Label.Num,t,n)}static{this.code=e.Code.Num}}e.Num=l;class c extends t{constructor(t,n){super(e.Code.NA,e.Label.NA,t,n)}static{this.code=e.Code.NA}}e.NA=c;class d extends t{constructor(t,n){super(e.Code.GettingData,e.Label.GettingData,t,n)}static{this.code=e.Code.GettingData}}e.GettingData=d;class u extends t{constructor(t,n){super(e.Code.Spill,e.Label.Spill,t,n)}static{this.code=e.Code.Spill}}e.Spill=u;class p extends t{constructor(t,n){super(e.Code.Connect,e.Label.Connect,t,n)}static{this.code=e.Code.Connect}}e.Connect=p;class m extends t{constructor(t,n){super(e.Code.Blocked,e.Label.Blocked,t,n)}static{this.code=e.Code.Blocked}}e.Blocked=m;class y extends t{constructor(t,n){super(e.Code.Unknown,e.Label.Unknown,t,n)}static{this.code=e.Code.Unknown}}e.Unknown=y;class f extends t{constructor(t,n){super(e.Code.Field,e.Label.Field,t,n)}static{this.code=e.Code.Field}}e.Field=f;class h extends t{constructor(t,n){super(e.Code.Calc,e.Label.Calc,t,n)}static{this.code=e.Code.Calc}}e.Calc=h;class g extends t{constructor(t,n){super(e.Code.Busy,e.Label.Busy,t,n)}static{this.code=e.Code.Busy}}e.Busy=g;class w extends t{constructor(t,n){super(e.Code.Python,e.Label.Python,t,n)}static{this.code=e.Code.Python}}e.Python=w;class C extends t{constructor(t,n){super(e.Code.Timeout,e.Label.Timeout,t,n)}static{this.code=e.Code.Timeout}}e.Timeout=C})(o||(o={}));const i={};i[o.Code.Parse]=o.Parse,i[o.Code.Null]=o.Null,i[o.Code.Div0]=o.Div0,i[o.Code.Value]=o.Value,i[o.Code.Ref]=o.Ref,i[o.Code.Name]=o.Name,i[o.Code.Num]=o.Num,i[o.Code.NA]=o.NA,i[o.Code.GettingData]=o.GettingData,i[o.Code.Spill]=o.Spill,i[o.Code.Connect]=o.Connect,i[o.Code.Blocked]=o.Blocked,i[o.Code.Unknown]=o.Unknown,i[o.Code.Field]=o.Field,i[o.Code.Calc]=o.Calc,i[o.Code.Busy]=o.Busy,i[o.Code.Python]=o.Python,i[o.Code.Timeout]=o.Timeout;const r=new Map,a=new Map,s=new Map,l=new Map,c=Object.keys(i);for(let e=0;e<c.length;e++){const t=c[e],n=i[t];s.set(o.Label[t],n),l.set(o.Code[t],n);const d=new n;r.set(d.getLabel(),d),a.set(d.getCode(),d)}const d=a.get(o.Code.Unknown);var u;(u=o||(o={})).BuiltIn={Parse:new u.Parse,Null:new u.Null,Div0:new u.Div0,Value:new u.Value,Ref:new u.Ref,Name:new u.Name,Num:new u.Num,NA:new u.NA,GettingData:new u.GettingData,Spill:new u.Spill,Connect:new u.Connect,Blocked:new u.Blocked,Unknown:new u.Unknown,Field:new u.Field,Calc:new u.Calc,Busy:new u.Busy,Python:new u.Python,Timeout:new u.Timeout},u.getBuiltInByLabel=e=>r.get(e),u.newTypedError=(e,t,n)=>{let o;return o="string"==typeof e?s.get(e):l.get(e),o||(o=u.Unknown),new o(t,n)},u.getBuiltInById=e=>a.get(e)||d;let p=null,m=null;const y={compilerOptions:{target:"esnext"}};const f=async()=>"\n interface FirstTest {\n isTrue?: boolean;\n }\n",h=new Map([["IReferenceRange","r"],["IRange","l"]]),g=new Map([["IWorkbook","workbook"],["ISheet","sheet"],["ICellRanges","ranges"],["ICellRange","range"],["IFormulaContext","context"]]),w=(e,t)=>{Array.from(t.keys()).forEach(n=>{const o=t.get(n);t.set(`${e}.${n}`,o)})},C=new Map([["Scalar","*"],["FormulaError.Known","e"],["Date","Date"],["JSON","JSON"]]),x=new Map([]),b="SheetXL";w(b,h),w(b,g),w(b,x);const T=new Map([["Promise",()=>({async:!0})],["Observable",()=>({stream:!0})]]);let k=null;async function N(){if(k)return k;try{return await(await import("./Dhvtq8jHg8BxOR0C.mjs")).initialize()}catch(e){throw k=null,e}finally{k=null}}async function S(t){const n=t?.source??null;if(!n)return null;const o=(t.disableBundle||t.declarationsOnly)??!1,i=[f(),N()],r=await Promise.all(i),a=r[0],s=r[1];let l="",c=null;const d=[],u={allowJs:!0,declaration:!1,sourceMap:!1,inlineSourceMap:!1,inlineSources:!1,isolatedModules:!0,preserveConstEnums:!1,module:99,noResolve:!0,emitDeclarationOnly:!1,target:s.ScriptTarget.ES2020},w="script",x=`${w}.ts`,b="lib.d.ts",k="global.d.ts",S={[x]:n,[b]:"\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",[k]:a},E={getSourceFile:(e,t,n,o)=>s.createSourceFile(e,S[e],s.ScriptTarget.Latest,!0),fileExists:e=>void 0!==S[e],readFile:e=>S[e],writeFile:(e,t)=>{S[e]=t},getCurrentDirectory:()=>"./",getCanonicalFileName:e=>e,useCaseSensitiveFileNames:()=>!0,getDefaultLibFileName:e=>b,getNewLine:()=>"\n"},L=s.createProgram([x,k],u,E),D=L.getTypeChecker(),v=L.getSourceFile(x),F=L.emit();F.diagnostics.length>0&&console.warn(F.diagnostics),l=S[`${w}.js`];const K=(e,t,n,o)=>{if(e){if(e.kind===s.SyntaxKind.NumberKeyword)t.scalar="n";else if(e.kind===s.SyntaxKind.StringKeyword)t.scalar="s";else if(e.kind===s.SyntaxKind.BooleanKeyword)t.scalar="b";else if(e.kind===s.SyntaxKind.UndefinedKeyword||e.kind===s.SyntaxKind.NullKeyword||e.kind===s.SyntaxKind.VoidKeyword){if(o)return void $(e,new Error(`'undefined' is not a valid type for input: '${e?.parent?.name?.escapedText}'.`));t.scalar="z"}else if(e.kind===s.SyntaxKind.BigIntKeyword)t.scalar="n";else if(e.kind===s.SyntaxKind.AnyKeyword)t.scalar="z";else if(e.kind===s.SyntaxKind.ArrayType){const i=e.elementType;if(!i)return void $(e,new Error(`'Array' must be typed: '${e?.parent?.name?.escapedText}'.`));t.arrayDepth=(t.arrayDepth??0)+1,K(i,t,n,o)}else if(e.kind!==s.SyntaxKind.TupleType&&e.kind===s.SyntaxKind.TypeReference){const i=e.typeName?.getText?.()??null,r=h.get(i);let a=!1;r&&(t.range=r,a=!0);const s=C.get(i);if(s&&(t.scalar=s),void 0!==s&&(a=!0),o){const e=g.get(i);if(e)return e}else{const n=T.get(i);if(n){const o={...t,...n()};let r=0;if(o.async&&r++,o.stream&&r++,r>1)return void $(e,new Error(`'${i}' cannot have multiple modifiers: '${e?.parent?.name?.escapedText}'.`));t=o,a=!0}}if(!a)return void $("node",new Error(`'${i}' is not a valid type: '${e?.parent?.name?.escapedText}'.`));const l=e.typeArguments;if(l){if(1!==l.length)return void $(e,new Error(`'${i}' must be typed with exactly 1 type: '${e?.parent?.name?.escapedText}'.`));K(l[0],t,n,o)}}}else $(e,new Error(`Type is not defined for '${t?.name??"return"}'.`))},P=[],$=(e,t)=>{P.push(t)};if(s.forEachChild(v,e=>{if(n=e,0!==(s.getCombinedModifierFlags(n)&s.ModifierFlags.Export)&&s.isFunctionDeclaration(e)){const n={},o={parameters:{}},i=e?.name?.getText();try{n.name=i;const r=D.getSymbolAtLocation(e.name).getDocumentationComment(D);if(r&&r.length>0&&r[0].text){let e=r[0].text;e=e.replace(/[\r\n]+/g,"\\n").trim(),o.summary=e}const a={};K(e.type,a,n,!1),n.returnType=a;const l={};t=e,0!==(s.getCombinedModifierFlags(t)&s.ModifierFlags.Default)&&(l.default=!0,c=i),Object.keys(l).length>0&&(n.behavior=l),n.parameters=[];const u=new Map;for(let t=0;t<e.parameters.length;t++){const i=e.parameters[t],r={};r.name=i.name?.getText();const a=K(i.type,r,n,!0);if(a){if(0!==n.parameters.length){const t=e?.parent,o=t?.name?.getText();return void $(e,new Error(`'${n.name}' contexts must be the first parameter: '${o}'.`))}n.context=a;continue}let l;if((void 0!==i.initializer&&null!==i.initializer||void 0!==i.questionToken&&null!==i.questionToken)&&(r.optional=!0,i.initializer))try{l=i.initializer.kind===s.SyntaxKind.StringLiteral?i.initializer.text:i.initializer.kind===s.SyntaxKind.NumericLiteral?parseFloat(i.initializer.text):i.initializer.kind===s.SyntaxKind.TrueKeyword||i.initializer.kind===s.SyntaxKind.FalseKeyword?i.initializer.kind===s.SyntaxKind.TrueKeyword:i.initializer.kind===s.SyntaxKind.NullKeyword?null:i.initializer.kind===s.SyntaxKind.ObjectLiteralExpression||i.initializer.kind===s.SyntaxKind.ArrayLiteralExpression?i.initializer.getText():i.initializer.getText?.()}catch(e){console.warn(`Couldn't extract default value for parameter '${r.name}'`,e)}i.dotDotDotToken&&(r.rest=!0),n.parameters.push(r);const c={description:""};o.parameters[r.name]=c;const d=D.getSymbolAtLocation(i.name).getDocumentationComment(D);d&&d.length>0&&d[0].text&&(c.description=d[0].text),void 0!==l&&(c.defaultValue=l),u.set(r.name,r)}if(e.jsDoc&&e.jsDoc.length>0){const t=e.jsDoc;for(let e=0;e<t.length;e++){const r=t[e]?.tags;if(r)for(let e=0;e<r.length;e++){const t=r[e];let a=t?.tagName?.text;if(!a)continue;a=a.toLowerCase();let l=t.comment;const c="hidden"===a;if(("string"==typeof l||c)&&("string"==typeof l&&(l=l.replace(/[\r\n]+/g,"\\n").trim()),c||!l||(l=l.split(/\\n/)[0],l&&0!==l.length))){if(l&&"string"==typeof l){const e=/\{@link(code|plain)?\s+([^}|]+)(?:\s*\|\s*([^}]+))?\}/g;let t,n=l,i=[];for(;null!==(t=e.exec(l));){const[e,n,o,i]=t,r=[o.trim()];i&&r.push(i.trim())}l=n,i.length>0&&"see"===a&&(o.links||(o.links=[]),o.links.push(...i))}if("name"===a){const e=l;e!==i&&(o.name=e)}else if("description"!==a)if("summary"===a){const e=l;e&&(o.summary=e)}else if("param"===a){const e=t.name?.text,n=u.get(e);if(!n){P.push(new Error(`Parameter '${e}' not found in function '${i}'.`));continue}if(t.typeExpression&&t.typeExpression.type)try{const e=t.typeExpression.type;if(e.kind===s.SyntaxKind.UnionType){const t=[];n.enums=t,e.types.forEach(e=>{if(e.kind===s.SyntaxKind.LiteralType){const n=e.literal.text;n&&t.push(n)}})}}catch(e){console.warn("Error parsing JSDoc type expression:",e)}}else if("returns"===a||"return"===a)n.returnType.description=l;else if("category"===a)o.category=l;else if("hidden"===a){let e=!0;const t=l?.toLowerCase();"false"===t?e=!1:"true"!==t&&(e=l),!1!==e&&(o.hidden=e??!0)}}}}}0===Object.keys(n.returnType).length&&delete n.returnType,d.push([n,o])}catch(t){$(e,new Error(`'${i}': ${t.message}`))}}var t,n}),P.length>0)throw console.warn(P),new Error("There were compilation errors.",{cause:P});if(0===d.length)throw new Error("No exported functions.");const B=`${e.uuidV4()}-script`;try{o||0!==P.length||(l=await async function(e,t,n="/script.js",o="__SHEETXL"){try{const e=await async function(){if(p)return p;if(m){if(await m,!p)throw new Error("ESBuild initialization promise resolved, but instance is not available.");return p}let e,t;m=new Promise((n,o)=>{e=n,t=o});try{const{initialize:t}=await import("./yM_d2jrPPN_EupI0.mjs");return p=await t(),e(),p}catch(e){throw console.error("Failed to import or initialize esbuild:",e),m=null,t(e),e}}(),i="@sheetxl/primitives",r=`\n export const FormulaContext = globalThis.${o}?.FormulaContext;\n export const ScalarType = globalThis.${o}?.ScalarType;\n export const Observable = globalThis.${o}?.Observable;\n export const IRange = globalThis.${o}?.IRange;\n export const FormulaError = globalThis.${o}?.FormulaError;\n // Add more exports as needed\n `,a={name:"sheetxl-esbuild-in-memory",setup(e){const o="sheetxl-"+(new Date).getTime();e.onResolve({filter:new RegExp(`^(${n.replace("/","\\/")}|${i})$`)},e=>({path:e.path,namespace:o})),e.onResolve({filter:/.*/},e=>{if(e.namespace!==o)return console.warn(`esbuild: Treating import "${e.path}" as external.`),{path:e.path,external:!0}}),e.onLoad({filter:/.*/,namespace:o},e=>{let a;if(e.path===n)a=t;else{if(e.path!==i)return{errors:[{text:`Cannot load unknown path in ${o}: ${e.path}`}]};a=r}return{contents:a,loader:"ts"}})}},s=await e.build({entryPoints:[n],bundle:!0,write:!1,format:"esm",plugins:[a],sourcemap:"inline",tsconfigRaw:y,minify:!0,platform:"neutral"});if(s.outputFiles&&s.outputFiles.length>0)return s.outputFiles[0].text;throw s.errors&&s.errors.length>0?new Error(`esbuild bundling failed: ${s.errors.map(e=>e.text).join("\n")}`):new Error("esbuild did not produce an output file.")}catch(e){throw console.error("esbuild bundling process failed:",e),e}}(0,l,w))}catch{console.warn("Error bundling script")}const R={functions:d,commitId:B,source:n,name:"Script",language:"typescript",compiled:l};return c&&(R.autoRun=c),R}export{S as compileModule};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.11
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.12
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.11
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.12
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.11
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.12
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.11
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.12
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.11
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.12
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.11
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.12
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.11
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.12
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -1,7 +1,7 @@
1
1
  /**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.11
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.12
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
6
  */
7
- const t="text/html",e="text/plain",r="image/png",n=Object.freeze({left:0,top:0}),o=Object.freeze({left:0,top:0,bottom:0,right:0}),a=Object.freeze({x:0,y:0,width:0,height:0});Object.freeze(Object.defineProperty({__proto__:null,EmptyBounds:a,EmptyRect:o,EmptyTopLeft:n},Symbol.toStringTag,{value:"Module"}));const i="column",l="row",s=Object.freeze({colIndex:0,rowIndex:0}),c=Object.freeze({colStart:0,rowStart:0,colEnd:0,rowEnd:0}),u=(t,e)=>t.colStart===e.colStart?t.rowStart-e.rowStart:t.colStart-e.colStart,d=(t,e)=>t.rowStart===e.rowStart?t.colStart-e.colStart:t.rowStart-e.rowStart,f=(t,e)=>t.rowEnd===e.rowEnd?e.colEnd-t.colEnd:e.rowEnd-t.rowEnd,p=(t,e)=>t.colEnd===e.colEnd?e.rowEnd-t.rowEnd:e.colEnd-t.colEnd,w=(t,e)=>t.colIndex===e.colIndex?t.rowIndex-e.rowIndex:t.colIndex-e.colIndex,h=(t,e)=>t.rowIndex===e.rowIndex?t.colIndex-e.colIndex:t.rowIndex-e.rowIndex,y=(t=l,e=!1)=>e?t!==i?f:p:t!==i?d:u,g=(t,e)=>t===e||!(!t||!e)&&t.rowIndex===e.rowIndex&&t.colIndex===e.colIndex,b=(t,e)=>t===e||!(!t||!e)&&t.rowStart===e.rowStart&&t.rowEnd===e.rowEnd&&t.colStart===e.colStart&&t.colEnd===e.colEnd,m=(t,e)=>!(!t||!e||t.colStart>e.colEnd||e.colStart>t.colEnd||t.rowStart>e.rowEnd||e.rowStart>t.rowEnd),E=(t,e)=>{if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!b(t[r],e[r]))return!1;return!0},S=(t,e,r)=>{if(!t&&!e)return null;if(!t)return r?e:{...e};if(!e)return r?t:{...t};const n=Math.min(t.colStart,e.colStart),o=Math.min(t.rowStart,e.rowStart),a=Math.max(t.colEnd,e.colEnd),i=Math.max(t.rowEnd,e.rowEnd);let l=r;return l?(l.colStart=n,l.rowStart=o,l.colEnd=a,l.rowEnd=i):l={colStart:n,rowStart:o,colEnd:a,rowEnd:i},l},v=(t,e)=>{if(!e||0===e.length)return t;const r={...t};for(let t=0;t<e.length;t++){const n=e[t];m(r,n)&&(r.rowStart=Math.min(r.rowStart,n.rowStart),r.colStart=Math.min(r.colStart,n.colStart),r.rowEnd=Math.max(r.rowEnd,n.rowEnd),r.colEnd=Math.max(r.colEnd,n.colEnd))}return r},x=[null,null],_=(t,e,r)=>{if(t[0].value===t[1].value)return e};function O(t,e=2,r,n=l,o){let a=[...t];if(e<=0||t.length<=1)return a;let s=n===i,c=0,u=!1;do{const t=a.sort(y(s?l:i));a=[],a.push(t[0]);const e=t.length;let d=0,f=t[0],p=f.colStart,w=f.rowStart,h=f.colEnd,g=f.rowEnd;for(let i=1;i<e;i++){const e=t[i];let l=!1;if(l=s?f&&w===e.rowStart&&g===e.rowEnd&&h+1===e.colStart:f&&p===e.colStart&&h===e.colEnd&&g+1===e.rowStart,l){let t={colStart:p,rowStart:w,colEnd:s?e.colEnd:h,rowEnd:s?g:e.rowEnd};if(void 0!==f.value&&(t.value=f.value),r){const a=o??[null,null];a[0]=f,a[1]=e,t=r(a,t,n)}if(t){a[d]=t,u=!0,f=t,p=f.colStart,w=f.rowStart,h=f.colEnd,g=f.rowEnd;continue}}a[++d]=e,f=e,p=f.colStart,w=f.rowStart,h=f.colEnd,g=f.rowEnd}c++,s=!s,1===c&&(u=!0)}while(c<e&&u&&a.length>1);return a}Object.freeze(Object.defineProperty({__proto__:null,EmptyCell:s,EmptyRange:c,cellToRange:(t,e)=>{if(!t)return null;let r=e;return r||(r={...t},delete r.colIndex,delete r.rowIndex),r.colStart=t.colIndex??0,r.rowStart=t.rowIndex??0,r.colEnd=t.colIndex??0,r.rowEnd=t.rowIndex??0,r},columnFirstCellComparator:w,columnFirstRangeComparator:u,createCellComparator:(t=l,e=!1)=>e?t!==i?(t,e)=>t.rowIndex===e.rowIndex?e.colIndex-t.colIndex:e.rowIndex-t.rowIndex:(t,e)=>t.colIndex===e.colIndex?e.rowIndex-t.rowIndex:e.colIndex-t.colIndex:t!==i?h:w,createConflatingRanges:(t,e=!1)=>{const r=[];let n,o,a=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;return{append:(i,l,c)=>{let u=!0;const d=void 0!==c;if(d){const r=t?t(o,c,e):o===c?c:void 0;void 0===r?u=!1:c=r}if(u&&l===s+1&&i===a)return e?n.rowEnd=l:n.colEnd=l,s=l,void(o=c);n&&r.push(n);const f=e?i:l,p=e?l:i;n={colStart:f,rowStart:p,colEnd:f,rowEnd:p},d&&(n.value=c),a=i,s=l,o=c},done:t=>(n&&(r.push(n),n=null),t?O(r,3,!0===t?_:t,e?i:l,x):r)}},createRangeComparator:y,defaultRange:(t,e,r)=>t?r?(r.colStart=t.colStart??e.colStart,r.rowStart=t.rowStart??e.rowStart,r.colEnd=t.colEnd??e.colEnd,r.rowEnd=t.rowEnd??e.rowEnd,r):{colStart:t.colStart??e.colStart,rowStart:t.rowStart??e.rowStart,colEnd:t.colEnd??e.colEnd,rowEnd:t.rowEnd??e.rowEnd}:e,extendRangeToIntersectingRanges:v,extendRangeToUnionRanges:(t,e)=>{if(!e||0===e.length)return t;let r=t,n=null;for(;!b(r,n);)n=r,r=v(n,e);return r},indexOfCoords:(t,e)=>{const r={colStart:t.colIndex,rowStart:t.rowIndex,colEnd:t.colIndex,rowEnd:t.rowIndex};for(let t=e.length-1;t>=0;t--)if(m(r,e[t]))return t;return-1},intersectRanges:(t,e,r)=>{if(!t)return r?e:{...e};if(!e)return r?t:{...t};if(!t&&!e||t.rowStart>e.rowEnd||t.rowEnd<e.rowStart||t.colStart>e.colEnd||t.colEnd<e.colStart)return null;const n=Math.max(t.colStart,e.colStart),o=Math.max(t.rowStart,e.rowStart),a=Math.min(t.colEnd,e.colEnd),i=Math.min(t.rowEnd,e.rowEnd);let l=r;return l?(l.colStart=n,l.rowStart=o,l.colEnd=a,l.rowEnd=i):l={colStart:n,rowStart:o,colEnd:a,rowEnd:i},l},isCellWithinRange:(t,e)=>!(!t||!e||t.rowIndex<e.rowStart||t.rowIndex>e.rowEnd||t.colIndex<e.colStart||t.colIndex>e.colEnd),isEqualCells:g,isEqualRanges:b,isEqualRangesArrays:E,isEqualSelectionCoords:(t,e)=>t===e||!(!t||!e)&&t.rangeIndex===e.rangeIndex&&!!g(t.cell,e.cell)&&E(t.ranges,e.ranges),isRangeWithinRange:(t,e)=>!(t.rowStart<e.rowStart||t.rowEnd>e.rowEnd||t.colStart<e.colStart||t.colEnd>e.colEnd),isRangesIntersect:m,isSingleCell:t=>!!t&&t.rowEnd===t.rowStart&&t.colStart===t.colEnd,isValidRange:t=>!(!t||"number"!=typeof t.colStart||t.colStart<0||"number"!=typeof t.colEnd||t.colEnd<t.colStart||"number"!=typeof t.rowStart||t.rowStart<0||"number"!=typeof t.rowEnd||t.rowEnd<t.rowStart),mergeRangedValues:O,rowFirstCellComparator:h,rowFirstRangeComparator:d,sanitizeRange:t=>t?{colStart:t.colIndex??t.colStart??0,rowStart:t.rowIndex??t.rowStart??0,colEnd:t.colIndex??t.colEnd??0,rowEnd:t.rowIndex??t.rowEnd??0}:null,translateRange:(t,e=-t.rowStart,r=-t.colStart,n)=>n?(n.colStart=t.colStart+r,n.rowStart=t.rowStart+e,n.colEnd=t.colEnd+r,n.rowEnd=t.rowEnd+e,n):{colStart:t.colStart+r,rowStart:t.rowStart+e,colEnd:t.colEnd+r,rowEnd:t.rowEnd+e},unionRanges:S,unionRangesArrays:(t,e,r)=>{if(!t||0===t.length)return null;if(1===t.length&&!e)return t[0];let n=t[0];for(let e=1;e<t.length;e++)n=S(n,t[e],r);return e&&(n=S(n,e,r)),n}},Symbol.toStringTag,{value:"Module"}));const I="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function j(t){return function(t){return!!t&&"object"==typeof t}(t)&&!function(t){const e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||t.$$typeof===I}(t)}function T(t,e){return!1!==e.clone&&e.isMergeableObject(t)?A((r=t,Array.isArray(r)?[]:{}),t,e):t;var r}function C(t,e,r){return t.concat(e).map(function(t){return T(t,r)})}function M(t){return Object.keys(t).concat((e=t,Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]));var e}function R(t,e){try{return e in t}catch{return!1}}function A(t,e,r){(r=r||{}).arrayMerge=r.arrayMerge||C,r.isMergeableObject=r.isMergeableObject||j,r.cloneUnlessOtherwiseSpecified=T;const n=Array.isArray(e);return n===Array.isArray(t)?n?r.arrayMerge(t,e,r):function(t,e,r){const n={};return r.isMergeableObject(t)&&M(t).forEach(function(e){n[e]=T(t[e],r)}),M(e).forEach(function(o){var a,i;R(a=t,i=o)&&(!Object.hasOwnProperty.call(a,i)||!Object.propertyIsEnumerable.call(a,i))||(R(t,o)&&r.isMergeableObject(e[o])?n[o]=function(t,e){if(!e.customMerge)return A;const r=e.customMerge(t);return"function"==typeof r?r:A}(o,r)(t[o],e[o],r):n[o]=T(e[o],r))}),n}(t,e,r):T(e,r)}A.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(t,r){return A(t,r,e)},{})};const F=Object.freeze([]),L=Object.freeze({}),U=t=>t,P=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){let e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}),k=(t,e)=>t===e||!(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length)&&t.every((t,r)=>t===e[r]),N=t=>"object"==typeof t&&!Array.isArray(t)&&null!==t,B=t=>"object"!=typeof t||Array.isArray(t)||null===t?t:(Object.keys(t).forEach(function(e){t[e]&&"object"==typeof t[e]?B(t[e]):null!==t[e]&&void 0!==t[e]||delete t[e],"object"==typeof t[e]&&0===Object.keys(t[e]).length&&delete t[e]}),0===Object.keys(t).length?null:t),z=(t,e)=>!(t!==e&&!k(t,e)&&!t.isEqual?.(e)),q=(t,e,r=z)=>{if(null==t||t===e)return null;if(!t||"object"!=typeof t||Array.isArray(t)||t.isImmutable?.())return r(t,e)?null:t;const n=Object.keys(t);if(0===n.length)return null;let o=!1;for(let a=0;a<n.length;a++){const i=n[a];null===q(t[i],e?.[i],r)&&(o=!0,delete t[i])}return o&&0===Object.keys(t).length?null:void 0},D="object"==typeof performance&&"function"==typeof performance.now?()=>performance.now():()=>Date.now(),$=t=>null==t,W=(t,e)=>!(e.left>t.right||e.right<t.left||e.top>t.bottom||e.bottom<t.top),V=!(typeof window>"u"||!window.document||!window.document.createElement),G={Windows:"windows",MacOS:"macos",IOS:"ios",Linux:"linux",Android:"android",Safari:"safari",Firefox:"firefox",Node:"node",Unknown:"unknown"},J=()=>{if(H())return G.Node;const t=void 0!==globalThis.navigator&&globalThis.navigator.userAgent?globalThis.navigator.userAgent.toLowerCase():"";return t?/(win32|win64|windows|wince)/i.test(t)?G.Windows:/(macintosh|macintel|macppc|mac68k|macos)/i.test(t)?G.MacOS:/(iphone|ipad|ipod)/i.test(t)?G.IOS:/android/.test(t)?G.Android:/linux/.test(t)?G.Linux:/^((?!chrome|android|).)*safari/i.test(t)?G.Safari:/^((?!chrome|android|Seamonkey).)*firefox/i.test(t)?G.Firefox:G.Unknown:G.Unknown};function H(){return typeof process<"u"&&"node"===process.release?.name||(typeof process<"u"&&process.browser,!1)}const K=(t,e=!1)=>(document.hasFocus()||e)&&(t===document.activeElement||t?.contains(document.activeElement)),Y=Object.freeze(Object.defineProperty({__proto__:null,EmptyArray:F,EmptyObject:L,OSType:G,arrayMove:function(t,e,r){const n=t.slice();return n.splice(r<0?n.length+r:r,0,n.splice(e,1)[0]),n},asNumber:t=>{const e=1*t;return Number.isFinite(e)?e:0},camelToPrettyCase:t=>1===t.length?t.toUpperCase():t.replace(/([A-Z])/g," $1").replace(/^./,function(t){return t.toUpperCase()}).trim(),canUseDOM:V,cancelTimeout:t=>{cancelAnimationFrame(t.id)},castToString:t=>null==t||void 0===t?"":"string"!=typeof t?""+t:t,cloneObject:t=>$(t)?t:JSON.parse(JSON.stringify(t)),consoleWithNoSource:(...t)=>new Promise(e=>{setTimeout(()=>{Function("console.log.apply(console, arguments)").apply(null,t),e()})}),debounce:function(t,e=300,r=!1){let n,o,a,i,l=0;function s(){let c=Date.now()-l;c<e&&c>=0?n=setTimeout(s,e-c):(n=null,r||(i=t.apply(a,o),a=o=null))}null==e&&(e=100);const c=function(){a=globalThis,o=arguments,l=Date.now();var c=r&&!n;return n||(n=setTimeout(s,e)),c&&(i=t.apply(a,o),a=o=null),i};return c.clear=function(){n&&(clearTimeout(n),n=null)},c.flush=function(){n&&(i=t.apply(a,o),a=o=null,clearTimeout(n),n=null)},c},deepEqual:function t(e,r){if(e===r)return!0;if(e&&r&&"object"==typeof e&&"object"==typeof r){if(e.constructor!==r.constructor)return!1;let n,o,a;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(o=n;0!==o--;)if(!t(e[o],r[o]))return!1;return!0}if(e instanceof Map&&r instanceof Map){if(e.size!==r.size)return!1;for(o of e.entries())if(!r.has(o[0]))return!1;for(o of e.entries())if(!t(o[1],r.get(o[0])))return!1;return!0}if(e instanceof Set&&r instanceof Set){if(e.size!==r.size)return!1;for(o of e.entries())if(!r.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(r)){if(n=e.length,n!=r.length)return!1;for(o=n;0!==o--;)if(e[o]!==r[o])return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(a=Object.keys(e),n=a.length,n!==Object.keys(r).length)return!1;for(o=n;0!==o--;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;for(o=n;0!==o--;){let n=a[o];if(!("_owner"===n&&e.$$typeof||t(e[n],r[n])))return!1}return!0}return e!=e&&r!=r},deepFreeze:function t(e){return Object.freeze(e),Object.keys(e).forEach(r=>{"object"!=typeof e[r]||null===e[r]||Object.isFrozen(e[r])||t(e[r])}),e},deepMerge:A,diffValues:(t,e)=>{const r={},n=Object.keys(e),o=n.length;for(let a=0;a<o;a++){const o=n[a];t[o]!==e[o]&&(void 0===t[o]?r[o]=e[o]:r[o]=t[o])}return 0===Object.keys(r).length?null:r},findEqualOrGreater:function(t,e,r=U){let n=0,o=t.length-1;for(;n<=o;){let a=Math.floor((n+o)/2),i=r(t[a]);if(i===e)return a;i<e?n=a+1:o=a-1}return n},findEqualOrLesser:function(t,e,r=U){let n=t.length-1,o=0;for(;n>=o;){let a=Math.floor((n+o)/2),i=r(t[a]);if(i===e)return a;i>e?n=a-1:o=a+1}return n},findNextStep:(t,e=!0,r=15,n=10,o=400)=>{const a=Math.max(t-n,0)+(e?1:-1);return Math.min(o,Math[e?"ceil":"floor"](a/r)*r+n)},getDPI:()=>{let t=1;return"object"==typeof window&&(t=window.devicePixelRatio||1),t},getFromPath:(t,e)=>{const r=e.split(".");let n=t;for(let t=0;t<r.length;t++){const e=r[t];if(!n)return null;let o=n[e];if("function"==typeof o&&(o=o.bind(n)()),!o||!N(o))return o;n=o}return n??null},getOS:J,hasFocus:K,isDefined:t=>null!=t,isEmpty:t=>null==t||""===t,isEqualArrays:k,isEqualBounds:(t,e)=>t===e||!(t&&!e||e&&!t)&&t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height,isEqualObjectKeys:(t,e)=>{if(t===e)return!0;if(t&&!e||e&&!t)return!1;const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!1;for(let n=0;n<r.length;n++)if(t[r[n]]!==e[r[n]])return!1;return!0},isNode:H,isNullOrUndefined:$,isNumeric:t=>{const e=1*t;return Number.isFinite(e)&&"number"==typeof e},isObject:N,isPromiseLike:t=>!!t&&"function"==typeof t.then,isRectInsideRect:(t,e)=>t.top>=e.top&&t.bottom<=e.bottom&&t.left>=e.left&&t.right<=e.right,isRectIntersect:W,mergeContentful:(...t)=>{const e=t.length;if(e>0&&void 0!==t[e-1]&&!N(t[e-1]))return t[e-1];let r=t[0]||{};for(let n=1;n<e;n++)r=A(r,t[n]||{},{arrayMerge:(t,e)=>[...e]});return r},nextTick:t=>{typeof window<"u"&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame(()=>{t()}):("function"==typeof setImmediate?setImmediate:setTimeout)(()=>{t()})},openFileDialog:(t="*.*")=>new Promise((e,r)=>{if(!V)return void r("Unable to open dialog with no dom.");const n=document.createElement("input");n.type="file",n.accept=t;let o=null,a=!1;globalThis.addEventListener?.("focus",()=>{setTimeout(()=>{o||a||(a=!0,e(null))},1e3)},{once:!0,passive:!0}),n.onchange=()=>{if(o=n.files[0],o){if(a)return void console.warn("File open detected after faux cancel.",o);e(o)}},n.autofocus=!0,n.click()}),rafThrottle:t=>{let e,r=!1,n=function(){r=!1,t(e)};return function(t){e=t,e&&e.persist&&e.persist(),r||(r=!0,requestAnimationFrame(n))}},removeEmptyProperties:B,removeEqualValues:q,removeListenerAll:t=>{if(!t)return[];for(let e=0;e<t.length;e++)t[e]&&t[e]();return[]},requestTimeout:(t,e)=>{const r=D(),n={id:requestAnimationFrame(function o(){D()-r>=e?t.call(null):n.id=requestAnimationFrame(o)})};return n},roundAccurately:(t,e=0)=>{if(null==t||!isFinite(t))return null;const r=10**e;return Number(Math.round(t*r)/r)},setToPath:(t,e,r)=>{const n=e.split(".");let o=t;if(!o)throw new Error("Can not set path to a null path.");for(let t=0;o&&t<n.length-1;t++){const e=n[t];let r=o[e];if(null==r&&(r={},o[e]=r),!N(r))throw new Error("Can not set path to a non object path.");o=r}if("number"!=typeof r&&"boolean"!=typeof r&&"string"!=typeof r&&!N(r))throw new Error(`Can not set path to ${r} that is not a a supported primitive.`);return o[n[n.length-1]]=r,t},splitNumber:t=>{let e=Math.abs(t);if(isNaN(e)||!isFinite(t))return null;let r=0|e,n=e-r,o=0,a=0,i=1;if(n>5e-8)for(;a<8&&Math.abs(o/i-n)>5e-8;)a++,i*=10,o=Math.round(n*i);return{ip:Math.trunc(t),fp:o,ipLength:Math.ceil(Math.log10(r+1)),fpLength:a}},subtractRect:(t,e,r=!1)=>{if(!e)return[t];if(!W(t,e))return[];const n=[];let o=t;const a=()=>{e.top>o.top&&e.top<o.bottom&&(n.push({...o,bottom:e.top}),o={...o,top:e.top})},i=()=>{e.bottom>o.top&&e.bottom<o.bottom&&(n.push({...o,top:e.bottom}),o={...o,bottom:e.bottom})},l=()=>{e.right>o.left&&e.right<o.right&&(n.push({...o,left:e.right}),o={...o,right:e.right})},s=()=>{e.left>o.left&&e.left<o.right&&(n.push({...o,right:e.left}),o={...o,left:e.left})};return r?(s(),l(),a(),i()):(a(),i(),l(),s()),n},textToKey:t=>t.replace(/[^a-zA-Z0-9]/g,"").toLowerCase(),throttle:function(t,e){let r=null;return(...n)=>{const o=Date.now();(!r||o-r>=e)&&(r=o,t(...n))}},toSafeJSON:function t(e){if(null===e||"object"!=typeof e)return e;if("function"==typeof e.toJSON)return e.toJSON();if(Array.isArray(e))return e.map(e=>t(e));if("function"==typeof e.toString&&e.toString!==Object.prototype.toString)return e.toString();const r={};for(const n in e)e.hasOwnProperty(n)&&(r[n]=t(e[n]));return r},transpose:t=>{if(!t)return t;const e=t.length,r=t[0].length,n=[];for(let t=0;t<r;t++)n[t]=Array(e);for(let o=0;o<e;o++)for(let e=0;e<r;e++)n[e][o]=t[o][e];return n},uuidV4:P,validEnumValue:(t,e)=>{if(!Object.values(t).includes(e))throw new Error(`Invalid type: ${e??"null"}. Must be one of: ${Object.values(e).join(", ")}.`)},whenFocus:async(t,e=!1)=>new Promise(r=>{K(t,e)?r(!0):t.addEventListener("focusin",()=>{r(!0)},{once:!0}),t.focus()})},Symbol.toStringTag,{value:"Module"}));Object.freeze(Object.defineProperty({__proto__:null,MESSAGE_ERROR_INVALID_ARG:t=>`Invalid argument: '${t}'.`},Symbol.toStringTag,{value:"Module"}));const Z=t=>{const e=new Uint8Array(t),r=e.byteLength;let n="";for(let t=0;t<r;t++)n+=String.fromCharCode(e[t]);if(typeof window<"u"&&"function"==typeof globalThis.btoa)return globalThis.btoa(n);if(typeof Buffer<"u")return Buffer.from(n,"binary").toString("base64");throw new Error("Unsupported environment")},X=t=>new Promise((e,r)=>{if(t)if(typeof FileReader<"u"){const n=new FileReader;n.onload=()=>{e(n.result)},n.onerror=()=>{r(n.error)},n.readAsText(t)}else if(typeof Buffer<"u"){const n=t=>Buffer.from(t).toString("utf-8");t.arrayBuffer().then(t=>{e(n(t))}).catch(t=>{r(t)})}else r(new Error("Unsupported environment"));else e("")});Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_MIME_TYPE:"*/*",arrayBufferToBase64:Z,base64ToArrayBuffer:t=>{const e=typeof window<"u"&&"function"==typeof globalThis.atob?globalThis.atob(t):Buffer.from(t,"base64").toString("binary"),r=e.length,n=new Uint8Array(r);for(let t=0;t<r;t++)n[t]=e.charCodeAt(t);return n.buffer},blobToString:X},Symbol.toStringTag,{value:"Module"}));const Q="data:image/png;base64,",tt="Unable to resolve image.",et=t=>new Promise(async(e,r)=>{let n=null;try{n=new Image,n.src=t,n.addEventListener("load",function(){e({width:n.naturalWidth,height:n.naturalHeight})},{once:!0}),n.addEventListener("error",function(){URL.revokeObjectURL(t),r("Invalid Image")},{once:!0}),await n.decode("sync")}catch{n?.src&&URL.revokeObjectURL(n.src)}n||r(tt)}),rt="image/svg+xml";var nt,ot;Object.freeze(Object.defineProperty({__proto__:null,DATA_URL_PNG_PREFIX:Q,getImageDataUrl:(t,e=1)=>new Promise(async(r,n)=>{let o=null;try{o=new Image,o.src=t,o.addEventListener("load",function(){try{const t=document.createElement("canvas");t.width=o.naturalWidth,t.height=o.naturalHeight,t.getContext("2d").drawImage(o,0,0);const n=t.toDataURL("image/png",e);r({elemImg:o,dataUrl:n})}catch(e){URL.revokeObjectURL(t),n(e)}},{once:!0}),o.addEventListener("error",function(){URL.revokeObjectURL(t),n("Invalid Image")},{once:!0}),await o.decode("sync")}catch{o?.src&&URL.revokeObjectURL(o.src)}o||n(tt)}),loadImageDetails:async(t,e=null)=>{let r=null;const n=async()=>{try{const n=e??"image/*",o=URL.createObjectURL(new Blob([t],{type:n})),a=await et(o);r={mimeType:n,naturalDimensions:a,asUrl:o}}catch{}},o=async()=>{try{const n=(new TextDecoder).decode(t),o=URL.createObjectURL(new Blob([n],{type:rt})),a=await et(o);r={mimeType:e??rt,naturalDimensions:a,asUrl:o,asSVGText:n}}catch{}};if(e===rt?await o():e.startsWith("image/")?await n():(await n(),r||await o()),!r)throw new Error("Failed to load image");return r}},Symbol.toStringTag,{value:"Module"})),(ot=nt||(nt={})).resolveTypedUpdates=(t,e,r,n)=>{if(null===t)return t;if(void 0===t)return n;let o=t;if(e?.shorthand){const n=e?.shorthand(t,r);void 0!==n&&(o=n)}if(null!==o&&e?.getSubType){const t=e.getSubType(o);t&&(e=t)}const a=e?.properties,i=e?.arrayType??!1;let l=o;if(e&&e.merge&&l&&n)l=e.merge(l,n,r);else if(!i&&a){const t=Object.keys({...o,...n});l=null;for(let e=0;e<t.length;e++){const i=t[e];let s,c=o[i];if(void 0!==c){const t=a[i];s=t?(0,ot.resolveTypedUpdates)(c,t,r,n?.[i]):c}else s=n?.[i];null!=s&&(l=l??{},l[i]=s)}}return l};const at="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.",it="You do not have permissions to access the clipboard.\nAll copy and paste operations will be limited to the browser tab.",lt={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:it,PermsWrite:J()===G.Safari?at:it,PermsRead:J()===G.Safari?at:it},st=async()=>new Promise(t=>{document.hasFocus()?t():globalThis.addEventListener?.("focus",()=>{t()},{once:!0}),document.activeElement.focus?.()}),ct=async(t,e,r)=>{if(J()===G.Safari)return await r(new Error(lt.Safari));try{const n=async t=>{try{return await t()}catch(t){if(t.message?.includes("Document is not focused"))return!1;throw t}},o=await(globalThis?.navigator?.permissions?.query({name:t,allowWithoutGesture:!0,allowWithoutSanitization:!0}));let a=!1;if("prompt"===o.state&&(a=await n(e)),a||"granted"!==o.state||(a=await e()),!a)return await r(new Error(o.state))}catch(t){return"No valid data on clipboard"===t.message||"DataError"===t.name?void 0:await r(t)}},ut=async e=>{try{return await e.read({unsanitized:[t]})}catch{}return await e.read()};if(!globalThis.ClipboardItem){const t=(t,e)=>new Blob([e],{type:t});class e{constructor(e,r){this._items={},this._types=Object.keys(e);const n={},o=Object.keys(e);for(let r=0;r<o.length;r++){const a=o[r];let i=e[a];n[a]="string"==typeof i?t(a,i):i}this._items=n,this._presentationStyle=r?.presentationStyle??"unspecified"}get types(){return this._types}getType(t){return Promise.resolve(this._items[t])}supports(t){return!0}}globalThis.ClipboardItem=e}const dt=async(e,r=t)=>new Promise(async(t,n)=>{try{const n=await(async(t,e)=>{if(!t)return null;const r=await ut(t);let n=!1;for(let t=0;!n&&r&&t<r.length;t++)if(n=r[t].types.includes(e),n)return await r[t].getType(e);return n?void 0:null})(e,r);if(n){const e=new FileReader;e.onload=()=>{t(e.result)},e.onerror=()=>{t("")},e.readAsText(n)}else t("")}catch(t){n(t)}}),ft=async(e,r=t)=>{const n=await dt(e,r);if(!n)return null;let o=null;try{o=(new DOMParser).parseFromString(n,t)}catch{console.warn("Can't parse html from clipboard.")}return o},pt="clipboard-uuid",wt="web text/uuid",ht=t=>`<div style="display:none" ${pt}="${t}"/>`,yt=(e,r)=>{let n=null;try{const o=(new DOMParser).parseFromString(r,t);o.body.firstElementChild.setAttribute(pt,e),n=o.getElementsByTagName("body")[0].innerHTML}catch(t){console.warn("Can't embed uuid.",t)}return n},gt=(t,e)=>{if(!e||!t)return!1;try{const r=e.querySelectorAll(`[${pt}="${t}"]`);if(r&&1===r.length)return!0;if(e.querySelector("parsererror"))throw new Error("We are unable to parse node");return!1}catch{return!1}};class bt{constructor(t){if(void 0===t?.nativeClipboard||!0===t?.nativeClipboard)try{this._nativeClipboard=globalThis?.navigator.clipboard}catch{!0===t?.nativeClipboard&&console.warn("NativeClipboard option set to true but no native clipboard available.")}else this._nativeClipboard=!1===t?.nativeClipboard?null:t?.nativeClipboard;this._disableCheckOnFocus=t?.disableCheckOnFocus??!1,this._init()}async _checkForChanges(){this._nativeClipboard&&this._state&&!this._disableCheckOnFocus&&await ct("clipboard-read",async()=>{await st();const e=await dt(this._nativeClipboard,wt);if(!this._state||e&&e===this._state.uuid)return!0;const r=await ft(this._nativeClipboard,t);return!this._state||(gt(this._state.uuid,r)||this.clear(),!0)},async t=>{"denied"===t?.message||t.message?.includes("Document is not focused")||J()===G.Safari||console.warn("Unable to detect clipboard changes: ",t)})}_init(){const t=this;this._listeners=new Map,this._listenersCapture=new Map,this._state=null,this._nativeClipboard&&(this._onFocus=()=>{t._checkForChanges()},this._onBlur=()=>{globalThis.addEventListener?.("focus",t._onFocus,{once:!0})},globalThis.addEventListener?.("blur",this._onBlur),this._nativeClipboard.addEventListener("clipboardchange",e=>{t._checkForChanges()}))}async read(){if(!this._nativeClipboard)return this._state?.items??null;const e=this;return await ct("clipboard-read",async()=>{if(await st(),this._state?.uuid){const r=await dt(this._nativeClipboard,wt);if(r&&r===e._state.uuid)return!0;const n=await ft(this._nativeClipboard,t);if(gt(e._state?.uuid,n))return!0}return e._state={items:await ut(this._nativeClipboard),uuid:null,ref:null},this.dispatchEvent(new Event("clipboardread")),!0},async t=>{this.dispatchEvent(new Event("clipboarderrorread"))}),this._state?.items??[]}async write(t){return this._write({uuid:P(),items:t,ref:null})}async _write(n){if(!this._nativeClipboard)return this._state=n,this.dispatchEvent(new Event("clipboardwrite")),this.dispatchEvent(new Event("clipboardchange")),null;const o=this,a=[],i=n.uuid;let l=n.items??[];const s=()=>{o._state={uuid:i,ref:n.ref,items:a},o.dispatchEvent(new Event("clipboardwrite")),o.dispatchEvent(new Event("clipboardchange"))};await ct("clipboard-write",async()=>{await st(),i&&0===l.length&&(l.push(new ClipboardItem({[wt]:new Blob([i],{type:wt})})),l.push(new ClipboardItem({[t]:new Blob([ht(i)],{type:t})})));for(let n=0;n<Math.min(1,l.length);n++){const o=l[n];let s=o.types.indexOf(t),c=null;if(-1!==s){const e=await o.getType(t);c=await X(e),c&&(c=yt(i,c))}if(!c&&o.types.includes(e)){const t=await o.getType(e);if(t){let e=null;"string"==typeof t?(console.warn("text as string",t),e=t):e=await X(t),e&&(c=`<div ${pt}="${i}">${e}</div>`)}}if(!c&&o.types.includes(r)){const t=await o.getType(r),e=Z(await t.arrayBuffer());c=`<div ${pt}="${i}"><img src="${Q+e}"/></div>`}!c&&i&&(c=ht(i));const u=new Blob([c??""],{type:t}),d={};for(let t=0;t<o.types.length;t++){const e=o.types[t];d[e]=t===s?u:o.getType(e)}c&&-1===s&&(d[t]=u),i&&(d[wt]=new Blob([i],{type:wt})),a.push(new ClipboardItem(d))}try{a&&0!==a.length?await this._nativeClipboard.write(a):await(async t=>{t&&await t.writeText("")})(this._nativeClipboard)}catch(t){t.message?.includes("Document is not focused")||console.warn("Unable to write to native clipboard: ",t)}return s(),!0},async t=>{this.dispatchEvent(new Event("clipboarderrorwrite")),s()})}async writeReference(n){if(!n)return void this.clear();let o=null;const a={};try{const t=await(n.toText?.())??null;t&&(a[e]=new Blob([t??""],{type:e}))}catch(t){o=t}try{const e=await(n.toHtml?.())??null;e&&(a[t]=new Blob([e],{type:t}))}catch(t){o=t,console.warn("export to html",t)}try{const t=await(n.toImage?.())??null;t&&(a[r]=t)}catch(t){o=t,console.warn("export to png",t)}const i=this._write({uuid:P(),ref:n,items:Object.keys(a).length>0?[new ClipboardItem(a)]:null});if(o)throw o;return i}clear(t=!1){this._state&&(this._state=null,t&&this._write({uuid:null,ref:null,items:null}),this.dispatchEvent(new Event("clipboardwrite")),this.dispatchEvent(new Event("clipboardchange")))}async readReference(){return await this.read(),this._state?.ref??null}readText(){return new Promise(async(t,r)=>{const n=await this.read();let o=null;for(let t=0;!o&&n&&t<n.length;t++)n[t].types.includes(e)&&(o=await n[t].getType(e));if(!o)return void t("");const a=new FileReader;a.onload=()=>{t(a.result)},a.readAsText(o),a.onerror=t=>{r(t)}})}async writeText(t){const r=[new ClipboardItem({[e]:new Blob([t],{type:e})})];return this._write({uuid:P(),items:r,ref:null})}addEventListener(t,e,r={}){const n=r?.capture?this._listenersCapture:this._listeners;let o=n.get(t);o||(o=new Map,n.set(t,o)),o.set(e,"boolean"==typeof r?{}:r)}dispatchEvent(t){if(!t)return;const e=e=>{const r=e.get(t.type);r&&r.forEach((e,n)=>{try{"function"==typeof n?n(t):n.handleEvent&&n.handleEvent(t),e.once&&r.delete(n)}catch(t){console.warn(t)}})};return e(this._listenersCapture),e(this._listeners),!0}removeEventListener(t,e,r){const n=r?.capture?this._listenersCapture:this._listeners,o=n.get(t);o&&(o.delete(e),0===o.size&&n.delete(t))}close(){globalThis.removeEventListener?.("focus",this._onFocus),globalThis.removeEventListener?.("blur",this._onBlur)}}var mt;(mt=bt||(bt={})).ErrorMessages=lt,mt.Global=new mt;let Et=null,St=null,vt=null;const xt=Object.freeze({compileTypescript:async function(t){if(!t?.source)return null;if(St&&Y.deepEqual(St,t))return Et;const e=await async function(){if(vt)return vt;const{TypeScriptCompiler:t}=await import("./BEs22-ynP5XGO3w2.mjs");return vt=new t,vt}(),r=await e.compileModule(t);return Et=r,St=t,r}}),_t=Object.freeze(Object.defineProperty({__proto__:null,ScriptingUtils:xt},Symbol.toStringTag,{value:"Module"}));export{Y as $,_t as i};
7
+ const t="text/html",e="text/plain",r="image/png",n=Object.freeze({left:0,top:0}),o=Object.freeze({left:0,top:0,bottom:0,right:0}),a=Object.freeze({x:0,y:0,width:0,height:0});Object.freeze(Object.defineProperty({__proto__:null,EmptyBounds:a,EmptyRect:o,EmptyTopLeft:n},Symbol.toStringTag,{value:"Module"}));const i="column",l="row",s=Object.freeze({colIndex:0,rowIndex:0}),c=Object.freeze({colStart:0,rowStart:0,colEnd:0,rowEnd:0}),u=(t,e)=>t.colStart===e.colStart?t.rowStart-e.rowStart:t.colStart-e.colStart,d=(t,e)=>t.rowStart===e.rowStart?t.colStart-e.colStart:t.rowStart-e.rowStart,f=(t,e)=>t.rowEnd===e.rowEnd?e.colEnd-t.colEnd:e.rowEnd-t.rowEnd,p=(t,e)=>t.colEnd===e.colEnd?e.rowEnd-t.rowEnd:e.colEnd-t.colEnd,w=(t,e)=>t.colIndex===e.colIndex?t.rowIndex-e.rowIndex:t.colIndex-e.colIndex,h=(t,e)=>t.rowIndex===e.rowIndex?t.colIndex-e.colIndex:t.rowIndex-e.rowIndex,y=(t=l,e=!1)=>e?t!==i?f:p:t!==i?d:u,g=(t,e)=>t===e||!(!t||!e)&&t.rowIndex===e.rowIndex&&t.colIndex===e.colIndex,b=(t,e)=>t===e||!(!t||!e)&&t.rowStart===e.rowStart&&t.rowEnd===e.rowEnd&&t.colStart===e.colStart&&t.colEnd===e.colEnd,m=(t,e)=>!(!t||!e||t.colStart>e.colEnd||e.colStart>t.colEnd||t.rowStart>e.rowEnd||e.rowStart>t.rowEnd),E=(t,e)=>{if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!b(t[r],e[r]))return!1;return!0},S=(t,e,r)=>{if(!t&&!e)return null;if(!t)return r?e:{...e};if(!e)return r?t:{...t};const n=Math.min(t.colStart,e.colStart),o=Math.min(t.rowStart,e.rowStart),a=Math.max(t.colEnd,e.colEnd),i=Math.max(t.rowEnd,e.rowEnd);let l=r;return l?(l.colStart=n,l.rowStart=o,l.colEnd=a,l.rowEnd=i):l={colStart:n,rowStart:o,colEnd:a,rowEnd:i},l},v=(t,e)=>{if(!e||0===e.length)return t;const r={...t};for(let t=0;t<e.length;t++){const n=e[t];m(r,n)&&(r.rowStart=Math.min(r.rowStart,n.rowStart),r.colStart=Math.min(r.colStart,n.colStart),r.rowEnd=Math.max(r.rowEnd,n.rowEnd),r.colEnd=Math.max(r.colEnd,n.colEnd))}return r},x=[null,null],_=(t,e,r)=>{if(t[0].value===t[1].value)return e};function O(t,e=2,r,n=l,o){let a=[...t];if(e<=0||t.length<=1)return a;let s=n===i,c=0,u=!1;do{const t=a.sort(y(s?l:i));a=[],a.push(t[0]);const e=t.length;let d=0,f=t[0],p=f.colStart,w=f.rowStart,h=f.colEnd,g=f.rowEnd;for(let i=1;i<e;i++){const e=t[i];let l=!1;if(l=s?f&&w===e.rowStart&&g===e.rowEnd&&h+1===e.colStart:f&&p===e.colStart&&h===e.colEnd&&g+1===e.rowStart,l){let t={colStart:p,rowStart:w,colEnd:s?e.colEnd:h,rowEnd:s?g:e.rowEnd};if(void 0!==f.value&&(t.value=f.value),r){const a=o??[null,null];a[0]=f,a[1]=e,t=r(a,t,n)}if(t){a[d]=t,u=!0,f=t,p=f.colStart,w=f.rowStart,h=f.colEnd,g=f.rowEnd;continue}}a[++d]=e,f=e,p=f.colStart,w=f.rowStart,h=f.colEnd,g=f.rowEnd}c++,s=!s,1===c&&(u=!0)}while(c<e&&u&&a.length>1);return a}Object.freeze(Object.defineProperty({__proto__:null,EmptyCell:s,EmptyRange:c,cellToRange:(t,e)=>{if(!t)return null;let r=e;return r||(r={...t},delete r.colIndex,delete r.rowIndex),r.colStart=t.colIndex??0,r.rowStart=t.rowIndex??0,r.colEnd=t.colIndex??0,r.rowEnd=t.rowIndex??0,r},columnFirstCellComparator:w,columnFirstRangeComparator:u,createCellComparator:(t=l,e=!1)=>e?t!==i?(t,e)=>t.rowIndex===e.rowIndex?e.colIndex-t.colIndex:e.rowIndex-t.rowIndex:(t,e)=>t.colIndex===e.colIndex?e.rowIndex-t.rowIndex:e.colIndex-t.colIndex:t!==i?h:w,createConflatingRanges:(t,e=!1)=>{const r=[];let n,o,a=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;return{append:(i,l,c)=>{let u=!0;const d=void 0!==c;if(d){const r=t?t(o,c,e):o===c?c:void 0;void 0===r?u=!1:c=r}if(u&&l===s+1&&i===a)return e?n.rowEnd=l:n.colEnd=l,s=l,void(o=c);n&&r.push(n);const f=e?i:l,p=e?l:i;n={colStart:f,rowStart:p,colEnd:f,rowEnd:p},d&&(n.value=c),a=i,s=l,o=c},done:t=>(n&&(r.push(n),n=null),t?O(r,3,!0===t?_:t,e?i:l,x):r)}},createRangeComparator:y,defaultRange:(t,e,r)=>t?r?(r.colStart=t.colStart??e.colStart,r.rowStart=t.rowStart??e.rowStart,r.colEnd=t.colEnd??e.colEnd,r.rowEnd=t.rowEnd??e.rowEnd,r):{colStart:t.colStart??e.colStart,rowStart:t.rowStart??e.rowStart,colEnd:t.colEnd??e.colEnd,rowEnd:t.rowEnd??e.rowEnd}:e,extendRangeToIntersectingRanges:v,extendRangeToUnionRanges:(t,e)=>{if(!e||0===e.length)return t;let r=t,n=null;for(;!b(r,n);)n=r,r=v(n,e);return r},indexOfCoords:(t,e)=>{const r={colStart:t.colIndex,rowStart:t.rowIndex,colEnd:t.colIndex,rowEnd:t.rowIndex};for(let t=e.length-1;t>=0;t--)if(m(r,e[t]))return t;return-1},intersectRanges:(t,e,r)=>{if(!t)return r?e:{...e};if(!e)return r?t:{...t};if(!t&&!e||t.rowStart>e.rowEnd||t.rowEnd<e.rowStart||t.colStart>e.colEnd||t.colEnd<e.colStart)return null;const n=Math.max(t.colStart,e.colStart),o=Math.max(t.rowStart,e.rowStart),a=Math.min(t.colEnd,e.colEnd),i=Math.min(t.rowEnd,e.rowEnd);let l=r;return l?(l.colStart=n,l.rowStart=o,l.colEnd=a,l.rowEnd=i):l={colStart:n,rowStart:o,colEnd:a,rowEnd:i},l},isCellWithinRange:(t,e)=>!(!t||!e||t.rowIndex<e.rowStart||t.rowIndex>e.rowEnd||t.colIndex<e.colStart||t.colIndex>e.colEnd),isEqualCells:g,isEqualRanges:b,isEqualRangesArrays:E,isEqualSelectionCoords:(t,e)=>t===e||!(!t||!e)&&t.rangeIndex===e.rangeIndex&&!!g(t.cell,e.cell)&&E(t.ranges,e.ranges),isRangeWithinRange:(t,e)=>!(t.rowStart<e.rowStart||t.rowEnd>e.rowEnd||t.colStart<e.colStart||t.colEnd>e.colEnd),isRangesIntersect:m,isSingleCell:t=>!!t&&t.rowEnd===t.rowStart&&t.colStart===t.colEnd,isValidRange:t=>!(!t||"number"!=typeof t.colStart||t.colStart<0||"number"!=typeof t.colEnd||t.colEnd<t.colStart||"number"!=typeof t.rowStart||t.rowStart<0||"number"!=typeof t.rowEnd||t.rowEnd<t.rowStart),mergeRangedValues:O,rowFirstCellComparator:h,rowFirstRangeComparator:d,sanitizeRange:t=>t?{colStart:t.colIndex??t.colStart??0,rowStart:t.rowIndex??t.rowStart??0,colEnd:t.colIndex??t.colEnd??0,rowEnd:t.rowIndex??t.rowEnd??0}:null,translateRange:(t,e=-t.rowStart,r=-t.colStart,n)=>n?(n.colStart=t.colStart+r,n.rowStart=t.rowStart+e,n.colEnd=t.colEnd+r,n.rowEnd=t.rowEnd+e,n):{colStart:t.colStart+r,rowStart:t.rowStart+e,colEnd:t.colEnd+r,rowEnd:t.rowEnd+e},unionRanges:S,unionRangesArrays:(t,e,r)=>{if(!t||0===t.length)return null;if(1===t.length&&!e)return t[0];let n=t[0];for(let e=1;e<t.length;e++)n=S(n,t[e],r);return e&&(n=S(n,e,r)),n}},Symbol.toStringTag,{value:"Module"}));const I="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function j(t){return function(t){return!!t&&"object"==typeof t}(t)&&!function(t){const e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||t.$$typeof===I}(t)}function T(t,e){return!1!==e.clone&&e.isMergeableObject(t)?A((r=t,Array.isArray(r)?[]:{}),t,e):t;var r}function C(t,e,r){return t.concat(e).map(function(t){return T(t,r)})}function M(t){return Object.keys(t).concat((e=t,Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]));var e}function R(t,e){try{return e in t}catch{return!1}}function A(t,e,r){(r=r||{}).arrayMerge=r.arrayMerge||C,r.isMergeableObject=r.isMergeableObject||j,r.cloneUnlessOtherwiseSpecified=T;const n=Array.isArray(e);return n===Array.isArray(t)?n?r.arrayMerge(t,e,r):function(t,e,r){const n={};return r.isMergeableObject(t)&&M(t).forEach(function(e){n[e]=T(t[e],r)}),M(e).forEach(function(o){var a,i;R(a=t,i=o)&&(!Object.hasOwnProperty.call(a,i)||!Object.propertyIsEnumerable.call(a,i))||(R(t,o)&&r.isMergeableObject(e[o])?n[o]=function(t,e){if(!e.customMerge)return A;const r=e.customMerge(t);return"function"==typeof r?r:A}(o,r)(t[o],e[o],r):n[o]=T(e[o],r))}),n}(t,e,r):T(e,r)}A.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(t,r){return A(t,r,e)},{})};const F=Object.freeze([]),L=Object.freeze({}),U=t=>t,P=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){let e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}),k=(t,e)=>t===e||!(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length)&&t.every((t,r)=>t===e[r]),N=t=>"object"==typeof t&&!Array.isArray(t)&&null!==t,B=t=>"object"!=typeof t||Array.isArray(t)||null===t?t:(Object.keys(t).forEach(function(e){t[e]&&"object"==typeof t[e]?B(t[e]):null!==t[e]&&void 0!==t[e]||delete t[e],"object"==typeof t[e]&&0===Object.keys(t[e]).length&&delete t[e]}),0===Object.keys(t).length?null:t),z=(t,e)=>!(t!==e&&!k(t,e)&&!t.isEqual?.(e)),q=(t,e,r=z)=>{if(null==t||t===e)return null;if(!t||"object"!=typeof t||Array.isArray(t)||t.isImmutable?.())return r(t,e)?null:t;const n=Object.keys(t);if(0===n.length)return null;let o=!1;for(let a=0;a<n.length;a++){const i=n[a];null===q(t[i],e?.[i],r)&&(o=!0,delete t[i])}return o&&0===Object.keys(t).length?null:void 0},D="object"==typeof performance&&"function"==typeof performance.now?()=>performance.now():()=>Date.now(),$=t=>null==t,W=(t,e)=>!(e.left>t.right||e.right<t.left||e.top>t.bottom||e.bottom<t.top),V=!(typeof window>"u"||!window.document||!window.document.createElement),G={Windows:"windows",MacOS:"macos",IOS:"ios",Linux:"linux",Android:"android",Safari:"safari",Firefox:"firefox",Node:"node",Unknown:"unknown"},J=()=>{if(H())return G.Node;const t=void 0!==globalThis.navigator&&globalThis.navigator.userAgent?globalThis.navigator.userAgent.toLowerCase():"";return t?/(win32|win64|windows|wince)/i.test(t)?G.Windows:/(macintosh|macintel|macppc|mac68k|macos)/i.test(t)?G.MacOS:/(iphone|ipad|ipod)/i.test(t)?G.IOS:/android/.test(t)?G.Android:/linux/.test(t)?G.Linux:/^((?!chrome|android|).)*safari/i.test(t)?G.Safari:/^((?!chrome|android|Seamonkey).)*firefox/i.test(t)?G.Firefox:G.Unknown:G.Unknown};function H(){return typeof process<"u"&&"node"===process.release?.name||(typeof process<"u"&&process.browser,!1)}const K=(t,e=!1)=>(document.hasFocus()||e)&&(t===document.activeElement||t?.contains(document.activeElement)),Y=Object.freeze(Object.defineProperty({__proto__:null,EmptyArray:F,EmptyObject:L,OSType:G,arrayMove:function(t,e,r){const n=t.slice();return n.splice(r<0?n.length+r:r,0,n.splice(e,1)[0]),n},asNumber:t=>{const e=1*t;return Number.isFinite(e)?e:0},camelToPrettyCase:t=>1===t.length?t.toUpperCase():t.replace(/([A-Z])/g," $1").replace(/^./,function(t){return t.toUpperCase()}).trim(),canUseDOM:V,cancelTimeout:t=>{cancelAnimationFrame(t.id)},castToString:t=>null==t||void 0===t?"":"string"!=typeof t?""+t:t,cloneObject:t=>$(t)?t:JSON.parse(JSON.stringify(t)),consoleWithNoSource:(...t)=>new Promise(e=>{setTimeout(()=>{Function("console.log.apply(console, arguments)").apply(null,t),e()})}),debounce:function(t,e=300,r=!1){let n,o,a,i,l=0;function s(){let c=Date.now()-l;c<e&&c>=0?n=setTimeout(s,e-c):(n=null,r||(i=t.apply(a,o),a=o=null))}null==e&&(e=100);const c=function(){a=globalThis,o=arguments,l=Date.now();var c=r&&!n;return n||(n=setTimeout(s,e)),c&&(i=t.apply(a,o),a=o=null),i};return c.clear=function(){n&&(clearTimeout(n),n=null)},c.flush=function(){n&&(i=t.apply(a,o),a=o=null,clearTimeout(n),n=null)},c},deepEqual:function t(e,r){if(e===r)return!0;if(e&&r&&"object"==typeof e&&"object"==typeof r){if(e.constructor!==r.constructor)return!1;let n,o,a;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(o=n;0!==o--;)if(!t(e[o],r[o]))return!1;return!0}if(e instanceof Map&&r instanceof Map){if(e.size!==r.size)return!1;for(o of e.entries())if(!r.has(o[0]))return!1;for(o of e.entries())if(!t(o[1],r.get(o[0])))return!1;return!0}if(e instanceof Set&&r instanceof Set){if(e.size!==r.size)return!1;for(o of e.entries())if(!r.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(r)){if(n=e.length,n!=r.length)return!1;for(o=n;0!==o--;)if(e[o]!==r[o])return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(a=Object.keys(e),n=a.length,n!==Object.keys(r).length)return!1;for(o=n;0!==o--;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;for(o=n;0!==o--;){let n=a[o];if(!("_owner"===n&&e.$$typeof||t(e[n],r[n])))return!1}return!0}return e!=e&&r!=r},deepFreeze:function t(e){return Object.freeze(e),Object.keys(e).forEach(r=>{"object"!=typeof e[r]||null===e[r]||Object.isFrozen(e[r])||t(e[r])}),e},deepMerge:A,diffValues:(t,e)=>{const r={},n=Object.keys(e),o=n.length;for(let a=0;a<o;a++){const o=n[a];t[o]!==e[o]&&(void 0===t[o]?r[o]=e[o]:r[o]=t[o])}return 0===Object.keys(r).length?null:r},findEqualOrGreater:function(t,e,r=U){let n=0,o=t.length-1;for(;n<=o;){let a=Math.floor((n+o)/2),i=r(t[a]);if(i===e)return a;i<e?n=a+1:o=a-1}return n},findEqualOrLesser:function(t,e,r=U){let n=t.length-1,o=0;for(;n>=o;){let a=Math.floor((n+o)/2),i=r(t[a]);if(i===e)return a;i>e?n=a-1:o=a+1}return n},findNextStep:(t,e=!0,r=15,n=10,o=400)=>{const a=Math.max(t-n,0)+(e?1:-1);return Math.min(o,Math[e?"ceil":"floor"](a/r)*r+n)},getDPI:()=>{let t=1;return"object"==typeof window&&(t=window.devicePixelRatio||1),t},getFromPath:(t,e)=>{const r=e.split(".");let n=t;for(let t=0;t<r.length;t++){const e=r[t];if(!n)return null;let o=n[e];if("function"==typeof o&&(o=o.bind(n)()),!o||!N(o))return o;n=o}return n??null},getOS:J,hasFocus:K,isDefined:t=>null!=t,isEmpty:t=>null==t||""===t,isEqualArrays:k,isEqualBounds:(t,e)=>t===e||!(t&&!e||e&&!t)&&t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height,isEqualObjectKeys:(t,e)=>{if(t===e)return!0;if(t&&!e||e&&!t)return!1;const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!1;for(let n=0;n<r.length;n++)if(t[r[n]]!==e[r[n]])return!1;return!0},isNode:H,isNullOrUndefined:$,isNumeric:t=>{const e=1*t;return Number.isFinite(e)&&"number"==typeof e},isObject:N,isPromiseLike:t=>!!t&&"function"==typeof t.then,isRectInsideRect:(t,e)=>t.top>=e.top&&t.bottom<=e.bottom&&t.left>=e.left&&t.right<=e.right,isRectIntersect:W,mergeContentful:(...t)=>{const e=t.length;if(e>0&&void 0!==t[e-1]&&!N(t[e-1]))return t[e-1];let r=t[0]||{};for(let n=1;n<e;n++)r=A(r,t[n]||{},{arrayMerge:(t,e)=>[...e]});return r},nextTick:t=>{typeof window<"u"&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame(()=>{t()}):("function"==typeof setImmediate?setImmediate:setTimeout)(()=>{t()})},openFileDialog:(t="*.*")=>new Promise((e,r)=>{if(!V)return void r("Unable to open dialog with no dom.");const n=document.createElement("input");n.type="file",n.accept=t;let o=null,a=!1;globalThis.addEventListener?.("focus",()=>{setTimeout(()=>{o||a||(a=!0,e(null))},1e3)},{once:!0,passive:!0}),n.onchange=()=>{if(o=n.files[0],o){if(a)return void console.warn("File open detected after faux cancel.",o);e(o)}},n.autofocus=!0,n.click()}),rafThrottle:t=>{let e,r=!1,n=function(){r=!1,t(e)};return function(t){e=t,e&&e.persist&&e.persist(),r||(r=!0,requestAnimationFrame(n))}},removeEmptyProperties:B,removeEqualValues:q,removeListenerAll:t=>{if(!t)return[];for(let e=0;e<t.length;e++)t[e]&&t[e]();return[]},requestTimeout:(t,e)=>{const r=D(),n={id:requestAnimationFrame(function o(){D()-r>=e?t.call(null):n.id=requestAnimationFrame(o)})};return n},roundAccurately:(t,e=0)=>{if(null==t||!isFinite(t))return null;const r=10**e;return Number(Math.round(t*r)/r)},setToPath:(t,e,r)=>{const n=e.split(".");let o=t;if(!o)throw new Error("Can not set path to a null path.");for(let t=0;o&&t<n.length-1;t++){const e=n[t];let r=o[e];if(null==r&&(r={},o[e]=r),!N(r))throw new Error("Can not set path to a non object path.");o=r}if("number"!=typeof r&&"boolean"!=typeof r&&"string"!=typeof r&&!N(r))throw new Error(`Can not set path to ${r} that is not a a supported primitive.`);return o[n[n.length-1]]=r,t},splitNumber:t=>{let e=Math.abs(t);if(isNaN(e)||!isFinite(t))return null;let r=0|e,n=e-r,o=0,a=0,i=1;if(n>5e-8)for(;a<8&&Math.abs(o/i-n)>5e-8;)a++,i*=10,o=Math.round(n*i);return{ip:Math.trunc(t),fp:o,ipLength:Math.ceil(Math.log10(r+1)),fpLength:a}},subtractRect:(t,e,r=!1)=>{if(!e)return[t];if(!W(t,e))return[];const n=[];let o=t;const a=()=>{e.top>o.top&&e.top<o.bottom&&(n.push({...o,bottom:e.top}),o={...o,top:e.top})},i=()=>{e.bottom>o.top&&e.bottom<o.bottom&&(n.push({...o,top:e.bottom}),o={...o,bottom:e.bottom})},l=()=>{e.right>o.left&&e.right<o.right&&(n.push({...o,left:e.right}),o={...o,right:e.right})},s=()=>{e.left>o.left&&e.left<o.right&&(n.push({...o,right:e.left}),o={...o,left:e.left})};return r?(s(),l(),a(),i()):(a(),i(),l(),s()),n},textToKey:t=>t.replace(/[^a-zA-Z0-9]/g,"").toLowerCase(),throttle:function(t,e){let r=null;return(...n)=>{const o=Date.now();(!r||o-r>=e)&&(r=o,t(...n))}},toSafeJSON:function t(e){if(null===e||"object"!=typeof e)return e;if("function"==typeof e.toJSON)return e.toJSON();if(Array.isArray(e))return e.map(e=>t(e));if("function"==typeof e.toString&&e.toString!==Object.prototype.toString)return e.toString();const r={};for(const n in e)e.hasOwnProperty(n)&&(r[n]=t(e[n]));return r},transpose:t=>{if(!t)return t;const e=t.length,r=t[0].length,n=[];for(let t=0;t<r;t++)n[t]=Array(e);for(let o=0;o<e;o++)for(let e=0;e<r;e++)n[e][o]=t[o][e];return n},uuidV4:P,validEnumValue:(t,e)=>{if(!Object.values(t).includes(e))throw new Error(`Invalid type: ${e??"null"}. Must be one of: ${Object.values(e).join(", ")}.`)},whenFocus:async(t,e=!1)=>new Promise(r=>{K(t,e)?r(!0):t.addEventListener("focusin",()=>{r(!0)},{once:!0}),t.focus()})},Symbol.toStringTag,{value:"Module"}));Object.freeze(Object.defineProperty({__proto__:null,MESSAGE_ERROR_INVALID_ARG:t=>`Invalid argument: '${t}'.`},Symbol.toStringTag,{value:"Module"}));const Z=t=>{const e=new Uint8Array(t),r=e.byteLength;let n="";for(let t=0;t<r;t++)n+=String.fromCharCode(e[t]);if(typeof window<"u"&&"function"==typeof globalThis.btoa)return globalThis.btoa(n);if(typeof Buffer<"u")return Buffer.from(n,"binary").toString("base64");throw new Error("Unsupported environment")},X=t=>new Promise((e,r)=>{if(t)if(typeof FileReader<"u"){const n=new FileReader;n.onload=()=>{e(n.result)},n.onerror=()=>{r(n.error)},n.readAsText(t)}else if(typeof Buffer<"u"){const n=t=>Buffer.from(t).toString("utf-8");t.arrayBuffer().then(t=>{e(n(t))}).catch(t=>{r(t)})}else r(new Error("Unsupported environment"));else e("")});Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_MIME_TYPE:"*/*",arrayBufferToBase64:Z,base64ToArrayBuffer:t=>{const e=typeof window<"u"&&"function"==typeof globalThis.atob?globalThis.atob(t):Buffer.from(t,"base64").toString("binary"),r=e.length,n=new Uint8Array(r);for(let t=0;t<r;t++)n[t]=e.charCodeAt(t);return n.buffer},blobToString:X},Symbol.toStringTag,{value:"Module"}));const Q="data:image/png;base64,",tt="Unable to resolve image.",et=t=>new Promise(async(e,r)=>{let n=null;try{n=new Image,n.src=t,n.addEventListener("load",function(){e({width:n.naturalWidth,height:n.naturalHeight})},{once:!0}),n.addEventListener("error",function(){URL.revokeObjectURL(t),r("Invalid Image")},{once:!0}),await n.decode("sync")}catch{n?.src&&URL.revokeObjectURL(n.src)}n||r(tt)}),rt="image/svg+xml";var nt,ot;Object.freeze(Object.defineProperty({__proto__:null,DATA_URL_PNG_PREFIX:Q,getImageDataUrl:(t,e=1)=>new Promise(async(r,n)=>{let o=null;try{o=new Image,o.src=t,o.addEventListener("load",function(){try{const t=document.createElement("canvas");t.width=o.naturalWidth,t.height=o.naturalHeight,t.getContext("2d").drawImage(o,0,0);const n=t.toDataURL("image/png",e);r({elemImg:o,dataUrl:n})}catch(e){URL.revokeObjectURL(t),n(e)}},{once:!0}),o.addEventListener("error",function(){URL.revokeObjectURL(t),n("Invalid Image")},{once:!0}),await o.decode("sync")}catch{o?.src&&URL.revokeObjectURL(o.src)}o||n(tt)}),loadImageDetails:async(t,e=null)=>{let r=null;const n=async()=>{try{const n=e??"image/*",o=URL.createObjectURL(new Blob([t],{type:n})),a=await et(o);r={mimeType:n,naturalDimensions:a,asUrl:o}}catch{}},o=async()=>{try{const n=(new TextDecoder).decode(t),o=URL.createObjectURL(new Blob([n],{type:rt})),a=await et(o);r={mimeType:e??rt,naturalDimensions:a,asUrl:o,asSVGText:n}}catch{}};if(e===rt?await o():e.startsWith("image/")?await n():(await n(),r||await o()),!r)throw new Error("Failed to load image");return r}},Symbol.toStringTag,{value:"Module"})),(ot=nt||(nt={})).resolveTypedUpdates=(t,e,r,n)=>{if(null===t)return t;if(void 0===t)return n;let o=t;if(e?.shorthand){const n=e?.shorthand(t,r);void 0!==n&&(o=n)}if(null!==o&&e?.getSubType){const t=e.getSubType(o);t&&(e=t)}const a=e?.properties,i=e?.arrayType??!1;let l=o;if(e&&e.merge&&l&&n)l=e.merge(l,n,r);else if(!i&&a){const t=Object.keys({...o,...n});l=null;for(let e=0;e<t.length;e++){const i=t[e];let s,c=o[i];if(void 0!==c){const t=a[i];s=t?(0,ot.resolveTypedUpdates)(c,t,r,n?.[i]):c}else s=n?.[i];null!=s&&(l=l??{},l[i]=s)}}return l};const at="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.",it="You do not have permissions to access the clipboard.\nAll copy and paste operations will be limited to the browser tab.",lt={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:it,PermsWrite:J()===G.Safari?at:it,PermsRead:J()===G.Safari?at:it},st=async()=>new Promise(t=>{document.hasFocus()?t():globalThis.addEventListener?.("focus",()=>{t()},{once:!0}),document.activeElement.focus?.()}),ct=async(t,e,r)=>{if(J()===G.Safari)return await r(new Error(lt.Safari));try{const n=async t=>{try{return await t()}catch(t){if(t.message?.includes("Document is not focused"))return!1;throw t}},o=await(globalThis?.navigator?.permissions?.query({name:t,allowWithoutGesture:!0,allowWithoutSanitization:!0}));let a=!1;if("prompt"===o.state&&(a=await n(e)),a||"granted"!==o.state||(a=await e()),!a)return await r(new Error(o.state))}catch(t){return"No valid data on clipboard"===t.message||"DataError"===t.name?void 0:await r(t)}},ut=async e=>{try{return await e.read({unsanitized:[t]})}catch{}return await e.read()};if(!globalThis.ClipboardItem){const t=(t,e)=>new Blob([e],{type:t});class e{constructor(e,r){this._items={},this._types=Object.keys(e);const n={},o=Object.keys(e);for(let r=0;r<o.length;r++){const a=o[r];let i=e[a];n[a]="string"==typeof i?t(a,i):i}this._items=n,this._presentationStyle=r?.presentationStyle??"unspecified"}get types(){return this._types}getType(t){return Promise.resolve(this._items[t])}supports(t){return!0}}globalThis.ClipboardItem=e}const dt=async(e,r=t)=>new Promise(async(t,n)=>{try{const n=await(async(t,e)=>{if(!t)return null;const r=await ut(t);let n=!1;for(let t=0;!n&&r&&t<r.length;t++)if(n=r[t].types.includes(e),n)return await r[t].getType(e);return n?void 0:null})(e,r);if(n){const e=new FileReader;e.onload=()=>{t(e.result)},e.onerror=()=>{t("")},e.readAsText(n)}else t("")}catch(t){n(t)}}),ft=async(e,r=t)=>{const n=await dt(e,r);if(!n)return null;let o=null;try{o=(new DOMParser).parseFromString(n,t)}catch{console.warn("Can't parse html from clipboard.")}return o},pt="clipboard-uuid",wt="web text/uuid",ht=t=>`<div style="display:none" ${pt}="${t}"/>`,yt=(e,r)=>{let n=null;try{const o=(new DOMParser).parseFromString(r,t);o.body.firstElementChild.setAttribute(pt,e),n=o.getElementsByTagName("body")[0].innerHTML}catch(t){console.warn("Can't embed uuid.",t)}return n},gt=(t,e)=>{if(!e||!t)return!1;try{const r=e.querySelectorAll(`[${pt}="${t}"]`);if(r&&1===r.length)return!0;if(e.querySelector("parsererror"))throw new Error("We are unable to parse node");return!1}catch{return!1}};class bt{constructor(t){if(void 0===t?.nativeClipboard||!0===t?.nativeClipboard)try{this._nativeClipboard=globalThis?.navigator.clipboard}catch{!0===t?.nativeClipboard&&console.warn("NativeClipboard option set to true but no native clipboard available.")}else this._nativeClipboard=!1===t?.nativeClipboard?null:t?.nativeClipboard;this._disableCheckOnFocus=t?.disableCheckOnFocus??!1,this._init()}async _checkForChanges(){this._nativeClipboard&&this._state&&!this._disableCheckOnFocus&&await ct("clipboard-read",async()=>{await st();const e=await dt(this._nativeClipboard,wt);if(!this._state||e&&e===this._state.uuid)return!0;const r=await ft(this._nativeClipboard,t);return!this._state||(gt(this._state.uuid,r)||this.clear(),!0)},async t=>{"denied"===t?.message||t.message?.includes("Document is not focused")||J()===G.Safari||console.warn("Unable to detect clipboard changes: ",t)})}_init(){const t=this;this._listeners=new Map,this._listenersCapture=new Map,this._state=null,this._nativeClipboard&&(this._onFocus=()=>{t._checkForChanges()},this._onBlur=()=>{globalThis.addEventListener?.("focus",t._onFocus,{once:!0})},globalThis.addEventListener?.("blur",this._onBlur),this._nativeClipboard.addEventListener("clipboardchange",e=>{t._checkForChanges()}))}async read(){if(!this._nativeClipboard)return this._state?.items??null;const e=this;return await ct("clipboard-read",async()=>{if(await st(),this._state?.uuid){const r=await dt(this._nativeClipboard,wt);if(r&&r===e._state.uuid)return!0;const n=await ft(this._nativeClipboard,t);if(gt(e._state?.uuid,n))return!0}return e._state={items:await ut(this._nativeClipboard),uuid:null,ref:null},this.dispatchEvent(new Event("clipboardread")),!0},async t=>{this.dispatchEvent(new Event("clipboarderrorread"))}),this._state?.items??[]}async write(t){return this._write({uuid:P(),items:t,ref:null})}async _write(n){if(!this._nativeClipboard)return this._state=n,this.dispatchEvent(new Event("clipboardwrite")),this.dispatchEvent(new Event("clipboardchange")),null;const o=this,a=[],i=n.uuid;let l=n.items??[];const s=()=>{o._state={uuid:i,ref:n.ref,items:a},o.dispatchEvent(new Event("clipboardwrite")),o.dispatchEvent(new Event("clipboardchange"))};await ct("clipboard-write",async()=>{await st(),i&&0===l.length&&(l.push(new ClipboardItem({[wt]:new Blob([i],{type:wt})})),l.push(new ClipboardItem({[t]:new Blob([ht(i)],{type:t})})));for(let n=0;n<Math.min(1,l.length);n++){const o=l[n];let s=o.types.indexOf(t),c=null;if(-1!==s){const e=await o.getType(t);c=await X(e),c&&(c=yt(i,c))}if(!c&&o.types.includes(e)){const t=await o.getType(e);if(t){let e=null;"string"==typeof t?(console.warn("text as string",t),e=t):e=await X(t),e&&(c=`<div ${pt}="${i}">${e}</div>`)}}if(!c&&o.types.includes(r)){const t=await o.getType(r),e=Z(await t.arrayBuffer());c=`<div ${pt}="${i}"><img src="${Q+e}"/></div>`}!c&&i&&(c=ht(i));const u=new Blob([c??""],{type:t}),d={};for(let t=0;t<o.types.length;t++){const e=o.types[t];d[e]=t===s?u:o.getType(e)}c&&-1===s&&(d[t]=u),i&&(d[wt]=new Blob([i],{type:wt})),a.push(new ClipboardItem(d))}try{a&&0!==a.length?await this._nativeClipboard.write(a):await(async t=>{t&&await t.writeText("")})(this._nativeClipboard)}catch(t){t.message?.includes("Document is not focused")||console.warn("Unable to write to native clipboard: ",t)}return s(),!0},async t=>{this.dispatchEvent(new Event("clipboarderrorwrite")),s()})}async writeReference(n){if(!n)return void this.clear();let o=null;const a={};try{const t=await(n.toText?.())??null;t&&(a[e]=new Blob([t??""],{type:e}))}catch(t){o=t}try{const e=await(n.toHtml?.())??null;e&&(a[t]=new Blob([e],{type:t}))}catch(t){o=t,console.warn("export to html",t)}try{const t=await(n.toImage?.())??null;t&&(a[r]=t)}catch(t){o=t,console.warn("export to png",t)}const i=this._write({uuid:P(),ref:n,items:Object.keys(a).length>0?[new ClipboardItem(a)]:null});if(o)throw o;return i}clear(t=!1){this._state&&(this._state=null,t&&this._write({uuid:null,ref:null,items:null}),this.dispatchEvent(new Event("clipboardwrite")),this.dispatchEvent(new Event("clipboardchange")))}async readReference(){return await this.read(),this._state?.ref??null}readText(){return new Promise(async(t,r)=>{const n=await this.read();let o=null;for(let t=0;!o&&n&&t<n.length;t++)n[t].types.includes(e)&&(o=await n[t].getType(e));if(!o)return void t("");const a=new FileReader;a.onload=()=>{t(a.result)},a.readAsText(o),a.onerror=t=>{r(t)}})}async writeText(t){const r=[new ClipboardItem({[e]:new Blob([t],{type:e})})];return this._write({uuid:P(),items:r,ref:null})}addEventListener(t,e,r={}){const n=r?.capture?this._listenersCapture:this._listeners;let o=n.get(t);o||(o=new Map,n.set(t,o)),o.set(e,"boolean"==typeof r?{}:r)}dispatchEvent(t){if(!t)return;const e=e=>{const r=e.get(t.type);r&&r.forEach((e,n)=>{try{"function"==typeof n?n(t):n.handleEvent&&n.handleEvent(t),e.once&&r.delete(n)}catch(t){console.warn(t)}})};return e(this._listenersCapture),e(this._listeners),!0}removeEventListener(t,e,r){const n=r?.capture?this._listenersCapture:this._listeners,o=n.get(t);o&&(o.delete(e),0===o.size&&n.delete(t))}close(){globalThis.removeEventListener?.("focus",this._onFocus),globalThis.removeEventListener?.("blur",this._onBlur)}}var mt;(mt=bt||(bt={})).ErrorMessages=lt,mt.Global=new mt;let Et=null,St=null,vt=null;const xt=Object.freeze({compileTypescript:async function(t){if(!t?.source)return null;if(St&&Y.deepEqual(St,t))return Et;const e=await async function(){if(vt)return vt;const{TypeScriptCompiler:t}=await import("./eCZnrKI7SxPgdErZ.mjs");return vt=new t,vt}(),r=await e.compileModule(t);return Et=r,St=t,r}}),_t=Object.freeze(Object.defineProperty({__proto__:null,ScriptingUtils:xt},Symbol.toStringTag,{value:"Module"}));export{Y as $,_t as i};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.11
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.12
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -1,7 +1,7 @@
1
1
  /**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.11
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.12
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
6
  */
7
- class r{constructor(r={}){this.workerWrapper=null}async getWorkerWrapper(){if(this.workerWrapper)return this.workerWrapper;const{createCompilerWorker:r}=await import("./1RkwhM87R80gyTMd.mjs");return this.workerWrapper=await r(),this.workerWrapper}async compileModule(r){try{return(await this.getWorkerWrapper()).execute(r)}catch(r){throw console.error("Failed to compile using worker:",r),r}}terminate(){this.workerWrapper?.terminate(),this.workerWrapper=null}}export{r as TypeScriptCompiler};
7
+ class r{constructor(r={}){this.workerWrapper=null}async getWorkerWrapper(){if(this.workerWrapper)return this.workerWrapper;const{createCompilerWorker:r}=await import("./C9XmeyBj3CidGuuQ.mjs");return this.workerWrapper=await r(),this.workerWrapper}async compileModule(r){try{return(await this.getWorkerWrapper()).execute(r)}catch(r){throw console.error("Failed to compile using worker:",r),r}}terminate(){this.workerWrapper?.terminate(),this.workerWrapper=null}}export{r as TypeScriptCompiler};
@@ -1,7 +1,7 @@
1
1
  /**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.11
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.12
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
6
  */
7
- export{ah as AddressUtils,q as AnchorLocation,W as AutoFill,s as BufferUtils,ag as Calculation,w as ChainedError,M as ClipboardUtils,a1 as Color,u as CommonMessages,a as CommonUtils,j as CoordUtils,v as Deferred,x as Direction,ay as ExternalRangeClipboardItem,o as FormulaContext,n as FormulaError,U as GeomUtils,ac as IAnchored,ao as IAutoFilter,a2 as IBorder,af as ICalculation,ai as ICell,ak as ICellHeaderRange,aj as ICellRange,a0 as IColor,ap as IConditionalFormat,$ as IFill,Z as IFont,Y as IFontCollection,al as IMovable,ad as IPicture,X as IPrint,l as IRange,az as ISheet,aw as ISheetView,am as ISort,a7 as IStyle,aq as ITableStyle,a4 as IText,a5 as ITextFrame,as as ITheme,at as IThemeCollection,y as ImageUtils,P as InternalClipboard,z as JSONStableStringify,R as LicenseManager,A as MimeType,E as NotImplementedError,B as NullNotAllowedError,a6 as NumberFormat,C as Observable,D as OutOfBoundsError,G as PartialError,ae as Picture,ax as RangeClipboardItem,H as RangeOrientation,I as RangeOrientations,a9 as Resource,aa as ResourceCollection,e as ScalarType,aA as Sheet,_ as SimpleFontFace,an as Sort,ab as StringCollection,p as StubbedFormulaContext,a8 as StyleCollection,ar as Table,a3 as TextUtils,au as Theme,av as ThemeCollection,O as TransactionStore,Q as TransactionUndoManager,V as Tuple,S as TypedError,J as TypedObject,K as TypesUtils,L as UndoManager,N as UserError,aC as Workbook,aB as WorkbookView}from"./CV82qaLuZfxcBBSy.mjs";
7
+ export{ah as AddressUtils,q as AnchorLocation,W as AutoFill,s as BufferUtils,ag as Calculation,w as ChainedError,M as ClipboardUtils,a1 as Color,u as CommonMessages,a as CommonUtils,j as CoordUtils,v as Deferred,x as Direction,ay as ExternalRangeClipboardItem,o as FormulaContext,n as FormulaError,U as GeomUtils,ac as IAnchored,ao as IAutoFilter,a2 as IBorder,af as ICalculation,ai as ICell,ak as ICellHeaderRange,aj as ICellRange,a0 as IColor,ap as IConditionalFormat,$ as IFill,Z as IFont,Y as IFontCollection,al as IMovable,ad as IPicture,X as IPrint,l as IRange,az as ISheet,aw as ISheetView,am as ISort,a7 as IStyle,aq as ITableStyle,a4 as IText,a5 as ITextFrame,as as ITheme,at as IThemeCollection,y as ImageUtils,P as InternalClipboard,z as JSONStableStringify,R as LicenseManager,A as MimeType,E as NotImplementedError,B as NullNotAllowedError,a6 as NumberFormat,C as Observable,D as OutOfBoundsError,G as PartialError,ae as Picture,ax as RangeClipboardItem,H as RangeOrientation,I as RangeOrientations,a9 as Resource,aa as ResourceCollection,e as ScalarType,aA as Sheet,_ as SimpleFontFace,an as Sort,ab as StringCollection,p as StubbedFormulaContext,a8 as StyleCollection,ar as Table,a3 as TextUtils,au as Theme,av as ThemeCollection,O as TransactionStore,Q as TransactionUndoManager,V as Tuple,S as TypedError,J as TypedObject,K as TypesUtils,L as UndoManager,N as UserError,aC as Workbook,aB as WorkbookView}from"./nE8H93zlwoi3F8Ii.mjs";