@carto/ps-react-ui 4.17.2 → 4.18.0

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 (91) hide show
  1. package/dist/category-Ct2BzADB.js +753 -0
  2. package/dist/category-Ct2BzADB.js.map +1 -0
  3. package/dist/change-column-Bhcxmp-r.js +1148 -0
  4. package/dist/change-column-Bhcxmp-r.js.map +1 -0
  5. package/dist/echart-B10dhEaM.js +262 -0
  6. package/dist/echart-B10dhEaM.js.map +1 -0
  7. package/dist/legend/stores.js +1 -1
  8. package/dist/{legend-store-registry-Bo8U_qWM.js → legend-store-registry-p1tSwJXH.js} +151 -147
  9. package/dist/legend-store-registry-p1tSwJXH.js.map +1 -0
  10. package/dist/legend.js +473 -415
  11. package/dist/legend.js.map +1 -1
  12. package/dist/types/legend/components/legend-actions/legend-actions.d.ts +2 -2
  13. package/dist/types/legend/components/legend-group/styles.d.ts +31 -20
  14. package/dist/types/legend/components/legend-row/styles.d.ts +24 -4
  15. package/dist/types/legend/components/legend-sortable/styles.d.ts +4 -3
  16. package/dist/types/widgets-v2/actions/lock-selection/lock-selection.d.ts +15 -5
  17. package/dist/types/widgets-v2/category/components/category-legend.d.ts +18 -2
  18. package/dist/types/widgets-v2/category/components/category-row-stacked.d.ts +6 -1
  19. package/dist/types/widgets-v2/category/style.d.ts +8 -0
  20. package/dist/types/widgets-v2/echart/use-chart-selection.d.ts +10 -4
  21. package/dist/types/widgets-v2/histogram/index.d.ts +1 -1
  22. package/dist/types/widgets-v2/histogram/transforms.d.ts +11 -0
  23. package/dist/types/widgets-v2/histogram/types.d.ts +9 -0
  24. package/dist/types/widgets-v2/scatterplot/index.d.ts +1 -1
  25. package/dist/types/widgets-v2/scatterplot/transforms.d.ts +9 -0
  26. package/dist/types/widgets-v2/table/index.d.ts +1 -0
  27. package/dist/types/widgets-v2/table/transforms.d.ts +13 -0
  28. package/dist/types/widgets-v2/table/transforms.test.d.ts +1 -0
  29. package/dist/types/widgets-v2/timeseries/index.d.ts +1 -0
  30. package/dist/types/widgets-v2/timeseries/transforms.d.ts +10 -0
  31. package/dist/types/widgets-v2/timeseries/transforms.test.d.ts +1 -0
  32. package/dist/widgets-v2/actions.js +1 -1
  33. package/dist/widgets-v2/category.js +1 -1
  34. package/dist/widgets-v2/echart.js +1 -1
  35. package/dist/widgets-v2/echart.js.map +1 -1
  36. package/dist/widgets-v2/histogram.js +181 -158
  37. package/dist/widgets-v2/histogram.js.map +1 -1
  38. package/dist/widgets-v2/pie.js +155 -116
  39. package/dist/widgets-v2/pie.js.map +1 -1
  40. package/dist/widgets-v2/scatterplot.js +91 -85
  41. package/dist/widgets-v2/scatterplot.js.map +1 -1
  42. package/dist/widgets-v2/table.js +55 -45
  43. package/dist/widgets-v2/table.js.map +1 -1
  44. package/dist/widgets-v2/timeseries.js +96 -85
  45. package/dist/widgets-v2/timeseries.js.map +1 -1
  46. package/dist/widgets-v2.js +4 -4
  47. package/package.json +3 -3
  48. package/src/legend/components/legend-actions/legend-actions.tsx +2 -2
  49. package/src/legend/components/legend-group/styles.ts +59 -36
  50. package/src/legend/components/legend-row/legend-row.tsx +10 -7
  51. package/src/legend/components/legend-row/styles.ts +41 -10
  52. package/src/legend/components/legend-sortable/styles.ts +13 -4
  53. package/src/legend/stores/legend-store-registry.ts +28 -4
  54. package/src/legend/stores/legend-store.test.ts +23 -0
  55. package/src/widgets-v2/actions/lock-selection/lock-selection.test.tsx +62 -0
  56. package/src/widgets-v2/actions/lock-selection/lock-selection.tsx +45 -13
  57. package/src/widgets-v2/category/category-ui.test.tsx +55 -0
  58. package/src/widgets-v2/category/category-ui.tsx +65 -6
  59. package/src/widgets-v2/category/components/category-legend.test.tsx +53 -2
  60. package/src/widgets-v2/category/components/category-legend.tsx +55 -12
  61. package/src/widgets-v2/category/components/category-row-stacked.test.tsx +7 -3
  62. package/src/widgets-v2/category/components/category-row-stacked.tsx +8 -3
  63. package/src/widgets-v2/category/style.ts +10 -2
  64. package/src/widgets-v2/echart/echart-ui.test.tsx +25 -0
  65. package/src/widgets-v2/echart/echart-ui.tsx +20 -0
  66. package/src/widgets-v2/echart/use-chart-selection.test.tsx +3 -1
  67. package/src/widgets-v2/echart/use-chart-selection.ts +10 -4
  68. package/src/widgets-v2/histogram/index.ts +4 -1
  69. package/src/widgets-v2/histogram/options.test.ts +86 -0
  70. package/src/widgets-v2/histogram/options.ts +50 -0
  71. package/src/widgets-v2/histogram/transforms.test.ts +36 -1
  72. package/src/widgets-v2/histogram/transforms.ts +23 -0
  73. package/src/widgets-v2/histogram/types.ts +9 -0
  74. package/src/widgets-v2/pie/options.test.ts +262 -0
  75. package/src/widgets-v2/pie/options.ts +80 -5
  76. package/src/widgets-v2/scatterplot/index.ts +4 -1
  77. package/src/widgets-v2/scatterplot/transforms.test.ts +38 -1
  78. package/src/widgets-v2/scatterplot/transforms.ts +23 -0
  79. package/src/widgets-v2/table/index.ts +1 -0
  80. package/src/widgets-v2/table/transforms.test.ts +40 -0
  81. package/src/widgets-v2/table/transforms.ts +26 -0
  82. package/src/widgets-v2/timeseries/index.ts +1 -0
  83. package/src/widgets-v2/timeseries/transforms.test.ts +49 -0
  84. package/src/widgets-v2/timeseries/transforms.ts +31 -0
  85. package/dist/category-CGS_eHr4.js +0 -719
  86. package/dist/category-CGS_eHr4.js.map +0 -1
  87. package/dist/change-column-CiVAjOUB.js +0 -1143
  88. package/dist/change-column-CiVAjOUB.js.map +0 -1
  89. package/dist/echart-Bdvbfx9s.js +0 -250
  90. package/dist/echart-Bdvbfx9s.js.map +0 -1
  91. package/dist/legend-store-registry-Bo8U_qWM.js.map +0 -1
@@ -0,0 +1,1148 @@
1
+ import { jsx as y, jsxs as ee, Fragment as fe } from "react/jsx-runtime";
2
+ import { c as B } from "react/compiler-runtime";
3
+ import { useRef as Ae, useState as q, useEffect as ie, useLayoutEffect as De } from "react";
4
+ import { IconButton as U, InputAdornment as de, TextField as ze, useTheme as we, CircularProgress as Oe, MenuItem as _e, ListItemIcon as Fe, ListItemText as Ee, Menu as Le, Box as Pe, Typography as Re, DialogTitle as $e, DialogContent as Be, Dialog as Me, SvgIcon as He } from "@mui/material";
5
+ import { Search as xe, Clear as Ne, StackedBarChart as Ue, Close as Ce, ZoomIn as We, HighlightAlt as je, Percent as Ge, FileDownload as Ze, FullscreenExit as Ke, Fullscreen as Ve, LockOpen as Xe, Lock as qe, DragIndicator as Ye } from "@mui/icons-material";
6
+ import { debounce as Je } from "@carto/ps-utils";
7
+ import { u as j } from "./widget-context-DTGO0Yta.js";
8
+ import { v as se, i as te, h as Qe } from "./widget-store-registry-_W4Z4xp-.js";
9
+ import "zustand";
10
+ import "./lasso-tool-YLFRgb-S.js";
11
+ import "./cjs-D4KH3azB.js";
12
+ import { T as G } from "./tooltip-BDnrRKrp.js";
13
+ import { a as re, u as et, b as tt } from "./use-transform-DXPN3nY7.js";
14
+ import "zustand/vanilla";
15
+ import "zustand/middleware";
16
+ import "zustand/react/shallow";
17
+ import { c as lt } from "./transforms-Cdx4fkU5.js";
18
+ import { b as ot } from "./exports-Cx-f6m6U.js";
19
+ import { createPortal as nt } from "react-dom";
20
+ import { useSensors as st, useSensor as ge, PointerSensor as it, KeyboardSensor as rt, DndContext as at, closestCenter as ct } from "@dnd-kit/core";
21
+ import { useSortable as ft, sortableKeyboardCoordinates as dt, arrayMove as gt, SortableContext as ut, verticalListSortingStrategy as mt } from "@dnd-kit/sortable";
22
+ import { CSS as ht } from "@dnd-kit/utilities";
23
+ function pt(t, e) {
24
+ if (!e) return t;
25
+ const l = e.toLowerCase();
26
+ return Array.isArray(t) ? t.map((r) => Array.isArray(r) ? r.filter((a) => {
27
+ if (a == null) return !1;
28
+ if (typeof a == "object" && "name" in a) {
29
+ const i = a.name;
30
+ return (i == null ? "" : ue(i)).toLowerCase().includes(l);
31
+ }
32
+ return ue(a).toLowerCase().includes(l);
33
+ }) : r) : t;
34
+ }
35
+ function ue(t) {
36
+ return typeof t == "string" ? t : typeof t == "number" || typeof t == "boolean" ? String(t) : "";
37
+ }
38
+ const Ie = {
39
+ toggle: "Search",
40
+ placeholder: "Search…",
41
+ clearAriaLabel: "Clear search",
42
+ noResults: "No matches."
43
+ }, ce = {
44
+ toggle: {
45
+ p: 0.5,
46
+ "& .MuiSvgIcon-root": {
47
+ fontSize: 20
48
+ }
49
+ },
50
+ toggleActive: {
51
+ background: (t) => t.palette.primary.relatedLight
52
+ },
53
+ input: {
54
+ width: "100%",
55
+ mb: 1
56
+ }
57
+ }, bt = {
58
+ id: "searcher",
59
+ type: "data",
60
+ order: 20,
61
+ disables: ["lock-selection"]
62
+ };
63
+ function Ll(t) {
64
+ const e = B(20), {
65
+ labels: l,
66
+ icon: r,
67
+ iconProps: a,
68
+ initialEnabled: i
69
+ } = t, m = r === void 0 ? xe : r, v = i === void 0 ? !1 : i, S = j();
70
+ let h;
71
+ e[0] !== l ? (h = {
72
+ ...Ie,
73
+ ...l
74
+ }, e[0] = l, e[1] = h) : h = e[1];
75
+ const c = h, n = se(S, St);
76
+ let p;
77
+ e[2] !== n ? (p = (E) => pt(E, n), e[2] = n, e[3] = p) : p = e[3];
78
+ const _ = p;
79
+ let f;
80
+ e[4] !== v ? (f = {
81
+ initialEnabled: v
82
+ }, e[4] = v, e[5] = f) : f = e[5];
83
+ const {
84
+ enabled: b,
85
+ toggle: o
86
+ } = re(S, bt, _, f), d = b && ce.toggleActive;
87
+ let g;
88
+ e[6] !== d ? (g = {
89
+ ...ce.toggle,
90
+ ...d
91
+ }, e[6] = d, e[7] = g) : g = e[7];
92
+ let s;
93
+ e[8] !== m || e[9] !== a ? (s = /* @__PURE__ */ y(m, { fontSize: "small", ...a }), e[8] = m, e[9] = a, e[10] = s) : s = e[10];
94
+ let u;
95
+ e[11] !== b || e[12] !== c.toggle || e[13] !== g || e[14] !== s || e[15] !== o ? (u = /* @__PURE__ */ y(U, { size: "small", "aria-label": c.toggle, "aria-pressed": b, onClick: o, sx: g, children: s }), e[11] = b, e[12] = c.toggle, e[13] = g, e[14] = s, e[15] = o, e[16] = u) : u = e[16];
96
+ let A;
97
+ return e[17] !== c.toggle || e[18] !== u ? (A = /* @__PURE__ */ y(G, { title: c.toggle, children: u }), e[17] = c.toggle, e[18] = u, e[19] = A) : A = e[19], A;
98
+ }
99
+ function St(t) {
100
+ return t.transformStates.searcher?.searchText ?? "";
101
+ }
102
+ function me(t, e) {
103
+ te(t).setState((l) => ({
104
+ transformStates: {
105
+ ...l.transformStates,
106
+ searcher: {
107
+ enabled: l.transformStates.searcher?.enabled ?? !1,
108
+ ...l.transformStates.searcher,
109
+ searchText: e
110
+ }
111
+ }
112
+ }));
113
+ }
114
+ const vt = 300;
115
+ function xl(t) {
116
+ const e = B(26), {
117
+ labels: l,
118
+ debounceMs: r
119
+ } = t, a = r === void 0 ? vt : r, i = j();
120
+ let m;
121
+ e[0] !== l ? (m = {
122
+ ...Ie,
123
+ ...l
124
+ }, e[0] = l, e[1] = m) : m = e[1];
125
+ const v = m, S = se(i, yt), h = Ae(null);
126
+ let c;
127
+ e[2] !== i ? (c = () => te(i).getState().transformStates.searcher?.searchText ?? "", e[2] = i, e[3] = c) : c = e[3];
128
+ const [n, p] = q(c);
129
+ let _;
130
+ e[4] !== i ? (_ = (L) => me(i, L), e[4] = i, e[5] = _) : _ = e[5];
131
+ let f;
132
+ e[6] !== a || e[7] !== _ ? (f = Je(_, a), e[6] = a, e[7] = _, e[8] = f) : f = e[8];
133
+ const b = f;
134
+ let o;
135
+ e[9] !== b ? (o = (L) => {
136
+ const D = L.target.value;
137
+ p(D), b(D);
138
+ }, e[9] = b, e[10] = o) : o = e[10];
139
+ const d = o;
140
+ let g;
141
+ e[11] !== b || e[12] !== i ? (g = () => {
142
+ p(""), me(i, ""), b(""), h.current?.focus();
143
+ }, e[11] = b, e[12] = i, e[13] = g) : g = e[13];
144
+ const s = g;
145
+ if (!S)
146
+ return null;
147
+ let u;
148
+ e[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ y(de, { position: "start", children: /* @__PURE__ */ y(xe, { fontSize: "small" }) }), e[14] = u) : u = e[14];
149
+ let A;
150
+ e[15] !== s || e[16] !== n || e[17] !== v.clearAriaLabel ? (A = n ? /* @__PURE__ */ y(de, { position: "end", children: /* @__PURE__ */ y(U, { size: "small", edge: "end", "aria-label": v.clearAriaLabel, onClick: s, children: /* @__PURE__ */ y(Ne, { fontSize: "small" }) }) }) : null, e[15] = s, e[16] = n, e[17] = v.clearAriaLabel, e[18] = A) : A = e[18];
151
+ let E;
152
+ e[19] !== A ? (E = {
153
+ startAdornment: u,
154
+ endAdornment: A
155
+ }, e[19] = A, e[20] = E) : E = e[20];
156
+ let C;
157
+ return e[21] !== d || e[22] !== n || e[23] !== v.placeholder || e[24] !== E ? (C = /* @__PURE__ */ y(ze, { inputRef: h, size: "small", fullWidth: !0, variant: "filled", placeholder: v.placeholder, value: n, onChange: d, autoFocus: !0, "aria-label": v.placeholder, sx: ce.input, InputProps: E }), e[21] = d, e[22] = n, e[23] = v.placeholder, e[24] = E, e[25] = C) : C = e[25], C;
158
+ }
159
+ function yt(t) {
160
+ return t.transformStates.searcher?.enabled ?? !1;
161
+ }
162
+ const At = (t) => {
163
+ if (t == null || typeof t != "object") return t;
164
+ const e = t, l = Array.isArray(e.series) ? e.series : [], r = l.length === 0 ? [{
165
+ stack: "total"
166
+ }] : l.map((a) => a == null || typeof a != "object" ? a : {
167
+ ...a,
168
+ stack: "total"
169
+ });
170
+ return {
171
+ ...e,
172
+ series: r
173
+ };
174
+ }, _t = {
175
+ on: "Unstack series",
176
+ off: "Stack series"
177
+ }, he = {
178
+ toggle: {
179
+ p: 0.5,
180
+ "& .MuiSvgIcon-root": {
181
+ fontSize: 20
182
+ }
183
+ },
184
+ toggleActive: {
185
+ background: (t) => t.palette.primary.relatedLight
186
+ }
187
+ }, Et = {
188
+ id: "stack-toggle",
189
+ type: "config",
190
+ order: 30
191
+ };
192
+ function Cl(t) {
193
+ const e = B(18), {
194
+ initialEnabled: l,
195
+ labels: r,
196
+ icon: a,
197
+ iconProps: i
198
+ } = t, m = l === void 0 ? !1 : l, v = a === void 0 ? Ue : a, S = j();
199
+ let h;
200
+ e[0] !== r ? (h = {
201
+ ..._t,
202
+ ...r
203
+ }, e[0] = r, e[1] = h) : h = e[1];
204
+ const c = h;
205
+ let n;
206
+ e[2] !== m ? (n = {
207
+ initialEnabled: m
208
+ }, e[2] = m, e[3] = n) : n = e[3];
209
+ const {
210
+ enabled: p,
211
+ toggle: _
212
+ } = re(S, Et, At, n), f = p ? c.on : c.off, b = p && he.toggleActive;
213
+ let o;
214
+ e[4] !== b ? (o = {
215
+ ...he.toggle,
216
+ ...b
217
+ }, e[4] = b, e[5] = o) : o = e[5];
218
+ let d;
219
+ e[6] !== v || e[7] !== i ? (d = /* @__PURE__ */ y(v, { fontSize: "small", ...i }), e[6] = v, e[7] = i, e[8] = d) : d = e[8];
220
+ let g;
221
+ e[9] !== p || e[10] !== o || e[11] !== d || e[12] !== _ || e[13] !== f ? (g = /* @__PURE__ */ y(U, { size: "small", "aria-label": f, "aria-pressed": p, onClick: _, sx: o, children: d }), e[9] = p, e[10] = o, e[11] = d, e[12] = _, e[13] = f, e[14] = g) : g = e[14];
222
+ let s;
223
+ return e[15] !== g || e[16] !== f ? (s = /* @__PURE__ */ y(G, { title: f, children: g }), e[15] = g, e[16] = f, e[17] = s) : s = e[17], s;
224
+ }
225
+ const Lt = {
226
+ toggle: "Show less"
227
+ }, xt = {
228
+ toggle: {
229
+ p: 0.5,
230
+ "& .MuiSvgIcon-root": {
231
+ fontSize: 20
232
+ }
233
+ }
234
+ }, pe = "show-all";
235
+ function Il(t) {
236
+ const e = B(14), {
237
+ labels: l,
238
+ icon: r,
239
+ iconProps: a
240
+ } = t, i = r === void 0 ? Ce : r, m = j();
241
+ let v;
242
+ e[0] !== l ? (v = {
243
+ ...Lt,
244
+ ...l
245
+ }, e[0] = l, e[1] = v) : v = e[1];
246
+ const S = v;
247
+ let h;
248
+ e[2] !== m ? (h = () => Ct(m, !1), e[2] = m, e[3] = h) : h = e[3];
249
+ let c;
250
+ e[4] !== i || e[5] !== a ? (c = /* @__PURE__ */ y(i, { fontSize: "small", ...a }), e[4] = i, e[5] = a, e[6] = c) : c = e[6];
251
+ let n;
252
+ e[7] !== S.toggle || e[8] !== h || e[9] !== c ? (n = /* @__PURE__ */ y(U, { size: "small", "aria-label": S.toggle, "aria-pressed": !0, onClick: h, sx: xt.toggle, children: c }), e[7] = S.toggle, e[8] = h, e[9] = c, e[10] = n) : n = e[10];
253
+ let p;
254
+ return e[11] !== S.toggle || e[12] !== n ? (p = /* @__PURE__ */ y(G, { title: S.toggle, children: n }), e[11] = S.toggle, e[12] = n, e[13] = p) : p = e[13], p;
255
+ }
256
+ function Ct(t, e) {
257
+ te(t).setState((l) => ({
258
+ transformStates: {
259
+ ...l.transformStates,
260
+ [pe]: {
261
+ ...l.transformStates[pe],
262
+ enabled: e
263
+ }
264
+ }
265
+ }));
266
+ }
267
+ const It = {
268
+ on: "Disable zoom",
269
+ off: "Enable zoom"
270
+ }, be = {
271
+ toggle: {
272
+ p: 0.5,
273
+ "& .MuiSvgIcon-root": {
274
+ fontSize: 20
275
+ }
276
+ },
277
+ toggleActive: {
278
+ background: (t) => t.palette.primary.relatedLight
279
+ }
280
+ }, Tt = {
281
+ id: "zoom-toggle",
282
+ type: "config",
283
+ order: 20
284
+ };
285
+ function Tl(t) {
286
+ const e = B(31), {
287
+ initialEnabled: l,
288
+ labels: r,
289
+ icon: a,
290
+ iconProps: i,
291
+ axes: m
292
+ } = t, v = l === void 0 ? !1 : l, S = a === void 0 ? We : a, h = j(), c = we();
293
+ let n;
294
+ e[0] !== r ? (n = {
295
+ ...It,
296
+ ...r
297
+ }, e[0] = r, e[1] = n) : n = e[1];
298
+ const p = n;
299
+ let _;
300
+ e[2] !== m ? (_ = m ? m.includes("x") : !0, e[2] = m, e[3] = _) : _ = e[3];
301
+ const f = _;
302
+ let b;
303
+ e[4] !== m ? (b = m ? m.includes("y") : !1, e[4] = m, e[5] = b) : b = e[5];
304
+ const o = b;
305
+ let d;
306
+ if (e[6] !== f || e[7] !== o || e[8] !== c) {
307
+ const w = [];
308
+ f && w.push("x"), o && w.push("y"), d = lt(c, {
309
+ axes: w
310
+ }), e[6] = f, e[7] = o, e[8] = c, e[9] = d;
311
+ } else
312
+ d = e[9];
313
+ const g = d;
314
+ let s;
315
+ e[10] !== v ? (s = {
316
+ initialEnabled: v
317
+ }, e[10] = v, e[11] = s) : s = e[11];
318
+ const {
319
+ enabled: u,
320
+ toggle: A
321
+ } = re(h, Tt, g, s);
322
+ let E;
323
+ e[12] !== u || e[13] !== h || e[14] !== A ? (E = () => {
324
+ u && Qe(h)?.setOption({}, {
325
+ replaceMerge: ["dataZoom"]
326
+ }), A();
327
+ }, e[12] = u, e[13] = h, e[14] = A, e[15] = E) : E = e[15];
328
+ const C = E, L = u ? p.on : p.off, D = u ? "active" : void 0, I = u && be.toggleActive;
329
+ let z;
330
+ e[16] !== I ? (z = {
331
+ ...be.toggle,
332
+ ...I
333
+ }, e[16] = I, e[17] = z) : z = e[17];
334
+ let x;
335
+ e[18] !== S || e[19] !== i ? (x = /* @__PURE__ */ y(S, { fontSize: "small", ...i }), e[18] = S, e[19] = i, e[20] = x) : x = e[20];
336
+ let T;
337
+ e[21] !== u || e[22] !== C || e[23] !== z || e[24] !== x || e[25] !== D || e[26] !== L ? (T = /* @__PURE__ */ y(U, { size: "small", "aria-label": L, "aria-pressed": u, onClick: C, className: D, sx: z, children: x }), e[21] = u, e[22] = C, e[23] = z, e[24] = x, e[25] = D, e[26] = L, e[27] = T) : T = e[27];
338
+ let k;
339
+ return e[28] !== T || e[29] !== L ? (k = /* @__PURE__ */ y(G, { title: L, children: T }), e[28] = T, e[29] = L, e[30] = k) : k = e[30], k;
340
+ }
341
+ const kt = (t) => {
342
+ if (t == null || typeof t != "object") return t;
343
+ const e = t;
344
+ return {
345
+ ...e,
346
+ brush: {
347
+ toolbox: ["rect", "clear"],
348
+ xAxisIndex: "all",
349
+ brushLink: "all",
350
+ outOfBrush: {
351
+ colorAlpha: 0.15
352
+ }
353
+ },
354
+ toolbox: {
355
+ ...e.toolbox ?? {},
356
+ show: !1,
357
+ feature: {
358
+ ...e.toolbox?.feature ?? {},
359
+ brush: {
360
+ type: ["rect", "clear"]
361
+ }
362
+ }
363
+ }
364
+ };
365
+ }, Dt = {
366
+ on: "Disable brush selection",
367
+ off: "Enable brush selection"
368
+ }, Se = {
369
+ toggle: {
370
+ p: 0.5,
371
+ "& .MuiSvgIcon-root": {
372
+ fontSize: 20
373
+ }
374
+ },
375
+ toggleActive: {
376
+ background: (t) => t.palette.primary.relatedLight
377
+ }
378
+ }, zt = {
379
+ id: "brush-toggle",
380
+ type: "config",
381
+ order: 25
382
+ };
383
+ function kl(t) {
384
+ const e = B(33), {
385
+ initialEnabled: l,
386
+ brushType: r,
387
+ brushMode: a,
388
+ selection: i,
389
+ labels: m,
390
+ icon: v,
391
+ iconProps: S
392
+ } = t, h = l === void 0 ? !1 : l, c = r === void 0 ? "lineX" : r, n = a === void 0 ? "multiple" : a, p = v === void 0 ? je : v, _ = j();
393
+ let f;
394
+ e[0] !== m ? (f = {
395
+ ...Dt,
396
+ ...m
397
+ }, e[0] = m, e[1] = f) : f = e[1];
398
+ const b = f;
399
+ let o;
400
+ e[2] !== h ? (o = {
401
+ initialEnabled: h
402
+ }, e[2] = h, e[3] = o) : o = e[3];
403
+ const {
404
+ enabled: d,
405
+ toggle: g
406
+ } = re(_, zt, kt, o), s = et(_);
407
+ let u, A;
408
+ e[4] !== n || e[5] !== c || e[6] !== s || e[7] !== d ? (u = () => {
409
+ if (!s)
410
+ return;
411
+ if (!d) {
412
+ s.dispatchAction({
413
+ type: "takeGlobalCursor"
414
+ }), s.dispatchAction({
415
+ type: "brush",
416
+ areas: []
417
+ });
418
+ return;
419
+ }
420
+ const w = () => {
421
+ s.dispatchAction({
422
+ type: "takeGlobalCursor",
423
+ key: "brush",
424
+ brushOption: {
425
+ brushType: c,
426
+ brushMode: n
427
+ }
428
+ });
429
+ }, O = () => w();
430
+ return s.on("finished", O), w(), () => {
431
+ s.off("finished", O);
432
+ };
433
+ }, A = [s, d, c, n], e[4] = n, e[5] = c, e[6] = s, e[7] = d, e[8] = u, e[9] = A) : (u = e[8], A = e[9]), ie(u, A);
434
+ let E;
435
+ e[10] !== s || e[11] !== d || e[12] !== i?.length ? (E = () => {
436
+ !s || !d || i?.length === 0 && s.dispatchAction({
437
+ type: "brush",
438
+ areas: []
439
+ });
440
+ }, e[10] = s, e[11] = d, e[12] = i?.length, e[13] = E) : E = e[13];
441
+ let C;
442
+ e[14] !== s || e[15] !== d || e[16] !== i ? (C = [s, d, i], e[14] = s, e[15] = d, e[16] = i, e[17] = C) : C = e[17], ie(E, C);
443
+ const L = d ? b.on : b.off, D = d ? "active" : void 0, I = d && Se.toggleActive;
444
+ let z;
445
+ e[18] !== I ? (z = {
446
+ ...Se.toggle,
447
+ ...I
448
+ }, e[18] = I, e[19] = z) : z = e[19];
449
+ let x;
450
+ e[20] !== p || e[21] !== S ? (x = /* @__PURE__ */ y(p, { fontSize: "small", ...S }), e[20] = p, e[21] = S, e[22] = x) : x = e[22];
451
+ let T;
452
+ e[23] !== d || e[24] !== D || e[25] !== z || e[26] !== x || e[27] !== g || e[28] !== L ? (T = /* @__PURE__ */ y(U, { size: "small", "aria-label": L, "aria-pressed": d, onClick: g, className: D, sx: z, children: x }), e[23] = d, e[24] = D, e[25] = z, e[26] = x, e[27] = g, e[28] = L, e[29] = T) : T = e[29];
453
+ let k;
454
+ return e[30] !== T || e[31] !== L ? (k = /* @__PURE__ */ y(G, { title: L, children: T }), e[30] = T, e[31] = L, e[32] = k) : k = e[32], k;
455
+ }
456
+ function wt(t) {
457
+ return Array.isArray(t) ? t.every((e) => e != null && typeof e == "object" && "value" in e && typeof e.value == "number") : !1;
458
+ }
459
+ const Ot = (t) => Array.isArray(t) ? t.map((e) => {
460
+ if (!wt(e)) return e;
461
+ const l = e.reduce((r, a) => r + Math.abs(a.value), 0);
462
+ return l <= 0 ? e : e.map((r) => ({
463
+ ...r,
464
+ value: r.value / l * 100
465
+ }));
466
+ }) : t;
467
+ function Ft(t) {
468
+ const e = new Intl.NumberFormat(t, {
469
+ style: "percent",
470
+ minimumFractionDigits: 0,
471
+ maximumFractionDigits: 2
472
+ });
473
+ return (l) => typeof l != "number" || !Number.isFinite(l) ? String(l) : e.format(l / 100);
474
+ }
475
+ const Pt = {
476
+ on: "Show absolute values",
477
+ off: "Show relative values"
478
+ }, ve = {
479
+ toggle: {
480
+ p: 0.5,
481
+ "& .MuiSvgIcon-root": {
482
+ fontSize: 20
483
+ }
484
+ },
485
+ toggleActive: {
486
+ background: (t) => t.palette.primary.relatedLight
487
+ }
488
+ }, Rt = {
489
+ id: "relative-data",
490
+ type: "data",
491
+ order: 15
492
+ };
493
+ function Dl(t) {
494
+ const e = B(26), {
495
+ initialEnabled: l,
496
+ locale: r,
497
+ labels: a,
498
+ icon: i,
499
+ iconProps: m,
500
+ transform: v
501
+ } = t, S = l === void 0 ? !1 : l, h = i === void 0 ? Ge : i, c = j();
502
+ let n;
503
+ e[0] !== a ? (n = {
504
+ ...Pt,
505
+ ...a
506
+ }, e[0] = a, e[1] = n) : n = e[1];
507
+ const p = n;
508
+ let _;
509
+ e[2] !== S ? (_ = {
510
+ initialEnabled: S
511
+ }, e[2] = S, e[3] = _) : _ = e[3];
512
+ const {
513
+ enabled: f,
514
+ toggle: b
515
+ } = re(c, Rt, v ?? Ot, _);
516
+ let o;
517
+ e[4] !== r ? (o = Ft(r), e[4] = r, e[5] = o) : o = e[5];
518
+ const d = o, g = se(c, $t);
519
+ let s, u;
520
+ e[6] !== f || e[7] !== c || e[8] !== d || e[9] !== g ? (s = () => {
521
+ te(c).setState({
522
+ formatter: f ? d : g
523
+ });
524
+ }, u = [c, f, d, g], e[6] = f, e[7] = c, e[8] = d, e[9] = g, e[10] = s, e[11] = u) : (s = e[10], u = e[11]), ie(s, u);
525
+ const A = f ? p.on : p.off, E = f && ve.toggleActive;
526
+ let C;
527
+ e[12] !== E ? (C = {
528
+ ...ve.toggle,
529
+ ...E
530
+ }, e[12] = E, e[13] = C) : C = e[13];
531
+ let L;
532
+ e[14] !== h || e[15] !== m ? (L = /* @__PURE__ */ y(h, { fontSize: "small", ...m }), e[14] = h, e[15] = m, e[16] = L) : L = e[16];
533
+ let D;
534
+ e[17] !== f || e[18] !== L || e[19] !== C || e[20] !== b || e[21] !== A ? (D = /* @__PURE__ */ y(U, { size: "small", "aria-label": A, "aria-pressed": f, onClick: b, sx: C, children: L }), e[17] = f, e[18] = L, e[19] = C, e[20] = b, e[21] = A, e[22] = D) : D = e[22];
535
+ let I;
536
+ return e[23] !== D || e[24] !== A ? (I = /* @__PURE__ */ y(G, { title: A, children: D }), e[23] = D, e[24] = A, e[25] = I) : I = e[25], I;
537
+ }
538
+ function $t(t) {
539
+ return t.rawFormatter;
540
+ }
541
+ const Bt = {
542
+ trigger: "Download",
543
+ loading: "Downloading…",
544
+ error: "Download failed"
545
+ };
546
+ function zl(t) {
547
+ const e = B(36), {
548
+ items: l,
549
+ labels: r,
550
+ icon: a,
551
+ iconProps: i,
552
+ onError: m
553
+ } = t, v = a === void 0 ? Ze : a;
554
+ let S;
555
+ e[0] !== r ? (S = {
556
+ ...Bt,
557
+ ...r
558
+ }, e[0] = r, e[1] = S) : S = e[1];
559
+ const h = S, [c, n] = q(null), [p, _] = q(!1), [f, b] = q(null);
560
+ let o;
561
+ e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = ($) => {
562
+ b(null), n($.currentTarget);
563
+ }, e[2] = o) : o = e[2];
564
+ const d = o;
565
+ let g;
566
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = () => n(null), e[3] = g) : g = e[3];
567
+ const s = g;
568
+ let u;
569
+ e[4] !== p || e[5] !== m ? (u = ($) => {
570
+ $.disabled || p || (s(), _(!0), b(null), $.resolve().then((R) => {
571
+ const {
572
+ url: W,
573
+ filename: X,
574
+ revoke: V
575
+ } = R;
576
+ ot({
577
+ url: W,
578
+ filename: $.filename ?? X
579
+ }), V && setTimeout(V, 0);
580
+ }).catch((R) => {
581
+ const W = R instanceof Error ? R : new Error(String(R));
582
+ b(W), m?.(W);
583
+ }).finally(() => {
584
+ _(!1);
585
+ }));
586
+ }, e[4] = p, e[5] = m, e[6] = u) : u = e[6];
587
+ const A = u, E = p ? h.loading : f ? h.error : h.trigger, C = !!c || p, L = c ? "true" : void 0, D = p || void 0, I = f ? "true" : void 0, z = p || l.length === 0, x = C ? "active" : void 0;
588
+ let T;
589
+ e[7] !== v || e[8] !== i || e[9] !== p ? (T = p ? /* @__PURE__ */ y(Oe, { size: 18, color: "inherit" }) : /* @__PURE__ */ y(v, { fontSize: "small", ...i }), e[7] = v, e[8] = i, e[9] = p, e[10] = T) : T = e[10];
590
+ let k;
591
+ e[11] !== x || e[12] !== T || e[13] !== L || e[14] !== D || e[15] !== I || e[16] !== z || e[17] !== E ? (k = /* @__PURE__ */ y(U, { size: "small", "aria-label": E, "aria-haspopup": "true", "aria-expanded": L, "aria-busy": D, "data-error": I, disabled: z, onClick: d, className: x, children: T }), e[11] = x, e[12] = T, e[13] = L, e[14] = D, e[15] = I, e[16] = z, e[17] = E, e[18] = k) : k = e[18];
592
+ let w;
593
+ e[19] !== k || e[20] !== E ? (w = /* @__PURE__ */ y(G, { title: E, children: k }), e[19] = k, e[20] = E, e[21] = w) : w = e[21];
594
+ const O = !!c;
595
+ let F, P;
596
+ e[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (F = {
597
+ vertical: "bottom",
598
+ horizontal: "right"
599
+ }, P = {
600
+ vertical: "top",
601
+ horizontal: "right"
602
+ }, e[22] = F, e[23] = P) : (F = e[22], P = e[23]);
603
+ let H;
604
+ if (e[24] !== l || e[25] !== A) {
605
+ let $;
606
+ e[27] !== A ? ($ = (R) => /* @__PURE__ */ ee(_e, { disabled: R.disabled, onClick: () => {
607
+ A(R);
608
+ }, children: [
609
+ R.icon && /* @__PURE__ */ y(Fe, { sx: {
610
+ color: "text.primary"
611
+ }, children: R.icon }),
612
+ /* @__PURE__ */ y(Ee, { children: R.label })
613
+ ] }, R.id), e[27] = A, e[28] = $) : $ = e[28], H = l.map($), e[24] = l, e[25] = A, e[26] = H;
614
+ } else
615
+ H = e[26];
616
+ let N;
617
+ e[29] !== c || e[30] !== O || e[31] !== H ? (N = /* @__PURE__ */ y(Le, { anchorEl: c, open: O, onClose: s, variant: "menu", elevation: 8, anchorOrigin: F, transformOrigin: P, children: H }), e[29] = c, e[30] = O, e[31] = H, e[32] = N) : N = e[32];
618
+ let K;
619
+ return e[33] !== w || e[34] !== N ? (K = /* @__PURE__ */ ee(fe, { children: [
620
+ w,
621
+ N
622
+ ] }), e[33] = w, e[34] = N, e[35] = K) : K = e[35], K;
623
+ }
624
+ const Te = {
625
+ open: "Open in full screen",
626
+ close: "Exit full screen"
627
+ }, Q = {
628
+ // Inline shell where the portaled body lives when fullscreen is closed.
629
+ // Real flex-column box (not `display: contents`) so that:
630
+ // 1. when the body is moved into the modal, we can pin a `min-height`
631
+ // to keep the widget card from collapsing — the inline shell is
632
+ // empty for that interval, and a layout-less wrapper would make
633
+ // the card squish a frame before the modal covers it (visible
634
+ // blink).
635
+ // 2. nested `flex: 1` (e.g. Widget.State's CaptureBox) still grows —
636
+ // this shell preserves the column-flex inheritance it would have
637
+ // had directly under `Widget.Content`.
638
+ // `gap: 1` mirrors `Widget.Content`'s gap so the body's siblings
639
+ // (Subheader / capture box / note) keep their spacing.
640
+ inlineSlot: {
641
+ display: "flex",
642
+ flexDirection: "column",
643
+ flex: 1,
644
+ minHeight: 0,
645
+ gap: 1
646
+ },
647
+ trigger: {
648
+ p: 0.5,
649
+ "& .MuiSvgIcon-root": {
650
+ fontSize: 20
651
+ }
652
+ },
653
+ triggerActive: {
654
+ background: (t) => t.palette.primary.relatedLight
655
+ },
656
+ dialogPaper: {
657
+ width: "90vw",
658
+ height: "90vh",
659
+ maxWidth: "none",
660
+ maxHeight: "none"
661
+ },
662
+ dialogTitle: {
663
+ display: "flex",
664
+ alignItems: "center",
665
+ justifyContent: "space-between",
666
+ gap: 1,
667
+ py: 3,
668
+ pr: 3,
669
+ pb: 2
670
+ },
671
+ titleText: {
672
+ minWidth: 0,
673
+ overflow: "hidden",
674
+ textOverflow: "ellipsis",
675
+ whiteSpace: "nowrap"
676
+ },
677
+ dialogContent: {
678
+ display: "flex",
679
+ flexDirection: "column",
680
+ gap: 1,
681
+ py: 3,
682
+ px: 2.5,
683
+ overflow: "auto"
684
+ }
685
+ };
686
+ function Mt(t) {
687
+ const e = B(20), {
688
+ labels: l,
689
+ enterIcon: r,
690
+ exitIcon: a,
691
+ iconProps: i
692
+ } = t, m = r === void 0 ? Ve : r, v = a === void 0 ? Ke : a, S = j();
693
+ let h;
694
+ e[0] !== l ? (h = {
695
+ ...Te,
696
+ ...l
697
+ }, e[0] = l, e[1] = h) : h = e[1];
698
+ const c = h, n = se(S, Ht);
699
+ let p;
700
+ e[2] !== S || e[3] !== n ? (p = () => {
701
+ te(S).setState({
702
+ isFullScreen: !n
703
+ });
704
+ }, e[2] = S, e[3] = n, e[4] = p) : p = e[4];
705
+ const _ = p, f = n ? c.close : c.open, b = n ? v : m, o = n ? "active" : void 0, d = n && Q.triggerActive;
706
+ let g;
707
+ e[5] !== d ? (g = {
708
+ ...Q.trigger,
709
+ ...d
710
+ }, e[5] = d, e[6] = g) : g = e[6];
711
+ let s;
712
+ e[7] !== b || e[8] !== i ? (s = /* @__PURE__ */ y(b, { fontSize: "small", ...i }), e[7] = b, e[8] = i, e[9] = s) : s = e[9];
713
+ let u;
714
+ e[10] !== _ || e[11] !== n || e[12] !== o || e[13] !== g || e[14] !== s || e[15] !== f ? (u = /* @__PURE__ */ y(U, { size: "small", "aria-label": f, "aria-pressed": n, onClick: _, className: o, sx: g, children: s }), e[10] = _, e[11] = n, e[12] = o, e[13] = g, e[14] = s, e[15] = f, e[16] = u) : u = e[16];
715
+ let A;
716
+ return e[17] !== u || e[18] !== f ? (A = /* @__PURE__ */ y(G, { title: f, children: u }), e[17] = u, e[18] = f, e[19] = A) : A = e[19], A;
717
+ }
718
+ function Ht(t) {
719
+ return t.isFullScreen ?? !1;
720
+ }
721
+ function Nt(t) {
722
+ const e = B(44), {
723
+ children: l,
724
+ title: r,
725
+ labels: a,
726
+ closeIcon: i,
727
+ iconProps: m
728
+ } = t, v = i === void 0 ? Ce : i, S = j();
729
+ let h;
730
+ e[0] !== a ? (h = {
731
+ ...Te,
732
+ ...a
733
+ }, e[0] = a, e[1] = h) : h = e[1];
734
+ const c = h, n = se(S, jt), [p, _] = q(null), [f, b] = q(null), [o] = q(Wt);
735
+ let d;
736
+ e[2] !== S ? (d = () => {
737
+ te(S).setState({
738
+ isFullScreen: !1
739
+ });
740
+ }, e[2] = S, e[3] = d) : d = e[3];
741
+ const g = d;
742
+ let s, u;
743
+ e[4] !== f || e[5] !== p || e[6] !== n || e[7] !== o ? (s = () => {
744
+ if (!o || !p)
745
+ return;
746
+ const P = n ? f : p;
747
+ P && o.parentNode !== P && P.appendChild(o), n || Gt(p);
748
+ }, u = [n, p, f, o], e[4] = f, e[5] = p, e[6] = n, e[7] = o, e[8] = s, e[9] = u) : (s = e[8], u = e[9]), De(s, u);
749
+ const A = `widget-fullscreen-title-${S}`;
750
+ let E, C;
751
+ if (e[10] !== l || e[11] !== n || e[12] !== o) {
752
+ const P = l(n);
753
+ e[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = /* @__PURE__ */ y(Pe, { ref: _, sx: Q.inlineSlot }), e[15] = E) : E = e[15], C = o ? nt(P, o) : null, e[10] = l, e[11] = n, e[12] = o, e[13] = E, e[14] = C;
754
+ } else
755
+ E = e[13], C = e[14];
756
+ let L;
757
+ e[16] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (L = {
758
+ sx: Q.dialogPaper
759
+ }, e[16] = L) : L = e[16];
760
+ let D;
761
+ e[17] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (D = {
762
+ zIndex: Ut
763
+ }, e[17] = D) : D = e[17];
764
+ let I;
765
+ e[18] !== r ? (I = /* @__PURE__ */ y(Re, { variant: "subtitle1", component: "span", sx: Q.titleText, children: r }), e[18] = r, e[19] = I) : I = e[19];
766
+ let z;
767
+ e[20] !== v || e[21] !== m ? (z = /* @__PURE__ */ y(v, { fontSize: "small", ...m }), e[20] = v, e[21] = m, e[22] = z) : z = e[22];
768
+ let x;
769
+ e[23] !== c.close || e[24] !== g || e[25] !== z ? (x = /* @__PURE__ */ y(U, { size: "medium", "aria-label": c.close, onClick: g, children: z }), e[23] = c.close, e[24] = g, e[25] = z, e[26] = x) : x = e[26];
770
+ let T;
771
+ e[27] !== c.close || e[28] !== x ? (T = /* @__PURE__ */ y(G, { title: c.close, children: x }), e[27] = c.close, e[28] = x, e[29] = T) : T = e[29];
772
+ let k;
773
+ e[30] !== I || e[31] !== T || e[32] !== A ? (k = /* @__PURE__ */ ee($e, { id: A, component: "div", sx: Q.dialogTitle, children: [
774
+ I,
775
+ T
776
+ ] }), e[30] = I, e[31] = T, e[32] = A, e[33] = k) : k = e[33];
777
+ let w;
778
+ e[34] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ y(Be, { ref: b, sx: Q.dialogContent }), e[34] = w) : w = e[34];
779
+ let O;
780
+ e[35] !== g || e[36] !== n || e[37] !== k || e[38] !== A ? (O = /* @__PURE__ */ ee(Me, { open: n, onClose: g, PaperProps: L, "aria-labelledby": A, sx: D, children: [
781
+ k,
782
+ w
783
+ ] }), e[35] = g, e[36] = n, e[37] = k, e[38] = A, e[39] = O) : O = e[39];
784
+ let F;
785
+ return e[40] !== O || e[41] !== E || e[42] !== C ? (F = /* @__PURE__ */ ee(fe, { children: [
786
+ E,
787
+ C,
788
+ O
789
+ ] }), e[40] = O, e[41] = E, e[42] = C, e[43] = F) : F = e[43], F;
790
+ }
791
+ function Ut(t) {
792
+ return t.zIndex.tooltip + 1;
793
+ }
794
+ function Wt() {
795
+ if (typeof document > "u")
796
+ return null;
797
+ const t = document.createElement("div");
798
+ return t.style.display = "contents", t;
799
+ }
800
+ function jt(t) {
801
+ return t.isFullScreen ?? !1;
802
+ }
803
+ function Gt(t) {
804
+ t.style.minHeight = "";
805
+ const e = t.getBoundingClientRect().height;
806
+ e > 0 && (t.style.minHeight = `${e}px`);
807
+ }
808
+ const wl = {
809
+ Trigger: Mt,
810
+ Slot: Nt
811
+ };
812
+ function Zt(t, e) {
813
+ if (e.length === 0 || !Array.isArray(t)) return t;
814
+ const l = new Set(e);
815
+ return t.map((r) => Array.isArray(r) ? r.filter((a) => {
816
+ if (a == null) return !1;
817
+ if (typeof a == "object" && "name" in a) {
818
+ const i = a.name;
819
+ return typeof i == "string" || typeof i == "number" ? l.has(i) : !1;
820
+ }
821
+ return !1;
822
+ }) : r);
823
+ }
824
+ const Kt = {
825
+ lock: "Lock selection",
826
+ unlock: "Unlock selection",
827
+ disabled: "Select rows to lock"
828
+ }, ye = {
829
+ toggle: {
830
+ p: 0.5,
831
+ "& .MuiSvgIcon-root": {
832
+ fontSize: 20
833
+ }
834
+ },
835
+ toggleActive: {
836
+ background: (t) => t.palette.primary.relatedLight
837
+ }
838
+ }, Vt = {
839
+ id: "lock-selection",
840
+ type: "data",
841
+ order: 30
842
+ };
843
+ function Ol(t) {
844
+ const e = B(28), {
845
+ selection: l,
846
+ lockedItems: r,
847
+ onLockChange: a,
848
+ labels: i,
849
+ lockIcon: m,
850
+ unlockIcon: v,
851
+ iconProps: S,
852
+ filterFn: h
853
+ } = t, c = m === void 0 ? qe : m, n = v === void 0 ? Xe : v, p = h === void 0 ? Zt : h, _ = j();
854
+ let f;
855
+ e[0] !== i ? (f = {
856
+ ...Kt,
857
+ ...i
858
+ }, e[0] = i, e[1] = f) : f = e[1];
859
+ const b = f, o = r.length > 0, d = o || l.length > 0, g = Xt(r, p);
860
+ let s;
861
+ e[2] !== o ? (s = {
862
+ initialEnabled: o
863
+ }, e[2] = o, e[3] = s) : s = e[3];
864
+ const {
865
+ enabled: u,
866
+ setEnabled: A
867
+ } = tt(_, g, s);
868
+ let E, C;
869
+ e[4] !== u || e[5] !== o || e[6] !== A ? (E = () => {
870
+ u !== o && A(o);
871
+ }, C = [u, o, A], e[4] = u, e[5] = o, e[6] = A, e[7] = E, e[8] = C) : (E = e[7], C = e[8]), ie(E, C);
872
+ let L;
873
+ e[9] !== o || e[10] !== a || e[11] !== l ? (L = () => {
874
+ a(o ? [] : [...l]);
875
+ }, e[9] = o, e[10] = a, e[11] = l, e[12] = L) : L = e[12];
876
+ const D = L, I = d ? o ? b.unlock : b.lock : b.disabled, z = o ? n : c, x = !d, T = o && ye.toggleActive;
877
+ let k;
878
+ e[13] !== T ? (k = {
879
+ ...ye.toggle,
880
+ ...T
881
+ }, e[13] = T, e[14] = k) : k = e[14];
882
+ let w;
883
+ e[15] !== z || e[16] !== S ? (w = /* @__PURE__ */ y(z, { fontSize: "small", ...S }), e[15] = z, e[16] = S, e[17] = w) : w = e[17];
884
+ let O;
885
+ e[18] !== D || e[19] !== o || e[20] !== k || e[21] !== w || e[22] !== x || e[23] !== I ? (O = /* @__PURE__ */ y("span", { children: /* @__PURE__ */ y(U, { size: "small", "aria-label": I, "aria-pressed": o, disabled: x, onClick: D, sx: k, children: w }) }), e[18] = D, e[19] = o, e[20] = k, e[21] = w, e[22] = x, e[23] = I, e[24] = O) : O = e[24];
886
+ let F;
887
+ return e[25] !== O || e[26] !== I ? (F = /* @__PURE__ */ y(G, { title: I, children: O }), e[25] = O, e[26] = I, e[27] = F) : F = e[27], F;
888
+ }
889
+ function Xt(t, e) {
890
+ const l = B(6), r = Ae(e);
891
+ let a;
892
+ l[0] !== e ? (a = () => {
893
+ r.current = e;
894
+ }, l[0] = e, l[1] = a) : a = l[1], ie(a);
895
+ let i;
896
+ l[2] !== t ? (i = (S) => r.current(S, t), l[2] = t, l[3] = i) : i = l[3];
897
+ const m = i;
898
+ let v;
899
+ return l[4] !== m ? (v = [{
900
+ descriptor: Vt,
901
+ fn: m
902
+ }], l[4] = m, l[5] = v) : v = l[5], v;
903
+ }
904
+ function qt(t) {
905
+ const e = B(3);
906
+ let l;
907
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ y("path", { fill: "currentColor", fillRule: "evenodd", d: "M14.25 2.25H3.75c-.825 0-1.5.675-1.5 1.5v10.5c0 .825.675 1.5 1.5 1.5h10.5c.825 0 1.5-.675 1.5-1.5V3.75c0-.825-.675-1.5-1.5-1.5m-3.75 12h-3V3.75h3zM3.75 3.75H6v10.5H3.75zM12 14.25V3.75h2.25v10.5z", clipRule: "evenodd" }), e[0] = l) : l = e[0];
908
+ let r;
909
+ return e[1] !== t ? (r = /* @__PURE__ */ y(He, { viewBox: "0 0 18 18", ...t, children: l }), e[1] = t, e[2] = r) : r = e[2], r;
910
+ }
911
+ const Yt = {
912
+ trigger: "Change column order",
913
+ reset: "Reset to default"
914
+ }, ne = {
915
+ toggle: {
916
+ p: 0.5,
917
+ "& .MuiSvgIcon-root": {
918
+ fontSize: 20
919
+ }
920
+ },
921
+ toggleActive: {
922
+ background: (t) => t.palette.primary.relatedLight
923
+ },
924
+ menuPaper: {
925
+ overflow: "hidden",
926
+ minWidth: 220
927
+ },
928
+ item: {
929
+ cursor: "grab",
930
+ "&:focus-visible": {
931
+ outline: "2px solid",
932
+ outlineColor: "primary.main",
933
+ outlineOffset: -2
934
+ }
935
+ },
936
+ itemDragging: {
937
+ opacity: 0.5,
938
+ cursor: "grabbing"
939
+ },
940
+ dragHandle: {
941
+ color: "text.secondary",
942
+ mr: 1,
943
+ fontSize: 18
944
+ }
945
+ };
946
+ function Jt(t) {
947
+ const e = B(21), {
948
+ id: l,
949
+ label: r,
950
+ dragHandleIcon: a
951
+ } = t, i = a === void 0 ? Ye : a;
952
+ let m;
953
+ e[0] !== l ? (m = {
954
+ id: l
955
+ }, e[0] = l, e[1] = m) : m = e[1];
956
+ const {
957
+ attributes: v,
958
+ listeners: S,
959
+ setNodeRef: h,
960
+ transform: c,
961
+ transition: n,
962
+ isDragging: p
963
+ } = ft(m);
964
+ let _;
965
+ e[2] !== c ? (_ = ht.Transform.toString(c ? {
966
+ ...c,
967
+ x: 0
968
+ } : null), e[2] = c, e[3] = _) : _ = e[3];
969
+ let f;
970
+ e[4] !== _ || e[5] !== n ? (f = {
971
+ transform: _,
972
+ transition: n
973
+ }, e[4] = _, e[5] = n, e[6] = f) : f = e[6];
974
+ const b = f, o = p && ne.itemDragging;
975
+ let d;
976
+ e[7] !== o ? (d = {
977
+ ...ne.item,
978
+ ...o
979
+ }, e[7] = o, e[8] = d) : d = e[8];
980
+ let g;
981
+ e[9] !== i ? (g = /* @__PURE__ */ y(i, { sx: ne.dragHandle }), e[9] = i, e[10] = g) : g = e[10];
982
+ let s;
983
+ e[11] !== r ? (s = /* @__PURE__ */ y(Ee, { children: r }), e[11] = r, e[12] = s) : s = e[12];
984
+ let u;
985
+ return e[13] !== v || e[14] !== S || e[15] !== h || e[16] !== d || e[17] !== g || e[18] !== s || e[19] !== b ? (u = /* @__PURE__ */ ee(_e, { ref: h, style: b, ...v, ...S, role: "menuitem", tabIndex: 0, sx: d, children: [
986
+ g,
987
+ s
988
+ ] }), e[13] = v, e[14] = S, e[15] = h, e[16] = d, e[17] = g, e[18] = s, e[19] = b, e[20] = u) : u = e[20], u;
989
+ }
990
+ function Fl(t) {
991
+ const e = B(52), {
992
+ columns: l,
993
+ labels: r,
994
+ icon: a,
995
+ iconProps: i,
996
+ dragHandleIcon: m
997
+ } = t, v = a === void 0 ? qt : a, S = j();
998
+ let h;
999
+ e[0] !== r ? (h = {
1000
+ ...Yt,
1001
+ ...r
1002
+ }, e[0] = r, e[1] = h) : h = e[1];
1003
+ const c = h, [n, p] = q(null), _ = se(S, tl);
1004
+ let f;
1005
+ if (e[2] !== _ || e[3] !== l) {
1006
+ e: {
1007
+ const M = l.map(el);
1008
+ if (!_ || _.length === 0) {
1009
+ f = M;
1010
+ break e;
1011
+ }
1012
+ const Y = new Set(M), J = /* @__PURE__ */ new Set(), oe = [];
1013
+ for (const Z of _)
1014
+ Y.has(Z) && !J.has(Z) && (oe.push(Z), J.add(Z));
1015
+ for (const Z of M)
1016
+ J.has(Z) || oe.push(Z);
1017
+ f = oe;
1018
+ }
1019
+ e[2] = _, e[3] = l, e[4] = f;
1020
+ } else
1021
+ f = e[4];
1022
+ const b = f;
1023
+ let o;
1024
+ e[5] !== l ? (o = new Map(l.map(Qt)), e[5] = l, e[6] = o) : o = e[6];
1025
+ const d = o;
1026
+ let g;
1027
+ if (e[7] !== d || e[8] !== b) {
1028
+ g = [];
1029
+ for (const M of b) {
1030
+ const Y = d.get(M);
1031
+ Y != null && g.push(Y);
1032
+ }
1033
+ e[7] = d, e[8] = b, e[9] = g;
1034
+ } else
1035
+ g = e[9];
1036
+ const s = g;
1037
+ let u;
1038
+ e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = {
1039
+ coordinateGetter: dt
1040
+ }, e[10] = u) : u = e[10];
1041
+ const A = st(ge(it), ge(rt, u));
1042
+ let E;
1043
+ e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = (M) => {
1044
+ M.stopPropagation(), p(M.currentTarget);
1045
+ }, e[11] = E) : E = e[11];
1046
+ const C = E;
1047
+ let L;
1048
+ e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (L = () => p(null), e[12] = L) : L = e[12];
1049
+ const D = L;
1050
+ let I;
1051
+ e[13] !== S || e[14] !== b ? (I = (M) => {
1052
+ const {
1053
+ active: Y,
1054
+ over: J
1055
+ } = M;
1056
+ if (!J || Y.id === J.id)
1057
+ return;
1058
+ const oe = b.indexOf(String(Y.id)), Z = b.indexOf(String(J.id));
1059
+ if (oe === -1 || Z === -1)
1060
+ return;
1061
+ const ke = gt([...b], oe, Z);
1062
+ te(S).setState({
1063
+ columnOrder: ke
1064
+ });
1065
+ }, e[13] = S, e[14] = b, e[15] = I) : I = e[15];
1066
+ const z = I;
1067
+ if (l.length < 2)
1068
+ return null;
1069
+ const x = !!n, T = x ? "change-column-menu" : void 0, k = x ? "true" : void 0, w = x ? "active" : void 0, O = x && ne.toggleActive;
1070
+ let F;
1071
+ e[16] !== O ? (F = {
1072
+ ...ne.toggle,
1073
+ ...O
1074
+ }, e[16] = O, e[17] = F) : F = e[17];
1075
+ let P;
1076
+ e[18] !== v || e[19] !== i ? (P = /* @__PURE__ */ y(v, { fontSize: "small", ...i }), e[18] = v, e[19] = i, e[20] = P) : P = e[20];
1077
+ let H;
1078
+ e[21] !== c.trigger || e[22] !== x || e[23] !== k || e[24] !== w || e[25] !== F || e[26] !== P || e[27] !== T ? (H = /* @__PURE__ */ y(U, { size: "small", "aria-label": c.trigger, "aria-pressed": x, "aria-haspopup": "true", "aria-controls": T, "aria-expanded": k, onClick: C, className: w, sx: F, children: P }), e[21] = c.trigger, e[22] = x, e[23] = k, e[24] = w, e[25] = F, e[26] = P, e[27] = T, e[28] = H) : H = e[28];
1079
+ let N;
1080
+ e[29] !== c.trigger || e[30] !== H ? (N = /* @__PURE__ */ y(G, { title: c.trigger, children: H }), e[29] = c.trigger, e[30] = H, e[31] = N) : N = e[31];
1081
+ let K, $, R;
1082
+ e[32] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (K = {
1083
+ vertical: "bottom",
1084
+ horizontal: "right"
1085
+ }, $ = {
1086
+ vertical: "top",
1087
+ horizontal: "right"
1088
+ }, R = {
1089
+ paper: {
1090
+ sx: ne.menuPaper
1091
+ }
1092
+ }, e[32] = K, e[33] = $, e[34] = R) : (K = e[32], $ = e[33], R = e[34]);
1093
+ let W;
1094
+ e[35] !== m || e[36] !== s ? (W = s.map((M) => /* @__PURE__ */ y(Jt, { id: M.id, label: M.label, dragHandleIcon: m }, M.id)), e[35] = m, e[36] = s, e[37] = W) : W = e[37];
1095
+ let X;
1096
+ e[38] !== b || e[39] !== W ? (X = /* @__PURE__ */ y(ut, { items: b, strategy: mt, children: W }), e[38] = b, e[39] = W, e[40] = X) : X = e[40];
1097
+ let V;
1098
+ e[41] !== n || e[42] !== x || e[43] !== X ? (V = /* @__PURE__ */ y(Le, { id: "change-column-menu", anchorEl: n, open: x, onClose: D, anchorOrigin: K, transformOrigin: $, slotProps: R, children: X }), e[41] = n, e[42] = x, e[43] = X, e[44] = V) : V = e[44];
1099
+ let le;
1100
+ e[45] !== z || e[46] !== A || e[47] !== V ? (le = /* @__PURE__ */ y(at, { sensors: A, collisionDetection: ct, onDragEnd: z, children: V }), e[45] = z, e[46] = A, e[47] = V, e[48] = le) : le = e[48];
1101
+ let ae;
1102
+ return e[49] !== N || e[50] !== le ? (ae = /* @__PURE__ */ ee(fe, { children: [
1103
+ N,
1104
+ le
1105
+ ] }), e[49] = N, e[50] = le, e[51] = ae) : ae = e[51], ae;
1106
+ }
1107
+ function Qt(t) {
1108
+ return [t.id, t];
1109
+ }
1110
+ function el(t) {
1111
+ return t.id;
1112
+ }
1113
+ function tl(t) {
1114
+ return t.columnOrder;
1115
+ }
1116
+ export {
1117
+ kl as B,
1118
+ Fl as C,
1119
+ Dt as D,
1120
+ wl as F,
1121
+ Ol as L,
1122
+ Dl as R,
1123
+ pe as S,
1124
+ Tl as Z,
1125
+ Yt as a,
1126
+ Bt as b,
1127
+ Te as c,
1128
+ Kt as d,
1129
+ Pt as e,
1130
+ Ie as f,
1131
+ Lt as g,
1132
+ _t as h,
1133
+ It as i,
1134
+ zl as j,
1135
+ xl as k,
1136
+ Ll as l,
1137
+ Il as m,
1138
+ Cl as n,
1139
+ kt as o,
1140
+ At as p,
1141
+ Ft as q,
1142
+ Zt as r,
1143
+ pt as s,
1144
+ me as t,
1145
+ Ct as u,
1146
+ Ot as v
1147
+ };
1148
+ //# sourceMappingURL=change-column-Bhcxmp-r.js.map