@carto/ps-react-ui 4.15.0 → 4.17.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 (82) hide show
  1. package/dist/components.js +786 -749
  2. package/dist/components.js.map +1 -1
  3. package/dist/legend/stores.js +20 -16
  4. package/dist/legend-store-registry-Bo8U_qWM.js +468 -0
  5. package/dist/legend-store-registry-Bo8U_qWM.js.map +1 -0
  6. package/dist/legend.js +1485 -798
  7. package/dist/legend.js.map +1 -1
  8. package/dist/types/components/responsive-drawer/responsive-drawer.d.ts +2 -9
  9. package/dist/types/legend/components/a11y.d.ts +6 -0
  10. package/dist/types/legend/components/contexts.d.ts +22 -4
  11. package/dist/types/legend/components/index.d.ts +2 -2
  12. package/dist/types/legend/components/legend-actions/legend-actions.d.ts +4 -3
  13. package/dist/types/legend/components/legend-group/legend-group.d.ts +2 -11
  14. package/dist/types/legend/components/legend-group/styles.d.ts +40 -2
  15. package/dist/types/legend/components/legend-group-menu/legend-group-menu-items.d.ts +28 -0
  16. package/dist/types/legend/components/legend-group-menu/legend-group-menu.d.ts +11 -0
  17. package/dist/types/legend/components/legend-opacity/legend-opacity.d.ts +7 -17
  18. package/dist/types/legend/components/legend-opacity/styles.d.ts +11 -6
  19. package/dist/types/legend/components/legend-overflow-menu/legend-overflow-menu.d.ts +12 -0
  20. package/dist/types/legend/components/legend-panel-menu/legend-panel-menu.d.ts +11 -0
  21. package/dist/types/legend/components/legend-row/legend-row.d.ts +4 -11
  22. package/dist/types/legend/components/legend-row/styles.d.ts +36 -1
  23. package/dist/types/legend/components/legend-row-menu/legend-row-menu-items.d.ts +12 -0
  24. package/dist/types/legend/components/legend-row-menu/legend-row-menu.d.ts +4 -10
  25. package/dist/types/legend/components/legend-row-menu/legend-zoom-to.d.ts +3 -8
  26. package/dist/types/legend/components/legend-sortable/contexts.d.ts +7 -0
  27. package/dist/types/legend/components/legend-sortable/legend-sortable.d.ts +11 -0
  28. package/dist/types/legend/components/legend-sortable/sortable-entity.d.ts +27 -0
  29. package/dist/types/legend/components/legend-sortable/sortable-ids.d.ts +6 -0
  30. package/dist/types/legend/components/legend-sortable/styles.d.ts +54 -0
  31. package/dist/types/legend/components/legend-visible-layers/legend-visible-layers.d.ts +7 -0
  32. package/dist/types/legend/components/legend-visible-layers/styles.d.ts +48 -0
  33. package/dist/types/legend/components/run-async-menu-action.d.ts +7 -0
  34. package/dist/types/legend/index.d.ts +53 -6
  35. package/dist/types/legend/provider/labels.d.ts +21 -0
  36. package/dist/types/legend/stores/index.d.ts +1 -1
  37. package/dist/types/legend/stores/selectors.d.ts +31 -0
  38. package/dist/types/legend/stores/types.d.ts +19 -0
  39. package/package.json +3 -3
  40. package/src/components/responsive-drawer/responsive-drawer.test.tsx +138 -0
  41. package/src/components/responsive-drawer/responsive-drawer.tsx +77 -51
  42. package/src/legend/components/a11y.ts +14 -0
  43. package/src/legend/components/contexts.ts +29 -4
  44. package/src/legend/components/index.ts +3 -4
  45. package/src/legend/components/legend-actions/legend-actions.tsx +4 -3
  46. package/src/legend/components/legend-group/legend-group.test.tsx +191 -9
  47. package/src/legend/components/legend-group/legend-group.tsx +88 -52
  48. package/src/legend/components/legend-group/styles.ts +59 -2
  49. package/src/legend/components/legend-group-menu/legend-group-menu-items.tsx +132 -0
  50. package/src/legend/components/legend-group-menu/legend-group-menu.tsx +25 -0
  51. package/src/legend/components/legend-opacity/legend-opacity.tsx +43 -70
  52. package/src/legend/components/legend-opacity/styles.ts +14 -9
  53. package/src/legend/components/legend-overflow-menu/legend-overflow-menu.tsx +84 -0
  54. package/src/legend/components/legend-panel-menu/legend-panel-menu.tsx +23 -0
  55. package/src/legend/components/legend-ramp/legend-ramp-ui.tsx +2 -1
  56. package/src/legend/components/legend-row/legend-row.test.tsx +304 -85
  57. package/src/legend/components/legend-row/legend-row.tsx +73 -50
  58. package/src/legend/components/legend-row/styles.ts +54 -1
  59. package/src/legend/components/legend-row-menu/legend-row-menu-items.tsx +57 -0
  60. package/src/legend/components/legend-row-menu/legend-row-menu.tsx +12 -50
  61. package/src/legend/components/legend-row-menu/legend-zoom-to.tsx +25 -17
  62. package/src/legend/components/legend-sortable/contexts.ts +12 -0
  63. package/src/legend/components/legend-sortable/legend-sortable.test.tsx +144 -0
  64. package/src/legend/components/legend-sortable/legend-sortable.tsx +195 -0
  65. package/src/legend/components/legend-sortable/sortable-entity.tsx +91 -0
  66. package/src/legend/components/legend-sortable/sortable-ids.ts +17 -0
  67. package/src/legend/components/legend-sortable/styles.ts +56 -0
  68. package/src/legend/components/legend-visibility-toggle/legend-visibility-toggle.tsx +14 -8
  69. package/src/legend/components/legend-visible-layers/legend-visible-layers.test.tsx +86 -0
  70. package/src/legend/components/legend-visible-layers/legend-visible-layers.tsx +135 -0
  71. package/src/legend/components/legend-visible-layers/styles.ts +60 -0
  72. package/src/legend/components/run-async-menu-action.ts +20 -0
  73. package/src/legend/index.ts +59 -4
  74. package/src/legend/provider/labels.ts +43 -1
  75. package/src/legend/stores/index.ts +4 -0
  76. package/src/legend/stores/legend-store-registry.ts +82 -2
  77. package/src/legend/stores/legend-store.test.ts +168 -0
  78. package/src/legend/stores/selectors.ts +64 -2
  79. package/src/legend/stores/types.ts +19 -0
  80. package/src/widgets/actions/download/exports.test.tsx +14 -1
  81. package/dist/selectors-DwHj6mE2.js +0 -388
  82. package/dist/selectors-DwHj6mE2.js.map +0 -1
package/dist/legend.js CHANGED
@@ -1,119 +1,267 @@
1
- import { jsx as s, jsxs as E, Fragment as se } from "react/jsx-runtime";
2
- import { c as R } from "react/compiler-runtime";
3
- import { createContext as he, useContext as me, useState as oe, useLayoutEffect as ye, Children as Ae, isValidElement as Be, useEffect as We, useId as Fe } from "react";
4
- import { L as Ne, h as Ue, g as je, a as Ze, i as Xe, r as Ke, u as qe, j as ee, k as Y, l as X, s as Je } from "./selectors-DwHj6mE2.js";
5
- import { Box as P, Typography as V, IconButton as de, Collapse as ve, createSvgIcon as Qe, Menu as Le, MenuItem as Ce, ListItemIcon as Ye, Slider as et, Popover as tt, Tooltip as we, InputAdornment as lt, OutlinedInput as ot, ButtonBase as nt } from "@mui/material";
6
- import { ExpandMore as Se, ExpandLess as Ie, LayersOutlined as it, VisibilityOffOutlined as rt, VisibilityOutlined as st, MoreVert as at, CenterFocusStrong as ct, ArrowDropDown as dt, ErrorOutline as pt } from "@mui/icons-material";
7
- import { S as $e } from "./smart-tooltip-D4vwQpFf.js";
1
+ import { jsx as d, jsxs as z, Fragment as he } from "react/jsx-runtime";
2
+ import { c as T } from "react/compiler-runtime";
3
+ import { createContext as me, useContext as be, useState as J, useLayoutEffect as Ge, Children as ut, isValidElement as pt, useEffect as ft, useRef as Te, useId as ht } from "react";
4
+ import { L as gt, h as yt, g as X, a as mt, m as bt, r as xt, u as vt, n as N, o as Z, p as U, b as ke, i as re, f as Lt, e as De, s as Me, j as xe, l as Ee } from "./legend-store-registry-Bo8U_qWM.js";
5
+ import { Box as P, IconButton as ve, Typography as E, Collapse as He, createSvgIcon as St, Menu as $e, CircularProgress as Re, MenuItem as q, Divider as Ct, Slider as wt, InputAdornment as It, OutlinedInput as kt, ButtonBase as $t } from "@mui/material";
6
+ import { DragIndicator as Ot, ExpandMore as Ve, VisibilityOffOutlined as _t, VisibilityOutlined as Be, MoreVert as Gt, ChecklistOutlined as Mt, Close as Pt, ArrowDropDown as zt, ErrorOutline as At } from "@mui/icons-material";
7
+ import { useSortable as Tt, SortableContext as We, verticalListSortingStrategy as Ne } from "@dnd-kit/sortable";
8
+ import { S as Fe } from "./smart-tooltip-D4vwQpFf.js";
9
+ import { CSS as Dt } from "@dnd-kit/utilities";
10
+ import { T as ie } from "./tooltip-BDnrRKrp.js";
8
11
  import "zustand";
9
12
  import "zustand/vanilla";
10
13
  import "zustand/middleware";
11
14
  import "zustand/react/shallow";
12
- import { Opacity as ft } from "@carto/meridian-ds/custom-icons";
13
- const ae = {
15
+ import { useSensors as Et, useSensor as Pe, PointerSensor as Ht, KeyboardSensor as Rt, DndContext as Vt, closestCenter as Bt, DragOverlay as Wt } from "@dnd-kit/core";
16
+ const ge = {
14
17
  expandLayer: "Expand layer",
15
18
  collapseLayer: "Collapse layer",
16
19
  hideLayer: "Hide layer",
17
20
  showLayer: "Show layer",
18
21
  layerOptions: "Layer options",
19
- zoomTo: "Zoom to",
22
+ zoomTo: "Zoom to layer",
23
+ loading: "Loading…",
24
+ showOnlyLayer: "Show only this layer",
25
+ showAllLayers: "Show all layers",
20
26
  hideGroup: "Hide group",
21
27
  showGroup: "Show group",
22
28
  expandGroup: "Expand group",
23
29
  collapseGroup: "Collapse group",
30
+ groupOptions: "Group options",
31
+ showOnlyGroup: "Show only this group",
32
+ showAllGroups: "Show all groups",
33
+ collapseAllGroups: "Collapse all groups",
34
+ expandAllGroups: "Expand all groups",
35
+ zoomToGroup: "Zoom to group",
36
+ panelOptions: "Legend options",
37
+ enabledLayers: "Enabled layers",
38
+ toggleEnabledLayers: "Quickly toggle enabled layers",
39
+ moreOptions: "More options",
40
+ reorder: "Reorder",
24
41
  opacity: "Opacity",
25
42
  attribute: "Attribute",
43
+ close: "Close",
26
44
  radiusRangeBy: "Radius range by",
27
45
  colorBasedOn: "Color based on",
28
46
  colorGradient: "Color gradient",
29
47
  maxPrefix: "MAX: ",
30
48
  minPrefix: "MIN: "
31
- }, ke = he({
32
- labels: ae
49
+ }, Ue = me({
50
+ labels: ge
33
51
  });
34
- function K() {
35
- return me(ke);
52
+ function B() {
53
+ return be(Ue);
36
54
  }
37
- function ut(t) {
38
- const e = R(24), {
55
+ function Nt(t) {
56
+ const e = T(24), {
39
57
  id: o,
40
- layers: n,
41
- groups: i,
42
- labels: r,
43
- keepAlive: l,
44
- children: p
45
- } = t, a = l === void 0 ? !0 : l;
46
- let d;
47
- e[0] !== i || e[1] !== o || e[2] !== n ? (d = () => {
48
- if (Ue(o))
49
- return je(o);
50
- const L = Ze(o, {
51
- layers: n,
52
- groups: i
58
+ layers: r,
59
+ groups: l,
60
+ labels: i,
61
+ keepAlive: n,
62
+ children: a
63
+ } = t, s = n === void 0 ? !0 : n;
64
+ let c;
65
+ e[0] !== l || e[1] !== o || e[2] !== r ? (c = () => {
66
+ if (yt(o))
67
+ return X(o);
68
+ const w = mt(o, {
69
+ layers: r,
70
+ groups: l
53
71
  });
54
- return Xe(o, L), L;
55
- }, e[0] = i, e[1] = o, e[2] = n, e[3] = d) : d = e[3];
56
- const [f] = oe(d);
57
- let m, c;
58
- e[4] !== o || e[5] !== a || e[6] !== f ? (m = () => (Ke(o, f), () => {
59
- qe(o, {
60
- keepAlive: a
72
+ return bt(o, w), w;
73
+ }, e[0] = l, e[1] = o, e[2] = r, e[3] = c) : c = e[3];
74
+ const [p] = J(c);
75
+ let f, u;
76
+ e[4] !== o || e[5] !== s || e[6] !== p ? (f = () => (xt(o, p), () => {
77
+ vt(o, {
78
+ keepAlive: s
61
79
  });
62
- }), c = [o, f, a], e[4] = o, e[5] = a, e[6] = f, e[7] = m, e[8] = c) : (m = e[7], c = e[8]), ye(m, c);
63
- let g, u;
64
- e[9] !== i || e[10] !== n || e[11] !== f ? (g = () => {
65
- f.getState()._sync(n, i ?? []);
66
- }, u = [f, n, i], e[9] = i, e[10] = n, e[11] = f, e[12] = g, e[13] = u) : (g = e[12], u = e[13]), ye(g, u);
67
- let h;
68
- e[14] !== r ? (h = r ? {
69
- ...ae,
70
- ...r
71
- } : ae, e[14] = r, e[15] = h) : h = e[15];
72
- let y;
73
- e[16] !== h ? (y = {
74
- labels: h
75
- }, e[16] = h, e[17] = y) : y = e[17];
76
- const x = y;
77
- let b;
78
- e[18] !== p || e[19] !== x ? (b = /* @__PURE__ */ s(ke.Provider, { value: x, children: p }), e[18] = p, e[19] = x, e[20] = b) : b = e[20];
80
+ }), u = [o, p, s], e[4] = o, e[5] = s, e[6] = p, e[7] = f, e[8] = u) : (f = e[7], u = e[8]), Ge(f, u);
81
+ let y, h;
82
+ e[9] !== l || e[10] !== r || e[11] !== p ? (y = () => {
83
+ p.getState()._sync(r, l ?? []);
84
+ }, h = [p, r, l], e[9] = l, e[10] = r, e[11] = p, e[12] = y, e[13] = h) : (y = e[12], h = e[13]), Ge(y, h);
85
+ let g;
86
+ e[14] !== i ? (g = i ? {
87
+ ...ge,
88
+ ...i
89
+ } : ge, e[14] = i, e[15] = g) : g = e[15];
79
90
  let v;
80
- return e[21] !== o || e[22] !== b ? (v = /* @__PURE__ */ s(Ne.Provider, { value: o, children: b }), e[21] = o, e[22] = b, e[23] = v) : v = e[23], v;
91
+ e[16] !== g ? (v = {
92
+ labels: g
93
+ }, e[16] = g, e[17] = v) : v = e[17];
94
+ const b = v;
95
+ let C;
96
+ e[18] !== a || e[19] !== b ? (C = /* @__PURE__ */ d(Ue.Provider, { value: b, children: a }), e[18] = a, e[19] = b, e[20] = C) : C = e[20];
97
+ let L;
98
+ return e[21] !== o || e[22] !== C ? (L = /* @__PURE__ */ d(gt.Provider, { value: o, children: C }), e[21] = o, e[22] = C, e[23] = L) : L = e[23], L;
99
+ }
100
+ function je(t) {
101
+ return (e) => {
102
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), t());
103
+ };
104
+ }
105
+ const Ze = me(null);
106
+ function Q() {
107
+ return be(Ze);
81
108
  }
82
- const ze = he(null);
83
- function te() {
84
- return me(ze);
109
+ const Ke = me(null);
110
+ function ue() {
111
+ return be(Ke);
85
112
  }
86
- const _e = he(null);
87
- function ht() {
88
- return me(_e);
113
+ const Xe = me(null);
114
+ function qe() {
115
+ return be(Xe);
89
116
  }
90
- const mt = {
117
+ const Ft = {
91
118
  fadeGroup: {
92
119
  display: "flex",
93
120
  alignItems: "center",
94
121
  gap: 0.25
95
122
  }
96
123
  };
97
- function Pe(t) {
98
- const e = R(3), {
124
+ function Qe(t) {
125
+ const e = T(3), {
99
126
  children: o
100
- } = t, i = te() !== null ? "PsLegend-rowFade" : "PsLegend-groupFade";
101
- let r;
102
- return e[0] !== o || e[1] !== i ? (r = /* @__PURE__ */ s(P, { className: i, sx: mt.fadeGroup, children: o }), e[0] = o, e[1] = i, e[2] = r) : r = e[2], r;
127
+ } = t, l = Q() !== null ? "PsLegend-rowFade" : "PsLegend-groupFade";
128
+ let i;
129
+ return e[0] !== o || e[1] !== l ? (i = /* @__PURE__ */ d(P, { className: l, sx: Ft.fadeGroup, children: o }), e[0] = o, e[1] = l, e[2] = i) : i = e[2], i;
103
130
  }
104
- function Me(t) {
131
+ function Ye(t) {
105
132
  const e = [], o = [];
106
- for (const n of Ae.toArray(t))
107
- gt(n, Pe) ? e.push(n) : o.push(n);
133
+ for (const r of ut.toArray(t))
134
+ Ut(r, Qe) ? e.push(r) : o.push(r);
108
135
  return {
109
136
  actions: e,
110
137
  body: o
111
138
  };
112
139
  }
113
- function gt(t, e) {
114
- return Be(t) && t.type === e;
140
+ function Ut(t, e) {
141
+ return pt(t) && t.type === e;
142
+ }
143
+ const Je = me(!1);
144
+ function et() {
145
+ return be(Je);
146
+ }
147
+ const Se = (t, e) => `${t}:${e}`;
148
+ function de(t) {
149
+ const e = t.indexOf(":");
150
+ if (e === -1) return null;
151
+ const o = t.slice(0, e);
152
+ return o !== "group" && o !== "layer" ? null : {
153
+ kind: o,
154
+ id: t.slice(e + 1)
155
+ };
156
+ }
157
+ const le = {
158
+ // Absolute handle — no flex slot; sticky header is the containing block.
159
+ handleSlot: {
160
+ position: "absolute",
161
+ zIndex: 1,
162
+ display: "flex",
163
+ alignItems: "center",
164
+ justifyContent: "center",
165
+ height: 24
166
+ },
167
+ handleSlotLayer: {
168
+ right: 2
169
+ },
170
+ handleSlotGroup: {
171
+ right: 2
172
+ },
173
+ handle: {
174
+ padding: "2px",
175
+ cursor: "grab",
176
+ touchAction: "none",
177
+ color: "text.secondary",
178
+ "& .MuiSvgIcon-root": {
179
+ fontSize: 18
180
+ },
181
+ "&:active": {
182
+ cursor: "grabbing"
183
+ },
184
+ "&:hover": {
185
+ backgroundColor: "transparent"
186
+ }
187
+ },
188
+ overlay: {
189
+ display: "flex",
190
+ alignItems: "center",
191
+ gap: 1,
192
+ padding: ({
193
+ spacing: t
194
+ }) => t(1, 1.5),
195
+ backgroundColor: "background.paper",
196
+ borderRadius: 1,
197
+ boxShadow: 4,
198
+ height: "auto",
199
+ maxWidth: "100%",
200
+ overflow: "hidden"
201
+ },
202
+ overlayIcon: {
203
+ display: "flex",
204
+ color: "text.secondary"
205
+ },
206
+ overlayLabel: {
207
+ minWidth: 0,
208
+ overflow: "hidden",
209
+ textOverflow: "ellipsis",
210
+ whiteSpace: "nowrap"
211
+ }
212
+ };
213
+ function tt(t) {
214
+ const e = T(31), {
215
+ kind: o,
216
+ id: r,
217
+ render: l
218
+ } = t, {
219
+ labels: i
220
+ } = B();
221
+ let n;
222
+ e[0] !== r || e[1] !== o ? (n = Se(o, r), e[0] = r, e[1] = o, e[2] = n) : n = e[2];
223
+ let a;
224
+ e[3] !== n ? (a = {
225
+ id: n
226
+ }, e[3] = n, e[4] = a) : a = e[4];
227
+ const {
228
+ attributes: s,
229
+ listeners: c,
230
+ setNodeRef: p,
231
+ setActivatorNodeRef: f,
232
+ transform: u,
233
+ transition: y,
234
+ isDragging: h
235
+ } = Tt(a);
236
+ let g;
237
+ if (e[5] !== s || e[6] !== h || e[7] !== o || e[8] !== i.reorder || e[9] !== c || e[10] !== l || e[11] !== f || e[12] !== p || e[13] !== u || e[14] !== y) {
238
+ const v = {
239
+ transform: Dt.Transform.toString(u ? {
240
+ ...u,
241
+ x: 0
242
+ } : null),
243
+ transition: y
244
+ }, b = `PsLegend-dragHandle-${o}`, C = o === "group" ? le.handleSlotGroup : le.handleSlotLayer;
245
+ let L;
246
+ e[16] !== C ? (L = [le.handleSlot, C], e[16] = C, e[17] = L) : L = e[17];
247
+ let w;
248
+ e[18] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ d(Ot, {}), e[18] = w) : w = e[18];
249
+ let x;
250
+ e[19] !== s || e[20] !== i.reorder || e[21] !== c || e[22] !== f ? (x = /* @__PURE__ */ d(ve, { ref: f, size: "xsmall", "aria-label": i.reorder, ...s, ...c, sx: le.handle, children: w }), e[19] = s, e[20] = i.reorder, e[21] = c, e[22] = f, e[23] = x) : x = e[23];
251
+ let I;
252
+ e[24] !== i.reorder || e[25] !== x ? (I = /* @__PURE__ */ d(ie, { title: i.reorder, children: x }), e[24] = i.reorder, e[25] = x, e[26] = I) : I = e[26];
253
+ let S;
254
+ e[27] !== b || e[28] !== L || e[29] !== I ? (S = /* @__PURE__ */ d(P, { component: "span", className: b, sx: L, children: I }), e[27] = b, e[28] = L, e[29] = I, e[30] = S) : S = e[30], g = l({
255
+ rootRef: p,
256
+ rootStyle: v,
257
+ dragging: h,
258
+ handle: S
259
+ }), e[5] = s, e[6] = h, e[7] = o, e[8] = i.reorder, e[9] = c, e[10] = l, e[11] = f, e[12] = p, e[13] = u, e[14] = y, e[15] = g;
260
+ } else
261
+ g = e[15];
262
+ return g;
115
263
  }
116
- const Oe = 48, ie = {
264
+ const ot = 48, Y = {
117
265
  group: {
118
266
  display: "flex",
119
267
  flexDirection: "column",
@@ -144,8 +292,30 @@ const Oe = 48, ie = {
144
292
  },
145
293
  "&:hover .PsLegend-groupFade > *, &:focus-within .PsLegend-groupFade > *": {
146
294
  opacity: 1
295
+ },
296
+ // Drag handle (Legend.Sortable): absolutely positioned (no reserved flex
297
+ // slot, so it never shifts the title/icon); the button inside fades in
298
+ // on hover/focus and is always visible on touch devices.
299
+ "& .PsLegend-dragHandle-group > *": {
300
+ opacity: 0,
301
+ transition: ({
302
+ transitions: t
303
+ }) => t.create("opacity", {
304
+ duration: t.duration.standard,
305
+ easing: t.easing.easeInOut
306
+ }),
307
+ "@media (hover: none)": {
308
+ opacity: 1
309
+ }
310
+ },
311
+ "&:hover .PsLegend-dragHandle-group > *, &:focus-within .PsLegend-dragHandle-group > *": {
312
+ opacity: 1
147
313
  }
148
314
  },
315
+ // The original stays in place, dimmed, while its overlay clone is dragged.
316
+ groupDragging: {
317
+ opacity: 0.4
318
+ },
149
319
  // Figma: 48px tall, icon at 12px from the left, 8px gap to the label,
150
320
  // actions right-aligned with ~8px edge inset (the small icon-button padding
151
321
  // brings the glyphs to the design's 16px optical inset), hairline divider
@@ -157,7 +327,7 @@ const Oe = 48, ie = {
157
327
  padding: ({
158
328
  spacing: t
159
329
  }) => t(1.5, 2, 1.5, 1),
160
- minHeight: Oe,
330
+ minHeight: ot,
161
331
  borderBottom: "1px solid",
162
332
  borderColor: "divider",
163
333
  position: "sticky",
@@ -165,19 +335,55 @@ const Oe = 48, ie = {
165
335
  // Above the sticky row headers (2), which in turn sit above MUI's
166
336
  // z-index-1 form internals in row content.
167
337
  zIndex: 3,
168
- backgroundColor: "background.paper"
338
+ // Distinct from the row header / panel body (both `background.paper`) so
339
+ // the group header visually separates from the rest.
340
+ backgroundColor: "background.default"
341
+ },
342
+ // Accordion click target: everything in the header but the actions box.
343
+ // Non-native button (role='button'), so it carries its own focus ring.
344
+ titleArea: {
345
+ flex: 1,
346
+ minWidth: 0,
347
+ display: "flex",
348
+ alignItems: "center",
349
+ gap: 1,
350
+ cursor: "pointer",
351
+ userSelect: "none",
352
+ "&:focus-visible": {
353
+ outline: "2px solid",
354
+ outlineColor: "primary.main",
355
+ outlineOffset: -2
356
+ }
169
357
  },
170
358
  groupIcon: {
171
359
  display: "flex",
172
360
  color: "text.secondary"
173
361
  },
174
362
  label: {
175
- flex: 1,
176
363
  minWidth: 0,
177
364
  overflow: "hidden",
178
365
  textOverflow: "ellipsis",
179
366
  whiteSpace: "nowrap"
180
367
  },
368
+ // Informative collapse indicator beside the title (the whole title area is
369
+ // the button). Points down when expanded, right when collapsed. Touch
370
+ // devices don't get it — the title row is the affordance there.
371
+ chevron: {
372
+ fontSize: 16,
373
+ color: "text.secondary",
374
+ flexShrink: 0,
375
+ transition: ({
376
+ transitions: t
377
+ }) => t.create("transform", {
378
+ duration: t.duration.shorter
379
+ }),
380
+ "@media (hover: none)": {
381
+ display: "none"
382
+ }
383
+ },
384
+ chevronCollapsed: {
385
+ transform: "rotate(-90deg)"
386
+ },
181
387
  // Icon buttons match the row header's 24×24 (2px padding + 20px icon).
182
388
  actions: {
183
389
  display: "flex",
@@ -189,73 +395,66 @@ const Oe = 48, ie = {
189
395
  }
190
396
  }
191
397
  };
192
- function yt(t) {
193
- const e = R(37), {
398
+ function jt(t) {
399
+ const e = T(27), {
194
400
  groupId: o,
195
- children: n
196
- } = t, i = ee();
197
- let r;
198
- e[0] !== o ? (r = ($) => $.groups[o], e[0] = o, e[1] = r) : r = e[1];
199
- const l = Y(i, r), p = Y(i, xt), {
200
- labels: a
201
- } = K();
202
- if (!l)
401
+ children: r
402
+ } = t, l = N();
403
+ let i;
404
+ e[0] !== o ? (i = (x) => x.groups[o], e[0] = o, e[1] = i) : i = e[1];
405
+ const n = Z(l, i), a = Z(l, Kt);
406
+ let s;
407
+ e[2] !== o ? (s = (x) => ke(x, o) === "hidden", e[2] = o, e[3] = s) : s = e[3];
408
+ const c = U(l, s), p = et();
409
+ let f;
410
+ e[4] !== o ? (f = (x) => re(x, o).map(Zt), e[4] = o, e[5] = f) : f = e[5];
411
+ const u = Z(l, f);
412
+ if (!n)
203
413
  return null;
204
- let d;
205
- e[2] !== n ? (d = Me(n), e[2] = n, e[3] = d) : d = e[3];
206
- const {
207
- actions: f,
208
- body: m
209
- } = d;
210
- let c;
211
- e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ s(P, { sx: ie.groupIcon, children: /* @__PURE__ */ s(it, { fontSize: "small" }) }), e[4] = c) : c = e[4];
212
- let g, u;
213
- e[5] !== l.label ? (g = [l.label], u = ($) => {
214
- const {
215
- ref: M
216
- } = $;
217
- return /* @__PURE__ */ s(V, { ref: M, variant: "button", color: "text.primary", sx: ie.label, children: l.label });
218
- }, e[5] = l.label, e[6] = g, e[7] = u) : (g = e[6], u = e[7]);
219
- let h;
220
- e[8] !== l.label || e[9] !== g || e[10] !== u ? (h = /* @__PURE__ */ s($e, { title: l.label, dependencies: g, children: u }), e[8] = l.label, e[9] = g, e[10] = u, e[11] = h) : h = e[11];
221
414
  let y;
222
- e[12] !== l.collapsed || e[13] !== o || e[14] !== p ? (y = () => p(o, !l.collapsed), e[12] = l.collapsed, e[13] = o, e[14] = p, e[15] = y) : y = e[15];
223
- const x = l.collapsed ? a.expandGroup : a.collapseGroup;
224
- let b;
225
- e[16] !== l.collapsed ? (b = l.collapsed ? /* @__PURE__ */ s(Se, { fontSize: "small" }) : /* @__PURE__ */ s(Ie, { fontSize: "small" }), e[16] = l.collapsed, e[17] = b) : b = e[17];
415
+ e[6] !== r ? (y = Ye(r), e[6] = r, e[7] = y) : y = e[7];
416
+ const {
417
+ actions: h,
418
+ body: g
419
+ } = y;
226
420
  let v;
227
- e[18] !== y || e[19] !== x || e[20] !== b ? (v = /* @__PURE__ */ s(de, { size: "small", onClick: y, "aria-label": x, children: b }), e[18] = y, e[19] = x, e[20] = b, e[21] = v) : v = e[21];
228
- let L;
229
- e[22] !== f || e[23] !== v ? (L = /* @__PURE__ */ E(P, { sx: ie.actions, children: [
230
- f,
231
- v
232
- ] }), e[22] = f, e[23] = v, e[24] = L) : L = e[24];
233
- let w;
234
- e[25] !== L || e[26] !== h ? (w = /* @__PURE__ */ E(P, { sx: ie.header, children: [
235
- c,
236
- h,
237
- L
238
- ] }), e[25] = L, e[26] = h, e[27] = w) : w = e[27];
239
- const k = !l.collapsed;
421
+ e[8] !== n.collapsed || e[9] !== o || e[10] !== a ? (v = () => a(o, !n.collapsed), e[8] = n.collapsed, e[9] = o, e[10] = a, e[11] = v) : v = e[11];
422
+ const b = v;
240
423
  let C;
241
- e[28] !== m || e[29] !== k ? (C = /* @__PURE__ */ s(ve, { in: k, children: m }), e[28] = m, e[29] = k, e[30] = C) : C = e[30];
242
- let S;
243
- e[31] !== w || e[32] !== C ? (S = /* @__PURE__ */ E(P, { sx: ie.group, children: [
244
- w,
245
- C
246
- ] }), e[31] = w, e[32] = C, e[33] = S) : S = e[33];
247
- let z;
248
- return e[34] !== o || e[35] !== S ? (z = /* @__PURE__ */ s(_e.Provider, { value: o, children: S }), e[34] = o, e[35] = S, e[36] = z) : z = e[36], z;
424
+ e[12] !== h || e[13] !== g || e[14] !== n.collapsed || e[15] !== n.icon || e[16] !== n.label || e[17] !== o || e[18] !== c || e[19] !== u || e[20] !== p || e[21] !== b ? (C = (x) => /* @__PURE__ */ d(Ke.Provider, { value: o, children: /* @__PURE__ */ z(P, { ref: x?.rootRef, style: x?.rootStyle, sx: [Y.group, x?.dragging === !0 && Y.groupDragging], children: [
425
+ /* @__PURE__ */ z(P, { sx: Y.header, children: [
426
+ x?.handle,
427
+ /* @__PURE__ */ z(P, { sx: Y.titleArea, role: "button", tabIndex: 0, "aria-expanded": !n.collapsed, onClick: b, onKeyDown: je(b), children: [
428
+ n.icon != null && /* @__PURE__ */ d(P, { sx: Y.groupIcon, children: n.icon }),
429
+ /* @__PURE__ */ d(Fe, { title: n.label, dependencies: [n.label], children: (I) => {
430
+ const {
431
+ ref: S
432
+ } = I;
433
+ return /* @__PURE__ */ d(E, { ref: S, variant: "button", fontWeight: "bold", color: c ? "text.disabled" : "text.primary", sx: Y.label, children: n.label });
434
+ } }),
435
+ /* @__PURE__ */ d(Ve, { sx: [Y.chevron, n.collapsed && Y.chevronCollapsed] })
436
+ ] }),
437
+ /* @__PURE__ */ d(P, { sx: Y.actions, children: h })
438
+ ] }),
439
+ /* @__PURE__ */ d(He, { in: !n.collapsed, children: p ? /* @__PURE__ */ d(We, { items: u, strategy: Ne, children: g }) : g })
440
+ ] }) }), e[12] = h, e[13] = g, e[14] = n.collapsed, e[15] = n.icon, e[16] = n.label, e[17] = o, e[18] = c, e[19] = u, e[20] = p, e[21] = b, e[22] = C) : C = e[22];
441
+ const L = C;
442
+ let w;
443
+ return e[23] !== o || e[24] !== L || e[25] !== p ? (w = p ? /* @__PURE__ */ d(tt, { kind: "group", id: o, render: L }) : L(), e[23] = o, e[24] = L, e[25] = p, e[26] = w) : w = e[26], w;
249
444
  }
250
- function xt(t) {
445
+ function Zt(t) {
446
+ return Se("layer", t.id);
447
+ }
448
+ function Kt(t) {
251
449
  return t.setGroupCollapsed;
252
450
  }
253
- const Z = {
451
+ const j = {
254
452
  // Padding lives on header/content/footer (not the root) so the sticky
255
453
  // header is opaque and full-bleed while pinned.
256
454
  row: {
257
455
  display: "flex",
258
456
  flexDirection: "column",
457
+ position: "relative",
259
458
  "& + &": {
260
459
  borderTop: "1px solid",
261
460
  borderColor: "divider"
@@ -288,8 +487,30 @@ const Z = {
288
487
  // (the renderers keep their own list-scoped rule for standalone usage).
289
488
  "&:hover .PsLegend-value, &:focus-within .PsLegend-value": {
290
489
  opacity: 1
490
+ },
491
+ // Drag handle (Legend.Sortable): absolutely positioned (no reserved flex
492
+ // slot, so it never shifts the title/icon); the button inside fades in
493
+ // on hover/focus and is always visible on touch devices.
494
+ "& .PsLegend-dragHandle-layer > *": {
495
+ opacity: 0,
496
+ transition: ({
497
+ transitions: t
498
+ }) => t.create("opacity", {
499
+ duration: t.duration.standard,
500
+ easing: t.easing.easeInOut
501
+ }),
502
+ "@media (hover: none)": {
503
+ opacity: 1
504
+ }
505
+ },
506
+ "&:hover .PsLegend-dragHandle-layer > *, &:focus-within .PsLegend-dragHandle-layer > *": {
507
+ opacity: 1
291
508
  }
292
509
  },
510
+ // The original stays in place, dimmed, while its overlay clone is dragged.
511
+ rowDragging: {
512
+ opacity: 0.4
513
+ },
293
514
  // Figma `_Legend header`: 16px top/left inset (title glyphs start at
294
515
  // y≈17, x=16 in the 68px-tall header), actions share the title's vertical
295
516
  // band (subtitle flows below them) — hence `flex-start` with the title
@@ -316,21 +537,51 @@ const Z = {
316
537
  display: "flex",
317
538
  flexDirection: "column"
318
539
  },
540
+ // Accordion click target (whole title block + spare space). Non-native
541
+ // button, so it carries its own focus ring.
542
+ titleBoxInteractive: {
543
+ cursor: "pointer",
544
+ userSelect: "none",
545
+ "&:focus-visible": {
546
+ outline: "2px solid",
547
+ outlineColor: "primary.main",
548
+ outlineOffset: -2
549
+ }
550
+ },
319
551
  // The title line and the actions box share the same 24px band, centered,
320
552
  // so the title and the action icons stay aligned under the header's
321
553
  // `flex-start` — no padding magic. The subtitle flows below.
322
554
  titleLine: {
323
555
  minHeight: 24,
324
556
  display: "flex",
325
- alignItems: "center"
557
+ alignItems: "center",
558
+ gap: 0.5
326
559
  },
327
560
  title: {
328
- flex: 1,
329
561
  minWidth: 0,
330
562
  overflow: "hidden",
331
563
  textOverflow: "ellipsis",
332
564
  whiteSpace: "nowrap"
333
565
  },
566
+ // Informative collapse indicator beside the title (the title area is the
567
+ // button). Points down when expanded, right when collapsed; not shown on
568
+ // touch devices — there the title row itself is the affordance.
569
+ chevron: {
570
+ fontSize: 16,
571
+ color: "text.secondary",
572
+ flexShrink: 0,
573
+ transition: ({
574
+ transitions: t
575
+ }) => t.create("transform", {
576
+ duration: t.duration.shorter
577
+ }),
578
+ "@media (hover: none)": {
579
+ display: "none"
580
+ }
581
+ },
582
+ chevronCollapsed: {
583
+ transform: "rotate(-90deg)"
584
+ },
334
585
  // Same 24px band as the title line, so both sides of the header stay
335
586
  // aligned even when the composed actions are shorter (or fade out).
336
587
  // Icon buttons (actions + collapse chevron) are squeezed to 24×24:
@@ -366,353 +617,779 @@ const Z = {
366
617
  opacity: 0.5
367
618
  }
368
619
  };
369
- function bt(t) {
370
- const e = R(57), {
620
+ function Xt(t) {
621
+ const e = T(30), {
371
622
  layerId: o,
372
- children: n
373
- } = t, i = ee();
374
- let r;
375
- e[0] !== o ? (r = (j) => j.layers[o], e[0] = o, e[1] = r) : r = e[1];
376
- const l = Y(i, r), p = Y(i, vt), {
377
- labels: a
378
- } = K(), [d, f] = oe(null), [m, c] = oe(!1);
379
- let g;
380
- e[2] !== d || e[3] !== o || e[4] !== m ? (g = {
623
+ children: r
624
+ } = t, l = N();
625
+ let i;
626
+ e[0] !== o ? (i = (m) => m.layers[o], e[0] = o, e[1] = i) : i = e[1];
627
+ const n = Z(l, i), a = Z(l, qt);
628
+ let s;
629
+ e[2] !== o ? (s = (m) => Lt(m, o), e[2] = o, e[3] = s) : s = e[3];
630
+ const c = U(l, s), p = ue() !== null, f = et(), [u, y] = J(!1), h = n?.visible ?? !0, g = u && h;
631
+ let v;
632
+ e[4] !== o || e[5] !== g ? (v = {
381
633
  layerId: o,
382
- headerEl: d,
383
- opacityOpen: m,
384
- setOpacityOpen: c
385
- }, e[2] = d, e[3] = o, e[4] = m, e[5] = g) : g = e[5];
386
- const u = g;
387
- if (!l)
634
+ opacityOpen: g,
635
+ setOpacityOpen: y
636
+ }, e[4] = o, e[5] = g, e[6] = v) : v = e[6];
637
+ const b = v;
638
+ if (!n)
388
639
  return null;
389
- let h;
390
- e[6] !== n ? (h = Me(n), e[6] = n, e[7] = h) : h = e[7];
391
- const {
392
- actions: y,
393
- body: x
394
- } = h, b = !l.visible || l.collapsed, v = l.groupId ? Oe : 0;
395
- let L;
396
- e[8] !== v ? (L = {
397
- top: v
398
- }, e[8] = v, e[9] = L) : L = e[9];
399
- let w, k;
400
- e[10] !== l.name ? (w = [l.name], k = (j) => {
401
- const {
402
- ref: q
403
- } = j;
404
- return /* @__PURE__ */ s(V, { ref: q, variant: "button", color: "text.primary", sx: Z.title, children: l.name });
405
- }, e[10] = l.name, e[11] = w, e[12] = k) : (w = e[11], k = e[12]);
406
640
  let C;
407
- e[13] !== l.name || e[14] !== w || e[15] !== k ? (C = /* @__PURE__ */ s(P, { sx: Z.titleLine, children: /* @__PURE__ */ s($e, { title: l.name, dependencies: w, children: k }) }), e[13] = l.name, e[14] = w, e[15] = k, e[16] = C) : C = e[16];
408
- let S;
409
- e[17] !== l.subtitle ? (S = l.subtitle && /* @__PURE__ */ s(V, { variant: "caption", color: "text.secondary", children: l.subtitle }), e[17] = l.subtitle, e[18] = S) : S = e[18];
410
- let z;
411
- e[19] !== C || e[20] !== S ? (z = /* @__PURE__ */ E(P, { sx: Z.titleBox, children: [
412
- C,
413
- S
414
- ] }), e[19] = C, e[20] = S, e[21] = z) : z = e[21];
415
- let $;
416
- e[22] !== l.collapsed || e[23] !== o || e[24] !== p ? ($ = () => p(o, !l.collapsed), e[22] = l.collapsed, e[23] = o, e[24] = p, e[25] = $) : $ = e[25];
417
- const M = !l.visible, I = b ? a.expandLayer : a.collapseLayer;
418
- let _;
419
- e[26] !== b ? (_ = b ? /* @__PURE__ */ s(Se, { fontSize: "small" }) : /* @__PURE__ */ s(Ie, { fontSize: "small" }), e[26] = b, e[27] = _) : _ = e[27];
641
+ e[7] !== r ? (C = Ye(r), e[7] = r, e[8] = C) : C = e[8];
642
+ const {
643
+ actions: L,
644
+ body: w
645
+ } = C, x = !n.visible || n.collapsed, I = p ? ot : 0, S = n.visible && c;
420
646
  let O;
421
- e[28] !== $ || e[29] !== M || e[30] !== I || e[31] !== _ ? (O = /* @__PURE__ */ s(de, { size: "small", onClick: $, disabled: M, "aria-label": I, children: _ }), e[28] = $, e[29] = M, e[30] = I, e[31] = _, e[32] = O) : O = e[32];
422
- let T;
423
- e[33] !== y || e[34] !== O ? (T = /* @__PURE__ */ E(P, { sx: Z.actions, children: [
424
- y,
425
- O
426
- ] }), e[33] = y, e[34] = O, e[35] = T) : T = e[35];
427
- let D;
428
- e[36] !== T || e[37] !== L || e[38] !== z ? (D = /* @__PURE__ */ E(P, { ref: f, sx: Z.header, style: L, children: [
429
- z,
430
- T
431
- ] }), e[36] = T, e[37] = L, e[38] = z, e[39] = D) : D = e[39];
432
- const N = !b;
433
- let A;
434
- e[40] !== l.visible ? (A = l.visible ? Z.content : {
435
- ...Z.content,
436
- ...Z.dimmed
437
- }, e[40] = l.visible, e[41] = A) : A = e[41];
438
- let F;
439
- e[42] !== x || e[43] !== A ? (F = /* @__PURE__ */ s(P, { sx: A, children: x }), e[42] = x, e[43] = A, e[44] = F) : F = e[44];
440
- let B;
441
- e[45] !== l.helperText ? (B = l.helperText && /* @__PURE__ */ s(P, { sx: Z.footer, children: typeof l.helperText == "string" ? /* @__PURE__ */ s(V, { variant: "caption", color: "text.secondary", children: l.helperText }) : l.helperText }), e[45] = l.helperText, e[46] = B) : B = e[46];
442
- let W;
443
- e[47] !== N || e[48] !== F || e[49] !== B ? (W = /* @__PURE__ */ E(ve, { in: N, children: [
444
- F,
445
- B
446
- ] }), e[47] = N, e[48] = F, e[49] = B, e[50] = W) : W = e[50];
447
- let H;
448
- e[51] !== D || e[52] !== W ? (H = /* @__PURE__ */ E(P, { sx: Z.row, children: [
449
- D,
450
- W
451
- ] }), e[51] = D, e[52] = W, e[53] = H) : H = e[53];
647
+ e[9] !== n.collapsed || e[10] !== o || e[11] !== a ? (O = () => a(o, !n.collapsed), e[9] = n.collapsed, e[10] = o, e[11] = a, e[12] = O) : O = e[12];
648
+ const k = O;
649
+ let $;
650
+ e[13] !== L || e[14] !== w || e[15] !== S || e[16] !== x || e[17] !== n.collapsed || e[18] !== n.helperText || e[19] !== n.name || e[20] !== n.subtitle || e[21] !== n.visible || e[22] !== b || e[23] !== I || e[24] !== k ? ($ = (m) => /* @__PURE__ */ d(Ze.Provider, { value: b, children: /* @__PURE__ */ z(P, { ref: m?.rootRef, style: m?.rootStyle, sx: [j.row, m?.dragging === !0 && j.rowDragging], children: [
651
+ /* @__PURE__ */ z(P, { sx: j.header, style: {
652
+ top: I
653
+ }, children: [
654
+ m?.handle,
655
+ /* @__PURE__ */ z(P, { sx: [j.titleBox, S && j.titleBoxInteractive], ...S && {
656
+ role: "button",
657
+ tabIndex: 0,
658
+ "aria-expanded": !n.collapsed,
659
+ onClick: k,
660
+ onKeyDown: je(k)
661
+ }, children: [
662
+ /* @__PURE__ */ z(P, { sx: j.titleLine, children: [
663
+ /* @__PURE__ */ d(Fe, { title: n.name, dependencies: [n.name], children: (M) => {
664
+ const {
665
+ ref: A
666
+ } = M;
667
+ return /* @__PURE__ */ d(E, { ref: A, variant: "button", color: n.visible ? "text.primary" : "text.disabled", sx: j.title, children: n.name });
668
+ } }),
669
+ S && /* @__PURE__ */ d(Ve, { sx: [j.chevron, n.collapsed && j.chevronCollapsed] })
670
+ ] }),
671
+ n.subtitle && !x && /* @__PURE__ */ d(E, { variant: "caption", color: "text.secondary", children: n.subtitle })
672
+ ] }),
673
+ /* @__PURE__ */ d(P, { sx: j.actions, children: L })
674
+ ] }),
675
+ /* @__PURE__ */ z(He, { in: !x, children: [
676
+ /* @__PURE__ */ d(P, { sx: n.visible ? j.content : {
677
+ ...j.content,
678
+ ...j.dimmed
679
+ }, children: w }),
680
+ n.helperText && /* @__PURE__ */ d(P, { sx: j.footer, children: typeof n.helperText == "string" ? /* @__PURE__ */ d(E, { variant: "caption", color: "text.secondary", children: n.helperText }) : n.helperText })
681
+ ] })
682
+ ] }) }), e[13] = L, e[14] = w, e[15] = S, e[16] = x, e[17] = n.collapsed, e[18] = n.helperText, e[19] = n.name, e[20] = n.subtitle, e[21] = n.visible, e[22] = b, e[23] = I, e[24] = k, e[25] = $) : $ = e[25];
683
+ const _ = $;
452
684
  let G;
453
- return e[54] !== u || e[55] !== H ? (G = /* @__PURE__ */ s(ze.Provider, { value: u, children: H }), e[54] = u, e[55] = H, e[56] = G) : G = e[56], G;
685
+ return e[26] !== o || e[27] !== _ || e[28] !== f ? (G = f ? /* @__PURE__ */ d(tt, { kind: "layer", id: o, render: _ }) : _(), e[26] = o, e[27] = _, e[28] = f, e[29] = G) : G = e[29], G;
454
686
  }
455
- function vt(t) {
687
+ function qt(t) {
456
688
  return t.setCollapsed;
457
689
  }
458
- const Lt = Qe(/* @__PURE__ */ E("g", { transform: "translate(12 12) scale(1.33333) translate(-184 -24)", children: [
459
- /* @__PURE__ */ s("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M184.901 29.5794L185.217 29.5415C185.803 29.4604 186.372 29.3216 186.918 29.1319L187 29.1007L187 29.1033L187.208 29.0255L187.536 28.8904C187.722 28.8088 187.906 28.721 188.086 28.6272L188.366 28.4747C188.381 28.4663 188.395 28.4578 188.41 28.4493C188.418 28.4451 188.425 28.4408 188.432 28.4365C188.455 28.4234 188.478 28.4102 188.5 28.3969C188.551 28.3668 188.601 28.3362 188.652 28.3052L188.912 28.1374C189.598 27.6788 190.217 27.1271 190.75 26.5002L190.751 26.4954C190.989 26.2164 191.21 25.9226 191.413 25.6152C191.488 25.5007 191.561 25.3843 191.631 25.2662L191.757 25.0445L191.878 24.8189L192.021 24.5306L192.15 24.2443L192.25 24C190.98 20.7776 187.885 18.4747 184.239 18.3782L184 18.375L183.716 18.3795L183.637 18.3823L183.373 18.3967L183.103 18.4198L182.838 18.4506L182.666 18.4749L182.426 18.5146C182.19 18.557 181.957 18.6087 181.728 18.6684L181.55 18.7175L181.271 18.8039L182.508 20.04L182.801 19.9854C183.194 19.9182 183.592 19.875 184 19.875C186.842 19.875 189.378 21.4725 190.615 24C190.172 24.915 189.55 25.7025 188.807 26.34L188.811 26.3446C188.71 26.4323 188.606 26.5172 188.5 26.5991C188.455 26.6337 188.41 26.6679 188.364 26.7015C188.108 26.8897 187.84 27.0611 187.562 27.2145C187.088 27.4755 186.585 27.6844 186.058 27.836L186.062 27.84L185.778 27.9125C185.707 27.9293 185.635 27.9452 185.563 27.9602C185.297 28.0173 185.025 28.06 184.75 28.0876V28.0866C184.503 28.1118 184.253 28.125 184 28.125C181.158 28.125 178.622 26.5275 177.385 24C177.91 22.9275 178.675 22.0425 179.582 21.3525L180.895 22.665L180.826 22.844C180.697 23.2065 180.625 23.595 180.625 24C180.625 25.86 182.14 27.375 184 27.375C184.258 27.375 184.509 27.3459 184.75 27.2915C185.462 27.129 186.09 26.7397 186.553 26.2048L179.79 19.4389C179.339 19.6833 178.912 19.9656 178.512 20.2817L178.517 20.2875L178.271 20.4884C177.704 20.9671 177.197 21.516 176.766 22.1227C176.404 22.6333 176.095 23.1838 175.845 23.7662L175.75 24C177.048 27.2925 180.25 29.625 184 29.625L184.285 29.6205L184.492 29.6116L184.628 29.6025L184.901 29.5794ZM182.133 23.9025L184.09 25.86L184.045 25.8703L184 25.875C182.965 25.875 182.125 25.035 182.125 24L182.133 23.9025Z" }),
460
- /* @__PURE__ */ s("path", { d: "M187.368 23.9925C187.375 22.1325 185.86 20.625 184 20.625C183.722 20.625 183.46 20.6625 183.198 20.73L184.75 22.2825L184.889 22.3507C185.252 22.5477 185.543 22.8625 185.71 23.2425L187.263 24.795L187.304 24.6011C187.342 24.4045 187.368 24.2006 187.368 23.9925Z" })
461
- ] }), "VisibilityIndeterminate"), Ct = {
462
- visible: st,
463
- hidden: rt,
464
- mixed: Lt
690
+ const Qt = St(/* @__PURE__ */ z("g", { transform: "translate(12 12) scale(1.33333) translate(-184 -24)", children: [
691
+ /* @__PURE__ */ d("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M184.901 29.5794L185.217 29.5415C185.803 29.4604 186.372 29.3216 186.918 29.1319L187 29.1007L187 29.1033L187.208 29.0255L187.536 28.8904C187.722 28.8088 187.906 28.721 188.086 28.6272L188.366 28.4747C188.381 28.4663 188.395 28.4578 188.41 28.4493C188.418 28.4451 188.425 28.4408 188.432 28.4365C188.455 28.4234 188.478 28.4102 188.5 28.3969C188.551 28.3668 188.601 28.3362 188.652 28.3052L188.912 28.1374C189.598 27.6788 190.217 27.1271 190.75 26.5002L190.751 26.4954C190.989 26.2164 191.21 25.9226 191.413 25.6152C191.488 25.5007 191.561 25.3843 191.631 25.2662L191.757 25.0445L191.878 24.8189L192.021 24.5306L192.15 24.2443L192.25 24C190.98 20.7776 187.885 18.4747 184.239 18.3782L184 18.375L183.716 18.3795L183.637 18.3823L183.373 18.3967L183.103 18.4198L182.838 18.4506L182.666 18.4749L182.426 18.5146C182.19 18.557 181.957 18.6087 181.728 18.6684L181.55 18.7175L181.271 18.8039L182.508 20.04L182.801 19.9854C183.194 19.9182 183.592 19.875 184 19.875C186.842 19.875 189.378 21.4725 190.615 24C190.172 24.915 189.55 25.7025 188.807 26.34L188.811 26.3446C188.71 26.4323 188.606 26.5172 188.5 26.5991C188.455 26.6337 188.41 26.6679 188.364 26.7015C188.108 26.8897 187.84 27.0611 187.562 27.2145C187.088 27.4755 186.585 27.6844 186.058 27.836L186.062 27.84L185.778 27.9125C185.707 27.9293 185.635 27.9452 185.563 27.9602C185.297 28.0173 185.025 28.06 184.75 28.0876V28.0866C184.503 28.1118 184.253 28.125 184 28.125C181.158 28.125 178.622 26.5275 177.385 24C177.91 22.9275 178.675 22.0425 179.582 21.3525L180.895 22.665L180.826 22.844C180.697 23.2065 180.625 23.595 180.625 24C180.625 25.86 182.14 27.375 184 27.375C184.258 27.375 184.509 27.3459 184.75 27.2915C185.462 27.129 186.09 26.7397 186.553 26.2048L179.79 19.4389C179.339 19.6833 178.912 19.9656 178.512 20.2817L178.517 20.2875L178.271 20.4884C177.704 20.9671 177.197 21.516 176.766 22.1227C176.404 22.6333 176.095 23.1838 175.845 23.7662L175.75 24C177.048 27.2925 180.25 29.625 184 29.625L184.285 29.6205L184.492 29.6116L184.628 29.6025L184.901 29.5794ZM182.133 23.9025L184.09 25.86L184.045 25.8703L184 25.875C182.965 25.875 182.125 25.035 182.125 24L182.133 23.9025Z" }),
692
+ /* @__PURE__ */ d("path", { d: "M187.368 23.9925C187.375 22.1325 185.86 20.625 184 20.625C183.722 20.625 183.46 20.6625 183.198 20.73L184.75 22.2825L184.889 22.3507C185.252 22.5477 185.543 22.8625 185.71 23.2425L187.263 24.795L187.304 24.6011C187.342 24.4045 187.368 24.2006 187.368 23.9925Z" })
693
+ ] }), "VisibilityIndeterminate"), Yt = {
694
+ visible: Be,
695
+ hidden: _t,
696
+ mixed: Qt
465
697
  };
466
- function wt(t) {
467
- const e = R(33), {
698
+ function Jt(t) {
699
+ const e = T(36), {
468
700
  visibility: o,
469
- onToggle: n,
470
- labels: i
471
- } = t, r = ee(), l = te(), p = ht(), {
472
- labels: a
473
- } = K(), d = o !== void 0 && n !== void 0;
474
- let f;
475
- e[0] !== d || e[1] !== l ? (f = (I) => !d && l ? I.layers[l.layerId]?.visible ?? !0 : !0, e[0] = d, e[1] = l, e[2] = f) : f = e[2];
476
- const m = X(r, f);
477
- let c;
478
- e[3] !== d || e[4] !== p || e[5] !== l ? (c = (I) => !d && !l && p ? Je(I, p) : "visible", e[3] = d, e[4] = p, e[5] = l, e[6] = c) : c = e[6];
479
- const g = Y(r, c), u = X(r, It), h = X(r, St);
480
- let y, x;
481
- e[7] !== d || e[8] !== p || e[9] !== l ? (y = () => {
482
- !d && !l && !p && console.warn("Legend.VisibilityToggle needs `visibility`/`onToggle` props or a Legend.Row / Legend.Group context.");
483
- }, x = [d, l, p], e[7] = d, e[8] = p, e[9] = l, e[10] = y, e[11] = x) : (y = e[10], x = e[11]), We(y, x);
484
- let b, v, L = i;
485
- if (d) {
486
- b = o;
487
- let I;
488
- e[12] !== n || e[13] !== o ? (I = () => n(o === "hidden"), e[12] = n, e[13] = o, e[14] = I) : I = e[14], v = I;
489
- } else if (l) {
490
- b = m ? "visible" : "hidden";
491
- let I;
492
- e[15] !== m || e[16] !== l || e[17] !== u ? (I = () => u(l.layerId, !m), e[15] = m, e[16] = l, e[17] = u, e[18] = I) : I = e[18], v = I;
493
- } else if (p) {
494
- b = g;
495
- let I;
496
- e[19] !== p || e[20] !== g || e[21] !== h ? (I = () => h(p, g === "hidden"), e[19] = p, e[20] = g, e[21] = h, e[22] = I) : I = e[22], v = I;
497
- let _;
498
- e[23] !== a || e[24] !== i ? (_ = i ?? {
499
- hideLayer: a.hideGroup,
500
- showLayer: a.showGroup
501
- }, e[23] = a, e[24] = i, e[25] = _) : _ = e[25], L = _;
701
+ onToggle: r,
702
+ labels: l
703
+ } = t, i = N(), n = Q(), a = ue(), {
704
+ labels: s
705
+ } = B(), c = o !== void 0 && r !== void 0;
706
+ let p;
707
+ e[0] !== c || e[1] !== n ? (p = (m) => !c && n ? m.layers[n.layerId]?.visible ?? !0 : !0, e[0] = c, e[1] = n, e[2] = p) : p = e[2];
708
+ const f = U(i, p);
709
+ let u;
710
+ e[3] !== c || e[4] !== a || e[5] !== n ? (u = (m) => !c && !n && a ? ke(m, a) : "visible", e[3] = c, e[4] = a, e[5] = n, e[6] = u) : u = e[6];
711
+ const y = Z(i, u), h = U(i, to), g = U(i, eo);
712
+ let v, b;
713
+ e[7] !== c || e[8] !== a || e[9] !== n ? (v = () => {
714
+ !c && !n && !a && console.warn("Legend.VisibilityToggle needs `visibility`/`onToggle` props or a Legend.Row / Legend.Group context.");
715
+ }, b = [c, n, a], e[7] = c, e[8] = a, e[9] = n, e[10] = v, e[11] = b) : (v = e[10], b = e[11]), ft(v, b);
716
+ let C, L, w = l;
717
+ if (c) {
718
+ C = o;
719
+ let m;
720
+ e[12] !== r || e[13] !== o ? (m = () => r(o === "hidden"), e[12] = r, e[13] = o, e[14] = m) : m = e[14], L = m;
721
+ } else if (n) {
722
+ C = f ? "visible" : "hidden";
723
+ let m;
724
+ e[15] !== f || e[16] !== n || e[17] !== h ? (m = () => h(n.layerId, !f), e[15] = f, e[16] = n, e[17] = h, e[18] = m) : m = e[18], L = m;
725
+ } else if (a) {
726
+ C = y;
727
+ let m;
728
+ e[19] !== a || e[20] !== y || e[21] !== g ? (m = () => g(a, y === "hidden"), e[19] = a, e[20] = y, e[21] = g, e[22] = m) : m = e[22], L = m;
729
+ let M;
730
+ e[23] !== s || e[24] !== l ? (M = l ?? {
731
+ hideLayer: s.hideGroup,
732
+ showLayer: s.showGroup
733
+ }, e[23] = s, e[24] = l, e[25] = M) : M = e[25], w = M;
502
734
  } else
503
735
  return null;
504
736
  const {
505
- hideLayer: w,
506
- showLayer: k
507
- } = L ?? a, C = Ct[b], S = b === "visible" ? void 0 : "active", z = b === "hidden" ? k : w;
737
+ hideLayer: x,
738
+ showLayer: I
739
+ } = w ?? s, S = Yt[C], O = C === "hidden" ? I : x, k = C === "visible" ? void 0 : "active";
508
740
  let $;
509
- e[26] !== C ? ($ = /* @__PURE__ */ s(C, { fontSize: "small" }), e[26] = C, e[27] = $) : $ = e[27];
510
- let M;
511
- return e[28] !== v || e[29] !== S || e[30] !== z || e[31] !== $ ? (M = /* @__PURE__ */ s(de, { size: "small", className: S, onClick: v, "aria-label": z, children: $ }), e[28] = v, e[29] = S, e[30] = z, e[31] = $, e[32] = M) : M = e[32], M;
741
+ e[26] !== S ? ($ = /* @__PURE__ */ d(S, { fontSize: "small" }), e[26] = S, e[27] = $) : $ = e[27];
742
+ let _;
743
+ e[28] !== L || e[29] !== O || e[30] !== k || e[31] !== $ ? (_ = /* @__PURE__ */ d(ve, { size: "small", className: k, onClick: L, "aria-label": O, children: $ }), e[28] = L, e[29] = O, e[30] = k, e[31] = $, e[32] = _) : _ = e[32];
744
+ let G;
745
+ return e[33] !== O || e[34] !== _ ? (G = /* @__PURE__ */ d(ie, { title: O, children: _ }), e[33] = O, e[34] = _, e[35] = G) : G = e[35], G;
512
746
  }
513
- function St(t) {
747
+ function eo(t) {
514
748
  return t.setGroupVisibility;
515
749
  }
516
- function It(t) {
750
+ function to(t) {
517
751
  return t.setVisibility;
518
752
  }
519
- function $t(t) {
520
- const e = R(17), {
521
- children: o
522
- } = t, n = ee(), [i, r] = oe(null), l = !!i, p = te();
523
- let a;
524
- e[0] !== p ? (a = (w) => p ? w.layers[p.layerId]?.visible ?? !0 : !0, e[0] = p, e[1] = a) : a = e[1];
525
- const d = X(n, a), {
526
- labels: f
527
- } = K();
528
- if (!p || !o || !d)
529
- return null;
530
- let m;
531
- e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = (w) => {
532
- w.stopPropagation(), r(w.currentTarget);
533
- }, e[2] = m) : m = e[2];
534
- const c = m;
753
+ function Oe(t) {
754
+ const e = T(23), {
755
+ children: o,
756
+ gate: r,
757
+ ariaLabel: l,
758
+ active: i
759
+ } = t, n = r === void 0 ? !0 : r, a = i === void 0 ? !1 : i, [s, c] = J(null), [p, f] = J(!1), u = Te(!1), y = !!s, {
760
+ labels: h
761
+ } = B();
535
762
  let g;
536
- e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = () => r(null), e[3] = g) : g = e[3];
537
- const u = g, h = l ? "active" : void 0, y = !d;
538
- let x;
539
- e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ s(at, { fontSize: "small" }), e[4] = x) : x = e[4];
763
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = () => c(null), e[0] = g) : g = e[0];
764
+ const v = g;
540
765
  let b;
541
- e[5] !== f.layerOptions || e[6] !== l || e[7] !== h || e[8] !== y ? (b = /* @__PURE__ */ s(de, { size: "small", className: h, disabled: y, onClick: c, "aria-label": f.layerOptions, "aria-haspopup": "menu", "aria-expanded": l, children: x }), e[5] = f.layerOptions, e[6] = l, e[7] = h, e[8] = y, e[9] = b) : b = e[9];
542
- let v;
543
- e[10] !== i || e[11] !== o || e[12] !== l ? (v = /* @__PURE__ */ s(Le, { anchorEl: i, open: l, onClose: u, onClick: u, children: o }), e[10] = i, e[11] = o, e[12] = l, e[13] = v) : v = e[13];
766
+ e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = (V) => {
767
+ u.current = V, f(V);
768
+ }, e[1] = b) : b = e[1];
769
+ const C = b;
544
770
  let L;
545
- return e[14] !== b || e[15] !== v ? (L = /* @__PURE__ */ E(se, { children: [
546
- b,
547
- v
548
- ] }), e[14] = b, e[15] = v, e[16] = L) : L = e[16], L;
771
+ e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (L = () => u.current, e[2] = L) : L = e[2];
772
+ const w = L;
773
+ let x;
774
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = () => {
775
+ u.current || v();
776
+ }, e[3] = x) : x = e[3];
777
+ const I = x;
778
+ let S;
779
+ e[4] !== p ? (S = {
780
+ busy: p,
781
+ isBusy: w,
782
+ setBusy: C,
783
+ close: v
784
+ }, e[4] = p, e[5] = S) : S = e[5];
785
+ const O = S;
786
+ if (!n || !o)
787
+ return null;
788
+ let k;
789
+ e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (k = (V) => {
790
+ V.stopPropagation(), c(V.currentTarget);
791
+ }, e[6] = k) : k = e[6];
792
+ const $ = k, _ = y || p || a ? "active" : void 0;
793
+ let G;
794
+ e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (G = /* @__PURE__ */ d(Gt, { fontSize: "small" }), e[7] = G) : G = e[7];
795
+ let m;
796
+ e[8] !== l || e[9] !== y || e[10] !== _ ? (m = /* @__PURE__ */ d(ve, { size: "small", className: _, onClick: $, "aria-label": l, "aria-haspopup": "menu", "aria-expanded": y, children: G }), e[8] = l, e[9] = y, e[10] = _, e[11] = m) : m = e[11];
797
+ let M;
798
+ e[12] !== h.moreOptions || e[13] !== m ? (M = /* @__PURE__ */ d(ie, { title: h.moreOptions, children: m }), e[12] = h.moreOptions, e[13] = m, e[14] = M) : M = e[14];
799
+ let A;
800
+ e[15] !== s || e[16] !== o || e[17] !== y ? (A = /* @__PURE__ */ d($e, { anchorEl: s, open: y, onClose: I, onClick: I, children: o }), e[15] = s, e[16] = o, e[17] = y, e[18] = A) : A = e[18];
801
+ let D;
802
+ return e[19] !== O || e[20] !== M || e[21] !== A ? (D = /* @__PURE__ */ z(Xe.Provider, { value: O, children: [
803
+ M,
804
+ A
805
+ ] }), e[19] = O, e[20] = M, e[21] = A, e[22] = D) : D = e[22], D;
806
+ }
807
+ function oo(t) {
808
+ const e = T(5), {
809
+ children: o
810
+ } = t, r = Q(), {
811
+ labels: l
812
+ } = B(), i = !!r, n = r?.opacityOpen ?? !1;
813
+ let a;
814
+ return e[0] !== o || e[1] !== l.layerOptions || e[2] !== i || e[3] !== n ? (a = /* @__PURE__ */ d(Oe, { gate: i, ariaLabel: l.layerOptions, active: n, children: o }), e[0] = o, e[1] = l.layerOptions, e[2] = i, e[3] = n, e[4] = a) : a = e[4], a;
549
815
  }
550
- function kt(t) {
551
- const e = R(7), {
816
+ async function nt(t, e) {
817
+ if (!t.isBusy()) {
818
+ t.setBusy(!0);
819
+ try {
820
+ await e();
821
+ } finally {
822
+ t.setBusy(!1), t.close();
823
+ }
824
+ }
825
+ }
826
+ function no(t) {
827
+ const e = T(13), {
552
828
  onZoomTo: o
553
- } = t, n = te(), {
554
- labels: i
555
- } = K();
556
- if (!n)
829
+ } = t, r = N(), l = Q(), i = qe();
830
+ let n;
831
+ e[0] !== l ? (n = (g) => l ? g.layers[l.layerId]?.visible ?? !1 : !1, e[0] = l, e[1] = n) : n = e[1];
832
+ const a = U(r, n), {
833
+ labels: s
834
+ } = B();
835
+ if (!l || !a)
836
+ return null;
837
+ const c = i?.busy ?? !1;
838
+ let p;
839
+ e[2] !== i || e[3] !== o || e[4] !== l ? (p = (g) => {
840
+ g.stopPropagation(), i && nt(i, () => o(l.layerId));
841
+ }, e[2] = i, e[3] = o, e[4] = l, e[5] = p) : p = e[5];
842
+ const f = p;
843
+ let u;
844
+ e[6] !== c ? (u = c && /* @__PURE__ */ d(Re, { size: 16, sx: {
845
+ mr: 1
846
+ } }), e[6] = c, e[7] = u) : u = e[7];
847
+ const y = c ? s.loading : s.zoomTo;
848
+ let h;
849
+ return e[8] !== c || e[9] !== f || e[10] !== u || e[11] !== y ? (h = /* @__PURE__ */ z(q, { disabled: c, onClick: f, children: [
850
+ u,
851
+ y
852
+ ] }), e[8] = c, e[9] = f, e[10] = u, e[11] = y, e[12] = h) : h = e[12], h;
853
+ }
854
+ function lo() {
855
+ const t = T(6), e = N(), o = Q(), {
856
+ labels: r
857
+ } = B();
858
+ if (!o)
859
+ return null;
860
+ let l;
861
+ t[0] !== e || t[1] !== o.layerId ? (l = () => {
862
+ const a = X(e).getState(), s = a.layers[o.layerId];
863
+ if (s)
864
+ for (const c of re(a, s.groupId))
865
+ a.setVisibility(c.id, c.id === o.layerId);
866
+ }, t[0] = e, t[1] = o.layerId, t[2] = l) : l = t[2];
867
+ const i = l;
868
+ let n;
869
+ return t[3] !== r.showOnlyLayer || t[4] !== i ? (n = /* @__PURE__ */ d(q, { onClick: i, children: r.showOnlyLayer }), t[3] = r.showOnlyLayer, t[4] = i, t[5] = n) : n = t[5], n;
870
+ }
871
+ function io() {
872
+ const t = T(6), e = N(), o = ue(), r = Q(), {
873
+ labels: l
874
+ } = B();
875
+ if (o === null && !r)
876
+ return null;
877
+ let i;
878
+ t[0] !== o || t[1] !== e ? (i = () => {
879
+ const s = X(e).getState();
880
+ if (o !== null)
881
+ s.setGroupVisibility(o, !0);
882
+ else
883
+ for (const c of re(s, void 0))
884
+ s.setVisibility(c.id, !0);
885
+ }, t[0] = o, t[1] = e, t[2] = i) : i = t[2];
886
+ const n = i;
887
+ let a;
888
+ return t[3] !== l.showAllLayers || t[4] !== n ? (a = /* @__PURE__ */ d(q, { onClick: n, children: l.showAllLayers }), t[3] = l.showAllLayers, t[4] = n, t[5] = a) : a = t[5], a;
889
+ }
890
+ function ro(t) {
891
+ const e = T(4), {
892
+ children: o
893
+ } = t, r = ue(), {
894
+ labels: l
895
+ } = B(), i = r !== null;
896
+ let n;
897
+ return e[0] !== o || e[1] !== l.groupOptions || e[2] !== i ? (n = /* @__PURE__ */ d(Oe, { gate: i, ariaLabel: l.groupOptions, children: o }), e[0] = o, e[1] = l.groupOptions, e[2] = i, e[3] = n) : n = e[3], n;
898
+ }
899
+ function so() {
900
+ const t = T(6), e = N(), o = ue(), {
901
+ labels: r
902
+ } = B();
903
+ if (o === null)
904
+ return null;
905
+ let l;
906
+ t[0] !== o || t[1] !== e ? (l = () => {
907
+ const a = X(e).getState();
908
+ for (const s of xe(a))
909
+ a.setGroupVisibility(s.id, s.id === o);
910
+ for (const s of re(a, void 0))
911
+ a.setVisibility(s.id, !1);
912
+ }, t[0] = o, t[1] = e, t[2] = l) : l = t[2];
913
+ const i = l;
914
+ let n;
915
+ return t[3] !== r.showOnlyGroup || t[4] !== i ? (n = /* @__PURE__ */ d(q, { onClick: i, children: r.showOnlyGroup }), t[3] = r.showOnlyGroup, t[4] = i, t[5] = n) : n = t[5], n;
916
+ }
917
+ function ao() {
918
+ const t = T(5), e = N(), o = U(e, De), {
919
+ labels: r
920
+ } = B();
921
+ if (!o)
557
922
  return null;
558
- let r;
559
- e[0] !== o || e[1] !== n.layerId ? (r = () => o(n.layerId), e[0] = o, e[1] = n.layerId, e[2] = r) : r = e[2];
560
923
  let l;
561
- e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ s(Ye, { children: /* @__PURE__ */ s(ct, { fontSize: "small" }) }), e[3] = l) : l = e[3];
924
+ t[0] !== e ? (l = () => {
925
+ const a = X(e).getState();
926
+ for (const s of xe(a))
927
+ a.setGroupVisibility(s.id, !0);
928
+ for (const s of re(a, void 0))
929
+ a.setVisibility(s.id, !0);
930
+ }, t[0] = e, t[1] = l) : l = t[1];
931
+ const i = l;
932
+ let n;
933
+ return t[2] !== r.showAllGroups || t[3] !== i ? (n = /* @__PURE__ */ d(q, { onClick: i, children: r.showAllGroups }), t[2] = r.showAllGroups, t[3] = i, t[4] = n) : n = t[4], n;
934
+ }
935
+ function co() {
936
+ const t = T(5), e = N(), o = U(e, De), r = U(e, Me), {
937
+ labels: l
938
+ } = B();
939
+ if (!o)
940
+ return null;
941
+ let i;
942
+ t[0] !== e ? (i = () => {
943
+ const c = X(e).getState(), p = Me(c);
944
+ for (const f of xe(c))
945
+ c.setGroupCollapsed(f.id, !p);
946
+ }, t[0] = e, t[1] = i) : i = t[1];
947
+ const n = i, a = r ? l.expandAllGroups : l.collapseAllGroups;
948
+ let s;
949
+ return t[2] !== a || t[3] !== n ? (s = /* @__PURE__ */ d(q, { onClick: n, children: a }), t[2] = a, t[3] = n, t[4] = s) : s = t[4], s;
950
+ }
951
+ function uo(t) {
952
+ const e = T(13), {
953
+ onZoomTo: o
954
+ } = t, r = N(), l = ue(), i = qe();
955
+ let n;
956
+ e[0] !== l ? (n = (g) => l !== null && ke(g, l) === "hidden", e[0] = l, e[1] = n) : n = e[1];
957
+ const a = U(r, n), {
958
+ labels: s
959
+ } = B();
960
+ if (l === null || a)
961
+ return null;
962
+ const c = i?.busy ?? !1;
562
963
  let p;
563
- return e[4] !== i.zoomTo || e[5] !== r ? (p = /* @__PURE__ */ E(Ce, { onClick: r, children: [
564
- l,
565
- i.zoomTo
566
- ] }), e[4] = i.zoomTo, e[5] = r, e[6] = p) : p = e[6], p;
964
+ e[2] !== l || e[3] !== i || e[4] !== o ? (p = (g) => {
965
+ g.stopPropagation(), i && nt(i, () => o(l));
966
+ }, e[2] = l, e[3] = i, e[4] = o, e[5] = p) : p = e[5];
967
+ const f = p;
968
+ let u;
969
+ e[6] !== c ? (u = c && /* @__PURE__ */ d(Re, { size: 16, sx: {
970
+ mr: 1
971
+ } }), e[6] = c, e[7] = u) : u = e[7];
972
+ const y = c ? s.loading : s.zoomToGroup;
973
+ let h;
974
+ return e[8] !== c || e[9] !== f || e[10] !== u || e[11] !== y ? (h = /* @__PURE__ */ z(q, { disabled: c, onClick: f, children: [
975
+ u,
976
+ y
977
+ ] }), e[8] = c, e[9] = f, e[10] = u, e[11] = y, e[12] = h) : h = e[12], h;
567
978
  }
568
- const fe = {
979
+ function po(t) {
980
+ const e = T(3), {
981
+ children: o
982
+ } = t, {
983
+ labels: r
984
+ } = B();
985
+ let l;
986
+ return e[0] !== o || e[1] !== r.panelOptions ? (l = /* @__PURE__ */ d(Oe, { ariaLabel: r.panelOptions, children: o }), e[0] = o, e[1] = r.panelOptions, e[2] = l) : l = e[2], l;
987
+ }
988
+ const ee = {
569
989
  // Tooltip wrapper around the (possibly disabled) trigger button. A plain
570
- // inline span would be sized by the line box (baseline + descender) and
571
- // end up ~1px taller than the 24px button inside.
990
+ // inline span would be sized by the line box and end up taller than the
991
+ // button inside.
572
992
  triggerWrap: {
573
993
  display: "inline-flex"
574
994
  },
575
- popover: {
995
+ paper: {
996
+ width: 240,
997
+ maxHeight: 320,
998
+ // List padding is disabled (flush sticky header); keep a small bottom
999
+ // inset so the last 32px item doesn't touch the paper edge.
1000
+ paddingBottom: 0.5
1001
+ },
1002
+ stickyHeader: {
1003
+ position: "sticky",
1004
+ top: 0,
1005
+ zIndex: 1,
1006
+ backgroundColor: "background.paper",
1007
+ padding: 1,
1008
+ marginBlockEnd: 1,
1009
+ lineHeight: "16px",
1010
+ borderBottom: "1px solid",
1011
+ borderColor: "divider"
1012
+ },
1013
+ groupCaption: {
1014
+ display: "block",
1015
+ padding: ({
1016
+ spacing: t
1017
+ }) => t(0.5, 1.5)
1018
+ },
1019
+ // The whole item is the hide action (keyboard-friendly); the eye is its
1020
+ // visual affordance.
1021
+ item: {
1022
+ minHeight: 32,
576
1023
  display: "flex",
577
1024
  alignItems: "center",
578
- gap: 1.5,
1025
+ justifyContent: "space-between",
1026
+ gap: 1,
579
1027
  padding: ({
580
1028
  spacing: t
581
- }) => t(1, 1.5),
582
- width: 280
1029
+ }) => t(0, 1, 0, 1.5)
1030
+ },
1031
+ itemName: {
1032
+ minWidth: 0,
1033
+ overflow: "hidden",
1034
+ textOverflow: "ellipsis",
1035
+ whiteSpace: "nowrap"
1036
+ },
1037
+ // Design's 18px glyph — decorative (the item itself is the action).
1038
+ eye: {
1039
+ fontSize: 18,
1040
+ color: "action.active",
1041
+ flexShrink: 0
1042
+ },
1043
+ divider: {
1044
+ marginY: 1
1045
+ }
1046
+ };
1047
+ function fo(t, e) {
1048
+ return Ee(X(t).getState());
1049
+ }
1050
+ function ho() {
1051
+ const t = T(33), e = N(), [o, r] = J(null);
1052
+ U(e, mo);
1053
+ const l = fo(e), i = Z(e, yo), {
1054
+ labels: n
1055
+ } = B(), a = l.reduce(go, 0), s = !!o && a > 0;
1056
+ let c;
1057
+ t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = (G) => r(G.currentTarget), t[0] = c) : c = t[0];
1058
+ const p = c;
1059
+ let f;
1060
+ t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (f = () => r(null), t[1] = f) : f = t[1];
1061
+ const u = f, y = s ? "active" : void 0, h = a === 0;
1062
+ let g;
1063
+ t[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ d(Mt, { fontSize: "small" }), t[2] = g) : g = t[2];
1064
+ let v;
1065
+ t[3] !== n.enabledLayers || t[4] !== s || t[5] !== y || t[6] !== h ? (v = /* @__PURE__ */ d(P, { component: "span", sx: ee.triggerWrap, children: /* @__PURE__ */ d(ve, { size: "small", className: y, disabled: h, onClick: p, "aria-label": n.enabledLayers, "aria-haspopup": "menu", "aria-expanded": s, children: g }) }), t[3] = n.enabledLayers, t[4] = s, t[5] = y, t[6] = h, t[7] = v) : v = t[7];
1066
+ let b;
1067
+ t[8] !== n.toggleEnabledLayers || t[9] !== v ? (b = /* @__PURE__ */ d(ie, { title: n.toggleEnabledLayers, children: v }), t[8] = n.toggleEnabledLayers, t[9] = v, t[10] = b) : b = t[10];
1068
+ const C = $e;
1069
+ let L;
1070
+ t[11] !== u ? (L = {
1071
+ onExited: u
1072
+ }, t[11] = u, t[12] = L) : L = t[12];
1073
+ let w, x;
1074
+ t[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = {
1075
+ disablePadding: !0
1076
+ }, x = {
1077
+ paper: {
1078
+ sx: ee.paper
1079
+ }
1080
+ }, t[13] = w, t[14] = x) : (w = t[13], x = t[14]);
1081
+ const I = `${n.enabledLayers} (${a})`;
1082
+ let S;
1083
+ t[15] !== I ? (S = /* @__PURE__ */ d(E, { component: "div", variant: "caption", color: "text.primary", sx: ee.stickyHeader, children: I }), t[15] = I, t[16] = S) : S = t[16];
1084
+ let O;
1085
+ t[17] !== n.hideLayer || t[18] !== i ? (O = (G, m) => [m > 0 ? /* @__PURE__ */ d(Ct, { sx: ee.divider }, `divider-${G.group?.id ?? "ungrouped"}`) : null, G.group ? /* @__PURE__ */ d(E, { variant: "caption", fontWeight: "medium", color: "text.secondary", sx: ee.groupCaption, children: G.group.label }, `caption-${G.group.id}`) : null, ...G.layers.map((M) => /* @__PURE__ */ z(q, { disableRipple: !0, sx: ee.item, onClick: () => i(M.id, !1), children: [
1086
+ /* @__PURE__ */ d(E, { variant: "body2", sx: ee.itemName, children: M.name }),
1087
+ /* @__PURE__ */ d(ie, { title: n.hideLayer, children: /* @__PURE__ */ d(Be, { sx: ee.eye }) })
1088
+ ] }, M.id))], t[17] = n.hideLayer, t[18] = i, t[19] = O) : O = t[19];
1089
+ const k = l.flatMap(O);
1090
+ let $;
1091
+ t[20] !== C || t[21] !== o || t[22] !== u || t[23] !== s || t[24] !== S || t[25] !== k || t[26] !== L || t[27] !== w || t[28] !== x ? ($ = /* @__PURE__ */ z(C, { anchorEl: o, open: s, onClose: u, TransitionProps: L, MenuListProps: w, slotProps: x, children: [
1092
+ S,
1093
+ k
1094
+ ] }), t[20] = C, t[21] = o, t[22] = u, t[23] = s, t[24] = S, t[25] = k, t[26] = L, t[27] = w, t[28] = x, t[29] = $) : $ = t[29];
1095
+ let _;
1096
+ return t[30] !== $ || t[31] !== b ? (_ = /* @__PURE__ */ z(he, { children: [
1097
+ b,
1098
+ $
1099
+ ] }), t[30] = $, t[31] = b, t[32] = _) : _ = t[32], _;
1100
+ }
1101
+ function go(t, e) {
1102
+ return t + e.layers.length;
1103
+ }
1104
+ function yo(t) {
1105
+ return t.setVisibility;
1106
+ }
1107
+ function mo(t) {
1108
+ return Ee(t).map(bo).join("|");
1109
+ }
1110
+ function bo(t) {
1111
+ const {
1112
+ group: e,
1113
+ layers: o
1114
+ } = t;
1115
+ return `${e?.id ?? ""}${e?.label ?? ""}:${o.map(xo).join(",")}`;
1116
+ }
1117
+ function xo(t) {
1118
+ return `${t.id}${t.name}`;
1119
+ }
1120
+ function vo(t) {
1121
+ const e = T(27), {
1122
+ children: o
1123
+ } = t, r = N(), [l, i] = J(null), n = Te(void 0), a = Z(r, Lo);
1124
+ let s;
1125
+ e[0] !== r ? (s = (k, $) => {
1126
+ const _ = de(k), G = de($);
1127
+ return !_ || G?.kind !== _.kind ? !1 : _.kind === "layer" ? X(r).getState().layers[G.id]?.groupId === n.current : !0;
1128
+ }, e[0] = r, e[1] = s) : s = e[1];
1129
+ const c = s;
1130
+ let p;
1131
+ e[2] !== c ? (p = (k, $) => {
1132
+ const {
1133
+ context: _
1134
+ } = $, {
1135
+ active: G,
1136
+ collisionRect: m,
1137
+ droppableRects: M,
1138
+ droppableContainers: A
1139
+ } = _;
1140
+ if (!G || !m || k.code !== "ArrowDown" && k.code !== "ArrowUp")
1141
+ return;
1142
+ k.preventDefault();
1143
+ const D = k.code === "ArrowDown", W = A.getEnabled().filter((R) => R.id !== G.id && c(String(G.id), String(R.id))).flatMap((R) => {
1144
+ const H = M.get(R.id);
1145
+ return H ? [H] : [];
1146
+ }).filter((R) => D ? R.top > m.top : R.top < m.top).sort((R, H) => D ? R.top - H.top : H.top - R.top)[0];
1147
+ return W ? {
1148
+ x: W.left,
1149
+ y: W.top
1150
+ } : void 0;
1151
+ }, e[2] = c, e[3] = p) : p = e[3];
1152
+ const f = p;
1153
+ let u;
1154
+ e[4] !== f ? (u = {
1155
+ coordinateGetter: f
1156
+ }, e[4] = f, e[5] = u) : u = e[5];
1157
+ const y = Et(Pe(Ht), Pe(Rt, u));
1158
+ let h;
1159
+ e[6] !== c ? (h = (k) => {
1160
+ const $ = k.droppableContainers.filter((_) => c(String(k.active.id), String(_.id)));
1161
+ return Bt({
1162
+ ...k,
1163
+ droppableContainers: $
1164
+ });
1165
+ }, e[6] = c, e[7] = h) : h = e[7];
1166
+ const g = h;
1167
+ let v;
1168
+ e[8] !== r ? (v = (k) => {
1169
+ const $ = String(k.active.id);
1170
+ i($);
1171
+ const _ = de($);
1172
+ n.current = _?.kind === "layer" ? X(r).getState().layers[_.id]?.groupId : void 0;
1173
+ }, e[8] = r, e[9] = v) : v = e[9];
1174
+ const b = v;
1175
+ let C;
1176
+ e[10] !== r ? (C = (k) => {
1177
+ i(null);
1178
+ const {
1179
+ active: $,
1180
+ over: _
1181
+ } = k;
1182
+ if (!_ || $.id === _.id)
1183
+ return;
1184
+ const G = de(String($.id)), m = de(String(_.id));
1185
+ if (!G || G.kind !== m?.kind)
1186
+ return;
1187
+ const M = X(r).getState();
1188
+ if (G.kind === "group") {
1189
+ const R = xe(M).findIndex((H) => H.id === m.id);
1190
+ R !== -1 && M.moveGroup(G.id, R);
1191
+ return;
1192
+ }
1193
+ const A = M.layers[G.id], D = M.layers[m.id];
1194
+ if (!A || !D || A.groupId !== D.groupId)
1195
+ return;
1196
+ const W = re(M, A.groupId).findIndex((R) => R.id === m.id);
1197
+ W !== -1 && M.moveLayer(G.id, W);
1198
+ }, e[10] = r, e[11] = C) : C = e[11];
1199
+ const L = C;
1200
+ let w;
1201
+ e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = () => i(null), e[12] = w) : w = e[12];
1202
+ let x;
1203
+ e[13] !== o || e[14] !== a ? (x = /* @__PURE__ */ d(We, { items: a, strategy: Ne, children: o }), e[13] = o, e[14] = a, e[15] = x) : x = e[15];
1204
+ let I;
1205
+ e[16] !== l ? (I = l && /* @__PURE__ */ d(wo, { activeId: l }), e[16] = l, e[17] = I) : I = e[17];
1206
+ let S;
1207
+ e[18] !== I ? (S = /* @__PURE__ */ d(Wt, { children: I }), e[18] = I, e[19] = S) : S = e[19];
1208
+ let O;
1209
+ return e[20] !== g || e[21] !== L || e[22] !== b || e[23] !== y || e[24] !== S || e[25] !== x ? (O = /* @__PURE__ */ d(Je.Provider, { value: !0, children: /* @__PURE__ */ z(Vt, { sensors: y, collisionDetection: g, onDragStart: b, onDragEnd: L, onDragCancel: w, children: [
1210
+ x,
1211
+ S
1212
+ ] }) }), e[20] = g, e[21] = L, e[22] = b, e[23] = y, e[24] = S, e[25] = x, e[26] = O) : O = e[26], O;
1213
+ }
1214
+ function Lo(t) {
1215
+ return [...xe(t).map(Co), ...re(t, void 0).map(So)];
1216
+ }
1217
+ function So(t) {
1218
+ return Se("layer", t.id);
1219
+ }
1220
+ function Co(t) {
1221
+ return Se("group", t.id);
1222
+ }
1223
+ function wo(t) {
1224
+ const e = T(15), {
1225
+ activeId: o
1226
+ } = t, r = N();
1227
+ let l;
1228
+ e[0] !== o ? (l = de(o), e[0] = o, e[1] = l) : l = e[1];
1229
+ const i = l;
1230
+ let n;
1231
+ e[2] !== i ? (n = (h) => i ? i.kind === "group" ? h.groups[i.id]?.label : h.layers[i.id]?.name : void 0, e[2] = i, e[3] = n) : n = e[3];
1232
+ const a = U(r, n);
1233
+ let s;
1234
+ e[4] !== i ? (s = (h) => i?.kind === "group" ? h.groups[i.id]?.icon : void 0, e[4] = i, e[5] = s) : s = e[5];
1235
+ const c = U(r, s);
1236
+ if (!i || a === void 0)
1237
+ return null;
1238
+ let p;
1239
+ e[6] !== c || e[7] !== i.kind ? (p = i.kind === "group" && c != null && /* @__PURE__ */ d(P, { sx: le.overlayIcon, children: c }), e[6] = c, e[7] = i.kind, e[8] = p) : p = e[8];
1240
+ const f = i.kind === "group" ? "bold" : void 0;
1241
+ let u;
1242
+ e[9] !== a || e[10] !== f ? (u = /* @__PURE__ */ d(E, { variant: "button", fontWeight: f, color: "text.primary", sx: le.overlayLabel, children: a }), e[9] = a, e[10] = f, e[11] = u) : u = e[11];
1243
+ let y;
1244
+ return e[12] !== p || e[13] !== u ? (y = /* @__PURE__ */ z(P, { sx: le.overlay, children: [
1245
+ p,
1246
+ u
1247
+ ] }), e[12] = p, e[13] = u, e[14] = y) : y = e[14], y;
1248
+ }
1249
+ const pe = {
1250
+ // Figma "Legend Opacity": a soft rounded bar between the row header and the
1251
+ // body — caption label + ✕ on the first line, slider + % input below.
1252
+ inline: {
1253
+ display: "flex",
1254
+ flexDirection: "column",
1255
+ gap: 0.5,
1256
+ borderRadius: 1
1257
+ },
1258
+ inlineHeader: {
1259
+ display: "flex",
1260
+ alignItems: "center",
1261
+ justifyContent: "space-between"
1262
+ },
1263
+ inlineControls: {
1264
+ display: "flex",
1265
+ alignItems: "center",
1266
+ gap: 1.5
583
1267
  },
584
1268
  slider: {
585
1269
  flex: 1
586
1270
  },
587
1271
  // Wide enough for "100 %" — the value must never ellipsize.
588
1272
  input: {
589
- width: 76,
1273
+ width: 68,
590
1274
  flexShrink: 0,
591
1275
  "& input": {
592
1276
  textAlign: "right"
593
1277
  }
594
1278
  }
595
- }, xe = (t) => Math.min(100, Math.max(0, Math.round(t)));
596
- function zt() {
597
- const t = R(16), e = ee(), o = te(), n = o?.layerId;
598
- let i;
599
- t[0] !== n ? (i = (y) => n ? y.layers[n]?.opacity ?? 1 : 1, t[0] = n, t[1] = i) : i = t[1];
600
- const r = X(e, i);
601
- let l;
602
- t[2] !== n ? (l = (y) => n ? y.layers[n]?.visible ?? !0 : !0, t[2] = n, t[3] = l) : l = t[3];
603
- const p = X(e, l), {
604
- labels: a
605
- } = K();
606
- if (!o || !p)
1279
+ }, ze = (t) => Math.min(100, Math.max(0, Math.round(t)));
1280
+ function Io() {
1281
+ const t = T(10), e = N(), o = Q();
1282
+ let r;
1283
+ t[0] !== o ? (r = (p) => o ? p.layers[o.layerId] : void 0, t[0] = o, t[1] = r) : r = t[1];
1284
+ const l = Z(e, r), i = Z(e, ko), {
1285
+ labels: n
1286
+ } = B();
1287
+ if (!o || !l?.visible || !l.opacityControl)
607
1288
  return null;
608
- const f = r !== 1 || o.opacityOpen ? "active" : void 0;
609
- let m;
610
- t[4] !== o ? (m = () => o.setOpacityOpen(!0), t[4] = o, t[5] = m) : m = t[5];
1289
+ let a;
1290
+ t[2] !== l || t[3] !== o || t[4] !== i ? (a = () => {
1291
+ const p = !o.opacityOpen;
1292
+ o.setOpacityOpen(p), p && l.collapsed && i(o.layerId, !1);
1293
+ }, t[2] = l, t[3] = o, t[4] = i, t[5] = a) : a = t[5];
1294
+ const s = a;
611
1295
  let c;
612
- t[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ s(ft, { fontSize: "small" }), t[6] = c) : c = t[6];
613
- let g;
614
- t[7] !== a.opacity || t[8] !== m ? (g = /* @__PURE__ */ s(de, { size: "small", onClick: m, "aria-label": a.opacity, children: c }), t[7] = a.opacity, t[8] = m, t[9] = g) : g = t[9];
615
- let u;
616
- t[10] !== f || t[11] !== g ? (u = /* @__PURE__ */ s(P, { component: "span", className: f, sx: fe.triggerWrap, children: g }), t[10] = f, t[11] = g, t[12] = u) : u = t[12];
617
- let h;
618
- return t[13] !== a.opacity || t[14] !== u ? (h = /* @__PURE__ */ s(we, { title: a.opacity, children: u }), t[13] = a.opacity, t[14] = u, t[15] = h) : h = t[15], h;
1296
+ return t[6] !== n.opacity || t[7] !== o.opacityOpen || t[8] !== s ? (c = /* @__PURE__ */ d(q, { selected: o.opacityOpen, onClick: s, children: n.opacity }), t[6] = n.opacity, t[7] = o.opacityOpen, t[8] = s, t[9] = c) : c = t[9], c;
619
1297
  }
620
- function _t() {
621
- const t = R(44), e = ee(), o = te(), n = o?.layerId;
622
- let i;
623
- t[0] !== n ? (i = (H) => n ? H.layers[n]?.opacity ?? 1 : 1, t[0] = n, t[1] = i) : i = t[1];
624
- const r = X(e, i);
1298
+ function ko(t) {
1299
+ return t.setCollapsed;
1300
+ }
1301
+ function $o() {
1302
+ const t = T(47), e = N(), o = Q(), r = o?.layerId;
625
1303
  let l;
626
- t[2] !== n ? (l = (H) => n ? H.layers[n]?.visible ?? !0 : !0, t[2] = n, t[3] = l) : l = t[3];
627
- const p = X(e, l), a = X(e, Mt), {
628
- labels: d
629
- } = K(), [f, m] = oe(null), [c, g] = oe(null);
630
- if (!o || !n || !p)
1304
+ t[0] !== r ? (l = (H) => r ? H.layers[r]?.opacity ?? 1 : 1, t[0] = r, t[1] = l) : l = t[1];
1305
+ const i = U(e, l), n = U(e, _o), {
1306
+ labels: a
1307
+ } = B(), [s, c] = J(null), [p, f] = J(null);
1308
+ if (!o || !r || !o.opacityOpen)
631
1309
  return null;
632
1310
  let u;
633
- t[4] !== f || t[5] !== r ? (u = f ?? xe(r * 100), t[4] = f, t[5] = r, t[6] = u) : u = t[6];
634
- const h = u;
635
- let y;
636
- t[7] !== n || t[8] !== a ? (y = (H) => {
637
- const G = xe(H);
638
- return a(n, G / 100), G;
639
- }, t[7] = n, t[8] = a, t[9] = y) : y = t[9];
640
- const x = y;
641
- let b;
642
- t[10] !== x ? (b = (H) => {
643
- if (g(H), H.trim() === "")
1311
+ t[2] !== s || t[3] !== i ? (u = s ?? ze(i * 100), t[2] = s, t[3] = i, t[4] = u) : u = t[4];
1312
+ const y = u;
1313
+ let h;
1314
+ t[5] !== r || t[6] !== n ? (h = (H) => {
1315
+ const F = ze(H);
1316
+ return n(r, F / 100), F;
1317
+ }, t[5] = r, t[6] = n, t[7] = h) : h = t[7];
1318
+ const g = h;
1319
+ let v;
1320
+ t[8] !== g ? (v = (H) => {
1321
+ if (f(H), H.trim() === "")
644
1322
  return;
645
- const G = Number(H);
646
- if (!Number.isFinite(G))
1323
+ const F = Number(H);
1324
+ if (!Number.isFinite(F))
647
1325
  return;
648
- const j = x(G);
649
- j !== G && g(String(j));
650
- }, t[10] = x, t[11] = b) : b = t[11];
651
- const v = b;
652
- let L;
653
- t[12] !== o ? (L = () => {
654
- o.setOpacityOpen(!1), g(null), m(null);
655
- }, t[12] = o, t[13] = L) : L = t[13];
656
- const w = L, k = o.opacityOpen && !!o.headerEl;
657
- let C, S;
658
- t[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (C = {
659
- vertical: "bottom",
660
- horizontal: "left"
661
- }, S = {
662
- vertical: "top",
663
- horizontal: "left"
664
- }, t[14] = C, t[15] = S) : (C = t[14], S = t[15]);
665
- const z = o.headerEl?.clientWidth;
666
- let $;
667
- t[16] !== z ? ($ = {
668
- paper: {
669
- sx: {
670
- width: z
671
- }
672
- }
673
- }, t[16] = z, t[17] = $) : $ = t[17];
674
- let M;
675
- t[18] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (M = (H, G) => {
676
- m(G), g(null);
677
- }, t[18] = M) : M = t[18];
1326
+ const se = g(F);
1327
+ se !== F && f(String(se));
1328
+ }, t[8] = g, t[9] = v) : v = t[9];
1329
+ const b = v;
1330
+ let C;
1331
+ t[10] !== o ? (C = () => {
1332
+ o.setOpacityOpen(!1), f(null), c(null);
1333
+ }, t[10] = o, t[11] = C) : C = t[11];
1334
+ const L = C;
1335
+ let w;
1336
+ t[12] !== a.opacity ? (w = /* @__PURE__ */ d(E, { variant: "caption", fontWeight: "medium", color: "text.primary", children: a.opacity }), t[12] = a.opacity, t[13] = w) : w = t[13];
1337
+ let x;
1338
+ t[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ d(Pt, { fontSize: "small" }), t[14] = x) : x = t[14];
678
1339
  let I;
679
- t[19] !== x ? (I = (H, G) => {
680
- x(G), m(null);
681
- }, t[19] = x, t[20] = I) : I = t[20];
1340
+ t[15] !== L || t[16] !== a.close ? (I = /* @__PURE__ */ d(ve, { size: "small", onClick: L, "aria-label": a.close, children: x }), t[15] = L, t[16] = a.close, t[17] = I) : I = t[17];
1341
+ let S;
1342
+ t[18] !== a.close || t[19] !== I ? (S = /* @__PURE__ */ d(ie, { title: a.close, children: I }), t[18] = a.close, t[19] = I, t[20] = S) : S = t[20];
1343
+ let O;
1344
+ t[21] !== w || t[22] !== S ? (O = /* @__PURE__ */ z(P, { sx: pe.inlineHeader, children: [
1345
+ w,
1346
+ S
1347
+ ] }), t[21] = w, t[22] = S, t[23] = O) : O = t[23];
1348
+ let k;
1349
+ t[24] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (k = (H, F) => {
1350
+ c(F), f(null);
1351
+ }, t[24] = k) : k = t[24];
1352
+ let $;
1353
+ t[25] !== g ? ($ = (H, F) => {
1354
+ g(F), c(null);
1355
+ }, t[25] = g, t[26] = $) : $ = t[26];
682
1356
  let _;
683
- t[21] !== d.opacity || t[22] !== h || t[23] !== I ? (_ = /* @__PURE__ */ s(et, { size: "small", min: 0, max: 100, step: 1, value: h, onChange: M, onChangeCommitted: I, "aria-label": d.opacity, sx: fe.slider }), t[21] = d.opacity, t[22] = h, t[23] = I, t[24] = _) : _ = t[24];
684
- const O = c ?? String(h);
685
- let T;
686
- t[25] !== v ? (T = (H) => v(H.target.value), t[25] = v, t[26] = T) : T = t[26];
687
- let D;
688
- t[27] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (D = () => g(null), t[27] = D) : D = t[27];
689
- let N;
690
- t[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ s(lt, { position: "end", children: "%" }), t[28] = N) : N = t[28];
1357
+ t[27] !== a.opacity || t[28] !== y || t[29] !== $ ? (_ = /* @__PURE__ */ d(wt, { size: "small", min: 0, max: 100, step: 1, value: y, onChange: k, onChangeCommitted: $, "aria-label": a.opacity, sx: pe.slider }), t[27] = a.opacity, t[28] = y, t[29] = $, t[30] = _) : _ = t[30];
1358
+ const G = p ?? String(y);
1359
+ let m;
1360
+ t[31] !== b ? (m = (H) => b(H.target.value), t[31] = b, t[32] = m) : m = t[32];
1361
+ let M;
1362
+ t[33] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (M = () => f(null), t[33] = M) : M = t[33];
691
1363
  let A;
692
- t[29] !== d.opacity ? (A = {
1364
+ t[34] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (A = /* @__PURE__ */ d(It, { position: "end", children: "%" }), t[34] = A) : A = t[34];
1365
+ let D;
1366
+ t[35] !== a.opacity ? (D = {
693
1367
  inputMode: "numeric",
694
- "aria-label": d.opacity
695
- }, t[29] = d.opacity, t[30] = A) : A = t[30];
696
- let F;
697
- t[31] !== O || t[32] !== T || t[33] !== A ? (F = /* @__PURE__ */ s(ot, { size: "small", value: O, onChange: T, onBlur: D, onKeyDown: Pt, endAdornment: N, inputProps: A, sx: fe.input }), t[31] = O, t[32] = T, t[33] = A, t[34] = F) : F = t[34];
698
- let B;
699
- t[35] !== _ || t[36] !== F ? (B = /* @__PURE__ */ E(P, { sx: fe.popover, children: [
700
- _,
701
- F
702
- ] }), t[35] = _, t[36] = F, t[37] = B) : B = t[37];
1368
+ "aria-label": a.opacity
1369
+ }, t[35] = a.opacity, t[36] = D) : D = t[36];
1370
+ let V;
1371
+ t[37] !== G || t[38] !== m || t[39] !== D ? (V = /* @__PURE__ */ d(kt, { size: "small", value: G, onChange: m, onBlur: M, onKeyDown: Oo, endAdornment: A, inputProps: D, sx: pe.input }), t[37] = G, t[38] = m, t[39] = D, t[40] = V) : V = t[40];
703
1372
  let W;
704
- return t[38] !== w || t[39] !== o.headerEl || t[40] !== $ || t[41] !== B || t[42] !== k ? (W = /* @__PURE__ */ s(tt, { open: k, anchorEl: o.headerEl, onClose: w, anchorOrigin: C, transformOrigin: S, slotProps: $, children: B }), t[38] = w, t[39] = o.headerEl, t[40] = $, t[41] = B, t[42] = k, t[43] = W) : W = t[43], W;
1373
+ t[41] !== _ || t[42] !== V ? (W = /* @__PURE__ */ z(P, { sx: pe.inlineControls, children: [
1374
+ _,
1375
+ V
1376
+ ] }), t[41] = _, t[42] = V, t[43] = W) : W = t[43];
1377
+ let R;
1378
+ return t[44] !== W || t[45] !== O ? (R = /* @__PURE__ */ z(P, { sx: pe.inline, children: [
1379
+ O,
1380
+ W
1381
+ ] }), t[44] = W, t[45] = O, t[46] = R) : R = t[46], R;
705
1382
  }
706
- function Pt(t) {
1383
+ function Oo(t) {
707
1384
  t.key === "Enter" && t.target.blur();
708
1385
  }
709
- function Mt(t) {
1386
+ function _o(t) {
710
1387
  return t.setOpacity;
711
1388
  }
712
- const Ot = {
713
- Trigger: zt,
714
- Popover: _t
715
- }, le = {
1389
+ const Go = {
1390
+ Item: Io,
1391
+ Inline: $o
1392
+ }, ne = {
716
1393
  // Outlined-input look-alike trigger (the design's select has no floating
717
1394
  // label — just the value + chevron in a 32px bordered field).
718
1395
  trigger: {
@@ -764,63 +1441,63 @@ const Ot = {
764
1441
  }
765
1442
  }
766
1443
  };
767
- function Tt() {
768
- const t = R(34), e = ee(), n = te()?.layerId;
769
- let i;
770
- t[0] !== n ? (i = (S) => n ? S.layers[n]?.sections : void 0, t[0] = n, t[1] = i) : i = t[1];
771
- const r = Y(e, i), l = Y(e, Et), {
772
- labels: p
773
- } = K(), [a, d] = oe(null), f = !!a;
774
- if (!n || !r || r.length === 0)
1444
+ function Mo() {
1445
+ const t = T(34), e = N(), r = Q()?.layerId;
1446
+ let l;
1447
+ t[0] !== r ? (l = (O) => r ? O.layers[r]?.sections : void 0, t[0] = r, t[1] = l) : l = t[1];
1448
+ const i = Z(e, l), n = Z(e, Po), {
1449
+ labels: a
1450
+ } = B(), [s, c] = J(null), p = !!s;
1451
+ if (!r || !i || i.length === 0)
775
1452
  return null;
776
- const m = r[0].active, c = r.length > 1;
777
- let g;
778
- t[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = (S) => d(S.currentTarget), t[2] = g) : g = t[2];
779
- let u;
780
- t[3] !== m ? (u = /* @__PURE__ */ s(V, { variant: "body2", sx: le.value, children: m }), t[3] = m, t[4] = u) : u = t[4];
781
- let h;
782
- t[5] !== f ? (h = f ? {
783
- ...le.chevron,
784
- ...le.chevronOpen
785
- } : le.chevron, t[5] = f, t[6] = h) : h = t[6];
1453
+ const f = i[0].active, u = i.length > 1;
786
1454
  let y;
787
- t[7] !== h ? (y = /* @__PURE__ */ s(dt, { fontSize: "small", sx: h }), t[7] = h, t[8] = y) : y = t[8];
788
- let x;
789
- t[9] !== p.attribute || t[10] !== f || t[11] !== u || t[12] !== y ? (x = /* @__PURE__ */ E(nt, { sx: le.trigger, onClick: g, "aria-label": p.attribute, "aria-haspopup": "listbox", "aria-expanded": f, children: [
790
- u,
791
- y
792
- ] }), t[9] = p.attribute, t[10] = f, t[11] = u, t[12] = y, t[13] = x) : x = t[13];
1455
+ t[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (y = (O) => c(O.currentTarget), t[2] = y) : y = t[2];
1456
+ let h;
1457
+ t[3] !== f ? (h = /* @__PURE__ */ d(E, { variant: "body2", sx: ne.value, children: f }), t[3] = f, t[4] = h) : h = t[4];
1458
+ let g;
1459
+ t[5] !== p ? (g = p ? {
1460
+ ...ne.chevron,
1461
+ ...ne.chevronOpen
1462
+ } : ne.chevron, t[5] = p, t[6] = g) : g = t[6];
1463
+ let v;
1464
+ t[7] !== g ? (v = /* @__PURE__ */ d(zt, { fontSize: "small", sx: g }), t[7] = g, t[8] = v) : v = t[8];
793
1465
  let b;
794
- t[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = () => d(null), t[14] = b) : b = t[14];
795
- const v = a?.clientWidth;
796
- let L;
797
- t[15] !== v ? (L = {
1466
+ t[9] !== a.attribute || t[10] !== p || t[11] !== h || t[12] !== v ? (b = /* @__PURE__ */ z($t, { sx: ne.trigger, onClick: y, "aria-label": a.attribute, "aria-haspopup": "listbox", "aria-expanded": p, children: [
1467
+ h,
1468
+ v
1469
+ ] }), t[9] = a.attribute, t[10] = p, t[11] = h, t[12] = v, t[13] = b) : b = t[13];
1470
+ let C;
1471
+ t[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (C = () => c(null), t[14] = C) : C = t[14];
1472
+ const L = s?.clientWidth;
1473
+ let w;
1474
+ t[15] !== L ? (w = {
798
1475
  paper: {
799
1476
  sx: {
800
- width: v
1477
+ width: L
801
1478
  }
802
1479
  }
803
- }, t[15] = v, t[16] = L) : L = t[16];
804
- let w;
805
- if (t[17] !== n || t[18] !== r || t[19] !== l || t[20] !== c) {
806
- let S;
807
- t[22] !== n || t[23] !== l || t[24] !== c ? (S = (z) => [c && z.title ? /* @__PURE__ */ s(V, { variant: "overline", color: "text.secondary", component: "li", sx: le.sectionTitle, children: z.title }, `${z.id}-title`) : null, ...z.options.map(($) => /* @__PURE__ */ s(Ce, { selected: $ === z.active, sx: le.option, onClick: () => {
808
- l(n, z.id, $), d(null);
809
- }, children: $ }, `${z.id}-${$}`))], t[22] = n, t[23] = l, t[24] = c, t[25] = S) : S = t[25], w = r.map(S), t[17] = n, t[18] = r, t[19] = l, t[20] = c, t[21] = w;
1480
+ }, t[15] = L, t[16] = w) : w = t[16];
1481
+ let x;
1482
+ if (t[17] !== r || t[18] !== i || t[19] !== n || t[20] !== u) {
1483
+ let O;
1484
+ t[22] !== r || t[23] !== n || t[24] !== u ? (O = (k) => [u && k.title ? /* @__PURE__ */ d(E, { variant: "overline", color: "text.secondary", component: "li", sx: ne.sectionTitle, children: k.title }, `${k.id}-title`) : null, ...k.options.map(($) => /* @__PURE__ */ d(q, { selected: $ === k.active, sx: ne.option, onClick: () => {
1485
+ n(r, k.id, $), c(null);
1486
+ }, children: $ }, `${k.id}-${$}`))], t[22] = r, t[23] = n, t[24] = u, t[25] = O) : O = t[25], x = i.map(O), t[17] = r, t[18] = i, t[19] = n, t[20] = u, t[21] = x;
810
1487
  } else
811
- w = t[21];
812
- let k;
813
- t[26] !== a || t[27] !== f || t[28] !== L || t[29] !== w ? (k = /* @__PURE__ */ s(Le, { anchorEl: a, open: f, onClose: b, slotProps: L, children: w }), t[26] = a, t[27] = f, t[28] = L, t[29] = w, t[30] = k) : k = t[30];
814
- let C;
815
- return t[31] !== k || t[32] !== x ? (C = /* @__PURE__ */ E(se, { children: [
816
- x,
817
- k
818
- ] }), t[31] = k, t[32] = x, t[33] = C) : C = t[33], C;
1488
+ x = t[21];
1489
+ let I;
1490
+ t[26] !== s || t[27] !== p || t[28] !== w || t[29] !== x ? (I = /* @__PURE__ */ d($e, { anchorEl: s, open: p, onClose: C, slotProps: w, children: x }), t[26] = s, t[27] = p, t[28] = w, t[29] = x, t[30] = I) : I = t[30];
1491
+ let S;
1492
+ return t[31] !== I || t[32] !== b ? (S = /* @__PURE__ */ z(he, { children: [
1493
+ b,
1494
+ I
1495
+ ] }), t[31] = I, t[32] = b, t[33] = S) : S = t[33], S;
819
1496
  }
820
- function Et(t) {
1497
+ function Po(t) {
821
1498
  return t.setSectionValue;
822
1499
  }
823
- const J = {
1500
+ const te = {
824
1501
  list: {
825
1502
  display: "flex",
826
1503
  flexDirection: "column",
@@ -880,8 +1557,8 @@ const J = {
880
1557
  overflow: "visible",
881
1558
  textOverflow: "clip"
882
1559
  }
883
- }, ge = 12, ce = 1.5, Te = 2, Ht = 1;
884
- function Dt(t) {
1560
+ }, _e = 12, ye = 1.5, lt = 2, zo = 1;
1561
+ function Ao(t) {
885
1562
  switch (t) {
886
1563
  case "dashed":
887
1564
  return {
@@ -889,7 +1566,7 @@ function Dt(t) {
889
1566
  };
890
1567
  case "dotted":
891
1568
  return {
892
- dash: `0.1 ${ce * 2}`,
1569
+ dash: `0.1 ${ye * 2}`,
893
1570
  round: !0
894
1571
  };
895
1572
  // `dash-dot` is line-only and `corners` is handled separately: both
@@ -898,7 +1575,7 @@ function Dt(t) {
898
1575
  return {};
899
1576
  }
900
1577
  }
901
- function Gt(t) {
1578
+ function To(t) {
902
1579
  switch (t) {
903
1580
  case "dashed":
904
1581
  return {
@@ -906,7 +1583,7 @@ function Gt(t) {
906
1583
  };
907
1584
  case "dotted":
908
1585
  return {
909
- dash: `0.1 ${Te * 2}`,
1586
+ dash: `0.1 ${lt * 2}`,
910
1587
  round: !0
911
1588
  };
912
1589
  case "dash-dot":
@@ -919,8 +1596,8 @@ function Gt(t) {
919
1596
  return {};
920
1597
  }
921
1598
  }
922
- function Vt(t, e) {
923
- const o = (n) => /* @__PURE__ */ s("path", { d: n, stroke: e, strokeWidth: 1.2, fill: "none" });
1599
+ function Do(t, e) {
1600
+ const o = (r) => /* @__PURE__ */ d("path", { d: r, stroke: e, strokeWidth: 1.2, fill: "none" });
924
1601
  switch (t) {
925
1602
  case "horizontal":
926
1603
  return {
@@ -950,156 +1627,156 @@ function Vt(t, e) {
950
1627
  case "dots":
951
1628
  return {
952
1629
  size: 4,
953
- content: /* @__PURE__ */ s("circle", { cx: 2, cy: 2, r: 0.9, fill: e })
1630
+ content: /* @__PURE__ */ d("circle", { cx: 2, cy: 2, r: 0.9, fill: e })
954
1631
  };
955
1632
  case "grid":
956
1633
  return {
957
1634
  size: 3,
958
- content: /* @__PURE__ */ s("circle", { cx: 1.5, cy: 1.5, r: 0.7, fill: e })
1635
+ content: /* @__PURE__ */ d("circle", { cx: 1.5, cy: 1.5, r: 0.7, fill: e })
959
1636
  };
960
1637
  default:
961
1638
  return null;
962
1639
  }
963
1640
  }
964
- function Ee(t) {
965
- const e = R(46), {
1641
+ function it(t) {
1642
+ const e = T(46), {
966
1643
  shape: o,
967
- color: n,
968
- isStrokeColor: i,
969
- fillPattern: r,
970
- strokeStyle: l,
971
- size: p
972
- } = t, a = o === void 0 ? "circle" : o, d = i === void 0 ? !1 : i, f = r === void 0 ? "solid" : r, m = l === void 0 ? "solid" : l, c = p === void 0 ? ge : p, g = Fe();
973
- if (a === "line") {
974
- let N;
975
- e[0] !== m ? (N = Gt(m), e[0] = m, e[1] = N) : N = e[1];
1644
+ color: r,
1645
+ isStrokeColor: l,
1646
+ fillPattern: i,
1647
+ strokeStyle: n,
1648
+ size: a
1649
+ } = t, s = o === void 0 ? "circle" : o, c = l === void 0 ? !1 : l, p = i === void 0 ? "solid" : i, f = n === void 0 ? "solid" : n, u = a === void 0 ? _e : a, y = ht();
1650
+ if (s === "line") {
1651
+ let V;
1652
+ e[0] !== f ? (V = To(f), e[0] = f, e[1] = V) : V = e[1];
976
1653
  const {
977
- dash: A,
978
- round: F
979
- } = N, B = `0 0 ${c} ${c}`;
980
- let W;
981
- e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (W = {
1654
+ dash: W,
1655
+ round: R
1656
+ } = V, H = `0 0 ${u} ${u}`;
1657
+ let F;
1658
+ e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (F = {
982
1659
  display: "block",
983
1660
  overflow: "visible"
984
- }, e[2] = W) : W = e[2];
985
- const H = c / 2, G = c / 2, j = F ? "round" : "butt";
986
- let q;
987
- e[3] !== n || e[4] !== A || e[5] !== c || e[6] !== G || e[7] !== j || e[8] !== H ? (q = /* @__PURE__ */ s("line", { x1: 0, y1: H, x2: c, y2: G, stroke: n, strokeWidth: Te, strokeDasharray: A, strokeLinecap: j }), e[3] = n, e[4] = A, e[5] = c, e[6] = G, e[7] = j, e[8] = H, e[9] = q) : q = e[9];
988
- let pe;
989
- return e[10] !== c || e[11] !== q || e[12] !== B ? (pe = /* @__PURE__ */ s("svg", { width: c, height: c, viewBox: B, "aria-hidden": !0, "data-shape": "line", style: W, children: q }), e[10] = c, e[11] = q, e[12] = B, e[13] = pe) : pe = e[13], pe;
1661
+ }, e[2] = F) : F = e[2];
1662
+ const se = u / 2, Ce = u / 2, we = R ? "round" : "butt";
1663
+ let ae;
1664
+ e[3] !== r || e[4] !== W || e[5] !== u || e[6] !== Ce || e[7] !== we || e[8] !== se ? (ae = /* @__PURE__ */ d("line", { x1: 0, y1: se, x2: u, y2: Ce, stroke: r, strokeWidth: lt, strokeDasharray: W, strokeLinecap: we }), e[3] = r, e[4] = W, e[5] = u, e[6] = Ce, e[7] = we, e[8] = se, e[9] = ae) : ae = e[9];
1665
+ let Le;
1666
+ return e[10] !== u || e[11] !== ae || e[12] !== H ? (Le = /* @__PURE__ */ d("svg", { width: u, height: u, viewBox: H, "aria-hidden": !0, "data-shape": "line", style: F, children: ae }), e[10] = u, e[11] = ae, e[12] = H, e[13] = Le) : Le = e[13], Le;
990
1667
  }
991
- const u = d ? ce / 2 : 0, h = !d && f !== "solid";
992
- let y;
993
- e[14] !== n || e[15] !== f || e[16] !== h ? (y = h ? Vt(f, n) : null, e[14] = n, e[15] = f, e[16] = h, e[17] = y) : y = e[17];
994
- const x = y, b = d && m === "corners" && a === "square";
1668
+ const h = c ? ye / 2 : 0, g = !c && p !== "solid";
995
1669
  let v;
996
- e[18] !== d || e[19] !== m ? (v = d ? Dt(m) : {
1670
+ e[14] !== r || e[15] !== p || e[16] !== g ? (v = g ? Do(p, r) : null, e[14] = r, e[15] = p, e[16] = g, e[17] = v) : v = e[17];
1671
+ const b = v, C = c && f === "corners" && s === "square";
1672
+ let L;
1673
+ e[18] !== c || e[19] !== f ? (L = c ? Ao(f) : {
997
1674
  dash: void 0,
998
1675
  round: !1
999
- }, e[18] = d, e[19] = m, e[20] = v) : v = e[20];
1676
+ }, e[18] = c, e[19] = f, e[20] = L) : L = e[20];
1000
1677
  const {
1001
- dash: L,
1002
- round: w
1003
- } = v, k = d ? ce : Ht, C = d ? L : void 0, S = w ? "round" : "butt";
1004
- let z;
1005
- e[21] !== n || e[22] !== S || e[23] !== k || e[24] !== C ? (z = {
1006
- stroke: n,
1007
- strokeWidth: k,
1008
- strokeDasharray: C,
1009
- strokeLinecap: S
1010
- }, e[21] = n, e[22] = S, e[23] = k, e[24] = C, e[25] = z) : z = e[25];
1011
- const $ = z, M = d ? "none" : h ? `url(#${g})` : n, I = `0 0 ${c} ${c}`;
1012
- let _;
1013
- e[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = {
1678
+ dash: w,
1679
+ round: x
1680
+ } = L, I = c ? ye : zo, S = c ? w : void 0, O = x ? "round" : "butt";
1681
+ let k;
1682
+ e[21] !== r || e[22] !== O || e[23] !== I || e[24] !== S ? (k = {
1683
+ stroke: r,
1684
+ strokeWidth: I,
1685
+ strokeDasharray: S,
1686
+ strokeLinecap: O
1687
+ }, e[21] = r, e[22] = O, e[23] = I, e[24] = S, e[25] = k) : k = e[25];
1688
+ const $ = k, _ = c ? "none" : g ? `url(#${y})` : r, G = `0 0 ${u} ${u}`;
1689
+ let m;
1690
+ e[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = {
1014
1691
  display: "block"
1015
- }, e[26] = _) : _ = e[26];
1016
- let O;
1017
- e[27] !== g || e[28] !== x ? (O = x && /* @__PURE__ */ s("defs", { children: /* @__PURE__ */ s("pattern", { id: g, patternUnits: "userSpaceOnUse", width: x.size, height: x.size, children: x.content }) }), e[27] = g, e[28] = x, e[29] = O) : O = e[29];
1018
- let T;
1019
- e[30] !== n || e[31] !== $ || e[32] !== M || e[33] !== u || e[34] !== b || e[35] !== d || e[36] !== a || e[37] !== c || e[38] !== h ? (T = b ? /* @__PURE__ */ s(Rt, { size: c, color: n }) : a === "circle" ? /* @__PURE__ */ s("circle", { cx: c / 2, cy: c / 2, r: c / 2 - u, fill: M, ...$, stroke: d || h ? n : "none" }) : /* @__PURE__ */ s("rect", { x: u, y: u, width: c - u * 2, height: c - u * 2, fill: M, ...$, stroke: d || h ? n : "none" }), e[30] = n, e[31] = $, e[32] = M, e[33] = u, e[34] = b, e[35] = d, e[36] = a, e[37] = c, e[38] = h, e[39] = T) : T = e[39];
1692
+ }, e[26] = m) : m = e[26];
1693
+ let M;
1694
+ e[27] !== y || e[28] !== b ? (M = b && /* @__PURE__ */ d("defs", { children: /* @__PURE__ */ d("pattern", { id: y, patternUnits: "userSpaceOnUse", width: b.size, height: b.size, children: b.content }) }), e[27] = y, e[28] = b, e[29] = M) : M = e[29];
1695
+ let A;
1696
+ e[30] !== r || e[31] !== $ || e[32] !== _ || e[33] !== h || e[34] !== C || e[35] !== c || e[36] !== s || e[37] !== u || e[38] !== g ? (A = C ? /* @__PURE__ */ d(Eo, { size: u, color: r }) : s === "circle" ? /* @__PURE__ */ d("circle", { cx: u / 2, cy: u / 2, r: u / 2 - h, fill: _, ...$, stroke: c || g ? r : "none" }) : /* @__PURE__ */ d("rect", { x: h, y: h, width: u - h * 2, height: u - h * 2, fill: _, ...$, stroke: c || g ? r : "none" }), e[30] = r, e[31] = $, e[32] = _, e[33] = h, e[34] = C, e[35] = c, e[36] = s, e[37] = u, e[38] = g, e[39] = A) : A = e[39];
1020
1697
  let D;
1021
- return e[40] !== a || e[41] !== c || e[42] !== I || e[43] !== O || e[44] !== T ? (D = /* @__PURE__ */ E("svg", { width: c, height: c, viewBox: I, "aria-hidden": !0, "data-shape": a, style: _, children: [
1022
- O,
1023
- T
1024
- ] }), e[40] = a, e[41] = c, e[42] = I, e[43] = O, e[44] = T, e[45] = D) : D = e[45], D;
1698
+ return e[40] !== s || e[41] !== u || e[42] !== G || e[43] !== M || e[44] !== A ? (D = /* @__PURE__ */ z("svg", { width: u, height: u, viewBox: G, "aria-hidden": !0, "data-shape": s, style: m, children: [
1699
+ M,
1700
+ A
1701
+ ] }), e[40] = s, e[41] = u, e[42] = G, e[43] = M, e[44] = A, e[45] = D) : D = e[45], D;
1025
1702
  }
1026
- function Rt(t) {
1027
- const e = R(19), {
1703
+ function Eo(t) {
1704
+ const e = T(19), {
1028
1705
  size: o,
1029
- color: n
1030
- } = t, i = Math.max(2, o * 0.3), r = ce / 2, l = o - r;
1031
- let p;
1032
- e[0] !== n ? (p = {
1033
- stroke: n,
1034
- strokeWidth: ce,
1706
+ color: r
1707
+ } = t, l = Math.max(2, o * 0.3), i = ye / 2, n = o - i;
1708
+ let a;
1709
+ e[0] !== r ? (a = {
1710
+ stroke: r,
1711
+ strokeWidth: ye,
1035
1712
  fill: "none"
1036
- }, e[0] = n, e[1] = p) : p = e[1];
1037
- const a = p, d = `M${r} ${r + i} V${r} H${r + i}`;
1038
- let f;
1039
- e[2] !== a || e[3] !== d ? (f = /* @__PURE__ */ s("path", { d, ...a }), e[2] = a, e[3] = d, e[4] = f) : f = e[4];
1040
- const m = `M${l - i} ${r} H${l} V${r + i}`;
1041
- let c;
1042
- e[5] !== a || e[6] !== m ? (c = /* @__PURE__ */ s("path", { d: m, ...a }), e[5] = a, e[6] = m, e[7] = c) : c = e[7];
1043
- const g = `M${l} ${l - i} V${l} H${l - i}`;
1713
+ }, e[0] = r, e[1] = a) : a = e[1];
1714
+ const s = a, c = `M${i} ${i + l} V${i} H${i + l}`;
1715
+ let p;
1716
+ e[2] !== s || e[3] !== c ? (p = /* @__PURE__ */ d("path", { d: c, ...s }), e[2] = s, e[3] = c, e[4] = p) : p = e[4];
1717
+ const f = `M${n - l} ${i} H${n} V${i + l}`;
1044
1718
  let u;
1045
- e[8] !== a || e[9] !== g ? (u = /* @__PURE__ */ s("path", { d: g, ...a }), e[8] = a, e[9] = g, e[10] = u) : u = e[10];
1046
- const h = `M${r + i} ${l} H${r} V${l - i}`;
1047
- let y;
1048
- e[11] !== a || e[12] !== h ? (y = /* @__PURE__ */ s("path", { d: h, ...a }), e[11] = a, e[12] = h, e[13] = y) : y = e[13];
1049
- let x;
1050
- return e[14] !== f || e[15] !== c || e[16] !== u || e[17] !== y ? (x = /* @__PURE__ */ E(se, { children: [
1051
- f,
1052
- c,
1719
+ e[5] !== s || e[6] !== f ? (u = /* @__PURE__ */ d("path", { d: f, ...s }), e[5] = s, e[6] = f, e[7] = u) : u = e[7];
1720
+ const y = `M${n} ${n - l} V${n} H${n - l}`;
1721
+ let h;
1722
+ e[8] !== s || e[9] !== y ? (h = /* @__PURE__ */ d("path", { d: y, ...s }), e[8] = s, e[9] = y, e[10] = h) : h = e[10];
1723
+ const g = `M${i + l} ${n} H${i} V${n - l}`;
1724
+ let v;
1725
+ e[11] !== s || e[12] !== g ? (v = /* @__PURE__ */ d("path", { d: g, ...s }), e[11] = s, e[12] = g, e[13] = v) : v = e[13];
1726
+ let b;
1727
+ return e[14] !== p || e[15] !== u || e[16] !== h || e[17] !== v ? (b = /* @__PURE__ */ z(he, { children: [
1728
+ p,
1053
1729
  u,
1054
- y
1055
- ] }), e[14] = f, e[15] = c, e[16] = u, e[17] = y, e[18] = x) : x = e[18], x;
1730
+ h,
1731
+ v
1732
+ ] }), e[14] = p, e[15] = u, e[16] = h, e[17] = v, e[18] = b) : b = e[18], b;
1056
1733
  }
1057
- const At = 16;
1058
- function He(t) {
1059
- const e = R(23), {
1734
+ const Ho = 16;
1735
+ function rt(t) {
1736
+ const e = T(23), {
1060
1737
  data: o
1061
1738
  } = t, {
1062
- items: n,
1063
- shape: i,
1064
- isStrokeColor: r,
1065
- fillPattern: l,
1066
- strokeStyle: p,
1067
- orientation: a
1068
- } = o, d = i === void 0 ? "circle" : i, f = r === void 0 ? !1 : r, m = l === void 0 ? "solid" : l, c = p === void 0 ? "solid" : p, g = a === void 0 ? "vertical" : a, u = g === "horizontal";
1069
- let h;
1070
- e[0] !== n ? (h = n.reduce(Bt, 0), e[0] = n, e[1] = h) : h = e[1];
1071
- const x = Math.max(At, h), b = u ? J.listHorizontal : null;
1072
- let v;
1073
- e[2] !== b ? (v = {
1074
- ...J.list,
1075
- ...b
1076
- }, e[2] = b, e[3] = v) : v = e[3];
1739
+ items: r,
1740
+ shape: l,
1741
+ isStrokeColor: i,
1742
+ fillPattern: n,
1743
+ strokeStyle: a,
1744
+ orientation: s
1745
+ } = o, c = l === void 0 ? "circle" : l, p = i === void 0 ? !1 : i, f = n === void 0 ? "solid" : n, u = a === void 0 ? "solid" : a, y = s === void 0 ? "vertical" : s, h = y === "horizontal";
1746
+ let g;
1747
+ e[0] !== r ? (g = r.reduce(Ro, 0), e[0] = r, e[1] = g) : g = e[1];
1748
+ const b = Math.max(Ho, g), C = h ? te.listHorizontal : null;
1077
1749
  let L;
1078
- if (e[4] !== m || e[5] !== x || e[6] !== u || e[7] !== f || e[8] !== n || e[9] !== d || e[10] !== c) {
1079
- let k;
1080
- e[12] !== m || e[13] !== x || e[14] !== u || e[15] !== f || e[16] !== d || e[17] !== c ? (k = (C, S) => /* @__PURE__ */ E(P, { sx: {
1081
- ...J.item,
1082
- ...u ? J.itemHorizontal : null
1750
+ e[2] !== C ? (L = {
1751
+ ...te.list,
1752
+ ...C
1753
+ }, e[2] = C, e[3] = L) : L = e[3];
1754
+ let w;
1755
+ if (e[4] !== f || e[5] !== b || e[6] !== h || e[7] !== p || e[8] !== r || e[9] !== c || e[10] !== u) {
1756
+ let I;
1757
+ e[12] !== f || e[13] !== b || e[14] !== h || e[15] !== p || e[16] !== c || e[17] !== u ? (I = (S, O) => /* @__PURE__ */ z(P, { sx: {
1758
+ ...te.item,
1759
+ ...h ? te.itemHorizontal : null
1083
1760
  }, children: [
1084
- /* @__PURE__ */ s(P, { sx: {
1085
- ...J.gutter,
1086
- width: u ? void 0 : x
1087
- }, children: /* @__PURE__ */ s(Ee, { shape: C.shape ?? d, color: C.color, isStrokeColor: C.isStrokeColor ?? f, fillPattern: C.fillPattern ?? m, strokeStyle: C.strokeStyle ?? c, size: C.size ?? ge }) }),
1088
- /* @__PURE__ */ s(V, { variant: "caption", color: "text.primary", sx: {
1089
- ...J.label,
1090
- ...u ? J.labelHorizontal : null
1091
- }, children: C.label }),
1092
- C.value != null && /* @__PURE__ */ s(V, { className: "PsLegend-value", variant: "caption", color: "text.secondary", sx: J.value, children: C.value })
1093
- ] }, `${C.label}-${S}`), e[12] = m, e[13] = x, e[14] = u, e[15] = f, e[16] = d, e[17] = c, e[18] = k) : k = e[18], L = n.map(k), e[4] = m, e[5] = x, e[6] = u, e[7] = f, e[8] = n, e[9] = d, e[10] = c, e[11] = L;
1761
+ /* @__PURE__ */ d(P, { sx: {
1762
+ ...te.gutter,
1763
+ width: h ? void 0 : b
1764
+ }, children: /* @__PURE__ */ d(it, { shape: S.shape ?? c, color: S.color, isStrokeColor: S.isStrokeColor ?? p, fillPattern: S.fillPattern ?? f, strokeStyle: S.strokeStyle ?? u, size: S.size ?? _e }) }),
1765
+ /* @__PURE__ */ d(E, { variant: "caption", color: "text.primary", sx: {
1766
+ ...te.label,
1767
+ ...h ? te.labelHorizontal : null
1768
+ }, children: S.label }),
1769
+ S.value != null && /* @__PURE__ */ d(E, { className: "PsLegend-value", variant: "caption", color: "text.secondary", sx: te.value, children: S.value })
1770
+ ] }, `${S.label}-${O}`), e[12] = f, e[13] = b, e[14] = h, e[15] = p, e[16] = c, e[17] = u, e[18] = I) : I = e[18], w = r.map(I), e[4] = f, e[5] = b, e[6] = h, e[7] = p, e[8] = r, e[9] = c, e[10] = u, e[11] = w;
1094
1771
  } else
1095
- L = e[11];
1096
- let w;
1097
- return e[19] !== g || e[20] !== v || e[21] !== L ? (w = /* @__PURE__ */ s(P, { "data-orientation": g, sx: v, children: L }), e[19] = g, e[20] = v, e[21] = L, e[22] = w) : w = e[22], w;
1772
+ w = e[11];
1773
+ let x;
1774
+ return e[19] !== y || e[20] !== L || e[21] !== w ? (x = /* @__PURE__ */ d(P, { "data-orientation": y, sx: L, children: w }), e[19] = y, e[20] = L, e[21] = w, e[22] = x) : x = e[22], x;
1098
1775
  }
1099
- function Bt(t, e) {
1100
- return Math.max(t, e.size ?? ge);
1776
+ function Ro(t, e) {
1777
+ return Math.max(t, e.size ?? _e);
1101
1778
  }
1102
- const U = {
1779
+ const K = {
1103
1780
  container: {
1104
1781
  display: "flex",
1105
1782
  flexDirection: "column",
@@ -1159,97 +1836,97 @@ const U = {
1159
1836
  whiteSpace: "nowrap"
1160
1837
  }
1161
1838
  };
1162
- function Wt(t) {
1839
+ function Vo(t) {
1163
1840
  const {
1164
1841
  avg: e,
1165
1842
  stops: o
1166
1843
  } = t;
1167
1844
  if (e == null || o.length < 2) return null;
1168
- const n = o[0].value, i = o[o.length - 1].value;
1169
- if (n === i) return null;
1170
- const r = (e - n) / (i - n) * 100;
1171
- return Math.min(100, Math.max(0, r));
1845
+ const r = o[0].value, l = o[o.length - 1].value;
1846
+ if (r === l) return null;
1847
+ const i = (e - r) / (l - r) * 100;
1848
+ return Math.min(100, Math.max(0, i));
1172
1849
  }
1173
- function De(t) {
1174
- const e = R(40), {
1850
+ function st(t) {
1851
+ const e = T(40), {
1175
1852
  data: o,
1176
- labels: n
1177
- } = t, i = n === void 0 ? ae : n, {
1178
- colors: r,
1179
- stops: l,
1180
- isContinuous: p,
1181
- attribute: a,
1182
- formatValue: d
1183
- } = o, f = d === void 0 ? String : d;
1184
- let m;
1185
- e[0] !== o ? (m = Wt(o), e[0] = o, e[1] = m) : m = e[1];
1186
- const c = m, g = l[0], u = l[l.length - 1];
1187
- let h;
1188
- e[2] !== r ? (h = r.join(", "), e[2] = r, e[3] = h) : h = e[3];
1189
- const y = `linear-gradient(90deg, ${h})`, x = !p && l.length === r.length + 1, b = !p && !x;
1190
- let v;
1191
- e[4] !== l ? (v = (_) => `${l[_]?.label ?? ""} – ${l[_ + 1]?.label ?? ""}`, e[4] = l, e[5] = v) : v = e[5];
1192
- const L = v;
1193
- let w;
1194
- e[6] !== a || e[7] !== i ? (w = a && /* @__PURE__ */ E(P, { sx: U.attribute, children: [
1195
- /* @__PURE__ */ s(V, { variant: "overline", color: "text.secondary", children: i.colorBasedOn }),
1196
- /* @__PURE__ */ s(V, { variant: "caption", color: "text.primary", children: a })
1197
- ] }), e[6] = a, e[7] = i, e[8] = w) : w = e[8];
1198
- const k = w;
1199
- if (b) {
1200
- let _;
1201
- e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ s(pt, { fontSize: "small" }), e[9] = _) : _ = e[9];
1202
- const O = `Discrete ramp needs ${r.length + 1} stops (one per color boundary) but got ${l.length}.`;
1203
- let T;
1204
- e[10] !== O ? (T = /* @__PURE__ */ E(P, { sx: U.error, children: [
1205
- _,
1206
- /* @__PURE__ */ s(V, { variant: "caption", color: "error", children: O })
1207
- ] }), e[10] = O, e[11] = T) : T = e[11];
1853
+ labels: r
1854
+ } = t, l = r === void 0 ? ge : r, {
1855
+ colors: i,
1856
+ stops: n,
1857
+ isContinuous: a,
1858
+ attribute: s,
1859
+ formatValue: c
1860
+ } = o, p = c === void 0 ? String : c;
1861
+ let f;
1862
+ e[0] !== o ? (f = Vo(o), e[0] = o, e[1] = f) : f = e[1];
1863
+ const u = f, y = n[0], h = n[n.length - 1];
1864
+ let g;
1865
+ e[2] !== i ? (g = i.join(", "), e[2] = i, e[3] = g) : g = e[3];
1866
+ const v = `linear-gradient(90deg, ${g})`, b = !a && n.length === i.length + 1, C = !a && !b;
1867
+ let L;
1868
+ e[4] !== n ? (L = (m) => `${n[m]?.label ?? ""} – ${n[m + 1]?.label ?? ""}`, e[4] = n, e[5] = L) : L = e[5];
1869
+ const w = L;
1870
+ let x;
1871
+ e[6] !== s || e[7] !== l ? (x = s && /* @__PURE__ */ z(P, { sx: K.attribute, children: [
1872
+ /* @__PURE__ */ d(E, { variant: "overline", color: "text.secondary", children: l.colorBasedOn }),
1873
+ /* @__PURE__ */ d(E, { variant: "caption", color: "text.primary", children: s })
1874
+ ] }), e[6] = s, e[7] = l, e[8] = x) : x = e[8];
1875
+ const I = x;
1876
+ if (C) {
1877
+ let m;
1878
+ e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ d(At, { fontSize: "small" }), e[9] = m) : m = e[9];
1879
+ const M = `Discrete ramp needs ${i.length + 1} stops (one per color boundary) but got ${n.length}.`;
1880
+ let A;
1881
+ e[10] !== M ? (A = /* @__PURE__ */ z(P, { sx: K.error, children: [
1882
+ m,
1883
+ /* @__PURE__ */ d(E, { variant: "caption", color: "error", children: M })
1884
+ ] }), e[10] = M, e[11] = A) : A = e[11];
1208
1885
  let D;
1209
- return e[12] !== k || e[13] !== T ? (D = /* @__PURE__ */ E(P, { sx: U.container, children: [
1210
- k,
1211
- T
1212
- ] }), e[12] = k, e[13] = T, e[14] = D) : D = e[14], D;
1886
+ return e[12] !== I || e[13] !== A ? (D = /* @__PURE__ */ z(P, { sx: K.container, children: [
1887
+ I,
1888
+ A
1889
+ ] }), e[12] = I, e[13] = A, e[14] = D) : D = e[14], D;
1213
1890
  }
1214
- let C;
1215
- e[15] !== r || e[16] !== y || e[17] !== p || e[18] !== i || e[19] !== L ? (C = p ? /* @__PURE__ */ s(P, { role: "img", "aria-label": i.colorGradient, sx: {
1891
+ let S;
1892
+ e[15] !== i || e[16] !== v || e[17] !== a || e[18] !== l || e[19] !== w ? (S = a ? /* @__PURE__ */ d(P, { role: "img", "aria-label": l.colorGradient, sx: {
1216
1893
  width: "100%",
1217
1894
  height: "100%",
1218
- background: y
1219
- } }) : r.map((_, O) => /* @__PURE__ */ s(P, { role: "img", "aria-label": L(O), sx: {
1220
- ...U.step,
1221
- backgroundColor: _
1222
- } }, O)), e[15] = r, e[16] = y, e[17] = p, e[18] = i, e[19] = L, e[20] = C) : C = e[20];
1223
- let S;
1224
- e[21] !== C ? (S = /* @__PURE__ */ s(P, { sx: U.bar, children: C }), e[21] = C, e[22] = S) : S = e[22];
1225
- let z;
1226
- e[23] !== c || e[24] !== o.avg || e[25] !== f ? (z = c != null && o.avg != null && /* @__PURE__ */ s(we, { title: f(o.avg), placement: "top", arrow: !0, children: /* @__PURE__ */ s(P, { sx: U.avgLine, style: {
1227
- left: `${c}%`
1228
- } }) }), e[23] = c, e[24] = o.avg, e[25] = f, e[26] = z) : z = e[26];
1895
+ background: v
1896
+ } }) : i.map((m, M) => /* @__PURE__ */ d(P, { role: "img", "aria-label": w(M), sx: {
1897
+ ...K.step,
1898
+ backgroundColor: m
1899
+ } }, M)), e[15] = i, e[16] = v, e[17] = a, e[18] = l, e[19] = w, e[20] = S) : S = e[20];
1900
+ let O;
1901
+ e[21] !== S ? (O = /* @__PURE__ */ d(P, { sx: K.bar, children: S }), e[21] = S, e[22] = O) : O = e[22];
1902
+ let k;
1903
+ e[23] !== u || e[24] !== o.avg || e[25] !== p ? (k = u != null && o.avg != null && /* @__PURE__ */ d(ie, { title: p(o.avg), placement: "top", arrow: !0, children: /* @__PURE__ */ d(P, { sx: K.avgLine, style: {
1904
+ left: `${u}%`
1905
+ } }) }), e[23] = u, e[24] = o.avg, e[25] = p, e[26] = k) : k = e[26];
1229
1906
  let $;
1230
- e[27] !== S || e[28] !== z ? ($ = /* @__PURE__ */ E(P, { sx: U.barWrap, children: [
1231
- S,
1232
- z
1233
- ] }), e[27] = S, e[28] = z, e[29] = $) : $ = e[29];
1234
- let M;
1235
- e[30] !== r.length || e[31] !== g?.label || e[32] !== x || e[33] !== u?.label || e[34] !== l ? (M = x ? /* @__PURE__ */ s(P, { sx: U.boundaryLabels, children: l.map((_, O) => {
1236
- const T = O === l.length - 1, D = O === 0 ? void 0 : T ? "translateX(-100%)" : "translateX(-50%)";
1237
- return /* @__PURE__ */ s(V, { variant: "overline", color: "text.secondary", sx: U.boundaryLabel, style: {
1238
- left: `${O / r.length * 100}%`,
1907
+ e[27] !== O || e[28] !== k ? ($ = /* @__PURE__ */ z(P, { sx: K.barWrap, children: [
1908
+ O,
1909
+ k
1910
+ ] }), e[27] = O, e[28] = k, e[29] = $) : $ = e[29];
1911
+ let _;
1912
+ e[30] !== i.length || e[31] !== y?.label || e[32] !== b || e[33] !== h?.label || e[34] !== n ? (_ = b ? /* @__PURE__ */ d(P, { sx: K.boundaryLabels, children: n.map((m, M) => {
1913
+ const A = M === n.length - 1, D = M === 0 ? void 0 : A ? "translateX(-100%)" : "translateX(-50%)";
1914
+ return /* @__PURE__ */ d(E, { variant: "overline", color: "text.secondary", sx: K.boundaryLabel, style: {
1915
+ left: `${M / i.length * 100}%`,
1239
1916
  transform: D
1240
- }, children: _.label }, `${_.label}-${O}`);
1241
- }) }) : /* @__PURE__ */ E(P, { sx: U.labels, children: [
1242
- /* @__PURE__ */ s(V, { variant: "overline", color: "text.secondary", children: g?.label }),
1243
- /* @__PURE__ */ s(V, { variant: "overline", color: "text.secondary", children: u?.label })
1244
- ] }), e[30] = r.length, e[31] = g?.label, e[32] = x, e[33] = u?.label, e[34] = l, e[35] = M) : M = e[35];
1245
- let I;
1246
- return e[36] !== k || e[37] !== $ || e[38] !== M ? (I = /* @__PURE__ */ E(P, { sx: U.container, children: [
1247
- k,
1917
+ }, children: m.label }, `${m.label}-${M}`);
1918
+ }) }) : /* @__PURE__ */ z(P, { sx: K.labels, children: [
1919
+ /* @__PURE__ */ d(E, { variant: "overline", color: "text.secondary", children: y?.label }),
1920
+ /* @__PURE__ */ d(E, { variant: "overline", color: "text.secondary", children: h?.label })
1921
+ ] }), e[30] = i.length, e[31] = y?.label, e[32] = b, e[33] = h?.label, e[34] = n, e[35] = _) : _ = e[35];
1922
+ let G;
1923
+ return e[36] !== I || e[37] !== $ || e[38] !== _ ? (G = /* @__PURE__ */ z(P, { sx: K.container, children: [
1924
+ I,
1248
1925
  $,
1249
- M
1250
- ] }), e[36] = k, e[37] = $, e[38] = M, e[39] = I) : I = e[39], I;
1926
+ _
1927
+ ] }), e[36] = I, e[37] = $, e[38] = _, e[39] = G) : G = e[39], G;
1251
1928
  }
1252
- const ne = {
1929
+ const ce = {
1253
1930
  root: {
1254
1931
  display: "flex",
1255
1932
  flexDirection: "column",
@@ -1289,89 +1966,89 @@ const ne = {
1289
1966
  flexDirection: "column",
1290
1967
  justifyContent: "space-between"
1291
1968
  }
1292
- }, re = 72, Ft = 0.3, be = 2, ue = 4;
1293
- function Nt(t) {
1294
- const e = (t.stops ?? []).filter((r) => Number.isFinite(r));
1295
- if (e.length >= be)
1296
- return e.sort((r, l) => l - r).slice(0, ue);
1969
+ }, fe = 72, Bo = 0.3, Ae = 2, Ie = 4;
1970
+ function Wo(t) {
1971
+ const e = (t.stops ?? []).filter((i) => Number.isFinite(i));
1972
+ if (e.length >= Ae)
1973
+ return e.sort((i, n) => n - i).slice(0, Ie);
1297
1974
  const {
1298
1975
  min: o,
1299
- max: n
1976
+ max: r
1300
1977
  } = t;
1301
- if (o === n) return [n];
1302
- const i = Math.min(ue, Math.max(be, t.steps ?? ue));
1978
+ if (o === r) return [r];
1979
+ const l = Math.min(Ie, Math.max(Ae, t.steps ?? Ie));
1303
1980
  return Array.from({
1304
- length: i
1305
- }, (r, l) => n - (n - o) * l / (i - 1));
1981
+ length: l
1982
+ }, (i, n) => r - (r - o) * n / (l - 1));
1306
1983
  }
1307
- function Ut(t, e) {
1308
- if (e <= 1) return re;
1309
- const o = 1 - (1 - Ft) * (t / (e - 1));
1310
- return re * o;
1984
+ function No(t, e) {
1985
+ if (e <= 1) return fe;
1986
+ const o = 1 - (1 - Bo) * (t / (e - 1));
1987
+ return fe * o;
1311
1988
  }
1312
- function Ge(t) {
1313
- const e = R(40), {
1989
+ function at(t) {
1990
+ const e = T(40), {
1314
1991
  data: o,
1315
- labels: n
1316
- } = t, i = n === void 0 ? ae : n, {
1317
- attribute: r,
1318
- formatValue: l
1319
- } = o, p = l === void 0 ? String : l;
1320
- let a, d, f, m, c, g, u, h, y;
1321
- if (e[0] !== r || e[1] !== o || e[2] !== p || e[3] !== i) {
1322
- const L = Nt(o), w = L.length;
1992
+ labels: r
1993
+ } = t, l = r === void 0 ? ge : r, {
1994
+ attribute: i,
1995
+ formatValue: n
1996
+ } = o, a = n === void 0 ? String : n;
1997
+ let s, c, p, f, u, y, h, g, v;
1998
+ if (e[0] !== i || e[1] !== o || e[2] !== a || e[3] !== l) {
1999
+ const w = Wo(o), x = w.length;
2000
+ let I;
2001
+ e[13] !== a || e[14] !== l || e[15] !== x ? (I = (_, G) => {
2002
+ const m = a(_);
2003
+ return x <= 1 ? m : G === 0 ? /* @__PURE__ */ z(he, { children: [
2004
+ l.maxPrefix,
2005
+ m
2006
+ ] }) : G === x - 1 ? /* @__PURE__ */ z(he, { children: [
2007
+ l.minPrefix,
2008
+ m
2009
+ ] }) : m;
2010
+ }, e[13] = a, e[14] = l, e[15] = x, e[16] = I) : I = e[16];
2011
+ const S = I;
2012
+ p = P, g = ce.root, e[17] !== i || e[18] !== l ? (v = i && /* @__PURE__ */ z(P, { sx: ce.attribute, children: [
2013
+ /* @__PURE__ */ d(E, { variant: "overline", color: "text.secondary", children: l.radiusRangeBy }),
2014
+ /* @__PURE__ */ d(E, { variant: "caption", color: "text.primary", children: i })
2015
+ ] }), e[17] = i, e[18] = l, e[19] = v) : v = e[19], c = P, y = ce.body;
2016
+ let O;
2017
+ e[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (O = {
2018
+ ...ce.circles,
2019
+ width: fe,
2020
+ height: fe
2021
+ }, e[20] = O) : O = e[20];
1323
2022
  let k;
1324
- e[13] !== p || e[14] !== i || e[15] !== w ? (k = (M, I) => {
1325
- const _ = p(M);
1326
- return w <= 1 ? _ : I === 0 ? /* @__PURE__ */ E(se, { children: [
1327
- i.maxPrefix,
1328
- _
1329
- ] }) : I === w - 1 ? /* @__PURE__ */ E(se, { children: [
1330
- i.minPrefix,
1331
- _
1332
- ] }) : _;
1333
- }, e[13] = p, e[14] = i, e[15] = w, e[16] = k) : k = e[16];
1334
- const C = k;
1335
- f = P, h = ne.root, e[17] !== r || e[18] !== i ? (y = r && /* @__PURE__ */ E(P, { sx: ne.attribute, children: [
1336
- /* @__PURE__ */ s(V, { variant: "overline", color: "text.secondary", children: i.radiusRangeBy }),
1337
- /* @__PURE__ */ s(V, { variant: "caption", color: "text.primary", children: r })
1338
- ] }), e[17] = r, e[18] = i, e[19] = y) : y = e[19], d = P, g = ne.body;
1339
- let S;
1340
- e[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (S = {
1341
- ...ne.circles,
1342
- width: re,
1343
- height: re
1344
- }, e[20] = S) : S = e[20];
1345
- let z;
1346
- e[21] !== w ? (z = (M, I) => {
1347
- const _ = Ut(I, w);
1348
- return /* @__PURE__ */ s(P, { "aria-hidden": !0, sx: {
1349
- ...ne.circle,
1350
- width: _,
1351
- height: _
1352
- } }, I);
1353
- }, e[21] = w, e[22] = z) : z = e[22], u = /* @__PURE__ */ s(P, { sx: S, children: L.map(z) }), a = P, e[23] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = {
1354
- ...ne.labels,
1355
- height: re
1356
- }, e[23] = m) : m = e[23];
2023
+ e[21] !== x ? (k = (_, G) => {
2024
+ const m = No(G, x);
2025
+ return /* @__PURE__ */ d(P, { "aria-hidden": !0, sx: {
2026
+ ...ce.circle,
2027
+ width: m,
2028
+ height: m
2029
+ } }, G);
2030
+ }, e[21] = x, e[22] = k) : k = e[22], h = /* @__PURE__ */ d(P, { sx: O, children: w.map(k) }), s = P, e[23] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (f = {
2031
+ ...ce.labels,
2032
+ height: fe
2033
+ }, e[23] = f) : f = e[23];
1357
2034
  let $;
1358
- e[24] !== C ? ($ = (M, I) => /* @__PURE__ */ s(V, { variant: "caption", color: "text.secondary", children: C(M, I) }, I), e[24] = C, e[25] = $) : $ = e[25], c = L.map($), e[0] = r, e[1] = o, e[2] = p, e[3] = i, e[4] = a, e[5] = d, e[6] = f, e[7] = m, e[8] = c, e[9] = g, e[10] = u, e[11] = h, e[12] = y;
2035
+ e[24] !== S ? ($ = (_, G) => /* @__PURE__ */ d(E, { variant: "caption", color: "text.secondary", children: S(_, G) }, G), e[24] = S, e[25] = $) : $ = e[25], u = w.map($), e[0] = i, e[1] = o, e[2] = a, e[3] = l, e[4] = s, e[5] = c, e[6] = p, e[7] = f, e[8] = u, e[9] = y, e[10] = h, e[11] = g, e[12] = v;
1359
2036
  } else
1360
- a = e[4], d = e[5], f = e[6], m = e[7], c = e[8], g = e[9], u = e[10], h = e[11], y = e[12];
1361
- let x;
1362
- e[26] !== a || e[27] !== m || e[28] !== c ? (x = /* @__PURE__ */ s(a, { sx: m, children: c }), e[26] = a, e[27] = m, e[28] = c, e[29] = x) : x = e[29];
2037
+ s = e[4], c = e[5], p = e[6], f = e[7], u = e[8], y = e[9], h = e[10], g = e[11], v = e[12];
1363
2038
  let b;
1364
- e[30] !== d || e[31] !== g || e[32] !== u || e[33] !== x ? (b = /* @__PURE__ */ E(d, { sx: g, children: [
1365
- u,
1366
- x
1367
- ] }), e[30] = d, e[31] = g, e[32] = u, e[33] = x, e[34] = b) : b = e[34];
1368
- let v;
1369
- return e[35] !== f || e[36] !== b || e[37] !== h || e[38] !== y ? (v = /* @__PURE__ */ E(f, { sx: h, children: [
1370
- y,
2039
+ e[26] !== s || e[27] !== f || e[28] !== u ? (b = /* @__PURE__ */ d(s, { sx: f, children: u }), e[26] = s, e[27] = f, e[28] = u, e[29] = b) : b = e[29];
2040
+ let C;
2041
+ e[30] !== c || e[31] !== y || e[32] !== h || e[33] !== b ? (C = /* @__PURE__ */ z(c, { sx: y, children: [
2042
+ h,
1371
2043
  b
1372
- ] }), e[35] = f, e[36] = b, e[37] = h, e[38] = y, e[39] = v) : v = e[39], v;
2044
+ ] }), e[30] = c, e[31] = y, e[32] = h, e[33] = b, e[34] = C) : C = e[34];
2045
+ let L;
2046
+ return e[35] !== p || e[36] !== C || e[37] !== g || e[38] !== v ? (L = /* @__PURE__ */ z(p, { sx: g, children: [
2047
+ v,
2048
+ C
2049
+ ] }), e[35] = p, e[36] = C, e[37] = g, e[38] = v, e[39] = L) : L = e[39], L;
1373
2050
  }
1374
- const Q = {
2051
+ const oe = {
1375
2052
  list: {
1376
2053
  display: "flex",
1377
2054
  flexDirection: "column",
@@ -1427,61 +2104,61 @@ const Q = {
1427
2104
  textOverflow: "clip"
1428
2105
  }
1429
2106
  };
1430
- function Ve(t) {
1431
- const e = R(11), {
2107
+ function ct(t) {
2108
+ const e = T(11), {
1432
2109
  data: o
1433
- } = t, n = o.orientation ?? "vertical", i = n === "horizontal", r = i ? Q.listHorizontal : null;
1434
- let l;
1435
- e[0] !== r ? (l = {
1436
- ...Q.list,
1437
- ...r
1438
- }, e[0] = r, e[1] = l) : l = e[1];
1439
- let p;
1440
- if (e[2] !== o.items || e[3] !== i) {
1441
- let d;
1442
- e[5] !== i ? (d = (f, m) => /* @__PURE__ */ E(P, { sx: {
1443
- ...Q.item,
1444
- ...i ? Q.itemHorizontal : null
2110
+ } = t, r = o.orientation ?? "vertical", l = r === "horizontal", i = l ? oe.listHorizontal : null;
2111
+ let n;
2112
+ e[0] !== i ? (n = {
2113
+ ...oe.list,
2114
+ ...i
2115
+ }, e[0] = i, e[1] = n) : n = e[1];
2116
+ let a;
2117
+ if (e[2] !== o.items || e[3] !== l) {
2118
+ let c;
2119
+ e[5] !== l ? (c = (p, f) => /* @__PURE__ */ z(P, { sx: {
2120
+ ...oe.item,
2121
+ ...l ? oe.itemHorizontal : null
1445
2122
  }, children: [
1446
- /* @__PURE__ */ s(P, { component: "img", src: f.icon, alt: "", sx: Q.icon }),
1447
- /* @__PURE__ */ s(V, { variant: "caption", color: "text.primary", sx: {
1448
- ...Q.label,
1449
- ...i ? Q.labelHorizontal : null
1450
- }, children: f.label }),
1451
- f.value != null && /* @__PURE__ */ s(V, { className: "PsLegend-value", variant: "caption", color: "text.secondary", sx: Q.value, children: f.value })
1452
- ] }, `${f.label}-${m}`), e[5] = i, e[6] = d) : d = e[6], p = o.items.map(d), e[2] = o.items, e[3] = i, e[4] = p;
2123
+ /* @__PURE__ */ d(P, { component: "img", src: p.icon, alt: "", sx: oe.icon }),
2124
+ /* @__PURE__ */ d(E, { variant: "caption", color: "text.primary", sx: {
2125
+ ...oe.label,
2126
+ ...l ? oe.labelHorizontal : null
2127
+ }, children: p.label }),
2128
+ p.value != null && /* @__PURE__ */ d(E, { className: "PsLegend-value", variant: "caption", color: "text.secondary", sx: oe.value, children: p.value })
2129
+ ] }, `${p.label}-${f}`), e[5] = l, e[6] = c) : c = e[6], a = o.items.map(c), e[2] = o.items, e[3] = l, e[4] = a;
1453
2130
  } else
1454
- p = e[4];
1455
- let a;
1456
- return e[7] !== n || e[8] !== l || e[9] !== p ? (a = /* @__PURE__ */ s(P, { "data-orientation": n, sx: l, children: p }), e[7] = n, e[8] = l, e[9] = p, e[10] = a) : a = e[10], a;
2131
+ a = e[4];
2132
+ let s;
2133
+ return e[7] !== r || e[8] !== n || e[9] !== a ? (s = /* @__PURE__ */ d(P, { "data-orientation": r, sx: n, children: a }), e[7] = r, e[8] = n, e[9] = a, e[10] = s) : s = e[10], s;
1457
2134
  }
1458
- function Re(t) {
1459
- const e = R(10), {
2135
+ function dt(t) {
2136
+ const e = T(10), {
1460
2137
  data: o,
1461
- labels: n
2138
+ labels: r
1462
2139
  } = t;
1463
2140
  switch (o.type) {
1464
2141
  case "category": {
1465
- let i;
1466
- return e[0] !== o ? (i = /* @__PURE__ */ s(He, { data: o }), e[0] = o, e[1] = i) : i = e[1], i;
2142
+ let l;
2143
+ return e[0] !== o ? (l = /* @__PURE__ */ d(rt, { data: o }), e[0] = o, e[1] = l) : l = e[1], l;
1467
2144
  }
1468
2145
  case "ramp": {
1469
- let i;
1470
- return e[2] !== o || e[3] !== n ? (i = /* @__PURE__ */ s(De, { data: o, labels: n }), e[2] = o, e[3] = n, e[4] = i) : i = e[4], i;
2146
+ let l;
2147
+ return e[2] !== o || e[3] !== r ? (l = /* @__PURE__ */ d(st, { data: o, labels: r }), e[2] = o, e[3] = r, e[4] = l) : l = e[4], l;
1471
2148
  }
1472
2149
  case "proportion": {
1473
- let i;
1474
- return e[5] !== o || e[6] !== n ? (i = /* @__PURE__ */ s(Ge, { data: o, labels: n }), e[5] = o, e[6] = n, e[7] = i) : i = e[7], i;
2150
+ let l;
2151
+ return e[5] !== o || e[6] !== r ? (l = /* @__PURE__ */ d(at, { data: o, labels: r }), e[5] = o, e[6] = r, e[7] = l) : l = e[7], l;
1475
2152
  }
1476
2153
  case "icon": {
1477
- let i;
1478
- return e[8] !== o ? (i = /* @__PURE__ */ s(Ve, { data: o }), e[8] = o, e[9] = i) : i = e[9], i;
2154
+ let l;
2155
+ return e[8] !== o ? (l = /* @__PURE__ */ d(ct, { data: o }), e[8] = o, e[9] = l) : l = e[9], l;
1479
2156
  }
1480
2157
  default:
1481
2158
  return o;
1482
2159
  }
1483
2160
  }
1484
- const jt = {
2161
+ const Fo = {
1485
2162
  // Figma: stacked variable sections sit ~16px apart (wider than the row
1486
2163
  // content's 8px block gap).
1487
2164
  stack: {
@@ -1490,47 +2167,57 @@ const jt = {
1490
2167
  gap: 2
1491
2168
  }
1492
2169
  };
1493
- function Zt() {
1494
- const t = R(9), e = ee(), o = te();
1495
- let n;
1496
- t[0] !== o ? (n = (a) => o ? a.layers[o.layerId]?.variables : void 0, t[0] = o, t[1] = n) : n = t[1];
1497
- const i = Y(e, n), {
1498
- labels: r
1499
- } = K();
1500
- if (!i || i.length === 0)
2170
+ function Uo() {
2171
+ const t = T(9), e = N(), o = Q();
2172
+ let r;
2173
+ t[0] !== o ? (r = (s) => o ? s.layers[o.layerId]?.variables : void 0, t[0] = o, t[1] = r) : r = t[1];
2174
+ const l = Z(e, r), {
2175
+ labels: i
2176
+ } = B();
2177
+ if (!l || l.length === 0)
1501
2178
  return null;
1502
- let l;
1503
- if (t[2] !== r || t[3] !== i) {
1504
- let a;
1505
- t[5] !== r ? (a = (d, f) => /* @__PURE__ */ s(Re, { data: d, labels: r }, f), t[5] = r, t[6] = a) : a = t[6], l = i.map(a), t[2] = r, t[3] = i, t[4] = l;
2179
+ let n;
2180
+ if (t[2] !== i || t[3] !== l) {
2181
+ let s;
2182
+ t[5] !== i ? (s = (c, p) => /* @__PURE__ */ d(dt, { data: c, labels: i }, p), t[5] = i, t[6] = s) : s = t[6], n = l.map(s), t[2] = i, t[3] = l, t[4] = n;
1506
2183
  } else
1507
- l = t[4];
1508
- let p;
1509
- return t[7] !== l ? (p = /* @__PURE__ */ s(P, { sx: jt.stack, children: l }), t[7] = l, t[8] = p) : p = t[8], p;
2184
+ n = t[4];
2185
+ let a;
2186
+ return t[7] !== n ? (a = /* @__PURE__ */ d(P, { sx: Fo.stack, children: n }), t[7] = n, t[8] = a) : a = t[8], a;
1510
2187
  }
1511
- const rl = {
2188
+ const an = {
1512
2189
  // Composition shell
1513
- Provider: ut,
1514
- Group: yt,
1515
- Row: bt,
1516
- Actions: Pe,
2190
+ Provider: Nt,
2191
+ Group: jt,
2192
+ Row: Xt,
2193
+ Actions: Qe,
2194
+ Sortable: vo,
1517
2195
  // Store-connected actions & controls (context-driven)
1518
- VisibilityToggle: wt,
1519
- RowMenu: $t,
1520
- ZoomTo: kt,
1521
- Opacity: Ot,
1522
- ConfigSelect: Tt,
1523
- Item: Zt,
2196
+ VisibilityToggle: Jt,
2197
+ RowMenu: oo,
2198
+ ZoomTo: no,
2199
+ ShowOnlyLayer: lo,
2200
+ ShowAllLayers: io,
2201
+ GroupMenu: ro,
2202
+ ShowOnlyGroup: so,
2203
+ ShowAllGroups: ao,
2204
+ CollapseAllGroups: co,
2205
+ ZoomToGroup: uo,
2206
+ PanelMenu: po,
2207
+ VisibleLayers: ho,
2208
+ Opacity: Go,
2209
+ ConfigSelect: Mo,
2210
+ Item: Uo,
1524
2211
  // Pure UI
1525
- ItemUI: Re,
1526
- Swatch: Ee,
1527
- CategoryUI: He,
1528
- RampUI: De,
1529
- ProportionUI: Ge,
1530
- IconUI: Ve
2212
+ ItemUI: dt,
2213
+ Swatch: it,
2214
+ CategoryUI: rt,
2215
+ RampUI: st,
2216
+ ProportionUI: at,
2217
+ IconUI: ct
1531
2218
  };
1532
2219
  export {
1533
- ae as DEFAULT_LEGEND_LABELS,
1534
- rl as Legend
2220
+ ge as DEFAULT_LEGEND_LABELS,
2221
+ an as Legend
1535
2222
  };
1536
2223
  //# sourceMappingURL=legend.js.map