@apliteni/apliteni-ui 0.160.0 → 0.162.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.
@@ -58,8 +58,8 @@ var Switch = forwardRef2(function Switch2({
58
58
  });
59
59
 
60
60
  // src/primitives/Button.tsx
61
- import { forwardRef as forwardRef3, useImperativeHandle, useLayoutEffect, useRef } from "react";
62
- import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
61
+ import { forwardRef as forwardRef3, useEffect, useId as useId2, useImperativeHandle, useLayoutEffect, useRef } from "react";
62
+ import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
63
63
  var announcers = /* @__PURE__ */ new WeakMap();
64
64
  function acquireAnnouncer(doc) {
65
65
  let entry = announcers.get(doc);
@@ -90,6 +90,11 @@ function acquireAnnouncer(doc) {
90
90
  }
91
91
  };
92
92
  }
93
+ var HOLD_MS = 1e3;
94
+ var TAP_MS = 300;
95
+ var STEP_MS = 250;
96
+ var TWICE_MS = 3e3;
97
+ var HOLD_HELP = "Hold to confirm, or press twice.";
93
98
  var cx = (...a) => a.filter(Boolean).join(" ");
94
99
  var Button = forwardRef3(function Button2({
95
100
  variant = "secondary",
@@ -102,6 +107,8 @@ var Button = forwardRef3(function Button2({
102
107
  busy,
103
108
  completionMessage,
104
109
  children,
110
+ hold,
111
+ onConfirm,
105
112
  type = "button",
106
113
  href,
107
114
  disabled,
@@ -142,6 +149,128 @@ var Button = forwardRef3(function Button2({
142
149
  announcer.current = null;
143
150
  previous.current = null;
144
151
  }, []);
152
+ const holds = hold === true && href === void 0;
153
+ const holdHelpId = useId2();
154
+ const live = useRef({ busy, disabled, onConfirm });
155
+ live.current = { busy, disabled, onConfirm };
156
+ const cancelHold = useRef(() => {
157
+ });
158
+ useEffect(() => {
159
+ const btn = buttonRef.current;
160
+ if (!holds || !btn) return;
161
+ let by = null, start = 0, frame = 0, armedUntil = 0;
162
+ let step, done;
163
+ const reduced = () => typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
164
+ const paint = (p) => btn.style.setProperty("--hold", String(p));
165
+ const hint = (on) => btn.toggleAttribute("data-hold-hint", on);
166
+ const fillEl = btn.querySelector(".ui-btn__hold-fill");
167
+ let drained;
168
+ const undrain = () => {
169
+ clearTimeout(drained);
170
+ btn.removeAttribute("data-hold-drain");
171
+ };
172
+ const stop = () => {
173
+ by = null;
174
+ cancelAnimationFrame(frame);
175
+ clearInterval(step);
176
+ clearTimeout(done);
177
+ };
178
+ const confirm = () => {
179
+ stop();
180
+ paint(0);
181
+ btn.removeAttribute("data-holding");
182
+ hint(false);
183
+ live.current.onConfirm?.();
184
+ };
185
+ const tick = () => {
186
+ paint(Math.min(1, (performance.now() - start) / HOLD_MS));
187
+ frame = requestAnimationFrame(tick);
188
+ };
189
+ const begin = (source) => {
190
+ if (by || live.current.busy || live.current.disabled) return;
191
+ by = source;
192
+ start = performance.now();
193
+ hint(false);
194
+ undrain();
195
+ btn.setAttribute("data-holding", "");
196
+ if (reduced()) {
197
+ let n = 0;
198
+ step = setInterval(() => paint(Math.min(4, ++n) / 4), STEP_MS);
199
+ } else frame = requestAnimationFrame(tick);
200
+ done = setTimeout(confirm, HOLD_MS);
201
+ };
202
+ const end = () => {
203
+ if (!by) return;
204
+ const short = performance.now() - start < TAP_MS;
205
+ stop();
206
+ btn.setAttribute("data-hold-drain", "");
207
+ drained = setTimeout(undrain, HOLD_MS);
208
+ btn.removeAttribute("data-holding");
209
+ paint(0);
210
+ if (short) hint(true);
211
+ };
212
+ cancelHold.current = () => {
213
+ armedUntil = 0;
214
+ hint(false);
215
+ if (!by) return;
216
+ stop();
217
+ btn.removeAttribute("data-holding");
218
+ paint(0);
219
+ };
220
+ const onPointerDown = (e) => {
221
+ if (e.button !== 0) return;
222
+ btn.setPointerCapture?.(e.pointerId);
223
+ begin("pointer");
224
+ };
225
+ const onKeyDown2 = (e) => {
226
+ if (e.key !== "Enter" && e.key !== " ") return;
227
+ e.preventDefault();
228
+ if (!e.repeat) begin("key");
229
+ };
230
+ const onKeyUp2 = (e) => {
231
+ if (e.key !== "Enter" && e.key !== " ") return;
232
+ e.preventDefault();
233
+ end();
234
+ };
235
+ const onClick2 = (e) => {
236
+ if (e.detail !== 0 || by || live.current.busy || live.current.disabled) return;
237
+ if (performance.now() < armedUntil) {
238
+ armedUntil = 0;
239
+ confirm();
240
+ return;
241
+ }
242
+ armedUntil = performance.now() + TWICE_MS;
243
+ hint(true);
244
+ };
245
+ const onContextMenu = (e) => e.preventDefault();
246
+ const listeners = [
247
+ ["pointerdown", onPointerDown],
248
+ ["pointerup", end],
249
+ ["pointercancel", end],
250
+ ["lostpointercapture", end],
251
+ ["keydown", onKeyDown2],
252
+ ["keyup", onKeyUp2],
253
+ ["blur", end],
254
+ ["click", onClick2],
255
+ ["contextmenu", onContextMenu]
256
+ ];
257
+ for (const [type2, fn] of listeners) btn.addEventListener(type2, fn);
258
+ fillEl?.addEventListener("transitionend", undrain);
259
+ return () => {
260
+ stop();
261
+ undrain();
262
+ cancelHold.current = () => {
263
+ };
264
+ fillEl?.removeEventListener("transitionend", undrain);
265
+ for (const [type2, fn] of listeners) btn.removeEventListener(type2, fn);
266
+ btn.removeAttribute("data-holding");
267
+ btn.removeAttribute("data-hold-hint");
268
+ btn.style.removeProperty("--hold");
269
+ };
270
+ }, [holds]);
271
+ useEffect(() => {
272
+ if (busy || disabled) cancelHold.current();
273
+ }, [busy, disabled]);
145
274
  const blockActivation = (event) => {
146
275
  if (!busy && !disabled) return false;
147
276
  event.preventDefault();
@@ -161,6 +290,8 @@ var Button = forwardRef3(function Button2({
161
290
  const fallback = typeof children === "string" && children.trim() ? children.trim() : icon9;
162
291
  const named = iconOnly && !labelled && fallback ? { "aria-label": fallback, title: rest.title ?? fallback } : {};
163
292
  const Root = href === void 0 ? "button" : "a";
293
+ const describedBy = holds ? cx(rest["aria-describedby"], holdHelpId) : rest["aria-describedby"];
294
+ const lead = leading != null ? /* @__PURE__ */ jsx4("span", { "aria-hidden": "true", style: { display: "inline-flex" }, children: leading }) : icon9 && /* @__PURE__ */ jsx4(Icon, { name: icon9 });
164
295
  return /* @__PURE__ */ jsxs3(
165
296
  Root,
166
297
  {
@@ -168,7 +299,7 @@ var Button = forwardRef3(function Button2({
168
299
  ref: buttonRef,
169
300
  "data-btn-wired": "",
170
301
  "data-btn-ready": !busy && hasBeenBusy.current ? "" : void 0,
171
- type: href === void 0 ? type : void 0,
302
+ type: href === void 0 ? holds ? "button" : type : void 0,
172
303
  href: disabled || busy ? void 0 : href,
173
304
  role: href !== void 0 ? "link" : rest.role,
174
305
  tabIndex: href !== void 0 && disabled ? -1 : href !== void 0 ? tabIndex ?? 0 : tabIndex,
@@ -177,6 +308,8 @@ var Button = forwardRef3(function Button2({
177
308
  disabled: href === void 0 ? disabled : void 0,
178
309
  "aria-disabled": disabled || busy ? true : void 0,
179
310
  "aria-busy": busy ? true : void 0,
311
+ "aria-describedby": describedBy,
312
+ "data-hold": holds ? "" : void 0,
180
313
  ...named,
181
314
  onAuxClickCapture: (event) => {
182
315
  if (!blockActivation(event)) onAuxClickCapture?.(event);
@@ -188,7 +321,9 @@ var Button = forwardRef3(function Button2({
188
321
  if (!blockActivation(event)) onClickCapture?.(event);
189
322
  },
190
323
  onClick: (event) => {
191
- if (!blockActivation(event)) onClick?.(event);
324
+ if (blockActivation(event)) return;
325
+ if (holds) event.preventDefault();
326
+ else onClick?.(event);
192
327
  },
193
328
  onKeyDownCapture: (event) => {
194
329
  if (!blockKey(event)) onKeyDownCapture?.(event);
@@ -203,13 +338,22 @@ var Button = forwardRef3(function Button2({
203
338
  if (!blockKey(event)) onKeyUp?.(event);
204
339
  },
205
340
  children: [
206
- leading != null ? /* @__PURE__ */ jsx4("span", { "aria-hidden": "true", style: { display: "inline-flex" }, children: leading }) : icon9 && /* @__PURE__ */ jsx4(Icon, { name: icon9 }),
341
+ lead,
207
342
  !iconOnly && renderedChildren != null && /* @__PURE__ */ jsx4("span", { className: "ui-btn__label-slot", children: /* @__PURE__ */ jsx4("span", { className: "ui-btn__label", ref: labelRef, children: renderedChildren }) }),
208
343
  iconRight && /* @__PURE__ */ jsx4(Icon, { name: iconRight }),
209
344
  busy && /* @__PURE__ */ jsxs3("span", { className: "ui-btn__dots", "aria-hidden": "true", children: [
210
345
  /* @__PURE__ */ jsx4("i", {}),
211
346
  /* @__PURE__ */ jsx4("i", {}),
212
347
  /* @__PURE__ */ jsx4("i", {})
348
+ ] }),
349
+ holds && /* @__PURE__ */ jsxs3(Fragment, { children: [
350
+ /* @__PURE__ */ jsxs3("span", { className: "ui-btn__hold-fill", "aria-hidden": "true", children: [
351
+ lead,
352
+ !iconOnly && renderedChildren != null && /* @__PURE__ */ jsx4("span", { className: "ui-btn__label-slot", children: /* @__PURE__ */ jsx4("span", { className: "ui-btn__label", children: renderedChildren }) }),
353
+ iconRight && /* @__PURE__ */ jsx4(Icon, { name: iconRight })
354
+ ] }),
355
+ /* @__PURE__ */ jsx4("span", { className: "ui-btn__hold-hint", "aria-hidden": "true", children: "Hold to confirm" }),
356
+ /* @__PURE__ */ jsx4("span", { id: holdHelpId, hidden: true, children: HOLD_HELP })
213
357
  ] })
214
358
  ]
215
359
  }
@@ -284,7 +428,7 @@ var StatusDot = forwardRef5(function StatusDot2({
284
428
  // src/primitives/Card.tsx
285
429
  import { createContext, useCallback as useCallback2, useMemo, useState as useState2 } from "react";
286
430
  import { icon as kitIcon, safeUrl } from "@apliteni/apliteni-ui";
287
- import { Fragment, jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
431
+ import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
288
432
  var CardTools = createContext(null);
289
433
  function Card({ title, sub, level = 2, variant, pad: pad2, icon: icon9, href, tools, className, children }) {
290
434
  const [claims, setClaims] = useState2([]);
@@ -304,7 +448,7 @@ function Card({ title, sub, level = 2, variant, pad: pad2, icon: icon9, href, to
304
448
  icon9 && /* @__PURE__ */ jsx9("span", { className: "ui-card__icon", "aria-hidden": "true", dangerouslySetInnerHTML: { __html: kitIcon(icon9) } }),
305
449
  title
306
450
  ] });
307
- const inner = /* @__PURE__ */ jsxs5(Fragment, { children: [
451
+ const inner = /* @__PURE__ */ jsxs5(Fragment2, { children: [
308
452
  withTools && (tools != null || owner != null) ? /* @__PURE__ */ jsxs5("div", { className: "ui-card__head", children: [
309
453
  heading,
310
454
  /* @__PURE__ */ jsx9("div", { className: "ui-card__tools", ref: setSlot, children: tools })
@@ -329,7 +473,7 @@ function Callout({ variant, icon: icon9 = calloutIcons[variant ?? "neutral"], ch
329
473
  }
330
474
 
331
475
  // src/primitives/StatBand.tsx
332
- import { useId as useId3 } from "react";
476
+ import { useId as useId4 } from "react";
333
477
 
334
478
  // src/tip.ts
335
479
  var TIP_GAP = 8;
@@ -370,9 +514,18 @@ function placeTip(host, mark, tip, bound, placement = "top") {
370
514
  tip.style.setProperty("--ui-tip-shift", `${left - ideal}px`);
371
515
  }
372
516
 
517
+ // src/tooltipDelay.ts
518
+ var OPEN_DELAY = 300;
519
+ var SKIP_WINDOW = 300;
520
+ var lastClose = -Infinity;
521
+ var hoverWait = () => Date.now() - lastClose < SKIP_WINDOW ? 0 : OPEN_DELAY;
522
+ function noteClose() {
523
+ lastClose = Date.now();
524
+ }
525
+
373
526
  // src/Tooltip.tsx
374
- import { useEffect, useId as useId2, useLayoutEffect as useLayoutEffect2, useRef as useRef2, useState as useState3 } from "react";
375
- import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
527
+ import { useEffect as useEffect2, useId as useId3, useLayoutEffect as useLayoutEffect2, useRef as useRef2, useState as useState3 } from "react";
528
+ import { Fragment as Fragment3, jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
376
529
  var DOC_EVENTS = ["pointerdown", "pointercancel", "click", "keydown", "touchend"];
377
530
  var CAPTURED = /* @__PURE__ */ new Set(["pointerdown", "pointercancel"]);
378
531
  var wirings = /* @__PURE__ */ new WeakMap();
@@ -399,13 +552,13 @@ function wireDocument(doc, handlers) {
399
552
  wirings.delete(doc);
400
553
  };
401
554
  }
402
- var Text2 = ({ label = "", value = "", detail: detail2 = "" }) => /* @__PURE__ */ jsxs7(Fragment2, { children: [
555
+ var Text2 = ({ label = "", value = "", detail: detail2 = "" }) => /* @__PURE__ */ jsxs7(Fragment3, { children: [
403
556
  /* @__PURE__ */ jsx11("span", { className: "ui-tip__label", hidden: !label, children: label }),
404
557
  /* @__PURE__ */ jsx11("span", { className: "ui-tip__value", hidden: !value, children: value }),
405
558
  /* @__PURE__ */ jsx11("span", { className: "ui-tip__detail", hidden: !detail2, children: detail2 })
406
559
  ] });
407
- function Tooltip({ text: text2, label = text2, value, detail: detail2, placement = "top", children }) {
408
- const id = useId2();
560
+ function Tooltip({ text: text2, label = text2, value, detail: detail2, placement = "top", control = false, children }) {
561
+ const id = useId3();
409
562
  const host = useRef2(null);
410
563
  const trigger = useRef2(null);
411
564
  const tip = useRef2(null);
@@ -416,12 +569,35 @@ function Tooltip({ text: text2, label = text2, value, detail: detail2, placement
416
569
  const dismissed = useRef2(null);
417
570
  const [mark, setMark] = useState3(null);
418
571
  const active = useRef2(null);
572
+ const timer = useRef2(void 0);
419
573
  active.current = mark;
420
574
  const open = mark !== null;
575
+ function cancel() {
576
+ clearTimeout(timer.current);
577
+ timer.current = void 0;
578
+ }
421
579
  function close(reset = false) {
580
+ cancel();
581
+ if (active.current) noteClose();
422
582
  dismissed.current = reset ? null : active.current;
423
583
  setMark(null);
424
584
  }
585
+ function hover(target) {
586
+ if (!target) {
587
+ close(true);
588
+ return;
589
+ }
590
+ if (target === active.current || timer.current) return;
591
+ const wait = hoverWait();
592
+ if (!wait) {
593
+ show(target);
594
+ return;
595
+ }
596
+ timer.current = setTimeout(() => {
597
+ timer.current = void 0;
598
+ show(target);
599
+ }, wait);
600
+ }
425
601
  function show(target) {
426
602
  if (target && target !== dismissed.current) {
427
603
  dismissed.current = null;
@@ -468,8 +644,9 @@ function Tooltip({ text: text2, label = text2, value, detail: detail2, placement
468
644
  shared.current.click = (event) => {
469
645
  if ((pointerKind.current === "touch" || pointerKind.current === "pen") && !host.current?.contains(event.target)) close(true);
470
646
  };
471
- useEffect(() => wireDocument(host.current.ownerDocument, shared.current), []);
472
- useEffect(() => {
647
+ useEffect2(() => wireDocument(host.current.ownerDocument, shared.current), []);
648
+ useEffect2(() => cancel, []);
649
+ useEffect2(() => {
473
650
  if (!open) return;
474
651
  const view = host.current.ownerDocument.defaultView;
475
652
  const reposition = () => place();
@@ -488,15 +665,13 @@ function Tooltip({ text: text2, label = text2, value, detail: detail2, placement
488
665
  style: { display: "inline-block" },
489
666
  onMouseOver: (event) => {
490
667
  if (Date.now() <= ignoreMouseUntil.current) return;
491
- const target = markOf(event.target);
492
- if (target) show(target);
493
- else setMark(null);
668
+ hover(markOf(event.target));
494
669
  },
495
670
  onMouseLeave: () => {
496
671
  if (Date.now() > ignoreMouseUntil.current) close(true);
497
672
  },
498
673
  onFocus: (event) => {
499
- if (Date.now() > ignoreMouseUntil.current) show(markOf(event.target));
674
+ if (Date.now() > ignoreMouseUntil.current && pointerKind.current !== "mouse") show(markOf(event.target));
500
675
  },
501
676
  onBlur: (event) => {
502
677
  if (!markOf(event.relatedTarget)) close(true);
@@ -505,7 +680,7 @@ function Tooltip({ text: text2, label = text2, value, detail: detail2, placement
505
680
  if (event.pointerType === "touch" || event.pointerType === "pen") ignoreMouseUntil.current = Date.now() + 800;
506
681
  else if (event.pointerType === "mouse") {
507
682
  ignoreMouseUntil.current = 0;
508
- show(markOf(event.target));
683
+ hover(markOf(event.target));
509
684
  }
510
685
  },
511
686
  onClickCapture: (event) => {
@@ -518,6 +693,11 @@ function Tooltip({ text: text2, label = text2, value, detail: detail2, placement
518
693
  if (!touched) close();
519
694
  return;
520
695
  }
696
+ if (control) {
697
+ dismissed.current = null;
698
+ show(target);
699
+ return;
700
+ }
521
701
  event.preventDefault();
522
702
  event.stopPropagation();
523
703
  const doc = host.current.ownerDocument;
@@ -552,15 +732,15 @@ function Tooltip({ text: text2, label = text2, value, detail: detail2, placement
552
732
  }
553
733
  },
554
734
  children: [
555
- /* @__PURE__ */ jsx11("span", { ref: trigger, className: "ui-focusable", tabIndex: 0, "aria-describedby": id, children }),
556
- /* @__PURE__ */ jsx11("span", { ref: tip, id, "data-tip": "", role: "tooltip", className: `ui-tip${open ? " is-open" : ""}`, children: /* @__PURE__ */ jsx11(Text2, { label, value, detail: detail2 }) })
735
+ control ? /* @__PURE__ */ jsx11("span", { ref: trigger, children }) : /* @__PURE__ */ jsx11("span", { ref: trigger, className: "ui-focusable", tabIndex: 0, "aria-describedby": id, children }),
736
+ /* @__PURE__ */ jsx11("span", { ref: tip, id, "data-tip": "", role: "tooltip", "aria-hidden": control || void 0, className: `ui-tip${open ? " is-open" : ""}`, children: /* @__PURE__ */ jsx11(Text2, { label, value, detail: detail2 }) })
557
737
  ]
558
738
  }
559
739
  );
560
740
  }
561
741
 
562
742
  // src/primitives/StatBand.tsx
563
- import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
743
+ import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
564
744
  var GLYPH = { up: "arrowUp", down: "arrowDown", flat: "minus" };
565
745
  var directionOf = (text2) => {
566
746
  const t = text2.trim();
@@ -569,7 +749,7 @@ var directionOf = (text2) => {
569
749
  var hasChange = (d) => !!d && d.value != null && d.value !== "";
570
750
  function ContextRow({ caption, delta, basisId }) {
571
751
  if (!hasChange(delta)) return caption ? /* @__PURE__ */ jsx12("dd", { className: "ui-stat__caption", children: caption }) : null;
572
- const lead = caption ? /* @__PURE__ */ jsxs8(Fragment3, { children: [
752
+ const lead = caption ? /* @__PURE__ */ jsxs8(Fragment4, { children: [
573
753
  /* @__PURE__ */ jsx12("span", { className: "ui-stat__caption", children: caption }),
574
754
  " "
575
755
  ] }) : null;
@@ -579,14 +759,14 @@ function ContextRow({ caption, delta, basisId }) {
579
759
  lead,
580
760
  /* @__PURE__ */ jsx12(Icon, { name: GLYPH[dir] }),
581
761
  delta.tooltip ? /* @__PURE__ */ jsx12(Tooltip, { text: delta.tooltip, children: /* @__PURE__ */ jsx12("span", { className: "ui-stat__change", children: delta.value }) }) : /* @__PURE__ */ jsx12("span", { className: "ui-stat__change", children: delta.value }),
582
- own ? /* @__PURE__ */ jsxs8(Fragment3, { children: [
762
+ own ? /* @__PURE__ */ jsxs8(Fragment4, { children: [
583
763
  " ",
584
764
  /* @__PURE__ */ jsx12("span", { className: "ui-stat__basis", children: own })
585
765
  ] }) : null
586
766
  ] });
587
767
  }
588
768
  function StatBand({ stats, variant = "tiles", basis, basisId: sharedBasisId, label, id }) {
589
- const auto = useId3();
769
+ const auto = useId4();
590
770
  const v = ["band", "tiles", "open"].includes(variant) ? variant : "tiles";
591
771
  const basisId = basis ? `${id || auto}-basis` : sharedBasisId;
592
772
  const root = ["ui-stats", `ui-stats--${v}`, v === "band" && "ui-card"].filter(Boolean).join(" ");
@@ -609,14 +789,14 @@ function StatBand({ stats, variant = "tiles", basis, basisId: sharedBasisId, lab
609
789
  import { useRef as useRef5 } from "react";
610
790
 
611
791
  // src/Modal.tsx
612
- import { useId as useId4, useRef as useRef4 } from "react";
792
+ import { useId as useId5, useRef as useRef4 } from "react";
613
793
  import { createPortal } from "react-dom";
614
794
 
615
795
  // src/dialog.ts
616
796
  import {
617
797
  createContext as createContext2,
618
798
  useContext,
619
- useEffect as useEffect2,
799
+ useEffect as useEffect3,
620
800
  useLayoutEffect as useLayoutEffect3,
621
801
  useRef as useRef3,
622
802
  useState as useState4
@@ -641,7 +821,7 @@ var dismissOnScrim = (onClose) => (e) => {
641
821
  e.preventDefault();
642
822
  onClose();
643
823
  };
644
- var useIsoLayoutEffect = typeof document === "undefined" ? useEffect2 : useLayoutEffect3;
824
+ var useIsoLayoutEffect = typeof document === "undefined" ? useEffect3 : useLayoutEffect3;
645
825
  var DialogScope = createContext2(null);
646
826
  var stack = [];
647
827
  var leaving = /* @__PURE__ */ new Set();
@@ -796,7 +976,7 @@ function useDialog(active, { root, panel, body, initialFocus, fallbackFocus }, o
796
976
  useIsoLayoutEffect(() => {
797
977
  close.current = onClose;
798
978
  });
799
- useEffect2(() => {
979
+ useEffect3(() => {
800
980
  if (!active || !root.current || !panel.current) return;
801
981
  const entry = {
802
982
  scope,
@@ -818,7 +998,7 @@ function useDialog(active, { root, panel, body, initialFocus, fallbackFocus }, o
818
998
  // src/Modal.tsx
819
999
  import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
820
1000
  function Modal({ open, title, onClose, footer, children, initialFocusRef, role = "dialog" }) {
821
- const id = useId4();
1001
+ const id = useId5();
822
1002
  const titleId = `${id}-title`;
823
1003
  const bodyId = `${id}-body`;
824
1004
  const root = useRef4(null);
@@ -853,7 +1033,7 @@ function Modal({ open, title, onClose, footer, children, initialFocusRef, role =
853
1033
  }
854
1034
 
855
1035
  // src/Confirm.tsx
856
- import { Fragment as Fragment4, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
1036
+ import { Fragment as Fragment5, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
857
1037
  function Confirm({
858
1038
  open,
859
1039
  title,
@@ -874,7 +1054,7 @@ function Confirm({
874
1054
  onClose: onCancel,
875
1055
  role: "alertdialog",
876
1056
  initialFocusRef: safeAction,
877
- footer: /* @__PURE__ */ jsxs10(Fragment4, { children: [
1057
+ footer: /* @__PURE__ */ jsxs10(Fragment5, { children: [
878
1058
  /* @__PURE__ */ jsx14(Button, { ref: safeAction, variant: "ghost", onClick: onCancel, children: cancelLabel }),
879
1059
  /* @__PURE__ */ jsx14(Button, { variant: danger ? "danger" : "primary", busy, onClick: onConfirm, children: confirmLabel })
880
1060
  ] }),
@@ -884,10 +1064,10 @@ function Confirm({
884
1064
  }
885
1065
 
886
1066
  // src/Feedback.tsx
887
- import { useEffect as useEffect3, useRef as useRef6, useState as useState5 } from "react";
1067
+ import { useEffect as useEffect4, useRef as useRef6, useState as useState5 } from "react";
888
1068
  import { createPortal as createPortal2 } from "react-dom";
889
1069
  import { nearestSection } from "@apliteni/apliteni-ui";
890
- import { Fragment as Fragment5, jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
1070
+ import { Fragment as Fragment6, jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
891
1071
  var defaultSection = (h) => {
892
1072
  if (!h) return { label: "this page", title: "", anchor: "" };
893
1073
  const t = (h.textContent || "").replace(/\s+/g, " ").trim();
@@ -921,7 +1101,7 @@ function Feedback({
921
1101
  const doneClose = useRef6(null);
922
1102
  const opts = useRef6({ minChars, section });
923
1103
  opts.current = { minChars, section };
924
- useEffect3(() => {
1104
+ useEffect4(() => {
925
1105
  function onSelect() {
926
1106
  if (openRef.current) return;
927
1107
  const el = container.current;
@@ -1006,7 +1186,7 @@ function Feedback({
1006
1186
  span.replaceWith(...Array.from(span.childNodes));
1007
1187
  restoreRange();
1008
1188
  }
1009
- useEffect3(() => () => {
1189
+ useEffect4(() => () => {
1010
1190
  opening.current++;
1011
1191
  clearMark();
1012
1192
  }, []);
@@ -1067,7 +1247,7 @@ function Feedback({
1067
1247
  setState("ready");
1068
1248
  }
1069
1249
  }
1070
- return createPortal2(/* @__PURE__ */ jsxs11(Fragment5, { children: [
1250
+ return createPortal2(/* @__PURE__ */ jsxs11(Fragment6, { children: [
1071
1251
  /* @__PURE__ */ jsxs11(
1072
1252
  "button",
1073
1253
  {
@@ -1124,14 +1304,14 @@ function Feedback({
1124
1304
  }
1125
1305
 
1126
1306
  // src/AccountWindow.tsx
1127
- import { useEffect as useEffect7, useId as useId7, useRef as useRef9, useState as useState7 } from "react";
1307
+ import { useEffect as useEffect8, useId as useId8, useRef as useRef9, useState as useState7 } from "react";
1128
1308
  import { createPortal as createPortal3 } from "react-dom";
1129
1309
  import { revealFocusedNav as revealFocusedNav2 } from "@apliteni/apliteni-ui";
1130
1310
 
1131
1311
  // src/NavTabs.tsx
1132
- import { Fragment as Fragment6, forwardRef as forwardRef6, useEffect as useEffect4, useRef as useRef7, useImperativeHandle as useImperativeHandle2 } from "react";
1312
+ import { Fragment as Fragment7, forwardRef as forwardRef6, useEffect as useEffect5, useRef as useRef7, useImperativeHandle as useImperativeHandle2 } from "react";
1133
1313
  import { safeUrl as safeUrl2, observeNavFit, revealCurrentNav, revealFocusedNav } from "@apliteni/apliteni-ui";
1134
- import { Fragment as Fragment7, jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
1314
+ import { Fragment as Fragment8, jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
1135
1315
  var NavTabs = forwardRef6(function NavTabs2({
1136
1316
  items,
1137
1317
  active,
@@ -1145,8 +1325,8 @@ var NavTabs = forwardRef6(function NavTabs2({
1145
1325
  const navRef = useRef7(null);
1146
1326
  useImperativeHandle2(ref, () => navRef.current, []);
1147
1327
  const signature = items.map((item) => item.id).join("\0");
1148
- useEffect4(() => observeNavFit(navRef.current), []);
1149
- useEffect4(() => {
1328
+ useEffect5(() => observeNavFit(navRef.current), []);
1329
+ useEffect5(() => {
1150
1330
  if (navRef.current) revealCurrentNav(navRef.current);
1151
1331
  }, [active, signature]);
1152
1332
  return /* @__PURE__ */ jsx16(
@@ -1162,7 +1342,7 @@ var NavTabs = forwardRef6(function NavTabs2({
1162
1342
  },
1163
1343
  children: items.map((item) => {
1164
1344
  const badge = item.badge != null && typeof item.badge === "object" ? item.badge : { text: item.badge, tone: void 0 };
1165
- const inner = /* @__PURE__ */ jsxs12(Fragment7, { children: [
1345
+ const inner = /* @__PURE__ */ jsxs12(Fragment8, { children: [
1166
1346
  /* @__PURE__ */ jsx16("span", { className: "ui-nav__tab-label", children: item.label }),
1167
1347
  badge.text != null && badge.text !== "" && /* @__PURE__ */ jsx16("span", { className: `ui-nav__badge is-${badge.tone || "neutral"}`, children: badge.text })
1168
1348
  ] });
@@ -1175,25 +1355,25 @@ var NavTabs = forwardRef6(function NavTabs2({
1175
1355
  "aria-current": current ? "page" : void 0,
1176
1356
  children: inner
1177
1357
  };
1178
- return /* @__PURE__ */ jsx16(Fragment6, { children: renderLink ? renderLink(item, linkProps) : /* @__PURE__ */ jsx16("a", { ...linkProps }) }, item.id);
1358
+ return /* @__PURE__ */ jsx16(Fragment7, { children: renderLink ? renderLink(item, linkProps) : /* @__PURE__ */ jsx16("a", { ...linkProps }) }, item.id);
1179
1359
  })
1180
1360
  }
1181
1361
  );
1182
1362
  });
1183
1363
 
1184
1364
  // src/SidebarNav.tsx
1185
- import { forwardRef as forwardRef7, useEffect as useEffect5, useId as useId5, useState as useState6 } from "react";
1365
+ import { forwardRef as forwardRef7, useEffect as useEffect6, useId as useId6, useState as useState6 } from "react";
1186
1366
  import { ENTRANCE_FALLBACK_MS } from "@apliteni/apliteni-ui/motion";
1187
- import { Fragment as Fragment8, jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
1367
+ import { Fragment as Fragment9, jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
1188
1368
  var badgeText = (badge) => typeof badge === "object" ? badge.text : badge;
1189
1369
  function Row({ item, active, activeIs, collapsed, renderLink, sub }) {
1190
- const uid = useId5();
1370
+ const uid = useId6();
1191
1371
  const group = !sub && !!item.items?.length;
1192
1372
  const childActive = group && item.items.some((child) => child.id === active);
1193
1373
  const [expanded, setExpanded] = useState6();
1194
1374
  const open = expanded ?? item.defaultOpen ?? childActive;
1195
1375
  const [entering, setEntering] = useState6(false);
1196
- useEffect5(() => {
1376
+ useEffect6(() => {
1197
1377
  if (!entering) return;
1198
1378
  const timer = setTimeout(() => setEntering(false), ENTRANCE_FALLBACK_MS);
1199
1379
  return () => clearTimeout(timer);
@@ -1210,7 +1390,7 @@ function Row({ item, active, activeIs, collapsed, renderLink, sub }) {
1210
1390
  item.disabled && "is-disabled",
1211
1391
  item.danger && "is-danger"
1212
1392
  ].filter(Boolean).join(" ");
1213
- const children = /* @__PURE__ */ jsxs13(Fragment8, { children: [
1393
+ const children = /* @__PURE__ */ jsxs13(Fragment9, { children: [
1214
1394
  (item.leading ?? item.icon) && /* @__PURE__ */ jsx17("span", { className: "ui-nav__ic", children: item.leading ?? /* @__PURE__ */ jsx17(Icon, { name: item.icon }) }),
1215
1395
  /* @__PURE__ */ jsx17("span", { className: "ui-nav__label", children: item.label }),
1216
1396
  count != null && count !== "" && /* @__PURE__ */ jsx17("span", { className: `ui-nav__badge is-${typeof item.badge === "object" ? item.badge.tone ?? "neutral" : "neutral"}`, children: count }),
@@ -1244,7 +1424,7 @@ function Row({ item, active, activeIs, collapsed, renderLink, sub }) {
1244
1424
  return /* @__PURE__ */ jsx17("li", { children: renderLink ? renderLink(item, props) : /* @__PURE__ */ jsx17("a", { ...props }) });
1245
1425
  }
1246
1426
  function Section({ section, ...props }) {
1247
- const uid = useId5();
1427
+ const uid = useId6();
1248
1428
  return /* @__PURE__ */ jsxs13("div", { className: "ui-nav__section", children: [
1249
1429
  section.label && /* @__PURE__ */ jsx17("div", { className: "ui-nav__cap", id: uid, "aria-hidden": props.collapsed || void 0, children: section.label }),
1250
1430
  /* @__PURE__ */ jsx17("ul", { className: "ui-nav__list", "aria-labelledby": section.label ? uid : void 0, children: section.items.map((item) => /* @__PURE__ */ jsx17(Row, { item, ...props }, item.id)) })
@@ -1279,9 +1459,9 @@ var SidebarNav = forwardRef7(function SidebarNav2({
1279
1459
  });
1280
1460
 
1281
1461
  // src/Tabs.tsx
1282
- import { useEffect as useEffect6, useId as useId6, useRef as useRef8 } from "react";
1462
+ import { useEffect as useEffect7, useId as useId7, useRef as useRef8 } from "react";
1283
1463
  import { playEntrance } from "@apliteni/apliteni-ui/motion";
1284
- import { Fragment as Fragment9, jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
1464
+ import { Fragment as Fragment10, jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
1285
1465
  function tabKeyIndex(key, i, count) {
1286
1466
  switch (key) {
1287
1467
  case "ArrowRight":
@@ -1297,11 +1477,11 @@ function tabKeyIndex(key, i, count) {
1297
1477
  }
1298
1478
  }
1299
1479
  function Tabs({ items, value, onChange, label }) {
1300
- const id = useId6();
1480
+ const id = useId7();
1301
1481
  const previous = useRef8(value);
1302
1482
  const activePanel = useRef8(null);
1303
1483
  const buttons = useRef8([]);
1304
- useEffect6(() => {
1484
+ useEffect7(() => {
1305
1485
  if (previous.current !== value) playEntrance(activePanel.current);
1306
1486
  previous.current = value;
1307
1487
  }, [value]);
@@ -1329,7 +1509,7 @@ function Tabs({ items, value, onChange, label }) {
1329
1509
  },
1330
1510
  children: [
1331
1511
  item.label,
1332
- item.count != null && /* @__PURE__ */ jsxs14(Fragment9, { children: [
1512
+ item.count != null && /* @__PURE__ */ jsxs14(Fragment10, { children: [
1333
1513
  " ",
1334
1514
  item.count
1335
1515
  ] })
@@ -1366,7 +1546,7 @@ function AccountWindow({
1366
1546
  onSectionChange,
1367
1547
  label = "Account"
1368
1548
  }) {
1369
- const titleId = useId7();
1549
+ const titleId = useId8();
1370
1550
  const root = useRef9(null);
1371
1551
  const panel = useRef9(null);
1372
1552
  const body = useRef9(null);
@@ -1375,7 +1555,7 @@ function AccountWindow({
1375
1555
  const { mounted, shown } = usePresence(open, root, panel);
1376
1556
  const scope = useDialog(shown, { root, panel, body }, onClose);
1377
1557
  const currentId = section ?? own;
1378
- useEffect7(() => {
1558
+ useEffect8(() => {
1379
1559
  const nav = tabs.current;
1380
1560
  if (nav) revealFocusedNav2(nav, nav.querySelector('[aria-selected="true"]'));
1381
1561
  }, [mounted, currentId]);
@@ -1490,7 +1670,7 @@ function AccountWindow({
1490
1670
  }
1491
1671
 
1492
1672
  // src/Drawer.tsx
1493
- import { useId as useId8, useRef as useRef10 } from "react";
1673
+ import { useId as useId9, useRef as useRef10 } from "react";
1494
1674
  import { createPortal as createPortal4 } from "react-dom";
1495
1675
  import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
1496
1676
  function Drawer({
@@ -1508,7 +1688,7 @@ function Drawer({
1508
1688
  const root = useRef10(null);
1509
1689
  const panel = useRef10(null);
1510
1690
  const body = useRef10(null);
1511
- const titleId = useId8();
1691
+ const titleId = useId9();
1512
1692
  const { mounted, shown } = usePresence(open, root, panel);
1513
1693
  const scope = useDialog(shown, { root, panel, body, initialFocus: initialFocusRef }, onClose);
1514
1694
  if (!mounted) return null;
@@ -1542,7 +1722,7 @@ function Drawer({
1542
1722
  }
1543
1723
 
1544
1724
  // src/CommandPalette.tsx
1545
- import { useCallback as useCallback3, useEffect as useEffect8, useId as useId9, useMemo as useMemo2, useRef as useRef11, useState as useState8 } from "react";
1725
+ import { useCallback as useCallback3, useEffect as useEffect9, useId as useId10, useMemo as useMemo2, useRef as useRef11, useState as useState8 } from "react";
1546
1726
  import { createPortal as createPortal5 } from "react-dom";
1547
1727
  import { rankGroups, icon as icon3 } from "@apliteni/apliteni-ui";
1548
1728
  import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
@@ -1563,13 +1743,13 @@ function CommandPalette({
1563
1743
  rank = true,
1564
1744
  onQueryChange
1565
1745
  }) {
1566
- const uid = useId9().replace(/:/g, "");
1746
+ const uid = useId10().replace(/:/g, "");
1567
1747
  const root = useRef11(null);
1568
1748
  const panel = useRef11(null);
1569
1749
  const search = useRef11(null);
1570
1750
  const [query, setQuery] = useState8("");
1571
1751
  const [at, setAt] = useState8(0);
1572
- useEffect8(() => {
1752
+ useEffect9(() => {
1573
1753
  if (open) {
1574
1754
  setQuery("");
1575
1755
  setAt(0);
@@ -1581,7 +1761,7 @@ function CommandPalette({
1581
1761
  );
1582
1762
  const rows = useMemo2(() => shown.flatMap((g) => g.items).filter((it) => !isDisabled(it)), [shown]);
1583
1763
  const active = rows[Math.min(at, rows.length - 1)];
1584
- useEffect8(() => {
1764
+ useEffect9(() => {
1585
1765
  setAt(0);
1586
1766
  }, [query]);
1587
1767
  const scope = useDialog(open, { root, panel, body: search }, onClose);
@@ -1737,11 +1917,11 @@ function rowId(uid, groups, item) {
1737
1917
  }
1738
1918
 
1739
1919
  // src/DataTable.tsx
1740
- import { Fragment as Fragment10, useCallback as useCallback4, useEffect as useEffect10, useMemo as useMemo3, useRef as useRef13, useState as useState10 } from "react";
1920
+ import { Fragment as Fragment11, useCallback as useCallback4, useEffect as useEffect11, useMemo as useMemo3, useRef as useRef13, useState as useState10 } from "react";
1741
1921
  import { DEFAULT_PAGE_SIZE as DEFAULT_PAGE_SIZE2 } from "@apliteni/apliteni-ui";
1742
1922
 
1743
1923
  // src/Pagination.tsx
1744
- import { useEffect as useEffect9, useId as useId10, useRef as useRef12, useState as useState9 } from "react";
1924
+ import { useEffect as useEffect10, useId as useId11, useRef as useRef12, useState as useState9 } from "react";
1745
1925
  import { DEFAULT_PAGE_SIZE } from "@apliteni/apliteni-ui";
1746
1926
  import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
1747
1927
  var GHOST_SM = "ui-btn ui-btn--ghost ui-btn--sm";
@@ -1785,7 +1965,7 @@ function Pagination({
1785
1965
  onPageChange,
1786
1966
  onPageSizeChange
1787
1967
  }) {
1788
- const auto = useId10();
1968
+ const auto = useId11();
1789
1969
  const [draft, setDraft] = useState9("");
1790
1970
  const [drafting, setDrafting] = useState9(false);
1791
1971
  const nav = useRef12(null);
@@ -1806,7 +1986,7 @@ function Pagination({
1806
1986
  }
1807
1987
  const offered = (Array.isArray(pageSizes) ? pageSizes : []).slice(0, 12).map((s) => int(s, 0)).filter((s) => s > 0);
1808
1988
  const sizes = offered.length ? [.../* @__PURE__ */ new Set([...offered, size])].sort((a, b) => a - b) : [];
1809
- useEffect9(() => {
1989
+ useEffect10(() => {
1810
1990
  const was = pressed.current;
1811
1991
  if (!was || loading) return;
1812
1992
  pressed.current = null;
@@ -1965,7 +2145,7 @@ function Pagination({
1965
2145
  }
1966
2146
 
1967
2147
  // src/DataTable.tsx
1968
- import { Fragment as Fragment11, jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
2148
+ import { Fragment as Fragment12, jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
1969
2149
  var CELL_CLASS = { title: "ui-table__title", code: "ui-table__code", long: "ui-table__long", strong: "ui-table__num--strong", act: "ui-table__act" };
1970
2150
  var NO_SORT = { key: void 0, dir: -1 };
1971
2151
  function sortTableRows(rows, sort) {
@@ -2014,7 +2194,7 @@ function DataTable({
2014
2194
  []
2015
2195
  );
2016
2196
  const [strip2, setStrip] = useState10();
2017
- useEffect10(() => {
2197
+ useEffect11(() => {
2018
2198
  const el = table.current;
2019
2199
  const host = pagerHost;
2020
2200
  if (!el || !host || typeof ResizeObserver === "undefined") {
@@ -2078,21 +2258,21 @@ function DataTable({
2078
2258
  strokeLinejoin: "round",
2079
2259
  "aria-hidden": "true",
2080
2260
  focusable: "false",
2081
- children: sort.key === k ? /* @__PURE__ */ jsx23("path", { d: "m8 10 4 4 4-4" }) : /* @__PURE__ */ jsxs19(Fragment11, { children: [
2261
+ children: sort.key === k ? /* @__PURE__ */ jsx23("path", { d: "m8 10 4 4 4-4" }) : /* @__PURE__ */ jsxs19(Fragment12, { children: [
2082
2262
  /* @__PURE__ */ jsx23("path", { d: "m8 9 4-4 4 4" }),
2083
2263
  /* @__PURE__ */ jsx23("path", { d: "m8 15 4 4 4-4" })
2084
2264
  ] })
2085
2265
  }
2086
2266
  );
2087
- const Wrap = scrollable ? "div" : Fragment10;
2267
+ const Wrap = scrollable ? "div" : Fragment11;
2088
2268
  const pageAllOn = selectable && slice.length > 0 && slice.every((r) => selected.has(r.name));
2089
2269
  const pageSomeOn = selectable && !pageAllOn && slice.some((r) => selected.has(r.name));
2090
- return /* @__PURE__ */ jsxs19(Fragment11, { children: [
2270
+ return /* @__PURE__ */ jsxs19(Fragment12, { children: [
2091
2271
  /* @__PURE__ */ jsx23(Wrap, { ...scrollable ? { className: "ui-table-scroll", role: "region", "aria-label": scrollLabel, tabIndex: 0 } : {}, children: /* @__PURE__ */ jsxs19(
2092
2272
  "table",
2093
2273
  {
2094
2274
  ref: table,
2095
- className: ["ui-table", hover && "ui-table--hover", zebra && "ui-table--zebra", (density === "dense" || !density && dense) && "ui-table--dense", density === "compact" && "ui-table--compact", stickyHeader && "ui-table--sticky", pinnedIdentity && "ui-table--pinned"].filter(Boolean).join(" "),
2275
+ className: ["ui-table", hover && "ui-table--hover", zebra && "ui-table--zebra", (density === "dense" || !density && dense) && "ui-table--dense", density === "compact" && "ui-table--compact", density === "comfortable" && "ui-table--comfortable", stickyHeader && "ui-table--sticky", pinnedIdentity && "ui-table--pinned"].filter(Boolean).join(" "),
2096
2276
  "aria-busy": loading || void 0,
2097
2277
  children: [
2098
2278
  caption ? /* @__PURE__ */ jsx23("caption", { className: "ui-sr", children: caption }) : null,
@@ -2281,7 +2461,7 @@ function Denied({
2281
2461
  // src/DatePicker.tsx
2282
2462
  import {
2283
2463
  useCallback as useCallback5,
2284
- useEffect as useEffect11,
2464
+ useEffect as useEffect12,
2285
2465
  useMemo as useMemo4,
2286
2466
  useRef as useRef14,
2287
2467
  useState as useState11
@@ -2297,7 +2477,7 @@ var DAY_RE = /^(\d{4})-(\d{2})-(\d{2})$/;
2297
2477
  var PHONE_MAX = 560;
2298
2478
  function usePhone() {
2299
2479
  const [phone, setPhone] = useState11(false);
2300
- useEffect11(() => {
2480
+ useEffect12(() => {
2301
2481
  const query = typeof window === "undefined" ? null : window.matchMedia?.(`(max-width: ${PHONE_MAX}px)`);
2302
2482
  if (!query) return;
2303
2483
  const read = () => setPhone(query.matches);
@@ -2441,7 +2621,7 @@ function DatePicker({
2441
2621
  useIsoLayoutEffect(() => {
2442
2622
  close.current = setOpen;
2443
2623
  });
2444
- useEffect11(() => {
2624
+ useEffect12(() => {
2445
2625
  if (open) setCursor(clamp(anchor, lo, hi));
2446
2626
  }, [open]);
2447
2627
  useIsoLayoutEffect(() => {
@@ -2465,7 +2645,7 @@ function DatePicker({
2465
2645
  view.removeEventListener("resize", fit);
2466
2646
  };
2467
2647
  }, [open, asSheet]);
2468
- useEffect11(() => {
2648
+ useEffect12(() => {
2469
2649
  if (!open || asSheet) return;
2470
2650
  const doc = root.current?.ownerDocument ?? document;
2471
2651
  const onClick = (e) => {
@@ -2775,11 +2955,11 @@ function DatePicker({
2775
2955
 
2776
2956
  // src/Dropdown.tsx
2777
2957
  import {
2778
- Fragment as Fragment12,
2958
+ Fragment as Fragment13,
2779
2959
  useCallback as useCallback6,
2780
2960
  useContext as useContext2,
2781
- useEffect as useEffect12,
2782
- useId as useId11,
2961
+ useEffect as useEffect13,
2962
+ useId as useId12,
2783
2963
  useRef as useRef15,
2784
2964
  useState as useState12
2785
2965
  } from "react";
@@ -2803,7 +2983,7 @@ import { createContext as createContext3 } from "react";
2803
2983
  var FieldContext = createContext3(null);
2804
2984
 
2805
2985
  // src/Dropdown.tsx
2806
- import { Fragment as Fragment13, jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
2986
+ import { Fragment as Fragment14, jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
2807
2987
  var EXIT_SLACK_MS2 = 50;
2808
2988
  var SETTLE_MS = 450;
2809
2989
  var inPanel = (node) => {
@@ -2882,7 +3062,7 @@ function Dropdown({
2882
3062
  const landOn = useRef15(null);
2883
3063
  const revealed = useRef15(false);
2884
3064
  const at = useRef15("");
2885
- const auto = useId11().replace(/:/g, "");
3065
+ const auto = useId12().replace(/:/g, "");
2886
3066
  const uid = id ?? auto;
2887
3067
  const inField = useContext2(FieldContext);
2888
3068
  const fieldName = inField && id === inField.id && !(ariaLabel && triggerContent != null) ? { id: `${uid}-trigger`, labelId: inField.labelId, labelledBy: `${inField.labelId} ${uid}-trigger` } : null;
@@ -2990,7 +3170,7 @@ function Dropdown({
2990
3170
  const given = rows.find((it) => it.selected);
2991
3171
  const givenKey = given ? keyOf(given) : null;
2992
3172
  const pickedKey = selectedValue === void 0 && pick && pick.against === givenKey ? pick.key : null;
2993
- useEffect12(() => {
3173
+ useEffect13(() => {
2994
3174
  if (pick && pick.against !== givenKey) setPick(null);
2995
3175
  }, [givenKey, pick]);
2996
3176
  const picked = pickedKey != null ? rows.find((it) => keyOf(it) === pickedKey) : void 0;
@@ -3007,7 +3187,7 @@ function Dropdown({
3007
3187
  const rowIds = /* @__PURE__ */ new Map();
3008
3188
  rows.forEach((it, i) => rowIds.set(it, `${uid}-opt-${i}`));
3009
3189
  const listId = `${uid}-list`;
3010
- useEffect12(() => {
3190
+ useEffect13(() => {
3011
3191
  if (!open) return;
3012
3192
  const mine = () => close.current(false);
3013
3193
  for (const other of [...openNow]) other();
@@ -3016,7 +3196,7 @@ function Dropdown({
3016
3196
  openNow.delete(mine);
3017
3197
  };
3018
3198
  }, [open]);
3019
- useEffect12(() => {
3199
+ useEffect13(() => {
3020
3200
  if (!open) return;
3021
3201
  const doc = root.current?.ownerDocument ?? document;
3022
3202
  const onClick = (e) => {
@@ -3268,7 +3448,7 @@ function Dropdown({
3268
3448
  ...asLink ? { href: entry.href, ...entry.target ? { target: entry.target } : null } : null,
3269
3449
  ...sx ? { id: rowIds.get(entry), hidden: hiddenBy(entry) || void 0 } : null,
3270
3450
  onClick: (e) => choose(entry, e),
3271
- children: /* @__PURE__ */ jsxs22(Fragment13, { children: [
3451
+ children: /* @__PURE__ */ jsxs22(Fragment14, { children: [
3272
3452
  entry.avatar ? /* @__PURE__ */ jsx26(Avatar, { personKey: entry.avatar.key, name: entry.avatar.name, src: entry.avatar.src, empty: entry.avatar.empty }) : entry.icon && /* @__PURE__ */ jsx26(Glyph2, { name: entry.icon, className: "ui-dropdown__ic" }),
3273
3453
  /* @__PURE__ */ jsxs22("span", { className: "ui-dropdown__main", children: [
3274
3454
  /* @__PURE__ */ jsx26("span", { className: "ui-dropdown__label", children: entry.label }),
@@ -3278,7 +3458,7 @@ function Dropdown({
3278
3458
  asOption && /* @__PURE__ */ jsx26(Glyph2, { name: "check", className: "ui-dropdown__tick", hidden: true })
3279
3459
  ] })
3280
3460
  };
3281
- if (row) return /* @__PURE__ */ jsx26(Fragment12, { children: row(entry, props) }, key);
3461
+ if (row) return /* @__PURE__ */ jsx26(Fragment13, { children: row(entry, props) }, key);
3282
3462
  const Tag = asLink ? "a" : "div";
3283
3463
  return /* @__PURE__ */ jsx26(Tag, { ...props }, key);
3284
3464
  }
@@ -3300,7 +3480,7 @@ function Dropdown({
3300
3480
  );
3301
3481
  }) : (items || []).map((entry, i) => renderRow(entry, `i${i}`));
3302
3482
  const cap = scroll && scroll !== true ? { "--ui-dropdown-cap": typeof scroll === "number" ? `${scroll}px` : scroll } : void 0;
3303
- const none = sx && filtering && !visible.length ? /* @__PURE__ */ jsxs22(Fragment13, { children: [
3483
+ const none = sx && filtering && !visible.length ? /* @__PURE__ */ jsxs22(Fragment14, { children: [
3304
3484
  /* @__PURE__ */ jsx26("span", { className: "ui-dropdown__none-title", children: sx.empty.replace("{q}", () => query.trim()) }),
3305
3485
  /* @__PURE__ */ jsx26("span", { className: "ui-dropdown__none-hint", children: sx.hint })
3306
3486
  ] }) : null;
@@ -3325,7 +3505,7 @@ function Dropdown({
3325
3505
  setOpen(!open);
3326
3506
  },
3327
3507
  children: [
3328
- triggerContent != null ? typeof triggerContent === "string" ? /* @__PURE__ */ jsx26("span", { className: "ui-dropdown__text", children: triggerContent }) : triggerContent : /* @__PURE__ */ jsxs22(Fragment13, { children: [
3508
+ triggerContent != null ? typeof triggerContent === "string" ? /* @__PURE__ */ jsx26("span", { className: "ui-dropdown__text", children: triggerContent }) : triggerContent : /* @__PURE__ */ jsxs22(Fragment14, { children: [
3329
3509
  marked2 && (chosen?.avatar ? /* @__PURE__ */ jsx26(Avatar, { personKey: chosen.avatar.key, name: chosen.avatar.name, src: chosen.avatar.src, empty: chosen.avatar.empty }) : /* @__PURE__ */ jsx26(Avatar, { empty: true })),
3330
3510
  label && /* @__PURE__ */ jsx26("span", { className: "ui-dropdown__pre", children: label }),
3331
3511
  /* @__PURE__ */ jsx26("span", { className: cx6("ui-dropdown__value", marked2 && !chosen && "is-placeholder"), children: shown != null ? shown : placeholder })
@@ -3355,7 +3535,7 @@ function Dropdown({
3355
3535
  onMouseMove,
3356
3536
  children: [
3357
3537
  header,
3358
- sx ? /* @__PURE__ */ jsxs22(Fragment13, { children: [
3538
+ sx ? /* @__PURE__ */ jsxs22(Fragment14, { children: [
3359
3539
  /* @__PURE__ */ jsxs22("div", { className: "ui-dropdown__search", children: [
3360
3540
  /* @__PURE__ */ jsx26(Glyph2, { name: "search", className: "ui-dropdown__search-ic", hidden: true }),
3361
3541
  /* @__PURE__ */ jsx26(
@@ -3509,7 +3689,7 @@ function Segmented({ options, value, onChange, label, appearance = "pill", size,
3509
3689
  // src/FilterBar.tsx
3510
3690
  import { useRef as useRef16, useState as useState13 } from "react";
3511
3691
  import { filterChipText, filterChipName, filterChipUnset, filterChipItems, focusNextStop } from "@apliteni/apliteni-ui";
3512
- import { Fragment as Fragment14, jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
3692
+ import { Fragment as Fragment15, jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
3513
3693
  var SEARCH_AT = 10;
3514
3694
  var isRow2 = (entry) => entry !== "---" && !entry.separator;
3515
3695
  function FilterBar({ filters, label = "Filters", clearLabel = "Clear all", clearVariant = "ghost", add, addLabel = "Filter", disabled = false, busy = false, onRemove, onClear, onChange, onAdd }) {
@@ -3623,7 +3803,7 @@ function FilterBar({ filters, label = "Filters", clearLabel = "Clear all", clear
3623
3803
  variant: "menu",
3624
3804
  sections,
3625
3805
  ariaLabel: addLabel,
3626
- triggerContent: /* @__PURE__ */ jsxs26(Fragment14, { children: [
3806
+ triggerContent: /* @__PURE__ */ jsxs26(Fragment15, { children: [
3627
3807
  /* @__PURE__ */ jsx30(Icon, { name: "plus" }),
3628
3808
  addLabel
3629
3809
  ] }),
@@ -3673,13 +3853,13 @@ function DrawerSection({ title, headingLevel = 3, className, children, ...rest }
3673
3853
  }
3674
3854
 
3675
3855
  // src/Snippet.tsx
3676
- import { useEffect as useEffect13, useRef as useRef17, useState as useState14 } from "react";
3677
- import { Fragment as Fragment15, jsx as jsx32, jsxs as jsxs28 } from "react/jsx-runtime";
3856
+ import { useEffect as useEffect14, useRef as useRef17, useState as useState14 } from "react";
3857
+ import { Fragment as Fragment16, jsx as jsx32, jsxs as jsxs28 } from "react/jsx-runtime";
3678
3858
  function Snippet({ label = "shell", code = "", children, copy = true, reveal = false, copyLabel = "Copy code" }) {
3679
3859
  const [status, setStatus] = useState14("idle");
3680
3860
  const request = useRef17(0);
3681
3861
  const timer = useRef17(void 0);
3682
- useEffect13(() => {
3862
+ useEffect14(() => {
3683
3863
  setStatus("idle");
3684
3864
  return () => {
3685
3865
  request.current++;
@@ -3702,7 +3882,7 @@ function Snippet({ label = "shell", code = "", children, copy = true, reveal = f
3702
3882
  return /* @__PURE__ */ jsxs28("div", { className: reveal ? "ui-snippet ui-snippet--reveal" : "ui-snippet", children: [
3703
3883
  /* @__PURE__ */ jsxs28("div", { className: "ui-snippet__bar", children: [
3704
3884
  /* @__PURE__ */ jsx32("span", { children: label }),
3705
- copy && /* @__PURE__ */ jsxs28(Fragment15, { children: [
3885
+ copy && /* @__PURE__ */ jsxs28(Fragment16, { children: [
3706
3886
  /* @__PURE__ */ jsx32(
3707
3887
  "button",
3708
3888
  {
@@ -3722,14 +3902,14 @@ function Snippet({ label = "shell", code = "", children, copy = true, reveal = f
3722
3902
  }
3723
3903
 
3724
3904
  // src/Timeline.tsx
3725
- import { useEffect as useEffect14, useRef as useRef18 } from "react";
3905
+ import { useEffect as useEffect15, useRef as useRef18 } from "react";
3726
3906
  import { playEntrance as playEntrance2, prefersReducedMotion } from "@apliteni/apliteni-ui/motion";
3727
3907
  import { jsx as jsx33, jsxs as jsxs29 } from "react/jsx-runtime";
3728
3908
  var kindIcons = { person: "user", rule: "bolt", reversal: "refresh" };
3729
3909
  function Timeline({ events, className, ...rest }) {
3730
3910
  const previousIds = useRef18(new Set(events.map((event) => event.id)));
3731
3911
  const rows = useRef18(/* @__PURE__ */ new Map());
3732
- useEffect14(() => {
3912
+ useEffect15(() => {
3733
3913
  if (previousIds.current.size > 0 && !prefersReducedMotion()) {
3734
3914
  for (const event of events) {
3735
3915
  if (previousIds.current.has(event.id)) continue;
@@ -3772,7 +3952,7 @@ function Timeline({ events, className, ...rest }) {
3772
3952
  }
3773
3953
 
3774
3954
  // src/Field.tsx
3775
- import { forwardRef as forwardRef8, useEffect as useEffect15, useId as useId12, useRef as useRef19, useState as useState15 } from "react";
3955
+ import { forwardRef as forwardRef8, useEffect as useEffect16, useId as useId13, useRef as useRef19, useState as useState15 } from "react";
3776
3956
  import { esc, icon as icon5 } from "@apliteni/apliteni-ui";
3777
3957
  import { jsx as jsx34, jsxs as jsxs30 } from "react/jsx-runtime";
3778
3958
  function messages(id, hint, error) {
@@ -3801,13 +3981,13 @@ function wiring(id, hint, error) {
3801
3981
  return { id, "aria-describedby": messages(id, hint, error), "aria-invalid": error ? true : void 0 };
3802
3982
  }
3803
3983
  function Field({ id: suppliedId, label, hint, error, required, children }) {
3804
- const generatedId = useId12();
3984
+ const generatedId = useId13();
3805
3985
  const id = suppliedId ?? generatedId;
3806
3986
  const labelId = `${id}-label`;
3807
3987
  return /* @__PURE__ */ jsx34(Frame, { ...{ id, labelId, label, hint, error, required }, children: /* @__PURE__ */ jsx34(FieldContext.Provider, { value: { id, labelId }, children: children({ ...wiring(id, hint, error), required }) }) });
3808
3988
  }
3809
3989
  var TextField = forwardRef8(function TextField2({ label, hint, error, required, type = "text", unit, icon: glyph2, className = "", ...props }, ref) {
3810
- const id = useId12();
3990
+ const id = useId13();
3811
3991
  const hasUnit = type === "number" && !!unit;
3812
3992
  const describedBy = [messages(id, hint, error), hasUnit ? `${id}-unit` : ""].filter(Boolean).join(" ") || void 0;
3813
3993
  const control = /* @__PURE__ */ jsx34(
@@ -3834,7 +4014,7 @@ var TextField = forwardRef8(function TextField2({ label, hint, error, required,
3834
4014
  ] }) : control });
3835
4015
  });
3836
4016
  function TextArea({ label, hint, error, required, className = "", ...props }) {
3837
- const id = useId12();
4017
+ const id = useId13();
3838
4018
  return /* @__PURE__ */ jsx34(Frame, { ...{ id, label, hint, error, required }, children: /* @__PURE__ */ jsx34(
3839
4019
  "textarea",
3840
4020
  {
@@ -3847,7 +4027,7 @@ function TextArea({ label, hint, error, required, className = "", ...props }) {
3847
4027
  ) });
3848
4028
  }
3849
4029
  function SelectField({ label, hint, error, required, className = "", children, ...props }) {
3850
- const id = useId12();
4030
+ const id = useId13();
3851
4031
  return /* @__PURE__ */ jsx34(Frame, { ...{ id, label, hint, error, required }, children: /* @__PURE__ */ jsx34(
3852
4032
  "select",
3853
4033
  {
@@ -3860,11 +4040,11 @@ function SelectField({ label, hint, error, required, className = "", children, .
3860
4040
  ) });
3861
4041
  }
3862
4042
  function FileField({ label, hint, error, required, disabled, onFileChange, className = "", ...props }) {
3863
- const id = useId12();
4043
+ const id = useId13();
3864
4044
  const input = useRef19(null);
3865
4045
  const [file, setFile] = useState15(null);
3866
4046
  const [dragging, setDragging] = useState15(false);
3867
- useEffect15(() => {
4047
+ useEffect16(() => {
3868
4048
  const form = input.current?.form;
3869
4049
  const reset = () => {
3870
4050
  setFile(null);
@@ -3948,7 +4128,7 @@ function EmptyState({ variant = "first-run", title, sub, icon: icon9, art, actio
3948
4128
  }
3949
4129
 
3950
4130
  // src/FileDrop.tsx
3951
- import { Fragment as Fragment16, jsx as jsx36, jsxs as jsxs32 } from "react/jsx-runtime";
4131
+ import { Fragment as Fragment17, jsx as jsx36, jsxs as jsxs32 } from "react/jsx-runtime";
3952
4132
  var MARKS = {
3953
4133
  uploading: "clock",
3954
4134
  done: "circleCheck",
@@ -4116,7 +4296,7 @@ function FileDrop({
4116
4296
  children: /* @__PURE__ */ jsx36("span", { style: { width: `${file.progress}%` } })
4117
4297
  }
4118
4298
  )
4119
- ] }) : /* @__PURE__ */ jsxs32(Fragment16, { children: [
4299
+ ] }) : /* @__PURE__ */ jsxs32(Fragment17, { children: [
4120
4300
  /* @__PURE__ */ jsx36(
4121
4301
  Button,
4122
4302
  {
@@ -4156,7 +4336,7 @@ var SearchField = forwardRef9(function SearchField2({ ariaLabel, className, ...p
4156
4336
  });
4157
4337
 
4158
4338
  // src/Toast.tsx
4159
- import { createContext as createContext4, useCallback as useCallback7, useContext as useContext3, useEffect as useEffect16, useLayoutEffect as useLayoutEffect4, useRef as useRef21, useState as useState17 } from "react";
4339
+ import { createContext as createContext4, useCallback as useCallback7, useContext as useContext3, useEffect as useEffect17, useLayoutEffect as useLayoutEffect4, useRef as useRef21, useState as useState17 } from "react";
4160
4340
  import { createPortal as createPortal6 } from "react-dom";
4161
4341
 
4162
4342
  // src/lib/toast-stack.ts
@@ -4293,7 +4473,7 @@ function Notice({ notice, remove }) {
4293
4473
  if (typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches) remove();
4294
4474
  else setLeaving(true);
4295
4475
  }, [remove]);
4296
- useEffect16(() => {
4476
+ useEffect17(() => {
4297
4477
  if (leaving2) {
4298
4478
  const element = root.current;
4299
4479
  const finish = (event) => {
@@ -4307,7 +4487,7 @@ function Notice({ notice, remove }) {
4307
4487
  };
4308
4488
  }
4309
4489
  }, [leaving2, remove]);
4310
- useEffect16(() => {
4490
+ useEffect17(() => {
4311
4491
  if (leaving2 || !timed || paused) return;
4312
4492
  const started = Date.now();
4313
4493
  const timer = setTimeout(dismiss, remaining.current);
@@ -4436,7 +4616,7 @@ function Toast({ children, collapse = false }) {
4436
4616
  }
4437
4617
 
4438
4618
  // src/AppShell.tsx
4439
- import { useEffect as useEffect18, useId as useId13, useMemo as useMemo5, useRef as useRef23, useState as useState19 } from "react";
4619
+ import { useEffect as useEffect19, useId as useId14, useMemo as useMemo5, useRef as useRef23, useState as useState19 } from "react";
4440
4620
  import { prism } from "@apliteni/apliteni-ui";
4441
4621
 
4442
4622
  // src/lib/palette-hotkey.ts
@@ -4466,7 +4646,7 @@ function storeRailCollapsed(collapsed) {
4466
4646
  }
4467
4647
 
4468
4648
  // src/AccountMenu.tsx
4469
- import { useEffect as useEffect17, useRef as useRef22, useState as useState18 } from "react";
4649
+ import { useEffect as useEffect18, useRef as useRef22, useState as useState18 } from "react";
4470
4650
  import { createPortal as createPortal7 } from "react-dom";
4471
4651
  import { icon as icon7, themeIcon as themeIcon2, transitionMs as transitionMs3 } from "@apliteni/apliteni-ui";
4472
4652
 
@@ -4547,7 +4727,7 @@ function ThemeToggle({ labelled = false }) {
4547
4727
  }
4548
4728
 
4549
4729
  // src/AccountMenu.tsx
4550
- import { Fragment as Fragment17, jsx as jsx40, jsxs as jsxs36 } from "react/jsx-runtime";
4730
+ import { Fragment as Fragment18, jsx as jsx40, jsxs as jsxs36 } from "react/jsx-runtime";
4551
4731
  var THEMES = [["auto", "Auto"], ["light", "Light"], ["dark", "Dark"]];
4552
4732
  var glyph = (svg, className) => /* @__PURE__ */ jsx40("span", { className, "aria-hidden": "true", dangerouslySetInnerHTML: { __html: svg } });
4553
4733
  function AccountMenu({ account, items, onSelect, withTheme, inPlace, away }) {
@@ -4588,7 +4768,7 @@ function AccountMenu({ account, items, onSelect, withTheme, inPlace, away }) {
4588
4768
  clearTimeout(landed);
4589
4769
  };
4590
4770
  }, [sub, inPlace]);
4591
- useEffect17(() => {
4771
+ useEffect18(() => {
4592
4772
  if (!open || !away) return;
4593
4773
  const gone = () => {
4594
4774
  if (block.current?.getClientRects().length) return;
@@ -4601,7 +4781,7 @@ function AccountMenu({ account, items, onSelect, withTheme, inPlace, away }) {
4601
4781
  window.addEventListener("resize", gone);
4602
4782
  return () => window.removeEventListener("resize", gone);
4603
4783
  }, [open, away]);
4604
- useEffect17(() => {
4784
+ useEffect18(() => {
4605
4785
  if (sub) list.current?.querySelector('[role="menuitemradio"]')?.focus();
4606
4786
  else if (refocus.current) {
4607
4787
  refocus.current = false;
@@ -4673,7 +4853,7 @@ function AccountMenu({ account, items, onSelect, withTheme, inPlace, away }) {
4673
4853
  setOpen(next);
4674
4854
  if (!next) setSub(false);
4675
4855
  },
4676
- triggerContent: /* @__PURE__ */ jsxs36(Fragment17, { children: [
4856
+ triggerContent: /* @__PURE__ */ jsxs36(Fragment18, { children: [
4677
4857
  /* @__PURE__ */ jsx40("span", { className: "ui-app__av", "aria-hidden": "true", children: /* @__PURE__ */ jsx40(Avatar, { personKey: account.email || account.name, name: account.name, size: 32 }) }),
4678
4858
  /* @__PURE__ */ jsxs36("span", { className: "ui-app__who", children: [
4679
4859
  /* @__PURE__ */ jsx40("b", { children: account.name }),
@@ -4681,7 +4861,7 @@ function AccountMenu({ account, items, onSelect, withTheme, inPlace, away }) {
4681
4861
  ] })
4682
4862
  ] }),
4683
4863
  items: [...items, ...withTheme ? [{ label: "Theme", value: "theme" }, "---"] : [], { label: "Sign out", value: "sign-out", icon: "logout", danger: true }],
4684
- row: (item, props) => item.value === "theme" ? /* @__PURE__ */ jsxs36(Fragment17, { children: [
4864
+ row: (item, props) => item.value === "theme" ? /* @__PURE__ */ jsxs36(Fragment18, { children: [
4685
4865
  /* @__PURE__ */ jsxs36(
4686
4866
  "div",
4687
4867
  {
@@ -4720,7 +4900,7 @@ function AccountMenu({ account, items, onSelect, withTheme, inPlace, away }) {
4720
4900
  }
4721
4901
 
4722
4902
  // src/AppShell.tsx
4723
- import { Fragment as Fragment18, jsx as jsx41, jsxs as jsxs37 } from "react/jsx-runtime";
4903
+ import { Fragment as Fragment19, jsx as jsx41, jsxs as jsxs37 } from "react/jsx-runtime";
4724
4904
  var path = (value) => value.split(/[?#]/)[0].replace(/\/+$/, "") || "/";
4725
4905
  function AppShell({
4726
4906
  sections,
@@ -4747,7 +4927,7 @@ function AppShell({
4747
4927
  onNavigate,
4748
4928
  renderLink
4749
4929
  }) {
4750
- const uid = useId13();
4930
+ const uid = useId14();
4751
4931
  const [collapsed, setCollapsed] = useState19(defaultCollapsed);
4752
4932
  const [search, setSearch] = useState19(false);
4753
4933
  const [menu, setMenu] = useState19(false);
@@ -4758,14 +4938,14 @@ function AppShell({
4758
4938
  } }), []);
4759
4939
  const current = path(pathname);
4760
4940
  const active = sections.filter((section) => current === path(section.href) || path(section.href) !== "/" && current.startsWith(`${path(section.href)}/`)).sort((a, b) => path(b.href).length - path(a.href).length)[0];
4761
- useEffect18(() => {
4941
+ useEffect19(() => {
4762
4942
  setCollapsed(railCollapsed() ?? defaultCollapsed);
4763
4943
  }, [defaultCollapsed]);
4764
- useEffect18(() => {
4944
+ useEffect19(() => {
4765
4945
  setMenu(false);
4766
4946
  setSearch(false);
4767
4947
  }, [pathname]);
4768
- useEffect18(() => {
4948
+ useEffect19(() => {
4769
4949
  if (!menu) return;
4770
4950
  const grown = () => {
4771
4951
  const button = menuButton.current;
@@ -4774,7 +4954,7 @@ function AppShell({
4774
4954
  window.addEventListener("resize", grown);
4775
4955
  return () => window.removeEventListener("resize", grown);
4776
4956
  }, [menu]);
4777
- useEffect18(() => {
4957
+ useEffect19(() => {
4778
4958
  if (layout === "rail") return;
4779
4959
  const hotkey = (event) => {
4780
4960
  if (!(event.metaKey || event.ctrlKey) || event.altKey || event.shiftKey || event.key.toLowerCase() !== "k") return;
@@ -4914,7 +5094,7 @@ function AppShell({
4914
5094
  ] }),
4915
5095
  /* @__PURE__ */ jsxs37("div", { className: "ui-app__well", children: [
4916
5096
  /* @__PURE__ */ jsxs37("header", { className: "ui-app__bar", children: [
4917
- navigable ? /* @__PURE__ */ jsxs37(Fragment18, { children: [
5097
+ navigable ? /* @__PURE__ */ jsxs37(Fragment19, { children: [
4918
5098
  /* @__PURE__ */ jsx41("a", { className: "ui-app__brand ui-app__brand--band", href: brandHref, "aria-label": word, children: brand ?? /* @__PURE__ */ jsx41("i", { "aria-hidden": "true", className: "ui-react-app__mark", dangerouslySetInnerHTML: { __html: prism(`${uid}-band`, 24) } }) }),
4919
5099
  /* @__PURE__ */ jsx41("span", { className: "ui-react-app__title", "aria-hidden": "true", children: title })
4920
5100
  ] }) : lockup,
@@ -4937,7 +5117,7 @@ function AppShell({
4937
5117
  "aria-expanded": menu,
4938
5118
  onClick: () => setMenu(true)
4939
5119
  }
4940
- ) : /* @__PURE__ */ jsxs37(Fragment18, { children: [
5120
+ ) : /* @__PURE__ */ jsxs37(Fragment19, { children: [
4941
5121
  bandControl && /* @__PURE__ */ jsx41("span", { className: "ui-react-app__band-control", children: bandControl }),
4942
5122
  headControl && /* @__PURE__ */ jsx41("span", { className: "ui-react-app__band-control", children: headControl }),
4943
5123
  /* @__PURE__ */ jsx41(ThemeToggle, {}),
@@ -4995,7 +5175,7 @@ var AuthShell = forwardRef10(function AuthShell2({ brand, children, className, .
4995
5175
  });
4996
5176
 
4997
5177
  // src/Footer.tsx
4998
- import { useId as useId14 } from "react";
5178
+ import { useId as useId15 } from "react";
4999
5179
  import { prism as prism2, safeUrl as safeUrl3 } from "@apliteni/apliteni-ui";
5000
5180
  import { jsx as jsx43, jsxs as jsxs39 } from "react/jsx-runtime";
5001
5181
  var SOCIAL_GLYPHS = {
@@ -5027,7 +5207,7 @@ function Footer({
5027
5207
  className,
5028
5208
  ...rest
5029
5209
  }) {
5030
- const uid = useId14();
5210
+ const uid = useId15();
5031
5211
  const cls = ["ui-footer", `ui-footer--${variant}`, className].filter(Boolean).join(" ");
5032
5212
  const bar = /* @__PURE__ */ jsx43(Legal, { legal, legalLinks, switcher });
5033
5213
  if (variant !== "full") {
@@ -5065,7 +5245,7 @@ function Footer({
5065
5245
  }
5066
5246
 
5067
5247
  // src/Success.tsx
5068
- import { forwardRef as forwardRef11, useEffect as useEffect19, useRef as useRef24, useState as useState20 } from "react";
5248
+ import { forwardRef as forwardRef11, useEffect as useEffect20, useRef as useRef24, useState as useState20 } from "react";
5069
5249
  import { jsx as jsx44, jsxs as jsxs40 } from "react/jsx-runtime";
5070
5250
  var SuccessCheck = forwardRef11(function SuccessCheck2({ variant = "line", className, ...rest }, ref) {
5071
5251
  const circled = variant === "circled";
@@ -5114,10 +5294,10 @@ var pieces = [
5114
5294
  function Countdown({ seconds, label = "Redirecting", onDone }) {
5115
5295
  const [remaining, setRemaining] = useState20(seconds);
5116
5296
  const callback = useRef24(onDone);
5117
- useEffect19(() => {
5297
+ useEffect20(() => {
5118
5298
  callback.current = onDone;
5119
5299
  }, [onDone]);
5120
- useEffect19(() => {
5300
+ useEffect20(() => {
5121
5301
  let count = seconds;
5122
5302
  const timer = setInterval(() => {
5123
5303
  count -= 1;
@@ -5191,8 +5371,8 @@ var Success = forwardRef11(function Success2({
5191
5371
  import {
5192
5372
  useCallback as useCallback8,
5193
5373
  useContext as useContext4,
5194
- useEffect as useEffect20,
5195
- useId as useId15,
5374
+ useEffect as useEffect21,
5375
+ useId as useId16,
5196
5376
  useLayoutEffect as useLayoutEffect5,
5197
5377
  useMemo as useMemo6,
5198
5378
  useRef as useRef25,
@@ -5202,7 +5382,7 @@ import { createPortal as createPortal8 } from "react-dom";
5202
5382
  import { CHART_FLOOR, bridgeWalk, chartScale, pointTarget } from "@apliteni/apliteni-ui";
5203
5383
 
5204
5384
  // src/chart-looks.tsx
5205
- import { Fragment as Fragment19, jsx as jsx45, jsxs as jsxs41 } from "react/jsx-runtime";
5385
+ import { Fragment as Fragment20, jsx as jsx45, jsxs as jsxs41 } from "react/jsx-runtime";
5206
5386
  var LOOK_DEFAULT = {
5207
5387
  line: "thin",
5208
5388
  area: "stacked",
@@ -5527,7 +5707,7 @@ function linesDrawing(g, open) {
5527
5707
  )
5528
5708
  ] }, `end-${layer.id}`);
5529
5709
  });
5530
- return /* @__PURE__ */ jsxs41(Fragment19, { children: [
5710
+ return /* @__PURE__ */ jsxs41(Fragment20, { children: [
5531
5711
  ramps.some(Boolean) && /* @__PURE__ */ jsx45("defs", { children: ramps.map((ramp) => ramp && /* @__PURE__ */ jsxs41(
5532
5712
  "linearGradient",
5533
5713
  {
@@ -5586,7 +5766,7 @@ function rowsDrawing(g, pick) {
5586
5766
  const { look, labels, format, formatAxis, scale } = g;
5587
5767
  const rows = rowsOf(g);
5588
5768
  const bottom = rows.row * labels.length;
5589
- return /* @__PURE__ */ jsxs41(Fragment19, { children: [
5769
+ return /* @__PURE__ */ jsxs41(Fragment20, { children: [
5590
5770
  pick !== null && pick >= 0 && pick < labels.length && /* @__PURE__ */ jsx45("rect", { className: "ui-chart__band", x: "0", width: px(rows.w), y: px(pick * rows.row), height: px(rows.row) }),
5591
5771
  scale.ticks.map((tick) => /* @__PURE__ */ jsxs41("g", { children: [
5592
5772
  /* @__PURE__ */ jsx45(
@@ -5657,7 +5837,7 @@ function ringDrawing(g) {
5657
5837
  const { look, format } = g;
5658
5838
  const ring = ringOf(g);
5659
5839
  const total = look.totals[0];
5660
- return /* @__PURE__ */ jsxs41(Fragment19, { children: [
5840
+ return /* @__PURE__ */ jsxs41(Fragment20, { children: [
5661
5841
  look.layers.filter((s) => s.to[0] > s.from[0]).map((slice) => /* @__PURE__ */ jsx45(
5662
5842
  "path",
5663
5843
  {
@@ -5701,7 +5881,7 @@ function Shares({ look, format, swatch }) {
5701
5881
  }
5702
5882
 
5703
5883
  // src/Chart.tsx
5704
- import { Fragment as Fragment20, jsx as jsx46, jsxs as jsxs42 } from "react/jsx-runtime";
5884
+ import { Fragment as Fragment21, jsx as jsx46, jsxs as jsxs42 } from "react/jsx-runtime";
5705
5885
  var HEIGHT = { months: 216, bridge: 216, spark: 32, line: 216, area: 216, stacked: 216, donut: 216 };
5706
5886
  var PAD = 2;
5707
5887
  var ZERO_INSET = 1.5;
@@ -5744,7 +5924,7 @@ function barPath(m) {
5744
5924
  }
5745
5925
  function useTapFloor() {
5746
5926
  const [floor, setFloor] = useState21(TARGET);
5747
- useEffect20(() => {
5927
+ useEffect21(() => {
5748
5928
  const query = typeof window === "undefined" ? null : window.matchMedia?.(`(max-width: ${PHONE_MAX2}px) and (pointer: coarse)`);
5749
5929
  if (!query) return;
5750
5930
  const read = () => setFloor(query.matches ? TAP_FLOOR : TARGET);
@@ -5981,7 +6161,7 @@ function Chart(props) {
5981
6161
  const showTable = table ?? !spark;
5982
6162
  const [view, setView] = useState21("chart");
5983
6163
  const asTable = showTable && view === "table";
5984
- const uid = useId15().replace(/[^\w-]/g, "");
6164
+ const uid = useId16().replace(/[^\w-]/g, "");
5985
6165
  const frameEl = useRef25(null);
5986
6166
  const card = useContext4(CardTools);
5987
6167
  const claim = card?.claim;
@@ -6135,7 +6315,7 @@ function Chart(props) {
6135
6315
  const fades = useMemo6(() => new Map(marks.filter((m) => m.kind === "bar").map((m) => fadeOf(uid, m, variant === "bridge")).filter((f) => f !== null).map((f) => [f.id, f])), [marks, uid, variant]);
6136
6316
  const lead = useCallback8((column) => marks.find((m) => m.column === column), [marks]);
6137
6317
  const open = openId ? byId.get(openId) : void 0;
6138
- useEffect20(() => {
6318
+ useEffect21(() => {
6139
6319
  const el = plot.current;
6140
6320
  const box2 = scroller.current;
6141
6321
  if (!el || !box2) return;
@@ -6160,7 +6340,7 @@ function Chart(props) {
6160
6340
  const anchor = [...svgEl.current.querySelectorAll("[data-anchor]")].find((el) => el.getAttribute("data-anchor") === openId);
6161
6341
  if (anchor) placeTip(frameEl.current, anchor, tipEl.current, frameEl.current);
6162
6342
  }, [openId, plotWidth, plotHeight]);
6163
- useEffect20(() => {
6343
+ useEffect21(() => {
6164
6344
  if (!openId) return;
6165
6345
  const doc = frameEl.current?.ownerDocument;
6166
6346
  const view2 = doc?.defaultView;
@@ -6540,9 +6720,9 @@ function Chart(props) {
6540
6720
  ] })
6541
6721
  }
6542
6722
  ),
6543
- /* @__PURE__ */ jsx46("span", { ref: tipEl, className: cx9("ui-tip", openId && "is-open"), role: open ? "tooltip" : void 0, children: open && /* @__PURE__ */ jsxs42(Fragment20, { children: [
6723
+ /* @__PURE__ */ jsx46("span", { ref: tipEl, className: cx9("ui-tip", openId && "is-open"), role: open ? "tooltip" : void 0, children: open && /* @__PURE__ */ jsxs42(Fragment21, { children: [
6544
6724
  /* @__PURE__ */ jsx46("span", { className: "ui-tip__label", children: spark || look ? columns[open.column]?.label : `${open.name}, ${columns[open.column]?.label}` }),
6545
- open.rows ? /* @__PURE__ */ jsxs42(Fragment20, { children: [
6725
+ open.rows ? /* @__PURE__ */ jsxs42(Fragment21, { children: [
6546
6726
  open.rows.map((row) => /* @__PURE__ */ jsxs42("span", { className: "ui-tip__value ui-chart__row", children: [
6547
6727
  /* @__PURE__ */ jsxs42("span", { className: cx9("ui-chart__key", `ui-chart__tone--${row.tone}`), children: [
6548
6728
  /* @__PURE__ */ jsx46(KeyMark, { shape: row.shape }),
@@ -6574,7 +6754,7 @@ function Chart(props) {
6574
6754
  /* @__PURE__ */ jsx46("tbody", { children: tableRows.map((row, i) => /* @__PURE__ */ jsxs42("tr", { "aria-current": pick === i ? true : void 0, children: [
6575
6755
  /* @__PURE__ */ jsxs42("th", { scope: "row", children: [
6576
6756
  row.column.label,
6577
- row.column.estimated && /* @__PURE__ */ jsxs42(Fragment20, { children: [
6757
+ row.column.estimated && /* @__PURE__ */ jsxs42(Fragment21, { children: [
6578
6758
  " ",
6579
6759
  /* @__PURE__ */ jsx46("span", { className: "ui-chart__state", children: stateOf(row.column) })
6580
6760
  ] })
@@ -6631,9 +6811,9 @@ var AccentPicker = forwardRef12(function AccentPicker2({
6631
6811
  });
6632
6812
 
6633
6813
  // src/TopBar.tsx
6634
- import { Fragment as Fragment21 } from "react";
6814
+ import { Fragment as Fragment22 } from "react";
6635
6815
  import { prism as prism3, safeUrl as safeUrl4, icon as icon8, ACCOUNT_NAV } from "@apliteni/apliteni-ui";
6636
- import { Fragment as Fragment22, jsx as jsx48, jsxs as jsxs43 } from "react/jsx-runtime";
6816
+ import { Fragment as Fragment23, jsx as jsx48, jsxs as jsxs43 } from "react/jsx-runtime";
6637
6817
  function TopBar({
6638
6818
  brand,
6639
6819
  word = "Strategy",
@@ -6667,7 +6847,7 @@ function ViewSwitch({ items, active, label = "View", renderLink }) {
6667
6847
  "aria-current": current ? "page" : void 0,
6668
6848
  children: item.label
6669
6849
  };
6670
- return /* @__PURE__ */ jsx48(Fragment21, { children: renderLink ? renderLink(item, linkProps) : /* @__PURE__ */ jsx48("a", { ...linkProps }) }, item.id);
6850
+ return /* @__PURE__ */ jsx48(Fragment22, { children: renderLink ? renderLink(item, linkProps) : /* @__PURE__ */ jsx48("a", { ...linkProps }) }, item.id);
6671
6851
  }) });
6672
6852
  }
6673
6853
  var BADGE = { live: "Live", archive: "Archive" };
@@ -6684,7 +6864,7 @@ function VersionSwitcher({ versions, value, onChange, label = "Version", default
6684
6864
  chevron: false,
6685
6865
  defaultOpen,
6686
6866
  ariaLabel: `${label} \u2014 ${current?.label ?? ""}`,
6687
- triggerContent: /* @__PURE__ */ jsxs43(Fragment22, { children: [
6867
+ triggerContent: /* @__PURE__ */ jsxs43(Fragment23, { children: [
6688
6868
  /* @__PURE__ */ jsx48("span", { className: "cur", children: current?.label }),
6689
6869
  /* @__PURE__ */ jsx48("span", { className: "car", "aria-hidden": "true" })
6690
6870
  ] }),