@sheetxl/studio-mui 0.8.0-beta.10 → 0.8.0-beta.11

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 (119) hide show
  1. package/browser/esm/0BWO0bLZ8Vm_dKd2.mjs +582 -0
  2. package/browser/esm/BAbq4-I5f5oUiNaF.mjs +141 -0
  3. package/browser/esm/BED6h6YAwCf1HEQJ.mjs +161 -0
  4. package/browser/esm/{CEvZe2cZK-voZTif.mjs → BXhNFzyEGokTF-BL.mjs} +5 -5
  5. package/browser/esm/BYE9gCDWKyx6mnVs.mjs +381 -0
  6. package/browser/esm/{DBtc4lku0uHVcqWn.mjs → BjvD_4t2KGsZP5V8.mjs} +3 -3
  7. package/browser/esm/{DU3J8Gcf-WpBxNYg.mjs → BknfGJouygmnpFIU.mjs} +4 -4
  8. package/browser/esm/{D8al_cJ4U-NgzwoK.mjs → BlE_8o8tO2AgAlaj.mjs} +19 -17
  9. package/browser/esm/BokqKEpU6TFgfRs6.mjs +252 -0
  10. package/browser/esm/{DHY19rkSiiRZxShC.mjs → Brsh5yscJ_4uKFXp.mjs} +3 -3
  11. package/browser/esm/Bujtz_Guj88d03vI.mjs +831 -0
  12. package/browser/esm/Buqcl7J75MJrhpVE.mjs +1379 -0
  13. package/browser/esm/BvhYPwX3GrRaO9CM.mjs +319 -0
  14. package/browser/esm/C0wlMAIn9iREPK6w.mjs +87 -0
  15. package/browser/esm/C8JU4KsMasmLvojI.mjs +103 -0
  16. package/browser/esm/{CjznclrKqJRi7u9O.mjs → C9pIZVACtl9unFOp.mjs} +2 -2
  17. package/browser/esm/CBD4RiRKbbZtSXV-.mjs +318 -0
  18. package/browser/esm/{Blaj2R5hYxtLAW__.mjs → CEtXsBzEjEKk9GOj.mjs} +6 -6
  19. package/browser/esm/{CIu1bjPJe_x31Oww.mjs → COlZu93LRwuBvjE-.mjs} +3 -3
  20. package/browser/esm/{CoSiOS-og0zFw4Ws.mjs → CTjqDD-swFMZzI-Y.mjs} +2 -2
  21. package/browser/esm/CWkOgdL7mOKiTR62.mjs +975 -0
  22. package/browser/esm/ChSVxkPTIjgcC8PL.mjs +412 -0
  23. package/browser/esm/{5cbK03T_Oh3tNdR7.mjs → ClBvNPeNCAhuVWrG.mjs} +1 -1
  24. package/browser/esm/CyLn6zOOp_biA3xU.mjs +335 -0
  25. package/browser/esm/CynTY0oNtyJnoaBq.mjs +14 -0
  26. package/browser/esm/{xKiLJKiLxto8SayF.mjs → D3rRUK4dIM5gUSmj.mjs} +2 -2
  27. package/browser/esm/D9ISy7VkaRRFJl46.mjs +515 -0
  28. package/browser/esm/{fb126BNj3F8URR19.mjs → DDc6rDuU9JAo1DH_.mjs} +3 -3
  29. package/browser/esm/DDczwkXhz_MHub4z.mjs +197 -0
  30. package/browser/esm/{X1Db3b_7b_7OuCk6.mjs → DEv4pIEgYr5C7etm.mjs} +1 -1
  31. package/browser/esm/DG21x7RKDpge6zAE.mjs +31 -0
  32. package/browser/esm/DJOOed_OtB-XT7f3.mjs +437 -0
  33. package/browser/esm/{9eKCkvqpMQwqcXiw.mjs → DKtJxrpN0axtuQ0l.mjs} +1 -1
  34. package/browser/esm/DRSCS6aLiYmPjUz1.mjs +1543 -0
  35. package/browser/esm/{ByeL_BZuJ2kl8gtf.mjs → DTpRkgsTm_zYnWfW.mjs} +1 -1
  36. package/browser/esm/DV6i9RQZfJiKtEaJ.mjs +2552 -0
  37. package/browser/esm/DdcZrjMLWVukWcU5.mjs +7473 -0
  38. package/browser/esm/Di3BUxA0SqFWWgeg.mjs +94 -0
  39. package/browser/esm/DnGaP5F7mLwCGUYG.mjs +408 -0
  40. package/browser/esm/DpD4fg2WcyiKX_2K.mjs +414 -0
  41. package/browser/esm/{C1Rp2hZrApo5MUc8.mjs → Ds3XRkne7HxcXD8J.mjs} +2 -2
  42. package/browser/esm/{sFOAxZpxXo-qvDSp.mjs → DsoNMWDwHZP8UXQd.mjs} +1 -1
  43. package/browser/esm/G0Inqm6Eqw47dMpa.mjs +212 -0
  44. package/browser/esm/{B1Yp_uy1vFHcJB3U.mjs → HViD4Wfoi0mmqk9w.mjs} +1 -1
  45. package/browser/esm/LZoYSQAYV2wksnDv.mjs +386 -0
  46. package/browser/esm/{CtEFHbzYNvYjDYvi.mjs → QgaAIDUMmBQBsXP9.mjs} +8 -8
  47. package/browser/esm/{D6S8kVTzOjCn0-SK.mjs → YThnrg3PadGs7B4j.mjs} +51 -51
  48. package/browser/esm/index.mjs +1028 -170
  49. package/browser/esm/ttjcNHcFn8O6hfnd.mjs +1288 -0
  50. package/browser/esm/{yZxC4qUENOlMhVUH.mjs → w_JrR69vEpvoyeMy.mjs} +1 -1
  51. package/browser/esm/{DmCQbW4zwkT_Rq88.mjs → xFqkfN8QMCxvsetB.mjs} +1 -1
  52. package/browser/esm/{IQLeaAbtGTipUsOD.mjs → zqilJefihVd7At2T.mjs} +22 -21
  53. package/licenses/dependencies.txt +94 -94
  54. package/node/esm/{BYsG3KYVmxSe_CIQ.mjs → 1bf4gn-2vld4BZ9u.mjs} +1 -1
  55. package/node/esm/{CKu1AtRgyltyEdEN.mjs → 3WghtBXAvCDwcVrq.mjs} +1 -1
  56. package/node/esm/{cqzp431iNSLWictb.mjs → 4HmLH0bPVJCZLgik.mjs} +22 -22
  57. package/node/esm/{BYVLi0md4AYuDsB_.mjs → B0bdb_6p7fQI_ivo.mjs} +28 -28
  58. package/node/esm/BIMkjQUwG4Ih-6Sh.mjs +142 -0
  59. package/node/esm/BNg4QQY0WAPLE0q7.mjs +141 -0
  60. package/node/esm/BPzcW4BejRqso338.mjs +72 -0
  61. package/node/esm/BR45ogAR-hY2bE60.mjs +318 -0
  62. package/node/esm/BlN7G0DVC24zauig.mjs +197 -0
  63. package/node/esm/{ah3CUg4-VmNstGk_.mjs → Bph-sR3l6AYWeuxK.mjs} +2 -2
  64. package/node/esm/CPq-MIdEnc-53JpF.mjs +319 -0
  65. package/node/esm/CSAnTp5rwId0DUb8.mjs +380 -0
  66. package/node/esm/CWcv7UVXF8IUB0PC.mjs +1379 -0
  67. package/node/esm/{D9rzScOA9pEYFrtz.mjs → CYIoK22I6Yvv12_x.mjs} +20 -20
  68. package/node/esm/CZyA9uD4SkTvqp_G.mjs +1283 -0
  69. package/node/esm/{ci8d-mF1H9wnYzix.mjs → CjC6s3RUJQNCF7mP.mjs} +1 -1
  70. package/node/esm/{D6oQL8knsPpgdXuk.mjs → CuMePia6i_8yfJ6S.mjs} +9 -9
  71. package/node/esm/CvRbu8JPxFarsSR-.mjs +412 -0
  72. package/node/esm/{DNSjK5DAH3M14Qbc.mjs → CyafafEgfmjLqE5O.mjs} +1 -1
  73. package/node/esm/D-xqQ5qOSd6WrzwJ.mjs +94 -0
  74. package/node/esm/DLqBHdFp6wvm6EGs.mjs +212 -0
  75. package/node/esm/{BcwMb6CyVfvEwbHn.mjs → DMXLxp3T0E0SRTQc.mjs} +1 -1
  76. package/node/esm/{DZzvTQxIKr9LbEsA.mjs → DWqvf4H5F2wMnZ0L.mjs} +32 -30
  77. package/node/esm/DatM6eEYPpAtIMy-.mjs +405 -0
  78. package/node/esm/Db3dbaYLKUO66T9s.mjs +1689 -0
  79. package/node/esm/{B_jRGdwGFkudwmL-.mjs → DdEzhVqYTrGODXrz.mjs} +1 -1
  80. package/node/esm/DeZJlLk8WJ3BLtLs.mjs +975 -0
  81. package/node/esm/DfCuL8AUxMFoEG2s.mjs +519 -0
  82. package/node/esm/{Bb1sLMqXWKjdve23.mjs → Do-zCKziWhoG5eAv.mjs} +2 -2
  83. package/node/esm/{B8SQfjKjzYHLxzZR.mjs → DpJ2gmZJioCyq8La.mjs} +67 -67
  84. package/node/esm/{ETK6T6G0SIcFXDe5.mjs → XEDcegsv5AGKBfu2.mjs} +40 -40
  85. package/node/esm/index.mjs +8941 -13558
  86. package/node/esm/yCUxQuqVuC4DHKPx.mjs +385 -0
  87. package/node/esm/zITjZ7R4raDqhP-n.mjs +515 -0
  88. package/package.json +9 -9
  89. package/resources/locales/de/ui.msg.json +97 -0
  90. package/resources/locales/en/ui.msg.json +97 -0
  91. package/types/src/anchorItems/AnchorItemsDescriptor.d.ts +4 -4
  92. package/types/src/anomalies/AnomaliesPlugin.d.ts +5 -0
  93. package/types/src/anomalies/AnomaliesTaskPane.d.ts +17 -0
  94. package/types/src/anomalies/index.d.ts +3 -0
  95. package/types/src/border/BorderTemplateIcon.d.ts +6 -1
  96. package/types/src/chart/ChartFormatPanel.d.ts +20 -0
  97. package/types/src/chart/ChartPlugin.d.ts +6 -0
  98. package/types/src/chart/index.d.ts +3 -0
  99. package/types/src/comments/CommentCard.d.ts +2 -2
  100. package/types/src/conditions/useFormulaOption.d.ts +2 -2
  101. package/types/src/dialog/WorkbookStatisticsDialog.d.ts +1 -1
  102. package/types/src/format/BorderPreview.d.ts +11 -4
  103. package/types/src/format/useFormatSelection.d.ts +4 -4
  104. package/types/src/formulaBar/MobileFormulaBar.d.ts +18 -6
  105. package/types/src/formulaBar/MobileInputToolbar.d.ts +9 -3
  106. package/types/src/formulaBar/useFormulaBarSession.d.ts +6 -3
  107. package/types/src/index.d.ts +15 -6
  108. package/types/src/protection/ProtectedCellsPanel.d.ts +2 -2
  109. package/types/src/protection/{SheetProtectionPanel.d.ts → WorksheetProtectionPanel.d.ts} +6 -6
  110. package/types/src/protection/index.d.ts +1 -1
  111. package/types/src/slicer/PresetSlicerStylesCommandButton.d.ts +2 -2
  112. package/types/src/workbook/DefaultRenderers.d.ts +2 -2
  113. package/types/src/workbook/WorkbookContextMenu.d.ts +4 -0
  114. package/browser/esm/Biy7bhzzzPb5sfRN.mjs +0 -152
  115. package/browser/esm/COv-m-c2byCgvU3M.mjs +0 -14861
  116. package/browser/esm/Die9NXVFveHvcCT-.mjs +0 -4205
  117. package/browser/esm/sam1KGQZ59B_fADz.mjs +0 -1941
  118. package/node/esm/BYwXhrEwkRAt9nJS.mjs +0 -71
  119. package/node/esm/Cmt8Wv806N7NmE4Y.mjs +0 -3344
@@ -1,4205 +0,0 @@
1
- /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.8.0-beta.10
3
- *
4
- * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */
7
- import { At as e, Bt as t, Ct as n, Dt as r, Et as i, Ft as a, G as o, Ht as s, It as c, Jt as l, Lt as u, Mt as d, Nt as f, Ot as p, Pt as m, Qt as h, R as g, Rt as _, Tn as v, Ut as y, V as b, Vt as x, Wt as S, a as C, an as ee, bt as te, cn as ne, en as re, h as ie, i as ae, jt as oe, kn as se, kt as w, l as ce, ln as le, o as ue, r as de, rt as fe, s as pe, t as me, w as he, xt as ge, zt as _e } from "./COv-m-c2byCgvU3M.mjs";
8
- import { T as ve, b as T } from "./sam1KGQZ59B_fADz.mjs";
9
- import { t as ye } from "./5cbK03T_Oh3tNdR7.mjs";
10
- import { n as be } from "./fb126BNj3F8URR19.mjs";
11
- import { Color as xe, CommonUtils as Se, ICellStyle as Ce, ICondition as we, IConditionalFormat as E, IDataValidation as D, IFill as Te, IFont as Ee } from "@sheetxl/sdk";
12
- import { COLOR_SCALE_PRESETS as De, CommandRootProvider as Oe, DATA_BAR_PRESETS as ke, DefaultTaskPaneRegistry as Ae, ICON_CATALOG as je, IconSetGlyphs as Me, LogoNoPaddingIcon as Ne, NO_CELL_ICON as Pe, STYLE_PRESETS as Fe, TaskPaneArea as Ie, TaskPaneProvider as Le, ThemeStateDefaults as Re, ThemeStateKey as ze, WorkbookIO as O, WorkbookProvider as Be, buildOOXMLThemeCSS as Ve, createEditable as He, createSystemColorVars as Ue, defaultColorScale as We, defaultDataBar as Ge, defaultIconSet as Ke, defaultIconStops as qe, getConditionalIconSet as k, iconSetSize as Je, registerMovablePane as Ye, registerMovableToolbarEntry as Xe, resolveIconSetIcons as Ze, useDocThemes as Qe, useModelSync as $e, useReferenceModeStore as et, useResolvedWorkbook as tt, useTaskPaneArea as nt, useWorkbookEncrypted as rt, useWorkbookName as it, useWorkbookSaveState as at, withIconOverride as ot } from "@sheetxl/react";
13
- import { Command as st, DefaultIconService as ct, DefaultReactNotifier as lt, DynamicIcon as A, LanguageStateKey as ut, NotifierType as dt, ReactErrorBoundary as ft, ReactNotifierProvider as pt, ReactUtils as mt, ScrollUtils as ht, SplitPane as gt, UncaughtErrorBoundary as _t, createBusyHandle as j, useCallbackRef as vt, useFullscreen as M, useImperativeElement as yt, useLanguage as N, useMeasure as bt, useNotifier as xt, usePersistentState as St, useResolvedThemeMode as Ct, useTokenThemeContext as wt, useTranslator as P, useVisualViewportRect as Tt } from "@sheetxl/utils-react";
14
- import F, { Component as Et, cloneElement as Dt, createElement as Ot, forwardRef as I, isValidElement as kt, memo as L, useCallback as R, useContext as At, useEffect as z, useLayoutEffect as jt, useMemo as B, useRef as V, useState as H } from "react";
15
- import { AnimatedLoadingPanel as Mt, AnimatedTraversingEllipsisIcon as Nt, CommandGroup as Pt, ExhibitFloatProvider as Ft, ExhibitPopupIconButton as It, ExhibitTooltip as Lt, ModalProvider as Rt, SimpleTooltip as zt, StackTrace as Bt, createExhibitTheme as Vt, defaultCreatePopupPanel as Ht, hideLoadingPanel as Ut, lazyModal as Wt, showLoadingPanel as Gt, useInputDialog as Kt, useLazyWindow as qt, useModal as Jt, useOptionsDialog as Yt } from "@sheetxl/utils-mui";
16
- import { Fragment as Xt, jsx as U, jsxs as W } from "react/jsx-runtime";
17
- import { Box as G, Card as Zt, CardActions as Qt, Checkbox as $t, Collapse as en, CssBaseline as tn, DialogTitle as nn, FormControl as rn, FormControlLabel as an, IconButton as on, InputLabel as sn, MenuItem as K, Paper as cn, Select as ln, SvgIcon as un, Tab as dn, Tabs as fn, TextField as pn, ThemeProvider as mn, ToggleButton as q, ToggleButtonGroup as hn, Typography as J, alpha as gn, useMediaQuery as _n, useTheme as vn } from "@mui/material";
18
- import { CommonUtils as yn, DOMUtils as bn, DefaultLanguagePackService as xn, ErrorUtils as Sn, ExpectedError as Cn, PartialError as wn, defineLazyModule as Y, formatMessage as Tn, messageKey as X, t as Z } from "@sheetxl/utils";
19
- import { createPortal as En } from "react-dom";
20
- var Dn = L((e) => {
21
- let { variant: t = "format", children: n, sx: r, ...i } = e;
22
- return U(G, {
23
- className: `sxl-cf-rule-section sxl-cf-rule-section-${t}`,
24
- sx: {
25
- display: "flex",
26
- flexDirection: "column",
27
- gap: 1,
28
- p: 2,
29
- border: 1,
30
- borderColor: "divider",
31
- borderRadius: 1,
32
- ...t === "config" ? { backgroundColor: "action.hover" } : null,
33
- ...r
34
- },
35
- ...i,
36
- children: n
37
- });
38
- });
39
- Dn.displayName = "RuleSection";
40
- var On = new xe("transparent"), kn = {
41
- lightRedFillDarkRedText: X("conditionalFormat.preset.lightRedFillDarkRedText"),
42
- yellowFillDarkYellowText: X("conditionalFormat.preset.yellowFillDarkYellowText"),
43
- greenFillDarkGreenText: X("conditionalFormat.preset.greenFillDarkGreenText"),
44
- lightRedFill: X("conditionalFormat.preset.lightRedFill"),
45
- redText: X("conditionalFormat.preset.redText"),
46
- redBorder: X("conditionalFormat.preset.redBorder")
47
- }, An = (e) => e ? typeof e == "string" ? e : e.type === Te.Type.None ? null : e.color ?? e.foreground ?? null : null, jn = (e, t) => e === "auto" ? null : u(e, t), Mn = L((e) => {
48
- let { format: t, onFormatChange: n, readOnly: r, ...i } = e, a = P(), { workbook: o, schemeLookup: s, themeKey: c, darkMode: l, propsColorPanel: u } = _(), d = t?.font ?? null, f = (d?.weight ?? 400) >= 600, p = d?.style === Ee.Style.Italic, m = !!d?.underline && d.underline !== Ee.UnderlineStyle.None, h = !!d?.strike, g = (e) => {
49
- let r = { ...d };
50
- for (let [t, n] of Object.entries(e)) n === void 0 ? delete r[t] : r[t] = n;
51
- let i = { ...t };
52
- Object.keys(r).length === 0 ? delete i.font : i.font = r, n(Object.keys(i).length === 0 ? null : i);
53
- }, y = B(() => o?.getStyles().getNormal().getFont().getColor(), [o, c]), b = B(() => jn(d?.color, o), [
54
- d?.color,
55
- o,
56
- c
57
- ]), x = B(() => jn(An(t?.fill), o), [
58
- t?.fill,
59
- o,
60
- c
61
- ]), S = {
62
- padding: "4px",
63
- border: "none",
64
- borderRadius: 1
65
- };
66
- return W(Dn, {
67
- ...i,
68
- children: [W(G, {
69
- sx: {
70
- display: "flex",
71
- alignItems: "flex-start",
72
- gap: 1
73
- },
74
- children: [U(G, {
75
- sx: {
76
- flex: "1 1 auto",
77
- minWidth: 0,
78
- display: "flex",
79
- gap: .5,
80
- flexWrap: "wrap"
81
- },
82
- children: Fe.map((e, t) => {
83
- let i = jn(An(e.style.fill), o), s = jn(e.style.font?.color, o), c = e.style.borders ? jn(Object.values(e.style.borders)[0]?.color, o) : null;
84
- return U(w, {
85
- sheet: !0,
86
- title: a(kn[e.key] ?? e.key),
87
- disabled: r,
88
- onClick: () => n(structuredClone(e.style)),
89
- sx: {
90
- backgroundColor: i?.toCSS("adaptive") ?? void 0,
91
- color: s?.toCSS("adaptive") ?? void 0,
92
- outline: c ? `1px solid ${c.toCSS("adaptive")}` : void 0,
93
- outlineOffset: "-3px"
94
- },
95
- children: "Aa"
96
- }, t);
97
- })
98
- }), U(w, {
99
- title: a("conditionalFormat.clearStyle"),
100
- disabled: r || !t,
101
- onClick: () => n(null),
102
- sx: {
103
- color: "text.secondary",
104
- "&:disabled": { opacity: .4 }
105
- },
106
- children: U(A, {
107
- iconKey: "ClearFormats",
108
- size: 16
109
- })
110
- })]
111
- }), W(G, {
112
- sx: {
113
- display: "flex",
114
- alignItems: "center",
115
- gap: .25
116
- },
117
- children: [
118
- U(q, {
119
- value: "bold",
120
- size: "small",
121
- sx: S,
122
- selected: f,
123
- disabled: r,
124
- onChange: () => g({ weight: f ? void 0 : 700 }),
125
- children: U(A, { iconKey: "TextBold" })
126
- }),
127
- U(q, {
128
- value: "italic",
129
- size: "small",
130
- sx: S,
131
- selected: p,
132
- disabled: r,
133
- onChange: () => g({ style: p ? void 0 : Ee.Style.Italic }),
134
- children: U(A, { iconKey: "TextItalic" })
135
- }),
136
- U(q, {
137
- value: "underline",
138
- size: "small",
139
- sx: S,
140
- selected: m,
141
- disabled: r,
142
- onChange: () => g({ underline: m ? void 0 : Ee.UnderlineStyle.Single }),
143
- children: U(A, { iconKey: "TextUnderline" })
144
- }),
145
- U(q, {
146
- value: "strike",
147
- size: "small",
148
- sx: S,
149
- selected: h,
150
- disabled: r,
151
- onChange: () => g({ strike: !h || void 0 }),
152
- children: U(A, { iconKey: "TextStrike" })
153
- }),
154
- o && U(v, {
155
- tooltip: a("conditionalFormat.border"),
156
- selectedBorder: t?.borders,
157
- createBorder: (e) => o.getStyles().getNormal().createStyle({ borders: e }).getBorders(),
158
- schemeLookup: s,
159
- autoColor: y,
160
- darkMode: l,
161
- disabled: r,
162
- onSelectBorder: (e) => ((e) => {
163
- let r = { ...t };
164
- e && Object.keys(e).length !== 0 ? r.borders = e : delete r.borders, n(Object.keys(r).length === 0 ? null : r);
165
- })(e)
166
- }),
167
- U(T, {
168
- icon: "fill.colored",
169
- tooltip: a("conditionalFormat.fillColor"),
170
- selectedColor: x,
171
- disabled: r,
172
- onSelectColor: (e) => ((e) => {
173
- let r = { ...t };
174
- e ? r.fill = {
175
- type: Te.Type.Solid,
176
- color: e.toString()
177
- } : delete r.fill, n(Object.keys(r).length === 0 ? null : r);
178
- })(e),
179
- darkMode: l,
180
- propsPanel: {
181
- disableAlpha: !0,
182
- autoColor: On,
183
- autoColorLabelKey: X("color.noFill"),
184
- autoColorPosition: ve.End,
185
- ...u
186
- }
187
- }),
188
- U(T, {
189
- icon: "text.colored",
190
- tooltip: a("conditionalFormat.fontColor"),
191
- selectedColor: b,
192
- disabled: r,
193
- onSelectColor: (e) => g({ color: e ? e.toString() : void 0 }),
194
- darkMode: l,
195
- propsPanel: {
196
- disableAlpha: !0,
197
- autoColor: y,
198
- ...u
199
- }
200
- })
201
- ]
202
- })]
203
- });
204
- });
205
- Mn.displayName = "ConditionalFormatStylePicker";
206
- var Nn = {
207
- [E.ColorStopType.AutoMin]: X("conditionalFormat.stopType.autoMin"),
208
- [E.ColorStopType.AutoMax]: X("conditionalFormat.stopType.autoMax"),
209
- [E.ColorStopType.Min]: X("conditionalFormat.stopType.min"),
210
- [E.ColorStopType.Max]: X("conditionalFormat.stopType.max"),
211
- [E.ColorStopType.Num]: X("conditionalFormat.stopType.num"),
212
- [E.ColorStopType.Percent]: X("conditionalFormat.stopType.percent"),
213
- [E.ColorStopType.Percentile]: X("conditionalFormat.stopType.percentile"),
214
- [E.ColorStopType.Formula]: X("conditionalFormat.stopType.formula")
215
- }, Pn = /* @__PURE__ */ new Set([
216
- E.ColorStopType.AutoMin,
217
- E.ColorStopType.AutoMax,
218
- E.ColorStopType.Min,
219
- E.ColorStopType.Max
220
- ]), Fn = L((e) => {
221
- let { label: t, stop: n, onStopChange: r, allowedTypes: i, showColor: a = !1, leading: o, showExclusive: c = !1, readOnly: l, ...u } = e, d = P(), { darkMode: f, toColor: p, propsColorPanel: m } = _(), h = s(), g = n.type ?? E.ColorStopType.Num, v = !Pn.has(g), y = l || !v, b = g === E.ColorStopType.Formula, x = n.value?.isIFormula ? n.value : null, S = n.color, C = a ? p(S) : null;
222
- return W(G, {
223
- sx: {
224
- display: "flex",
225
- alignItems: "center",
226
- gap: .5
227
- },
228
- ...u,
229
- children: [
230
- t !== void 0 && U(J, {
231
- variant: "caption",
232
- sx: {
233
- color: "text.secondary",
234
- flex: "0 0 62px",
235
- minWidth: 0,
236
- overflow: "hidden",
237
- textOverflow: "ellipsis"
238
- },
239
- children: t
240
- }),
241
- o,
242
- a && U(T, {
243
- tooltip: d("conditionalFormat.stopColor"),
244
- selectedColor: C,
245
- disabled: l,
246
- onSelectColor: (e) => {
247
- e && r({
248
- ...n,
249
- color: e.toString()
250
- });
251
- },
252
- darkMode: f,
253
- propsPanel: {
254
- disableAlpha: !0,
255
- ...m
256
- }
257
- }),
258
- c && W(ln, {
259
- size: "small",
260
- value: n.exclusive ? "gt" : "gte",
261
- disabled: l,
262
- onChange: (e) => {
263
- let t = { ...n };
264
- e.target.value === "gt" ? t.exclusive = !0 : delete t.exclusive, r(t);
265
- },
266
- sx: {
267
- flex: "0 0 auto",
268
- backgroundColor: "background.paper"
269
- },
270
- children: [U(K, {
271
- value: "gte",
272
- children: ">="
273
- }), U(K, {
274
- value: "gt",
275
- children: ">"
276
- })]
277
- }),
278
- U(ln, {
279
- size: "small",
280
- value: g,
281
- disabled: l,
282
- onChange: (e) => ((e) => {
283
- let t = {
284
- ...n,
285
- type: e
286
- };
287
- if (Pn.has(e)) delete t.value;
288
- else if (t.value === void 0) t.value = e === E.ColorStopType.Formula ? "" : 0;
289
- else if (e !== E.ColorStopType.Formula && typeof t.value != "number") {
290
- let e = typeof t.value == "string" ? Number(t.value) : NaN;
291
- t.value = Number.isFinite(e) ? e : 0;
292
- }
293
- r(t);
294
- })(e.target.value),
295
- sx: {
296
- flex: "1 1 40%",
297
- minWidth: 0,
298
- backgroundColor: "background.paper"
299
- },
300
- children: i.map((e) => U(K, {
301
- value: e,
302
- children: d(Nn[e])
303
- }, e))
304
- }),
305
- b ? U(be, {
306
- size: "small",
307
- home: h.home,
308
- value: x ? h.display(x) : `${n.value ?? ""}`,
309
- onChangeText: (e) => {
310
- r({
311
- ...n,
312
- value: e.trim().length > 0 ? h.compile(e) : e
313
- });
314
- },
315
- placeholder: d("conditionalFormat.enterFormula"),
316
- disabled: y,
317
- equals: "bare",
318
- pickAs: "absolute",
319
- label: null,
320
- showError: !1,
321
- helperText: null,
322
- sx: {
323
- flex: "1 1 30%",
324
- minWidth: 0,
325
- "& .MuiInputBase-root": { backgroundColor: y ? "action.disabledBackground" : "background.paper" }
326
- }
327
- }) : U(pn, {
328
- size: "small",
329
- type: "number",
330
- placeholder: v ? void 0 : d("conditionalFormat.stopFromData"),
331
- value: v ? `${n.value ?? ""}` : "",
332
- disabled: y,
333
- onChange: (e) => {
334
- let t = e.target.value;
335
- r({
336
- ...n,
337
- value: t === "" ? 0 : Number(t)
338
- });
339
- },
340
- sx: {
341
- flex: "1 1 30%",
342
- minWidth: 0,
343
- cursor: y ? "not-allowed" : void 0
344
- },
345
- slotProps: { input: { sx: {
346
- backgroundColor: y ? "action.disabledBackground" : "background.paper",
347
- cursor: y ? "not-allowed" : void 0
348
- } } }
349
- })
350
- ]
351
- });
352
- });
353
- Fn.displayName = "ScaleStopRow";
354
- var In = [
355
- E.ColorStopType.Min,
356
- E.ColorStopType.Max,
357
- E.ColorStopType.Num,
358
- E.ColorStopType.Percent,
359
- E.ColorStopType.Percentile,
360
- E.ColorStopType.Formula
361
- ], Ln = L((e) => {
362
- let { scale: t, onScaleChange: n, readOnly: r, ...i } = e, o = P(), { workbook: s, toColor: c } = _(), l = t.stops ?? [], u = l.length === 2 ? [X("conditionalFormat.stop.minimum"), X("conditionalFormat.stop.maximum")] : [
363
- X("conditionalFormat.stop.minimum"),
364
- X("conditionalFormat.stop.midpoint"),
365
- X("conditionalFormat.stop.maximum")
366
- ];
367
- return W(G, {
368
- sx: {
369
- display: "flex",
370
- flexDirection: "column",
371
- gap: 1
372
- },
373
- ...i,
374
- children: [U(Dn, { children: W(G, {
375
- sx: {
376
- display: "flex",
377
- alignItems: "flex-start",
378
- gap: 1
379
- },
380
- children: [U(G, {
381
- sx: {
382
- flex: "1 1 auto",
383
- minWidth: 0,
384
- display: "flex",
385
- gap: .5,
386
- flexWrap: "wrap"
387
- },
388
- children: De.filter((e) => e.stops.length === (l.length === 2 ? 2 : 3)).map((e, t) => U(w, {
389
- sheet: !0,
390
- disabled: r,
391
- onClick: () => n(structuredClone(e)),
392
- children: U(m, { rows: a(e.stops ?? [], oe, s) })
393
- }, t))
394
- }), W(hn, {
395
- exclusive: !0,
396
- size: "small",
397
- value: l.length === 2 ? 2 : 3,
398
- disabled: r,
399
- onChange: (e, r) => {
400
- r && ((e) => {
401
- if (e === l.length || e !== 2 && e !== 3) return;
402
- let r = l.slice();
403
- if (e === 3) {
404
- let e = "#FFEB84", t = c(l[0]?.color ?? e)?.toRGBA(), n = c(l[l.length - 1]?.color ?? e)?.toRGBA();
405
- if (t && n) {
406
- let r = (e) => Math.round(e).toString(16).padStart(2, "0").toUpperCase();
407
- e = `#${r((t.red + n.red) / 2)}${r((t.green + n.green) / 2)}${r((t.blue + n.blue) / 2)}`;
408
- }
409
- r.splice(1, 0, {
410
- type: E.ColorStopType.Percentile,
411
- value: 50,
412
- color: e
413
- });
414
- } else r.splice(1, r.length - 2);
415
- n({
416
- ...t,
417
- stops: r
418
- });
419
- })(r);
420
- },
421
- sx: { flex: "0 0 auto" },
422
- children: [U(q, {
423
- value: 2,
424
- sx: {
425
- textTransform: "none",
426
- pt: .25,
427
- pb: .25
428
- },
429
- children: o("conditionalFormat.twoColor")
430
- }), U(q, {
431
- value: 3,
432
- sx: {
433
- textTransform: "none",
434
- pt: .25,
435
- pb: .25
436
- },
437
- children: o("conditionalFormat.threeColor")
438
- })]
439
- })]
440
- }) }), U(Dn, {
441
- variant: "config",
442
- children: l.map((e, i) => U(Fn, {
443
- label: o(u[Math.min(i, u.length - 1)]),
444
- stop: e,
445
- allowedTypes: In,
446
- showColor: !0,
447
- readOnly: r,
448
- onStopChange: (e) => {
449
- let r = l.slice();
450
- r[i] = e, n({
451
- ...t,
452
- stops: r
453
- });
454
- }
455
- }, i))
456
- })]
457
- });
458
- });
459
- Ln.displayName = "ColorScaleRulePanel";
460
- var Rn = [
461
- E.ColorStopType.AutoMin,
462
- E.ColorStopType.Min,
463
- E.ColorStopType.Num,
464
- E.ColorStopType.Percent,
465
- E.ColorStopType.Percentile,
466
- E.ColorStopType.Formula
467
- ], zn = [
468
- E.ColorStopType.AutoMax,
469
- E.ColorStopType.Max,
470
- E.ColorStopType.Num,
471
- E.ColorStopType.Percent,
472
- E.ColorStopType.Percentile,
473
- E.ColorStopType.Formula
474
- ], Bn = "__auto__", Vn = L((e) => {
475
- let { scale: t, onScaleChange: n, readOnly: r, ...i } = e, a = P(), { darkMode: o, toColor: s, propsColorPanel: l } = _(), u = t.stops ?? [], d = s(t.color), f = s(t.negativeFillColor), p = s(t.borderColor), h = s(t.negativeBorderColor), g = t.gradient ?? !1, v = (e) => {
476
- let r = { ...t };
477
- for (let [t, n] of Object.entries(e)) n === void 0 ? delete r[t] : r[t] = n;
478
- n(r);
479
- }, y = { backgroundColor: "background.paper" };
480
- return W(G, {
481
- sx: {
482
- display: "flex",
483
- flexDirection: "column",
484
- gap: 1
485
- },
486
- ...i,
487
- children: [W(Dn, { children: [
488
- W(G, {
489
- sx: {
490
- display: "flex",
491
- alignItems: "flex-start",
492
- gap: 1
493
- },
494
- children: [U(G, {
495
- sx: {
496
- flex: "1 1 auto",
497
- minWidth: 0,
498
- display: "flex",
499
- gap: .5,
500
- flexWrap: "wrap"
501
- },
502
- children: ke.filter((e) => (e.gradient ?? !1) === g).map((e, t) => U(w, {
503
- sheet: !0,
504
- disabled: r,
505
- onClick: () => v({
506
- color: e.color,
507
- gradient: e.gradient,
508
- borderColor: e.borderColor
509
- }),
510
- children: U(m, { rows: c(e, s(e.color)?.toCSS("adaptive") ?? "var(--sxl-color-primary, rgb(33, 115, 70))") })
511
- }, t))
512
- }), W(hn, {
513
- exclusive: !0,
514
- size: "small",
515
- value: g,
516
- disabled: r,
517
- onChange: (e, t) => {
518
- t !== null && v({ gradient: !!t || void 0 });
519
- },
520
- sx: { flex: "0 0 auto" },
521
- children: [U(q, {
522
- value: !1,
523
- sx: {
524
- textTransform: "none",
525
- pt: .25,
526
- pb: .25
527
- },
528
- children: a("conditionalFormat.solidFill")
529
- }), U(q, {
530
- value: !0,
531
- sx: {
532
- textTransform: "none",
533
- pt: .25,
534
- pb: .25
535
- },
536
- children: a("conditionalFormat.gradientFill")
537
- })]
538
- })]
539
- }),
540
- U(an, {
541
- control: U($t, {
542
- size: "small",
543
- checked: !1 === t.showValue,
544
- disabled: r,
545
- onChange: (e) => v({ showValue: !e.target.checked && void 0 })
546
- }),
547
- label: U(J, {
548
- variant: "body2",
549
- children: a("conditionalFormat.showBarsOnly")
550
- })
551
- }),
552
- W(G, {
553
- sx: {
554
- display: "flex",
555
- alignItems: "center",
556
- gap: .5
557
- },
558
- children: [
559
- U(J, {
560
- variant: "caption",
561
- sx: {
562
- color: "text.secondary",
563
- flex: "0 0 62px"
564
- },
565
- children: a("conditionalFormat.bar")
566
- }),
567
- U(T, {
568
- icon: "fill.colored",
569
- tooltip: a("conditionalFormat.barColor"),
570
- selectedColor: d,
571
- disabled: r,
572
- onSelectColor: (e) => v({ color: e ? e.toString() : void 0 }),
573
- darkMode: o,
574
- propsPanel: {
575
- disableAlpha: !0,
576
- ...l
577
- }
578
- }),
579
- U(T, {
580
- icon: "stroke.colored",
581
- tooltip: a("conditionalFormat.barBorderColor"),
582
- selectedColor: p,
583
- disabled: r,
584
- onSelectColor: (e) => v({ borderColor: e ? e.toString() : void 0 }),
585
- darkMode: o,
586
- propsPanel: {
587
- disableAlpha: !0,
588
- ...l
589
- }
590
- })
591
- ]
592
- }),
593
- W(G, {
594
- sx: {
595
- display: "flex",
596
- alignItems: "center",
597
- gap: .5
598
- },
599
- children: [
600
- U(J, {
601
- variant: "caption",
602
- sx: {
603
- color: "text.secondary",
604
- flex: "0 0 62px"
605
- },
606
- children: a("conditionalFormat.negative")
607
- }),
608
- U(T, {
609
- icon: "fill.colored",
610
- tooltip: a("conditionalFormat.negativeColor"),
611
- selectedColor: f ?? d,
612
- disabled: r,
613
- onSelectColor: (e) => v({ negativeFillColor: e ? e.toString() : void 0 }),
614
- darkMode: o,
615
- propsPanel: {
616
- disableAlpha: !0,
617
- ...l
618
- }
619
- }),
620
- U(T, {
621
- icon: "stroke.colored",
622
- tooltip: a("conditionalFormat.negativeBorderColor"),
623
- selectedColor: h ?? p,
624
- disabled: r,
625
- onSelectColor: (e) => v({ negativeBorderColor: e ? e.toString() : void 0 }),
626
- darkMode: o,
627
- propsPanel: {
628
- disableAlpha: !0,
629
- ...l
630
- }
631
- }),
632
- U(w, {
633
- title: a("conditionalFormat.sameAsPositive"),
634
- disabled: r || !t.negativeFillColor && !t.negativeBorderColor,
635
- onClick: () => v({
636
- negativeFillColor: void 0,
637
- negativeBorderColor: void 0
638
- }),
639
- sx: {
640
- color: "text.secondary",
641
- "&:disabled": { opacity: .4 }
642
- },
643
- children: U(A, {
644
- iconKey: "ClearFormats",
645
- size: 16
646
- })
647
- })
648
- ]
649
- }),
650
- W(G, {
651
- sx: {
652
- display: "flex",
653
- gap: 1,
654
- mt: .5
655
- },
656
- children: [W(rn, {
657
- size: "small",
658
- sx: {
659
- flex: 1,
660
- minWidth: 0
661
- },
662
- children: [U(sn, { children: a("conditionalFormat.axis") }), W(ln, {
663
- label: a("conditionalFormat.axis"),
664
- value: t.axisPosition ?? Bn,
665
- disabled: r,
666
- sx: y,
667
- onChange: (e) => {
668
- let t = e.target.value;
669
- v({ axisPosition: t === Bn ? void 0 : t });
670
- },
671
- children: [
672
- U(K, {
673
- value: Bn,
674
- children: a("conditionalFormat.automatic")
675
- }),
676
- U(K, {
677
- value: "middle",
678
- children: a("conditionalFormat.axisMiddle")
679
- }),
680
- U(K, {
681
- value: "none",
682
- children: a("conditionalFormat.axisNone")
683
- })
684
- ]
685
- })]
686
- }), W(rn, {
687
- size: "small",
688
- sx: {
689
- flex: 1,
690
- minWidth: 0
691
- },
692
- children: [U(sn, { children: a("conditionalFormat.direction") }), W(ln, {
693
- label: a("conditionalFormat.direction"),
694
- value: t.direction ?? Bn,
695
- disabled: r,
696
- sx: y,
697
- onChange: (e) => {
698
- let t = e.target.value;
699
- v({ direction: t === Bn ? void 0 : t });
700
- },
701
- children: [
702
- U(K, {
703
- value: Bn,
704
- children: a("conditionalFormat.automatic")
705
- }),
706
- U(K, {
707
- value: "leftToRight",
708
- children: a("conditionalFormat.leftToRight")
709
- }),
710
- U(K, {
711
- value: "rightToLeft",
712
- children: a("conditionalFormat.rightToLeft")
713
- })
714
- ]
715
- })]
716
- })]
717
- })
718
- ] }), W(Dn, {
719
- variant: "config",
720
- children: [U(Fn, {
721
- label: a("conditionalFormat.stop.minimum"),
722
- stop: u[0] ?? { type: E.ColorStopType.AutoMin },
723
- allowedTypes: Rn,
724
- readOnly: r,
725
- onStopChange: (e) => {
726
- let t = u.slice();
727
- t[0] = e, v({ stops: t });
728
- }
729
- }), U(Fn, {
730
- label: a("conditionalFormat.stop.maximum"),
731
- stop: u[1] ?? { type: E.ColorStopType.AutoMax },
732
- allowedTypes: zn,
733
- readOnly: r,
734
- onStopChange: (e) => {
735
- let t = u.slice();
736
- for (; t.length < 2;) t.push({ type: E.ColorStopType.AutoMax });
737
- t[1] = e, v({ stops: t });
738
- }
739
- })]
740
- })]
741
- });
742
- });
743
- Vn.displayName = "DataBarRulePanel";
744
- var Hn = X("conditionalFormat.noCellIcon"), Un = X("conditionalFormat.cellIcon"), Wn = {
745
- borderColor: "primary.main",
746
- boxShadow: (e) => `inset 0 0 0 1px ${e.palette.primary.main}`
747
- }, Gn = {
748
- width: "28px",
749
- height: "26px"
750
- }, Kn = L((e) => {
751
- let { icon: t, onPick: n } = e, r = P();
752
- return W(G, {
753
- sx: {
754
- display: "flex",
755
- flexDirection: "column",
756
- gap: "4px",
757
- padding: "6px 8px"
758
- },
759
- children: [U(w, {
760
- sheet: !0,
761
- title: r(Hn),
762
- "aria-pressed": t === null,
763
- sx: {
764
- ...Gn,
765
- ...t === null ? Wn : null
766
- },
767
- onClick: () => {
768
- n({ ...Pe });
769
- },
770
- children: U(Me, {
771
- icons: [null],
772
- size: 16
773
- })
774
- }), U(G, {
775
- sx: {
776
- display: "grid",
777
- gridTemplateColumns: "repeat(8, auto)",
778
- justifyContent: "start",
779
- gap: "3px"
780
- },
781
- children: je.map((e) => {
782
- let i = ((e, t) => !!e && e.iconKey === t.iconKey && e.color === t.color)(t, e.spec);
783
- return U(w, {
784
- sheet: !0,
785
- title: p(r, e.spec),
786
- "aria-pressed": i,
787
- sx: {
788
- ...Gn,
789
- ...i ? Wn : null
790
- },
791
- onClick: () => {
792
- n({
793
- set: e.set,
794
- id: e.id
795
- });
796
- },
797
- children: U(Me, {
798
- icons: [e.spec],
799
- size: 16
800
- })
801
- }, `${e.set}:${e.id}`);
802
- })
803
- })]
804
- });
805
- });
806
- Kn.displayName = "IconCatalogPanel";
807
- var qn = L(I((e, t) => {
808
- let { icon: n, onPick: r, tooltip: i, ...a } = e, o = P(), s = R((e) => {
809
- let { closeFloat: t } = e, i = U(Kn, {
810
- icon: n,
811
- onPick: (e) => {
812
- t?.(), r(e);
813
- }
814
- });
815
- return Ht({
816
- ...e,
817
- children: i
818
- });
819
- }, [n, r]);
820
- return U(It, {
821
- ref: t,
822
- createPopupPanel: s,
823
- tooltip: i ?? o(Un),
824
- icon: U(Me, {
825
- icons: [n],
826
- size: 16
827
- }),
828
- outlined: !0,
829
- ...a
830
- });
831
- }));
832
- qn.displayName = "IconPickerPopupButton";
833
- var Jn = [
834
- E.ColorStopType.Percent,
835
- E.ColorStopType.Num,
836
- E.ColorStopType.Percentile,
837
- E.ColorStopType.Formula
838
- ], Yn = L((e) => {
839
- let { scale: t, onScaleChange: n, readOnly: a, ...o } = e, s = P(), c = t.iconSet ?? Ce.IconSet.TrafficLights3, l = k(c).length === 0, u = t.stops ?? [], d = u.length, f = Ze(t), p = (e) => {
840
- let r = { ...t };
841
- for (let [t, n] of Object.entries(e)) n === void 0 ? delete r[t] : r[t] = n;
842
- n(r);
843
- }, m = R((e) => {
844
- let { closeFloat: t } = e, n = U(r, {
845
- groups: i,
846
- disabled: a,
847
- onPick: (e) => {
848
- t?.(), e.type === E.ScaleType.IconSet && e.iconSet && ((e) => {
849
- if (e === c) return;
850
- let t = Je(e), n = u;
851
- t !== u.length && (n = qe(t)), p({
852
- iconSet: e,
853
- stops: n,
854
- icon: void 0
855
- });
856
- })(e.iconSet);
857
- }
858
- });
859
- return Ht({
860
- ...e,
861
- children: n
862
- });
863
- }, [a, t]), h = Se.camelToPrettyCase(c);
864
- return W(G, {
865
- sx: {
866
- display: "flex",
867
- flexDirection: "column",
868
- gap: 1
869
- },
870
- ...o,
871
- children: [W(Dn, { children: [
872
- U(G, {
873
- sx: {
874
- display: "flex",
875
- alignItems: "center",
876
- gap: 1
877
- },
878
- children: U(It, {
879
- outlined: !0,
880
- disabled: a,
881
- label: h,
882
- tooltip: h,
883
- icon: U(G, {
884
- sx: {
885
- width: "82px",
886
- display: "flex",
887
- justifyContent: "center"
888
- },
889
- children: l ? U(J, {
890
- variant: "caption",
891
- noWrap: !0,
892
- children: h
893
- }) : U(Me, {
894
- icons: k(c),
895
- order: "descending",
896
- size: 14,
897
- gap: 3
898
- })
899
- }),
900
- createPopupPanel: m
901
- })
902
- }),
903
- l && U(J, {
904
- variant: "caption",
905
- sx: { color: "text.secondary" },
906
- children: s("conditionalFormat.adoptedIconSet")
907
- }),
908
- W(G, {
909
- sx: {
910
- display: "flex",
911
- gap: 1
912
- },
913
- children: [U(an, {
914
- control: U($t, {
915
- size: "small",
916
- checked: !1 === t.showValue,
917
- disabled: a,
918
- onChange: (e) => p({ showValue: !e.target.checked && void 0 })
919
- }),
920
- label: U(J, {
921
- variant: "body2",
922
- children: s("conditionalFormat.showIconsOnly")
923
- })
924
- }), U(an, {
925
- control: U($t, {
926
- size: "small",
927
- checked: t.reverse ?? !1,
928
- disabled: a,
929
- onChange: (e) => p({ reverse: !!e.target.checked || void 0 })
930
- }),
931
- label: U(J, {
932
- variant: "body2",
933
- children: s("conditionalFormat.reverseIcons")
934
- })
935
- })]
936
- })
937
- ] }), U(Dn, {
938
- variant: "config",
939
- children: u.map((e, r) => {
940
- let i = t.reverse ? d - 1 - r : r;
941
- return U(Fn, {
942
- stop: e,
943
- allowedTypes: Jn,
944
- showExclusive: !0,
945
- readOnly: a || r === 0,
946
- leading: U(qn, {
947
- icon: f[r] ?? null,
948
- disabled: a || l,
949
- onPick: (e) => n(ot(t, i, e))
950
- }),
951
- onStopChange: (e) => {
952
- let t = u.slice();
953
- t[r] = e, p({ stops: t });
954
- }
955
- }, r);
956
- })
957
- })]
958
- });
959
- });
960
- Yn.displayName = "IconSetRulePanel";
961
- var Xn = (e, t, n) => u(e, t)?.toCSS("adaptive") ?? n, Zn = (e, t, n) => {
962
- if (!e) return n;
963
- if (typeof e == "string") return Xn(e, t, n);
964
- if (e.type === Te.Type.None) return n;
965
- let r = e, i = e;
966
- return Xn(i.foreground ?? r.color ?? i.background, t, n);
967
- }, Qn = L((t) => {
968
- let { conditionalFormat: n, size: r = 28, ...i } = t, { workbook: o, themeKey: s } = _();
969
- $e(n, "onAnyChange");
970
- let l = n.getScale(), u = n.getStyle(), p = B(() => {
971
- try {
972
- return o?.getStyles().getNormal().getFont().toCSS("adaptive") ?? {};
973
- } catch {
974
- return {};
975
- }
976
- }, [o, s]), h = B(() => {
977
- if (l?.type === E.ScaleType.ColorScale) return U(m, { rows: a(l.stops ?? [], oe, o) });
978
- if (l?.type === E.ScaleType.DataBar) return U(m, { rows: c(l, Xn(l.color, o, e), l.borderColor ? Xn(l.borderColor, o, e) : void 0) });
979
- if (l?.type === E.ScaleType.IconSet) return U(G, {
980
- sx: {
981
- display: "flex",
982
- alignItems: "center",
983
- justifyContent: "center",
984
- width: "100%",
985
- height: "100%",
986
- px: .5
987
- },
988
- children: U(Me, {
989
- icons: Ze(l),
990
- order: "descending",
991
- size: 14,
992
- gap: 3
993
- })
994
- });
995
- let t = u?.font, n = t?.underline && t.underline !== Ee.UnderlineStyle.None;
996
- return U(G, {
997
- sx: {
998
- width: "100%",
999
- height: "100%",
1000
- display: "flex",
1001
- alignItems: "center",
1002
- justifyContent: "center",
1003
- ...p,
1004
- backgroundColor: Zn(u?.fill, o, "transparent"),
1005
- ...t?.color && t.color !== "auto" ? { color: Xn(t.color, o, f) } : null,
1006
- ...t?.weight ? { fontWeight: t.weight } : null,
1007
- ...t?.style ? { fontStyle: t.style } : null,
1008
- textDecoration: [n ? "underline" : "", t?.strike ? "line-through" : ""].join(" ").trim() || "none",
1009
- fontSize: `${Math.round(.5 * r)}px`,
1010
- lineHeight: 1,
1011
- outline: u?.borders ? `1px solid ${Xn(Object.values(u.borders)[0]?.color, o, d)}` : void 0,
1012
- outlineOffset: "-3px"
1013
- },
1014
- children: "Aa"
1015
- });
1016
- }, [
1017
- l,
1018
- u,
1019
- r,
1020
- p,
1021
- o,
1022
- s
1023
- ]);
1024
- return U(w, {
1025
- sheet: !0,
1026
- className: "sxl-cf-rule-preview",
1027
- sx: {
1028
- width: "auto",
1029
- minWidth: 1.7 * r + "px",
1030
- height: `${r}px`
1031
- },
1032
- ...i,
1033
- children: h
1034
- });
1035
- });
1036
- Qn.displayName = "RulePreview";
1037
- var $n = (e, t) => {
1038
- let n = e.getCondition()?.toString();
1039
- if (n) return n;
1040
- let r = e.getScale();
1041
- return r ? Se.camelToPrettyCase(r.type) : t("conditionalFormat.noCondition");
1042
- }, er = {
1043
- classic: X("conditionalFormat.tab.classic"),
1044
- [E.ScaleType.ColorScale]: X("conditionalFormat.tab.colorScale"),
1045
- [E.ScaleType.DataBar]: X("conditionalFormat.tab.dataBars"),
1046
- [E.ScaleType.IconSet]: X("conditionalFormat.tab.iconSets")
1047
- }, tr = L((e) => {
1048
- let { conditionalFormat: n } = e, r = P();
1049
- $e(n, "onAnyChange");
1050
- let i = n.getScale(), a = n.getCondition(), o = n.getStyle(), s = n.isProtected(), c = i?.type ?? "classic", u = V({ scales: {} }), d = (e) => {
1051
- n.update({ scale: e });
1052
- }, f = W(cn, {
1053
- tabIndex: 0,
1054
- className: l["editor-panel"],
1055
- sx: {
1056
- gap: (e) => e.spacing(1),
1057
- paddingTop: (e) => e.spacing(1.25),
1058
- paddingBottom: (e) => e.spacing(2),
1059
- paddingLeft: (e) => e.spacing(1.5),
1060
- paddingRight: (e) => e.spacing(1.5),
1061
- border: (e) => `1px solid ${e.palette.divider}`,
1062
- borderRadius: (e) => e.spacing(1.25),
1063
- overflow: "auto"
1064
- },
1065
- children: [
1066
- W(G, {
1067
- sx: {
1068
- display: "flex",
1069
- flexDirection: "column",
1070
- gap: (e) => e.spacing(1.75),
1071
- margin: (e) => e.spacing(1.25),
1072
- marginBottom: 0
1073
- },
1074
- children: [W(G, {
1075
- sx: {
1076
- display: "flex",
1077
- alignItems: "center",
1078
- gap: (e) => e.spacing(1.5)
1079
- },
1080
- children: [U(Qn, {
1081
- conditionalFormat: n,
1082
- size: 48
1083
- }), U(J, {
1084
- variant: "body2",
1085
- sx: {
1086
- minWidth: 0,
1087
- wordBreak: "break-word"
1088
- },
1089
- children: $n(n, r)
1090
- })]
1091
- }), U(y, {
1092
- item: n,
1093
- label: r("conditionalFormat.applyTo")
1094
- })]
1095
- }),
1096
- U(fn, {
1097
- value: c,
1098
- onChange: (e, t) => {
1099
- s || ((e) => {
1100
- if (e !== c) {
1101
- if (c === "classic" ? (u.current.condition = a?.toJSON() ?? null, u.current.style = o) : i && (u.current.scales[i.type] = i), e === "classic") n.update({
1102
- condition: u.current.condition ?? {
1103
- operator: we.BuiltInOperatorNames.Between,
1104
- param: null
1105
- },
1106
- style: u.current.style ?? null,
1107
- scale: null
1108
- });
1109
- else {
1110
- let t = u.current.scales[e] ?? (e === E.ScaleType.ColorScale ? We() : e === E.ScaleType.DataBar ? Ge() : Ke());
1111
- n.update({
1112
- scale: t,
1113
- condition: null,
1114
- style: null
1115
- });
1116
- }
1117
- }
1118
- })(t);
1119
- },
1120
- variant: "fullWidth",
1121
- sx: {
1122
- minHeight: "36px",
1123
- borderBottom: 1,
1124
- borderColor: "divider",
1125
- "& .MuiTab-root": {
1126
- minHeight: "36px",
1127
- textTransform: "none",
1128
- pt: .5,
1129
- pb: .5,
1130
- px: .5,
1131
- minWidth: 0
1132
- }
1133
- },
1134
- children: Object.keys(er).map((e) => U(dn, {
1135
- value: e,
1136
- label: r(er[e])
1137
- }, e))
1138
- }),
1139
- c === "classic" && W(Xt, { children: [U(Mn, {
1140
- format: o,
1141
- readOnly: s,
1142
- onFormatChange: (e) => n.update({ style: e })
1143
- }), U(_e, {
1144
- sx: {
1145
- ...t,
1146
- p: 2,
1147
- pb: 1
1148
- },
1149
- selectorTitle: r("conditionalFormat.highlight"),
1150
- condition: a,
1151
- ranges: n.getRanges(),
1152
- readOnly: s,
1153
- onConditionChange: (e) => n.setCondition(e)
1154
- })] }),
1155
- i?.type === E.ScaleType.ColorScale && U(Ln, {
1156
- scale: i,
1157
- onScaleChange: d,
1158
- readOnly: s
1159
- }),
1160
- i?.type === E.ScaleType.DataBar && U(Vn, {
1161
- scale: i,
1162
- onScaleChange: d,
1163
- readOnly: s
1164
- }),
1165
- i?.type === E.ScaleType.IconSet && U(Yn, {
1166
- scale: i,
1167
- onScaleChange: d,
1168
- readOnly: s
1169
- }),
1170
- c === "classic" && U(G, {
1171
- sx: {
1172
- pl: 2,
1173
- pr: 2,
1174
- border: 1,
1175
- borderColor: "divider",
1176
- borderRadius: 1
1177
- },
1178
- children: U(an, {
1179
- control: U($t, {
1180
- checked: n.isStopIfTrue(),
1181
- disabled: s,
1182
- onChange: (e) => n.setStopIfTrue(e.target.checked)
1183
- }),
1184
- label: r("conditionalFormat.stopIfTrue")
1185
- })
1186
- })
1187
- ]
1188
- });
1189
- return U(x.Provider, {
1190
- value: n,
1191
- children: f
1192
- });
1193
- });
1194
- tr.displayName = "ConditionalFormatEditorPanel";
1195
- var nr = L(({ item: e }) => {
1196
- let t = P();
1197
- return $e(e, "onAnyChange"), !e.isStopIfTrue() || e.getScale() ? null : U(G, {
1198
- sx: {
1199
- display: "inline-flex",
1200
- alignItems: "center",
1201
- alignSelf: "flex-start",
1202
- px: .75,
1203
- py: .25,
1204
- border: 1,
1205
- borderColor: "divider",
1206
- borderRadius: 1,
1207
- color: "text.secondary"
1208
- },
1209
- children: U(J, {
1210
- variant: "caption",
1211
- children: t("conditionalFormat.stopIfTrue")
1212
- })
1213
- });
1214
- });
1215
- nr.displayName = "StopIfTrueBadge";
1216
- var rr = L(({ item: e }) => {
1217
- let t = P();
1218
- return U(y, {
1219
- item: e,
1220
- label: t("conditionalFormat.applyTo"),
1221
- helperText: null
1222
- });
1223
- });
1224
- rr.displayName = "ConditionalFormatCardRanges";
1225
- var ir = {
1226
- key: "conditional-format",
1227
- messageKeys: {
1228
- none: X("conditionalFormat.none"),
1229
- addPrompt: X("conditionalFormat.addPrompt"),
1230
- heading: X("conditionalFormat.heading"),
1231
- insert: X("conditionalFormat.insert"),
1232
- new: X("conditionalFormat.new"),
1233
- moveUp: X("conditionalFormat.moveUp"),
1234
- moveDown: X("conditionalFormat.moveDown"),
1235
- edit: X("conditionalFormat.edit"),
1236
- duplicate: X("conditionalFormat.duplicate"),
1237
- delete: X("conditionalFormat.delete"),
1238
- cancel: X("conditionalFormat.cancel"),
1239
- save: X("conditionalFormat.save")
1240
- },
1241
- getCollection: (e) => e.getConditionalFormats(),
1242
- changeEvents: ["onConditionalFormatsChange"],
1243
- isReadOnly: (e) => !e.getProtection().isFormatCellsAllowed(),
1244
- applyUpdate: (e, t) => {
1245
- e.update(t);
1246
- },
1247
- validate: (e) => e.getCondition()?.validate() ?? null,
1248
- applySeed: (e, t) => {
1249
- e.update({
1250
- condition: t.condition ?? null,
1251
- style: t.style ?? null,
1252
- scale: t.scale ?? null,
1253
- stopIfTrue: t.stopIfTrue ?? !1
1254
- });
1255
- },
1256
- getCardTitle: $n,
1257
- CardMedia: ({ item: e }) => U(Qn, {
1258
- conditionalFormat: e,
1259
- size: 32
1260
- }),
1261
- CardSubtitle: rr,
1262
- CardBody: nr,
1263
- EditorBody: ({ item: e }) => U(tr, { conditionalFormat: e })
1264
- }, ar = L(I((e, t) => {
1265
- let { workbook: n, args: r, ...i } = e;
1266
- return U(S, {
1267
- ref: t,
1268
- workbook: n,
1269
- descriptor: ir,
1270
- args: r,
1271
- dragReorder: !0,
1272
- ...i
1273
- });
1274
- }));
1275
- ar.displayName = "ConditionalFormatDetailsPanel";
1276
- var or = (e) => {
1277
- let { model: t, entryKey: n, frame: r, args: i, ref: a, ...o } = e;
1278
- return U(ar, {
1279
- ref: a,
1280
- workbook: t,
1281
- args: i,
1282
- ...o
1283
- });
1284
- }, sr = ["lines"];
1285
- function cr(e) {
1286
- var t, n, r = "";
1287
- if (typeof e == "string" || typeof e == "number") r += e;
1288
- else if (typeof e == "object") {
1289
- if (Array.isArray(e)) for (t = 0; t < e.length; t++) e[t] && (n = cr(e[t])) && (r && (r += " "), r += n);
1290
- else for (t in e) e[t] && (r && (r += " "), r += t);
1291
- }
1292
- return r;
1293
- }
1294
- function lr() {
1295
- for (var e, t, n = 0, r = ""; n < arguments.length;) (e = arguments[n++]) && (t = cr(e)) && (r && (r += " "), r += t);
1296
- return r;
1297
- }
1298
- var ur = { data: "" }, dr = (e) => {
1299
- if (typeof window == "object") {
1300
- let t = (e ? e.querySelector("#_goober") : window._goober) || Object.assign(document.createElement("style"), {
1301
- innerHTML: " ",
1302
- id: "_goober"
1303
- });
1304
- return t.nonce = window.__nonce__, t.parentNode || (e || document.head).appendChild(t), t.firstChild;
1305
- }
1306
- return e || ur;
1307
- }, fr = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, pr = /\/\*[^]*?\*\/| +/g, mr = /\n+/g, hr = (e, t) => {
1308
- let n = "", r = "", i = "";
1309
- for (let a in e) {
1310
- let o = e[a];
1311
- a[0] == "@" ? a[1] == "i" ? n = a + " " + o + ";" : r += a[1] == "f" ? hr(o, a) : a + "{" + hr(o, a[1] == "k" ? "" : t) + "}" : typeof o == "object" ? r += hr(o, t ? t.replace(/([^,])+/g, (e) => a.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g, (t) => /&/.test(t) ? t.replace(/&/g, e) : e ? e + " " + t : t)) : a) : o != null && (a = a[1] == "-" ? a : a.replace(/[A-Z]/g, "-$&").toLowerCase(), i += hr.p ? hr.p(a, o) : a + ":" + o + ";");
1312
- }
1313
- return n + (t && i ? t + "{" + i + "}" : i) + r;
1314
- }, gr = {}, _r = (e) => {
1315
- if (typeof e == "object") {
1316
- let t = "";
1317
- for (let n in e) t += n + _r(e[n]);
1318
- return t;
1319
- }
1320
- return e;
1321
- }, vr = (e, t, n, r, i) => {
1322
- let a = _r(e), o = gr[a] || (gr[a] = ((e) => {
1323
- let t = 0, n = 11;
1324
- for (; t < e.length;) n = 101 * n + e.charCodeAt(t++) >>> 0;
1325
- return "go" + n;
1326
- })(a));
1327
- if (!gr[o]) {
1328
- let t = a === e ? ((e) => {
1329
- let t, n, r = [{}];
1330
- for (; t = fr.exec(e.replace(pr, ""));) t[4] ? r.shift() : t[3] ? (n = t[3].replace(mr, " ").trim(), r.unshift(r[0][n] = r[0][n] || {})) : r[0][t[1]] = t[2].replace(mr, " ").trim();
1331
- return r[0];
1332
- })(e) : e;
1333
- gr[o] = hr(i ? { ["@keyframes " + o]: t } : t, n ? "" : "." + o);
1334
- }
1335
- let s = n && gr.g;
1336
- return n && (gr.g = gr[o]), ((e, t, n, r) => {
1337
- r ? t.data = t.data.replace(r, e) : t.data.indexOf(e) === -1 && (t.data = n ? e + t.data : t.data + e);
1338
- })(gr[o], t, r, s), o;
1339
- };
1340
- function yr(e) {
1341
- let t = this || {}, n = e.call ? e(t.p) : e;
1342
- return vr(n.unshift ? n.raw ? ((e, t, n) => e.reduce((e, r, i) => {
1343
- let a = t[i];
1344
- if (a && a.call) {
1345
- let e = a(n), t = e && e.props && e.props.className || /^go/.test(e) && e;
1346
- a = t ? "." + t : e && typeof e == "object" ? e.props ? "" : hr(e, "") : !1 === e ? "" : e;
1347
- }
1348
- return e + r + (a ?? "");
1349
- }, ""))(n, [].slice.call(arguments, 1), t.p) : n.reduce((e, n) => Object.assign(e, n && n.call ? n(t.p) : n), {}) : n, dr(t.target), t.g, t.o, t.k);
1350
- }
1351
- yr.bind({ g: 1 }), yr.bind({ k: 1 });
1352
- function br(e, t) {
1353
- for (var n = 0; n < t.length; n++) {
1354
- var r = t[n];
1355
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
1356
- }
1357
- }
1358
- function xr(e, t, n) {
1359
- return t && br(e.prototype, t), n && br(e, n), e;
1360
- }
1361
- function Q() {
1362
- return Q = Object.assign || function(e) {
1363
- for (var t = 1; t < arguments.length; t++) {
1364
- var n = arguments[t];
1365
- for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
1366
- }
1367
- return e;
1368
- }, Q.apply(this, arguments);
1369
- }
1370
- function Sr(e, t) {
1371
- e.prototype = Object.create(t.prototype), e.prototype.constructor = e, e.__proto__ = t;
1372
- }
1373
- function Cr(e, t) {
1374
- if (e == null) return {};
1375
- for (var n, r = {}, i = Object.keys(e), a = 0; a < i.length; a++) n = i[a], t.indexOf(n) >= 0 || (r[n] = e[n]);
1376
- return r;
1377
- }
1378
- function wr(e) {
1379
- if (e === void 0) throw ReferenceError("this hasn't been initialised - super() hasn't been called");
1380
- return e;
1381
- }
1382
- var Tr = function() {
1383
- return "";
1384
- }, Er = F.createContext({
1385
- enqueueSnackbar: Tr,
1386
- closeSnackbar: Tr
1387
- }), Dr = "@media (max-width:599.95px)", Or = "@media (min-width:600px)", kr = function(e) {
1388
- return e.charAt(0).toUpperCase() + e.slice(1);
1389
- }, Ar = function(e) {
1390
- return "" + kr(e.vertical) + kr(e.horizontal);
1391
- }, jr = function(e) {
1392
- return !!e || e === 0;
1393
- }, Mr = "unmounted", Nr = "exited", Pr = "entering", Fr = "entered", Ir = "exiting", Lr = function(e) {
1394
- function t(t) {
1395
- var n, r = e.call(this, t) || this, i = t.appear;
1396
- return r.appearStatus = null, t.in ? i ? (n = Nr, r.appearStatus = Pr) : n = Fr : n = t.unmountOnExit || t.mountOnEnter ? Mr : Nr, r.state = { status: n }, r.nextCallback = null, r;
1397
- }
1398
- Sr(t, e), t.getDerivedStateFromProps = function(e, t) {
1399
- return e.in && t.status === Mr ? { status: Nr } : null;
1400
- };
1401
- var n = t.prototype;
1402
- return n.componentDidMount = function() {
1403
- this.updateStatus(!0, this.appearStatus);
1404
- }, n.componentDidUpdate = function(e) {
1405
- var t = null;
1406
- if (e !== this.props) {
1407
- var n = this.state.status;
1408
- this.props.in ? n !== Pr && n !== Fr && (t = Pr) : n !== Pr && n !== Fr || (t = Ir);
1409
- }
1410
- this.updateStatus(!1, t);
1411
- }, n.componentWillUnmount = function() {
1412
- this.cancelNextCallback();
1413
- }, n.getTimeouts = function() {
1414
- var e = this.props.timeout, t = e, n = e;
1415
- return e != null && typeof e != "number" && typeof e != "string" && (n = e.exit, t = e.enter), {
1416
- exit: n,
1417
- enter: t
1418
- };
1419
- }, n.updateStatus = function(e, t) {
1420
- e === void 0 && (e = !1), t === null ? this.props.unmountOnExit && this.state.status === Nr && this.setState({ status: Mr }) : (this.cancelNextCallback(), t === Pr ? this.performEnter(e) : this.performExit());
1421
- }, n.performEnter = function(e) {
1422
- var t = this, n = this.props.enter, r = e, i = this.getTimeouts();
1423
- e || n ? (this.props.onEnter && this.props.onEnter(this.node, r), this.safeSetState({ status: Pr }, function() {
1424
- t.props.onEntering && t.props.onEntering(t.node, r), t.onTransitionEnd(i.enter, function() {
1425
- t.safeSetState({ status: Fr }, function() {
1426
- t.props.onEntered && t.props.onEntered(t.node, r);
1427
- });
1428
- });
1429
- })) : this.safeSetState({ status: Fr }, function() {
1430
- t.props.onEntered && t.props.onEntered(t.node, r);
1431
- });
1432
- }, n.performExit = function() {
1433
- var e = this, t = this.props.exit, n = this.getTimeouts();
1434
- t ? (this.props.onExit && this.props.onExit(this.node), this.safeSetState({ status: Ir }, function() {
1435
- e.props.onExiting && e.props.onExiting(e.node), e.onTransitionEnd(n.exit, function() {
1436
- e.safeSetState({ status: Nr }, function() {
1437
- e.props.onExited && e.props.onExited(e.node);
1438
- });
1439
- });
1440
- })) : this.safeSetState({ status: Nr }, function() {
1441
- e.props.onExited && e.props.onExited(e.node);
1442
- });
1443
- }, n.cancelNextCallback = function() {
1444
- this.nextCallback !== null && this.nextCallback.cancel && (this.nextCallback.cancel(), this.nextCallback = null);
1445
- }, n.safeSetState = function(e, t) {
1446
- t = this.setNextCallback(t), this.setState(e, t);
1447
- }, n.setNextCallback = function(e) {
1448
- var t = this, n = !0;
1449
- return this.nextCallback = function() {
1450
- n && (n = !1, t.nextCallback = null, e());
1451
- }, this.nextCallback.cancel = function() {
1452
- n = !1;
1453
- }, this.nextCallback;
1454
- }, n.onTransitionEnd = function(e, t) {
1455
- this.setNextCallback(t);
1456
- var n = e == null && !this.props.addEndListener;
1457
- this.node && !n ? (this.props.addEndListener && this.props.addEndListener(this.node, this.nextCallback), e != null && setTimeout(this.nextCallback, e)) : setTimeout(this.nextCallback, 0);
1458
- }, n.render = function() {
1459
- var e = this.state.status;
1460
- if (e === Mr) return null;
1461
- var t = this.props;
1462
- return (0, t.children)(e, Cr(t, [
1463
- "children",
1464
- "in",
1465
- "mountOnEnter",
1466
- "unmountOnExit",
1467
- "appear",
1468
- "enter",
1469
- "exit",
1470
- "timeout",
1471
- "addEndListener",
1472
- "onEnter",
1473
- "onEntering",
1474
- "onEntered",
1475
- "onExit",
1476
- "onExiting",
1477
- "onExited",
1478
- "nodeRef"
1479
- ]));
1480
- }, xr(t, [{
1481
- key: "node",
1482
- get: function() {
1483
- var e = this.props.nodeRef?.current;
1484
- if (!e) throw Error("notistack - Custom snackbar is not refForwarding");
1485
- return e;
1486
- }
1487
- }]), t;
1488
- }(F.Component);
1489
- function Rr() {}
1490
- function zr(e, t) {
1491
- typeof e == "function" ? e(t) : e && (e.current = t);
1492
- }
1493
- function Br(e, t) {
1494
- return B(function() {
1495
- return e == null && t == null ? null : function(n) {
1496
- zr(e, n), zr(t, n);
1497
- };
1498
- }, [e, t]);
1499
- }
1500
- function Vr(e) {
1501
- var t = e.timeout, n = e.style, r = n === void 0 ? {} : n, i = e.mode;
1502
- return {
1503
- duration: typeof t == "object" ? t[i] || 0 : t,
1504
- easing: r.transitionTimingFunction,
1505
- delay: r.transitionDelay
1506
- };
1507
- }
1508
- Lr.defaultProps = {
1509
- in: !1,
1510
- mountOnEnter: !1,
1511
- unmountOnExit: !1,
1512
- appear: !1,
1513
- enter: !0,
1514
- exit: !0,
1515
- onEnter: Rr,
1516
- onEntering: Rr,
1517
- onEntered: Rr,
1518
- onExit: Rr,
1519
- onExiting: Rr,
1520
- onExited: Rr
1521
- };
1522
- var Hr = "cubic-bezier(0.4, 0, 0.2, 1)", Ur = "cubic-bezier(0.0, 0, 0.2, 1)", Wr = "cubic-bezier(0.4, 0, 0.6, 1)", Gr = function(e) {
1523
- e.scrollTop = e.scrollTop;
1524
- }, Kr = function(e) {
1525
- return Math.round(e) + "ms";
1526
- };
1527
- function qr(e, t) {
1528
- e === void 0 && (e = ["all"]);
1529
- var n = t || {}, r = n.duration, i = r === void 0 ? 300 : r, a = n.easing, o = a === void 0 ? Hr : a, s = n.delay, c = s === void 0 ? 0 : s;
1530
- return (Array.isArray(e) ? e : [e]).map(function(e) {
1531
- var t = typeof i == "string" ? i : Kr(i), n = typeof c == "string" ? c : Kr(c);
1532
- return e + " " + t + " " + o + " " + n;
1533
- }).join(",");
1534
- }
1535
- function Jr(e) {
1536
- return function(e) {
1537
- return e && e.ownerDocument || document;
1538
- }(e).defaultView || window;
1539
- }
1540
- function Yr(e, t) {
1541
- if (t) {
1542
- var n = function(e, t) {
1543
- var n, r = t.getBoundingClientRect(), i = Jr(t);
1544
- if (t.fakeTransform) n = t.fakeTransform;
1545
- else {
1546
- var a = i.getComputedStyle(t);
1547
- n = a.getPropertyValue("-webkit-transform") || a.getPropertyValue("transform");
1548
- }
1549
- var o = 0, s = 0;
1550
- if (n && n !== "none" && typeof n == "string") {
1551
- var c = n.split("(")[1].split(")")[0].split(",");
1552
- o = parseInt(c[4], 10), s = parseInt(c[5], 10);
1553
- }
1554
- switch (e) {
1555
- case "left": return "translateX(" + (i.innerWidth + o - r.left) + "px)";
1556
- case "right": return "translateX(-" + (r.left + r.width - o) + "px)";
1557
- case "up": return "translateY(" + (i.innerHeight + s - r.top) + "px)";
1558
- default: return "translateY(-" + (r.top + r.height - s) + "px)";
1559
- }
1560
- }(e, t);
1561
- n && (t.style.webkitTransform = n, t.style.transform = n);
1562
- }
1563
- }
1564
- var Xr = I(function(e, t) {
1565
- var n = e.children, r = e.direction, i = r === void 0 ? "down" : r, a = e.in, o = e.style, s = e.timeout, c = s === void 0 ? 0 : s, l = e.onEnter, u = e.onEntered, d = e.onExit, f = e.onExited, p = Cr(e, [
1566
- "children",
1567
- "direction",
1568
- "in",
1569
- "style",
1570
- "timeout",
1571
- "onEnter",
1572
- "onEntered",
1573
- "onExit",
1574
- "onExited"
1575
- ]), m = V(null), h = Br(Br(n.ref, m), t), g = R(function() {
1576
- m.current && Yr(i, m.current);
1577
- }, [i]);
1578
- return z(function() {
1579
- if (!a && i !== "down" && i !== "right") {
1580
- var e = function(e, t) {
1581
- var n;
1582
- function r() {
1583
- for (var r = this, i = arguments.length, a = Array(i), o = 0; o < i; o++) a[o] = arguments[o];
1584
- clearTimeout(n), n = setTimeout(function() {
1585
- e.apply(r, a);
1586
- }, t);
1587
- }
1588
- return t === void 0 && (t = 166), r.clear = function() {
1589
- clearTimeout(n);
1590
- }, r;
1591
- }(function() {
1592
- m.current && Yr(i, m.current);
1593
- }), t = Jr(m.current);
1594
- return t.addEventListener("resize", e), function() {
1595
- e.clear(), t.removeEventListener("resize", e);
1596
- };
1597
- }
1598
- }, [i, a]), z(function() {
1599
- a || g();
1600
- }, [a, g]), Ot(Lr, Object.assign({
1601
- appear: !0,
1602
- nodeRef: m,
1603
- onEnter: function(e, t) {
1604
- Yr(i, e), Gr(e), l && l(e, t);
1605
- },
1606
- onEntered: u,
1607
- onEntering: function(e) {
1608
- var t = o?.transitionTimingFunction || Ur, n = Vr({
1609
- timeout: c,
1610
- mode: "enter",
1611
- style: Q({}, o, { transitionTimingFunction: t })
1612
- });
1613
- e.style.webkitTransition = qr("-webkit-transform", n), e.style.transition = qr("transform", n), e.style.webkitTransform = "none", e.style.transform = "none";
1614
- },
1615
- onExit: function(e) {
1616
- var t = o?.transitionTimingFunction || Wr, n = Vr({
1617
- timeout: c,
1618
- mode: "exit",
1619
- style: Q({}, o, { transitionTimingFunction: t })
1620
- });
1621
- e.style.webkitTransition = qr("-webkit-transform", n), e.style.transition = qr("transform", n), Yr(i, e), d && d(e);
1622
- },
1623
- onExited: function(e) {
1624
- e.style.webkitTransition = "", e.style.transition = "", f && f(e);
1625
- },
1626
- in: a,
1627
- timeout: c
1628
- }, p), function(e, t) {
1629
- return Dt(n, Q({
1630
- ref: h,
1631
- style: Q({ visibility: e !== "exited" || a ? void 0 : "hidden" }, o, {}, n.props.style)
1632
- }, t));
1633
- });
1634
- });
1635
- Xr.displayName = "Slide";
1636
- var Zr = function(e) {
1637
- return F.createElement("svg", Object.assign({
1638
- viewBox: "0 0 24 24",
1639
- focusable: "false",
1640
- style: {
1641
- fontSize: 20,
1642
- marginInlineEnd: 8,
1643
- userSelect: "none",
1644
- width: "1em",
1645
- height: "1em",
1646
- display: "inline-block",
1647
- fill: "currentColor",
1648
- flexShrink: 0
1649
- }
1650
- }, e));
1651
- }, Qr = {
1652
- maxSnack: 3,
1653
- persist: !1,
1654
- hideIconVariant: !1,
1655
- disableWindowBlurListener: !1,
1656
- variant: "default",
1657
- autoHideDuration: 5e3,
1658
- iconVariant: {
1659
- default: void 0,
1660
- success: F.createElement(function() {
1661
- return F.createElement(Zr, null, F.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\n 10.59L10 14.17L17.59 6.58L19 8L10 17Z" }));
1662
- }, null),
1663
- warning: F.createElement(function() {
1664
- return F.createElement(Zr, null, F.createElement("path", { d: "M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z" }));
1665
- }, null),
1666
- error: F.createElement(function() {
1667
- return F.createElement(Zr, null, F.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,\n 6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,\n 13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z" }));
1668
- }, null),
1669
- info: F.createElement(function() {
1670
- return F.createElement(Zr, null, F.createElement("path", { d: "M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,\n 0 22,12A10,10 0 0,0 12,2Z" }));
1671
- }, null)
1672
- },
1673
- anchorOrigin: {
1674
- vertical: "bottom",
1675
- horizontal: "left"
1676
- },
1677
- TransitionComponent: Xr,
1678
- transitionDuration: {
1679
- enter: 225,
1680
- exit: 195
1681
- }
1682
- }, $r = function(e, t) {
1683
- return function(n, r) {
1684
- return r === void 0 && (r = !1), r ? Q({}, Qr[n], {}, t[n], {}, e[n]) : n === "autoHideDuration" ? (i = e.autoHideDuration, a = t.autoHideDuration, (o = function(e) {
1685
- return typeof e == "number" || e === null;
1686
- })(i) ? i : o(a) ? a : Qr.autoHideDuration) : n === "transitionDuration" ? function(e, t) {
1687
- var n = function(e, t) {
1688
- return t.some(function(t) {
1689
- return typeof e === t;
1690
- });
1691
- };
1692
- return n(e, ["string", "number"]) ? e : n(e, ["object"]) ? Q({}, Qr.transitionDuration, {}, n(t, ["object"]) && t, {}, e) : n(t, ["string", "number"]) ? t : n(t, ["object"]) ? Q({}, Qr.transitionDuration, {}, t) : Qr.transitionDuration;
1693
- }(e.transitionDuration, t.transitionDuration) : e[n] || t[n] || Qr[n];
1694
- var i, a, o;
1695
- };
1696
- };
1697
- function ei(e) {
1698
- return Object.entries(e).reduce(function(e, t) {
1699
- var n, r = t[0], i = t[1];
1700
- return Q({}, e, ((n = {})[r] = yr(i), n));
1701
- }, {});
1702
- }
1703
- var ti = "notistack-SnackbarContainer", ni = "notistack-Snackbar", ri = "notistack-CollapseWrapper", ii = "notistack-MuiContent", ai = function(e) {
1704
- return "notistack-MuiContent-" + e;
1705
- }, oi = ei({
1706
- root: { height: 0 },
1707
- entered: { height: "auto" }
1708
- }), si = "0px", ci = I(function(e, t) {
1709
- var n = e.children, r = e.in, i = e.onExited, a = V(null), o = V(null), s = Br(t, o), c = function() {
1710
- return a.current ? a.current.clientHeight : 0;
1711
- };
1712
- return Ot(Lr, {
1713
- in: r,
1714
- unmountOnExit: !0,
1715
- onEnter: function(e) {
1716
- e.style.height = si;
1717
- },
1718
- onEntered: function(e) {
1719
- e.style.height = "auto";
1720
- },
1721
- onEntering: function(e) {
1722
- var t = c(), n = Vr({
1723
- timeout: 175,
1724
- mode: "enter"
1725
- }), r = n.duration, i = n.easing;
1726
- e.style.transitionDuration = typeof r == "string" ? r : r + "ms", e.style.height = t + "px", e.style.transitionTimingFunction = i || "";
1727
- },
1728
- onExit: function(e) {
1729
- e.style.height = c() + "px";
1730
- },
1731
- onExited: i,
1732
- onExiting: function(e) {
1733
- Gr(e);
1734
- var t = Vr({
1735
- timeout: 175,
1736
- mode: "exit"
1737
- }), n = t.duration, r = t.easing;
1738
- e.style.transitionDuration = typeof n == "string" ? n : n + "ms", e.style.height = si, e.style.transitionTimingFunction = r || "";
1739
- },
1740
- nodeRef: o,
1741
- timeout: 175
1742
- }, function(e, t) {
1743
- return Ot("div", Object.assign({
1744
- ref: s,
1745
- className: lr(oi.root, e === "entered" && oi.entered),
1746
- style: Q({
1747
- pointerEvents: "all",
1748
- overflow: "hidden",
1749
- minHeight: si,
1750
- transition: qr("height")
1751
- }, e === "entered" && { overflow: "visible" }, {}, e === "exited" && !r && { visibility: "hidden" })
1752
- }, t), Ot("div", {
1753
- ref: a,
1754
- className: ri,
1755
- style: {
1756
- display: "flex",
1757
- width: "100%"
1758
- }
1759
- }, n));
1760
- });
1761
- });
1762
- ci.displayName = "Collapse";
1763
- var li = {
1764
- right: "left",
1765
- left: "right",
1766
- bottom: "up",
1767
- top: "down"
1768
- }, ui = function(e) {
1769
- return "anchorOrigin" + Ar(e);
1770
- }, di = function() {};
1771
- function fi(e, t) {
1772
- return e.reduce(function(e, n) {
1773
- return n == null ? e : function() {
1774
- var r = [...arguments], i = [].concat(r);
1775
- t && i.indexOf(t) === -1 && i.push(t), e.apply(this, i), n.apply(this, i);
1776
- };
1777
- }, di);
1778
- }
1779
- var pi = typeof window < "u" ? jt : z;
1780
- function mi(e) {
1781
- var t = V(e);
1782
- return pi(function() {
1783
- t.current = e;
1784
- }), R(function() {
1785
- return t.current.apply(void 0, arguments);
1786
- }, []);
1787
- }
1788
- var hi, gi = I(function(e, t) {
1789
- var n = e.children, r = e.className, i = e.autoHideDuration, a = e.disableWindowBlurListener, o = a !== void 0 && a, s = e.onClose, c = e.id, l = e.open, u = e.SnackbarProps, d = u === void 0 ? {} : u, f = V(), p = mi(function() {
1790
- s && s.apply(void 0, arguments);
1791
- }), m = mi(function(e) {
1792
- s && e != null && (f.current && clearTimeout(f.current), f.current = setTimeout(function() {
1793
- p(null, "timeout", c);
1794
- }, e));
1795
- });
1796
- z(function() {
1797
- return l && m(i), function() {
1798
- f.current && clearTimeout(f.current);
1799
- };
1800
- }, [
1801
- l,
1802
- i,
1803
- m
1804
- ]);
1805
- var h = function() {
1806
- f.current && clearTimeout(f.current);
1807
- }, g = R(function() {
1808
- i != null && m(.5 * i);
1809
- }, [i, m]);
1810
- return z(function() {
1811
- if (!o && l) return window.addEventListener("focus", g), window.addEventListener("blur", h), function() {
1812
- window.removeEventListener("focus", g), window.removeEventListener("blur", h);
1813
- };
1814
- }, [
1815
- o,
1816
- g,
1817
- l
1818
- ]), Ot("div", Object.assign({ ref: t }, d, {
1819
- className: lr(ni, r),
1820
- onMouseEnter: function(e) {
1821
- d.onMouseEnter && d.onMouseEnter(e), h();
1822
- },
1823
- onMouseLeave: function(e) {
1824
- d.onMouseLeave && d.onMouseLeave(e), g();
1825
- }
1826
- }), n);
1827
- });
1828
- gi.displayName = "Snackbar";
1829
- var _i = ei({ root: (hi = {
1830
- display: "flex",
1831
- flexWrap: "wrap",
1832
- flexGrow: 1
1833
- }, hi[Or] = {
1834
- flexGrow: "initial",
1835
- minWidth: "288px"
1836
- }, hi) }), vi = I(function(e, t) {
1837
- var n = e.className, r = Cr(e, ["className"]);
1838
- return F.createElement("div", Object.assign({
1839
- ref: t,
1840
- className: lr(_i.root, n)
1841
- }, r));
1842
- });
1843
- vi.displayName = "SnackbarContent";
1844
- var yi = ei({
1845
- root: {
1846
- backgroundColor: "#313131",
1847
- fontSize: "0.875rem",
1848
- lineHeight: 1.43,
1849
- letterSpacing: "0.01071em",
1850
- color: "#fff",
1851
- alignItems: "center",
1852
- padding: "6px 16px",
1853
- borderRadius: "4px",
1854
- 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)"
1855
- },
1856
- lessPadding: { paddingLeft: "20px" },
1857
- default: { backgroundColor: "#313131" },
1858
- success: { backgroundColor: "#43a047" },
1859
- error: { backgroundColor: "#d32f2f" },
1860
- warning: { backgroundColor: "#ff9800" },
1861
- info: { backgroundColor: "#2196f3" },
1862
- message: {
1863
- display: "flex",
1864
- alignItems: "center",
1865
- padding: "8px 0"
1866
- },
1867
- action: {
1868
- display: "flex",
1869
- alignItems: "center",
1870
- marginLeft: "auto",
1871
- paddingLeft: "16px",
1872
- marginRight: "-8px"
1873
- }
1874
- }), bi = "notistack-snackbar", xi = I(function(e, t) {
1875
- var n = e.id, r = e.message, i = e.action, a = e.iconVariant, o = e.variant, s = e.hideIconVariant, c = e.style, l = e.className, u = a[o], d = i;
1876
- return typeof d == "function" && (d = d(n)), F.createElement(vi, {
1877
- ref: t,
1878
- role: "alert",
1879
- "aria-describedby": bi,
1880
- style: c,
1881
- className: lr(ii, ai(o), yi.root, yi[o], l, !s && u && yi.lessPadding)
1882
- }, F.createElement("div", {
1883
- id: bi,
1884
- className: yi.message
1885
- }, s ? null : u, r), d && F.createElement("div", { className: yi.action }, d));
1886
- });
1887
- xi.displayName = "MaterialDesignContent";
1888
- var Si, Ci, wi, Ti, Ei, Di = L(xi), Oi = ei({ wrappedRoot: {
1889
- width: "100%",
1890
- position: "relative",
1891
- transform: "translateX(0)",
1892
- top: 0,
1893
- right: 0,
1894
- bottom: 0,
1895
- left: 0,
1896
- minWidth: "288px"
1897
- } }), ki = function(e) {
1898
- var t = V(), n = H(!0), r = n[0], i = n[1], a = fi([e.snack.onClose, e.onClose]), o = R(function() {
1899
- t.current = setTimeout(function() {
1900
- i(function(e) {
1901
- return !e;
1902
- });
1903
- }, 125);
1904
- }, []);
1905
- z(function() {
1906
- return function() {
1907
- t.current && clearTimeout(t.current);
1908
- };
1909
- }, []);
1910
- var s, c = e.snack, l = e.classes, u = e.Component, d = u === void 0 ? Di : u, f = B(function() {
1911
- return function(e) {
1912
- e === void 0 && (e = {});
1913
- var t = {
1914
- containerRoot: !0,
1915
- containerAnchorOriginTopCenter: !0,
1916
- containerAnchorOriginBottomCenter: !0,
1917
- containerAnchorOriginTopRight: !0,
1918
- containerAnchorOriginBottomRight: !0,
1919
- containerAnchorOriginTopLeft: !0,
1920
- containerAnchorOriginBottomLeft: !0
1921
- };
1922
- return Object.keys(e).filter(function(e) {
1923
- return !t[e];
1924
- }).reduce(function(t, n) {
1925
- var r;
1926
- return Q({}, t, ((r = {})[n] = e[n], r));
1927
- }, {});
1928
- }(l);
1929
- }, [l]), p = c.open, m = c.SnackbarProps, h = c.TransitionComponent, g = c.TransitionProps, _ = c.transitionDuration, v = c.disableWindowBlurListener, y = c.content, b = Cr(c, [
1930
- "open",
1931
- "SnackbarProps",
1932
- "TransitionComponent",
1933
- "TransitionProps",
1934
- "transitionDuration",
1935
- "disableWindowBlurListener",
1936
- "content",
1937
- "entered",
1938
- "requestClose",
1939
- "onEnter",
1940
- "onEntered",
1941
- "onExit",
1942
- "onExited"
1943
- ]), x = Q({
1944
- direction: (s = b.anchorOrigin, s.horizontal === "center" ? li[s.vertical] : li[s.horizontal]),
1945
- timeout: _
1946
- }, g), S = y;
1947
- typeof S == "function" && (S = S(b.id, b.message));
1948
- var C = [
1949
- "onEnter",
1950
- "onEntered",
1951
- "onExit",
1952
- "onExited"
1953
- ].reduce(function(t, n) {
1954
- var r;
1955
- return Q({}, t, ((r = {})[n] = fi([e.snack[n], e[n]], b.id), r));
1956
- }, {});
1957
- return F.createElement(ci, {
1958
- in: r,
1959
- onExited: C.onExited
1960
- }, F.createElement(gi, {
1961
- open: p,
1962
- id: b.id,
1963
- disableWindowBlurListener: v,
1964
- autoHideDuration: b.autoHideDuration,
1965
- className: lr(Oi.wrappedRoot, f.root, f[ui(b.anchorOrigin)]),
1966
- SnackbarProps: m,
1967
- onClose: a
1968
- }, F.createElement(h, Object.assign({}, x, {
1969
- appear: !0,
1970
- in: p,
1971
- onExit: C.onExit,
1972
- onExited: o,
1973
- onEnter: C.onEnter,
1974
- onEntered: fi([C.onEntered, function() {
1975
- e.snack.requestClose && a(null, "instructed", e.snack.id);
1976
- }], b.id)
1977
- }), S || F.createElement(d, Object.assign({}, b)))));
1978
- }, Ai = {
1979
- default: 20,
1980
- dense: 4
1981
- }, ji = {
1982
- default: 6,
1983
- dense: 2
1984
- }, Mi = "." + ri, Ni = ei({
1985
- root: (Si = {
1986
- boxSizing: "border-box",
1987
- display: "flex",
1988
- maxHeight: "100%",
1989
- position: "fixed",
1990
- zIndex: 1400,
1991
- height: "auto",
1992
- width: "auto",
1993
- transition: qr([
1994
- "top",
1995
- "right",
1996
- "bottom",
1997
- "left",
1998
- "max-width"
1999
- ], {
2000
- duration: 300,
2001
- easing: "ease"
2002
- }),
2003
- pointerEvents: "none"
2004
- }, Si[Mi] = {
2005
- padding: ji.default + "px 0px",
2006
- transition: "padding 300ms ease 0ms"
2007
- }, Si.maxWidth = "calc(100% - " + 2 * Ai.default + "px)", Si[Dr] = {
2008
- width: "100%",
2009
- maxWidth: "calc(100% - 32px)"
2010
- }, Si),
2011
- rootDense: (Ci = {}, Ci[Mi] = { padding: ji.dense + "px 0px" }, Ci),
2012
- top: {
2013
- top: Ai.default - ji.default + "px",
2014
- flexDirection: "column"
2015
- },
2016
- bottom: {
2017
- bottom: Ai.default - ji.default + "px",
2018
- flexDirection: "column-reverse"
2019
- },
2020
- left: (wi = { left: Ai.default + "px" }, wi[Or] = { alignItems: "flex-start" }, wi[Dr] = { left: "16px" }, wi),
2021
- right: (Ti = { right: Ai.default + "px" }, Ti[Or] = { alignItems: "flex-end" }, Ti[Dr] = { right: "16px" }, Ti),
2022
- center: (Ei = {
2023
- left: "50%",
2024
- transform: "translateX(-50%)"
2025
- }, Ei[Or] = { alignItems: "center" }, Ei)
2026
- }), Pi = L(function(e) {
2027
- var t = e.classes, n = t === void 0 ? {} : t, r = e.anchorOrigin, i = e.dense, a = e.children, o = lr(ti, Ni[r.vertical], Ni[r.horizontal], Ni.root, n.containerRoot, n["containerAnchorOrigin" + Ar(r)], i && Ni.rootDense);
2028
- return F.createElement("div", { className: o }, a);
2029
- }), Fi = function(e) {
2030
- return !(typeof e == "string" || kt(e));
2031
- }, Ii = function(e) {
2032
- function t(t) {
2033
- var n = e.call(this, t) || this;
2034
- return n.enqueueSnackbar = function(e, t) {
2035
- if (t === void 0 && (t = {}), e == null) throw Error("enqueueSnackbar called with invalid argument");
2036
- var r = Fi(e) ? e : t, i = Fi(e) ? e.message : e, a = r.key, o = r.preventDuplicate, s = Cr(r, ["key", "preventDuplicate"]), c = jr(a), l = c ? a : (/* @__PURE__ */ new Date()).getTime() + Math.random(), u = $r(s, n.props), d = Q({ id: l }, s, {
2037
- message: i,
2038
- open: !0,
2039
- entered: !1,
2040
- requestClose: !1,
2041
- persist: u("persist"),
2042
- action: u("action"),
2043
- content: u("content"),
2044
- variant: u("variant"),
2045
- anchorOrigin: u("anchorOrigin"),
2046
- disableWindowBlurListener: u("disableWindowBlurListener"),
2047
- autoHideDuration: u("autoHideDuration"),
2048
- hideIconVariant: u("hideIconVariant"),
2049
- TransitionComponent: u("TransitionComponent"),
2050
- transitionDuration: u("transitionDuration"),
2051
- TransitionProps: u("TransitionProps", !0),
2052
- iconVariant: u("iconVariant", !0),
2053
- style: u("style", !0),
2054
- SnackbarProps: u("SnackbarProps", !0),
2055
- className: lr(n.props.className, s.className)
2056
- });
2057
- return d.persist && (d.autoHideDuration = void 0), n.setState(function(e) {
2058
- if (o === void 0 && n.props.preventDuplicate || o) {
2059
- var t = function(e) {
2060
- return c ? e.id === l : e.message === i;
2061
- }, r = e.queue.findIndex(t) > -1, a = e.snacks.findIndex(t) > -1;
2062
- if (r || a) return e;
2063
- }
2064
- return n.handleDisplaySnack(Q({}, e, { queue: [].concat(e.queue, [d]) }));
2065
- }), l;
2066
- }, n.handleDisplaySnack = function(e) {
2067
- return e.snacks.length >= n.maxSnack ? n.handleDismissOldest(e) : n.processQueue(e);
2068
- }, n.processQueue = function(e) {
2069
- var t = e.queue, n = e.snacks;
2070
- return t.length > 0 ? Q({}, e, {
2071
- snacks: [].concat(n, [t[0]]),
2072
- queue: t.slice(1, t.length)
2073
- }) : e;
2074
- }, n.handleDismissOldest = function(e) {
2075
- if (e.snacks.some(function(e) {
2076
- return !e.open || e.requestClose;
2077
- })) return e;
2078
- var t = !1, r = !1;
2079
- e.snacks.reduce(function(e, t) {
2080
- return e + (t.open && t.persist ? 1 : 0);
2081
- }, 0) === n.maxSnack && (r = !0);
2082
- var i = e.snacks.map(function(e) {
2083
- return t || e.persist && !r ? Q({}, e) : (t = !0, e.entered ? (e.onClose && e.onClose(null, "maxsnack", e.id), n.props.onClose && n.props.onClose(null, "maxsnack", e.id), Q({}, e, { open: !1 })) : Q({}, e, { requestClose: !0 }));
2084
- });
2085
- return Q({}, e, { snacks: i });
2086
- }, n.handleEnteredSnack = function(e, t, r) {
2087
- if (!jr(r)) throw Error("handleEnteredSnack Cannot be called with undefined key");
2088
- n.setState(function(e) {
2089
- return { snacks: e.snacks.map(function(e) {
2090
- return e.id === r ? Q({}, e, { entered: !0 }) : Q({}, e);
2091
- }) };
2092
- });
2093
- }, n.handleCloseSnack = function(e, t, r) {
2094
- n.props.onClose && n.props.onClose(e, t, r);
2095
- var i = r === void 0;
2096
- n.setState(function(e) {
2097
- var t = e.snacks, n = e.queue;
2098
- return {
2099
- snacks: t.map(function(e) {
2100
- return i || e.id === r ? e.entered ? Q({}, e, { open: !1 }) : Q({}, e, { requestClose: !0 }) : Q({}, e);
2101
- }),
2102
- queue: n.filter(function(e) {
2103
- return e.id !== r;
2104
- })
2105
- };
2106
- });
2107
- }, n.closeSnackbar = function(e) {
2108
- var t = n.state.snacks.find(function(t) {
2109
- return t.id === e;
2110
- });
2111
- jr(e) && t && t.onClose && t.onClose(null, "instructed", e), n.handleCloseSnack(null, "instructed", e);
2112
- }, n.handleExitedSnack = function(e, t) {
2113
- if (!jr(t)) throw Error("handleExitedSnack Cannot be called with undefined key");
2114
- n.setState(function(e) {
2115
- var r = n.processQueue(Q({}, e, { snacks: e.snacks.filter(function(e) {
2116
- return e.id !== t;
2117
- }) }));
2118
- return r.queue.length === 0 ? r : n.handleDismissOldest(r);
2119
- });
2120
- }, n.enqueueSnackbar, n.closeSnackbar, n.state = {
2121
- snacks: [],
2122
- queue: [],
2123
- contextValue: {
2124
- enqueueSnackbar: n.enqueueSnackbar.bind(wr(n)),
2125
- closeSnackbar: n.closeSnackbar.bind(wr(n))
2126
- }
2127
- }, n;
2128
- }
2129
- return Sr(t, e), t.prototype.render = function() {
2130
- var e = this, t = this.state.contextValue, n = this.props, r = n.domRoot, i = n.children, a = n.dense, o = a !== void 0 && a, s = n.Components, c = s === void 0 ? {} : s, l = n.classes, u = this.state.snacks.reduce(function(e, t) {
2131
- var n, r = Ar(t.anchorOrigin), i = e[r] || [];
2132
- return Q({}, e, ((n = {})[r] = [].concat(i, [t]), n));
2133
- }, {}), d = Object.keys(u).map(function(t) {
2134
- var n = u[t], r = n[0];
2135
- return F.createElement(Pi, {
2136
- key: t,
2137
- dense: o,
2138
- anchorOrigin: r.anchorOrigin,
2139
- classes: l
2140
- }, n.map(function(t) {
2141
- return F.createElement(ki, {
2142
- key: t.id,
2143
- snack: t,
2144
- classes: l,
2145
- Component: c[t.variant],
2146
- onClose: e.handleCloseSnack,
2147
- onEnter: e.props.onEnter,
2148
- onExit: e.props.onExit,
2149
- onExited: fi([e.handleExitedSnack, e.props.onExited], t.id),
2150
- onEntered: fi([e.handleEnteredSnack, e.props.onEntered], t.id)
2151
- });
2152
- }));
2153
- });
2154
- return F.createElement(Er.Provider, { value: t }, i, r ? En(d, r) : d);
2155
- }, xr(t, [{
2156
- key: "maxSnack",
2157
- get: function() {
2158
- return this.props.maxSnack || Qr.maxSnack;
2159
- }
2160
- }]), t;
2161
- }(Et), Li = function() {
2162
- return At(Er);
2163
- }, $ = {
2164
- card: "_card_h0jnt_7",
2165
- actionRoot: "_actionRoot_h0jnt_11",
2166
- icons: "_icons_h0jnt_16",
2167
- expand: "_expand_h0jnt_22",
2168
- expandOpen: "_expandOpen_h0jnt_29",
2169
- stackTraceContainer: "_stackTraceContainer_h0jnt_33",
2170
- paper: "_paper_h0jnt_37",
2171
- checkIcon: "_checkIcon_h0jnt_42",
2172
- button: "_button_h0jnt_47"
2173
- }, Ri = L(I((e, t) => {
2174
- let { id: n, message: r, iconVariant: i, error: a, hideIconVariant: o, ...s } = e, c = P(), { closeSnackbar: l } = Li(), [u, d] = H(!1), f = a ? Sn.collectErrorChain(a, !0)?.[0]?.error : void 0, p = f && !(f instanceof Cn), m = R(() => {
2175
- d((e) => !e);
2176
- }, []), h = R(() => {
2177
- l(n);
2178
- }, [n, l]), g = f?.message;
2179
- return !g && kt(r) && (g = r), g || typeof r != "string" || (g = r), g ||= `Unknown Error: ${r}`, U(vi, {
2180
- ref: t,
2181
- className: ye($.root, "error-snackbar"),
2182
- children: W(Zt, {
2183
- className: $.card,
2184
- style: {
2185
- backgroundColor: "var(--sxl-color-error)",
2186
- color: "var(--sxl-color-error-content)",
2187
- border: "1px solid var(--sxl-color-error)"
2188
- },
2189
- children: [W(Qt, {
2190
- className: $.actionRoot,
2191
- children: [
2192
- o ? null : i?.error,
2193
- U(J, {
2194
- variant: "body2",
2195
- component: "div",
2196
- className: $.typography,
2197
- children: g
2198
- }),
2199
- U("div", { style: { flex: "1 1 auto" } }),
2200
- W("div", {
2201
- className: $.icons,
2202
- children: [p ? U(on, {
2203
- "aria-label": c("toast.showMore"),
2204
- size: "small",
2205
- className: ye($.expand, { [$.expandOpen]: u }),
2206
- onClick: m,
2207
- children: U(A, { iconKey: "ExpandMore" })
2208
- }) : null, U(on, {
2209
- size: "small",
2210
- className: $.expand,
2211
- onClick: h,
2212
- children: U(A, {
2213
- iconKey: "Close",
2214
- style: { transform: "scale(0.8)" }
2215
- })
2216
- })]
2217
- })
2218
- ]
2219
- }), p ? U(en, {
2220
- in: u,
2221
- timeout: "auto",
2222
- children: U("div", {
2223
- className: $.stackTraceContainer,
2224
- style: {
2225
- backgroundColor: "color-mix(in srgb, var(--sxl-color-error) 90%, var(--sxl-color-base-100))",
2226
- borderTop: "1px solid var(--sxl-color-error)"
2227
- },
2228
- children: U(Bt, {
2229
- error: a,
2230
- hideLineNumbers: !0
2231
- })
2232
- })
2233
- }) : null]
2234
- })
2235
- });
2236
- }));
2237
- Ri.displayName = "ToastError";
2238
- var zi = U(() => {
2239
- let e = P();
2240
- return U(Lt, {
2241
- label: "SheetXL",
2242
- description: e("logo.description"),
2243
- children: U(G, {
2244
- component: "a",
2245
- href: "https://www.sheetxl.com",
2246
- target: "_blank",
2247
- rel: "noopener noreferrer",
2248
- sx: {
2249
- display: "inline-flex",
2250
- width: "24px",
2251
- height: "24px",
2252
- marginBottom: "4px",
2253
- marginLeft: "6px",
2254
- cursor: "pointer"
2255
- },
2256
- children: U(Ne, { style: {
2257
- width: "24px",
2258
- height: "24px"
2259
- } })
2260
- })
2261
- });
2262
- }, {}), Bi = L(I((e, t) => {
2263
- let { workbook: n, className: r, logo: i = zi, mainElement: a, startElement: o, endElement: s, ...c } = e, [l, { width: u }] = bt(), d = u < 530, f = V(null), p = le([
2264
- f,
2265
- l,
2266
- t
2267
- ]);
2268
- return U(G, {
2269
- ...c,
2270
- ref: p,
2271
- className: r,
2272
- children: te({
2273
- isCompact: d,
2274
- wrapperSelect: (e) => W(G, {
2275
- sx: {
2276
- display: "grid",
2277
- gridTemplateColumns: "1fr auto 1fr",
2278
- flex: "1",
2279
- alignItems: "stretch",
2280
- gap: (e) => e.spacing(1),
2281
- paddingLeft: (e) => e.spacing(1),
2282
- paddingRight: (e) => e.spacing(1)
2283
- },
2284
- children: [
2285
- W(G, {
2286
- sx: {
2287
- display: "flex",
2288
- flexDirection: "row",
2289
- alignItems: "center",
2290
- justifyContent: "start",
2291
- gap: (e) => e.spacing(.5)
2292
- },
2293
- children: [i, W(G, {
2294
- sx: {
2295
- display: "flex",
2296
- flexDirection: "row",
2297
- alignItems: "center",
2298
- gap: (e) => e.spacing(.25)
2299
- },
2300
- children: [o, e]
2301
- })]
2302
- }),
2303
- U(G, {
2304
- sx: {
2305
- display: "flex",
2306
- flexDirection: "row",
2307
- minWidth: 0,
2308
- overflow: "hidden",
2309
- alignItems: "center",
2310
- justifyContent: "center"
2311
- },
2312
- children: a
2313
- }),
2314
- U(G, {
2315
- sx: {
2316
- display: "flex",
2317
- alignItems: "center",
2318
- justifyContent: "end"
2319
- },
2320
- children: s
2321
- })
2322
- ]
2323
- })
2324
- })
2325
- });
2326
- }));
2327
- Bi.displayName = "StudioToolbar";
2328
- var Vi = (e, t) => {
2329
- let n = new URL(window.location.pathname, window.location.origin);
2330
- e && n.searchParams.set("source", e), e && t && n.searchParams.set("title", t), window.open(n.toString(), "sheetxl-" + yn.uuidV4(), "popup=true");
2331
- };
2332
- function Hi(e, t) {
2333
- let { workbook: n, setWorkbook: r, workbookTitle: i = "export", isDirty: a, notifier: o, refSave: s } = t, c = !1, l = async (e = null, t = null, n = null) => {
2334
- let r = [], i = {
2335
- source: e && typeof e != "string" ? e : null,
2336
- typedCreateWorkbookOptions: t ?? void 0,
2337
- onPassword: async ({ origin: e, validate: t }) => {
2338
- let n = await o.showInput({
2339
- title: Z("dialog.password.title"),
2340
- description: Z("dialog.password.open.description", { name: e.getName() ?? "" }),
2341
- inputType: "password",
2342
- options: [{
2343
- id: "Open",
2344
- label: () => Z("dialog.open")
2345
- }, "Cancel"],
2346
- defaultOption: "Open",
2347
- onValidateInput: async (e, n) => n === void 0 ? { valid: !0 } : e ? await t(e) ? { valid: !0 } : {
2348
- valid: !1,
2349
- message: Z("dialog.password.open.retry")
2350
- } : {
2351
- valid: !1,
2352
- message: Z("dialog.password.open.required")
2353
- }
2354
- });
2355
- return n?.option === "Open" ? n.input ?? null : null;
2356
- },
2357
- progress: { onWarning: (e) => {
2358
- r.push(e);
2359
- } }
2360
- }, a;
2361
- n && (i.progress.onStart = n);
2362
- let s = -5;
2363
- return O.read({
2364
- ...i,
2365
- progress: {
2366
- async onStart(e, t) {
2367
- await i?.progress?.onStart?.(e, t), a = await o?.showBusy?.(Z("workbook.opening", { name: e?.getName() ?? "" })), t && a?.setProgress?.(0, t);
2368
- },
2369
- onProgress(e, t) {
2370
- if (!t) return;
2371
- let n = Math.min(100, Math.round(e / t * 100));
2372
- if (n >= 100) {
2373
- if (s === 100) return;
2374
- s = 100, a?.setProgress?.(e, t);
2375
- } else n - s < 5 || (s = n, a?.setProgress?.(e, t));
2376
- },
2377
- onComplete() {
2378
- a?.(), r.length > 0 && (o.showMessage(Z("workbook.importWarnings")), console.warn("Import warnings:\n" + r.join("\n")));
2379
- },
2380
- onWarning(e, t) {
2381
- i?.progress?.onWarning?.(e, t);
2382
- }
2383
- }
2384
- });
2385
- }, u = async (e, t, n = !1, r) => {
2386
- let a, s = {
2387
- format: t?.key,
2388
- progress: {
2389
- async onStart(e) {
2390
- a = await o?.showBusy?.(Z("workbook.saving", { name: e?.getName() ?? "" }));
2391
- },
2392
- onComplete() {
2393
- a?.();
2394
- }
2395
- },
2396
- onWarnings: r ?? (async ({ warnings: e, origin: t, canCancel: n }) => {
2397
- a?.(), console.warn(`Not written to '${t.getName()}':\n${e.map((e) => ` ${e.message}`).join("\n")}`);
2398
- let r = Z("dialog.writeWarnings.title"), i = t.getFormat(), s = (i ? (await O.getWriteFormats({ search: i }))[0] : void 0)?.description ?? i ?? "", c = Z("dialog.writeWarnings.keep");
2399
- return n ? await o.showOptions({
2400
- title: r,
2401
- type: dt.Warning,
2402
- description: `${Z("dialog.writeWarnings.confirm", { format: s })}\n\n${c}`,
2403
- options: [{
2404
- id: "Save",
2405
- label: () => Z("dialog.save")
2406
- }, "Cancel"],
2407
- defaultOption: "Cancel"
2408
- }) === "Save" && (a = await o?.showBusy?.(Z("workbook.saving", { name: t?.getName() ?? "" })), !0) : (o.showOptions({
2409
- title: r,
2410
- type: dt.Warning,
2411
- description: `${Z("dialog.writeWarnings.saved", { format: s })}\n\n${c}`,
2412
- options: ["Ok"]
2413
- }), !0);
2414
- })
2415
- }, c;
2416
- if (n) {
2417
- let n = e.getOrigin(), r = t?.exts?.[0] ?? (n.getExtension() || "sxl"), a = `${i || n.getName() || Z("workbook.defaultName")}.${r}`;
2418
- c = await O.writeAs(e, a, {
2419
- ...s,
2420
- prompt: !0
2421
- });
2422
- } else c = await O.write(e, void 0, s);
2423
- return c;
2424
- }, d = null;
2425
- return e.updateCommand("newWorkbook", { callback: async (e) => {
2426
- let t = O.canRead() && !a();
2427
- e?.source ? t && d ? await d({
2428
- url: e.source,
2429
- title: e.title
2430
- }) : Vi(e.source, e.title) : t ? r({}) : Vi();
2431
- } }), e.updateCommand("closeWorkbook", { callback: async () => {
2432
- a() && await o.showOptions({
2433
- title: Z("dialog.confirm.title"),
2434
- description: Z("dialog.unsavedChanges"),
2435
- options: [{
2436
- id: "Close",
2437
- label: () => Z("dialog.close")
2438
- }, "Cancel"],
2439
- defaultOption: "Cancel"
2440
- }) !== "Close" || window.close();
2441
- } }), (async () => {
2442
- let t = await O.getWriteFormats();
2443
- if (c) return;
2444
- let i = O.canWrite(), f = O.canRead();
2445
- if (i) {
2446
- let r = (e) => {
2447
- let r = e ? t.find((t) => t.key === e) : void 0;
2448
- u(n, r, !0).catch((e) => o.showError(e));
2449
- };
2450
- e.updateCommand("saveWorkbook", { callback: () => {
2451
- u(n, void 0, !1).catch((e) => o.showError(e));
2452
- } }), s && (s.current = (e) => u(n, void 0, !1, e?.onWarnings)), e.updateCommand("saveWorkbookAs", { callback: (e) => {
2453
- r(e);
2454
- } });
2455
- for (let n of t) {
2456
- let t = n.key;
2457
- e.updateCommand(`saveWorkbookAs${t}`, {
2458
- label: () => Z("command.saveAsFormat.label", { format: n.description }),
2459
- groupLabels: {
2460
- workbook: () => Z("command.saveAsFormat.workbook", { format: n.description }),
2461
- saveWorkbookOptions: () => Z("command.saveAsFormat.compact", { format: n.description })
2462
- },
2463
- tags: n.tags,
2464
- description: () => Z("command.saveAsFormat", { format: n.description }),
2465
- icon: t === "CSV" ? "FileDownloadAsCSV" : t === "Excel" ? "FileDownloadAsExcel" : "FileDownloadAsSheet",
2466
- callback: () => {
2467
- r(t);
2468
- }
2469
- });
2470
- }
2471
- }
2472
- let p = async (e = null) => {
2473
- let t = { csv: {
2474
- date1904: n.getRuntime().isDate1904(),
2475
- ...n.options
2476
- } };
2477
- try {
2478
- let r = "", i = await l(e, t, async (e) => {
2479
- r = e?.getName() ?? "";
2480
- });
2481
- if (!i) return;
2482
- let a = i.getSheets().getItems();
2483
- await n.doBatch(async () => {
2484
- for (let e = 0; e < a.length; e++) {
2485
- let t = a[e], i = a.length === 1 ? r : t.getName(), o = n.findValidSheetName(i);
2486
- await n.getSheets().add({
2487
- name: o,
2488
- autoSelect: e === a.length - 1
2489
- }).getEntireRange().copyFrom(t.getEntireRange());
2490
- }
2491
- }, X("op.importData")), i.close();
2492
- } catch (e) {
2493
- o.showError(e);
2494
- }
2495
- };
2496
- if (e.updateCommand("insertDataFromFile", {
2497
- tags: ["noTransaction", "noRepeat"],
2498
- callback: async (e = null) => {
2499
- let t = e;
2500
- if (t || O.canRead() || (t = await (async () => {
2501
- let e = await O.getReadFormats(), t = [...new Set(e.flatMap((e) => e.exts))].map((e) => `.${e}`);
2502
- return bn.openFileDialog(t.length ? t.join(",") : "*.*");
2503
- })(), t)) return p(t);
2504
- }
2505
- }), e.updateCommand("insertDataFromURL", {
2506
- tags: ["noTransaction", "noRepeat"],
2507
- callback: async (e) => {
2508
- if (!e) {
2509
- let t = await o.showInput({
2510
- title: Z("dialog.importFromWeb.title"),
2511
- description: Z("dialog.importFromWeb.description"),
2512
- inputLabel: Z("dialog.webAddress.inputLabel"),
2513
- initialValue: "https://www.sheetxl.com/docs/examples/financial-calculators.xlsx",
2514
- propsInput: { style: { minWidth: "440px" } },
2515
- options: [{
2516
- id: "Import",
2517
- label: () => Z("dialog.import")
2518
- }]
2519
- });
2520
- if (t.option !== "Import") return;
2521
- e = t.input;
2522
- }
2523
- if (e) try {
2524
- let t = await fetch(e);
2525
- if (!t.ok) throw Error(`Could not fetch '${e}' (${t.status} ${t.statusText}).`);
2526
- let n = await t.blob(), r = decodeURIComponent(e.split("/").pop()?.split("?")[0] || "") || "import.xlsx";
2527
- await p(new File([n], r, { type: n.type }));
2528
- } catch (e) {
2529
- o.showError(e);
2530
- }
2531
- }
2532
- }), f) {
2533
- let t = async () => !a() || await o.showOptions({
2534
- title: Z("dialog.confirm.title"),
2535
- description: Z("dialog.unsavedChanges"),
2536
- options: [{
2537
- id: "Open",
2538
- label: () => Z("dialog.open")
2539
- }, "Cancel"],
2540
- defaultOption: "Cancel"
2541
- }) === "Open", i = async (e = null) => {
2542
- let t = { csv: {
2543
- date1904: n.getRuntime().isDate1904(),
2544
- ...n.options
2545
- } };
2546
- try {
2547
- let n = await l(e, t);
2548
- if (!n) return;
2549
- r(n);
2550
- } catch (e) {
2551
- o.showError(e);
2552
- }
2553
- };
2554
- e.updateCommand("openWorkbook", { callback: async (e = null) => {
2555
- await t() && await i(e);
2556
- } }), d = async (e) => {
2557
- let n = typeof e == "string" ? e : e?.url, r = typeof e == "string" ? void 0 : e?.title;
2558
- if (!n) {
2559
- let e = await o.showInput({
2560
- title: Z("dialog.openFromWeb.title"),
2561
- description: Z("dialog.openFromWeb.description"),
2562
- inputLabel: Z("dialog.webAddress.inputLabel"),
2563
- initialValue: "https://www.sheetxl.com/docs/examples/financial-calculators.xlsx",
2564
- propsInput: { style: { minWidth: "440px" } },
2565
- options: [{
2566
- id: "Open",
2567
- label: () => Z("dialog.open")
2568
- }]
2569
- });
2570
- if (e.option !== "Open") return;
2571
- n = e.input;
2572
- }
2573
- if (n && await t()) try {
2574
- let e = await fetch(n);
2575
- if (!e.ok) throw Error(`Could not fetch '${n}' (${e.status} ${e.statusText}).`);
2576
- let t = await e.blob(), a = decodeURIComponent(n.split("/").pop()?.split("?")[0] || "") || "workbook.xlsx", o = a.match(/\.[^/.]+$/)?.[0] ?? "", s = r ? `${r}${o}` : a;
2577
- await i(new File([t], s, { type: t.type }));
2578
- } catch (e) {
2579
- o.showError(e);
2580
- }
2581
- }, e.updateCommand("openWorkbookFromUrl", { callback: d });
2582
- }
2583
- })(), () => {
2584
- c = !0, s && (s.current = null);
2585
- };
2586
- }
2587
- var Ui = Wt(Y("studio:shortcutKeysDialog", () => import("./X1Db3b_7b_7OuCk6.mjs")).load);
2588
- se(), me();
2589
- var Wi = /* @__PURE__ */ new Set(["ui"]), Gi = (e) => {
2590
- let t = (e) => {
2591
- if (typeof e != "function") return e;
2592
- try {
2593
- return e();
2594
- } catch {
2595
- return;
2596
- }
2597
- }, n = (e, n) => {
2598
- let r = t(e);
2599
- return typeof r == "string" ? Tn(r, n, xn.getActive()) : void 0;
2600
- }, r = [];
2601
- for (let i of e.names()) if (!Wi.has(i)) for (let a of e.keys(i)) {
2602
- let o = e.resolveDefinition(i, a);
2603
- r.push({
2604
- groupKey: i,
2605
- command: {
2606
- getLabel: () => n(o?.label, o?.params) ?? a,
2607
- getIcon: () => t(o?.icon),
2608
- getDescription: () => n(o?.description, o?.params) ?? "",
2609
- getShortcut: () => t(o?.shortcut) ?? null,
2610
- getScope: () => i,
2611
- getScopeLabel: () => st.DefaultCommandCatalogService.getScopeLabel(i)
2612
- }
2613
- });
2614
- }
2615
- return { getAllCommands: () => r };
2616
- }, Ki = (e) => {
2617
- let { children: t, workbook: n, setWorkbook: r, workbookTitle: i, isDirty: a, refSave: o, fullscreenTarget: s } = e, c = st.useCommandScope(), l = xt(), { showModal: u } = Jt(), d = P(), f = V(a);
2618
- f.current = a;
2619
- let p = vt(() => {
2620
- let e = c?.getRoot().getRegistry();
2621
- if (!e) return;
2622
- let t = u(Ui, {
2623
- title: d("dialog.shortcutKeys.title"),
2624
- commands: Gi(e),
2625
- onDone: () => t.hide(),
2626
- onLoadError: (e) => {
2627
- t.destroy(), l.showError(e);
2628
- }
2629
- });
2630
- }, [c, u]);
2631
- z(() => {
2632
- if (!c) return;
2633
- let e = c.getRoot().contribution();
2634
- return function(e, t) {
2635
- let n = () => t.showShortcuts();
2636
- e.updateCommand("showKeyboardShortcuts", { callback: n }), e.updateCommand("help", { callback: n });
2637
- for (let [t, n] of Object.entries({
2638
- gotoUrlGithub: "https://github.com/sheetxl/sheetxl",
2639
- gotoUrlDiscord: "https://discord.gg/NTKdwUgK9p",
2640
- gotoUrlDocumentation: "https://www.sheetxl.com/docs",
2641
- gotoUrlIssue: "https://github.com/sheetxl/sheetxl/issues"
2642
- })) e.updateCommand(t, { callback: () => {
2643
- window?.open(n);
2644
- } });
2645
- }(e, { showShortcuts: p }), () => e.remove();
2646
- }, [c, p]);
2647
- let m = _n("(prefers-color-scheme: dark)"), { themeMode: h } = Ct(), [g, _] = St(ze.Mode, Re[ze.Mode]), [v, y] = St(ze.DarkGrid, Re[ze.DarkGrid]), [b, x] = St(ze.DarkImages, Re[ze.DarkImages]);
2648
- z(() => {
2649
- if (!c) return;
2650
- let e = c.getRoot().contribution();
2651
- return function(e, t) {
2652
- e.updateCommand("themeMode", {
2653
- state: t.mode ?? null,
2654
- params: { dark: t.isDark },
2655
- icon: t.isDark ? "DarkMode" : "LightMode",
2656
- callback: () => t.setMode(t.isDark ? "light" : "dark")
2657
- }), e.updateCommand("defaultThemeMode", {
2658
- state: !t.mode,
2659
- icon: t.systemDefaultDark ? "SystemDefaultDarkMode" : "SystemDefaultLightMode",
2660
- callback: () => t.setMode(null)
2661
- }), e.updateCommand("enableDarkGrid", {
2662
- state: t.enableDarkGrid,
2663
- callback: () => t.setEnableDarkGrid((e) => !e)
2664
- }), e.updateCommand("enableDarkImages", {
2665
- state: t.enableDarkImages,
2666
- callback: () => t.setEnableDarkImages((e) => !e)
2667
- });
2668
- }(e, {
2669
- mode: g,
2670
- setMode: _,
2671
- isDark: g === "dark" || !g && h === "dark",
2672
- systemDefaultDark: m,
2673
- enableDarkGrid: v,
2674
- setEnableDarkGrid: y,
2675
- enableDarkImages: b,
2676
- setEnableDarkImages: x
2677
- }), () => e.remove();
2678
- }, [
2679
- c,
2680
- g,
2681
- h,
2682
- m,
2683
- v,
2684
- b,
2685
- _,
2686
- y,
2687
- x
2688
- ]);
2689
- let [S, C] = St(ut.Active, null), [ee, te] = H(() => xn.getActive());
2690
- z(() => xn.addChangeListener(te), []), z(() => {
2691
- S && S !== xn.getActive() && xn.setActive(S);
2692
- }, [S]), z(() => {
2693
- if (!c) return;
2694
- let e = c.getRoot().contribution();
2695
- return function(e, t) {
2696
- e.updateCommand("language", {
2697
- state: t.active,
2698
- callback: (e) => {
2699
- e && t.setActive(e);
2700
- }
2701
- });
2702
- }(e, {
2703
- active: ee,
2704
- setActive: (e) => {
2705
- C(e);
2706
- }
2707
- }), () => e.remove();
2708
- }, [
2709
- c,
2710
- ee,
2711
- C
2712
- ]);
2713
- let ne = B(() => ({ current: s ?? null }), [s]), { isFullscreenAvailable: re, isFullscreenEnabled: ie, toggleFullscreen: ae } = M({ target: ne });
2714
- z(() => {
2715
- if (!c) return;
2716
- let e = c.getRoot().contribution();
2717
- return function(e, t) {
2718
- e.updateCommand("fullScreenToggle", {
2719
- state: t.isFullscreenEnabled,
2720
- disabledReasons: t.isFullscreenAvailable ? [] : [X("reason.fullscreenUnavailable")],
2721
- icon: t.isFullscreenEnabled ? "FullScreenOff" : "FullScreen",
2722
- callback: () => {
2723
- t.toggleFullscreen();
2724
- }
2725
- });
2726
- }(e, {
2727
- isFullscreenAvailable: re,
2728
- isFullscreenEnabled: ie,
2729
- toggleFullscreen: ae
2730
- }), () => e.remove();
2731
- }, [
2732
- c,
2733
- re,
2734
- ie,
2735
- ae
2736
- ]);
2737
- let oe = nt(!0);
2738
- return z(() => {
2739
- if (!c) return;
2740
- let e = c.getRoot().contribution();
2741
- return function(e, t) {
2742
- e.updateCommand("protectWorkbook", {
2743
- tags: ["noTransaction", "noRepeat"],
2744
- callback: () => {
2745
- t("manageProtection", { args: { tab: "workbook" } });
2746
- }
2747
- });
2748
- }(e, (e, t) => oe.activate(e, t)), () => e.remove();
2749
- }, [c, oe]), z(() => {
2750
- if (!c || !n) return;
2751
- let e = c.getRoot().contribution(), t = Hi(e, {
2752
- workbook: n,
2753
- setWorkbook: r,
2754
- workbookTitle: i ?? void 0,
2755
- isDirty: () => f.current?.() ?? !1,
2756
- notifier: l,
2757
- refSave: o
2758
- });
2759
- return () => {
2760
- t(), e.remove();
2761
- };
2762
- }, [
2763
- c,
2764
- n,
2765
- r,
2766
- i,
2767
- l,
2768
- o
2769
- ]), t;
2770
- };
2771
- Ki.displayName = "StudioCommandProvider";
2772
- var qi = ({ renderWorkbook: e }) => {
2773
- let t = st.useCommandResolver(), n = V(null), r = P(), [i, a] = H(null), o = R((e) => {
2774
- let n = e.dataTransfer;
2775
- if (t && n) {
2776
- if (e.type === "dragenter" || e.type === "dragover") {
2777
- let e = n.types, t = n.items, r = !1;
2778
- for (let e = 0; e < t.length; e++) if (t[e].type.startsWith("image/")) {
2779
- r = !0;
2780
- break;
2781
- }
2782
- r ? a("insertImage") : e.includes("Files") && t.length > 0 ? a("open") : (n.effectAllowed = "none", n.dropEffect = "none");
2783
- } else if (e.type === "dragleave") {
2784
- let t = e.relatedTarget;
2785
- t && e.currentTarget.contains(t) || a(null);
2786
- }
2787
- e.preventDefault();
2788
- }
2789
- }, [t]), s = vt((e) => {
2790
- e.preventDefault();
2791
- let r = i;
2792
- if (a(null), r && t && (e.stopPropagation(), e.dataTransfer.files && e.dataTransfer.files.length > 0)) {
2793
- let r = e.dataTransfer.files[0];
2794
- if (!r) return;
2795
- if (r?.type?.startsWith("image/")) {
2796
- let i = n.current?.getSheetElement()?.getGridSurface().getPaneFromClient(e.clientX, e.clientY);
2797
- if (!i) return;
2798
- let a = i.getPanePointFromPointer(e.clientX, e.clientY);
2799
- if (!a) return;
2800
- let o = i.toAbsoluteBounds({
2801
- x: a.x ?? 0,
2802
- y: a.y ?? 0,
2803
- width: 0,
2804
- height: 0
2805
- });
2806
- t.execute("insertImageFromFile", {
2807
- file: r,
2808
- options: { bounds: {
2809
- x: o.x,
2810
- y: o.y
2811
- } }
2812
- });
2813
- } else {
2814
- if (!O.canRead()) return;
2815
- let n = e.dataTransfer.items?.[0], i = typeof window < "u" && window.isSecureContext ? n?.getAsFileSystemHandle?.() : void 0;
2816
- i ? i.then((e) => t.execute("openWorkbook", e?.kind === "file" ? e : r)).catch(() => t.execute("openWorkbook", r)) : t.execute("openWorkbook", r);
2817
- }
2818
- }
2819
- }, [t, i]), c = B(() => {
2820
- if (!i) return null;
2821
- let e = i === "insertImage";
2822
- return U(G, {
2823
- className: "drop-overlay",
2824
- sx: {
2825
- position: "absolute",
2826
- inset: 0,
2827
- zIndex: 1,
2828
- boxSizing: "border-box",
2829
- pointerEvents: "none",
2830
- display: "flex",
2831
- justifyContent: "center",
2832
- alignItems: "center",
2833
- backgroundColor: (e) => gn(e.palette.primary.main, .46),
2834
- outline: (e) => `2px dashed ${e.palette.primary.main}`,
2835
- outlineOffset: "-6px",
2836
- borderRadius: 2
2837
- },
2838
- children: W(cn, {
2839
- elevation: 6,
2840
- sx: {
2841
- display: "flex",
2842
- alignItems: "center",
2843
- gap: 1.5,
2844
- px: 3,
2845
- py: 2,
2846
- borderRadius: 2,
2847
- color: "text.primary",
2848
- "& .drop-overlay-icon": { color: "primary.main" }
2849
- },
2850
- children: [U(A, {
2851
- iconKey: e ? "InsertImage" : "FileOpen",
2852
- className: "drop-overlay-icon",
2853
- size: 32
2854
- }), U(J, {
2855
- variant: "h6",
2856
- component: "span",
2857
- children: r(e ? "drop.insertImage" : "drop.open")
2858
- })]
2859
- })
2860
- });
2861
- }, [i, r]);
2862
- return W(Xt, { children: [e({
2863
- ref: n,
2864
- onDragStart: (e) => {
2865
- if (e.target.src) {
2866
- let t = new Image();
2867
- t.src = e.target.src, e.dataTransfer.setDragImage(t, 1, 1);
2868
- }
2869
- },
2870
- onDragEnter: o,
2871
- onDragLeave: o,
2872
- onDragOver: o,
2873
- onDrop: s
2874
- }), c] });
2875
- }, Ji = L((e) => {
2876
- let { workbook: t, setWorkbook: n, refDocumentTitle: r, titleWorkbook: i, setWorkbookTitle: a, isDirty: o, initialCommandAnchor: s, renderWorkbook: c, refSave: l, host: u } = e;
2877
- return U(Oe, {
2878
- initialAnchor: s,
2879
- children: U(Ki, {
2880
- workbook: t,
2881
- setWorkbook: n,
2882
- workbookTitle: i,
2883
- isDirty: o,
2884
- refSave: l,
2885
- fullscreenTarget: u,
2886
- children: U(qi, { renderWorkbook: c })
2887
- })
2888
- });
2889
- });
2890
- Ji.displayName = "CommandsWrapper";
2891
- var Yi = {
2892
- sort: Y("studio:sortDialog", () => import("./DHY19rkSiiRZxShC.mjs")).load,
2893
- hyperlink: Y("studio:hyperlinkDialog", () => import("./CtEFHbzYNvYjDYvi.mjs")).load,
2894
- find: Y("studio:findReplaceWindow", () => import("./ByeL_BZuJ2kl8gtf.mjs")).load,
2895
- tableNew: Y("studio:tableNewDialog", () => import("./Blaj2R5hYxtLAW__.mjs")).load,
2896
- namedDetails: Y("studio:namedReferenceDialog", () => import("./CEvZe2cZK-voZTif.mjs")).load,
2897
- insertFunction: Y("studio:insertFunctionDialog", () => import("./DU3J8Gcf-WpBxNYg.mjs")).load,
2898
- resizeHeader: Y("studio:resizeHeaderDialog", () => import("./9eKCkvqpMQwqcXiw.mjs")).load,
2899
- outlineSettings: Y("studio:outlineSettingsDialog", () => import("./yZxC4qUENOlMhVUH.mjs")).load,
2900
- fillSeries: Y("studio:fillSeriesDialog", () => import("./sFOAxZpxXo-qvDSp.mjs")).load,
2901
- workbookStatistics: Y("studio:workbookStatisticsDialog", () => import("./D8al_cJ4U-NgzwoK.mjs")).load,
2902
- password: Y("studio:passwordDialog", () => import("./index.mjs").then((e) => e.t)).load
2903
- }, Xi = ["find"], Zi = L((e) => {
2904
- let { children: t } = e, n = Li(), r = n ? n.enqueueSnackbar : () => {}, i = n ? n.closeSnackbar : () => {}, a = V(/* @__PURE__ */ new Set()), o = V(null), s = V(null), [c, l] = H({
2905
- label: null,
2906
- progress: null
2907
- }), u = P(), d = yn.EmptyObject, f = qt(d), p = Yt(d), m = Kt(d), h = V(!1);
2908
- z(() => {
2909
- if (h.current) return;
2910
- h.current = !0;
2911
- let e = window, t = e.requestIdleCallback ?? ((e) => setTimeout(e, 500)), n = e.cancelIdleCallback ?? clearTimeout, r = t(() => {
2912
- for (let e of Xi) f(e, Yi[e], { prewarm: !0 }).catch(() => {});
2913
- });
2914
- return () => n(r);
2915
- }, []);
2916
- let g = V(/* @__PURE__ */ new Set()), _ = B(() => {
2917
- let e = (e, t) => {
2918
- if (t?.onceKey) {
2919
- if (g.current.has(t.onceKey)) return;
2920
- let e = new Set(g.current);
2921
- e.add(t.onceKey), g.current = e;
2922
- }
2923
- let n = {
2924
- variant: t?.type ?? dt.Info,
2925
- anchorOrigin: {
2926
- vertical: "top",
2927
- horizontal: "center"
2928
- },
2929
- preventDuplicate: t?.preventDuplicate,
2930
- persist: t?.persist ?? t?.type === dt.Error,
2931
- action: (e) => U(on, {
2932
- onClick: () => i(e),
2933
- children: U(A, { iconKey: "Cancel" })
2934
- })
2935
- };
2936
- t?.enqueueProps && Object.assign(n, t.enqueueProps), e || console.log("message is 'null'", t), r(e ?? "Alert", n);
2937
- }, t = {
2938
- showMessage: e,
2939
- showBusy: (e, t) => {
2940
- let n = Symbol("busy");
2941
- a.current.add(n), s.current = e, e != null && typeof e != "string" && l((t) => t.label === e ? t : {
2942
- ...t,
2943
- label: e
2944
- });
2945
- let r = j(() => {
2946
- a.current.delete(n) && (a.current.size > 0 || (Ut(o.current), s.current = null, l((e) => e.label === null && e.progress === null ? e : {
2947
- label: null,
2948
- progress: null
2949
- })));
2950
- }, (e, t) => {
2951
- let n = t && t > 0 && e != null ? Math.max(0, Math.min(1, e / t)) : null;
2952
- l((e) => e.progress === n ? e : {
2953
- ...e,
2954
- progress: n
2955
- });
2956
- }, (e) => {
2957
- s.current = e, typeof e == "string" ? Gt(o.current, e) : l((t) => ({
2958
- ...t,
2959
- label: e
2960
- }));
2961
- }), i = Gt(o.current, typeof e == "string" ? e : void 0);
2962
- return i ? i.then(() => r) : r;
2963
- },
2964
- showWindow: (e, t) => {
2965
- let n = t;
2966
- return t = {
2967
- ...t,
2968
- onKeyDown: (e) => {
2969
- e.isDefaultPrevented() || e.isPropagationStopped() || n?.onKeyDown?.(e);
2970
- }
2971
- }, f(e, Yi[e], t);
2972
- },
2973
- showOptions: p,
2974
- showInput: m,
2975
- showError: (t) => {
2976
- let n, r = dt.Error, i = u("error.unknown");
2977
- typeof t == "string" ? i = t : t instanceof Error && (n = t, t.message && (i = u(t.message))), t instanceof wn && (r = dt.Info), e(i, {
2978
- type: r,
2979
- enqueueProps: { error: n }
2980
- });
2981
- }
2982
- }, n = new lt();
2983
- return n.setOverrides(t), n;
2984
- }, [u]), v = B(() => U(Mt, {
2985
- ref: o,
2986
- autoStart: !1,
2987
- icon: U(Nt, { sx: {
2988
- transform: "scale(0.7)",
2989
- marginLeft: "-6px"
2990
- } }),
2991
- panel: !0,
2992
- label: c.label ?? (typeof s.current == "string" ? s.current : void 0),
2993
- progress: c.progress,
2994
- sx: {
2995
- position: "absolute",
2996
- left: "0",
2997
- top: "0",
2998
- width: "100%",
2999
- height: "100%",
3000
- zIndex: "9999",
3001
- pointerEvents: "none"
3002
- }
3003
- }), [c.label, c.progress]);
3004
- return W(pt, {
3005
- notifier: _,
3006
- children: [v, t]
3007
- });
3008
- });
3009
- Zi.displayName = "StudioNotifierProvider";
3010
- var Qi = "var(--sxl-color-input-border, light-dark(rgba(0, 0, 0, 0.2), rgba(255, 255, 255, 0.2)))", $i = L(I((e, t) => {
3011
- let { children: n, title: r, taskPanes: i, onSelect: a, selected: o, registry: s = Ae, style: c, iconsOnly: l, side: u = "right", className: d, ...f } = e, p = u !== "right", m = N(), h = B(() => i.map((t) => {
3012
- let n = s.getRegisteredTaskPane(t);
3013
- if (!n) return null;
3014
- let r = n.getIcon?.();
3015
- typeof r == "string" && (r = U(A, { iconKey: r }));
3016
- let i = t === o, a = r ? U(G, {
3017
- sx: {
3018
- display: "inline-block",
3019
- transform: p ? "rotate(-90deg)" : "rotate(90deg)",
3020
- transformOrigin: "center",
3021
- color: (e) => e.palette.text.secondary
3022
- },
3023
- children: r
3024
- }) : null, c = !r || !l && i, u = U(G, {
3025
- sx: {
3026
- display: "grid",
3027
- gridTemplateColumns: c ? "1fr" : "0fr",
3028
- opacity: +!!c,
3029
- transition: (e) => e.transitions.create(["grid-template-columns", "opacity"], { duration: e.transitions.duration.short })
3030
- },
3031
- children: U(G, {
3032
- sx: {
3033
- overflow: "hidden",
3034
- minWidth: 0,
3035
- minHeight: 0
3036
- },
3037
- children: U(J, {
3038
- component: "div",
3039
- sx: {
3040
- textTransform: "none",
3041
- whiteSpace: "nowrap",
3042
- transform: p ? "rotate(180deg)" : void 0,
3043
- padding: "4px 0px",
3044
- color: (e) => i ? e.palette.primary.main : e.palette.text.secondary
3045
- },
3046
- children: n.getTitle()
3047
- })
3048
- })
3049
- });
3050
- return U(dn, {
3051
- value: t,
3052
- label: U(zt, {
3053
- disableInteractive: !0,
3054
- title: n.getTitle() ?? "",
3055
- placement: "left-start",
3056
- children: W(G, {
3057
- sx: {
3058
- padding: "0px 0px",
3059
- writingMode: p ? "vertical-lr" : "vertical-rl",
3060
- textOrientation: "mixed",
3061
- display: "flex",
3062
- alignItems: "center",
3063
- justifyContent: "space-between",
3064
- minWidth: "0px",
3065
- color: (e) => e.palette.text.secondary
3066
- },
3067
- children: [p ? u : a, p ? a : u]
3068
- })
3069
- }),
3070
- sx: {
3071
- padding: "4px 4px",
3072
- minWidth: "0px",
3073
- minHeight: "0px",
3074
- borderRadius: "4px"
3075
- },
3076
- className: ye("taskpane-strip-item", { "Mui-selected": i }),
3077
- onClick: () => e.onSelect(t)
3078
- }, t);
3079
- }), [
3080
- i,
3081
- o,
3082
- a,
3083
- s,
3084
- p,
3085
- l,
3086
- m
3087
- ]), g = yt(t, () => ({ isTaskPaneStrip: () => !0 }), []), _ = B(() => ye("taskpane-strip", d), [d]);
3088
- return U(G, {
3089
- ref: g,
3090
- className: _,
3091
- sx: {
3092
- paddingLeft: p ? void 0 : "2px",
3093
- paddingRight: p ? "2px" : void 0,
3094
- paddingTop: "4px",
3095
- ...c
3096
- },
3097
- ...f,
3098
- children: U(fn, {
3099
- orientation: "vertical",
3100
- variant: "scrollable",
3101
- value: o,
3102
- onChange: (e, t) => {
3103
- a(t);
3104
- },
3105
- slotProps: {
3106
- list: { sx: { gap: "2px" } },
3107
- indicator: { sx: {
3108
- left: p ? void 0 : "0px",
3109
- right: p ? void 0 : "unset",
3110
- bottom: p ? "0px" : void 0
3111
- } }
3112
- },
3113
- children: h
3114
- })
3115
- });
3116
- })), ea = (e) => {
3117
- let { title: t, icon: n, onClose: r, readOnly: i, focused: a, ...o } = e, s = V(null), c = P();
3118
- return U(nn, {
3119
- className: ye({ "Mui-selected": a }),
3120
- sx: {
3121
- display: "flex",
3122
- flex: "1 1 %0",
3123
- color: (e) => e.palette.text.secondary,
3124
- boxSizing: "border-box",
3125
- padding: "0 0",
3126
- transitionProperty: "opacity",
3127
- transitionDuration: (e) => `${e.transitions.duration.shortest}ms`,
3128
- opacity: .7,
3129
- "&.Mui-selected": {
3130
- opacity: 1,
3131
- transitionDuration: (e) => e.transitions.duration.shortest / 2 + "ms"
3132
- },
3133
- backgroundColor: (e) => gn(e.palette.action.hover, .03),
3134
- borderBottom: `solid ${Qi} 1px`
3135
- },
3136
- ...o,
3137
- children: W(G, {
3138
- sx: {
3139
- display: "flex",
3140
- flex: "1 1 10%",
3141
- flexDirection: "row",
3142
- alignItems: "center",
3143
- marginTop: (e) => e.spacing(.25),
3144
- marginBottom: (e) => e.spacing(.25),
3145
- marginLeft: (e) => e.spacing(1),
3146
- marginRight: (e) => e.spacing(1)
3147
- },
3148
- children: [U(G, {
3149
- sx: {
3150
- flex: "1 1 100%",
3151
- paddingLeft: (e) => e.spacing(1)
3152
- },
3153
- children: t
3154
- }), U(Lt, {
3155
- label: c("taskPane.close"),
3156
- children: U(on, {
3157
- "aria-label": "close",
3158
- sx: { color: (e) => e.palette.text.icon ?? e.palette.action.active },
3159
- touchRippleRef: s,
3160
- onPointerDown: (e) => {
3161
- s.current?.start(e, { center: !1 }), e.stopPropagation(), e.preventDefault();
3162
- },
3163
- onPointerUp: () => {
3164
- r();
3165
- },
3166
- children: U(A, { iconKey: "Close" })
3167
- })
3168
- })]
3169
- })
3170
- });
3171
- }, ta = I((e, t) => {
3172
- let { model: n, side: r, ...i } = e, a = vn(), o = `solid ${Qi} 1px`, s = `${a.shape.borderRadius ?? 4}px`, c = `${a.spacing?.(.5) ?? 4}px`;
3173
- return U(Ie, {
3174
- model: n,
3175
- ref: t,
3176
- propsFrame: { style: {
3177
- border: o,
3178
- borderRadius: s,
3179
- marginBottom: c
3180
- } },
3181
- alwaysShowStrip: !0,
3182
- componentTitle: ea,
3183
- componentStrip: $i,
3184
- side: r,
3185
- ...e,
3186
- onOpen: () => {
3187
- e?.onOpen?.();
3188
- },
3189
- onClose: () => {
3190
- e?.onClose?.();
3191
- },
3192
- ...i
3193
- });
3194
- }), na = "_styled-resizer_fdl5y_3", ra = {}, ia = {
3195
- flex: "1 1 100%",
3196
- display: "flex",
3197
- boxSizing: "border-box"
3198
- }, aa = L(I((e, t) => {
3199
- let { mainElement: n, sidebarElement: r, position: i, persistKey: a, onPositionChange: o, className: s, style: c, taskSide: l = "right", ...u } = e, [d, f] = St(a ?? null, ra), p = vn(), [m, { width: h }] = bt(), g = h > 530 || h === 0, _ = V(null), v, y, b = null, x = 4, S = 13;
3200
- g ? b = "m 3.6261898,11.36243 c 0,0.88365 -0.71627,1.59991 -1.59991,1.59991 -0.8836498,0 -1.60004965,-0.71626 -1.60004965,-1.59991 0,-0.88365 0.71639985,-1.6000508 1.60004965,-1.6000508 0.88364,0 1.59991,0.7164008 1.59991,1.6000508 m 0,-4.881294 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 -0.8836498,0 -1.60004965,-0.7164 -1.60004965,-1.60004 0,-0.88365 0.71639985,-1.60005 1.60004965,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-4.881226 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 1.14263,3.19996 0.42623015,2.48356 0.42623015,1.59991 0.42623015,0.71626 1.14263,0 2.0262798,0 c 0.88364,0 1.59991,0.71626 1.59991,1.59991" : (b = "M 1.59991,3.62619 C 0.71626,3.62619 0,2.90992 0,2.02628 0,1.1426301 0.71626,0.42623015 1.59991,0.42623015 c 0.88365,0 1.6000508,0.71639995 1.6000508,1.60004985 0,0.88364 -0.7164008,1.59991 -1.6000508,1.59991 m 4.881294,0 c -0.88364,0 -1.60004,-0.71627 -1.60004,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60004,-1.60004985 0.88365,0 1.60005,0.71639995 1.60005,1.60004985 0,0.88364 -0.7164,1.59991 -1.60005,1.59991 m 4.881226,0 c -0.88365,0 -1.60005,-0.71627 -1.60005,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60005,-1.60004985 0.88365,0 1.59991,0.71639995 1.59991,1.60004985 0,0.88364 -0.71626,1.59991 -1.59991,1.59991", x = 13, S = 4);
3201
- let C, ee = n, te = r, ne = l !== "right", re = g ? "row" : "column", ie = ne && te ? "before" : "after", ae = `${re}:${ie}`, oe = a ? d[ae] : void 0, se = oe == null ? ((e, t) => {
3202
- if (e == null) return "40%";
3203
- if (typeof e == "number" || typeof e == "string") return e;
3204
- let n = e[t];
3205
- return n == null ? "40%" : `${n}%`;
3206
- })(i, ae) : `${oe}%`, w = a || o ? (e) => {
3207
- a && f((t) => ({
3208
- ...t,
3209
- [ae]: e.percent
3210
- })), o?.(e, {
3211
- orientation: re,
3212
- side: ie,
3213
- key: ae
3214
- });
3215
- } : void 0;
3216
- ne && te ? (ee = r, te = n, y = { style: {
3217
- flexDirection: "column",
3218
- boxSizing: "border-box",
3219
- paddingRight: "2px"
3220
- } }, v = {}, C = {
3221
- fixedPane: "before",
3222
- position: se,
3223
- minBefore: g ? "280px" : "120px",
3224
- splitDirection: g ? "row" : "column"
3225
- }) : (v = { style: {
3226
- flexDirection: "column",
3227
- marginRight: r ? void 0 : "6px"
3228
- } }, y = { style: {
3229
- marginLeft: g ? "0px" : "4px",
3230
- marginRight: g ? "8px" : "4px"
3231
- } }, C = {
3232
- fixedPane: "after",
3233
- position: se,
3234
- minAfter: g ? "280px" : "120px",
3235
- splitDirection: g ? "row" : "column"
3236
- });
3237
- let ce = le([
3238
- _,
3239
- m,
3240
- t
3241
- ]);
3242
- return U(gt, {
3243
- ref: ce,
3244
- className: s,
3245
- style: c ? {
3246
- ...ia,
3247
- ...c
3248
- } : ia,
3249
- ...u,
3250
- ...C,
3251
- onPositionChange: w,
3252
- propsResizer: {
3253
- className: ye("styled-resizer", na),
3254
- style: {
3255
- minWidth: g ? "7px" : void 0,
3256
- minHeight: g ? void 0 : "6px",
3257
- maskImage: `url("data:image/svg+xml,%3Csvg width='${x}' height='${S}' viewBox='0 0 ${x} ${S}' version='1.1' fill='${p.palette.text.icon ?? p.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='${b}' /%3E%3C/svg%3E%0A")`,
3258
- maskRepeat: "no-repeat",
3259
- maskPosition: ne ? g ? "center center" : "bottom center" : g ? "left center" : "top center"
3260
- }
3261
- },
3262
- elementBefore: ee,
3263
- propsPaneBefore: v,
3264
- elementAfter: te,
3265
- propsPaneAfter: y
3266
- });
3267
- }));
3268
- aa.displayName = "StudioSplitPane";
3269
- var oa = () => U("div", { style: {
3270
- flex: "none",
3271
- height: 0,
3272
- borderTop: "solid var(--sxl-color-base-border, light-dark(rgba(0, 0, 0, 0.26), rgba(255, 255, 255, 0.3))) 1px"
3273
- } }), sa = (e, t) => {
3274
- let n = (e) => U(F.Fragment, { children: t[e] }, e);
3275
- if (e === "bottom") {
3276
- let e = t.statusBar && t.formulaBar ? U(oa, {}, "divider") : null;
3277
- return [
3278
- n("toolbar"),
3279
- n("main"),
3280
- n("statusBar"),
3281
- e,
3282
- n("formulaBar")
3283
- ];
3284
- }
3285
- return [
3286
- n("toolbar"),
3287
- n("formulaBar"),
3288
- n("main"),
3289
- n("statusBar")
3290
- ];
3291
- }, ca = we.BuiltInSelectorNames, la = {
3292
- [ca.Whole]: "FormulaMathTrig",
3293
- [ca.Number]: "IncreaseDecimal",
3294
- [ca.Date]: "FormulaDateTime",
3295
- [ca.DateTime]: "FormulaDateTime",
3296
- [ca.Time]: "FormulaDateTime",
3297
- [ca.TextLength]: "FormulaText"
3298
- }, ua = (e) => {
3299
- let t = e.getCondition();
3300
- if (!t) return "DataValidation";
3301
- let n = t.toJSON();
3302
- return n.operator === we.BuiltInOperatorNames.Expression ? "FormulaCustom" : n.selector || n.operator !== we.BuiltInOperatorNames.InSet ? typeof n.selector == "string" && la[n.selector] || "DataValidation" : "Menu";
3303
- }, da = L(({ dataValidation: e, size: t = 28 }) => ($e(e, "onAnyChange"), U(w, {
3304
- className: "sxl-dv-icon",
3305
- sx: {
3306
- width: "auto",
3307
- minWidth: 1.7 * t + "px",
3308
- height: `${t}px`
3309
- },
3310
- children: U(A, {
3311
- iconKey: ua(e),
3312
- size: Math.round(.6 * t),
3313
- ariaHidden: !0
3314
- })
3315
- })));
3316
- da.displayName = "DataValidationIcon";
3317
- var fa = (e, t) => {
3318
- let n = e.getCondition();
3319
- if (!n) return t("dataValidation.anyValue");
3320
- let r = n.toJSON();
3321
- if (r.operator === we.BuiltInOperatorNames.Expression && typeof r.param == "string") return t("dataValidation.titleCustom", { formula: r.param });
3322
- if (!r.selector && r.operator === we.BuiltInOperatorNames.InSet) {
3323
- let e = r.param, n = e?.source;
3324
- if (typeof n == "string" && n.length > 0) return t("dataValidation.titleListFrom", { source: n });
3325
- let i = (e?.items ?? []).map((e) => String(e ?? "")).concat((e?.additions ?? []).map((e) => e.trimStart()));
3326
- return t("dataValidation.titleList", {
3327
- items: i.slice(0, 3).join(", "),
3328
- more: Math.max(0, i.length - 3)
3329
- });
3330
- }
3331
- return n.toString();
3332
- }, pa = {
3333
- [D.AlertStyle.Stop]: "ValidationStop",
3334
- [D.AlertStyle.Warning]: "ValidationWarning",
3335
- [D.AlertStyle.Information]: "ValidationInformation"
3336
- }, ma = "none", ha = {
3337
- width: 18,
3338
- height: 18,
3339
- flex: "0 0 auto"
3340
- }, ga = {
3341
- [D.AlertStyle.Stop]: X("dataValidation.alertStop"),
3342
- [D.AlertStyle.Warning]: X("dataValidation.alertWarning"),
3343
- [D.AlertStyle.Information]: X("dataValidation.alertInformation")
3344
- }, _a = L((e) => {
3345
- let { dataValidation: n } = e, r = P();
3346
- $e(n, "onAnyChange");
3347
- let i = n.isProtected(), a = n.getRenderHints().includes("list"), [o, s] = H("rule"), c = W(cn, {
3348
- tabIndex: 0,
3349
- className: l["editor-panel"],
3350
- sx: {
3351
- gap: (e) => e.spacing(1),
3352
- paddingTop: (e) => e.spacing(1.25),
3353
- paddingBottom: (e) => e.spacing(2),
3354
- paddingLeft: (e) => e.spacing(1.5),
3355
- paddingRight: (e) => e.spacing(1.5),
3356
- border: (e) => `1px solid ${e.palette.divider}`,
3357
- borderRadius: (e) => e.spacing(1.25),
3358
- overflow: "auto"
3359
- },
3360
- children: [
3361
- W(G, {
3362
- sx: {
3363
- display: "flex",
3364
- flexDirection: "column",
3365
- gap: (e) => e.spacing(1.75),
3366
- margin: (e) => e.spacing(1.25),
3367
- marginBottom: 0
3368
- },
3369
- children: [W(G, {
3370
- sx: {
3371
- display: "flex",
3372
- alignItems: "center",
3373
- gap: (e) => e.spacing(1.5)
3374
- },
3375
- children: [U(da, {
3376
- dataValidation: n,
3377
- size: 48
3378
- }), U(J, {
3379
- variant: "body2",
3380
- sx: {
3381
- minWidth: 0,
3382
- wordBreak: "break-word"
3383
- },
3384
- children: fa(n, r)
3385
- })]
3386
- }), U(y, {
3387
- item: n,
3388
- label: r("dataValidation.applyTo")
3389
- })]
3390
- }),
3391
- W(fn, {
3392
- value: o,
3393
- onChange: (e, t) => s(t),
3394
- sx: {
3395
- minHeight: "36px",
3396
- borderBottom: 1,
3397
- borderColor: "divider",
3398
- "& .MuiTab-root": {
3399
- minHeight: "36px",
3400
- textTransform: "none",
3401
- pt: .5,
3402
- pb: .5,
3403
- px: 1.5,
3404
- minWidth: 0
3405
- }
3406
- },
3407
- children: [U(dn, {
3408
- value: "rule",
3409
- label: r("dataValidation.tabRule")
3410
- }), U(dn, {
3411
- value: "prompt",
3412
- label: r("dataValidation.prompt")
3413
- })]
3414
- }),
3415
- o === "prompt" ? W(G, {
3416
- sx: {
3417
- display: "flex",
3418
- flexDirection: "column",
3419
- gap: 2
3420
- },
3421
- children: [
3422
- U(an, {
3423
- control: U($t, {
3424
- checked: n.isShowPromptMessage(),
3425
- disabled: i,
3426
- onChange: (e) => n.setShowPromptMessage(e.target.checked)
3427
- }),
3428
- label: r("dataValidation.showPrompt"),
3429
- sx: {
3430
- ml: 0,
3431
- pl: .5
3432
- }
3433
- }),
3434
- U(pn, {
3435
- size: "small",
3436
- label: r("dataValidation.title"),
3437
- value: n.getPromptTitle(),
3438
- onChange: (e) => n.setPromptTitle(e.target.value),
3439
- disabled: i,
3440
- fullWidth: !0,
3441
- slotProps: { htmlInput: { maxLength: 32 } },
3442
- sx: { backgroundColor: "background.paper" }
3443
- }),
3444
- U(pn, {
3445
- size: "small",
3446
- label: r("dataValidation.message"),
3447
- value: n.getPromptMessage(),
3448
- onChange: (e) => n.setPromptMessage(e.target.value),
3449
- disabled: i,
3450
- multiline: !0,
3451
- rows: 2,
3452
- fullWidth: !0,
3453
- slotProps: { htmlInput: { maxLength: 254 } },
3454
- sx: { backgroundColor: "background.paper" }
3455
- })
3456
- ]
3457
- }) : W(Xt, { children: [U(_e, {
3458
- sx: {
3459
- ...t,
3460
- p: 2,
3461
- pb: 0
3462
- },
3463
- selectorTitle: r("dataValidation.allow"),
3464
- condition: n.getCondition(),
3465
- ranges: n.getRanges(),
3466
- readOnly: i,
3467
- onConditionChange: (e) => {
3468
- let t = !n.getCondition() && e ? {
3469
- ...e,
3470
- includeBlanks: !0
3471
- } : e;
3472
- n.setCondition(t);
3473
- },
3474
- qualifiers: a ? U(an, {
3475
- control: U($t, {
3476
- size: "small",
3477
- checked: !n.isHideDropdown(),
3478
- disabled: i,
3479
- onChange: (e) => n.setHideDropdown(!e.target.checked)
3480
- }),
3481
- label: r("dataValidation.inCellDropdown")
3482
- }) : null
3483
- }), W(G, {
3484
- sx: {
3485
- display: "flex",
3486
- flexDirection: "column",
3487
- gap: 2,
3488
- p: 2,
3489
- border: 1,
3490
- borderColor: "divider",
3491
- borderRadius: 1
3492
- },
3493
- children: [W(rn, {
3494
- fullWidth: !0,
3495
- size: "small",
3496
- disabled: i,
3497
- sx: { backgroundColor: "background.paper" },
3498
- children: [U(sn, { children: r("dataValidation.onInvalid") }), W(ln, {
3499
- className: "on-invalid",
3500
- value: n.isShowAlertMessage() ? n.getAlertStyle() : ma,
3501
- label: r("dataValidation.onInvalid"),
3502
- onChange: (e) => {
3503
- let t = e.target.value;
3504
- t === ma ? n.setShowAlertMessage(!1) : (n.setAlertStyle(t), n.setShowAlertMessage(!0));
3505
- },
3506
- renderValue: (e) => W(G, {
3507
- sx: {
3508
- display: "flex",
3509
- alignItems: "center",
3510
- gap: 1
3511
- },
3512
- children: [e === ma ? U(G, { sx: ha }) : U(A, {
3513
- iconKey: pa[e],
3514
- size: 18,
3515
- ariaHidden: !0
3516
- }), r(e === ma ? "dataValidation.alertNone" : ga[e])]
3517
- }),
3518
- children: [Object.keys(pa).map((e) => W(K, {
3519
- value: e,
3520
- sx: { gap: 1 },
3521
- children: [U(A, {
3522
- iconKey: pa[e],
3523
- size: 18,
3524
- ariaHidden: !0
3525
- }), r(ga[e])]
3526
- }, e)), W(K, {
3527
- value: ma,
3528
- sx: { gap: 1 },
3529
- children: [U(G, { sx: ha }), r("dataValidation.alertNone")]
3530
- }, ma)]
3531
- })]
3532
- }), n.isShowAlertMessage() ? W(Xt, { children: [U(pn, {
3533
- size: "small",
3534
- label: r("dataValidation.title"),
3535
- value: n.getAlertTitle(),
3536
- onChange: (e) => n.setAlertTitle(e.target.value),
3537
- disabled: i,
3538
- fullWidth: !0,
3539
- slotProps: { htmlInput: { maxLength: 32 } },
3540
- sx: { backgroundColor: "background.paper" }
3541
- }), U(pn, {
3542
- size: "small",
3543
- label: r("dataValidation.message"),
3544
- value: n.getAlertMessage(),
3545
- onChange: (e) => n.setAlertMessage(e.target.value),
3546
- disabled: i,
3547
- multiline: !0,
3548
- rows: 2,
3549
- fullWidth: !0,
3550
- slotProps: { htmlInput: { maxLength: 225 } },
3551
- sx: { backgroundColor: "background.paper" }
3552
- })] }) : null]
3553
- })] })
3554
- ]
3555
- });
3556
- return U(x.Provider, {
3557
- value: n,
3558
- children: c
3559
- });
3560
- });
3561
- _a.displayName = "DataValidationEditorPanel";
3562
- var va = ({ icon: e, title: t, children: n }) => W(G, {
3563
- className: "validation-badge",
3564
- title: t,
3565
- "aria-label": t,
3566
- sx: {
3567
- display: "inline-flex",
3568
- alignItems: "center",
3569
- gap: .5,
3570
- px: .75,
3571
- py: .25,
3572
- border: 1,
3573
- borderColor: "divider",
3574
- borderRadius: 1,
3575
- color: "text.secondary"
3576
- },
3577
- children: [U(A, {
3578
- iconKey: e,
3579
- size: 14,
3580
- ariaHidden: !0
3581
- }), n ? U(J, {
3582
- variant: "caption",
3583
- children: n
3584
- }) : null]
3585
- }), ya = {
3586
- [D.AlertStyle.Stop]: "dataValidation.alertStop",
3587
- [D.AlertStyle.Warning]: "dataValidation.alertWarning",
3588
- [D.AlertStyle.Information]: "dataValidation.alertInformation"
3589
- }, ba = L(({ item: e }) => {
3590
- let t = P();
3591
- $e(e, "onAnyChange");
3592
- let n = [];
3593
- if (e.isShowPromptMessage() && n.push(U(va, {
3594
- icon: "NoteInsert",
3595
- title: t("dataValidation.prompt"),
3596
- children: e.getPromptTitle() || null
3597
- }, "prompt")), e.getCondition() && e.isShowAlertMessage()) {
3598
- let r = e.getAlertStyle();
3599
- n.push(U(va, {
3600
- icon: pa[r],
3601
- title: `${t("dataValidation.alert")}: ${t(ya[r])}`
3602
- }, "alert"));
3603
- }
3604
- return !e.isHideDropdown() && e.getRenderHints().includes("list") && n.push(U(va, {
3605
- icon: "ArrowDownOutline",
3606
- title: t("dataValidation.inCellDropdown")
3607
- }, "dropdown")), n.length === 0 ? null : U(G, {
3608
- sx: {
3609
- display: "flex",
3610
- flexWrap: "wrap",
3611
- gap: .5
3612
- },
3613
- children: n
3614
- });
3615
- });
3616
- ba.displayName = "DataValidationCardBody";
3617
- var xa = L(({ item: e }) => {
3618
- let t = P();
3619
- return U(y, {
3620
- item: e,
3621
- label: t("dataValidation.applyTo"),
3622
- helperText: null
3623
- });
3624
- });
3625
- xa.displayName = "DataValidationCardRanges";
3626
- var Sa = {
3627
- key: "data-validation",
3628
- messageKeys: {
3629
- none: X("dataValidation.none"),
3630
- addPrompt: X("dataValidation.addPrompt"),
3631
- heading: X("dataValidation.heading"),
3632
- insert: X("dataValidation.insert"),
3633
- new: X("dataValidation.new"),
3634
- moveUp: X("dataValidation.moveUp"),
3635
- moveDown: X("dataValidation.moveDown"),
3636
- edit: X("dataValidation.edit"),
3637
- duplicate: X("dataValidation.duplicate"),
3638
- delete: X("dataValidation.delete"),
3639
- cancel: X("dataValidation.cancel"),
3640
- save: X("dataValidation.save")
3641
- },
3642
- getCollection: (e) => e.getDataValidations(),
3643
- changeEvents: ["onDataValidationsChange"],
3644
- isReadOnly: (e) => e.getProtection().isLocked() || e.getProtection().isReadOnly(),
3645
- applyUpdate: (e, t) => {
3646
- e.update(t);
3647
- },
3648
- validate: (e) => e.getCondition()?.validate() ?? null,
3649
- applyNewDefaults: (e) => {
3650
- e.update({
3651
- alertStyle: D.AlertStyle.Stop,
3652
- showAlertMessage: !0
3653
- });
3654
- },
3655
- applySeed: (e, t) => {
3656
- e.update(t);
3657
- },
3658
- getCardTitle: fa,
3659
- CardMedia: ({ item: e }) => U(da, {
3660
- dataValidation: e,
3661
- size: 32
3662
- }),
3663
- CardSubtitle: xa,
3664
- CardBody: ba,
3665
- EditorBody: ({ item: e }) => U(_a, { dataValidation: e })
3666
- }, Ca = L(I((e, t) => {
3667
- let { workbook: n, args: r, ...i } = e;
3668
- return U(S, {
3669
- ref: t,
3670
- workbook: n,
3671
- descriptor: Sa,
3672
- args: r,
3673
- dragReorder: !0,
3674
- ...i
3675
- });
3676
- }));
3677
- Ca.displayName = "DataValidationDetailsPanel", ee(), Xe("shape", {
3678
- key: "changeShapeGallery",
3679
- render: (e) => U(n, {
3680
- ...e,
3681
- commandKey: "changeShape",
3682
- excludeCategories: sr
3683
- })
3684
- }, {
3685
- order: -1,
3686
- divider: "after"
3687
- }), Ye("shape", () => import("./DBtc4lku0uHVcqWn.mjs").then((e) => e.ShapeFormatPanel)), Xe("picture", {
3688
- key: "changePictureOptions",
3689
- defaultKey: "changePictureFromFile",
3690
- members: ["changePictureFromFile", "changePictureFromURL"]
3691
- }, {
3692
- order: -1,
3693
- divider: "after"
3694
- }), g(), ct.register("plugin-table", { icons: {} }), Ae.registerTaskPane({
3695
- key: "dataValidationDetails",
3696
- getTitle: () => "Data Validation",
3697
- getIcon: () => "DataValidation",
3698
- component: (e) => {
3699
- let { model: t, entryKey: n, frame: r, args: i, ref: a, ...o } = e;
3700
- return U(Ca, {
3701
- ref: a,
3702
- workbook: t,
3703
- args: i,
3704
- ...o
3705
- });
3706
- }
3707
- }, !0), Ae.registerTaskPane({
3708
- key: "conditionalFormatDetails",
3709
- getTitle: () => "Conditional Formatting",
3710
- getIcon: () => "FormatPaint",
3711
- component: or
3712
- }, !0), ie(), fe(), o(), b(), he(), ge();
3713
- var wa = () => {
3714
- let e, t, n = new Promise((n, r) => {
3715
- e = n, t = r;
3716
- }), r = {
3717
- promise: n,
3718
- settled: !1,
3719
- resolve: (t) => {
3720
- r.settled = !0, e(t);
3721
- },
3722
- reject: (e) => {
3723
- r.settled = !0, t(e);
3724
- }
3725
- };
3726
- return n.catch(() => {}), r;
3727
- }, Ta = (e, t) => {
3728
- if (!e) return {};
3729
- let { colorSchemes: n, ...r } = e, i = n?.[t ? "dark" : "light"];
3730
- return i && typeof i == "object" ? yn.deepMerge(r, i) : r;
3731
- }, Ea = "taskPanePosition", Da = L(I((e, t) => {
3732
- let { host: n, scopeClass: r, square: i, elevation: a, variant: o, onWorkbookLoad: s, prefetch: c, onDocumentError: l, renderDocumentError: u = C, propsDocumentError: d, propsTaskPaneArea: f, renderTaskPaneArea: p = Oa, taskPaneSide: m = "right", onKeyDown: g, workbook: _, onWorkbookChange: v, logo: y, topLeft: b, topRight: x, muiTheme: S, tokens: ee, cssBaseline: te, autoFocus: ie = !1, title: oe, onDirtyChange: se, propsDocumentTitle: w, renderDocumentLoading: le = pe, propsDocumentLoading: fe, propsWorkbook: me, showFormulaBar: he, propsFormulaBar: ge, renderFormulaBar: _e, formulaBarPlacement: ve, manageVisualViewport: T = !0, editable: ye, showStatusBar: be, propsStatusBar: xe, renderStatusBar: Se, propsToolbar: Ce, renderToolbar: we } = e, E = V(null), D = V(null), Te = V(null), Ee = vt(() => {
3733
- Te.current?.getNamedCollectionEditorElement?.()?.focus?.();
3734
- }, []), De = ((e, t = typeof window > "u" ? "mouse" : mt.detectIt().primaryInput) => e === "top" || e === "bottom" ? e : t === "touch" ? "bottom" : "top")(ve), Oe = De === "bottom" && T, ke = Tt(Oe), Ae = ke ? Math.max(0, Math.round(window.innerHeight - ke.height)) : 0, je = ke ? Math.round(ke.offsetTop) : 0, Me = ke?.height;
3735
- z(() => {
3736
- Oe && Me !== void 0 && (window.scrollX === 0 && window.scrollY === 0 || window.scrollTo(0, 0));
3737
- }, [Oe, Me]);
3738
- let Ne = vt(l ?? (() => {}), [l]), Pe = vt(se ?? (() => {}), [se]), Fe = w?.placeHolder, [Ie] = St(ze.Mode, Re[ze.Mode]), { themeMode: We } = Ct({ mode: Ie ?? void 0 }), [Ge] = St(ut.Active, null), Ke = V(Ge);
3739
- Ke.current = Ge;
3740
- let qe = wt(), k = B(() => ({
3741
- light: Vt(!1, yn.deepMerge(Ta(S, !1), re(qe?.light))),
3742
- dark: Vt(!0, yn.deepMerge(Ta(S, !0), re(qe?.dark)))
3743
- }), [
3744
- S,
3745
- qe?.light,
3746
- qe?.dark
3747
- ]), Je = We === "dark", Ye = B(() => h(k.light, k.dark, `.${r}`, ee), [
3748
- k,
3749
- r,
3750
- ee
3751
- ]), Xe = B(() => Ve("sxl-defaults", `.${r}`), [r]), Ze = Qe(), [nt, ot] = H(() => _ ?? null);
3752
- z(() => {
3753
- ot(_ ?? null);
3754
- }, [_]);
3755
- let [lt, dt] = H(0), pt = V(null);
3756
- pt.current ||= wa();
3757
- let gt = tt(nt, {
3758
- io: O,
3759
- defaultTheme: Ze.getDefaultTheme(),
3760
- reloadKey: lt
3761
- }), j = gt.status === "loaded" ? gt.workbook : null, M = B(() => gt.status === "error" ? {
3762
- status: "error",
3763
- error: gt.error
3764
- } : gt.status === "loaded" ? {
3765
- status: "loaded",
3766
- workbook: gt.workbook
3767
- } : { status: "loading" }, [gt]);
3768
- z(() => {
3769
- pt.current.settled && (pt.current = wa());
3770
- }, [nt, lt]), z(() => {
3771
- M.status === "loaded" ? pt.current.resolve(M.workbook) : M.status === "error" && (Ne?.(M.error), pt.current.reject(M.error));
3772
- }, [M]);
3773
- let [N, bt] = H(null);
3774
- j && !N && bt(j);
3775
- let xt = j && N && j !== N ? j : null, P = V(xt);
3776
- P.current = xt;
3777
- let F = V(N);
3778
- F.current = N;
3779
- let Et = V([]), Dt = R((e) => {
3780
- let t = F.current;
3781
- t && Et.current.push(t), ot(e);
3782
- }, []);
3783
- z(() => {
3784
- let e = Et.current;
3785
- if (e.length !== 0) {
3786
- Et.current = e.filter((e) => e === N);
3787
- for (let t = 0; t < e.length; t++) {
3788
- let n = e[t];
3789
- if (n !== N) try {
3790
- n.close();
3791
- } catch (e) {
3792
- console.warn("Unable to close the replaced workbook", e);
3793
- }
3794
- }
3795
- }
3796
- }, [N]);
3797
- let Ot = ye ? null : N, I = et(), kt = B(() => Ot ? He(Ot.getSelectedSheet(), { referenceMode: I }) : null, [Ot, I]), L = ye ?? kt, At = V(L);
3798
- At.current = L, z(() => {
3799
- if (!L) return;
3800
- let e = L.getSession();
3801
- return L.subscribe(() => {
3802
- let t = e;
3803
- e = L.getSession(), t && !e && t.getActiveEditorId() === "formula-bar" && Te.current?.contains?.(document.activeElement) && E.current?.focus();
3804
- });
3805
- }, [L]);
3806
- let jt = it(N), { isDirty: Mt, saveState: Nt } = at(N, O), It = rt(N), Lt = V(Nt), zt = V(null);
3807
- Lt.current = Nt;
3808
- let Bt = R(() => Lt.current?.isDirty() ?? !1, []), Ht = V(M);
3809
- Ht.current = M;
3810
- let [Ut, Wt] = H(null), Gt = oe ?? w?.title, [Kt, qt] = H(null);
3811
- z(() => {
3812
- qt(null);
3813
- }, [N]);
3814
- let Jt = Gt ?? Kt ?? jt ?? "";
3815
- z(() => {
3816
- Pe?.(Mt);
3817
- }, [Mt]);
3818
- let Yt = vt(v ?? (() => {}), [v]);
3819
- z(() => {
3820
- Yt?.(j);
3821
- }, [j]);
3822
- let Zt = V(j);
3823
- Zt.current = j, $e(N, "onViewChange");
3824
- let Qt = B(() => U(Pt, {
3825
- groupKey: "helpOptions",
3826
- disableHover: !0,
3827
- sx: { padding: "0" },
3828
- propsButton: { sx: { maxHeight: "22px" } }
3829
- }), []), [$t, en] = H(null), nn = R((e) => {
3830
- en(e);
3831
- }, []);
3832
- z(() => {
3833
- ct.prefetch().catch((e) => {
3834
- console.warn("Icons could not be loaded:", e);
3835
- });
3836
- }, []);
3837
- let rn = V(null);
3838
- rn.current ||= wa();
3839
- let an = V(null), on = R(() => an.current?.getSheetElement()?.getGridSurface()?.getPane()?.getElement() ?? rn.current.promise, []), sn = vt(async (e) => {
3840
- let t = Ke.current;
3841
- t && t !== xn.getActive() && await xn.setActive(t), await st.DefaultCommandCatalogService.prefetch(t ?? void 0), Wt(e), an.current = e.source, rn.current.settled || rn.current.resolve(e.source.getSheetElement()?.getGridSurface()?.getPane()?.getElement() ?? null), s?.(e);
3842
- }, []), K = V(null), ln = R((e) => {
3843
- let t = null, n = {
3844
- readOnly: !0,
3845
- ...w
3846
- };
3847
- return w?.hidden || (t = U(de, {
3848
- ...n,
3849
- style: {
3850
- maxWidth: "100%",
3851
- ...w?.style
3852
- },
3853
- workbook: e.workbook ?? E.current,
3854
- ref: K,
3855
- title: Jt,
3856
- modified: Mt,
3857
- encrypted: It,
3858
- placeHolder: Fe,
3859
- onTitleChange: (e) => {
3860
- qt(e), w?.onTitleChange?.(e);
3861
- }
3862
- })), U(Bi, {
3863
- ...e,
3864
- logo: y,
3865
- mainElement: t,
3866
- startElement: b,
3867
- endElement: x
3868
- });
3869
- }, [
3870
- y,
3871
- Jt,
3872
- Mt,
3873
- It,
3874
- w,
3875
- b,
3876
- x
3877
- ]);
3878
- z(() => {
3879
- let e = E.current;
3880
- if (!e) return;
3881
- let t = (t) => {
3882
- (t.ctrlKey || t.metaKey || ht.getWheelOwner(t, e) !== "native") && t.preventDefault();
3883
- };
3884
- return e.addEventListener("wheel", t, { passive: !1 }), () => {
3885
- e.removeEventListener("wheel", t);
3886
- };
3887
- }, [Ut]);
3888
- let [dn, fn] = H(null);
3889
- z(() => {
3890
- fn(Ut?.source?.getCommandScope?.() ?? null);
3891
- }, [Ut]);
3892
- let pn = B(() => ({
3893
- "& .SnackbarContainer-root": { position: "absolute !important" },
3894
- "& .notistack-SnackbarContainer > div": { maxWidth: "min(100%, 720px)" },
3895
- "& .notistack-Snackbar": { minWidth: "unset" },
3896
- "& .notistack-Snackbar > .error-snackbar .MuiTypography-root": { color: (e) => e.palette.getContrastText(e.palette.error.main) },
3897
- "& .notistack-Snackbar > .error-snackbar .MuiCardActions-root": { color: (e) => e.palette.getContrastText(e.palette.error.main) },
3898
- "& .notistack-Snackbar > .error-snackbar .MuiButtonBase-root": { color: (e) => e.palette.getContrastText(e.palette.error.main) },
3899
- "& .notistack-MuiContent *": { fontFamily: (e) => e.typography.fontFamily },
3900
- "& #notistack-snackbar": {
3901
- maxWidth: "560px",
3902
- whiteSpace: "pre-wrap"
3903
- },
3904
- "*": { userSelect: "none" }
3905
- }), []), [q, hn] = H(null), [, J] = St(null, !1);
3906
- z(() => {
3907
- J(q != null);
3908
- }, [q, J]);
3909
- let gn = R((e) => p({
3910
- model: N,
3911
- side: m,
3912
- ...e,
3913
- ...f
3914
- }), [
3915
- N,
3916
- m,
3917
- f
3918
- ]), _n = V(n);
3919
- _n.current = n, yt(t, () => ({
3920
- isStudioElement: () => !0,
3921
- save: (e) => {
3922
- let t = zt.current;
3923
- return t ? t(e) : Promise.reject(/* @__PURE__ */ Error("The studio cannot save: no workbook, or the backing store cannot write."));
3924
- },
3925
- getWorkbookElement: () => E.current,
3926
- getWorkbook: () => Zt.current ?? null,
3927
- isDirty: () => Lt.current?.isDirty() ?? !1,
3928
- getEditable: () => At.current,
3929
- getFormulaBarElement: () => Te.current ?? null,
3930
- focus: () => E.current?.focus(),
3931
- whenReady: () => (pt.current ||= wa(), pt.current.promise),
3932
- getWorkbookState: () => Ht.current,
3933
- retry: () => dt((e) => e + 1)
3934
- }), [], n);
3935
- let vn = V(!1), bn = vt((e, t) => {
3936
- t === P.current && requestAnimationFrame(() => requestAnimationFrame(() => {
3937
- t === P.current && (vn.current = _n.current?.contains(document.activeElement) ?? !0, bt(t), sn(e));
3938
- }));
3939
- }, []);
3940
- z(() => {
3941
- vn.current && (vn.current = !1, E.current?.focus());
3942
- }, [N]);
3943
- let Sn = R(() => U(Xt, {}), []), Cn = R((e) => {
3944
- let { ref: t, ...n } = e, r = Je ? k.dark : k.light, s = M.status === "error" ? u({
3945
- ...d,
3946
- style: {
3947
- width: "100%",
3948
- height: "100%",
3949
- ...d?.style
3950
- },
3951
- error: M.error
3952
- }) : null;
3953
- if (s && !N) return U(cn, {
3954
- style: {
3955
- width: "100%",
3956
- height: "100%",
3957
- position: "absolute",
3958
- display: "flex",
3959
- alignItems: "stretch",
3960
- justifyContent: "stretch"
3961
- },
3962
- children: s
3963
- });
3964
- let l = null;
3965
- if (N) {
3966
- let e = N, i = e.getView(), a = he ?? i?.isShowFormulaBar(), o = be ?? i?.isShowStatusBar(), s = Ut?.source ?? E.current, u = (we ?? ln)({
3967
- workbook: s,
3968
- ...Ce
3969
- }), d = De === "bottom", f = a ? (_e ?? ue)({
3970
- ref: Te,
3971
- style: {
3972
- marginTop: r.spacing(d ? .5 : .25),
3973
- marginLeft: r.spacing(1),
3974
- marginRight: r.spacing(1),
3975
- marginBottom: r.spacing(d ? .5 : .75)
3976
- },
3977
- workbook: e,
3978
- editable: L ?? void 0,
3979
- placement: De,
3980
- ...ge,
3981
- propsNamedCollectionEditor: {
3982
- restoreFocus: (e) => s?.focus(e),
3983
- ...ge?.propsNamedCollectionEditor
3984
- }
3985
- }) : null, p = o ? (Se ?? ce)({
3986
- childrenEnd: Qt,
3987
- ...xe
3988
- }) : null, h = (e, r) => U(ae, {
3989
- ...me,
3990
- tabIndex: 0,
3991
- autoFocus: !r && ie,
3992
- workbook: e,
3993
- editable: r ? void 0 : L ?? void 0,
3994
- focusNameBox: r ? void 0 : Ee,
3995
- prefetch: !r && c,
3996
- ref: r ? D : ne([t, E]),
3997
- onWorkbookLoad: r ? (t) => bn(t, e) : sn,
3998
- onKeyDown: (e) => {
3999
- g?.(e);
4000
- },
4001
- propsWorkbookLoading: fe,
4002
- renderWorkbookLoading: Sn,
4003
- style: r ? {
4004
- ...me?.style,
4005
- position: "absolute",
4006
- inset: 0,
4007
- visibility: "hidden"
4008
- } : {
4009
- flex: "1 1 100%",
4010
- minHeight: 0,
4011
- ...me?.style
4012
- },
4013
- onContextMenu: (e) => e.preventDefault(),
4014
- ...r ? null : n
4015
- }, e.getId());
4016
- l = U("div", {
4017
- style: {
4018
- display: "flex",
4019
- flexDirection: "column",
4020
- flex: "1 1 100%",
4021
- minWidth: 0,
4022
- minHeight: 0,
4023
- ...Ue({
4024
- window: r.palette.background.default,
4025
- windowText: r.palette.text.primary
4026
- })
4027
- },
4028
- children: sa(De, {
4029
- toolbar: u,
4030
- formulaBar: f,
4031
- statusBar: p,
4032
- main: U(aa, {
4033
- taskSide: m,
4034
- persistKey: Ea,
4035
- sidebarElement: q ? U(st.CommandScopeProvider, {
4036
- scope: dn,
4037
- children: q
4038
- }) : void 0,
4039
- mainElement: W("div", {
4040
- style: {
4041
- position: "relative",
4042
- display: "flex",
4043
- flexDirection: "column",
4044
- flex: "1 1 100%",
4045
- minWidth: 0,
4046
- minHeight: 0
4047
- },
4048
- children: [[h(N, !1), xt ? h(xt, !0) : null], U(G, {
4049
- ref: nn,
4050
- sx: {
4051
- position: "absolute",
4052
- top: "10%",
4053
- left: 0,
4054
- right: 0,
4055
- bottom: 0,
4056
- pointerEvents: "none",
4057
- "& > :first-of-type": { position: "relative" }
4058
- }
4059
- })]
4060
- })
4061
- })
4062
- })
4063
- });
4064
- }
4065
- let f = Ut ? null : le({ ...fe });
4066
- return W(cn, {
4067
- sx: pn,
4068
- style: {
4069
- width: "100%",
4070
- height: Ae ? `calc(100% - ${Ae}px)` : "100%",
4071
- transform: je ? `translateY(${je}px)` : void 0,
4072
- overscrollBehavior: Oe ? "none" : void 0,
4073
- position: "absolute",
4074
- display: "flex",
4075
- alignItems: "stretch",
4076
- justifyContent: "stretch",
4077
- backgroundColor: "var(--sxl-color-base-200)"
4078
- },
4079
- className: "eager-studio",
4080
- square: i,
4081
- elevation: a,
4082
- variant: o,
4083
- children: [
4084
- l,
4085
- s ? U(cn, {
4086
- style: {
4087
- position: "absolute",
4088
- inset: 0,
4089
- display: "flex",
4090
- alignItems: "stretch",
4091
- justifyContent: "stretch"
4092
- },
4093
- children: s
4094
- }) : null,
4095
- f ? U("div", {
4096
- style: {
4097
- position: "absolute",
4098
- inset: 0,
4099
- display: "flex",
4100
- alignItems: "center",
4101
- justifyContent: "center",
4102
- background: `var(--sxl-color-base-100, ${Je ? "#121212" : "#fff"})`
4103
- },
4104
- children: f
4105
- }) : null
4106
- ]
4107
- });
4108
- }, [
4109
- M,
4110
- N,
4111
- xt,
4112
- Ut,
4113
- Jt,
4114
- le,
4115
- fe,
4116
- Sn,
4117
- me,
4118
- i,
4119
- a,
4120
- o,
4121
- Qt,
4122
- u,
4123
- d,
4124
- ln,
4125
- pn,
4126
- q,
4127
- m,
4128
- dn,
4129
- he,
4130
- ge,
4131
- _e,
4132
- De,
4133
- L,
4134
- be,
4135
- xe,
4136
- Se,
4137
- Ce,
4138
- we,
4139
- Oe,
4140
- Ae,
4141
- je,
4142
- k,
4143
- Je
4144
- ]), wn = U(Ii, {
4145
- maxSnack: 3,
4146
- domRoot: $t ?? void 0,
4147
- anchorOrigin: {
4148
- vertical: "bottom",
4149
- horizontal: "right"
4150
- },
4151
- autoHideDuration: 3500,
4152
- onClose: (e, t, n) => {
4153
- E.current?.focus();
4154
- },
4155
- Components: { error: Ri },
4156
- iconVariant: {
4157
- success: U(un, {
4158
- style: { marginRight: "8px" },
4159
- children: U("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" })
4160
- }),
4161
- error: U(A, {
4162
- iconKey: "ErrorAlert",
4163
- style: { marginRight: "8px" }
4164
- })
4165
- },
4166
- children: U(Be, {
4167
- workbook: N,
4168
- children: U(Le, {
4169
- renderArea: gn,
4170
- onUpdateArea: (e) => {
4171
- hn(e);
4172
- },
4173
- children: U(Rt, { children: U(Zi, { children: U(_t, { children: U(ft, { children: U(Ji, {
4174
- workbook: N,
4175
- initialCommandAnchor: on,
4176
- renderWorkbook: Cn,
4177
- setWorkbook: Dt,
4178
- titleWorkbook: Jt,
4179
- setWorkbookTitle: qt,
4180
- refDocumentTitle: K,
4181
- isDirty: Bt,
4182
- refSave: zt,
4183
- host: n
4184
- }) }) }) }) })
4185
- })
4186
- })
4187
- });
4188
- return wn = W(mn, {
4189
- theme: Je ? k.dark : k.light,
4190
- children: [
4191
- te ? U(tn, {}) : null,
4192
- U("style", { children: Ye }),
4193
- U("style", { children: Xe }),
4194
- U(Ft, {
4195
- themeScopeClass: r,
4196
- themeSurface: "app",
4197
- themeMode: We,
4198
- children: wn
4199
- })
4200
- ]
4201
- }), wn;
4202
- }));
4203
- Da.displayName = "EagerStudio";
4204
- var Oa = (e) => U(ta, { ...e });
4205
- export { Da as EagerStudio, Da as default };