@photon-ai/pho-ui 4.11.0 → 4.13.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 (71) hide show
  1. package/dist/chunks/animated-height-zr7BmFY1.js +56 -0
  2. package/dist/chunks/animated-height-zr7BmFY1.js.map +1 -0
  3. package/dist/chunks/basic-page-6dDfY33L.js +2197 -0
  4. package/dist/chunks/basic-page-6dDfY33L.js.map +1 -0
  5. package/dist/chunks/box-search-C9EVZgcb.js +56 -0
  6. package/dist/chunks/box-search-C9EVZgcb.js.map +1 -0
  7. package/dist/chunks/{chat-B0WIgEyM.js → chat-Bu8UyIbT.js} +207 -205
  8. package/dist/chunks/chat-Bu8UyIbT.js.map +1 -0
  9. package/dist/chunks/{checkbox-CLPmblNA.js → checkbox-CwvoEJhd.js} +2 -2
  10. package/dist/chunks/{checkbox-CLPmblNA.js.map → checkbox-CwvoEJhd.js.map} +1 -1
  11. package/dist/chunks/choice-card-_Ocs0iUj.js +17 -0
  12. package/dist/chunks/choice-card-_Ocs0iUj.js.map +1 -0
  13. package/dist/chunks/chrome-Ds7WykBJ.js +14 -0
  14. package/dist/chunks/chrome-Ds7WykBJ.js.map +1 -0
  15. package/dist/chunks/{command-iYvU6Mhf.js → command-D5g49VqR.js} +3 -3
  16. package/dist/chunks/{command-iYvU6Mhf.js.map → command-D5g49VqR.js.map} +1 -1
  17. package/dist/chunks/{data-table-B1dmrN6r.js → data-table-hzZb7Otx.js} +58 -56
  18. package/dist/chunks/{data-table-B1dmrN6r.js.map → data-table-hzZb7Otx.js.map} +1 -1
  19. package/dist/chunks/{dialog-MPvem7yV.js → dialog-ChS0tdHa.js} +120 -116
  20. package/dist/chunks/dialog-ChS0tdHa.js.map +1 -0
  21. package/dist/chunks/{filter-bar-B-oYYBsU.js → filter-bar-C4sPEjw1.js} +63 -66
  22. package/dist/chunks/filter-bar-C4sPEjw1.js.map +1 -0
  23. package/dist/chunks/ghost-search-8PzP73zS.js +50 -0
  24. package/dist/chunks/ghost-search-8PzP73zS.js.map +1 -0
  25. package/dist/chunks/{input-DjvZoF8v.js → input-fFWvPJOf.js} +2 -1
  26. package/dist/chunks/{input-DjvZoF8v.js.map → input-fFWvPJOf.js.map} +1 -1
  27. package/dist/chunks/{trace-D1fOFzJt.js → trace-DyjsBY-S.js} +15 -13
  28. package/dist/chunks/{trace-D1fOFzJt.js.map → trace-DyjsBY-S.js.map} +1 -1
  29. package/dist/components/chat.js +1 -1
  30. package/dist/components/checkbox.js +1 -1
  31. package/dist/components/command.js +1 -1
  32. package/dist/components/data-table.js +4 -3
  33. package/dist/components/dialog.js +1 -1
  34. package/dist/components/field.js +34 -29
  35. package/dist/components/field.js.map +1 -1
  36. package/dist/components/filter-bar.js +1 -1
  37. package/dist/components/input.js +1 -1
  38. package/dist/components/radio-group.js +64 -59
  39. package/dist/components/radio-group.js.map +1 -1
  40. package/dist/components/scope.js +418 -0
  41. package/dist/components/scope.js.map +1 -0
  42. package/dist/components/trace.js +1 -1
  43. package/dist/index.js +176 -175
  44. package/dist/motion.js +61 -36
  45. package/dist/motion.js.map +1 -1
  46. package/dist/sections/basic-page.js +2 -2
  47. package/dist/src/components/chat/chat.d.ts +7 -4
  48. package/dist/src/components/dialog/dialog.d.ts +9 -1
  49. package/dist/src/components/field/field.d.ts +11 -1
  50. package/dist/src/components/input-group/box-search.d.ts +29 -0
  51. package/dist/src/components/radio-group/radio-card.d.ts +11 -4
  52. package/dist/src/components/scope/index.d.ts +1 -0
  53. package/dist/src/components/scope/scope.d.ts +98 -0
  54. package/dist/src/motion/index.d.ts +52 -0
  55. package/dist/src/sections/basic-page/basic-page.d.ts +145 -15
  56. package/dist/src/sections/basic-page/index.d.ts +1 -1
  57. package/dist/src/utils/animated-height.d.ts +16 -7
  58. package/dist/src/utils/choice-card.d.ts +8 -1
  59. package/dist/src/utils/ghost-search.d.ts +19 -3
  60. package/package.json +5 -1
  61. package/dist/chunks/animated-height-I44sUq0n.js +0 -48
  62. package/dist/chunks/animated-height-I44sUq0n.js.map +0 -1
  63. package/dist/chunks/basic-page-B5FsORRi.js +0 -1885
  64. package/dist/chunks/basic-page-B5FsORRi.js.map +0 -1
  65. package/dist/chunks/chat-B0WIgEyM.js.map +0 -1
  66. package/dist/chunks/choice-card-BVNP1NB6.js +0 -17
  67. package/dist/chunks/choice-card-BVNP1NB6.js.map +0 -1
  68. package/dist/chunks/dialog-MPvem7yV.js.map +0 -1
  69. package/dist/chunks/filter-bar-B-oYYBsU.js.map +0 -1
  70. package/dist/chunks/ghost-search-CNVs9k1o.js +0 -34
  71. package/dist/chunks/ghost-search-CNVs9k1o.js.map +0 -1
@@ -0,0 +1,2197 @@
1
+ "use client";
2
+ import { t as u } from "./cn-ChIgwEl3.js";
3
+ import { n as Ze } from "./link-provider-DXzDQ08N.js";
4
+ import { FADE_ENTRANCE as Ma, FADE_SWAP as Da, SPRING_ENTRANCE as Fa, TRAVEL_LINEAR as Ha, fadeThroughBlur as Q, revealIn as za } from "../motion.js";
5
+ import { a as ne, o as Re } from "./button-C9VqBBIr.js";
6
+ import { t as Ga } from "./error-D5SzZ0ev.js";
7
+ import { f as $a, p as Wa, t as Va } from "./code-block-CbcE994O.js";
8
+ import { t as oe } from "./IconChevronLeft-CSWMKQ4C.js";
9
+ import { t as ja } from "./IconChevronRight-CzoJnYNI.js";
10
+ import { t as qa } from "./IconSearch-BKAHkLyX.js";
11
+ import { a as Ka, n as Xa, r as Se, t as Qa } from "./data-table-hzZb7Otx.js";
12
+ import { t as ea } from "./IconX-pZ9vrtSr.js";
13
+ import { t as Ua } from "./toast-BACxYsv6.js";
14
+ import { n as Ya, t as Ja } from "./animated-height-zr7BmFY1.js";
15
+ import { n as Te, t as te } from "./scroll-area-DSwD9th7.js";
16
+ import { i as aa } from "./checkbox-CwvoEJhd.js";
17
+ import { t as Za } from "./form-AiHbbw4m.js";
18
+ import { i as Y } from "./menu-BQeprfxB.js";
19
+ import { t as et } from "./ghost-search-8PzP73zS.js";
20
+ import { t as X } from "./tooltip-BTF7GChl.js";
21
+ import { t as ze } from "./description-list-8qm83WZB.js";
22
+ import { t as at } from "./box-search-C9EVZgcb.js";
23
+ import { Children as U, Fragment as tt, createContext as B, isValidElement as ce, useCallback as Pe, useContext as k, useEffect as L, useId as Ie, useLayoutEffect as H, useMemo as V, useRef as C, useState as _, useSyncExternalStore as he } from "react";
24
+ import { Fragment as Z, jsx as a, jsxs as b } from "react/jsx-runtime";
25
+ import { AnimatePresence as z, motion as N, useIsPresent as ta, useReducedMotion as I } from "motion/react";
26
+ import { Dialog as se } from "@base-ui/react/dialog";
27
+ import { createPortal as Ge } from "react-dom";
28
+ var ge = "rounded-base border border-pho-secondary bg-pho-primary [--choice-card-inset:0.75rem]", de = "divide-y divide-pho-secondary [&>:has(+[data-basic-page-alert])]:border-b-0", na = `${ge} ${de} gap-0`, $e = "flex min-w-0 flex-col gap-3 rounded-base border border-pho-secondary bg-pho-page p-5 [--choice-card-inset:0.75rem]", nt = "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", it = "-mx-5 -mb-4 flex items-center rounded-b-[calc(0.75rem-1px)] bg-pho-secondary py-1 pr-3 pl-5", st = "-mx-2 -mt-1.5 flex items-center rounded-sm bg-pho-secondary px-2 py-0.5", P = Fa, F = Ma, j = 12, ra = B(null), ia = B(!1), lt = 768;
29
+ function ot(e, t = "default") {
30
+ return Math.round(t === "wide" ? Math.min(Math.max(e * (2 / 3), 448), 768) : Math.min(Math.max(e * 0.4, 320), 448));
31
+ }
32
+ var sa = B(null), la = B(null);
33
+ function ct(e) {
34
+ const [t, n] = _(null), [r, s] = _(!1), [l, c] = _(!1), [p, i] = _(!1), [d, m] = _(() => ({
35
+ width: typeof window > "u" ? 0 : window.innerWidth,
36
+ height: null
37
+ }));
38
+ return H(() => {
39
+ const o = e.current;
40
+ if (!r || o == null) return;
41
+ const h = Be(o), g = () => {
42
+ const y = o.offsetWidth, w = h?.clientHeight ?? null;
43
+ m((f) => f.width === y && f.height === w ? f : {
44
+ width: y,
45
+ height: w
46
+ });
47
+ };
48
+ if (g(), typeof ResizeObserver > "u") return;
49
+ const v = new ResizeObserver(g);
50
+ return v.observe(o), h != null && v.observe(h), () => v.disconnect();
51
+ }, [e, r]), {
52
+ host: V(() => ({
53
+ slot: t,
54
+ paneNarrow: d.width < lt,
55
+ paneWidth: d.width,
56
+ paneHeight: d.height,
57
+ setOpen: c,
58
+ setAsPage: i,
59
+ setPresent: s
60
+ }), [t, d]),
61
+ setSlot: n,
62
+ open: l,
63
+ asPage: p
64
+ };
65
+ }
66
+ function dt(e) {
67
+ return e == null ? window.scrollY : e.scrollTop;
68
+ }
69
+ function We(e, t) {
70
+ e == null ? window.scrollTo({ top: t }) : e.scrollTop = t;
71
+ }
72
+ function ut({ condense: e = !0, width: t, prerendered: n = !1, className: r, children: s, ref: l, ...c }) {
73
+ const p = k(re)?.adopt ?? !1, i = k(la), d = e === "pinned", [m, o] = _(!1), h = C(0), g = Pe((q) => {
74
+ h.current += q ? 1 : -1, o(h.current > 0);
75
+ }, []), v = t === "full" && i == null, y = t === "wide" || t == null && m, [w] = _(Ka), f = C(null), A = V(() => ({
76
+ ref: f,
77
+ prerendered: n
78
+ }), [n]), [x, E] = _(null), [S, O] = _(null);
79
+ L(() => {
80
+ if (i != null)
81
+ return i.setBack(S), () => i.setBack(null);
82
+ }, [i, S]);
83
+ const { host: M, setSlot: D, open: W, asPage: ie } = ct(f), G = W && ie, ye = V(() => ({
84
+ setTitle: E,
85
+ setTail: O,
86
+ pinned: d
87
+ }), [d]), T = V(() => ({
88
+ tail: i == null ? S : null,
89
+ silent: G || i != null
90
+ }), [
91
+ S,
92
+ i,
93
+ G
94
+ ]), R = C(!1), K = C(0);
95
+ H(() => {
96
+ const q = f.current;
97
+ if (G === R.current || q == null) return;
98
+ R.current = G;
99
+ const we = Be(q);
100
+ G ? (K.current = dt(we), We(we, 0)) : We(we, K.current);
101
+ }, [G]);
102
+ const $ = e && !d ? /* @__PURE__ */ a(oa, {
103
+ title: x,
104
+ tail: i == null ? S : null,
105
+ silent: G || i != null
106
+ }) : null, xe = /* @__PURE__ */ a("div", {
107
+ "data-basic-page-column": "",
108
+ className: u("mx-auto flex w-full min-w-0 flex-1 flex-col px-5 pt-12 pb-12 *:min-w-0", i == null && (v ? "px-0 pb-0" : y ? "max-w-[84rem] md:px-8" : "max-w-[44.5rem]"), d ? "pt-0 [&_[data-basic-page-back]]:hidden" : p || i != null ? "[&_[data-basic-page-back]]:hidden" : "has-[[data-basic-page-back]]:pt-16"),
109
+ children: e ? /* @__PURE__ */ a(Le.Provider, {
110
+ value: ye,
111
+ children: /* @__PURE__ */ a(ua.Provider, {
112
+ value: T,
113
+ children: s
114
+ })
115
+ }) : s
116
+ });
117
+ return /* @__PURE__ */ a("div", {
118
+ "data-basic-page-root": "",
119
+ "data-basic-page-width": v ? "full" : y ? "wide" : void 0,
120
+ "data-basic-page-prerendered": n ? "" : void 0,
121
+ "data-basic-page-pinned": d ? "" : void 0,
122
+ className: u("relative flex min-h-full w-full min-w-0 flex-row", r),
123
+ ...c,
124
+ ref: (q) => {
125
+ f.current = q, typeof l == "function" ? l(q) : l != null && (l.current = q);
126
+ },
127
+ children: /* @__PURE__ */ a(ra.Provider, {
128
+ value: A,
129
+ children: /* @__PURE__ */ a(sa.Provider, {
130
+ value: M,
131
+ children: /* @__PURE__ */ a(Xa.Provider, {
132
+ value: g,
133
+ children: /* @__PURE__ */ b(Se.Provider, {
134
+ value: w,
135
+ children: [/* @__PURE__ */ b("div", {
136
+ "data-basic-page-main": "",
137
+ className: u("flex min-w-0 flex-1 flex-col", G && "hidden"),
138
+ children: [$, xe]
139
+ }), /* @__PURE__ */ a("div", {
140
+ ref: D,
141
+ className: "contents"
142
+ })]
143
+ })
144
+ })
145
+ })
146
+ })
147
+ });
148
+ }
149
+ var Ne = /* @__PURE__ */ new Set();
150
+ function oa({ title: e, tail: t, silent: n = !1, pinned: r = !1, className: s }) {
151
+ const l = I(), [c, p] = _(() => r || !n && Ne.size > 0), i = k(re), d = Ie();
152
+ H(() => {
153
+ if (!(!c || n))
154
+ return Ne.add(d), () => {
155
+ Ne.delete(d);
156
+ };
157
+ }, [
158
+ d,
159
+ c,
160
+ n
161
+ ]), L(() => {
162
+ if (i != null) {
163
+ if (n) {
164
+ i.store.clear(d);
165
+ return;
166
+ }
167
+ i.store.set(d, {
168
+ condensed: c,
169
+ title: e?.label ?? null,
170
+ back: t
171
+ });
172
+ }
173
+ }, [
174
+ i,
175
+ d,
176
+ c,
177
+ e,
178
+ t,
179
+ n
180
+ ]), L(() => {
181
+ if (i != null)
182
+ return () => i.store.clear(d);
183
+ }, [i, d]);
184
+ const m = e?.el ?? null;
185
+ L(() => {
186
+ if (r) return;
187
+ if (m == null || typeof IntersectionObserver > "u") {
188
+ if (typeof requestAnimationFrame > "u") return;
189
+ const v = requestAnimationFrame(() => p(!1));
190
+ return () => cancelAnimationFrame(v);
191
+ }
192
+ const g = new IntersectionObserver(([v]) => p(v != null && !v.isIntersecting), { root: Be(m) });
193
+ return g.observe(m), () => g.disconnect();
194
+ }, [m, r]);
195
+ const o = l ? 0 : -_t, h = l ? "blur(0px)" : `blur(${Te}px)`;
196
+ return /* @__PURE__ */ a("div", {
197
+ "data-basic-page-condense": "",
198
+ className: u("sticky top-0 z-20 h-0 overflow-visible", s),
199
+ children: /* @__PURE__ */ a(z, {
200
+ initial: !1,
201
+ children: c && !(i?.adopt ?? !1) && /* @__PURE__ */ b(N.div, {
202
+ initial: { opacity: 0 },
203
+ animate: { opacity: 1 },
204
+ exit: { opacity: 0 },
205
+ transition: ue,
206
+ 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",
207
+ children: [/* @__PURE__ */ a("div", {
208
+ className: "flex min-w-0 items-center justify-start",
209
+ children: t != null && /* @__PURE__ */ a(Re, {
210
+ variant: "ghost",
211
+ size: "sm",
212
+ href: t.href,
213
+ onClick: t.onClick,
214
+ prefix: /* @__PURE__ */ a("span", {
215
+ className: "inline-flex [&>svg]:size-[1.125em] [&>svg]:shrink-0",
216
+ children: /* @__PURE__ */ a(oe, {})
217
+ }),
218
+ className: "min-w-max",
219
+ children: t.label
220
+ })
221
+ }), /* @__PURE__ */ a(N.span, {
222
+ initial: {
223
+ opacity: 0,
224
+ y: o,
225
+ filter: h
226
+ },
227
+ animate: {
228
+ opacity: 1,
229
+ y: 0,
230
+ filter: "blur(0px)"
231
+ },
232
+ exit: {
233
+ opacity: 0,
234
+ y: o,
235
+ filter: h
236
+ },
237
+ transition: {
238
+ ...ue,
239
+ y: Nt
240
+ },
241
+ className: "text-pho-primary block max-w-full min-w-0 truncate text-center text-base font-medium",
242
+ children: e?.label
243
+ })]
244
+ })
245
+ })
246
+ });
247
+ }
248
+ function pt(e) {
249
+ return e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
250
+ }
251
+ function mt(e) {
252
+ if (!(typeof e != "string" && typeof e != "number"))
253
+ return pt(String(e)) || void 0;
254
+ }
255
+ function Oe(e, t) {
256
+ if (e !== "")
257
+ return e ?? mt(t);
258
+ }
259
+ var ft = (e) => `basic-page-morph-${e}`, ht = { layout: P }, Ve = 10, je = {
260
+ delay: 0.2,
261
+ duration: 0.12,
262
+ ease: "easeOut"
263
+ }, gt = {
264
+ duration: 0.18,
265
+ ease: "easeOut"
266
+ }, bt = -8, vt = {
267
+ duration: 0.16,
268
+ ease: "easeOut"
269
+ }, yt = {
270
+ delay: 0.14,
271
+ duration: 0.16,
272
+ ease: "easeOut"
273
+ }, ca = {
274
+ duration: 0.12,
275
+ ease: "easeOut"
276
+ }, J = [];
277
+ function xt(e) {
278
+ const t = C({ labels: e });
279
+ t.current.labels = e, H(() => {
280
+ const n = t.current;
281
+ return J.push(n), () => {
282
+ J.splice(J.indexOf(n), 1);
283
+ };
284
+ }, []);
285
+ }
286
+ function da() {
287
+ const [e] = _(() => {
288
+ const t = J[J.length - 1];
289
+ return t ? { labels: [...t.labels] } : null;
290
+ });
291
+ return e;
292
+ }
293
+ var Le = B(null), ua = B({
294
+ tail: null,
295
+ silent: !1
296
+ }), Ce = {
297
+ condensed: !1,
298
+ title: null,
299
+ back: null
300
+ }, re = B(null), be = () => () => {
301
+ }, qe = () => Ce;
302
+ function wt({ adopt: e = !0, children: t }) {
303
+ const [n] = _(() => {
304
+ let s = Ce, l = null;
305
+ const c = /* @__PURE__ */ new Set(), p = () => {
306
+ for (const i of c) i();
307
+ };
308
+ return {
309
+ get: () => s,
310
+ set(i, d) {
311
+ l = i, s = d, p();
312
+ },
313
+ clear(i) {
314
+ l === i && (l = null, s = Ce, p());
315
+ },
316
+ subscribe(i) {
317
+ return c.add(i), () => c.delete(i);
318
+ }
319
+ };
320
+ }), r = V(() => ({
321
+ store: n,
322
+ adopt: e
323
+ }), [n, e]);
324
+ return /* @__PURE__ */ a(re.Provider, {
325
+ value: r,
326
+ children: t
327
+ });
328
+ }
329
+ function hr() {
330
+ const e = k(re);
331
+ return he(e?.store.subscribe ?? be, e?.store.get ?? qe, e?.store.get ?? qe);
332
+ }
333
+ var ue = Da, Nt = Ha, _t = -8;
334
+ function Be(e) {
335
+ if (typeof getComputedStyle != "function") return null;
336
+ for (let t = e.parentElement; t != null && t !== document.body; t = t.parentElement) {
337
+ const { overflowY: n } = getComputedStyle(t);
338
+ if (n === "auto" || n === "scroll") return t;
339
+ }
340
+ return null;
341
+ }
342
+ var _e = /* @__PURE__ */ new Map(), At = 96;
343
+ function Ct(e) {
344
+ const t = e.closest("[data-basic-page-root]"), n = t?.querySelector("[data-basic-page-column]");
345
+ return !t || !n ? 0 : n.getBoundingClientRect().left - t.getBoundingClientRect().left;
346
+ }
347
+ function pa(e) {
348
+ const [t] = _(() => {
349
+ if (e == null) return !1;
350
+ const r = _e.get(e);
351
+ return r != null && r.visible && r.el.isConnected && Ct(r.el) <= At;
352
+ }), n = C(null);
353
+ return L(() => {
354
+ if (e == null || typeof IntersectionObserver > "u") return;
355
+ const r = n.current;
356
+ if (!r) return;
357
+ const s = new IntersectionObserver(([l]) => {
358
+ l && _e.set(e, {
359
+ visible: l.isIntersecting,
360
+ el: r
361
+ });
362
+ });
363
+ return s.observe(r), () => {
364
+ s.disconnect(), _e.delete(e);
365
+ };
366
+ }, [e]), {
367
+ fly: t,
368
+ ref: n
369
+ };
370
+ }
371
+ var Et = {
372
+ fade: {
373
+ initial: { opacity: 0 },
374
+ animate: { opacity: 1 },
375
+ transition: { opacity: F }
376
+ },
377
+ rise: {
378
+ initial: {
379
+ opacity: 0,
380
+ y: j
381
+ },
382
+ animate: {
383
+ opacity: 1,
384
+ y: 0
385
+ },
386
+ transition: {
387
+ y: P,
388
+ opacity: F
389
+ }
390
+ },
391
+ slide: {
392
+ initial: { x: "-100%" },
393
+ animate: { x: 0 },
394
+ transition: { x: yt }
395
+ }
396
+ };
397
+ function ma({ morphId: e, fromClassName: t, fly: n, morphRef: r, arrival: s, className: l, children: c }) {
398
+ const [p, i] = _(!1), d = !n && s != null ? Et[s] : null;
399
+ return /* @__PURE__ */ b(N.span, {
400
+ ref: r,
401
+ layoutId: ft(e),
402
+ initial: d?.initial,
403
+ animate: d?.animate,
404
+ transition: n ? ht : {
405
+ layout: { duration: 0 },
406
+ ...d?.transition
407
+ },
408
+ onLayoutAnimationStart: () => {
409
+ n && i(!0);
410
+ },
411
+ onLayoutAnimationComplete: () => i(!1),
412
+ className: u("relative inline-block", l),
413
+ children: [c, p && /* @__PURE__ */ a(N.span, {
414
+ "aria-hidden": !0,
415
+ initial: { opacity: 1 },
416
+ animate: { opacity: 0 },
417
+ transition: gt,
418
+ onAnimationComplete: () => i(!1),
419
+ className: u("absolute inset-0", t),
420
+ children: c
421
+ })]
422
+ });
423
+ }
424
+ var Ke = "max-w-full min-w-0 truncate align-top", Xe = "flex shrink-0 items-center", fa = B(!1);
425
+ function Qe(e) {
426
+ return typeof e == "string" || typeof e == "number" ? e : /* @__PURE__ */ a(fa.Provider, {
427
+ value: !0,
428
+ children: e
429
+ });
430
+ }
431
+ function kt({ inBar: e = !0, children: t }) {
432
+ return k(fa) && !e ? null : /* @__PURE__ */ a(Z, { children: t });
433
+ }
434
+ function Rt({ id: e, morphId: t, enter: n, trailing: r, className: s, children: l, ...c }) {
435
+ const p = Oe(e, l), i = I(), d = ve(n === !0), m = pa(t), o = da(), h = !i && (t != null || d === !0), g = d || o != null ? "rise" : void 0, v = k(Le), y = v?.pinned ?? !1, w = k(re)?.adopt ?? !1, f = k(ua), A = C(null);
436
+ H(() => {
437
+ if (!(v == null || y))
438
+ return v.setTitle({
439
+ label: Qe(l),
440
+ el: A.current
441
+ }), () => v.setTitle(null);
442
+ }, [
443
+ v,
444
+ y,
445
+ l
446
+ ]);
447
+ const [x, E] = _(m.fly && o != null);
448
+ H(() => {
449
+ J.length > 0 && E(!1);
450
+ }, []);
451
+ const S = r != null && r !== !1, O = !i && (t != null ? m.fly || g != null : d === !0), M = t != null && !i ? /* @__PURE__ */ a(ma, {
452
+ morphId: t,
453
+ fromClassName: "text-pho-secondary",
454
+ fly: m.fly,
455
+ morphRef: m.ref,
456
+ arrival: g,
457
+ className: Ke,
458
+ children: l
459
+ }) : d && !i ? /* @__PURE__ */ a(N.span, {
460
+ initial: {
461
+ opacity: 0,
462
+ y: j
463
+ },
464
+ animate: {
465
+ opacity: 1,
466
+ y: 0
467
+ },
468
+ transition: {
469
+ y: P,
470
+ opacity: F
471
+ },
472
+ className: u("inline-block", Ke),
473
+ children: l
474
+ }) : S ? /* @__PURE__ */ a("span", {
475
+ className: "min-w-0 truncate",
476
+ children: l
477
+ }) : l;
478
+ return /* @__PURE__ */ b(Z, { children: [y && v != null && /* @__PURE__ */ a(oa, {
479
+ title: {
480
+ label: Qe(l),
481
+ el: A.current
482
+ },
483
+ tail: f.tail,
484
+ silent: f.silent,
485
+ pinned: !0,
486
+ className: w ? void 0 : "h-12 shrink-0"
487
+ }), /* @__PURE__ */ b("h1", {
488
+ id: p,
489
+ "data-basic-page-title": "",
490
+ className: u("text-display-base text-pho-primary max-w-full min-w-0 scroll-mt-12 px-5 font-medium", !y && "min-h-[1lh]", h ? "whitespace-nowrap" : "truncate", y && "sr-only", s),
491
+ ...c,
492
+ ref: (D) => {
493
+ A.current = D;
494
+ const W = c.ref;
495
+ typeof W == "function" ? W(D) : W != null && (W.current = D);
496
+ },
497
+ children: [S ? /* @__PURE__ */ b("span", {
498
+ className: "flex min-h-[1lh] max-w-full min-w-0 items-center gap-2",
499
+ children: [M, O ? /* @__PURE__ */ a(N.span, {
500
+ "data-basic-page-title-trailing": "",
501
+ initial: {
502
+ opacity: 0,
503
+ y: j
504
+ },
505
+ animate: {
506
+ opacity: 1,
507
+ y: 0
508
+ },
509
+ transition: {
510
+ y: P,
511
+ opacity: F
512
+ },
513
+ className: Xe,
514
+ children: r
515
+ }) : /* @__PURE__ */ a("span", {
516
+ "data-basic-page-title-trailing": "",
517
+ className: Xe,
518
+ children: r
519
+ })]
520
+ }) : M, x && /* @__PURE__ */ a(N.span, {
521
+ "aria-hidden": !0,
522
+ initial: { opacity: 1 },
523
+ animate: { opacity: 0 },
524
+ transition: ca,
525
+ onAnimationComplete: () => E(!1),
526
+ className: u("text-pho-secondary pointer-events-none absolute inline-flex items-center", En),
527
+ children: /* @__PURE__ */ a(oe, {})
528
+ })]
529
+ })] });
530
+ }
531
+ var Me = B(!1);
532
+ function St() {
533
+ const e = k(Me), t = I(), [n] = _(() => e && !t);
534
+ return n;
535
+ }
536
+ var Tt = {
537
+ height: 0,
538
+ opacity: 0,
539
+ paddingTop: 0,
540
+ paddingBottom: 0,
541
+ borderTopWidth: 0
542
+ }, Pt = {
543
+ y: P,
544
+ opacity: F,
545
+ height: P,
546
+ paddingTop: P,
547
+ paddingBottom: P,
548
+ borderTopWidth: P
549
+ };
550
+ function ee() {
551
+ const e = St(), t = ta(), n = I();
552
+ return {
553
+ initial: e ? {
554
+ opacity: 0,
555
+ y: j
556
+ } : !1,
557
+ animate: {
558
+ opacity: 1,
559
+ y: 0
560
+ },
561
+ exit: Tt,
562
+ transition: n ? { duration: 0 } : Pt,
563
+ leaving: !t
564
+ };
565
+ }
566
+ var It = typeof process < "u" && process.env.NODE_ENV !== "production";
567
+ function ha(e, t, n, r) {
568
+ L(() => {
569
+ if (!It || e.current == null || typeof getComputedStyle != "function") return;
570
+ const s = (c) => {
571
+ const p = getComputedStyle(c).rowGap;
572
+ return p === "" || p === "normal" ? null : parseFloat(p);
573
+ }, l = s(e.current);
574
+ l != null && l !== n && console.warn(`[BasicPage.${t}] spaced at ${l}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);
575
+ for (const c of Array.from(e.current.children)) {
576
+ const p = r(c);
577
+ if (p == null || getComputedStyle(c).display === "contents") continue;
578
+ const i = s(c);
579
+ i != null && i !== p && console.warn(`[BasicPage.${t}] a child is spaced at ${i}px instead of ${p}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.`, c);
580
+ }
581
+ });
582
+ }
583
+ function Ot(e) {
584
+ return Array.from(e.querySelectorAll("[data-basic-page-stack], [data-basic-page-title], [data-basic-page-header]")).some((t) => t.closest('[aria-busy="true"]') != null);
585
+ }
586
+ var Lt = () => !1, Bt = () => !0;
587
+ function Mt() {
588
+ return he(be, Lt, Bt);
589
+ }
590
+ function ve(e, t = !1) {
591
+ const n = k(ra), r = k(ia), s = Mt(), [l] = _(() => {
592
+ if (s || !e || n?.prerendered || r) return !1;
593
+ if (t) return !0;
594
+ if (document.querySelector("[data-basic-page-prerendered]") != null) return !1;
595
+ const c = n ? n.ref.current : document;
596
+ return c == null || !Ot(c);
597
+ });
598
+ return l;
599
+ }
600
+ function le({ enter: e, className: t, children: n, ref: r, ...s }) {
601
+ const l = I(), c = C(null);
602
+ ha(c, "Stack", 40, (h) => h.hasAttribute("data-basic-page-fields") ? 20 : h.hasAttribute("data-basic-page-card") || h.hasAttribute("data-basic-page-onboard") || h.hasAttribute("data-basic-page-receipt") || h.hasAttribute("data-basic-page-header") || h.hasAttribute("data-basic-page-columns") || h.hasAttribute("data-data-table") || h.hasAttribute("data-code-block") ? null : 12);
603
+ const p = ve(e ?? !0, e === !0), i = s["aria-busy"], d = i === !0 || i === "true", m = C(d), o = m.current && !d;
604
+ return L(() => {
605
+ m.current = d;
606
+ }), /* @__PURE__ */ a(N.div, {
607
+ ref: (h) => {
608
+ c.current = h, typeof r == "function" ? r(h) : r != null && (r.current = h);
609
+ },
610
+ "data-basic-page-stack": "",
611
+ initial: l || !p ? !1 : {
612
+ opacity: 0,
613
+ y: j
614
+ },
615
+ animate: {
616
+ opacity: 1,
617
+ y: 0
618
+ },
619
+ transition: {
620
+ y: P,
621
+ opacity: F
622
+ },
623
+ className: u("mt-7 flex min-w-0 flex-col gap-10 [--choice-card-inset:1.25rem]", "[&: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", "[&:has(>*:first-child>[data-basic-page-form-body]>[data-basic-page-header]:first-child)]:mt-6 [&:has(>*:first-child>[data-basic-page-form-body]>h2:first-child)]:mt-6", "[[data-basic-page-pinned]:not([data-basic-page-width=full])_[data-basic-page-column]_&]:mt-3 [[data-basic-page-pinned][data-basic-page-width=full]_[data-basic-page-column]_&]:mt-0", "*: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-receipt]):not([data-basic-page-header]):not([data-basic-page-columns]):not([data-data-table]):not([data-code-block])]: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-receipt]):not([data-basic-page-header]):not([data-basic-page-columns]):not([data-data-table]):not([data-code-block])]: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-receipt]):not([data-basic-page-header]):not([data-basic-page-columns]):not([data-data-table]):not([data-code-block])]:gap-3", t),
624
+ ...s,
625
+ children: /* @__PURE__ */ a(Me.Provider, {
626
+ value: o,
627
+ children: n
628
+ })
629
+ });
630
+ }
631
+ var Ue = "@container grid min-w-0 grid-cols-[minmax(0,1fr)_auto_auto] mb-3 gap-y-0 [&>: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 [[data-basic-page-stack]>*>[data-basic-page-form-body]>&]:mb-0";
632
+ function Dt({ enter: e, className: t, ...n }) {
633
+ const r = I();
634
+ return ve(e === !0) && !r ? /* @__PURE__ */ a(N.div, {
635
+ initial: {
636
+ opacity: 0,
637
+ y: j
638
+ },
639
+ animate: {
640
+ opacity: 1,
641
+ y: 0
642
+ },
643
+ transition: {
644
+ y: P,
645
+ opacity: F
646
+ },
647
+ className: u(Ue, t),
648
+ ...n,
649
+ "data-basic-page-header": ""
650
+ }) : /* @__PURE__ */ a("div", {
651
+ className: u(Ue, t),
652
+ ...n,
653
+ "data-basic-page-header": ""
654
+ });
655
+ }
656
+ function Ft({ className: e, ...t }) {
657
+ return /* @__PURE__ */ a("div", {
658
+ "data-basic-page-header-action": "",
659
+ className: u("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-center [[data-basic-page-header]>&]:justify-self-end", "[[data-basic-page-callout]_[data-basic-page-header]>&]:mr-0", e),
660
+ ...t
661
+ });
662
+ }
663
+ function Ht({ id: e, className: t, children: n, ...r }) {
664
+ const s = Oe(e, n);
665
+ return /* @__PURE__ */ a("h2", {
666
+ id: s,
667
+ className: u("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 [[data-basic-page-stack]>*>[data-basic-page-form-body]>&]:mb-0", t),
668
+ ...r,
669
+ children: n
670
+ });
671
+ }
672
+ function ga({ className: e, ...t }) {
673
+ return /* @__PURE__ */ a("p", {
674
+ className: u("text-display-xs text-pho-description px-5 font-normal", e),
675
+ ...t
676
+ });
677
+ }
678
+ function zt({ one: e, other: t, ...n }) {
679
+ const r = k(Se), s = he(r?.subscribe ?? be, () => r?.get().api ?? null, () => null);
680
+ if (s == null) return null;
681
+ const l = s.query.trim() !== "" ? `${s.matched} of ${s.total}.` : `${s.total} ${s.total === 1 ? e : t}.`;
682
+ return /* @__PURE__ */ a(ga, {
683
+ ...n,
684
+ children: l
685
+ });
686
+ }
687
+ function Gt({ className: e, ...t }) {
688
+ return /* @__PURE__ */ a("p", {
689
+ className: u("text-pho-description px-5 text-xs font-normal", "mt-3 [[data-basic-page-callout]_&]:mt-0 [[data-basic-page-stack]>*>&]:mt-0 [[data-basic-page-stack]>*>[data-basic-page-form-body]>&]:mt-0", e),
690
+ ...t
691
+ });
692
+ }
693
+ function $t({ animateHeight: e, className: t, children: n, ...r }) {
694
+ const s = /* @__PURE__ */ a(z, { children: U.toArray(n) });
695
+ return e ? /* @__PURE__ */ a("div", {
696
+ className: u(ge, "min-h-0 gap-0", t),
697
+ ...r,
698
+ "data-basic-page-card": "",
699
+ children: /* @__PURE__ */ a(Ja, {
700
+ transition: P,
701
+ className: de,
702
+ children: s
703
+ })
704
+ }) : /* @__PURE__ */ a("div", {
705
+ className: u(na, t),
706
+ ...r,
707
+ "data-basic-page-card": "",
708
+ children: s
709
+ });
710
+ }
711
+ function Wt({ className: e, ...t }) {
712
+ const { leaving: n, ...r } = ee();
713
+ return /* @__PURE__ */ a(N.div, {
714
+ ...r,
715
+ className: u(rt, n && "overflow-hidden", e),
716
+ ...t
717
+ });
718
+ }
719
+ function Vt({ divided: e = !1, className: t, ...n }) {
720
+ return /* @__PURE__ */ a("div", {
721
+ className: u(e ? st : it, t),
722
+ ...n
723
+ });
724
+ }
725
+ function jt({ className: e, icon: t, children: n, ...r }) {
726
+ if (t == null || t === !1 || t === !0) return /* @__PURE__ */ a("div", {
727
+ className: u($e, e),
728
+ ...r,
729
+ "data-basic-page-callout": "",
730
+ children: n
731
+ });
732
+ const [s, ...l] = U.toArray(n);
733
+ return /* @__PURE__ */ b("div", {
734
+ className: u($e, e),
735
+ ...r,
736
+ "data-basic-page-callout": "",
737
+ children: [/* @__PURE__ */ b("div", {
738
+ className: "relative",
739
+ children: [/* @__PURE__ */ a("div", {
740
+ className: "min-w-0 pr-16",
741
+ children: s
742
+ }), /* @__PURE__ */ a("div", {
743
+ "aria-hidden": !0,
744
+ className: "text-pho-primary pointer-events-none absolute top-0 right-0 size-14 opacity-[0.275] [&>svg]:size-full",
745
+ children: t
746
+ })]
747
+ }), l]
748
+ });
749
+ }
750
+ function qt({ id: e, className: t, children: n, ...r }) {
751
+ const s = Oe(e, n);
752
+ return /* @__PURE__ */ a("h2", {
753
+ id: s,
754
+ className: u("text-display-xs text-pho-primary max-w-full min-w-0 scroll-mt-12 truncate font-medium", t),
755
+ ...r,
756
+ children: n
757
+ });
758
+ }
759
+ function Kt({ className: e, ...t }) {
760
+ return /* @__PURE__ */ a("p", {
761
+ className: u("text-display-xs text-pho-description font-normal", e),
762
+ ...t
763
+ });
764
+ }
765
+ var De = B(null), ba = B(!1);
766
+ function va(e) {
767
+ return e === "current" || e === "working" || e === "pending";
768
+ }
769
+ function Xt(e) {
770
+ let t = -1;
771
+ return {
772
+ steps: U.toArray(e).map((n, r) => {
773
+ if (!ce(n)) return {
774
+ node: n,
775
+ key: r,
776
+ index: r,
777
+ state: null,
778
+ page: null
779
+ };
780
+ let s;
781
+ return n.props.done ? s = "done" : t !== -1 ? s = "upcoming" : (t = r, s = n.props.working ? "working" : n.props.pending ? "pending" : "current"), {
782
+ node: n,
783
+ key: n.key ?? r,
784
+ index: r,
785
+ state: s,
786
+ page: n.props.children
787
+ };
788
+ }),
789
+ atHand: t
790
+ };
791
+ }
792
+ function Qt({ paged: e, className: t, children: n, ...r }) {
793
+ const { steps: s, atHand: l } = Xt(n);
794
+ return e ? /* @__PURE__ */ a(Jt, {
795
+ steps: s,
796
+ atHand: l,
797
+ className: t,
798
+ ...r
799
+ }) : /* @__PURE__ */ a("ol", {
800
+ className: u(na, "m-0 list-none p-0", t),
801
+ ...r,
802
+ "data-basic-page-onboard": "",
803
+ children: s.map((c) => c.state == null ? c.node : /* @__PURE__ */ a(De.Provider, {
804
+ value: {
805
+ number: c.index + 1,
806
+ state: c.state
807
+ },
808
+ children: c.node
809
+ }, c.key))
810
+ });
811
+ }
812
+ function Ut(e) {
813
+ const t = Q(e);
814
+ return {
815
+ enter: (n) => ({
816
+ opacity: 0,
817
+ x: e ? 0 : n * j,
818
+ filter: "blur(0px)"
819
+ }),
820
+ rest: {
821
+ opacity: 1,
822
+ x: 0,
823
+ filter: "blur(0px)",
824
+ transition: e ? { duration: 0 } : {
825
+ x: P,
826
+ opacity: F
827
+ }
828
+ },
829
+ leave: {
830
+ ...t.exit,
831
+ transition: t.transition
832
+ }
833
+ };
834
+ }
835
+ function Yt(e) {
836
+ const t = ta();
837
+ return /* @__PURE__ */ a(N.section, {
838
+ ...e,
839
+ inert: !t,
840
+ "data-basic-page-onboard-page": ""
841
+ });
842
+ }
843
+ function Jt({ steps: e, atHand: t, className: n, ref: r, ...s }) {
844
+ const l = I(), c = ve(!0), p = Ie(), i = C(null), d = C(null), m = C(null), [o, h] = _({
845
+ from: t,
846
+ direction: 1
847
+ });
848
+ let g = o.direction;
849
+ o.from !== t && (g = t > o.from ? 1 : -1, h({
850
+ from: t,
851
+ direction: g
852
+ }));
853
+ const v = C(t);
854
+ H(() => {
855
+ if (v.current === t) return;
856
+ v.current = t;
857
+ const f = i.current, A = d.current, x = m.current;
858
+ if (t === -1 || f == null || A == null || x == null) return;
859
+ typeof A.scrollIntoView == "function" && A.scrollIntoView({ block: "nearest" });
860
+ const E = document.activeElement;
861
+ !x.contains(E) && (E == null || E === document.body || f.contains(E)) && x.focus({ preventScroll: !0 });
862
+ }, [t]);
863
+ const y = e.filter((f) => f.state != null).at(-1)?.index, w = t === -1 ? null : e[t];
864
+ return /* @__PURE__ */ b(N.div, {
865
+ ref: i,
866
+ "data-basic-page-onboard": "paged",
867
+ initial: l || !c ? !1 : {
868
+ opacity: 0,
869
+ y: j
870
+ },
871
+ animate: {
872
+ opacity: 1,
873
+ y: 0
874
+ },
875
+ transition: {
876
+ y: P,
877
+ opacity: F
878
+ },
879
+ className: "relative mt-7 flex min-w-0 flex-col [[data-basic-page-stack]>&]:mt-0",
880
+ children: [/* @__PURE__ */ a("ol", {
881
+ ref: (f) => {
882
+ d.current = f, typeof r == "function" ? r(f) : r != null && (r.current = f);
883
+ },
884
+ className: u("m-0 flex min-w-0 scroll-mt-12 list-none items-center gap-3 p-0 px-5", n),
885
+ ...s,
886
+ "data-basic-page-onboard-row": "",
887
+ children: e.map((f) => f.state == null ? f.node : /* @__PURE__ */ a(De.Provider, {
888
+ value: {
889
+ number: f.index + 1,
890
+ state: f.state,
891
+ row: {
892
+ last: f.index === y,
893
+ labelId: `${p}-${f.index}`
894
+ }
895
+ },
896
+ children: f.node
897
+ }, f.key))
898
+ }), /* @__PURE__ */ a(z, {
899
+ initial: !1,
900
+ mode: "popLayout",
901
+ children: w != null ? /* @__PURE__ */ a(Yt, {
902
+ ref: (f) => {
903
+ f != null && (m.current = f);
904
+ },
905
+ custom: g,
906
+ variants: Ut(l),
907
+ initial: "enter",
908
+ animate: "rest",
909
+ exit: "leave",
910
+ "aria-labelledby": `${p}-${w.index}`,
911
+ tabIndex: -1,
912
+ className: "min-w-0 outline-none",
913
+ children: /* @__PURE__ */ a(ia.Provider, {
914
+ value: !0,
915
+ children: w.page
916
+ })
917
+ }, w.key) : null
918
+ })]
919
+ });
920
+ }
921
+ var ya = "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]", xa = {
922
+ done: "border-pho-ink text-pho-primary",
923
+ current: "bg-pho-brand-solid text-pho-on-brand border-transparent",
924
+ working: "border-transparent text-pho-primary",
925
+ pending: "border-pho-ink text-pho-primary border-dashed",
926
+ upcoming: "border-pho-primary text-pho-description"
927
+ }, wa = "pointer-events-none absolute -inset-px rounded-full border border-pho-ink opacity-30", Na = "pointer-events-none absolute -inset-px rounded-full border border-pho-ink border-r-transparent border-b-transparent border-l-transparent animate-pho-spinner", _a = {
928
+ done: "Done.",
929
+ working: "In progress.",
930
+ pending: "Waiting."
931
+ };
932
+ function Aa({ state: e, number: t, glyph: n, className: r }) {
933
+ const s = I();
934
+ return /* @__PURE__ */ b("span", {
935
+ "aria-hidden": !0,
936
+ className: u(ya, xa[e], r),
937
+ children: [/* @__PURE__ */ a(z, {
938
+ initial: !1,
939
+ children: e === "done" ? /* @__PURE__ */ a(N.span, {
940
+ ...Q(s),
941
+ className: "flex [&>svg]:size-3",
942
+ children: n ?? /* @__PURE__ */ a(aa, { className: "size-3" })
943
+ }, "check") : /* @__PURE__ */ a(N.span, {
944
+ ...Q(s),
945
+ children: t
946
+ }, "number")
947
+ }), e === "working" ? /* @__PURE__ */ b(Z, { children: [/* @__PURE__ */ a("span", { className: wa }), /* @__PURE__ */ a("span", { className: Na })] }) : null]
948
+ });
949
+ }
950
+ var Ca = {
951
+ done: "Done",
952
+ working: "In progress",
953
+ pending: "Waiting",
954
+ upcoming: "Not yet",
955
+ failed: null
956
+ }, Ea = B(!1);
957
+ function Zt(e) {
958
+ const t = e.findIndex((n) => n === "failed" || n === "pending" || n === "working");
959
+ return t === -1 ? e.lastIndexOf("done") : t;
960
+ }
961
+ function en({ className: e, children: t, ...n }) {
962
+ const r = U.toArray(t), s = Zt(r.map((l) => ce(l) ? l.props.state ?? "upcoming" : null));
963
+ return /* @__PURE__ */ a("ul", {
964
+ "data-basic-page-checklist": "",
965
+ className: u("m-0 flex list-none flex-col gap-1.5 p-0", e),
966
+ ...n,
967
+ children: r.map((l, c) => /* @__PURE__ */ a(Ea.Provider, {
968
+ value: c === s,
969
+ children: l
970
+ }, ce(l) && l.key != null ? l.key : c))
971
+ });
972
+ }
973
+ function ka({ state: e }) {
974
+ const t = I();
975
+ return e === "failed" ? /* @__PURE__ */ a(ea, {
976
+ "aria-hidden": !0,
977
+ className: "text-pho-error size-4 shrink-0"
978
+ }) : /* @__PURE__ */ b("span", {
979
+ "aria-hidden": !0,
980
+ className: u(ya, "size-4", xa[e]),
981
+ children: [/* @__PURE__ */ a(z, {
982
+ initial: !1,
983
+ children: e === "done" ? /* @__PURE__ */ a(N.span, {
984
+ ...Q(t),
985
+ className: "flex",
986
+ children: /* @__PURE__ */ a(aa, { className: "size-2.5" })
987
+ }, "check") : null
988
+ }), e === "working" ? /* @__PURE__ */ b(Z, { children: [/* @__PURE__ */ a("span", { className: wa }), /* @__PURE__ */ a("span", { className: Na })] }) : null]
989
+ });
990
+ }
991
+ function an({ state: e = "upcoming", value: t, description: n, failure: r = "Failed", className: s, children: l, ...c }) {
992
+ const p = k(Ea), i = Ca[e], d = e === "failed";
993
+ return /* @__PURE__ */ b("li", {
994
+ "data-basic-page-check": e,
995
+ "data-current": p ? "" : void 0,
996
+ "aria-current": p ? "step" : void 0,
997
+ className: u("text-pho-secondary m-0 grid min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-x-1.5 text-base", s),
998
+ ...c,
999
+ children: [
1000
+ /* @__PURE__ */ a(ka, { state: e }),
1001
+ /* @__PURE__ */ b("span", {
1002
+ className: u("flex min-w-0 items-center gap-1.5", p && "font-medium"),
1003
+ children: [/* @__PURE__ */ b("span", {
1004
+ className: "min-w-0",
1005
+ children: [l, i ? /* @__PURE__ */ a("span", {
1006
+ className: "sr-only",
1007
+ children: `, ${i}`
1008
+ }) : null]
1009
+ }), d ? /* @__PURE__ */ a("span", {
1010
+ className: "text-pho-error",
1011
+ children: r
1012
+ }) : null]
1013
+ }),
1014
+ t != null ? /* @__PURE__ */ a("span", {
1015
+ className: "text-pho-description col-start-3 pl-4 tabular-nums",
1016
+ children: t
1017
+ }) : null,
1018
+ n != null ? /* @__PURE__ */ a("div", {
1019
+ className: u("col-start-2 col-end-4 mt-0.5 text-xs", d ? "text-pho-error" : "text-pho-description"),
1020
+ children: n
1021
+ }) : null
1022
+ ]
1023
+ });
1024
+ }
1025
+ function tn({ className: e, ...t }) {
1026
+ return /* @__PURE__ */ a("ol", {
1027
+ "data-basic-page-timeline": "",
1028
+ className: u("m-0 flex list-none flex-col p-0", e),
1029
+ ...t
1030
+ });
1031
+ }
1032
+ function nn({ state: e = "done", title: t, time: n, className: r, children: s, ...l }) {
1033
+ const c = Ca[e] ?? (e === "failed" ? "Failed" : null);
1034
+ return /* @__PURE__ */ b("li", {
1035
+ "data-basic-page-timeline-item": e,
1036
+ className: u("group/timeline text-pho-secondary relative m-0 grid min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-2.5 pb-5 text-base last:pb-0", r),
1037
+ ...l,
1038
+ children: [
1039
+ /* @__PURE__ */ a("span", {
1040
+ "aria-hidden": !0,
1041
+ className: "border-pho-primary absolute top-[1.375rem] bottom-0.5 left-[calc(0.5rem-0.5px)] border-l group-last/timeline:hidden"
1042
+ }),
1043
+ /* @__PURE__ */ a("span", {
1044
+ className: "flex h-5 items-center",
1045
+ children: /* @__PURE__ */ a(ka, { state: e })
1046
+ }),
1047
+ /* @__PURE__ */ b("div", {
1048
+ className: "min-w-0",
1049
+ children: [
1050
+ /* @__PURE__ */ b("div", {
1051
+ className: "text-pho-primary",
1052
+ children: [t, c ? /* @__PURE__ */ a("span", {
1053
+ className: "sr-only",
1054
+ children: `, ${c}`
1055
+ }) : null]
1056
+ }),
1057
+ n != null ? /* @__PURE__ */ a("div", {
1058
+ className: "text-pho-description text-xs tabular-nums",
1059
+ children: n
1060
+ }) : null,
1061
+ s != null ? /* @__PURE__ */ a("div", {
1062
+ className: "text-pho-description mt-1.5 text-xs",
1063
+ children: s
1064
+ }) : null
1065
+ ]
1066
+ })
1067
+ ]
1068
+ });
1069
+ }
1070
+ function rn({ seat: e, title: t, icon: n, className: r, ...s }) {
1071
+ const { state: l, row: c } = e, p = I(), i = C(null), d = C(null), m = Ya("width", i, d, P), o = va(l), h = _a[l], g = typeof t == "string" || typeof t == "number" ? `title:${t}` : `state:${l === "done"}`;
1072
+ return /* @__PURE__ */ b("li", {
1073
+ "data-basic-page-step": l,
1074
+ "aria-current": o ? "step" : void 0,
1075
+ className: u("m-0 flex min-w-0 items-center", !c.last && "flex-auto", r),
1076
+ ...s,
1077
+ children: [
1078
+ /* @__PURE__ */ a(Aa, {
1079
+ state: l,
1080
+ number: e.number,
1081
+ glyph: n != null && n !== !1 ? n : void 0
1082
+ }),
1083
+ /* @__PURE__ */ a(N.span, {
1084
+ ref: i,
1085
+ id: c.labelId,
1086
+ "data-basic-page-step-title": "",
1087
+ style: { width: m },
1088
+ className: u("min-w-0 overflow-x-clip text-base font-medium transition-colors duration-200 ease-out", l === "upcoming" ? "text-pho-description" : "text-pho-primary"),
1089
+ children: /* @__PURE__ */ a("span", {
1090
+ ref: d,
1091
+ className: u("relative block w-max pl-3 whitespace-nowrap", !o && "max-sm:w-0 max-sm:pl-0"),
1092
+ children: /* @__PURE__ */ a(z, {
1093
+ initial: !1,
1094
+ mode: "popLayout",
1095
+ children: /* @__PURE__ */ b(N.span, {
1096
+ ...Q(p),
1097
+ className: "inline-block",
1098
+ children: [h ? /* @__PURE__ */ b("span", {
1099
+ className: "sr-only",
1100
+ children: [h, " "]
1101
+ }) : null, t]
1102
+ }, g)
1103
+ })
1104
+ })
1105
+ }),
1106
+ c.last ? null : /* @__PURE__ */ a("span", {
1107
+ "aria-hidden": !0,
1108
+ "data-basic-page-step-line": "",
1109
+ className: u("ml-3 h-0 min-w-3 flex-1 border-t transition-[border-color] duration-200 ease-out", l === "done" ? "border-pho-ink" : "border-pho-primary")
1110
+ })
1111
+ ]
1112
+ });
1113
+ }
1114
+ function sn({ icon: e, aside: t, title: n, description: r, done: s, working: l, pending: c, className: p, children: i, ...d }) {
1115
+ const m = k(De), o = m?.state ?? (s ? "done" : l ? "working" : c ? "pending" : "current"), h = I();
1116
+ if (m?.row != null) return /* @__PURE__ */ a(rn, {
1117
+ seat: {
1118
+ ...m,
1119
+ row: m.row
1120
+ },
1121
+ title: n,
1122
+ icon: e,
1123
+ className: p,
1124
+ ...d
1125
+ });
1126
+ const g = va(o), v = o === "upcoming", y = _a[o], w = i != null && i !== !1, f = e != null && e !== !1, A = t != null && t !== !1;
1127
+ return /* @__PURE__ */ a("li", {
1128
+ "data-basic-page-step": o,
1129
+ "aria-current": g ? "step" : void 0,
1130
+ className: u("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", g && "bg-pho-page", p),
1131
+ ...d,
1132
+ children: /* @__PURE__ */ b(ba.Provider, {
1133
+ value: !0,
1134
+ children: [
1135
+ /* @__PURE__ */ a(Aa, {
1136
+ state: o,
1137
+ number: m?.number ?? 1,
1138
+ className: "col-start-1 row-start-1"
1139
+ }),
1140
+ /* @__PURE__ */ b("div", {
1141
+ "data-basic-page-step-title": "",
1142
+ className: u("text-display-xs col-start-2 row-start-1 min-w-0 font-medium transition-colors duration-200 ease-out", v ? "text-pho-description" : "text-pho-primary"),
1143
+ children: [y ? /* @__PURE__ */ b("span", {
1144
+ className: "sr-only",
1145
+ children: [y, " "]
1146
+ }) : null, n]
1147
+ }),
1148
+ /* @__PURE__ */ a(He, {
1149
+ show: g,
1150
+ gap: "none",
1151
+ clip: !1,
1152
+ className: "col-start-2 row-start-2 flex min-w-0 flex-col self-stretch",
1153
+ children: /* @__PURE__ */ b("div", {
1154
+ "data-basic-page-step-body": "",
1155
+ className: "flex min-w-0 flex-1 flex-col",
1156
+ children: [r ? /* @__PURE__ */ a("div", {
1157
+ className: "text-display-xs text-pho-description font-normal",
1158
+ children: r
1159
+ }) : null, w ? /* @__PURE__ */ a("div", {
1160
+ className: "mt-auto flex flex-wrap items-center gap-2 pt-3",
1161
+ children: i
1162
+ }) : null]
1163
+ })
1164
+ }),
1165
+ o === "done" && w ? /* @__PURE__ */ a("div", {
1166
+ className: "col-start-3 row-start-1 flex min-w-0 items-center gap-2",
1167
+ children: i
1168
+ }) : A ? /* @__PURE__ */ a(z, {
1169
+ initial: !1,
1170
+ children: g ? /* @__PURE__ */ a(N.div, {
1171
+ ...Q(h),
1172
+ className: "col-start-3 row-span-2 row-start-1 self-start",
1173
+ children: t
1174
+ }, "aside") : null
1175
+ }) : f ? /* @__PURE__ */ a(z, {
1176
+ initial: !1,
1177
+ children: g ? /* @__PURE__ */ a(N.div, {
1178
+ "aria-hidden": !0,
1179
+ ...Q(h),
1180
+ className: "pointer-events-none col-start-3 row-span-2 row-start-1 size-14 self-start",
1181
+ children: /* @__PURE__ */ a("div", {
1182
+ className: "text-pho-primary size-full opacity-[0.275] [&>svg]:size-full",
1183
+ children: e
1184
+ })
1185
+ }, "icon") : null
1186
+ }) : null
1187
+ ]
1188
+ })
1189
+ });
1190
+ }
1191
+ function ln({ label: e, description: t, htmlFor: n, stacked: r = !1, className: s, children: l, ...c }) {
1192
+ const { leaving: p, ...i } = ee();
1193
+ return /* @__PURE__ */ b(N.div, {
1194
+ ...i,
1195
+ className: u(nt, r && "sm:flex-col sm:items-stretch sm:justify-start sm:gap-3", p && "overflow-hidden", s),
1196
+ ...c,
1197
+ children: [/* @__PURE__ */ b("div", {
1198
+ className: "min-w-0",
1199
+ children: [n ? /* @__PURE__ */ a("label", {
1200
+ htmlFor: n,
1201
+ className: "text-pho-primary block text-base font-normal",
1202
+ children: e
1203
+ }) : /* @__PURE__ */ a("div", {
1204
+ className: "text-pho-primary text-base font-normal",
1205
+ children: e
1206
+ }), t ? /* @__PURE__ */ a("p", {
1207
+ className: "text-pho-description text-xs",
1208
+ children: t
1209
+ }) : null]
1210
+ }), /* @__PURE__ */ a("div", {
1211
+ className: u("flex w-full min-w-0 items-center gap-2 sm:w-auto", r && "sm:w-full"),
1212
+ children: l
1213
+ })]
1214
+ });
1215
+ }
1216
+ function on({ className: e, ...t }) {
1217
+ const n = k(ba);
1218
+ return /* @__PURE__ */ a("p", {
1219
+ className: u("text-pho-description max-w-full min-w-0 truncate", n ? "text-display-xs font-normal" : "text-base", e),
1220
+ ...t
1221
+ });
1222
+ }
1223
+ var cn = "grid grid-cols-[minmax(0,1fr)_auto] gap-x-6 sm:grid-cols-[minmax(0,1fr)_auto_auto]", pe = "col-span-full grid grid-cols-subgrid", dn = "[[data-basic-page-receipt]>&:not([data-basic-page-receipt-line]+&)]:pt-5 [[data-basic-page-receipt]>&:not(:has(+[data-basic-page-receipt-line]))]:pb-5 [[data-basic-page-receipt]>&:not(:first-child):not([data-basic-page-receipt-line]+&)]:border-t", un = "[[data-basic-page-receipt]>&:not([data-basic-page-receipt-total]+&)]:pt-5 [[data-basic-page-receipt]>&:not(:has(+[data-basic-page-receipt-total]))]:pb-5 [[data-basic-page-receipt]>&:not(:first-child):not([data-basic-page-receipt-total]+&)]:border-t", Fe = "flex min-h-5 min-w-0 items-center gap-2 [overflow-wrap:anywhere]", Ee = "flex min-h-5 items-center justify-end whitespace-nowrap tabular-nums", Ra = "col-start-1 row-start-1", pn = "col-start-1 row-start-2 justify-start text-xs sm:col-start-2 sm:row-start-1 sm:justify-end sm:text-base", Sa = "col-start-2 row-start-1 sm:col-start-3", me = (e) => e != null && e !== !1 && e !== !0;
1224
+ function mn({ empty: e, className: t, children: n, ...r }) {
1225
+ const s = U.toArray(n).length === 0;
1226
+ return /* @__PURE__ */ a("ul", {
1227
+ className: u(ge, cn, "m-0 list-none p-0", t),
1228
+ ...r,
1229
+ "data-basic-page-receipt": "",
1230
+ children: s && me(e) ? /* @__PURE__ */ a("li", {
1231
+ "data-basic-page-receipt-empty": "",
1232
+ className: "text-pho-description col-span-full m-0 px-5 py-5 text-base",
1233
+ children: e
1234
+ }) : n
1235
+ });
1236
+ }
1237
+ function fn({ label: e, className: t, children: n, ...r }) {
1238
+ const { initial: s, animate: l, transition: c } = ee(), p = Ie(), i = me(e);
1239
+ return /* @__PURE__ */ b(N.li, {
1240
+ initial: s,
1241
+ animate: l,
1242
+ transition: c,
1243
+ className: u(pe, "border-pho-secondary m-0 py-4", "[[data-basic-page-receipt]>&:not(:first-child)]:border-t", t),
1244
+ ...r,
1245
+ "data-basic-page-receipt-group": "",
1246
+ children: [i ? /* @__PURE__ */ a("div", {
1247
+ id: p,
1248
+ className: u(Fe, "text-pho-primary col-span-full min-h-7 px-5 py-1 text-base font-medium"),
1249
+ children: e
1250
+ }) : null, /* @__PURE__ */ a("ul", {
1251
+ "aria-labelledby": i ? p : void 0,
1252
+ className: u(pe, "m-0 list-none p-0"),
1253
+ children: /* @__PURE__ */ a(Me.Provider, {
1254
+ value: !1,
1255
+ children: n
1256
+ })
1257
+ })]
1258
+ });
1259
+ }
1260
+ function hn({ label: e, quantity: t, amount: n, className: r, ...s }) {
1261
+ const { initial: l, animate: c, transition: p } = ee(), i = me(t), d = me(n);
1262
+ return /* @__PURE__ */ b(N.li, {
1263
+ initial: l,
1264
+ animate: c,
1265
+ transition: p,
1266
+ className: u(pe, "border-pho-secondary m-0 items-start px-5 py-1 text-base", dn, r),
1267
+ ...s,
1268
+ "data-basic-page-receipt-line": "",
1269
+ children: [
1270
+ /* @__PURE__ */ a("div", {
1271
+ className: u(Fe, Ra, "text-pho-secondary", !d && "col-end-3", i ? "sm:col-end-2" : d ? "sm:col-end-3" : "sm:col-end-4"),
1272
+ children: e
1273
+ }),
1274
+ i ? /* @__PURE__ */ a("div", {
1275
+ className: u(Ee, pn, "text-pho-description"),
1276
+ children: t
1277
+ }) : null,
1278
+ d ? /* @__PURE__ */ a("div", {
1279
+ className: u(Ee, Sa, "text-pho-secondary"),
1280
+ children: n
1281
+ }) : null
1282
+ ]
1283
+ });
1284
+ }
1285
+ function gn({ label: e, amount: t, className: n, ...r }) {
1286
+ const { initial: s, animate: l, transition: c } = ee();
1287
+ return /* @__PURE__ */ b(N.li, {
1288
+ initial: s,
1289
+ animate: l,
1290
+ transition: c,
1291
+ className: u(pe, "border-pho-secondary text-pho-primary m-0 items-start px-5 py-1 text-base font-medium", un, n),
1292
+ ...r,
1293
+ "data-basic-page-receipt-total": "",
1294
+ children: [/* @__PURE__ */ a("div", {
1295
+ className: u(Fe, Ra, "sm:col-end-3"),
1296
+ children: e
1297
+ }), /* @__PURE__ */ a("div", {
1298
+ className: u(Ee, Sa),
1299
+ children: t
1300
+ })]
1301
+ });
1302
+ }
1303
+ function bn({ error: e, show: t, className: n, children: r, ...s }) {
1304
+ const l = I(), c = k(ae), p = e ?? c?.error ?? void 0;
1305
+ return /* @__PURE__ */ a(z, {
1306
+ initial: !1,
1307
+ children: (t ?? !0) && (p != null || r != null) ? /* @__PURE__ */ a(N.div, {
1308
+ "data-basic-page-alert": "",
1309
+ className: "overflow-hidden",
1310
+ initial: {
1311
+ height: 0,
1312
+ opacity: 0
1313
+ },
1314
+ animate: {
1315
+ height: "auto",
1316
+ opacity: 1
1317
+ },
1318
+ exit: {
1319
+ height: 0,
1320
+ opacity: 0
1321
+ },
1322
+ transition: l ? { duration: 0 } : {
1323
+ height: P,
1324
+ opacity: F
1325
+ },
1326
+ children: /* @__PURE__ */ a(Ga, {
1327
+ error: p,
1328
+ className: u("px-5 pb-3", n),
1329
+ ...s,
1330
+ children: r
1331
+ })
1332
+ }) : null
1333
+ });
1334
+ }
1335
+ function gr() {
1336
+ return k(ae)?.requestSave ?? null;
1337
+ }
1338
+ var br = 800, Ae = Ua.createToastManager(), ae = B(null);
1339
+ function vn({ action: e, errors: t, autoSave: n = !1, className: r, children: s, onChange: l, onBlur: c, ...p }) {
1340
+ const [i, d] = _(!1), [m, o] = _(!1), [h, g] = _(null), [v, y] = _(t ?? {}), [w, f] = _(null), A = C(null), x = C(null), E = C(null), S = C(!1), O = C(!1), M = C(null), D = C(async () => {
1341
+ });
1342
+ L(() => () => {
1343
+ x.current != null && clearTimeout(x.current);
1344
+ }, []);
1345
+ const W = async () => {
1346
+ const T = A.current;
1347
+ if (T == null || e == null) return;
1348
+ if (S.current) {
1349
+ O.current = !0;
1350
+ return;
1351
+ }
1352
+ if (!T.checkValidity()) return;
1353
+ const R = Object.fromEntries(new FormData(T).entries()), K = E.current;
1354
+ S.current = !0, f({
1355
+ field: K,
1356
+ phase: "saving"
1357
+ }), g(null);
1358
+ try {
1359
+ const $ = (await e(R))?.errors;
1360
+ if ($ != null && Object.keys($).length > 0) {
1361
+ y($), f(null);
1362
+ return;
1363
+ }
1364
+ y({}), o(!1), f({
1365
+ field: K,
1366
+ phase: "saved"
1367
+ }), M.current != null && (Ae.close(M.current), M.current = null);
1368
+ } catch ($) {
1369
+ f(null), g($), M.current != null && Ae.close(M.current), M.current = Ae.add({
1370
+ type: "error",
1371
+ title: "Couldn't save",
1372
+ description: $ instanceof Error && $.message !== "" ? $.message : "The change is still here — try again.",
1373
+ timeout: 0,
1374
+ actionProps: {
1375
+ children: "Retry",
1376
+ onClick: () => {
1377
+ D.current();
1378
+ }
1379
+ }
1380
+ });
1381
+ } finally {
1382
+ S.current = !1, O.current && (O.current = !1, D.current());
1383
+ }
1384
+ };
1385
+ D.current = W;
1386
+ const ie = () => {
1387
+ x.current != null && clearTimeout(x.current), x.current = setTimeout(() => {
1388
+ x.current = null, D.current();
1389
+ }, 800);
1390
+ }, G = V(() => n ? (T) => {
1391
+ T != null && (E.current = T), o(!0), ie();
1392
+ } : null, [n]), ye = V(() => ({
1393
+ pending: i,
1394
+ dirty: m,
1395
+ error: h,
1396
+ auto: w,
1397
+ requestSave: G
1398
+ }), [
1399
+ i,
1400
+ m,
1401
+ h,
1402
+ w,
1403
+ G
1404
+ ]);
1405
+ return /* @__PURE__ */ a(ae.Provider, {
1406
+ value: ye,
1407
+ children: /* @__PURE__ */ a(Za, {
1408
+ errors: v,
1409
+ onFormSubmit: async (T) => {
1410
+ if (e != null) {
1411
+ d(!0), g(null);
1412
+ try {
1413
+ const R = (await e(T))?.errors;
1414
+ if (R != null && Object.keys(R).length > 0) {
1415
+ y(R);
1416
+ return;
1417
+ }
1418
+ y({}), o(!1);
1419
+ } catch (R) {
1420
+ g(R);
1421
+ } finally {
1422
+ d(!1);
1423
+ }
1424
+ }
1425
+ },
1426
+ onChange: (T) => {
1427
+ o(!0), g(null);
1428
+ const R = T.target.name;
1429
+ R && R in v && y((K) => {
1430
+ const { [R]: $, ...xe } = K;
1431
+ return xe;
1432
+ }), n && (R && (E.current = R), ie()), l?.(T);
1433
+ },
1434
+ onBlur: (T) => {
1435
+ n && m && x.current != null && (clearTimeout(x.current), x.current = null, D.current()), c?.(T);
1436
+ },
1437
+ className: u("contents [[data-basic-page-stack]>&]:flex [[data-basic-page-stack]>&]:min-w-0 [[data-basic-page-stack]>&]:flex-col", r),
1438
+ ...p,
1439
+ ref: (T) => {
1440
+ A.current = T;
1441
+ const R = p.ref;
1442
+ typeof R == "function" ? R(T) : R != null && (R.current = T);
1443
+ },
1444
+ children: /* @__PURE__ */ a("fieldset", {
1445
+ disabled: i,
1446
+ "aria-busy": i || void 0,
1447
+ className: "contents",
1448
+ "data-basic-page-form-body": "",
1449
+ children: s
1450
+ })
1451
+ })
1452
+ });
1453
+ }
1454
+ function yn({ name: e, className: t, ...n }) {
1455
+ const r = k(ae), s = I(), l = r?.auto ?? null, c = l != null && (e == null || l.field === e), [p, i] = _(!1), d = c ? l.phase : null;
1456
+ L(() => {
1457
+ if (d !== "saved") return;
1458
+ i(!0);
1459
+ const h = setTimeout(() => i(!1), 1800);
1460
+ return () => clearTimeout(h);
1461
+ }, [d, l]);
1462
+ const m = d === "saving" ? "Saving…" : d === "saved" && p ? "Saved" : null, o = s ? "blur(0px)" : `blur(${Te}px)`;
1463
+ return /* @__PURE__ */ a("span", {
1464
+ className: "grid justify-items-end",
1465
+ children: /* @__PURE__ */ a(z, {
1466
+ initial: !1,
1467
+ children: m != null && /* @__PURE__ */ a(N.output, {
1468
+ initial: {
1469
+ opacity: 0,
1470
+ filter: o
1471
+ },
1472
+ animate: {
1473
+ opacity: 1,
1474
+ filter: "blur(0px)"
1475
+ },
1476
+ exit: {
1477
+ opacity: 0,
1478
+ filter: o
1479
+ },
1480
+ transition: ue,
1481
+ className: u("text-pho-description pl-8 [grid-area:1/1]", t),
1482
+ style: { background: "linear-gradient(to left, var(--background-color-pho-primary) calc(100% - 2rem), transparent)" },
1483
+ ...n,
1484
+ children: m
1485
+ }, m)
1486
+ })
1487
+ });
1488
+ }
1489
+ var xn = "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";
1490
+ function wn({ className: e, ...t }) {
1491
+ const n = C(null);
1492
+ return ha(n, "Fields", 20, () => null), /* @__PURE__ */ a("div", {
1493
+ className: u(ge, xn, e),
1494
+ ...t,
1495
+ ref: (r) => {
1496
+ n.current = r;
1497
+ const s = t.ref;
1498
+ typeof s == "function" ? s(r) : s != null && (s.current = r);
1499
+ },
1500
+ "data-basic-page-fields": ""
1501
+ });
1502
+ }
1503
+ function Nn({ className: e, ...t }) {
1504
+ return /* @__PURE__ */ a("div", {
1505
+ className: u("flex min-w-0 flex-col gap-5 *:min-w-0 sm:flex-row sm:gap-3 sm:*:flex-1", e),
1506
+ ...t
1507
+ });
1508
+ }
1509
+ function _n({ children: e = "Save changes", ...t }) {
1510
+ const n = k(ae);
1511
+ return /* @__PURE__ */ a(ne, {
1512
+ type: "submit",
1513
+ variant: "effect",
1514
+ size: "sm",
1515
+ loading: n?.pending,
1516
+ ...t,
1517
+ children: e
1518
+ });
1519
+ }
1520
+ function An({ show: e, className: t, ...n }) {
1521
+ const r = k(ae), s = e === "dirty" ? r?.dirty ?? !1 : e, l = /* @__PURE__ */ a("div", {
1522
+ "data-basic-page-footer": "",
1523
+ className: u("flex items-center justify-end gap-3 pr-[calc(1.25rem+2.5px)]", t),
1524
+ ...n
1525
+ });
1526
+ return s === void 0 ? l : /* @__PURE__ */ a(He, {
1527
+ show: s,
1528
+ gap: "block",
1529
+ clip: !1,
1530
+ children: l
1531
+ });
1532
+ }
1533
+ var Cn = {
1534
+ stack: "-2.5rem",
1535
+ block: "-0.75rem",
1536
+ fields: "-1.25rem",
1537
+ none: "0px"
1538
+ };
1539
+ function He({ show: e, clip: t = !0, gap: n = "stack", dividers: r, className: s, ...l }) {
1540
+ const c = I(), p = Cn[r ? "none" : n], i = C(null), d = C(e !== !0);
1541
+ L(() => {
1542
+ d.current = !0;
1543
+ }, []);
1544
+ const m = () => {
1545
+ t && i.current && (i.current.style.overflow = "hidden");
1546
+ }, o = () => {
1547
+ i.current && (i.current.style.overflow = "");
1548
+ };
1549
+ return e === void 0 ? /* @__PURE__ */ a(N.div, {
1550
+ initial: c ? !1 : {
1551
+ opacity: 0,
1552
+ y: j
1553
+ },
1554
+ animate: {
1555
+ opacity: 1,
1556
+ y: 0
1557
+ },
1558
+ transition: {
1559
+ y: P,
1560
+ opacity: F
1561
+ },
1562
+ className: u(r && de, s),
1563
+ ...l
1564
+ }) : /* @__PURE__ */ a(z, {
1565
+ initial: !1,
1566
+ children: e ? /* @__PURE__ */ a(N.div, {
1567
+ "data-basic-page-reveal": "",
1568
+ ref: (h) => {
1569
+ i.current = h, t && h && d.current && (h.style.overflow = "hidden");
1570
+ },
1571
+ onAnimationStart: m,
1572
+ onAnimationComplete: o,
1573
+ ...za(c, p),
1574
+ className: u(r && de, s),
1575
+ ...l
1576
+ }) : null
1577
+ });
1578
+ }
1579
+ var En = "top-4 left-5 h-8 text-base [&>svg]:size-[1.125em] [&>svg]:shrink-0", kn = "(min-width: 40rem)";
1580
+ function Rn() {
1581
+ return typeof window < "u" && typeof window.matchMedia == "function" && !window.matchMedia(kn).matches;
1582
+ }
1583
+ var Ta = B(null);
1584
+ function Pa({ className: e, children: t, ...n }) {
1585
+ const r = U.toArray(t).filter(ce), s = r.map((A) => A.props.children ?? null), l = da();
1586
+ xt(s);
1587
+ const [c] = _(Rn), p = I(), i = r.length, d = Ze(), m = !c && i >= Sn, o = k(Le), h = i > 0 ? r[i - 1]?.props : null, g = h?.children ?? "Back", v = h?.href, y = h?.onClick;
1588
+ H(() => {
1589
+ if (!(o == null || v == null))
1590
+ return o.setTail({
1591
+ label: g,
1592
+ href: v,
1593
+ onClick: y
1594
+ }), () => o.setTail(null);
1595
+ }, [
1596
+ o,
1597
+ g,
1598
+ v,
1599
+ y
1600
+ ]);
1601
+ const [w, f] = _(!p && !c && l != null && l.labels.length > i);
1602
+ return /* @__PURE__ */ a("nav", {
1603
+ "aria-label": "Breadcrumb",
1604
+ "data-basic-page-back": "",
1605
+ className: u("absolute top-4 left-3 flex min-w-max items-center", e),
1606
+ ...n,
1607
+ children: /* @__PURE__ */ b("ol", {
1608
+ className: "m-0 flex list-none items-center p-0",
1609
+ children: [r.map((A, x) => m && x > 0 && x < i - 2 ? null : /* @__PURE__ */ b(tt, { children: [m && x === i - 2 && /* @__PURE__ */ b("li", {
1610
+ className: "m-0 flex items-center max-sm:hidden",
1611
+ children: [/* @__PURE__ */ a("span", {
1612
+ "aria-hidden": !0,
1613
+ className: ke,
1614
+ children: fe
1615
+ }), /* @__PURE__ */ b(Y.Root, { children: [/* @__PURE__ */ a(Y.Trigger, { render: /* @__PURE__ */ a(ne, {
1616
+ variant: "ghost",
1617
+ size: "sm",
1618
+ "aria-label": "Hidden pages",
1619
+ className: "px-2.5",
1620
+ children: Tn
1621
+ }) }), /* @__PURE__ */ a(Y.Portal, { children: /* @__PURE__ */ a(Y.Positioner, {
1622
+ align: "start",
1623
+ sideOffset: 4,
1624
+ children: /* @__PURE__ */ a(Y.Popup, { children: r.slice(1, i - 2).map((E, S) => {
1625
+ const O = E.props;
1626
+ return /* @__PURE__ */ a(Y.LinkItem, {
1627
+ render: /* @__PURE__ */ a(d, {
1628
+ href: O.href,
1629
+ onClick: O.onClick
1630
+ }),
1631
+ children: O.children ?? "Back"
1632
+ }, E.key ?? S);
1633
+ }) })
1634
+ }) })] })]
1635
+ }), /* @__PURE__ */ a("li", {
1636
+ className: u("m-0 flex items-center", x < i - 1 && "max-sm:hidden"),
1637
+ children: /* @__PURE__ */ a(Ta.Provider, {
1638
+ value: {
1639
+ index: x,
1640
+ count: i,
1641
+ departing: l,
1642
+ narrow: c
1643
+ },
1644
+ children: A
1645
+ })
1646
+ })] }, A.key ?? x)), w && /* @__PURE__ */ a("li", {
1647
+ "aria-hidden": !0,
1648
+ className: "m-0 flex items-center max-sm:hidden",
1649
+ children: /* @__PURE__ */ a(N.span, {
1650
+ initial: { opacity: 1 },
1651
+ animate: { opacity: 0 },
1652
+ transition: ca,
1653
+ onAnimationComplete: () => f(!1),
1654
+ className: ke,
1655
+ children: fe
1656
+ })
1657
+ })]
1658
+ })
1659
+ });
1660
+ }
1661
+ var ke = "text-pho-description -mx-1 inline-flex shrink-0 text-base select-none", fe = "/", Sn = 4, Tn = "…";
1662
+ function Ia({ href: e, className: t, morphId: n, children: r = "Back", ...s }) {
1663
+ const l = k(Ta), c = I(), p = n != null && !c, i = pa(p ? n : void 0);
1664
+ if (l == null) throw new Error("BasicPage.Crumb must be rendered inside BasicPage.Breadcrumbs");
1665
+ const { index: d, count: m, departing: o, narrow: h } = l, g = d === 0, v = d === m - 1, y = o != null && o.labels.length < m, w = o != null && o.labels.length > m, f = v && (o == null || y || h), A = g || v, x = g && v ? "" : g ? "max-sm:hidden" : "sm:hidden", E = o != null, S = v ? h ? w ? "slide" : "fade" : f ? "fade" : void 0 : void 0, [O, M] = _(p && h && i.fly && o != null && !w ? o.labels[o.labels.length - 1] : null), D = p && A && !E, W = p && !g && v && (o == null || y);
1666
+ return /* @__PURE__ */ b(Z, { children: [!g && /* @__PURE__ */ a("span", {
1667
+ "aria-hidden": !0,
1668
+ className: u(ke, "max-sm:hidden"),
1669
+ children: W ? /* @__PURE__ */ a(N.span, {
1670
+ initial: i.fly ? {
1671
+ opacity: 0,
1672
+ x: Ve
1673
+ } : { opacity: 0 },
1674
+ animate: i.fly ? {
1675
+ opacity: 1,
1676
+ x: 0
1677
+ } : { opacity: 1 },
1678
+ transition: i.fly ? je : F,
1679
+ className: "inline-flex",
1680
+ children: fe
1681
+ }) : fe
1682
+ }), /* @__PURE__ */ a(Re, {
1683
+ variant: "ghost",
1684
+ size: "sm",
1685
+ href: e,
1686
+ prefix: A ? D ? /* @__PURE__ */ a(N.span, {
1687
+ initial: i.fly ? {
1688
+ opacity: 0,
1689
+ x: Ve
1690
+ } : { opacity: 0 },
1691
+ animate: i.fly ? {
1692
+ opacity: 1,
1693
+ x: 0
1694
+ } : { opacity: 1 },
1695
+ transition: i.fly ? je : F,
1696
+ className: u("inline-flex [&>svg]:size-[1.125em] [&>svg]:shrink-0", x),
1697
+ children: /* @__PURE__ */ a(oe, {})
1698
+ }) : /* @__PURE__ */ a("span", {
1699
+ className: u("inline-flex [&>svg]:size-[1.125em] [&>svg]:shrink-0", x),
1700
+ children: /* @__PURE__ */ a(oe, {})
1701
+ }) : /* @__PURE__ */ a("span", { className: "hidden" }),
1702
+ className: u("min-w-max", t),
1703
+ ...s,
1704
+ children: p && n != null ? /* @__PURE__ */ b("span", {
1705
+ className: u("relative block", !i.fly && S === "slide" && "overflow-hidden", !v && "max-w-40 truncate"),
1706
+ children: [/* @__PURE__ */ a(ma, {
1707
+ morphId: n,
1708
+ fromClassName: "text-pho-primary",
1709
+ fly: i.fly,
1710
+ morphRef: i.ref,
1711
+ arrival: S,
1712
+ children: r
1713
+ }), O != null && /* @__PURE__ */ a(N.span, {
1714
+ "aria-hidden": !0,
1715
+ initial: {
1716
+ x: 0,
1717
+ opacity: 1
1718
+ },
1719
+ animate: {
1720
+ x: bt,
1721
+ opacity: 0
1722
+ },
1723
+ transition: vt,
1724
+ onAnimationComplete: () => M(null),
1725
+ className: "pointer-events-none absolute inset-y-0 left-0 whitespace-nowrap",
1726
+ children: O
1727
+ })]
1728
+ }) : /* @__PURE__ */ a("span", {
1729
+ className: u("block", !v && "max-w-40 truncate"),
1730
+ children: r
1731
+ })
1732
+ })] });
1733
+ }
1734
+ function Pn({ className: e, ...t }) {
1735
+ return /* @__PURE__ */ a(Pa, {
1736
+ className: e,
1737
+ children: /* @__PURE__ */ a(Ia, { ...t })
1738
+ });
1739
+ }
1740
+ function In({ label: e, description: t, leading: n, href: r, className: s, children: l, ...c }) {
1741
+ const p = Ze(), i = V(() => N.create(p), [p]), { leaving: d, ...m } = ee();
1742
+ return /* @__PURE__ */ b(i, {
1743
+ href: r,
1744
+ ...m,
1745
+ ...c,
1746
+ className: u("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", s),
1747
+ children: [/* @__PURE__ */ b("div", {
1748
+ className: u("flex min-w-0 flex-1 items-center", n != null && "gap-3"),
1749
+ children: [n, /* @__PURE__ */ b("div", {
1750
+ className: "min-w-0",
1751
+ children: [/* @__PURE__ */ a("div", {
1752
+ className: "flex min-w-0 items-center gap-1",
1753
+ children: typeof e == "string" || typeof e == "number" ? /* @__PURE__ */ a("p", {
1754
+ className: "text-pho-primary truncate text-base font-medium",
1755
+ children: e
1756
+ }) : e
1757
+ }), t ? /* @__PURE__ */ a("div", {
1758
+ className: "text-pho-description truncate text-xs",
1759
+ children: t
1760
+ }) : null]
1761
+ })]
1762
+ }), /* @__PURE__ */ b("div", {
1763
+ className: "flex min-w-0 items-center justify-end gap-2",
1764
+ children: [l != null ? /* @__PURE__ */ a("div", {
1765
+ className: "min-w-0",
1766
+ children: l
1767
+ }) : null, /* @__PURE__ */ a(ja, {
1768
+ "aria-hidden": !0,
1769
+ className: "text-pho-secondary group-hover:text-pho-secondary-hover size-4 shrink-0 transition-colors"
1770
+ })]
1771
+ })]
1772
+ });
1773
+ }
1774
+ function On({ open: e, variant: t = "overlay", modal: n = !1, placeholder: r, onClose: s, width: l = "default", presentation: c, defaultPresentation: p, onPresentationChange: i, expandable: d = !0, children: m }) {
1775
+ const o = k(sa), h = o != null ? ot(o.paneWidth, l) : 0, g = e ?? U.toArray(m).length > 0, { presentation: v, setPresentation: y, canChoose: w } = Ln({
1776
+ isOpen: g,
1777
+ paneNarrow: o?.paneNarrow ?? !1,
1778
+ presentation: c,
1779
+ defaultPresentation: p,
1780
+ onPresentationChange: i
1781
+ }), f = o?.setOpen, A = o?.setAsPage, x = o?.setPresent;
1782
+ if (H(() => {
1783
+ if (x != null)
1784
+ return x(!0), () => x(!1);
1785
+ }, [x]), H(() => {
1786
+ if (f != null)
1787
+ return f(g), () => f(!1);
1788
+ }, [f, g]), H(() => {
1789
+ if (A != null)
1790
+ return A(v === "page"), () => A(!1);
1791
+ }, [A, v]), L(() => {
1792
+ o == null && typeof process < "u" && process.env.NODE_ENV !== "production" && console.warn("BasicPage.Aside: needs a `BasicPage.Root` around it.");
1793
+ }, [o]), o == null || o.slot == null) return null;
1794
+ const E = d && w ? () => y("page") : void 0;
1795
+ if (v === "page") {
1796
+ const S = d && w && !o.paneNarrow ? () => y("panel") : void 0;
1797
+ return Ge(g ? /* @__PURE__ */ b("div", {
1798
+ "data-basic-page-aside": "page",
1799
+ "data-basic-page-aside-expanded": o.paneNarrow ? void 0 : "",
1800
+ className: "relative flex min-w-0 flex-1 flex-col",
1801
+ children: [S != null ? /* @__PURE__ */ a("span", {
1802
+ className: "absolute top-2 right-2 z-30",
1803
+ children: /* @__PURE__ */ a(X.Provider, { children: /* @__PURE__ */ a(La, {
1804
+ label: "Show as panel",
1805
+ icon: /* @__PURE__ */ a($a, {}),
1806
+ onClick: S
1807
+ }) })
1808
+ }) : null, m]
1809
+ }) : null, o.slot);
1810
+ }
1811
+ return t === "inline" ? Ge(/* @__PURE__ */ a(Bn, {
1812
+ width: h,
1813
+ paneHeight: o.paneHeight,
1814
+ onClose: s,
1815
+ onExpand: E,
1816
+ open: g,
1817
+ placeholder: r,
1818
+ children: m
1819
+ }), o.slot) : /* @__PURE__ */ a(Mn, {
1820
+ container: o.slot,
1821
+ width: h,
1822
+ paneHeight: o.paneHeight,
1823
+ onClose: s,
1824
+ onExpand: E,
1825
+ open: g,
1826
+ modal: n,
1827
+ children: m
1828
+ });
1829
+ }
1830
+ function Ln({ isOpen: e, paneNarrow: t, presentation: n, defaultPresentation: r, onPresentationChange: s }) {
1831
+ const [l, c] = _(e), [p, i] = _(null);
1832
+ H(() => {
1833
+ e || (c(!1), i(null));
1834
+ }, [e]);
1835
+ const d = n != null;
1836
+ return {
1837
+ presentation: t ? "page" : n ?? p ?? r ?? (l ? "page" : "panel"),
1838
+ setPresentation: Pe((m) => {
1839
+ d || i(m), s?.(m);
1840
+ }, [d, s]),
1841
+ canChoose: !d || s != null
1842
+ };
1843
+ }
1844
+ function Oa() {
1845
+ const [e, t] = _(null), n = V(() => ({ setBack: t }), []), r = C(null);
1846
+ return {
1847
+ back: e,
1848
+ panel: n,
1849
+ closeRef: r,
1850
+ leave: Pe(() => {
1851
+ const s = r.current?.querySelector("a, button");
1852
+ return s == null ? !1 : (s.click(), !0);
1853
+ }, [])
1854
+ };
1855
+ }
1856
+ var Ye = {
1857
+ variant: "ghost",
1858
+ size: "sm",
1859
+ svgOnly: !0,
1860
+ "aria-label": "Close",
1861
+ children: /* @__PURE__ */ a(ea, {})
1862
+ };
1863
+ function La({ label: e, icon: t, onClick: n }) {
1864
+ return /* @__PURE__ */ b(X.Root, { children: [/* @__PURE__ */ a(X.Trigger, { render: /* @__PURE__ */ a(ne, {
1865
+ variant: "ghost",
1866
+ size: "sm",
1867
+ svgOnly: !0,
1868
+ "aria-label": e,
1869
+ onClick: n,
1870
+ children: t
1871
+ }) }), /* @__PURE__ */ a(X.Portal, { children: /* @__PURE__ */ a(X.Positioner, { children: /* @__PURE__ */ a(X.Popup, { children: e }) }) })] });
1872
+ }
1873
+ function Ba({ back: e, onClose: t, onExpand: n, closeRef: r, panel: s, children: l }) {
1874
+ return /* @__PURE__ */ b(Z, { children: [/* @__PURE__ */ b("span", {
1875
+ className: "absolute top-2 right-2 z-30 flex items-center gap-0.5",
1876
+ children: [n != null ? /* @__PURE__ */ a(X.Provider, { children: /* @__PURE__ */ a(La, {
1877
+ label: "Expand",
1878
+ icon: /* @__PURE__ */ a(Wa, {}),
1879
+ onClick: n
1880
+ }) }) : null, /* @__PURE__ */ a("span", {
1881
+ ref: r,
1882
+ className: "contents",
1883
+ children: e != null ? /* @__PURE__ */ a(Re, {
1884
+ ...Ye,
1885
+ href: e.href,
1886
+ onClick: e.onClick
1887
+ }) : t != null ? /* @__PURE__ */ a(ne, {
1888
+ ...Ye,
1889
+ onClick: t
1890
+ }) : null
1891
+ })]
1892
+ }), /* @__PURE__ */ b(te.Root, {
1893
+ className: "min-h-0 min-w-0 flex-1",
1894
+ children: [/* @__PURE__ */ a(te.Viewport, {
1895
+ className: "overflow-x-hidden",
1896
+ style: { overflowX: "hidden" },
1897
+ children: /* @__PURE__ */ a(te.Content, {
1898
+ className: "flex min-h-full w-full min-w-0 flex-col",
1899
+ style: {
1900
+ minWidth: 0,
1901
+ width: "100%",
1902
+ maxWidth: "100%"
1903
+ },
1904
+ children: /* @__PURE__ */ a(la.Provider, {
1905
+ value: s,
1906
+ children: l
1907
+ })
1908
+ })
1909
+ }), /* @__PURE__ */ a(te.Scrollbar, { children: /* @__PURE__ */ a(te.Thumb, {}) })]
1910
+ })] });
1911
+ }
1912
+ function Bn({ width: e, paneHeight: t, onClose: n, onExpand: r, open: s, placeholder: l, children: c }) {
1913
+ const p = I(), { back: i, panel: d, closeRef: m, leave: o } = Oa(), h = p ? "blur(0px)" : `blur(${Te}px)`, g = t ?? "100dvh";
1914
+ L(() => {
1915
+ const y = (w) => {
1916
+ w.key !== "Escape" || w.defaultPrevented || o() && w.preventDefault();
1917
+ };
1918
+ return document.addEventListener("keydown", y), () => document.removeEventListener("keydown", y);
1919
+ }, [o]);
1920
+ const v = {
1921
+ initial: {
1922
+ opacity: 0,
1923
+ filter: h
1924
+ },
1925
+ animate: {
1926
+ opacity: 1,
1927
+ filter: "blur(0px)"
1928
+ },
1929
+ exit: {
1930
+ opacity: 0,
1931
+ filter: h
1932
+ },
1933
+ transition: p ? { duration: 0 } : ue
1934
+ };
1935
+ return /* @__PURE__ */ a("aside", {
1936
+ "data-basic-page-aside": "panel",
1937
+ "data-basic-page-aside-variant": "inline",
1938
+ className: "relative flex min-w-0 shrink-0 flex-col",
1939
+ style: {
1940
+ width: e,
1941
+ minWidth: 0,
1942
+ maxWidth: e,
1943
+ minHeight: g
1944
+ },
1945
+ children: /* @__PURE__ */ a("div", {
1946
+ className: "border-pho-secondary bg-pho-primary sticky top-0 grid min-w-0 overflow-hidden border-l *:min-h-0 *:[grid-area:1/1]",
1947
+ style: { height: g },
1948
+ children: /* @__PURE__ */ a(z, {
1949
+ initial: !1,
1950
+ children: s ? /* @__PURE__ */ a(N.div, {
1951
+ ...v,
1952
+ className: "relative flex min-w-0 flex-col",
1953
+ children: /* @__PURE__ */ a(Ba, {
1954
+ back: i,
1955
+ onClose: n,
1956
+ onExpand: r,
1957
+ closeRef: m,
1958
+ panel: d,
1959
+ children: c
1960
+ })
1961
+ }, "page") : /* @__PURE__ */ a(N.div, {
1962
+ ...v,
1963
+ className: "flex flex-col",
1964
+ children: l
1965
+ }, "empty")
1966
+ })
1967
+ })
1968
+ });
1969
+ }
1970
+ function Mn({ container: e, width: t, paneHeight: n, onClose: r, onExpand: s, open: l, modal: c, children: p }) {
1971
+ const { back: i, panel: d, closeRef: m, leave: o } = Oa(), h = n ?? "100dvh";
1972
+ return /* @__PURE__ */ a(se.Root, {
1973
+ open: l,
1974
+ modal: c ? "trap-focus" : !1,
1975
+ disablePointerDismissal: !0,
1976
+ onOpenChange: (g, v) => {
1977
+ g || (v.cancel(), o());
1978
+ },
1979
+ children: /* @__PURE__ */ b(se.Portal, {
1980
+ container: e,
1981
+ className: "contents",
1982
+ children: [c ? /* @__PURE__ */ a(se.Backdrop, {
1983
+ "data-basic-page-aside-backdrop": "",
1984
+ className: u("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"),
1985
+ onClick: o
1986
+ }) : null, /* @__PURE__ */ a(se.Popup, {
1987
+ "data-basic-page-aside": "panel",
1988
+ "data-basic-page-aside-variant": "overlay",
1989
+ initialFocus: c ? void 0 : !1,
1990
+ finalFocus: c ? void 0 : !1,
1991
+ className: u("absolute inset-y-0 right-0 z-30 flex min-w-0 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"),
1992
+ style: {
1993
+ width: t,
1994
+ minWidth: 0,
1995
+ maxWidth: t
1996
+ },
1997
+ children: /* @__PURE__ */ a("div", {
1998
+ className: "border-pho-secondary bg-pho-primary shadow-pho-xl sticky top-0 flex min-w-0 flex-col overflow-hidden border-l",
1999
+ style: { height: h },
2000
+ children: /* @__PURE__ */ a(Ba, {
2001
+ back: i,
2002
+ onClose: r,
2003
+ onExpand: s,
2004
+ closeRef: m,
2005
+ panel: d,
2006
+ children: p
2007
+ })
2008
+ })
2009
+ })]
2010
+ })
2011
+ });
2012
+ }
2013
+ var Dn = "14rem", Fn = "transition-[width] duration-[330ms] ease-pho-spring motion-reduce:transition-none", Je = "transition-[opacity,visibility] duration-200 ease-out motion-reduce:transition-none";
2014
+ function Hn({ variant: e = "box", fold: t = "auto", value: n, onValueChange: r, placeholder: s, label: l, className: c, ...p }) {
2015
+ const i = k(Se), d = he(i?.subscribe ?? be, () => i?.get().api ?? null, () => null), m = n != null;
2016
+ L(() => {
2017
+ if (!(i == null || m))
2018
+ return i.adopt(!0), () => i.adopt(!1);
2019
+ }, [i, m]);
2020
+ const o = m ? {
2021
+ query: n,
2022
+ setQuery: r,
2023
+ placeholder: s ?? "Search",
2024
+ label: l ?? s ?? "Search"
2025
+ } : d == null ? null : {
2026
+ query: d.query,
2027
+ setQuery: d.setQuery,
2028
+ placeholder: d.placeholder,
2029
+ label: l ?? d.placeholder
2030
+ }, [h, g] = _(!1), v = C(null), y = h || (o?.query ?? "") !== "";
2031
+ if (L(() => {
2032
+ if (!h) return;
2033
+ let f = 0, A = 0;
2034
+ const x = () => {
2035
+ const E = v.current;
2036
+ E != null && (E.focus(), document.activeElement !== E && A++ < 5 && (f = requestAnimationFrame(x)));
2037
+ };
2038
+ return f = requestAnimationFrame(x), () => cancelAnimationFrame(f);
2039
+ }, [h]), e === "ghost") return /* @__PURE__ */ a("div", {
2040
+ "data-basic-page-search": "",
2041
+ "data-variant": "ghost",
2042
+ className: u("flex min-w-0 flex-1", o == null && "hidden", c),
2043
+ ...p,
2044
+ children: o != null && /* @__PURE__ */ a(et, {
2045
+ value: o.query,
2046
+ onChange: o.setQuery,
2047
+ onClear: () => o.setQuery(""),
2048
+ placeholder: o.placeholder,
2049
+ "aria-label": o.label,
2050
+ onKeyDown: (f) => {
2051
+ f.key === "Escape" && (f.preventDefault(), o.setQuery(""), f.currentTarget.blur());
2052
+ }
2053
+ })
2054
+ });
2055
+ const w = t === "auto";
2056
+ return /* @__PURE__ */ a("div", {
2057
+ "data-basic-page-search": "",
2058
+ "data-expanded": y || void 0,
2059
+ className: u("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", o == null && "hidden", c),
2060
+ ...p,
2061
+ children: o != null && /* @__PURE__ */ b("div", {
2062
+ className: u("grid w-9 max-w-full justify-items-end *:[grid-area:1/1]", Fn, w && "@[36rem]:w-56"),
2063
+ style: y ? { width: Dn } : void 0,
2064
+ children: [/* @__PURE__ */ a(ne, {
2065
+ variant: "outlined",
2066
+ size: "sm",
2067
+ shape: "circle",
2068
+ svgOnly: !0,
2069
+ "aria-label": o.label,
2070
+ "aria-hidden": y || void 0,
2071
+ tabIndex: y ? -1 : void 0,
2072
+ onClick: () => g(!0),
2073
+ className: u(Je, y ? "pointer-events-none invisible opacity-0" : "visible opacity-100", w && "@[36rem]:pointer-events-none @[36rem]:invisible @[36rem]:opacity-0"),
2074
+ children: /* @__PURE__ */ a(qa, {})
2075
+ }), /* @__PURE__ */ a("div", {
2076
+ inert: !w && !y,
2077
+ className: u("w-full min-w-0", Je, y ? "visible opacity-100" : "pointer-events-none invisible opacity-0", w && "@[36rem]:pointer-events-auto @[36rem]:visible @[36rem]:opacity-100"),
2078
+ children: /* @__PURE__ */ a(at, {
2079
+ ref: v,
2080
+ value: o.query,
2081
+ onChange: (f) => o.setQuery(f.target.value),
2082
+ onClear: () => o.setQuery(""),
2083
+ onBlur: () => {
2084
+ o.query === "" && g(!1);
2085
+ },
2086
+ onKeyDown: (f) => {
2087
+ f.key === "Escape" && (f.preventDefault(), o.setQuery(""), g(!1), f.currentTarget.blur());
2088
+ },
2089
+ placeholder: o.placeholder,
2090
+ "aria-label": o.label,
2091
+ className: "w-full"
2092
+ })
2093
+ })]
2094
+ })
2095
+ });
2096
+ }
2097
+ function zn({ header: e, main: t, side: n, foot: r, enter: s }) {
2098
+ const l = n != null;
2099
+ return /* @__PURE__ */ a("div", {
2100
+ "data-basic-page-columns": "",
2101
+ className: "@container w-full min-w-0",
2102
+ children: /* @__PURE__ */ b("div", {
2103
+ className: u("mx-auto w-full max-w-[42rem]", l && "@min-[73.5rem]:max-w-none"),
2104
+ children: [e, /* @__PURE__ */ b("div", {
2105
+ className: u("grid gap-x-10 gap-y-4", l && "@min-[73.5rem]:grid-cols-[minmax(42rem,1fr)_minmax(29rem,32rem)] @min-[73.5rem]:grid-rows-[auto_minmax(0,1fr)]", l && "[&>[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"),
2106
+ children: [
2107
+ /* @__PURE__ */ a(le, {
2108
+ enter: s,
2109
+ "data-basic-page-columns-main": "",
2110
+ className: u("[[data-basic-page-stack]>[data-basic-page-columns]_&]:mt-0", l && "@min-[73.5rem]:col-start-1 @min-[73.5rem]:row-span-2 @min-[73.5rem]:row-start-1"),
2111
+ children: t
2112
+ }),
2113
+ l ? /* @__PURE__ */ a(le, {
2114
+ enter: s,
2115
+ "data-basic-page-columns-side": "",
2116
+ className: u("[[data-basic-page-stack]>[data-basic-page-columns]_&]:mt-0", "@min-[73.5rem]:col-start-2 @min-[73.5rem]:row-start-1"),
2117
+ children: n
2118
+ }) : null,
2119
+ r != null ? /* @__PURE__ */ a(le, {
2120
+ enter: s,
2121
+ "data-basic-page-columns-foot": "",
2122
+ className: u("[[data-basic-page-stack]>[data-basic-page-columns]_&]:mt-0", l && "@min-[73.5rem]:col-start-2 @min-[73.5rem]:row-start-2 @min-[73.5rem]:self-start"),
2123
+ children: r
2124
+ }) : null
2125
+ ]
2126
+ })]
2127
+ })
2128
+ });
2129
+ }
2130
+ var vr = {
2131
+ Root: ut,
2132
+ Aside: On,
2133
+ Search: Hn,
2134
+ Table: Qa,
2135
+ Code: Va,
2136
+ CondenseScope: wt,
2137
+ Breadcrumbs: Pa,
2138
+ Crumb: Ia,
2139
+ Back: Pn,
2140
+ Title: Rt,
2141
+ TitleAccessory: kt,
2142
+ Stack: le,
2143
+ Columns: zn,
2144
+ Header: Dt,
2145
+ HeaderAction: Ft,
2146
+ SectionTitle: Ht,
2147
+ Description: ga,
2148
+ TableCount: zt,
2149
+ SectionFooter: Gt,
2150
+ Card: $t,
2151
+ Item: Wt,
2152
+ ItemPanel: Vt,
2153
+ Callout: jt,
2154
+ CalloutTitle: qt,
2155
+ CalloutDescription: Kt,
2156
+ Onboard: Qt,
2157
+ Step: sn,
2158
+ Checklist: en,
2159
+ Check: an,
2160
+ Timeline: tn,
2161
+ TimelineItem: nn,
2162
+ Row: ln,
2163
+ RowLink: In,
2164
+ Value: on,
2165
+ Meta: ze.Root,
2166
+ MetaItem: ze.Item,
2167
+ Receipt: mn,
2168
+ ReceiptGroup: fn,
2169
+ ReceiptLine: hn,
2170
+ ReceiptTotal: gn,
2171
+ Alert: bn,
2172
+ Footer: An,
2173
+ Form: vn,
2174
+ Saved: yn,
2175
+ Fields: wn,
2176
+ Inline: Nn,
2177
+ Submit: _n,
2178
+ Reveal: He
2179
+ };
2180
+ export {
2181
+ it as a,
2182
+ vr as c,
2183
+ Nt as d,
2184
+ Ae as f,
2185
+ rt as i,
2186
+ ue as l,
2187
+ hr as m,
2188
+ $e as n,
2189
+ st as o,
2190
+ gr as p,
2191
+ na as r,
2192
+ nt as s,
2193
+ br as t,
2194
+ _t as u
2195
+ };
2196
+
2197
+ //# sourceMappingURL=basic-page-6dDfY33L.js.map