@carto/ps-react-ui 4.6.3 → 4.7.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 (38) hide show
  1. package/dist/{download-config-C3I0jWIL.js → download-config-DNLkypdN.js} +8 -7
  2. package/dist/{download-config-C3I0jWIL.js.map → download-config-DNLkypdN.js.map} +1 -1
  3. package/dist/shared-resize-observer-98b1SK1e.js +17 -0
  4. package/dist/shared-resize-observer-98b1SK1e.js.map +1 -0
  5. package/dist/types/widgets/actions/brush-toggle/brush-overlay.d.ts +24 -0
  6. package/dist/types/widgets/actions/brush-toggle/brush-toggle.d.ts +15 -10
  7. package/dist/types/widgets/actions/brush-toggle/hit-test.d.ts +19 -0
  8. package/dist/types/widgets/actions/brush-toggle/hit-test.test.d.ts +1 -0
  9. package/dist/types/widgets/actions/brush-toggle/style.d.ts +8 -0
  10. package/dist/types/widgets/actions/brush-toggle/types.d.ts +35 -1
  11. package/dist/widgets/actions.js +985 -772
  12. package/dist/widgets/actions.js.map +1 -1
  13. package/dist/widgets/bar.js +1 -1
  14. package/dist/widgets/category.js +9 -8
  15. package/dist/widgets/category.js.map +1 -1
  16. package/dist/widgets/echart.js +79 -91
  17. package/dist/widgets/echart.js.map +1 -1
  18. package/dist/widgets/formula.js +43 -42
  19. package/dist/widgets/formula.js.map +1 -1
  20. package/dist/widgets/histogram.js +7 -6
  21. package/dist/widgets/histogram.js.map +1 -1
  22. package/dist/widgets/markdown.js +15 -14
  23. package/dist/widgets/markdown.js.map +1 -1
  24. package/dist/widgets/pie.js +1 -1
  25. package/dist/widgets/scatterplot.js +1 -1
  26. package/dist/widgets/spread.js +47 -46
  27. package/dist/widgets/spread.js.map +1 -1
  28. package/dist/widgets/table.js +17 -16
  29. package/dist/widgets/table.js.map +1 -1
  30. package/dist/widgets/timeseries.js +1 -1
  31. package/dist/widgets/utils.js +1 -1
  32. package/package.json +3 -1
  33. package/src/widgets/actions/brush-toggle/brush-overlay.tsx +386 -0
  34. package/src/widgets/actions/brush-toggle/brush-toggle.tsx +88 -152
  35. package/src/widgets/actions/brush-toggle/hit-test.test.ts +65 -0
  36. package/src/widgets/actions/brush-toggle/hit-test.ts +45 -0
  37. package/src/widgets/actions/brush-toggle/style.ts +32 -0
  38. package/src/widgets/actions/brush-toggle/types.ts +36 -1
@@ -1,18 +1,20 @@
1
- import { jsx as b, jsxs as ne, Fragment as he } from "react/jsx-runtime";
2
- import { c as U } from "react/compiler-runtime";
3
- import { IconButton as K, DialogContent as Ae, Dialog as We, Typography as Pe, DialogTitle as Be, CircularProgress as Re, MenuItem as xe, ListItemIcon as $e, ListItemText as Ee, Menu as Ce, useTheme as Fe, Box as ke, TextField as Me, InputAdornment as be, SvgIcon as Ge } from "@mui/material";
4
- import { w as g } from "../widget-store-Bw5zRUGg.js";
5
- import { u as Q } from "../use-widget-selector-DFl2hW0R.js";
6
- import { FullscreenOutlined as Ze, Close as Ve, FileDownloadOutlined as He, PercentOutlined as Ne, SubdirectoryArrowLeftOutlined as je, ZoomInOutlined as Ue, CheckBoxOutlined as Ke, SearchOutlined as Le, ClearOutlined as Ye, HighlightAltOutlined as qe } from "@mui/icons-material";
7
- import { useState as ge, useRef as le, useEffect as $ } from "react";
8
- import { a as gn, d as hn } from "../exports-Cr43OCul.js";
1
+ import { jsx as x, jsxs as oe, Fragment as de } from "react/jsx-runtime";
2
+ import { c as J } from "react/compiler-runtime";
3
+ import { IconButton as Q, DialogContent as Me, Dialog as Ae, Typography as Be, DialogTitle as We, CircularProgress as Fe, MenuItem as Le, ListItemIcon as $e, ListItemText as ke, Menu as we, useTheme as Ne, Box as Pe, TextField as Ge, InputAdornment as pe, SvgIcon as Ze } from "@mui/material";
4
+ import { w as b, u as Ve } from "../widget-store-Bw5zRUGg.js";
5
+ import { u as te } from "../use-widget-selector-DFl2hW0R.js";
6
+ import { FullscreenOutlined as He, Close as je, FileDownloadOutlined as Ue, PercentOutlined as Xe, SubdirectoryArrowLeftOutlined as Ke, ZoomInOutlined as Ye, CheckBoxOutlined as qe, SearchOutlined as Re, ClearOutlined as Je, HighlightAltOutlined as Qe } from "@mui/icons-material";
7
+ import { useState as ie, useRef as le, useEffect as H, useSyncExternalStore as Se } from "react";
8
+ import { a as Pn, d as Rn } from "../exports-Cr43OCul.js";
9
9
  import "../lasso-tool-BYbxrJ-7.js";
10
10
  import "../cjs-D4KH3azB.js";
11
- import { T as ee } from "../tooltip-BDnrRKrp.js";
12
- import { b as Je, a as Qe, D as Xe, g as pe } from "../utils-BOhInag6.js";
13
- import { useSensors as et, useSensor as Se, PointerSensor as tt, KeyboardSensor as nt, DndContext as ot, closestCenter as lt } from "@dnd-kit/core";
14
- import { useSortable as rt, sortableKeyboardCoordinates as st, arrayMove as it, SortableContext as at, verticalListSortingStrategy as ct } from "@dnd-kit/sortable";
15
- import { CSS as dt } from "@dnd-kit/utilities";
11
+ import { T as re } from "../tooltip-BDnrRKrp.js";
12
+ import { b as et, a as tt, D as nt } from "../utils-BOhInag6.js";
13
+ import { useSensors as ot, useSensor as xe, PointerSensor as lt, KeyboardSensor as rt, DndContext as it, closestCenter as st } from "@dnd-kit/core";
14
+ import { useSortable as ct, sortableKeyboardCoordinates as at, arrayMove as dt, SortableContext as ut, verticalListSortingStrategy as ft } from "@dnd-kit/sortable";
15
+ import { CSS as mt } from "@dnd-kit/utilities";
16
+ import { createPortal as gt } from "react-dom";
17
+ import { o as ht } from "../shared-resize-observer-98b1SK1e.js";
16
18
  const ve = {
17
19
  title: {
18
20
  container: {
@@ -29,302 +31,302 @@ const ve = {
29
31
  spacing: n
30
32
  }) => n(1)
31
33
  }
32
- }, ut = {};
33
- function tn(n) {
34
- const e = U(42), {
34
+ }, bt = {};
35
+ function pn(n) {
36
+ const e = J(42), {
35
37
  id: t,
36
- labels: f,
37
- children: p,
38
- Icon: m,
39
- IconButtonProps: S,
40
- DialogContentProps: _,
41
- DialogProps: T
42
- } = n, o = _ === void 0 ? ut : _;
43
- let l, r;
38
+ labels: l,
39
+ children: u,
40
+ Icon: c,
41
+ IconButtonProps: p,
42
+ DialogContentProps: E,
43
+ DialogProps: S
44
+ } = n, o = E === void 0 ? bt : E;
45
+ let r, i;
44
46
  e[0] !== o ? ({
45
- sx: r,
46
- ...l
47
- } = o, e[0] = o, e[1] = l, e[2] = r) : (l = e[1], r = e[2]);
47
+ sx: i,
48
+ ...r
49
+ } = o, e[0] = o, e[1] = r, e[2] = i) : (r = e[1], i = e[2]);
48
50
  const {
49
- isFullScreen: s,
50
- title: a
51
- } = Q(t, ft);
52
- let u;
53
- e[3] !== t ? (u = (W) => {
54
- g.setWidget(t, {
55
- isFullScreen: W.isFullScreen
51
+ isFullScreen: a,
52
+ title: d
53
+ } = te(t, pt);
54
+ let g;
55
+ e[3] !== t ? (g = (B) => {
56
+ b.setWidget(t, {
57
+ isFullScreen: B.isFullScreen
56
58
  });
57
- }, e[3] = t, e[4] = u) : u = e[4];
58
- const i = u;
59
- let c;
60
- e[5] !== i ? (c = () => i({
59
+ }, e[3] = t, e[4] = g) : g = e[4];
60
+ const f = g;
61
+ let h;
62
+ e[5] !== f ? (h = () => f({
61
63
  isFullScreen: !0
62
- }), e[5] = i, e[6] = c) : c = e[6];
63
- let d;
64
- e[7] !== m ? (d = m ?? /* @__PURE__ */ b(Ze, {}), e[7] = m, e[8] = d) : d = e[8];
65
- let v;
66
- e[9] !== S || e[10] !== c || e[11] !== d ? (v = /* @__PURE__ */ b(K, { ...S, onClick: c, children: d }), e[9] = S, e[10] = c, e[11] = d, e[12] = v) : v = e[12];
67
- const O = !!s, C = f?.ariaLabel ?? `fullscreen-dialog-title-${t}`;
68
- let k;
69
- e[13] !== i ? (k = () => i({
64
+ }), e[5] = f, e[6] = h) : h = e[6];
65
+ let m;
66
+ e[7] !== c ? (m = c ?? /* @__PURE__ */ x(He, {}), e[7] = c, e[8] = m) : m = e[8];
67
+ let y;
68
+ e[9] !== p || e[10] !== h || e[11] !== m ? (y = /* @__PURE__ */ x(Q, { ...p, onClick: h, children: m }), e[9] = p, e[10] = h, e[11] = m, e[12] = y) : y = e[12];
69
+ const s = !!a, w = l?.ariaLabel ?? `fullscreen-dialog-title-${t}`;
70
+ let C;
71
+ e[13] !== f ? (C = () => f({
70
72
  isFullScreen: !1
71
- }), e[13] = i, e[14] = k) : k = e[14];
72
- const A = `fullscreen-dialog-title-${t}`;
73
- let w;
74
- e[15] !== a ? (w = /* @__PURE__ */ b(Pe, { variant: "subtitle1", component: "span", children: a }), e[15] = a, e[16] = w) : w = e[16];
73
+ }), e[13] = f, e[14] = C) : C = e[14];
74
+ const P = `fullscreen-dialog-title-${t}`;
75
75
  let D;
76
- e[17] !== i ? (D = () => i({
76
+ e[15] !== d ? (D = /* @__PURE__ */ x(Be, { variant: "subtitle1", component: "span", children: d }), e[15] = d, e[16] = D) : D = e[16];
77
+ let O;
78
+ e[17] !== f ? (O = () => f({
77
79
  isFullScreen: !1
78
- }), e[17] = i, e[18] = D) : D = e[18];
79
- let x;
80
- e[19] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ b(Ve, {}), e[19] = x) : x = e[19];
81
- let E;
82
- e[20] !== D ? (E = /* @__PURE__ */ b(K, { onClick: D, children: x }), e[20] = D, e[21] = E) : E = e[21];
83
- let z;
84
- e[22] !== A || e[23] !== w || e[24] !== E ? (z = /* @__PURE__ */ ne(Be, { id: A, sx: ve.title.container, children: [
85
- w,
86
- E
87
- ] }), e[22] = A, e[23] = w, e[24] = E, e[25] = z) : z = e[25];
88
- let y;
89
- e[26] !== r ? (y = {
80
+ }), e[17] = f, e[18] = O) : O = e[18];
81
+ let T;
82
+ e[19] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (T = /* @__PURE__ */ x(je, {}), e[19] = T) : T = e[19];
83
+ let R;
84
+ e[20] !== O ? (R = /* @__PURE__ */ x(Q, { onClick: O, children: T }), e[20] = O, e[21] = R) : R = e[21];
85
+ let L;
86
+ e[22] !== P || e[23] !== D || e[24] !== R ? (L = /* @__PURE__ */ oe(We, { id: P, sx: ve.title.container, children: [
87
+ D,
88
+ R
89
+ ] }), e[22] = P, e[23] = D, e[24] = R, e[25] = L) : L = e[25];
90
+ let v;
91
+ e[26] !== i ? (v = {
90
92
  ...ve.content,
91
- ...r
92
- }, e[26] = r, e[27] = y) : y = e[27];
93
- let h;
94
- e[28] !== l || e[29] !== p || e[30] !== y ? (h = /* @__PURE__ */ b(Ae, { sx: y, ...l, children: p }), e[28] = l, e[29] = p, e[30] = y, e[31] = h) : h = e[31];
93
+ ...i
94
+ }, e[26] = i, e[27] = v) : v = e[27];
95
+ let _;
96
+ e[28] !== r || e[29] !== u || e[30] !== v ? (_ = /* @__PURE__ */ x(Me, { sx: v, ...r, children: u }), e[28] = r, e[29] = u, e[30] = v, e[31] = _) : _ = e[31];
95
97
  let I;
96
- e[32] !== T || e[33] !== z || e[34] !== h || e[35] !== O || e[36] !== C || e[37] !== k ? (I = /* @__PURE__ */ ne(We, { maxWidth: !1, open: O, keepMounted: !0, "aria-labelledby": C, ...T, onClose: k, children: [
97
- z,
98
- h
99
- ] }), e[32] = T, e[33] = z, e[34] = h, e[35] = O, e[36] = C, e[37] = k, e[38] = I) : I = e[38];
100
- let L;
101
- return e[39] !== I || e[40] !== v ? (L = /* @__PURE__ */ ne(he, { children: [
102
- v,
98
+ e[32] !== S || e[33] !== L || e[34] !== _ || e[35] !== s || e[36] !== w || e[37] !== C ? (I = /* @__PURE__ */ oe(Ae, { maxWidth: !1, open: s, keepMounted: !0, "aria-labelledby": w, ...S, onClose: C, children: [
99
+ L,
100
+ _
101
+ ] }), e[32] = S, e[33] = L, e[34] = _, e[35] = s, e[36] = w, e[37] = C, e[38] = I) : I = e[38];
102
+ let z;
103
+ return e[39] !== I || e[40] !== y ? (z = /* @__PURE__ */ oe(de, { children: [
104
+ y,
103
105
  I
104
- ] }), e[39] = I, e[40] = v, e[41] = L) : L = e[41], L;
106
+ ] }), e[39] = I, e[40] = y, e[41] = z) : z = e[41], z;
105
107
  }
106
- function ft(n) {
108
+ function pt(n) {
107
109
  return {
108
110
  isFullScreen: n?.isFullScreen,
109
111
  title: n?.title
110
112
  };
111
113
  }
112
- const mt = {};
113
- function nn(n) {
114
- const e = U(31), {
114
+ const St = {};
115
+ function Sn(n) {
116
+ const e = J(31), {
115
117
  id: t,
116
- items: f,
117
- labels: p,
118
- Icon: m,
119
- IconButtonProps: S
120
- } = n, _ = p === void 0 ? mt : p, {
121
- data: T
122
- } = Q(t, gt), [o, l] = ge(!1), [r, s] = ge(null);
123
- let a;
124
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = (W) => {
125
- W.stopPropagation(), s(W.currentTarget);
126
- }, e[0] = a) : a = e[0];
127
- const u = a;
128
- let i;
129
- e[1] !== t ? (i = (W, P) => {
130
- const B = document.createElement("a");
131
- B.href = W, B.download = P.filename ?? t, B.style.display = "none", document.body.appendChild(B), B.click(), document.body.removeChild(B), P.callback?.(B.href);
132
- }, e[1] = t, e[2] = i) : i = e[2];
133
- const c = i;
118
+ items: l,
119
+ labels: u,
120
+ Icon: c,
121
+ IconButtonProps: p
122
+ } = n, E = u === void 0 ? St : u, {
123
+ data: S
124
+ } = te(t, xt), [o, r] = ie(!1), [i, a] = ie(null);
134
125
  let d;
135
- e[3] !== T || e[4] !== c ? (d = async (W, P) => {
136
- W.stopPropagation(), l(!0), s(null);
137
- const B = await P.modifier(T);
138
- if (!B) {
139
- l(!1);
126
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = (B) => {
127
+ B.stopPropagation(), a(B.currentTarget);
128
+ }, e[0] = d) : d = e[0];
129
+ const g = d;
130
+ let f;
131
+ e[1] !== t ? (f = (B, M) => {
132
+ const W = document.createElement("a");
133
+ W.href = B, W.download = M.filename ?? t, W.style.display = "none", document.body.appendChild(W), W.click(), document.body.removeChild(W), M.callback?.(W.href);
134
+ }, e[1] = t, e[2] = f) : f = e[2];
135
+ const h = f;
136
+ let m;
137
+ e[3] !== S || e[4] !== h ? (m = async (B, M) => {
138
+ B.stopPropagation(), r(!0), a(null);
139
+ const W = await M.modifier(S);
140
+ if (!W) {
141
+ r(!1);
140
142
  return;
141
143
  }
142
- c(B, P), l(!1);
143
- }, e[3] = T, e[4] = c, e[5] = d) : d = e[5];
144
- const v = d, O = _.ariaLabel ?? "download options", C = o || f.length === 0, k = o || r ? "active" : "";
145
- let A;
146
- e[6] !== m || e[7] !== o ? (A = o ? /* @__PURE__ */ b(Re, { size: 18, color: "inherit" }) : m ?? /* @__PURE__ */ b(He, {}), e[6] = m, e[7] = o, e[8] = A) : A = e[8];
147
- let w;
148
- e[9] !== S || e[10] !== O || e[11] !== C || e[12] !== k || e[13] !== A ? (w = /* @__PURE__ */ b(K, { size: "small", "aria-label": O, "aria-controls": "options-menu", "aria-haspopup": "true", onClick: u, ...S, disabled: C, className: k, children: A }), e[9] = S, e[10] = O, e[11] = C, e[12] = k, e[13] = A, e[14] = w) : w = e[14];
149
- let D, x;
150
- e[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (D = {
144
+ h(W, M), r(!1);
145
+ }, e[3] = S, e[4] = h, e[5] = m) : m = e[5];
146
+ const y = m, s = E.ariaLabel ?? "download options", w = o || l.length === 0, C = o || i ? "active" : "";
147
+ let P;
148
+ e[6] !== c || e[7] !== o ? (P = o ? /* @__PURE__ */ x(Fe, { size: 18, color: "inherit" }) : c ?? /* @__PURE__ */ x(Ue, {}), e[6] = c, e[7] = o, e[8] = P) : P = e[8];
149
+ let D;
150
+ e[9] !== p || e[10] !== s || e[11] !== w || e[12] !== C || e[13] !== P ? (D = /* @__PURE__ */ x(Q, { size: "small", "aria-label": s, "aria-controls": "options-menu", "aria-haspopup": "true", onClick: g, ...p, disabled: w, className: C, children: P }), e[9] = p, e[10] = s, e[11] = w, e[12] = C, e[13] = P, e[14] = D) : D = e[14];
151
+ let O, T;
152
+ e[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (O = {
151
153
  vertical: "bottom",
152
154
  horizontal: "right"
153
- }, x = {
155
+ }, T = {
154
156
  vertical: "top",
155
157
  horizontal: "right"
156
- }, e[15] = D, e[16] = x) : (D = e[15], x = e[16]);
157
- const E = !!r;
158
- let z, y;
159
- e[17] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (z = () => s(null), y = {
158
+ }, e[15] = O, e[16] = T) : (O = e[15], T = e[16]);
159
+ const R = !!i;
160
+ let L, v;
161
+ e[17] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (L = () => a(null), v = {
160
162
  sx: {
161
163
  paddingBottom: 0
162
164
  }
163
- }, e[17] = z, e[18] = y) : (z = e[17], y = e[18]);
164
- let h;
165
- if (e[19] !== v || e[20] !== f) {
166
- let W;
167
- e[22] !== v ? (W = (P) => /* @__PURE__ */ ne(xe, { disabled: P.disabled, onClick: (B) => {
168
- v(B, P);
165
+ }, e[17] = L, e[18] = v) : (L = e[17], v = e[18]);
166
+ let _;
167
+ if (e[19] !== y || e[20] !== l) {
168
+ let B;
169
+ e[22] !== y ? (B = (M) => /* @__PURE__ */ oe(Le, { disabled: M.disabled, onClick: (W) => {
170
+ y(W, M);
169
171
  }, children: [
170
- P.icon && /* @__PURE__ */ b($e, { sx: {
172
+ M.icon && /* @__PURE__ */ x($e, { sx: {
171
173
  color: "text.primary"
172
- }, children: P.icon }),
173
- /* @__PURE__ */ b(Ee, { children: P.label })
174
- ] }, P.id), e[22] = v, e[23] = W) : W = e[23], h = f.map(W), e[19] = v, e[20] = f, e[21] = h;
174
+ }, children: M.icon }),
175
+ /* @__PURE__ */ x(ke, { children: M.label })
176
+ ] }, M.id), e[22] = y, e[23] = B) : B = e[23], _ = l.map(B), e[19] = y, e[20] = l, e[21] = _;
175
177
  } else
176
- h = e[21];
178
+ _ = e[21];
177
179
  let I;
178
- e[24] !== r || e[25] !== E || e[26] !== h ? (I = /* @__PURE__ */ b(Ce, { variant: "menu", elevation: 8, anchorOrigin: D, transformOrigin: x, anchorEl: r, open: E, onClose: z, MenuListProps: y, children: h }), e[24] = r, e[25] = E, e[26] = h, e[27] = I) : I = e[27];
179
- let L;
180
- return e[28] !== I || e[29] !== w ? (L = /* @__PURE__ */ ne(he, { children: [
181
- w,
180
+ e[24] !== i || e[25] !== R || e[26] !== _ ? (I = /* @__PURE__ */ x(we, { variant: "menu", elevation: 8, anchorOrigin: O, transformOrigin: T, anchorEl: i, open: R, onClose: L, MenuListProps: v, children: _ }), e[24] = i, e[25] = R, e[26] = _, e[27] = I) : I = e[27];
181
+ let z;
182
+ return e[28] !== I || e[29] !== D ? (z = /* @__PURE__ */ oe(de, { children: [
183
+ D,
182
184
  I
183
- ] }), e[28] = I, e[29] = w, e[30] = L) : L = e[30], L;
185
+ ] }), e[28] = I, e[29] = D, e[30] = z) : z = e[30], z;
184
186
  }
185
- function gt(n) {
187
+ function xt(n) {
186
188
  return {
187
189
  data: n?.data
188
190
  };
189
191
  }
190
- const re = {
192
+ const se = {
191
193
  trigger: {
192
194
  '&[data-active="true"]': {
193
195
  background: (n) => n.palette.primary.relatedLight
194
196
  }
195
197
  }
196
198
  };
197
- function ht(n) {
198
- return n.reduce((e, t) => t.reduce((f, p) => {
199
- if (Array.isArray(p)) {
200
- const m = p.at(-1);
201
- return typeof m == "number" ? f + m : f;
199
+ function vt(n) {
200
+ return n.reduce((e, t) => t.reduce((l, u) => {
201
+ if (Array.isArray(u)) {
202
+ const c = u.at(-1);
203
+ return typeof c == "number" ? l + c : l;
202
204
  }
203
- return Object.entries(p).reduce((m, [S, _]) => S === "name" ? m : typeof _ == "number" ? m + _ : m, f);
205
+ return Object.entries(u).reduce((c, [p, E]) => p === "name" ? c : typeof E == "number" ? c + E : c, l);
204
206
  }, e), 0);
205
207
  }
206
- function bt(n, e) {
207
- return e === 0 ? n : n.map((t) => t.map((f) => {
208
- if (Array.isArray(f))
209
- return f.map((m, S) => S === f.length - 1 && typeof m == "number" ? m / e * 100 : m);
210
- const p = {};
211
- for (const [m, S] of Object.entries(f)) {
212
- if (m === "name") {
213
- p[m] = S;
208
+ function yt(n, e) {
209
+ return e === 0 ? n : n.map((t) => t.map((l) => {
210
+ if (Array.isArray(l))
211
+ return l.map((c, p) => p === l.length - 1 && typeof c == "number" ? c / e * 100 : c);
212
+ const u = {};
213
+ for (const [c, p] of Object.entries(l)) {
214
+ if (c === "name") {
215
+ u[c] = p;
214
216
  continue;
215
217
  }
216
- p[m] = typeof S == "number" ? S / e * 100 : S;
218
+ u[c] = typeof p == "number" ? p / e * 100 : p;
217
219
  }
218
- return p;
220
+ return u;
219
221
  }));
220
222
  }
221
- const ce = "relative-data", Ie = "relative-data-config";
222
- function on(n) {
223
- const e = U(36), {
223
+ const fe = "relative-data", ye = "relative-data-config";
224
+ function xn(n) {
225
+ const e = J(36), {
224
226
  id: t,
225
- order: f,
226
- defaultIsRelative: p,
227
- labels: m,
228
- Icon: S,
229
- IconButtonProps: _
230
- } = n, T = f === void 0 ? 10 : f, o = p === void 0 ? !1 : p, l = le(void 0);
231
- let r;
232
- e[0] !== o ? (r = (y) => ({
233
- isRelative: y?.isRelative ?? o
234
- }), e[0] = o, e[1] = r) : r = e[1];
227
+ order: l,
228
+ defaultIsRelative: u,
229
+ labels: c,
230
+ Icon: p,
231
+ IconButtonProps: E
232
+ } = n, S = l === void 0 ? 10 : l, o = u === void 0 ? !1 : u, r = le(void 0);
233
+ let i;
234
+ e[0] !== o ? (i = (v) => ({
235
+ isRelative: v?.isRelative ?? o
236
+ }), e[0] = o, e[1] = i) : i = e[1];
235
237
  const {
236
- isRelative: s
237
- } = Q(t, r);
238
- let a, u;
239
- e[2] !== o || e[3] !== t ? (a = () => {
240
- const y = g.getWidget(t);
241
- y?.isRelative === void 0 && (o ? g.setWidget(t, {
238
+ isRelative: a
239
+ } = te(t, i);
240
+ let d, g;
241
+ e[2] !== o || e[3] !== t ? (d = () => {
242
+ const v = b.getWidget(t);
243
+ v?.isRelative === void 0 && (o ? b.setWidget(t, {
242
244
  isRelative: !0,
243
- originalFormatter: y?.formatter,
244
- originalMax: y?.max
245
- }) : g.setWidget(t, {
245
+ originalFormatter: v?.formatter,
246
+ originalMax: v?.max
247
+ }) : b.setWidget(t, {
246
248
  isRelative: o
247
249
  }));
248
- }, u = [t, o], e[2] = o, e[3] = t, e[4] = a, e[5] = u) : (a = e[4], u = e[5]), $(a, u);
249
- let i, c;
250
- e[6] !== o || e[7] !== t || e[8] !== T ? (i = () => (g.registerTool(t, {
251
- id: ce,
252
- order: T,
250
+ }, g = [t, o], e[2] = o, e[3] = t, e[4] = d, e[5] = g) : (d = e[4], g = e[5]), H(d, g);
251
+ let f, h;
252
+ e[6] !== o || e[7] !== t || e[8] !== S ? (f = () => (b.registerTool(t, {
253
+ id: fe,
254
+ order: S,
253
255
  enabled: o,
254
- fn: pt
255
- }), () => g.unregisterTool(t, ce)), c = [t, T, o], e[6] = o, e[7] = t, e[8] = T, e[9] = i, e[10] = c) : (i = e[9], c = e[10]), $(i, c);
256
- let d, v;
257
- e[11] !== t || e[12] !== s ? (d = () => {
258
- g.setToolEnabled(t, ce, s);
259
- }, v = [t, s], e[11] = t, e[12] = s, e[13] = d, e[14] = v) : (d = e[13], v = e[14]), $(d, v);
260
- let O;
261
- e[15] !== t || e[16] !== T ? (O = () => (g.registerTool(t, {
262
- id: Ie,
256
+ fn: It
257
+ }), () => b.unregisterTool(t, fe)), h = [t, S, o], e[6] = o, e[7] = t, e[8] = S, e[9] = f, e[10] = h) : (f = e[9], h = e[10]), H(f, h);
258
+ let m, y;
259
+ e[11] !== t || e[12] !== a ? (m = () => {
260
+ b.setToolEnabled(t, fe, a);
261
+ }, y = [t, a], e[11] = t, e[12] = a, e[13] = m, e[14] = y) : (m = e[13], y = e[14]), H(m, y);
262
+ let s;
263
+ e[15] !== t || e[16] !== S ? (s = () => (b.registerTool(t, {
264
+ id: ye,
263
265
  type: "config",
264
- order: T,
266
+ order: S,
265
267
  enabled: !0,
266
- fn: (y) => {
267
- const h = y, I = g.getWidget(t), L = I?.sourceData != null && !(Array.isArray(I.sourceData) && I.sourceData.length === 0);
268
+ fn: (v) => {
269
+ const _ = v, I = b.getWidget(t), z = I?.sourceData != null && !(Array.isArray(I.sourceData) && I.sourceData.length === 0);
268
270
  if (I?.isRelative) {
269
- if (!L)
270
- return h;
271
- if (!l.current) {
272
- const W = I?.locale;
273
- l.current = (P) => new Intl.NumberFormat(W, {
271
+ if (!z)
272
+ return _;
273
+ if (!r.current) {
274
+ const B = I?.locale;
275
+ r.current = (M) => new Intl.NumberFormat(B, {
274
276
  style: "percent",
275
277
  minimumFractionDigits: 1,
276
278
  maximumFractionDigits: 1
277
- }).format(P / 100);
279
+ }).format(M / 100);
278
280
  }
279
281
  return {
280
- ...h,
281
- formatter: l.current,
282
+ ..._,
283
+ formatter: r.current,
282
284
  max: 100
283
285
  };
284
286
  }
285
- return l.current = void 0, I != null && "originalFormatter" in I ? {
286
- ...h,
287
+ return r.current = void 0, I != null && "originalFormatter" in I ? {
288
+ ..._,
287
289
  formatter: I.originalFormatter,
288
290
  max: I.originalMax
289
- } : h;
291
+ } : _;
290
292
  }
291
293
  }), () => {
292
- const y = g.getWidget(t);
293
- y?.isRelative && "originalFormatter" in y && g.setWidget(t, {
294
- formatter: y.originalFormatter,
295
- max: y.originalMax
296
- }), l.current = void 0, g.unregisterTool(t, Ie);
297
- }), e[15] = t, e[16] = T, e[17] = O) : O = e[17];
294
+ const v = b.getWidget(t);
295
+ v?.isRelative && "originalFormatter" in v && b.setWidget(t, {
296
+ formatter: v.originalFormatter,
297
+ max: v.originalMax
298
+ }), r.current = void 0, b.unregisterTool(t, ye);
299
+ }), e[15] = t, e[16] = S, e[17] = s) : s = e[17];
300
+ let w;
301
+ e[18] !== o || e[19] !== t || e[20] !== S ? (w = [t, S, o], e[18] = o, e[19] = t, e[20] = S, e[21] = w) : w = e[21], H(s, w);
298
302
  let C;
299
- e[18] !== o || e[19] !== t || e[20] !== T ? (C = [t, T, o], e[18] = o, e[19] = t, e[20] = T, e[21] = C) : C = e[21], $(O, C);
300
- let k;
301
- e[22] !== t || e[23] !== s ? (k = () => {
302
- const y = !s;
303
- if (l.current = void 0, y) {
304
- const h = g.getWidget(t);
305
- g.setWidget(t, {
303
+ e[22] !== t || e[23] !== a ? (C = () => {
304
+ const v = !a;
305
+ if (r.current = void 0, v) {
306
+ const _ = b.getWidget(t);
307
+ b.setWidget(t, {
306
308
  isRelative: !0,
307
- originalFormatter: h?.formatter,
308
- originalMax: h?.max
309
+ originalFormatter: _?.formatter,
310
+ originalMax: _?.max
309
311
  });
310
312
  } else
311
- g.setWidget(t, {
313
+ b.setWidget(t, {
312
314
  isRelative: !1
313
315
  });
314
- }, e[22] = t, e[23] = s, e[24] = k) : k = e[24];
315
- const A = k, w = s ? m?.absolute ?? "Show absolute values" : m?.relative ?? "Show relative values", D = m?.ariaLabel ?? w;
316
- let x;
317
- e[25] !== S ? (x = S ?? /* @__PURE__ */ b(Ne, {}), e[25] = S, e[26] = x) : x = e[26];
318
- let E;
319
- e[27] !== _ || e[28] !== A || e[29] !== s || e[30] !== D || e[31] !== x ? (E = /* @__PURE__ */ b(K, { size: "small", "aria-label": D, onClick: A, sx: re.trigger, "data-active": s, ..._, children: x }), e[27] = _, e[28] = A, e[29] = s, e[30] = D, e[31] = x, e[32] = E) : E = e[32];
320
- let z;
321
- return e[33] !== E || e[34] !== w ? (z = /* @__PURE__ */ b(ee, { title: w, children: E }), e[33] = E, e[34] = w, e[35] = z) : z = e[35], z;
316
+ }, e[22] = t, e[23] = a, e[24] = C) : C = e[24];
317
+ const P = C, D = a ? c?.absolute ?? "Show absolute values" : c?.relative ?? "Show relative values", O = c?.ariaLabel ?? D;
318
+ let T;
319
+ e[25] !== p ? (T = p ?? /* @__PURE__ */ x(Xe, {}), e[25] = p, e[26] = T) : T = e[26];
320
+ let R;
321
+ e[27] !== E || e[28] !== P || e[29] !== a || e[30] !== O || e[31] !== T ? (R = /* @__PURE__ */ x(Q, { size: "small", "aria-label": O, onClick: P, sx: se.trigger, "data-active": a, ...E, children: T }), e[27] = E, e[28] = P, e[29] = a, e[30] = O, e[31] = T, e[32] = R) : R = e[32];
322
+ let L;
323
+ return e[33] !== R || e[34] !== D ? (L = /* @__PURE__ */ x(re, { title: D, children: R }), e[33] = R, e[34] = D, e[35] = L) : L = e[35], L;
322
324
  }
323
- function pt(n) {
324
- const e = n, t = ht(e);
325
- return bt(e, t);
325
+ function It(n) {
326
+ const e = n, t = vt(e);
327
+ return yt(e, t);
326
328
  }
327
- const ye = {
329
+ const Ie = {
328
330
  container: {
329
331
  display: "flex",
330
332
  alignItems: "center",
@@ -337,596 +339,596 @@ const ye = {
337
339
  background: (n) => n.palette.primary.relatedLight
338
340
  }
339
341
  }
340
- }, de = "zoom-toggle";
341
- function ln(n) {
342
- const e = U(63), {
342
+ }, me = "zoom-toggle";
343
+ function vn(n) {
344
+ const e = J(63), {
343
345
  id: t,
344
- defaultZoom: f,
345
- defaultZoomStart: p,
346
- defaultZoomEnd: m,
347
- labels: S,
348
- Icon: _,
349
- ResetIcon: T,
346
+ defaultZoom: l,
347
+ defaultZoomStart: u,
348
+ defaultZoomEnd: c,
349
+ labels: p,
350
+ Icon: E,
351
+ ResetIcon: S,
350
352
  IconButtonProps: o
351
- } = n, l = f === void 0 ? !1 : f, r = p === void 0 ? 0 : p, s = m === void 0 ? 100 : m, a = Fe();
352
- let u;
353
- e[0] !== l || e[1] !== s || e[2] !== r ? (u = (R) => ({
354
- zoom: R?.zoom ?? l,
355
- zoomStart: R?.zoomStart ?? r,
356
- zoomEnd: R?.zoomEnd ?? s
357
- }), e[0] = l, e[1] = s, e[2] = r, e[3] = u) : u = e[3];
353
+ } = n, r = l === void 0 ? !1 : l, i = u === void 0 ? 0 : u, a = c === void 0 ? 100 : c, d = Ne();
354
+ let g;
355
+ e[0] !== r || e[1] !== a || e[2] !== i ? (g = (A) => ({
356
+ zoom: A?.zoom ?? r,
357
+ zoomStart: A?.zoomStart ?? i,
358
+ zoomEnd: A?.zoomEnd ?? a
359
+ }), e[0] = r, e[1] = a, e[2] = i, e[3] = g) : g = e[3];
358
360
  const {
359
- zoom: i,
360
- zoomStart: c,
361
- zoomEnd: d
362
- } = Q(t, u);
363
- let v, O;
364
- e[4] !== l || e[5] !== s || e[6] !== r || e[7] !== t ? (v = () => {
365
- g.getWidget(t)?.zoom === void 0 && g.setWidget(t, {
366
- zoom: l,
367
- zoomStart: r,
368
- zoomEnd: s
361
+ zoom: f,
362
+ zoomStart: h,
363
+ zoomEnd: m
364
+ } = te(t, g);
365
+ let y, s;
366
+ e[4] !== r || e[5] !== a || e[6] !== i || e[7] !== t ? (y = () => {
367
+ b.getWidget(t)?.zoom === void 0 && b.setWidget(t, {
368
+ zoom: r,
369
+ zoomStart: i,
370
+ zoomEnd: a
369
371
  });
370
- }, O = [t, l, r, s], e[4] = l, e[5] = s, e[6] = r, e[7] = t, e[8] = v, e[9] = O) : (v = e[8], O = e[9]), $(v, O);
371
- let C;
372
- e[10] !== t ? (C = (R) => {
373
- const j = R, N = j.start ?? j.batch?.[0]?.start, Y = j.end ?? j.batch?.[0]?.end;
374
- N !== void 0 && Y !== void 0 && g.setWidget(t, {
372
+ }, s = [t, r, i, a], e[4] = r, e[5] = a, e[6] = i, e[7] = t, e[8] = y, e[9] = s) : (y = e[8], s = e[9]), H(y, s);
373
+ let w;
374
+ e[10] !== t ? (w = (A) => {
375
+ const N = A, V = N.start ?? N.batch?.[0]?.start, X = N.end ?? N.batch?.[0]?.end;
376
+ V !== void 0 && X !== void 0 && b.setWidget(t, {
375
377
  zoom: !0,
376
- zoomStart: N,
377
- zoomEnd: Y
378
+ zoomStart: V,
379
+ zoomEnd: X
378
380
  });
379
- }, e[10] = t, e[11] = C) : C = e[11];
380
- const k = C;
381
- let A;
382
- e[12] !== l || e[13] !== k || e[14] !== t || e[15] !== a ? (A = () => (g.registerTool(t, {
383
- id: de,
381
+ }, e[10] = t, e[11] = w) : w = e[11];
382
+ const C = w;
383
+ let P;
384
+ e[12] !== r || e[13] !== C || e[14] !== t || e[15] !== d ? (P = () => (b.registerTool(t, {
385
+ id: me,
384
386
  type: "config",
385
387
  order: 20,
386
- enabled: l,
387
- fn: (R) => {
388
- const j = R, N = j.option, Y = j.onEvents ?? {}, oe = g.getWidget(t), te = oe?.zoomStart ?? 0, ae = oe?.zoomEnd ?? 100, q = N?.legend, X = q?.show !== !1 && q !== void 0, Oe = parseInt(a?.spacing?.(4) ?? "32"), ze = Je({
389
- start: te,
390
- end: ae
388
+ enabled: r,
389
+ fn: (A) => {
390
+ const N = A, V = N.option, X = N.onEvents ?? {}, K = b.getWidget(t), Y = K?.zoomStart ?? 0, ne = K?.zoomEnd ?? 100, q = V?.legend, ee = q?.show !== !1 && q !== void 0, ue = parseInt(d?.spacing?.(4) ?? "32"), De = et({
391
+ start: Y,
392
+ end: ne
391
393
  }, {
392
394
  inside: !0,
393
395
  xSlider: !0,
394
396
  ySlider: !1,
395
- bottomOffset: X ? 28 : 0
396
- }, a), se = N?.grid, De = (typeof se?.bottom == "number" ? se.bottom : parseInt(se?.bottom ?? "24")) + Oe + 8, we = {
397
- ...Y,
398
- dataZoom: k
397
+ bottomOffset: ee ? 28 : 0
398
+ }, d), ce = V?.grid, ze = (typeof ce?.bottom == "number" ? ce.bottom : parseInt(ce?.bottom ?? "24")) + ue + 8, Oe = {
399
+ ...X,
400
+ dataZoom: C
399
401
  };
400
402
  return {
401
- ...j,
403
+ ...N,
402
404
  option: {
403
- ...N,
404
- ...ze,
405
+ ...V,
406
+ ...De,
405
407
  grid: {
406
- ...se,
407
- bottom: De
408
+ ...ce,
409
+ bottom: ze
408
410
  }
409
411
  },
410
- onEvents: we
412
+ onEvents: Oe
411
413
  };
412
414
  }
413
- }), () => g.unregisterTool(t, de)), e[12] = l, e[13] = k, e[14] = t, e[15] = a, e[16] = A) : A = e[16];
414
- let w;
415
- e[17] !== l || e[18] !== s || e[19] !== r || e[20] !== k || e[21] !== t || e[22] !== a ? (w = [t, a, k, l, r, s], e[17] = l, e[18] = s, e[19] = r, e[20] = k, e[21] = t, e[22] = a, e[23] = w) : w = e[23], $(A, w);
416
- let D, x;
417
- e[24] !== t || e[25] !== i ? (D = () => {
418
- g.setToolEnabled(t, de, i);
419
- }, x = [t, i], e[24] = t, e[25] = i, e[26] = D, e[27] = x) : (D = e[26], x = e[27]), $(D, x);
420
- let E;
421
- e[28] !== t ? (E = () => {
422
- g.triggerToolPipeline(t);
423
- }, e[28] = t, e[29] = E) : E = e[29];
424
- let z;
425
- e[30] !== t || e[31] !== d || e[32] !== c ? (z = [t, c, d], e[30] = t, e[31] = d, e[32] = c, e[33] = z) : z = e[33], $(E, z);
426
- let y;
427
- e[34] !== t || e[35] !== i || e[36] !== d || e[37] !== c ? (y = () => {
428
- const R = !i;
429
- g.setWidget(t, {
430
- zoom: R,
431
- zoomStart: R ? c : 0,
432
- zoomEnd: R ? d : 100
415
+ }), () => b.unregisterTool(t, me)), e[12] = r, e[13] = C, e[14] = t, e[15] = d, e[16] = P) : P = e[16];
416
+ let D;
417
+ e[17] !== r || e[18] !== a || e[19] !== i || e[20] !== C || e[21] !== t || e[22] !== d ? (D = [t, d, C, r, i, a], e[17] = r, e[18] = a, e[19] = i, e[20] = C, e[21] = t, e[22] = d, e[23] = D) : D = e[23], H(P, D);
418
+ let O, T;
419
+ e[24] !== t || e[25] !== f ? (O = () => {
420
+ b.setToolEnabled(t, me, f);
421
+ }, T = [t, f], e[24] = t, e[25] = f, e[26] = O, e[27] = T) : (O = e[26], T = e[27]), H(O, T);
422
+ let R;
423
+ e[28] !== t ? (R = () => {
424
+ b.triggerToolPipeline(t);
425
+ }, e[28] = t, e[29] = R) : R = e[29];
426
+ let L;
427
+ e[30] !== t || e[31] !== m || e[32] !== h ? (L = [t, h, m], e[30] = t, e[31] = m, e[32] = h, e[33] = L) : L = e[33], H(R, L);
428
+ let v;
429
+ e[34] !== t || e[35] !== f || e[36] !== m || e[37] !== h ? (v = () => {
430
+ const A = !f;
431
+ b.setWidget(t, {
432
+ zoom: A,
433
+ zoomStart: A ? h : 0,
434
+ zoomEnd: A ? m : 100
433
435
  });
434
- }, e[34] = t, e[35] = i, e[36] = d, e[37] = c, e[38] = y) : y = e[38];
435
- const h = y;
436
+ }, e[34] = t, e[35] = f, e[36] = m, e[37] = h, e[38] = v) : v = e[38];
437
+ const _ = v;
436
438
  let I;
437
- e[39] !== s || e[40] !== r || e[41] !== t ? (I = () => {
438
- g.setWidget(t, {
439
+ e[39] !== a || e[40] !== i || e[41] !== t ? (I = () => {
440
+ b.setWidget(t, {
439
441
  zoom: !0,
440
- zoomStart: r,
441
- zoomEnd: s
442
+ zoomStart: i,
443
+ zoomEnd: a
442
444
  });
443
- }, e[39] = s, e[40] = r, e[41] = t, e[42] = I) : I = e[42];
444
- const L = I, W = S?.enable ?? "Enable zoom", P = S?.disable ?? "Disable zoom", B = S?.reset ?? "Reset zoom", H = i ? P : W, Z = S?.ariaLabel ?? H;
445
- let F;
446
- e[43] !== _ ? (F = _ ?? /* @__PURE__ */ b(Ue, {}), e[43] = _, e[44] = F) : F = e[44];
445
+ }, e[39] = a, e[40] = i, e[41] = t, e[42] = I) : I = e[42];
446
+ const z = I, B = p?.enable ?? "Enable zoom", M = p?.disable ?? "Disable zoom", W = p?.reset ?? "Reset zoom", j = f ? M : B, Z = p?.ariaLabel ?? j;
447
+ let $;
448
+ e[43] !== E ? ($ = E ?? /* @__PURE__ */ x(Ye, {}), e[43] = E, e[44] = $) : $ = e[44];
447
449
  let G;
448
- e[45] !== o || e[46] !== h || e[47] !== Z || e[48] !== F || e[49] !== i ? (G = /* @__PURE__ */ b(K, { size: "small", "aria-label": Z, onClick: h, sx: ye.trigger, "data-active": i, ...o, children: F }), e[45] = o, e[46] = h, e[47] = Z, e[48] = F, e[49] = i, e[50] = G) : G = e[50];
449
- let V;
450
- e[51] !== G || e[52] !== H ? (V = /* @__PURE__ */ b(ee, { title: H, children: G }), e[51] = G, e[52] = H, e[53] = V) : V = e[53];
451
- let M;
452
- e[54] !== o || e[55] !== T || e[56] !== L || e[57] !== B || e[58] !== i ? (M = i && /* @__PURE__ */ b(ee, { title: B, children: /* @__PURE__ */ b(K, { size: "small", "aria-label": B, onClick: L, ...o, children: T ?? /* @__PURE__ */ b(je, {}) }) }), e[54] = o, e[55] = T, e[56] = L, e[57] = B, e[58] = i, e[59] = M) : M = e[59];
453
- let J;
454
- return e[60] !== V || e[61] !== M ? (J = /* @__PURE__ */ ne(ke, { sx: ye.container, children: [
455
- V,
456
- M
457
- ] }), e[60] = V, e[61] = M, e[62] = J) : J = e[62], J;
450
+ e[45] !== o || e[46] !== _ || e[47] !== Z || e[48] !== $ || e[49] !== f ? (G = /* @__PURE__ */ x(Q, { size: "small", "aria-label": Z, onClick: _, sx: Ie.trigger, "data-active": f, ...o, children: $ }), e[45] = o, e[46] = _, e[47] = Z, e[48] = $, e[49] = f, e[50] = G) : G = e[50];
451
+ let U;
452
+ e[51] !== G || e[52] !== j ? (U = /* @__PURE__ */ x(re, { title: j, children: G }), e[51] = G, e[52] = j, e[53] = U) : U = e[53];
453
+ let k;
454
+ e[54] !== o || e[55] !== S || e[56] !== z || e[57] !== W || e[58] !== f ? (k = f && /* @__PURE__ */ x(re, { title: W, children: /* @__PURE__ */ x(Q, { size: "small", "aria-label": W, onClick: z, ...o, children: S ?? /* @__PURE__ */ x(Ke, {}) }) }), e[54] = o, e[55] = S, e[56] = z, e[57] = W, e[58] = f, e[59] = k) : k = e[59];
455
+ let F;
456
+ return e[60] !== U || e[61] !== k ? (F = /* @__PURE__ */ oe(Pe, { sx: Ie.container, children: [
457
+ U,
458
+ k
459
+ ] }), e[60] = U, e[61] = k, e[62] = F) : F = e[62], F;
458
460
  }
459
- const St = () => {
460
- const n = U(1);
461
+ const _t = () => {
462
+ const n = J(1);
461
463
  let e;
462
- return n[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ b("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ b("path", { d: "M4 20V8H8V20H4ZM9 20V13H13V20H9ZM16 20V4H20V20H16Z", fill: "currentColor" }) }), n[0] = e) : e = n[0], e;
463
- }, ue = "stack-toggle";
464
- function rn(n) {
465
- const e = U(35), {
464
+ return n[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ x("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ x("path", { d: "M4 20V8H8V20H4ZM9 20V13H13V20H9ZM16 20V4H20V20H16Z", fill: "currentColor" }) }), n[0] = e) : e = n[0], e;
465
+ }, ge = "stack-toggle";
466
+ function yn(n) {
467
+ const e = J(35), {
466
468
  id: t,
467
- defaultIsStacked: f,
468
- labels: p,
469
- Icon: m,
470
- IconButtonProps: S
471
- } = n, _ = f === void 0 ? !1 : f, {
472
- storeIsStacked: T,
469
+ defaultIsStacked: l,
470
+ labels: u,
471
+ Icon: c,
472
+ IconButtonProps: p
473
+ } = n, E = l === void 0 ? !1 : l, {
474
+ storeIsStacked: S,
473
475
  option: o
474
- } = Q(t, Tt);
475
- let l;
476
+ } = te(t, Lt);
477
+ let r;
476
478
  e: {
477
479
  if (!o) {
478
- let P;
479
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (P = {
480
+ let M;
481
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (M = {
480
482
  hasMultiSeries: !1,
481
483
  hasStackInSeries: !1
482
- }, e[0] = P) : P = e[0], l = P;
484
+ }, e[0] = M) : M = e[0], r = M;
483
485
  break e;
484
486
  }
485
- let y;
486
- e[1] !== o.series ? (y = Array.isArray(o.series) ? o.series : [o.series], e[1] = o.series, e[2] = y) : y = e[2];
487
- const h = y, I = h.length > 1;
488
- let L;
489
- e[3] !== h ? (L = h.some(yt), e[3] = h, e[4] = L) : L = e[4];
490
- let W;
491
- e[5] !== I || e[6] !== L ? (W = {
487
+ let v;
488
+ e[1] !== o.series ? (v = Array.isArray(o.series) ? o.series : [o.series], e[1] = o.series, e[2] = v) : v = e[2];
489
+ const _ = v, I = _.length > 1;
490
+ let z;
491
+ e[3] !== _ ? (z = _.some(Ct), e[3] = _, e[4] = z) : z = e[4];
492
+ let B;
493
+ e[5] !== I || e[6] !== z ? (B = {
492
494
  hasMultiSeries: I,
493
- hasStackInSeries: L
494
- }, e[5] = I, e[6] = L, e[7] = W) : W = e[7], l = W;
495
+ hasStackInSeries: z
496
+ }, e[5] = I, e[6] = z, e[7] = B) : B = e[7], r = B;
495
497
  }
496
498
  const {
497
- hasMultiSeries: r,
498
- hasStackInSeries: s
499
- } = l, a = s || _, u = T ?? a;
500
- let i, c;
501
- e[8] !== t ? (i = () => (g.registerTool(t, {
502
- id: ue,
499
+ hasMultiSeries: i,
500
+ hasStackInSeries: a
501
+ } = r, d = a || E, g = S ?? d;
502
+ let f, h;
503
+ e[8] !== t ? (f = () => (b.registerTool(t, {
504
+ id: ge,
503
505
  type: "config",
504
506
  order: 10,
505
507
  enabled: !1,
506
- fn: vt
507
- }), () => g.unregisterTool(t, ue)), c = [t], e[8] = t, e[9] = i, e[10] = c) : (i = e[9], c = e[10]), $(i, c);
508
- let d, v;
509
- e[11] !== r || e[12] !== t || e[13] !== u ? (d = () => {
510
- g.setToolEnabled(t, ue, u && r);
511
- }, v = [t, u, r], e[11] = r, e[12] = t, e[13] = u, e[14] = d, e[15] = v) : (d = e[14], v = e[15]), $(d, v);
512
- let O, C;
513
- e[16] !== a || e[17] !== t || e[18] !== T ? (O = () => {
514
- T === void 0 && g.setWidget(t, {
515
- isStacked: a
508
+ fn: Tt
509
+ }), () => b.unregisterTool(t, ge)), h = [t], e[8] = t, e[9] = f, e[10] = h) : (f = e[9], h = e[10]), H(f, h);
510
+ let m, y;
511
+ e[11] !== i || e[12] !== t || e[13] !== g ? (m = () => {
512
+ b.setToolEnabled(t, ge, g && i);
513
+ }, y = [t, g, i], e[11] = i, e[12] = t, e[13] = g, e[14] = m, e[15] = y) : (m = e[14], y = e[15]), H(m, y);
514
+ let s, w;
515
+ e[16] !== d || e[17] !== t || e[18] !== S ? (s = () => {
516
+ S === void 0 && b.setWidget(t, {
517
+ isStacked: d
516
518
  });
517
- }, C = [a, t, T], e[16] = a, e[17] = t, e[18] = T, e[19] = O, e[20] = C) : (O = e[19], C = e[20]), $(O, C);
518
- let k;
519
- e[21] !== t || e[22] !== u ? (k = () => {
520
- g.setWidget(t, {
521
- isStacked: !u
519
+ }, w = [d, t, S], e[16] = d, e[17] = t, e[18] = S, e[19] = s, e[20] = w) : (s = e[19], w = e[20]), H(s, w);
520
+ let C;
521
+ e[21] !== t || e[22] !== g ? (C = () => {
522
+ b.setWidget(t, {
523
+ isStacked: !g
522
524
  });
523
- }, e[21] = t, e[22] = u, e[23] = k) : k = e[23];
524
- const A = k, w = u ? p?.unstacked ?? "Disable stacking" : p?.stacked ?? "Enable stacking";
525
- if (!r)
525
+ }, e[21] = t, e[22] = g, e[23] = C) : C = e[23];
526
+ const P = C, D = g ? u?.unstacked ?? "Disable stacking" : u?.stacked ?? "Enable stacking";
527
+ if (!i)
526
528
  return null;
527
- const D = p?.ariaLabel ?? w;
528
- let x;
529
- e[24] !== m ? (x = m ?? /* @__PURE__ */ b(St, {}), e[24] = m, e[25] = x) : x = e[25];
530
- let E;
531
- e[26] !== S || e[27] !== A || e[28] !== u || e[29] !== D || e[30] !== x ? (E = /* @__PURE__ */ b(K, { size: "small", "aria-label": D, onClick: A, sx: re.trigger, "data-active": u, ...S, children: x }), e[26] = S, e[27] = A, e[28] = u, e[29] = D, e[30] = x, e[31] = E) : E = e[31];
532
- let z;
533
- return e[32] !== E || e[33] !== w ? (z = /* @__PURE__ */ b(ee, { title: w, children: E }), e[32] = E, e[33] = w, e[34] = z) : z = e[34], z;
529
+ const O = u?.ariaLabel ?? D;
530
+ let T;
531
+ e[24] !== c ? (T = c ?? /* @__PURE__ */ x(_t, {}), e[24] = c, e[25] = T) : T = e[25];
532
+ let R;
533
+ e[26] !== p || e[27] !== P || e[28] !== g || e[29] !== O || e[30] !== T ? (R = /* @__PURE__ */ x(Q, { size: "small", "aria-label": O, onClick: P, sx: se.trigger, "data-active": g, ...p, children: T }), e[26] = p, e[27] = P, e[28] = g, e[29] = O, e[30] = T, e[31] = R) : R = e[31];
534
+ let L;
535
+ return e[32] !== R || e[33] !== D ? (L = /* @__PURE__ */ x(re, { title: D, children: R }), e[32] = R, e[33] = D, e[34] = L) : L = e[34], L;
534
536
  }
535
- function vt(n) {
537
+ function Tt(n) {
536
538
  const e = n, t = e.option;
537
539
  if (!t)
538
540
  return n;
539
- const p = (Array.isArray(t.series) ? t.series : [t.series]).map(It);
541
+ const u = (Array.isArray(t.series) ? t.series : [t.series]).map(Et);
540
542
  return {
541
543
  ...e,
542
544
  option: {
543
545
  ...t,
544
- series: p
546
+ series: u
545
547
  }
546
548
  };
547
549
  }
548
- function It(n) {
550
+ function Et(n) {
549
551
  const e = n?.stack;
550
552
  return {
551
553
  ...n,
552
- ...Qe(typeof e == "string" ? e : Xe)
554
+ ...tt(typeof e == "string" ? e : nt)
553
555
  };
554
556
  }
555
- function yt(n) {
557
+ function Ct(n) {
556
558
  return n?.stack;
557
559
  }
558
- function Tt(n) {
560
+ function Lt(n) {
559
561
  return {
560
562
  storeIsStacked: n?.isStacked,
561
563
  option: n?.option
562
564
  };
563
565
  }
564
- const ie = "lock-selection";
565
- function sn(n) {
566
- const e = U(24), {
566
+ const ae = "lock-selection";
567
+ function In(n) {
568
+ const e = J(24), {
567
569
  id: t,
568
- selectedItems: f,
569
- order: p,
570
- labels: m,
571
- Icon: S,
572
- IconButtonProps: _
573
- } = n, T = p === void 0 ? 30 : p, {
570
+ selectedItems: l,
571
+ order: u,
572
+ labels: c,
573
+ Icon: p,
574
+ IconButtonProps: E
575
+ } = n, S = u === void 0 ? 30 : u, {
574
576
  storeIsLocked: o
575
- } = Q(t, _t), l = o ?? !1;
576
- let r, s;
577
- e[0] !== t || e[1] !== T ? (r = () => (g.registerTool(t, {
578
- id: ie,
579
- order: T,
577
+ } = te(t, kt), r = o ?? !1;
578
+ let i, a;
579
+ e[0] !== t || e[1] !== S ? (i = () => (b.registerTool(t, {
580
+ id: ae,
581
+ order: S,
580
582
  enabled: !1,
581
- fn: (A) => {
582
- const D = g.getWidget(t)?.lockedItems ?? [];
583
- return D.length === 0 ? A : xt(A, D);
583
+ fn: (P) => {
584
+ const O = b.getWidget(t)?.lockedItems ?? [];
585
+ return O.length === 0 ? P : wt(P, O);
584
586
  }
585
- }), () => g.unregisterTool(t, ie)), s = [t, T], e[0] = t, e[1] = T, e[2] = r, e[3] = s) : (r = e[2], s = e[3]), $(r, s);
586
- let a, u;
587
- e[4] !== t || e[5] !== l || e[6] !== f.length ? (a = () => {
588
- if (l && f.length === 0) {
589
- g.setWidget(t, {
587
+ }), () => b.unregisterTool(t, ae)), a = [t, S], e[0] = t, e[1] = S, e[2] = i, e[3] = a) : (i = e[2], a = e[3]), H(i, a);
588
+ let d, g;
589
+ e[4] !== t || e[5] !== r || e[6] !== l.length ? (d = () => {
590
+ if (r && l.length === 0) {
591
+ b.setWidget(t, {
590
592
  isLocked: !1,
591
593
  lockedItems: []
592
594
  });
593
595
  return;
594
596
  }
595
- g.setToolEnabled(t, ie, l);
596
- }, u = [t, l, f.length], e[4] = t, e[5] = l, e[6] = f.length, e[7] = a, e[8] = u) : (a = e[7], u = e[8]), $(a, u);
597
- let i;
598
- e[9] !== t || e[10] !== l || e[11] !== f ? (i = () => {
599
- l ? g.setWidget(t, {
597
+ b.setToolEnabled(t, ae, r);
598
+ }, g = [t, r, l.length], e[4] = t, e[5] = r, e[6] = l.length, e[7] = d, e[8] = g) : (d = e[7], g = e[8]), H(d, g);
599
+ let f;
600
+ e[9] !== t || e[10] !== r || e[11] !== l ? (f = () => {
601
+ r ? b.setWidget(t, {
600
602
  isLocked: !1,
601
603
  lockedItems: []
602
- }) : g.setWidget(t, {
604
+ }) : b.setWidget(t, {
603
605
  isLocked: !0,
604
- lockedItems: f
606
+ lockedItems: l
605
607
  });
606
- }, e[9] = t, e[10] = l, e[11] = f, e[12] = i) : i = e[12];
607
- const c = i;
608
- if (f.length === 0)
608
+ }, e[9] = t, e[10] = r, e[11] = l, e[12] = f) : f = e[12];
609
+ const h = f;
610
+ if (l.length === 0)
609
611
  return null;
610
- const d = l ? m?.unlock ?? "Unlock selection" : m?.lock ?? "Lock selection", v = m?.ariaLabel ?? d;
611
- let O;
612
- e[13] !== S ? (O = S ?? /* @__PURE__ */ b(Ke, { fontSize: "small" }), e[13] = S, e[14] = O) : O = e[14];
612
+ const m = r ? c?.unlock ?? "Unlock selection" : c?.lock ?? "Lock selection", y = c?.ariaLabel ?? m;
613
+ let s;
614
+ e[13] !== p ? (s = p ?? /* @__PURE__ */ x(qe, { fontSize: "small" }), e[13] = p, e[14] = s) : s = e[14];
615
+ let w;
616
+ e[15] !== E || e[16] !== y || e[17] !== h || e[18] !== r || e[19] !== s ? (w = /* @__PURE__ */ x(Q, { size: "small", "aria-label": y, onClick: h, sx: se.trigger, "data-active": r, ...E, children: s }), e[15] = E, e[16] = y, e[17] = h, e[18] = r, e[19] = s, e[20] = w) : w = e[20];
613
617
  let C;
614
- e[15] !== _ || e[16] !== v || e[17] !== c || e[18] !== l || e[19] !== O ? (C = /* @__PURE__ */ b(K, { size: "small", "aria-label": v, onClick: c, sx: re.trigger, "data-active": l, ..._, children: O }), e[15] = _, e[16] = v, e[17] = c, e[18] = l, e[19] = O, e[20] = C) : C = e[20];
615
- let k;
616
- return e[21] !== C || e[22] !== d ? (k = /* @__PURE__ */ b(ee, { title: d, children: C }), e[21] = C, e[22] = d, e[23] = k) : k = e[23], k;
618
+ return e[21] !== w || e[22] !== m ? (C = /* @__PURE__ */ x(re, { title: m, children: w }), e[21] = w, e[22] = m, e[23] = C) : C = e[23], C;
617
619
  }
618
- function _t(n) {
620
+ function kt(n) {
619
621
  return {
620
622
  storeIsLocked: n?.isLocked
621
623
  };
622
624
  }
623
- function xt(n, e) {
624
- return n.map((t) => t.filter((f) => {
625
- const p = f.name;
626
- return typeof p == "string" && e.includes(p);
625
+ function wt(n, e) {
626
+ return n.map((t) => t.filter((l) => {
627
+ const u = l.name;
628
+ return typeof u == "string" && e.includes(u);
627
629
  }));
628
630
  }
629
- const fe = "searcher", Et = 300;
630
- function an(n) {
631
- const e = U(39), {
631
+ const he = "searcher", Pt = 300;
632
+ function _n(n) {
633
+ const e = J(39), {
632
634
  id: t,
633
- filterFn: f,
634
- order: p,
635
- labels: m,
636
- TextFieldProps: S,
637
- ClearIcon: _,
638
- debounceDelay: T
639
- } = n, o = p === void 0 ? 20 : p, l = T === void 0 ? Et : T, r = le(null), s = le(null), {
640
- enabled: a,
641
- searchText: u
642
- } = Q(t, Ct), i = le(a), c = f ?? kt;
643
- let d;
644
- e[0] !== t ? (d = (V) => {
645
- g.setWidget(t, {
646
- searchText: V
635
+ filterFn: l,
636
+ order: u,
637
+ labels: c,
638
+ TextFieldProps: p,
639
+ ClearIcon: E,
640
+ debounceDelay: S
641
+ } = n, o = u === void 0 ? 20 : u, r = S === void 0 ? Pt : S, i = le(null), a = le(null), {
642
+ enabled: d,
643
+ searchText: g
644
+ } = te(t, Rt), f = le(d), h = l ?? Dt;
645
+ let m;
646
+ e[0] !== t ? (m = (U) => {
647
+ b.setWidget(t, {
648
+ searchText: U
647
649
  });
648
- }, e[0] = t, e[1] = d) : d = e[1];
649
- const v = d;
650
- let O, C;
651
- e[2] !== c || e[3] !== t || e[4] !== o ? (O = () => (g.registerTool(t, {
652
- id: fe,
650
+ }, e[0] = t, e[1] = m) : m = e[1];
651
+ const y = m;
652
+ let s, w;
653
+ e[2] !== h || e[3] !== t || e[4] !== o ? (s = () => (b.registerTool(t, {
654
+ id: he,
653
655
  order: o,
654
656
  enabled: !1,
655
- fn: async (V) => {
656
- const J = g.getWidget(t)?.searchText ?? "";
657
- return c(V, J);
657
+ fn: async (U) => {
658
+ const F = b.getWidget(t)?.searchText ?? "";
659
+ return h(U, F);
658
660
  },
659
- disables: [ie]
660
- }), () => g.unregisterTool(t, fe)), C = [t, o, c], e[2] = c, e[3] = t, e[4] = o, e[5] = O, e[6] = C) : (O = e[5], C = e[6]), $(O, C);
661
- let k, A;
662
- e[7] !== a || e[8] !== t ? (k = () => {
663
- g.setToolEnabled(t, fe, a);
664
- }, A = [t, a], e[7] = a, e[8] = t, e[9] = k, e[10] = A) : (k = e[9], A = e[10]), $(k, A);
665
- let w;
666
- e[11] !== l || e[12] !== t ? (w = () => {
667
- s.current && clearTimeout(s.current), s.current = setTimeout(() => {
668
- g.triggerToolPipeline(t);
669
- }, l);
670
- }, e[11] = l, e[12] = t, e[13] = w) : w = e[13];
671
- const D = w;
672
- let x, E;
673
- e[14] !== a ? (E = () => {
674
- a && !i.current && r.current && r.current.focus(), i.current = a;
675
- }, x = [a], e[14] = a, e[15] = x, e[16] = E) : (x = e[15], E = e[16]), $(E, x);
676
- let z, y;
677
- e[17] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (z = () => () => {
678
- s.current && clearTimeout(s.current);
679
- }, y = [], e[17] = z, e[18] = y) : (z = e[17], y = e[18]), $(z, y);
680
- let h;
681
- e[19] !== D || e[20] !== v ? (h = (V) => {
682
- const M = V.target.value;
683
- v(M), D();
684
- }, e[19] = D, e[20] = v, e[21] = h) : h = e[21];
685
- const I = h;
686
- let L;
687
- e[22] !== t || e[23] !== v ? (L = () => {
688
- v(""), g.triggerToolPipeline(t), r.current && r.current.focus();
689
- }, e[22] = t, e[23] = v, e[24] = L) : L = e[24];
690
- const W = L;
691
- if (!a)
661
+ disables: [ae]
662
+ }), () => b.unregisterTool(t, he)), w = [t, o, h], e[2] = h, e[3] = t, e[4] = o, e[5] = s, e[6] = w) : (s = e[5], w = e[6]), H(s, w);
663
+ let C, P;
664
+ e[7] !== d || e[8] !== t ? (C = () => {
665
+ b.setToolEnabled(t, he, d);
666
+ }, P = [t, d], e[7] = d, e[8] = t, e[9] = C, e[10] = P) : (C = e[9], P = e[10]), H(C, P);
667
+ let D;
668
+ e[11] !== r || e[12] !== t ? (D = () => {
669
+ a.current && clearTimeout(a.current), a.current = setTimeout(() => {
670
+ b.triggerToolPipeline(t);
671
+ }, r);
672
+ }, e[11] = r, e[12] = t, e[13] = D) : D = e[13];
673
+ const O = D;
674
+ let T, R;
675
+ e[14] !== d ? (R = () => {
676
+ d && !f.current && i.current && i.current.focus(), f.current = d;
677
+ }, T = [d], e[14] = d, e[15] = T, e[16] = R) : (T = e[15], R = e[16]), H(R, T);
678
+ let L, v;
679
+ e[17] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (L = () => () => {
680
+ a.current && clearTimeout(a.current);
681
+ }, v = [], e[17] = L, e[18] = v) : (L = e[17], v = e[18]), H(L, v);
682
+ let _;
683
+ e[19] !== O || e[20] !== y ? (_ = (U) => {
684
+ const k = U.target.value;
685
+ y(k), O();
686
+ }, e[19] = O, e[20] = y, e[21] = _) : _ = e[21];
687
+ const I = _;
688
+ let z;
689
+ e[22] !== t || e[23] !== y ? (z = () => {
690
+ y(""), b.triggerToolPipeline(t), i.current && i.current.focus();
691
+ }, e[22] = t, e[23] = y, e[24] = z) : z = e[24];
692
+ const B = z;
693
+ if (!d)
692
694
  return null;
693
- const P = m?.placeholder ?? "Search...", B = m?.clearAriaLabel ?? "Clear search";
694
- let H;
695
- e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ b(be, { position: "start", children: /* @__PURE__ */ b(Le, {}) }), e[25] = H) : H = e[25];
695
+ const M = c?.placeholder ?? "Search...", W = c?.clearAriaLabel ?? "Clear search";
696
+ let j;
697
+ e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (j = /* @__PURE__ */ x(pe, { position: "start", children: /* @__PURE__ */ x(Re, {}) }), e[25] = j) : j = e[25];
696
698
  let Z;
697
- e[26] !== _ || e[27] !== B || e[28] !== W || e[29] !== u ? (Z = u ? /* @__PURE__ */ b(be, { position: "end", children: /* @__PURE__ */ b(K, { size: "small", "aria-label": B, onClick: W, edge: "end", children: _ ?? /* @__PURE__ */ b(Ye, { fontSize: "small" }) }) }) : null, e[26] = _, e[27] = B, e[28] = W, e[29] = u, e[30] = Z) : Z = e[30];
698
- let F;
699
- e[31] !== Z ? (F = {
700
- startAdornment: H,
699
+ e[26] !== E || e[27] !== W || e[28] !== B || e[29] !== g ? (Z = g ? /* @__PURE__ */ x(pe, { position: "end", children: /* @__PURE__ */ x(Q, { size: "small", "aria-label": W, onClick: B, edge: "end", children: E ?? /* @__PURE__ */ x(Je, { fontSize: "small" }) }) }) : null, e[26] = E, e[27] = W, e[28] = B, e[29] = g, e[30] = Z) : Z = e[30];
700
+ let $;
701
+ e[31] !== Z ? ($ = {
702
+ startAdornment: j,
701
703
  endAdornment: Z
702
- }, e[31] = Z, e[32] = F) : F = e[32];
704
+ }, e[31] = Z, e[32] = $) : $ = e[32];
703
705
  let G;
704
- return e[33] !== S || e[34] !== I || e[35] !== P || e[36] !== u || e[37] !== F ? (G = /* @__PURE__ */ b(Me, { inputRef: r, size: "small", fullWidth: !0, variant: "filled", placeholder: P, value: u, onChange: I, InputProps: F, ...S }), e[33] = S, e[34] = I, e[35] = P, e[36] = u, e[37] = F, e[38] = G) : G = e[38], G;
706
+ return e[33] !== p || e[34] !== I || e[35] !== M || e[36] !== g || e[37] !== $ ? (G = /* @__PURE__ */ x(Ge, { inputRef: i, size: "small", fullWidth: !0, variant: "filled", placeholder: M, value: g, onChange: I, InputProps: $, ...p }), e[33] = p, e[34] = I, e[35] = M, e[36] = g, e[37] = $, e[38] = G) : G = e[38], G;
705
707
  }
706
- function Ct(n) {
708
+ function Rt(n) {
707
709
  return {
708
710
  enabled: n?.isSearchEnabled ?? !1,
709
711
  searchText: n?.searchText ?? ""
710
712
  };
711
713
  }
712
- const kt = (n, e) => {
714
+ const Dt = (n, e) => {
713
715
  if (!e.trim()) return Promise.resolve(n);
714
716
  const t = e.toLowerCase();
715
- return Promise.resolve(n.map((f) => f.filter((p) => Object.values(p).some((m) => String(m).toLowerCase().includes(t)))));
717
+ return Promise.resolve(n.map((l) => l.filter((u) => Object.values(u).some((c) => String(c).toLowerCase().includes(t)))));
716
718
  };
717
- function cn(n) {
718
- const e = U(18), {
719
+ function Tn(n) {
720
+ const e = J(18), {
719
721
  id: t,
720
- defaultEnabled: f,
721
- labels: p,
722
- Icon: m,
723
- IconButtonProps: S
724
- } = n, _ = f === void 0 ? !1 : f, {
725
- storeIsEnabled: T
726
- } = Q(t, Lt), o = T ?? _;
727
- let l, r;
728
- e[0] !== _ || e[1] !== t ? (l = () => {
729
- g.getWidget(t)?.isSearchEnabled === void 0 && g.setWidget(t, {
730
- isSearchEnabled: _
722
+ defaultEnabled: l,
723
+ labels: u,
724
+ Icon: c,
725
+ IconButtonProps: p
726
+ } = n, E = l === void 0 ? !1 : l, {
727
+ storeIsEnabled: S
728
+ } = te(t, zt), o = S ?? E;
729
+ let r, i;
730
+ e[0] !== E || e[1] !== t ? (r = () => {
731
+ b.getWidget(t)?.isSearchEnabled === void 0 && b.setWidget(t, {
732
+ isSearchEnabled: E
731
733
  });
732
- }, r = [_, t], e[0] = _, e[1] = t, e[2] = l, e[3] = r) : (l = e[2], r = e[3]), $(l, r);
733
- let s;
734
- e[4] !== t || e[5] !== o ? (s = () => {
735
- g.setWidget(t, {
734
+ }, i = [E, t], e[0] = E, e[1] = t, e[2] = r, e[3] = i) : (r = e[2], i = e[3]), H(r, i);
735
+ let a;
736
+ e[4] !== t || e[5] !== o ? (a = () => {
737
+ b.setWidget(t, {
736
738
  isSearchEnabled: !o
737
739
  });
738
- }, e[4] = t, e[5] = o, e[6] = s) : s = e[6];
739
- const a = s, u = o ? p?.disable ?? "Disable search" : p?.enable ?? "Enable search", i = p?.ariaLabel ?? u;
740
- let c;
741
- e[7] !== m ? (c = m ?? /* @__PURE__ */ b(Le, { fontSize: "small" }), e[7] = m, e[8] = c) : c = e[8];
742
- let d;
743
- e[9] !== S || e[10] !== i || e[11] !== a || e[12] !== o || e[13] !== c ? (d = /* @__PURE__ */ b(K, { size: "small", "aria-label": i, onClick: a, sx: re.trigger, "data-active": o, ...S, children: c }), e[9] = S, e[10] = i, e[11] = a, e[12] = o, e[13] = c, e[14] = d) : d = e[14];
744
- let v;
745
- return e[15] !== d || e[16] !== u ? (v = /* @__PURE__ */ b(ee, { title: u, children: d }), e[15] = d, e[16] = u, e[17] = v) : v = e[17], v;
740
+ }, e[4] = t, e[5] = o, e[6] = a) : a = e[6];
741
+ const d = a, g = o ? u?.disable ?? "Disable search" : u?.enable ?? "Enable search", f = u?.ariaLabel ?? g;
742
+ let h;
743
+ e[7] !== c ? (h = c ?? /* @__PURE__ */ x(Re, { fontSize: "small" }), e[7] = c, e[8] = h) : h = e[8];
744
+ let m;
745
+ e[9] !== p || e[10] !== f || e[11] !== d || e[12] !== o || e[13] !== h ? (m = /* @__PURE__ */ x(Q, { size: "small", "aria-label": f, onClick: d, sx: se.trigger, "data-active": o, ...p, children: h }), e[9] = p, e[10] = f, e[11] = d, e[12] = o, e[13] = h, e[14] = m) : m = e[14];
746
+ let y;
747
+ return e[15] !== m || e[16] !== g ? (y = /* @__PURE__ */ x(re, { title: g, children: m }), e[15] = m, e[16] = g, e[17] = y) : y = e[17], y;
746
748
  }
747
- function Lt(n) {
749
+ function zt(n) {
748
750
  return {
749
751
  storeIsEnabled: n?.isSearchEnabled
750
752
  };
751
753
  }
752
754
  const Ot = () => {
753
- const n = U(1);
755
+ const n = J(1);
754
756
  let e;
755
- return n[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ b("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 18 18", children: /* @__PURE__ */ b("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" }) }), n[0] = e) : e = n[0], e;
757
+ return n[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ x("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 18 18", children: /* @__PURE__ */ x("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" }) }), n[0] = e) : e = n[0], e;
756
758
  };
757
- function zt(n) {
758
- const e = U(18), {
759
+ function Mt(n) {
760
+ const e = J(18), {
759
761
  column: t
760
762
  } = n;
761
- let f;
762
- e[0] !== t.id ? (f = {
763
+ let l;
764
+ e[0] !== t.id ? (l = {
763
765
  id: t.id
764
- }, e[0] = t.id, e[1] = f) : f = e[1];
766
+ }, e[0] = t.id, e[1] = l) : l = e[1];
765
767
  const {
766
- attributes: p,
767
- listeners: m,
768
- setNodeRef: S,
769
- transform: _,
770
- transition: T,
768
+ attributes: u,
769
+ listeners: c,
770
+ setNodeRef: p,
771
+ transform: E,
772
+ transition: S,
771
773
  isDragging: o
772
- } = rt(f);
773
- let l;
774
- e[2] !== _ ? (l = dt.Transform.toString(_ ? {
775
- ..._,
774
+ } = ct(l);
775
+ let r;
776
+ e[2] !== E ? (r = mt.Transform.toString(E ? {
777
+ ...E,
776
778
  x: 0
777
- } : null), e[2] = _, e[3] = l) : l = e[3];
778
- const r = o ? 0.5 : 1, s = o ? "grabbing" : "grab";
779
- let a;
780
- e[4] !== l || e[5] !== r || e[6] !== s || e[7] !== T ? (a = {
781
- transform: l,
782
- transition: T,
783
- opacity: r,
784
- cursor: s
785
- }, e[4] = l, e[5] = r, e[6] = s, e[7] = T, e[8] = a) : a = e[8];
786
- const u = a;
787
- let i;
788
- e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = {
779
+ } : null), e[2] = E, e[3] = r) : r = e[3];
780
+ const i = o ? 0.5 : 1, a = o ? "grabbing" : "grab";
781
+ let d;
782
+ e[4] !== r || e[5] !== i || e[6] !== a || e[7] !== S ? (d = {
783
+ transform: r,
784
+ transition: S,
785
+ opacity: i,
786
+ cursor: a
787
+ }, e[4] = r, e[5] = i, e[6] = a, e[7] = S, e[8] = d) : d = e[8];
788
+ const g = d;
789
+ let f;
790
+ e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (f = {
789
791
  "&:focus-visible": {
790
- outline: Dt,
792
+ outline: At,
791
793
  outlineOffset: -2
792
794
  }
793
- }, e[9] = i) : i = e[9];
794
- let c;
795
- e[10] !== t.label ? (c = /* @__PURE__ */ b(Ee, { children: t.label }), e[10] = t.label, e[11] = c) : c = e[11];
796
- let d;
797
- return e[12] !== p || e[13] !== m || e[14] !== S || e[15] !== u || e[16] !== c ? (d = /* @__PURE__ */ b(xe, { ref: S, style: u, ...p, ...m, role: "menuitem", tabIndex: 0, sx: i, children: c }), e[12] = p, e[13] = m, e[14] = S, e[15] = u, e[16] = c, e[17] = d) : d = e[17], d;
795
+ }, e[9] = f) : f = e[9];
796
+ let h;
797
+ e[10] !== t.label ? (h = /* @__PURE__ */ x(ke, { children: t.label }), e[10] = t.label, e[11] = h) : h = e[11];
798
+ let m;
799
+ return e[12] !== u || e[13] !== c || e[14] !== p || e[15] !== g || e[16] !== h ? (m = /* @__PURE__ */ x(Le, { ref: p, style: g, ...u, ...c, role: "menuitem", tabIndex: 0, sx: f, children: h }), e[12] = u, e[13] = c, e[14] = p, e[15] = g, e[16] = h, e[17] = m) : m = e[17], m;
798
800
  }
799
- function Dt(n) {
801
+ function At(n) {
800
802
  return `2px solid ${n.palette.primary.main}`;
801
803
  }
802
- const Te = "change-column";
803
- function dn(n) {
804
- const e = U(46), {
804
+ const _e = "change-column";
805
+ function En(n) {
806
+ const e = J(46), {
805
807
  id: t,
806
- labels: f,
807
- Icon: p,
808
- IconButtonProps: m,
809
- MenuProps: S
810
- } = n, [_, T] = ge(null), {
808
+ labels: l,
809
+ Icon: u,
810
+ IconButtonProps: c,
811
+ MenuProps: p
812
+ } = n, [E, S] = ie(null), {
811
813
  columns: o
812
- } = Q(t, Pt);
813
- let l;
814
- e[0] !== t ? (l = (M) => {
815
- const R = g.getWidget(t)?.columns;
816
- if (!R || R.length === 0)
817
- return M;
818
- const j = M, N = j.columns;
819
- if (!N || N.length === 0 || N.length === R.length && N.every((q, X) => q.id === R[X]?.id))
820
- return M;
821
- const oe = new Map(N.map(Wt)), te = [];
822
- for (const q of R) {
823
- const X = oe.get(q.id);
824
- X && (te.push(X), oe.delete(q.id));
814
+ } = te(t, $t);
815
+ let r;
816
+ e[0] !== t ? (r = (k) => {
817
+ const A = b.getWidget(t)?.columns;
818
+ if (!A || A.length === 0)
819
+ return k;
820
+ const N = k, V = N.columns;
821
+ if (!V || V.length === 0 || V.length === A.length && V.every((q, ee) => q.id === A[ee]?.id))
822
+ return k;
823
+ const K = new Map(V.map(Ft)), Y = [];
824
+ for (const q of A) {
825
+ const ee = K.get(q.id);
826
+ ee && (Y.push(ee), K.delete(q.id));
825
827
  }
826
- for (const q of oe.values())
827
- te.push(q);
828
- const ae = te.length === R.length && te.every((q, X) => q.id === R[X]?.id);
828
+ for (const q of K.values())
829
+ Y.push(q);
830
+ const ne = Y.length === A.length && Y.every((q, ee) => q.id === A[ee]?.id);
829
831
  return {
830
- ...j,
831
- columns: ae ? R : te
832
+ ...N,
833
+ columns: ne ? A : Y
832
834
  };
833
- }, e[0] = t, e[1] = l) : l = e[1];
834
- const r = l;
835
- let s;
836
- e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = {
837
- coordinateGetter: st
838
- }, e[2] = s) : s = e[2];
839
- const a = et(Se(tt), Se(nt, s));
840
- let u;
841
- e[3] !== o ? (u = o?.map(At) ?? [], e[3] = o, e[4] = u) : u = e[4];
842
- const i = u;
843
- let c, d;
844
- e[5] !== t || e[6] !== r ? (c = () => (g.registerTool(t, {
845
- id: Te,
835
+ }, e[0] = t, e[1] = r) : r = e[1];
836
+ const i = r;
837
+ let a;
838
+ e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = {
839
+ coordinateGetter: at
840
+ }, e[2] = a) : a = e[2];
841
+ const d = ot(xe(lt), xe(rt, a));
842
+ let g;
843
+ e[3] !== o ? (g = o?.map(Wt) ?? [], e[3] = o, e[4] = g) : g = e[4];
844
+ const f = g;
845
+ let h, m;
846
+ e[5] !== t || e[6] !== i ? (h = () => (b.registerTool(t, {
847
+ id: _e,
846
848
  type: "config",
847
849
  order: 100,
848
850
  enabled: !0,
849
- fn: r
850
- }), () => g.unregisterTool(t, Te)), d = [t, r], e[5] = t, e[6] = r, e[7] = c, e[8] = d) : (c = e[7], d = e[8]), $(c, d);
851
- let v;
852
- e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (v = (M) => {
853
- M.stopPropagation(), T(M.currentTarget);
854
- }, e[9] = v) : v = e[9];
855
- const O = v;
856
- let C;
857
- e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (C = () => {
858
- T(null);
859
- }, e[10] = C) : C = e[10];
860
- const k = C;
861
- let A;
862
- e[11] !== o || e[12] !== t ? (A = (M) => {
851
+ fn: i
852
+ }), () => b.unregisterTool(t, _e)), m = [t, i], e[5] = t, e[6] = i, e[7] = h, e[8] = m) : (h = e[7], m = e[8]), H(h, m);
853
+ let y;
854
+ e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (y = (k) => {
855
+ k.stopPropagation(), S(k.currentTarget);
856
+ }, e[9] = y) : y = e[9];
857
+ const s = y;
858
+ let w;
859
+ e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = () => {
860
+ S(null);
861
+ }, e[10] = w) : w = e[10];
862
+ const C = w;
863
+ let P;
864
+ e[11] !== o || e[12] !== t ? (P = (k) => {
863
865
  const {
864
- active: J,
865
- over: R
866
- } = M;
867
- if (!R || J.id === R.id || !o)
866
+ active: F,
867
+ over: A
868
+ } = k;
869
+ if (!A || F.id === A.id || !o)
868
870
  return;
869
- const j = o.findIndex((Y) => Y.id === J.id), N = o.findIndex((Y) => Y.id === R.id);
870
- if (j !== -1 && N !== -1) {
871
- const Y = it(o, j, N);
872
- g.setWidget(t, {
873
- columns: Y
871
+ const N = o.findIndex((X) => X.id === F.id), V = o.findIndex((X) => X.id === A.id);
872
+ if (N !== -1 && V !== -1) {
873
+ const X = dt(o, N, V);
874
+ b.setWidget(t, {
875
+ columns: X
874
876
  });
875
877
  }
876
- }, e[11] = o, e[12] = t, e[13] = A) : A = e[13];
877
- const w = A;
878
+ }, e[11] = o, e[12] = t, e[13] = P) : P = e[13];
879
+ const D = P;
878
880
  if (!o || o.length < 2)
879
881
  return null;
880
- const D = f?.tooltip ?? "Change column", x = !!_, E = f?.ariaLabel ?? D, z = x ? "change-column-menu" : void 0, y = x ? "true" : void 0;
881
- let h;
882
- e[14] !== p ? (h = p ?? /* @__PURE__ */ b(Ge, { children: /* @__PURE__ */ b(Ot, {}) }), e[14] = p, e[15] = h) : h = e[15];
882
+ const O = l?.tooltip ?? "Change column", T = !!E, R = l?.ariaLabel ?? O, L = T ? "change-column-menu" : void 0, v = T ? "true" : void 0;
883
+ let _;
884
+ e[14] !== u ? (_ = u ?? /* @__PURE__ */ x(Ze, { children: /* @__PURE__ */ x(Ot, {}) }), e[14] = u, e[15] = _) : _ = e[15];
883
885
  let I;
884
- e[16] !== m || e[17] !== x || e[18] !== z || e[19] !== y || e[20] !== h || e[21] !== E ? (I = /* @__PURE__ */ b(K, { size: "small", "aria-label": E, "aria-controls": z, "aria-haspopup": "true", "aria-expanded": y, onClick: O, "data-active": x, sx: re.trigger, ...m, children: h }), e[16] = m, e[17] = x, e[18] = z, e[19] = y, e[20] = h, e[21] = E, e[22] = I) : I = e[22];
885
- let L;
886
- e[23] !== I || e[24] !== D ? (L = /* @__PURE__ */ b(ee, { title: D, children: I }), e[23] = I, e[24] = D, e[25] = L) : L = e[25];
887
- let W, P, B;
888
- e[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (W = {
886
+ e[16] !== c || e[17] !== T || e[18] !== L || e[19] !== v || e[20] !== _ || e[21] !== R ? (I = /* @__PURE__ */ x(Q, { size: "small", "aria-label": R, "aria-controls": L, "aria-haspopup": "true", "aria-expanded": v, onClick: s, "data-active": T, sx: se.trigger, ...c, children: _ }), e[16] = c, e[17] = T, e[18] = L, e[19] = v, e[20] = _, e[21] = R, e[22] = I) : I = e[22];
887
+ let z;
888
+ e[23] !== I || e[24] !== O ? (z = /* @__PURE__ */ x(re, { title: O, children: I }), e[23] = I, e[24] = O, e[25] = z) : z = e[25];
889
+ let B, M, W;
890
+ e[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = {
889
891
  vertical: "bottom",
890
892
  horizontal: "right"
891
- }, P = {
893
+ }, M = {
892
894
  vertical: "top",
893
895
  horizontal: "right"
894
- }, B = {
896
+ }, W = {
895
897
  paper: {
896
898
  sx: {
897
899
  overflow: "hidden"
898
900
  }
899
901
  }
900
- }, e[26] = W, e[27] = P, e[28] = B) : (W = e[26], P = e[27], B = e[28]);
901
- let H;
902
- e[29] !== o ? (H = o.map(wt), e[29] = o, e[30] = H) : H = e[30];
902
+ }, e[26] = B, e[27] = M, e[28] = W) : (B = e[26], M = e[27], W = e[28]);
903
+ let j;
904
+ e[29] !== o ? (j = o.map(Bt), e[29] = o, e[30] = j) : j = e[30];
903
905
  let Z;
904
- e[31] !== i || e[32] !== H ? (Z = /* @__PURE__ */ b(at, { items: i, strategy: ct, children: H }), e[31] = i, e[32] = H, e[33] = Z) : Z = e[33];
905
- let F;
906
- e[34] !== S || e[35] !== _ || e[36] !== x || e[37] !== Z ? (F = /* @__PURE__ */ b(Ce, { id: "change-column-menu", anchorEl: _, open: x, onClose: k, anchorOrigin: W, transformOrigin: P, slotProps: B, ...S, children: Z }), e[34] = S, e[35] = _, e[36] = x, e[37] = Z, e[38] = F) : F = e[38];
906
+ e[31] !== f || e[32] !== j ? (Z = /* @__PURE__ */ x(ut, { items: f, strategy: ft, children: j }), e[31] = f, e[32] = j, e[33] = Z) : Z = e[33];
907
+ let $;
908
+ e[34] !== p || e[35] !== E || e[36] !== T || e[37] !== Z ? ($ = /* @__PURE__ */ x(we, { id: "change-column-menu", anchorEl: E, open: T, onClose: C, anchorOrigin: B, transformOrigin: M, slotProps: W, ...p, children: Z }), e[34] = p, e[35] = E, e[36] = T, e[37] = Z, e[38] = $) : $ = e[38];
907
909
  let G;
908
- e[39] !== w || e[40] !== a || e[41] !== F ? (G = /* @__PURE__ */ b(ot, { sensors: a, collisionDetection: lt, onDragEnd: w, children: F }), e[39] = w, e[40] = a, e[41] = F, e[42] = G) : G = e[42];
909
- let V;
910
- return e[43] !== L || e[44] !== G ? (V = /* @__PURE__ */ ne(he, { children: [
911
- L,
910
+ e[39] !== D || e[40] !== d || e[41] !== $ ? (G = /* @__PURE__ */ x(it, { sensors: d, collisionDetection: st, onDragEnd: D, children: $ }), e[39] = D, e[40] = d, e[41] = $, e[42] = G) : G = e[42];
911
+ let U;
912
+ return e[43] !== z || e[44] !== G ? (U = /* @__PURE__ */ oe(de, { children: [
913
+ z,
912
914
  G
913
- ] }), e[43] = L, e[44] = G, e[45] = V) : V = e[45], V;
915
+ ] }), e[43] = z, e[44] = G, e[45] = U) : U = e[45], U;
914
916
  }
915
- function wt(n) {
916
- return /* @__PURE__ */ b(zt, { column: n }, n.id);
917
+ function Bt(n) {
918
+ return /* @__PURE__ */ x(Mt, { column: n }, n.id);
917
919
  }
918
- function At(n) {
920
+ function Wt(n) {
919
921
  return n.id;
920
922
  }
921
- function Wt(n) {
923
+ function Ft(n) {
922
924
  return [n.id, n];
923
925
  }
924
- function Pt(n) {
926
+ function $t(n) {
925
927
  return {
926
928
  columns: n?.columns
927
929
  };
928
930
  }
929
- const _e = {
931
+ const Te = {
930
932
  container: {
931
933
  display: "flex",
932
934
  alignItems: "center",
@@ -939,145 +941,356 @@ const _e = {
939
941
  background: (n) => n.palette.primary.relatedLight
940
942
  }
941
943
  }
942
- }, me = "brush-toggle";
943
- function un(n) {
944
- const e = U(32), {
944
+ }, Ee = {
945
+ // `top` and `height` are filled in at render time from the chart's plot
946
+ // rect so rectangles don't bleed over the legend / axis labels.
947
+ //
948
+ // Colors track ECharts 6's `backgroundTint` token (used by the default
949
+ // brush) — a barely-visible pale blue-gray translucent fill that washes
950
+ // bars underneath rather than masking them. Border is a hairline dark
951
+ // alpha so the selection edges are just findable, not prominent.
952
+ rect: {
953
+ position: "absolute",
954
+ background: "rgba(234, 237, 245, 0.2)",
955
+ border: "1px dashed rgba(0, 0, 0, 0.15)",
956
+ pointerEvents: "none"
957
+ },
958
+ // Live drag preview — identical to committed rect (no "in-progress" vs
959
+ // "committed" visual distinction; the preview just disappears on
960
+ // `pointerup` as the rect takes its place).
961
+ rectPreview: {
962
+ position: "absolute",
963
+ background: "rgba(234, 237, 245, 0.6)",
964
+ border: "1px dashed rgba(0, 0, 0, 0.15)",
965
+ pointerEvents: "none"
966
+ }
967
+ };
968
+ function Nt(n, e, t) {
969
+ if (t <= 0) return [];
970
+ const [l, u] = n <= e ? [n, e] : [e, n], c = Math.max(0, Math.floor(l)), p = Math.min(t - 1, Math.ceil(u));
971
+ if (c > p) return [];
972
+ const E = [];
973
+ for (let S = c; S <= p; S += 1) E.push(S);
974
+ return E;
975
+ }
976
+ function Gt(n, e) {
977
+ if (n.length === 0) return [];
978
+ const t = /* @__PURE__ */ new Set();
979
+ for (const l of n)
980
+ for (const u of Nt(l.xStart, l.xEnd, e))
981
+ t.add(u);
982
+ return Array.from(t).sort((l, u) => l - u);
983
+ }
984
+ const Zt = 2, Vt = Object.freeze([]), Ce = Object.freeze([]);
985
+ function Ht(n) {
986
+ try {
987
+ const l = n.getModel().getComponent("grid", 0)?.coordinateSystem?.getRect();
988
+ return !l || !Number.isFinite(l.x) || !Number.isFinite(l.y) || !Number.isFinite(l.width) || !Number.isFinite(l.height) ? null : {
989
+ x: l.x,
990
+ y: l.y,
991
+ width: l.width,
992
+ height: l.height
993
+ };
994
+ } catch {
995
+ return null;
996
+ }
997
+ }
998
+ function jt(n, e) {
999
+ return n === e ? !0 : !n || !e ? !1 : n.x === e.x && n.y === e.y && n.width === e.width && n.height === e.height;
1000
+ }
1001
+ function Ut(n) {
1002
+ const e = J(50), {
945
1003
  id: t,
946
- onBrushSelected: f,
947
- labels: p,
948
- Icon: m,
949
- IconButtonProps: S
950
- } = n;
951
- let _;
952
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = {
953
- dataIndex: [],
954
- seriesIndex: 0
955
- }, e[0] = _) : _ = e[0];
956
- const T = le(_), {
957
- brush: o
958
- } = Q(t, $t);
959
- let l;
960
- e[1] !== o || e[2] !== t || e[3] !== f ? (l = () => {
961
- const h = !o;
962
- g.setWidget(t, {
963
- brush: h
964
- }), h && f?.({
965
- dataIndex: [],
966
- seriesIndex: 0
967
- });
968
- }, e[1] = o, e[2] = t, e[3] = f, e[4] = l) : l = e[4];
969
- const r = l;
970
- let s, a;
971
- e[5] !== o || e[6] !== t ? (s = () => {
1004
+ multiBrush: l
1005
+ } = n, {
1006
+ enabled: u,
1007
+ rects: c,
1008
+ dataLength: p
1009
+ } = te(t, qt), E = Yt;
1010
+ let S;
1011
+ e[0] !== t ? (S = () => b.getWidget(t)?.refUI?.current ?? null, e[0] = t, e[1] = S) : S = e[1];
1012
+ const o = Se(E, S, Kt);
1013
+ let r;
1014
+ e[2] !== t ? (r = () => b.getWidget(t)?.instance?.current ?? null, e[2] = t, e[3] = r) : r = e[3];
1015
+ const i = Se(E, r, Xt), a = le(null), d = le(null), g = le(null), [f, h] = ie(Ce), [m, y] = ie(null), [s, w] = ie(null);
1016
+ let C, P;
1017
+ e[4] !== o || e[5] !== t ? (C = () => {
972
1018
  if (!o)
973
1019
  return;
974
- const h = g.getWidget(t)?.instance?.current;
975
- if (!h)
1020
+ const k = document.getElementById(t);
1021
+ if (!k)
976
1022
  return;
977
- const I = () => {
978
- const L = pe();
979
- h.dispatchAction({
980
- type: "takeGlobalCursor",
981
- key: "brush",
982
- brushOption: {
983
- brushType: L.brush.brushType,
984
- brushMode: L.brush.brushMode
985
- }
986
- });
1023
+ const F = k.style.position;
1024
+ return F || (k.style.position = "relative"), () => {
1025
+ F || (k.style.position = "");
987
1026
  };
988
- return I(), h.on("rendered", I), () => {
989
- h.off("rendered", I);
1027
+ }, P = [t, o], e[4] = o, e[5] = t, e[6] = C, e[7] = P) : (C = e[6], P = e[7]), H(C, P);
1028
+ let D, O;
1029
+ e[8] !== o || e[9] !== i || e[10] !== c ? (D = () => {
1030
+ if (!i || !o)
1031
+ return;
1032
+ const k = () => {
1033
+ const A = Ht(i);
1034
+ if (w((V) => jt(V, A) ? V : A), !A)
1035
+ return;
1036
+ const N = [];
1037
+ for (const V of c) {
1038
+ const X = i.convertToPixel({
1039
+ xAxisIndex: 0
1040
+ }, V.xStart), K = i.convertToPixel({
1041
+ xAxisIndex: 0
1042
+ }, V.xEnd);
1043
+ if (typeof X != "number" || typeof K != "number" || !Number.isFinite(X) || !Number.isFinite(K))
1044
+ continue;
1045
+ const Y = Math.max(A.x, Math.min(X, K)), ne = Math.min(A.x + A.width, Math.max(X, K));
1046
+ ne <= Y || N.push({
1047
+ left: Y,
1048
+ right: ne
1049
+ });
1050
+ }
1051
+ h(N.length === 0 ? Ce : N);
990
1052
  };
991
- }, a = [o, t], e[5] = o, e[6] = t, e[7] = s, e[8] = a) : (s = e[7], a = e[8]), $(s, a);
992
- let u;
993
- e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = (h) => {
994
- const L = h.batch?.flatMap(Rt) ?? [];
995
- if (!L.length) {
996
- T.current = {
997
- dataIndex: [],
998
- seriesIndex: 0
999
- };
1053
+ k(), i.on("finished", k);
1054
+ const F = ht(o, k);
1055
+ return () => {
1056
+ i.off("finished", k), F();
1057
+ };
1058
+ }, O = [i, o, c], e[8] = o, e[9] = i, e[10] = c, e[11] = D, e[12] = O) : (D = e[11], O = e[12]), H(D, O);
1059
+ let T;
1060
+ e[13] !== o || e[14] !== u || e[15] !== s ? (T = (k) => {
1061
+ if (!u || !o || !s)
1062
+ return;
1063
+ const F = a.current;
1064
+ if (!F)
1000
1065
  return;
1066
+ k.preventDefault(), F.setPointerCapture(k.pointerId), g.current = k.pointerId;
1067
+ const A = o.getBoundingClientRect(), N = be(k.clientX - A.left, s);
1068
+ d.current = N, y({
1069
+ left: N,
1070
+ right: N
1071
+ });
1072
+ }, e[13] = o, e[14] = u, e[15] = s, e[16] = T) : T = e[16];
1073
+ const R = T;
1074
+ let L;
1075
+ e[17] !== o || e[18] !== s ? (L = (k) => {
1076
+ if (g.current !== k.pointerId)
1077
+ return;
1078
+ const F = d.current;
1079
+ if (F === null || !o || !s)
1080
+ return;
1081
+ const A = o.getBoundingClientRect(), N = be(k.clientX - A.left, s);
1082
+ y({
1083
+ left: Math.min(F, N),
1084
+ right: Math.max(F, N)
1085
+ });
1086
+ }, e[17] = o, e[18] = s, e[19] = L) : L = e[19];
1087
+ const v = L;
1088
+ let _;
1089
+ e[20] !== o || e[21] !== p || e[22] !== t || e[23] !== i || e[24] !== l || e[25] !== s || e[26] !== c ? (_ = (k) => {
1090
+ if (g.current !== k.pointerId)
1091
+ return;
1092
+ const F = d.current, A = a.current;
1093
+ if (g.current = null, d.current = null, y(null), F === null || !A || !i || !o || !s)
1094
+ return;
1095
+ try {
1096
+ A.releasePointerCapture(k.pointerId);
1097
+ } catch {
1001
1098
  }
1002
- const W = L[0]?.seriesIndex ?? 0, P = Array.from(new Set(L.filter((B) => B.seriesIndex === void 0 || B.seriesIndex === W).flatMap(Bt)));
1003
- T.current = {
1004
- dataIndex: P,
1005
- seriesIndex: W
1099
+ const N = o.getBoundingClientRect(), V = be(k.clientX - N.left, s), X = Math.min(F, V), K = Math.max(F, V);
1100
+ if (K - X < Zt)
1101
+ return;
1102
+ const Y = i.convertFromPixel({
1103
+ xAxisIndex: 0
1104
+ }, X), ne = i.convertFromPixel({
1105
+ xAxisIndex: 0
1106
+ }, K);
1107
+ if (typeof Y != "number" || typeof ne != "number" || !Number.isFinite(Y) || !Number.isFinite(ne))
1108
+ return;
1109
+ const q = {
1110
+ xStart: Y,
1111
+ xEnd: ne
1112
+ }, ee = l ? [...c, q] : [q], ue = {
1113
+ dataIndex: Gt(ee, p),
1114
+ seriesIndex: 0
1006
1115
  };
1007
- }, e[9] = u) : u = e[9];
1008
- const i = u;
1009
- let c;
1010
- e[10] !== t || e[11] !== f ? (c = () => {
1011
- f?.(T.current), g.setWidget(t, {
1012
- brush: !1
1116
+ b.setWidget(t, {
1117
+ brushRects: ee,
1118
+ brushSelection: ue,
1119
+ ...l ? {} : {
1120
+ brush: !1
1121
+ }
1013
1122
  });
1014
- }, e[10] = t, e[11] = f, e[12] = c) : c = e[12];
1015
- const d = c;
1016
- let v, O;
1017
- e[13] !== d || e[14] !== t ? (v = () => (g.registerTool(t, {
1018
- id: me,
1019
- type: "config",
1020
- order: 25,
1021
- enabled: !1,
1022
- fn: (h) => {
1023
- const I = h, L = I.option, W = I.onEvents ?? {}, P = pe(), B = {
1024
- ...W,
1025
- brushSelected: i,
1026
- brushEnd: d
1027
- };
1028
- return {
1029
- ...I,
1030
- option: {
1031
- ...L,
1032
- ...P
1033
- },
1034
- onEvents: B
1035
- };
1036
- }
1037
- }), () => g.unregisterTool(t, me)), O = [t, i, d], e[13] = d, e[14] = t, e[15] = v, e[16] = O) : (v = e[15], O = e[16]), $(v, O);
1038
- let C, k;
1039
- e[17] !== o || e[18] !== t ? (k = () => {
1040
- g.setToolEnabled(t, me, o);
1041
- }, C = [t, o], e[17] = o, e[18] = t, e[19] = C, e[20] = k) : (C = e[19], k = e[20]), $(k, C);
1042
- const A = p?.enable ?? "Enable brush selection", w = p?.disable ?? "Disable brush selection", D = o ? w : A, x = p?.ariaLabel ?? D;
1043
- let E;
1044
- e[21] !== m ? (E = m ?? /* @__PURE__ */ b(qe, {}), e[21] = m, e[22] = E) : E = e[22];
1123
+ }, e[20] = o, e[21] = p, e[22] = t, e[23] = i, e[24] = l, e[25] = s, e[26] = c, e[27] = _) : _ = e[27];
1124
+ const I = _;
1125
+ if (!o)
1126
+ return null;
1045
1127
  let z;
1046
- e[23] !== S || e[24] !== o || e[25] !== r || e[26] !== x || e[27] !== E ? (z = /* @__PURE__ */ b(K, { size: "small", "aria-label": x, onClick: r, sx: _e.trigger, "data-active": o, ...S, children: E }), e[23] = S, e[24] = o, e[25] = r, e[26] = x, e[27] = E, e[28] = z) : z = e[28];
1047
- let y;
1048
- return e[29] !== z || e[30] !== D ? (y = /* @__PURE__ */ b(ke, { sx: _e.container, children: /* @__PURE__ */ b(ee, { title: D, children: z }) }), e[29] = z, e[30] = D, e[31] = y) : y = e[31], y;
1128
+ e[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (z = {
1129
+ position: "absolute",
1130
+ inset: 0,
1131
+ pointerEvents: "none",
1132
+ zIndex: 1
1133
+ }, e[28] = z) : z = e[28];
1134
+ const B = z;
1135
+ let M;
1136
+ e[29] !== u || e[30] !== s ? (M = s ? {
1137
+ position: "absolute",
1138
+ left: s.x,
1139
+ top: s.y,
1140
+ width: s.width,
1141
+ height: s.height,
1142
+ pointerEvents: u ? "auto" : "none",
1143
+ cursor: u ? "crosshair" : "default",
1144
+ userSelect: "none",
1145
+ touchAction: "none"
1146
+ } : void 0, e[29] = u, e[30] = s, e[31] = M) : M = e[31];
1147
+ const W = M;
1148
+ let j;
1149
+ e[32] !== W || e[33] !== R || e[34] !== v || e[35] !== I ? (j = W && /* @__PURE__ */ x("div", { ref: a, style: W, onPointerDown: R, onPointerMove: v, onPointerUp: I, onPointerCancel: I }), e[32] = W, e[33] = R, e[34] = v, e[35] = I, e[36] = j) : j = e[36];
1150
+ let Z;
1151
+ e[37] !== s || e[38] !== f ? (Z = s && f.map((k, F) => /* @__PURE__ */ x("div", { style: {
1152
+ ...Ee.rect,
1153
+ left: k.left,
1154
+ width: Math.max(0, k.right - k.left),
1155
+ top: s.y,
1156
+ height: s.height
1157
+ } }, `${k.left}-${k.right}-${F}`)), e[37] = s, e[38] = f, e[39] = Z) : Z = e[39];
1158
+ let $;
1159
+ e[40] !== m || e[41] !== s ? ($ = s && m && /* @__PURE__ */ x("div", { style: {
1160
+ ...Ee.rectPreview,
1161
+ left: m.left,
1162
+ width: Math.max(0, m.right - m.left),
1163
+ top: s.y,
1164
+ height: s.height
1165
+ } }), e[40] = m, e[41] = s, e[42] = $) : $ = e[42];
1166
+ let G;
1167
+ e[43] !== j || e[44] !== Z || e[45] !== $ ? (G = /* @__PURE__ */ oe("div", { style: B, children: [
1168
+ j,
1169
+ Z,
1170
+ $
1171
+ ] }), e[43] = j, e[44] = Z, e[45] = $, e[46] = G) : G = e[46];
1172
+ let U;
1173
+ return e[47] !== o || e[48] !== G ? (U = gt(G, o), e[47] = o, e[48] = G, e[49] = U) : U = e[49], U;
1049
1174
  }
1050
- function Bt(n) {
1051
- return n.dataIndex ?? [];
1175
+ function Xt() {
1176
+ return null;
1052
1177
  }
1053
- function Rt(n) {
1054
- return n.selected ?? [];
1178
+ function Kt() {
1179
+ return null;
1055
1180
  }
1056
- function $t(n) {
1181
+ function Yt(n) {
1182
+ return Ve.subscribe(n);
1183
+ }
1184
+ function qt(n) {
1185
+ const e = n, l = n?.data?.[0], u = Array.isArray(l) ? l.length : 0;
1057
1186
  return {
1058
- brush: n?.brush ?? !1
1187
+ enabled: e?.brush ?? !1,
1188
+ rects: e?.brushRects ?? Vt,
1189
+ dataLength: u
1059
1190
  };
1060
1191
  }
1192
+ function be(n, e) {
1193
+ return Math.max(e.x, Math.min(e.x + e.width, n));
1194
+ }
1195
+ const Cn = "brush-toggle";
1196
+ function Ln(n) {
1197
+ const e = J(35), {
1198
+ id: t,
1199
+ onBrushSelected: l,
1200
+ multiBrush: u,
1201
+ selections: c,
1202
+ defaultEnabled: p,
1203
+ labels: E,
1204
+ Icon: S,
1205
+ IconButtonProps: o
1206
+ } = n, r = p === void 0 ? !1 : p;
1207
+ let i;
1208
+ e[0] !== r ? (i = (B) => {
1209
+ const M = B;
1210
+ return {
1211
+ brush: M?.brush ?? r,
1212
+ selection: M?.brushSelection
1213
+ };
1214
+ }, e[0] = r, e[1] = i) : i = e[1];
1215
+ const {
1216
+ brush: a,
1217
+ selection: d
1218
+ } = te(t, i);
1219
+ let g, f;
1220
+ e[2] !== r || e[3] !== t ? (g = () => {
1221
+ b.getWidget(t)?.brush === void 0 && b.setWidget(t, {
1222
+ brush: r
1223
+ });
1224
+ }, f = [t, r], e[2] = r, e[3] = t, e[4] = g, e[5] = f) : (g = e[4], f = e[5]), H(g, f);
1225
+ let h;
1226
+ e[6] !== a || e[7] !== t || e[8] !== l ? (h = () => {
1227
+ a ? b.setWidget(t, {
1228
+ brush: !1
1229
+ }) : (b.setWidget(t, {
1230
+ brush: !0,
1231
+ brushRects: [],
1232
+ brushSelection: {
1233
+ dataIndex: [],
1234
+ seriesIndex: 0
1235
+ }
1236
+ }), l?.({
1237
+ dataIndex: [],
1238
+ seriesIndex: 0
1239
+ }));
1240
+ }, e[6] = a, e[7] = t, e[8] = l, e[9] = h) : h = e[9];
1241
+ const m = h, y = le(void 0);
1242
+ let s, w;
1243
+ e[10] !== l || e[11] !== d ? (s = () => {
1244
+ d && y.current !== d && (y.current = d, l?.(d));
1245
+ }, w = [d, l], e[10] = l, e[11] = d, e[12] = s, e[13] = w) : (s = e[12], w = e[13]), H(s, w);
1246
+ let C, P;
1247
+ e[14] !== t || e[15] !== c ? (C = () => {
1248
+ if (c !== 0)
1249
+ return;
1250
+ const B = b.getWidget(t), M = (B?.brushRects?.length ?? 0) > 0, W = (B?.brushSelection?.dataIndex?.length ?? 0) > 0;
1251
+ !M && !W || b.setWidget(t, {
1252
+ brushRects: [],
1253
+ brushSelection: {
1254
+ dataIndex: [],
1255
+ seriesIndex: 0
1256
+ }
1257
+ });
1258
+ }, P = [c, t], e[14] = t, e[15] = c, e[16] = C, e[17] = P) : (C = e[16], P = e[17]), H(C, P);
1259
+ const D = E?.enable ?? "Enable brush selection", O = E?.disable ?? "Disable brush selection", T = a ? O : D, R = E?.ariaLabel ?? T;
1260
+ let L;
1261
+ e[18] !== S ? (L = S ?? /* @__PURE__ */ x(Qe, {}), e[18] = S, e[19] = L) : L = e[19];
1262
+ let v;
1263
+ e[20] !== o || e[21] !== a || e[22] !== m || e[23] !== R || e[24] !== L ? (v = /* @__PURE__ */ x(Q, { size: "small", "aria-label": R, onClick: m, sx: Te.trigger, "data-active": a, ...o, children: L }), e[20] = o, e[21] = a, e[22] = m, e[23] = R, e[24] = L, e[25] = v) : v = e[25];
1264
+ let _;
1265
+ e[26] !== v || e[27] !== T ? (_ = /* @__PURE__ */ x(Pe, { sx: Te.container, children: /* @__PURE__ */ x(re, { title: T, children: v }) }), e[26] = v, e[27] = T, e[28] = _) : _ = e[28];
1266
+ let I;
1267
+ e[29] !== t || e[30] !== u ? (I = /* @__PURE__ */ x(Ut, { id: t, multiBrush: u }), e[29] = t, e[30] = u, e[31] = I) : I = e[31];
1268
+ let z;
1269
+ return e[32] !== _ || e[33] !== I ? (z = /* @__PURE__ */ oe(de, { children: [
1270
+ _,
1271
+ I
1272
+ ] }), e[32] = _, e[33] = I, e[34] = z) : z = e[34], z;
1273
+ }
1061
1274
  export {
1062
- me as BRUSH_TOGGLE_TOOL_ID,
1063
- un as BrushToggle,
1064
- Te as CHANGE_COLUMN_TOOL_ID,
1065
- dn as ChangeColumn,
1066
- nn as Download,
1067
- tn as FullScreen,
1068
- ie as LOCK_SELECTION_TOOL_ID,
1069
- sn as LockSelection,
1070
- Ie as RELATIVE_DATA_CONFIG_TOOL_ID,
1071
- ce as RELATIVE_DATA_TOOL_ID,
1072
- on as RelativeData,
1073
- fe as SEARCHER_TOOL_ID,
1074
- ue as STACK_TOGGLE_TOOL_ID,
1075
- an as Searcher,
1076
- cn as SearcherToggle,
1077
- rn as StackToggle,
1078
- de as ZOOM_TOGGLE_TOOL_ID,
1079
- ln as ZoomToggle,
1080
- gn as downloadToCSV,
1081
- hn as downloadToPNG
1275
+ Cn as BRUSH_TOGGLE_TOOL_ID,
1276
+ Ln as BrushToggle,
1277
+ _e as CHANGE_COLUMN_TOOL_ID,
1278
+ En as ChangeColumn,
1279
+ Sn as Download,
1280
+ pn as FullScreen,
1281
+ ae as LOCK_SELECTION_TOOL_ID,
1282
+ In as LockSelection,
1283
+ ye as RELATIVE_DATA_CONFIG_TOOL_ID,
1284
+ fe as RELATIVE_DATA_TOOL_ID,
1285
+ xn as RelativeData,
1286
+ he as SEARCHER_TOOL_ID,
1287
+ ge as STACK_TOGGLE_TOOL_ID,
1288
+ _n as Searcher,
1289
+ Tn as SearcherToggle,
1290
+ yn as StackToggle,
1291
+ me as ZOOM_TOGGLE_TOOL_ID,
1292
+ vn as ZoomToggle,
1293
+ Pn as downloadToCSV,
1294
+ Rn as downloadToPNG
1082
1295
  };
1083
1296
  //# sourceMappingURL=actions.js.map