@sheetxl/studio-mui 0.4.7 → 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 (86) hide show
  1. package/browser/cjs/{D2F5d-KqoX6K87V-.cjs → B9VxvukbesYhdTdA.cjs} +2 -2
  2. package/browser/cjs/{6ahm9L_JadTVTVKM.cjs → BA7HloSCkIjbJehh.cjs} +2 -2
  3. package/browser/cjs/BJN1sH87EvdxRpOd.cjs +12 -0
  4. package/browser/cjs/{ZmZmJzyx8f56di-3.cjs → BXt_O5ZSE2LpILmE.cjs} +3 -3
  5. package/browser/cjs/{C0rgKqf5wJGFF0Pn.cjs → BZUPFYECmoclErqJ.cjs} +2 -2
  6. package/browser/cjs/{DK6e7OLzcRQFuNAR.cjs → Ba7K1ZdzfgXpvg7P.cjs} +1 -1
  7. package/browser/cjs/{D0g5Yi1sFZedrm8U.cjs → C1NVH5bp1otDYHTC.cjs} +2 -2
  8. package/browser/cjs/{BbvqKmxn6Rum-bk6.cjs → C1wsDeHNaWiFlCZh.cjs} +6 -6
  9. package/browser/cjs/{sia-JpDs1OJx3UqA.cjs → C7YVj8dlBBL_wOM9.cjs} +1 -1
  10. package/browser/cjs/{DQRGxRYSOKOEByUm.cjs → CPtvdlvWWilf8Vep.cjs} +2 -2
  11. package/browser/cjs/{CnIoJa4rGjDIRDt_.cjs → CTokFqp-O-Uhl0LW.cjs} +1 -1
  12. package/browser/cjs/{x0gHCGm4Ua404wtj.cjs → CeRQ0zAM1Xczv7Gm.cjs} +2 -2
  13. package/browser/cjs/{CzHIyuIwxVQd9I_P.cjs → CiJS-8DphNBc_B9t.cjs} +2 -2
  14. package/browser/cjs/{x5DxzBmBRyolQW8p.cjs → Cuyl2HX5ovut6vef.cjs} +2 -2
  15. package/browser/cjs/Czcg6yLU8uVHew0l.cjs +6 -0
  16. package/browser/cjs/D7ntR8K8guZD6yMH.cjs +6 -0
  17. package/browser/cjs/{BULArqiBp4j5hxyx.cjs → DIKyZ-hkjeexXMzY.cjs} +1 -1
  18. package/browser/cjs/{ojTdNwa8dIIVVsYa.cjs → DNjiEJT8EtVysR2q.cjs} +1 -1
  19. package/browser/cjs/DTaaqEmMOO2QrfZF.cjs +87 -0
  20. package/browser/cjs/{CmX_3VyTiwTzdJhI.cjs → DkfygXp4ZgvLr3Yw.cjs} +2 -2
  21. package/browser/cjs/{BnHBKznz1O8QEPEE.cjs → NRKyHbS2cOhmoSox.cjs} +2 -2
  22. package/browser/cjs/{B5H9gNIHdOkSXNhX.cjs → dYzaARxDkWvC98N4.cjs} +1 -1
  23. package/browser/cjs/index.cjs +2 -2
  24. package/browser/cjs/{CArewr_CDpxiRR66.cjs → k4ZW48PahXgf2WQD.cjs} +1 -1
  25. package/browser/cjs/z_x7DWNrjsFa45Nh.cjs +6 -0
  26. package/browser/cjs/{D5hBXjLlXQHJlC_R.cjs → znXBy3z9cM6mLfO7.cjs} +1 -1
  27. package/browser/esm/ABtrpK9yMoHh6oPr.mjs +864 -0
  28. package/browser/esm/{CAgqX2BO2DbnSbS0.mjs → BG3qcQNY_GZt3VHB.mjs} +2 -2
  29. package/browser/esm/{C2ogJhUgj6tBd2Ze.mjs → BG8pohDV-03DRiXx.mjs} +13 -13
  30. package/browser/esm/{DBhNx8LLdmzo5Avs.mjs → BYftsJS-zhpjBq1k.mjs} +2 -2
  31. package/browser/esm/{CJ46XJddcTe9sn3Q.mjs → Bd0yhfN0EoE3uahv.mjs} +2 -2
  32. package/browser/esm/{ww-U-PglTS7Dtu3g.mjs → CAvo3HCB981DM5OF.mjs} +2 -2
  33. package/browser/esm/{CIEN20sJj9GKW3yE.mjs → CHNZIKe6NNdfdZOr.mjs} +1 -1
  34. package/browser/esm/{D0TAETGiUzsAjxPY.mjs → CJxkcbtPJNL_Gloc.mjs} +16 -16
  35. package/browser/esm/{PjZRDfcmhPXxjS2K.mjs → COU2bYtN0WpsI4PY.mjs} +1 -1
  36. package/browser/esm/{CevfhoT-xtAPuMWS.mjs → CWtcMBj9hNKDPN_v.mjs} +2 -2
  37. package/browser/esm/{CMiuTssM0lBVhuJS.mjs → CzXTFr7g6RYXxPM1.mjs} +6 -6
  38. package/browser/esm/{DJJZ-Mz0hVMWcKq8.mjs → DIxDU9Lfq3hPWFPl.mjs} +2 -2
  39. package/browser/esm/{BSQXNtEzcvD1nZ07.mjs → DJBG1-2QdNbZKe_4.mjs} +7971 -7961
  40. package/browser/esm/{vs0v9un-v2S9Jnlo.mjs → DL8nFbYrab-MKQmF.mjs} +4 -4
  41. package/browser/esm/{DXbciCQNKY4_r5Et.mjs → DWOLWdzUONLf1nae.mjs} +1 -1
  42. package/browser/esm/{CRCvnu8AKE7fJq05.mjs → DatUamvfhoqxlf8D.mjs} +2 -2
  43. package/browser/esm/{BRio-IBtU98oZf5v.mjs → DdVyaTOGGjRcamT8.mjs} +1 -1
  44. package/browser/esm/{BgQK3a-xYWlmvNDD.mjs → DdzcCdPQ_zZbqH2p.mjs} +2 -2
  45. package/browser/esm/{DHsxjQ98xXj3tRTJ.mjs → DoDQcFwr66QfXlYi.mjs} +1 -1
  46. package/browser/esm/{54Y6CqDofk0Ryz8B.mjs → DwLP5jvXe3rwi5r2.mjs} +3 -3
  47. package/browser/esm/{D3DJPz0louDEmOOg.mjs → Dz_iWDlTCAECBFSF.mjs} +7 -7
  48. package/browser/esm/{BUxotxJXTYkCxXGj.mjs → GYPCajr96WY2V_je.mjs} +1 -1
  49. package/browser/esm/{BadcJIpfDDb6Oula.mjs → eq540RbNc68EuIvk.mjs} +1 -1
  50. package/browser/esm/index.mjs +26 -25
  51. package/browser/esm/{Ip_kfHi5bomcrUk6.mjs → lk_a0cAuz5HJsQKm.mjs} +1 -1
  52. package/browser/esm/{B5ZVjFCvGZMlskn5.mjs → zMjWIB_wUonhfIad.mjs} +2 -2
  53. package/licenses/dependencies.txt +6 -6
  54. package/node/esm/{D9INCGl89jNGldla.mjs → 0CnPehqlnzEMqDVS.mjs} +1 -1
  55. package/node/esm/{BeiZhSUAA8NyCua8.mjs → BFxNXzqwDw9mTzzX.mjs} +1 -1
  56. package/node/esm/{CTgcSkLGEwSlcrWM.mjs → BKkexYXFkC5jI1D4.mjs} +1 -1
  57. package/node/esm/{RPVynz_rpfz9lkAQ.mjs → BXF0I0KwKWFhkYfM.mjs} +7 -7
  58. package/node/esm/{CiFa6r-hL-KsSx0I.mjs → BpwzpczDCk32RxzY.mjs} +1 -1
  59. package/node/esm/{C2SG9zLSqOGo3vCR.mjs → C74xiDKgQep36e0D.mjs} +5 -5
  60. package/node/esm/{DQfxpSzOhUDp1tes.mjs → CE2Wff_Jx8m74lIm.mjs} +1 -1
  61. package/node/esm/{BK_IZrqK3_Xz2rfA.mjs → CVy5rNrHziJk0Xxc.mjs} +1 -1
  62. package/node/esm/{B_-60k30GZTVFJCG.mjs → ChbG8iQjvpz3jA7T.mjs} +1 -1
  63. package/node/esm/{xQKjfFNNUiXBnIeG.mjs → Cjw96KqgMSYqwdC4.mjs} +1 -1
  64. package/node/esm/{1YvclnJ1eNd7ibD-.mjs → ClUQ790AiAE9XIkY.mjs} +1 -1
  65. package/node/esm/{ClSJpKVPQuTKvJtg.mjs → D-Wu9vRF_DAsmME4.mjs} +14 -14
  66. package/node/esm/{DEtck55hesGlXNoj.mjs → D0ePiwz-m6oHmiUC.mjs} +1 -1
  67. package/node/esm/{BdwO--U2p6MiyekK.mjs → D4GNfE_QjFh3c9sT.mjs} +1 -1
  68. package/node/esm/DBDh50h4q3jgV4kn.mjs +312 -0
  69. package/node/esm/{BcfUxPgXAV1if9NT.mjs → DCLyoPsjP2qTWbca.mjs} +1 -1
  70. package/node/esm/{HAKu1GEoK2wZht5-.mjs → DTp1I9pWjg3-VyHr.mjs} +2 -2
  71. package/node/esm/{CJhxYk5D_7vcD7QG.mjs → DkTySui4bQaZlvaP.mjs} +1 -1
  72. package/node/esm/{BkzwNHPzd0DSf0FL.mjs → Dm3qRN9_dIcmeeTB.mjs} +19 -19
  73. package/node/esm/{DW9fZUq5TEVyK05B.mjs → cZHe3atogTKTMgvX.mjs} +1 -1
  74. package/node/esm/index.mjs +231 -221
  75. package/node/esm/{CVheJHEYC7Bxc-m9.mjs → q2jb3DavC5pzi-mZ.mjs} +1 -1
  76. package/node/esm/{DKqYePntZxW3fh6x.mjs → wxIEXtYch2hJq7Rz.mjs} +1 -1
  77. package/node/esm/{C-WOcvkTBKxqQfEZ.mjs → zfM7ir63qYOCXQWg.mjs} +20 -20
  78. package/package.json +8 -8
  79. package/types/index.d.ts +118 -81
  80. package/browser/cjs/Bi9ti1geH1gSoYX2.cjs +0 -6
  81. package/browser/cjs/Bt1aI3vb7h-PM53z.cjs +0 -6
  82. package/browser/cjs/CxMQIx_-k_XCclct.cjs +0 -87
  83. package/browser/cjs/DFkeNYQoyIagEEQ9.cjs +0 -6
  84. package/browser/cjs/iEu_JcRmrN7o_Gnt.cjs +0 -12
  85. package/browser/esm/BQoEwYUY9khnxsGk.mjs +0 -860
  86. package/node/esm/BlIGyiGNQyArtF2L.mjs +0 -308
@@ -1,860 +0,0 @@
1
- import { jsx as h, jsxs as ie, Fragment as It } from "react/jsx-runtime";
2
- import S, { Component as At, createElement as le, createContext as an, memo as Ee, forwardRef as oe, useRef as ne, useState as ee, useCallback as Z, useEffect as j, useMemo as $, useContext as sn, isValidElement as ln, cloneElement as cn, useLayoutEffect as st } from "react";
3
- import { u as un, a as lt, L as dn, T as te, v as Je, x as Te, y as pn, M as mn, P as fn, z as hn, b as kt, W as pe, d as gn, H as kn, e as bt, V as bn, f as xn, h as wn, j as yn, k as vn, m as Ht, n as En, l as Cn, A as Sn, Y as Ln, Q as K, Z as De, X as xt, K as Rt, w as Tn, o as jt, p as ct, E as Dn, q as Mn, s as On, t as Wn, $ as qt, G as Fn, B as Pn, D as Re, U as Nn, F as wt, R as In, I as An, J as Hn, N as Rn, O as jn, S as qn } from "./BSQXNtEzcvD1nZ07.mjs";
4
- import { createPortal as Bn } from "react-dom";
5
- import { Card as _n, CardActions as Vn, Typography as zn, IconButton as ut, Collapse as Un, Box as ue, SvgIcon as Gn, CssBaseline as Kn } from "@mui/material";
6
- import { PartialError as $n, CommonUtils as et, UndoManager as Zn, Workbook as yt } from "@sheetxl/sdk";
7
- import { ExpandMore as Xn, Close as Qn, CancelOutlined as Yn } from "@mui/icons-material";
8
- /**
9
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.7
10
- *
11
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
12
- * License: The license can be found at https://www.sheetxl.com/license.
13
- */
14
- const Jn = an(null), tt = { didCatch: !1, error: null };
15
- class eo extends At {
16
- constructor(a) {
17
- super(a), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = tt;
18
- }
19
- static getDerivedStateFromError(a) {
20
- return { didCatch: !0, error: a };
21
- }
22
- resetErrorBoundary() {
23
- const { error: a } = this.state;
24
- if (a !== null) {
25
- for (var r, e, n = arguments.length, o = new Array(n), i = 0; i < n; i++) o[i] = arguments[i];
26
- (r = (e = this.props).onReset) === null || r === void 0 || r.call(e, { args: o, reason: "imperative-api" }), this.setState(tt);
27
- }
28
- }
29
- componentDidCatch(a, r) {
30
- var e, n;
31
- (e = (n = this.props).onError) === null || e === void 0 || e.call(n, a, r);
32
- }
33
- componentDidUpdate(a, r) {
34
- const { didCatch: e } = this.state, { resetKeys: n } = this.props;
35
- var o, i;
36
- e && r.error !== null && function() {
37
- let c = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
38
- return c.length !== s.length || c.some((l, u) => !Object.is(l, s[u]));
39
- }(a.resetKeys, n) && ((o = (i = this.props).onReset) === null || o === void 0 || o.call(i, { next: n, prev: a.resetKeys, reason: "keys" }), this.setState(tt));
40
- }
41
- render() {
42
- const { children: a, fallbackRender: r, FallbackComponent: e, fallback: n } = this.props, { didCatch: o, error: i } = this.state;
43
- let c = a;
44
- if (o) {
45
- const s = { error: i, resetErrorBoundary: this.resetErrorBoundary };
46
- if (typeof r == "function") c = r(s);
47
- else if (e) c = le(e, s);
48
- else {
49
- if (n === void 0) throw i;
50
- c = n;
51
- }
52
- }
53
- return le(Jn.Provider, { value: { didCatch: o, error: i, resetErrorBoundary: this.resetErrorBoundary } }, c);
54
- }
55
- }
56
- function Bt(t) {
57
- var a, r, e = "";
58
- if (typeof t == "string" || typeof t == "number") e += t;
59
- else if (typeof t == "object") if (Array.isArray(t)) for (a = 0; a < t.length; a++) t[a] && (r = Bt(t[a])) && (e && (e += " "), e += r);
60
- else for (a in t) t[a] && (e && (e += " "), e += a);
61
- return e;
62
- }
63
- function fe() {
64
- for (var t, a, r = 0, e = ""; r < arguments.length; ) (t = arguments[r++]) && (a = Bt(t)) && (e && (e += " "), e += a);
65
- return e;
66
- }
67
- let to = { data: "" }, no = (t) => typeof window == "object" ? ((t ? t.querySelector("#_goober") : window._goober) || Object.assign((t || document.head).appendChild(document.createElement("style")), { innerHTML: " ", id: "_goober" })).firstChild : t || to, oo = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, ro = /\/\*[^]*?\*\/| +/g, vt = /\n+/g, me = (t, a) => {
68
- let r = "", e = "", n = "";
69
- for (let o in t) {
70
- let i = t[o];
71
- o[0] == "@" ? o[1] == "i" ? r = o + " " + i + ";" : e += o[1] == "f" ? me(i, o) : o + "{" + me(i, o[1] == "k" ? "" : a) + "}" : typeof i == "object" ? e += me(i, a ? a.replace(/([^,])+/g, (c) => o.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g, (s) => /&/.test(s) ? s.replace(/&/g, c) : c ? c + " " + s : s)) : o) : i != null && (o = /^--/.test(o) ? o : o.replace(/[A-Z]/g, "-$&").toLowerCase(), n += me.p ? me.p(o, i) : o + ":" + i + ";");
72
- }
73
- return r + (a && n ? a + "{" + n + "}" : n) + e;
74
- }, re = {}, _t = (t) => {
75
- if (typeof t == "object") {
76
- let a = "";
77
- for (let r in t) a += r + _t(t[r]);
78
- return a;
79
- }
80
- return t;
81
- }, ao = (t, a, r, e, n) => {
82
- let o = _t(t), i = re[o] || (re[o] = ((s) => {
83
- let l = 0, u = 11;
84
- for (; l < s.length; ) u = 101 * u + s.charCodeAt(l++) >>> 0;
85
- return "go" + u;
86
- })(o));
87
- if (!re[i]) {
88
- let s = o !== t ? t : ((l) => {
89
- let u, d, m = [{}];
90
- for (; u = oo.exec(l.replace(ro, "")); ) u[4] ? m.shift() : u[3] ? (d = u[3].replace(vt, " ").trim(), m.unshift(m[0][d] = m[0][d] || {})) : m[0][u[1]] = u[2].replace(vt, " ").trim();
91
- return m[0];
92
- })(t);
93
- re[i] = me(n ? { ["@keyframes " + i]: s } : s, r ? "" : "." + i);
94
- }
95
- let c = r && re.g ? re.g : null;
96
- return r && (re.g = re[i]), ((s, l, u, d) => {
97
- d ? l.data = l.data.replace(d, s) : l.data.indexOf(s) === -1 && (l.data = u ? s + l.data : l.data + s);
98
- })(re[i], a, e, c), i;
99
- };
100
- function dt(t) {
101
- let a = this || {}, r = t.call ? t(a.p) : t;
102
- return ao(r.unshift ? r.raw ? ((e, n, o) => e.reduce((i, c, s) => {
103
- let l = n[s];
104
- if (l && l.call) {
105
- let u = l(o), d = u && u.props && u.props.className || /^go/.test(u) && u;
106
- l = d ? "." + d : u && typeof u == "object" ? u.props ? "" : me(u, "") : u === !1 ? "" : u;
107
- }
108
- return i + c + (l ?? "");
109
- }, ""))(r, [].slice.call(arguments, 1), a.p) : r.reduce((e, n) => Object.assign(e, n && n.call ? n(a.p) : n), {}) : r, no(a.target), a.g, a.o, a.k);
110
- }
111
- function Vt(t, a, r) {
112
- return a && function(e, n) {
113
- for (var o = 0; o < n.length; o++) {
114
- var i = n[o];
115
- i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i);
116
- }
117
- }(t.prototype, a), t;
118
- }
119
- function L() {
120
- return L = Object.assign || function(t) {
121
- for (var a = 1; a < arguments.length; a++) {
122
- var r = arguments[a];
123
- for (var e in r) Object.prototype.hasOwnProperty.call(r, e) && (t[e] = r[e]);
124
- }
125
- return t;
126
- }, L.apply(this, arguments);
127
- }
128
- function zt(t, a) {
129
- t.prototype = Object.create(a.prototype), t.prototype.constructor = t, t.__proto__ = a;
130
- }
131
- function Ne(t, a) {
132
- if (t == null) return {};
133
- var r, e, n = {}, o = Object.keys(t);
134
- for (e = 0; e < o.length; e++) r = o[e], a.indexOf(r) >= 0 || (n[r] = t[r]);
135
- return n;
136
- }
137
- function Et(t) {
138
- if (t === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
139
- return t;
140
- }
141
- dt.bind({ g: 1 }), dt.bind({ k: 1 });
142
- var Ct = function() {
143
- return "";
144
- }, Ut = S.createContext({ enqueueSnackbar: Ct, closeSnackbar: Ct }), nt = "@media (max-width:599.95px)", Ge = "@media (min-width:600px)", St = function(t) {
145
- return t.charAt(0).toUpperCase() + t.slice(1);
146
- }, mt = function(t) {
147
- return "" + St(t.vertical) + St(t.horizontal);
148
- }, je = function(t) {
149
- return !!t || t === 0;
150
- }, qe = "unmounted", xe = "exited", we = "entering", Me = "entered", Lt = "exiting", ft = function(t) {
151
- function a(e) {
152
- var n;
153
- n = t.call(this, e) || this;
154
- var o, i = e.appear;
155
- return n.appearStatus = null, e.in ? i ? (o = xe, n.appearStatus = we) : o = Me : o = e.unmountOnExit || e.mountOnEnter ? qe : xe, n.state = { status: o }, n.nextCallback = null, n;
156
- }
157
- zt(a, t), a.getDerivedStateFromProps = function(e, n) {
158
- return e.in && n.status === qe ? { status: xe } : null;
159
- };
160
- var r = a.prototype;
161
- return r.componentDidMount = function() {
162
- this.updateStatus(!0, this.appearStatus);
163
- }, r.componentDidUpdate = function(e) {
164
- var n = null;
165
- if (e !== this.props) {
166
- var o = this.state.status;
167
- this.props.in ? o !== we && o !== Me && (n = we) : o !== we && o !== Me || (n = Lt);
168
- }
169
- this.updateStatus(!1, n);
170
- }, r.componentWillUnmount = function() {
171
- this.cancelNextCallback();
172
- }, r.getTimeouts = function() {
173
- var e = this.props.timeout, n = e, o = e;
174
- return e != null && typeof e != "number" && typeof e != "string" && (o = e.exit, n = e.enter), { exit: o, enter: n };
175
- }, r.updateStatus = function(e, n) {
176
- e === void 0 && (e = !1), n !== null ? (this.cancelNextCallback(), n === we ? this.performEnter(e) : this.performExit()) : this.props.unmountOnExit && this.state.status === xe && this.setState({ status: qe });
177
- }, r.performEnter = function(e) {
178
- var n = this, o = this.props.enter, i = e, c = this.getTimeouts();
179
- e || o ? (this.props.onEnter && this.props.onEnter(this.node, i), this.safeSetState({ status: we }, function() {
180
- n.props.onEntering && n.props.onEntering(n.node, i), n.onTransitionEnd(c.enter, function() {
181
- n.safeSetState({ status: Me }, function() {
182
- n.props.onEntered && n.props.onEntered(n.node, i);
183
- });
184
- });
185
- })) : this.safeSetState({ status: Me }, function() {
186
- n.props.onEntered && n.props.onEntered(n.node, i);
187
- });
188
- }, r.performExit = function() {
189
- var e = this, n = this.props.exit, o = this.getTimeouts();
190
- n ? (this.props.onExit && this.props.onExit(this.node), this.safeSetState({ status: Lt }, function() {
191
- e.props.onExiting && e.props.onExiting(e.node), e.onTransitionEnd(o.exit, function() {
192
- e.safeSetState({ status: xe }, function() {
193
- e.props.onExited && e.props.onExited(e.node);
194
- });
195
- });
196
- })) : this.safeSetState({ status: xe }, function() {
197
- e.props.onExited && e.props.onExited(e.node);
198
- });
199
- }, r.cancelNextCallback = function() {
200
- this.nextCallback !== null && this.nextCallback.cancel && (this.nextCallback.cancel(), this.nextCallback = null);
201
- }, r.safeSetState = function(e, n) {
202
- n = this.setNextCallback(n), this.setState(e, n);
203
- }, r.setNextCallback = function(e) {
204
- var n = this, o = !0;
205
- return this.nextCallback = function() {
206
- o && (o = !1, n.nextCallback = null, e());
207
- }, this.nextCallback.cancel = function() {
208
- o = !1;
209
- }, this.nextCallback;
210
- }, r.onTransitionEnd = function(e, n) {
211
- this.setNextCallback(n);
212
- var o = e == null && !this.props.addEndListener;
213
- this.node && !o ? (this.props.addEndListener && this.props.addEndListener(this.node, this.nextCallback), e != null && setTimeout(this.nextCallback, e)) : setTimeout(this.nextCallback, 0);
214
- }, r.render = function() {
215
- var e = this.state.status;
216
- if (e === qe) return null;
217
- var n = this.props;
218
- return (0, n.children)(e, Ne(n, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]));
219
- }, Vt(a, [{ key: "node", get: function() {
220
- var e, n = (e = this.props.nodeRef) === null || e === void 0 ? void 0 : e.current;
221
- if (!n) throw new Error("notistack - Custom snackbar is not refForwarding");
222
- return n;
223
- } }]), a;
224
- }(S.Component);
225
- function ye() {
226
- }
227
- function Tt(t, a) {
228
- typeof t == "function" ? t(a) : t && (t.current = a);
229
- }
230
- function pt(t, a) {
231
- return $(function() {
232
- return t == null && a == null ? null : function(r) {
233
- Tt(t, r), Tt(a, r);
234
- };
235
- }, [t, a]);
236
- }
237
- function Ke(t) {
238
- var a = t.timeout, r = t.style, e = r === void 0 ? {} : r, n = t.mode;
239
- return { duration: typeof a == "object" ? a[n] || 0 : a, easing: e.transitionTimingFunction, delay: e.transitionDelay };
240
- }
241
- ft.defaultProps = { in: !1, mountOnEnter: !1, unmountOnExit: !1, appear: !1, enter: !0, exit: !0, onEnter: ye, onEntering: ye, onEntered: ye, onExit: ye, onExiting: ye, onExited: ye };
242
- var io = "cubic-bezier(0.4, 0, 0.2, 1)", so = "cubic-bezier(0.0, 0, 0.2, 1)", lo = "cubic-bezier(0.4, 0, 0.6, 1)", Gt = function(t) {
243
- t.scrollTop = t.scrollTop;
244
- }, Dt = function(t) {
245
- return Math.round(t) + "ms";
246
- };
247
- function ve(t, a) {
248
- t === void 0 && (t = ["all"]);
249
- var r = a || {}, e = r.duration, n = e === void 0 ? 300 : e, o = r.easing, i = o === void 0 ? io : o, c = r.delay, s = c === void 0 ? 0 : c;
250
- return (Array.isArray(t) ? t : [t]).map(function(l) {
251
- var u = typeof n == "string" ? n : Dt(n), d = typeof s == "string" ? s : Dt(s);
252
- return l + " " + u + " " + i + " " + d;
253
- }).join(",");
254
- }
255
- function Kt(t) {
256
- var a = function(r) {
257
- return r && r.ownerDocument || document;
258
- }(t);
259
- return a.defaultView || window;
260
- }
261
- function Be(t, a) {
262
- if (a) {
263
- var r = function(e, n) {
264
- var o, i = n.getBoundingClientRect(), c = Kt(n);
265
- if (n.fakeTransform) o = n.fakeTransform;
266
- else {
267
- var s = c.getComputedStyle(n);
268
- o = s.getPropertyValue("-webkit-transform") || s.getPropertyValue("transform");
269
- }
270
- var l = 0, u = 0;
271
- if (o && o !== "none" && typeof o == "string") {
272
- var d = o.split("(")[1].split(")")[0].split(",");
273
- l = parseInt(d[4], 10), u = parseInt(d[5], 10);
274
- }
275
- switch (e) {
276
- case "left":
277
- return "translateX(" + (c.innerWidth + l - i.left) + "px)";
278
- case "right":
279
- return "translateX(-" + (i.left + i.width - l) + "px)";
280
- case "up":
281
- return "translateY(" + (c.innerHeight + u - i.top) + "px)";
282
- default:
283
- return "translateY(-" + (i.top + i.height - u) + "px)";
284
- }
285
- }(t, a);
286
- r && (a.style.webkitTransform = r, a.style.transform = r);
287
- }
288
- }
289
- var $t = oe(function(t, a) {
290
- var r = t.children, e = t.direction, n = e === void 0 ? "down" : e, o = t.in, i = t.style, c = t.timeout, s = c === void 0 ? 0 : c, l = t.onEnter, u = t.onEntered, d = t.onExit, m = t.onExited, b = Ne(t, ["children", "direction", "in", "style", "timeout", "onEnter", "onEntered", "onExit", "onExited"]), w = ne(null), x = pt(r.ref, w), y = pt(x, a), g = Z(function() {
291
- w.current && Be(n, w.current);
292
- }, [n]);
293
- return j(function() {
294
- if (!o && n !== "down" && n !== "right") {
295
- var f = function(C, Y) {
296
- var R;
297
- function q() {
298
- for (var B = this, z = arguments.length, _ = new Array(z), X = 0; X < z; X++) _[X] = arguments[X];
299
- clearTimeout(R), R = setTimeout(function() {
300
- C.apply(B, _);
301
- }, Y);
302
- }
303
- return Y === void 0 && (Y = 166), q.clear = function() {
304
- clearTimeout(R);
305
- }, q;
306
- }(function() {
307
- w.current && Be(n, w.current);
308
- }), O = Kt(w.current);
309
- return O.addEventListener("resize", f), function() {
310
- f.clear(), O.removeEventListener("resize", f);
311
- };
312
- }
313
- }, [n, o]), j(function() {
314
- o || g();
315
- }, [o, g]), le(ft, Object.assign({ appear: !0, nodeRef: w, onEnter: function(f, O) {
316
- Be(n, f), Gt(f), l && l(f, O);
317
- }, onEntered: u, onEntering: function(f) {
318
- var O = i?.transitionTimingFunction || so, C = Ke({ timeout: s, mode: "enter", style: L({}, i, { transitionTimingFunction: O }) });
319
- f.style.webkitTransition = ve("-webkit-transform", C), f.style.transition = ve("transform", C), f.style.webkitTransform = "none", f.style.transform = "none";
320
- }, onExit: function(f) {
321
- var O = i?.transitionTimingFunction || lo, C = Ke({ timeout: s, mode: "exit", style: L({}, i, { transitionTimingFunction: O }) });
322
- f.style.webkitTransition = ve("-webkit-transform", C), f.style.transition = ve("transform", C), Be(n, f), d && d(f);
323
- }, onExited: function(f) {
324
- f.style.webkitTransition = "", f.style.transition = "", m && m(f);
325
- }, in: o, timeout: s }, b), function(f, O) {
326
- return cn(r, L({ ref: y, style: L({ visibility: f !== "exited" || o ? void 0 : "hidden" }, i, {}, r.props.style) }, O));
327
- });
328
- });
329
- $t.displayName = "Slide";
330
- var $e = function(t) {
331
- return S.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 } }, t));
332
- }, co = function() {
333
- return S.createElement($e, null, S.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
334
- 10.59L10 14.17L17.59 6.58L19 8L10 17Z` }));
335
- }, uo = function() {
336
- return S.createElement($e, null, S.createElement("path", { d: "M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z" }));
337
- }, po = function() {
338
- return S.createElement($e, null, S.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,
339
- 6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,
340
- 13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z` }));
341
- }, mo = function() {
342
- return S.createElement($e, null, S.createElement("path", { d: `M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,
343
- 0 22,12A10,10 0 0,0 12,2Z` }));
344
- }, de = { maxSnack: 3, persist: !1, hideIconVariant: !1, disableWindowBlurListener: !1, variant: "default", autoHideDuration: 5e3, iconVariant: { default: void 0, success: S.createElement(co, null), warning: S.createElement(uo, null), error: S.createElement(po, null), info: S.createElement(mo, null) }, anchorOrigin: { vertical: "bottom", horizontal: "left" }, TransitionComponent: $t, transitionDuration: { enter: 225, exit: 195 } }, fo = function(t, a) {
345
- return function(r, e) {
346
- return e === void 0 && (e = !1), e ? L({}, de[r], {}, a[r], {}, t[r]) : r === "autoHideDuration" ? (n = t.autoHideDuration, o = a.autoHideDuration, (i = function(c) {
347
- return typeof c == "number" || c === null;
348
- })(n) ? n : i(o) ? o : de.autoHideDuration) : r === "transitionDuration" ? function(c, s) {
349
- var l = function(u, d) {
350
- return d.some(function(m) {
351
- return typeof u === m;
352
- });
353
- };
354
- return l(c, ["string", "number"]) ? c : l(c, ["object"]) ? L({}, de.transitionDuration, {}, l(s, ["object"]) && s, {}, c) : l(s, ["string", "number"]) ? s : l(s, ["object"]) ? L({}, de.transitionDuration, {}, s) : de.transitionDuration;
355
- }(t.transitionDuration, a.transitionDuration) : t[r] || a[r] || de[r];
356
- var n, o, i;
357
- };
358
- };
359
- function Ie(t) {
360
- return Object.entries(t).reduce(function(a, r) {
361
- var e, n = r[0], o = r[1];
362
- return L({}, a, ((e = {})[n] = dt(o), e));
363
- }, {});
364
- }
365
- var ho = "notistack-SnackbarContainer", go = "notistack-Snackbar", Zt = "notistack-CollapseWrapper", ko = "notistack-MuiContent", bo = function(t) {
366
- return "notistack-MuiContent-" + t;
367
- }, Mt = Ie({ root: { height: 0 }, entered: { height: "auto" } }), ot = "0px", Xt = oe(function(t, a) {
368
- var r = t.children, e = t.in, n = t.onExited, o = ne(null), i = ne(null), c = pt(a, i), s = function() {
369
- return o.current ? o.current.clientHeight : 0;
370
- };
371
- return le(ft, { in: e, unmountOnExit: !0, onEnter: function(l) {
372
- l.style.height = ot;
373
- }, onEntered: function(l) {
374
- l.style.height = "auto";
375
- }, onEntering: function(l) {
376
- var u = s(), d = Ke({ timeout: 175, mode: "enter" }), m = d.duration, b = d.easing;
377
- l.style.transitionDuration = typeof m == "string" ? m : m + "ms", l.style.height = u + "px", l.style.transitionTimingFunction = b || "";
378
- }, onExit: function(l) {
379
- l.style.height = s() + "px";
380
- }, onExited: n, onExiting: function(l) {
381
- Gt(l);
382
- var u = Ke({ timeout: 175, mode: "exit" }), d = u.duration, m = u.easing;
383
- l.style.transitionDuration = typeof d == "string" ? d : d + "ms", l.style.height = ot, l.style.transitionTimingFunction = m || "";
384
- }, nodeRef: i, timeout: 175 }, function(l, u) {
385
- return le("div", Object.assign({ ref: c, className: fe(Mt.root, l === "entered" && Mt.entered), style: L({ pointerEvents: "all", overflow: "hidden", minHeight: ot, transition: ve("height") }, l === "entered" && { overflow: "visible" }, {}, l === "exited" && !e && { visibility: "hidden" }) }, u), le("div", { ref: o, className: Zt, style: { display: "flex", width: "100%" } }, r));
386
- });
387
- });
388
- Xt.displayName = "Collapse";
389
- var Ot = { right: "left", left: "right", bottom: "up", top: "down" }, xo = function(t) {
390
- return "anchorOrigin" + mt(t);
391
- }, wo = function() {
392
- };
393
- function Pe(t, a) {
394
- return t.reduce(function(r, e) {
395
- return e == null ? r : function() {
396
- for (var n = arguments.length, o = new Array(n), i = 0; i < n; i++) o[i] = arguments[i];
397
- var c = [].concat(o);
398
- a && c.indexOf(a) === -1 && c.push(a), r.apply(this, c), e.apply(this, c);
399
- };
400
- }, wo);
401
- }
402
- var yo = typeof window < "u" ? st : j;
403
- function Wt(t) {
404
- var a = ne(t);
405
- return yo(function() {
406
- a.current = t;
407
- }), Z(function() {
408
- return a.current.apply(void 0, arguments);
409
- }, []);
410
- }
411
- var rt, Qt = oe(function(t, a) {
412
- var r = t.children, e = t.className, n = t.autoHideDuration, o = t.disableWindowBlurListener, i = o !== void 0 && o, c = t.onClose, s = t.id, l = t.open, u = t.SnackbarProps, d = u === void 0 ? {} : u, m = ne(), b = Wt(function() {
413
- c && c.apply(void 0, arguments);
414
- }), w = Wt(function(g) {
415
- c && g != null && (m.current && clearTimeout(m.current), m.current = setTimeout(function() {
416
- b(null, "timeout", s);
417
- }, g));
418
- });
419
- j(function() {
420
- return l && w(n), function() {
421
- m.current && clearTimeout(m.current);
422
- };
423
- }, [l, n, w]);
424
- var x = function() {
425
- m.current && clearTimeout(m.current);
426
- }, y = Z(function() {
427
- n != null && w(0.5 * n);
428
- }, [n, w]);
429
- return j(function() {
430
- if (!i && l) return window.addEventListener("focus", y), window.addEventListener("blur", x), function() {
431
- window.removeEventListener("focus", y), window.removeEventListener("blur", x);
432
- };
433
- }, [i, y, l]), le("div", Object.assign({ ref: a }, d, { className: fe(go, e), onMouseEnter: function(g) {
434
- d.onMouseEnter && d.onMouseEnter(g), x();
435
- }, onMouseLeave: function(g) {
436
- d.onMouseLeave && d.onMouseLeave(g), y();
437
- } }), r);
438
- });
439
- Qt.displayName = "Snackbar";
440
- var vo = Ie({ root: (rt = { display: "flex", flexWrap: "wrap", flexGrow: 1 }, rt[Ge] = { flexGrow: "initial", minWidth: "288px" }, rt) }), ht = oe(function(t, a) {
441
- var r = t.className, e = Ne(t, ["className"]);
442
- return S.createElement("div", Object.assign({ ref: a, className: fe(vo.root, r) }, e));
443
- });
444
- ht.displayName = "SnackbarContent";
445
- var Oe = Ie({ 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" } }), Ft = "notistack-snackbar", Yt = oe(function(t, a) {
446
- var r = t.id, e = t.message, n = t.action, o = t.iconVariant, i = t.variant, c = t.hideIconVariant, s = t.style, l = t.className, u = o[i], d = n;
447
- return typeof d == "function" && (d = d(r)), S.createElement(ht, { ref: a, role: "alert", "aria-describedby": Ft, style: s, className: fe(ko, bo(i), Oe.root, Oe[i], l, !c && u && Oe.lessPadding) }, S.createElement("div", { id: Ft, className: Oe.message }, c ? null : u, e), d && S.createElement("div", { className: Oe.action }, d));
448
- });
449
- Yt.displayName = "MaterialDesignContent";
450
- var We, at, _e, Ve, it, Eo = Ee(Yt), Co = Ie({ wrappedRoot: { width: "100%", position: "relative", transform: "translateX(0)", top: 0, right: 0, bottom: 0, left: 0, minWidth: "288px" } }), So = function(t) {
451
- var a = ne(), r = ee(!0), e = r[0], n = r[1], o = Pe([t.snack.onClose, t.onClose]), i = Z(function() {
452
- a.current = setTimeout(function() {
453
- n(function(B) {
454
- return !B;
455
- });
456
- }, 125);
457
- }, []);
458
- j(function() {
459
- return function() {
460
- a.current && clearTimeout(a.current);
461
- };
462
- }, []);
463
- var c, s = t.snack, l = t.classes, u = t.Component, d = u === void 0 ? Eo : u, m = $(function() {
464
- return function(B) {
465
- B === void 0 && (B = {});
466
- var z = { containerRoot: !0, containerAnchorOriginTopCenter: !0, containerAnchorOriginBottomCenter: !0, containerAnchorOriginTopRight: !0, containerAnchorOriginBottomRight: !0, containerAnchorOriginTopLeft: !0, containerAnchorOriginBottomLeft: !0 };
467
- return Object.keys(B).filter(function(_) {
468
- return !z[_];
469
- }).reduce(function(_, X) {
470
- var he;
471
- return L({}, _, ((he = {})[X] = B[X], he));
472
- }, {});
473
- }(l);
474
- }, [l]), b = s.open, w = s.SnackbarProps, x = s.TransitionComponent, y = s.TransitionProps, g = s.transitionDuration, f = s.disableWindowBlurListener, O = s.content, C = Ne(s, ["open", "SnackbarProps", "TransitionComponent", "TransitionProps", "transitionDuration", "disableWindowBlurListener", "content", "entered", "requestClose", "onEnter", "onEntered", "onExit", "onExited"]), Y = L({ direction: (c = C.anchorOrigin, c.horizontal !== "center" ? Ot[c.horizontal] : Ot[c.vertical]), timeout: g }, y), R = O;
475
- typeof R == "function" && (R = R(C.id, C.message));
476
- var q = ["onEnter", "onEntered", "onExit", "onExited"].reduce(function(B, z) {
477
- var _;
478
- return L({}, B, ((_ = {})[z] = Pe([t.snack[z], t[z]], C.id), _));
479
- }, {});
480
- return S.createElement(Xt, { in: e, onExited: q.onExited }, S.createElement(Qt, { open: b, id: C.id, disableWindowBlurListener: f, autoHideDuration: C.autoHideDuration, className: fe(Co.wrappedRoot, m.root, m[xo(C.anchorOrigin)]), SnackbarProps: w, onClose: o }, S.createElement(x, Object.assign({}, Y, { appear: !0, in: b, onExit: q.onExit, onExited: i, onEnter: q.onEnter, onEntered: Pe([q.onEntered, function() {
481
- t.snack.requestClose && o(null, "instructed", t.snack.id);
482
- }], C.id) }), R || S.createElement(d, Object.assign({}, C)))));
483
- }, Fe = { default: 20 }, ze = { default: 6, dense: 2 }, Pt = "." + Zt, Ue = Ie({ root: (We = { boxSizing: "border-box", display: "flex", maxHeight: "100%", position: "fixed", zIndex: 1400, height: "auto", width: "auto", transition: ve(["top", "right", "bottom", "left", "max-width"], { duration: 300, easing: "ease" }), pointerEvents: "none" }, We[Pt] = { padding: ze.default + "px 0px", transition: "padding 300ms ease 0ms" }, We.maxWidth = "calc(100% - " + 2 * Fe.default + "px)", We[nt] = { width: "100%", maxWidth: "calc(100% - 32px)" }, We), rootDense: (at = {}, at[Pt] = { padding: ze.dense + "px 0px" }, at), top: { top: Fe.default - ze.default + "px", flexDirection: "column" }, bottom: { bottom: Fe.default - ze.default + "px", flexDirection: "column-reverse" }, left: (_e = { left: Fe.default + "px" }, _e[Ge] = { alignItems: "flex-start" }, _e[nt] = { left: "16px" }, _e), right: (Ve = { right: Fe.default + "px" }, Ve[Ge] = { alignItems: "flex-end" }, Ve[nt] = { right: "16px" }, Ve), center: (it = { left: "50%", transform: "translateX(-50%)" }, it[Ge] = { alignItems: "center" }, it) }), Lo = Ee(function(t) {
484
- var a = t.classes, r = a === void 0 ? {} : a, e = t.anchorOrigin, n = t.dense, o = t.children, i = fe(ho, Ue[e.vertical], Ue[e.horizontal], Ue.root, r.containerRoot, r["containerAnchorOrigin" + mt(e)], n && Ue.rootDense);
485
- return S.createElement("div", { className: i }, o);
486
- }), Nt = function(t) {
487
- return !(typeof t == "string" || ln(t));
488
- }, To = function(t) {
489
- function a(r) {
490
- var e;
491
- return (e = t.call(this, r) || this).enqueueSnackbar = function(n, o) {
492
- if (o === void 0 && (o = {}), n == null) throw new Error("enqueueSnackbar called with invalid argument");
493
- var i = Nt(n) ? n : o, c = Nt(n) ? n.message : n, s = i.key, l = i.preventDuplicate, u = Ne(i, ["key", "preventDuplicate"]), d = je(s), m = d ? s : (/* @__PURE__ */ new Date()).getTime() + Math.random(), b = fo(u, e.props), w = L({ id: m }, u, { message: c, open: !0, entered: !1, requestClose: !1, persist: b("persist"), action: b("action"), content: b("content"), variant: b("variant"), anchorOrigin: b("anchorOrigin"), disableWindowBlurListener: b("disableWindowBlurListener"), autoHideDuration: b("autoHideDuration"), hideIconVariant: b("hideIconVariant"), TransitionComponent: b("TransitionComponent"), transitionDuration: b("transitionDuration"), TransitionProps: b("TransitionProps", !0), iconVariant: b("iconVariant", !0), style: b("style", !0), SnackbarProps: b("SnackbarProps", !0), className: fe(e.props.className, u.className) });
494
- return w.persist && (w.autoHideDuration = void 0), e.setState(function(x) {
495
- if (l === void 0 && e.props.preventDuplicate || l) {
496
- var y = function(O) {
497
- return d ? O.id === m : O.message === c;
498
- }, g = x.queue.findIndex(y) > -1, f = x.snacks.findIndex(y) > -1;
499
- if (g || f) return x;
500
- }
501
- return e.handleDisplaySnack(L({}, x, { queue: [].concat(x.queue, [w]) }));
502
- }), m;
503
- }, e.handleDisplaySnack = function(n) {
504
- return n.snacks.length >= e.maxSnack ? e.handleDismissOldest(n) : e.processQueue(n);
505
- }, e.processQueue = function(n) {
506
- var o = n.queue, i = n.snacks;
507
- return o.length > 0 ? L({}, n, { snacks: [].concat(i, [o[0]]), queue: o.slice(1, o.length) }) : n;
508
- }, e.handleDismissOldest = function(n) {
509
- if (n.snacks.some(function(s) {
510
- return !s.open || s.requestClose;
511
- })) return n;
512
- var o = !1, i = !1;
513
- n.snacks.reduce(function(s, l) {
514
- return s + (l.open && l.persist ? 1 : 0);
515
- }, 0) === e.maxSnack && (i = !0);
516
- var c = n.snacks.map(function(s) {
517
- return o || s.persist && !i ? L({}, s) : (o = !0, s.entered ? (s.onClose && s.onClose(null, "maxsnack", s.id), e.props.onClose && e.props.onClose(null, "maxsnack", s.id), L({}, s, { open: !1 })) : L({}, s, { requestClose: !0 }));
518
- });
519
- return L({}, n, { snacks: c });
520
- }, e.handleEnteredSnack = function(n, o, i) {
521
- if (!je(i)) throw new Error("handleEnteredSnack Cannot be called with undefined key");
522
- e.setState(function(c) {
523
- return { snacks: c.snacks.map(function(s) {
524
- return s.id === i ? L({}, s, { entered: !0 }) : L({}, s);
525
- }) };
526
- });
527
- }, e.handleCloseSnack = function(n, o, i) {
528
- e.props.onClose && e.props.onClose(n, o, i);
529
- var c = i === void 0;
530
- e.setState(function(s) {
531
- var l = s.snacks, u = s.queue;
532
- return { snacks: l.map(function(d) {
533
- return c || d.id === i ? d.entered ? L({}, d, { open: !1 }) : L({}, d, { requestClose: !0 }) : L({}, d);
534
- }), queue: u.filter(function(d) {
535
- return d.id !== i;
536
- }) };
537
- });
538
- }, e.closeSnackbar = function(n) {
539
- var o = e.state.snacks.find(function(i) {
540
- return i.id === n;
541
- });
542
- je(n) && o && o.onClose && o.onClose(null, "instructed", n), e.handleCloseSnack(null, "instructed", n);
543
- }, e.handleExitedSnack = function(n, o) {
544
- if (!je(o)) throw new Error("handleExitedSnack Cannot be called with undefined key");
545
- e.setState(function(i) {
546
- var c = e.processQueue(L({}, i, { snacks: i.snacks.filter(function(s) {
547
- return s.id !== o;
548
- }) }));
549
- return c.queue.length === 0 ? c : e.handleDismissOldest(c);
550
- });
551
- }, e.enqueueSnackbar, e.closeSnackbar, e.state = { snacks: [], queue: [], contextValue: { enqueueSnackbar: e.enqueueSnackbar.bind(Et(e)), closeSnackbar: e.closeSnackbar.bind(Et(e)) } }, e;
552
- }
553
- return zt(a, t), a.prototype.render = function() {
554
- var r = this, e = this.state.contextValue, n = this.props, o = n.domRoot, i = n.children, c = n.dense, s = c !== void 0 && c, l = n.Components, u = l === void 0 ? {} : l, d = n.classes, m = this.state.snacks.reduce(function(w, x) {
555
- var y, g = mt(x.anchorOrigin), f = w[g] || [];
556
- return L({}, w, ((y = {})[g] = [].concat(f, [x]), y));
557
- }, {}), b = Object.keys(m).map(function(w) {
558
- var x = m[w], y = x[0];
559
- return S.createElement(Lo, { key: w, dense: s, anchorOrigin: y.anchorOrigin, classes: d }, x.map(function(g) {
560
- return S.createElement(So, { key: g.id, snack: g, classes: d, Component: u[g.variant], onClose: r.handleCloseSnack, onEnter: r.props.onEnter, onExit: r.props.onExit, onExited: Pe([r.handleExitedSnack, r.props.onExited], g.id), onEntered: Pe([r.handleEnteredSnack, r.props.onEntered], g.id) });
561
- }));
562
- });
563
- return S.createElement(Ut.Provider, { value: e }, i, o ? Bn(b, o) : b);
564
- }, Vt(a, [{ key: "maxSnack", get: function() {
565
- return this.props.maxSnack || de.maxSnack;
566
- } }]), a;
567
- }(At), Jt = function() {
568
- return sn(Ut);
569
- };
570
- const ae = { card: "_card_1a398_7", actionRoot: "_actionRoot_1a398_11", icons: "_icons_1a398_16", expand: "_expand_1a398_22", expandOpen: "_expandOpen_1a398_29", stackTraceContainer: "_stackTraceContainer_1a398_33" }, en = oe((t, a) => {
571
- const { id: r, message: e, iconVariant: n, error: o, hideIconVariant: i, ...c } = t, { closeSnackbar: s } = Jt(), l = un(), [u, d] = ee(!1), m = Z(() => {
572
- d((x) => !x);
573
- }, []), b = Z(() => {
574
- s(r);
575
- }, [r, s]), w = o?.message || String(e);
576
- return h(ht, { ref: a, className: lt(ae.root, "error-snackbar"), children: ie(_n, { className: ae.card, style: { backgroundColor: l.palette.error.dark, border: `1px solid ${l.palette.error.dark}` }, children: [ie(Vn, { className: ae.actionRoot, children: [i ? null : n?.error, h(zn, { variant: "body2", component: "div", className: ae.typography, style: { color: l.palette.text.primary }, children: w }), h("div", { style: { flex: "1 1 auto" } }), ie("div", { className: ae.icons, children: [o ? h(ut, { "aria-label": "Show more", size: "small", className: lt(ae.expand, { [ae.expandOpen]: u }), style: { color: l.palette.action.active }, onClick: m, children: h(Xn, {}) }) : null, h(ut, { size: "small", className: ae.expand, style: { color: l.palette.action.active }, onClick: b, children: h(Qn, { fontSize: "small" }) })] })] }), o ? h(Un, { in: u, timeout: "auto", unmountOnExit: !0, children: h("div", { className: ae.stackTraceContainer, style: { backgroundColor: l.palette.error.light, borderTop: `1px solid ${l.palette.error.main}` }, children: h(dn, { error: o, hideLineNumbers: !0 }) }) }) : null] }) });
577
- });
578
- en.displayName = "ToastError";
579
- const tn = Ee(oe((t, a) => {
580
- const { commands: r, commandHook: e, scope: n = "workbook", disabled: o = !1, ...i } = t, c = te((l) => {
581
- const u = { variant: pn.Menuitem, parentFloat: l.floatReference, commandHook: e, scope: n, disabled: o }, d = ie(It, { children: [h(Je, { ...u, command: r.getCommand("newWorkbook"), icon: Te(h(mn, {})) }), h(fn, { orientation: "horizontal" }), h(Je, { ...u, command: r.getCommand("openWorkbook"), icon: Te(h(hn, {})) }), h(kt, { ...u, commands: r, quickCommand: "saveWorkbook", icon: Te(h(bn, {})), createPopupPanel: (m) => {
582
- const b = { ...u, parentFloat: m.floatReference, scope: "saveWorkbook" }, w = [];
583
- return pe.getWriteFormats().forEach((x) => {
584
- if (x.isDefault) return;
585
- let y = null;
586
- x.key === "CSV" ? y = Te(h(gn, {})) : x.key === "Excel" && (y = Te(h(kn, {})));
587
- const g = r.getCommand(`saveWorkbookAs${x.key}`);
588
- g ? w.push(le(Je, { ...b, key: x.key, command: g, icon: y })) : console.warn(`Unable to resolve command: 'saveWorkbookAs${x.key}'`);
589
- }), bt({ ...m, children: w, onClick: () => {
590
- m.closeFloatAll();
591
- } });
592
- } })] });
593
- return bt({ ...l, children: d, onClick: (m) => {
594
- m.isDefaultPrevented || l.closeFloatAll();
595
- } });
596
- }, [o, r, e, n]), s = "File";
597
- return h(kt, { commands: r, disabled: o, commandHook: e, scope: n, label: s, tooltip: "Options for saving and loading the workbook.", sx: { paddingBottom: "0px", "& button": { paddingTop: "0px", paddingBottom: "0px", height: (l) => `calc(1.25rem + ${l.spacing(2)}px)` } }, ...i, createPopupPanel: c, icon: h(xn, { className: "label", icon: null, label: s }) });
598
- }));
599
- tn.displayName = "StandaloneFileCommandButton";
600
- const Do = h(En, { label: "SheetXL", description: "Visit me at sheetxl.com.", children: h(ue, { sx: { width: "24px", height: "24px", marginBottom: "4px", marginLeft: "6px" }, children: h(Cn, { onClick: () => {
601
- window?.open("https://www.sheetxl.com", "_blank");
602
- }, style: { width: "24px", height: "24px", cursor: "pointer" } }) }) }), nn = Ee(oe((t, a) => {
603
- const { commands: r, workbook: e, logo: n = Do, mainElement: o, showFileMenu: i = !0, showAppearanceMenu: c = !0, ...s } = t, { reference: l } = wn(), [u, { width: d }] = yn(), m = d < 530, b = i ? h(tn, { commands: r, commandHook: { beforeExecute() {
604
- l?.closeAll();
605
- }, onError(g, f, O) {
606
- } } }) : null, w = c ? h(Sn, { commands: r, commandHook: { beforeExecute() {
607
- l?.closeAll();
608
- }, onError(g, f, O) {
609
- } } }) : null, x = $(() => ({ paddingLeft: (g) => g.spacing(1), paddingRight: (g) => g.spacing(1) }), []), y = ne(null);
610
- return h(ue, { ref: Ht([y, u, a]), ...s, children: vn({ commands: r, renderCompact: m, workbook: e, selectWrapper: (g) => ie(ue, { sx: { display: "flex", flex: "1", flexDirection: "row", alignItems: "stretch", gap: (f) => f.spacing(1), paddingLeft: (f) => f.spacing(1), paddingRight: (f) => f.spacing(1) }, children: [ie(ue, { sx: { display: "flex", flexDirection: "row", alignItems: "center", flex: "1 1 100%", gap: (f) => f.spacing(0.5) }, children: [n, ie(ue, { sx: { display: "flex", flexDirection: "row", alignItems: "center", gap: (f) => f.spacing(0.25) }, children: [b, g] })] }), h(ue, { sx: { display: "flex", flexDirection: "row", flex: "1 1 300%", overflow: "hidden", alignItems: "center", justifyContent: "center" }, children: o }), h(ue, { sx: { display: "flex", alignItems: "center", justifyContent: "end", flex: m && !w ? "0 0 auto" : "1 1 100%" }, children: w })] }), selectProps: x, toolbarsProps: { Home: { sx: {} } } }) });
611
- }));
612
- nn.displayName = "StandaloneWorkbookToolbar";
613
- const on = Ee(oe((t, a) => {
614
- const { workbook: r, setWorkbook: e, refWorkbookTitle: n, titleWorkbook: o, setWorkbookTitle: i, titlePlaceHolder: c, children: s, undoManager: l, commands: u, importExportDisabled: d, themeModeOptions: m } = t, b = Jt(), w = b ? b.enqueueSnackbar : () => {
615
- }, x = b ? b.closeSnackbar : () => {
616
- }, [y, g] = ee({ isMounted: !1, label: null, starting: /* @__PURE__ */ new Map(), running: /* @__PURE__ */ new Map() }), f = Z(() => {
617
- g((M) => ({ ...M, isMounted: !0 }));
618
- }, []), O = Z(() => {
619
- g((M) => ({ ...M, isMounted: !1 }));
620
- }, []), C = Mn(), Y = On(), R = Wn(), q = ne(/* @__PURE__ */ new Set()), B = $(() => {
621
- const M = (v, E) => {
622
- if (E?.onceKey) {
623
- if (q.current.has(E.onceKey)) return;
624
- const T = new Set(q.current);
625
- T.add(E.onceKey), q.current = T;
626
- }
627
- const W = { variant: E?.type ?? Re.Info, anchorOrigin: { vertical: "top", horizontal: "center" }, preventDuplicate: E?.preventDuplicate, persist: E?.persist ?? E?.type === Re.Error, action: (T) => h(ut, { onClick: () => x(T), children: h(Yn, {}) }) };
628
- E?.enqueueProps && Object.assign(W, E.enqueueProps), v || console.log("message is 'null'", E), w(v ?? "Alert", W);
629
- };
630
- return { showMessage: M, showBusy: (v, E) => {
631
- let W = null;
632
- const T = new Promise((H) => {
633
- W = H;
634
- });
635
- return g((H) => {
636
- const I = new Map(H.starting);
637
- return I.set(T, W), { ...H, label: v, starting: I };
638
- }), T;
639
- }, showWindow: (v, E, W) => {
640
- const T = { ...E, onKeyDown: (H) => {
641
- u?.dispatchToFocusedCommand(H), H.isDefaultPrevented() || H.isPropagationStopped() || E?.onKeyDown?.(H);
642
- } };
643
- return C(v, { sort: () => import("./BgQK3a-xYWlmvNDD.mjs"), numberFormat: () => import("./DJJZ-Mz0hVMWcKq8.mjs"), hyperlink: () => import("./CevfhoT-xtAPuMWS.mjs"), comments: () => import("./ww-U-PglTS7Dtu3g.mjs"), find: () => import("./C2ogJhUgj6tBd2Ze.mjs"), tableDetails: () => import("./D3DJPz0louDEmOOg.mjs"), tableNew: () => import("./B5ZVjFCvGZMlskn5.mjs"), namedDetails: () => import("./DBhNx8LLdmzo5Avs.mjs") }[v], T, W);
644
- }, showOptions: Y, showInputOptions: R, showError: (v) => {
645
- let E, W = Re.Error, T = "Unknown Error";
646
- typeof v == "string" ? T = v : v instanceof Error && (E = v, v.message && (T = v.message)), v instanceof $n && (W = Re.Info), M(T, { type: W, enqueueProps: { error: E } });
647
- } };
648
- }, []), z = Z(() => {
649
- }, []), _ = ((M) => {
650
- const { workbook: v, setWorkbook: E, importExportDisabled: W, workbookTitle: T = "export", setWorkbookTitle: H, notifier: I, requestWorkbookTitle: J, themeModeOptions: F, undoManager: Ae, commands: Q, onExecute: ke } = M, He = te(F?.onForceModeChange, [F?.onForceModeChange]), Ze = te(F?.onForceLightGridChange, [F?.onForceLightGridChange]), be = te(F?.onForceLightImagesChange, [F?.onForceLightImagesChange]), Xe = te(async (D = null, U = null) => {
651
- const p = [];
652
- let k, P = null, G = null;
653
- if (typeof D == "string" ? G = D : P = D, k = P ? D : await Ln.openFileDialog(G ?? pe.getAllReadFormatTypeAsString().join(",")), !k) return null;
654
- const se = { source: k, constructorOptions: U, onWarning: (Ye) => {
655
- p.push(Ye);
656
- } }, Le = await pe.read(se, I);
657
- return p.length > 0 && (I?.showMessage?.("Some elements were not able to be imported. See console for details."), console.warn(`Import warnings:
658
- ` + p.join(`
659
- `))), Le;
660
- }, [ke, I, v]), Ce = te(async (D, U, p) => {
661
- if (!U && J) {
662
- const k = await J("Enter Workbook name to " + (p.isDefault ? "Save." : `Export as ${p.description}.`));
663
- return k !== null && pe.writeFile(k, D, { formatType: p.key });
664
- }
665
- return pe.writeFile(U, D, { formatType: p.key });
666
- }, [I, v, J]), A = Z(() => ({ contains: (D) => !0, focus() {
667
- } }), []), ce = $(() => {
668
- const D = [];
669
- W || (pe.getWriteFormats().forEach((p) => {
670
- const k = p.isDefault, P = { label: k ? "Save Workbook" : `Save Workbook as ${p.description}`, scopedLabels: { workbook: "Save", saveWorkbook: `as ${p.description}` }, tags: p.tags, description: `Save the workbook to the desktop${k ? "" : ` as ${p.description}`}.` };
671
- k && (P.shortcut = { key: "S", modifiers: [De.Ctrl] }, D.push(new K("saveWorkbookAs", A, { label: "Save Workbook As…", scopedLabels: { workbook: "Save as…", saveWorkbook: "as…" }, shortcut: [{ key: "S", modifiers: [De.Shift, De.Ctrl] }, { key: "F12" }], description: "Save the workbook to the desktop with the provided name." }, () => {
672
- Ce(v, null, p).catch((se) => {
673
- I?.showError?.(se);
674
- });
675
- })));
676
- const G = k ? "saveWorkbook" : `saveWorkbookAs${p.key}`;
677
- D.push(new K(G, A, P, (se) => {
678
- Ce(v, se ?? T, p).catch((Le) => {
679
- I?.showError?.(Le);
680
- });
681
- }));
682
- }), D.push(new K("openWorkbook", A, { label: "Open Workbook…", scopedLabels: { workbook: "Open…" }, description: "Open a workbook from the desktop.", shortcut: { key: "O", modifiers: [De.Ctrl] } }, async (p = null) => {
683
- const k = { date1904: v.isDate1904(), ...v.options };
684
- try {
685
- const P = await Xe(p, k);
686
- if (!P) return;
687
- const G = P.title, se = P.workbook, Le = se.getSelectedSheet();
688
- if (P.formatType.mimeType === "text/csv") {
689
- const Ye = v.findValidSheetName(G);
690
- await v.doBatch(async () => {
691
- const gt = Le.getUsedRange();
692
- if (!gt) return void I?.showMessage("The file appears to be blank.");
693
- await v.getSheets().add({ name: Ye, autoSelect: !0 }).getRange({ colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 }).copyFrom(gt);
694
- }, `Import CSV '${G}'`);
695
- } else v?.close(), H?.(G), E(se);
696
- } catch (P) {
697
- I?.showError?.(P);
698
- }
699
- })), D.push(new K("openWorkbookFromUrl", A, { label: "Open Workbook From Web", scopedLabels: { insert: "From Web", workbook: "From Web…" }, description: "Open a workbook from the web." }, async function(p) {
700
- if (!p) {
701
- const k = await I?.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"] });
702
- if (k.option !== "Open") return;
703
- p = k.input;
704
- }
705
- p && console.log("openWorkbookFromUrl", p);
706
- })));
707
- let U = [];
708
- return F && (U = [new K("themeMode", A, { label: "Light/Dark Mode", scopedLabels: { appearance: "Light/Dark Mode" }, description: "Toggle the application styling between light and dark mode." }), new K("defaultThemeMode", A, { 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 K("forceLightGrid", A, { 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 K("forceLightImages", A, { 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." })]), [...D, ...U, new xt("help", A, { label: "Show Help", description: "Provide Help.", shortcut: { key: "F1" } }, () => {
709
- }), new xt("showKeyboardShortcuts", A, { label: "Keyboard Shortcuts", description: "Show keyboard shortcuts.", shortcut: { key: "/", modifiers: [De.Ctrl] } }, () => {
710
- }), new K("gotoUrlGithub", A, { label: "Github", description: "Download examples, explore source code, and leave a star." }, () => {
711
- window?.open("https://github.com/sheetxl/sheetxl");
712
- }), new K("gotoUrlDiscord", A, { label: "Discord", description: "Join our community on discord." }, () => {
713
- window?.open("https://discord.gg/NTKdwUgK9p");
714
- }), new K("gotoUrlDocumentation", A, { label: "Documentation", description: "Read the documentation." }, () => {
715
- window?.open("https://www.sheetxl.com/docs");
716
- }), new K("gotoUrlIssue", A, { label: "Create Issue", description: "Create an issue to identify a bug or a feature request." }, () => {
717
- window?.open("https://github.com/sheetxl/sheetxl/issues");
718
- })];
719
- }, [v, T, I, W, F, Q, Ae]), V = $(() => {
720
- let D = null;
721
- return D = Q ? Q.createChildGroup(A, "standaloneWorkbook", !1) : new Rt(A, "standaloneWorkbook"), D.addCommands(ce, !0), D;
722
- }, [Q, ce]);
723
- Tn({ manager: Ae, commands: V, notifier: I });
724
- const { themeMode: Se } = jt();
725
- j(() => {
726
- if (!F || !V) return;
727
- const D = F.forceMode === "dark" || !F.forceMode && Se === "dark";
728
- V.getCommand("themeMode").update({ state: F.forceMode ?? null, label: D ? "Dark Mode" : "Light Mode", scopedLabels: { appearance: D ? "Dark Mode" : "Light Mode" } }).updateCallback(() => {
729
- He(D ? ct.Light : ct.Dark);
730
- }), V.getCommand("defaultThemeMode").update({ state: !F.forceMode }).updateCallback(() => {
731
- He(null);
732
- }), V.getCommand("forceLightGrid").update({ state: F.forceLightGrid }).updateCallback(() => {
733
- Ze(!F.forceLightGrid);
734
- }), V.getCommand("forceLightImages").update({ state: F.forceLightImages }).updateCallback(() => {
735
- be(!F.forceLightImages);
736
- });
737
- }, [Se, F, ce]);
738
- const { showModal: Qe } = Dn();
739
- return j(() => {
740
- const D = () => new Promise((U, p) => {
741
- const k = S.lazy(() => import("./vs0v9un-v2S9Jnlo.mjs")), P = Qe(k, { title: "Shortcut Keys Reference", commands: V, onDone: () => {
742
- P.hide();
743
- }, TransitionProps: { onExited: () => {
744
- U(!0);
745
- } } });
746
- });
747
- V.getCommand("showKeyboardShortcuts").updateCallback(() => D()), V.getCommand("help").updateCallback(() => D());
748
- }, [ce, V]), V;
749
- })({ workbook: r, setWorkbook: e, importExportDisabled: d, workbookTitle: o, setWorkbookTitle: i, commands: u, requestWorkbookTitle: (M) => new Promise((v) => {
750
- n.current ? n.current.requestWorkbookTitle((E, W) => {
751
- v(E);
752
- }, { selectAll: !0, requestReason: M }) : v(c);
753
- }), themeModeOptions: m, undoManager: l, notifier: B, onExecute: z });
754
- j(() => {
755
- y.starting.size <= 0 || !y.isMounted || g((M) => {
756
- const v = new Map(M.running);
757
- return M.starting.forEach((E, W) => {
758
- const T = () => {
759
- g((H) => {
760
- const I = new Map(H.running);
761
- return I.delete(W), { ...H, running: I };
762
- });
763
- };
764
- v.set(W, T), E(T);
765
- }), { ...M, starting: /* @__PURE__ */ new Map(), running: v };
766
- });
767
- }, [y]);
768
- const [X, he] = ee(null);
769
- j(() => {
770
- y.starting.size !== 0 || y.running.size !== 0 ? he(h(qt, { icon: h(Fn, { sx: { transform: "scale(0.7)", marginLeft: "-6px" } }), panel: !0, label: y.label, onMount: f, onUnmount: O, sx: { position: "absolute", left: "0", top: "0", width: "100%", height: "100%", zIndex: "9999" } })) : he(null);
771
- }, [y.starting, y.running]);
772
- const N = $(() => h(Pn, { commands: _, disableHover: !0, sx: { padding: "0" }, buttonProps: { sx: { maxHeight: "22px" } } }), [_]), ge = { notifier: B, commands: _ };
773
- return r && (ge.statusBarProps = { childrenEnd: N }), ie(It, { children: [X, s ? S.cloneElement(s, ge) : null] });
774
- }));
775
- on.displayName = "SnackbarAndCommandsWrapper";
776
- const rn = Ee(oe((t, a) => {
777
- const { className: r, sx: e, style: n, onElementLoad: o, onError: i, undoManager: c, errorPanel: s = Nn, onKeyDown: l, workbook: u, createWorkbookOptions: d, onWorkbookChange: m, logo: b, importExportDisabled: w = !1, themeModeOptions: x, autoFocus: y = !1, commands: g, title: f, onTitleChange: O, titleProps: C, ...Y } = t, R = ne(null), q = te(m, [m]), B = te(O ?? C?.onTitleChange, [O ?? C?.onTitleChange]), z = C?.placeHolder ?? "Untitled", _ = x?.forceMode, { themeMode: X, source: he } = jt({ mode: _ }), N = $(() => ({ ...x, light: wt(!1, et.deepMerge(x?.theme ?? {}, x?.light ?? {})), dark: wt(!0, et.deepMerge(x?.theme ?? {}, x?.dark ?? {})) }), [x]), ge = X === ct.Dark, [M, v] = ee(null);
778
- j(() => {
779
- v(c ?? new Zn());
780
- }, [c]);
781
- const [E, W] = ee(null), [T, H] = ee(null), I = In();
782
- st(() => {
783
- if (!u || Object.keys(u).length === 0 && !et.isPromiseLike(u)) {
784
- const p = { theme: I.getDefaultTheme(), ...d };
785
- H(new yt(p));
786
- } else H(u);
787
- }, [u]), st(() => {
788
- if (T) {
789
- if (T instanceof yt) return W({ workbook: T }), void (u !== T && q?.(T));
790
- (async () => {
791
- try {
792
- let p, k = await Promise.resolve(T);
793
- k && k.source && (k = await pe.read(k)), k.workbook ? (ke(k.title), p = k.workbook) : p = k, q?.(p), W({ workbook: p });
794
- } catch (p) {
795
- q?.(null), W({ error: p });
796
- }
797
- })();
798
- }
799
- }, [T]);
800
- const [J, F] = ee(null);
801
- j(() => {
802
- if (!M || !E) return;
803
- M.clear();
804
- const p = E?.workbook?.getTransactions();
805
- if (p)
806
- return p.addListener({ onCommitEnd: (k) => {
807
- k.getDescription() ? M.addUndoOperation({ description: k.getDescription(), undo: () => (p.revert(k.getId()), J.source?.focus(), () => {
808
- p.restore(k.getId()), J.source?.focus();
809
- }) }) : console.warn("commit has no description", k);
810
- } });
811
- }, [M, E, J]);
812
- const Ae = te((p) => {
813
- p ? M.setRepeatableOperation({ description: p.label(), repeat: async () => p.execute() }) : M.setRepeatableOperation(null);
814
- }, [M]), [Q, ke] = ee(f ?? C?.title ?? "");
815
- j(() => {
816
- ke(f ?? C?.title ?? "");
817
- }, [f ?? C?.title]), j(() => {
818
- B?.(Q);
819
- }, [Q]);
820
- const [He, Ze] = ee(null), be = $(() => {
821
- const p = () => ({ contains: (k) => !0, focus() {
822
- } });
823
- return g ? g.createChildGroup(p, "application", !1) : new Rt(p, "application");
824
- }, [g]), Xe = te((p) => {
825
- Ze(p.source.getViewportElement()), F(p), be.activate("sheet"), o?.(p);
826
- }, [be]);
827
- j(() => {
828
- J && y && J.source?.focus(typeof y == "object" ? y : void 0);
829
- }, [J]);
830
- const Ce = ne(null), A = Z((p) => {
831
- let k = null;
832
- return C?.hidden || (k = h(An, { ...C, style: { maxWidth: "100%", ...C?.style }, workbook: R.current, ref: Ce, title: Q, placeHolder: z, onTitleChange: (P) => {
833
- ke(P);
834
- } })), h(nn, { ...p, logo: b, mainElement: k, showFileMenu: !w, showAppearanceMenu: !!(N?.onForceLightGridChange || N?.onForceLightImagesChange || N?.onForceModeChange) });
835
- }, [b, Q, C, N, w, be]);
836
- j(() => {
837
- const p = (k) => k.preventDefault();
838
- return R.current?.addEventListener("wheel", p, { passive: !1 }), () => {
839
- R.current?.removeEventListener("wheel", p);
840
- };
841
- }, []);
842
- const ce = $(() => h(qt, { transparentBackground: !0, sx: e, style: n }), [e, n]), V = Z(({ error: p }) => (i?.(p), h(s, { sx: e, style: n, error: p ?? "Unable to display empty workbook." })), [e, n, i]), Se = $(() => ({ ...e, "& .SnackbarContainer-root": { position: "absolute !important" }, "& .notistack-Snackbar": { minWidth: "unset" }, "& .notistack-MuiContent *": { fontFamily: (p) => p.typography.fontFamily }, "& #notistack-snackbar": { maxWidth: "560px", whiteSpace: "pre-wrap" }, "*": { userSelect: "none" } }), [e]), Qe = Ht([R, a]), D = $(() => {
843
- if (!E) return ce;
844
- if (E.error || !E.workbook) return V({ error: E.error });
845
- let p = null, k = null, P = !1;
846
- return N && (p = ge ? N.dark : N.light, k = ge && !N.forceLightGrid ? N.dark : N.light, P = N.forceLightImages), h(Hn, { sx: Se, style: n, tabIndex: 0, autoFocus: !0, workbook: E.workbook, ref: Qe, renderToolbar: A, onElementLoad: Xe, onRepeatCommandChange: Ae, onKeyDown: (G) => {
847
- l?.(G);
848
- }, gridTheme: k, headersTheme: p, forceLightImages: P, className: lt(r, "sheetxl-workbook"), onContextMenu: (G) => G.preventDefault(), ...Y }, "WorkbookElement");
849
- }, [E, Q, M, ce, N, Y, A, Se]);
850
- let U = h(eo, { fallbackRender: V, children: h(To, { maxSnack: 3, domRoot: He, anchorOrigin: { vertical: "bottom", horizontal: "right" }, autoHideDuration: 3500, onClose: (p, k, P) => {
851
- R.current?.focus();
852
- }, Components: { error: en }, iconVariant: { success: h(Gn, { style: { marginRight: "8px" }, children: h("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: h(jn, { style: { marginRight: "8px" } }) }, children: h(Rn, { children: h(on, { workbook: E?.workbook, setWorkbook: H, importExportDisabled: w, titlePlaceHolder: z, titleWorkbook: Q, setWorkbookTitle: ke, refWorkbookTitle: Ce, commands: be, undoManager: M, themeModeOptions: N, children: D }) }) }) });
853
- return N && (U = ie(qn, { theme: ge ? N.dark : N.light, children: [N.cssBaseline ? h(Kn, {}) : null, U] })), U;
854
- }));
855
- rn.displayName = "EagerStandaloneWorkbook";
856
- const Ho = Object.freeze(Object.defineProperty({ __proto__: null, default: rn }, Symbol.toStringTag, { value: "Module" }));
857
- export {
858
- Ho as E,
859
- fe as c
860
- };