@agent-factory-platform/ui-kit 0.2.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 (84) hide show
  1. package/dist/charts/basic.d.ts +66 -0
  2. package/dist/charts/chart-tooltip.d.ts +12 -0
  3. package/dist/charts/index.d.ts +2 -0
  4. package/dist/charts/theme.d.ts +38 -0
  5. package/dist/component-api.d.ts +21 -0
  6. package/dist/component-api.js +7 -0
  7. package/dist/components/alert.d.ts +11 -0
  8. package/dist/components/avatar.d.ts +27 -0
  9. package/dist/components/badge.d.ts +34 -0
  10. package/dist/components/button-group.d.ts +7 -0
  11. package/dist/components/button.d.ts +30 -0
  12. package/dist/components/card.d.ts +25 -0
  13. package/dist/components/chart-frame.d.ts +12 -0
  14. package/dist/components/color-picker.d.ts +18 -0
  15. package/dist/components/combobox.d.ts +18 -0
  16. package/dist/components/command-dialog.d.ts +26 -0
  17. package/dist/components/confirm-dialog.d.ts +36 -0
  18. package/dist/components/data-table.d.ts +16 -0
  19. package/dist/components/date-time.d.ts +39 -0
  20. package/dist/components/disclosure.d.ts +10 -0
  21. package/dist/components/drawer.d.ts +35 -0
  22. package/dist/components/dropdown-select.d.ts +22 -0
  23. package/dist/components/field.d.ts +16 -0
  24. package/dist/components/floating-window.d.ts +33 -0
  25. package/dist/components/heading.d.ts +16 -0
  26. package/dist/components/hover-tip.d.ts +23 -0
  27. package/dist/components/icon-tip.d.ts +9 -0
  28. package/dist/components/input-group.d.ts +12 -0
  29. package/dist/components/input-otp.d.ts +11 -0
  30. package/dist/components/input.d.ts +12 -0
  31. package/dist/components/item.d.ts +21 -0
  32. package/dist/components/kbd.d.ts +7 -0
  33. package/dist/components/line-chart.d.ts +12 -0
  34. package/dist/components/listbox.d.ts +13 -0
  35. package/dist/components/live-value.d.ts +13 -0
  36. package/dist/components/modal.d.ts +43 -0
  37. package/dist/components/multi-select.d.ts +14 -0
  38. package/dist/components/native-select.d.ts +12 -0
  39. package/dist/components/navigation.d.ts +20 -0
  40. package/dist/components/page.d.ts +14 -0
  41. package/dist/components/popover-menu.d.ts +57 -0
  42. package/dist/components/progress.d.ts +4 -0
  43. package/dist/components/resizable-pane.d.ts +14 -0
  44. package/dist/components/scroll-load-more.d.ts +24 -0
  45. package/dist/components/seg-slider.d.ts +22 -0
  46. package/dist/components/segmented-control.d.ts +16 -0
  47. package/dist/components/selection-controls.d.ts +46 -0
  48. package/dist/components/sidebar.d.ts +11 -0
  49. package/dist/components/skeleton.d.ts +18 -0
  50. package/dist/components/slider.d.ts +33 -0
  51. package/dist/components/sliding-tabs.d.ts +32 -0
  52. package/dist/components/spinner.d.ts +5 -0
  53. package/dist/components/spotlight-tour.d.ts +19 -0
  54. package/dist/components/stat-card.d.ts +7 -0
  55. package/dist/components/state-view.d.ts +51 -0
  56. package/dist/components/stats-table.d.ts +8 -0
  57. package/dist/components/table.d.ts +8 -0
  58. package/dist/components/tag-pill.d.ts +21 -0
  59. package/dist/components/theme-editor.d.ts +78 -0
  60. package/dist/components/toast.d.ts +11 -0
  61. package/dist/components/toolbar.d.ts +15 -0
  62. package/dist/components/utility.d.ts +5 -0
  63. package/dist/components/widget-frame.d.ts +12 -0
  64. package/dist/components/widget-picker.d.ts +31 -0
  65. package/dist/components/workspace-grid.d.ts +25 -0
  66. package/dist/index.d.ts +67 -0
  67. package/dist/index.js +4506 -0
  68. package/dist/lib/cn.d.ts +2 -0
  69. package/dist/lib/focus-modality.d.ts +6 -0
  70. package/dist/lib/motion.d.ts +67 -0
  71. package/dist/lib/viewport.d.ts +19 -0
  72. package/dist/manifest.d.ts +17 -0
  73. package/dist/manifest.js +19 -0
  74. package/dist/styles.d.ts +1 -0
  75. package/dist/styles.js +1 -0
  76. package/dist/theme.d.ts +39 -0
  77. package/dist/ui-kit.css +1 -0
  78. package/package.json +66 -0
  79. package/src/fonts/BDOGrotesk-DemiBold.woff2 +0 -0
  80. package/src/fonts/BDOGrotesk-Medium.woff2 +0 -0
  81. package/src/fonts/BDOGrotesk-Regular.woff2 +0 -0
  82. package/src/fonts/GeistMono-Medium.woff2 +0 -0
  83. package/src/fonts/OFL-1.1.txt +93 -0
  84. package/src/fonts.css +31 -0
package/dist/index.js ADDED
@@ -0,0 +1,4506 @@
1
+ import { jsx as r, jsxs as h, Fragment as fe } from "react/jsx-runtime";
2
+ import { Slot as Pe, ContextMenu as Ae, DropdownMenu as ne, Popover as ae, Slider as $e, Checkbox as bt, RadioGroup as _e, Switch as gt, ToggleGroup as xt, Toolbar as Be, Accordion as Ee, Collapsible as tt, Progress as vt, AspectRatio as fr, ScrollArea as Oe, Separator as hr } from "radix-ui";
3
+ import { forwardRef as he, useState as j, useRef as U, useCallback as Se, useEffect as q, useMemo as ce, useContext as At, createContext as $t, useId as Q, useLayoutEffect as Ye, isValidElement as Et, cloneElement as Ot } from "react";
4
+ import { AlertCircle as Ht, TriangleAlert as pr, CircleCheck as mr, CircleHelp as br, LoaderCircle as Ut, Info as gr, CheckCircle2 as xr, X as Ke, Pin as vr, AlertTriangle as wr, Inbox as yr, Search as ut, Check as ve, Pipette as kr, ChevronDown as Ve, ArrowUp as Nr, ArrowDown as Cr, ChevronsUpDown as Sr, Sun as zr, Moon as Mr, Monitor as Tr, ChevronLeft as jt, ChevronRight as Bt, GripVertical as wt, GripHorizontal as Dr } from "lucide-react";
5
+ import { createPortal as ze } from "react-dom";
6
+ import { AnimatePresence as Ze, motion as Me } from "motion/react";
7
+ import Ir, { useContainerWidth as Rr, noCompactor as Pr } from "react-grid-layout";
8
+ import { UI_KIT_CATEGORIES as Xo, UI_KIT_COMPONENTS as Yo, UI_KIT_DEFERRED_COMPONENTS as Vo } from "./manifest.js";
9
+ import { UI_KIT_COMPONENT_API as Jo } from "./component-api.js";
10
+ import { ResponsiveContainer as Le, AreaChart as Kt, CartesianGrid as _t, XAxis as Ft, YAxis as Wt, Tooltip as Je, Area as ot, BarChart as Lr, Bar as Ar, Cell as Gt, PieChart as $r, Legend as Er, Pie as Or, RadarChart as Hr, PolarGrid as Ur, PolarAngleAxis as qt, PolarRadiusAxis as jr, Radar as yt, RadialBarChart as Br, RadialBar as Kr } from "recharts";
11
+ function v(...t) {
12
+ return t.filter(Boolean).join(" ");
13
+ }
14
+ function de({
15
+ asChild: t = !1,
16
+ variant: e = "primary",
17
+ size: n = "default",
18
+ className: a,
19
+ children: o,
20
+ type: i = "button",
21
+ ...s
22
+ }) {
23
+ const l = t ? Pe.Root : "button", d = "inline-flex shrink-0 items-center justify-center gap-2 rounded-control font-sohne font-[500] tracking-[0] outline-none transition-[background-color,color,border-color,opacity,transform] duration-150 active:scale-[0.98] focus-visible:ring-2 focus-visible:ring-rust/35 focus-visible:ring-offset-2 focus-visible:ring-offset-surface-canvas disabled:pointer-events-none disabled:opacity-45", c = {
24
+ primary: "bg-solid text-on-solid hover:opacity-90",
25
+ accent: "bg-rust text-on-accent hover:opacity-90",
26
+ secondary: "border border-border bg-surface-muted text-ink hover:bg-surface-hover",
27
+ ghost: "text-ink hover:bg-surface-hover",
28
+ success: "bg-up text-on-status hover:opacity-90",
29
+ danger: "bg-danger text-on-status hover:opacity-90",
30
+ text: "h-auto rounded-none p-0 text-ink underline-offset-4 hover:underline"
31
+ }, p = {
32
+ compact: "h-control-compact px-2.5 text-caption",
33
+ default: "h-control-default px-3.5 text-body-sm",
34
+ touch: "h-control-touch px-4 text-body",
35
+ icon: "size-control-default p-0"
36
+ };
37
+ return /* @__PURE__ */ r(
38
+ l,
39
+ {
40
+ type: t ? void 0 : i,
41
+ "data-variant": e,
42
+ "data-size": n,
43
+ className: v(d, c[e], p[n], a),
44
+ ...s,
45
+ children: o
46
+ }
47
+ );
48
+ }
49
+ function Jn({ children: t }) {
50
+ return /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center justify-end gap-2", children: t });
51
+ }
52
+ const _r = he(function({ asChild: e = !1, active: n = !1, className: a, children: o, ...i }, s) {
53
+ const l = e ? Pe.Root : "button";
54
+ return /* @__PURE__ */ r(
55
+ l,
56
+ {
57
+ ref: s,
58
+ type: e ? void 0 : "button",
59
+ "data-active": n || void 0,
60
+ className: v(
61
+ "outline-none transition-[background-color,color,border-color,box-shadow,transform] focus-visible:ring-2 focus-visible:ring-rust/35 focus-visible:ring-offset-2 focus-visible:ring-offset-surface-canvas active:scale-[0.99]",
62
+ a
63
+ ),
64
+ ...i,
65
+ children: o
66
+ }
67
+ );
68
+ });
69
+ function Qn({ label: t, children: e, orientation: n = "horizontal", className: a }) {
70
+ return /* @__PURE__ */ r(
71
+ "div",
72
+ {
73
+ role: "group",
74
+ "aria-label": t,
75
+ "aria-orientation": n,
76
+ "data-orientation": n,
77
+ className: v(
78
+ "inline-flex min-w-0 [&>button]:relative [&>button]:focus-visible:z-10",
79
+ n === "horizontal" ? "flex-row [&>button:not(:first-child)]:-ml-px [&>button:not(:first-child)]:rounded-l-none [&>button:not(:last-child)]:rounded-r-none" : "flex-col [&>button:not(:first-child)]:-mt-px [&>button:not(:first-child)]:rounded-t-none [&>button:not(:last-child)]:rounded-b-none",
80
+ a
81
+ ),
82
+ children: e
83
+ }
84
+ );
85
+ }
86
+ const Fr = {
87
+ info: "border-info/35 bg-info/10 text-info",
88
+ success: "border-success/35 bg-success/10 text-success",
89
+ warning: "border-warning/35 bg-warning/10 text-warning",
90
+ danger: "border-danger/35 bg-danger/10 text-danger"
91
+ }, Wr = {
92
+ info: /* @__PURE__ */ r(br, { size: 16, "aria-hidden": !0 }),
93
+ success: /* @__PURE__ */ r(mr, { size: 16, "aria-hidden": !0 }),
94
+ warning: /* @__PURE__ */ r(pr, { size: 16, "aria-hidden": !0 }),
95
+ danger: /* @__PURE__ */ r(Ht, { size: 16, "aria-hidden": !0 })
96
+ };
97
+ function ea({ title: t, children: e, tone: n = "info", icon: a, action: o, className: i }) {
98
+ return /* @__PURE__ */ h(
99
+ "div",
100
+ {
101
+ role: n === "warning" || n === "danger" ? "alert" : "status",
102
+ "data-tone": n,
103
+ className: v("grid min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] gap-2 rounded-panel border p-3", Fr[n], i),
104
+ children: [
105
+ /* @__PURE__ */ r("span", { className: "mt-0.5 shrink-0", children: a ?? Wr[n] }),
106
+ /* @__PURE__ */ h("div", { className: "min-w-0", children: [
107
+ /* @__PURE__ */ r("p", { className: "font-product text-body-sm font-[600] text-ink", children: t }),
108
+ e && /* @__PURE__ */ r("div", { className: "mt-0.5 font-product text-caption leading-relaxed text-graphite", children: e })
109
+ ] }),
110
+ o && /* @__PURE__ */ r("div", { className: "shrink-0", children: o })
111
+ ]
112
+ }
113
+ );
114
+ }
115
+ const Gr = {
116
+ compact: "size-control-compact text-data",
117
+ default: "size-control-default text-caption",
118
+ touch: "size-control-touch text-body-sm"
119
+ }, qr = {
120
+ online: "bg-success",
121
+ away: "bg-warning",
122
+ offline: "bg-graphite"
123
+ };
124
+ function ta({ src: t, fallback: e, label: n, status: a, statusLabel: o, size: i = "default", className: s }) {
125
+ const [l, d] = j(!1);
126
+ return /* @__PURE__ */ h(
127
+ "span",
128
+ {
129
+ role: "img",
130
+ "aria-label": n,
131
+ "data-size": i,
132
+ className: v("relative inline-grid shrink-0 place-items-center overflow-visible rounded-full bg-surface-muted font-data font-[600] text-ink ring-1 ring-border", Gr[i], s),
133
+ children: [
134
+ t && !l ? /* @__PURE__ */ r(
135
+ "img",
136
+ {
137
+ src: t,
138
+ alt: "",
139
+ className: "size-full rounded-full object-cover",
140
+ onError: () => d(!0)
141
+ }
142
+ ) : /* @__PURE__ */ r("span", { className: "truncate px-1", "data-slot": "avatar-fallback", children: e }),
143
+ a && /* @__PURE__ */ r(
144
+ "span",
145
+ {
146
+ "aria-label": o,
147
+ "aria-hidden": o ? void 0 : !0,
148
+ "data-status": a,
149
+ className: v("absolute bottom-0 right-0 z-10 size-2.5 rounded-full ring-2 ring-surface-canvas", qr[a])
150
+ }
151
+ )
152
+ ]
153
+ }
154
+ );
155
+ }
156
+ const Xr = {
157
+ compact: "-space-x-1.5",
158
+ default: "-space-x-2"
159
+ };
160
+ function ra({
161
+ label: t,
162
+ children: e,
163
+ overlap: n = "default",
164
+ className: a,
165
+ ...o
166
+ }) {
167
+ return /* @__PURE__ */ r(
168
+ "span",
169
+ {
170
+ role: "group",
171
+ "aria-label": t,
172
+ className: v(
173
+ "isolate inline-flex items-center overflow-visible [&>*]:relative [&>*]:ring-2 [&>*]:ring-surface-raised [&>*]:transition-transform [&>*:hover]:z-10 [&>*:hover]:-translate-y-px",
174
+ Xr[n],
175
+ a
176
+ ),
177
+ ...o,
178
+ children: e
179
+ }
180
+ );
181
+ }
182
+ function na({
183
+ count: t,
184
+ label: e,
185
+ size: n = 20,
186
+ showPlus: a = !0,
187
+ className: o,
188
+ style: i,
189
+ ...s
190
+ }) {
191
+ const l = Math.max(0, Math.floor(t)), d = `${a && l > 0 ? "+" : ""}${l}`, c = Math.max(n, 18 + Math.max(0, d.length - 2) * 4);
192
+ return /* @__PURE__ */ r(
193
+ "span",
194
+ {
195
+ role: "img",
196
+ "aria-label": e,
197
+ "data-avatar-overflow-count": l,
198
+ className: v(
199
+ "inline-grid shrink-0 place-items-center overflow-visible whitespace-nowrap rounded-full bg-surface-muted font-data text-[9px] font-[600] leading-none text-ink",
200
+ o
201
+ ),
202
+ style: { width: c, height: c, ...i },
203
+ ...s,
204
+ children: d
205
+ }
206
+ );
207
+ }
208
+ function aa({ label: t, size: e = "default", className: n }) {
209
+ return /* @__PURE__ */ r("span", { role: "status", "aria-label": t, "data-size": e, className: v("inline-grid shrink-0 place-items-center text-graphite", n), children: /* @__PURE__ */ r(Ut, { size: e === "compact" ? 14 : 18, className: "animate-spin", "aria-hidden": !0 }) });
210
+ }
211
+ const Yr = { error: Ht, success: xr, info: gr }, Vr = { error: "bg-danger", success: "bg-success", info: "bg-info" }, Xt = $t(null);
212
+ function oa() {
213
+ const t = At(Xt);
214
+ if (!t) throw new Error("useToast must be used within ToastProvider");
215
+ return t;
216
+ }
217
+ function ia({ children: t, closeLabel: e, duration: n = 6e3 }) {
218
+ const [a, o] = j([]), i = U(1), s = U(/* @__PURE__ */ new Map()), l = Se((u) => {
219
+ o((g) => g.filter((m) => m.id !== u));
220
+ const y = s.current.get(u);
221
+ y && clearTimeout(y), s.current.delete(u);
222
+ }, []), d = Se((u) => {
223
+ const y = s.current.get(u);
224
+ y && clearTimeout(y), s.current.set(u, setTimeout(() => l(u), n));
225
+ }, [l, n]), c = Se((u, y = "error") => {
226
+ o((g) => {
227
+ const m = g.find((b) => b.message === u && b.tone === y);
228
+ if (m)
229
+ return d(m.id), g;
230
+ const f = i.current++;
231
+ return d(f), [...g, { id: f, message: u, tone: y }];
232
+ });
233
+ }, [d]);
234
+ q(() => () => {
235
+ for (const u of s.current.values()) clearTimeout(u);
236
+ s.current.clear();
237
+ }, []);
238
+ const p = ce(() => ({ show: c }), [c]);
239
+ return /* @__PURE__ */ h(Xt.Provider, { value: p, children: [
240
+ t,
241
+ /* @__PURE__ */ r("div", { className: "pointer-events-none fixed right-4 top-[calc(60px+1rem)] z-[9999] flex w-[calc(100vw-2rem)] flex-col items-end gap-2.5 sm:right-6 sm:w-auto sm:max-w-sm", "data-slot": "toast-viewport", children: a.map((u) => {
242
+ const y = Yr[u.tone];
243
+ return /* @__PURE__ */ h(
244
+ "div",
245
+ {
246
+ role: u.tone === "error" ? "alert" : "status",
247
+ "data-tone": u.tone,
248
+ className: "t-item pointer-events-auto flex w-full items-center gap-3 rounded-panel border border-border bg-surface-raised py-3 pl-3.5 pr-3 shadow-pop",
249
+ children: [
250
+ /* @__PURE__ */ r("span", { className: v("grid size-8 shrink-0 place-items-center rounded-full text-on-status", Vr[u.tone]), children: /* @__PURE__ */ r(y, { size: 17, "aria-hidden": !0 }) }),
251
+ /* @__PURE__ */ r("span", { className: "min-w-0 flex-1 break-words font-product text-caption font-[480] text-ink", children: u.message }),
252
+ /* @__PURE__ */ r(
253
+ "button",
254
+ {
255
+ type: "button",
256
+ onClick: () => l(u.id),
257
+ "aria-label": e,
258
+ className: "grid size-7 shrink-0 place-items-center rounded-control text-graphite outline-none transition hover:bg-surface-hover hover:text-ink focus-visible:ring-2 focus-visible:ring-rust/35",
259
+ children: /* @__PURE__ */ r(Ke, { size: 14, "aria-hidden": !0 })
260
+ }
261
+ )
262
+ ]
263
+ },
264
+ u.id
265
+ );
266
+ }) })
267
+ ] });
268
+ }
269
+ function sa({ className: t, ...e }) {
270
+ return /* @__PURE__ */ r(
271
+ "kbd",
272
+ {
273
+ className: v("inline-flex min-w-5 items-center justify-center rounded-indicator border border-border bg-surface-muted px-1.5 py-0.5 font-mono text-micro leading-none text-graphite shadow-subtle", t),
274
+ ...e
275
+ }
276
+ );
277
+ }
278
+ function la({ label: t, children: e, className: n }) {
279
+ return /* @__PURE__ */ r("span", { role: "group", "aria-label": t, className: v("inline-flex items-center gap-1", n), children: e });
280
+ }
281
+ const rt = [0.22, 0.61, 0.36, 1], xe = {
282
+ /** Sidebar / context-panel expand-collapse. */
283
+ panel: { duration: 0.26, ease: rt },
284
+ /** Mobile drawer slide. */
285
+ drawer: { duration: 0.24, ease: rt },
286
+ /** Scrims, tooltips, small opacity changes. */
287
+ fade: { duration: 0.18, ease: rt }
288
+ }, Yt = {
289
+ initial: { opacity: 0 },
290
+ animate: { opacity: 1 },
291
+ exit: { opacity: 0 }
292
+ }, Vt = {
293
+ initial: { y: "100%" },
294
+ animate: { y: 0 },
295
+ exit: { y: "100%" }
296
+ }, Zr = {
297
+ initial: { opacity: 0, y: 24 },
298
+ animate: { opacity: 1, y: 0 },
299
+ exit: { opacity: 0, y: 24 }
300
+ };
301
+ function Jr(t = 560) {
302
+ const e = `(min-width: ${t}px)`, [n, a] = j(
303
+ () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(e).matches
304
+ );
305
+ return q(() => {
306
+ if (typeof window.matchMedia != "function") return;
307
+ const o = window.matchMedia(e), i = () => a(o.matches);
308
+ return o.addEventListener("change", i), () => o.removeEventListener("change", i);
309
+ }, [e]), n;
310
+ }
311
+ function Zt({
312
+ open: t,
313
+ onClose: e,
314
+ title: n,
315
+ ariaLabel: a,
316
+ closeLabel: o = "Close",
317
+ children: i,
318
+ footer: s,
319
+ size: l = "sm",
320
+ bare: d = !1,
321
+ /** Viewport width (px) at which the modal becomes a centered card; below stays bottom sheet. */
322
+ sheetUntilPx: c = 560,
323
+ placement: p = "responsive",
324
+ rootClassName: u,
325
+ panelClassName: y
326
+ }) {
327
+ const g = U(null), m = Q(), f = U(e);
328
+ f.current = e;
329
+ const b = Jr(c), w = p === "center" || p === "responsive" && b, x = w ? Zr : Vt, C = w ? xe.panel : xe.drawer;
330
+ return q(() => {
331
+ if (!t) return;
332
+ const T = document.activeElement, k = (N) => {
333
+ if (N.key === "Escape") {
334
+ f.current();
335
+ return;
336
+ }
337
+ if (N.key === "Tab" && g.current) {
338
+ const M = g.current.querySelectorAll(
339
+ 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])'
340
+ );
341
+ if (M.length === 0) {
342
+ N.preventDefault();
343
+ return;
344
+ }
345
+ const D = M[0], P = M[M.length - 1], z = document.activeElement;
346
+ N.shiftKey && (z === D || z === g.current) ? (N.preventDefault(), P.focus()) : !N.shiftKey && z === P && (N.preventDefault(), D.focus());
347
+ }
348
+ };
349
+ document.addEventListener("keydown", k);
350
+ const L = document.body.style.overflow;
351
+ document.body.style.overflow = "hidden";
352
+ const O = requestAnimationFrame(() => {
353
+ var N;
354
+ return (N = g.current) == null ? void 0 : N.focus();
355
+ });
356
+ return () => {
357
+ var N;
358
+ document.removeEventListener("keydown", k), document.body.style.overflow = L, cancelAnimationFrame(O), (N = T == null ? void 0 : T.focus) == null || N.call(T);
359
+ };
360
+ }, [t]), typeof document > "u" ? null : ze(
361
+ /* @__PURE__ */ r(Ze, { children: t && /* @__PURE__ */ h(
362
+ "div",
363
+ {
364
+ className: v("fixed inset-0 z-50 flex justify-center", w ? "items-center" : "items-end", u),
365
+ role: "dialog",
366
+ "aria-modal": "true",
367
+ "aria-labelledby": !d && n ? m : void 0,
368
+ "aria-label": d ? a ?? n : n ? void 0 : a,
369
+ "data-overlay": "modal",
370
+ "data-placement": w ? "center" : "bottom",
371
+ children: [
372
+ /* @__PURE__ */ r(
373
+ Me.div,
374
+ {
375
+ ...Yt,
376
+ transition: xe.fade,
377
+ "aria-hidden": "true",
378
+ onClick: e,
379
+ className: "absolute inset-0 bg-black/55 backdrop-blur-sm"
380
+ }
381
+ ),
382
+ /* @__PURE__ */ r(
383
+ Me.div,
384
+ {
385
+ ref: g,
386
+ "data-testid": "modal-panel",
387
+ tabIndex: -1,
388
+ onClick: (T) => T.stopPropagation(),
389
+ onMouseDown: (T) => T.stopPropagation(),
390
+ initial: x.initial,
391
+ animate: x.animate,
392
+ exit: x.exit,
393
+ transition: C,
394
+ className: v(
395
+ // overflow-hidden clips full-bleed children (e.g. the account
396
+ // modal's Fog sidebar) to the panel radius — without it a square
397
+ // child paints over the rounded corners.
398
+ "relative z-10 flex max-h-[90dvh] w-full min-w-0 flex-col overflow-hidden border border-border bg-surface-raised shadow-pop outline-none",
399
+ w ? v(
400
+ "m-4 rounded-overlay pb-0",
401
+ l === "full" ? "max-w-[1500px]" : l === "wide" ? "max-w-[980px]" : l === "xl" ? "max-w-overlay-dashboard" : l === "lg" ? "max-w-overlay-lg" : l === "command" ? "max-w-overlay-command" : "max-w-overlay-sm"
402
+ ) : "rounded-t-sheet border-b-0 pb-[env(safe-area-inset-bottom)]",
403
+ y
404
+ ),
405
+ children: d ? i : /* @__PURE__ */ h(fe, { children: [
406
+ n && /* @__PURE__ */ h("header", { className: "flex shrink-0 items-center justify-between gap-3 px-5 pb-1 pt-5", children: [
407
+ /* @__PURE__ */ r("h2", { id: m, className: "font-sohne text-body-lg font-[500] tracking-[0] text-ink", children: n }),
408
+ /* @__PURE__ */ r(
409
+ "button",
410
+ {
411
+ type: "button",
412
+ onClick: e,
413
+ title: o,
414
+ "aria-label": o,
415
+ className: "-mr-1 grid size-8 place-items-center rounded-control text-graphite outline-none transition hover:bg-surface-hover hover:text-ink focus-visible:ring-2 focus-visible:ring-rust/35",
416
+ children: /* @__PURE__ */ r(Ke, { size: 16, "aria-hidden": !0 })
417
+ }
418
+ )
419
+ ] }),
420
+ /* @__PURE__ */ r("div", { className: "min-h-0 min-w-0 flex-1 overflow-y-auto px-5 pb-5 pt-2", children: i }),
421
+ s && /* @__PURE__ */ r("div", { className: "shrink-0 border-t border-divider px-5 py-3", children: s })
422
+ ] })
423
+ }
424
+ )
425
+ ]
426
+ }
427
+ ) }),
428
+ document.body
429
+ );
430
+ }
431
+ function ca({
432
+ open: t,
433
+ onClose: e,
434
+ title: n,
435
+ message: a,
436
+ body: o,
437
+ confirmLabel: i,
438
+ cancelLabel: s,
439
+ closeLabel: l,
440
+ onConfirm: d,
441
+ confirmVariant: c,
442
+ busy: p = !1,
443
+ busyLabel: u,
444
+ confirmDisabled: y = !1
445
+ }) {
446
+ return /* @__PURE__ */ h(
447
+ Zt,
448
+ {
449
+ open: t,
450
+ onClose: p ? () => {
451
+ } : e,
452
+ title: n,
453
+ closeLabel: l ?? s,
454
+ footer: /* @__PURE__ */ h("div", { className: "flex items-center justify-end gap-2", children: [
455
+ /* @__PURE__ */ r(
456
+ de,
457
+ {
458
+ variant: "secondary",
459
+ onClick: e,
460
+ disabled: p,
461
+ children: s
462
+ }
463
+ ),
464
+ /* @__PURE__ */ r(
465
+ de,
466
+ {
467
+ variant: c ?? "primary",
468
+ onClick: () => void d(),
469
+ disabled: p || y,
470
+ "aria-busy": p || void 0,
471
+ children: p ? u ?? i : i
472
+ }
473
+ )
474
+ ] }),
475
+ children: [
476
+ a && /* @__PURE__ */ r("p", { className: "font-sohne text-body-sm leading-relaxed text-ash", children: a }),
477
+ o && /* @__PURE__ */ r("div", { className: "mt-3", children: o })
478
+ ]
479
+ }
480
+ );
481
+ }
482
+ const Qr = {
483
+ initial: { x: "100%" },
484
+ animate: { x: 0 },
485
+ exit: { x: "100%" }
486
+ };
487
+ function en() {
488
+ const [t, e] = j(
489
+ () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(min-width: 640px)").matches
490
+ );
491
+ return q(() => {
492
+ if (typeof window.matchMedia != "function") return;
493
+ const n = window.matchMedia("(min-width: 640px)"), a = () => e(n.matches);
494
+ return n.addEventListener("change", a), () => n.removeEventListener("change", a);
495
+ }, []), t;
496
+ }
497
+ function da({
498
+ open: t,
499
+ onClose: e,
500
+ title: n,
501
+ ariaLabel: a,
502
+ closeLabel: o = "Close",
503
+ description: i,
504
+ children: s,
505
+ footer: l,
506
+ size: d = "md",
507
+ bare: c = !1,
508
+ side: p = "right",
509
+ mobilePlacement: u = "bottom",
510
+ rootClassName: y,
511
+ panelClassName: g
512
+ }) {
513
+ const m = U(null), f = Q(), b = U(e);
514
+ b.current = e;
515
+ const x = en() || u === "side", T = x ? p === "left" ? { initial: { x: "-100%" }, animate: { x: 0 }, exit: { x: "-100%" } } : Qr : Vt;
516
+ if (q(() => {
517
+ if (!t) return;
518
+ const L = document.activeElement, O = (D) => {
519
+ if (D.key === "Escape") {
520
+ b.current();
521
+ return;
522
+ }
523
+ if (D.key === "Tab" && m.current) {
524
+ const P = m.current.querySelectorAll(
525
+ 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])'
526
+ );
527
+ if (P.length === 0) {
528
+ D.preventDefault();
529
+ return;
530
+ }
531
+ const z = P[0], S = P[P.length - 1];
532
+ D.shiftKey && (document.activeElement === z || document.activeElement === m.current) ? (D.preventDefault(), S.focus()) : !D.shiftKey && document.activeElement === S && (D.preventDefault(), z.focus());
533
+ }
534
+ };
535
+ document.addEventListener("keydown", O);
536
+ const N = document.body.style.overflow;
537
+ document.body.style.overflow = "hidden";
538
+ const M = requestAnimationFrame(() => {
539
+ var D;
540
+ return (D = m.current) == null ? void 0 : D.focus();
541
+ });
542
+ return () => {
543
+ var D;
544
+ document.removeEventListener("keydown", O), document.body.style.overflow = N, cancelAnimationFrame(M), (D = L == null ? void 0 : L.focus) == null || D.call(L);
545
+ };
546
+ }, [t]), typeof document > "u") return null;
547
+ const k = d === "xl" ? "sm:w-drawer-xl" : d === "lg" ? "sm:w-drawer-lg" : d === "sm" ? "sm:w-drawer-sm" : "sm:w-drawer-md";
548
+ return ze(
549
+ /* @__PURE__ */ r(Ze, { children: t && /* @__PURE__ */ h(
550
+ "div",
551
+ {
552
+ className: v(
553
+ "fixed inset-0 z-50 flex",
554
+ x ? p === "left" ? "items-stretch justify-start" : "items-stretch justify-end" : "items-end justify-center sm:items-stretch sm:justify-end",
555
+ y
556
+ ),
557
+ role: "dialog",
558
+ "aria-modal": "true",
559
+ "aria-labelledby": !c && n ? f : void 0,
560
+ "aria-label": c ? a ?? n : n ? void 0 : a,
561
+ "data-overlay": "drawer",
562
+ "data-placement": x ? p : "bottom",
563
+ children: [
564
+ /* @__PURE__ */ r(
565
+ Me.div,
566
+ {
567
+ ...Yt,
568
+ transition: xe.fade,
569
+ "aria-hidden": "true",
570
+ onClick: e,
571
+ className: "absolute inset-0 bg-black/55 backdrop-blur-sm"
572
+ }
573
+ ),
574
+ /* @__PURE__ */ r(
575
+ Me.div,
576
+ {
577
+ ref: m,
578
+ "data-testid": "drawer-panel",
579
+ tabIndex: -1,
580
+ initial: T.initial,
581
+ animate: T.animate,
582
+ exit: T.exit,
583
+ transition: xe.drawer,
584
+ className: v(
585
+ "relative z-10 flex w-full min-w-0 flex-col overflow-hidden border border-border bg-surface-raised shadow-pop outline-none",
586
+ x ? v(
587
+ "h-full max-h-none pb-0",
588
+ p === "left" ? "rounded-r-overlay border-l-0" : "rounded-l-overlay border-r-0"
589
+ ) : "max-h-[90dvh] rounded-t-sheet border-b-0 pb-[env(safe-area-inset-bottom)] sm:h-full sm:max-h-none sm:rounded-none sm:rounded-l-overlay sm:border-b sm:border-r-0 sm:pb-0",
590
+ k,
591
+ g
592
+ ),
593
+ children: c ? s : /* @__PURE__ */ h(fe, { children: [
594
+ n && /* @__PURE__ */ h("header", { className: "flex shrink-0 items-start justify-between gap-2 border-b border-divider px-5 py-3.5", children: [
595
+ /* @__PURE__ */ h("div", { className: "min-w-0", children: [
596
+ /* @__PURE__ */ r("h2", { id: f, className: "font-sohne text-body font-[500] text-ink", children: n }),
597
+ i && /* @__PURE__ */ r("p", { className: "mt-0.5 font-sohne text-caption text-graphite", children: i })
598
+ ] }),
599
+ /* @__PURE__ */ r(
600
+ "button",
601
+ {
602
+ type: "button",
603
+ onClick: e,
604
+ title: o,
605
+ "aria-label": o,
606
+ className: "-mr-1 grid size-8 place-items-center rounded-control text-graphite outline-none transition hover:bg-surface-hover hover:text-ink focus-visible:ring-2 focus-visible:ring-rust/35",
607
+ children: /* @__PURE__ */ r(Ke, { size: 16, "aria-hidden": !0 })
608
+ }
609
+ )
610
+ ] }),
611
+ /* @__PURE__ */ r("div", { className: "min-h-0 flex-1 overflow-y-auto px-5 py-4", children: s }),
612
+ l && /* @__PURE__ */ r("div", { className: "shrink-0 border-t border-divider px-5 py-3", children: l })
613
+ ] })
614
+ }
615
+ )
616
+ ]
617
+ }
618
+ ) }),
619
+ document.body
620
+ );
621
+ }
622
+ const me = 12, be = 12, Fe = 6, We = (t, e, n) => Math.max(e, Math.min(n, t));
623
+ function tn(t, e, n) {
624
+ const a = window.innerWidth, o = window.innerHeight;
625
+ if (!t)
626
+ return {
627
+ top: (o - e.height) / 2,
628
+ left: (a - e.width) / 2,
629
+ placement: "center",
630
+ arrow: 0
631
+ };
632
+ const i = t.left + t.width / 2, s = t.top + t.height / 2, l = {
633
+ bottom: t.top + t.height + me + e.height <= o - be,
634
+ top: t.top - me - e.height >= be,
635
+ right: t.left + t.width + me + e.width <= a - be,
636
+ left: t.left - me - e.width >= be
637
+ }, c = (n && n !== "auto" ? [n, "bottom", "top", "right", "left"] : ["bottom", "top", "right", "left"]).find((g) => l[g]) ?? "bottom";
638
+ let p, u;
639
+ c === "bottom" || c === "top" ? (u = We(i - e.width / 2, be, a - be - e.width), p = c === "bottom" ? t.top + t.height + me : t.top - me - e.height) : (p = We(s - e.height / 2, be, o - be - e.height), u = c === "right" ? t.left + t.width + me : t.left - me - e.width);
640
+ const y = c === "bottom" || c === "top" ? We(i - u, 20, e.width - 20) : We(s - p, 20, e.height - 20);
641
+ return { top: p, left: u, placement: c, arrow: y };
642
+ }
643
+ function rn({ placement: t, offset: e }) {
644
+ const n = "absolute size-2.5 rotate-45 border border-border bg-surface-raised";
645
+ return t === "bottom" ? /* @__PURE__ */ r("span", { "aria-hidden": !0, className: n, style: { top: -5, left: e - 5 } }) : t === "top" ? /* @__PURE__ */ r("span", { "aria-hidden": !0, className: n, style: { bottom: -5, left: e - 5 } }) : t === "right" ? /* @__PURE__ */ r("span", { "aria-hidden": !0, className: n, style: { left: -5, top: e - 5 } }) : t === "left" ? /* @__PURE__ */ r("span", { "aria-hidden": !0, className: n, style: { right: -5, top: e - 5 } }) : null;
646
+ }
647
+ function ua({
648
+ open: t,
649
+ label: e,
650
+ target: n = null,
651
+ preferredPlacement: a = "auto",
652
+ onEscape: o,
653
+ children: i,
654
+ className: s
655
+ }) {
656
+ const l = U(null), [d, c] = j({ width: 320, height: 180 });
657
+ if (Ye(() => {
658
+ if (!t || !l.current) return;
659
+ const u = l.current, y = () => {
660
+ const m = u.getBoundingClientRect();
661
+ c((f) => f.width === m.width && f.height === m.height ? f : { width: m.width, height: m.height });
662
+ };
663
+ if (y(), typeof ResizeObserver > "u") return;
664
+ const g = new ResizeObserver(y);
665
+ return g.observe(u), () => g.disconnect();
666
+ }, [i, t, n]), q(() => {
667
+ if (!t) return;
668
+ const u = document.activeElement, y = document.body.style.overflow, g = (f) => {
669
+ if (f.key === "Escape") {
670
+ o();
671
+ return;
672
+ }
673
+ if (f.key !== "Tab" || !l.current) return;
674
+ const b = l.current.querySelectorAll(
675
+ 'a[href],button:not([disabled]),input:not([disabled]),[tabindex]:not([tabindex="-1"])'
676
+ );
677
+ if (b.length === 0) {
678
+ f.preventDefault();
679
+ return;
680
+ }
681
+ const w = b[0], x = b[b.length - 1];
682
+ f.shiftKey && (document.activeElement === w || document.activeElement === l.current) ? (f.preventDefault(), x.focus()) : !f.shiftKey && document.activeElement === x && (f.preventDefault(), w.focus());
683
+ };
684
+ document.body.style.overflow = "hidden", document.addEventListener("keydown", g);
685
+ const m = requestAnimationFrame(() => {
686
+ var f;
687
+ return (f = l.current) == null ? void 0 : f.focus();
688
+ });
689
+ return () => {
690
+ var f;
691
+ cancelAnimationFrame(m), document.removeEventListener("keydown", g), document.body.style.overflow = y, (f = u == null ? void 0 : u.focus) == null || f.call(u);
692
+ };
693
+ }, [o, t]), !t || typeof document > "u") return null;
694
+ const p = tn(n, d, a);
695
+ return ze(
696
+ /* @__PURE__ */ h("div", { className: "fixed inset-0 z-[60]", role: "dialog", "aria-modal": "true", "aria-label": e, "data-overlay": "spotlight-tour", children: [
697
+ /* @__PURE__ */ r("div", { "data-uikit-interaction-shield": !0, className: "absolute inset-0", onClick: (u) => u.stopPropagation() }),
698
+ n ? /* @__PURE__ */ r(
699
+ "div",
700
+ {
701
+ "aria-hidden": !0,
702
+ className: "pointer-events-none absolute rounded-panel transition-[top,left,width,height] duration-300 ease-out motion-reduce:transition-none",
703
+ style: {
704
+ top: n.top - Fe,
705
+ left: n.left - Fe,
706
+ width: n.width + Fe * 2,
707
+ height: n.height + Fe * 2,
708
+ boxShadow: "0 0 0 3px color-mix(in srgb, var(--color-pure-white) 55%, transparent), 0 0 0 9999px color-mix(in srgb, black 60%, transparent)"
709
+ }
710
+ }
711
+ ) : /* @__PURE__ */ r("div", { "aria-hidden": !0, className: "pointer-events-none absolute inset-0 bg-black/60" }),
712
+ /* @__PURE__ */ h(
713
+ Me.div,
714
+ {
715
+ ref: l,
716
+ tabIndex: -1,
717
+ initial: { opacity: 0, scale: 0.98 },
718
+ animate: { opacity: 1, scale: 1 },
719
+ transition: xe.fade,
720
+ className: v(
721
+ "absolute w-80 max-w-[calc(100vw-24px)] rounded-panel border border-border bg-surface-raised p-5 shadow-pop outline-none",
722
+ s
723
+ ),
724
+ style: { top: p.top, left: p.left },
725
+ children: [
726
+ /* @__PURE__ */ r(rn, { placement: p.placement, offset: p.arrow }),
727
+ i
728
+ ]
729
+ }
730
+ )
731
+ ] }),
732
+ document.body
733
+ );
734
+ }
735
+ function nn(t = 560) {
736
+ const e = `(min-width: ${t}px)`, [n, a] = j(
737
+ () => typeof window < "u" && window.matchMedia(e).matches
738
+ );
739
+ return q(() => {
740
+ const o = window.matchMedia(e), i = () => a(o.matches);
741
+ return o.addEventListener("change", i), () => o.removeEventListener("change", i);
742
+ }, [e]), n;
743
+ }
744
+ const De = (t, e, n) => Math.max(e, Math.min(n, t));
745
+ function fa({
746
+ open: t,
747
+ onClose: e,
748
+ title: n,
749
+ children: a,
750
+ initialW: o = 560,
751
+ initialH: i = 440,
752
+ minW: s = 320,
753
+ minH: l = 260,
754
+ pinLabel: d = "Pin",
755
+ unpinLabel: c = "Unpin",
756
+ closeLabel: p = "Close"
757
+ }) {
758
+ const u = nn(640), [y, g] = j(!1), [m, f] = j({ w: o, h: i }), [b, w] = j(null), x = U(null), C = U(null);
759
+ if (q(() => {
760
+ !t || typeof window > "u" || !u || w(
761
+ (z) => z ?? {
762
+ x: De((window.innerWidth - o) / 2, 16, Math.max(16, window.innerWidth - o - 16)),
763
+ y: De((window.innerHeight - i) / 3, 16, Math.max(16, window.innerHeight - i - 16))
764
+ }
765
+ );
766
+ }, [t, o, i, u]), q(() => {
767
+ if (!t || u && y) return;
768
+ const z = (S) => {
769
+ S.key === "Escape" && e();
770
+ };
771
+ return document.addEventListener("keydown", z), () => document.removeEventListener("keydown", z);
772
+ }, [t, y, e, u]), q(() => {
773
+ if (!t || u || typeof document > "u") return;
774
+ const z = document.body.style.overflow;
775
+ return document.body.style.overflow = "hidden", () => {
776
+ document.body.style.overflow = z;
777
+ };
778
+ }, [t, u]), !t || typeof document > "u" || u && !b) return null;
779
+ const T = (z) => {
780
+ try {
781
+ z.currentTarget.setPointerCapture(z.pointerId);
782
+ } catch {
783
+ }
784
+ }, k = (z) => {
785
+ !u || z.button !== 0 || !b || (x.current = { ox: z.clientX - b.x, oy: z.clientY - b.y }, T(z));
786
+ }, L = (z) => {
787
+ !u || !x.current || !b || w({
788
+ x: De(z.clientX - x.current.ox, 0, window.innerWidth - m.w),
789
+ y: De(z.clientY - x.current.oy, 0, window.innerHeight - 40)
790
+ });
791
+ }, O = (z) => {
792
+ var S, A;
793
+ x.current = null, (A = (S = z.currentTarget).releasePointerCapture) == null || A.call(S, z.pointerId);
794
+ }, N = (z) => {
795
+ !u || !b || (z.stopPropagation(), C.current = { sx: z.clientX, sy: z.clientY, sw: m.w, sh: m.h }, T(z));
796
+ }, M = (z) => {
797
+ !u || !C.current || !b || f({
798
+ w: De(C.current.sw + (z.clientX - C.current.sx), s, window.innerWidth - b.x - 8),
799
+ h: De(C.current.sh + (z.clientY - C.current.sy), l, window.innerHeight - b.y - 8)
800
+ });
801
+ }, D = (z) => {
802
+ var S, A;
803
+ C.current = null, (A = (S = z.currentTarget).releasePointerCapture) == null || A.call(S, z.pointerId);
804
+ }, P = /* @__PURE__ */ h(
805
+ "div",
806
+ {
807
+ role: "dialog",
808
+ "aria-label": n,
809
+ className: v(
810
+ "flex flex-col overflow-hidden bg-surface-raised shadow-subtle ring-1 ring-border",
811
+ u ? "fixed z-50 rounded-overlay" : "relative z-10 h-[min(92dvh,var(--spacing-overlay-dashboard))] w-full max-w-none rounded-t-sheet pb-[env(safe-area-inset-bottom)]"
812
+ ),
813
+ style: u && b ? { left: b.x, top: b.y, width: m.w, height: m.h } : void 0,
814
+ children: [
815
+ /* @__PURE__ */ h(
816
+ "header",
817
+ {
818
+ onPointerDown: k,
819
+ onPointerMove: L,
820
+ onPointerUp: O,
821
+ onPointerCancel: O,
822
+ className: v(
823
+ "flex shrink-0 select-none items-center justify-between gap-2 border-b border-border bg-fog/50 px-3 py-2",
824
+ u ? "cursor-move touch-none" : "cursor-default"
825
+ ),
826
+ children: [
827
+ !u && /* @__PURE__ */ r("span", { className: "absolute left-1/2 top-1.5 h-1 w-10 -translate-x-1/2 rounded-full bg-dove/80", "aria-hidden": !0 }),
828
+ /* @__PURE__ */ r("span", { className: v("truncate font-sohne text-caption font-[480] text-ink", !u && "pt-1"), children: n }),
829
+ /* @__PURE__ */ h("div", { className: "flex shrink-0 items-center gap-1", children: [
830
+ u && /* @__PURE__ */ r(
831
+ "button",
832
+ {
833
+ type: "button",
834
+ onPointerDown: (z) => z.stopPropagation(),
835
+ onClick: () => g((z) => !z),
836
+ "aria-pressed": y,
837
+ title: y ? c : d,
838
+ "aria-label": y ? c : d,
839
+ className: v(
840
+ "grid h-6 w-6 place-items-center rounded-full transition hover:bg-dove/50",
841
+ y ? "text-ink" : "text-graphite"
842
+ ),
843
+ children: /* @__PURE__ */ r(vr, { size: 13, fill: y ? "currentColor" : "none" })
844
+ }
845
+ ),
846
+ /* @__PURE__ */ r(
847
+ "button",
848
+ {
849
+ type: "button",
850
+ onPointerDown: (z) => z.stopPropagation(),
851
+ onClick: e,
852
+ title: p,
853
+ "aria-label": p,
854
+ className: "grid h-6 w-6 place-items-center rounded-full text-graphite transition hover:bg-dove/50 hover:text-ink",
855
+ children: /* @__PURE__ */ r(Ke, { size: 14, "aria-hidden": !0 })
856
+ }
857
+ )
858
+ ] })
859
+ ]
860
+ }
861
+ ),
862
+ /* @__PURE__ */ r("div", { className: "relative flex min-h-0 flex-1 flex-col p-2", children: a }),
863
+ u && /* @__PURE__ */ r(
864
+ "div",
865
+ {
866
+ onPointerDown: N,
867
+ onPointerMove: M,
868
+ onPointerUp: D,
869
+ onPointerCancel: D,
870
+ "aria-hidden": !0,
871
+ className: "absolute bottom-0 right-0 h-4 w-4 cursor-nwse-resize touch-none",
872
+ children: /* @__PURE__ */ r("svg", { viewBox: "0 0 10 10", className: "h-full w-full text-graphite/60", "aria-hidden": !0, children: /* @__PURE__ */ r("path", { d: "M9 3 L3 9 M9 6 L6 9", stroke: "currentColor", strokeWidth: "1", strokeLinecap: "round", fill: "none" }) })
873
+ }
874
+ )
875
+ ]
876
+ }
877
+ );
878
+ return u ? ze(P, document.body) : ze(
879
+ /* @__PURE__ */ h("div", { className: "fixed inset-0 z-50 flex items-end justify-center", children: [
880
+ /* @__PURE__ */ r(
881
+ "button",
882
+ {
883
+ type: "button",
884
+ "aria-label": p,
885
+ onClick: e,
886
+ className: "absolute inset-0 bg-black/45 backdrop-blur-[2px]"
887
+ }
888
+ ),
889
+ P
890
+ ] }),
891
+ document.body
892
+ );
893
+ }
894
+ const an = {
895
+ sm: { pad: "py-8", wrap: "size-9", icon: 18, title: "text-caption", desc: "text-[11px]", gap: "gap-2", button: "compact" },
896
+ md: { pad: "py-12", wrap: "size-12", icon: 24, title: "text-body", desc: "text-caption", gap: "gap-2.5", button: "default" },
897
+ lg: { pad: "py-16", wrap: "size-14", icon: 28, title: "text-body-lg", desc: "text-body", gap: "gap-3", button: "default" }
898
+ };
899
+ function ha({
900
+ variant: t = "empty",
901
+ size: e = "md",
902
+ tone: n = "default",
903
+ icon: a,
904
+ title: o,
905
+ description: i,
906
+ /** Shorthand for a single primary action. Prefer `actions` when you need more than one. */
907
+ action: s,
908
+ actions: l,
909
+ children: d,
910
+ className: c,
911
+ "data-testid": p
912
+ }) {
913
+ const u = an[e], y = n === "scrim" ? "text-ash" : "text-graphite", g = l ?? (s ? [s] : []);
914
+ return /* @__PURE__ */ h(
915
+ "div",
916
+ {
917
+ role: t === "error" ? "alert" : "status",
918
+ "data-testid": p,
919
+ "data-variant": t,
920
+ "data-size": e,
921
+ className: v("flex flex-col items-center justify-center text-center", u.pad, u.gap, c),
922
+ children: [
923
+ t === "loading" ? /* @__PURE__ */ r(on, { size: u.icon }) : /* @__PURE__ */ r(
924
+ "div",
925
+ {
926
+ className: v(
927
+ "grid shrink-0 place-items-center rounded-full",
928
+ u.wrap,
929
+ t === "error" ? "bg-danger/10 text-danger" : v("bg-fog", y)
930
+ ),
931
+ children: a ?? (t === "error" ? /* @__PURE__ */ r(ln, { size: u.icon }) : /* @__PURE__ */ r(sn, { size: u.icon }))
932
+ }
933
+ ),
934
+ o != null && o !== "" && /* @__PURE__ */ r("p", { className: v("font-sohne font-[480]", u.title, t === "error" ? "text-danger" : "text-ink"), children: o }),
935
+ i != null && i !== "" && /* @__PURE__ */ r("p", { className: v("max-w-sm font-sohne leading-snug", y, u.desc), children: i }),
936
+ d,
937
+ g.length > 0 && /* @__PURE__ */ r("div", { className: "mt-1 flex flex-wrap items-center justify-center gap-2", children: g.map((f, b) => /* @__PURE__ */ r(
938
+ de,
939
+ {
940
+ size: u.button,
941
+ variant: f.variant ?? (b === 0 ? "primary" : "secondary"),
942
+ disabled: f.disabled,
943
+ onClick: f.onClick,
944
+ children: f.label
945
+ },
946
+ `${f.label}-${b}`
947
+ )) })
948
+ ]
949
+ }
950
+ );
951
+ }
952
+ function on({ size: t }) {
953
+ return /* @__PURE__ */ r(Ut, { size: t, className: "animate-spin text-graphite", "aria-hidden": !0 });
954
+ }
955
+ function sn({ size: t }) {
956
+ return /* @__PURE__ */ r(yr, { size: t, "aria-hidden": !0 });
957
+ }
958
+ function ln({ size: t }) {
959
+ return /* @__PURE__ */ r(wr, { size: t, "aria-hidden": !0 });
960
+ }
961
+ function pa({ className: t, style: e }) {
962
+ return /* @__PURE__ */ r("div", { "aria-hidden": !0, className: v("t-shimmer rounded-control", t), style: e });
963
+ }
964
+ function ma({
965
+ className: t,
966
+ children: e,
967
+ width: n = "fluid"
968
+ }) {
969
+ return /* @__PURE__ */ r(
970
+ "div",
971
+ {
972
+ "data-page-width": n,
973
+ className: v(
974
+ "w-full px-3 md:px-5",
975
+ n === "contained" && "mx-auto max-w-[96rem]",
976
+ t
977
+ ),
978
+ children: e
979
+ }
980
+ );
981
+ }
982
+ function Jt({ asChild: t = !1, as: e = "div", tone: n = "plain", density: a = "default", className: o, children: i, ...s }) {
983
+ const l = t ? Pe.Root : e;
984
+ return /* @__PURE__ */ r(
985
+ l,
986
+ {
987
+ "data-density": a,
988
+ className: v(
989
+ "rounded-panel",
990
+ a === "none" ? "" : a === "compact" ? "p-3" : "p-4",
991
+ {
992
+ plain: "border border-border bg-surface-card",
993
+ warm: "border border-border bg-surface-warm",
994
+ cool: "border border-border bg-surface-cool"
995
+ }[n],
996
+ o
997
+ ),
998
+ ...s,
999
+ children: i
1000
+ }
1001
+ );
1002
+ }
1003
+ function cn({ children: t, className: e }) {
1004
+ return /* @__PURE__ */ r("h3", { className: v("font-sohne text-body font-[500] tracking-[0] text-ink", e), children: t });
1005
+ }
1006
+ function dn({ children: t, className: e }) {
1007
+ return /* @__PURE__ */ r("span", { className: v("font-sohne text-caption text-graphite", e), children: t });
1008
+ }
1009
+ const un = {
1010
+ live: "bg-up",
1011
+ stale: "bg-warning",
1012
+ loading: "bg-info",
1013
+ error: "bg-danger"
1014
+ };
1015
+ function ba({
1016
+ title: t,
1017
+ summary: e,
1018
+ status: n,
1019
+ statusLabel: a,
1020
+ toolbar: o,
1021
+ legend: i,
1022
+ className: s,
1023
+ children: l,
1024
+ ...d
1025
+ }) {
1026
+ const c = Q(), p = Q();
1027
+ return /* @__PURE__ */ h(
1028
+ "figure",
1029
+ {
1030
+ "aria-labelledby": c,
1031
+ "aria-describedby": p,
1032
+ "data-chart-status": n,
1033
+ className: v(
1034
+ "flex min-h-chart-frame-min min-w-0 flex-col overflow-hidden rounded-panel border border-border bg-surface-card",
1035
+ s
1036
+ ),
1037
+ ...d,
1038
+ children: [
1039
+ /* @__PURE__ */ h("header", { className: "flex min-h-row-compact shrink-0 items-center justify-between gap-3 border-b border-divider px-3", children: [
1040
+ /* @__PURE__ */ h("div", { className: "flex min-w-0 items-center gap-2", children: [
1041
+ /* @__PURE__ */ r("span", { id: c, className: "truncate font-sohne text-caption font-[500] text-ink", children: t }),
1042
+ n && a && /* @__PURE__ */ h("span", { className: "inline-flex shrink-0 items-center gap-1.5 font-sohne text-micro text-graphite", children: [
1043
+ /* @__PURE__ */ r("span", { className: v("size-1.5 rounded-full", un[n]), "aria-hidden": !0 }),
1044
+ a
1045
+ ] })
1046
+ ] }),
1047
+ o && /* @__PURE__ */ r("div", { className: "flex shrink-0 items-center gap-1", children: o })
1048
+ ] }),
1049
+ i && /* @__PURE__ */ r("div", { className: "shrink-0 border-b border-divider px-3 py-1.5", children: i }),
1050
+ /* @__PURE__ */ r("div", { className: "min-h-0 min-w-0 flex-1 p-3", children: l }),
1051
+ /* @__PURE__ */ r("figcaption", { id: p, className: "sr-only", children: e })
1052
+ ]
1053
+ }
1054
+ );
1055
+ }
1056
+ function ga({
1057
+ open: t,
1058
+ onClose: e,
1059
+ title: n,
1060
+ query: a,
1061
+ onQueryChange: o,
1062
+ placeholder: i,
1063
+ inputRef: s,
1064
+ busy: l = !1,
1065
+ filters: d,
1066
+ filter: c,
1067
+ onFilterChange: p,
1068
+ filterAriaLabel: u,
1069
+ children: y,
1070
+ footer: g,
1071
+ onKeyDown: m,
1072
+ className: f
1073
+ }) {
1074
+ return /* @__PURE__ */ r(Zt, { open: t, onClose: e, title: n, size: "command", sheetUntilPx: 640, bare: !0, children: /* @__PURE__ */ h("div", { "data-command-dialog": !0, className: v("flex min-h-0 flex-col", f), onKeyDown: m, children: [
1075
+ /* @__PURE__ */ h(
1076
+ "div",
1077
+ {
1078
+ "data-slot": "command-search",
1079
+ className: "flex min-h-command-search shrink-0 items-center gap-2 border-b border-divider px-4",
1080
+ children: [
1081
+ /* @__PURE__ */ r(ut, { size: 17, className: "shrink-0 text-graphite", "aria-hidden": !0 }),
1082
+ /* @__PURE__ */ r(
1083
+ "input",
1084
+ {
1085
+ ref: s,
1086
+ value: a,
1087
+ onChange: (b) => o(b.target.value),
1088
+ placeholder: i,
1089
+ "aria-label": n,
1090
+ "aria-busy": l,
1091
+ autoComplete: "off",
1092
+ spellCheck: !1,
1093
+ className: "min-w-0 flex-1 bg-transparent font-sohne text-body text-ink outline-none placeholder:text-graphite"
1094
+ }
1095
+ ),
1096
+ l && /* @__PURE__ */ r(
1097
+ "span",
1098
+ {
1099
+ className: "size-4 shrink-0 animate-spin rounded-full border-2 border-graphite/25 border-t-graphite",
1100
+ "aria-hidden": !0
1101
+ }
1102
+ ),
1103
+ /* @__PURE__ */ r("kbd", { className: "hidden rounded-control border border-border bg-surface-muted px-1.5 py-0.5 font-mono text-micro text-graphite sm:inline", children: "Esc" })
1104
+ ]
1105
+ }
1106
+ ),
1107
+ /* @__PURE__ */ r(
1108
+ "div",
1109
+ {
1110
+ "data-slot": "command-filters",
1111
+ role: "group",
1112
+ "aria-label": u,
1113
+ className: "flex min-h-row-default shrink-0 items-end gap-4 overflow-x-auto border-b border-divider px-4 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
1114
+ children: d.map((b) => {
1115
+ const w = b.value === c;
1116
+ return /* @__PURE__ */ r(
1117
+ "button",
1118
+ {
1119
+ type: "button",
1120
+ "aria-pressed": w,
1121
+ disabled: b.disabled,
1122
+ onClick: () => p(b.value),
1123
+ className: v(
1124
+ "relative h-row-default shrink-0 px-0.5 font-sohne text-caption outline-none transition-colors focus-visible:ring-2 focus-visible:ring-rust/35 disabled:pointer-events-none disabled:opacity-45",
1125
+ w ? "font-[500] text-ink after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:bg-rust" : "text-graphite hover:text-ink"
1126
+ ),
1127
+ children: b.label
1128
+ },
1129
+ b.value
1130
+ );
1131
+ })
1132
+ }
1133
+ ),
1134
+ /* @__PURE__ */ r("div", { className: "min-h-0 max-h-command-results flex-1 overflow-y-auto px-2 py-2", children: y }),
1135
+ g && /* @__PURE__ */ r("div", { className: "min-h-row-compact shrink-0 border-t border-divider px-4 py-2 font-sohne text-data text-graphite", children: g })
1136
+ ] }) });
1137
+ }
1138
+ const ft = "w-full rounded-control border border-border bg-pure-white font-sohne text-ink outline-none transition-colors placeholder:text-graphite hover:border-graphite focus:border-rust/70 focus-visible:ring-2 focus-visible:ring-rust/20 disabled:cursor-not-allowed disabled:bg-surface-muted disabled:text-graphite disabled:opacity-70", Qt = {
1139
+ compact: "h-control-compact px-2.5 text-caption",
1140
+ default: "h-control-default px-3 text-body-sm",
1141
+ touch: "h-control-touch px-3.5 text-body"
1142
+ }, xa = `${ft} ${Qt.default}`, fn = v(
1143
+ ft,
1144
+ "min-h-[7.5rem] resize-y px-3 py-2.5 text-body-sm"
1145
+ ), ht = he(
1146
+ function({ className: e, density: n = "default", ...a }, o) {
1147
+ return /* @__PURE__ */ r(
1148
+ "input",
1149
+ {
1150
+ ref: o,
1151
+ "data-density": n,
1152
+ className: v(ft, Qt[n], e),
1153
+ ...a
1154
+ }
1155
+ );
1156
+ }
1157
+ ), va = he(
1158
+ function({ className: e, variant: n = "outlined", ...a }, o) {
1159
+ return /* @__PURE__ */ r(
1160
+ "textarea",
1161
+ {
1162
+ ref: o,
1163
+ "data-variant": n,
1164
+ className: v(
1165
+ n === "outlined" ? fn : "w-full min-h-[7.5rem] resize-y border-0 bg-transparent px-0 py-0 font-sohne text-body-sm text-ink outline-none placeholder:text-graphite focus-visible:ring-0 disabled:cursor-not-allowed disabled:text-graphite disabled:opacity-70",
1166
+ e
1167
+ ),
1168
+ ...a
1169
+ }
1170
+ );
1171
+ }
1172
+ ), pt = "relative z-50 min-w-48 rounded-panel border border-border bg-surface-raised p-1 font-sohne text-body-sm text-ink shadow-pop outline-none", it = "flex h-row-default cursor-default select-none items-center rounded-control px-3 outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-surface-hover";
1173
+ function hn({
1174
+ trigger: t,
1175
+ title: e,
1176
+ closeLabel: n,
1177
+ children: a,
1178
+ open: o,
1179
+ onOpenChange: i,
1180
+ size: s = "sm",
1181
+ align: l = "center",
1182
+ side: d = "bottom",
1183
+ sideOffset: c = 4,
1184
+ contentClassName: p
1185
+ }) {
1186
+ return /* @__PURE__ */ h(ae.Root, { open: o, onOpenChange: i, children: [
1187
+ /* @__PURE__ */ r(ae.Trigger, { asChild: !0, children: t }),
1188
+ /* @__PURE__ */ r(ae.Portal, { children: /* @__PURE__ */ h(
1189
+ ae.Content,
1190
+ {
1191
+ role: "dialog",
1192
+ "aria-label": e,
1193
+ sideOffset: c,
1194
+ collisionPadding: 8,
1195
+ align: l,
1196
+ side: d,
1197
+ className: v(pt, "af-popup-bound p-3", s === "command" ? "w-overlay-command" : "w-overlay-sm", p),
1198
+ children: [
1199
+ n && /* @__PURE__ */ r(ae.Close, { asChild: !0, children: /* @__PURE__ */ r("button", { type: "button", "aria-label": n, className: "absolute right-2 top-2 z-10 grid size-7 place-items-center rounded-control text-graphite outline-none hover:bg-surface-hover hover:text-ink focus-visible:ring-2 focus-visible:ring-rust/35", children: /* @__PURE__ */ r(Ke, { size: 14, "aria-hidden": !0 }) }) }),
1200
+ a
1201
+ ]
1202
+ }
1203
+ ) })
1204
+ ] });
1205
+ }
1206
+ function wa({ label: t, className: e, children: n, ...a }) {
1207
+ return /* @__PURE__ */ r("div", { role: "menu", "aria-label": t, className: e, ...a, children: n });
1208
+ }
1209
+ function ya({ selected: t, asChild: e = !1, children: n, ...a }) {
1210
+ const o = e ? Pe.Root : "button";
1211
+ return /* @__PURE__ */ r(o, { role: "menuitemradio", "aria-checked": t, ...a, children: n });
1212
+ }
1213
+ function ka({ asChild: t = !1, children: e, ...n }) {
1214
+ const a = t ? Pe.Root : "button";
1215
+ return /* @__PURE__ */ r(a, { role: "menuitem", ...n, children: e });
1216
+ }
1217
+ function Na({
1218
+ trigger: t,
1219
+ label: e,
1220
+ items: n,
1221
+ value: a,
1222
+ onValueChange: o,
1223
+ open: i,
1224
+ onOpenChange: s,
1225
+ align: l = "start",
1226
+ side: d = "bottom",
1227
+ contentClassName: c
1228
+ }) {
1229
+ const p = Q(), u = U(null), y = n.filter((f) => f.kind === "radio"), g = n.filter((f) => f.kind !== "radio"), m = (f, b = !1) => /* @__PURE__ */ h(fe, { children: [
1230
+ f.leading && /* @__PURE__ */ r("span", { className: "shrink-0", "aria-hidden": !0, children: f.leading }),
1231
+ /* @__PURE__ */ r("span", { className: "min-w-0 flex-1 truncate", children: f.label }),
1232
+ f.trailing,
1233
+ b && !f.trailing && /* @__PURE__ */ r(ve, { size: 14, className: "shrink-0 text-ink", "aria-hidden": !0 })
1234
+ ] });
1235
+ return /* @__PURE__ */ h(
1236
+ ne.Root,
1237
+ {
1238
+ modal: !1,
1239
+ open: i,
1240
+ onOpenChange: (f) => {
1241
+ s == null || s(f), f && requestAnimationFrame(() => {
1242
+ var b;
1243
+ return (b = u.current) == null ? void 0 : b.focus();
1244
+ });
1245
+ },
1246
+ children: [
1247
+ /* @__PURE__ */ r(ne.Trigger, { asChild: !0, children: t }),
1248
+ /* @__PURE__ */ r(ne.Portal, { children: /* @__PURE__ */ h(
1249
+ ne.Content,
1250
+ {
1251
+ "aria-labelledby": p,
1252
+ sideOffset: 4,
1253
+ collisionPadding: 8,
1254
+ align: l,
1255
+ side: d,
1256
+ className: v(pt, c),
1257
+ children: [
1258
+ /* @__PURE__ */ r("span", { id: p, className: "sr-only", children: e }),
1259
+ y.length > 0 && /* @__PURE__ */ r(
1260
+ ne.RadioGroup,
1261
+ {
1262
+ value: a,
1263
+ onValueChange: (f) => {
1264
+ var b, w;
1265
+ o == null || o(f), (w = (b = y.find((x) => x.id === f)) == null ? void 0 : b.onSelect) == null || w.call(b);
1266
+ },
1267
+ children: y.map((f, b) => /* @__PURE__ */ r(
1268
+ ne.RadioItem,
1269
+ {
1270
+ value: f.id,
1271
+ ref: b === 0 ? u : void 0,
1272
+ disabled: f.disabled,
1273
+ className: v(it, "gap-2", f.danger && "text-danger"),
1274
+ children: m(f, a === f.id)
1275
+ },
1276
+ f.id
1277
+ ))
1278
+ }
1279
+ ),
1280
+ g.map((f, b) => /* @__PURE__ */ h("div", { children: [
1281
+ f.separatorBefore && /* @__PURE__ */ r(ne.Separator, { className: "my-1 h-px bg-divider" }),
1282
+ /* @__PURE__ */ r(
1283
+ ne.Item,
1284
+ {
1285
+ ref: y.length === 0 && b === 0 ? u : void 0,
1286
+ disabled: f.disabled,
1287
+ onSelect: f.onSelect,
1288
+ className: v(it, "gap-2", f.danger && "text-danger"),
1289
+ children: m(f)
1290
+ }
1291
+ )
1292
+ ] }, f.id))
1293
+ ]
1294
+ }
1295
+ ) })
1296
+ ]
1297
+ }
1298
+ );
1299
+ }
1300
+ function Ca({
1301
+ children: t,
1302
+ label: e,
1303
+ items: n
1304
+ }) {
1305
+ const a = Q();
1306
+ return /* @__PURE__ */ h(Ae.Root, { children: [
1307
+ /* @__PURE__ */ r(Ae.Trigger, { asChild: !0, children: t }),
1308
+ /* @__PURE__ */ r(Ae.Portal, { children: /* @__PURE__ */ h(Ae.Content, { "aria-labelledby": a, collisionPadding: 8, className: pt, children: [
1309
+ /* @__PURE__ */ r("span", { id: a, className: "sr-only", children: e }),
1310
+ n.map((o) => /* @__PURE__ */ r(
1311
+ Ae.Item,
1312
+ {
1313
+ disabled: o.disabled,
1314
+ onSelect: o.onSelect,
1315
+ className: `${it} ${o.danger ? "text-danger" : ""}`,
1316
+ children: o.label
1317
+ },
1318
+ o.id
1319
+ ))
1320
+ ] }) })
1321
+ ] });
1322
+ }
1323
+ function Ge(t, e = 0, n = 1) {
1324
+ return Math.min(n, Math.max(e, t));
1325
+ }
1326
+ function pn(t) {
1327
+ const e = /^#[0-9a-f]{6}$/i.test(t) ? t : "#000000", [n, a, o] = [1, 3, 5].map((c) => Number.parseInt(e.slice(c, c + 2), 16) / 255), i = Math.max(n, a, o), s = Math.min(n, a, o), l = i - s;
1328
+ let d = 0;
1329
+ return l > 0 && (i === n ? d = 60 * ((a - o) / l % 6) : i === a ? d = 60 * ((o - n) / l + 2) : d = 60 * ((n - a) / l + 4)), {
1330
+ h: d < 0 ? d + 360 : d,
1331
+ s: i === 0 ? 0 : l / i,
1332
+ v: i
1333
+ };
1334
+ }
1335
+ function mn({ h: t, s: e, v: n }) {
1336
+ const a = n * e, o = t / 60, i = a * (1 - Math.abs(o % 2 - 1)), [s, l, d] = o < 1 ? [a, i, 0] : o < 2 ? [i, a, 0] : o < 3 ? [0, a, i] : o < 4 ? [0, i, a] : o < 5 ? [i, 0, a] : [a, 0, i], c = n - a, p = (u) => Math.round((u + c) * 255).toString(16).padStart(2, "0");
1337
+ return `#${p(s)}${p(l)}${p(d)}`;
1338
+ }
1339
+ function bn({ value: t, onChange: e, labels: n, presets: a = [], disabled: o = !1 }) {
1340
+ const i = /^#[0-9a-f]{6}$/i.test(t) ? t.toLowerCase() : "#000000", s = ce(() => pn(i), [i]), [l, d] = j(i.toUpperCase()), c = U(null);
1341
+ q(() => d(i.toUpperCase()), [i]);
1342
+ const p = (g) => e(mn({ h: (g.h + 360) % 360, s: Ge(g.s), v: Ge(g.v) })), u = (g) => {
1343
+ const m = c.current;
1344
+ if (!m) return;
1345
+ const f = m.getBoundingClientRect();
1346
+ p({ h: s.h, s: Ge((g.clientX - f.left) / f.width), v: 1 - Ge((g.clientY - f.top) / f.height) });
1347
+ }, y = () => {
1348
+ /^#[0-9a-f]{6}$/i.test(l) ? e(l.toLowerCase()) : d(i.toUpperCase());
1349
+ };
1350
+ return /* @__PURE__ */ r(
1351
+ hn,
1352
+ {
1353
+ title: n.dialog,
1354
+ closeLabel: n.close,
1355
+ trigger: /* @__PURE__ */ h(
1356
+ de,
1357
+ {
1358
+ "data-color-picker-trigger": "true",
1359
+ variant: "secondary",
1360
+ disabled: o,
1361
+ "aria-label": n.trigger,
1362
+ className: "w-full min-w-0 justify-between px-2.5",
1363
+ children: [
1364
+ /* @__PURE__ */ h("span", { className: "flex min-w-0 items-center gap-2", children: [
1365
+ /* @__PURE__ */ r("span", { className: "size-5 shrink-0 rounded-full border border-border shadow-subtle", style: { backgroundColor: i }, "aria-hidden": !0 }),
1366
+ /* @__PURE__ */ r("span", { className: "min-w-0 text-left text-caption text-graphite", children: n.trigger })
1367
+ ] }),
1368
+ /* @__PURE__ */ r("span", { className: "shrink-0 font-data text-data tabular-nums text-ink", children: i.toUpperCase() })
1369
+ ]
1370
+ }
1371
+ ),
1372
+ children: /* @__PURE__ */ h("div", { className: "grid min-w-0 gap-3 pt-5", children: [
1373
+ /* @__PURE__ */ r(
1374
+ "div",
1375
+ {
1376
+ ref: c,
1377
+ role: "slider",
1378
+ tabIndex: 0,
1379
+ "aria-label": n.saturation,
1380
+ "aria-valuemin": 0,
1381
+ "aria-valuemax": 100,
1382
+ "aria-valuenow": Math.round(s.s * s.v * 100),
1383
+ className: "relative h-40 touch-none cursor-crosshair overflow-hidden rounded-control border border-border outline-none focus-visible:ring-2 focus-visible:ring-rust/35",
1384
+ style: { backgroundImage: `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${s.h} 100% 50%))` },
1385
+ onPointerDown: (g) => {
1386
+ g.currentTarget.setPointerCapture(g.pointerId), u(g);
1387
+ },
1388
+ onPointerMove: (g) => {
1389
+ g.currentTarget.hasPointerCapture(g.pointerId) && u(g);
1390
+ },
1391
+ onKeyDown: (g) => {
1392
+ const m = g.shiftKey ? 0.1 : 0.02;
1393
+ if (g.key === "ArrowLeft") p({ ...s, s: s.s - m });
1394
+ else if (g.key === "ArrowRight") p({ ...s, s: s.s + m });
1395
+ else if (g.key === "ArrowUp") p({ ...s, v: s.v + m });
1396
+ else if (g.key === "ArrowDown") p({ ...s, v: s.v - m });
1397
+ else return;
1398
+ g.preventDefault();
1399
+ },
1400
+ children: /* @__PURE__ */ r(
1401
+ "span",
1402
+ {
1403
+ className: "pointer-events-none absolute size-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-pure-white shadow-pop",
1404
+ style: { left: `${s.s * 100}%`, top: `${(1 - s.v) * 100}%`, backgroundColor: i },
1405
+ "aria-hidden": !0
1406
+ }
1407
+ )
1408
+ }
1409
+ ),
1410
+ /* @__PURE__ */ h("label", { className: "grid gap-1.5", children: [
1411
+ /* @__PURE__ */ r("span", { className: "font-product text-micro font-[600] text-graphite", children: n.hue }),
1412
+ /* @__PURE__ */ r(
1413
+ "input",
1414
+ {
1415
+ type: "range",
1416
+ min: 0,
1417
+ max: 359,
1418
+ value: Math.round(s.h),
1419
+ "aria-label": n.hue,
1420
+ onChange: (g) => p({ ...s, h: Number(g.target.value) }),
1421
+ className: "af-color-picker-hue h-3 w-full cursor-pointer appearance-none rounded-full outline-none focus-visible:ring-2 focus-visible:ring-rust/35"
1422
+ }
1423
+ )
1424
+ ] }),
1425
+ /* @__PURE__ */ h("label", { className: "grid gap-1.5", children: [
1426
+ /* @__PURE__ */ r("span", { className: "font-product text-micro font-[600] text-graphite", children: n.hex }),
1427
+ /* @__PURE__ */ h("span", { className: "grid grid-cols-[auto_minmax(0,1fr)] items-center overflow-hidden rounded-control border border-border bg-pure-white has-[input:focus-visible]:border-rust has-[input:focus-visible]:ring-2 has-[input:focus-visible]:ring-rust/20", children: [
1428
+ /* @__PURE__ */ r("span", { className: "grid size-control-default place-items-center border-r border-divider text-graphite", "aria-hidden": !0, children: /* @__PURE__ */ r(kr, { size: 15 }) }),
1429
+ /* @__PURE__ */ r(
1430
+ ht,
1431
+ {
1432
+ value: l,
1433
+ "aria-label": n.hex,
1434
+ maxLength: 7,
1435
+ spellCheck: !1,
1436
+ onChange: (g) => d(g.target.value.startsWith("#") ? g.target.value : `#${g.target.value}`),
1437
+ onBlur: y,
1438
+ onKeyDown: (g) => {
1439
+ g.key === "Enter" && (y(), g.currentTarget.blur());
1440
+ },
1441
+ className: "border-0 bg-transparent font-data uppercase focus-visible:ring-0"
1442
+ }
1443
+ )
1444
+ ] })
1445
+ ] }),
1446
+ a.length > 0 ? /* @__PURE__ */ h("div", { className: "grid gap-1.5", children: [
1447
+ /* @__PURE__ */ r("span", { className: "font-product text-micro font-[600] text-graphite", children: n.presets }),
1448
+ /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-2", role: "group", "aria-label": n.presets, children: a.map((g) => {
1449
+ const m = g.toLowerCase() === i;
1450
+ return /* @__PURE__ */ r(
1451
+ "button",
1452
+ {
1453
+ type: "button",
1454
+ "aria-label": `${n.presets}: ${g}`,
1455
+ "aria-pressed": m,
1456
+ onClick: () => e(g.toLowerCase()),
1457
+ className: "grid size-8 place-items-center rounded-full border-2 border-surface-raised outline-none ring-1 ring-border transition-transform hover:scale-110 focus-visible:ring-2 focus-visible:ring-rust aria-pressed:ring-2 aria-pressed:ring-ink",
1458
+ style: { backgroundColor: g },
1459
+ children: m ? /* @__PURE__ */ r(ve, { size: 14, className: "text-pure-white drop-shadow-sm", strokeWidth: 3, "aria-hidden": !0 }) : null
1460
+ },
1461
+ g
1462
+ );
1463
+ }) })
1464
+ ] }) : null
1465
+ ] })
1466
+ }
1467
+ );
1468
+ }
1469
+ function gn({ label: t, start: e, end: n, children: a, className: o }) {
1470
+ const i = Et(a) ? Ot(a, {
1471
+ className: v("min-w-0 flex-1 !rounded-none !border-0 !bg-transparent focus:!border-0 focus-visible:!ring-0", a.props.className)
1472
+ }) : a;
1473
+ return /* @__PURE__ */ h("div", { role: "group", "aria-label": t, "data-focus-shell": !0, className: v("flex min-w-0 items-center overflow-hidden rounded-control border border-border bg-pure-white has-[input:focus-visible]:border-rust/70 has-[input:focus-visible]:ring-2 has-[input:focus-visible]:ring-rust/20", o), children: [
1474
+ e && /* @__PURE__ */ r("span", { "data-slot": "input-start", className: "shrink-0 border-r border-divider px-2.5 font-product text-caption text-graphite", children: e }),
1475
+ i,
1476
+ n && /* @__PURE__ */ r("span", { "data-slot": "input-end", className: "shrink-0 border-l border-divider px-2.5 font-product text-caption text-graphite", children: n })
1477
+ ] });
1478
+ }
1479
+ function Sa({
1480
+ value: t,
1481
+ onValueChange: e,
1482
+ label: n,
1483
+ length: a = 6,
1484
+ disabled: o = !1,
1485
+ invalid: i = !1,
1486
+ inputMode: s = "numeric",
1487
+ className: l
1488
+ }) {
1489
+ const d = (c) => {
1490
+ const p = c.target.value, u = s === "numeric" ? p.replace(/\D/g, "") : p;
1491
+ e(u.slice(0, a));
1492
+ };
1493
+ return /* @__PURE__ */ h(
1494
+ "div",
1495
+ {
1496
+ "data-slot": "input-otp",
1497
+ "data-focus-shell": !0,
1498
+ "data-invalid": i || void 0,
1499
+ className: v("group relative inline-flex max-w-full items-center gap-1.5 rounded-selection outline-none has-[input:focus-visible]:ring-2 has-[input:focus-visible]:ring-rust/35", l),
1500
+ children: [
1501
+ /* @__PURE__ */ r(
1502
+ "input",
1503
+ {
1504
+ type: "text",
1505
+ value: t,
1506
+ onChange: d,
1507
+ maxLength: a,
1508
+ inputMode: s,
1509
+ autoComplete: "one-time-code",
1510
+ "aria-label": n,
1511
+ "aria-invalid": i || void 0,
1512
+ disabled: o,
1513
+ className: "absolute inset-0 z-10 size-full cursor-text opacity-0 outline-none disabled:cursor-not-allowed"
1514
+ }
1515
+ ),
1516
+ Array.from({ length: a }, (c, p) => /* @__PURE__ */ r(
1517
+ "span",
1518
+ {
1519
+ "aria-hidden": !0,
1520
+ "data-active": p === Math.min(t.length, a - 1) || void 0,
1521
+ className: "grid size-control-default place-items-center rounded-control border border-border bg-pure-white font-mono text-body-sm tabular-nums text-ink data-[active=true]:border-rust data-[active=true]:bg-surface-muted group-data-[invalid=true]:border-danger",
1522
+ children: t[p] ?? ""
1523
+ },
1524
+ p
1525
+ ))
1526
+ ]
1527
+ }
1528
+ );
1529
+ }
1530
+ function za({ label: t, options: e, onChange: n, className: a, ...o }) {
1531
+ return /* @__PURE__ */ r(
1532
+ "select",
1533
+ {
1534
+ "aria-label": t,
1535
+ className: v("h-control-default min-w-0 rounded-control border border-border bg-pure-white px-3 font-product text-body-sm text-ink outline-none hover:border-graphite focus:border-rust/70 focus-visible:ring-2 focus-visible:ring-rust/20 disabled:bg-surface-muted disabled:text-graphite", a),
1536
+ onChange: (i) => n(i.target.value),
1537
+ ...o,
1538
+ children: e.map((i) => /* @__PURE__ */ r("option", { value: i.value, disabled: i.disabled, children: i.label }, i.value))
1539
+ }
1540
+ );
1541
+ }
1542
+ function xn({ label: t, children: e, hint: n, error: a, required: o = !1, className: i = "" }) {
1543
+ const s = Q(), l = e.props.id ?? s, d = n ? `${l}-hint` : void 0, c = a ? `${l}-error` : void 0, p = [e.props["aria-describedby"], d, c].filter(Boolean).join(" ") || void 0, u = Et(e) ? Ot(e, {
1544
+ id: l,
1545
+ "aria-describedby": p,
1546
+ "aria-invalid": !!a || void 0
1547
+ }) : e;
1548
+ return /* @__PURE__ */ h("div", { className: `grid min-w-0 gap-1.5 font-sohne text-caption ${i}`, "data-slot": "field", children: [
1549
+ /* @__PURE__ */ h("label", { htmlFor: l, className: "font-[500] text-graphite", children: [
1550
+ t,
1551
+ o && /* @__PURE__ */ r("span", { className: "ml-1 text-danger", "aria-hidden": !0, children: "*" })
1552
+ ] }),
1553
+ u,
1554
+ n && /* @__PURE__ */ r("p", { id: d, className: "text-caption text-graphite", children: n }),
1555
+ a && /* @__PURE__ */ r("p", { id: c, className: "text-caption text-danger", children: a })
1556
+ ] });
1557
+ }
1558
+ function Ma({
1559
+ value: t,
1560
+ options: e,
1561
+ onChange: n,
1562
+ ariaLabel: a,
1563
+ placeholder: o,
1564
+ disabled: i = !1,
1565
+ density: s = "default",
1566
+ menuAlign: l = "start",
1567
+ portaled: d = !1,
1568
+ className: c
1569
+ }) {
1570
+ const [p, u] = j(!1), [y, g] = j(-1), m = U(null), f = U(null), [b, w] = j(), x = Q(), C = ce(() => e.find((S) => S.value === t), [e, t]), T = !i && e.length > 0, k = (S, A) => {
1571
+ var F;
1572
+ for (let Y = 0; Y < e.length; Y += 1) {
1573
+ const ue = (S + A * Y + e.length) % e.length;
1574
+ if (!((F = e[ue]) != null && F.disabled)) return ue;
1575
+ }
1576
+ return -1;
1577
+ }, L = () => {
1578
+ if (!T) return;
1579
+ const S = e.findIndex((A) => A.value === t && !A.disabled);
1580
+ g(S >= 0 ? S : k(0, 1)), u(!0);
1581
+ };
1582
+ q(() => {
1583
+ if (!p) return;
1584
+ const S = (F) => {
1585
+ var ue, Te;
1586
+ const Y = F.target;
1587
+ !((ue = m.current) != null && ue.contains(Y)) && !((Te = f.current) != null && Te.contains(Y)) && u(!1);
1588
+ }, A = (F) => {
1589
+ F.key === "Escape" && u(!1);
1590
+ };
1591
+ return document.addEventListener("mousedown", S, !0), document.addEventListener("keydown", A), () => {
1592
+ document.removeEventListener("mousedown", S, !0), document.removeEventListener("keydown", A);
1593
+ };
1594
+ }, [p]), Ye(() => {
1595
+ if (!p || !d) return;
1596
+ const S = () => {
1597
+ var E;
1598
+ const A = (E = m.current) == null ? void 0 : E.getBoundingClientRect();
1599
+ if (!A) return;
1600
+ const F = 8, Y = Math.max(220, A.width), ue = l === "end" ? A.right - Y : A.left, Te = Math.max(F, Math.min(ue, window.innerWidth - Y - F)), I = window.innerHeight - A.bottom - F - 6, R = I < 160 && A.top > I;
1601
+ w({
1602
+ position: "fixed",
1603
+ left: Te,
1604
+ top: R ? void 0 : A.bottom + 6,
1605
+ bottom: R ? window.innerHeight - A.top + 6 : void 0,
1606
+ width: Y,
1607
+ maxHeight: Math.max(96, Math.min(256, R ? A.top - 14 : I))
1608
+ });
1609
+ };
1610
+ return S(), window.addEventListener("resize", S), window.addEventListener("scroll", S, !0), () => {
1611
+ window.removeEventListener("resize", S), window.removeEventListener("scroll", S, !0);
1612
+ };
1613
+ }, [l, p, d]), q(() => {
1614
+ i && u(!1);
1615
+ }, [i]), q(() => {
1616
+ if (!p || y < 0) return;
1617
+ const S = f.current, A = S == null ? void 0 : S.children.item(y);
1618
+ if (!S || !A) return;
1619
+ const F = A.offsetTop, Y = F + A.offsetHeight;
1620
+ F < S.scrollTop ? S.scrollTop = F : Y > S.scrollTop + S.clientHeight && (S.scrollTop = Y - S.clientHeight);
1621
+ }, [y, x, p]);
1622
+ const O = (S) => {
1623
+ const A = e[S];
1624
+ !A || A.disabled || (n(A.value), u(!1));
1625
+ }, N = (S) => {
1626
+ g((A) => k(A < 0 ? S === 1 ? -1 : 0 : A + S, S));
1627
+ }, M = (S) => {
1628
+ if (T) {
1629
+ if (!p) {
1630
+ (S.key === "ArrowDown" || S.key === "ArrowUp" || S.key === "Enter" || S.key === " ") && (S.preventDefault(), L());
1631
+ return;
1632
+ }
1633
+ D(S);
1634
+ }
1635
+ }, D = (S) => {
1636
+ switch (S.key) {
1637
+ case "ArrowDown":
1638
+ S.preventDefault(), N(1);
1639
+ break;
1640
+ case "ArrowUp":
1641
+ S.preventDefault(), N(-1);
1642
+ break;
1643
+ case "Home":
1644
+ S.preventDefault(), g(k(0, 1));
1645
+ break;
1646
+ case "End":
1647
+ S.preventDefault(), g(k(e.length - 1, -1));
1648
+ break;
1649
+ case "Enter":
1650
+ case " ":
1651
+ S.preventDefault(), y >= 0 && O(y);
1652
+ break;
1653
+ }
1654
+ }, P = p && y >= 0 ? `${x}-opt-${y}` : void 0, z = /* @__PURE__ */ r(Ze, { children: p && /* @__PURE__ */ r(
1655
+ Me.div,
1656
+ {
1657
+ ref: f,
1658
+ id: x,
1659
+ initial: { opacity: 0, y: -4, scale: 0.98 },
1660
+ animate: { opacity: 1, y: 0, scale: 1 },
1661
+ exit: { opacity: 0, y: -4, scale: 0.98 },
1662
+ transition: xe.fade,
1663
+ style: d ? b : void 0,
1664
+ className: v(
1665
+ "z-[100] max-h-64 w-full min-w-[220px] overflow-y-auto rounded-panel border border-border bg-surface-raised p-1 shadow-pop",
1666
+ d ? "fixed" : "absolute top-[calc(100%+6px)]",
1667
+ !d && (l === "end" ? "right-0" : "left-0")
1668
+ ),
1669
+ role: "listbox",
1670
+ "aria-label": a,
1671
+ children: e.map((S, A) => {
1672
+ const F = S.value === t, Y = A === y;
1673
+ return /* @__PURE__ */ h(
1674
+ "button",
1675
+ {
1676
+ id: `${x}-opt-${A}`,
1677
+ type: "button",
1678
+ role: "option",
1679
+ "aria-selected": F,
1680
+ disabled: S.disabled,
1681
+ tabIndex: -1,
1682
+ onMouseEnter: () => !S.disabled && g(A),
1683
+ onClick: () => {
1684
+ S.disabled || O(A);
1685
+ },
1686
+ className: v(
1687
+ "flex min-h-row-default w-full min-w-0 items-center gap-2 rounded-control px-2.5 py-1.5 text-left font-sohne text-body-sm transition-colors disabled:cursor-not-allowed disabled:opacity-45",
1688
+ F ? "bg-surface-muted font-[500] text-ink" : "text-graphite hover:bg-surface-hover hover:text-ink",
1689
+ Y && !F && "bg-surface-hover text-ink"
1690
+ ),
1691
+ children: [
1692
+ S.leading,
1693
+ /* @__PURE__ */ h("span", { className: "min-w-0 flex-1", children: [
1694
+ /* @__PURE__ */ r("span", { className: "block truncate", children: S.label }),
1695
+ S.meta && /* @__PURE__ */ r("span", { className: "mt-0.5 block truncate text-caption font-[450] text-graphite", children: S.meta })
1696
+ ] }),
1697
+ F && /* @__PURE__ */ r(ve, { size: 14, className: "shrink-0 text-ink" })
1698
+ ]
1699
+ },
1700
+ S.value
1701
+ );
1702
+ })
1703
+ }
1704
+ ) });
1705
+ return /* @__PURE__ */ h("div", { ref: m, className: v("relative min-w-0", c), children: [
1706
+ /* @__PURE__ */ h(
1707
+ "button",
1708
+ {
1709
+ type: "button",
1710
+ "aria-label": a,
1711
+ "aria-haspopup": "listbox",
1712
+ "aria-expanded": p,
1713
+ "aria-controls": p ? x : void 0,
1714
+ "aria-activedescendant": P,
1715
+ disabled: !T,
1716
+ "data-density": s,
1717
+ onClick: () => p ? u(!1) : L(),
1718
+ onKeyDown: M,
1719
+ className: v(
1720
+ "flex w-full min-w-0 items-center gap-2 rounded-control border border-border bg-pure-white font-sohne font-[500] leading-none text-ink outline-none transition hover:border-graphite hover:bg-surface-hover disabled:cursor-not-allowed disabled:text-graphite focus-visible:ring-2 focus-visible:ring-rust/35",
1721
+ s === "compact" ? "h-control-compact px-2 text-caption" : "h-control-default px-3 text-body-sm"
1722
+ ),
1723
+ children: [
1724
+ C == null ? void 0 : C.leading,
1725
+ /* @__PURE__ */ r("span", { className: "min-w-0 flex-1 truncate text-left", children: (C == null ? void 0 : C.label) ?? o }),
1726
+ /* @__PURE__ */ r(
1727
+ Ve,
1728
+ {
1729
+ size: 12,
1730
+ className: v("shrink-0 text-ink transition-transform", p && "rotate-180")
1731
+ }
1732
+ )
1733
+ ]
1734
+ }
1735
+ ),
1736
+ d && typeof document < "u" ? ze(z, document.body) : z
1737
+ ] });
1738
+ }
1739
+ function we({
1740
+ value: t,
1741
+ options: e,
1742
+ onChange: n,
1743
+ ariaLabel: a,
1744
+ density: o = "default",
1745
+ semantics: i = "selection",
1746
+ className: s
1747
+ }) {
1748
+ const l = o === "compact" ? "min-h-control-compact py-1 text-caption" : o === "touch" ? "min-h-control-touch py-1.5 text-body" : "min-h-control-default py-1 text-body-sm";
1749
+ return /* @__PURE__ */ r(
1750
+ "div",
1751
+ {
1752
+ role: i === "tabs" ? "tablist" : "group",
1753
+ "aria-label": a,
1754
+ "data-density": o,
1755
+ className: v("inline-flex min-w-0 items-center rounded-selection bg-surface-muted p-0.5", s),
1756
+ children: e.map((d) => {
1757
+ const c = d.value === t;
1758
+ return /* @__PURE__ */ r(
1759
+ "button",
1760
+ {
1761
+ type: "button",
1762
+ role: i === "tabs" ? "tab" : void 0,
1763
+ "aria-selected": i === "tabs" ? c : void 0,
1764
+ "aria-pressed": i === "selection" ? c : void 0,
1765
+ disabled: d.disabled,
1766
+ onClick: () => n(d.value),
1767
+ className: v(
1768
+ "min-w-0 flex-1 rounded-control px-3 font-sohne font-[500] outline-none transition-[background-color,color,box-shadow,transform] duration-150 active:scale-[0.98] focus-visible:ring-2 focus-visible:ring-rust/35 disabled:pointer-events-none disabled:opacity-45",
1769
+ l,
1770
+ c ? "bg-surface-raised text-ink shadow-subtle" : "text-graphite hover:text-ink"
1771
+ ),
1772
+ children: /* @__PURE__ */ r("span", { className: "flex min-w-0 items-center justify-center whitespace-normal break-words text-center", children: d.label })
1773
+ },
1774
+ d.value
1775
+ );
1776
+ })
1777
+ }
1778
+ );
1779
+ }
1780
+ function st({
1781
+ value: t,
1782
+ min: e = 0,
1783
+ max: n = 100,
1784
+ step: a = 1,
1785
+ density: o = "default",
1786
+ onChange: i,
1787
+ onCommit: s,
1788
+ disabled: l = !1,
1789
+ ariaLabel: d,
1790
+ formatValue: c,
1791
+ marks: p = [],
1792
+ variant: u = "plain",
1793
+ className: y,
1794
+ testId: g
1795
+ }) {
1796
+ const m = U(null), [f, b] = j(!1), w = Se(
1797
+ (k) => {
1798
+ const L = Math.round((k - e) / a) * a + e, O = (a.toString().split(".")[1] ?? "").length;
1799
+ return parseFloat(Math.min(n, Math.max(e, L)).toFixed(O));
1800
+ },
1801
+ [e, n, a]
1802
+ ), x = u === "boxed" ? 8 : u === "allocation" ? 2 : 0, C = Se(
1803
+ (k) => {
1804
+ const L = m.current;
1805
+ if (!L) return t;
1806
+ const { left: O, width: N } = L.getBoundingClientRect(), M = Math.max(1, N - x * 2), D = Math.min(1, Math.max(0, (k - O - x) / M));
1807
+ return w(e + (n - e) * D);
1808
+ },
1809
+ [x, e, n, w, t]
1810
+ ), T = Math.min(100, Math.max(0, (t - e) / (n - e) * 100));
1811
+ return /* @__PURE__ */ r(
1812
+ "div",
1813
+ {
1814
+ ref: m,
1815
+ role: "slider",
1816
+ "aria-disabled": l || void 0,
1817
+ "aria-valuemin": e,
1818
+ "aria-valuemax": n,
1819
+ "aria-valuenow": t,
1820
+ "aria-valuetext": c == null ? void 0 : c(t),
1821
+ "aria-label": d,
1822
+ "data-density": o,
1823
+ "data-variant": u,
1824
+ tabIndex: l ? -1 : 0,
1825
+ "data-testid": g,
1826
+ onPointerDown: (k) => {
1827
+ l || (k.currentTarget.setPointerCapture(k.pointerId), b(!0), i(C(k.clientX)));
1828
+ },
1829
+ onPointerMove: (k) => {
1830
+ l || !f || i(C(k.clientX));
1831
+ },
1832
+ onPointerUp: (k) => {
1833
+ k.currentTarget.hasPointerCapture(k.pointerId) && k.currentTarget.releasePointerCapture(k.pointerId), !(!f || l) && (b(!1), s == null || s(C(k.clientX)));
1834
+ },
1835
+ onPointerCancel: () => b(!1),
1836
+ onKeyDown: (k) => {
1837
+ l || ((k.key === "ArrowLeft" || k.key === "ArrowDown") && i(w(t - a)), (k.key === "ArrowRight" || k.key === "ArrowUp") && i(w(t + a)), k.key === "Home" && i(e), k.key === "End" && i(n), k.key === "PageDown" && i(w(t - a * 10)), k.key === "PageUp" && i(w(t + a * 10)));
1838
+ },
1839
+ onKeyUp: (k) => {
1840
+ !l && ["ArrowLeft", "ArrowDown", "ArrowRight", "ArrowUp", "Home", "End", "PageDown", "PageUp"].includes(k.key) && (s == null || s(t));
1841
+ },
1842
+ onBlur: () => {
1843
+ l || s == null || s(t);
1844
+ },
1845
+ className: v(
1846
+ "group relative w-full shrink-0 touch-none cursor-pointer select-none outline-none focus-visible:ring-2 focus-visible:ring-rust/35 focus-visible:ring-offset-2 focus-visible:ring-offset-surface-canvas",
1847
+ l && "cursor-not-allowed opacity-50",
1848
+ u === "boxed" || u === "allocation" ? "h-control-default overflow-hidden rounded-control border border-border bg-surface-raised" : o === "compact" ? "h-6" : "h-control-touch",
1849
+ y
1850
+ ),
1851
+ children: /* @__PURE__ */ h("div", { className: "absolute inset-y-0", style: { left: x, right: x }, children: [
1852
+ u === "allocation" ? /* @__PURE__ */ h(fe, { children: [
1853
+ /* @__PURE__ */ r("div", { "data-slot": "allocation-track", className: "absolute inset-y-0 w-full bg-surface-raised" }),
1854
+ /* @__PURE__ */ r(
1855
+ "div",
1856
+ {
1857
+ "data-slot": "allocation-fill",
1858
+ "data-risk": T >= 75 ? "high" : T >= 50 ? "medium" : "low",
1859
+ className: "absolute inset-y-0 left-0 bg-rust/30",
1860
+ style: { width: `${T}%` }
1861
+ }
1862
+ )
1863
+ ] }) : /* @__PURE__ */ r("div", { "data-slot": "slider-track", className: "absolute top-1/2 h-slider-track w-full -translate-y-1/2 rounded-full bg-dove/40" }),
1864
+ p.map((k) => {
1865
+ const L = Math.min(100, Math.max(0, (k - e) / (n - e) * 100));
1866
+ return /* @__PURE__ */ r("span", { "data-slider-mark": !0, "aria-hidden": !0, className: v("pointer-events-none absolute top-1/2 -translate-x-1/2 -translate-y-1/2", u === "allocation" ? "h-3 w-px rounded-full bg-graphite/70 shadow-[0_0_0_1px_var(--color-surface-canvas)]" : "size-1 rounded-full bg-graphite/70 ring-1 ring-surface-canvas"), style: { left: `${L}%` } }, k);
1867
+ }),
1868
+ u !== "allocation" && /* @__PURE__ */ r("div", { "data-slot": "slider-range", className: "absolute top-1/2 h-slider-track -translate-y-1/2 rounded-full bg-rust", style: { width: `${T}%` } }),
1869
+ u === "allocation" ? /* @__PURE__ */ r(
1870
+ "div",
1871
+ {
1872
+ "data-slot": "allocation-thumb",
1873
+ className: v("absolute top-1/2 z-10 h-6 w-1 -translate-x-1/2 -translate-y-1/2 rounded-full border border-on-accent/70 bg-rust shadow-subtle transition-transform", f && "scale-y-110"),
1874
+ style: { left: `${T}%` }
1875
+ }
1876
+ ) : /* @__PURE__ */ r("div", { "data-slot": "slider-thumb", className: ["absolute top-1/2 z-10 -translate-x-1/2 -translate-y-1/2 rounded-full bg-rust ring-2 ring-pure-white shadow-subtle transition-transform", o === "compact" ? "size-slider-thumb-compact" : "size-slider-thumb-default", f ? "scale-110" : "group-hover:scale-110 group-focus:scale-110"].join(" "), style: { left: `${T}%` } })
1877
+ ] })
1878
+ }
1879
+ );
1880
+ }
1881
+ function Ta(t) {
1882
+ return /* @__PURE__ */ r(st, { ...t, density: "compact", variant: "allocation" });
1883
+ }
1884
+ function Da({
1885
+ value: t,
1886
+ min: e = 0,
1887
+ max: n = 100,
1888
+ step: a = 1,
1889
+ density: o = "default",
1890
+ onChange: i,
1891
+ onCommit: s,
1892
+ lowerLabel: l,
1893
+ upperLabel: d,
1894
+ formatValue: c
1895
+ }) {
1896
+ return /* @__PURE__ */ h(
1897
+ $e.Root,
1898
+ {
1899
+ value: t,
1900
+ min: e,
1901
+ max: n,
1902
+ step: a,
1903
+ minStepsBetweenThumbs: 1,
1904
+ "data-density": o,
1905
+ "data-focus-shell": !0,
1906
+ onValueChange: (p) => i([p[0], p[1]]),
1907
+ onValueCommit: (p) => s == null ? void 0 : s([p[0], p[1]]),
1908
+ className: `relative flex w-full touch-none select-none items-center outline-none has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-rust/35 ${o === "compact" ? "h-6" : "h-control-touch"}`,
1909
+ children: [
1910
+ /* @__PURE__ */ r($e.Track, { "data-slot": "slider-track", className: "relative h-slider-track w-full grow overflow-hidden rounded-full bg-dove/40", children: /* @__PURE__ */ r($e.Range, { "data-slot": "slider-range", className: "absolute h-full bg-rust" }) }),
1911
+ /* @__PURE__ */ r(
1912
+ $e.Thumb,
1913
+ {
1914
+ "data-slot": "slider-thumb-lower",
1915
+ "aria-label": l,
1916
+ "aria-valuetext": c == null ? void 0 : c(t[0]),
1917
+ className: `block rounded-full bg-rust ring-2 ring-pure-white shadow-subtle outline-none focus-visible:ring-rust ${o === "compact" ? "size-slider-thumb-compact" : "size-slider-thumb-default"}`
1918
+ }
1919
+ ),
1920
+ /* @__PURE__ */ r(
1921
+ $e.Thumb,
1922
+ {
1923
+ "data-slot": "slider-thumb-upper",
1924
+ "aria-label": d,
1925
+ "aria-valuetext": c == null ? void 0 : c(t[1]),
1926
+ className: `block rounded-full bg-rust ring-2 ring-pure-white shadow-subtle outline-none focus-visible:ring-rust ${o === "compact" ? "size-slider-thumb-compact" : "size-slider-thumb-default"}`
1927
+ }
1928
+ )
1929
+ ]
1930
+ }
1931
+ );
1932
+ }
1933
+ function Ia({
1934
+ value: t,
1935
+ options: e,
1936
+ onValueChange: n,
1937
+ label: a,
1938
+ valueLabel: o
1939
+ }) {
1940
+ const i = Q(), s = e.filter((l) => t.includes(l.value));
1941
+ return /* @__PURE__ */ h(ne.Root, { children: [
1942
+ /* @__PURE__ */ r(ne.Trigger, { asChild: !0, children: /* @__PURE__ */ h(de, { variant: "secondary", "aria-label": a, className: "max-w-full", children: [
1943
+ /* @__PURE__ */ r("span", { className: "truncate", children: o(s) }),
1944
+ /* @__PURE__ */ r(Ve, { size: 14, className: "shrink-0", "aria-hidden": !0 })
1945
+ ] }) }),
1946
+ /* @__PURE__ */ r(ne.Portal, { children: /* @__PURE__ */ h(
1947
+ ne.Content,
1948
+ {
1949
+ "aria-labelledby": i,
1950
+ sideOffset: 4,
1951
+ collisionPadding: 8,
1952
+ className: "z-50 min-w-48 rounded-panel border border-border bg-surface-raised p-1 font-product text-body-sm text-ink shadow-pop outline-none",
1953
+ children: [
1954
+ /* @__PURE__ */ r("span", { id: i, className: "sr-only", children: a }),
1955
+ e.map((l) => {
1956
+ const d = t.includes(l.value);
1957
+ return /* @__PURE__ */ h(
1958
+ ne.CheckboxItem,
1959
+ {
1960
+ checked: d,
1961
+ disabled: l.disabled,
1962
+ onCheckedChange: (c) => n(c ? [...t, l.value] : t.filter((p) => p !== l.value)),
1963
+ onSelect: (c) => c.preventDefault(),
1964
+ className: "group flex min-h-row-default cursor-default select-none items-center gap-2 rounded-control px-3 outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-surface-hover",
1965
+ children: [
1966
+ /* @__PURE__ */ r("span", { className: "inline-flex size-4 shrink-0 items-center justify-center rounded-indicator border border-border group-data-[state=checked]:border-rust group-data-[state=checked]:bg-rust group-data-[state=checked]:text-on-accent", children: /* @__PURE__ */ r(ne.ItemIndicator, { children: /* @__PURE__ */ r(ve, { size: 12, strokeWidth: 3, "aria-hidden": !0 }) }) }),
1967
+ /* @__PURE__ */ r("span", { className: "min-w-0 flex-1 truncate", children: l.label }),
1968
+ l.meta
1969
+ ]
1970
+ },
1971
+ l.value
1972
+ );
1973
+ })
1974
+ ]
1975
+ }
1976
+ ) })
1977
+ ] });
1978
+ }
1979
+ function Ra({ label: t, checked: e, onCheckedChange: n, disabled: a = !1, className: o }) {
1980
+ return /* @__PURE__ */ h("label", { className: v("inline-flex min-h-control-default items-center gap-2 font-sohne text-body-sm text-ink", o), children: [
1981
+ /* @__PURE__ */ r(
1982
+ bt.Root,
1983
+ {
1984
+ checked: e,
1985
+ onCheckedChange: (i) => n(i === !0),
1986
+ disabled: a,
1987
+ className: "inline-flex size-4 shrink-0 items-center justify-center rounded-indicator border border-border bg-surface-raised text-on-accent outline-none transition-colors hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-rust disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-rust data-[state=checked]:bg-rust",
1988
+ children: /* @__PURE__ */ r(bt.Indicator, { children: /* @__PURE__ */ r(ve, { size: 12, strokeWidth: 3, "aria-hidden": !0 }) })
1989
+ }
1990
+ ),
1991
+ /* @__PURE__ */ r("span", { children: t })
1992
+ ] });
1993
+ }
1994
+ function vn({
1995
+ label: t,
1996
+ checked: e,
1997
+ onCheckedChange: n,
1998
+ disabled: a = !1,
1999
+ labelPosition: o = "end",
2000
+ hideLabel: i = !1,
2001
+ className: s,
2002
+ labelClassName: l
2003
+ }) {
2004
+ const d = /* @__PURE__ */ r("span", { className: v(i && "sr-only", l), children: t });
2005
+ return /* @__PURE__ */ h("label", { className: v("inline-flex min-h-control-default items-center gap-2 font-sohne text-body-sm text-ink", s), children: [
2006
+ o === "start" && d,
2007
+ /* @__PURE__ */ r(
2008
+ gt.Root,
2009
+ {
2010
+ checked: e,
2011
+ onCheckedChange: n,
2012
+ disabled: a,
2013
+ className: "relative h-5 w-9 shrink-0 rounded-full border border-border bg-surface-hover outline-none transition-colors focus-visible:ring-2 focus-visible:ring-rust disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-rust",
2014
+ children: /* @__PURE__ */ r(gt.Thumb, { className: "block size-4 translate-x-0.5 rounded-full bg-surface-raised shadow-subtle transition-transform data-[state=checked]:translate-x-4" })
2015
+ }
2016
+ ),
2017
+ o === "end" && d
2018
+ ] });
2019
+ }
2020
+ function Pa({
2021
+ label: t,
2022
+ value: e,
2023
+ options: n,
2024
+ onValueChange: a,
2025
+ appearance: o = "control",
2026
+ className: i,
2027
+ optionClassName: s
2028
+ }) {
2029
+ return /* @__PURE__ */ r(
2030
+ _e.Root,
2031
+ {
2032
+ "aria-label": t,
2033
+ value: e,
2034
+ onValueChange: (l) => a(l),
2035
+ className: v(o === "card" ? "grid min-w-0 gap-2" : "flex min-w-0 flex-wrap items-center gap-3", i),
2036
+ children: n.map((l) => o === "card" ? /* @__PURE__ */ r(
2037
+ _e.Item,
2038
+ {
2039
+ value: l.value,
2040
+ disabled: l.disabled,
2041
+ className: v(
2042
+ "min-w-0 rounded-panel border border-border bg-surface-card p-2 text-left text-ink outline-none transition-colors hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-rust data-[state=checked]:border-rust data-[state=checked]:ring-1 data-[state=checked]:ring-rust",
2043
+ s
2044
+ ),
2045
+ children: l.label
2046
+ },
2047
+ l.value
2048
+ ) : /* @__PURE__ */ h("label", { className: "inline-flex min-h-control-default items-center gap-2 font-sohne text-body-sm text-ink", children: [
2049
+ /* @__PURE__ */ r(
2050
+ _e.Item,
2051
+ {
2052
+ value: l.value,
2053
+ disabled: l.disabled,
2054
+ onFocus: () => {
2055
+ l.value !== e && a(l.value);
2056
+ },
2057
+ className: "inline-flex size-4 shrink-0 items-center justify-center rounded-full border border-border bg-surface-raised outline-none transition-colors hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-rust disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-rust",
2058
+ children: /* @__PURE__ */ r(_e.Indicator, { className: "size-2 rounded-full bg-rust" })
2059
+ }
2060
+ ),
2061
+ /* @__PURE__ */ r("span", { children: l.label })
2062
+ ] }, l.value))
2063
+ }
2064
+ );
2065
+ }
2066
+ function La({ label: t, value: e, options: n, onValueChange: a }) {
2067
+ return /* @__PURE__ */ r(
2068
+ xt.Root,
2069
+ {
2070
+ type: "multiple",
2071
+ "aria-label": t,
2072
+ value: e,
2073
+ onValueChange: (o) => a(o),
2074
+ className: "inline-flex items-center gap-1 rounded-panel border border-border bg-surface-fog p-1",
2075
+ children: n.map((o) => /* @__PURE__ */ r(
2076
+ xt.Item,
2077
+ {
2078
+ value: o.value,
2079
+ "aria-label": o.label,
2080
+ className: "inline-flex size-control-compact items-center justify-center rounded-control text-graphite outline-none transition-colors hover:bg-surface-hover hover:text-ink focus-visible:ring-2 focus-visible:ring-rust data-[state=on]:bg-surface-raised data-[state=on]:text-ink",
2081
+ children: o.label
2082
+ },
2083
+ o.value
2084
+ ))
2085
+ }
2086
+ );
2087
+ }
2088
+ function Aa({ label: t, children: e, className: n = "", variant: a = "framed", density: o = "default" }) {
2089
+ return /* @__PURE__ */ r(
2090
+ Be.Root,
2091
+ {
2092
+ "aria-label": t,
2093
+ "data-variant": a,
2094
+ "data-density": o,
2095
+ className: `inline-flex items-center gap-1 ${o === "compact" ? "h-control-compact" : "h-control-default"} ${a === "framed" ? "rounded-panel border border-border bg-surface-fog p-1" : "bg-transparent"} ${n}`,
2096
+ loop: !0,
2097
+ children: e
2098
+ }
2099
+ );
2100
+ }
2101
+ function $a(t) {
2102
+ return /* @__PURE__ */ r(
2103
+ Be.Button,
2104
+ {
2105
+ ...t,
2106
+ className: `inline-flex size-control-compact items-center justify-center rounded-control text-graphite outline-none transition-colors hover:bg-surface-hover hover:text-ink focus-visible:ring-2 focus-visible:ring-rust disabled:opacity-50 ${t.className ?? ""}`
2107
+ }
2108
+ );
2109
+ }
2110
+ function Ea({ children: t }) {
2111
+ return /* @__PURE__ */ r(Be.ToggleGroup, { type: "multiple", children: t });
2112
+ }
2113
+ function Oa(t) {
2114
+ return /* @__PURE__ */ r(
2115
+ Be.ToggleItem,
2116
+ {
2117
+ ...t,
2118
+ className: `inline-flex size-control-compact items-center justify-center rounded-control text-graphite outline-none transition-colors hover:bg-surface-hover hover:text-ink focus-visible:ring-2 focus-visible:ring-rust data-[state=on]:bg-surface-raised data-[state=on]:text-ink ${t.className ?? ""}`
2119
+ }
2120
+ );
2121
+ }
2122
+ function Ha(t) {
2123
+ return /* @__PURE__ */ r(Be.Separator, { ...t, className: `mx-1 h-4 w-px bg-divider ${t.className ?? ""}` });
2124
+ }
2125
+ function Ua({ label: t, className: e, children: n, ...a }) {
2126
+ return /* @__PURE__ */ r("div", { role: "listbox", "aria-label": t, className: v("min-w-0", e), ...a, children: n });
2127
+ }
2128
+ function ja({
2129
+ selected: t,
2130
+ disabled: e = !1,
2131
+ asChild: n = !1,
2132
+ className: a,
2133
+ children: o,
2134
+ ...i
2135
+ }) {
2136
+ const s = n ? Pe.Root : "div";
2137
+ return /* @__PURE__ */ r(
2138
+ s,
2139
+ {
2140
+ role: "option",
2141
+ "aria-selected": t,
2142
+ "aria-disabled": e || void 0,
2143
+ "data-selected": t ? "true" : "false",
2144
+ "data-disabled": e ? "true" : void 0,
2145
+ className: a,
2146
+ ...i,
2147
+ children: o
2148
+ }
2149
+ );
2150
+ }
2151
+ function Ba({
2152
+ value: t,
2153
+ title: e,
2154
+ children: n
2155
+ }) {
2156
+ return /* @__PURE__ */ r(Ee.Root, { type: "single", collapsible: !0, className: "overflow-hidden rounded-panel border border-border bg-surface-fog", children: /* @__PURE__ */ h(Ee.Item, { value: t, children: [
2157
+ /* @__PURE__ */ r(Ee.Header, { children: /* @__PURE__ */ h(Ee.Trigger, { className: "group flex h-row-default w-full items-center justify-between gap-3 px-3 font-sohne text-body-sm font-[500] text-ink outline-none transition-colors hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-rust", children: [
2158
+ /* @__PURE__ */ r("span", { children: e }),
2159
+ /* @__PURE__ */ r(Ve, { size: 14, className: "shrink-0 text-graphite transition-transform group-data-[state=open]:rotate-180", "aria-hidden": !0 })
2160
+ ] }) }),
2161
+ /* @__PURE__ */ r(Ee.Content, { className: "border-t border-divider px-3 py-2 font-sohne text-caption text-graphite", children: n })
2162
+ ] }) });
2163
+ }
2164
+ function Ka({ title: t, children: e }) {
2165
+ return /* @__PURE__ */ h(tt.Root, { className: "overflow-hidden rounded-panel border border-border bg-surface-fog", children: [
2166
+ /* @__PURE__ */ h(tt.Trigger, { className: "group flex h-row-default w-full items-center justify-between gap-3 px-3 font-sohne text-body-sm font-[500] text-ink outline-none transition-colors hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-rust", children: [
2167
+ /* @__PURE__ */ r("span", { children: t }),
2168
+ /* @__PURE__ */ r(Ve, { size: 14, className: "shrink-0 text-graphite transition-transform group-data-[state=open]:rotate-180", "aria-hidden": !0 })
2169
+ ] }),
2170
+ /* @__PURE__ */ r(tt.Content, { className: "border-t border-divider px-3 py-2 font-sohne text-caption text-graphite", children: e })
2171
+ ] });
2172
+ }
2173
+ function _a({ value: t, label: e }) {
2174
+ const n = Math.min(100, Math.max(0, t));
2175
+ return /* @__PURE__ */ r(
2176
+ vt.Root,
2177
+ {
2178
+ value: n,
2179
+ "aria-label": e,
2180
+ className: "relative h-1 w-full overflow-hidden rounded-full bg-surface-hover",
2181
+ children: /* @__PURE__ */ r(
2182
+ vt.Indicator,
2183
+ {
2184
+ className: "h-full w-full origin-left bg-rust transition-transform",
2185
+ style: { transform: `translateX(-${100 - n}%)` }
2186
+ }
2187
+ )
2188
+ }
2189
+ );
2190
+ }
2191
+ function Fa({
2192
+ value: t,
2193
+ options: e,
2194
+ onValueChange: n,
2195
+ label: a,
2196
+ resultsLabel: o,
2197
+ placeholder: i,
2198
+ emptyText: s,
2199
+ disabled: l = !1,
2200
+ className: d
2201
+ }) {
2202
+ const c = U(null), p = Q(), u = e.find((N) => N.value === t), [y, g] = j((u == null ? void 0 : u.label) ?? ""), [m, f] = j(!1), [b, w] = j(0);
2203
+ q(() => {
2204
+ m || g((u == null ? void 0 : u.label) ?? "");
2205
+ }, [m, u == null ? void 0 : u.label]);
2206
+ const x = ce(() => {
2207
+ const N = y.trim().toLocaleLowerCase();
2208
+ return !N || N === (u == null ? void 0 : u.label.toLocaleLowerCase()) ? [...e] : e.filter(
2209
+ (M) => `${M.label} ${M.meta ?? ""}`.toLocaleLowerCase().includes(N)
2210
+ );
2211
+ }, [e, y, u == null ? void 0 : u.label]), C = (N, M) => {
2212
+ var D;
2213
+ for (let P = 0; P < x.length; P += 1) {
2214
+ const z = (N + P * M + x.length) % x.length;
2215
+ if (!((D = x[z]) != null && D.disabled)) return z;
2216
+ }
2217
+ return -1;
2218
+ }, T = (N) => {
2219
+ const M = x[N];
2220
+ !M || M.disabled || (n(M.value), g(M.label), f(!1), requestAnimationFrame(() => {
2221
+ var D;
2222
+ return (D = c.current) == null ? void 0 : D.focus();
2223
+ }));
2224
+ }, k = (N) => {
2225
+ w((M) => {
2226
+ const D = x.length ? (M + N + x.length) % x.length : 0;
2227
+ return C(D, N);
2228
+ });
2229
+ }, L = (N) => {
2230
+ l || (N.key === "ArrowDown" || N.key === "ArrowUp" ? (N.preventDefault(), m ? k(N.key === "ArrowDown" ? 1 : -1) : (f(!0), w(C(N.key === "ArrowDown" ? 0 : x.length - 1, N.key === "ArrowDown" ? 1 : -1)))) : N.key === "Enter" && m ? (N.preventDefault(), T(b)) : N.key === "Escape" && m ? (N.preventDefault(), f(!1), g((u == null ? void 0 : u.label) ?? "")) : N.key === "Home" && m ? (N.preventDefault(), w(C(0, 1))) : N.key === "End" && m && (N.preventDefault(), w(C(x.length - 1, -1))));
2231
+ }, O = m && b >= 0 ? `${p}-option-${b}` : void 0;
2232
+ return /* @__PURE__ */ h(ae.Root, { open: m, onOpenChange: f, children: [
2233
+ /* @__PURE__ */ r(ae.Trigger, { asChild: !0, children: /* @__PURE__ */ h("div", { className: v("relative min-w-0", d), children: [
2234
+ /* @__PURE__ */ r(ut, { size: 14, className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-graphite", "aria-hidden": !0 }),
2235
+ /* @__PURE__ */ r(
2236
+ "input",
2237
+ {
2238
+ ref: c,
2239
+ role: "combobox",
2240
+ "aria-label": a,
2241
+ "aria-controls": p,
2242
+ "aria-expanded": m,
2243
+ "aria-autocomplete": "list",
2244
+ "aria-activedescendant": O,
2245
+ autoComplete: "off",
2246
+ disabled: l,
2247
+ placeholder: i,
2248
+ value: y,
2249
+ onFocus: () => {
2250
+ l || f(!0);
2251
+ },
2252
+ onChange: (N) => {
2253
+ g(N.target.value), w(0), f(!0);
2254
+ },
2255
+ onKeyDown: L,
2256
+ className: "h-control-default w-full rounded-control border border-border bg-surface-raised pl-9 pr-3 font-product text-body-sm text-ink outline-none placeholder:text-graphite focus:border-rust focus-visible:ring-2 focus-visible:ring-rust/20 disabled:cursor-not-allowed disabled:opacity-50"
2257
+ }
2258
+ )
2259
+ ] }) }),
2260
+ /* @__PURE__ */ r(ae.Portal, { children: /* @__PURE__ */ h(
2261
+ ae.Content,
2262
+ {
2263
+ role: "listbox",
2264
+ id: p,
2265
+ "aria-label": o,
2266
+ sideOffset: 4,
2267
+ align: "start",
2268
+ collisionPadding: 8,
2269
+ onOpenAutoFocus: (N) => {
2270
+ var M;
2271
+ N.preventDefault(), (M = c.current) == null || M.focus();
2272
+ },
2273
+ onCloseAutoFocus: (N) => {
2274
+ var M;
2275
+ N.preventDefault(), (M = c.current) == null || M.focus();
2276
+ },
2277
+ className: "af-popup-bound z-50 max-h-command-results w-overlay-sm overflow-y-auto rounded-panel border border-border bg-surface-raised p-1 font-product text-body-sm text-ink shadow-pop outline-none",
2278
+ children: [
2279
+ x.length === 0 && /* @__PURE__ */ r("div", { className: "px-3 py-2 text-caption text-graphite", children: s }),
2280
+ x.map((N, M) => {
2281
+ const D = M === b, P = N.value === t;
2282
+ return /* @__PURE__ */ h(
2283
+ "div",
2284
+ {
2285
+ id: `${p}-option-${M}`,
2286
+ role: "option",
2287
+ "aria-selected": P,
2288
+ "aria-disabled": N.disabled || void 0,
2289
+ "data-active": D || void 0,
2290
+ onPointerMove: () => {
2291
+ N.disabled || w(M);
2292
+ },
2293
+ onPointerDown: (z) => z.preventDefault(),
2294
+ onClick: () => T(M),
2295
+ className: "flex min-h-row-default cursor-default items-center gap-2 rounded-control px-3 outline-none data-[active]:bg-surface-hover aria-disabled:pointer-events-none aria-disabled:opacity-50",
2296
+ children: [
2297
+ /* @__PURE__ */ h("span", { className: "min-w-0 flex-1", children: [
2298
+ /* @__PURE__ */ r("span", { className: "block truncate", children: N.label }),
2299
+ N.meta && /* @__PURE__ */ r("span", { className: "block truncate text-caption text-graphite", children: N.meta })
2300
+ ] }),
2301
+ P && /* @__PURE__ */ r(ve, { size: 14, className: "shrink-0 text-rust", "aria-hidden": !0 })
2302
+ ]
2303
+ },
2304
+ N.value
2305
+ );
2306
+ })
2307
+ ]
2308
+ }
2309
+ ) })
2310
+ ] });
2311
+ }
2312
+ function Wa({
2313
+ label: t,
2314
+ columns: e,
2315
+ rows: n,
2316
+ rowKey: a,
2317
+ emptyText: o
2318
+ }) {
2319
+ const [i, s] = j(null), l = U(null), [d, c] = j(() => e.map(() => 100 / e.length)), p = ce(() => {
2320
+ if (!i) return [...n];
2321
+ const m = e.find((b) => b.id === i.id);
2322
+ if (!(m != null && m.sortValue)) return [...n];
2323
+ const f = i.direction === "ascending" ? 1 : -1;
2324
+ return [...n].sort((b, w) => {
2325
+ var T, k;
2326
+ const x = ((T = m.sortValue) == null ? void 0 : T.call(m, b)) ?? "", C = ((k = m.sortValue) == null ? void 0 : k.call(m, w)) ?? "";
2327
+ return (typeof x == "number" && typeof C == "number" ? x - C : String(x).localeCompare(String(C))) * f;
2328
+ });
2329
+ }, [e, n, i]), u = (m, f) => {
2330
+ m >= d.length - 1 || c((b) => {
2331
+ const w = [...b], x = b[m] + b[m + 1], C = Math.min(x - 10, Math.max(10, b[m] + f));
2332
+ return w[m] = C, w[m + 1] = x - C, w;
2333
+ });
2334
+ }, y = (m, f) => {
2335
+ m.key === "ArrowLeft" ? (m.preventDefault(), u(f, -5)) : m.key === "ArrowRight" && (m.preventDefault(), u(f, 5));
2336
+ }, g = (m, f) => {
2337
+ var O;
2338
+ if (m.button !== 0) return;
2339
+ m.preventDefault();
2340
+ const b = m.currentTarget, w = m.clientX, x = ((O = l.current) == null ? void 0 : O.getBoundingClientRect().width) ?? 1, C = d[f], T = d[f] + d[f + 1];
2341
+ b.setPointerCapture(m.pointerId);
2342
+ const k = (N) => {
2343
+ const M = Math.min(
2344
+ T - 10,
2345
+ Math.max(10, C + (N.clientX - w) / x * 100)
2346
+ );
2347
+ c((D) => {
2348
+ const P = [...D];
2349
+ return P[f] = M, P[f + 1] = T - M, P;
2350
+ });
2351
+ }, L = (N) => {
2352
+ b.hasPointerCapture(N.pointerId) && b.releasePointerCapture(N.pointerId), b.removeEventListener("pointermove", k), b.removeEventListener("pointerup", L), b.removeEventListener("pointercancel", L);
2353
+ };
2354
+ b.addEventListener("pointermove", k), b.addEventListener("pointerup", L), b.addEventListener("pointercancel", L);
2355
+ };
2356
+ return /* @__PURE__ */ r("div", { className: "min-w-0 overflow-x-auto rounded-panel border border-border", children: /* @__PURE__ */ h("table", { ref: l, "aria-label": t, className: "w-full min-w-xl border-collapse table-fixed", children: [
2357
+ /* @__PURE__ */ r("colgroup", { children: e.map((m, f) => /* @__PURE__ */ r("col", { style: { width: `${d[f]}%` } }, m.id)) }),
2358
+ /* @__PURE__ */ r("thead", { className: "bg-surface-muted font-product text-micro uppercase text-graphite", children: /* @__PURE__ */ r("tr", { className: "h-row-compact", children: e.map((m, f) => {
2359
+ const b = (i == null ? void 0 : i.id) === m.id ? i.direction : void 0;
2360
+ return /* @__PURE__ */ h(
2361
+ "th",
2362
+ {
2363
+ scope: "col",
2364
+ "aria-sort": b ?? (m.sortValue ? "none" : void 0),
2365
+ className: v("relative px-3 font-[500]", m.align === "right" ? "text-right" : "text-left"),
2366
+ children: [
2367
+ m.sortValue ? /* @__PURE__ */ h(
2368
+ "button",
2369
+ {
2370
+ type: "button",
2371
+ onClick: () => s((w) => ({
2372
+ id: m.id,
2373
+ direction: (w == null ? void 0 : w.id) === m.id && w.direction === "ascending" ? "descending" : "ascending"
2374
+ })),
2375
+ className: v(
2376
+ "inline-flex h-control-compact max-w-full items-center gap-1 rounded-control outline-none hover:text-ink focus-visible:ring-2 focus-visible:ring-rust",
2377
+ m.align === "right" && "ml-auto"
2378
+ ),
2379
+ children: [
2380
+ /* @__PURE__ */ r("span", { className: "truncate", children: m.header }),
2381
+ b === "ascending" ? /* @__PURE__ */ r(Nr, { size: 12, "aria-hidden": !0 }) : b === "descending" ? /* @__PURE__ */ r(Cr, { size: 12, "aria-hidden": !0 }) : /* @__PURE__ */ r(Sr, { size: 12, "aria-hidden": !0 })
2382
+ ]
2383
+ }
2384
+ ) : m.header,
2385
+ m.resizeLabel && f < e.length - 1 && /* @__PURE__ */ r(
2386
+ "span",
2387
+ {
2388
+ role: "separator",
2389
+ tabIndex: 0,
2390
+ "aria-label": m.resizeLabel,
2391
+ "aria-orientation": "vertical",
2392
+ "aria-valuemin": 10,
2393
+ "aria-valuemax": Math.round(d[f] + d[f + 1] - 10),
2394
+ "aria-valuenow": Math.round(d[f]),
2395
+ onKeyDown: (w) => y(w, f),
2396
+ onPointerDown: (w) => g(w, f),
2397
+ className: "absolute inset-y-0 right-0 z-10 w-1 cursor-col-resize touch-none bg-transparent outline-none hover:bg-rust focus-visible:bg-rust"
2398
+ }
2399
+ )
2400
+ ]
2401
+ },
2402
+ m.id
2403
+ );
2404
+ }) }) }),
2405
+ /* @__PURE__ */ h("tbody", { className: "font-data text-data tabular-nums text-ink", children: [
2406
+ p.map((m) => /* @__PURE__ */ r("tr", { className: "h-row-default border-t border-divider hover:bg-surface-hover", children: e.map((f) => /* @__PURE__ */ r(
2407
+ "td",
2408
+ {
2409
+ className: v("truncate px-3", f.align === "right" ? "text-right" : "text-left"),
2410
+ children: f.cell(m)
2411
+ },
2412
+ f.id
2413
+ )) }, a(m))),
2414
+ p.length === 0 && /* @__PURE__ */ r("tr", { className: "h-row-touch border-t border-divider", children: /* @__PURE__ */ r("td", { colSpan: e.length, className: "px-3 text-center font-product text-caption text-graphite", children: o }) })
2415
+ ] })
2416
+ ] }) });
2417
+ }
2418
+ const Ga = he(function({ className: e, ...n }, a) {
2419
+ return /* @__PURE__ */ r("table", { ref: a, className: v("w-full border-collapse font-product text-caption text-ink", e), ...n });
2420
+ }), qa = he(function({ className: e, ...n }, a) {
2421
+ return /* @__PURE__ */ r("thead", { ref: a, className: v("bg-surface-muted text-micro text-graphite", e), ...n });
2422
+ }), Xa = he(function({ className: e, ...n }, a) {
2423
+ return /* @__PURE__ */ r("tbody", { ref: a, className: v("[&_tr:last-child]:border-b-0", e), ...n });
2424
+ }), Ya = he(function({ className: e, ...n }, a) {
2425
+ return /* @__PURE__ */ r("tr", { ref: a, className: v("border-b border-divider transition-colors hover:bg-surface-hover", e), ...n });
2426
+ }), Va = he(function({ className: e, ...n }, a) {
2427
+ return /* @__PURE__ */ r("th", { ref: a, className: v("h-row-compact px-3 text-left align-middle font-[500]", e), ...n });
2428
+ }), Za = he(function({ className: e, ...n }, a) {
2429
+ return /* @__PURE__ */ r("td", { ref: a, className: v("h-row-default px-3 align-middle", e), ...n });
2430
+ });
2431
+ function Ja({ value: t, children: e, className: n, ...a }) {
2432
+ const o = U(t), i = U(0), [s, l] = j(null);
2433
+ return q(() => {
2434
+ const d = o.current;
2435
+ t != null && Number.isFinite(t) && d != null && Number.isFinite(d) && t !== d && l({ direction: t > d ? "up" : "down", sequence: ++i.current }), o.current = t;
2436
+ }, [t]), q(() => {
2437
+ if (!s) return;
2438
+ const d = window.setTimeout(() => l((c) => (c == null ? void 0 : c.sequence) === s.sequence ? null : c), 1200);
2439
+ return () => window.clearTimeout(d);
2440
+ }, [s]), /* @__PURE__ */ r("span", { "data-live-value": !0, className: v("inline-flex min-w-0", n), ...a, children: /* @__PURE__ */ r(
2441
+ "span",
2442
+ {
2443
+ "data-live-value-pulse": !0,
2444
+ "data-direction": s == null ? void 0 : s.direction,
2445
+ className: v("rounded-control px-0.5", s && (s.direction === "up" ? "af-live-value-up" : "af-live-value-down")),
2446
+ children: e
2447
+ },
2448
+ (s == null ? void 0 : s.sequence) ?? 0
2449
+ ) });
2450
+ }
2451
+ const te = {
2452
+ mode: "light",
2453
+ brand: "#e5ad27",
2454
+ accent: "#e5ad27",
2455
+ neutral: "#726e68",
2456
+ positive: "#38a67c",
2457
+ negative: "#bc263e",
2458
+ warning: "#b7680d",
2459
+ info: "#2e78c1",
2460
+ shape: "soft",
2461
+ solidStyle: "inverse",
2462
+ effect: "flat",
2463
+ surface: "filled",
2464
+ dataStyle: "categorical",
2465
+ motion: "all",
2466
+ fontScale: 1,
2467
+ radiusScale: 1
2468
+ }, wn = [
2469
+ "#e5ad27",
2470
+ "#2e78c1",
2471
+ "#278f82",
2472
+ "#8c42c5",
2473
+ "#c02b86",
2474
+ "#b7680d",
2475
+ "#d43b24",
2476
+ "#bc263e",
2477
+ "#4d8421",
2478
+ "#2e7d5b",
2479
+ "#257d94",
2480
+ "#6752d9"
2481
+ ], yn = [
2482
+ "#e5ad27",
2483
+ "#2e78c1",
2484
+ "#38a67c",
2485
+ "#7c4dce",
2486
+ "#c02b86",
2487
+ "#b7680d",
2488
+ "#d43b24",
2489
+ "#bc263e",
2490
+ "#4d8421",
2491
+ "#2e7d5b",
2492
+ "#257d94",
2493
+ "#6752d9"
2494
+ ], kn = ["#726e68", "#60656f", "#6c686f", "#5f6d69", "#796b69", "#59656b"], qe = [
2495
+ "#38a67c",
2496
+ "#2e7d5b",
2497
+ "#5cc09b",
2498
+ "#bc263e",
2499
+ "#d44b62",
2500
+ "#b7680d",
2501
+ "#2e78c1",
2502
+ "#7c4dce"
2503
+ ];
2504
+ function kt(t, e, n) {
2505
+ return Math.min(n, Math.max(e, t));
2506
+ }
2507
+ function Nn(t) {
2508
+ return /^#[0-9a-f]{6}$/i.test(t);
2509
+ }
2510
+ function ye(t, e) {
2511
+ return typeof t == "string" && Nn(t) ? t.toLowerCase() : e;
2512
+ }
2513
+ function Nt(t) {
2514
+ const e = Cn(t);
2515
+ return Ct(e, 0) >= Ct(e, 1) ? "#000000" : "#ffffff";
2516
+ }
2517
+ function Cn(t) {
2518
+ const n = [t.slice(1, 3), t.slice(3, 5), t.slice(5, 7)].map((a) => Number.parseInt(a, 16) / 255).map((a) => a <= 0.04045 ? a / 12.92 : ((a + 0.055) / 1.055) ** 2.4);
2519
+ return 0.2126 * n[0] + 0.7152 * n[1] + 0.0722 * n[2];
2520
+ }
2521
+ function Ct(t, e) {
2522
+ return (Math.max(t, e) + 0.05) / (Math.min(t, e) + 0.05);
2523
+ }
2524
+ function ke(t, e, n) {
2525
+ return typeof t == "string" && e.includes(t) ? t : n;
2526
+ }
2527
+ function Qe(t) {
2528
+ return {
2529
+ mode: ke(t.mode, ["light", "dark", "system"], te.mode),
2530
+ brand: ye(t.brand, te.brand),
2531
+ accent: ye(t.accent, te.accent),
2532
+ neutral: ye(t.neutral, te.neutral),
2533
+ positive: ye(t.positive, te.positive),
2534
+ negative: ye(t.negative, te.negative),
2535
+ warning: ye(t.warning, te.warning),
2536
+ info: ye(t.info, te.info),
2537
+ shape: ke(t.shape, ["sharp", "compact", "soft", "round"], te.shape),
2538
+ solidStyle: ke(t.solidStyle, ["color", "inverse"], te.solidStyle),
2539
+ effect: ke(t.effect, ["flat", "plastic"], te.effect),
2540
+ surface: ke(t.surface, ["filled", "translucent"], te.surface),
2541
+ dataStyle: ke(t.dataStyle, ["categorical", "divergent", "sequential"], te.dataStyle),
2542
+ motion: ke(t.motion, ["all", "micro", "macro", "none"], te.motion),
2543
+ fontScale: kt(Number.isFinite(t.fontScale) ? t.fontScale : 1, 0.875, 1.25),
2544
+ radiusScale: kt(Number.isFinite(t.radiusScale) ? t.radiusScale : 1, 0, 2)
2545
+ };
2546
+ }
2547
+ function Sn(t) {
2548
+ return t !== "system" ? t : typeof matchMedia == "function" && matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
2549
+ }
2550
+ function er(t) {
2551
+ const e = Qe(t), n = e.solidStyle === "color" ? e.brand : "var(--color-ink)", a = e.solidStyle === "color" ? Nt(e.brand) : "var(--color-pure-white)", o = e.dataStyle === "divergent" ? ["var(--color-up)", "var(--color-down)", e.brand, e.neutral, "var(--color-dove)"] : e.dataStyle === "sequential" ? [e.brand, `color-mix(in srgb, ${e.brand} 78%, transparent)`, `color-mix(in srgb, ${e.brand} 56%, transparent)`, `color-mix(in srgb, ${e.brand} 36%, transparent)`, e.neutral] : [e.brand, "var(--color-data-blue)", e.neutral, "var(--color-apricot-wash)", "var(--color-dove)"];
2552
+ return {
2553
+ "--color-brand": e.brand,
2554
+ "--color-rust": e.accent,
2555
+ "--color-on-accent": Nt(e.accent),
2556
+ "--color-graphite": e.neutral,
2557
+ "--color-up": e.positive,
2558
+ "--color-down": e.negative,
2559
+ "--color-warning": e.warning,
2560
+ "--color-info": e.info,
2561
+ "--color-solid": n,
2562
+ "--color-on-solid": a,
2563
+ "--color-data-1": o[0],
2564
+ "--color-data-2": o[1],
2565
+ "--color-data-3": o[2],
2566
+ "--color-data-4": o[3],
2567
+ "--color-data-5": o[4],
2568
+ "--font-scale": String(e.fontScale),
2569
+ "--radius-scale": String(e.radiusScale),
2570
+ "--surface-opacity": e.surface === "translucent" ? "0.82" : "1",
2571
+ "--effect-shadow-strength": e.effect === "plastic" ? "1" : "0",
2572
+ "--motion-scale": e.motion === "none" ? "0" : e.motion === "micro" ? "0.65" : e.motion === "macro" ? "1.2" : "1"
2573
+ };
2574
+ }
2575
+ function tr(t) {
2576
+ const e = Sn(t.mode);
2577
+ return { mode: e, attributes: { "data-theme": e, "data-theme-mode": t.mode, "data-shape": t.shape, "data-effect": t.effect, "data-surface": t.surface, "data-data-style": t.dataStyle, "data-motion": t.motion } };
2578
+ }
2579
+ function Qa(t, e) {
2580
+ const n = Qe(e), { mode: a, attributes: o } = tr(n);
2581
+ t.classList.toggle("dark", a === "dark"), t.classList.toggle("light", a === "light"), t.style.colorScheme = a;
2582
+ for (const [i, s] of Object.entries(o)) t.setAttribute(i, s);
2583
+ for (const [i, s] of Object.entries(er(n))) t.style.setProperty(i, String(s));
2584
+ return n;
2585
+ }
2586
+ const rr = $t(te);
2587
+ function eo() {
2588
+ return At(rr);
2589
+ }
2590
+ function to({ settings: t, className: e, children: n, style: a, ...o }) {
2591
+ const i = ce(() => Qe(t), [t]), { mode: s, attributes: l } = tr(i);
2592
+ return /* @__PURE__ */ r(rr.Provider, { value: i, children: /* @__PURE__ */ r("div", { ...o, ...l, className: v(s, e), style: { ...er(i), ...a }, children: n }) });
2593
+ }
2594
+ function Ie({ title: t, children: e }) {
2595
+ return /* @__PURE__ */ h("section", { className: "min-w-0 overflow-hidden rounded-panel border border-border bg-surface-raised", children: [
2596
+ /* @__PURE__ */ r("h3", { className: "border-b border-divider px-3 py-2.5 font-product text-body-sm font-[600] text-ink", children: t }),
2597
+ /* @__PURE__ */ r("div", { className: "grid min-w-0 divide-y divide-divider", children: e })
2598
+ ] });
2599
+ }
2600
+ function le({ label: t, children: e }) {
2601
+ return /* @__PURE__ */ h("div", { className: "af-theme-field grid min-w-0 gap-2.5 px-3 py-3", children: [
2602
+ /* @__PURE__ */ r("span", { className: "af-theme-field-label min-w-0 font-product text-caption font-[500] text-ink", children: t }),
2603
+ /* @__PURE__ */ r("div", { className: "min-w-0", children: e })
2604
+ ] });
2605
+ }
2606
+ function Ne({ icon: t, children: e }) {
2607
+ return /* @__PURE__ */ h("span", { className: "flex min-w-0 items-center justify-center gap-1.5", children: [
2608
+ t,
2609
+ e
2610
+ ] });
2611
+ }
2612
+ function Ce({
2613
+ label: t,
2614
+ customLabel: e,
2615
+ colors: n,
2616
+ value: a,
2617
+ onChange: o,
2618
+ pickerLabels: i
2619
+ }) {
2620
+ return /* @__PURE__ */ r(le, { label: t, children: /* @__PURE__ */ h("div", { className: "grid min-w-0 gap-2.5", children: [
2621
+ /* @__PURE__ */ r("div", { className: "flex min-w-0 flex-wrap items-center gap-2", role: "group", "aria-label": t, children: n.map((s) => /* @__PURE__ */ r(
2622
+ "button",
2623
+ {
2624
+ type: "button",
2625
+ "aria-label": `${t} ${s}`,
2626
+ "aria-pressed": a === s,
2627
+ onClick: () => o(s),
2628
+ className: "grid size-8 place-items-center rounded-full border-2 border-surface-raised outline-none ring-1 ring-border transition-transform hover:scale-110 focus-visible:ring-2 focus-visible:ring-rust aria-pressed:ring-2 aria-pressed:ring-ink",
2629
+ style: { backgroundColor: s },
2630
+ children: a === s ? /* @__PURE__ */ r(ve, { size: 13, className: "text-pure-white drop-shadow-sm", strokeWidth: 3, "aria-hidden": !0 }) : null
2631
+ },
2632
+ s
2633
+ )) }),
2634
+ /* @__PURE__ */ r(bn, { value: a, onChange: o, presets: n, labels: { ...i, trigger: e } })
2635
+ ] }) });
2636
+ }
2637
+ function ro({
2638
+ settings: t,
2639
+ labels: e,
2640
+ onChange: n,
2641
+ brands: a = wn,
2642
+ accents: o = yn,
2643
+ neutrals: i = kn
2644
+ }) {
2645
+ const s = (c) => n(Qe({ ...t, ...c })), l = "flex w-full", d = (c) => ({
2646
+ trigger: c,
2647
+ dialog: e.colorPickerTitle(c),
2648
+ hex: e.colorPickerHex,
2649
+ hue: e.colorPickerHue,
2650
+ saturation: e.colorPickerSaturation,
2651
+ presets: e.colorPickerPresets,
2652
+ close: e.colorPickerClose
2653
+ });
2654
+ return /* @__PURE__ */ h("div", { "data-ui-theme-editor": "true", className: "af-theme-editor grid min-w-0 gap-4 overflow-x-hidden", children: [
2655
+ /* @__PURE__ */ r(Ie, { title: e.preview, children: /* @__PURE__ */ r("div", { "data-theme-preview": !0, className: "min-w-0 p-3", children: /* @__PURE__ */ h("div", { className: "min-w-0 rounded-panel border border-border bg-surface-canvas p-3 shadow-subtle", children: [
2656
+ /* @__PURE__ */ h("div", { className: "flex min-w-0 items-start justify-between gap-3", children: [
2657
+ /* @__PURE__ */ h("div", { className: "min-w-0", children: [
2658
+ /* @__PURE__ */ r("p", { className: "font-product text-micro uppercase text-graphite", children: e.previewEyebrow }),
2659
+ /* @__PURE__ */ r("p", { className: "mt-0.5 break-words font-product text-body font-[600] text-ink", children: e.previewTitle }),
2660
+ /* @__PURE__ */ r("p", { className: "mt-1 break-words font-product text-caption leading-normal text-graphite", children: e.previewDescription })
2661
+ ] }),
2662
+ /* @__PURE__ */ r("span", { className: "shrink-0 rounded-control bg-rust/12 px-2 py-1 font-product text-micro font-[600] text-rust", children: e.previewMetric })
2663
+ ] }),
2664
+ /* @__PURE__ */ h("div", { className: "mt-3 flex items-center gap-4 border-b border-divider font-product text-caption", children: [
2665
+ /* @__PURE__ */ r("span", { className: "border-b-2 border-rust pb-1.5 font-[600] text-ink", children: e.previewPrimaryTab }),
2666
+ /* @__PURE__ */ r("span", { className: "pb-1.5 text-graphite", children: e.previewSecondaryTab })
2667
+ ] }),
2668
+ /* @__PURE__ */ r("div", { className: "mt-3 h-2 overflow-hidden rounded-full bg-surface-muted", "aria-hidden": !0, children: /* @__PURE__ */ r("div", { className: "h-full w-3/5 rounded-full bg-rust" }) }),
2669
+ /* @__PURE__ */ h("div", { className: "mt-3 flex min-w-0 flex-wrap items-center gap-2", children: [
2670
+ /* @__PURE__ */ r(de, { variant: "accent", size: "compact", children: e.previewAction }),
2671
+ /* @__PURE__ */ r(de, { variant: "ghost", size: "compact", children: e.previewSecondaryAction }),
2672
+ /* @__PURE__ */ r(vn, { label: e.previewSwitch, checked: !0, onCheckedChange: () => {
2673
+ } })
2674
+ ] }),
2675
+ /* @__PURE__ */ h("div", { className: "mt-3 flex items-center gap-2", "aria-hidden": !0, children: [
2676
+ /* @__PURE__ */ r("span", { className: "size-5 rounded-control bg-rust" }),
2677
+ /* @__PURE__ */ r("span", { className: "size-5 rounded-control bg-up" }),
2678
+ /* @__PURE__ */ r("span", { className: "size-5 rounded-control bg-down" })
2679
+ ] })
2680
+ ] }) }) }),
2681
+ /* @__PURE__ */ h(Ie, { title: e.page, children: [
2682
+ /* @__PURE__ */ r(le, { label: e.mode, children: /* @__PURE__ */ r(
2683
+ we,
2684
+ {
2685
+ className: l,
2686
+ value: t.mode,
2687
+ onChange: (c) => s({ mode: c }),
2688
+ ariaLabel: e.mode,
2689
+ options: [
2690
+ { value: "light", label: /* @__PURE__ */ r(Ne, { icon: /* @__PURE__ */ r(zr, { size: 14, "aria-hidden": !0 }), children: e.light }) },
2691
+ { value: "dark", label: /* @__PURE__ */ r(Ne, { icon: /* @__PURE__ */ r(Mr, { size: 14, "aria-hidden": !0 }), children: e.dark }) },
2692
+ { value: "system", label: /* @__PURE__ */ r(Ne, { icon: /* @__PURE__ */ r(Tr, { size: 14, "aria-hidden": !0 }), children: e.system }) }
2693
+ ]
2694
+ }
2695
+ ) }),
2696
+ /* @__PURE__ */ r(le, { label: e.shape, children: /* @__PURE__ */ r(
2697
+ we,
2698
+ {
2699
+ className: l,
2700
+ value: t.shape,
2701
+ onChange: (c) => s({ shape: c, radiusScale: { sharp: 0, compact: 0.65, soft: 1, round: 2 }[c] }),
2702
+ ariaLabel: e.shape,
2703
+ options: [
2704
+ { value: "sharp", label: /* @__PURE__ */ r(Ne, { icon: /* @__PURE__ */ r("span", { className: "size-3 border border-current", "aria-hidden": !0 }), children: e.sharp }) },
2705
+ { value: "compact", label: /* @__PURE__ */ r(Ne, { icon: /* @__PURE__ */ r("span", { className: "size-3 rounded-[2px] border border-current", "aria-hidden": !0 }), children: e.compact }) },
2706
+ { value: "soft", label: /* @__PURE__ */ r(Ne, { icon: /* @__PURE__ */ r("span", { className: "size-3 rounded-[4px] border border-current", "aria-hidden": !0 }), children: e.soft }) },
2707
+ { value: "round", label: /* @__PURE__ */ r(Ne, { icon: /* @__PURE__ */ r("span", { className: "size-3 rounded-full border border-current", "aria-hidden": !0 }), children: e.round }) }
2708
+ ]
2709
+ }
2710
+ ) })
2711
+ ] }),
2712
+ /* @__PURE__ */ h(Ie, { title: e.colors, children: [
2713
+ /* @__PURE__ */ r(Ce, { label: e.brand, customLabel: e.customBrand, colors: a, value: t.brand, onChange: (c) => s({ brand: c }), pickerLabels: d(e.customBrand) }),
2714
+ /* @__PURE__ */ r(Ce, { label: e.accent, customLabel: e.customAccent, colors: o, value: t.accent, onChange: (c) => s({ accent: c }), pickerLabels: d(e.customAccent) }),
2715
+ /* @__PURE__ */ r(Ce, { label: e.neutral, customLabel: e.customNeutral, colors: i, value: t.neutral, onChange: (c) => s({ neutral: c }), pickerLabels: d(e.customNeutral) })
2716
+ ] }),
2717
+ /* @__PURE__ */ h(Ie, { title: e.semanticColors, children: [
2718
+ /* @__PURE__ */ r(Ce, { label: e.positive, customLabel: e.customPositive, colors: qe, value: t.positive, onChange: (c) => s({ positive: c }), pickerLabels: d(e.customPositive) }),
2719
+ /* @__PURE__ */ r(Ce, { label: e.negative, customLabel: e.customNegative, colors: qe, value: t.negative, onChange: (c) => s({ negative: c }), pickerLabels: d(e.customNegative) }),
2720
+ /* @__PURE__ */ r(Ce, { label: e.warning, customLabel: e.customWarning, colors: qe, value: t.warning, onChange: (c) => s({ warning: c }), pickerLabels: d(e.customWarning) }),
2721
+ /* @__PURE__ */ r(Ce, { label: e.info, customLabel: e.customInfo, colors: qe, value: t.info, onChange: (c) => s({ info: c }), pickerLabels: d(e.customInfo) })
2722
+ ] }),
2723
+ /* @__PURE__ */ h(Ie, { title: e.controls, children: [
2724
+ /* @__PURE__ */ r(le, { label: e.solidStyle, children: /* @__PURE__ */ r(we, { className: l, value: t.solidStyle, onChange: (c) => s({ solidStyle: c }), ariaLabel: e.solidStyle, options: [{ value: "color", label: e.color }, { value: "inverse", label: e.inverse }] }) }),
2725
+ /* @__PURE__ */ r(le, { label: e.effect, children: /* @__PURE__ */ r(we, { className: l, value: t.effect, onChange: (c) => s({ effect: c }), ariaLabel: e.effect, options: [{ value: "flat", label: e.flat }, { value: "plastic", label: e.plastic }] }) })
2726
+ ] }),
2727
+ /* @__PURE__ */ h(Ie, { title: e.advanced, children: [
2728
+ /* @__PURE__ */ r(le, { label: e.surface, children: /* @__PURE__ */ r(we, { className: l, value: t.surface, onChange: (c) => s({ surface: c }), ariaLabel: e.surface, options: [{ value: "filled", label: e.filled }, { value: "translucent", label: e.translucent }] }) }),
2729
+ /* @__PURE__ */ r(le, { label: e.dataStyle, children: /* @__PURE__ */ r(we, { className: l, value: t.dataStyle, onChange: (c) => s({ dataStyle: c }), ariaLabel: e.dataStyle, options: [{ value: "categorical", label: e.categorical }, { value: "divergent", label: e.divergent }, { value: "sequential", label: e.sequential }] }) }),
2730
+ /* @__PURE__ */ r(le, { label: e.motion, children: /* @__PURE__ */ r(we, { className: l, value: t.motion, onChange: (c) => s({ motion: c }), ariaLabel: e.motion, options: [{ value: "all", label: e.all }, { value: "micro", label: e.micro }, { value: "macro", label: e.macro }, { value: "none", label: e.none }] }) }),
2731
+ /* @__PURE__ */ r(le, { label: e.fontScale, children: /* @__PURE__ */ h("div", { className: "grid grid-cols-[minmax(0,1fr)_4.75rem] items-center gap-3", children: [
2732
+ /* @__PURE__ */ r(st, { value: t.fontScale, min: 0.875, max: 1.25, step: 0.125, onChange: (c) => s({ fontScale: c }), ariaLabel: e.fontScale, formatValue: e.value }),
2733
+ /* @__PURE__ */ r("output", { className: "rounded-control border border-border bg-surface-raised px-2 py-1.5 text-center font-data text-data tabular-nums text-ink", children: e.value(t.fontScale) })
2734
+ ] }) }),
2735
+ /* @__PURE__ */ r(le, { label: e.radiusScale, children: /* @__PURE__ */ h("div", { className: "grid grid-cols-[minmax(0,1fr)_4.75rem] items-center gap-3", children: [
2736
+ /* @__PURE__ */ r(st, { value: t.radiusScale, min: 0, max: 2, step: 0.25, onChange: (c) => s({ radiusScale: c }), ariaLabel: e.radiusScale, formatValue: e.value }),
2737
+ /* @__PURE__ */ r("output", { className: "rounded-control border border-border bg-surface-raised px-2 py-1.5 text-center font-data text-data tabular-nums text-ink", children: e.value(t.radiusScale) })
2738
+ ] }) })
2739
+ ] })
2740
+ ] });
2741
+ }
2742
+ function no({ label: t, items: e }) {
2743
+ return /* @__PURE__ */ r("nav", { "aria-label": t, children: /* @__PURE__ */ r("ol", { className: "flex min-w-0 items-center gap-1 font-product text-caption text-graphite", children: e.map((n, a) => {
2744
+ const o = a === e.length - 1;
2745
+ return /* @__PURE__ */ h("li", { className: "flex min-w-0 items-center gap-1", children: [
2746
+ a > 0 && /* @__PURE__ */ r("span", { "aria-hidden": !0, children: "/" }),
2747
+ o ? /* @__PURE__ */ r("span", { "aria-current": "page", className: "truncate font-[500] text-ink", children: n.label }) : n.href ? /* @__PURE__ */ r("a", { href: n.href, className: "truncate rounded-control outline-none hover:text-ink focus-visible:ring-2 focus-visible:ring-rust", children: n.label }) : /* @__PURE__ */ r("button", { type: "button", onClick: n.onClick, className: "truncate rounded-control outline-none hover:text-ink focus-visible:ring-2 focus-visible:ring-rust", children: n.label })
2748
+ ] }, n.id);
2749
+ }) }) });
2750
+ }
2751
+ function ao({
2752
+ label: t,
2753
+ page: e,
2754
+ pageCount: n,
2755
+ onPageChange: a,
2756
+ pageLabel: o,
2757
+ previousLabel: i,
2758
+ nextLabel: s
2759
+ }) {
2760
+ const l = Array.from({ length: n }, (c, p) => p + 1), d = "inline-flex size-control-compact items-center justify-center rounded-control font-data text-caption outline-none hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-rust disabled:opacity-40";
2761
+ return /* @__PURE__ */ h("nav", { "aria-label": t, className: "flex items-center gap-1", children: [
2762
+ /* @__PURE__ */ r("button", { type: "button", "aria-label": i, disabled: e <= 1, onClick: () => a(e - 1), className: d, children: /* @__PURE__ */ r(jt, { size: 14, "aria-hidden": !0 }) }),
2763
+ l.map((c) => /* @__PURE__ */ r(
2764
+ "button",
2765
+ {
2766
+ type: "button",
2767
+ "aria-label": o(c),
2768
+ "aria-current": c === e ? "page" : void 0,
2769
+ onClick: () => a(c),
2770
+ className: `${d} ${c === e ? "bg-surface-hover font-[500] text-ink" : "text-graphite"}`,
2771
+ children: c
2772
+ },
2773
+ c
2774
+ )),
2775
+ /* @__PURE__ */ r("button", { type: "button", "aria-label": s, disabled: e >= n, onClick: () => a(e + 1), className: d, children: /* @__PURE__ */ r(Bt, { size: 14, "aria-hidden": !0 }) })
2776
+ ] });
2777
+ }
2778
+ function Re(t) {
2779
+ const [e, n, a] = t.split("-").map(Number);
2780
+ return new Date(Date.UTC(e, n - 1, a));
2781
+ }
2782
+ function lt(t) {
2783
+ return [
2784
+ t.getUTCFullYear(),
2785
+ String(t.getUTCMonth() + 1).padStart(2, "0"),
2786
+ String(t.getUTCDate()).padStart(2, "0")
2787
+ ].join("-");
2788
+ }
2789
+ function St(t, e) {
2790
+ const n = Re(t);
2791
+ return n.setUTCDate(n.getUTCDate() + e), lt(n);
2792
+ }
2793
+ function He(t) {
2794
+ return `${t.getUTCFullYear()}-${String(t.getUTCMonth() + 1).padStart(2, "0")}`;
2795
+ }
2796
+ function zn({
2797
+ value: t,
2798
+ onValueChange: e,
2799
+ label: n,
2800
+ locale: a,
2801
+ weekdayLabels: o,
2802
+ previousMonthLabel: i,
2803
+ nextMonthLabel: s,
2804
+ dateLabel: l = (u) => u,
2805
+ minimum: d,
2806
+ maximum: c,
2807
+ className: p
2808
+ }) {
2809
+ const u = t ? Re(t) : /* @__PURE__ */ new Date(), [y, g] = j(() => He(u)), m = Q(), [f, b] = y.split("-").map(Number), w = new Date(Date.UTC(f, b - 1, 1)), x = new Date(w);
2810
+ x.setUTCDate(1 - w.getUTCDay());
2811
+ const C = Array.from({ length: 42 }, (M, D) => {
2812
+ const P = new Date(x);
2813
+ return P.setUTCDate(x.getUTCDate() + D), lt(P);
2814
+ }), T = lt(/* @__PURE__ */ new Date()), k = ce(
2815
+ () => new Intl.DateTimeFormat(a, { year: "numeric", month: "long", timeZone: "UTC" }).format(w),
2816
+ [a, y]
2817
+ );
2818
+ q(() => {
2819
+ t && g(He(Re(t)));
2820
+ }, [t]);
2821
+ const L = (M) => {
2822
+ const D = new Date(w);
2823
+ D.setUTCMonth(D.getUTCMonth() + M), g(He(D));
2824
+ }, O = (M) => {
2825
+ g(He(Re(M))), requestAnimationFrame(() => {
2826
+ var D;
2827
+ (D = document.querySelector(`[data-calendar-id="${m}"] [data-date="${M}"]`)) == null || D.focus();
2828
+ });
2829
+ }, N = (M, D) => {
2830
+ const P = {
2831
+ ArrowLeft: -1,
2832
+ ArrowRight: 1,
2833
+ ArrowUp: -7,
2834
+ ArrowDown: 7
2835
+ }[M.key];
2836
+ if (P)
2837
+ M.preventDefault(), O(St(D, P));
2838
+ else if (M.key === "Home" || M.key === "End") {
2839
+ M.preventDefault();
2840
+ const z = Re(D).getUTCDay();
2841
+ O(St(D, M.key === "Home" ? -z : 6 - z));
2842
+ } else (M.key === "PageUp" || M.key === "PageDown") && (M.preventDefault(), L(M.key === "PageUp" ? -1 : 1));
2843
+ };
2844
+ return /* @__PURE__ */ h("div", { className: v("font-product text-body-sm text-ink", p), children: [
2845
+ /* @__PURE__ */ h("div", { className: "mb-2 flex h-row-default items-center justify-between", children: [
2846
+ /* @__PURE__ */ r(de, { size: "icon", variant: "ghost", "aria-label": i, onClick: () => L(-1), children: /* @__PURE__ */ r(jt, { size: 14, "aria-hidden": !0 }) }),
2847
+ /* @__PURE__ */ r("span", { className: "font-[500]", children: k }),
2848
+ /* @__PURE__ */ r(de, { size: "icon", variant: "ghost", "aria-label": s, onClick: () => L(1), children: /* @__PURE__ */ r(Bt, { size: 14, "aria-hidden": !0 }) })
2849
+ ] }),
2850
+ /* @__PURE__ */ h("div", { role: "grid", "aria-label": n, "data-calendar-id": m, children: [
2851
+ /* @__PURE__ */ r("div", { role: "row", className: "grid grid-cols-7", children: o.map((M) => /* @__PURE__ */ r("span", { role: "columnheader", className: "grid h-row-compact place-items-center text-micro text-graphite", children: M }, M)) }),
2852
+ Array.from({ length: 6 }, (M, D) => /* @__PURE__ */ r("div", { role: "row", className: "grid grid-cols-7", children: C.slice(D * 7, D * 7 + 7).map((P) => {
2853
+ const z = Re(P), S = z.getUTCMonth() !== b - 1, A = P === t, F = !!(d && P < d || c && P > c);
2854
+ return /* @__PURE__ */ r("span", { role: "gridcell", "aria-selected": A, children: /* @__PURE__ */ r(
2855
+ "button",
2856
+ {
2857
+ type: "button",
2858
+ "data-date": P,
2859
+ "aria-label": l(P),
2860
+ "aria-current": P === T ? "date" : void 0,
2861
+ "aria-pressed": A,
2862
+ disabled: F,
2863
+ tabIndex: A || !t && z.getUTCDate() === 1 && !S ? 0 : -1,
2864
+ onKeyDown: (Y) => N(Y, P),
2865
+ onClick: () => {
2866
+ e(P), g(He(z));
2867
+ },
2868
+ className: "grid size-control-default place-items-center rounded-control font-data text-caption tabular-nums text-ink outline-none hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-rust disabled:opacity-30 data-[outside=true]:text-graphite aria-pressed:bg-rust aria-pressed:text-on-accent",
2869
+ "data-outside": S || void 0,
2870
+ children: z.getUTCDate()
2871
+ }
2872
+ ) }, P);
2873
+ }) }, D))
2874
+ ] })
2875
+ ] });
2876
+ }
2877
+ function zt({
2878
+ value: t,
2879
+ onValueChange: e,
2880
+ label: n,
2881
+ calendarLabel: a,
2882
+ placeholder: o,
2883
+ displayValue: i = (l) => l,
2884
+ ...s
2885
+ }) {
2886
+ const [l, d] = j(!1);
2887
+ return /* @__PURE__ */ h(ae.Root, { open: l, onOpenChange: d, children: [
2888
+ /* @__PURE__ */ r(ae.Trigger, { asChild: !0, children: /* @__PURE__ */ r(de, { variant: "secondary", "aria-label": n, className: "w-full justify-start", children: t ? i(t) : o }) }),
2889
+ /* @__PURE__ */ r(ae.Portal, { children: /* @__PURE__ */ r(
2890
+ ae.Content,
2891
+ {
2892
+ role: "dialog",
2893
+ "aria-label": a,
2894
+ sideOffset: 4,
2895
+ collisionPadding: 8,
2896
+ className: "z-50 w-80 rounded-panel border border-border bg-surface-raised p-3 shadow-pop outline-none",
2897
+ children: /* @__PURE__ */ r(
2898
+ zn,
2899
+ {
2900
+ ...s,
2901
+ value: t,
2902
+ label: a,
2903
+ onValueChange: (c) => {
2904
+ e(c), d(!1);
2905
+ }
2906
+ }
2907
+ )
2908
+ }
2909
+ ) })
2910
+ ] });
2911
+ }
2912
+ function oo({
2913
+ start: t,
2914
+ end: e,
2915
+ onChange: n,
2916
+ startLabel: a,
2917
+ endLabel: o,
2918
+ ...i
2919
+ }) {
2920
+ return /* @__PURE__ */ h("div", { className: "grid min-w-0 gap-2 sm:grid-cols-2", children: [
2921
+ /* @__PURE__ */ r(
2922
+ zt,
2923
+ {
2924
+ ...i,
2925
+ value: t,
2926
+ label: a,
2927
+ maximum: e || void 0,
2928
+ onValueChange: (s) => n({ start: s, end: e })
2929
+ }
2930
+ ),
2931
+ /* @__PURE__ */ r(
2932
+ zt,
2933
+ {
2934
+ ...i,
2935
+ value: e,
2936
+ label: o,
2937
+ minimum: t || void 0,
2938
+ onValueChange: (s) => n({ start: t, end: s })
2939
+ }
2940
+ )
2941
+ ] });
2942
+ }
2943
+ function io({
2944
+ label: t,
2945
+ value: e,
2946
+ onValueChange: n,
2947
+ timezone: a,
2948
+ minimum: o,
2949
+ maximum: i
2950
+ }) {
2951
+ return /* @__PURE__ */ r(xn, { label: t, children: /* @__PURE__ */ h("div", { className: "flex min-w-0 items-center gap-2", children: [
2952
+ /* @__PURE__ */ r(
2953
+ ht,
2954
+ {
2955
+ type: "time",
2956
+ "aria-label": t,
2957
+ value: e,
2958
+ min: o,
2959
+ max: i,
2960
+ onChange: (s) => n(s.target.value),
2961
+ className: "min-w-0 flex-1 font-data tabular-nums"
2962
+ }
2963
+ ),
2964
+ /* @__PURE__ */ r("span", { className: "shrink-0 font-mono text-data text-graphite", children: a })
2965
+ ] }) });
2966
+ }
2967
+ function Mn(t, e, n) {
2968
+ return Math.min(n, Math.max(e, t));
2969
+ }
2970
+ function so({
2971
+ value: t,
2972
+ onValueChange: e,
2973
+ label: n,
2974
+ first: a,
2975
+ second: o,
2976
+ direction: i = "horizontal",
2977
+ minimum: s = 20,
2978
+ maximum: l = 80,
2979
+ step: d = 5,
2980
+ className: c
2981
+ }) {
2982
+ const p = U(null), u = Q(), y = Q(), g = (b, w = !1) => e(Mn(w ? Math.round(b / d) * d : b, s, l)), m = (b) => {
2983
+ if (b.button !== 0) return;
2984
+ b.preventDefault();
2985
+ const w = b.currentTarget;
2986
+ w.setPointerCapture(b.pointerId);
2987
+ const x = (T) => {
2988
+ var N;
2989
+ const k = (N = p.current) == null ? void 0 : N.getBoundingClientRect(), L = i === "horizontal" ? k == null ? void 0 : k.width : k == null ? void 0 : k.height;
2990
+ if (!k || !L) return;
2991
+ const O = i === "horizontal" ? T.clientX - k.left : T.clientY - k.top;
2992
+ g(O / L * 100, !0);
2993
+ }, C = (T) => {
2994
+ w.hasPointerCapture(T.pointerId) && w.releasePointerCapture(T.pointerId), w.removeEventListener("pointermove", x), w.removeEventListener("pointerup", C), w.removeEventListener("pointercancel", C);
2995
+ };
2996
+ w.addEventListener("pointermove", x), w.addEventListener("pointerup", C), w.addEventListener("pointercancel", C);
2997
+ }, f = (b) => {
2998
+ const w = i === "horizontal" ? "ArrowLeft" : "ArrowUp", x = i === "horizontal" ? "ArrowRight" : "ArrowDown";
2999
+ b.key === w ? (b.preventDefault(), g(t - d)) : b.key === x ? (b.preventDefault(), g(t + d)) : b.key === "Home" ? (b.preventDefault(), g(s)) : b.key === "End" && (b.preventDefault(), g(l));
3000
+ };
3001
+ return /* @__PURE__ */ h(
3002
+ "div",
3003
+ {
3004
+ ref: p,
3005
+ className: v("flex min-h-0 min-w-0 overflow-hidden", i === "horizontal" ? "flex-row" : "flex-col", c),
3006
+ "data-slot": "resizable-pane-group",
3007
+ "data-direction": i,
3008
+ children: [
3009
+ /* @__PURE__ */ r("div", { id: u, "data-slot": "resizable-pane-first", className: "min-h-0 min-w-0 shrink-0 overflow-auto", style: { flexBasis: `${t}%` }, children: a }),
3010
+ /* @__PURE__ */ r(
3011
+ "div",
3012
+ {
3013
+ role: "separator",
3014
+ tabIndex: 0,
3015
+ "aria-label": n,
3016
+ "aria-orientation": i === "horizontal" ? "vertical" : "horizontal",
3017
+ "aria-valuemin": s,
3018
+ "aria-valuemax": l,
3019
+ "aria-valuenow": t,
3020
+ "aria-controls": `${u} ${y}`,
3021
+ onPointerDown: m,
3022
+ onKeyDown: f,
3023
+ className: v(
3024
+ "group relative z-10 shrink-0 touch-none bg-divider outline-none after:absolute after:rounded-full after:bg-graphite/60 hover:after:bg-rust focus-visible:after:bg-rust",
3025
+ i === "horizontal" ? "w-1 cursor-col-resize after:inset-y-2 after:left-1/2 after:w-0.5 after:-translate-x-1/2" : "h-1 cursor-row-resize after:inset-x-2 after:top-1/2 after:h-0.5 after:-translate-y-1/2"
3026
+ )
3027
+ }
3028
+ ),
3029
+ /* @__PURE__ */ r("div", { id: y, "data-slot": "resizable-pane-second", className: "min-h-0 min-w-0 flex-1 overflow-auto", children: o })
3030
+ ]
3031
+ }
3032
+ );
3033
+ }
3034
+ function lo({ label: t, className: e, ...n }) {
3035
+ return /* @__PURE__ */ r("aside", { "aria-label": t, className: v("flex min-h-0 w-64 shrink-0 flex-col border-r border-divider bg-surface-fog", e), ...n });
3036
+ }
3037
+ function co({ className: t, ...e }) {
3038
+ return /* @__PURE__ */ r("div", { className: v("flex min-h-row-touch shrink-0 items-center border-b border-divider px-4 font-product text-body-sm font-[600] text-ink", t), ...e });
3039
+ }
3040
+ function uo({ className: t, ...e }) {
3041
+ return /* @__PURE__ */ r("div", { className: v("min-h-0 flex-1 overflow-y-auto p-2", t), ...e });
3042
+ }
3043
+ function fo({ label: t, children: e, className: n }) {
3044
+ return /* @__PURE__ */ h("section", { className: v("py-2", n), children: [
3045
+ /* @__PURE__ */ r("h2", { className: "px-2 pb-1 font-product text-micro font-[600] uppercase text-graphite", children: t }),
3046
+ /* @__PURE__ */ r("div", { className: "min-w-0", children: e })
3047
+ ] });
3048
+ }
3049
+ function ho({
3050
+ title: t,
3051
+ status: e,
3052
+ toolbar: n,
3053
+ headerContent: a,
3054
+ headerClassName: o,
3055
+ hideHeader: i = !1,
3056
+ density: s = "default",
3057
+ children: l,
3058
+ className: d,
3059
+ contentClassName: c,
3060
+ ...p
3061
+ }) {
3062
+ const u = Q();
3063
+ return /* @__PURE__ */ h(
3064
+ "section",
3065
+ {
3066
+ role: "region",
3067
+ "aria-labelledby": u,
3068
+ className: v("min-w-0 overflow-hidden rounded-panel border border-border bg-surface-fog", d),
3069
+ ...p,
3070
+ children: [
3071
+ i ? /* @__PURE__ */ r("h3", { id: u, className: "sr-only", children: t }) : /* @__PURE__ */ r("header", { className: v("flex items-center gap-2 border-b border-divider px-3", !a && (s === "compact" ? "h-row-compact" : "h-row-default"), o), children: a ? /* @__PURE__ */ h(fe, { children: [
3072
+ /* @__PURE__ */ r("h3", { id: u, className: "sr-only", children: t }),
3073
+ a
3074
+ ] }) : /* @__PURE__ */ h(fe, { children: [
3075
+ /* @__PURE__ */ r("h3", { id: u, className: v("min-w-0 flex-1 truncate font-product font-[500] text-ink", s === "compact" ? "text-caption" : "text-body-sm"), children: t }),
3076
+ e && /* @__PURE__ */ r("div", { className: "shrink-0 font-data text-data tabular-nums text-graphite", children: e }),
3077
+ n && /* @__PURE__ */ r("div", { className: "flex shrink-0 items-center gap-1", children: n })
3078
+ ] }) }),
3079
+ /* @__PURE__ */ r("div", { "data-slot": "widget-content", className: v("min-w-0", c), children: l })
3080
+ ]
3081
+ }
3082
+ );
3083
+ }
3084
+ function je(t) {
3085
+ return typeof t == "number" && Number.isFinite(t);
3086
+ }
3087
+ const $ = 1e-3, Tn = 0.3, Dn = {
3088
+ ...Pr,
3089
+ preventCollision: !0
3090
+ };
3091
+ function G(t) {
3092
+ return Math.round(t / $) * $;
3093
+ }
3094
+ function ge(t) {
3095
+ return t.map((e) => ({ ...e }));
3096
+ }
3097
+ function ct(t, e, n, a) {
3098
+ if (!Array.isArray(t) || t.length !== e.length) return !1;
3099
+ const o = new Map(e.map((s) => [s.i, s])), i = /* @__PURE__ */ new Set();
3100
+ for (const s of t) {
3101
+ if (!s || typeof s != "object") return !1;
3102
+ const l = s;
3103
+ if (typeof l.i != "string" || i.has(l.i)) return !1;
3104
+ const d = o.get(l.i);
3105
+ if (!d || ![l.x, l.y, l.w, l.h].every(je)) return !1;
3106
+ const { x: c, y: p, w: u, h: y } = l;
3107
+ if (c < -$ || p < -$ || u < (d.minW ?? 1) - $ || y < (d.minH ?? 1) - $ || u > (d.maxW ?? n) + $ || y > (d.maxH ?? a) + $ || c + u > n + $ || p + y > a + $) return !1;
3108
+ i.add(l.i);
3109
+ }
3110
+ return t.every((s, l) => t.slice(l + 1).every((d) => !mt(s, d)));
3111
+ }
3112
+ function nr(t, e) {
3113
+ const n = new Map(e.map((a) => [a.i, a]));
3114
+ return t.map(({ i: a, x: o, y: i, w: s, h: l }) => ({
3115
+ ...n.get(a),
3116
+ i: a,
3117
+ x: G(o),
3118
+ y: G(i),
3119
+ w: G(s),
3120
+ h: G(l)
3121
+ }));
3122
+ }
3123
+ function In(t, e, n, a) {
3124
+ if (!t || typeof window > "u") return ge(e);
3125
+ try {
3126
+ const o = JSON.parse(window.localStorage.getItem(t) ?? "null");
3127
+ return ct(o, e, n, a) ? nr(o, e) : (window.localStorage.removeItem(t), ge(e));
3128
+ } catch {
3129
+ return window.localStorage.removeItem(t), ge(e);
3130
+ }
3131
+ }
3132
+ function mt(t, e) {
3133
+ return t.x < e.x + e.w - $ && t.x + t.w > e.x + $ && t.y < e.y + e.h - $ && t.y + t.h > e.y + $;
3134
+ }
3135
+ function nt(t) {
3136
+ var a;
3137
+ const e = t;
3138
+ if (je(e.clientX) && je(e.clientY)) return { x: e.clientX, y: e.clientY };
3139
+ const n = (a = e.changedTouches) == null ? void 0 : a[0];
3140
+ return n && je(n.clientX) && je(n.clientY) ? { x: n.clientX, y: n.clientY } : null;
3141
+ }
3142
+ function Rn(t, e) {
3143
+ const n = Math.max(0, Math.min(t.left + t.width, e.left + e.width) - Math.max(t.left, e.left)), a = Math.max(0, Math.min(t.top + t.height, e.top + e.height) - Math.max(t.top, e.top)), o = Math.min(t.width * t.height, e.width * e.height);
3144
+ return o > 0 ? n * a / o : 0;
3145
+ }
3146
+ function Mt(t, e) {
3147
+ const n = new Map(e.map((a) => [a.i, a]));
3148
+ for (const a of t) {
3149
+ const o = n.get(a.i);
3150
+ o && Object.assign(a, o);
3151
+ }
3152
+ }
3153
+ function Ue(t, e) {
3154
+ return Math.abs(t - e) <= $;
3155
+ }
3156
+ function Pn(t) {
3157
+ if (t.length === 0) return null;
3158
+ const e = Math.min(...t.map((i) => i.x)), n = Math.min(...t.map((i) => i.y)), a = Math.max(...t.map((i) => i.x + i.w)), o = Math.max(...t.map((i) => i.y + i.h));
3159
+ return { x: e, y: n, w: a - e, h: o - n };
3160
+ }
3161
+ function Ln(t, e, n) {
3162
+ const a = n === "x" ? e.x : e.y, o = a + (n === "x" ? e.w : e.h), i = /* @__PURE__ */ new Set();
3163
+ for (const s of t) {
3164
+ const l = n === "x" ? s.x : s.y, d = l + (n === "x" ? s.w : s.h);
3165
+ l > a + $ && l < o - $ && i.add(G(l)), d > a + $ && d < o - $ && i.add(G(d));
3166
+ }
3167
+ return [...i].filter((s) => t.every((l) => {
3168
+ const d = n === "x" ? l.x : l.y;
3169
+ return d + (n === "x" ? l.w : l.h) <= s + $ || d >= s - $;
3170
+ })).sort((s, l) => s - l);
3171
+ }
3172
+ function ar(t, e) {
3173
+ const n = t.reduce((o, i) => o + i.w * i.h, 0);
3174
+ if (!Ue(n, e.w * e.h)) return null;
3175
+ if (t.length === 1) {
3176
+ const [o] = t;
3177
+ return !Ue(o.x, e.x) || !Ue(o.y, e.y) || !Ue(o.w, e.w) || !Ue(o.h, e.h) ? null : { kind: "leaf", bounds: e, item: { ...o } };
3178
+ }
3179
+ const a = ["x", "y"].map((o) => ({ axis: o, cuts: Ln(t, e, o) })).filter(({ cuts: o }) => o.length > 0).sort((o, i) => o.cuts.length - i.cuts.length);
3180
+ for (const { axis: o, cuts: i } of a) {
3181
+ const s = o === "x" ? e.x : e.y, l = s + (o === "x" ? e.w : e.h), d = [s, ...i, l], c = [];
3182
+ let p = !0;
3183
+ for (let u = 0; u < d.length - 1; u += 1) {
3184
+ const y = d[u], g = d[u + 1], m = t.filter((w) => {
3185
+ const x = o === "x" ? w.x : w.y, C = x + (o === "x" ? w.w : w.h);
3186
+ return x >= y - $ && C <= g + $;
3187
+ });
3188
+ if (m.length === 0) {
3189
+ p = !1;
3190
+ break;
3191
+ }
3192
+ const f = o === "x" ? { x: y, y: e.y, w: g - y, h: e.h } : { x: e.x, y, w: e.w, h: g - y }, b = ar(m, f);
3193
+ if (!b) {
3194
+ p = !1;
3195
+ break;
3196
+ }
3197
+ c.push(b);
3198
+ }
3199
+ if (p && c.length > 1) return { kind: "split", bounds: e, axis: o, children: c };
3200
+ }
3201
+ return null;
3202
+ }
3203
+ function dt(t, e) {
3204
+ return t.kind === "leaf" ? t.item.i === e : t.children.some((n) => dt(n, e));
3205
+ }
3206
+ function or(t, e, n) {
3207
+ const a = {
3208
+ ...t.bounds,
3209
+ x: G(t.bounds.x + e),
3210
+ y: G(t.bounds.y + n)
3211
+ };
3212
+ return t.kind === "leaf" ? {
3213
+ kind: "leaf",
3214
+ bounds: a,
3215
+ item: {
3216
+ ...t.item,
3217
+ x: G(t.item.x + e),
3218
+ y: G(t.item.y + n)
3219
+ }
3220
+ } : {
3221
+ kind: "split",
3222
+ bounds: a,
3223
+ axis: t.axis,
3224
+ children: t.children.map((o) => or(o, e, n))
3225
+ };
3226
+ }
3227
+ function An(t, e) {
3228
+ let n = t.axis === "x" ? t.bounds.x : t.bounds.y;
3229
+ const a = e.map((o) => {
3230
+ const i = t.axis === "x" ? o.bounds.x : o.bounds.y, s = or(o, t.axis === "x" ? n - i : 0, t.axis === "y" ? n - i : 0);
3231
+ return n += t.axis === "x" ? o.bounds.w : o.bounds.h, s;
3232
+ });
3233
+ return { ...t, children: a };
3234
+ }
3235
+ function ir(t, e, n) {
3236
+ if (t.kind === "leaf") return { node: t, changed: !1 };
3237
+ const a = t.children.findIndex((l) => dt(l, e)), o = t.children.findIndex((l) => dt(l, n));
3238
+ if (a < 0 || o < 0) return { node: t, changed: !1 };
3239
+ if (a !== o) {
3240
+ const l = [...t.children], [d] = l.splice(a, 1);
3241
+ return l.splice(o, 0, d), { node: An(t, l), changed: !0 };
3242
+ }
3243
+ const i = ir(t.children[a], e, n);
3244
+ if (!i.changed) return { node: t, changed: !1 };
3245
+ const s = [...t.children];
3246
+ return s[a] = i.node, { node: { ...t, children: s }, changed: !0 };
3247
+ }
3248
+ function sr(t, e = /* @__PURE__ */ new Map()) {
3249
+ return t.kind === "leaf" ? e.set(t.item.i, t.item) : t.children.forEach((n) => sr(n, e)), e;
3250
+ }
3251
+ function $n(t, e, n) {
3252
+ let a = { x: e.x, y: e.y, w: e.w, h: e.h }, o = { x: n.x, y: n.y, w: n.w, h: n.h };
3253
+ if (Math.abs(e.w - n.w) <= $ && Math.abs(e.h - n.h) <= $)
3254
+ a = { ...a, x: n.x, y: n.y }, o = { ...o, x: e.x, y: e.y };
3255
+ else if (Math.abs(e.x - n.x) <= $ && Math.abs(e.w - n.w) <= $ && (Math.abs(e.y + e.h - n.y) <= $ || Math.abs(n.y + n.h - e.y) <= $)) {
3256
+ const i = Math.min(e.y, n.y);
3257
+ e.y < n.y ? (o = { ...o, y: i }, a = { ...a, y: i + n.h }) : (a = { ...a, y: i }, o = { ...o, y: i + e.h });
3258
+ } else if (Math.abs(e.y - n.y) <= $ && Math.abs(e.h - n.h) <= $ && (Math.abs(e.x + e.w - n.x) <= $ || Math.abs(n.x + n.w - e.x) <= $)) {
3259
+ const i = Math.min(e.x, n.x);
3260
+ e.x < n.x ? (o = { ...o, x: i }, a = { ...a, x: i + n.w }) : (a = { ...a, x: i }, o = { ...o, x: i + e.w });
3261
+ } else return null;
3262
+ return t.map((i) => i.i === e.i ? { ...i, ...a } : i.i === n.i ? { ...i, ...o } : i);
3263
+ }
3264
+ function at(t, e, n) {
3265
+ if (e.i === n.i) return null;
3266
+ const a = Pn(t), o = a ? ar(t, a) : null;
3267
+ if (o) {
3268
+ const i = ir(o, e.i, n.i);
3269
+ if (i.changed) {
3270
+ const s = sr(i.node);
3271
+ return t.map((l) => {
3272
+ const d = s.get(l.i);
3273
+ return d ? { ...l, x: d.x, y: d.y } : l;
3274
+ });
3275
+ }
3276
+ }
3277
+ return $n(t, e, n);
3278
+ }
3279
+ function En(t) {
3280
+ const e = /* @__PURE__ */ new Map(), n = (a, o, i, s, l, d) => {
3281
+ if (s <= i) return;
3282
+ const c = `${a}:${o}`, p = e.get(c) ?? [];
3283
+ p.push({ id: c, orientation: a, boundary: o, start: i, end: s, before: [l], after: [d] }), e.set(c, p);
3284
+ };
3285
+ for (let a = 0; a < t.length; a += 1)
3286
+ for (let o = a + 1; o < t.length; o += 1) {
3287
+ const i = t[a], s = t[o];
3288
+ Math.abs(i.x + i.w - s.x) <= $ && n("vertical", G(s.x), Math.max(i.y, s.y), Math.min(i.y + i.h, s.y + s.h), i.i, s.i), Math.abs(s.x + s.w - i.x) <= $ && n("vertical", G(i.x), Math.max(i.y, s.y), Math.min(i.y + i.h, s.y + s.h), s.i, i.i), Math.abs(i.y + i.h - s.y) <= $ && n("horizontal", G(s.y), Math.max(i.x, s.x), Math.min(i.x + i.w, s.x + s.w), i.i, s.i), Math.abs(s.y + s.h - i.y) <= $ && n("horizontal", G(i.y), Math.max(i.x, s.x), Math.min(i.x + i.w, s.x + s.w), s.i, i.i);
3289
+ }
3290
+ return [...e.values()].flatMap((a) => {
3291
+ const o = [...a].sort((s, l) => s.start - l.start), i = [];
3292
+ for (const s of o) {
3293
+ const l = i.at(-1);
3294
+ if (!l || s.start > l.end) {
3295
+ i.push({ ...s, id: `${s.id}:${s.start}-${s.end}` });
3296
+ continue;
3297
+ }
3298
+ l.end = Math.max(l.end, s.end), l.before = [.../* @__PURE__ */ new Set([...l.before, ...s.before])], l.after = [.../* @__PURE__ */ new Set([...l.after, ...s.after])];
3299
+ }
3300
+ return i.map((s) => ({
3301
+ ...s,
3302
+ id: `${s.orientation}:${[...s.before].sort().join("+")}|${[...s.after].sort().join("+")}`
3303
+ }));
3304
+ });
3305
+ }
3306
+ function Tt(t, e, n, a, o) {
3307
+ if (n === 0) return t;
3308
+ const i = new Set(e.before), s = new Set(e.after), l = t.map((c) => {
3309
+ if (e.orientation === "vertical") {
3310
+ if (i.has(c.i)) return { ...c, w: G(c.w + n) };
3311
+ if (s.has(c.i)) return { ...c, x: G(c.x + n), w: G(c.w - n) };
3312
+ } else {
3313
+ if (i.has(c.i)) return { ...c, h: G(c.h + n) };
3314
+ if (s.has(c.i)) return { ...c, y: G(c.y + n), h: G(c.h - n) };
3315
+ }
3316
+ return c;
3317
+ });
3318
+ return l.every((c) => c.x >= 0 && c.y >= 0 && c.x + c.w <= a && c.y + c.h <= o && c.w >= (c.minW ?? 1) && c.h >= (c.minH ?? 1) && c.w <= (c.maxW ?? a) && c.h <= (c.maxH ?? o)) && l.every((c, p) => l.slice(p + 1).every((u) => !mt(c, u))) ? l : null;
3319
+ }
3320
+ function po({
3321
+ label: t,
3322
+ moveLabel: e,
3323
+ resizeLabel: n = t,
3324
+ items: a,
3325
+ initialLayout: o,
3326
+ storageKey: i,
3327
+ columns: s = 12,
3328
+ rows: l = 12,
3329
+ gap: d = 6,
3330
+ className: c,
3331
+ testId: p,
3332
+ onLayoutChange: u
3333
+ }) {
3334
+ const { width: y, containerRef: g, mounted: m } = Rr({ initialWidth: 1200 }), [f, b] = j(720), [w, x] = j(() => In(i, o, s, l)), C = U(null), T = U(null), k = U(null);
3335
+ q(() => {
3336
+ const I = g.current;
3337
+ if (!I) return;
3338
+ const R = () => b(Math.max(240, I.clientHeight));
3339
+ if (R(), typeof ResizeObserver > "u") return;
3340
+ const E = new ResizeObserver(R);
3341
+ return E.observe(I), () => E.disconnect();
3342
+ }, [g]);
3343
+ const L = ce(() => new Map(w.map((I) => [I.i, I])), [w]), O = ce(() => En(w), [w]), N = ce(() => w.map((I) => ({ ...I, isResizable: !1 })), [w]), M = Math.max(16, (f - d * (l - 1)) / l), D = (y + d) / s, P = M + d, z = (I) => {
3344
+ if (!ct(I, o, s, l)) return !1;
3345
+ const R = nr(I, o);
3346
+ return x(R), i && window.localStorage.setItem(i, JSON.stringify(R)), u == null || u(R), !0;
3347
+ }, S = (I, R, E, W, V, B) => {
3348
+ const Z = ge(I), X = (R == null ? void 0 : R.i) ?? (E == null ? void 0 : E.i), re = nt(V), J = B == null ? void 0 : B.getBoundingClientRect();
3349
+ if (!X || !re || !J) {
3350
+ C.current = null;
3351
+ return;
3352
+ }
3353
+ C.current = {
3354
+ origin: Z,
3355
+ draggedId: X,
3356
+ pointerOffsetX: re.x - J.left,
3357
+ pointerOffsetY: re.y - J.top,
3358
+ width: J.width,
3359
+ height: J.height
3360
+ }, T.current = null, k.current = null;
3361
+ }, A = (I, R, E, W, V) => {
3362
+ var oe;
3363
+ const B = C.current, Z = nt(V), X = (oe = g.current) == null ? void 0 : oe.getBoundingClientRect();
3364
+ if (!B || !Z || !X) return;
3365
+ const re = B.origin.find((K) => K.i === B.draggedId);
3366
+ if (!re) return;
3367
+ const J = {
3368
+ left: Z.x - B.pointerOffsetX,
3369
+ top: Z.y - B.pointerOffsetY,
3370
+ width: B.width,
3371
+ height: B.height
3372
+ }, pe = B.origin.filter((K) => K.i !== re.i).map((K) => {
3373
+ const _ = {
3374
+ left: X.left + K.x * D,
3375
+ top: X.top + K.y * P,
3376
+ width: K.w * D - d,
3377
+ height: K.h * P - d
3378
+ }, ur = Z.x >= _.left && Z.x <= _.left + _.width && Z.y >= _.top && Z.y <= _.top + _.height;
3379
+ return { item: K, score: ur ? Rn(J, _) : 0 };
3380
+ }).filter(({ score: K }) => K >= Tn).sort((K, _) => _.score - K.score);
3381
+ let se = null, ee = null;
3382
+ for (const K of pe) {
3383
+ const _ = at(B.origin, re, K.item);
3384
+ if (_ && ct(_, o, s, l)) {
3385
+ se = K.item.i, ee = _;
3386
+ break;
3387
+ }
3388
+ }
3389
+ if (ee && se) {
3390
+ Mt(I, ee), T.current = ge(ee), k.current !== se && (k.current = se, x(ge(ee)));
3391
+ return;
3392
+ }
3393
+ T.current = null, k.current && (k.current = null, Mt(I, B.origin), x(ge(B.origin)));
3394
+ }, F = (I, R, E, W, V) => {
3395
+ var se;
3396
+ const B = C.current, Z = (B == null ? void 0 : B.origin) ?? ge(w), X = T.current;
3397
+ if (C.current = null, T.current = null, k.current = null, X && z(X))
3398
+ return;
3399
+ const re = Z.find((ee) => ee.i === ((R == null ? void 0 : R.i) ?? (E == null ? void 0 : E.i))), J = nt(V), pe = (se = g.current) == null ? void 0 : se.getBoundingClientRect();
3400
+ if (re && J && pe) {
3401
+ const ee = (J.x - pe.left) / D, oe = (J.y - pe.top) / P, K = Z.find((_) => _.i !== re.i && ee >= _.x && ee <= _.x + _.w && oe >= _.y && oe <= _.y + _.h);
3402
+ if (K) {
3403
+ const _ = at(Z, re, K);
3404
+ if (_ && z(_))
3405
+ return;
3406
+ }
3407
+ }
3408
+ z(I) || z(Z);
3409
+ }, Y = (I, R) => {
3410
+ const E = {
3411
+ ArrowLeft: [-1, 0],
3412
+ ArrowRight: [1, 0],
3413
+ ArrowUp: [0, -1],
3414
+ ArrowDown: [0, 1]
3415
+ }[I.key];
3416
+ if (!E) return;
3417
+ I.preventDefault();
3418
+ const W = w.find((X) => X.i === R);
3419
+ if (!W) return;
3420
+ const V = {
3421
+ ...W,
3422
+ x: Math.max(0, Math.min(s - W.w, W.x + E[0])),
3423
+ y: Math.max(0, Math.min(l - W.h, W.y + E[1]))
3424
+ };
3425
+ if (V.x === W.x && V.y === W.y) return;
3426
+ const B = w.find((X) => X.i !== R && mt(V, X));
3427
+ if (!B) {
3428
+ z(w.map((X) => X.i === R ? V : X));
3429
+ return;
3430
+ }
3431
+ const Z = at(w, W, B);
3432
+ Z && z(Z);
3433
+ }, ue = (I, R) => {
3434
+ const E = R.orientation === "vertical" ? "ArrowLeft" : "ArrowUp", W = R.orientation === "vertical" ? "ArrowRight" : "ArrowDown";
3435
+ if (I.key !== E && I.key !== W) return;
3436
+ I.preventDefault();
3437
+ const V = Tt(w, R, I.key === W ? 1 : -1, s, l);
3438
+ V && z(V);
3439
+ }, Te = (I, R) => {
3440
+ if (I.button !== 0) return;
3441
+ I.preventDefault(), I.stopPropagation();
3442
+ const E = I.currentTarget, W = I.pointerId;
3443
+ E.setPointerCapture(W);
3444
+ const V = w.map((oe) => ({ ...oe })), B = R.orientation === "vertical" ? I.clientX : I.clientY, Z = R.orientation === "vertical" ? D : P;
3445
+ let X = V, re = 0, J = 0;
3446
+ const pe = () => {
3447
+ J = 0;
3448
+ const oe = G(re / Z), K = Tt(V, R, oe, s, l);
3449
+ if (!K) {
3450
+ E.dataset.resizeBlocked = "true";
3451
+ return;
3452
+ }
3453
+ delete E.dataset.resizeBlocked, X = K, x(K);
3454
+ }, se = (oe) => {
3455
+ re = (R.orientation === "vertical" ? oe.clientX : oe.clientY) - B, J || (J = window.requestAnimationFrame(pe));
3456
+ }, ee = () => {
3457
+ window.removeEventListener("pointermove", se), window.removeEventListener("pointerup", ee), window.removeEventListener("pointercancel", ee), J && (window.cancelAnimationFrame(J), pe()), delete E.dataset.resizeBlocked, E.hasPointerCapture(W) && E.releasePointerCapture(W), z(X);
3458
+ };
3459
+ window.addEventListener("pointermove", se), window.addEventListener("pointerup", ee), window.addEventListener("pointercancel", ee);
3460
+ };
3461
+ return /* @__PURE__ */ h("div", { ref: g, role: "group", "aria-label": t, "data-testid": p, className: v("relative h-full min-h-0 min-w-0", c), children: [
3462
+ m && /* @__PURE__ */ r(
3463
+ Ir,
3464
+ {
3465
+ width: y,
3466
+ layout: N,
3467
+ gridConfig: { cols: s, rowHeight: M, margin: [d, d], containerPadding: [0, 0], maxRows: l },
3468
+ dragConfig: { enabled: !0, bounded: !0, handle: ".af-workspace-grid-handle", threshold: 3 },
3469
+ resizeConfig: { enabled: !1 },
3470
+ compactor: Dn,
3471
+ autoSize: !1,
3472
+ style: { height: f },
3473
+ className: "h-full",
3474
+ onDragStart: S,
3475
+ onDrag: A,
3476
+ onDragStop: F,
3477
+ children: a.map((I) => {
3478
+ const R = L.get(I.id) ?? o.find((E) => E.i === I.id);
3479
+ return /* @__PURE__ */ h(
3480
+ "div",
3481
+ {
3482
+ "data-workspace-grid-item": !0,
3483
+ "data-testid": `workspace-grid-item-${I.id}`,
3484
+ "data-grid-x": R == null ? void 0 : R.x,
3485
+ "data-grid-y": R == null ? void 0 : R.y,
3486
+ "data-grid-w": R == null ? void 0 : R.w,
3487
+ "data-grid-h": R == null ? void 0 : R.h,
3488
+ className: "group/workspace-grid-item min-h-0 min-w-0",
3489
+ children: [
3490
+ /* @__PURE__ */ r(
3491
+ "button",
3492
+ {
3493
+ type: "button",
3494
+ "data-workspace-drag-handle": !0,
3495
+ "data-testid": `workspace-drag-handle-${I.id}`,
3496
+ "aria-label": e(I.label),
3497
+ onKeyDown: (E) => Y(E, I.id),
3498
+ className: "af-workspace-grid-handle absolute left-1/2 top-0.5 z-30 grid size-5 -translate-x-1/2 cursor-grab touch-none place-items-center rounded-control bg-surface-raised text-graphite shadow-pop transition-opacity hover:text-ink active:cursor-grabbing",
3499
+ children: /* @__PURE__ */ r(wt, { size: 12, "aria-hidden": !0 })
3500
+ }
3501
+ ),
3502
+ /* @__PURE__ */ r("div", { className: "h-full min-h-0 min-w-0", children: I.content })
3503
+ ]
3504
+ },
3505
+ I.id
3506
+ );
3507
+ })
3508
+ }
3509
+ ),
3510
+ m && O.map((I) => {
3511
+ const R = I.orientation === "vertical", E = I.start * (R ? P : D), W = (I.end - I.start) * (R ? P : D) - d, V = I.boundary * (R ? D : P) - d / 2;
3512
+ return /* @__PURE__ */ r(
3513
+ "div",
3514
+ {
3515
+ role: "separator",
3516
+ tabIndex: 0,
3517
+ "aria-label": n,
3518
+ "aria-orientation": R ? "vertical" : "horizontal",
3519
+ "aria-valuemin": 1,
3520
+ "aria-valuemax": R ? s - 1 : l - 1,
3521
+ "aria-valuenow": I.boundary,
3522
+ "data-workspace-resize-divider": !0,
3523
+ "data-orientation": I.orientation,
3524
+ "data-boundary": I.boundary,
3525
+ "data-before-panels": I.before.join(" "),
3526
+ "data-after-panels": I.after.join(" "),
3527
+ onPointerDown: (B) => Te(B, I),
3528
+ onKeyDown: (B) => ue(B, I),
3529
+ className: v(
3530
+ "group absolute z-40 grid touch-none place-items-center outline-none hover:bg-rust/20 focus-visible:bg-rust/20 data-[resize-blocked=true]:cursor-not-allowed data-[resize-blocked=true]:bg-down/25",
3531
+ R ? "-translate-x-1/2 cursor-col-resize" : "-translate-y-1/2 cursor-row-resize"
3532
+ ),
3533
+ style: R ? { left: V, top: E, width: Math.max(10, d), height: W } : { left: E, top: V, width: W, height: Math.max(10, d) },
3534
+ children: /* @__PURE__ */ r("span", { className: "grid size-5 place-items-center rounded-control bg-surface-raised text-graphite opacity-0 shadow-pop group-hover:opacity-100 group-focus-visible:opacity-100", children: R ? /* @__PURE__ */ r(wt, { size: 12, "aria-hidden": !0 }) : /* @__PURE__ */ r(Dr, { size: 12, "aria-hidden": !0 }) })
3535
+ },
3536
+ I.id
3537
+ );
3538
+ })
3539
+ ] });
3540
+ }
3541
+ function lr(t) {
3542
+ const e = U(null), n = U(/* @__PURE__ */ new Map()), a = U(null), o = U(!1);
3543
+ return Ye(() => {
3544
+ const l = () => {
3545
+ const c = n.current.get(t), p = a.current;
3546
+ !c || !p || (p.style.transform = `translateX(${c.offsetLeft}px)`, p.style.width = `${c.offsetWidth}px`);
3547
+ };
3548
+ l(), o.current || requestAnimationFrame(() => {
3549
+ var c;
3550
+ (c = a.current) == null || c.classList.add("is-ready"), o.current = !0;
3551
+ });
3552
+ const d = new ResizeObserver(l);
3553
+ return e.current && d.observe(e.current), () => d.disconnect();
3554
+ }, [t]), { listRef: e, indRef: a, setBtn: (l) => (d) => {
3555
+ d ? n.current.set(l, d) : n.current.delete(l);
3556
+ }, focusTab: (l) => {
3557
+ var d;
3558
+ return (d = n.current.get(l)) == null ? void 0 : d.focus();
3559
+ } };
3560
+ }
3561
+ function On({
3562
+ tabs: t,
3563
+ value: e,
3564
+ onChange: n,
3565
+ onReorder: a,
3566
+ size: o = "md",
3567
+ variant: i = "underline",
3568
+ className: s,
3569
+ ariaLabel: l
3570
+ }) {
3571
+ const { listRef: d, indRef: c, setBtn: p, focusTab: u } = lr(e), [y, g] = j(null), [m, f] = j(null), b = o === "sm" ? "text-body-sm" : "text-body", w = !!a;
3572
+ return /* @__PURE__ */ h(
3573
+ "div",
3574
+ {
3575
+ ref: d,
3576
+ role: "tablist",
3577
+ "aria-label": l,
3578
+ "aria-orientation": "horizontal",
3579
+ "data-variant": i,
3580
+ className: v("relative flex items-center overflow-x-auto", i === "toolbar" ? "gap-1" : o === "sm" ? "gap-4" : "gap-5", s),
3581
+ children: [
3582
+ t.map((x) => /* @__PURE__ */ h(
3583
+ "button",
3584
+ {
3585
+ ref: p(x.key),
3586
+ type: "button",
3587
+ role: "tab",
3588
+ "data-testid": x.testId,
3589
+ "aria-selected": e === x.key,
3590
+ tabIndex: e === x.key ? 0 : -1,
3591
+ draggable: w,
3592
+ onClick: () => n(x.key),
3593
+ onKeyDown: (C) => {
3594
+ var O;
3595
+ const T = t.findIndex((N) => N.key === x.key);
3596
+ let k = T;
3597
+ if (C.key === "ArrowRight") k = (T + 1) % t.length;
3598
+ else if (C.key === "ArrowLeft") k = (T - 1 + t.length) % t.length;
3599
+ else if (C.key === "Home") k = 0;
3600
+ else if (C.key === "End") k = t.length - 1;
3601
+ else return;
3602
+ C.preventDefault();
3603
+ const L = (O = t[k]) == null ? void 0 : O.key;
3604
+ L != null && (n(L), requestAnimationFrame(() => u(L)));
3605
+ },
3606
+ onDragStart: w ? (C) => {
3607
+ g(x.key), C.dataTransfer.effectAllowed = "move", C.dataTransfer.setData("text/plain", x.key);
3608
+ } : void 0,
3609
+ onDragEnd: w ? () => {
3610
+ g(null), f(null);
3611
+ } : void 0,
3612
+ onDragOver: w ? (C) => {
3613
+ C.preventDefault(), C.dataTransfer.dropEffect = "move", m !== x.key && f(x.key);
3614
+ } : void 0,
3615
+ onDrop: w ? (C) => {
3616
+ C.preventDefault();
3617
+ const T = C.dataTransfer.getData("text/plain") || y;
3618
+ T && T !== x.key && (a == null || a(T, x.key)), g(null), f(null);
3619
+ } : void 0,
3620
+ className: v(
3621
+ "relative whitespace-nowrap font-sohne outline-none transition focus-visible:ring-2 focus-visible:ring-rust/35",
3622
+ i === "toolbar" ? "inline-flex h-6 min-h-6 items-center rounded-control border px-2 text-micro" : "min-h-control-default px-0.5 pb-2 pt-1",
3623
+ i === "toolbar" ? void 0 : b,
3624
+ e === x.key ? i === "toolbar" ? "border-border bg-surface-muted font-[500] text-ink" : "font-[480] text-ink" : i === "toolbar" ? "border-transparent text-graphite hover:bg-surface-hover hover:text-ink" : "text-graphite hover:text-ink",
3625
+ w && "cursor-grab active:cursor-grabbing",
3626
+ y === x.key && "opacity-40",
3627
+ m === x.key && y && y !== x.key && "text-ink"
3628
+ ),
3629
+ children: [
3630
+ x.label,
3631
+ x.count !== void 0 && /* @__PURE__ */ r("span", { className: "ml-1.5 text-caption text-graphite", children: x.count }),
3632
+ x.live && /* @__PURE__ */ h(fe, { children: [
3633
+ /* @__PURE__ */ r("span", { className: "sr-only", children: x.liveLabel ?? "Live" }),
3634
+ /* @__PURE__ */ r(
3635
+ "span",
3636
+ {
3637
+ title: x.liveLabel,
3638
+ className: "absolute -right-2 top-0 h-1.5 w-1.5 animate-pulse rounded-full bg-up",
3639
+ "aria-hidden": !0
3640
+ }
3641
+ )
3642
+ ] })
3643
+ ]
3644
+ },
3645
+ x.key
3646
+ )),
3647
+ i === "underline" && /* @__PURE__ */ r("span", { ref: c, className: "t-tab-underline", "aria-hidden": !0 })
3648
+ ]
3649
+ }
3650
+ );
3651
+ }
3652
+ function mo({
3653
+ label: t,
3654
+ searchLabel: e,
3655
+ searchPlaceholder: n,
3656
+ categories: a,
3657
+ category: o,
3658
+ onCategoryChange: i,
3659
+ query: s,
3660
+ onQueryChange: l,
3661
+ items: d,
3662
+ selected: c,
3663
+ onToggle: p,
3664
+ addedLabel: u,
3665
+ emptyLabel: y,
3666
+ testIdPrefix: g,
3667
+ className: m
3668
+ }) {
3669
+ const f = s.trim().toLocaleLowerCase(), w = d.filter(
3670
+ (x) => (o === "all" || x.category === o) && (!f || x.title.toLocaleLowerCase().includes(f))
3671
+ ).reduce((x, C) => {
3672
+ var T;
3673
+ return (x[T = C.category] ?? (x[T] = [])).push(C), x;
3674
+ }, {});
3675
+ return /* @__PURE__ */ h("div", { "aria-label": t, className: v("min-w-0 space-y-4", m), children: [
3676
+ /* @__PURE__ */ h("div", { className: "flex min-w-0 flex-col gap-2 border-b border-divider pb-2 sm:flex-row sm:items-end sm:justify-between", children: [
3677
+ /* @__PURE__ */ r(
3678
+ On,
3679
+ {
3680
+ size: "sm",
3681
+ ariaLabel: t,
3682
+ value: o,
3683
+ onChange: i,
3684
+ tabs: a.map((x) => ({ key: x.value, label: x.label })),
3685
+ className: "min-w-0"
3686
+ }
3687
+ ),
3688
+ /* @__PURE__ */ r(gn, { label: e, start: /* @__PURE__ */ r(ut, { size: 13, "aria-hidden": !0 }), className: "w-full shrink-0 sm:w-48", children: /* @__PURE__ */ r(ht, { density: "compact", value: s, onChange: (x) => l(x.target.value), "aria-label": e, placeholder: n }) })
3689
+ ] }),
3690
+ Object.keys(w).length === 0 && /* @__PURE__ */ r("p", { className: "py-12 text-center font-sohne text-body-sm text-graphite", children: y }),
3691
+ Object.entries(w).map(([x, C]) => {
3692
+ var T;
3693
+ return /* @__PURE__ */ h("section", { "aria-labelledby": `widget-picker-${x}`, className: "space-y-2.5", children: [
3694
+ /* @__PURE__ */ r("h3", { id: `widget-picker-${x}`, className: "font-sohne text-body-sm font-[500] text-ink", children: ((T = a.find((k) => k.value === x)) == null ? void 0 : T.label) ?? x }),
3695
+ /* @__PURE__ */ r("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4", children: C.map((k) => {
3696
+ const L = c.includes(k.id);
3697
+ return /* @__PURE__ */ h(
3698
+ _r,
3699
+ {
3700
+ "data-testid": g ? `${g}-${k.id}` : void 0,
3701
+ "aria-pressed": L,
3702
+ "aria-label": k.title,
3703
+ active: L,
3704
+ onClick: () => p(k.id),
3705
+ "aria-disabled": k.disabled || void 0,
3706
+ className: v(
3707
+ "group relative min-h-36 overflow-hidden rounded-panel border border-border bg-surface-card p-3 text-left hover:border-graphite hover:bg-surface-hover",
3708
+ L && "border-graphite bg-surface-muted",
3709
+ k.disabled && "pointer-events-none opacity-45"
3710
+ ),
3711
+ children: [
3712
+ /* @__PURE__ */ h("span", { className: "flex min-w-0 items-center justify-between gap-2 font-sohne text-caption font-[500] text-ink", children: [
3713
+ /* @__PURE__ */ r("span", { className: "truncate", children: k.title }),
3714
+ L && /* @__PURE__ */ h("span", { className: "inline-flex shrink-0 items-center gap-1 text-micro font-[450] text-graphite", children: [
3715
+ /* @__PURE__ */ r(ve, { size: 11, "aria-hidden": !0 }),
3716
+ u
3717
+ ] })
3718
+ ] }),
3719
+ /* @__PURE__ */ r("div", { className: "mt-3 h-24 overflow-hidden rounded-control border border-divider bg-surface-canvas p-2", children: k.preview })
3720
+ ]
3721
+ },
3722
+ k.id
3723
+ );
3724
+ }) })
3725
+ ] }, x);
3726
+ })
3727
+ ] });
3728
+ }
3729
+ function bo(t) {
3730
+ return /* @__PURE__ */ r(hr.Root, { ...t, className: `shrink-0 bg-divider data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px ${t.className ?? ""}` });
3731
+ }
3732
+ function go(t) {
3733
+ const { children: e, className: n, ...a } = t;
3734
+ return /* @__PURE__ */ h(Oe.Root, { ...a, className: `overflow-hidden ${n ?? ""}`, children: [
3735
+ /* @__PURE__ */ r(Oe.Viewport, { className: "size-full", children: e }),
3736
+ /* @__PURE__ */ r(Oe.Scrollbar, { orientation: "vertical", className: "flex w-2 touch-none select-none p-0.5", children: /* @__PURE__ */ r(Oe.Thumb, { className: "flex-1 rounded-full bg-dove" }) }),
3737
+ /* @__PURE__ */ r(Oe.Corner, {})
3738
+ ] });
3739
+ }
3740
+ const xo = fr.Root, Dt = [
3741
+ "var(--color-surface-warm)",
3742
+ "var(--color-surface-cool)",
3743
+ "var(--color-surface-muted)",
3744
+ "var(--color-surface-raised)"
3745
+ ];
3746
+ function cr(t) {
3747
+ let e = 0;
3748
+ for (let n = 0; n < t.length; n++) e = e * 31 + t.charCodeAt(n) >>> 0;
3749
+ return Dt[e % Dt.length];
3750
+ }
3751
+ function vo({
3752
+ initials: t,
3753
+ tint: e,
3754
+ size: n = 36,
3755
+ className: a,
3756
+ src: o,
3757
+ alt: i
3758
+ }) {
3759
+ return o ? /* @__PURE__ */ r(
3760
+ "img",
3761
+ {
3762
+ src: o,
3763
+ alt: i ?? t,
3764
+ className: v("inline-block shrink-0 rounded-full object-cover", a),
3765
+ style: { width: n, height: n }
3766
+ }
3767
+ ) : /* @__PURE__ */ r(
3768
+ "span",
3769
+ {
3770
+ className: v(
3771
+ "inline-flex items-center justify-center rounded-full font-sohne font-[500] text-ink",
3772
+ a
3773
+ ),
3774
+ style: {
3775
+ backgroundColor: e ?? cr(t),
3776
+ width: n,
3777
+ height: n,
3778
+ fontSize: Math.round(n * 0.36)
3779
+ },
3780
+ children: t.slice(0, 2).toUpperCase()
3781
+ }
3782
+ );
3783
+ }
3784
+ function wo({ label: t, fallback: e, sources: n = [], tint: a, size: o = 20, className: i }) {
3785
+ const [s, l] = j(0), [d, c] = j(!1), p = n[s];
3786
+ return q(() => {
3787
+ l(0), c(!1);
3788
+ }, [t, n.join("|")]), /* @__PURE__ */ h(
3789
+ "span",
3790
+ {
3791
+ role: "img",
3792
+ "aria-label": t,
3793
+ "data-image-state": d ? "loaded" : p ? "loading" : "fallback",
3794
+ className: v("relative inline-grid shrink-0 place-items-center overflow-hidden rounded-full font-sohne font-[600] text-ink", i),
3795
+ style: { width: o, height: o, backgroundColor: d ? "transparent" : a ?? cr(t) },
3796
+ children: [
3797
+ !d && /* @__PURE__ */ r("span", { "aria-hidden": !0, style: { fontSize: Math.max(7, Math.round(o * 0.42)), lineHeight: 1 }, children: e.slice(0, 2).toUpperCase() }),
3798
+ p && /* @__PURE__ */ r(
3799
+ "img",
3800
+ {
3801
+ src: p,
3802
+ alt: "",
3803
+ "aria-hidden": !0,
3804
+ onLoad: () => c(!0),
3805
+ onError: () => {
3806
+ s + 1 < n.length ? l((u) => u + 1) : c(!1);
3807
+ },
3808
+ className: v("absolute inset-0 size-full rounded-full object-contain", d ? "opacity-100" : "opacity-0")
3809
+ },
3810
+ p
3811
+ )
3812
+ ]
3813
+ }
3814
+ );
3815
+ }
3816
+ function yo({ children: t, tone: e = "neutral", size: n = "default", className: a, ...o }) {
3817
+ const i = {
3818
+ neutral: "bg-fog text-graphite",
3819
+ warm: "bg-surface-warm text-rust",
3820
+ cool: "bg-surface-cool text-ink",
3821
+ success: "bg-up/15 text-up",
3822
+ danger: "bg-down/15 text-down",
3823
+ warning: "bg-warning/15 text-warning"
3824
+ }, s = {
3825
+ micro: "h-4 rounded-indicator px-1.5 text-micro font-[500]",
3826
+ compact: "h-5 rounded-control px-2 text-data font-[500]",
3827
+ default: "min-h-7 rounded-full px-3 py-1 text-[13px] font-[450]"
3828
+ };
3829
+ return /* @__PURE__ */ r(
3830
+ "span",
3831
+ {
3832
+ ...o,
3833
+ className: v(
3834
+ "inline-flex shrink-0 items-center justify-center whitespace-nowrap font-sohne",
3835
+ i[e],
3836
+ s[n],
3837
+ a
3838
+ ),
3839
+ children: t
3840
+ }
3841
+ );
3842
+ }
3843
+ const ie = 8;
3844
+ function It(t, e, n) {
3845
+ return Math.min(Math.max(e, t), n);
3846
+ }
3847
+ function Hn({
3848
+ content: t,
3849
+ children: e,
3850
+ width: n = 240,
3851
+ variant: a = "panel"
3852
+ }) {
3853
+ const o = U(null), i = U(null), s = U(null), [l, d] = j(null), [c, p] = j(!1), u = () => {
3854
+ s.current && clearTimeout(s.current), s.current = null;
3855
+ }, y = Se(() => {
3856
+ u();
3857
+ const m = o.current;
3858
+ if (!m) return;
3859
+ const f = m.getBoundingClientRect();
3860
+ p(!1), d({
3861
+ top: f.bottom + 5,
3862
+ left: f.left,
3863
+ maxH: a === "hint" ? 96 : 240
3864
+ });
3865
+ }, [a]), g = Se(() => {
3866
+ u(), s.current = setTimeout(() => {
3867
+ d(null), p(!1);
3868
+ }, 140);
3869
+ }, []);
3870
+ return Ye(() => {
3871
+ if (!l) return;
3872
+ const m = i.current, f = o.current;
3873
+ if (!m || !f) return;
3874
+ const b = f.getBoundingClientRect(), w = m.getBoundingClientRect(), x = w.width || (a === "hint" ? 160 : n), C = w.height || 32, T = window.innerWidth, k = window.innerHeight, O = k - b.bottom - ie < C + 8 && b.top > C + ie;
3875
+ let N = O ? b.top - 5 - C : b.bottom + 5;
3876
+ N = It(N, ie, Math.max(ie, k - ie - C));
3877
+ let M;
3878
+ a === "hint" ? M = b.left + b.width / 2 - x / 2 : M = b.left, M = It(M, ie, Math.max(ie, T - ie - x));
3879
+ const D = O ? Math.max(a === "hint" ? 48 : 120, b.top - ie * 2) : Math.max(a === "hint" ? 48 : 120, k - N - ie), P = { top: N, left: M, maxH: D };
3880
+ (!c || Math.abs(P.top - l.top) > 0.5 || Math.abs(P.left - l.left) > 0.5 || Math.abs(P.maxH - l.maxH) > 0.5) && (d(P), p(!0));
3881
+ }, [l, c, a, n, t]), /* @__PURE__ */ h(fe, { children: [
3882
+ /* @__PURE__ */ r(
3883
+ "span",
3884
+ {
3885
+ ref: o,
3886
+ className: "inline-flex",
3887
+ onMouseEnter: y,
3888
+ onMouseLeave: g,
3889
+ onFocus: y,
3890
+ onBlur: g,
3891
+ children: e
3892
+ }
3893
+ ),
3894
+ typeof document < "u" && ze(
3895
+ /* @__PURE__ */ r(Ze, { children: l && /* @__PURE__ */ r(
3896
+ Me.div,
3897
+ {
3898
+ ref: i,
3899
+ role: "tooltip",
3900
+ initial: { opacity: 0, y: -4 },
3901
+ animate: { opacity: c ? 1 : 0, y: 0 },
3902
+ exit: { opacity: 0, y: -4 },
3903
+ transition: xe.fade,
3904
+ onMouseEnter: u,
3905
+ onMouseLeave: g,
3906
+ style: {
3907
+ position: "fixed",
3908
+ top: l.top,
3909
+ left: l.left,
3910
+ maxHeight: l.maxH,
3911
+ ...a === "hint" ? { maxWidth: `min(${n}px, calc(100vw - ${ie * 2}px))` } : { width: n }
3912
+ },
3913
+ className: v(
3914
+ "z-[60]",
3915
+ a === "hint" ? "pointer-events-none w-max rounded-md bg-ink px-2 py-1 shadow-pop" : "overflow-y-auto rounded-panel bg-surface-raised p-3 shadow-pop ring-1 ring-border"
3916
+ ),
3917
+ children: a === "hint" ? /* @__PURE__ */ r("div", { className: "font-sohne text-[11px] font-[480] leading-snug text-pure-white", children: t }) : t
3918
+ }
3919
+ ) }),
3920
+ document.body
3921
+ )
3922
+ ] });
3923
+ }
3924
+ function ko({
3925
+ label: t,
3926
+ children: e
3927
+ }) {
3928
+ return /* @__PURE__ */ r(Hn, { content: t, variant: "hint", children: e });
3929
+ }
3930
+ function No({
3931
+ options: t,
3932
+ value: e,
3933
+ onChange: n,
3934
+ onBlocked: a,
3935
+ className: o,
3936
+ size: i = "md",
3937
+ ariaLabel: s
3938
+ }) {
3939
+ var m;
3940
+ const { listRef: l, indRef: d, setBtn: c } = lr(e), p = i === "sm" ? "gap-0.5 rounded-lg p-0.5" : "gap-1 rounded-xl p-1", u = i === "sm" ? "rounded-md py-1 text-caption font-[450]" : "rounded-lg py-1.5 text-[14px] font-[450]", y = i === "sm" ? "t-seg-pill t-seg-pill-sm" : "t-seg-pill", g = ((m = t.find((f) => f.key === e)) == null ? void 0 : m.tone) ?? "neutral";
3941
+ return /* @__PURE__ */ h("div", { ref: l, role: "tablist", "aria-label": s, className: v("relative flex bg-surface-muted/50", p, o), children: [
3942
+ /* @__PURE__ */ r("span", { ref: d, className: y, "data-tone": g, "aria-hidden": !0 }),
3943
+ t.map((f) => {
3944
+ const b = e === f.key;
3945
+ return /* @__PURE__ */ r(
3946
+ "button",
3947
+ {
3948
+ ref: c(f.key),
3949
+ type: "button",
3950
+ role: "tab",
3951
+ "aria-selected": b,
3952
+ onClick: () => f.disabled ? a == null ? void 0 : a(f.key) : n(f.key),
3953
+ className: v(
3954
+ "relative z-[1] flex-1 text-center font-sohne outline-none transition-colors focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-rust/35",
3955
+ u,
3956
+ b ? f.tone === "up" ? "text-up" : f.tone === "down" ? "text-down" : "text-ink" : "text-graphite hover:text-ink",
3957
+ f.disabled && !b && "cursor-not-allowed opacity-45 hover:text-graphite"
3958
+ ),
3959
+ children: f.label
3960
+ },
3961
+ f.key
3962
+ );
3963
+ })
3964
+ ] });
3965
+ }
3966
+ const Un = {
3967
+ emphasis: "bg-apricot-wash text-rust ring-rust/25",
3968
+ accent: "bg-sky-wash text-data-blue ring-data-blue/20",
3969
+ default: "bg-fog text-ink ring-dove/55",
3970
+ muted: "bg-pure-white text-graphite ring-border"
3971
+ }, jn = {
3972
+ xs: "max-w-[7.5rem] truncate rounded-md px-1.5 py-0.5 text-[10.5px] leading-snug",
3973
+ sm: "rounded-full px-2 py-0.5 text-[11px] leading-tight"
3974
+ };
3975
+ function Rt({
3976
+ children: t,
3977
+ level: e = "default",
3978
+ size: n = "xs",
3979
+ className: a,
3980
+ title: o
3981
+ }) {
3982
+ return /* @__PURE__ */ r(
3983
+ "span",
3984
+ {
3985
+ title: o,
3986
+ className: v(
3987
+ "inline-flex shrink-0 items-center font-sohne font-[480] ring-1 ring-inset",
3988
+ Un[e],
3989
+ jn[n],
3990
+ a
3991
+ ),
3992
+ children: t
3993
+ }
3994
+ );
3995
+ }
3996
+ function Co({
3997
+ items: t,
3998
+ limit: e = 3,
3999
+ size: n = "xs",
4000
+ levelForItem: a = () => "default",
4001
+ labelForItem: o,
4002
+ className: i
4003
+ }) {
4004
+ if (!t.length) return null;
4005
+ const s = t.slice(0, e), l = t.length - s.length;
4006
+ return /* @__PURE__ */ h("div", { className: v("flex min-w-0 flex-nowrap items-center gap-1", i), children: [
4007
+ s.map((d) => /* @__PURE__ */ r(Rt, { level: a(d), size: n, title: o(d), children: o(d) }, d)),
4008
+ l > 0 && /* @__PURE__ */ h(Rt, { level: "muted", size: n, children: [
4009
+ "+",
4010
+ l
4011
+ ] })
4012
+ ] });
4013
+ }
4014
+ function So({
4015
+ label: t,
4016
+ value: e,
4017
+ delta: n,
4018
+ direction: a = "up"
4019
+ }) {
4020
+ const o = a === "up";
4021
+ return /* @__PURE__ */ h(Jt, { className: "flex flex-col gap-2 p-5", children: [
4022
+ /* @__PURE__ */ r(dn, { children: t }),
4023
+ /* @__PURE__ */ r("span", { className: "font-sohne text-heading-sm font-[480] leading-none tracking-[0] text-ink", children: e }),
4024
+ n && /* @__PURE__ */ h("span", { className: v("flex items-center gap-1 text-[12px]", o ? "text-up" : "text-down"), children: [
4025
+ o ? "↑" : "↓",
4026
+ " ",
4027
+ n
4028
+ ] })
4029
+ ] });
4030
+ }
4031
+ function zo({
4032
+ title: t,
4033
+ rows: e
4034
+ }) {
4035
+ return /* @__PURE__ */ h(Jt, { className: "flex flex-col gap-3 p-5", children: [
4036
+ /* @__PURE__ */ r(cn, { children: t }),
4037
+ /* @__PURE__ */ r("ul", { className: "flex flex-col gap-3", children: e.map((n) => /* @__PURE__ */ h("li", { className: "flex items-center justify-between font-sohne text-[14px]", children: [
4038
+ /* @__PURE__ */ r("span", { className: "text-graphite", children: n.name }),
4039
+ /* @__PURE__ */ r("span", { className: "font-[480] text-ink", children: n.count })
4040
+ ] }, n.name)) })
4041
+ ] });
4042
+ }
4043
+ function Pt(t, e, n, a = 6) {
4044
+ const o = Math.max(...t, 1), i = Math.min(...t, 0), s = o - i || 1, l = (e - a * 2) / (t.length - 1 || 1);
4045
+ return t.map((d, c) => {
4046
+ const p = a + c * l, u = n - a - (d - i) / s * (n - a * 2);
4047
+ return `${c === 0 ? "M" : "L"}${p.toFixed(1)},${u.toFixed(1)}`;
4048
+ }).join(" ");
4049
+ }
4050
+ function Mo({
4051
+ current: t,
4052
+ previous: e,
4053
+ width: n = 280,
4054
+ height: a = 96,
4055
+ ariaLabel: o
4056
+ }) {
4057
+ return /* @__PURE__ */ h("svg", { width: "100%", viewBox: `0 0 ${n} ${a}`, role: "img", "aria-label": o, focusable: "false", className: "pointer-events-none select-none outline-none", children: [
4058
+ e && /* @__PURE__ */ r(
4059
+ "path",
4060
+ {
4061
+ d: Pt(e, n, a),
4062
+ fill: "none",
4063
+ stroke: "var(--color-rust)",
4064
+ strokeWidth: 2,
4065
+ strokeLinecap: "round",
4066
+ opacity: 0.7
4067
+ }
4068
+ ),
4069
+ /* @__PURE__ */ r(
4070
+ "path",
4071
+ {
4072
+ d: Pt(t, n, a),
4073
+ fill: "none",
4074
+ stroke: "var(--color-data-blue)",
4075
+ strokeWidth: 2,
4076
+ strokeLinecap: "round"
4077
+ }
4078
+ )
4079
+ ] });
4080
+ }
4081
+ function To({ pct: t, size: e = 96 }) {
4082
+ const n = e / 2 - 8, a = 2 * Math.PI * n;
4083
+ return /* @__PURE__ */ h("svg", { width: e, height: e, viewBox: `0 0 ${e} ${e}`, role: "img", "aria-label": `${t}%`, focusable: "false", className: "pointer-events-none select-none outline-none", children: [
4084
+ /* @__PURE__ */ r("circle", { cx: e / 2, cy: e / 2, r: n, fill: "none", stroke: "var(--color-pure-white)", strokeWidth: 10 }),
4085
+ /* @__PURE__ */ r(
4086
+ "circle",
4087
+ {
4088
+ cx: e / 2,
4089
+ cy: e / 2,
4090
+ r: n,
4091
+ fill: "none",
4092
+ stroke: "var(--color-rust)",
4093
+ strokeWidth: 10,
4094
+ strokeLinecap: "round",
4095
+ strokeDasharray: `${a * t / 100} ${a}`,
4096
+ transform: `rotate(-90 ${e / 2} ${e / 2})`
4097
+ }
4098
+ ),
4099
+ /* @__PURE__ */ h(
4100
+ "text",
4101
+ {
4102
+ x: "50%",
4103
+ y: "52%",
4104
+ textAnchor: "middle",
4105
+ dominantBaseline: "middle",
4106
+ className: "font-sohne font-[480]",
4107
+ fontSize: e * 0.22,
4108
+ fill: "var(--color-ink)",
4109
+ children: [
4110
+ t,
4111
+ "%"
4112
+ ]
4113
+ }
4114
+ )
4115
+ ] });
4116
+ }
4117
+ const H = {
4118
+ rust: "var(--color-rust)",
4119
+ blue: "var(--color-data-blue)",
4120
+ ink: "var(--color-ink)",
4121
+ ash: "var(--color-ash)",
4122
+ graphite: "var(--color-graphite)",
4123
+ dove: "var(--color-dove)",
4124
+ grid: "var(--color-chart-grid)",
4125
+ axis: "var(--color-chart-axis)",
4126
+ canvas: "var(--color-surface-canvas)",
4127
+ surface: "var(--color-surface-raised)",
4128
+ up: "var(--color-up)",
4129
+ down: "var(--color-down)",
4130
+ apricot: "var(--color-apricot-wash)",
4131
+ sky: "var(--color-sky-wash)",
4132
+ white: "var(--color-surface-raised)",
4133
+ font: "var(--font-sohne)"
4134
+ }, Lt = ["var(--color-data-1)", "var(--color-data-2)", "var(--color-data-3)", "var(--color-data-4)", "var(--color-data-5)"], Xe = {
4135
+ tick: { fill: H.graphite, fontSize: 12, fontFamily: H.font },
4136
+ tickLine: !1,
4137
+ axisLine: { stroke: H.axis },
4138
+ tickMargin: 8
4139
+ }, dr = {
4140
+ stroke: H.grid,
4141
+ strokeOpacity: 1,
4142
+ strokeDasharray: "2 6",
4143
+ vertical: !1
4144
+ };
4145
+ function et({
4146
+ active: t,
4147
+ payload: e,
4148
+ label: n,
4149
+ valueFormat: a = String,
4150
+ labelFormat: o = String
4151
+ }) {
4152
+ return !t || !(e != null && e.length) ? null : /* @__PURE__ */ h("div", { role: "tooltip", className: "rounded-panel border border-border bg-surface-raised px-3 py-2 shadow-pop", style: { fontFamily: H.font }, children: [
4153
+ n != null && /* @__PURE__ */ r("div", { className: "mb-1 text-caption text-graphite", children: o(n) }),
4154
+ /* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: e.map((i, s) => /* @__PURE__ */ h("div", { className: "flex items-center gap-2 text-body-sm text-ink", children: [
4155
+ /* @__PURE__ */ r("span", { className: "size-2 rounded-indicator", style: { backgroundColor: i.color }, "aria-hidden": !0 }),
4156
+ /* @__PURE__ */ r("span", { className: "text-graphite", children: i.name }),
4157
+ /* @__PURE__ */ r("span", { className: "ml-auto font-data tabular-nums", children: a(i.value ?? "") })
4158
+ ] }, `${i.name ?? "series"}-${s}`)) })
4159
+ ] });
4160
+ }
4161
+ function Do({ data: t, height: e = 240, valueFormat: n = String, showPrevious: a = !0, ariaLabel: o = "Area trend chart" }) {
4162
+ const i = Q().replace(/:/g, "");
4163
+ return /* @__PURE__ */ r(Le, { width: "100%", height: e, children: /* @__PURE__ */ h(Kt, { data: t, margin: { top: 8, right: 8, left: 0, bottom: 0 }, accessibilityLayer: !1, tabIndex: -1, role: "img", "aria-label": o, children: [
4164
+ /* @__PURE__ */ h("defs", { children: [
4165
+ /* @__PURE__ */ h("linearGradient", { id: `${i}-current`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
4166
+ /* @__PURE__ */ r("stop", { offset: "0%", stopColor: H.blue, stopOpacity: 0.26 }),
4167
+ /* @__PURE__ */ r("stop", { offset: "100%", stopColor: H.blue, stopOpacity: 0 })
4168
+ ] }),
4169
+ /* @__PURE__ */ h("linearGradient", { id: `${i}-previous`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
4170
+ /* @__PURE__ */ r("stop", { offset: "0%", stopColor: H.rust, stopOpacity: 0.18 }),
4171
+ /* @__PURE__ */ r("stop", { offset: "100%", stopColor: H.rust, stopOpacity: 0 })
4172
+ ] })
4173
+ ] }),
4174
+ /* @__PURE__ */ r(_t, { ...dr }),
4175
+ /* @__PURE__ */ r(Ft, { dataKey: "label", ...Xe }),
4176
+ /* @__PURE__ */ r(Wt, { ...Xe, width: 52, tickFormatter: n }),
4177
+ /* @__PURE__ */ r(Je, { cursor: { stroke: H.dove }, content: /* @__PURE__ */ r(et, { valueFormat: n }) }),
4178
+ a && /* @__PURE__ */ r(ot, { type: "monotone", dataKey: "previous", name: "Previous", stroke: H.rust, strokeWidth: 1.5, fill: `url(#${i}-previous)`, dot: !1 }),
4179
+ /* @__PURE__ */ r(ot, { type: "monotone", dataKey: "current", name: "Current", stroke: H.blue, strokeWidth: 2, fill: `url(#${i}-current)`, dot: !1 })
4180
+ ] }) });
4181
+ }
4182
+ function Bn({ data: t, height: e = 240, valueFormat: n = String, signColor: a = !1, ariaLabel: o = "Bar chart" }) {
4183
+ return /* @__PURE__ */ r(Le, { width: "100%", height: e, children: /* @__PURE__ */ h(Lr, { data: t, margin: { top: 8, right: 8, left: 0, bottom: 0 }, accessibilityLayer: !1, tabIndex: -1, role: "img", "aria-label": o, children: [
4184
+ /* @__PURE__ */ r(_t, { ...dr }),
4185
+ /* @__PURE__ */ r(Ft, { dataKey: "label", ...Xe }),
4186
+ /* @__PURE__ */ r(Wt, { ...Xe, width: 52, tickFormatter: n }),
4187
+ /* @__PURE__ */ r(Je, { cursor: { fill: H.dove, fillOpacity: 0.12 }, content: /* @__PURE__ */ r(et, { valueFormat: n }) }),
4188
+ /* @__PURE__ */ r(Ar, { dataKey: "value", name: "Value", maxBarSize: 36, radius: [4, 4, 0, 0], children: t.map((i) => /* @__PURE__ */ r(Gt, { fill: a ? i.value >= 0 ? H.up : H.down : H.blue }, i.label)) })
4189
+ ] }) });
4190
+ }
4191
+ function Io(t) {
4192
+ return /* @__PURE__ */ r(Bn, { ...t, signColor: !0 });
4193
+ }
4194
+ function Ro({ data: t, height: e = 220, donut: n = !1, centerLabel: a, valueFormat: o = String, ariaLabel: i = "Pie chart" }) {
4195
+ return /* @__PURE__ */ h("div", { className: "relative", style: { height: e }, children: [
4196
+ /* @__PURE__ */ r(Le, { width: "100%", height: "100%", children: /* @__PURE__ */ h($r, { accessibilityLayer: !1, tabIndex: -1, role: "img", "aria-label": i, children: [
4197
+ /* @__PURE__ */ r(Je, { content: /* @__PURE__ */ r(et, { valueFormat: o }) }),
4198
+ /* @__PURE__ */ r(Er, { iconType: "circle", wrapperStyle: { color: H.graphite, fontFamily: H.font, fontSize: 12 } }),
4199
+ /* @__PURE__ */ r(Or, { data: t, dataKey: "value", nameKey: "name", innerRadius: n ? "54%" : 0, outerRadius: "78%", paddingAngle: n ? 2 : 0, cornerRadius: n ? 4 : 0, stroke: H.canvas, strokeWidth: 2, children: t.map((s, l) => /* @__PURE__ */ r(Gt, { fill: Lt[l % Lt.length] }, s.name)) })
4200
+ ] }) }),
4201
+ n && a && /* @__PURE__ */ r("span", { className: "pointer-events-none absolute inset-0 grid place-items-center font-product text-caption font-[600] text-ink", children: a })
4202
+ ] });
4203
+ }
4204
+ function Po({ data: t, height: e = 260, ariaLabel: n = "Radar chart" }) {
4205
+ return /* @__PURE__ */ r(Le, { width: "100%", height: e, children: /* @__PURE__ */ h(Hr, { data: t, outerRadius: "72%", accessibilityLayer: !1, tabIndex: -1, role: "img", "aria-label": n, children: [
4206
+ /* @__PURE__ */ r(Ur, { stroke: H.grid }),
4207
+ /* @__PURE__ */ r(qt, { dataKey: "label", tick: { fill: H.graphite, fontFamily: H.font, fontSize: 11 } }),
4208
+ /* @__PURE__ */ r(jr, { tick: !1, axisLine: !1 }),
4209
+ /* @__PURE__ */ r(Je, { content: /* @__PURE__ */ r(et, {}) }),
4210
+ /* @__PURE__ */ r(yt, { name: "Current", dataKey: "current", stroke: H.blue, fill: H.blue, fillOpacity: 0.2 }),
4211
+ /* @__PURE__ */ r(yt, { name: "Previous", dataKey: "previous", stroke: H.rust, fill: H.rust, fillOpacity: 0.1 })
4212
+ ] }) });
4213
+ }
4214
+ function Lo({ value: t, maximum: e = 100, label: n, height: a = 220 }) {
4215
+ const o = Math.min(e, Math.max(0, t));
4216
+ return /* @__PURE__ */ h("div", { className: "relative", style: { height: a }, children: [
4217
+ /* @__PURE__ */ r(Le, { width: "100%", height: "100%", children: /* @__PURE__ */ h(Br, { data: [{ name: n, value: o, fill: H.rust }], startAngle: 210, endAngle: -30, innerRadius: "64%", outerRadius: "92%", barSize: 16, accessibilityLayer: !1, tabIndex: -1, role: "img", "aria-label": n, children: [
4218
+ /* @__PURE__ */ r(qt, { type: "number", domain: [0, e], tick: !1 }),
4219
+ /* @__PURE__ */ r(Kr, { dataKey: "value", background: { fill: H.grid }, cornerRadius: 8 })
4220
+ ] }) }),
4221
+ /* @__PURE__ */ h("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center pt-4", children: [
4222
+ /* @__PURE__ */ r("strong", { className: "font-data text-heading-sm tabular-nums text-ink", children: o }),
4223
+ /* @__PURE__ */ r("span", { className: "text-caption text-graphite", children: n })
4224
+ ] })
4225
+ ] });
4226
+ }
4227
+ function Ao({
4228
+ data: t,
4229
+ tone: e = "up",
4230
+ height: n = 40,
4231
+ ariaLabel: a = "Value trend",
4232
+ emptyLabel: o
4233
+ }) {
4234
+ const i = Q().replace(/:/g, ""), s = e === "blue" ? H.blue : e === "down" ? H.down : H.up;
4235
+ return t.length < 2 ? /* @__PURE__ */ r(
4236
+ "div",
4237
+ {
4238
+ className: "pointer-events-none relative overflow-hidden rounded-md bg-fog/50",
4239
+ style: { height: n },
4240
+ role: "img",
4241
+ "aria-label": o || a,
4242
+ children: /* @__PURE__ */ r("svg", { width: "100%", height: "100%", viewBox: "0 0 120 40", preserveAspectRatio: "none", "aria-hidden": !0, className: "absolute inset-0", children: /* @__PURE__ */ r(
4243
+ "path",
4244
+ {
4245
+ d: "M4 22 C 30 18, 55 26, 80 20 S 110 16, 116 22",
4246
+ fill: "none",
4247
+ stroke: H.dove,
4248
+ strokeWidth: 1.25,
4249
+ strokeDasharray: "3 3",
4250
+ strokeOpacity: 0.75
4251
+ }
4252
+ ) })
4253
+ }
4254
+ ) : /* @__PURE__ */ r("div", { className: "pointer-events-none", style: { height: n }, children: /* @__PURE__ */ r(Le, { width: "100%", height: "100%", children: /* @__PURE__ */ h(Kt, { data: t.map((l, d) => ({ index: d, value: l })), margin: { top: 2, right: 0, left: 0, bottom: 0 }, accessibilityLayer: !1, tabIndex: -1, role: "img", "aria-label": a, children: [
4255
+ /* @__PURE__ */ r("defs", { children: /* @__PURE__ */ h("linearGradient", { id: `${i}-spark`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
4256
+ /* @__PURE__ */ r("stop", { offset: "0%", stopColor: s, stopOpacity: 0.25 }),
4257
+ /* @__PURE__ */ r("stop", { offset: "100%", stopColor: s, stopOpacity: 0 })
4258
+ ] }) }),
4259
+ /* @__PURE__ */ r(ot, { type: "monotone", dataKey: "value", stroke: s, strokeWidth: 2, fill: `url(#${i}-spark)`, dot: !1, activeDot: !1, isAnimationActive: !1 })
4260
+ ] }) }) });
4261
+ }
4262
+ function $o({
4263
+ level: t = "base",
4264
+ as: e = "h2",
4265
+ className: n,
4266
+ children: a
4267
+ }) {
4268
+ return /* @__PURE__ */ r(e, { className: v("font-signifier font-[600] tracking-[0] text-ink", {
4269
+ display: "text-display",
4270
+ lg: "text-heading-lg",
4271
+ base: "text-heading"
4272
+ }[t], n), children: a });
4273
+ }
4274
+ function Eo({ children: t, className: e }) {
4275
+ return /* @__PURE__ */ r("h3", { className: v("font-sohne text-subheading font-[450] text-ink", e), children: t });
4276
+ }
4277
+ function Kn(t) {
4278
+ let e = (t == null ? void 0 : t.parentElement) ?? null;
4279
+ for (; e; ) {
4280
+ const { overflowY: n } = getComputedStyle(e);
4281
+ if ((n === "auto" || n === "scroll" || n === "overlay") && e.scrollHeight > e.clientHeight + 1)
4282
+ return e;
4283
+ e = e.parentElement;
4284
+ }
4285
+ return null;
4286
+ }
4287
+ function Oo({
4288
+ hasMore: t,
4289
+ loading: e = !1,
4290
+ onLoadMore: n,
4291
+ loadingLabel: a,
4292
+ endLabel: o,
4293
+ hintLabel: i,
4294
+ loadingSlot: s,
4295
+ className: l,
4296
+ rootMargin: d = "320px 0px"
4297
+ }) {
4298
+ const c = U(null), p = U(e);
4299
+ return p.current = e, q(() => {
4300
+ if (!t) return;
4301
+ const u = c.current;
4302
+ if (!u) return;
4303
+ const y = Kn(u), g = new IntersectionObserver(
4304
+ ([m]) => {
4305
+ m != null && m.isIntersecting && !p.current && n();
4306
+ },
4307
+ { root: y, rootMargin: d, threshold: 0 }
4308
+ );
4309
+ return g.observe(u), () => g.disconnect();
4310
+ }, [t, n, d]), !t && !e && !o ? null : /* @__PURE__ */ h("div", { className: v("flex flex-col gap-3", l), children: [
4311
+ e && s,
4312
+ /* @__PURE__ */ r(
4313
+ "div",
4314
+ {
4315
+ ref: c,
4316
+ className: "flex min-h-12 flex-col items-center justify-center gap-2 py-3",
4317
+ "aria-live": "polite",
4318
+ children: e ? /* @__PURE__ */ h(fe, { children: [
4319
+ /* @__PURE__ */ r(_n, {}),
4320
+ a && /* @__PURE__ */ r("span", { className: "text-caption font-sohne text-graphite", children: a })
4321
+ ] }) : t ? i ? /* @__PURE__ */ r("span", { className: "text-[11px] font-sohne text-graphite", children: i }) : /* @__PURE__ */ r("span", { className: "h-1 w-full", "aria-hidden": !0 }) : o ? /* @__PURE__ */ r("span", { className: "text-[11px] font-sohne text-graphite", children: o }) : null
4322
+ }
4323
+ )
4324
+ ] });
4325
+ }
4326
+ function _n() {
4327
+ return /* @__PURE__ */ h("svg", { width: 22, height: 22, viewBox: "0 0 24 24", fill: "none", className: "animate-spin text-graphite", "aria-hidden": !0, children: [
4328
+ /* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "9", stroke: "currentColor", strokeOpacity: 0.2, strokeWidth: "2.5" }),
4329
+ /* @__PURE__ */ r("path", { d: "M21 12a9 9 0 0 0-9-9", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round" })
4330
+ ] });
4331
+ }
4332
+ function Ho({ label: t, children: e, className: n }) {
4333
+ return /* @__PURE__ */ r("ul", { role: "list", "aria-label": t, className: v("min-w-0 divide-y divide-divider", n), children: e });
4334
+ }
4335
+ function Uo({ className: t, density: e = "touch", ...n }) {
4336
+ return /* @__PURE__ */ r(
4337
+ "li",
4338
+ {
4339
+ "data-density": e,
4340
+ className: v(
4341
+ "flex min-w-0 items-center",
4342
+ e === "compact" ? "min-h-row-default gap-1 py-0.5" : "min-h-row-touch gap-3 py-2.5",
4343
+ t
4344
+ ),
4345
+ ...n
4346
+ }
4347
+ );
4348
+ }
4349
+ function jo({ className: t, ...e }) {
4350
+ return /* @__PURE__ */ r("span", { className: v("inline-grid size-control-default shrink-0 place-items-center rounded-control bg-surface-muted text-graphite", t), ...e });
4351
+ }
4352
+ function Bo({ className: t, ...e }) {
4353
+ return /* @__PURE__ */ r("div", { className: v("min-w-0 flex-1", t), ...e });
4354
+ }
4355
+ function Ko({ className: t, ...e }) {
4356
+ return /* @__PURE__ */ r("p", { className: v("truncate font-product text-body-sm font-[500] text-ink", t), ...e });
4357
+ }
4358
+ function _o({ className: t, ...e }) {
4359
+ return /* @__PURE__ */ r("p", { className: v("mt-0.5 truncate font-product text-caption text-graphite", t), ...e });
4360
+ }
4361
+ function Fo({ children: t, className: e }) {
4362
+ return /* @__PURE__ */ r("span", { className: v("shrink-0 font-data text-data tabular-nums text-graphite", e), children: t });
4363
+ }
4364
+ function Wo({ children: t, className: e }) {
4365
+ return /* @__PURE__ */ r("span", { className: v("shrink-0", e), children: t });
4366
+ }
4367
+ export {
4368
+ Ba as Accordion,
4369
+ Jn as ActionGroup,
4370
+ ea as Alert,
4371
+ Ta as AllocationSlider,
4372
+ Do as AreaTrendChart,
4373
+ xo as AspectRatio,
4374
+ ta as Avatar,
4375
+ vo as AvatarBadge,
4376
+ ra as AvatarGroup,
4377
+ na as AvatarGroupOverflow,
4378
+ Bn as BarChart,
4379
+ no as Breadcrumb,
4380
+ de as Button,
4381
+ Qn as ButtonGroup,
4382
+ Lt as CATEGORICAL,
4383
+ H as CHART,
4384
+ zn as Calendar,
4385
+ Jt as Card,
4386
+ dn as CardLabel,
4387
+ cn as CardTitle,
4388
+ ba as ChartFrame,
4389
+ Ra as Checkbox,
4390
+ Ka as Collapsible,
4391
+ bn as ColorPicker,
4392
+ Fa as Combobox,
4393
+ ga as CommandDialog,
4394
+ ca as ConfirmDialog,
4395
+ Ca as ContextMenu,
4396
+ Wa as DataTable,
4397
+ zt as DatePicker,
4398
+ oo as DateRangePicker,
4399
+ To as Donut,
4400
+ da as Drawer,
4401
+ Ma as DropdownSelect,
4402
+ xn as Field,
4403
+ fa as FloatingWindow,
4404
+ $o as Heading,
4405
+ Io as HistogramChart,
4406
+ Hn as HoverTip,
4407
+ ko as IconTip,
4408
+ ht as Input,
4409
+ gn as InputGroup,
4410
+ Sa as InputOtp,
4411
+ Uo as Item,
4412
+ Wo as ItemAction,
4413
+ Bo as ItemContent,
4414
+ _o as ItemDescription,
4415
+ Ho as ItemList,
4416
+ jo as ItemMedia,
4417
+ Fo as ItemMeta,
4418
+ Ko as ItemTitle,
4419
+ sa as Kbd,
4420
+ la as KbdGroup,
4421
+ Mo as LineChart,
4422
+ Ua as Listbox,
4423
+ ja as ListboxOption,
4424
+ Ja as LiveValue,
4425
+ Na as Menu,
4426
+ wa as MenuChoiceGroup,
4427
+ ya as MenuChoiceItem,
4428
+ ka as MenuCommandItem,
4429
+ Zt as Modal,
4430
+ Ia as MultiSelect,
4431
+ za as NativeSelect,
4432
+ ma as PageContainer,
4433
+ ao as Pagination,
4434
+ Ro as PieChart,
4435
+ hn as Popover,
4436
+ _r as Pressable,
4437
+ _a as Progress,
4438
+ Po as RadarChart,
4439
+ Lo as RadialGaugeChart,
4440
+ Pa as RadioGroup,
4441
+ Da as RangeSlider,
4442
+ so as ResizablePaneGroup,
4443
+ wo as ResourceIcon,
4444
+ go as ScrollArea,
4445
+ Oo as ScrollLoadMore,
4446
+ No as SegSlider,
4447
+ we as SegmentedControl,
4448
+ bo as Separator,
4449
+ lo as Sidebar,
4450
+ uo as SidebarContent,
4451
+ co as SidebarHeader,
4452
+ fo as SidebarSection,
4453
+ pa as Skeleton,
4454
+ st as Slider,
4455
+ On as SlidingTabs,
4456
+ Ao as Sparkline,
4457
+ aa as Spinner,
4458
+ ua as SpotlightTour,
4459
+ So as StatCard,
4460
+ ha as StateView,
4461
+ zo as StatsTable,
4462
+ Eo as Subheading,
4463
+ vn as Switch,
4464
+ Ga as Table,
4465
+ Xa as TableBody,
4466
+ Za as TableCell,
4467
+ Va as TableHead,
4468
+ qa as TableHeader,
4469
+ Ya as TableRow,
4470
+ yo as Tag,
4471
+ Co as TagList,
4472
+ Rt as TagPill,
4473
+ va as Textarea,
4474
+ ro as ThemeEditor,
4475
+ to as ThemeProvider,
4476
+ io as TimeField,
4477
+ ia as ToastProvider,
4478
+ La as ToggleGroup,
4479
+ Aa as Toolbar,
4480
+ $a as ToolbarButton,
4481
+ Ha as ToolbarSeparator,
4482
+ Ea as ToolbarToggleGroup,
4483
+ Oa as ToolbarToggleItem,
4484
+ Xo as UI_KIT_CATEGORIES,
4485
+ Yo as UI_KIT_COMPONENTS,
4486
+ Jo as UI_KIT_COMPONENT_API,
4487
+ Vo as UI_KIT_DEFERRED_COMPONENTS,
4488
+ yn as UI_THEME_ACCENTS,
4489
+ wn as UI_THEME_BRANDS,
4490
+ te as UI_THEME_DEFAULTS,
4491
+ kn as UI_THEME_NEUTRALS,
4492
+ qe as UI_THEME_SEMANTICS,
4493
+ ho as WidgetFrame,
4494
+ mo as WidgetPicker,
4495
+ po as WorkspaceGrid,
4496
+ Qa as applyUiThemeSettings,
4497
+ Xe as axisProps,
4498
+ xa as fieldInputClass,
4499
+ fn as fieldTextareaClass,
4500
+ dr as gridProps,
4501
+ Qe as normalizeUiThemeSettings,
4502
+ er as uiThemeStyle,
4503
+ lr as useSlideIndicator,
4504
+ oa as useToast,
4505
+ eo as useUiTheme
4506
+ };