@mt-gloss/ui 0.1.114 → 0.1.115

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.
@@ -1,29 +1,29 @@
1
- import { u as L, f as J, S as ve, a as _e, g as A, c as k } from "./COMMITS-Bzrd0rgy.js";
2
- import { C as kt, b as Dt, P as Ot, e as Lt, i as It, r as Mt, d as $t } from "./COMMITS-Bzrd0rgy.js";
3
- import { jsx as a, jsxs as h, Fragment as Z } from "react/jsx-runtime";
4
- import B, { useState as S, useRef as I, createContext as ee, useContext as te, useMemo as W, useEffect as x, useCallback as P, useLayoutEffect as Ce } from "react";
5
- import { useSensors as Te, useSensor as G, PointerSensor as Se, KeyboardSensor as Ne, DndContext as we, closestCenter as Ee } from "@dnd-kit/core";
6
- import { sortableKeyboardCoordinates as Pe, SortableContext as xe, horizontalListSortingStrategy as Ae, arrayMove as ke, useSortable as De } from "@dnd-kit/sortable";
7
- import { CSS as Oe } from "@dnd-kit/utilities";
8
- import { M as Q } from "./MetricCard-Cyoxhb_S.js";
9
- function vt() {
10
- const e = L();
1
+ import { u as F, h as pe, g as Ne, S as Se, b as we, j as I, d as M } from "./COMMITS-CeuMPpjt.js";
2
+ import { C as It, c as Mt, P as $t, f as Rt, i as Ft, r as Ut, e as zt } from "./COMMITS-CeuMPpjt.js";
3
+ import { jsx as a, jsxs as h, Fragment as me } from "react/jsx-runtime";
4
+ import se, { useState as E, useRef as U, createContext as he, useContext as fe, useMemo as re, useEffect as L, useCallback as x, useLayoutEffect as Ee } from "react";
5
+ import { useSensors as Pe, useSensor as le, PointerSensor as xe, KeyboardSensor as Ae, DndContext as ke, closestCenter as De } from "@dnd-kit/core";
6
+ import { sortableKeyboardCoordinates as Oe, SortableContext as Le, horizontalListSortingStrategy as Ie, arrayMove as Me, useSortable as $e } from "@dnd-kit/sortable";
7
+ import { CSS as Re } from "@dnd-kit/utilities";
8
+ import { M as oe } from "./MetricCard-Cyoxhb_S.js";
9
+ function Nt() {
10
+ const e = F();
11
11
  if (e?.state.activePanelId !== "settings") return null;
12
12
  const t = e.state.activeTrigger;
13
13
  return t?.kind === "card-overflow" ? t.cardId : null;
14
14
  }
15
- function Le({ children: e }) {
15
+ function Fe({ children: e }) {
16
16
  return /* @__PURE__ */ a("div", { className: "clone-stage", children: e });
17
17
  }
18
- function Ie({ span: e, rotating: t = !0, children: r }) {
19
- const c = ["clone-card", `span-${e}`, t ? "rotating" : ""].filter(Boolean).join(" "), n = r != null ? "full" : "fallback";
20
- return /* @__PURE__ */ a("div", { className: c, "data-clone-fidelity": n, children: r });
18
+ function Ue({ span: e, rotating: t = !0, children: r }) {
19
+ const i = ["clone-card", `span-${e}`, t ? "rotating" : ""].filter(Boolean).join(" "), n = r != null ? "full" : "fallback";
20
+ return /* @__PURE__ */ a("div", { className: i, "data-clone-fidelity": n, children: r });
21
21
  }
22
- function Me({
22
+ function ze({
23
23
  value: e,
24
24
  onChange: t,
25
25
  enabled: r = !1,
26
- onToggleEnabled: c
26
+ onToggleEnabled: i
27
27
  }) {
28
28
  const n = "settings-threshold-enabled";
29
29
  return /* @__PURE__ */ h("div", { className: "settings-shell__field settings-shell__field--threshold", children: [
@@ -38,7 +38,7 @@ function Me({
38
38
  "aria-label": "Enable threshold indicator",
39
39
  "aria-checked": r,
40
40
  checked: r,
41
- onChange: (o) => c?.(o.target.checked),
41
+ onChange: (o) => i?.(o.target.checked),
42
42
  className: "settings-shell__toggle"
43
43
  }
44
44
  )
@@ -70,7 +70,7 @@ function Me({
70
70
  !r && /* @__PURE__ */ a("p", { className: "settings-shell__help", "aria-live": "polite", children: "Off — the card uses its default styling. Turn on to tint values below the threshold." })
71
71
  ] });
72
72
  }
73
- function $e({ value: e, onChange: t }) {
73
+ function Ve({ value: e, onChange: t }) {
74
74
  return /* @__PURE__ */ h("div", { className: "settings-shell__field settings-shell__field--timeframe", children: [
75
75
  /* @__PURE__ */ a("span", { className: "settings-shell__label", "aria-hidden": "true", children: "Rolling period (days)" }),
76
76
  /* @__PURE__ */ h("div", { className: "settings-shell__slider-row", children: [
@@ -97,18 +97,18 @@ function $e({ value: e, onChange: t }) {
97
97
  ] })
98
98
  ] });
99
99
  }
100
- function Re({ id: e, onRemove: t }) {
101
- const { attributes: r, listeners: c, setNodeRef: n, transform: o, transition: u, isDragging: l } = De({ id: e }), s = {
102
- transform: Oe.Transform.toString(o),
100
+ function He({ id: e, onRemove: t }) {
101
+ const { attributes: r, listeners: i, setNodeRef: n, transform: o, transition: u, isDragging: s } = $e({ id: e }), l = {
102
+ transform: Re.Transform.toString(o),
103
103
  transition: u,
104
- opacity: l ? 0.6 : 1
104
+ opacity: s ? 0.6 : 1
105
105
  };
106
106
  return /* @__PURE__ */ h(
107
107
  "li",
108
108
  {
109
109
  ref: n,
110
- style: s,
111
- className: `settings-shell__slot-pill${l ? " settings-shell__slot-pill--dragging" : ""}`,
110
+ style: l,
111
+ className: `settings-shell__slot-pill${s ? " settings-shell__slot-pill--dragging" : ""}`,
112
112
  children: [
113
113
  /* @__PURE__ */ a(
114
114
  "button",
@@ -117,7 +117,7 @@ function Re({ id: e, onRemove: t }) {
117
117
  className: "settings-shell__slot-pill__handle",
118
118
  "aria-label": `Reorder ${e}`,
119
119
  ...r,
120
- ...c,
120
+ ...i,
121
121
  children: /* @__PURE__ */ a("span", { "aria-hidden": "true", className: "settings-shell__slot-pill__grip", children: "⋮⋮" })
122
122
  }
123
123
  ),
@@ -136,31 +136,31 @@ function Re({ id: e, onRemove: t }) {
136
136
  }
137
137
  );
138
138
  }
139
- function Fe({ value: e, onChange: t }) {
140
- const r = Te(
141
- G(Se, { activationConstraint: { distance: 4 } }),
142
- G(Ne, { coordinateGetter: Pe })
143
- ), c = (o) => {
144
- const { active: u, over: l } = o;
145
- if (!l || u.id === l.id) return;
146
- const s = e.findIndex((d) => d === u.id), i = e.findIndex((d) => d === l.id);
147
- s === -1 || i === -1 || t(ke([...e], s, i));
139
+ function Ke({ value: e, onChange: t }) {
140
+ const r = Pe(
141
+ le(xe, { activationConstraint: { distance: 4 } }),
142
+ le(Ae, { coordinateGetter: Oe })
143
+ ), i = (o) => {
144
+ const { active: u, over: s } = o;
145
+ if (!s || u.id === s.id) return;
146
+ const l = e.findIndex((d) => d === u.id), c = e.findIndex((d) => d === s.id);
147
+ l === -1 || c === -1 || t(Me([...e], l, c));
148
148
  }, n = (o) => {
149
149
  t(e.filter((u) => u !== o));
150
150
  };
151
151
  return /* @__PURE__ */ h("div", { className: "settings-shell__field settings-shell__field--slots", "aria-label": "Stack slots", children: [
152
152
  /* @__PURE__ */ a("span", { className: "settings-shell__label", children: "Stack slots" }),
153
- /* @__PURE__ */ a(we, { sensors: r, collisionDetection: Ee, onDragEnd: c, children: /* @__PURE__ */ a(xe, { items: [...e], strategy: Ae, children: /* @__PURE__ */ a("ul", { className: "settings-shell__slots-list", role: "list", children: e.map((o) => /* @__PURE__ */ a(Re, { id: o, onRemove: () => n(o) }, o)) }) }) }),
153
+ /* @__PURE__ */ a(ke, { sensors: r, collisionDetection: De, onDragEnd: i, children: /* @__PURE__ */ a(Le, { items: [...e], strategy: Ie, children: /* @__PURE__ */ a("ul", { className: "settings-shell__slots-list", role: "list", children: e.map((o) => /* @__PURE__ */ a(He, { id: o, onRemove: () => n(o) }, o)) }) }) }),
154
154
  e.length === 0 && /* @__PURE__ */ a("p", { className: "settings-shell__help", children: "All slots removed. Apply to commit, or Reset to restore." }),
155
155
  /* @__PURE__ */ a("p", { className: "settings-shell__help settings-shell__help--small", children: "Drag to reorder · click × to remove" })
156
156
  ] });
157
157
  }
158
- const Ue = ["#1d6fd8", "#10b981", "#f59e0b", "#ef4444", "#8b5cf6"];
159
- function Ve({
158
+ const Ye = ["#1d6fd8", "#10b981", "#f59e0b", "#ef4444", "#8b5cf6"];
159
+ function Be({
160
160
  value: e,
161
161
  onSelect: t,
162
162
  enabled: r = !1,
163
- onToggleEnabled: c
163
+ onToggleEnabled: i
164
164
  }) {
165
165
  const n = "settings-accent-enabled";
166
166
  return /* @__PURE__ */ h("div", { className: "settings-shell__field settings-shell__field--color", role: "group", "aria-label": "Accent color", children: [
@@ -175,13 +175,13 @@ function Ve({
175
175
  "aria-label": "Enable accent override",
176
176
  "aria-checked": r,
177
177
  checked: r,
178
- onChange: (o) => c?.(o.target.checked),
178
+ onChange: (o) => i?.(o.target.checked),
179
179
  className: "settings-shell__toggle"
180
180
  }
181
181
  )
182
182
  ] }),
183
183
  /* @__PURE__ */ a("span", { className: "settings-shell__label", children: "Accent color" }),
184
- /* @__PURE__ */ a("div", { className: "settings-shell__swatch-row", "aria-disabled": !r, children: Ue.map((o) => {
184
+ /* @__PURE__ */ a("div", { className: "settings-shell__swatch-row", "aria-disabled": !r, children: Ye.map((o) => {
185
185
  const u = e === o;
186
186
  return /* @__PURE__ */ a(
187
187
  "button",
@@ -200,46 +200,46 @@ function Ve({
200
200
  !r && /* @__PURE__ */ a("p", { className: "settings-shell__help", "aria-live": "polite", children: "Off — the card uses its default accent. Turn on to override." })
201
201
  ] });
202
202
  }
203
- const He = ["Orders", "Quota", "Unassigned"], ze = ["threshold", "timeframe", "color"];
204
- function _t({
203
+ const We = ["Orders", "Quota", "Unassigned"], Ge = ["threshold", "timeframe", "color"];
204
+ function St({
205
205
  isOpen: e,
206
206
  cardSpan: t,
207
207
  cardLabel: r = "Metric",
208
- cardValue: c = "—",
208
+ cardValue: i = "—",
209
209
  previewSlot: n,
210
- dimensions: o = ze,
210
+ dimensions: o = Ge,
211
211
  initialTab: u,
212
- initialValues: l
212
+ initialValues: s
213
213
  }) {
214
- const s = L(), i = s?.state.activeTrigger, d = i?.kind === "card-overflow" ? i.cardId : null, p = J(), m = i?.span, f = t ?? m ?? 1, _ = o[0] ?? "threshold", [b, C] = B.useState(u ?? _);
215
- B.useEffect(() => {
216
- o.includes(b) || C(_);
217
- }, [o, b, _]);
218
- const y = d != null ? s?.state?.bufferByCard?.[d]?.changes ?? {} : {}, v = typeof y.threshold == "number" ? y.threshold : typeof l?.threshold == "number" ? l.threshold : 80, E = typeof y.timeframe == "number" ? y.timeframe : typeof l?.timeframe == "number" ? l.timeframe : 30, ce = typeof y.accent == "string" ? y.accent : typeof l?.accent == "string" ? l.accent : null, de = Array.isArray(y.slots) ? y.slots : Array.isArray(l?.slots) ? l.slots : He, ue = typeof y.thresholdEnabled == "boolean" ? y.thresholdEnabled : typeof l?.thresholdEnabled == "boolean" ? l.thresholdEnabled : !1, pe = typeof y.accentEnabled == "boolean" ? y.accentEnabled : typeof l?.accentEnabled == "boolean" ? l.accentEnabled : !1, me = (T) => {
219
- d == null || s == null || s.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "threshold", value: Number(T.target.value) });
220
- }, he = (T) => {
221
- d == null || s == null || s.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "timeframe", value: Number(T.target.value) });
222
- }, fe = (T) => {
223
- d == null || s == null || s.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "accent", value: T });
224
- }, ge = (T) => {
225
- d == null || s == null || s.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "slots", value: T });
226
- }, be = (T) => {
227
- d == null || s == null || s.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "thresholdEnabled", value: T });
228
- }, ye = (T) => {
229
- d == null || s == null || s.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "accentEnabled", value: T });
214
+ const l = F(), c = l?.state.activeTrigger, d = c?.kind === "card-overflow" ? c.cardId : null, m = pe(), f = c?.span, v = t ?? f ?? 1, p = o[0] ?? "threshold", [b, w] = se.useState(u ?? p);
215
+ se.useEffect(() => {
216
+ o.includes(b) || w(p);
217
+ }, [o, b, p]);
218
+ const T = d != null ? l?.state?.bufferByCard?.[d]?.changes ?? {} : {}, y = typeof T.threshold == "number" ? T.threshold : typeof s?.threshold == "number" ? s.threshold : 80, A = typeof T.timeframe == "number" ? T.timeframe : typeof s?.timeframe == "number" ? s.timeframe : 30, z = typeof T.accent == "string" ? T.accent : typeof s?.accent == "string" ? s.accent : null, V = Array.isArray(T.slots) ? T.slots : Array.isArray(s?.slots) ? s.slots : We, D = typeof T.thresholdEnabled == "boolean" ? T.thresholdEnabled : typeof s?.thresholdEnabled == "boolean" ? s.thresholdEnabled : !1, H = typeof T.accentEnabled == "boolean" ? T.accentEnabled : typeof s?.accentEnabled == "boolean" ? s.accentEnabled : !1, K = (C) => {
219
+ d == null || l == null || l.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "threshold", value: Number(C.target.value) });
220
+ }, Y = (C) => {
221
+ d == null || l == null || l.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "timeframe", value: Number(C.target.value) });
222
+ }, ae = (C) => {
223
+ d == null || l == null || l.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "accent", value: C });
224
+ }, B = (C) => {
225
+ d == null || l == null || l.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "slots", value: C });
226
+ }, g = (C) => {
227
+ d == null || l == null || l.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "thresholdEnabled", value: C });
228
+ }, N = (C) => {
229
+ d == null || l == null || l.dispatch({ type: "SET_BUFFER_VALUE", cardId: d, key: "accentEnabled", value: C });
230
230
  };
231
231
  return /* @__PURE__ */ h("div", { className: "settings-shell", "data-shell": "settings", "aria-hidden": !e, children: [
232
- /* @__PURE__ */ a("div", { "aria-hidden": "true", children: /* @__PURE__ */ a(Le, { children: /* @__PURE__ */ a(Ie, { span: f, rotating: !p, children: n ?? /* @__PURE__ */ h(Z, { children: [
232
+ /* @__PURE__ */ a("div", { "aria-hidden": "true", children: /* @__PURE__ */ a(Fe, { children: /* @__PURE__ */ a(Ue, { span: v, rotating: !m, children: n ?? /* @__PURE__ */ h(me, { children: [
233
233
  /* @__PURE__ */ a("div", { style: { fontSize: 9, textTransform: "uppercase", letterSpacing: "0.06em", color: "#9ca3af", marginBottom: 6 }, children: r }),
234
- /* @__PURE__ */ a("div", { style: { fontSize: 22, fontWeight: 700, color: "#111827", lineHeight: 1 }, children: c })
234
+ /* @__PURE__ */ a("div", { style: { fontSize: 22, fontWeight: 700, color: "#111827", lineHeight: 1 }, children: i })
235
235
  ] }) }) }) }),
236
236
  /* @__PURE__ */ a(
237
- ve,
237
+ Ne,
238
238
  {
239
239
  dimensions: o,
240
240
  activeTab: b,
241
- onSelect: C,
242
- reduced: p
241
+ onSelect: w,
242
+ reduced: m
243
243
  }
244
244
  ),
245
245
  /* @__PURE__ */ h(
@@ -252,23 +252,23 @@ function _t({
252
252
  className: "settings-shell__tabpanel",
253
253
  children: [
254
254
  b === "threshold" && /* @__PURE__ */ a(
255
- Me,
255
+ ze,
256
256
  {
257
- value: v,
258
- onChange: me,
259
- enabled: ue,
260
- onToggleEnabled: be
257
+ value: y,
258
+ onChange: K,
259
+ enabled: D,
260
+ onToggleEnabled: g
261
261
  }
262
262
  ),
263
- b === "timeframe" && /* @__PURE__ */ a($e, { value: E, onChange: he }),
264
- b === "slots" && /* @__PURE__ */ a(Fe, { value: de, onChange: ge }),
263
+ b === "timeframe" && /* @__PURE__ */ a(Ve, { value: A, onChange: Y }),
264
+ b === "slots" && /* @__PURE__ */ a(Ke, { value: V, onChange: B }),
265
265
  b === "color" && /* @__PURE__ */ a(
266
- Ve,
266
+ Be,
267
267
  {
268
- value: ce,
269
- onSelect: fe,
270
- enabled: pe,
271
- onToggleEnabled: ye
268
+ value: z,
269
+ onSelect: ae,
270
+ enabled: H,
271
+ onToggleEnabled: N
272
272
  }
273
273
  )
274
274
  ]
@@ -276,7 +276,7 @@ function _t({
276
276
  )
277
277
  ] });
278
278
  }
279
- const ne = [
279
+ const ge = [
280
280
  "Overbought",
281
281
  "What's selling",
282
282
  "On track vs plan",
@@ -284,7 +284,7 @@ const ne = [
284
284
  "Vendor performance",
285
285
  "Assortment mix",
286
286
  "Customer retention"
287
- ], ae = "Overbought", z = {
287
+ ], be = "Overbought", ee = {
288
288
  Overbought: {
289
289
  headline: "Am I overbought?",
290
290
  helper: "Find slow-moving inventory before discount cycles eat margin."
@@ -314,8 +314,8 @@ const ne = [
314
314
  helper: "Repeat-rate and lapsed-account signals from the buyer file."
315
315
  }
316
316
  };
317
- z["Customer retention"].beta = !0;
318
- const se = {
317
+ ee["Customer retention"].beta = !0;
318
+ const ve = {
319
319
  Overbought: {
320
320
  primary: [
321
321
  {
@@ -780,45 +780,45 @@ const se = {
780
780
  ]
781
781
  }
782
782
  };
783
- function re({
783
+ function ye({
784
784
  lenses: e,
785
785
  activeLens: t,
786
786
  onLensChange: r,
787
- variant: c = "pills",
788
- lensMeta: n = z
787
+ variant: i = "pills",
788
+ lensMeta: n = ee
789
789
  }) {
790
- return c === "pills" ? /* @__PURE__ */ a("div", { className: "cat-pills-wrap", children: /* @__PURE__ */ a("div", { className: "cat-pills", role: "tablist", "aria-label": "Metric lenses", children: e.map((o) => {
791
- const u = o === t, l = n[o], s = ["cat-pill"];
792
- return u && s.push("active"), /* @__PURE__ */ h(
790
+ return i === "pills" ? /* @__PURE__ */ a("div", { className: "cat-pills-wrap", children: /* @__PURE__ */ a("div", { className: "cat-pills", role: "tablist", "aria-label": "Metric lenses", children: e.map((o) => {
791
+ const u = o === t, s = n[o], l = ["cat-pill"];
792
+ return u && l.push("active"), /* @__PURE__ */ h(
793
793
  "button",
794
794
  {
795
795
  type: "button",
796
796
  role: "tab",
797
797
  "aria-selected": u,
798
- className: s.join(" "),
798
+ className: l.join(" "),
799
799
  "data-lens": o,
800
800
  onClick: () => {
801
801
  u || r(o);
802
802
  },
803
803
  children: [
804
804
  o,
805
- l?.beta && /* @__PURE__ */ a("span", { className: "cat-pill-beta", "aria-label": "Beta", children: "BETA" })
805
+ s?.beta && /* @__PURE__ */ a("span", { className: "cat-pill-beta", "aria-label": "Beta", children: "BETA" })
806
806
  ]
807
807
  },
808
808
  o
809
809
  );
810
- }) }) }) : /* @__PURE__ */ a(Ye, { lenses: e, activeLens: t, onLensChange: r });
810
+ }) }) }) : /* @__PURE__ */ a(Qe, { lenses: e, activeLens: t, onLensChange: r });
811
811
  }
812
- function Ye({
812
+ function Qe({
813
813
  lenses: e,
814
814
  activeLens: t,
815
815
  onLensChange: r
816
816
  }) {
817
- const [c, n] = S(!1), o = I(null), u = () => {
817
+ const [i, n] = E(!1), o = U(null), u = () => {
818
818
  o.current != null && (window.clearTimeout(o.current), o.current = null);
819
- }, l = () => {
819
+ }, s = () => {
820
820
  u(), o.current = window.setTimeout(() => n(!1), 100);
821
- }, s = e.filter((i) => i !== t);
821
+ }, l = e.filter((c) => c !== t);
822
822
  return /* @__PURE__ */ a("div", { className: "cat-segmented-wrap", children: /* @__PURE__ */ h("div", { className: "cat-segmented", children: [
823
823
  /* @__PURE__ */ a(
824
824
  "button",
@@ -837,28 +837,28 @@ function Ye({
837
837
  onMouseEnter: () => {
838
838
  u(), n(!0);
839
839
  },
840
- onMouseLeave: l,
840
+ onMouseLeave: s,
841
841
  children: [
842
- /* @__PURE__ */ a("button", { type: "button", className: "cat-seg cat-seg-more-btn", "aria-haspopup": "menu", "aria-expanded": c, children: "More ▾" }),
843
- c && /* @__PURE__ */ a(
842
+ /* @__PURE__ */ a("button", { type: "button", className: "cat-seg cat-seg-more-btn", "aria-haspopup": "menu", "aria-expanded": i, children: "More ▾" }),
843
+ i && /* @__PURE__ */ a(
844
844
  "div",
845
845
  {
846
846
  className: "cat-seg-overflow",
847
847
  role: "menu",
848
848
  onMouseEnter: u,
849
- onMouseLeave: l,
850
- children: s.map((i) => /* @__PURE__ */ a(
849
+ onMouseLeave: s,
850
+ children: l.map((c) => /* @__PURE__ */ a(
851
851
  "button",
852
852
  {
853
853
  type: "button",
854
- "data-lens": i,
854
+ "data-lens": c,
855
855
  role: "menuitem",
856
856
  onClick: () => {
857
- r(i), n(!1);
857
+ r(c), n(!1);
858
858
  },
859
- children: i
859
+ children: c
860
860
  },
861
- i
861
+ c
862
862
  ))
863
863
  }
864
864
  )
@@ -867,30 +867,30 @@ function Ye({
867
867
  )
868
868
  ] }) });
869
869
  }
870
- function V({ tiles: e, selectedTileId: t, onSelectTile: r, renderTile: c }) {
870
+ function X({ tiles: e, selectedTileId: t, onSelectTile: r, renderTile: i }) {
871
871
  return /* @__PURE__ */ a("div", { className: "cat-tiles", children: e.map((n) => {
872
872
  const o = n.id === t, u = n.subStats != null && n.subStats.length > 0;
873
- let l = null;
874
- u ? n.subStats.length === 5 ? l = "span-5" : n.subStats.length === 3 ? l = "span-3" : l = "span-2" : n.stack === !0 && (l = "span-2");
875
- const s = ["cat-tile"];
876
- l && s.push(l), o && s.push("selected"), n.isNew && s.push("is-new"), n.startHere && s.push("start-here"), n.donut && s.push("has-donut");
877
- const i = 1;
873
+ let s = null;
874
+ u ? n.subStats.length === 5 ? s = "span-5" : n.subStats.length === 3 ? s = "span-3" : s = "span-2" : n.stack === !0 && (s = "span-2");
875
+ const l = ["cat-tile"];
876
+ s && l.push(s), o && l.push("selected"), n.isNew && l.push("is-new"), n.startHere && l.push("start-here"), n.donut && l.push("has-donut");
877
+ const c = 1;
878
878
  let d = 0.7;
879
879
  if (n.donut) {
880
- const p = /([\d.]+)\s*%/.exec(n.value);
881
- if (p) {
882
- const m = parseFloat(p[1]);
883
- Number.isFinite(m) && (d = Math.max(0, Math.min(1, m / 100)));
880
+ const m = /([\d.]+)\s*%/.exec(n.value);
881
+ if (m) {
882
+ const f = parseFloat(m[1]);
883
+ Number.isFinite(f) && (d = Math.max(0, Math.min(1, f / 100)));
884
884
  }
885
885
  }
886
886
  return /* @__PURE__ */ h(
887
887
  "button",
888
888
  {
889
889
  type: "button",
890
- className: s.join(" "),
890
+ className: l.join(" "),
891
891
  "data-metric": n.id,
892
892
  "data-desc": n.desc,
893
- "data-col-span": String(i),
893
+ "data-col-span": String(c),
894
894
  "data-donut": n.donut ? "true" : void 0,
895
895
  "data-accent": n.accent,
896
896
  "aria-pressed": o,
@@ -898,7 +898,7 @@ function V({ tiles: e, selectedTileId: t, onSelectTile: r, renderTile: c }) {
898
898
  style: n.accent ? { "--cat-tile-accent": n.accent } : void 0,
899
899
  children: [
900
900
  n.startHere && /* @__PURE__ */ a("span", { className: "cat-tile-start-here", "aria-hidden": "true", children: "START HERE" }),
901
- c ? c(n) : /* @__PURE__ */ a(
901
+ i ? i(n) : /* @__PURE__ */ a(
902
902
  "div",
903
903
  {
904
904
  className: "cat-tile-primitive-wrapper gloss-metric-card",
@@ -906,7 +906,7 @@ function V({ tiles: e, selectedTileId: t, onSelectTile: r, renderTile: c }) {
906
906
  style: { pointerEvents: "none", width: "100%", height: "100%" },
907
907
  "aria-hidden": "true",
908
908
  children: n.donut ? /* @__PURE__ */ a(
909
- Q,
909
+ oe,
910
910
  {
911
911
  variant: "donut",
912
912
  label: n.label,
@@ -914,20 +914,20 @@ function V({ tiles: e, selectedTileId: t, onSelectTile: r, renderTile: c }) {
914
914
  donutValue: d,
915
915
  donutMax: 1,
916
916
  accentColor: n.accent,
917
- colSpan: i
917
+ colSpan: c
918
918
  }
919
919
  ) : /* @__PURE__ */ a(
920
- Q,
920
+ oe,
921
921
  {
922
922
  variant: "standard",
923
923
  label: n.label,
924
924
  value: n.value,
925
- colSpan: i
925
+ colSpan: c
926
926
  }
927
927
  )
928
928
  }
929
929
  ),
930
- n.variants && n.variants.length > 0 && /* @__PURE__ */ a("span", { className: "cat-tile-variants", "aria-hidden": "true", children: n.variants.map((p) => /* @__PURE__ */ a("span", { children: p }, p)) }),
930
+ n.variants && n.variants.length > 0 && /* @__PURE__ */ a("span", { className: "cat-tile-variants", "aria-hidden": "true", children: n.variants.map((m) => /* @__PURE__ */ a("span", { children: m }, m)) }),
931
931
  n.isNew && /* @__PURE__ */ a("span", { className: "cat-tile-new-dot", "aria-hidden": "true" })
932
932
  ]
933
933
  },
@@ -935,14 +935,14 @@ function V({ tiles: e, selectedTileId: t, onSelectTile: r, renderTile: c }) {
935
935
  );
936
936
  }) });
937
937
  }
938
- const Y = ee(null);
939
- function Ke() {
940
- return te(Y);
938
+ const te = he(null);
939
+ function qe() {
940
+ return fe(te);
941
941
  }
942
- function Be({ mode: e, dispatch: t }) {
943
- const r = Ke();
942
+ function je({ mode: e, dispatch: t }) {
943
+ const r = qe();
944
944
  if (r == null && e == null) return null;
945
- const c = r?.mode ?? e ?? "add", n = r?.selectedTileId ?? null, o = r?.description ?? null, u = n == null;
945
+ const i = r?.mode ?? e ?? "add", n = r?.selectedTileId ?? null, o = r?.description ?? null, u = n == null;
946
946
  return /* @__PURE__ */ h("div", { className: "panel-footer catalog", children: [
947
947
  /* @__PURE__ */ a("div", { className: "cat-description", id: "cat-desc", children: o ?? /* @__PURE__ */ a("em", { children: "Tap a metric to see its description" }) }),
948
948
  /* @__PURE__ */ h("div", { style: { display: "flex", padding: "10px 14px", gap: 8 }, children: [
@@ -957,7 +957,7 @@ function Be({ mode: e, dispatch: t }) {
957
957
  children: "Cancel"
958
958
  }
959
959
  ),
960
- c === "add" && /* @__PURE__ */ a(
960
+ i === "add" && /* @__PURE__ */ a(
961
961
  "button",
962
962
  {
963
963
  id: "btn-cat-add",
@@ -968,7 +968,7 @@ function Be({ mode: e, dispatch: t }) {
968
968
  children: "Add metric"
969
969
  }
970
970
  ),
971
- c === "replace" && /* @__PURE__ */ a(
971
+ i === "replace" && /* @__PURE__ */ a(
972
972
  "button",
973
973
  {
974
974
  id: "btn-cat-replace",
@@ -982,36 +982,36 @@ function Be({ mode: e, dispatch: t }) {
982
982
  ] })
983
983
  ] });
984
984
  }
985
- function q(e, t) {
985
+ function ie(e, t) {
986
986
  if (t.length === 0) return !0;
987
987
  const r = t.toLowerCase();
988
988
  if (e.label.toLowerCase().includes(r) || e.value.toLowerCase().includes(r)) return !0;
989
989
  if (e.subStats) {
990
- for (const c of e.subStats)
991
- if (c.label.toLowerCase().includes(r) || c.value.toLowerCase().includes(r)) return !0;
990
+ for (const i of e.subStats)
991
+ if (i.label.toLowerCase().includes(r) || i.value.toLowerCase().includes(r)) return !0;
992
992
  }
993
993
  return !1;
994
994
  }
995
- function Ct({
995
+ function wt({
996
996
  isOpen: e,
997
- lenses: t = ne,
998
- defaultLens: r = ae,
999
- tilesByLens: c = se,
1000
- lensMeta: n = z,
997
+ lenses: t = ge,
998
+ defaultLens: r = be,
999
+ tilesByLens: i = ve,
1000
+ lensMeta: n = ee,
1001
1001
  footerSlot: o,
1002
1002
  renderTile: u
1003
1003
  }) {
1004
- const [l, s] = S(r), [i, d] = S(null), [p, m] = S(null), [f, _] = S(""), b = c[l] ?? { primary: [] }, C = n[l], N = W(
1005
- () => b.primary.filter((v) => q(v, f)),
1006
- [b.primary, f]
1007
- ), y = W(
1008
- () => (b.secondary ?? []).filter((v) => q(v, f)),
1009
- [b.secondary, f]
1004
+ const [s, l] = E(r), [c, d] = E(null), [m, f] = E(null), [v, p] = E(""), b = i[s] ?? { primary: [] }, w = n[s], S = re(
1005
+ () => b.primary.filter((y) => ie(y, v)),
1006
+ [b.primary, v]
1007
+ ), T = re(
1008
+ () => (b.secondary ?? []).filter((y) => ie(y, v)),
1009
+ [b.secondary, v]
1010
1010
  );
1011
1011
  return /* @__PURE__ */ h(
1012
- Y.Provider,
1012
+ te.Provider,
1013
1013
  {
1014
- value: { mode: "add", selectedTileId: i, description: p },
1014
+ value: { mode: "add", selectedTileId: c, description: m },
1015
1015
  children: [
1016
1016
  /* @__PURE__ */ h("div", { "data-shell": "catalog-add", "aria-hidden": !e, children: [
1017
1017
  /* @__PURE__ */ a("div", { className: "cat-search", children: /* @__PURE__ */ a(
@@ -1021,54 +1021,54 @@ function Ct({
1021
1021
  className: "cat-search-input",
1022
1022
  placeholder: "Search metrics",
1023
1023
  "aria-label": "Search metrics",
1024
- value: f,
1025
- onChange: (v) => _(v.target.value)
1024
+ value: v,
1025
+ onChange: (y) => p(y.target.value)
1026
1026
  }
1027
1027
  ) }),
1028
1028
  /* @__PURE__ */ a(
1029
- re,
1029
+ ye,
1030
1030
  {
1031
1031
  lenses: t,
1032
- activeLens: l,
1032
+ activeLens: s,
1033
1033
  lensMeta: n,
1034
1034
  variant: "pills",
1035
- onLensChange: (v) => {
1036
- s(v), d(null), m(null), _("");
1035
+ onLensChange: (y) => {
1036
+ l(y), d(null), f(null), p("");
1037
1037
  }
1038
1038
  }
1039
1039
  ),
1040
- C && /* @__PURE__ */ h("div", { className: "cat-lens-meta", children: [
1041
- /* @__PURE__ */ a("h3", { className: "cat-lens-headline", children: C.headline }),
1042
- /* @__PURE__ */ a("p", { className: "cat-lens-helper", children: C.helper })
1040
+ w && /* @__PURE__ */ h("div", { className: "cat-lens-meta", children: [
1041
+ /* @__PURE__ */ a("h3", { className: "cat-lens-headline", children: w.headline }),
1042
+ /* @__PURE__ */ a("p", { className: "cat-lens-helper", children: w.helper })
1043
1043
  ] }),
1044
1044
  /* @__PURE__ */ a(
1045
- V,
1045
+ X,
1046
1046
  {
1047
- tiles: N,
1048
- selectedTileId: i,
1049
- onSelectTile: (v, E) => {
1050
- d(v), m(E);
1047
+ tiles: S,
1048
+ selectedTileId: c,
1049
+ onSelectTile: (y, A) => {
1050
+ d(y), f(A);
1051
1051
  },
1052
1052
  renderTile: u
1053
1053
  }
1054
1054
  ),
1055
- y.length > 0 && /* @__PURE__ */ h("div", { className: "cat-more-in-lens", children: [
1055
+ T.length > 0 && /* @__PURE__ */ h("div", { className: "cat-more-in-lens", children: [
1056
1056
  /* @__PURE__ */ a("div", { className: "cat-more-in-lens__heading", children: "MORE IN THIS LENS" }),
1057
1057
  /* @__PURE__ */ a(
1058
- V,
1058
+ X,
1059
1059
  {
1060
- tiles: y,
1061
- selectedTileId: i,
1062
- onSelectTile: (v, E) => {
1063
- d(v), m(E);
1060
+ tiles: T,
1061
+ selectedTileId: c,
1062
+ onSelectTile: (y, A) => {
1063
+ d(y), f(A);
1064
1064
  },
1065
1065
  renderTile: u
1066
1066
  }
1067
1067
  )
1068
1068
  ] }),
1069
- N.length === 0 && y.length === 0 && f.length > 0 && /* @__PURE__ */ h("div", { className: "cat-empty", children: [
1069
+ S.length === 0 && T.length === 0 && v.length > 0 && /* @__PURE__ */ h("div", { className: "cat-empty", children: [
1070
1070
  'No metrics match "',
1071
- f,
1071
+ v,
1072
1072
  '".'
1073
1073
  ] })
1074
1074
  ] }),
@@ -1077,20 +1077,20 @@ function Ct({
1077
1077
  }
1078
1078
  );
1079
1079
  }
1080
- function Tt({
1080
+ function Et({
1081
1081
  isOpen: e,
1082
1082
  replacingLabel: t,
1083
- lenses: r = ne,
1084
- defaultLens: c = ae,
1085
- tilesByLens: n = se,
1083
+ lenses: r = ge,
1084
+ defaultLens: i = be,
1085
+ tilesByLens: n = ve,
1086
1086
  footerSlot: o,
1087
1087
  renderTile: u
1088
1088
  }) {
1089
- const [l, s] = S(c), [i, d] = S(null), [p, m] = S(null), f = n[l] ?? { primary: [] }, _ = [...f.primary, ...f.secondary ?? []];
1089
+ const [s, l] = E(i), [c, d] = E(null), [m, f] = E(null), v = n[s] ?? { primary: [] }, p = [...v.primary, ...v.secondary ?? []];
1090
1090
  return /* @__PURE__ */ h(
1091
- Y.Provider,
1091
+ te.Provider,
1092
1092
  {
1093
- value: { mode: "replace", selectedTileId: i, description: p },
1093
+ value: { mode: "replace", selectedTileId: c, description: m },
1094
1094
  children: [
1095
1095
  /* @__PURE__ */ h("div", { "data-shell": "catalog-replace", "aria-hidden": !e, children: [
1096
1096
  t && /* @__PURE__ */ h("p", { className: "cat-subtitle", children: [
@@ -1098,22 +1098,22 @@ function Tt({
1098
1098
  t
1099
1099
  ] }),
1100
1100
  /* @__PURE__ */ a(
1101
- re,
1101
+ ye,
1102
1102
  {
1103
1103
  lenses: r,
1104
- activeLens: l,
1104
+ activeLens: s,
1105
1105
  onLensChange: (b) => {
1106
- s(b), d(null), m(null);
1106
+ l(b), d(null), f(null);
1107
1107
  }
1108
1108
  }
1109
1109
  ),
1110
1110
  /* @__PURE__ */ a(
1111
- V,
1111
+ X,
1112
1112
  {
1113
- tiles: _,
1114
- selectedTileId: i,
1115
- onSelectTile: (b, C) => {
1116
- d(b), m(C);
1113
+ tiles: p,
1114
+ selectedTileId: c,
1115
+ onSelectTile: (b, w) => {
1116
+ d(b), f(w);
1117
1117
  },
1118
1118
  renderTile: u
1119
1119
  }
@@ -1124,12 +1124,12 @@ function Tt({
1124
1124
  }
1125
1125
  );
1126
1126
  }
1127
- const le = ee(null);
1128
- function oe() {
1129
- return te(le);
1127
+ const Ce = he(null);
1128
+ function _e() {
1129
+ return fe(Ce);
1130
1130
  }
1131
- function We(e = {}) {
1132
- const r = oe()?.setPages;
1131
+ function Ze(e = {}) {
1132
+ const t = _e(), r = t?.createPage, i = t?.setPages;
1133
1133
  return /* @__PURE__ */ h(
1134
1134
  "div",
1135
1135
  {
@@ -1144,8 +1144,12 @@ function We(e = {}) {
1144
1144
  type: "button",
1145
1145
  className: "btn btn-primary",
1146
1146
  onClick: () => {
1147
- r && r((c) => [
1148
- ...c,
1147
+ if (r) {
1148
+ r();
1149
+ return;
1150
+ }
1151
+ i && i((n) => [
1152
+ ...n,
1149
1153
  { id: `new-${Date.now()}`, name: "Untitled", active: !1 }
1150
1154
  ]);
1151
1155
  },
@@ -1156,36 +1160,51 @@ function We(e = {}) {
1156
1160
  }
1157
1161
  );
1158
1162
  }
1159
- function Ge({ page: e, onRename: t, onKebab: r, onDragStart: c }) {
1160
- const n = oe(), [o, u] = S(!1), l = I(null);
1161
- x(() => {
1162
- if (!o) return;
1163
- const m = (f) => {
1164
- l.current && (l.current.contains(f.target) || u(!1));
1163
+ function ce({ page: e, onRename: t, onKebab: r, onDragStart: i, onSwitchPage: n }) {
1164
+ const o = _e(), [u, s] = E(!1), l = U(null);
1165
+ L(() => {
1166
+ if (!u) return;
1167
+ const p = (b) => {
1168
+ l.current && (l.current.contains(b.target) || s(!1));
1165
1169
  };
1166
- return document.addEventListener("mousedown", m, !0), () => document.removeEventListener("mousedown", m, !0);
1167
- }, [o]);
1168
- const s = () => {
1169
- if (u(!1), t) return t(e.id);
1170
- if (!n?.renamePage) return;
1171
- const m = window.prompt("Rename page", e.name);
1172
- m != null && m.trim().length > 0 && n.renamePage(e.id, m.trim());
1173
- }, i = () => {
1174
- u(!1), n?.duplicatePage?.(e.id);
1170
+ return document.addEventListener("mousedown", p, !0), () => document.removeEventListener("mousedown", p, !0);
1171
+ }, [u]);
1172
+ const c = () => {
1173
+ if (s(!1), t) return t(e.id);
1174
+ if (!o?.renamePage) return;
1175
+ const p = window.prompt("Rename page", e.name);
1176
+ p != null && p.trim().length > 0 && o.renamePage(e.id, p.trim());
1175
1177
  }, d = () => {
1176
- u(!1), !e.active && n?.deletePage?.(e.id);
1177
- }, p = ["pm-row"];
1178
- return e.active && p.push("active"), /* @__PURE__ */ h("div", { ref: l, className: p.join(" "), "data-page-id": e.id, role: "listitem", children: [
1178
+ s(!1), o?.duplicatePage?.(e.id);
1179
+ }, m = () => {
1180
+ s(!1), o?.deletePage?.(e.id);
1181
+ }, f = (p) => {
1182
+ p.stopPropagation(), n && !e.active && n(e.id);
1183
+ }, v = ["pm-row"];
1184
+ return e.active && v.push("active"), /* @__PURE__ */ h("div", { ref: l, className: v.join(" "), "data-page-id": e.id, role: "listitem", children: [
1179
1185
  /* @__PURE__ */ a(
1180
1186
  "div",
1181
1187
  {
1182
1188
  className: "pm-handle",
1183
1189
  "aria-hidden": "true",
1184
- onMouseDown: () => c?.(e.id),
1190
+ onMouseDown: () => i?.(e.id),
1185
1191
  children: "⋮⋮"
1186
1192
  }
1187
1193
  ),
1188
- /* @__PURE__ */ a("div", { className: "pm-name", children: e.name }),
1194
+ /* @__PURE__ */ a(
1195
+ "div",
1196
+ {
1197
+ className: "pm-name",
1198
+ role: n && !e.active ? "button" : void 0,
1199
+ tabIndex: n && !e.active ? 0 : void 0,
1200
+ onClick: n ? f : void 0,
1201
+ onKeyDown: (p) => {
1202
+ !n || e.active || (p.key === "Enter" || p.key === " ") && (p.preventDefault(), p.stopPropagation(), n(e.id));
1203
+ },
1204
+ "aria-label": n && !e.active ? `Switch to ${e.name}` : void 0,
1205
+ children: e.name
1206
+ }
1207
+ ),
1189
1208
  /* @__PURE__ */ a(
1190
1209
  "button",
1191
1210
  {
@@ -1193,75 +1212,152 @@ function Ge({ page: e, onRename: t, onKebab: r, onDragStart: c }) {
1193
1212
  className: "pm-kebab",
1194
1213
  "aria-label": "Page options",
1195
1214
  "aria-haspopup": "menu",
1196
- "aria-expanded": o,
1197
- onClick: (m) => {
1198
- if (m.stopPropagation(), r) return r(e.id);
1199
- u((f) => !f);
1215
+ "aria-expanded": u,
1216
+ onPointerDown: (p) => p.stopPropagation(),
1217
+ onMouseDown: (p) => p.stopPropagation(),
1218
+ onClick: (p) => {
1219
+ if (p.stopPropagation(), r) return r(e.id);
1220
+ s((b) => !b);
1200
1221
  },
1201
1222
  children: "⋯"
1202
1223
  }
1203
1224
  ),
1204
- o && /* @__PURE__ */ h("div", { className: "pm-kebab-menu", role: "menu", "data-page-id": e.id, children: [
1205
- /* @__PURE__ */ a("button", { type: "button", role: "menuitem", className: "pm-kebab-menu__item", onClick: s, children: "Rename" }),
1206
- /* @__PURE__ */ a("button", { type: "button", role: "menuitem", className: "pm-kebab-menu__item", onClick: i, children: "Duplicate" }),
1207
- /* @__PURE__ */ a(
1208
- "button",
1209
- {
1210
- type: "button",
1211
- role: "menuitem",
1212
- className: "pm-kebab-menu__item pm-kebab-menu__item--danger",
1213
- onClick: d,
1214
- "aria-disabled": e.active,
1215
- children: "Delete"
1216
- }
1217
- )
1218
- ] })
1225
+ u && /* @__PURE__ */ h(
1226
+ "div",
1227
+ {
1228
+ className: "pm-kebab-menu",
1229
+ role: "menu",
1230
+ "data-page-id": e.id,
1231
+ onPointerDown: (p) => p.stopPropagation(),
1232
+ onMouseDown: (p) => p.stopPropagation(),
1233
+ children: [
1234
+ /* @__PURE__ */ a("button", { type: "button", role: "menuitem", className: "pm-kebab-menu__item", onClick: c, children: "Rename" }),
1235
+ /* @__PURE__ */ a("button", { type: "button", role: "menuitem", className: "pm-kebab-menu__item", onClick: d, children: "Duplicate" }),
1236
+ /* @__PURE__ */ a(
1237
+ "button",
1238
+ {
1239
+ type: "button",
1240
+ role: "menuitem",
1241
+ className: "pm-kebab-menu__item pm-kebab-menu__item--danger",
1242
+ onClick: m,
1243
+ children: "Delete"
1244
+ }
1245
+ )
1246
+ ]
1247
+ }
1248
+ )
1219
1249
  ] });
1220
1250
  }
1221
- const Qe = [
1251
+ const Xe = [
1222
1252
  { id: "p-pipeline", name: "My Pipeline", active: !0 },
1223
1253
  { id: "p-numbers", name: "My Numbers", active: !1 },
1224
1254
  { id: "p-morning", name: "My Morning", active: !1 },
1225
1255
  { id: "p-accounts", name: "My Accounts", active: !1 }
1226
1256
  ];
1227
- function St({
1257
+ function Pt({
1228
1258
  isOpen: e,
1229
- pages: t = Qe,
1230
- footerSlot: r
1259
+ pages: t = Xe,
1260
+ footerSlot: r,
1261
+ externalPages: i,
1262
+ activePageId: n,
1263
+ onRename: o,
1264
+ onDuplicate: u,
1265
+ onDelete: s,
1266
+ onReorder: l,
1267
+ onCreatePage: c,
1268
+ onSwitchPage: d
1231
1269
  }) {
1232
- const [c, n] = S(() => [...t]), o = P((s, i) => {
1233
- n((d) => d.map((p) => p.id === s ? { ...p, name: i } : p));
1234
- }, []), u = P((s) => {
1235
- n((i) => {
1236
- const d = i.find((f) => f.id === s);
1237
- if (!d) return i;
1238
- const p = {
1239
- id: `${d.id}-copy-${Date.now()}`,
1240
- name: `${d.name} copy`,
1270
+ const [m, f] = E(() => [...t]), v = x((g, N) => {
1271
+ f((C) => C.map((P) => P.id === g ? { ...P, name: N } : P));
1272
+ }, []), p = x((g) => {
1273
+ f((N) => {
1274
+ const C = N.find((W) => W.id === g);
1275
+ if (!C) return N;
1276
+ const P = {
1277
+ id: `${C.id}-copy-${Date.now()}`,
1278
+ name: `${C.name} copy`,
1241
1279
  active: !1
1242
- }, m = i.findIndex((f) => f.id === s);
1243
- return [...i.slice(0, m + 1), p, ...i.slice(m + 1)];
1280
+ }, k = N.findIndex((W) => W.id === g);
1281
+ return [...N.slice(0, k + 1), P, ...N.slice(k + 1)];
1244
1282
  });
1245
- }, []), l = P((s) => {
1246
- n((i) => i.filter((d) => d.id !== s));
1247
- }, []);
1248
- return /* @__PURE__ */ a(le.Provider, { value: { pages: c, setPages: n, renamePage: o, duplicatePage: u, deletePage: l }, children: /* @__PURE__ */ h("div", { "data-shell": "page-management", "aria-hidden": !e, children: [
1249
- /* @__PURE__ */ a("div", { className: "pm-list", role: "list", children: c.map((s) => /* @__PURE__ */ a(Ge, { page: s }, s.id)) }),
1250
- r != null && /* @__PURE__ */ a("div", { className: "pm-footer-pin", children: r })
1251
- ] }) });
1283
+ }, []), b = x((g) => {
1284
+ f((N) => N.filter((C) => C.id !== g));
1285
+ }, []), w = x((g) => {
1286
+ f((N) => {
1287
+ const C = new Map(N.map((k) => [k.id, k])), P = g.map((k) => C.get(k)).filter(Boolean);
1288
+ return P.length === N.length ? P : N;
1289
+ });
1290
+ }, []), S = i != null, T = S ? i : m, y = n != null ? T.map((g) => ({ ...g, active: g.id === n })) : [...T], A = o ?? (S ? void 0 : v), z = u ?? (S ? void 0 : p), V = s ?? (S ? void 0 : b), D = l ?? (S ? void 0 : w), H = x(
1291
+ (g) => {
1292
+ S || f(g);
1293
+ },
1294
+ [S]
1295
+ ), K = x(
1296
+ (g) => {
1297
+ const N = g[0]?.items.map((C) => C.id) ?? [];
1298
+ N.length > 0 && D && D(N);
1299
+ },
1300
+ [D]
1301
+ ), Y = y.map((g) => `${g.id}:${g.name}`).join("|"), B = D != null && y.length > 1 ? /* @__PURE__ */ a(
1302
+ Se,
1303
+ {
1304
+ zones: [
1305
+ {
1306
+ zoneKey: "pm-pages",
1307
+ items: y.map((g) => ({ ...g, id: g.id }))
1308
+ }
1309
+ ],
1310
+ onZoneChange: K,
1311
+ renderZone: (g, N, C) => /* @__PURE__ */ a("div", { className: "pm-list", role: "list", children: C }),
1312
+ renderItem: (g) => /* @__PURE__ */ a(
1313
+ ce,
1314
+ {
1315
+ page: g,
1316
+ onSwitchPage: d
1317
+ },
1318
+ g.id
1319
+ )
1320
+ },
1321
+ Y
1322
+ ) : /* @__PURE__ */ a("div", { className: "pm-list", role: "list", children: y.map((g) => /* @__PURE__ */ a(
1323
+ ce,
1324
+ {
1325
+ page: g,
1326
+ onSwitchPage: d
1327
+ },
1328
+ g.id
1329
+ )) });
1330
+ return /* @__PURE__ */ a(
1331
+ Ce.Provider,
1332
+ {
1333
+ value: {
1334
+ pages: y,
1335
+ setPages: H,
1336
+ renamePage: A,
1337
+ duplicatePage: z,
1338
+ deletePage: V,
1339
+ // Sprint 2026-05-20 — propagate live create binding for footer.
1340
+ createPage: c
1341
+ },
1342
+ children: /* @__PURE__ */ h("div", { "data-shell": "page-management", "aria-hidden": !e, children: [
1343
+ B,
1344
+ r != null && /* @__PURE__ */ a("div", { className: "pm-footer-pin", children: r })
1345
+ ] })
1346
+ }
1347
+ );
1252
1348
  }
1253
- const Nt = {
1349
+ const xt = {
1254
1350
  SETTINGS: "settings",
1255
1351
  CATALOG_ADD: "catalog-add",
1256
1352
  CATALOG_REPLACE: "catalog-replace",
1257
1353
  PAGE_MGMT: "page-management",
1258
1354
  NOTIFICATION_CENTER: "notification-center"
1259
- }, qe = {
1355
+ }, Je = {
1260
1356
  position: "fixed",
1261
1357
  inset: 0,
1262
1358
  pointerEvents: "none",
1263
1359
  zIndex: 55
1264
- }, je = {
1360
+ }, et = {
1265
1361
  position: "absolute",
1266
1362
  inset: 0,
1267
1363
  zIndex: 1,
@@ -1270,88 +1366,88 @@ const Nt = {
1270
1366
  pointerEvents: "none",
1271
1367
  background: "rgba(0, 0, 0, 0.04)"
1272
1368
  };
1273
- function wt() {
1274
- const { state: e, dispatch: t, getCloseLog: r } = _e();
1275
- x(() => {
1369
+ function At() {
1370
+ const { state: e, dispatch: t, getCloseLog: r } = we();
1371
+ L(() => {
1276
1372
  if (e.activePanelId == null) return;
1277
1373
  function o(u) {
1278
1374
  u.key === "Escape" && t({ type: "CLOSE_PANEL", reason: "escape-key" });
1279
1375
  }
1280
1376
  return document.addEventListener("keydown", o), () => document.removeEventListener("keydown", o);
1281
1377
  }, [e.activePanelId, t]);
1282
- const c = I(e);
1283
- Ce(() => {
1284
- c.current = e;
1285
- }), x(() => {
1378
+ const i = U(e);
1379
+ Ee(() => {
1380
+ i.current = e;
1381
+ }), L(() => {
1286
1382
  if (process.env.NODE_ENV === "production") return;
1287
1383
  const o = window;
1288
1384
  return o.__panelsHostHandle && console.warn("[panels] multiple PanelHost/PanelHostShell instances mounted; dev handle is unreliable"), o.__panelsHostHandle = {
1289
1385
  dispatch: t,
1290
- getState: () => c.current,
1386
+ getState: () => i.current,
1291
1387
  getCloseLog: r
1292
1388
  }, () => {
1293
1389
  o.__panelsHostHandle?.dispatch === t && delete window.__panelsHostHandle;
1294
1390
  };
1295
1391
  }, [t, r]);
1296
- const n = P(() => {
1392
+ const n = x(() => {
1297
1393
  t({ type: "CLOSE_PANEL", reason: "nav-escape-hatch" });
1298
1394
  }, [t]);
1299
- return /* @__PURE__ */ a("div", { "data-panel-host": "true", style: qe, children: e.activePanelId != null && /* @__PURE__ */ a(
1395
+ return /* @__PURE__ */ a("div", { "data-panel-host": "true", style: Je, children: e.activePanelId != null && /* @__PURE__ */ a(
1300
1396
  "div",
1301
1397
  {
1302
1398
  "data-panel-scrim": "true",
1303
- style: je,
1399
+ style: et,
1304
1400
  onClick: n
1305
1401
  }
1306
1402
  ) });
1307
1403
  }
1308
- const Xe = 700;
1309
- function Je(e) {
1310
- const [t, r] = S(null), c = I(null);
1311
- return x(() => {
1404
+ const tt = 700;
1405
+ function nt(e) {
1406
+ const [t, r] = E(null), i = U(null);
1407
+ return L(() => {
1312
1408
  if (e != null) {
1313
- c.current != null && (clearTimeout(c.current), c.current = null), r(null);
1409
+ i.current != null && (clearTimeout(i.current), i.current = null), r(null);
1314
1410
  return;
1315
1411
  }
1316
- return r((n) => n), c.current = setTimeout(() => {
1317
- r(null), c.current = null;
1318
- }, Xe), () => {
1319
- c.current != null && (clearTimeout(c.current), c.current = null);
1412
+ return r((n) => n), i.current = setTimeout(() => {
1413
+ r(null), i.current = null;
1414
+ }, tt), () => {
1415
+ i.current != null && (clearTimeout(i.current), i.current = null);
1320
1416
  };
1321
- }, [e]), x(() => {
1417
+ }, [e]), L(() => {
1322
1418
  e != null && r(e);
1323
1419
  }, [e]), e != null ? { panelId: e, isOpen: !0 } : t != null ? { panelId: t, isOpen: !1 } : { panelId: null, isOpen: !1 };
1324
1420
  }
1325
- function Et({ panelComponents: e, children: t }) {
1326
- const r = L();
1421
+ function kt({ panelComponents: e, children: t }) {
1422
+ const r = F();
1327
1423
  if (r == null) return null;
1328
- const { state: c, dispatch: n } = r, o = Je(c.activePanelId);
1424
+ const { state: i, dispatch: n } = r, o = nt(i.activePanelId);
1329
1425
  if (o.panelId == null) return null;
1330
- const u = o.panelId, l = o.isOpen, s = e?.[u];
1331
- if (s == null && t == null)
1426
+ const u = o.panelId, s = o.isOpen, l = e?.[u];
1427
+ if (l == null && t == null)
1332
1428
  return process.env.NODE_ENV !== "production" && console.error(
1333
1429
  "[panels] No panel component registered for activePanelId:",
1334
1430
  u
1335
1431
  ), null;
1336
1432
  if (u === "settings") {
1337
- const i = c.isDirty, d = c.activeTrigger, p = d?.kind === "card-overflow" ? d.cardId : null;
1338
- return /* @__PURE__ */ a(A, { isOpen: l, children: /* @__PURE__ */ a(
1339
- k,
1433
+ const c = i.isDirty, d = i.activeTrigger, m = d?.kind === "card-overflow" ? d.cardId : null;
1434
+ return /* @__PURE__ */ a(I, { isOpen: s, children: /* @__PURE__ */ a(
1435
+ M,
1340
1436
  {
1341
- isOpen: l,
1437
+ isOpen: s,
1342
1438
  title: "Configure metric",
1343
1439
  variant: "merged-stage",
1344
1440
  onClose: () => n({ type: "CLOSE_PANEL", reason: "header-x" }),
1345
- footer: /* @__PURE__ */ h(Z, { children: [
1441
+ footer: /* @__PURE__ */ h(me, { children: [
1346
1442
  /* @__PURE__ */ a(
1347
1443
  "button",
1348
1444
  {
1349
1445
  id: "btn-reset",
1350
1446
  type: "button",
1351
1447
  className: "gloss-panel-chrome__footer-btn",
1352
- disabled: !i,
1448
+ disabled: !c,
1353
1449
  onClick: () => {
1354
- p != null && n({ type: "CLEAR_BUFFER", cardId: p });
1450
+ m != null && n({ type: "CLEAR_BUFFER", cardId: m });
1355
1451
  },
1356
1452
  children: "Reset"
1357
1453
  }
@@ -1373,344 +1469,344 @@ function Et({ panelComponents: e, children: t }) {
1373
1469
  id: "settings-apply",
1374
1470
  type: "button",
1375
1471
  className: "gloss-panel-chrome__footer-btn gloss-panel-chrome__footer-btn--primary",
1376
- disabled: !i,
1472
+ disabled: !c,
1377
1473
  onClick: () => n({ type: "CLOSE_PANEL", reason: "apply-button" }),
1378
1474
  children: "Apply"
1379
1475
  }
1380
1476
  )
1381
1477
  ] }),
1382
- children: s != null ? /* @__PURE__ */ a(s, { isOpen: l }) : t
1478
+ children: l != null ? /* @__PURE__ */ a(l, { isOpen: s }) : t
1383
1479
  }
1384
1480
  ) });
1385
1481
  }
1386
1482
  if (u === "catalog-add" || u === "catalog-replace") {
1387
- if (s == null) return null;
1388
- const i = u === "catalog-replace" ? "replace" : "add";
1389
- return /* @__PURE__ */ a(A, { isOpen: l, children: /* @__PURE__ */ a(
1390
- k,
1483
+ if (l == null) return null;
1484
+ const c = u === "catalog-replace" ? "replace" : "add";
1485
+ return /* @__PURE__ */ a(I, { isOpen: s, children: /* @__PURE__ */ a(
1486
+ M,
1391
1487
  {
1392
- isOpen: l,
1488
+ isOpen: s,
1393
1489
  onClose: () => n({ type: "CLOSE_PANEL", reason: "header-x" }),
1394
1490
  footer: null,
1395
- title: i === "replace" ? "Replace metric" : "Add a metric",
1491
+ title: c === "replace" ? "Replace metric" : "Add a metric",
1396
1492
  children: /* @__PURE__ */ a(
1397
- s,
1493
+ l,
1398
1494
  {
1399
- isOpen: l,
1400
- footerSlot: /* @__PURE__ */ a(Be, { mode: i, dispatch: n })
1495
+ isOpen: s,
1496
+ footerSlot: /* @__PURE__ */ a(je, { mode: c, dispatch: n })
1401
1497
  }
1402
1498
  )
1403
1499
  }
1404
1500
  ) });
1405
1501
  }
1406
- return u === "page-management" ? s == null ? null : /* @__PURE__ */ a(A, { isOpen: l, children: /* @__PURE__ */ a(
1407
- k,
1502
+ return u === "page-management" ? l == null ? null : /* @__PURE__ */ a(I, { isOpen: s, children: /* @__PURE__ */ a(
1503
+ M,
1408
1504
  {
1409
- isOpen: l,
1505
+ isOpen: s,
1410
1506
  onClose: () => n({ type: "CLOSE_PANEL", reason: "header-x" }),
1411
1507
  footer: null,
1412
1508
  title: "Manage pages",
1413
- children: /* @__PURE__ */ a(s, { isOpen: l, footerSlot: /* @__PURE__ */ a(We, {}) })
1509
+ children: /* @__PURE__ */ a(l, { isOpen: s, footerSlot: /* @__PURE__ */ a(Ze, {}) })
1414
1510
  }
1415
- ) }) : /* @__PURE__ */ a(A, { isOpen: l, children: /* @__PURE__ */ a(
1416
- k,
1511
+ ) }) : /* @__PURE__ */ a(I, { isOpen: s, children: /* @__PURE__ */ a(
1512
+ M,
1417
1513
  {
1418
1514
  isOpen: !0,
1419
1515
  onClose: () => n({ type: "CLOSE_PANEL", reason: "header-x" }),
1420
1516
  footer: null,
1421
- children: s != null ? /* @__PURE__ */ a(s, { isOpen: l }) : t
1517
+ children: l != null ? /* @__PURE__ */ a(l, { isOpen: s }) : t
1422
1518
  }
1423
1519
  ) });
1424
1520
  }
1425
- function j(e) {
1521
+ function de(e) {
1426
1522
  return e === null ? null : e.kind === "manage-pages-action" ? `global-${e.align ?? "left"}` : e.kind === "card-overflow" || e.kind === "empty-cell" ? `section-${e.sectionIndex}` : null;
1427
1523
  }
1428
- const Ze = 685, X = 627, et = "cubic-bezier(0.22, 1, 0.36, 1)", tt = 200;
1429
- function ie(e, t) {
1524
+ const at = 685, ue = 627, st = "cubic-bezier(0.22, 1, 0.36, 1)", rt = 200;
1525
+ function Te(e, t) {
1430
1526
  if (typeof window > "u") return t;
1431
1527
  const r = window.getComputedStyle(document.documentElement).getPropertyValue(e).trim();
1432
1528
  if (!r) return t;
1433
- const c = parseFloat(r);
1434
- return Number.isNaN(c) ? t : r.endsWith("s") && !r.endsWith("ms") ? c * 1e3 : c;
1529
+ const i = parseFloat(r);
1530
+ return Number.isNaN(i) ? t : r.endsWith("s") && !r.endsWith("ms") ? i * 1e3 : i;
1435
1531
  }
1436
- function nt(e, t) {
1532
+ function lt(e, t) {
1437
1533
  return typeof window > "u" ? t : window.getComputedStyle(document.documentElement).getPropertyValue(e).trim() || t;
1438
1534
  }
1439
- function D(e) {
1535
+ function $(e) {
1440
1536
  e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger });
1441
1537
  }
1442
- function at(e) {
1443
- const { mountEl: t, chromeEl: r, reducedMotion: c, onAssert: n } = e;
1538
+ function ot(e) {
1539
+ const { mountEl: t, chromeEl: r, reducedMotion: i, onAssert: n } = e;
1444
1540
  if (t == null || r == null) {
1445
- D(e), n?.({ branch: "slide-fallback-no-dom", timestamp: Date.now() });
1541
+ $(e), n?.({ branch: "slide-fallback-no-dom", timestamp: Date.now() });
1446
1542
  return;
1447
1543
  }
1448
- if (c) {
1544
+ if (i) {
1449
1545
  e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), n?.({ branch: "slide-reduced-motion", timestamp: Date.now() });
1450
1546
  return;
1451
1547
  }
1452
1548
  if (typeof r.animate != "function") {
1453
- D(e), n?.({ branch: "slide-no-waapi", timestamp: Date.now() });
1549
+ $(e), n?.({ branch: "slide-no-waapi", timestamp: Date.now() });
1454
1550
  return;
1455
1551
  }
1456
1552
  const o = r.cloneNode(!0);
1457
1553
  o.id = "panel-chrome-frozen", o.style.cssText = "position:absolute;left:8px;right:8px;top:8px;z-index:1;pointer-events:none;", t.appendChild(o), r.style.zIndex = "2", e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger });
1458
- const u = ie("--panel-open-dur", Ze), l = nt("--panel-easing", et), s = r.animate(
1554
+ const u = Te("--panel-open-dur", at), s = lt("--panel-easing", st), l = r.animate(
1459
1555
  [{ transform: "translateY(100%)" }, { transform: "translateY(0)" }],
1460
- { duration: u, easing: l, fill: "forwards" }
1556
+ { duration: u, easing: s, fill: "forwards" }
1461
1557
  );
1462
- s.addEventListener(
1558
+ l.addEventListener(
1463
1559
  "finish",
1464
1560
  () => {
1465
- o.remove(), r.style.zIndex = "", s.cancel(), n?.({ branch: "slide-complete", frozen: "cleaned", timestamp: Date.now() });
1561
+ o.remove(), r.style.zIndex = "", l.cancel(), n?.({ branch: "slide-complete", frozen: "cleaned", timestamp: Date.now() });
1466
1562
  },
1467
1563
  { once: !0 }
1468
1564
  );
1469
1565
  }
1470
- function st(e) {
1566
+ function it(e) {
1471
1567
  const { mountEl: t, onAssert: r } = e;
1472
1568
  if (t == null) {
1473
- e.dispatch({ type: "CLOSE_PANEL", reason: "mutex-handoff" }), setTimeout(() => D(e), X), r?.({ branch: "handoff-fallback-no-mount", timestamp: Date.now() });
1569
+ e.dispatch({ type: "CLOSE_PANEL", reason: "mutex-handoff" }), setTimeout(() => $(e), ue), r?.({ branch: "handoff-fallback-no-mount", timestamp: Date.now() });
1474
1570
  return;
1475
1571
  }
1476
- const c = ie("--panel-close-dur", X);
1572
+ const i = Te("--panel-close-dur", ue);
1477
1573
  let n = !1, o = null;
1478
- const u = (s) => {
1479
- s.target !== t || s.propertyName !== "max-height" || n || (n = !0, o != null && clearTimeout(o), t.removeEventListener("transitionend", u), e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), r?.({ branch: "handoff-complete", timestamp: Date.now() }));
1480
- }, l = () => {
1574
+ const u = (l) => {
1575
+ l.target !== t || l.propertyName !== "max-height" || n || (n = !0, o != null && clearTimeout(o), t.removeEventListener("transitionend", u), e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), r?.({ branch: "handoff-complete", timestamp: Date.now() }));
1576
+ }, s = () => {
1481
1577
  n || (n = !0, t.removeEventListener("transitionend", u), e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), r?.({ branch: "handoff-forced", timestamp: Date.now() }));
1482
1578
  };
1483
- t.addEventListener("transitionend", u), e.dispatch({ type: "CLOSE_PANEL", reason: "mutex-handoff" }), o = setTimeout(l, c + tt);
1579
+ t.addEventListener("transitionend", u), e.dispatch({ type: "CLOSE_PANEL", reason: "mutex-handoff" }), o = setTimeout(s, i + rt);
1484
1580
  }
1485
- function rt(e) {
1581
+ function ct(e) {
1486
1582
  const { state: t, onAssert: r } = e;
1487
1583
  if (t.activePanelId && t.isDirty) {
1488
1584
  e.dispatch({ type: "OPEN_PANEL", panelId: e.panelId, trigger: e.trigger }), r?.({ branch: "blocked-dirty", timestamp: Date.now() });
1489
1585
  return;
1490
1586
  }
1491
- const c = j(t.activeTrigger), n = j(e.trigger);
1492
- if (!!t.activePanelId && c != null && c === n) {
1493
- at(e);
1587
+ const i = de(t.activeTrigger), n = de(e.trigger);
1588
+ if (!!t.activePanelId && i != null && i === n) {
1589
+ ot(e);
1494
1590
  return;
1495
1591
  }
1496
1592
  if (t.activePanelId) {
1497
- st(e);
1593
+ it(e);
1498
1594
  return;
1499
1595
  }
1500
- D(e), r?.({ branch: "fresh-open", timestamp: Date.now() });
1596
+ $(e), r?.({ branch: "fresh-open", timestamp: Date.now() });
1501
1597
  }
1502
- function lt() {
1598
+ function dt() {
1503
1599
  if (!(typeof window > "u"))
1504
1600
  return window.__panelsAsserter;
1505
1601
  }
1506
- function Pt() {
1507
- const e = L(), t = J();
1508
- return P(
1509
- (r, c) => {
1602
+ function Dt() {
1603
+ const e = F(), t = pe();
1604
+ return x(
1605
+ (r, i) => {
1510
1606
  if (!e)
1511
1607
  return;
1512
1608
  const n = typeof document < "u" ? document.querySelector('[data-mount="panel"]') : null, o = typeof document < "u" ? document.querySelector('[data-chrome="panel"]') : null, u = {
1513
1609
  panelId: r,
1514
- trigger: c,
1610
+ trigger: i,
1515
1611
  state: e.state,
1516
1612
  dispatch: e.dispatch,
1517
1613
  mountEl: n,
1518
1614
  chromeEl: o,
1519
1615
  reducedMotion: t,
1520
- onAssert: (l) => {
1521
- lt()?.recordTransition?.(l);
1616
+ onAssert: (s) => {
1617
+ dt()?.recordTransition?.(s);
1522
1618
  }
1523
1619
  };
1524
- rt(u);
1620
+ ct(u);
1525
1621
  },
1526
1622
  [e, t]
1527
1623
  );
1528
1624
  }
1529
- let O = !1, M = null;
1530
- function H() {
1625
+ let R = !1, G = null;
1626
+ function J() {
1531
1627
  const e = [];
1532
1628
  let t = "cleaned";
1533
1629
  document.querySelectorAll("#panel-chrome-frozen").length > 0 && (e.push("#panel-chrome-frozen"), t = "lingering");
1534
- const c = document.querySelectorAll(".gloss-panel-mount");
1535
- c.length > 1 && e.push(`mount-count=${c.length}`);
1536
- const n = c[0] ?? null, o = n ? n.querySelectorAll(".gloss-panel-chrome") : [];
1630
+ const i = document.querySelectorAll(".gloss-panel-mount");
1631
+ i.length > 1 && e.push(`mount-count=${i.length}`);
1632
+ const n = i[0] ?? null, o = n ? n.querySelectorAll(".gloss-panel-chrome") : [];
1537
1633
  o.length > 1 && e.push(`chrome-count=${o.length}`);
1538
1634
  const u = o[0] ?? null;
1539
1635
  if (u) {
1540
1636
  const d = u.style.zIndex;
1541
1637
  d !== "" && d !== "2" && e.push(`chrome-zindex=${d}`);
1542
1638
  }
1543
- const l = n ? "present" : "absent", s = u ? "present" : "absent";
1639
+ const s = n ? "present" : "absent", l = u ? "present" : "absent";
1544
1640
  return {
1545
1641
  valid: e.length === 0,
1546
- mount: l,
1547
- chrome: s,
1642
+ mount: s,
1643
+ chrome: l,
1548
1644
  frozen: t,
1549
1645
  orphans: e,
1550
1646
  timestamp: Date.now()
1551
1647
  };
1552
1648
  }
1553
- const $ = "8px 8px 0px", R = "64px", F = "inset(0px 0px 60px 0px)", U = "inset(0px -40px -40px -40px)";
1554
- function g(e, t, r, c, n) {
1555
- return { id: e, constraint: t, expected: r, actual: c, pass: n };
1649
+ const Q = "8px 8px 0px", q = "64px", j = "inset(0px 0px 60px 0px)", Z = "inset(0px -40px -40px -40px)";
1650
+ function _(e, t, r, i, n) {
1651
+ return { id: e, constraint: t, expected: r, actual: i, pass: n };
1556
1652
  }
1557
- function w(e) {
1653
+ function O(e) {
1558
1654
  const t = parseInt(e, 10);
1559
1655
  return Number.isFinite(t) ? t : NaN;
1560
1656
  }
1561
- function K() {
1562
- const e = [], t = document.querySelector(".gloss-panel-mount"), r = t?.querySelector(".gloss-panel-chrome") ?? null, c = document.querySelector(".gloss-panel-coordinator") ?? document.querySelector("[data-panel-coordinator]"), n = document.querySelector(".bell-cutout"), o = document.querySelector(".bell-popover"), u = document.querySelector(".gloss-bottom-toolbar");
1657
+ function ne() {
1658
+ const e = [], t = document.querySelector(".gloss-panel-mount"), r = t?.querySelector(".gloss-panel-chrome") ?? null, i = document.querySelector(".gloss-panel-coordinator") ?? document.querySelector("[data-panel-coordinator]"), n = document.querySelector(".bell-cutout"), o = document.querySelector(".bell-popover"), u = document.querySelector(".gloss-bottom-toolbar");
1563
1659
  if (!t)
1564
- e.push(g("C1", "mount --reveal-y matches clip-path inset-bottom Npx", "mount present", "absent", !1));
1660
+ e.push(_("C1", "mount --reveal-y matches clip-path inset-bottom Npx", "mount present", "absent", !1));
1565
1661
  else {
1566
- const l = getComputedStyle(t), s = l.getPropertyValue("--reveal-y").trim() || t.style.getPropertyValue("--reveal-y").trim(), i = l.clipPath || t.style.clipPath || "", d = i.match(/inset\(\s*0(?:px)?\s+0(?:px)?\s+(\d+)px\s+0(?:px)?\s*\)/), p = d ? parseInt(d[1], 10) : NaN, m = w(s), f = Number.isFinite(p) && Number.isFinite(m) && p === m;
1662
+ const s = getComputedStyle(t), l = s.getPropertyValue("--reveal-y").trim() || t.style.getPropertyValue("--reveal-y").trim(), c = s.clipPath || t.style.clipPath || "", d = c.match(/inset\(\s*0(?:px)?\s+0(?:px)?\s+(\d+)px\s+0(?:px)?\s*\)/), m = d ? parseInt(d[1], 10) : NaN, f = O(l), v = Number.isFinite(m) && Number.isFinite(f) && m === f;
1567
1663
  e.push(
1568
- g(
1664
+ _(
1569
1665
  "C1",
1570
1666
  "mount --reveal-y matches clip-path inset-bottom Npx",
1571
- `inset(0 0 ${m}px 0) === --reveal-y(${m}px)`,
1572
- `--reveal-y=${s || "n/a"} clip-path=${i || "n/a"}`,
1573
- f
1667
+ `inset(0 0 ${f}px 0) === --reveal-y(${f}px)`,
1668
+ `--reveal-y=${l || "n/a"} clip-path=${c || "n/a"}`,
1669
+ v
1574
1670
  )
1575
1671
  );
1576
1672
  }
1577
1673
  if (!t)
1578
- e.push(g("C2", "mount padding constant", $, "absent", !1));
1674
+ e.push(_("C2", "mount padding constant", Q, "absent", !1));
1579
1675
  else {
1580
- const l = t.style.padding, s = getComputedStyle(t), i = l || s.padding || "", d = i === $ || i === "8px 8px 0px 8px";
1581
- e.push(g("C2", "mount padding constant", $, i || "n/a", d));
1676
+ const s = t.style.padding, l = getComputedStyle(t), c = s || l.padding || "", d = c === Q || c === "8px 8px 0px 8px";
1677
+ e.push(_("C2", "mount padding constant", Q, c || "n/a", d));
1582
1678
  }
1583
1679
  if (!t)
1584
- e.push(g("C3", "mount.bottom resolves to var(--tb-h)=64px", R, "absent", !1));
1680
+ e.push(_("C3", "mount.bottom resolves to var(--tb-h)=64px", q, "absent", !1));
1585
1681
  else {
1586
- const s = getComputedStyle(t).bottom || t.style.bottom || "", i = s === R;
1587
- e.push(g("C3", "mount.bottom resolves to var(--tb-h)=64px", R, s || "n/a", i));
1682
+ const l = getComputedStyle(t).bottom || t.style.bottom || "", c = l === q;
1683
+ e.push(_("C3", "mount.bottom resolves to var(--tb-h)=64px", q, l || "n/a", c));
1588
1684
  }
1589
1685
  if (!r)
1590
- e.push(g("C4", "panel-chrome height formula = (row-h*3)+(row-gap*3)-8px", "formula match", "absent", !1));
1686
+ e.push(_("C4", "panel-chrome height formula = (row-h*3)+(row-gap*3)-8px", "formula match", "absent", !1));
1591
1687
  else {
1592
- const l = getComputedStyle(r), s = w(
1593
- l.getPropertyValue("--row-h").trim() || r.style.getPropertyValue("--row-h").trim() || "0"
1594
- ), i = w(
1595
- l.getPropertyValue("--row-gap").trim() || r.style.getPropertyValue("--row-gap").trim() || "0"
1596
- ), d = s * 3 + i * 3 - 8, p = w(l.height || r.style.height || ""), m = Number.isFinite(s) && Number.isFinite(i) && Number.isFinite(p) && Number.isFinite(d) && p === d;
1688
+ const s = getComputedStyle(r), l = O(
1689
+ s.getPropertyValue("--row-h").trim() || r.style.getPropertyValue("--row-h").trim() || "0"
1690
+ ), c = O(
1691
+ s.getPropertyValue("--row-gap").trim() || r.style.getPropertyValue("--row-gap").trim() || "0"
1692
+ ), d = l * 3 + c * 3 - 8, m = O(s.height || r.style.height || ""), f = Number.isFinite(l) && Number.isFinite(c) && Number.isFinite(m) && Number.isFinite(d) && m === d;
1597
1693
  e.push(
1598
- g(
1694
+ _(
1599
1695
  "C4",
1600
1696
  "panel-chrome height formula = (row-h*3)+(row-gap*3)-8px",
1601
- `${d}px (rh=${s} rg=${i})`,
1602
- `${p}px`,
1603
- m
1697
+ `${d}px (rh=${l} rg=${c})`,
1698
+ `${m}px`,
1699
+ f
1604
1700
  )
1605
1701
  );
1606
1702
  }
1607
- if (!c || !r)
1703
+ if (!i || !r)
1608
1704
  e.push(
1609
- g(
1705
+ _(
1610
1706
  "C5",
1611
1707
  'coordinator perspective + origin "center bottom"; chrome perspective-style flat',
1612
1708
  "present",
1613
- `coordinator=${c ? "present" : "absent"} chrome=${r ? "present" : "absent"}`,
1709
+ `coordinator=${i ? "present" : "absent"} chrome=${r ? "present" : "absent"}`,
1614
1710
  !1
1615
1711
  )
1616
1712
  );
1617
1713
  else {
1618
- const l = getComputedStyle(c), s = getComputedStyle(r), i = l.perspective || c.style.perspective || "", d = (l.perspectiveOrigin || c.style.perspectiveOrigin || "").trim(), p = s.perspectiveStyle || r.style.perspectiveStyle || "", b = i !== "" && i !== "none" && (d === "center bottom" || d === "50% 100%") && p === "flat";
1714
+ const s = getComputedStyle(i), l = getComputedStyle(r), c = s.perspective || i.style.perspective || "", d = (s.perspectiveOrigin || i.style.perspectiveOrigin || "").trim(), m = l.perspectiveStyle || r.style.perspectiveStyle || "", b = c !== "" && c !== "none" && (d === "center bottom" || d === "50% 100%") && m === "flat";
1619
1715
  e.push(
1620
- g(
1716
+ _(
1621
1717
  "C5",
1622
1718
  'coordinator perspective + origin "center bottom"; chrome perspective-style flat',
1623
1719
  "perspective:not-none, origin:center bottom, chrome-style:flat",
1624
- `perspective=${i} origin=${d} chrome-style=${p}`,
1720
+ `perspective=${c} origin=${d} chrome-style=${m}`,
1625
1721
  b
1626
1722
  )
1627
1723
  );
1628
1724
  }
1629
1725
  {
1630
- let l = !1, s = "absent";
1726
+ let s = !1, l = "absent";
1631
1727
  try {
1632
- for (const i of Array.from(document.styleSheets)) {
1728
+ for (const c of Array.from(document.styleSheets)) {
1633
1729
  let d = [];
1634
1730
  try {
1635
- d = Array.from(i.cssRules ?? []);
1731
+ d = Array.from(c.cssRules ?? []);
1636
1732
  } catch {
1637
1733
  continue;
1638
1734
  }
1639
- for (const p of d)
1640
- if (p.name === "stage-spin") {
1641
- const f = Array.from(p.cssRules), _ = f.find((v) => v.keyText === "0%" || v.keyText === "from"), b = f.find((v) => v.keyText === "100%" || v.keyText === "to"), C = _?.style.transform ?? "", N = b?.style.transform ?? "", y = /rotateY\(\s*0(?:deg)?\s*\)/;
1642
- l = y.test(C) && y.test(N), s = `0%=${C || "n/a"} 100%=${N || "n/a"}`;
1735
+ for (const m of d)
1736
+ if (m.name === "stage-spin") {
1737
+ const v = Array.from(m.cssRules), p = v.find((y) => y.keyText === "0%" || y.keyText === "from"), b = v.find((y) => y.keyText === "100%" || y.keyText === "to"), w = p?.style.transform ?? "", S = b?.style.transform ?? "", T = /rotateY\(\s*0(?:deg)?\s*\)/;
1738
+ s = T.test(w) && T.test(S), l = `0%=${w || "n/a"} 100%=${S || "n/a"}`;
1643
1739
  break;
1644
1740
  }
1645
- if (s !== "absent") break;
1741
+ if (l !== "absent") break;
1646
1742
  }
1647
1743
  } catch {
1648
- s = "inspection-error";
1744
+ l = "inspection-error";
1649
1745
  }
1650
1746
  e.push(
1651
- g(
1747
+ _(
1652
1748
  "C6",
1653
1749
  "@keyframes stage-spin 0% AND 100% anchor at rotateY(0)",
1654
1750
  "both frames rotateY(0)",
1655
- s,
1656
- l
1751
+ l,
1752
+ s
1657
1753
  )
1658
1754
  );
1659
1755
  }
1660
1756
  {
1661
- const l = document.documentElement, s = getComputedStyle(l), i = s.getPropertyValue("--panel-open-dur").trim() || l.style.getPropertyValue("--panel-open-dur").trim(), d = s.getPropertyValue("--panel-close-dur").trim() || l.style.getPropertyValue("--panel-close-dur").trim(), p = w(i) || parseFloat(i) * (i.endsWith("s") && !i.endsWith("ms") ? 1e3 : 1), m = w(d) || parseFloat(d) * (d.endsWith("s") && !d.endsWith("ms") ? 1e3 : 1), f = Number.isFinite(p) && Number.isFinite(m) && p > m;
1757
+ const s = document.documentElement, l = getComputedStyle(s), c = l.getPropertyValue("--panel-open-dur").trim() || s.style.getPropertyValue("--panel-open-dur").trim(), d = l.getPropertyValue("--panel-close-dur").trim() || s.style.getPropertyValue("--panel-close-dur").trim(), m = O(c) || parseFloat(c) * (c.endsWith("s") && !c.endsWith("ms") ? 1e3 : 1), f = O(d) || parseFloat(d) * (d.endsWith("s") && !d.endsWith("ms") ? 1e3 : 1), v = Number.isFinite(m) && Number.isFinite(f) && m > f;
1662
1758
  e.push(
1663
- g("C7", "--panel-open-dur > --panel-close-dur", "open > close", `open=${i || "n/a"} close=${d || "n/a"}`, f)
1759
+ _("C7", "--panel-open-dur > --panel-close-dur", "open > close", `open=${c || "n/a"} close=${d || "n/a"}`, v)
1664
1760
  );
1665
1761
  }
1666
1762
  if (!n)
1667
- e.push(g("C8", "BellCutout zero computed animation/transition", "no inline timing", "absent", !1));
1763
+ e.push(_("C8", "BellCutout zero computed animation/transition", "no inline timing", "absent", !1));
1668
1764
  else {
1669
- const l = getComputedStyle(n), s = l.animationName || "", i = l.transitionProperty || "", d = (s === "" || s === "none") && (i === "" || i === "none" || i === "all");
1765
+ const s = getComputedStyle(n), l = s.animationName || "", c = s.transitionProperty || "", d = (l === "" || l === "none") && (c === "" || c === "none" || c === "all");
1670
1766
  e.push(
1671
- g(
1767
+ _(
1672
1768
  "C8",
1673
1769
  "BellCutout zero computed animation/transition",
1674
1770
  "animation:none AND transition:none",
1675
- `animation=${s || "n/a"} transition=${i || "n/a"}`,
1771
+ `animation=${l || "n/a"} transition=${c || "n/a"}`,
1676
1772
  d
1677
1773
  )
1678
1774
  );
1679
1775
  }
1680
1776
  if (!t)
1681
- e.push(g("C9", "mount closed-state clipPath", F, "absent", !1));
1777
+ e.push(_("C9", "mount closed-state clipPath", j, "absent", !1));
1682
1778
  else {
1683
- const l = t.style.clipPath, s = getComputedStyle(t), i = l || s.clipPath || "", d = i === F;
1684
- e.push(g("C9", "mount closed-state clipPath", F, i || "n/a", d));
1779
+ const s = t.style.clipPath, l = getComputedStyle(t), c = s || l.clipPath || "", d = c === j;
1780
+ e.push(_("C9", "mount closed-state clipPath", j, c || "n/a", d));
1685
1781
  }
1686
1782
  if (!o)
1687
- e.push(g("C10", "bell-popover parentElement === document.body (open)", "body", "absent", !1));
1783
+ e.push(_("C10", "bell-popover parentElement === document.body (open)", "body", "absent", !1));
1688
1784
  else {
1689
- const l = o.parentElement, s = l === document.body;
1785
+ const s = o.parentElement, l = s === document.body;
1690
1786
  e.push(
1691
- g(
1787
+ _(
1692
1788
  "C10",
1693
1789
  "bell-popover parentElement === document.body (open)",
1694
1790
  "body",
1695
- l === document.body ? "body" : l?.tagName ?? "n/a",
1696
- s
1791
+ s === document.body ? "body" : s?.tagName ?? "n/a",
1792
+ l
1697
1793
  )
1698
1794
  );
1699
1795
  }
1700
- if (!c)
1701
- e.push(g("C11", "coordinator overflow === visible", "visible", "absent", !1));
1796
+ if (!i)
1797
+ e.push(_("C11", "coordinator overflow === visible", "visible", "absent", !1));
1702
1798
  else {
1703
- const s = getComputedStyle(c).overflow || c.style.overflow || "", i = s === "visible";
1704
- e.push(g("C11", "coordinator overflow === visible", "visible", s || "n/a", i));
1799
+ const l = getComputedStyle(i).overflow || i.style.overflow || "", c = l === "visible";
1800
+ e.push(_("C11", "coordinator overflow === visible", "visible", l || "n/a", c));
1705
1801
  }
1706
1802
  if (!u)
1707
- e.push(g("C12", "toolbar clipPath = inset(0 -40 -40 -40)", U, "absent", !1));
1803
+ e.push(_("C12", "toolbar clipPath = inset(0 -40 -40 -40)", Z, "absent", !1));
1708
1804
  else {
1709
- const l = u.style.clipPath, s = getComputedStyle(u), i = l || s.clipPath || "", d = i === U;
1710
- e.push(g("C12", "toolbar clipPath = inset(0 -40 -40 -40)", U, i || "n/a", d));
1805
+ const s = u.style.clipPath, l = getComputedStyle(u), c = s || l.clipPath || "", d = c === Z;
1806
+ e.push(_("C12", "toolbar clipPath = inset(0 -40 -40 -40)", Z, c || "n/a", d));
1711
1807
  }
1712
1808
  return e.push(
1713
- g(
1809
+ _(
1714
1810
  "C13",
1715
1811
  "same-position slide via WAAPI (mid-transition getAnimations().length > 0)",
1716
1812
  "WAAPI driver wired in orchestrator (source-proof)",
@@ -1718,7 +1814,7 @@ function K() {
1718
1814
  "wiring_only"
1719
1815
  )
1720
1816
  ), e.push(
1721
- g(
1817
+ _(
1722
1818
  "C14",
1723
1819
  'cross-position handoff transitionend filtered by propertyName="max-height"',
1724
1820
  "transitionend filter wired in orchestrator (source-proof)",
@@ -1727,11 +1823,11 @@ function K() {
1727
1823
  )
1728
1824
  ), e;
1729
1825
  }
1730
- function ot(e) {
1731
- return K().find((t) => t.id === e);
1826
+ function ut(e) {
1827
+ return ne().find((t) => t.id === e);
1732
1828
  }
1733
- function it() {
1734
- const e = H();
1829
+ function pt() {
1830
+ const e = J();
1735
1831
  return { q12: [
1736
1832
  {
1737
1833
  id: "Q12-12",
@@ -1740,76 +1836,76 @@ function it() {
1740
1836
  actual: `valid=${e.valid} mount=${e.mount} chrome=${e.chrome} frozen=${e.frozen} orphans=[${e.orphans.join(",")}]`,
1741
1837
  pass: e.valid
1742
1838
  }
1743
- ], cc: K() };
1839
+ ], cc: ne() };
1744
1840
  }
1745
- function ct() {
1841
+ function mt() {
1746
1842
  return {
1747
- enable: dt,
1748
- disable: ut,
1749
- isEnabled: () => O,
1750
- getLastReport: () => M,
1843
+ enable: ht,
1844
+ disable: ft,
1845
+ isEnabled: () => R,
1846
+ getLastReport: () => G,
1751
1847
  recordTransition: (e) => {
1752
- O && (M = { ...e, ...H() });
1848
+ R && (G = { ...e, ...J() });
1753
1849
  },
1754
1850
  assertOnce: () => {
1755
- const e = H();
1756
- return M = e, e;
1851
+ const e = J();
1852
+ return G = e, e;
1757
1853
  },
1758
- assertCcOnly: K,
1759
- getCcRowById: ot,
1760
- assertPanelTruths: it
1854
+ assertCcOnly: ne,
1855
+ getCcRowById: ut,
1856
+ assertPanelTruths: pt
1761
1857
  };
1762
1858
  }
1763
- function dt() {
1764
- if (O = !0, typeof window > "u") return;
1765
- window.__panelsAsserter || (window.__panelsAsserter = ct(), console.info(
1859
+ function ht() {
1860
+ if (R = !0, typeof window > "u") return;
1861
+ window.__panelsAsserter || (window.__panelsAsserter = mt(), console.info(
1766
1862
  "[panels] asserter enabled (P3b Q12-12 + P6 W5 cc:C1..C14). Inspect via window.__panelsAsserter."
1767
1863
  ));
1768
1864
  }
1769
- function ut() {
1770
- O = !1;
1865
+ function ft() {
1866
+ R = !1;
1771
1867
  }
1772
1868
  export {
1773
- kt as COMMITS,
1774
- Ct as CatalogAddShell,
1775
- Be as CatalogFooter,
1776
- Tt as CatalogReplaceShell,
1777
- Y as CatalogStateContext,
1778
- Ie as CloneCard,
1779
- Le as CloneStage,
1780
- ae as MOCK_DEFAULT_LENS,
1781
- ne as MOCK_LENSES,
1782
- z as MOCK_LENS_META,
1783
- Qe as MOCK_PAGES,
1784
- se as MOCK_TILES_BY_LENS,
1785
- Nt as PANEL_IDS,
1786
- We as PageMgmtFooter,
1787
- St as PageMgmtShell,
1788
- le as PageMgmtStateContext,
1789
- k as PanelChrome,
1790
- Dt as PanelHost,
1791
- wt as PanelHostShell,
1792
- A as PanelMount,
1793
- Ot as PanelProvider,
1794
- Et as PanelSlot,
1795
- _t as SettingsShell,
1796
- K as assertCcOnly,
1797
- H as assertPanelDomShape,
1798
- it as assertPanelTruths,
1799
- Lt as deriveSurfaceState,
1800
- ut as disablePanelAsserter,
1801
- dt as enablePanelAsserter,
1802
- ot as getCcRowById,
1803
- It as initialState,
1804
- j as positionKey,
1805
- Mt as reducer,
1806
- rt as transitionToPanel,
1807
- Ke as useCatalogState,
1808
- vt as useEditingCardId,
1809
- oe as usePageMgmtState,
1810
- _e as usePanelContext,
1811
- L as usePanelContextOptional,
1812
- $t as usePanelCoordinator,
1813
- J as useReducedMotionPanel,
1814
- Pt as useTransitionToPanel
1869
+ It as COMMITS,
1870
+ wt as CatalogAddShell,
1871
+ je as CatalogFooter,
1872
+ Et as CatalogReplaceShell,
1873
+ te as CatalogStateContext,
1874
+ Ue as CloneCard,
1875
+ Fe as CloneStage,
1876
+ be as MOCK_DEFAULT_LENS,
1877
+ ge as MOCK_LENSES,
1878
+ ee as MOCK_LENS_META,
1879
+ Xe as MOCK_PAGES,
1880
+ ve as MOCK_TILES_BY_LENS,
1881
+ xt as PANEL_IDS,
1882
+ Ze as PageMgmtFooter,
1883
+ Pt as PageMgmtShell,
1884
+ Ce as PageMgmtStateContext,
1885
+ M as PanelChrome,
1886
+ Mt as PanelHost,
1887
+ At as PanelHostShell,
1888
+ I as PanelMount,
1889
+ $t as PanelProvider,
1890
+ kt as PanelSlot,
1891
+ St as SettingsShell,
1892
+ ne as assertCcOnly,
1893
+ J as assertPanelDomShape,
1894
+ pt as assertPanelTruths,
1895
+ Rt as deriveSurfaceState,
1896
+ ft as disablePanelAsserter,
1897
+ ht as enablePanelAsserter,
1898
+ ut as getCcRowById,
1899
+ Ft as initialState,
1900
+ de as positionKey,
1901
+ Ut as reducer,
1902
+ ct as transitionToPanel,
1903
+ qe as useCatalogState,
1904
+ Nt as useEditingCardId,
1905
+ _e as usePageMgmtState,
1906
+ we as usePanelContext,
1907
+ F as usePanelContextOptional,
1908
+ zt as usePanelCoordinator,
1909
+ pe as useReducedMotionPanel,
1910
+ Dt as useTransitionToPanel
1815
1911
  };