@photon-ai/pho-ui 2.16.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/dist/chunks/IconArrowsMinimize-BfPUGuCB.js +75 -0
  2. package/dist/chunks/IconArrowsMinimize-BfPUGuCB.js.map +1 -0
  3. package/dist/chunks/IconChevronUp-CrpWSgIl.js +11 -0
  4. package/dist/chunks/IconChevronUp-CrpWSgIl.js.map +1 -0
  5. package/dist/chunks/{bar-chart-BJfr3eyd.js → bar-chart-DIALC2_z.js} +2 -2
  6. package/dist/chunks/bar-chart-DIALC2_z.js.map +1 -0
  7. package/dist/chunks/basic-page-CYDwfVjO.js +1749 -0
  8. package/dist/chunks/basic-page-CYDwfVjO.js.map +1 -0
  9. package/dist/chunks/calendar-4OFiCLAv.js +292 -0
  10. package/dist/chunks/calendar-4OFiCLAv.js.map +1 -0
  11. package/dist/chunks/card-DhDwtSi9.js +56 -0
  12. package/dist/chunks/card-DhDwtSi9.js.map +1 -0
  13. package/dist/chunks/code-block-BuDIo8Q0.js +197 -0
  14. package/dist/chunks/code-block-BuDIo8Q0.js.map +1 -0
  15. package/dist/chunks/collapsible-if7ncPbI.js +28 -0
  16. package/dist/chunks/collapsible-if7ncPbI.js.map +1 -0
  17. package/dist/chunks/{command-Ck8IAgV7.js → command-CTYrSz9a.js} +2 -2
  18. package/dist/chunks/{command-Ck8IAgV7.js.map → command-CTYrSz9a.js.map} +1 -1
  19. package/dist/chunks/data-table-DcwCgXJU.js +293 -0
  20. package/dist/chunks/data-table-DcwCgXJU.js.map +1 -0
  21. package/dist/chunks/date-picker-Bwa6J4ik.js +381 -0
  22. package/dist/chunks/date-picker-Bwa6J4ik.js.map +1 -0
  23. package/dist/chunks/{dialog-BxKACOj5.js → dialog-BwfUFn6B.js} +2 -2
  24. package/dist/chunks/{dialog-BxKACOj5.js.map → dialog-BwfUFn6B.js.map} +1 -1
  25. package/dist/chunks/{error-D0yoFxCv.js → error-BAQgnde7.js} +2 -2
  26. package/dist/chunks/{error-D0yoFxCv.js.map → error-BAQgnde7.js.map} +1 -1
  27. package/dist/chunks/{filter-bar-Cjjq38xo.js → filter-bar-D9lBBr4z.js} +3 -3
  28. package/dist/chunks/{filter-bar-Cjjq38xo.js.map → filter-bar-D9lBBr4z.js.map} +1 -1
  29. package/dist/chunks/ghost-search-BvBFa9su.js +25 -0
  30. package/dist/chunks/ghost-search-BvBFa9su.js.map +1 -0
  31. package/dist/chunks/{line-chart-CUR3AxrR.js → line-chart-VuMYKzW3.js} +2 -2
  32. package/dist/chunks/{line-chart-CUR3AxrR.js.map → line-chart-VuMYKzW3.js.map} +1 -1
  33. package/dist/chunks/{log-list-0AXnjFrk.js → log-list-BERiO4UJ.js} +2 -2
  34. package/dist/chunks/{log-list-0AXnjFrk.js.map → log-list-BERiO4UJ.js.map} +1 -1
  35. package/dist/chunks/scroll-area-Zik8t1Mk.js +168 -0
  36. package/dist/chunks/scroll-area-Zik8t1Mk.js.map +1 -0
  37. package/dist/chunks/sidebar-DRPe5CAh.js +306 -0
  38. package/dist/chunks/sidebar-DRPe5CAh.js.map +1 -0
  39. package/dist/chunks/{toast-iSf6NuAS.js → toast-72Wwlzg9.js} +2 -2
  40. package/dist/chunks/{toast-iSf6NuAS.js.map → toast-72Wwlzg9.js.map} +1 -1
  41. package/dist/chunks/trace-Ba1RMBfk.js +1645 -0
  42. package/dist/chunks/trace-Ba1RMBfk.js.map +1 -0
  43. package/dist/chunks/use-measure-C-i54AC6.js +629 -0
  44. package/dist/chunks/use-measure-C-i54AC6.js.map +1 -0
  45. package/dist/components/bar-chart.js +1 -1
  46. package/dist/components/calendar.js +5 -0
  47. package/dist/components/card.js +1 -1
  48. package/dist/components/code-block.js +1 -1
  49. package/dist/components/collapsible.js +2 -25
  50. package/dist/components/command.js +1 -1
  51. package/dist/components/data-table.js +9 -8
  52. package/dist/components/date-picker.js +6 -0
  53. package/dist/components/dialog.js +1 -1
  54. package/dist/components/error.js +1 -1
  55. package/dist/components/filter-bar.js +1 -1
  56. package/dist/components/line-chart.js +1 -1
  57. package/dist/components/log-list.js +1 -1
  58. package/dist/components/scroll-area.js +1 -1
  59. package/dist/components/toast.js +1 -1
  60. package/dist/components/trace.js +41 -6
  61. package/dist/index.js +164 -121
  62. package/dist/primitives.js +3 -3
  63. package/dist/sections/basic-page.js +5 -5
  64. package/dist/sections/sidebar.js +9 -6
  65. package/dist/src/components/calendar/calendar.d.ts +36 -0
  66. package/dist/src/components/calendar/index.d.ts +2 -0
  67. package/dist/src/components/card/card.d.ts +5 -1
  68. package/dist/src/components/chart/scale.d.ts +6 -1
  69. package/dist/src/components/code-block/code-block.d.ts +24 -5
  70. package/dist/src/components/code-block/index.d.ts +1 -1
  71. package/dist/src/components/data-table/data-table.d.ts +54 -13
  72. package/dist/src/components/date-picker/date-picker.d.ts +97 -0
  73. package/dist/src/components/date-picker/index.d.ts +2 -0
  74. package/dist/src/components/scroll-area/scroll-area.d.ts +9 -1
  75. package/dist/src/components/trace/decorations.d.ts +32 -0
  76. package/dist/src/components/trace/index.d.ts +5 -2
  77. package/dist/src/components/trace/layout.d.ts +57 -29
  78. package/dist/src/components/trace/span-primitive.d.ts +168 -0
  79. package/dist/src/components/trace/span-tree.d.ts +148 -0
  80. package/dist/src/components/trace/trace.d.ts +98 -16
  81. package/dist/src/index.d.ts +2 -0
  82. package/dist/src/sections/basic-page/basic-page.d.ts +95 -7
  83. package/dist/src/sections/basic-page/index.d.ts +1 -1
  84. package/dist/src/sections/sidebar/index.d.ts +1 -1
  85. package/dist/src/sections/sidebar/sidebar.d.ts +72 -0
  86. package/dist/src/utils/ghost-search.d.ts +11 -0
  87. package/package.json +10 -1
  88. package/dist/chunks/bar-chart-BJfr3eyd.js.map +0 -1
  89. package/dist/chunks/basic-page-CMJuM5iA.js +0 -1650
  90. package/dist/chunks/basic-page-CMJuM5iA.js.map +0 -1
  91. package/dist/chunks/card-DSW3Uhag.js +0 -56
  92. package/dist/chunks/card-DSW3Uhag.js.map +0 -1
  93. package/dist/chunks/code-block-CdozzaHM.js +0 -139
  94. package/dist/chunks/code-block-CdozzaHM.js.map +0 -1
  95. package/dist/chunks/data-table-CHLJfGkS.js +0 -279
  96. package/dist/chunks/data-table-CHLJfGkS.js.map +0 -1
  97. package/dist/chunks/scroll-area-BO-9PMM7.js +0 -167
  98. package/dist/chunks/scroll-area-BO-9PMM7.js.map +0 -1
  99. package/dist/chunks/sidebar-DVzZsCts.js +0 -223
  100. package/dist/chunks/sidebar-DVzZsCts.js.map +0 -1
  101. package/dist/chunks/trace-CbH0IohX.js +0 -314
  102. package/dist/chunks/trace-CbH0IohX.js.map +0 -1
  103. package/dist/chunks/use-measure-CMVgLouO.js +0 -616
  104. package/dist/chunks/use-measure-CMVgLouO.js.map +0 -1
  105. package/dist/components/collapsible.js.map +0 -1
@@ -0,0 +1,1749 @@
1
+ "use client";
2
+ import { t as p } from "./cn-ChIgwEl3.js";
3
+ import { n as Ge } from "./link-provider-DXzDQ08N.js";
4
+ import { FADE_ENTRANCE as ct, FADE_SWAP as ut, SPRING_ENTRANCE as dt, TRAVEL_LINEAR as pt, fadeThroughBlur as ae } from "../motion.js";
5
+ import { a as Z, o as ge } from "./button-CdqS_t5a.js";
6
+ import { t as mt } from "./error-BAQgnde7.js";
7
+ import { n as ft, t as ht } from "./IconArrowsMinimize-BfPUGuCB.js";
8
+ import { t as ie } from "./IconChevronLeft-CSWMKQ4C.js";
9
+ import { t as gt } from "./IconChevronRight-CzoJnYNI.js";
10
+ import { t as Re } from "./IconSearch-BKAHkLyX.js";
11
+ import { i as be, n as bt, o as vt, r as yt } from "./data-table-DcwCgXJU.js";
12
+ import { t as xt } from "./IconX-pZ9vrtSr.js";
13
+ import { t as wt } from "./toast-72Wwlzg9.js";
14
+ import { t as ue } from "./input-group-fc9_jD4d.js";
15
+ import { t as Nt } from "./animated-height-CCO-Ocoz.js";
16
+ import { n as ve, t as J } from "./scroll-area-Zik8t1Mk.js";
17
+ import { i as At } from "./checkbox-CLPmblNA.js";
18
+ import { t as _t } from "./form-AiHbbw4m.js";
19
+ import { i as K } from "./menu-BQeprfxB.js";
20
+ import { t as Ct } from "./ghost-search-BvBFa9su.js";
21
+ import { t as W } from "./tooltip-BTF7GChl.js";
22
+ import { Children as ee, Fragment as Et, createContext as z, isValidElement as Ve, useCallback as ye, useContext as T, useEffect as O, useId as kt, useLayoutEffect as H, useMemo as q, useRef as C, useState as w, useSyncExternalStore as xe } from "react";
23
+ import { Fragment as we, jsx as t, jsxs as y } from "react/jsx-runtime";
24
+ import { AnimatePresence as $, motion as A, useIsPresent as St, useReducedMotion as M } from "motion/react";
25
+ import { Dialog as ne } from "@base-ui/react/dialog";
26
+ import { createPortal as Pe } from "react-dom";
27
+ var Ne = "rounded-base border border-pho-secondary bg-pho-primary", se = "divide-y divide-pho-secondary [&>:has(+[data-basic-page-alert])]:border-b-0", $e = `${Ne} ${se} gap-0`, Ie = "flex min-w-0 flex-col gap-3 rounded-base border border-pho-secondary bg-pho-page p-5", Tt = "flex min-h-[4.25rem] min-w-0 flex-col gap-3 px-5 py-4 sm:flex-row sm:items-center sm:justify-between sm:gap-6", Rt = "flex flex-col gap-3 px-5 py-4", Pt = "-mx-5 -mb-4 flex items-center rounded-b-[calc(0.75rem-1px)] bg-pho-secondary py-1 pr-3 pl-5", It = "-mx-2 -mt-1.5 flex items-center rounded-sm bg-pho-secondary px-2 py-0.5", I = dt, D = ct, j = 12, qe = z(null), Ot = 768;
28
+ function Lt(e, a = "default") {
29
+ return Math.round(a === "wide" ? Math.min(Math.max(e * 0.5, 400), 640) : Math.min(Math.max(e * 0.4, 320), 448));
30
+ }
31
+ var We = z(null), je = z(null);
32
+ function Bt(e) {
33
+ const [a, n] = w(null), [r, i] = w(!1), [o, u] = w(!1), [c, s] = w(!1), [d, f] = w(() => ({
34
+ width: typeof window > "u" ? 0 : window.innerWidth,
35
+ height: null
36
+ }));
37
+ return H(() => {
38
+ const l = e.current;
39
+ if (!r || l == null) return;
40
+ const m = Ee(l), h = () => {
41
+ const b = l.offsetWidth, N = m?.clientHeight ?? null;
42
+ f((v) => v.width === b && v.height === N ? v : {
43
+ width: b,
44
+ height: N
45
+ });
46
+ };
47
+ if (h(), typeof ResizeObserver > "u") return;
48
+ const g = new ResizeObserver(h);
49
+ return g.observe(l), m != null && g.observe(m), () => g.disconnect();
50
+ }, [e, r]), {
51
+ host: q(() => ({
52
+ slot: a,
53
+ paneNarrow: d.width < Ot,
54
+ paneWidth: d.width,
55
+ paneHeight: d.height,
56
+ setOpen: u,
57
+ setAsPage: s,
58
+ setPresent: i
59
+ }), [a, d]),
60
+ setSlot: n,
61
+ open: o,
62
+ asPage: c
63
+ };
64
+ }
65
+ function Mt(e) {
66
+ return e == null ? window.scrollY : e.scrollTop;
67
+ }
68
+ function Oe(e, a) {
69
+ e == null ? window.scrollTo({ top: a }) : e.scrollTop = a;
70
+ }
71
+ function Dt({ condense: e = !0, width: a, prerendered: n = !1, className: r, children: i, ref: o, ...u }) {
72
+ const c = T(ce)?.adopt ?? !1, s = T(je), [d, f] = w(!1), l = C(0), m = ye((L) => {
73
+ l.current += L ? 1 : -1, f(l.current > 0);
74
+ }, []), h = a === "wide" || a == null && d, [g] = w(vt), b = C(null), N = q(() => ({
75
+ ref: b,
76
+ prerendered: n
77
+ }), [n]), [v, _] = w(null), [x, E] = w(null), R = q(() => ({
78
+ setTitle: _,
79
+ setTail: E
80
+ }), []);
81
+ O(() => {
82
+ if (s != null)
83
+ return s.setBack(x), () => s.setBack(null);
84
+ }, [s, x]);
85
+ const { host: P, setSlot: F, open: G, asPage: Y } = Bt(b), V = G && Y, U = C(!1), te = C(0);
86
+ H(() => {
87
+ const L = b.current;
88
+ if (V === U.current || L == null) return;
89
+ U.current = V;
90
+ const B = Ee(L);
91
+ V ? (te.current = Mt(B), Oe(B, 0)) : Oe(B, te.current);
92
+ }, [V]);
93
+ const S = e ? /* @__PURE__ */ t(Ht, {
94
+ title: v,
95
+ tail: s == null ? x : null,
96
+ silent: V || s != null
97
+ }) : null, k = /* @__PURE__ */ t("div", {
98
+ "data-basic-page-column": "",
99
+ className: p("mx-auto flex w-full min-w-0 flex-1 flex-col px-5 pt-12 pb-12 *:min-w-0", h ? "max-w-[84rem] md:px-8" : "max-w-[44.5rem]", c || s != null ? "[&_[data-basic-page-back]]:hidden" : "has-[[data-basic-page-back]]:pt-16"),
100
+ children: e ? /* @__PURE__ */ t(_e.Provider, {
101
+ value: R,
102
+ children: i
103
+ }) : i
104
+ });
105
+ return /* @__PURE__ */ t("div", {
106
+ "data-basic-page-root": "",
107
+ "data-basic-page-width": h ? "wide" : void 0,
108
+ "data-basic-page-prerendered": n ? "" : void 0,
109
+ className: p("relative flex min-h-full w-full min-w-0 flex-row", r),
110
+ ...u,
111
+ ref: (L) => {
112
+ b.current = L, typeof o == "function" ? o(L) : o != null && (o.current = L);
113
+ },
114
+ children: /* @__PURE__ */ t(qe.Provider, {
115
+ value: N,
116
+ children: /* @__PURE__ */ t(We.Provider, {
117
+ value: P,
118
+ children: /* @__PURE__ */ t(yt.Provider, {
119
+ value: m,
120
+ children: /* @__PURE__ */ y(be.Provider, {
121
+ value: g,
122
+ children: [/* @__PURE__ */ y("div", {
123
+ "data-basic-page-main": "",
124
+ className: p("flex min-w-0 flex-1 flex-col", V && "hidden"),
125
+ children: [S, k]
126
+ }), /* @__PURE__ */ t("div", {
127
+ ref: F,
128
+ className: "contents"
129
+ })]
130
+ })
131
+ })
132
+ })
133
+ })
134
+ });
135
+ }
136
+ var de = /* @__PURE__ */ new Set();
137
+ function Ht({ title: e, tail: a, silent: n = !1 }) {
138
+ const r = M(), [i, o] = w(() => !n && de.size > 0), u = T(ce), c = kt();
139
+ H(() => {
140
+ if (!(!i || n))
141
+ return de.add(c), () => {
142
+ de.delete(c);
143
+ };
144
+ }, [
145
+ c,
146
+ i,
147
+ n
148
+ ]), O(() => {
149
+ if (u != null) {
150
+ if (n) {
151
+ u.store.clear(c);
152
+ return;
153
+ }
154
+ u.store.set(c, {
155
+ condensed: i,
156
+ title: e?.label ?? null,
157
+ back: a
158
+ });
159
+ }
160
+ }, [
161
+ u,
162
+ c,
163
+ i,
164
+ e,
165
+ a,
166
+ n
167
+ ]), O(() => {
168
+ if (u != null)
169
+ return () => u.store.clear(c);
170
+ }, [u, c]);
171
+ const s = e?.el ?? null;
172
+ O(() => {
173
+ if (s == null || typeof IntersectionObserver > "u") {
174
+ if (typeof requestAnimationFrame > "u") return;
175
+ const m = requestAnimationFrame(() => o(!1));
176
+ return () => cancelAnimationFrame(m);
177
+ }
178
+ const l = new IntersectionObserver(([m]) => o(m != null && !m.isIntersecting), { root: Ee(s) });
179
+ return l.observe(s), () => l.disconnect();
180
+ }, [s]);
181
+ const d = r ? 0 : -Yt, f = r ? "blur(0px)" : `blur(${ve}px)`;
182
+ return /* @__PURE__ */ t("div", {
183
+ "data-basic-page-condense": "",
184
+ className: "sticky top-0 z-20 h-0 overflow-visible",
185
+ children: /* @__PURE__ */ t($, {
186
+ initial: !1,
187
+ children: i && !(u?.adopt ?? !1) && /* @__PURE__ */ y(A.div, {
188
+ initial: { opacity: 0 },
189
+ animate: { opacity: 1 },
190
+ exit: { opacity: 0 },
191
+ transition: le,
192
+ className: "border-pho-secondary bg-pho-page/85 relative grid h-12 grid-cols-[1fr_minmax(0,auto)_1fr] items-center border-b px-3 backdrop-blur",
193
+ children: [/* @__PURE__ */ t("div", {
194
+ className: "flex min-w-0 items-center justify-start",
195
+ children: a != null && /* @__PURE__ */ t(ge, {
196
+ variant: "ghost",
197
+ size: "sm",
198
+ href: a.href,
199
+ onClick: a.onClick,
200
+ prefix: /* @__PURE__ */ t("span", {
201
+ className: "inline-flex [&>svg]:size-[1.125em] [&>svg]:shrink-0",
202
+ children: /* @__PURE__ */ t(ie, {})
203
+ }),
204
+ className: "min-w-max",
205
+ children: a.label
206
+ })
207
+ }), /* @__PURE__ */ t(A.span, {
208
+ initial: {
209
+ opacity: 0,
210
+ y: d,
211
+ filter: f
212
+ },
213
+ animate: {
214
+ opacity: 1,
215
+ y: 0,
216
+ filter: "blur(0px)"
217
+ },
218
+ exit: {
219
+ opacity: 0,
220
+ y: d,
221
+ filter: f
222
+ },
223
+ transition: {
224
+ ...le,
225
+ y: Qt
226
+ },
227
+ className: "text-pho-primary block max-w-full min-w-0 truncate text-center text-base font-medium",
228
+ children: e?.label
229
+ })]
230
+ })
231
+ })
232
+ });
233
+ }
234
+ function Ft(e) {
235
+ return e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
236
+ }
237
+ function zt(e) {
238
+ if (!(typeof e != "string" && typeof e != "number"))
239
+ return Ft(String(e)) || void 0;
240
+ }
241
+ function Ae(e, a) {
242
+ if (e !== "")
243
+ return e ?? zt(a);
244
+ }
245
+ var Gt = (e) => `basic-page-morph-${e}`, Vt = { layout: I }, Le = 10, Be = {
246
+ delay: 0.2,
247
+ duration: 0.12,
248
+ ease: "easeOut"
249
+ }, $t = {
250
+ duration: 0.18,
251
+ ease: "easeOut"
252
+ }, qt = -8, Wt = {
253
+ duration: 0.16,
254
+ ease: "easeOut"
255
+ }, jt = {
256
+ delay: 0.14,
257
+ duration: 0.16,
258
+ ease: "easeOut"
259
+ }, Ke = {
260
+ duration: 0.12,
261
+ ease: "easeOut"
262
+ }, X = [];
263
+ function Kt(e) {
264
+ const a = C({ labels: e });
265
+ a.current.labels = e, H(() => {
266
+ const n = a.current;
267
+ return X.push(n), () => {
268
+ X.splice(X.indexOf(n), 1);
269
+ };
270
+ }, []);
271
+ }
272
+ function Xe() {
273
+ const [e] = w(() => {
274
+ const a = X[X.length - 1];
275
+ return a ? { labels: [...a.labels] } : null;
276
+ });
277
+ return e;
278
+ }
279
+ var _e = z(null), fe = {
280
+ condensed: !1,
281
+ title: null,
282
+ back: null
283
+ }, ce = z(null), Ce = () => () => {
284
+ }, Me = () => fe;
285
+ function Xt({ adopt: e = !0, children: a }) {
286
+ const [n] = w(() => {
287
+ let i = fe, o = null;
288
+ const u = /* @__PURE__ */ new Set(), c = () => {
289
+ for (const s of u) s();
290
+ };
291
+ return {
292
+ get: () => i,
293
+ set(s, d) {
294
+ o = s, i = d, c();
295
+ },
296
+ clear(s) {
297
+ o === s && (o = null, i = fe, c());
298
+ },
299
+ subscribe(s) {
300
+ return u.add(s), () => u.delete(s);
301
+ }
302
+ };
303
+ }), r = q(() => ({
304
+ store: n,
305
+ adopt: e
306
+ }), [n, e]);
307
+ return /* @__PURE__ */ t(ce.Provider, {
308
+ value: r,
309
+ children: a
310
+ });
311
+ }
312
+ function _n() {
313
+ const e = T(ce);
314
+ return xe(e?.store.subscribe ?? Ce, e?.store.get ?? Me, e?.store.get ?? Me);
315
+ }
316
+ var le = ut, Qt = pt, Yt = -8;
317
+ function Ee(e) {
318
+ if (typeof getComputedStyle != "function") return null;
319
+ for (let a = e.parentElement; a != null && a !== document.body; a = a.parentElement) {
320
+ const { overflowY: n } = getComputedStyle(a);
321
+ if (n === "auto" || n === "scroll") return a;
322
+ }
323
+ return null;
324
+ }
325
+ var pe = /* @__PURE__ */ new Map(), Ut = 96;
326
+ function Jt(e) {
327
+ const a = e.closest("[data-basic-page-root]"), n = a?.querySelector("[data-basic-page-column]");
328
+ return !a || !n ? 0 : n.getBoundingClientRect().left - a.getBoundingClientRect().left;
329
+ }
330
+ function Qe(e) {
331
+ const [a] = w(() => {
332
+ if (e == null) return !1;
333
+ const r = pe.get(e);
334
+ return r != null && r.visible && r.el.isConnected && Jt(r.el) <= Ut;
335
+ }), n = C(null);
336
+ return O(() => {
337
+ if (e == null || typeof IntersectionObserver > "u") return;
338
+ const r = n.current;
339
+ if (!r) return;
340
+ const i = new IntersectionObserver(([o]) => {
341
+ o && pe.set(e, {
342
+ visible: o.isIntersecting,
343
+ el: r
344
+ });
345
+ });
346
+ return i.observe(r), () => {
347
+ i.disconnect(), pe.delete(e);
348
+ };
349
+ }, [e]), {
350
+ fly: a,
351
+ ref: n
352
+ };
353
+ }
354
+ var Zt = {
355
+ fade: {
356
+ initial: { opacity: 0 },
357
+ animate: { opacity: 1 },
358
+ transition: { opacity: D }
359
+ },
360
+ rise: {
361
+ initial: {
362
+ opacity: 0,
363
+ y: j
364
+ },
365
+ animate: {
366
+ opacity: 1,
367
+ y: 0
368
+ },
369
+ transition: {
370
+ y: I,
371
+ opacity: D
372
+ }
373
+ },
374
+ slide: {
375
+ initial: { x: "-100%" },
376
+ animate: { x: 0 },
377
+ transition: { x: jt }
378
+ }
379
+ };
380
+ function Ye({ morphId: e, fromClassName: a, fly: n, morphRef: r, arrival: i, className: o, children: u }) {
381
+ const [c, s] = w(!1), d = !n && i != null ? Zt[i] : null;
382
+ return /* @__PURE__ */ y(A.span, {
383
+ ref: r,
384
+ layoutId: Gt(e),
385
+ initial: d?.initial,
386
+ animate: d?.animate,
387
+ transition: n ? Vt : {
388
+ layout: { duration: 0 },
389
+ ...d?.transition
390
+ },
391
+ onLayoutAnimationStart: () => {
392
+ n && s(!0);
393
+ },
394
+ onLayoutAnimationComplete: () => s(!1),
395
+ className: p("relative inline-block", o),
396
+ children: [u, c && /* @__PURE__ */ t(A.span, {
397
+ "aria-hidden": !0,
398
+ initial: { opacity: 1 },
399
+ animate: { opacity: 0 },
400
+ transition: $t,
401
+ onAnimationComplete: () => s(!1),
402
+ className: p("absolute inset-0", a),
403
+ children: u
404
+ })]
405
+ });
406
+ }
407
+ var De = "max-w-full min-w-0 truncate align-top";
408
+ function ea({ id: e, morphId: a, enter: n, trailing: r, className: i, children: o, ...u }) {
409
+ const c = Ae(e, o), s = M(), d = Se(n === !0), f = Qe(a), l = Xe(), m = !s && (a != null || d === !0), h = d || l != null ? "rise" : void 0, g = T(_e), b = C(null);
410
+ H(() => {
411
+ if (g != null)
412
+ return g.setTitle({
413
+ label: o,
414
+ el: b.current
415
+ }), () => g.setTitle(null);
416
+ }, [g, o]);
417
+ const [N, v] = w(f.fly && l != null);
418
+ H(() => {
419
+ X.length > 0 && v(!1);
420
+ }, []);
421
+ const _ = r != null && r !== !1, x = !s && (a != null ? f.fly || h != null : d === !0), E = a != null && !s ? /* @__PURE__ */ t(Ye, {
422
+ morphId: a,
423
+ fromClassName: "text-pho-secondary",
424
+ fly: f.fly,
425
+ morphRef: f.ref,
426
+ arrival: h,
427
+ className: De,
428
+ children: o
429
+ }) : d && !s ? /* @__PURE__ */ t(A.span, {
430
+ initial: {
431
+ opacity: 0,
432
+ y: j
433
+ },
434
+ animate: {
435
+ opacity: 1,
436
+ y: 0
437
+ },
438
+ transition: {
439
+ y: I,
440
+ opacity: D
441
+ },
442
+ className: p("inline-block", De),
443
+ children: o
444
+ }) : _ ? /* @__PURE__ */ t("span", {
445
+ className: "min-w-0 truncate",
446
+ children: o
447
+ }) : o;
448
+ return /* @__PURE__ */ y("h1", {
449
+ id: c,
450
+ "data-basic-page-title": "",
451
+ className: p("text-display-base text-pho-primary max-w-full min-w-0 scroll-mt-12 px-5 font-medium", m ? "whitespace-nowrap" : "truncate", i),
452
+ ...u,
453
+ ref: (R) => {
454
+ b.current = R;
455
+ const P = u.ref;
456
+ typeof P == "function" ? P(R) : P != null && (P.current = R);
457
+ },
458
+ children: [_ ? /* @__PURE__ */ y("span", {
459
+ className: "flex max-w-full min-w-0 items-center gap-2",
460
+ children: [E, x ? /* @__PURE__ */ t(A.span, {
461
+ "data-basic-page-title-trailing": "",
462
+ initial: {
463
+ opacity: 0,
464
+ y: j
465
+ },
466
+ animate: {
467
+ opacity: 1,
468
+ y: 0
469
+ },
470
+ transition: {
471
+ y: I,
472
+ opacity: D
473
+ },
474
+ className: "shrink-0",
475
+ children: r
476
+ }) : /* @__PURE__ */ t("span", {
477
+ "data-basic-page-title-trailing": "",
478
+ className: "shrink-0",
479
+ children: r
480
+ })]
481
+ }) : E, N && /* @__PURE__ */ t(A.span, {
482
+ "aria-hidden": !0,
483
+ initial: { opacity: 1 },
484
+ animate: { opacity: 0 },
485
+ transition: Ke,
486
+ onAnimationComplete: () => v(!1),
487
+ className: p("text-pho-secondary pointer-events-none absolute inline-flex items-center", Ba),
488
+ children: /* @__PURE__ */ t(ie, {})
489
+ })]
490
+ });
491
+ }
492
+ var Ue = z(!1);
493
+ function ta() {
494
+ const e = T(Ue), a = M(), [n] = w(() => e && !a);
495
+ return n;
496
+ }
497
+ var aa = {
498
+ height: 0,
499
+ opacity: 0,
500
+ paddingTop: 0,
501
+ paddingBottom: 0,
502
+ borderTopWidth: 0
503
+ }, na = {
504
+ y: I,
505
+ opacity: D,
506
+ height: I,
507
+ paddingTop: I,
508
+ paddingBottom: I,
509
+ borderTopWidth: I
510
+ };
511
+ function ke() {
512
+ const e = ta(), a = St(), n = M();
513
+ return {
514
+ initial: e ? {
515
+ opacity: 0,
516
+ y: j
517
+ } : !1,
518
+ animate: {
519
+ opacity: 1,
520
+ y: 0
521
+ },
522
+ exit: aa,
523
+ transition: n ? { duration: 0 } : na,
524
+ leaving: !a
525
+ };
526
+ }
527
+ var ra = typeof process < "u" && process.env.NODE_ENV !== "production";
528
+ function Je(e, a, n, r) {
529
+ O(() => {
530
+ if (!ra || e.current == null || typeof getComputedStyle != "function") return;
531
+ const i = (u) => {
532
+ const c = getComputedStyle(u).rowGap;
533
+ return c === "" || c === "normal" ? null : parseFloat(c);
534
+ }, o = i(e.current);
535
+ o != null && o !== n && console.warn(`[BasicPage.${a}] spaced at ${o}px instead of ${n}px. Spacing is the system's: Stack gap-10 between blocks, a block gap-3, Fields gap-5. Remove the class and move the wrapper instead.`, e.current);
536
+ for (const u of Array.from(e.current.children)) {
537
+ const c = r(u);
538
+ if (c == null || getComputedStyle(u).display === "contents") continue;
539
+ const s = i(u);
540
+ s != null && s !== c && console.warn(`[BasicPage.${a}] a child is spaced at ${s}px instead of ${c}px. Spacing is the system's: Stack gap-10 between blocks, a block gap-3, Fields gap-5. Remove the class and move the wrapper instead.`, u);
541
+ }
542
+ });
543
+ }
544
+ function ia(e) {
545
+ return Array.from(e.querySelectorAll("[data-basic-page-stack], [data-basic-page-title], [data-basic-page-header]")).some((a) => a.closest('[aria-busy="true"]') != null);
546
+ }
547
+ function Se(e, a = !1) {
548
+ const n = T(qe), [r] = w(() => {
549
+ if (typeof document > "u" || !e || n?.prerendered) return !1;
550
+ if (a) return !0;
551
+ if (document.querySelector("[data-basic-page-prerendered]") != null) return !1;
552
+ const i = n ? n.ref.current : document;
553
+ return i == null || !ia(i);
554
+ });
555
+ return r;
556
+ }
557
+ function re({ enter: e, className: a, children: n, ref: r, ...i }) {
558
+ const o = M(), u = C(null);
559
+ Je(u, "Stack", 40, (m) => m.hasAttribute("data-basic-page-fields") ? 20 : m.hasAttribute("data-basic-page-card") || m.hasAttribute("data-basic-page-onboard") || m.hasAttribute("data-basic-page-header") || m.hasAttribute("data-basic-page-columns") || m.hasAttribute("data-data-table") ? null : 12);
560
+ const c = Se(e ?? !0, e === !0), s = i["aria-busy"], d = s === !0 || s === "true", f = C(d), l = f.current && !d;
561
+ return O(() => {
562
+ f.current = d;
563
+ }), /* @__PURE__ */ t(A.div, {
564
+ ref: (m) => {
565
+ u.current = m, typeof r == "function" ? r(m) : r != null && (r.current = m);
566
+ },
567
+ "data-basic-page-stack": "",
568
+ initial: o || !c ? !1 : {
569
+ opacity: 0,
570
+ y: j
571
+ },
572
+ animate: {
573
+ opacity: 1,
574
+ y: 0
575
+ },
576
+ transition: {
577
+ y: I,
578
+ opacity: D
579
+ },
580
+ className: p("mt-7 flex min-w-0 flex-col gap-10", "[&:has(>*:first-child:not([data-basic-page-callout])>[data-basic-page-header]:first-child)]:mt-6 [&:has(>*:first-child:not([data-basic-page-callout])>h2:first-child)]:mt-6 [&:has(>[data-basic-page-header]:first-child)]:mt-6 [&:has(>h2:first-child)]:mt-6", "*:min-w-0 [&>*:not([data-basic-page-fields]):not([data-basic-page-card]):not([data-basic-page-callout]):not([data-basic-page-onboard]):not([data-basic-page-header]):not([data-basic-page-columns]):not([data-data-table])]:flex [&>*:not([data-basic-page-fields]):not([data-basic-page-card]):not([data-basic-page-callout]):not([data-basic-page-onboard]):not([data-basic-page-header]):not([data-basic-page-columns]):not([data-data-table])]:flex-col [&>*:not([data-basic-page-fields]):not([data-basic-page-card]):not([data-basic-page-callout]):not([data-basic-page-onboard]):not([data-basic-page-header]):not([data-basic-page-columns]):not([data-data-table])]:gap-3", a),
581
+ ...i,
582
+ children: /* @__PURE__ */ t(Ue.Provider, {
583
+ value: l,
584
+ children: n
585
+ })
586
+ });
587
+ }
588
+ var He = "@container grid min-w-0 grid-cols-[minmax(0,1fr)_auto_auto] mb-3 [&>:not([data-basic-page-search]):not([data-basic-page-header-action])]:col-start-1 [&>:nth-child(1_of_:not([data-basic-page-search]):not([data-basic-page-header-action])):nth-last-child(1_of_:not([data-basic-page-search]):not([data-basic-page-header-action]))]:row-span-2 [&>:nth-child(1_of_:not([data-basic-page-search]):not([data-basic-page-header-action])):nth-last-child(1_of_:not([data-basic-page-search]):not([data-basic-page-header-action]))]:self-center [&>:nth-child(1_of_:not([data-basic-page-search]):not([data-basic-page-header-action])):not(:nth-last-child(1_of_:not([data-basic-page-search]):not([data-basic-page-header-action])))]:self-end [&>:not([data-basic-page-search]):not([data-basic-page-header-action]):not(:nth-child(1_of_:not([data-basic-page-search]):not([data-basic-page-header-action])))]:self-start [[data-basic-page-callout]_&]:mb-0 [[data-basic-page-stack]>*>&]:mb-0";
589
+ function sa({ enter: e, className: a, ...n }) {
590
+ const r = M();
591
+ return Se(e === !0) && !r ? /* @__PURE__ */ t(A.div, {
592
+ initial: {
593
+ opacity: 0,
594
+ y: j
595
+ },
596
+ animate: {
597
+ opacity: 1,
598
+ y: 0
599
+ },
600
+ transition: {
601
+ y: I,
602
+ opacity: D
603
+ },
604
+ className: p(He, a),
605
+ ...n,
606
+ "data-basic-page-header": ""
607
+ }) : /* @__PURE__ */ t("div", {
608
+ className: p(He, a),
609
+ ...n,
610
+ "data-basic-page-header": ""
611
+ });
612
+ }
613
+ function la({ className: e, ...a }) {
614
+ return /* @__PURE__ */ t("div", {
615
+ "data-basic-page-header-action": "",
616
+ className: p("flex items-center gap-2", "[[data-basic-page-header]>&]:col-start-3 [[data-basic-page-header]>&]:row-span-2 [[data-basic-page-header]>&]:row-start-1 [[data-basic-page-header]>&]:mr-5 [[data-basic-page-header]>&]:ml-4 [[data-basic-page-header]>&]:self-start [[data-basic-page-header]>&]:justify-self-end", "[[data-basic-page-callout]_[data-basic-page-header]>&]:mr-0", e),
617
+ ...a
618
+ });
619
+ }
620
+ function oa({ id: e, className: a, children: n, ...r }) {
621
+ const i = Ae(e, n);
622
+ return /* @__PURE__ */ t("h2", {
623
+ id: i,
624
+ className: p("text-display-xs text-pho-primary max-w-full min-w-0 scroll-mt-12 truncate px-5 font-medium", "mb-3 [[data-basic-page-callout]_&]:mb-0 [[data-basic-page-header]>&]:mb-0 [[data-basic-page-stack]>*>&]:mb-0", a),
625
+ ...r,
626
+ children: n
627
+ });
628
+ }
629
+ function Ze({ className: e, ...a }) {
630
+ return /* @__PURE__ */ t("p", {
631
+ className: p("text-display-xs text-pho-description px-5 font-normal", e),
632
+ ...a
633
+ });
634
+ }
635
+ function ca({ one: e, other: a, ...n }) {
636
+ const r = T(be), i = xe(r?.subscribe ?? Ce, () => r?.get().api ?? null, () => null);
637
+ if (i == null) return null;
638
+ const o = i.query.trim() !== "" ? `${i.matched} of ${i.total}.` : `${i.total} ${i.total === 1 ? e : a}.`;
639
+ return /* @__PURE__ */ t(Ze, {
640
+ ...n,
641
+ children: o
642
+ });
643
+ }
644
+ function ua({ className: e, ...a }) {
645
+ return /* @__PURE__ */ t("p", {
646
+ className: p("text-pho-description px-5 text-xs font-normal", "mt-3 [[data-basic-page-callout]_&]:mt-0 [[data-basic-page-stack]>*>&]:mt-0", e),
647
+ ...a
648
+ });
649
+ }
650
+ function da({ animateHeight: e, className: a, children: n, ...r }) {
651
+ const i = /* @__PURE__ */ t($, { children: ee.toArray(n) });
652
+ return e ? /* @__PURE__ */ t("div", {
653
+ className: p(Ne, "min-h-0 gap-0 overflow-hidden", a),
654
+ ...r,
655
+ "data-basic-page-card": "",
656
+ children: /* @__PURE__ */ t(Nt, {
657
+ transition: I,
658
+ className: se,
659
+ children: i
660
+ })
661
+ }) : /* @__PURE__ */ t("div", {
662
+ className: p($e, a),
663
+ ...r,
664
+ "data-basic-page-card": "",
665
+ children: i
666
+ });
667
+ }
668
+ function pa({ className: e, ...a }) {
669
+ const { leaving: n, ...r } = ke();
670
+ return /* @__PURE__ */ t(A.div, {
671
+ ...r,
672
+ className: p(Rt, n && "overflow-hidden", e),
673
+ ...a
674
+ });
675
+ }
676
+ function ma({ divided: e = !1, className: a, ...n }) {
677
+ return /* @__PURE__ */ t("div", {
678
+ className: p(e ? It : Pt, a),
679
+ ...n
680
+ });
681
+ }
682
+ function fa({ className: e, icon: a, children: n, ...r }) {
683
+ if (a == null || a === !1 || a === !0) return /* @__PURE__ */ t("div", {
684
+ className: p(Ie, e),
685
+ ...r,
686
+ "data-basic-page-callout": "",
687
+ children: n
688
+ });
689
+ const [i, ...o] = ee.toArray(n);
690
+ return /* @__PURE__ */ y("div", {
691
+ className: p(Ie, e),
692
+ ...r,
693
+ "data-basic-page-callout": "",
694
+ children: [/* @__PURE__ */ y("div", {
695
+ className: "relative",
696
+ children: [/* @__PURE__ */ t("div", {
697
+ className: "min-w-0 pr-16",
698
+ children: i
699
+ }), /* @__PURE__ */ t("div", {
700
+ "aria-hidden": !0,
701
+ className: "text-pho-primary pointer-events-none absolute top-0 right-0 size-14 opacity-[0.275] [&>svg]:size-full",
702
+ children: a
703
+ })]
704
+ }), o]
705
+ });
706
+ }
707
+ function ha({ id: e, className: a, children: n, ...r }) {
708
+ const i = Ae(e, n);
709
+ return /* @__PURE__ */ t("h2", {
710
+ id: i,
711
+ className: p("text-display-xs text-pho-primary max-w-full min-w-0 scroll-mt-12 truncate font-medium", a),
712
+ ...r,
713
+ children: n
714
+ });
715
+ }
716
+ function ga({ className: e, ...a }) {
717
+ return /* @__PURE__ */ t("p", {
718
+ className: p("text-display-xs text-pho-description font-normal", e),
719
+ ...a
720
+ });
721
+ }
722
+ var et = z(null), tt = z(!1);
723
+ function ba({ className: e, children: a, ...n }) {
724
+ let r = !1;
725
+ const i = ee.toArray(a).map((o, u) => {
726
+ if (!Ve(o)) return o;
727
+ let c;
728
+ return o.props.done ? c = "done" : r ? c = "upcoming" : (r = !0, c = o.props.working ? "working" : o.props.pending ? "pending" : "current"), /* @__PURE__ */ t(et.Provider, {
729
+ value: {
730
+ number: u + 1,
731
+ state: c
732
+ },
733
+ children: o
734
+ }, o.key ?? u);
735
+ });
736
+ return /* @__PURE__ */ t("ol", {
737
+ className: p($e, "m-0 list-none p-0", e),
738
+ ...n,
739
+ "data-basic-page-onboard": "",
740
+ children: i
741
+ });
742
+ }
743
+ var va = "relative grid size-5 shrink-0 place-items-center rounded-full border text-xs font-medium tabular-nums transition-[background-color,border-color,color] duration-200 ease-out *:[grid-area:1/1]", ya = {
744
+ done: "border-pho-ink text-pho-primary",
745
+ current: "bg-pho-brand-solid text-pho-on-brand border-transparent",
746
+ working: "border-transparent text-pho-primary",
747
+ pending: "border-pho-ink text-pho-primary border-dashed",
748
+ upcoming: "border-pho-primary text-pho-description"
749
+ }, xa = "pointer-events-none absolute -inset-px rounded-full border border-pho-ink opacity-30", wa = "pointer-events-none absolute -inset-px rounded-full border border-pho-ink border-r-transparent border-b-transparent border-l-transparent animate-pho-spinner", Na = {
750
+ done: "Done.",
751
+ working: "In progress.",
752
+ pending: "Waiting."
753
+ };
754
+ function Aa({ icon: e, aside: a, title: n, description: r, done: i, working: o, pending: u, className: c, children: s, ...d }) {
755
+ const f = T(et), l = f?.state ?? (i ? "done" : o ? "working" : u ? "pending" : "current"), m = M(), h = l === "current" || l === "working" || l === "pending", g = l === "upcoming", b = Na[l], N = s != null && s !== !1, v = e != null && e !== !1, _ = a != null && a !== !1;
756
+ return /* @__PURE__ */ t("li", {
757
+ "data-basic-page-step": l,
758
+ "aria-current": h ? "step" : void 0,
759
+ className: p("relative m-0 grid min-w-0 grid-cols-[auto_minmax(0,1fr)] grid-rows-[auto_minmax(0,1fr)] items-center gap-x-3 px-5 py-4", "transition-[background-color] duration-200 ease-out first:rounded-t-[calc(0.75rem-1px)] last:rounded-b-[calc(0.75rem-1px)] motion-reduce:transition-none", h && "bg-pho-page", c),
760
+ ...d,
761
+ children: /* @__PURE__ */ y(tt.Provider, {
762
+ value: !0,
763
+ children: [
764
+ /* @__PURE__ */ y("span", {
765
+ "aria-hidden": !0,
766
+ className: p(va, ya[l], "col-start-1 row-start-1"),
767
+ children: [/* @__PURE__ */ t($, {
768
+ initial: !1,
769
+ children: l === "done" ? /* @__PURE__ */ t(A.span, {
770
+ ...ae(m),
771
+ className: "flex",
772
+ children: /* @__PURE__ */ t(At, { className: "size-3" })
773
+ }, "check") : /* @__PURE__ */ t(A.span, {
774
+ ...ae(m),
775
+ children: f?.number ?? 1
776
+ }, "number")
777
+ }), l === "working" ? /* @__PURE__ */ y(we, { children: [/* @__PURE__ */ t("span", { className: xa }), /* @__PURE__ */ t("span", { className: wa })] }) : null]
778
+ }),
779
+ /* @__PURE__ */ y("div", {
780
+ "data-basic-page-step-title": "",
781
+ className: p("text-display-xs col-start-2 row-start-1 min-w-0 font-medium transition-colors duration-200 ease-out", g ? "text-pho-description" : "text-pho-primary"),
782
+ children: [b ? /* @__PURE__ */ y("span", {
783
+ className: "sr-only",
784
+ children: [b, " "]
785
+ }) : null, n]
786
+ }),
787
+ /* @__PURE__ */ t(Te, {
788
+ show: h,
789
+ gap: "none",
790
+ clip: !1,
791
+ className: "col-start-2 row-start-2 flex min-w-0 flex-col self-stretch",
792
+ children: /* @__PURE__ */ y("div", {
793
+ "data-basic-page-step-body": "",
794
+ className: "flex min-w-0 flex-1 flex-col",
795
+ children: [r ? /* @__PURE__ */ t("div", {
796
+ className: "text-display-xs text-pho-description font-normal",
797
+ children: r
798
+ }) : null, N ? /* @__PURE__ */ t("div", {
799
+ className: "mt-auto flex flex-wrap items-center gap-2 pt-3",
800
+ children: s
801
+ }) : null]
802
+ })
803
+ }),
804
+ l === "done" && N ? /* @__PURE__ */ t("div", {
805
+ className: "col-start-3 row-start-1 flex min-w-0 items-center gap-2",
806
+ children: s
807
+ }) : _ ? /* @__PURE__ */ t($, {
808
+ initial: !1,
809
+ children: h ? /* @__PURE__ */ t(A.div, {
810
+ ...ae(m),
811
+ className: "col-start-3 row-span-2 row-start-1 self-start",
812
+ children: a
813
+ }, "aside") : null
814
+ }) : v ? /* @__PURE__ */ t($, {
815
+ initial: !1,
816
+ children: h ? /* @__PURE__ */ t(A.div, {
817
+ "aria-hidden": !0,
818
+ ...ae(m),
819
+ className: "pointer-events-none col-start-3 row-span-2 row-start-1 size-14 self-start",
820
+ children: /* @__PURE__ */ t("div", {
821
+ className: "text-pho-primary size-full opacity-[0.275] [&>svg]:size-full",
822
+ children: e
823
+ })
824
+ }, "icon") : null
825
+ }) : null
826
+ ]
827
+ })
828
+ });
829
+ }
830
+ function _a({ label: e, description: a, htmlFor: n, stacked: r = !1, className: i, children: o, ...u }) {
831
+ const { leaving: c, ...s } = ke();
832
+ return /* @__PURE__ */ y(A.div, {
833
+ ...s,
834
+ className: p(Tt, r && "sm:flex-col sm:items-stretch sm:justify-start sm:gap-3", c && "overflow-hidden", i),
835
+ ...u,
836
+ children: [/* @__PURE__ */ y("div", {
837
+ className: "min-w-0",
838
+ children: [n ? /* @__PURE__ */ t("label", {
839
+ htmlFor: n,
840
+ className: "text-pho-primary block text-base font-normal",
841
+ children: e
842
+ }) : /* @__PURE__ */ t("div", {
843
+ className: "text-pho-primary text-base font-normal",
844
+ children: e
845
+ }), a ? /* @__PURE__ */ t("p", {
846
+ className: "text-pho-description text-xs",
847
+ children: a
848
+ }) : null]
849
+ }), /* @__PURE__ */ t("div", {
850
+ className: p("flex w-full min-w-0 items-center gap-2 sm:w-auto", r && "sm:w-full"),
851
+ children: o
852
+ })]
853
+ });
854
+ }
855
+ function Ca({ className: e, ...a }) {
856
+ const n = T(tt);
857
+ return /* @__PURE__ */ t("p", {
858
+ className: p("text-pho-description max-w-full min-w-0 truncate", n ? "text-display-xs font-normal" : "text-base", e),
859
+ ...a
860
+ });
861
+ }
862
+ function Ea({ error: e, show: a, className: n, children: r, ...i }) {
863
+ const o = M(), u = T(Q), c = e ?? u?.error ?? void 0;
864
+ return /* @__PURE__ */ t($, {
865
+ initial: !1,
866
+ children: (a ?? !0) && (c != null || r != null) ? /* @__PURE__ */ t(A.div, {
867
+ "data-basic-page-alert": "",
868
+ className: "overflow-hidden",
869
+ initial: {
870
+ height: 0,
871
+ opacity: 0
872
+ },
873
+ animate: {
874
+ height: "auto",
875
+ opacity: 1
876
+ },
877
+ exit: {
878
+ height: 0,
879
+ opacity: 0
880
+ },
881
+ transition: o ? { duration: 0 } : {
882
+ height: I,
883
+ opacity: D
884
+ },
885
+ children: /* @__PURE__ */ t(mt, {
886
+ error: c,
887
+ className: p("px-5 pb-3", n),
888
+ ...i,
889
+ children: r
890
+ })
891
+ }) : null
892
+ });
893
+ }
894
+ function Cn() {
895
+ return T(Q)?.requestSave ?? null;
896
+ }
897
+ var En = 800, me = wt.createToastManager(), Q = z(null);
898
+ function ka({ action: e, errors: a, autoSave: n = !1, className: r, children: i, onChange: o, onBlur: u, ...c }) {
899
+ const [s, d] = w(!1), [f, l] = w(!1), [m, h] = w(null), [g, b] = w(a ?? {}), [N, v] = w(null), _ = C(null), x = C(null), E = C(null), R = C(!1), P = C(!1), F = C(null), G = C(async () => {
900
+ });
901
+ O(() => () => {
902
+ x.current != null && clearTimeout(x.current);
903
+ }, []);
904
+ const Y = async () => {
905
+ const S = _.current;
906
+ if (S == null || e == null) return;
907
+ if (R.current) {
908
+ P.current = !0;
909
+ return;
910
+ }
911
+ if (!S.checkValidity()) return;
912
+ const k = Object.fromEntries(new FormData(S).entries()), L = E.current;
913
+ R.current = !0, v({
914
+ field: L,
915
+ phase: "saving"
916
+ }), h(null);
917
+ try {
918
+ const B = (await e(k))?.errors;
919
+ if (B != null && Object.keys(B).length > 0) {
920
+ b(B), v(null);
921
+ return;
922
+ }
923
+ b({}), l(!1), v({
924
+ field: L,
925
+ phase: "saved"
926
+ }), F.current != null && (me.close(F.current), F.current = null);
927
+ } catch (B) {
928
+ v(null), h(B), F.current != null && me.close(F.current), F.current = me.add({
929
+ type: "error",
930
+ title: "Couldn't save",
931
+ description: B instanceof Error && B.message !== "" ? B.message : "The change is still here — try again.",
932
+ timeout: 0,
933
+ actionProps: {
934
+ children: "Retry",
935
+ onClick: () => {
936
+ G.current();
937
+ }
938
+ }
939
+ });
940
+ } finally {
941
+ R.current = !1, P.current && (P.current = !1, G.current());
942
+ }
943
+ };
944
+ G.current = Y;
945
+ const V = () => {
946
+ x.current != null && clearTimeout(x.current), x.current = setTimeout(() => {
947
+ x.current = null, G.current();
948
+ }, 800);
949
+ }, U = q(() => n ? (S) => {
950
+ S != null && (E.current = S), l(!0), V();
951
+ } : null, [n]), te = q(() => ({
952
+ pending: s,
953
+ dirty: f,
954
+ error: m,
955
+ auto: N,
956
+ requestSave: U
957
+ }), [
958
+ s,
959
+ f,
960
+ m,
961
+ N,
962
+ U
963
+ ]);
964
+ return /* @__PURE__ */ t(Q.Provider, {
965
+ value: te,
966
+ children: /* @__PURE__ */ t(_t, {
967
+ errors: g,
968
+ onFormSubmit: async (S) => {
969
+ if (e != null) {
970
+ d(!0), h(null);
971
+ try {
972
+ const k = (await e(S))?.errors;
973
+ if (k != null && Object.keys(k).length > 0) {
974
+ b(k);
975
+ return;
976
+ }
977
+ b({}), l(!1);
978
+ } catch (k) {
979
+ h(k);
980
+ } finally {
981
+ d(!1);
982
+ }
983
+ }
984
+ },
985
+ onChange: (S) => {
986
+ l(!0), h(null);
987
+ const k = S.target.name;
988
+ k && k in g && b((L) => {
989
+ const { [k]: B, ...ot } = L;
990
+ return ot;
991
+ }), n && (k && (E.current = k), V()), o?.(S);
992
+ },
993
+ onBlur: (S) => {
994
+ n && f && x.current != null && (clearTimeout(x.current), x.current = null, G.current()), u?.(S);
995
+ },
996
+ className: p("contents [[data-basic-page-stack]>&]:flex [[data-basic-page-stack]>&]:min-w-0 [[data-basic-page-stack]>&]:flex-col", r),
997
+ ...c,
998
+ ref: (S) => {
999
+ _.current = S;
1000
+ const k = c.ref;
1001
+ typeof k == "function" ? k(S) : k != null && (k.current = S);
1002
+ },
1003
+ children: /* @__PURE__ */ t("fieldset", {
1004
+ disabled: s,
1005
+ "aria-busy": s || void 0,
1006
+ className: "contents",
1007
+ children: i
1008
+ })
1009
+ })
1010
+ });
1011
+ }
1012
+ function Sa({ name: e, className: a, ...n }) {
1013
+ const r = T(Q), i = M(), o = r?.auto ?? null, u = o != null && (e == null || o.field === e), [c, s] = w(!1), d = u ? o.phase : null;
1014
+ O(() => {
1015
+ if (d !== "saved") return;
1016
+ s(!0);
1017
+ const m = setTimeout(() => s(!1), 1800);
1018
+ return () => clearTimeout(m);
1019
+ }, [d, o]);
1020
+ const f = d === "saving" ? "Saving…" : d === "saved" && c ? "Saved" : null, l = i ? "blur(0px)" : `blur(${ve}px)`;
1021
+ return /* @__PURE__ */ t("span", {
1022
+ className: "grid justify-items-end",
1023
+ children: /* @__PURE__ */ t($, {
1024
+ initial: !1,
1025
+ children: f != null && /* @__PURE__ */ t(A.output, {
1026
+ initial: {
1027
+ opacity: 0,
1028
+ filter: l
1029
+ },
1030
+ animate: {
1031
+ opacity: 1,
1032
+ filter: "blur(0px)"
1033
+ },
1034
+ exit: {
1035
+ opacity: 0,
1036
+ filter: l
1037
+ },
1038
+ transition: le,
1039
+ className: p("text-pho-description pl-8 [grid-area:1/1]", a),
1040
+ style: { background: "linear-gradient(to left, var(--background-color-pho-primary) calc(100% - 2rem), transparent)" },
1041
+ ...n,
1042
+ children: f
1043
+ }, f)
1044
+ })
1045
+ });
1046
+ }
1047
+ var Ta = "flex min-w-0 flex-col gap-5 p-5 [&>[data-basic-page-alert]]:-mx-5 [&>[data-basic-page-alert]]:-mt-2 [&>[data-basic-page-alert]]:-mb-5 [&>[data-basic-page-footer]]:pr-0 [&>[data-basic-page-reveal]]:flex [&>[data-basic-page-reveal]]:flex-col [&>[data-basic-page-reveal]]:gap-5";
1048
+ function Ra({ className: e, ...a }) {
1049
+ const n = C(null);
1050
+ return Je(n, "Fields", 20, () => null), /* @__PURE__ */ t("div", {
1051
+ className: p(Ne, Ta, e),
1052
+ ...a,
1053
+ ref: (r) => {
1054
+ n.current = r;
1055
+ const i = a.ref;
1056
+ typeof i == "function" ? i(r) : i != null && (i.current = r);
1057
+ },
1058
+ "data-basic-page-fields": ""
1059
+ });
1060
+ }
1061
+ function Pa({ className: e, ...a }) {
1062
+ return /* @__PURE__ */ t("div", {
1063
+ className: p("flex min-w-0 flex-col gap-5 *:min-w-0 sm:flex-row sm:gap-3 sm:*:flex-1", e),
1064
+ ...a
1065
+ });
1066
+ }
1067
+ function Ia({ children: e = "Save changes", ...a }) {
1068
+ const n = T(Q);
1069
+ return /* @__PURE__ */ t(Z, {
1070
+ type: "submit",
1071
+ variant: "effect",
1072
+ size: "sm",
1073
+ loading: n?.pending,
1074
+ ...a,
1075
+ children: e
1076
+ });
1077
+ }
1078
+ function Oa({ show: e, className: a, ...n }) {
1079
+ const r = T(Q), i = e === "dirty" ? r?.dirty ?? !1 : e, o = /* @__PURE__ */ t("div", {
1080
+ "data-basic-page-footer": "",
1081
+ className: p("flex items-center justify-end gap-3 pr-[calc(1.25rem+2.5px)]", a),
1082
+ ...n
1083
+ });
1084
+ return i === void 0 ? o : /* @__PURE__ */ t(Te, {
1085
+ show: i,
1086
+ gap: "block",
1087
+ clip: !1,
1088
+ children: o
1089
+ });
1090
+ }
1091
+ var La = {
1092
+ stack: "-2.5rem",
1093
+ block: "-0.75rem",
1094
+ fields: "-1.25rem",
1095
+ none: "0px"
1096
+ };
1097
+ function Te({ show: e, clip: a = !0, gap: n = "stack", dividers: r, className: i, ...o }) {
1098
+ const u = M(), c = La[r ? "none" : n], s = C(null), d = C(e !== !0);
1099
+ O(() => {
1100
+ d.current = !0;
1101
+ }, []);
1102
+ const f = () => {
1103
+ a && s.current && (s.current.style.overflow = "hidden");
1104
+ }, l = () => {
1105
+ s.current && (s.current.style.overflow = "");
1106
+ };
1107
+ return e === void 0 ? /* @__PURE__ */ t(A.div, {
1108
+ initial: u ? !1 : {
1109
+ opacity: 0,
1110
+ y: j
1111
+ },
1112
+ animate: {
1113
+ opacity: 1,
1114
+ y: 0
1115
+ },
1116
+ transition: {
1117
+ y: I,
1118
+ opacity: D
1119
+ },
1120
+ className: p(r && se, i),
1121
+ ...o
1122
+ }) : /* @__PURE__ */ t($, {
1123
+ initial: !1,
1124
+ children: e ? /* @__PURE__ */ t(A.div, {
1125
+ "data-basic-page-reveal": "",
1126
+ ref: (m) => {
1127
+ s.current = m, a && m && d.current && (m.style.overflow = "hidden");
1128
+ },
1129
+ onAnimationStart: f,
1130
+ onAnimationComplete: l,
1131
+ initial: {
1132
+ height: 0,
1133
+ opacity: 0,
1134
+ marginTop: c
1135
+ },
1136
+ animate: {
1137
+ height: "auto",
1138
+ opacity: 1,
1139
+ marginTop: 0
1140
+ },
1141
+ exit: {
1142
+ height: 0,
1143
+ opacity: 0,
1144
+ marginTop: c
1145
+ },
1146
+ transition: u ? { duration: 0 } : {
1147
+ height: I,
1148
+ marginTop: I,
1149
+ opacity: D
1150
+ },
1151
+ className: p(r && se, i),
1152
+ ...o
1153
+ }) : null
1154
+ });
1155
+ }
1156
+ var Ba = "top-4 left-5 h-8 text-base [&>svg]:size-[1.125em] [&>svg]:shrink-0", Ma = "(min-width: 40rem)";
1157
+ function Da() {
1158
+ return typeof window < "u" && typeof window.matchMedia == "function" && !window.matchMedia(Ma).matches;
1159
+ }
1160
+ var at = z(null);
1161
+ function nt({ className: e, children: a, ...n }) {
1162
+ const r = ee.toArray(a).filter(Ve), i = r.map((_) => _.props.children ?? null), o = Xe();
1163
+ Kt(i);
1164
+ const [u] = w(Da), c = M(), s = r.length, d = Ge(), f = !u && s >= Ha, l = T(_e), m = s > 0 ? r[s - 1]?.props : null, h = m?.children ?? "Back", g = m?.href, b = m?.onClick;
1165
+ H(() => {
1166
+ if (!(l == null || g == null))
1167
+ return l.setTail({
1168
+ label: h,
1169
+ href: g,
1170
+ onClick: b
1171
+ }), () => l.setTail(null);
1172
+ }, [
1173
+ l,
1174
+ h,
1175
+ g,
1176
+ b
1177
+ ]);
1178
+ const [N, v] = w(!c && !u && o != null && o.labels.length > s);
1179
+ return /* @__PURE__ */ t("nav", {
1180
+ "aria-label": "Breadcrumb",
1181
+ "data-basic-page-back": "",
1182
+ className: p("absolute top-4 left-3 flex min-w-max items-center", e),
1183
+ ...n,
1184
+ children: /* @__PURE__ */ y("ol", {
1185
+ className: "m-0 flex list-none items-center p-0",
1186
+ children: [r.map((_, x) => f && x > 0 && x < s - 2 ? null : /* @__PURE__ */ y(Et, { children: [f && x === s - 2 && /* @__PURE__ */ y("li", {
1187
+ className: "m-0 flex items-center max-sm:hidden",
1188
+ children: [/* @__PURE__ */ t("span", {
1189
+ "aria-hidden": !0,
1190
+ className: he,
1191
+ children: oe
1192
+ }), /* @__PURE__ */ y(K.Root, { children: [/* @__PURE__ */ t(K.Trigger, { render: /* @__PURE__ */ t(Z, {
1193
+ variant: "ghost",
1194
+ size: "sm",
1195
+ "aria-label": "Hidden pages",
1196
+ className: "px-2",
1197
+ children: Fa
1198
+ }) }), /* @__PURE__ */ t(K.Portal, { children: /* @__PURE__ */ t(K.Positioner, {
1199
+ align: "start",
1200
+ sideOffset: 4,
1201
+ children: /* @__PURE__ */ t(K.Popup, { children: r.slice(1, s - 2).map((E, R) => {
1202
+ const P = E.props;
1203
+ return /* @__PURE__ */ t(K.LinkItem, {
1204
+ render: /* @__PURE__ */ t(d, {
1205
+ href: P.href,
1206
+ onClick: P.onClick
1207
+ }),
1208
+ children: P.children ?? "Back"
1209
+ }, E.key ?? R);
1210
+ }) })
1211
+ }) })] })]
1212
+ }), /* @__PURE__ */ t("li", {
1213
+ className: p("m-0 flex items-center", x < s - 1 && "max-sm:hidden"),
1214
+ children: /* @__PURE__ */ t(at.Provider, {
1215
+ value: {
1216
+ index: x,
1217
+ count: s,
1218
+ departing: o,
1219
+ narrow: u
1220
+ },
1221
+ children: _
1222
+ })
1223
+ })] }, _.key ?? x)), N && /* @__PURE__ */ t("li", {
1224
+ "aria-hidden": !0,
1225
+ className: "m-0 flex items-center max-sm:hidden",
1226
+ children: /* @__PURE__ */ t(A.span, {
1227
+ initial: { opacity: 1 },
1228
+ animate: { opacity: 0 },
1229
+ transition: Ke,
1230
+ onAnimationComplete: () => v(!1),
1231
+ className: he,
1232
+ children: oe
1233
+ })
1234
+ })]
1235
+ })
1236
+ });
1237
+ }
1238
+ var he = "text-pho-description -mx-1 inline-flex shrink-0 text-base select-none", oe = "/", Ha = 4, Fa = "…";
1239
+ function rt({ href: e, className: a, morphId: n, children: r = "Back", ...i }) {
1240
+ const o = T(at), u = M(), c = n != null && !u, s = Qe(c ? n : void 0);
1241
+ if (o == null) throw new Error("BasicPage.Crumb must be rendered inside BasicPage.Breadcrumbs");
1242
+ const { index: d, count: f, departing: l, narrow: m } = o, h = d === 0, g = d === f - 1, b = l != null && l.labels.length < f, N = l != null && l.labels.length > f, v = g && (l == null || b || m), _ = h || g, x = h && g ? "" : h ? "max-sm:hidden" : "sm:hidden", E = l != null, R = g ? m ? N ? "slide" : "fade" : v ? "fade" : void 0 : void 0, [P, F] = w(c && m && s.fly && l != null && !N ? l.labels[l.labels.length - 1] : null), G = c && _ && !E, Y = c && !h && g && (l == null || b);
1243
+ return /* @__PURE__ */ y(we, { children: [!h && /* @__PURE__ */ t("span", {
1244
+ "aria-hidden": !0,
1245
+ className: p(he, "max-sm:hidden"),
1246
+ children: Y ? /* @__PURE__ */ t(A.span, {
1247
+ initial: s.fly ? {
1248
+ opacity: 0,
1249
+ x: Le
1250
+ } : { opacity: 0 },
1251
+ animate: s.fly ? {
1252
+ opacity: 1,
1253
+ x: 0
1254
+ } : { opacity: 1 },
1255
+ transition: s.fly ? Be : D,
1256
+ className: "inline-flex",
1257
+ children: oe
1258
+ }) : oe
1259
+ }), /* @__PURE__ */ t(ge, {
1260
+ variant: "ghost",
1261
+ size: "sm",
1262
+ href: e,
1263
+ prefix: _ ? G ? /* @__PURE__ */ t(A.span, {
1264
+ initial: s.fly ? {
1265
+ opacity: 0,
1266
+ x: Le
1267
+ } : { opacity: 0 },
1268
+ animate: s.fly ? {
1269
+ opacity: 1,
1270
+ x: 0
1271
+ } : { opacity: 1 },
1272
+ transition: s.fly ? Be : D,
1273
+ className: p("inline-flex [&>svg]:size-[1.125em] [&>svg]:shrink-0", x),
1274
+ children: /* @__PURE__ */ t(ie, {})
1275
+ }) : /* @__PURE__ */ t("span", {
1276
+ className: p("inline-flex [&>svg]:size-[1.125em] [&>svg]:shrink-0", x),
1277
+ children: /* @__PURE__ */ t(ie, {})
1278
+ }) : /* @__PURE__ */ t("span", { className: "hidden" }),
1279
+ className: p("min-w-max", a),
1280
+ ...i,
1281
+ children: c && n != null ? /* @__PURE__ */ y("span", {
1282
+ className: p("relative block", !s.fly && R === "slide" && "overflow-hidden", !g && "max-w-40 truncate"),
1283
+ children: [/* @__PURE__ */ t(Ye, {
1284
+ morphId: n,
1285
+ fromClassName: "text-pho-primary",
1286
+ fly: s.fly,
1287
+ morphRef: s.ref,
1288
+ arrival: R,
1289
+ children: r
1290
+ }), P != null && /* @__PURE__ */ t(A.span, {
1291
+ "aria-hidden": !0,
1292
+ initial: {
1293
+ x: 0,
1294
+ opacity: 1
1295
+ },
1296
+ animate: {
1297
+ x: qt,
1298
+ opacity: 0
1299
+ },
1300
+ transition: Wt,
1301
+ onAnimationComplete: () => F(null),
1302
+ className: "pointer-events-none absolute inset-y-0 left-0 whitespace-nowrap",
1303
+ children: P
1304
+ })]
1305
+ }) : /* @__PURE__ */ t("span", {
1306
+ className: p("block", !g && "max-w-40 truncate"),
1307
+ children: r
1308
+ })
1309
+ })] });
1310
+ }
1311
+ function za({ className: e, ...a }) {
1312
+ return /* @__PURE__ */ t(nt, {
1313
+ className: e,
1314
+ children: /* @__PURE__ */ t(rt, { ...a })
1315
+ });
1316
+ }
1317
+ function Ga({ label: e, description: a, leading: n, href: r, className: i, children: o, ...u }) {
1318
+ const c = Ge(), s = q(() => A.create(c), [c]), { leaving: d, ...f } = ke();
1319
+ return /* @__PURE__ */ y(s, {
1320
+ href: r,
1321
+ ...f,
1322
+ ...u,
1323
+ className: p("flex min-h-[4.25rem] min-w-0 flex-row items-center justify-between gap-6 px-5 py-4", "group outline-pho-brand hover:bg-pho-primary-hover cursor-pointer transition-colors focus-visible:outline-2 focus-visible:-outline-offset-2", "aria-[current=page]:bg-pho-primary-hover", "first:rounded-t-[calc(var(--radius-base)-1px)] last:rounded-b-[calc(var(--radius-base)-1px)]", d && "overflow-hidden", i),
1324
+ children: [/* @__PURE__ */ y("div", {
1325
+ className: p("flex min-w-0 flex-1 items-center", n != null && "gap-3"),
1326
+ children: [n, /* @__PURE__ */ y("div", {
1327
+ className: "min-w-0",
1328
+ children: [/* @__PURE__ */ t("div", {
1329
+ className: "flex min-w-0 items-center gap-1",
1330
+ children: typeof e == "string" || typeof e == "number" ? /* @__PURE__ */ t("p", {
1331
+ className: "text-pho-primary truncate text-base font-medium",
1332
+ children: e
1333
+ }) : e
1334
+ }), a ? /* @__PURE__ */ t("div", {
1335
+ className: "text-pho-description truncate text-xs",
1336
+ children: a
1337
+ }) : null]
1338
+ })]
1339
+ }), /* @__PURE__ */ y("div", {
1340
+ className: "flex min-w-0 items-center justify-end gap-2",
1341
+ children: [o != null ? /* @__PURE__ */ t("div", {
1342
+ className: "min-w-0",
1343
+ children: o
1344
+ }) : null, /* @__PURE__ */ t(gt, {
1345
+ "aria-hidden": !0,
1346
+ className: "text-pho-secondary group-hover:text-pho-secondary-hover size-4 shrink-0 transition-colors"
1347
+ })]
1348
+ })]
1349
+ });
1350
+ }
1351
+ function Va({ open: e, variant: a = "overlay", modal: n = !1, placeholder: r, onClose: i, width: o = "default", presentation: u, defaultPresentation: c, onPresentationChange: s, expandable: d = !0, children: f }) {
1352
+ const l = T(We), m = l != null ? Lt(l.paneWidth, o) : 0, h = e ?? ee.toArray(f).length > 0, { presentation: g, setPresentation: b, canChoose: N } = $a({
1353
+ isOpen: h,
1354
+ paneNarrow: l?.paneNarrow ?? !1,
1355
+ presentation: u,
1356
+ defaultPresentation: c,
1357
+ onPresentationChange: s
1358
+ }), v = l?.setOpen, _ = l?.setAsPage, x = l?.setPresent;
1359
+ if (H(() => {
1360
+ if (x != null)
1361
+ return x(!0), () => x(!1);
1362
+ }, [x]), H(() => {
1363
+ if (v != null)
1364
+ return v(h), () => v(!1);
1365
+ }, [v, h]), H(() => {
1366
+ if (_ != null)
1367
+ return _(g === "page"), () => _(!1);
1368
+ }, [_, g]), O(() => {
1369
+ l == null && typeof process < "u" && process.env.NODE_ENV !== "production" && console.warn("BasicPage.Aside: needs a `BasicPage.Root` around it.");
1370
+ }, [l]), l == null || l.slot == null) return null;
1371
+ const E = d && N ? () => b("page") : void 0;
1372
+ if (g === "page") {
1373
+ const R = d && N && !l.paneNarrow ? () => b("panel") : void 0;
1374
+ return Pe(h ? /* @__PURE__ */ y("div", {
1375
+ "data-basic-page-aside": "page",
1376
+ "data-basic-page-aside-expanded": l.paneNarrow ? void 0 : "",
1377
+ className: "relative flex min-w-0 flex-1 flex-col",
1378
+ children: [R != null ? /* @__PURE__ */ t("span", {
1379
+ className: "absolute top-2 right-2 z-30",
1380
+ children: /* @__PURE__ */ t(W.Provider, { children: /* @__PURE__ */ t(st, {
1381
+ label: "Show as panel",
1382
+ icon: /* @__PURE__ */ t(ht, {}),
1383
+ onClick: R
1384
+ }) })
1385
+ }) : null, f]
1386
+ }) : null, l.slot);
1387
+ }
1388
+ return a === "inline" ? Pe(/* @__PURE__ */ t(qa, {
1389
+ width: m,
1390
+ paneHeight: l.paneHeight,
1391
+ onClose: i,
1392
+ onExpand: E,
1393
+ open: h,
1394
+ placeholder: r,
1395
+ children: f
1396
+ }), l.slot) : /* @__PURE__ */ t(Wa, {
1397
+ container: l.slot,
1398
+ width: m,
1399
+ paneHeight: l.paneHeight,
1400
+ onClose: i,
1401
+ onExpand: E,
1402
+ open: h,
1403
+ modal: n,
1404
+ children: f
1405
+ });
1406
+ }
1407
+ function $a({ isOpen: e, paneNarrow: a, presentation: n, defaultPresentation: r, onPresentationChange: i }) {
1408
+ const [o, u] = w(e), [c, s] = w(null);
1409
+ H(() => {
1410
+ e || (u(!1), s(null));
1411
+ }, [e]);
1412
+ const d = n != null;
1413
+ return {
1414
+ presentation: a ? "page" : n ?? c ?? r ?? (o ? "page" : "panel"),
1415
+ setPresentation: ye((f) => {
1416
+ d || s(f), i?.(f);
1417
+ }, [d, i]),
1418
+ canChoose: !d || i != null
1419
+ };
1420
+ }
1421
+ function it() {
1422
+ const [e, a] = w(null), n = q(() => ({ setBack: a }), []), r = C(null);
1423
+ return {
1424
+ back: e,
1425
+ panel: n,
1426
+ closeRef: r,
1427
+ leave: ye(() => {
1428
+ const i = r.current?.querySelector("a, button");
1429
+ return i == null ? !1 : (i.click(), !0);
1430
+ }, [])
1431
+ };
1432
+ }
1433
+ var Fe = {
1434
+ variant: "ghost",
1435
+ size: "sm",
1436
+ svgOnly: !0,
1437
+ "aria-label": "Close",
1438
+ children: /* @__PURE__ */ t(xt, {})
1439
+ };
1440
+ function st({ label: e, icon: a, onClick: n }) {
1441
+ return /* @__PURE__ */ y(W.Root, { children: [/* @__PURE__ */ t(W.Trigger, { render: /* @__PURE__ */ t(Z, {
1442
+ variant: "ghost",
1443
+ size: "sm",
1444
+ svgOnly: !0,
1445
+ "aria-label": e,
1446
+ onClick: n,
1447
+ children: a
1448
+ }) }), /* @__PURE__ */ t(W.Portal, { children: /* @__PURE__ */ t(W.Positioner, { children: /* @__PURE__ */ t(W.Popup, { children: e }) }) })] });
1449
+ }
1450
+ function lt({ back: e, onClose: a, onExpand: n, closeRef: r, panel: i, children: o }) {
1451
+ return /* @__PURE__ */ y(we, { children: [/* @__PURE__ */ y("span", {
1452
+ className: "absolute top-2 right-2 z-30 flex items-center gap-0.5",
1453
+ children: [n != null ? /* @__PURE__ */ t(W.Provider, { children: /* @__PURE__ */ t(st, {
1454
+ label: "Expand",
1455
+ icon: /* @__PURE__ */ t(ft, {}),
1456
+ onClick: n
1457
+ }) }) : null, /* @__PURE__ */ t("span", {
1458
+ ref: r,
1459
+ className: "contents",
1460
+ children: e != null ? /* @__PURE__ */ t(ge, {
1461
+ ...Fe,
1462
+ href: e.href,
1463
+ onClick: e.onClick
1464
+ }) : a != null ? /* @__PURE__ */ t(Z, {
1465
+ ...Fe,
1466
+ onClick: a
1467
+ }) : null
1468
+ })]
1469
+ }), /* @__PURE__ */ y(J.Root, {
1470
+ className: "min-h-0 flex-1",
1471
+ children: [/* @__PURE__ */ t(J.Viewport, { children: /* @__PURE__ */ t(J.Content, {
1472
+ className: "flex min-h-full flex-col",
1473
+ children: /* @__PURE__ */ t(je.Provider, {
1474
+ value: i,
1475
+ children: o
1476
+ })
1477
+ }) }), /* @__PURE__ */ t(J.Scrollbar, { children: /* @__PURE__ */ t(J.Thumb, {}) })]
1478
+ })] });
1479
+ }
1480
+ function qa({ width: e, paneHeight: a, onClose: n, onExpand: r, open: i, placeholder: o, children: u }) {
1481
+ const c = M(), { back: s, panel: d, closeRef: f, leave: l } = it(), m = c ? "blur(0px)" : `blur(${ve}px)`, h = a ?? "100dvh";
1482
+ O(() => {
1483
+ const b = (N) => {
1484
+ N.key !== "Escape" || N.defaultPrevented || l() && N.preventDefault();
1485
+ };
1486
+ return document.addEventListener("keydown", b), () => document.removeEventListener("keydown", b);
1487
+ }, [l]);
1488
+ const g = {
1489
+ initial: {
1490
+ opacity: 0,
1491
+ filter: m
1492
+ },
1493
+ animate: {
1494
+ opacity: 1,
1495
+ filter: "blur(0px)"
1496
+ },
1497
+ exit: {
1498
+ opacity: 0,
1499
+ filter: m
1500
+ },
1501
+ transition: c ? { duration: 0 } : le
1502
+ };
1503
+ return /* @__PURE__ */ t("aside", {
1504
+ "data-basic-page-aside": "panel",
1505
+ "data-basic-page-aside-variant": "inline",
1506
+ className: "relative flex shrink-0 flex-col",
1507
+ style: {
1508
+ width: e,
1509
+ minHeight: h
1510
+ },
1511
+ children: /* @__PURE__ */ t("div", {
1512
+ className: "border-pho-secondary bg-pho-primary sticky top-0 grid border-l *:min-h-0 *:[grid-area:1/1]",
1513
+ style: { height: h },
1514
+ children: /* @__PURE__ */ t($, {
1515
+ initial: !1,
1516
+ children: i ? /* @__PURE__ */ t(A.div, {
1517
+ ...g,
1518
+ className: "relative flex flex-col",
1519
+ children: /* @__PURE__ */ t(lt, {
1520
+ back: s,
1521
+ onClose: n,
1522
+ onExpand: r,
1523
+ closeRef: f,
1524
+ panel: d,
1525
+ children: u
1526
+ })
1527
+ }, "page") : /* @__PURE__ */ t(A.div, {
1528
+ ...g,
1529
+ className: "flex flex-col",
1530
+ children: o
1531
+ }, "empty")
1532
+ })
1533
+ })
1534
+ });
1535
+ }
1536
+ function Wa({ container: e, width: a, paneHeight: n, onClose: r, onExpand: i, open: o, modal: u, children: c }) {
1537
+ const { back: s, panel: d, closeRef: f, leave: l } = it(), m = n ?? "100dvh";
1538
+ return /* @__PURE__ */ t(ne.Root, {
1539
+ open: o,
1540
+ modal: u ? "trap-focus" : !1,
1541
+ disablePointerDismissal: !0,
1542
+ onOpenChange: (h, g) => {
1543
+ h || (g.cancel(), l());
1544
+ },
1545
+ children: /* @__PURE__ */ y(ne.Portal, {
1546
+ container: e,
1547
+ className: "contents",
1548
+ children: [u ? /* @__PURE__ */ t(ne.Backdrop, {
1549
+ "data-basic-page-aside-backdrop": "",
1550
+ className: p("bg-pho-overlay absolute inset-0 z-30 transition-opacity duration-200 ease-out motion-reduce:transition-none", "data-[ending-style]:opacity-0 data-[starting-style]:opacity-0"),
1551
+ onClick: l
1552
+ }) : null, /* @__PURE__ */ t(ne.Popup, {
1553
+ "data-basic-page-aside": "panel",
1554
+ "data-basic-page-aside-variant": "overlay",
1555
+ initialFocus: u ? void 0 : !1,
1556
+ finalFocus: u ? void 0 : !1,
1557
+ className: p("absolute inset-y-0 right-0 z-30 flex flex-col outline-none", "transition-[translate,opacity] duration-250 ease-out motion-reduce:transition-none", "data-[ending-style]:translate-x-3 data-[ending-style]:opacity-0 data-[ending-style]:duration-200 data-[starting-style]:translate-x-3 data-[starting-style]:opacity-0"),
1558
+ style: { width: a },
1559
+ children: /* @__PURE__ */ t("div", {
1560
+ className: "border-pho-secondary bg-pho-primary shadow-pho-xl sticky top-0 flex flex-col border-l",
1561
+ style: { height: m },
1562
+ children: /* @__PURE__ */ t(lt, {
1563
+ back: s,
1564
+ onClose: r,
1565
+ onExpand: i,
1566
+ closeRef: f,
1567
+ panel: d,
1568
+ children: c
1569
+ })
1570
+ })
1571
+ })]
1572
+ })
1573
+ });
1574
+ }
1575
+ var ja = "14rem", Ka = "transition-[width] duration-[330ms] ease-pho-spring motion-reduce:transition-none", ze = "transition-[opacity,visibility] duration-200 ease-out motion-reduce:transition-none";
1576
+ function Xa({ variant: e = "box", fold: a = "auto", value: n, onValueChange: r, placeholder: i, label: o, className: u, ...c }) {
1577
+ const s = T(be), d = xe(s?.subscribe ?? Ce, () => s?.get().api ?? null, () => null), f = n != null;
1578
+ O(() => {
1579
+ if (!(s == null || f))
1580
+ return s.adopt(!0), () => s.adopt(!1);
1581
+ }, [s, f]);
1582
+ const l = f ? {
1583
+ query: n,
1584
+ setQuery: r,
1585
+ placeholder: i ?? "Search",
1586
+ label: o ?? i ?? "Search"
1587
+ } : d == null ? null : {
1588
+ query: d.query,
1589
+ setQuery: d.setQuery,
1590
+ placeholder: d.placeholder,
1591
+ label: o ?? d.placeholder
1592
+ }, [m, h] = w(!1), g = C(null), b = m || (l?.query ?? "") !== "";
1593
+ if (O(() => {
1594
+ if (!m) return;
1595
+ let v = 0, _ = 0;
1596
+ const x = () => {
1597
+ const E = g.current;
1598
+ E != null && (E.focus(), document.activeElement !== E && _++ < 5 && (v = requestAnimationFrame(x)));
1599
+ };
1600
+ return v = requestAnimationFrame(x), () => cancelAnimationFrame(v);
1601
+ }, [m]), e === "ghost") return /* @__PURE__ */ t("div", {
1602
+ "data-basic-page-search": "",
1603
+ "data-variant": "ghost",
1604
+ className: p("flex min-w-0 flex-1", l == null && "hidden", u),
1605
+ ...c,
1606
+ children: l != null && /* @__PURE__ */ t(Ct, {
1607
+ value: l.query,
1608
+ onChange: l.setQuery,
1609
+ placeholder: l.placeholder,
1610
+ "aria-label": l.label,
1611
+ onKeyDown: (v) => {
1612
+ v.key === "Escape" && (v.preventDefault(), l.setQuery(""), v.currentTarget.blur());
1613
+ }
1614
+ })
1615
+ });
1616
+ const N = a === "auto";
1617
+ return /* @__PURE__ */ t("div", {
1618
+ "data-basic-page-search": "",
1619
+ "data-expanded": b || void 0,
1620
+ className: p("grid min-w-0 content-center", "[[data-basic-page-header]>&]:col-start-2 [[data-basic-page-header]>&]:row-span-2 [[data-basic-page-header]>&]:row-start-1 [[data-basic-page-header]>&]:ml-4 [[data-basic-page-header]>&]:justify-items-end [[data-basic-page-header]>&]:self-start", l == null && "hidden", u),
1621
+ ...c,
1622
+ children: l != null && /* @__PURE__ */ y("div", {
1623
+ className: p("grid w-9 max-w-full justify-items-end *:[grid-area:1/1]", Ka, N && "@[36rem]:w-56"),
1624
+ style: b ? { width: ja } : void 0,
1625
+ children: [/* @__PURE__ */ t(Z, {
1626
+ variant: "outlined",
1627
+ size: "sm",
1628
+ shape: "circle",
1629
+ svgOnly: !0,
1630
+ "aria-label": l.label,
1631
+ "aria-hidden": b || void 0,
1632
+ tabIndex: b ? -1 : void 0,
1633
+ onClick: () => h(!0),
1634
+ className: p(ze, b ? "pointer-events-none invisible opacity-0" : "visible opacity-100", N && "@[36rem]:pointer-events-none @[36rem]:invisible @[36rem]:opacity-0"),
1635
+ children: /* @__PURE__ */ t(Re, {})
1636
+ }), /* @__PURE__ */ t("div", {
1637
+ inert: !N && !b,
1638
+ className: p("w-full min-w-0", ze, b ? "visible opacity-100" : "pointer-events-none invisible opacity-0", N && "@[36rem]:pointer-events-auto @[36rem]:visible @[36rem]:opacity-100"),
1639
+ children: /* @__PURE__ */ y(ue.Root, {
1640
+ size: "sm",
1641
+ className: "w-full",
1642
+ children: [/* @__PURE__ */ t(ue.Addon, { children: /* @__PURE__ */ t(Re, {}) }), /* @__PURE__ */ t(ue.Input, {
1643
+ ref: g,
1644
+ type: "search",
1645
+ value: l.query,
1646
+ onChange: (v) => l.setQuery(v.target.value),
1647
+ onBlur: () => {
1648
+ l.query === "" && h(!1);
1649
+ },
1650
+ onKeyDown: (v) => {
1651
+ v.key === "Escape" && (v.preventDefault(), l.setQuery(""), h(!1), v.currentTarget.blur());
1652
+ },
1653
+ placeholder: l.placeholder,
1654
+ "aria-label": l.label
1655
+ })]
1656
+ })
1657
+ })]
1658
+ })
1659
+ });
1660
+ }
1661
+ function Qa({ header: e, main: a, side: n, foot: r, enter: i }) {
1662
+ const o = n != null;
1663
+ return /* @__PURE__ */ t("div", {
1664
+ "data-basic-page-columns": "",
1665
+ className: "@container w-full min-w-0",
1666
+ children: /* @__PURE__ */ y("div", {
1667
+ className: p("mx-auto w-full max-w-[42rem]", o && "@min-[73.5rem]:max-w-none"),
1668
+ children: [e, /* @__PURE__ */ y("div", {
1669
+ className: p("grid gap-x-10 gap-y-4", o && "@min-[73.5rem]:grid-cols-[minmax(42rem,1fr)_minmax(29rem,32rem)] @min-[73.5rem]:grid-rows-[auto_minmax(0,1fr)]", o && "[&>[data-basic-page-columns-side]]:mt-6 @min-[73.5rem]:[&>[data-basic-page-columns-side]]:mt-7", r != null && "[&>[data-basic-page-columns-foot]]:mt-6"),
1670
+ children: [
1671
+ /* @__PURE__ */ t(re, {
1672
+ enter: i,
1673
+ "data-basic-page-columns-main": "",
1674
+ className: p("[[data-basic-page-stack]>[data-basic-page-columns]_&]:mt-0", o && "@min-[73.5rem]:col-start-1 @min-[73.5rem]:row-span-2 @min-[73.5rem]:row-start-1"),
1675
+ children: a
1676
+ }),
1677
+ o ? /* @__PURE__ */ t(re, {
1678
+ enter: i,
1679
+ "data-basic-page-columns-side": "",
1680
+ className: p("[[data-basic-page-stack]>[data-basic-page-columns]_&]:mt-0", "@min-[73.5rem]:col-start-2 @min-[73.5rem]:row-start-1"),
1681
+ children: n
1682
+ }) : null,
1683
+ r != null ? /* @__PURE__ */ t(re, {
1684
+ enter: i,
1685
+ "data-basic-page-columns-foot": "",
1686
+ className: p("[[data-basic-page-stack]>[data-basic-page-columns]_&]:mt-0", o && "@min-[73.5rem]:col-start-2 @min-[73.5rem]:row-start-2 @min-[73.5rem]:self-start"),
1687
+ children: r
1688
+ }) : null
1689
+ ]
1690
+ })]
1691
+ })
1692
+ });
1693
+ }
1694
+ var kn = {
1695
+ Root: Dt,
1696
+ Aside: Va,
1697
+ Search: Xa,
1698
+ Table: bt,
1699
+ CondenseScope: Xt,
1700
+ Breadcrumbs: nt,
1701
+ Crumb: rt,
1702
+ Back: za,
1703
+ Title: ea,
1704
+ Stack: re,
1705
+ Columns: Qa,
1706
+ Header: sa,
1707
+ HeaderAction: la,
1708
+ SectionTitle: oa,
1709
+ Description: Ze,
1710
+ TableCount: ca,
1711
+ SectionFooter: ua,
1712
+ Card: da,
1713
+ Item: pa,
1714
+ ItemPanel: ma,
1715
+ Callout: fa,
1716
+ CalloutTitle: ha,
1717
+ CalloutDescription: ga,
1718
+ Onboard: ba,
1719
+ Step: Aa,
1720
+ Row: _a,
1721
+ RowLink: Ga,
1722
+ Value: Ca,
1723
+ Alert: Ea,
1724
+ Footer: Oa,
1725
+ Form: ka,
1726
+ Saved: Sa,
1727
+ Fields: Ra,
1728
+ Inline: Pa,
1729
+ Submit: Ia,
1730
+ Reveal: Te
1731
+ };
1732
+ export {
1733
+ Pt as a,
1734
+ kn as c,
1735
+ Qt as d,
1736
+ me as f,
1737
+ Rt as i,
1738
+ le as l,
1739
+ _n as m,
1740
+ Ie as n,
1741
+ It as o,
1742
+ Cn as p,
1743
+ $e as r,
1744
+ Tt as s,
1745
+ En as t,
1746
+ Yt as u
1747
+ };
1748
+
1749
+ //# sourceMappingURL=basic-page-CYDwfVjO.js.map