@sheetxl/studio-vanilla 0.4.6 → 0.4.8

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 (95) hide show
  1. package/README.md +3 -3
  2. package/browser/cjs/{CO2670BoVR60TAIO.cjs → 3nTDo2EiTknjadbt.cjs} +1 -1
  3. package/browser/cjs/6Wu3sLyx-7NM6CXS.cjs +301 -0
  4. package/browser/cjs/B11W4AIKbkJQG6ug.cjs +6 -0
  5. package/browser/cjs/{BDVO5vEdK7Wah9u6.cjs → BCnlTOmUDmizyvVV.cjs} +2 -2
  6. package/browser/cjs/{hlMzhbyi3yXzEax6.cjs → BIPxYhhi1F-y0gSm.cjs} +3 -3
  7. package/browser/cjs/{DJ3lRRtgGNfZ_GK7.cjs → BYhOQCFEzewgsKDn.cjs} +2 -2
  8. package/browser/cjs/{rf4-78JGGhtQMtw3.cjs → BqLDj2GlSzX8ZN3l.cjs} +1 -1
  9. package/browser/cjs/{ClnAKZeWBp1OEjmi.cjs → C2B3wbeahcHlbOBZ.cjs} +2 -2
  10. package/browser/cjs/C6nZKAevPqj8zJY-.cjs +6 -0
  11. package/browser/cjs/{BC1EuCQ2stuFE3uE.cjs → CD_HItzF2RneMAER.cjs} +2 -2
  12. package/browser/cjs/{Cg56Q7yFUDqoNyPz.cjs → CE5NVYltiso41NzK.cjs} +1 -1
  13. package/browser/cjs/{BEJCfS2GnnCHB_Mm.cjs → CHSE1pa8SMApg4BM.cjs} +2 -2
  14. package/browser/cjs/{D_BIUeiHuQDwD6QN.cjs → CTXKzcsm-W1ujL_U.cjs} +6 -6
  15. package/browser/cjs/{mzGAr1pI91e1sd2y.cjs → CcQjGGiCx6Qz7yJ4.cjs} +1 -1
  16. package/browser/cjs/{Ckn4M7Qh3E3gxz2w.cjs → Cqymi9AOXO_JYvY4.cjs} +2 -2
  17. package/browser/cjs/{CcvjqZjjmoPDS0vK.cjs → D6pPBbRPLTNFSXuO.cjs} +1 -1
  18. package/browser/cjs/DMUSzq5n2k0WNFw6.cjs +12 -0
  19. package/browser/cjs/DWTMnPR33rKK87Xt.cjs +12 -0
  20. package/browser/cjs/{VWWxZ8TRgMDlwBgU.cjs → Dds58NEqJ0OalWH3.cjs} +4 -4
  21. package/browser/cjs/{D52XNI-phrNzLrWS.cjs → Dy4SB47It0LGbh2I.cjs} +1 -1
  22. package/browser/cjs/{DAoqhWARDCCMxYfu.cjs → VJLb1uMfbKAUW1QF.cjs} +8 -8
  23. package/browser/cjs/{CRbLTUE75pKqxTAE.cjs → bHWvGntvmuk8t7sX.cjs} +2 -2
  24. package/browser/cjs/{CyL3JLfSqByl6NJK.cjs → euAV1pPrNOIb6DV4.cjs} +2 -2
  25. package/browser/cjs/{B0L2HuliuW9aTvJM.cjs → i0D2haODisHW8uGg.cjs} +1 -1
  26. package/browser/cjs/index.cjs +2 -2
  27. package/browser/cjs/{Ch1N2RfTkexbaLQZ.cjs → oNi7wirDlZ81Lm0Z.cjs} +1 -1
  28. package/browser/cjs/z1aNSOtWsEE21p2H.cjs +6 -0
  29. package/browser/esm/{DpJ6rBC_S3qKpTTz.mjs → 2RGq163l1wYJKGsa.mjs} +10887 -10878
  30. package/{cdn/assets/D7VphVLqKl6argvu.js → browser/esm/4C7Rg83L5RYFoOvl.mjs} +5 -5
  31. package/browser/esm/{BEb33qzyvFCELL-3.mjs → 6KgR81NK4yzANTBT.mjs} +8 -8
  32. package/{cdn/assets/BWgkRW6hv3jQZREe.js → browser/esm/B1CYiJmSpyx4TD5r.mjs} +20 -20
  33. package/{cdn/assets/Mf5PGnpvo2ab2ron.js → browser/esm/B7qUiL1xPnzfOHZw.mjs} +1 -1
  34. package/{cdn/assets/AWcFdkqHbjuM31T8.js → browser/esm/BEFQcBJ71bA297Zu.mjs} +1 -1
  35. package/browser/esm/{BcNJxq2cuxPkAW4q.mjs → BEIn7yNWsHNJisB6.mjs} +3 -3
  36. package/browser/esm/{DfNICWSvz9QDZQhb.mjs → BM74iVi-iQkHbrfo.mjs} +2 -2
  37. package/browser/esm/{Cj2uX_OMjmaU3fNR.mjs → BP8kNG31HYSkk1VW.mjs} +12 -12
  38. package/browser/esm/{DmlVS3gIBTC4kUV7.mjs → CA_DRvBOFOlhezCt.mjs} +8 -8
  39. package/browser/esm/{D0GrOZjFUR2HlnMz.mjs → CDkmbShJijwq4EBo.mjs} +6 -6
  40. package/browser/esm/{DzTywDe5V3E28PWl.mjs → CPi83FXApMlTaVbs.mjs} +1 -1
  41. package/browser/esm/{CyTYBSnJvDp00EQS.mjs → C_hRuPoaT857EnC1.mjs} +5 -5
  42. package/browser/esm/{nPC0QB7Y32vNdKJ6.mjs → CjVsKZEPAncg5mIk.mjs} +1 -1
  43. package/browser/esm/{Ka_EOSR_2pEe_9bW.mjs → Ckz080o58XOgRhqj.mjs} +2 -2
  44. package/browser/esm/{BefI9PT_BgRNGb7_.mjs → ClXspoNrNV-A8BaL.mjs} +2 -2
  45. package/browser/esm/{bnNlX3wyLfzCzkPl.mjs → DQ0Li3WfKbZxSFuB.mjs} +2 -2
  46. package/browser/esm/{yULhUqAUufR5kUwn.mjs → DXyJaUwHLq39-Jfa.mjs} +5 -5
  47. package/{cdn/assets/C_kr_6FpZ17pfLXi.js → browser/esm/D_FC0zteMRPriWTD.mjs} +1 -1
  48. package/browser/esm/{B10LhnZcMt1ayTsN.mjs → DnWiOUNTPvi_llPT.mjs} +1 -1
  49. package/browser/esm/{DB6PulwZ7VZjKPA8.mjs → DyUvHYGMNA9W2zL6.mjs} +1 -1
  50. package/browser/esm/{anzhTAYYl_AYExOH.mjs → EUFvcP5R4HFDLn2V.mjs} +5 -5
  51. package/browser/esm/cSe92c0HnvbRwiVM.mjs +944 -0
  52. package/{cdn/assets/DtxnQukkOL0CjEuQ.js → browser/esm/eXQ_1uhRMyN-hfDZ.mjs} +1 -1
  53. package/browser/esm/{Cy4td5Lr__p7Rygx.mjs → h4NbNvV8KCL9Tl1v.mjs} +16 -16
  54. package/browser/esm/index.mjs +2 -2
  55. package/browser/esm/xlL3Ai-ka9qMVeua.mjs +84 -0
  56. package/cdn/assets/{mJrwxSI9ER8tcfM5.js → B2hDWpWSEoChxhVY.js} +11896 -11887
  57. package/{browser/esm/Mf5PGnpvo2ab2ron.mjs → cdn/assets/B7qUiL1xPnzfOHZw.js} +1 -1
  58. package/{browser/esm/AWcFdkqHbjuM31T8.mjs → cdn/assets/BEFQcBJ71bA297Zu.js} +1 -1
  59. package/cdn/assets/{jzOOsUtK1t6fHp7l.js → BXBP2rNGQxrgUPvU.js} +5 -5
  60. package/cdn/assets/{yNhs_10ijt0MpP-T.js → BgChN-ZVYUOMDX9_.js} +12 -12
  61. package/cdn/assets/{DYHqPNPZiXqt-4Ux.js → Bvy1txLm7c3LbPL7.js} +6 -6
  62. package/cdn/assets/{zdC5k0nNqnRyMFF0.js → C1x5-f1q8NeSwRA2.js} +16 -16
  63. package/{browser/esm/Bhv6QhNtkfdin_7u.mjs → cdn/assets/C5NMOq74C3Sme49x.js} +20 -20
  64. package/cdn/assets/{D6ibgkGY0zdJZVdP.js → CLA1BGtRbWm0K0U0.js} +2 -2
  65. package/cdn/assets/{DzTywDe5V3E28PWl.js → CPi83FXApMlTaVbs.js} +1 -1
  66. package/cdn/assets/{nPC0QB7Y32vNdKJ6.js → CjVsKZEPAncg5mIk.js} +1 -1
  67. package/cdn/assets/{Bg1gxl7R7pEDQJ_e.js → CpVan9KpuEGXgwIK.js} +2 -2
  68. package/cdn/assets/{BH2PfED5elf6o2V9.js → CtDntnnwJW1rZ3sM.js} +5 -5
  69. package/cdn/assets/{A8kiDhrng-S3d7bC.js → CuG5WoZ4OOj9RCsv.js} +3 -3
  70. package/{browser/esm/ar5lDYhxFfJDlI4q.mjs → cdn/assets/DTvvMKZZfsVRhbow.js} +5 -5
  71. package/{browser/esm/C_kr_6FpZ17pfLXi.mjs → cdn/assets/D_FC0zteMRPriWTD.js} +1 -1
  72. package/cdn/assets/{BSywdRZwPRE8kvep.js → Dbd0AFDlzQDW0tOg.js} +5 -5
  73. package/cdn/assets/{B10LhnZcMt1ayTsN.js → DnWiOUNTPvi_llPT.js} +1 -1
  74. package/cdn/assets/{DOZC168cRHRH_MNy.js → DppHXtCDGzttFdS4.js} +2 -2
  75. package/cdn/assets/{BiXCdxCfyppsYKdi.js → DuU1-7vd87A1wfGJ.js} +2 -2
  76. package/cdn/assets/{DB6PulwZ7VZjKPA8.js → DyUvHYGMNA9W2zL6.js} +1 -1
  77. package/cdn/assets/{CGRxpUrPJQySyydG.js → O1XID2whLDb1cTWS.js} +8 -8
  78. package/{browser/esm/DtxnQukkOL0CjEuQ.mjs → cdn/assets/eXQ_1uhRMyN-hfDZ.js} +1 -1
  79. package/cdn/assets/{DgLqE4amKIfxfXZt.js → g4FhlroGKmJM7Utd.js} +8 -8
  80. package/cdn/assets/tJI1G_FjDgqWo3rJ.js +944 -0
  81. package/cdn/assets/xlL3Ai-ka9qMVeua.js +84 -0
  82. package/cdn/index.js +24 -24
  83. package/cdn/loader.js +2 -2
  84. package/package.json +3 -3
  85. package/types/index.d.ts +8 -8
  86. package/browser/cjs/C0AMVPCvA-TujT5K.cjs +0 -12
  87. package/browser/cjs/Cf2_qMNBs2gVwbh1.cjs +0 -12
  88. package/browser/cjs/CiQE7e1h2nORtvH-.cjs +0 -6
  89. package/browser/cjs/CndX6WxBX5l14erU.cjs +0 -301
  90. package/browser/cjs/D4J2MWfhcQh5QfIS.cjs +0 -6
  91. package/browser/cjs/D8mduMF3arHBud5b.cjs +0 -6
  92. package/browser/esm/C3Oq5rZbPE2to2eI.mjs +0 -940
  93. package/browser/esm/pQgC_MfgVvqv6lyK.mjs +0 -84
  94. package/cdn/assets/YtJ5y2-cVhR5MGYz.js +0 -940
  95. package/cdn/assets/pQgC_MfgVvqv6lyK.js +0 -84
@@ -0,0 +1,84 @@
1
+ import { Workbook as J } from "@sheetxl/sdk";
2
+ /**
3
+ * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.8
4
+ *
5
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
6
+ * License: The license can be found at https://www.sheetxl.com/license.
7
+ */
8
+ const k = async (w, l) => {
9
+ const u = await w.toJSON(), b = l?.whiteSpace ?? 0;
10
+ let g;
11
+ l?.beforeWrite?.(w, u), g = b === 0 ? JSON.stringify(u) : function(f, r = 2) {
12
+ const n = [];
13
+ function i(o) {
14
+ const e = r * o;
15
+ return n[e] === void 0 && (n[e] = " ".repeat(e)), n[e];
16
+ }
17
+ return function o(e, a, s, m) {
18
+ if (e == null || typeof e != "object") return JSON.stringify(e);
19
+ const d = i(a), O = i(a + 1);
20
+ if (Array.isArray(e)) {
21
+ const c = e.length;
22
+ if (c === 0) return "[]";
23
+ if (s !== 0) return JSON.stringify(e);
24
+ let y = `[
25
+ `;
26
+ for (let h = 0; h < c; h++) y += O + o(e[h], a + 1, s + 1, !0), h < c - 1 && (y += `,
27
+ `);
28
+ return y += `
29
+ ` + d + "]", y;
30
+ }
31
+ const B = Object.keys(e), A = B.length;
32
+ if (A === 0) return "{}";
33
+ if (!(s < 2)) return JSON.stringify(e);
34
+ let S = `{
35
+ `;
36
+ m || (s = 0);
37
+ for (let c = 0; c < A; c++) {
38
+ const y = B[c];
39
+ S += O + JSON.stringify(y) + ": " + o(e[y], a + 1, s, !1), c < A - 1 && (S += `,
40
+ `);
41
+ }
42
+ return S += `
43
+ ` + d + "}", S;
44
+ }(f, 0, 0, !1);
45
+ }(u, b);
46
+ let p = new TextEncoder().encode(g).buffer;
47
+ const t = l?.compress ?? !0;
48
+ return t && (p = await async function(f, r = "gzip") {
49
+ let n;
50
+ typeof SharedArrayBuffer < "u" && f instanceof SharedArrayBuffer ? (n = new ArrayBuffer(f.byteLength), new Uint8Array(n).set(new Uint8Array(f))) : n = f;
51
+ const i = new ReadableStream({ start(a) {
52
+ a.enqueue(n), a.close();
53
+ } }), o = new CompressionStream(r), e = i.pipeThrough(o);
54
+ return (await new Response(e).blob()).arrayBuffer();
55
+ }(p, typeof t == "string" ? t : void 0)), p;
56
+ }, z = async (w, l) => {
57
+ let u = w;
58
+ (function(t) {
59
+ if (t.byteLength < 4) return !1;
60
+ const f = new Uint8Array(t), r = { gzip: [31, 139], zip: [80, 75, 3, 4], bz2: [66, 90, 104], br: [206, 178, 207, 129] }, n = Object.keys(r);
61
+ for (let i = 0; i < n.length; i++) {
62
+ const o = n[i], e = r[o];
63
+ let a = !0;
64
+ for (let s = 0; s < e.length; s++) if (f[s] !== e[s]) {
65
+ a = !1;
66
+ break;
67
+ }
68
+ if (a) return o;
69
+ }
70
+ return !1;
71
+ })(u) && (u = await async function(t, f = "gzip") {
72
+ let r;
73
+ typeof SharedArrayBuffer < "u" && t instanceof SharedArrayBuffer ? (r = new ArrayBuffer(t.byteLength), new Uint8Array(r).set(new Uint8Array(t))) : r = t;
74
+ const n = new Blob([r]).stream(), i = new DecompressionStream(f), o = n.pipeThrough(i);
75
+ return (await new Response(o).blob()).arrayBuffer();
76
+ }(u));
77
+ let b = new TextDecoder().decode(u);
78
+ const g = JSON.parse(b), p = { ...l?.createWorkbookOptions ?? {}, json: g };
79
+ return new J(p);
80
+ };
81
+ export {
82
+ z as fromBufferJSON,
83
+ k as toBufferJSON
84
+ };
package/cdn/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.6
2
+ * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.8
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 k = /* @__PURE__ */ new Map(), E = (e, n = {}) => {
7
+ const S = /* @__PURE__ */ new Map(), L = (e, n = {}) => {
8
8
  const { message: t, icon: r, customElement: p, hide: m = !1, className: a, cssVars: f = {} } = n;
9
9
  if (m) return;
10
10
  const l = typeof e == "string" ? document.querySelector(e) : e;
@@ -91,12 +91,12 @@ const k = /* @__PURE__ */ new Map(), E = (e, n = {}) => {
91
91
  }
92
92
  u && (o.style.cssText += u), window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches && o.classList.add("dark");
93
93
  }
94
- window.getComputedStyle(l).position === "static" && (l.style.position = "relative"), l.appendChild(o), k.set(e, o);
94
+ window.getComputedStyle(l).position === "static" && (l.style.position = "relative"), l.appendChild(o), S.set(e, o);
95
95
  }, h = (e) => {
96
- const n = k.get(e);
97
- n && n.parentNode && (n.parentNode.removeChild(n), k.delete(e));
98
- }, C = (e, n = {}) => {
99
- E(e, { message: "Loading SheetXL...", icon: `
96
+ const n = S.get(e);
97
+ n && n.parentNode && (n.parentNode.removeChild(n), S.delete(e));
98
+ }, k = (e, n = {}) => {
99
+ L(e, { message: "Loading SheetXL...", icon: `
100
100
  <svg width="24" height="24" viewBox="0 0 24 24" style="animation: sheetxl-spin 1s linear infinite;">
101
101
  <circle cx="12" cy="12" r="10" fill="none" stroke="currentColor" stroke-width="2" stroke-dasharray="31.416" stroke-dashoffset="31.416">
102
102
  <animate attributeName="stroke-dasharray" dur="2s" values="0 31.416;15.708 15.708;0 31.416" repeatCount="indefinite"/>
@@ -104,32 +104,32 @@ const k = /* @__PURE__ */ new Map(), E = (e, n = {}) => {
104
104
  </circle>
105
105
  </svg>
106
106
  `, className: "loading", ...n });
107
- }, L = (e, n = {}) => {
108
- E(e, { message: "Failed to load SheetXL", icon: `
107
+ }, b = (e, n = {}) => {
108
+ L(e, { message: "Failed to load SheetXL", icon: `
109
109
  <svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor">
110
110
  <path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/>
111
111
  </svg>
112
112
  `, className: "error", ...n });
113
113
  }, x = /* @__PURE__ */ new Map();
114
114
  let c;
115
- const b = async (e) => c || (c = await (async (n, t) => {
115
+ const C = async (e) => c || (c = await (async (n, t) => {
116
116
  try {
117
- if (t?.selector && C(t?.selector, t?.loading), !n) {
118
- const { resolveDependencies: r } = await import("./assets/BiXCdxCfyppsYKdi.js");
117
+ if (t?.selector && k(t?.selector, t?.loading), !n) {
118
+ const { resolveDependencies: r } = await import("./assets/DuU1-7vd87A1wfGJ.js");
119
119
  n = await r(t?.dependencies);
120
120
  }
121
121
  t?.licenseKey && await n.StudioMUI.LicenseManager.setLicenseKey(t.licenseKey), t?.selector && h(t?.selector);
122
122
  } catch (r) {
123
- throw t?.selector && (h(t.selector), L(t.selector, { message: `Failed to initialize: ${r instanceof Error ? r.message : String(r)}`, ...t?.error })), console.error("Failed to initialize:", r), r;
123
+ throw t?.selector && (h(t.selector), b(t.selector, { message: `Failed to initialize: ${r instanceof Error ? r.message : String(r)}`, ...t?.error })), console.error("Failed to initialize:", r), r;
124
124
  }
125
125
  return n;
126
- })(null, typeof e == "object" ? e : void 0), c), M = { attachWorkbook: async (e, n) => (c || (c = await b(e)), (async (t, r, p, m) => {
126
+ })(null, typeof e == "object" ? e : void 0), c), M = { attachStudio: async (e, n) => (c || (c = await C(e)), (async (t, r, p, m) => {
127
127
  if (!r) throw new Error("Either a 'selector' or a 'InitializationOptions' must be provided to attach.");
128
128
  const a = typeof r == "string" ? r : r.selector || "#sheetxl", f = typeof a == "string" ? document.querySelector(a) : a;
129
129
  if (!f) throw new Error(`Element with selector "${a}" not found.`);
130
130
  if (x.has(a) && x.get(a) !== null) throw new Error(`SheetXL already attached to "${a}". Detach first if you want to re-attach.`);
131
131
  const l = typeof r == "object" ? r : null;
132
- C(a, l?.loading);
132
+ k(a, l?.loading);
133
133
  try {
134
134
  h(a);
135
135
  const o = t.ReactDOMClient.createRoot(f), u = t.React.createRef(), g = t.StudioMUI[p];
@@ -141,27 +141,27 @@ const b = async (e) => c || (c = await (async (n, t) => {
141
141
  });
142
142
  const y = { runtime: t, root: o };
143
143
  x.set(a, y);
144
- let S = !1;
144
+ let E = !1;
145
145
  return new Proxy(d, { get(v, i, z) {
146
- if (S) throw new Error(`SheetXL instance attached to "${a}" has been detached. Cannot access properties.`);
146
+ if (E) throw new Error(`SheetXL instance attached to "${a}" has been detached. Cannot access properties.`);
147
147
  return i === "update" ? (N) => {
148
148
  const $ = { ...m, ...N, ref: u };
149
149
  return o.render(t.React.createElement(g, $)), Promise.resolve();
150
- } : i === "detach" ? () => (x.delete(a), o.unmount(), S = !0, Promise.resolve()) : Reflect.get(v, i, z);
150
+ } : i === "detach" ? () => (x.delete(a), o.unmount(), E = !0, Promise.resolve()) : Reflect.get(v, i, z);
151
151
  } });
152
152
  } catch (o) {
153
- throw h(a), L(a, { message: `Failed to initialize: ${o instanceof Error ? o.message : String(o)}`, ...l?.error }), console.error("Failed to initialize:", o), o;
153
+ throw h(a), b(a, { message: `Failed to initialize: ${o instanceof Error ? o.message : String(o)}`, ...l?.error }), console.error("Failed to initialize:", o), o;
154
154
  }
155
- })(c, e, "StandaloneWorkbook", n)), async initialize(e) {
156
- await b(e);
155
+ })(c, e, "Studio", n)), async initialize(e) {
156
+ await C(e);
157
157
  } }, w = document.currentScript;
158
158
  if (w) {
159
159
  console.log("SheetXL script tag:", w);
160
160
  const e = w.dataset ? w.dataset.target : "#sheetxl";
161
- document.querySelector(e) || console.error(`SheetXL: Target element "${e}" not found in the document.`), M.attachWorkbook(e, { autoFocus: !0 }).then((n) => {
162
- console.log("SheetXL workbook created and attached:", n);
161
+ document.querySelector(e) || console.error(`SheetXL: Target element "${e}" not found in the document.`), M.attachStudio(e, { autoFocus: !0 }).then((n) => {
162
+ console.log("SheetXL studio created and attached:", n);
163
163
  }).catch((n) => {
164
- console.error("Error creating SheetXL workbook:", n);
164
+ console.error("Error creating SheetXL studio:", n);
165
165
  });
166
166
  }
167
167
  const X = M;
package/cdn/loader.js CHANGED
@@ -1,6 +1,6 @@
1
1
  (function(e){typeof define=="function"&&define.amd?define(e):e()})(function(){"use strict";/**
2
- * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.6
2
+ * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.8
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
- */(()=>{const e=document.currentScript,o=()=>{if(!e)return void console.error("script tag is not available. Ensure the module tag is not used.");const r=e.dataset.target??"#sheetxl",t={...e.dataset},d=t.licenseKey;delete t.target,delete t.licenseKey;const i=e.src,c=new URL("./index.js",i).href;import(c).then(n=>{const a=document.querySelector(r);a?n.SheetXL.attachWorkbook({selector:a,licenseKey:d},t):console.error(`SheetXL: Target element "${r}" not found.`)}).catch(n=>{console.error(`SheetXL: Failed to load the main application from ${c}`,n)})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",o):o()})()});
6
+ */(()=>{const e=document.currentScript,o=()=>{if(!e)return void console.error("script tag is not available. Ensure the module tag is not used.");const r=e.dataset.target??"#sheetxl",t={...e.dataset},d=t.licenseKey;delete t.target,delete t.licenseKey;const i=e.src,c=new URL("./index.js",i).href;import(c).then(n=>{const a=document.querySelector(r);a?n.SheetXL.attachStudio({selector:a,licenseKey:d},t):console.error(`SheetXL: Target element "${r}" not found.`)}).catch(n=>{console.error(`SheetXL: Failed to load the main application from ${c}`,n)})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",o):o()})()});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sheetxl/studio-vanilla",
3
3
  "description": "SheetXL Studio - Vanilla entry point for integrating SheetXL UI.",
4
- "version": "0.4.6",
4
+ "version": "0.4.8",
5
5
  "license": "SEE LICENSE IN <LICENSE>",
6
6
  "type": "module",
7
7
  "main": "./browser/esm/index.mjs",
@@ -41,12 +41,12 @@
41
41
  "@mui/styled-engine": "^6.5.0",
42
42
  "@mui/system": "^6.5.0",
43
43
  "@mui/utils": "^6.4.9",
44
- "@sheetxl/studio-mui": "^0.4.6",
44
+ "@sheetxl/studio-mui": "^0.4.8",
45
45
  "csstype": "^3.1.3",
46
46
  "http-server": "^14.1.1"
47
47
  },
48
48
  "peerDependencies": {
49
- "@sheetxl/sdk": "^0.4.6",
49
+ "@sheetxl/sdk": "^0.4.8",
50
50
  "react": "^19.1.0",
51
51
  "react-dom": "^19.1.0"
52
52
  }
package/types/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { IWorkbookElement as IWorkbookElement_2 } from '@sheetxl/studio-mui';
2
2
  import { sheetxlStudioMui } from '@sheetxl/studio-mui';
3
- import { StandaloneWorkbookProps as StandaloneWorkbookProps_2 } from '@sheetxl/studio-mui';
3
+ import { StudioProps as StudioProps_2 } from '@sheetxl/studio-mui';
4
4
 
5
5
  /**
6
6
  * All elements attached to a DOM element will have the additional methods
@@ -75,7 +75,7 @@ export declare interface ISheetXL {
75
75
  * @param props Optional properties to pass to the SheetXL React component.
76
76
  * @returns A promise that resolves to a function that, when called, will detach the SheetXL React component from the DOM element.
77
77
  */
78
- attachWorkbook(selector: string | InitializationOptions, props?: StandaloneWorkbookProps): Promise<IWorkbookElement & Attached<StandaloneWorkbookProps>>;
78
+ attachStudio(selector: string | InitializationOptions, props?: StudioProps): Promise<IWorkbookElement & Attached<StudioProps>>;
79
79
  /**
80
80
  * Initializes the SheetXL runtime with the provided options.
81
81
  *
@@ -129,17 +129,17 @@ declare const SheetXL: ISheetXL;
129
129
  export default SheetXL;
130
130
 
131
131
  /**
132
- * Reference to StandaloneWorkbookProps.
132
+ * Reference to StudioMUI module.
133
133
  *
134
- * @link [StandaloneWorkbookProps](../interfaces/_sheetxl_studio-mui.StandaloneWorkbookProps.html)
134
+ * [@sheetxl/studio-mui](../modules/_sheetxl_studio-mui.html)
135
135
  */
136
- export declare type StandaloneWorkbookProps = StandaloneWorkbookProps_2;
136
+ export declare type StudioMUIModule = sheetxlStudioMui;
137
137
 
138
138
  /**
139
- * Reference to StudioMUI module.
139
+ * Reference to StudioProps.
140
140
  *
141
- * [@sheetxl/studio-mui](../modules/_sheetxl_studio-mui.html)
141
+ * @link [StudioProps](../interfaces/_sheetxl_studio-mui.StudioProps.html)
142
142
  */
143
- export declare type StudioMUIModule = sheetxlStudioMui;
143
+ export declare type StudioProps = StudioProps_2;
144
144
 
145
145
  export { }
@@ -1,12 +0,0 @@
1
- "use strict";/**
2
- * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.6
3
- *
4
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */const m=require("react/jsx-runtime"),l=require("react"),a=require("./CndX6WxBX5l14erU.cjs"),Wt=require("react-dom"),ue=require("@sheetxl/sdk");function It(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,t.get?t:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const pe=It(l);function Pt(e){return a.generateUtilityClass("MuiCollapse",e)}a.generateUtilityClasses("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const Ft=a.styled("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:r}=e;return[o.root,o[r.orientation],r.state==="entered"&&o.entered,r.state==="exited"&&!r.in&&r.collapsedSize==="0px"&&o.hidden]}})(a.memoTheme(({theme:e})=>({height:0,overflow:"hidden",transition:e.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:e.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:o})=>o.state==="exited"&&!o.in&&o.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),Nt=a.styled("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(e,o)=>o.wrapper})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),At=a.styled("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(e,o)=>o.wrapperInner})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),Fe=pe.forwardRef(function(e,o){const r=a.useDefaultProps({props:e,name:"MuiCollapse"}),{addEndListener:t,children:n,className:i,collapsedSize:s="0px",component:u,easing:c,in:d,onEnter:p,onEntered:f,onEntering:x,onExit:v,onExited:y,onExiting:b,orientation:w="vertical",style:k,timeout:h=a.duration.standard,TransitionComponent:R=a.Transition,...E}=r,F={...r,orientation:w,collapsedSize:s},L=(M=>{const{orientation:O,classes:V}=M,Y={root:["root",`${O}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${O}`],wrapperInner:["wrapperInner",`${O}`]};return a.composeClasses(Y,Pt,V)})(F),q=a.useTheme(),_=a.useTimeout(),I=pe.useRef(null),H=pe.useRef(),G=typeof s=="number"?`${s}px`:s,J=w==="horizontal",N=J?"width":"height",te=pe.useRef(null),P=a.useForkRef(o,te),S=M=>O=>{if(M){const V=te.current;O===void 0?M(V):M(V,O)}},j=()=>I.current?I.current[J?"clientWidth":"clientHeight"]:0,A=S((M,O)=>{I.current&&J&&(I.current.style.position="absolute"),M.style[N]=G,p&&p(M,O)}),D=S((M,O)=>{const V=j();I.current&&J&&(I.current.style.position="");const{duration:Y,easing:ae}=a.getTransitionProps({style:k,timeout:h,easing:c},{mode:"enter"});if(h==="auto"){const ne=q.transitions.getAutoHeightDuration(V);M.style.transitionDuration=`${ne}ms`,H.current=ne}else M.style.transitionDuration=typeof Y=="string"?Y:`${Y}ms`;M.style[N]=`${V}px`,M.style.transitionTimingFunction=ae,x&&x(M,O)}),U=S((M,O)=>{M.style[N]="auto",f&&f(M,O)}),B=S(M=>{M.style[N]=`${j()}px`,v&&v(M)}),Q=S(y),z=S(M=>{const O=j(),{duration:V,easing:Y}=a.getTransitionProps({style:k,timeout:h,easing:c},{mode:"exit"});if(h==="auto"){const ae=q.transitions.getAutoHeightDuration(O);M.style.transitionDuration=`${ae}ms`,H.current=ae}else M.style.transitionDuration=typeof V=="string"?V:`${V}ms`;M.style[N]=G,M.style.transitionTimingFunction=Y,b&&b(M)});return m.jsx(R,{in:d,onEnter:A,onEntered:U,onEntering:D,onExit:B,onExited:Q,onExiting:z,addEndListener:M=>{h==="auto"&&_.start(H.current||0,M),t&&t(te.current,M)},nodeRef:te,timeout:h==="auto"?null:h,...E,children:(M,{ownerState:O,...V})=>m.jsx(Ft,{as:u,className:a.clsx(L.root,i,{entered:L.entered,exited:!d&&G==="0px"&&L.hidden}[M]),style:{[J?"minWidth":"minHeight"]:G,...k},ref:P,ownerState:{...F,state:M},...V,children:m.jsx(Nt,{ownerState:{...F,state:M},className:L.wrapper,ref:I,children:m.jsx(At,{ownerState:{...F,state:M},className:L.wrapperInner,children:n})})})})});function qt(e){return a.generateUtilityClass("MuiCard",e)}Fe&&(Fe.muiSupportAuto=!0),a.generateUtilityClasses("MuiCard",["root"]);const zt=a.styled(a.Paper,{name:"MuiCard",slot:"Root",overridesResolver:(e,o)=>o.root})({overflow:"hidden"}),Ht=pe.forwardRef(function(e,o){const r=a.useDefaultProps({props:e,name:"MuiCard"}),{className:t,raised:n=!1,...i}=r,s={...r,raised:n},u=(c=>{const{classes:d}=c;return a.composeClasses({root:["root"]},qt,d)})(s);return m.jsx(zt,{className:a.clsx(u.root,t),elevation:n?8:void 0,ref:o,ownerState:s,...i})});function Bt(e){return a.generateUtilityClass("MuiCardActions",e)}a.generateUtilityClasses("MuiCardActions",["root","spacing"]);const _t=a.styled("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:r}=e;return[o.root,!r.disableSpacing&&o.spacing]}})({display:"flex",alignItems:"center",padding:8,variants:[{props:{disableSpacing:!1},style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),Ut=pe.forwardRef(function(e,o){const r=a.useDefaultProps({props:e,name:"MuiCardActions"}),{disableSpacing:t=!1,className:n,...i}=r,s={...r,disableSpacing:t},u=(c=>{const{classes:d,disableSpacing:p}=c,f={root:["root",!p&&"spacing"]};return a.composeClasses(f,Bt,d)})(s);return m.jsx(_t,{className:a.clsx(u.root,n),ownerState:s,ref:o,...i})}),Ge=typeof a.globalCss({})=="function",Vt=(e,o)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...o&&!e.vars&&{colorScheme:e.palette.mode}}),$t=e=>({color:(e.vars||e).palette.text.primary,...e.typography.body1,backgroundColor:(e.vars||e).palette.background.default,"@media print":{backgroundColor:(e.vars||e).palette.common.white}}),tt=(e,o=!1)=>{const r={};o&&e.colorSchemes&&typeof e.getColorSchemeSelector=="function"&&Object.entries(e.colorSchemes).forEach(([i,s])=>{const u=e.getColorSchemeSelector(i);u.startsWith("@")?r[u]={":root":{colorScheme:s.palette?.mode}}:r[u.replace(/\s*&/,"")]={colorScheme:s.palette?.mode}});let t={html:Vt(e,o),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:{margin:0,...$t(e),"&::backdrop":{backgroundColor:(e.vars||e).palette.background.default}},...r};const n=e.components?.MuiCssBaseline?.styleOverrides;return n&&(t=[t,n]),t},Ie="mui-ecs",Kt=a.globalCss(Ge?({theme:e,enableColorScheme:o})=>tt(e,o):({theme:e})=>(o=>{const r=tt(o,!1),t=Array.isArray(r)?r[0]:r;return!o.vars&&t&&(t.html[`:root:has(${Ie})`]={colorScheme:o.palette.mode}),o.colorSchemes&&Object.entries(o.colorSchemes).forEach(([n,i])=>{const s=o.getColorSchemeSelector(n);s.startsWith("@")?t[s]={[`:root:not(:has(.${Ie}))`]:{colorScheme:i.palette?.mode}}:t[s.replace(/\s*&/,"")]={[`&:not(:has(.${Ie}))`]:{colorScheme:i.palette?.mode}}}),r})(e));function Gt(e){const o=a.useDefaultProps({props:e,name:"MuiCssBaseline"}),{children:r,enableColorScheme:t=!1}=o;return m.jsxs(pe.Fragment,{children:[Ge&&m.jsx(Kt,{enableColorScheme:t}),!Ge&&!t&&m.jsx("span",{className:Ie,style:{display:"none"}}),r]})}const Xt=a.createSvgIcon(m.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"}),"CancelOutlined"),Zt=l.createContext(null),He={didCatch:!1,error:null};class Jt extends l.Component{constructor(o){super(o),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=He}static getDerivedStateFromError(o){return{didCatch:!0,error:o}}resetErrorBoundary(){const{error:o}=this.state;if(o!==null){for(var r,t,n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];(r=(t=this.props).onReset)===null||r===void 0||r.call(t,{args:i,reason:"imperative-api"}),this.setState(He)}}componentDidCatch(o,r){var t,n;(t=(n=this.props).onError)===null||t===void 0||t.call(n,o,r)}componentDidUpdate(o,r){const{didCatch:t}=this.state,{resetKeys:n}=this.props;var i,s;t&&r.error!==null&&function(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return u.length!==c.length||u.some((d,p)=>!Object.is(d,c[p]))}(o.resetKeys,n)&&((i=(s=this.props).onReset)===null||i===void 0||i.call(s,{next:n,prev:o.resetKeys,reason:"keys"}),this.setState(He))}render(){const{children:o,fallbackRender:r,FallbackComponent:t,fallback:n}=this.props,{didCatch:i,error:s}=this.state;let u=o;if(i){const c={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof r=="function")u=r(c);else if(t)u=l.createElement(t,c);else{if(n===void 0)throw s;u=n}}return l.createElement(Zt.Provider,{value:{didCatch:i,error:s,resetErrorBoundary:this.resetErrorBoundary}},u)}}function ht(e){var o,r,t="";if(typeof e=="string"||typeof e=="number")t+=e;else if(typeof e=="object")if(Array.isArray(e))for(o=0;o<e.length;o++)e[o]&&(r=ht(e[o]))&&(t&&(t+=" "),t+=r);else for(o in e)e[o]&&(t&&(t+=" "),t+=o);return t}function ie(){for(var e,o,r=0,t="";r<arguments.length;)(e=arguments[r++])&&(o=ht(e))&&(t&&(t+=" "),t+=o);return t}let Qt={data:""},Yt=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,en=/\/\*[^]*?\*\/| +/g,nt=/\n+/g,de=(e,o)=>{let r="",t="",n="";for(let i in e){let s=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+s+";":t+=i[1]=="f"?de(s,i):i+"{"+de(s,i[1]=="k"?"":o)+"}":typeof s=="object"?t+=de(s,o?o.replace(/([^,])+/g,u=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,u):u?u+" "+c:c)):i):s!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),n+=de.p?de.p(i,s):i+":"+s+";")}return r+(o&&n?o+"{"+n+"}":n)+t},oe={},gt=e=>{if(typeof e=="object"){let o="";for(let r in e)o+=r+gt(e[r]);return o}return e};function Xe(e){let o=this||{},r=e.call?e(o.p):e;return((s,u,c,d,p)=>{let f=gt(s),x=oe[f]||(oe[f]=(h=>{let R=0,E=11;for(;R<h.length;)E=101*E+h.charCodeAt(R++)>>>0;return"go"+E})(f));if(!oe[x]){let h=f!==s?s:(R=>{let E,F,L=[{}];for(;E=Yt.exec(R.replace(en,""));)E[4]?L.shift():E[3]?(F=E[3].replace(nt," ").trim(),L.unshift(L[0][F]=L[0][F]||{})):L[0][E[1]]=E[2].replace(nt," ").trim();return L[0]})(s);oe[x]=de(p?{["@keyframes "+x]:h}:h,c?"":"."+x)}let v=c&&oe.g?oe.g:null;return c&&(oe.g=oe[x]),y=oe[x],b=u,w=d,(k=v)?b.data=b.data.replace(k,y):b.data.indexOf(y)===-1&&(b.data=w?y+b.data:b.data+y),x;var y,b,w,k})(r.unshift?r.raw?(t=r,n=[].slice.call(arguments,1),i=o.p,t.reduce((s,u,c)=>{let d=n[c];if(d&&d.call){let p=d(i),f=p&&p.props&&p.props.className||/^go/.test(p)&&p;d=f?"."+f:p&&typeof p=="object"?p.props?"":de(p,""):p===!1?"":p}return s+u+(d??"")},"")):r.reduce((s,u)=>Object.assign(s,u&&u.call?u(o.p):u),{}):r,(s=>typeof window=="object"?((s?s.querySelector("#_goober"):window._goober)||Object.assign((s||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:s||Qt)(o.target),o.g,o.o,o.k);var t,n,i}function kt(e,o,r){return o&&function(t,n){for(var i=0;i<n.length;i++){var s=n[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}(e.prototype,o),e}function T(){return T=Object.assign||function(e){for(var o=1;o<arguments.length;o++){var r=arguments[o];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e},T.apply(this,arguments)}function bt(e,o){e.prototype=Object.create(o.prototype),e.prototype.constructor=e,e.__proto__=o}function Se(e,o){if(e==null)return{};var r,t,n={},i=Object.keys(e);for(t=0;t<i.length;t++)r=i[t],o.indexOf(r)>=0||(n[r]=e[r]);return n}function ot(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}Xe.bind({g:1}),Xe.bind({k:1});var rt=function(){return""},xt=l.createContext({enqueueSnackbar:rt,closeSnackbar:rt}),Be="@media (max-width:599.95px)",Pe="@media (min-width:600px)",it=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},Je=function(e){return""+it(e.vertical)+it(e.horizontal)},je=function(e){return!!e||e===0},Re="unmounted",me="exited",fe="entering",ye="entered",at="exiting",Qe=function(e){function o(t){var n;n=e.call(this,t)||this;var i,s=t.appear;return n.appearStatus=null,t.in?s?(i=me,n.appearStatus=fe):i=ye:i=t.unmountOnExit||t.mountOnEnter?Re:me,n.state={status:i},n.nextCallback=null,n}bt(o,e),o.getDerivedStateFromProps=function(t,n){return t.in&&n.status===Re?{status:me}:null};var r=o.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(t){var n=null;if(t!==this.props){var i=this.state.status;this.props.in?i!==fe&&i!==ye&&(n=fe):i!==fe&&i!==ye||(n=at)}this.updateStatus(!1,n)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var t=this.props.timeout,n=t,i=t;return t!=null&&typeof t!="number"&&typeof t!="string"&&(i=t.exit,n=t.enter),{exit:i,enter:n}},r.updateStatus=function(t,n){t===void 0&&(t=!1),n!==null?(this.cancelNextCallback(),n===fe?this.performEnter(t):this.performExit()):this.props.unmountOnExit&&this.state.status===me&&this.setState({status:Re})},r.performEnter=function(t){var n=this,i=this.props.enter,s=t,u=this.getTimeouts();t||i?(this.props.onEnter&&this.props.onEnter(this.node,s),this.safeSetState({status:fe},function(){n.props.onEntering&&n.props.onEntering(n.node,s),n.onTransitionEnd(u.enter,function(){n.safeSetState({status:ye},function(){n.props.onEntered&&n.props.onEntered(n.node,s)})})})):this.safeSetState({status:ye},function(){n.props.onEntered&&n.props.onEntered(n.node,s)})},r.performExit=function(){var t=this,n=this.props.exit,i=this.getTimeouts();n?(this.props.onExit&&this.props.onExit(this.node),this.safeSetState({status:at},function(){t.props.onExiting&&t.props.onExiting(t.node),t.onTransitionEnd(i.exit,function(){t.safeSetState({status:me},function(){t.props.onExited&&t.props.onExited(t.node)})})})):this.safeSetState({status:me},function(){t.props.onExited&&t.props.onExited(t.node)})},r.cancelNextCallback=function(){this.nextCallback!==null&&this.nextCallback.cancel&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(t,n){n=this.setNextCallback(n),this.setState(t,n)},r.setNextCallback=function(t){var n=this,i=!0;return this.nextCallback=function(){i&&(i=!1,n.nextCallback=null,t())},this.nextCallback.cancel=function(){i=!1},this.nextCallback},r.onTransitionEnd=function(t,n){this.setNextCallback(n);var i=t==null&&!this.props.addEndListener;this.node&&!i?(this.props.addEndListener&&this.props.addEndListener(this.node,this.nextCallback),t!=null&&setTimeout(this.nextCallback,t)):setTimeout(this.nextCallback,0)},r.render=function(){var t=this.state.status;if(t===Re)return null;var n=this.props;return(0,n.children)(t,Se(n,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]))},kt(o,[{key:"node",get:function(){var t,n=(t=this.props.nodeRef)===null||t===void 0?void 0:t.current;if(!n)throw new Error("notistack - Custom snackbar is not refForwarding");return n}}]),o}(l.Component);function he(){}function st(e,o){typeof e=="function"?e(o):e&&(e.current=o)}function Ze(e,o){return l.useMemo(function(){return e==null&&o==null?null:function(r){st(e,r),st(o,r)}},[e,o])}function Ne(e){var o=e.timeout,r=e.style,t=r===void 0?{}:r,n=e.mode;return{duration:typeof o=="object"?o[n]||0:o,easing:t.transitionTimingFunction,delay:t.transitionDelay}}Qe.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:he,onEntering:he,onEntered:he,onExit:he,onExiting:he,onExited:he};var yt=function(e){e.scrollTop=e.scrollTop},lt=function(e){return Math.round(e)+"ms"};function ge(e,o){e===void 0&&(e=["all"]);var r=o||{},t=r.duration,n=t===void 0?300:t,i=r.easing,s=i===void 0?"cubic-bezier(0.4, 0, 0.2, 1)":i,u=r.delay,c=u===void 0?0:u;return(Array.isArray(e)?e:[e]).map(function(d){var p=typeof n=="string"?n:lt(n),f=typeof c=="string"?c:lt(c);return d+" "+p+" "+s+" "+f}).join(",")}function wt(e){var o;return((o=e)&&o.ownerDocument||document).defaultView||window}function Le(e,o){if(o){var r=function(t,n){var i,s=n.getBoundingClientRect(),u=wt(n);if(n.fakeTransform)i=n.fakeTransform;else{var c=u.getComputedStyle(n);i=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("transform")}var d=0,p=0;if(i&&i!=="none"&&typeof i=="string"){var f=i.split("(")[1].split(")")[0].split(",");d=parseInt(f[4],10),p=parseInt(f[5],10)}switch(t){case"left":return"translateX("+(u.innerWidth+d-s.left)+"px)";case"right":return"translateX(-"+(s.left+s.width-d)+"px)";case"up":return"translateY("+(u.innerHeight+p-s.top)+"px)";default:return"translateY(-"+(s.top+s.height-p)+"px)"}}(e,o);r&&(o.style.webkitTransform=r,o.style.transform=r)}}var vt=l.forwardRef(function(e,o){var r=e.children,t=e.direction,n=t===void 0?"down":t,i=e.in,s=e.style,u=e.timeout,c=u===void 0?0:u,d=e.onEnter,p=e.onEntered,f=e.onExit,x=e.onExited,v=Se(e,["children","direction","in","style","timeout","onEnter","onEntered","onExit","onExited"]),y=l.useRef(null),b=Ze(r.ref,y),w=Ze(b,o),k=l.useCallback(function(){y.current&&Le(n,y.current)},[n]);return l.useEffect(function(){if(!i&&n!=="down"&&n!=="right"){var h=function(E,F){var L;function q(){for(var _=this,I=arguments.length,H=new Array(I),G=0;G<I;G++)H[G]=arguments[G];clearTimeout(L),L=setTimeout(function(){E.apply(_,H)},F)}return F===void 0&&(F=166),q.clear=function(){clearTimeout(L)},q}(function(){y.current&&Le(n,y.current)}),R=wt(y.current);return R.addEventListener("resize",h),function(){h.clear(),R.removeEventListener("resize",h)}}},[n,i]),l.useEffect(function(){i||k()},[i,k]),l.createElement(Qe,Object.assign({appear:!0,nodeRef:y,onEnter:function(h,R){Le(n,h),yt(h),d&&d(h,R)},onEntered:p,onEntering:function(h){var R=Ne({timeout:c,mode:"enter",style:T({},s,{transitionTimingFunction:s?.transitionTimingFunction||"cubic-bezier(0.0, 0, 0.2, 1)"})});h.style.webkitTransition=ge("-webkit-transform",R),h.style.transition=ge("transform",R),h.style.webkitTransform="none",h.style.transform="none"},onExit:function(h){var R=Ne({timeout:c,mode:"exit",style:T({},s,{transitionTimingFunction:s?.transitionTimingFunction||"cubic-bezier(0.4, 0, 0.6, 1)"})});h.style.webkitTransition=ge("-webkit-transform",R),h.style.transition=ge("transform",R),Le(n,h),f&&f(h)},onExited:function(h){h.style.webkitTransition="",h.style.transition="",x&&x(h)},in:i,timeout:c},v),function(h,R){return l.cloneElement(r,T({ref:w,style:T({visibility:h!=="exited"||i?void 0:"hidden"},s,{},r.props.style)},R))})});vt.displayName="Slide";var De=function(e){return l.createElement("svg",Object.assign({viewBox:"0 0 24 24",focusable:"false",style:{fontSize:20,marginInlineEnd:8,userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0}},e))},ce={maxSnack:3,persist:!1,hideIconVariant:!1,disableWindowBlurListener:!1,variant:"default",autoHideDuration:5e3,iconVariant:{default:void 0,success:l.createElement(function(){return l.createElement(De,null,l.createElement("path",{d:`M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41
7
- 10.59L10 14.17L17.59 6.58L19 8L10 17Z`}))},null),warning:l.createElement(function(){return l.createElement(De,null,l.createElement("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"}))},null),error:l.createElement(function(){return l.createElement(De,null,l.createElement("path",{d:`M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,
8
- 6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,
9
- 13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z`}))},null),info:l.createElement(function(){return l.createElement(De,null,l.createElement("path",{d:`M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,
10
- 0 22,12A10,10 0 0,0 12,2Z`}))},null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},TransitionComponent:vt,transitionDuration:{enter:225,exit:195}};function Me(e){return Object.entries(e).reduce(function(o,r){var t,n=r[0],i=r[1];return T({},o,((t={})[n]=Xe(i),t))},{})}var Et="notistack-CollapseWrapper",tn=function(e){return"notistack-MuiContent-"+e},ct=Me({root:{height:0},entered:{height:"auto"}}),_e="0px",Ct=l.forwardRef(function(e,o){var r=e.children,t=e.in,n=e.onExited,i=l.useRef(null),s=l.useRef(null),u=Ze(o,s),c=function(){return i.current?i.current.clientHeight:0};return l.createElement(Qe,{in:t,unmountOnExit:!0,onEnter:function(d){d.style.height=_e},onEntered:function(d){d.style.height="auto"},onEntering:function(d){var p=c(),f=Ne({timeout:175,mode:"enter"}),x=f.duration,v=f.easing;d.style.transitionDuration=typeof x=="string"?x:x+"ms",d.style.height=p+"px",d.style.transitionTimingFunction=v||""},onExit:function(d){d.style.height=c()+"px"},onExited:n,onExiting:function(d){yt(d);var p=Ne({timeout:175,mode:"exit"}),f=p.duration,x=p.easing;d.style.transitionDuration=typeof f=="string"?f:f+"ms",d.style.height=_e,d.style.transitionTimingFunction=x||""},nodeRef:s,timeout:175},function(d,p){return l.createElement("div",Object.assign({ref:u,className:ie(ct.root,d==="entered"&&ct.entered),style:T({pointerEvents:"all",overflow:"hidden",minHeight:_e,transition:ge("height")},d==="entered"&&{overflow:"visible"},{},d==="exited"&&!t&&{visibility:"hidden"})},p),l.createElement("div",{ref:i,className:Et,style:{display:"flex",width:"100%"}},r))})});Ct.displayName="Collapse";var ut={right:"left",left:"right",bottom:"up",top:"down"},nn=function(e){return"anchorOrigin"+Je(e)},on=function(){};function Ce(e,o){return e.reduce(function(r,t){return t==null?r:function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];var u=[].concat(i);o&&u.indexOf(o)===-1&&u.push(o),r.apply(this,u),t.apply(this,u)}},on)}var rn=typeof window<"u"?l.useLayoutEffect:l.useEffect;function dt(e){var o=l.useRef(e);return rn(function(){o.current=e}),l.useCallback(function(){return o.current.apply(void 0,arguments)},[])}var Ue,St=l.forwardRef(function(e,o){var r=e.children,t=e.className,n=e.autoHideDuration,i=e.disableWindowBlurListener,s=i!==void 0&&i,u=e.onClose,c=e.id,d=e.open,p=e.SnackbarProps,f=p===void 0?{}:p,x=l.useRef(),v=dt(function(){u&&u.apply(void 0,arguments)}),y=dt(function(k){u&&k!=null&&(x.current&&clearTimeout(x.current),x.current=setTimeout(function(){v(null,"timeout",c)},k))});l.useEffect(function(){return d&&y(n),function(){x.current&&clearTimeout(x.current)}},[d,n,y]);var b=function(){x.current&&clearTimeout(x.current)},w=l.useCallback(function(){n!=null&&y(.5*n)},[n,y]);return l.useEffect(function(){if(!s&&d)return window.addEventListener("focus",w),window.addEventListener("blur",b),function(){window.removeEventListener("focus",w),window.removeEventListener("blur",b)}},[s,w,d]),l.createElement("div",Object.assign({ref:o},f,{className:ie("notistack-Snackbar",t),onMouseEnter:function(k){f.onMouseEnter&&f.onMouseEnter(k),b()},onMouseLeave:function(k){f.onMouseLeave&&f.onMouseLeave(k),w()}}),r)});St.displayName="Snackbar";var an=Me({root:(Ue={display:"flex",flexWrap:"wrap",flexGrow:1},Ue[Pe]={flexGrow:"initial",minWidth:"288px"},Ue)}),Ye=l.forwardRef(function(e,o){var r=e.className,t=Se(e,["className"]);return l.createElement("div",Object.assign({ref:o,className:ie(an.root,r)},t))});Ye.displayName="SnackbarContent";var we=Me({root:{backgroundColor:"#313131",fontSize:"0.875rem",lineHeight:1.43,letterSpacing:"0.01071em",color:"#fff",alignItems:"center",padding:"6px 16px",borderRadius:"4px",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"},lessPadding:{paddingLeft:"20px"},default:{backgroundColor:"#313131"},success:{backgroundColor:"#43a047"},error:{backgroundColor:"#d32f2f"},warning:{backgroundColor:"#ff9800"},info:{backgroundColor:"#2196f3"},message:{display:"flex",alignItems:"center",padding:"8px 0"},action:{display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:"16px",marginRight:"-8px"}}),pt="notistack-snackbar",Mt=l.forwardRef(function(e,o){var r=e.id,t=e.message,n=e.action,i=e.iconVariant,s=e.variant,u=e.hideIconVariant,c=e.style,d=e.className,p=i[s],f=n;return typeof f=="function"&&(f=f(r)),l.createElement(Ye,{ref:o,role:"alert","aria-describedby":pt,style:c,className:ie("notistack-MuiContent",tn(s),we.root,we[s],d,!u&&p&&we.lessPadding)},l.createElement("div",{id:pt,className:we.message},u?null:p,t),f&&l.createElement("div",{className:we.action},f))});Mt.displayName="MaterialDesignContent";var ve,Ve,Te,Oe,$e,sn=l.memo(Mt),ln=Me({wrappedRoot:{width:"100%",position:"relative",transform:"translateX(0)",top:0,right:0,bottom:0,left:0,minWidth:"288px"}}),cn=function(e){var o=l.useRef(),r=l.useState(!0),t=r[0],n=r[1],i=Ce([e.snack.onClose,e.onClose]),s=l.useCallback(function(){o.current=setTimeout(function(){n(function(_){return!_})},125)},[]);l.useEffect(function(){return function(){o.current&&clearTimeout(o.current)}},[]);var u,c=e.snack,d=e.classes,p=e.Component,f=p===void 0?sn:p,x=l.useMemo(function(){return function(_){_===void 0&&(_={});var I={containerRoot:!0,containerAnchorOriginTopCenter:!0,containerAnchorOriginBottomCenter:!0,containerAnchorOriginTopRight:!0,containerAnchorOriginBottomRight:!0,containerAnchorOriginTopLeft:!0,containerAnchorOriginBottomLeft:!0};return Object.keys(_).filter(function(H){return!I[H]}).reduce(function(H,G){var J;return T({},H,((J={})[G]=_[G],J))},{})}(d)},[d]),v=c.open,y=c.SnackbarProps,b=c.TransitionComponent,w=c.TransitionProps,k=c.transitionDuration,h=c.disableWindowBlurListener,R=c.content,E=Se(c,["open","SnackbarProps","TransitionComponent","TransitionProps","transitionDuration","disableWindowBlurListener","content","entered","requestClose","onEnter","onEntered","onExit","onExited"]),F=T({direction:(u=E.anchorOrigin,u.horizontal!=="center"?ut[u.horizontal]:ut[u.vertical]),timeout:k},w),L=R;typeof L=="function"&&(L=L(E.id,E.message));var q=["onEnter","onEntered","onExit","onExited"].reduce(function(_,I){var H;return T({},_,((H={})[I]=Ce([e.snack[I],e[I]],E.id),H))},{});return l.createElement(Ct,{in:t,onExited:q.onExited},l.createElement(St,{open:v,id:E.id,disableWindowBlurListener:h,autoHideDuration:E.autoHideDuration,className:ie(ln.wrappedRoot,x.root,x[nn(E.anchorOrigin)]),SnackbarProps:y,onClose:i},l.createElement(b,Object.assign({},F,{appear:!0,in:v,onExit:q.onExit,onExited:s,onEnter:q.onEnter,onEntered:Ce([q.onEntered,function(){e.snack.requestClose&&i(null,"instructed",e.snack.id)}],E.id)}),L||l.createElement(f,Object.assign({},E)))))},Ee=20,Ke=6,un=2,mt="."+Et,We=Me({root:(ve={boxSizing:"border-box",display:"flex",maxHeight:"100%",position:"fixed",zIndex:1400,height:"auto",width:"auto",transition:ge(["top","right","bottom","left","max-width"],{duration:300,easing:"ease"}),pointerEvents:"none"},ve[mt]={padding:Ke+"px 0px",transition:"padding 300ms ease 0ms"},ve.maxWidth="calc(100% - "+2*Ee+"px)",ve[Be]={width:"100%",maxWidth:"calc(100% - 32px)"},ve),rootDense:(Ve={},Ve[mt]={padding:un+"px 0px"},Ve),top:{top:Ee-Ke+"px",flexDirection:"column"},bottom:{bottom:Ee-Ke+"px",flexDirection:"column-reverse"},left:(Te={left:Ee+"px"},Te[Pe]={alignItems:"flex-start"},Te[Be]={left:"16px"},Te),right:(Oe={right:Ee+"px"},Oe[Pe]={alignItems:"flex-end"},Oe[Be]={right:"16px"},Oe),center:($e={left:"50%",transform:"translateX(-50%)"},$e[Pe]={alignItems:"center"},$e)}),dn=l.memo(function(e){var o=e.classes,r=o===void 0?{}:o,t=e.anchorOrigin,n=e.dense,i=e.children,s=ie("notistack-SnackbarContainer",We[t.vertical],We[t.horizontal],We.root,r.containerRoot,r["containerAnchorOrigin"+Je(t)],n&&We.rootDense);return l.createElement("div",{className:s},i)}),ft=function(e){return!(typeof e=="string"||l.isValidElement(e))},pn=function(e){function o(r){var t;return(t=e.call(this,r)||this).enqueueSnackbar=function(n,i){if(i===void 0&&(i={}),n==null)throw new Error("enqueueSnackbar called with invalid argument");var s=ft(n)?n:i,u=ft(n)?n.message:n,c=s.key,d=s.preventDuplicate,p=Se(s,["key","preventDuplicate"]),f=je(c),x=f?c:new Date().getTime()+Math.random(),v=function(b,w){return function(k,h){return h===void 0&&(h=!1),h?T({},ce[k],{},w[k],{},b[k]):k==="autoHideDuration"?(L=b.autoHideDuration,q=w.autoHideDuration,(_=function(I){return typeof I=="number"||I===null})(L)?L:_(q)?q:ce.autoHideDuration):k==="transitionDuration"?(R=b.transitionDuration,E=w.transitionDuration,(F=function(I,H){return H.some(function(G){return typeof I===G})})(R,["string","number"])?R:F(R,["object"])?T({},ce.transitionDuration,{},F(E,["object"])&&E,{},R):F(E,["string","number"])?E:F(E,["object"])?T({},ce.transitionDuration,{},E):ce.transitionDuration):b[k]||w[k]||ce[k];var R,E,F,L,q,_}}(p,t.props),y=T({id:x},p,{message:u,open:!0,entered:!1,requestClose:!1,persist:v("persist"),action:v("action"),content:v("content"),variant:v("variant"),anchorOrigin:v("anchorOrigin"),disableWindowBlurListener:v("disableWindowBlurListener"),autoHideDuration:v("autoHideDuration"),hideIconVariant:v("hideIconVariant"),TransitionComponent:v("TransitionComponent"),transitionDuration:v("transitionDuration"),TransitionProps:v("TransitionProps",!0),iconVariant:v("iconVariant",!0),style:v("style",!0),SnackbarProps:v("SnackbarProps",!0),className:ie(t.props.className,p.className)});return y.persist&&(y.autoHideDuration=void 0),t.setState(function(b){if(d===void 0&&t.props.preventDuplicate||d){var w=function(R){return f?R.id===x:R.message===u},k=b.queue.findIndex(w)>-1,h=b.snacks.findIndex(w)>-1;if(k||h)return b}return t.handleDisplaySnack(T({},b,{queue:[].concat(b.queue,[y])}))}),x},t.handleDisplaySnack=function(n){return n.snacks.length>=t.maxSnack?t.handleDismissOldest(n):t.processQueue(n)},t.processQueue=function(n){var i=n.queue,s=n.snacks;return i.length>0?T({},n,{snacks:[].concat(s,[i[0]]),queue:i.slice(1,i.length)}):n},t.handleDismissOldest=function(n){if(n.snacks.some(function(c){return!c.open||c.requestClose}))return n;var i=!1,s=!1;n.snacks.reduce(function(c,d){return c+(d.open&&d.persist?1:0)},0)===t.maxSnack&&(s=!0);var u=n.snacks.map(function(c){return i||c.persist&&!s?T({},c):(i=!0,c.entered?(c.onClose&&c.onClose(null,"maxsnack",c.id),t.props.onClose&&t.props.onClose(null,"maxsnack",c.id),T({},c,{open:!1})):T({},c,{requestClose:!0}))});return T({},n,{snacks:u})},t.handleEnteredSnack=function(n,i,s){if(!je(s))throw new Error("handleEnteredSnack Cannot be called with undefined key");t.setState(function(u){return{snacks:u.snacks.map(function(c){return c.id===s?T({},c,{entered:!0}):T({},c)})}})},t.handleCloseSnack=function(n,i,s){t.props.onClose&&t.props.onClose(n,i,s);var u=s===void 0;t.setState(function(c){var d=c.snacks,p=c.queue;return{snacks:d.map(function(f){return u||f.id===s?f.entered?T({},f,{open:!1}):T({},f,{requestClose:!0}):T({},f)}),queue:p.filter(function(f){return f.id!==s})}})},t.closeSnackbar=function(n){var i=t.state.snacks.find(function(s){return s.id===n});je(n)&&i&&i.onClose&&i.onClose(null,"instructed",n),t.handleCloseSnack(null,"instructed",n)},t.handleExitedSnack=function(n,i){if(!je(i))throw new Error("handleExitedSnack Cannot be called with undefined key");t.setState(function(s){var u=t.processQueue(T({},s,{snacks:s.snacks.filter(function(c){return c.id!==i})}));return u.queue.length===0?u:t.handleDismissOldest(u)})},t.enqueueSnackbar,t.closeSnackbar,t.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:t.enqueueSnackbar.bind(ot(t)),closeSnackbar:t.closeSnackbar.bind(ot(t))}},t}return bt(o,e),o.prototype.render=function(){var r=this,t=this.state.contextValue,n=this.props,i=n.domRoot,s=n.children,u=n.dense,c=u!==void 0&&u,d=n.Components,p=d===void 0?{}:d,f=n.classes,x=this.state.snacks.reduce(function(y,b){var w,k=Je(b.anchorOrigin),h=y[k]||[];return T({},y,((w={})[k]=[].concat(h,[b]),w))},{}),v=Object.keys(x).map(function(y){var b=x[y],w=b[0];return l.createElement(dn,{key:y,dense:c,anchorOrigin:w.anchorOrigin,classes:f},b.map(function(k){return l.createElement(cn,{key:k.id,snack:k,classes:f,Component:p[k.variant],onClose:r.handleCloseSnack,onEnter:r.props.onEnter,onExit:r.props.onExit,onExited:Ce([r.handleExitedSnack,r.props.onExited],k.id),onEntered:Ce([r.handleEnteredSnack,r.props.onEntered],k.id)})}))});return l.createElement(xt.Provider,{value:t},s,i?Wt.createPortal(v,i):v)},kt(o,[{key:"maxSnack",get:function(){return this.props.maxSnack||ce.maxSnack}}]),o}(l.Component),jt=function(){return l.useContext(xt)};const re={card:"_card_1a398_7",actionRoot:"_actionRoot_1a398_11",icons:"_icons_1a398_16",expand:"_expand_1a398_22",expandOpen:"_expandOpen_1a398_29",stackTraceContainer:"_stackTraceContainer_1a398_33"},Rt=l.forwardRef((e,o)=>{const{id:r,message:t,iconVariant:n,error:i,hideIconVariant:s,...u}=e,{closeSnackbar:c}=jt(),d=a.E0(),[p,f]=l.useState(!1),x=l.useCallback(()=>{f(b=>!b)},[]),v=l.useCallback(()=>{c(r)},[r,c]),y=i?.message||String(t);return m.jsx(Ye,{ref:o,className:a.yo(re.root,"error-snackbar"),children:m.jsxs(Ht,{className:re.card,style:{backgroundColor:d.palette.error.dark,border:`1px solid ${d.palette.error.dark}`},children:[m.jsxs(Ut,{className:re.actionRoot,children:[s?null:n?.error,m.jsx(a.Typography,{variant:"body2",component:"div",className:re.typography,style:{color:d.palette.text.primary},children:y}),m.jsx("div",{style:{flex:"1 1 auto"}}),m.jsxs("div",{className:re.icons,children:[i?m.jsx(a.IconButton,{"aria-label":"Show more",size:"small",className:a.yo(re.expand,{[re.expandOpen]:p}),style:{color:d.palette.action.active},onClick:x,children:m.jsx(a.Xn,{})}):null,m.jsx(a.IconButton,{size:"small",className:re.expand,style:{color:d.palette.action.active},onClick:v,children:m.jsx(a._o,{fontSize:"small"})})]})]}),i?m.jsx(Fe,{in:p,timeout:"auto",unmountOnExit:!0,children:m.jsx("div",{className:re.stackTraceContainer,style:{backgroundColor:d.palette.error.light,borderTop:`1px solid ${d.palette.error.main}`},children:m.jsx(a.L9,{error:i,hideLineNumbers:!0})})}):null]})})});Rt.displayName="ToastError";const Lt=l.memo(l.forwardRef((e,o)=>{const{commands:r,commandHook:t,scope:n="workbook",disabled:i=!1,...s}=e,u=a.me(d=>{const p={variant:a.Qt.Menuitem,parentFloat:d.floatReference,commandHook:t,scope:n,disabled:i},f=m.jsxs(m.Fragment,{children:[m.jsx(a.Oe,{...p,command:r.getCommand("newWorkbook"),icon:a.ve(m.jsx(a.yR,{}))}),m.jsx(a.$t,{orientation:"horizontal"}),m.jsx(a.Oe,{...p,command:r.getCommand("openWorkbook"),icon:a.ve(m.jsx(a.bR,{}))}),m.jsx(a.Kn,{...p,commands:r,quickCommand:"saveWorkbook",icon:a.ve(m.jsx(a.wR,{})),createPopupPanel:x=>{const v={...p,parentFloat:x.floatReference,scope:"saveWorkbook"},y=[];return a.qR.getWriteFormats().forEach(b=>{if(b.isDefault)return;let w=null;b.key==="CSV"?w=a.ve(m.jsx(a.xR,{})):b.key==="Excel"&&(w=a.ve(m.jsx(a.vR,{})));const k=r.getCommand(`saveWorkbookAs${b.key}`);k?y.push(l.createElement(a.Oe,{...v,key:b.key,command:k,icon:w})):console.warn(`Unable to resolve command: 'saveWorkbookAs${b.key}'`)}),a.Fn({...x,children:y,onClick:()=>{x.closeFloatAll()}})}})]});return a.Fn({...d,children:f,onClick:x=>{x.isDefaultPrevented||d.closeFloatAll()}})},[i,r,t,n]),c="File";return m.jsx(a.Kn,{commands:r,disabled:i,commandHook:t,scope:n,label:c,tooltip:"Options for saving and loading the workbook.",sx:{paddingBottom:"0px","& button":{paddingTop:"0px",paddingBottom:"0px",height:d=>`calc(1.25rem + ${d.spacing(2)}px)`}},...s,createPopupPanel:u,icon:m.jsx(a.es,{className:"label",icon:null,label:c})})}));Lt.displayName="StandaloneFileCommandButton";const mn=m.jsx(a.ar,{label:"SheetXL",description:"Visit me at sheetxl.com.",children:m.jsx(a.Box,{sx:{width:"24px",height:"24px",marginBottom:"4px",marginLeft:"6px"},children:m.jsx(a.NR,{onClick:()=>{window?.open("https://www.sheetxl.com","_blank")},style:{width:"24px",height:"24px",cursor:"pointer"}})})}),Dt=l.memo(l.forwardRef((e,o)=>{const{commands:r,workbook:t,logo:n=mn,mainElement:i,showFileMenu:s=!0,showAppearanceMenu:u=!0,...c}=e,{reference:d}=a.N0(),[p,{width:f}]=a.fc(),x=f<530,v=s?m.jsx(Lt,{commands:r,commandHook:{beforeExecute(){d?.closeAll()},onError(k,h,R){}}}):null,y=u?m.jsx(a.HR,{commands:r,commandHook:{beforeExecute(){d?.closeAll()},onError(k,h,R){}}}):null,b=l.useMemo(()=>({paddingLeft:k=>k.spacing(1),paddingRight:k=>k.spacing(1)}),[]),w=l.useRef(null);return m.jsx(a.Box,{ref:a.h5([w,p,o]),...c,children:a.DM({commands:r,renderCompact:x,workbook:t,selectWrapper:k=>m.jsxs(a.Box,{sx:{display:"flex",flex:"1",flexDirection:"row",alignItems:"stretch",gap:h=>h.spacing(1),paddingLeft:h=>h.spacing(1),paddingRight:h=>h.spacing(1)},children:[m.jsxs(a.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",flex:"1 1 100%",gap:h=>h.spacing(.5)},children:[n,m.jsxs(a.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:h=>h.spacing(.25)},children:[v,k]})]}),m.jsx(a.Box,{sx:{display:"flex",flexDirection:"row",flex:"1 1 300%",overflow:"hidden",alignItems:"center",justifyContent:"center"},children:i}),m.jsx(a.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"end",flex:x&&!y?"0 0 auto":"1 1 100%"},children:y})]}),selectProps:b,toolbarsProps:{Home:{sx:{}}}})})}));Dt.displayName="StandaloneWorkbookToolbar";const Tt=l.memo(l.forwardRef((e,o)=>{const{workbook:r,setWorkbook:t,refWorkbookTitle:n,titleWorkbook:i,setWorkbookTitle:s,titlePlaceHolder:u,children:c,undoManager:d,commands:p,importExportDisabled:f,themeModeOptions:x}=e,v=jt(),y=v?v.enqueueSnackbar:()=>{},b=v?v.closeSnackbar:()=>{},[w,k]=l.useState({isMounted:!1,label:null,starting:new Map,running:new Map}),h=l.useCallback(()=>{k(P=>({...P,isMounted:!0}))},[]),R=l.useCallback(()=>{k(P=>({...P,isMounted:!1}))},[]),E=a.OR(),F=a.LR(),L=a.AR(),q=l.useRef(new Set),_=l.useMemo(()=>{const P=(S,j)=>{if(j?.onceKey){if(q.current.has(j.onceKey))return;const D=new Set(q.current);D.add(j.onceKey),q.current=D}const A={variant:j?.type??a.z0.Info,anchorOrigin:{vertical:"top",horizontal:"center"},preventDuplicate:j?.preventDuplicate,persist:j?.persist??j?.type===a.z0.Error,action:D=>m.jsx(a.IconButton,{onClick:()=>b(D),children:m.jsx(Xt,{})})};j?.enqueueProps&&Object.assign(A,j.enqueueProps),S||console.log("message is 'null'",j),y(S??"Alert",A)};return{showMessage:P,showBusy:(S,j)=>{let A=null;const D=new Promise(U=>{A=U});return k(U=>{const B=new Map(U.starting);return B.set(D,A),{...U,label:S,starting:B}}),D},showWindow:(S,j,A)=>{const D={...j,onKeyDown:U=>{p?.dispatchToFocusedCommand(U),U.isDefaultPrevented()||U.isPropagationStopped()||j?.onKeyDown?.(U)}};return E(S,{sort:()=>Promise.resolve().then(()=>require("./BEJCfS2GnnCHB_Mm.cjs")),numberFormat:()=>Promise.resolve().then(()=>require("./CRbLTUE75pKqxTAE.cjs")),hyperlink:()=>Promise.resolve().then(()=>require("./Ckn4M7Qh3E3gxz2w.cjs")),comments:()=>Promise.resolve().then(()=>require("./hlMzhbyi3yXzEax6.cjs")),find:()=>Promise.resolve().then(()=>require("./D8mduMF3arHBud5b.cjs")),tableDetails:()=>Promise.resolve().then(()=>require("./D4J2MWfhcQh5QfIS.cjs")),tableNew:()=>Promise.resolve().then(()=>require("./BDVO5vEdK7Wah9u6.cjs")),namedDetails:()=>Promise.resolve().then(()=>require("./CyL3JLfSqByl6NJK.cjs"))}[S],D,A)},showOptions:F,showInputOptions:L,showError:S=>{let j,A=a.z0.Error,D="Unknown Error";typeof S=="string"?D=S:S instanceof Error&&(j=S,S.message&&(D=S.message)),S instanceof ue.PartialError&&(A=a.z0.Info),P(D,{type:A,enqueueProps:{error:j}})}}},[]),I=l.useCallback(()=>{},[]),H=(P=>{const{workbook:S,setWorkbook:j,importExportDisabled:A,workbookTitle:D="export",setWorkbookTitle:U,notifier:B,requestWorkbookTitle:Q,themeModeOptions:z,undoManager:M,commands:O,onExecute:V}=P,Y=a.me(z?.onForceModeChange,[z?.onForceModeChange]),ae=a.me(z?.onForceLightGridChange,[z?.onForceLightGridChange]),ne=a.me(z?.onForceLightImagesChange,[z?.onForceLightImagesChange]),Ae=a.me(async(W=null,Z=null)=>{const g=[];let C,$=null,ee=null;if(typeof W=="string"?ee=W:$=W,C=$?W:await a.Jt.openFileDialog(ee??a.qR.getAllReadFormatTypeAsString().join(",")),!C)return null;const se={source:C,constructorOptions:Z,onWarning:ze=>{g.push(ze)}},xe=await a.qR.read(se,B);return g.length>0&&(B?.showMessage?.("Some elements were not able to be imported. See console for details."),console.warn(`Import warnings:
11
- `+g.join(`
12
- `))),xe},[V,B,S]),ke=a.me(async(W,Z,g)=>{if(!Z&&Q){const C=await Q("Enter Workbook name to "+(g.isDefault?"Save.":`Export as ${g.description}.`));return C!==null&&a.qR.writeFile(C,W,{formatType:g.key})}return a.qR.writeFile(Z,W,{formatType:g.key})},[B,S,Q]),K=l.useCallback(()=>({contains:W=>!0,focus(){}}),[]),le=l.useMemo(()=>{const W=[];A||(a.qR.getWriteFormats().forEach(g=>{const C=g.isDefault,$={label:C?"Save Workbook":`Save Workbook as ${g.description}`,scopedLabels:{workbook:"Save",saveWorkbook:`as ${g.description}`},tags:g.tags,description:`Save the workbook to the desktop${C?"":` as ${g.description}`}.`};C&&($.shortcut={key:"S",modifiers:[a.Re.Ctrl]},W.push(new a.Ie("saveWorkbookAs",K,{label:"Save Workbook As…",scopedLabels:{workbook:"Save as…",saveWorkbook:"as…"},shortcut:[{key:"S",modifiers:[a.Re.Shift,a.Re.Ctrl]},{key:"F12"}],description:"Save the workbook to the desktop with the provided name."},()=>{ke(S,null,g).catch(se=>{B?.showError?.(se)})})));const ee=C?"saveWorkbook":`saveWorkbookAs${g.key}`;W.push(new a.Ie(ee,K,$,se=>{ke(S,se??D,g).catch(xe=>{B?.showError?.(xe)})}))}),W.push(new a.Ie("openWorkbook",K,{label:"Open Workbook…",scopedLabels:{workbook:"Open…"},description:"Open a workbook from the desktop.",shortcut:{key:"O",modifiers:[a.Re.Ctrl]}},async(g=null)=>{const C={date1904:S.isDate1904(),...S.options};try{const $=await Ae(g,C);if(!$)return;const ee=$.title,se=$.workbook,xe=se.getSelectedSheet();if($.formatType.mimeType==="text/csv"){const ze=S.findValidSheetName(ee);await S.doBatch(async()=>{const et=xe.getUsedRange();et?await S.getSheets().add({name:ze,autoSelect:!0}).getRange({colStart:0,rowStart:0,colEnd:0,rowEnd:0}).copyFrom(et):B?.showMessage("The file appears to be blank.")},`Import CSV '${ee}'`)}else S?.close(),U?.(ee),j(se)}catch($){B?.showError?.($)}})),W.push(new a.Ie("openWorkbookFromUrl",K,{label:"Open Workbook From Web",scopedLabels:{insert:"From Web",workbook:"From Web…"},description:"Open a workbook from the web."},async function(g){if(!g){const C=await B?.showInputOptions?.({title:"Open Workbook from the Web",description:"Enter the web address for the workbook to open.",inputLabel:"Address",initialValue:"https://www.sheetxl.com/examples/features-checklist.xlsx",inputProps:{style:{minWidth:"440px"}},options:["Open"]});if(C.option!=="Open")return;g=C.input}g&&console.log("openWorkbookFromUrl",g)})));let Z=[];return z&&(Z=[new a.Ie("themeMode",K,{label:"Light/Dark Mode",scopedLabels:{appearance:"Light/Dark Mode"},description:"Toggle the application styling between light and dark mode."}),new a.Ie("defaultThemeMode",K,{label:"Use System Light/Dark Mode",scopedLabels:{appearance:"Use System Default"},description:"Use the system settings to determine styling for light and dark mode."}),new a.Ie("forceLightGrid",K,{label:"Force Light Grid",description:"Force the grid to always render in light mode if dark mode is being used. This is ensures that the grid will render the colors as specified in another tools (for example Excel)."}),new a.Ie("forceLightImages",K,{label:"Force Light Images",description:"Force the images to always render in light mode if dark mode is being used. This is ensures that the images will render the colors as specified in another tools (for example Excel). This only has any effect if the grid is in dark mode."})]),[...W,...Z,new a.Tt("help",K,{label:"Show Help",description:"Provide Help.",shortcut:{key:"F1"}},()=>{}),new a.Tt("showKeyboardShortcuts",K,{label:"Keyboard Shortcuts",description:"Show keyboard shortcuts.",shortcut:{key:"/",modifiers:[a.Re.Ctrl]}},()=>{}),new a.Ie("gotoUrlGithub",K,{label:"Github",description:"Download examples, explore source code, and leave a star."},()=>{window?.open("https://github.com/sheetxl/sheetxl")}),new a.Ie("gotoUrlDiscord",K,{label:"Discord",description:"Join our community on discord."},()=>{window?.open("https://discord.gg/NTKdwUgK9p")}),new a.Ie("gotoUrlDocumentation",K,{label:"Documentation",description:"Read the documentation."},()=>{window?.open("https://www.sheetxl.com/docs")}),new a.Ie("gotoUrlIssue",K,{label:"Create Issue",description:"Create an issue to identify a bug or a feature request."},()=>{window?.open("https://github.com/sheetxl/sheetxl/issues")})]},[S,D,B,A,z,O,M]),X=l.useMemo(()=>{let W=null;return W=O?O.createChildGroup(K,"standaloneWorkbook",!1):new a.fs(K,"standaloneWorkbook"),W.addCommands(le,!0),W},[O,le]);a.gR({manager:M,commands:X,notifier:B});const{themeMode:be}=a.UR();l.useEffect(()=>{if(!z||!X)return;const W=z.forceMode==="dark"||!z.forceMode&&be==="dark";X.getCommand("themeMode").update({state:z.forceMode??null,label:W?"Dark Mode":"Light Mode",scopedLabels:{appearance:W?"Dark Mode":"Light Mode"}}).updateCallback(()=>{Y(W?a.WR.Light:a.WR.Dark)}),X.getCommand("defaultThemeMode").update({state:!z.forceMode}).updateCallback(()=>{Y(null)}),X.getCommand("forceLightGrid").update({state:z.forceLightGrid}).updateCallback(()=>{ae(!z.forceLightGrid)}),X.getCommand("forceLightImages").update({state:z.forceLightImages}).updateCallback(()=>{ne(!z.forceLightImages)})},[be,z,le]);const{showModal:qe}=a.Bu();return l.useEffect(()=>{const W=()=>new Promise((Z,g)=>{const C=l.lazy(()=>Promise.resolve().then(()=>require("./DAoqhWARDCCMxYfu.cjs"))),$=qe(C,{title:"Shortcut Keys Reference",commands:X,onDone:()=>{$.hide()},TransitionProps:{onExited:()=>{Z(!0)}}})});X.getCommand("showKeyboardShortcuts").updateCallback(()=>W()),X.getCommand("help").updateCallback(()=>W())},[le,X]),X})({workbook:r,setWorkbook:t,importExportDisabled:f,workbookTitle:i,setWorkbookTitle:s,commands:p,requestWorkbookTitle:P=>new Promise(S=>{n.current?n.current.requestWorkbookTitle((j,A)=>{S(j)},{selectAll:!0,requestReason:P}):S(u)}),themeModeOptions:x,undoManager:d,notifier:_,onExecute:I});l.useEffect(()=>{w.starting.size<=0||!w.isMounted||k(P=>{const S=new Map(P.running);return P.starting.forEach((j,A)=>{const D=()=>{k(U=>{const B=new Map(U.running);return B.delete(A),{...U,running:B}})};S.set(A,D),j(D)}),{...P,starting:new Map,running:S}})},[w]);const[G,J]=l.useState(null);l.useEffect(()=>{w.starting.size!==0||w.running.size!==0?J(m.jsx(a.bs,{icon:m.jsx(a.RR,{sx:{transform:"scale(0.7)",marginLeft:"-6px"}}),panel:!0,label:w.label,onMount:h,onUnmount:R,sx:{position:"absolute",left:"0",top:"0",width:"100%",height:"100%",zIndex:"9999"}})):J(null)},[w.starting,w.running]);const N=l.useMemo(()=>m.jsx(a.$R,{commands:H,disableHover:!0,sx:{padding:"0"},buttonProps:{sx:{maxHeight:"22px"}}}),[H]),te={notifier:_,commands:H};return r&&(te.statusBarProps={childrenEnd:N}),m.jsxs(m.Fragment,{children:[G,c?l.cloneElement(c,te):null]})}));Tt.displayName="SnackbarAndCommandsWrapper";const Ot=l.memo(l.forwardRef((e,o)=>{const{className:r,sx:t,style:n,onElementLoad:i,onError:s,undoManager:u,errorPanel:c=a.xx,onKeyDown:d,workbook:p,createWorkbookOptions:f,onWorkbookChange:x,logo:v,importExportDisabled:y=!1,themeModeOptions:b,autoFocus:w=!1,commands:k,title:h,onTitleChange:R,titleProps:E,...F}=e,L=l.useRef(null),q=a.me(x,[x]),_=a.me(R??E?.onTitleChange,[R??E?.onTitleChange]),I=E?.placeHolder??"Untitled",H=b?.forceMode,{themeMode:G,source:J}=a.UR({mode:H}),N=l.useMemo(()=>({...b,light:a.DR(!1,ue.CommonUtils.deepMerge(b?.theme??{},b?.light??{})),dark:a.DR(!0,ue.CommonUtils.deepMerge(b?.theme??{},b?.dark??{}))}),[b]),te=G===a.WR.Dark,[P,S]=l.useState(null);l.useEffect(()=>{S(u??new ue.UndoManager)},[u]);const[j,A]=l.useState(null),[D,U]=l.useState(null),B=a.Xf();l.useLayoutEffect(()=>{if(!p||Object.keys(p).length===0&&!ue.CommonUtils.isPromiseLike(p)){const g={theme:B.getDefaultTheme(),...f};U(new ue.Workbook(g))}else U(p)},[p]),l.useLayoutEffect(()=>{if(D){if(D instanceof ue.Workbook)return A({workbook:D}),void(p!==D&&q?.(D));(async()=>{try{let g,C=await Promise.resolve(D);C&&C.source&&(C=await a.qR.read(C)),C.workbook?(V(C.title),g=C.workbook):g=C,q?.(g),A({workbook:g})}catch(g){q?.(null),A({error:g})}})()}},[D]);const[Q,z]=l.useState(null);l.useEffect(()=>{if(!P||!j)return;P.clear();const g=j?.workbook?.getTransactions();return g?g.addListener({onCommitEnd:C=>{C.getDescription()?P.addUndoOperation({description:C.getDescription(),undo:()=>(g.revert(C.getId()),Q.source?.focus(),()=>{g.restore(C.getId()),Q.source?.focus()})}):console.warn("commit has no description",C)}}):void 0},[P,j,Q]);const M=a.me(g=>{g?P.setRepeatableOperation({description:g.label(),repeat:async()=>g.execute()}):P.setRepeatableOperation(null)},[P]),[O,V]=l.useState(h??E?.title??"");l.useEffect(()=>{V(h??E?.title??"")},[h??E?.title]),l.useEffect(()=>{_?.(O)},[O]);const[Y,ae]=l.useState(null),ne=l.useMemo(()=>{const g=()=>({contains:C=>!0,focus(){}});return k?k.createChildGroup(g,"application",!1):new a.fs(g,"application")},[k]),Ae=a.me(g=>{ae(g.source.getViewportElement()),z(g),ne.activate("sheet"),i?.(g)},[ne]);l.useEffect(()=>{Q&&w&&Q.source?.focus(typeof w=="object"?w:void 0)},[Q]);const ke=l.useRef(null),K=l.useCallback(g=>{let C=null;return E?.hidden||(C=m.jsx(a.eR,{...E,style:{maxWidth:"100%",...E?.style},workbook:L.current,ref:ke,title:O,placeHolder:I,onTitleChange:$=>{V($)}})),m.jsx(Dt,{...g,logo:v,mainElement:C,showFileMenu:!y,showAppearanceMenu:!!(N?.onForceLightGridChange||N?.onForceLightImagesChange||N?.onForceModeChange)})},[v,O,E,N,y,ne]);l.useEffect(()=>{const g=C=>C.preventDefault();return L.current?.addEventListener("wheel",g,{passive:!1}),()=>{L.current?.removeEventListener("wheel",g)}},[]);const le=l.useMemo(()=>m.jsx(a.bs,{transparentBackground:!0,sx:t,style:n}),[t,n]),X=l.useCallback(({error:g})=>(s?.(g),m.jsx(c,{sx:t,style:n,error:g??"Unable to display empty workbook."})),[t,n,s]),be=l.useMemo(()=>({...t,"& .SnackbarContainer-root":{position:"absolute !important"},"& .notistack-Snackbar":{minWidth:"unset"},"& .notistack-MuiContent *":{fontFamily:g=>g.typography.fontFamily},"& #notistack-snackbar":{maxWidth:"560px",whiteSpace:"pre-wrap"},"*":{userSelect:"none"}}),[t]),qe=a.h5([L,o]),W=l.useMemo(()=>{if(!j)return le;if(j.error||!j.workbook)return X({error:j.error});let g=null,C=null,$=!1;return N&&(g=te?N.dark:N.light,C=te&&!N.forceLightGrid?N.dark:N.light,$=N.forceLightImages),m.jsx(a.JM,{sx:be,style:n,tabIndex:0,autoFocus:!0,workbook:j.workbook,ref:qe,renderToolbar:K,onElementLoad:Ae,onRepeatCommandChange:M,onKeyDown:ee=>{d?.(ee)},gridTheme:C,headersTheme:g,forceLightImages:$,className:a.yo(r,"sheetxl-workbook"),onContextMenu:ee=>ee.preventDefault(),...F},"WorkbookElement")},[j,O,P,le,N,F,K,be]);let Z=m.jsx(Jt,{fallbackRender:X,children:m.jsx(pn,{maxSnack:3,domRoot:Y,anchorOrigin:{vertical:"bottom",horizontal:"right"},autoHideDuration:3500,onClose:(g,C,$)=>{L.current?.focus()},Components:{error:Rt},iconVariant:{success:m.jsx(a.SvgIcon,{style:{marginRight:"8px"},children:m.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"})}),error:m.jsx(a.MR,{style:{marginRight:"8px"}})},children:m.jsx(a.IR,{children:m.jsx(Tt,{workbook:j?.workbook,setWorkbook:U,importExportDisabled:y,titlePlaceHolder:I,titleWorkbook:O,setWorkbookTitle:V,refWorkbookTitle:ke,commands:ne,undoManager:P,themeModeOptions:N,children:W})})})});return N&&(Z=m.jsxs(a.nk,{theme:te?N.dark:N.light,children:[N.cssBaseline?m.jsx(Gt,{}):null,Z]})),Z}));Ot.displayName="EagerStandaloneWorkbook";const fn=Object.freeze(Object.defineProperty({__proto__:null,default:Ot},Symbol.toStringTag,{value:"Module"})),hn=Object.freeze(Object.defineProperty({__proto__:null,E:fn,c:ie},Symbol.toStringTag,{value:"Module"}));exports.BXKEJUmDPV4aXepN=hn,exports.Collapse=Fe,exports.fe=ie;
@@ -1,12 +0,0 @@
1
- "use strict";/**
2
- * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.6
3
- *
4
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const J=require("@sheetxl/sdk");exports.fromBufferJSON=async(b,l)=>{let c=b;(function(t){if(t.byteLength<4)return!1;const i=new Uint8Array(t),r={gzip:[31,139],zip:[80,75,3,4],bz2:[66,90,104],br:[206,178,207,129]},n=Object.keys(r);for(let s=0;s<n.length;s++){const o=n[s],e=r[o];let f=!0;for(let a=0;a<e.length;a++)if(i[a]!==e[a]){f=!1;break}if(f)return o}return!1})(c)&&(c=await async function(t,i="gzip"){let r;t instanceof SharedArrayBuffer?(r=new ArrayBuffer(t.byteLength),new Uint8Array(r).set(new Uint8Array(t))):r=t;const n=new Blob([r]).stream(),s=new DecompressionStream(i),o=n.pipeThrough(s);return(await new Response(o).blob()).arrayBuffer()}(c));let g=new TextDecoder().decode(c);const p=JSON.parse(g),w={...l?.constructorOptions??{},json:p};return new J.Workbook(w)},exports.toBufferJSON=async(b,l)=>{const c=await b.toJSON(),g=l?.whiteSpace??0;let p;l?.beforeWrite?.(b,c),p=g===0?JSON.stringify(c):function(i,r=2){const n=[];function s(o){const e=r*o;return n[e]===void 0&&(n[e]=" ".repeat(e)),n[e]}return function o(e,f,a,B){if(e==null||typeof e!="object")return JSON.stringify(e);const d=s(f),A=s(f+1);if(Array.isArray(e)){const u=e.length;if(u===0)return"[]";if(a!==0)return JSON.stringify(e);let y=`[
7
- `;for(let h=0;h<u;h++)y+=A+o(e[h],f+1,a+1,!0),h<u-1&&(y+=`,
8
- `);return y+=`
9
- `+d+"]",y}const m=Object.keys(e),O=m.length;if(O===0)return"{}";if(!(a<2))return JSON.stringify(e);let S=`{
10
- `;B||(a=0);for(let u=0;u<O;u++){const y=m[u];S+=A+JSON.stringify(y)+": "+o(e[y],f+1,a,!1),u<O-1&&(S+=`,
11
- `)}return S+=`
12
- `+d+"}",S}(i,0,0,!1)}(c,g);let w=new TextEncoder().encode(p).buffer;const t=l?.compress??!0;return t&&(w=await async function(i,r="gzip"){let n;i instanceof SharedArrayBuffer?(n=new ArrayBuffer(i.byteLength),new Uint8Array(n).set(new Uint8Array(i))):n=i;const s=new ReadableStream({start(f){f.enqueue(n),f.close()}}),o=new CompressionStream(r),e=s.pipeThrough(o);return(await new Response(e).blob()).arrayBuffer()}(w,typeof t=="string"?t:void 0)),w};
@@ -1,6 +0,0 @@
1
- "use strict";/**
2
- * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.6
3
- *
4
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("@sheetxl/sdk");exports.fromBufferCSV=async(a,d)=>{const{papaParseConfig:i,setValuesOptions:f,constructorOptions:h}=d??{},o=await Promise.resolve().then(()=>require("./Cg56Q7yFUDqoNyPz.cjs")).then(n=>n.p),m=new TextDecoder().decode(a);let p=-1;const t=new S.Workbook(h),u=t.getSelectedSheet().getEntireRange().startIncrementalUpdates({orientation:S.IRange.Orientation.Row}),c=d?.onProgress;let e=0;const r={...i,transform:(n,g)=>{i?.transform&&(n=i.transform(n,g));const s=g;s===0&&p++;let l=n??"";return u.pushAt(p,s,l),e++,e%1e5==0&&c?.(e),n}};return o.parse(m,r).data,u.apply({textParser:!0,...f}),t},exports.toBufferCSV=async(a,d)=>{const{trimLeadingBlankRow:i=!0,trimLeadingBlankColumn:f=!0,excludeHidden:h=!1,sheetKey:o=null,papaParseConfig:m={}}=d||{},p=await Promise.resolve().then(()=>require("./Cg56Q7yFUDqoNyPz.cjs")).then(s=>s.p);if(!a)throw new Error("workbook must be specified");let t=null;if(o===null?t=a.getSelectedSheet():typeof o=="number"?t=a.getSheets().search()[o]:typeof o=="string"&&(t=a.getSheets().getByName(o)),!t)throw new Error("invalid sheetKey specified");let u=null;const c=[];let e=null,r=t.getUsedRange({excludeHidden:h});if(!r)throw new Error("Nothing to export");if(!i||!f){const s=i?r.getRowStart():0,l=f?r.getColumnStart():0;r=r.getOffsetTo(s,l)}r.forEach((s,l)=>{const w=l.getCoords(),y=l.getCell();u!==w.rowIndex&&(e&&c.push(e),e=[],u=w.rowIndex);const x=y.toTextUnformatted()??"";e.push(x)},{includeEmpty:!0,address:null}),e&&c.push(e);const n={...m},g=p.unparse(c,n);return new TextEncoder().encode(g).buffer};