@altimateai/ui-components 0.0.21 → 0.0.23-beta.1

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.
package/dist/Form.js ADDED
@@ -0,0 +1,3657 @@
1
+ import { j as s, C as ba, c as Sa, b as xr, d as Ca, h as _a, a as jt, i as Na } from "./index2.js";
2
+ import * as a from "react";
3
+ import T, { forwardRef as ee } from "react";
4
+ import { aa as Ot, ab as yr, ac as Ye, ad as kt, ae as qe, c as E, af as Xe, ag as $t, ah as Lt, m as Ze, ai as je, i as Vt, a as Ne, D as Je, w as wr, E as br, j as Oe, u as q, aj as Sr, d as I, ak as Cr, al as _r, F as Nr, z as Ea, G as Er, P as $, A as Ra, g as Qe, H as Rr, am as Ir, l as Ia, x as Ft, J as Bt, k as Mr, y as ne, b as xe, $ as Ma, a4 as Aa, h as ce, an as Ar, ao as Da, C as Dr, e as Pa, V as Ta, M as ja, S as Oa } from "./Tooltip.js";
5
+ import * as Pr from "react-dom";
6
+ const rd = Ot, nd = yr, od = Ye, ka = kt, Tr = a.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
7
+ qe,
8
+ {
9
+ className: E(
10
+ "al-fixed al-inset-0 al-z-50 al-bg-black/80 al- data-[state=open]:al-animate-in data-[state=closed]:al-animate-out data-[state=closed]:al-fade-out-0 data-[state=open]:al-fade-in-0",
11
+ e
12
+ ),
13
+ ...r,
14
+ ref: t
15
+ }
16
+ ));
17
+ Tr.displayName = qe.displayName;
18
+ const $a = Ze(
19
+ "al-fixed al-z-50 al-gap-4 al-bg-background al-p-6 al-shadow-lg al-transition al-ease-in-out data-[state=open]:al-animate-in data-[state=closed]:al-animate-out data-[state=closed]:al-duration-300 data-[state=open]:al-duration-500",
20
+ {
21
+ variants: {
22
+ side: {
23
+ top: "al-inset-x-0 al-top-0 al-border-b data-[state=closed]:al-slide-out-to-top data-[state=open]:al-slide-in-from-top",
24
+ bottom: "al-inset-x-0 al-bottom-0 al-border-t data-[state=closed]:al-slide-out-to-bottom data-[state=open]:al-slide-in-from-bottom",
25
+ left: "al-inset-y-0 al-left-0 al-h-full al-w-3/4 al-border-r data-[state=closed]:al-slide-out-to-left data-[state=open]:al-slide-in-from-left sm:al-max-w-sm",
26
+ right: "al-inset-y-0 al-right-0 al-h-full al-w-3/4 al- al-border-l data-[state=closed]:al-slide-out-to-right data-[state=open]:al-slide-in-from-right sm:al-max-w-sm"
27
+ }
28
+ },
29
+ defaultVariants: {
30
+ side: "right"
31
+ }
32
+ }
33
+ ), La = a.forwardRef(({ side: e = "right", className: r, children: t, ...n }, o) => /* @__PURE__ */ s.jsxs(ka, { children: [
34
+ /* @__PURE__ */ s.jsx(Tr, {}),
35
+ /* @__PURE__ */ s.jsxs(Xe, { ref: o, className: E($a({ side: e }), r), ...n, children: [
36
+ t,
37
+ /* @__PURE__ */ s.jsxs(Ye, { className: "al-absolute al-right-4 al-top-4 al-rounded-sm al-opacity-70 al-ring-offset-background al-transition-opacity hover:al-opacity-100 focus:al-outline-none focus:al-ring-2 focus:al-ring-ring focus:al-ring-offset-2 disabled:al-pointer-events-none data-[state=open]:al-bg-secondary", children: [
38
+ /* @__PURE__ */ s.jsx(ba, { className: "al-h-4 al-w-4" }),
39
+ /* @__PURE__ */ s.jsx("span", { className: "al-sr-only", children: "Close" })
40
+ ] })
41
+ ] })
42
+ ] }));
43
+ La.displayName = Xe.displayName;
44
+ const Va = ({ className: e, ...r }) => /* @__PURE__ */ s.jsx(
45
+ "div",
46
+ {
47
+ className: E("al-flex al-flex-col al-space-y-2 al-text-center sm:al-text-left", e),
48
+ ...r
49
+ }
50
+ );
51
+ Va.displayName = "SheetHeader";
52
+ const Fa = ({ className: e, ...r }) => /* @__PURE__ */ s.jsx(
53
+ "div",
54
+ {
55
+ className: E(
56
+ "al-flex al-flex-col-reverse sm:al-flex-row sm:al-justify-end sm:al-space-x-2",
57
+ e
58
+ ),
59
+ ...r
60
+ }
61
+ );
62
+ Fa.displayName = "SheetFooter";
63
+ const Ba = a.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
64
+ $t,
65
+ {
66
+ ref: t,
67
+ className: E("al-text-lg al-font-semibold al-text-foreground", e),
68
+ ...r
69
+ }
70
+ ));
71
+ Ba.displayName = $t.displayName;
72
+ const Ga = a.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
73
+ Lt,
74
+ {
75
+ ref: t,
76
+ className: E("al-text-sm al-text-muted-foreground", e),
77
+ ...r
78
+ }
79
+ ));
80
+ Ga.displayName = Lt.displayName;
81
+ var jr = a.forwardRef((e, r) => {
82
+ const { children: t, ...n } = e, o = a.Children.toArray(t), l = o.find(Ka);
83
+ if (l) {
84
+ const i = l.props.children, c = o.map((d) => d === l ? a.Children.count(i) > 1 ? a.Children.only(null) : a.isValidElement(i) ? i.props.children : null : d);
85
+ return /* @__PURE__ */ s.jsx(wt, { ...n, ref: r, children: a.isValidElement(i) ? a.cloneElement(i, void 0, c) : null });
86
+ }
87
+ return /* @__PURE__ */ s.jsx(wt, { ...n, ref: r, children: t });
88
+ });
89
+ jr.displayName = "Slot";
90
+ var wt = a.forwardRef((e, r) => {
91
+ const { children: t, ...n } = e;
92
+ if (a.isValidElement(t)) {
93
+ const o = Wa(t);
94
+ return a.cloneElement(t, {
95
+ ...Ua(n, t.props),
96
+ // @ts-ignore
97
+ ref: r ? je(r, o) : o
98
+ });
99
+ }
100
+ return a.Children.count(t) > 1 ? a.Children.only(null) : null;
101
+ });
102
+ wt.displayName = "SlotClone";
103
+ var Ha = ({ children: e }) => /* @__PURE__ */ s.jsx(s.Fragment, { children: e });
104
+ function Ka(e) {
105
+ return a.isValidElement(e) && e.type === Ha;
106
+ }
107
+ function Ua(e, r) {
108
+ const t = { ...r };
109
+ for (const n in r) {
110
+ const o = e[n], l = r[n];
111
+ /^on[A-Z]/.test(n) ? o && l ? t[n] = (...c) => {
112
+ l(...c), o(...c);
113
+ } : o && (t[n] = o) : n === "style" ? t[n] = { ...o, ...l } : n === "className" && (t[n] = [o, l].filter(Boolean).join(" "));
114
+ }
115
+ return { ...e, ...t };
116
+ }
117
+ function Wa(e) {
118
+ var n, o;
119
+ let r = (n = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : n.get, t = r && "isReactWarning" in r && r.isReactWarning;
120
+ return t ? e.ref : (r = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, t = r && "isReactWarning" in r && r.isReactWarning, t ? e.props.ref : e.props.ref || e.ref);
121
+ }
122
+ var bt = ["Enter", " "], za = ["ArrowDown", "PageUp", "Home"], Or = ["ArrowUp", "PageDown", "End"], Ya = [...za, ...Or], qa = {
123
+ ltr: [...bt, "ArrowRight"],
124
+ rtl: [...bt, "ArrowLeft"]
125
+ }, Xa = {
126
+ ltr: ["ArrowLeft"],
127
+ rtl: ["ArrowRight"]
128
+ }, ke = "Menu", [De, Za, Ja] = Vt(ke), [Se, kr] = Ne(ke, [
129
+ Ja,
130
+ Je,
131
+ wr
132
+ ]), $e = Je(), $r = wr(), [Lr, pe] = Se(ke), [Qa, Le] = Se(ke), Vr = (e) => {
133
+ const { __scopeMenu: r, open: t = !1, children: n, dir: o, onOpenChange: l, modal: i = !0 } = e, c = $e(r), [d, u] = a.useState(null), f = a.useRef(!1), p = Qe(l), g = Ft(o);
134
+ return a.useEffect(() => {
135
+ const x = () => {
136
+ f.current = !0, document.addEventListener("pointerdown", y, { capture: !0, once: !0 }), document.addEventListener("pointermove", y, { capture: !0, once: !0 });
137
+ }, y = () => f.current = !1;
138
+ return document.addEventListener("keydown", x, { capture: !0 }), () => {
139
+ document.removeEventListener("keydown", x, { capture: !0 }), document.removeEventListener("pointerdown", y, { capture: !0 }), document.removeEventListener("pointermove", y, { capture: !0 });
140
+ };
141
+ }, []), /* @__PURE__ */ s.jsx(Bt, { ...c, children: /* @__PURE__ */ s.jsx(
142
+ Lr,
143
+ {
144
+ scope: r,
145
+ open: t,
146
+ onOpenChange: p,
147
+ content: d,
148
+ onContentChange: u,
149
+ children: /* @__PURE__ */ s.jsx(
150
+ Qa,
151
+ {
152
+ scope: r,
153
+ onClose: a.useCallback(() => p(!1), [p]),
154
+ isUsingKeyboardRef: f,
155
+ dir: g,
156
+ modal: i,
157
+ children: n
158
+ }
159
+ )
160
+ }
161
+ ) });
162
+ };
163
+ Vr.displayName = ke;
164
+ var el = "MenuAnchor", Gt = a.forwardRef(
165
+ (e, r) => {
166
+ const { __scopeMenu: t, ...n } = e, o = $e(t);
167
+ return /* @__PURE__ */ s.jsx(br, { ...o, ...n, ref: r });
168
+ }
169
+ );
170
+ Gt.displayName = el;
171
+ var Ht = "MenuPortal", [tl, Fr] = Se(Ht, {
172
+ forceMount: void 0
173
+ }), Br = (e) => {
174
+ const { __scopeMenu: r, forceMount: t, children: n, container: o } = e, l = pe(Ht, r);
175
+ return /* @__PURE__ */ s.jsx(tl, { scope: r, forceMount: t, children: /* @__PURE__ */ s.jsx(Oe, { present: t || l.open, children: /* @__PURE__ */ s.jsx(Mr, { asChild: !0, container: o, children: n }) }) });
176
+ };
177
+ Br.displayName = Ht;
178
+ var se = "MenuContent", [rl, Kt] = Se(se), Gr = a.forwardRef(
179
+ (e, r) => {
180
+ const t = Fr(se, e.__scopeMenu), { forceMount: n = t.forceMount, ...o } = e, l = pe(se, e.__scopeMenu), i = Le(se, e.__scopeMenu);
181
+ return /* @__PURE__ */ s.jsx(De.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ s.jsx(Oe, { present: n || l.open, children: /* @__PURE__ */ s.jsx(De.Slot, { scope: e.__scopeMenu, children: i.modal ? /* @__PURE__ */ s.jsx(nl, { ...o, ref: r }) : /* @__PURE__ */ s.jsx(ol, { ...o, ref: r }) }) }) });
182
+ }
183
+ ), nl = a.forwardRef(
184
+ (e, r) => {
185
+ const t = pe(se, e.__scopeMenu), n = a.useRef(null), o = q(r, n);
186
+ return a.useEffect(() => {
187
+ const l = n.current;
188
+ if (l) return Sr(l);
189
+ }, []), /* @__PURE__ */ s.jsx(
190
+ Ut,
191
+ {
192
+ ...e,
193
+ ref: o,
194
+ trapFocus: t.open,
195
+ disableOutsidePointerEvents: t.open,
196
+ disableOutsideScroll: !0,
197
+ onFocusOutside: I(
198
+ e.onFocusOutside,
199
+ (l) => l.preventDefault(),
200
+ { checkForDefaultPrevented: !1 }
201
+ ),
202
+ onDismiss: () => t.onOpenChange(!1)
203
+ }
204
+ );
205
+ }
206
+ ), ol = a.forwardRef((e, r) => {
207
+ const t = pe(se, e.__scopeMenu);
208
+ return /* @__PURE__ */ s.jsx(
209
+ Ut,
210
+ {
211
+ ...e,
212
+ ref: r,
213
+ trapFocus: !1,
214
+ disableOutsidePointerEvents: !1,
215
+ disableOutsideScroll: !1,
216
+ onDismiss: () => t.onOpenChange(!1)
217
+ }
218
+ );
219
+ }), Ut = a.forwardRef(
220
+ (e, r) => {
221
+ const {
222
+ __scopeMenu: t,
223
+ loop: n = !1,
224
+ trapFocus: o,
225
+ onOpenAutoFocus: l,
226
+ onCloseAutoFocus: i,
227
+ disableOutsidePointerEvents: c,
228
+ onEntryFocus: d,
229
+ onEscapeKeyDown: u,
230
+ onPointerDownOutside: f,
231
+ onFocusOutside: p,
232
+ onInteractOutside: g,
233
+ onDismiss: x,
234
+ disableOutsideScroll: y,
235
+ ...v
236
+ } = e, w = pe(se, t), S = Le(se, t), h = $e(t), _ = $r(t), L = Za(t), [V, j] = a.useState(null), P = a.useRef(null), K = q(r, P, w.onContentChange), G = a.useRef(0), U = a.useRef(""), re = a.useRef(0), Z = a.useRef(null), oe = a.useRef("right"), W = a.useRef(0), J = y ? Ir : a.Fragment, H = y ? { as: jr, allowPinchZoom: !0 } : void 0, Q = (N) => {
237
+ var b, A;
238
+ const Y = U.current + N, X = L().filter((O) => !O.disabled), m = document.activeElement, R = (b = X.find((O) => O.ref.current === m)) == null ? void 0 : b.textValue, M = X.map((O) => O.textValue), C = vl(M, Y, R), D = (A = X.find((O) => O.textValue === C)) == null ? void 0 : A.ref.current;
239
+ (function O(k) {
240
+ U.current = k, window.clearTimeout(G.current), k !== "" && (G.current = window.setTimeout(() => O(""), 1e3));
241
+ })(Y), D && setTimeout(() => D.focus());
242
+ };
243
+ a.useEffect(() => () => window.clearTimeout(G.current), []), Cr();
244
+ const z = a.useCallback((N) => {
245
+ var X, m;
246
+ return oe.current === ((X = Z.current) == null ? void 0 : X.side) && xl(N, (m = Z.current) == null ? void 0 : m.area);
247
+ }, []);
248
+ return /* @__PURE__ */ s.jsx(
249
+ rl,
250
+ {
251
+ scope: t,
252
+ searchRef: U,
253
+ onItemEnter: a.useCallback(
254
+ (N) => {
255
+ z(N) && N.preventDefault();
256
+ },
257
+ [z]
258
+ ),
259
+ onItemLeave: a.useCallback(
260
+ (N) => {
261
+ var Y;
262
+ z(N) || ((Y = P.current) == null || Y.focus(), j(null));
263
+ },
264
+ [z]
265
+ ),
266
+ onTriggerLeave: a.useCallback(
267
+ (N) => {
268
+ z(N) && N.preventDefault();
269
+ },
270
+ [z]
271
+ ),
272
+ pointerGraceTimerRef: re,
273
+ onPointerGraceIntentChange: a.useCallback((N) => {
274
+ Z.current = N;
275
+ }, []),
276
+ children: /* @__PURE__ */ s.jsx(J, { ...H, children: /* @__PURE__ */ s.jsx(
277
+ _r,
278
+ {
279
+ asChild: !0,
280
+ trapped: o,
281
+ onMountAutoFocus: I(l, (N) => {
282
+ var Y;
283
+ N.preventDefault(), (Y = P.current) == null || Y.focus({ preventScroll: !0 });
284
+ }),
285
+ onUnmountAutoFocus: i,
286
+ children: /* @__PURE__ */ s.jsx(
287
+ Nr,
288
+ {
289
+ asChild: !0,
290
+ disableOutsidePointerEvents: c,
291
+ onEscapeKeyDown: u,
292
+ onPointerDownOutside: f,
293
+ onFocusOutside: p,
294
+ onInteractOutside: g,
295
+ onDismiss: x,
296
+ children: /* @__PURE__ */ s.jsx(
297
+ Ea,
298
+ {
299
+ asChild: !0,
300
+ ..._,
301
+ dir: S.dir,
302
+ orientation: "vertical",
303
+ loop: n,
304
+ currentTabStopId: V,
305
+ onCurrentTabStopIdChange: j,
306
+ onEntryFocus: I(d, (N) => {
307
+ S.isUsingKeyboardRef.current || N.preventDefault();
308
+ }),
309
+ preventScrollOnEntryFocus: !0,
310
+ children: /* @__PURE__ */ s.jsx(
311
+ Er,
312
+ {
313
+ role: "menu",
314
+ "aria-orientation": "vertical",
315
+ "data-state": an(w.open),
316
+ "data-radix-menu-content": "",
317
+ dir: S.dir,
318
+ ...h,
319
+ ...v,
320
+ ref: K,
321
+ style: { outline: "none", ...v.style },
322
+ onKeyDown: I(v.onKeyDown, (N) => {
323
+ const X = N.target.closest("[data-radix-menu-content]") === N.currentTarget, m = N.ctrlKey || N.altKey || N.metaKey, R = N.key.length === 1;
324
+ X && (N.key === "Tab" && N.preventDefault(), !m && R && Q(N.key));
325
+ const M = P.current;
326
+ if (N.target !== M || !Ya.includes(N.key)) return;
327
+ N.preventDefault();
328
+ const D = L().filter((b) => !b.disabled).map((b) => b.ref.current);
329
+ Or.includes(N.key) && D.reverse(), ml(D);
330
+ }),
331
+ onBlur: I(e.onBlur, (N) => {
332
+ N.currentTarget.contains(N.target) || (window.clearTimeout(G.current), U.current = "");
333
+ }),
334
+ onPointerMove: I(
335
+ e.onPointerMove,
336
+ Pe((N) => {
337
+ const Y = N.target, X = W.current !== N.clientX;
338
+ if (N.currentTarget.contains(Y) && X) {
339
+ const m = N.clientX > W.current ? "right" : "left";
340
+ oe.current = m, W.current = N.clientX;
341
+ }
342
+ })
343
+ )
344
+ }
345
+ )
346
+ }
347
+ )
348
+ }
349
+ )
350
+ }
351
+ ) })
352
+ }
353
+ );
354
+ }
355
+ );
356
+ Gr.displayName = se;
357
+ var al = "MenuGroup", Wt = a.forwardRef(
358
+ (e, r) => {
359
+ const { __scopeMenu: t, ...n } = e;
360
+ return /* @__PURE__ */ s.jsx($.div, { role: "group", ...n, ref: r });
361
+ }
362
+ );
363
+ Wt.displayName = al;
364
+ var ll = "MenuLabel", Hr = a.forwardRef(
365
+ (e, r) => {
366
+ const { __scopeMenu: t, ...n } = e;
367
+ return /* @__PURE__ */ s.jsx($.div, { ...n, ref: r });
368
+ }
369
+ );
370
+ Hr.displayName = ll;
371
+ var Ke = "MenuItem", sr = "menu.itemSelect", et = a.forwardRef(
372
+ (e, r) => {
373
+ const { disabled: t = !1, onSelect: n, ...o } = e, l = a.useRef(null), i = Le(Ke, e.__scopeMenu), c = Kt(Ke, e.__scopeMenu), d = q(r, l), u = a.useRef(!1), f = () => {
374
+ const p = l.current;
375
+ if (!t && p) {
376
+ const g = new CustomEvent(sr, { bubbles: !0, cancelable: !0 });
377
+ p.addEventListener(sr, (x) => n == null ? void 0 : n(x), { once: !0 }), Ia(p, g), g.defaultPrevented ? u.current = !1 : i.onClose();
378
+ }
379
+ };
380
+ return /* @__PURE__ */ s.jsx(
381
+ Kr,
382
+ {
383
+ ...o,
384
+ ref: d,
385
+ disabled: t,
386
+ onClick: I(e.onClick, f),
387
+ onPointerDown: (p) => {
388
+ var g;
389
+ (g = e.onPointerDown) == null || g.call(e, p), u.current = !0;
390
+ },
391
+ onPointerUp: I(e.onPointerUp, (p) => {
392
+ var g;
393
+ u.current || (g = p.currentTarget) == null || g.click();
394
+ }),
395
+ onKeyDown: I(e.onKeyDown, (p) => {
396
+ const g = c.searchRef.current !== "";
397
+ t || g && p.key === " " || bt.includes(p.key) && (p.currentTarget.click(), p.preventDefault());
398
+ })
399
+ }
400
+ );
401
+ }
402
+ );
403
+ et.displayName = Ke;
404
+ var Kr = a.forwardRef(
405
+ (e, r) => {
406
+ const { __scopeMenu: t, disabled: n = !1, textValue: o, ...l } = e, i = Kt(Ke, t), c = $r(t), d = a.useRef(null), u = q(r, d), [f, p] = a.useState(!1), [g, x] = a.useState("");
407
+ return a.useEffect(() => {
408
+ const y = d.current;
409
+ y && x((y.textContent ?? "").trim());
410
+ }, [l.children]), /* @__PURE__ */ s.jsx(
411
+ De.ItemSlot,
412
+ {
413
+ scope: t,
414
+ disabled: n,
415
+ textValue: o ?? g,
416
+ children: /* @__PURE__ */ s.jsx(Ra, { asChild: !0, ...c, focusable: !n, children: /* @__PURE__ */ s.jsx(
417
+ $.div,
418
+ {
419
+ role: "menuitem",
420
+ "data-highlighted": f ? "" : void 0,
421
+ "aria-disabled": n || void 0,
422
+ "data-disabled": n ? "" : void 0,
423
+ ...l,
424
+ ref: u,
425
+ onPointerMove: I(
426
+ e.onPointerMove,
427
+ Pe((y) => {
428
+ n ? i.onItemLeave(y) : (i.onItemEnter(y), y.defaultPrevented || y.currentTarget.focus({ preventScroll: !0 }));
429
+ })
430
+ ),
431
+ onPointerLeave: I(
432
+ e.onPointerLeave,
433
+ Pe((y) => i.onItemLeave(y))
434
+ ),
435
+ onFocus: I(e.onFocus, () => p(!0)),
436
+ onBlur: I(e.onBlur, () => p(!1))
437
+ }
438
+ ) })
439
+ }
440
+ );
441
+ }
442
+ ), sl = "MenuCheckboxItem", Ur = a.forwardRef(
443
+ (e, r) => {
444
+ const { checked: t = !1, onCheckedChange: n, ...o } = e;
445
+ return /* @__PURE__ */ s.jsx(Xr, { scope: e.__scopeMenu, checked: t, children: /* @__PURE__ */ s.jsx(
446
+ et,
447
+ {
448
+ role: "menuitemcheckbox",
449
+ "aria-checked": Ue(t) ? "mixed" : t,
450
+ ...o,
451
+ ref: r,
452
+ "data-state": qt(t),
453
+ onSelect: I(
454
+ o.onSelect,
455
+ () => n == null ? void 0 : n(Ue(t) ? !0 : !t),
456
+ { checkForDefaultPrevented: !1 }
457
+ )
458
+ }
459
+ ) });
460
+ }
461
+ );
462
+ Ur.displayName = sl;
463
+ var Wr = "MenuRadioGroup", [il, cl] = Se(
464
+ Wr,
465
+ { value: void 0, onValueChange: () => {
466
+ } }
467
+ ), zr = a.forwardRef(
468
+ (e, r) => {
469
+ const { value: t, onValueChange: n, ...o } = e, l = Qe(n);
470
+ return /* @__PURE__ */ s.jsx(il, { scope: e.__scopeMenu, value: t, onValueChange: l, children: /* @__PURE__ */ s.jsx(Wt, { ...o, ref: r }) });
471
+ }
472
+ );
473
+ zr.displayName = Wr;
474
+ var Yr = "MenuRadioItem", qr = a.forwardRef(
475
+ (e, r) => {
476
+ const { value: t, ...n } = e, o = cl(Yr, e.__scopeMenu), l = t === o.value;
477
+ return /* @__PURE__ */ s.jsx(Xr, { scope: e.__scopeMenu, checked: l, children: /* @__PURE__ */ s.jsx(
478
+ et,
479
+ {
480
+ role: "menuitemradio",
481
+ "aria-checked": l,
482
+ ...n,
483
+ ref: r,
484
+ "data-state": qt(l),
485
+ onSelect: I(
486
+ n.onSelect,
487
+ () => {
488
+ var i;
489
+ return (i = o.onValueChange) == null ? void 0 : i.call(o, t);
490
+ },
491
+ { checkForDefaultPrevented: !1 }
492
+ )
493
+ }
494
+ ) });
495
+ }
496
+ );
497
+ qr.displayName = Yr;
498
+ var zt = "MenuItemIndicator", [Xr, dl] = Se(
499
+ zt,
500
+ { checked: !1 }
501
+ ), Zr = a.forwardRef(
502
+ (e, r) => {
503
+ const { __scopeMenu: t, forceMount: n, ...o } = e, l = dl(zt, t);
504
+ return /* @__PURE__ */ s.jsx(
505
+ Oe,
506
+ {
507
+ present: n || Ue(l.checked) || l.checked === !0,
508
+ children: /* @__PURE__ */ s.jsx(
509
+ $.span,
510
+ {
511
+ ...o,
512
+ ref: r,
513
+ "data-state": qt(l.checked)
514
+ }
515
+ )
516
+ }
517
+ );
518
+ }
519
+ );
520
+ Zr.displayName = zt;
521
+ var ul = "MenuSeparator", Jr = a.forwardRef(
522
+ (e, r) => {
523
+ const { __scopeMenu: t, ...n } = e;
524
+ return /* @__PURE__ */ s.jsx(
525
+ $.div,
526
+ {
527
+ role: "separator",
528
+ "aria-orientation": "horizontal",
529
+ ...n,
530
+ ref: r
531
+ }
532
+ );
533
+ }
534
+ );
535
+ Jr.displayName = ul;
536
+ var pl = "MenuArrow", Qr = a.forwardRef(
537
+ (e, r) => {
538
+ const { __scopeMenu: t, ...n } = e, o = $e(t);
539
+ return /* @__PURE__ */ s.jsx(Rr, { ...o, ...n, ref: r });
540
+ }
541
+ );
542
+ Qr.displayName = pl;
543
+ var Yt = "MenuSub", [fl, en] = Se(Yt), tn = (e) => {
544
+ const { __scopeMenu: r, children: t, open: n = !1, onOpenChange: o } = e, l = pe(Yt, r), i = $e(r), [c, d] = a.useState(null), [u, f] = a.useState(null), p = Qe(o);
545
+ return a.useEffect(() => (l.open === !1 && p(!1), () => p(!1)), [l.open, p]), /* @__PURE__ */ s.jsx(Bt, { ...i, children: /* @__PURE__ */ s.jsx(
546
+ Lr,
547
+ {
548
+ scope: r,
549
+ open: n,
550
+ onOpenChange: p,
551
+ content: u,
552
+ onContentChange: f,
553
+ children: /* @__PURE__ */ s.jsx(
554
+ fl,
555
+ {
556
+ scope: r,
557
+ contentId: ne(),
558
+ triggerId: ne(),
559
+ trigger: c,
560
+ onTriggerChange: d,
561
+ children: t
562
+ }
563
+ )
564
+ }
565
+ ) });
566
+ };
567
+ tn.displayName = Yt;
568
+ var Ie = "MenuSubTrigger", rn = a.forwardRef(
569
+ (e, r) => {
570
+ const t = pe(Ie, e.__scopeMenu), n = Le(Ie, e.__scopeMenu), o = en(Ie, e.__scopeMenu), l = Kt(Ie, e.__scopeMenu), i = a.useRef(null), { pointerGraceTimerRef: c, onPointerGraceIntentChange: d } = l, u = { __scopeMenu: e.__scopeMenu }, f = a.useCallback(() => {
571
+ i.current && window.clearTimeout(i.current), i.current = null;
572
+ }, []);
573
+ return a.useEffect(() => f, [f]), a.useEffect(() => {
574
+ const p = c.current;
575
+ return () => {
576
+ window.clearTimeout(p), d(null);
577
+ };
578
+ }, [c, d]), /* @__PURE__ */ s.jsx(Gt, { asChild: !0, ...u, children: /* @__PURE__ */ s.jsx(
579
+ Kr,
580
+ {
581
+ id: o.triggerId,
582
+ "aria-haspopup": "menu",
583
+ "aria-expanded": t.open,
584
+ "aria-controls": o.contentId,
585
+ "data-state": an(t.open),
586
+ ...e,
587
+ ref: je(r, o.onTriggerChange),
588
+ onClick: (p) => {
589
+ var g;
590
+ (g = e.onClick) == null || g.call(e, p), !(e.disabled || p.defaultPrevented) && (p.currentTarget.focus(), t.open || t.onOpenChange(!0));
591
+ },
592
+ onPointerMove: I(
593
+ e.onPointerMove,
594
+ Pe((p) => {
595
+ l.onItemEnter(p), !p.defaultPrevented && !e.disabled && !t.open && !i.current && (l.onPointerGraceIntentChange(null), i.current = window.setTimeout(() => {
596
+ t.onOpenChange(!0), f();
597
+ }, 100));
598
+ })
599
+ ),
600
+ onPointerLeave: I(
601
+ e.onPointerLeave,
602
+ Pe((p) => {
603
+ var x, y;
604
+ f();
605
+ const g = (x = t.content) == null ? void 0 : x.getBoundingClientRect();
606
+ if (g) {
607
+ const v = (y = t.content) == null ? void 0 : y.dataset.side, w = v === "right", S = w ? -5 : 5, h = g[w ? "left" : "right"], _ = g[w ? "right" : "left"];
608
+ l.onPointerGraceIntentChange({
609
+ area: [
610
+ // Apply a bleed on clientX to ensure that our exit point is
611
+ // consistently within polygon bounds
612
+ { x: p.clientX + S, y: p.clientY },
613
+ { x: h, y: g.top },
614
+ { x: _, y: g.top },
615
+ { x: _, y: g.bottom },
616
+ { x: h, y: g.bottom }
617
+ ],
618
+ side: v
619
+ }), window.clearTimeout(c.current), c.current = window.setTimeout(
620
+ () => l.onPointerGraceIntentChange(null),
621
+ 300
622
+ );
623
+ } else {
624
+ if (l.onTriggerLeave(p), p.defaultPrevented) return;
625
+ l.onPointerGraceIntentChange(null);
626
+ }
627
+ })
628
+ ),
629
+ onKeyDown: I(e.onKeyDown, (p) => {
630
+ var x;
631
+ const g = l.searchRef.current !== "";
632
+ e.disabled || g && p.key === " " || qa[n.dir].includes(p.key) && (t.onOpenChange(!0), (x = t.content) == null || x.focus(), p.preventDefault());
633
+ })
634
+ }
635
+ ) });
636
+ }
637
+ );
638
+ rn.displayName = Ie;
639
+ var nn = "MenuSubContent", on = a.forwardRef(
640
+ (e, r) => {
641
+ const t = Fr(se, e.__scopeMenu), { forceMount: n = t.forceMount, ...o } = e, l = pe(se, e.__scopeMenu), i = Le(se, e.__scopeMenu), c = en(nn, e.__scopeMenu), d = a.useRef(null), u = q(r, d);
642
+ return /* @__PURE__ */ s.jsx(De.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ s.jsx(Oe, { present: n || l.open, children: /* @__PURE__ */ s.jsx(De.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ s.jsx(
643
+ Ut,
644
+ {
645
+ id: c.contentId,
646
+ "aria-labelledby": c.triggerId,
647
+ ...o,
648
+ ref: u,
649
+ align: "start",
650
+ side: i.dir === "rtl" ? "left" : "right",
651
+ disableOutsidePointerEvents: !1,
652
+ disableOutsideScroll: !1,
653
+ trapFocus: !1,
654
+ onOpenAutoFocus: (f) => {
655
+ var p;
656
+ i.isUsingKeyboardRef.current && ((p = d.current) == null || p.focus()), f.preventDefault();
657
+ },
658
+ onCloseAutoFocus: (f) => f.preventDefault(),
659
+ onFocusOutside: I(e.onFocusOutside, (f) => {
660
+ f.target !== c.trigger && l.onOpenChange(!1);
661
+ }),
662
+ onEscapeKeyDown: I(e.onEscapeKeyDown, (f) => {
663
+ i.onClose(), f.preventDefault();
664
+ }),
665
+ onKeyDown: I(e.onKeyDown, (f) => {
666
+ var x;
667
+ const p = f.currentTarget.contains(f.target), g = Xa[i.dir].includes(f.key);
668
+ p && g && (l.onOpenChange(!1), (x = c.trigger) == null || x.focus(), f.preventDefault());
669
+ })
670
+ }
671
+ ) }) }) });
672
+ }
673
+ );
674
+ on.displayName = nn;
675
+ function an(e) {
676
+ return e ? "open" : "closed";
677
+ }
678
+ function Ue(e) {
679
+ return e === "indeterminate";
680
+ }
681
+ function qt(e) {
682
+ return Ue(e) ? "indeterminate" : e ? "checked" : "unchecked";
683
+ }
684
+ function ml(e) {
685
+ const r = document.activeElement;
686
+ for (const t of e)
687
+ if (t === r || (t.focus(), document.activeElement !== r)) return;
688
+ }
689
+ function gl(e, r) {
690
+ return e.map((t, n) => e[(r + n) % e.length]);
691
+ }
692
+ function vl(e, r, t) {
693
+ const o = r.length > 1 && Array.from(r).every((u) => u === r[0]) ? r[0] : r, l = t ? e.indexOf(t) : -1;
694
+ let i = gl(e, Math.max(l, 0));
695
+ o.length === 1 && (i = i.filter((u) => u !== t));
696
+ const d = i.find(
697
+ (u) => u.toLowerCase().startsWith(o.toLowerCase())
698
+ );
699
+ return d !== t ? d : void 0;
700
+ }
701
+ function hl(e, r) {
702
+ const { x: t, y: n } = e;
703
+ let o = !1;
704
+ for (let l = 0, i = r.length - 1; l < r.length; i = l++) {
705
+ const c = r[l].x, d = r[l].y, u = r[i].x, f = r[i].y;
706
+ d > n != f > n && t < (u - c) * (n - d) / (f - d) + c && (o = !o);
707
+ }
708
+ return o;
709
+ }
710
+ function xl(e, r) {
711
+ if (!r) return !1;
712
+ const t = { x: e.clientX, y: e.clientY };
713
+ return hl(t, r);
714
+ }
715
+ function Pe(e) {
716
+ return (r) => r.pointerType === "mouse" ? e(r) : void 0;
717
+ }
718
+ var yl = Vr, wl = Gt, bl = Br, Sl = Gr, Cl = Wt, _l = Hr, Nl = et, El = Ur, Rl = zr, Il = qr, Ml = Zr, Al = Jr, Dl = Qr, Pl = tn, Tl = rn, jl = on, Xt = "DropdownMenu", [Ol, ad] = Ne(
719
+ Xt,
720
+ [kr]
721
+ ), te = kr(), [kl, ln] = Ol(Xt), sn = (e) => {
722
+ const {
723
+ __scopeDropdownMenu: r,
724
+ children: t,
725
+ dir: n,
726
+ open: o,
727
+ defaultOpen: l,
728
+ onOpenChange: i,
729
+ modal: c = !0
730
+ } = e, d = te(r), u = a.useRef(null), [f = !1, p] = xe({
731
+ prop: o,
732
+ defaultProp: l,
733
+ onChange: i
734
+ });
735
+ return /* @__PURE__ */ s.jsx(
736
+ kl,
737
+ {
738
+ scope: r,
739
+ triggerId: ne(),
740
+ triggerRef: u,
741
+ contentId: ne(),
742
+ open: f,
743
+ onOpenChange: p,
744
+ onOpenToggle: a.useCallback(() => p((g) => !g), [p]),
745
+ modal: c,
746
+ children: /* @__PURE__ */ s.jsx(yl, { ...d, open: f, onOpenChange: p, dir: n, modal: c, children: t })
747
+ }
748
+ );
749
+ };
750
+ sn.displayName = Xt;
751
+ var cn = "DropdownMenuTrigger", dn = a.forwardRef(
752
+ (e, r) => {
753
+ const { __scopeDropdownMenu: t, disabled: n = !1, ...o } = e, l = ln(cn, t), i = te(t);
754
+ return /* @__PURE__ */ s.jsx(wl, { asChild: !0, ...i, children: /* @__PURE__ */ s.jsx(
755
+ $.button,
756
+ {
757
+ type: "button",
758
+ id: l.triggerId,
759
+ "aria-haspopup": "menu",
760
+ "aria-expanded": l.open,
761
+ "aria-controls": l.open ? l.contentId : void 0,
762
+ "data-state": l.open ? "open" : "closed",
763
+ "data-disabled": n ? "" : void 0,
764
+ disabled: n,
765
+ ...o,
766
+ ref: je(r, l.triggerRef),
767
+ onPointerDown: I(e.onPointerDown, (c) => {
768
+ !n && c.button === 0 && c.ctrlKey === !1 && (l.onOpenToggle(), l.open || c.preventDefault());
769
+ }),
770
+ onKeyDown: I(e.onKeyDown, (c) => {
771
+ n || (["Enter", " "].includes(c.key) && l.onOpenToggle(), c.key === "ArrowDown" && l.onOpenChange(!0), ["Enter", " ", "ArrowDown"].includes(c.key) && c.preventDefault());
772
+ })
773
+ }
774
+ ) });
775
+ }
776
+ );
777
+ dn.displayName = cn;
778
+ var $l = "DropdownMenuPortal", un = (e) => {
779
+ const { __scopeDropdownMenu: r, ...t } = e, n = te(r);
780
+ return /* @__PURE__ */ s.jsx(bl, { ...n, ...t });
781
+ };
782
+ un.displayName = $l;
783
+ var pn = "DropdownMenuContent", fn = a.forwardRef(
784
+ (e, r) => {
785
+ const { __scopeDropdownMenu: t, ...n } = e, o = ln(pn, t), l = te(t), i = a.useRef(!1);
786
+ return /* @__PURE__ */ s.jsx(
787
+ Sl,
788
+ {
789
+ id: o.contentId,
790
+ "aria-labelledby": o.triggerId,
791
+ ...l,
792
+ ...n,
793
+ ref: r,
794
+ onCloseAutoFocus: I(e.onCloseAutoFocus, (c) => {
795
+ var d;
796
+ i.current || (d = o.triggerRef.current) == null || d.focus(), i.current = !1, c.preventDefault();
797
+ }),
798
+ onInteractOutside: I(e.onInteractOutside, (c) => {
799
+ const d = c.detail.originalEvent, u = d.button === 0 && d.ctrlKey === !0, f = d.button === 2 || u;
800
+ (!o.modal || f) && (i.current = !0);
801
+ }),
802
+ style: {
803
+ ...e.style,
804
+ "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
805
+ "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
806
+ "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
807
+ "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
808
+ "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
809
+ }
810
+ }
811
+ );
812
+ }
813
+ );
814
+ fn.displayName = pn;
815
+ var Ll = "DropdownMenuGroup", mn = a.forwardRef(
816
+ (e, r) => {
817
+ const { __scopeDropdownMenu: t, ...n } = e, o = te(t);
818
+ return /* @__PURE__ */ s.jsx(Cl, { ...o, ...n, ref: r });
819
+ }
820
+ );
821
+ mn.displayName = Ll;
822
+ var Vl = "DropdownMenuLabel", gn = a.forwardRef(
823
+ (e, r) => {
824
+ const { __scopeDropdownMenu: t, ...n } = e, o = te(t);
825
+ return /* @__PURE__ */ s.jsx(_l, { ...o, ...n, ref: r });
826
+ }
827
+ );
828
+ gn.displayName = Vl;
829
+ var Fl = "DropdownMenuItem", vn = a.forwardRef(
830
+ (e, r) => {
831
+ const { __scopeDropdownMenu: t, ...n } = e, o = te(t);
832
+ return /* @__PURE__ */ s.jsx(Nl, { ...o, ...n, ref: r });
833
+ }
834
+ );
835
+ vn.displayName = Fl;
836
+ var Bl = "DropdownMenuCheckboxItem", hn = a.forwardRef((e, r) => {
837
+ const { __scopeDropdownMenu: t, ...n } = e, o = te(t);
838
+ return /* @__PURE__ */ s.jsx(El, { ...o, ...n, ref: r });
839
+ });
840
+ hn.displayName = Bl;
841
+ var Gl = "DropdownMenuRadioGroup", xn = a.forwardRef((e, r) => {
842
+ const { __scopeDropdownMenu: t, ...n } = e, o = te(t);
843
+ return /* @__PURE__ */ s.jsx(Rl, { ...o, ...n, ref: r });
844
+ });
845
+ xn.displayName = Gl;
846
+ var Hl = "DropdownMenuRadioItem", yn = a.forwardRef((e, r) => {
847
+ const { __scopeDropdownMenu: t, ...n } = e, o = te(t);
848
+ return /* @__PURE__ */ s.jsx(Il, { ...o, ...n, ref: r });
849
+ });
850
+ yn.displayName = Hl;
851
+ var Kl = "DropdownMenuItemIndicator", wn = a.forwardRef((e, r) => {
852
+ const { __scopeDropdownMenu: t, ...n } = e, o = te(t);
853
+ return /* @__PURE__ */ s.jsx(Ml, { ...o, ...n, ref: r });
854
+ });
855
+ wn.displayName = Kl;
856
+ var Ul = "DropdownMenuSeparator", bn = a.forwardRef((e, r) => {
857
+ const { __scopeDropdownMenu: t, ...n } = e, o = te(t);
858
+ return /* @__PURE__ */ s.jsx(Al, { ...o, ...n, ref: r });
859
+ });
860
+ bn.displayName = Ul;
861
+ var Wl = "DropdownMenuArrow", zl = a.forwardRef(
862
+ (e, r) => {
863
+ const { __scopeDropdownMenu: t, ...n } = e, o = te(t);
864
+ return /* @__PURE__ */ s.jsx(Dl, { ...o, ...n, ref: r });
865
+ }
866
+ );
867
+ zl.displayName = Wl;
868
+ var Yl = (e) => {
869
+ const { __scopeDropdownMenu: r, children: t, open: n, onOpenChange: o, defaultOpen: l } = e, i = te(r), [c = !1, d] = xe({
870
+ prop: n,
871
+ defaultProp: l,
872
+ onChange: o
873
+ });
874
+ return /* @__PURE__ */ s.jsx(Pl, { ...i, open: c, onOpenChange: d, children: t });
875
+ }, ql = "DropdownMenuSubTrigger", Sn = a.forwardRef((e, r) => {
876
+ const { __scopeDropdownMenu: t, ...n } = e, o = te(t);
877
+ return /* @__PURE__ */ s.jsx(Tl, { ...o, ...n, ref: r });
878
+ });
879
+ Sn.displayName = ql;
880
+ var Xl = "DropdownMenuSubContent", Cn = a.forwardRef((e, r) => {
881
+ const { __scopeDropdownMenu: t, ...n } = e, o = te(t);
882
+ return /* @__PURE__ */ s.jsx(
883
+ jl,
884
+ {
885
+ ...o,
886
+ ...n,
887
+ ref: r,
888
+ style: {
889
+ ...e.style,
890
+ "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
891
+ "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
892
+ "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
893
+ "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
894
+ "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
895
+ }
896
+ }
897
+ );
898
+ });
899
+ Cn.displayName = Xl;
900
+ var Zl = sn, Jl = dn, _n = un, Nn = fn, Ql = mn, En = gn, Rn = vn, In = hn, es = xn, Mn = yn, An = wn, Dn = bn, ts = Yl, Pn = Sn, Tn = Cn;
901
+ const ld = Zl, sd = Jl, id = Ql, cd = _n, dd = ts, ud = es, rs = ee(({ className: e, inset: r, children: t, ...n }, o) => /* @__PURE__ */ s.jsxs(
902
+ Pn,
903
+ {
904
+ ref: o,
905
+ className: E(
906
+ "al-flex al-cursor-default al-gap-2 al-select-none al-items-center al-rounded-sm al-px-2 al-py-1.5 al-text-sm al-outline-none focus:al-bg-accent data-[state=open]:al-bg-accent [&_svg]:al-pointer-events-none [&_svg]:al-size-4 [&_svg]:al-shrink-0",
907
+ r && "al-pl-8",
908
+ e
909
+ ),
910
+ ...n,
911
+ children: [
912
+ t,
913
+ /* @__PURE__ */ s.jsx(Sa, { className: "al-ml-auto" })
914
+ ]
915
+ }
916
+ ));
917
+ rs.displayName = Pn.displayName;
918
+ const ns = ee(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
919
+ Tn,
920
+ {
921
+ ref: t,
922
+ className: E(
923
+ "al-z-50 al-min-w-[8rem] al-overflow-hidden al-rounded-md al-border al-bg-popover al-p-1 al-text-popover-foreground al-shadow-lg data-[state=open]:al-animate-in data-[state=closed]:al-animate-out data-[state=closed]:al-fade-out-0 data-[state=open]:al-fade-in-0 data-[state=closed]:al-zoom-out-95 data-[state=open]:al-zoom-in-95 data-[side=bottom]:al-slide-in-from-top-2 data-[side=left]:al-slide-in-from-right-2 data-[side=right]:al-slide-in-from-left-2 data-[side=top]:al-slide-in-from-bottom-2",
924
+ e
925
+ ),
926
+ ...r
927
+ }
928
+ ));
929
+ ns.displayName = Tn.displayName;
930
+ const os = ee(({ className: e, sideOffset: r = 4, ...t }, n) => /* @__PURE__ */ s.jsx(_n, { children: /* @__PURE__ */ s.jsx(
931
+ Nn,
932
+ {
933
+ ref: n,
934
+ sideOffset: r,
935
+ className: E(
936
+ "al-z-50 al-min-w-[8rem] al-overflow-hidden al-rounded-md al-border al-bg-popover al-p-1 al-text-popover-foreground al-shadow-md data-[state=open]:al-animate-in data-[state=closed]:al-animate-out data-[state=closed]:al-fade-out-0 data-[state=open]:al-fade-in-0 data-[state=closed]:al-zoom-out-95 data-[state=open]:al-zoom-in-95 data-[side=bottom]:al-slide-in-from-top-2 data-[side=left]:al-slide-in-from-right-2 data-[side=right]:al-slide-in-from-left-2 data-[side=top]:al-slide-in-from-bottom-2",
937
+ e
938
+ ),
939
+ ...t
940
+ }
941
+ ) }));
942
+ os.displayName = Nn.displayName;
943
+ const as = ee(({ className: e, inset: r, ...t }, n) => /* @__PURE__ */ s.jsx(
944
+ Rn,
945
+ {
946
+ ref: n,
947
+ className: E(
948
+ "al-relative al-flex al-cursor-default al-select-none al-items-center al-gap-2 al-rounded-sm al-px-2 al-py-1.5 al-text-sm al-outline-none al-transition-colors focus:al-bg-accent focus:al-text-accent-foreground data-[disabled]:al-pointer-events-none data-[disabled]:al-opacity-50 [&_svg]:al-pointer-events-none [&_svg]:al-size-4 [&_svg]:al-shrink-0",
949
+ r && "al-pl-8",
950
+ e
951
+ ),
952
+ ...t
953
+ }
954
+ ));
955
+ as.displayName = Rn.displayName;
956
+ const ls = ee(({ className: e, children: r, checked: t, ...n }, o) => /* @__PURE__ */ s.jsxs(
957
+ In,
958
+ {
959
+ ref: o,
960
+ className: E(
961
+ "al-relative al-flex al-cursor-default al-select-none al-items-center al-rounded-sm al-py-1.5 al-pl-8 al-pr-2 al-text-sm al-outline-none al-transition-colors focus:al-bg-accent focus:al-text-accent-foreground data-[disabled]:al-pointer-events-none data-[disabled]:al-opacity-50",
962
+ e
963
+ ),
964
+ checked: t,
965
+ ...n,
966
+ children: [
967
+ /* @__PURE__ */ s.jsx("span", { className: "al-absolute al-left-2 al-flex al-h-3.5 al-w-3.5 al-items-center al-justify-center", children: /* @__PURE__ */ s.jsx(An, { children: /* @__PURE__ */ s.jsx(xr, { className: "al-h-4 al-w-4" }) }) }),
968
+ r
969
+ ]
970
+ }
971
+ ));
972
+ ls.displayName = In.displayName;
973
+ const ss = ee(({ className: e, children: r, ...t }, n) => /* @__PURE__ */ s.jsxs(
974
+ Mn,
975
+ {
976
+ ref: n,
977
+ className: E(
978
+ "al-relative al-flex al-cursor-default al-select-none al-items-center al-rounded-sm al-py-1.5 al-pl-8 al-pr-2 al-text-sm al-outline-none al-transition-colors focus:al-bg-accent focus:al-text-accent-foreground data-[disabled]:al-pointer-events-none data-[disabled]:al-opacity-50",
979
+ e
980
+ ),
981
+ ...t,
982
+ children: [
983
+ /* @__PURE__ */ s.jsx("span", { className: "al-absolute al-left-2 al-flex al-h-3.5 al-w-3.5 al-items-center al-justify-center", children: /* @__PURE__ */ s.jsx(An, { children: /* @__PURE__ */ s.jsx(Ca, { className: "al-h-2 al-w-2 al-fill-current" }) }) }),
984
+ r
985
+ ]
986
+ }
987
+ ));
988
+ ss.displayName = Mn.displayName;
989
+ const is = ee(({ className: e, inset: r, ...t }, n) => /* @__PURE__ */ s.jsx(
990
+ En,
991
+ {
992
+ ref: n,
993
+ className: E("al-px-2 al-py-1.5 al-text-sm al-font-semibold", r && "al-pl-8", e),
994
+ ...t
995
+ }
996
+ ));
997
+ is.displayName = En.displayName;
998
+ const cs = ee(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
999
+ Dn,
1000
+ {
1001
+ ref: t,
1002
+ className: E("al--mx-1 al-my-1 al-h-px al-bg-muted", e),
1003
+ ...r
1004
+ }
1005
+ ));
1006
+ cs.displayName = Dn.displayName;
1007
+ const ds = ({ className: e, ...r }) => /* @__PURE__ */ s.jsx(
1008
+ "span",
1009
+ {
1010
+ className: E("al-ml-auto al-text-xs al-tracking-widest al-opacity-60", e),
1011
+ ...r
1012
+ }
1013
+ );
1014
+ ds.displayName = "DropdownMenuShortcut";
1015
+ var ir = 1, us = 0.9, ps = 0.8, fs = 0.17, pt = 0.1, ft = 0.999, ms = 0.9999, gs = 0.99, vs = /[\\\/_+.#"@\[\(\{&]/, hs = /[\\\/_+.#"@\[\(\{&]/g, xs = /[\s-]/, jn = /[\s-]/g;
1016
+ function St(e, r, t, n, o, l, i) {
1017
+ if (l === r.length) return o === e.length ? ir : gs;
1018
+ var c = `${o},${l}`;
1019
+ if (i[c] !== void 0) return i[c];
1020
+ for (var d = n.charAt(l), u = t.indexOf(d, o), f = 0, p, g, x, y; u >= 0; ) p = St(e, r, t, n, u + 1, l + 1, i), p > f && (u === o ? p *= ir : vs.test(e.charAt(u - 1)) ? (p *= ps, x = e.slice(o, u - 1).match(hs), x && o > 0 && (p *= Math.pow(ft, x.length))) : xs.test(e.charAt(u - 1)) ? (p *= us, y = e.slice(o, u - 1).match(jn), y && o > 0 && (p *= Math.pow(ft, y.length))) : (p *= fs, o > 0 && (p *= Math.pow(ft, u - o))), e.charAt(u) !== r.charAt(l) && (p *= ms)), (p < pt && t.charAt(u - 1) === n.charAt(l + 1) || n.charAt(l + 1) === n.charAt(l) && t.charAt(u - 1) !== n.charAt(l)) && (g = St(e, r, t, n, u + 1, l + 2, i), g * pt > p && (p = g * pt)), p > f && (f = p), u = t.indexOf(d, u + 1);
1021
+ return i[c] = f, f;
1022
+ }
1023
+ function cr(e) {
1024
+ return e.toLowerCase().replace(jn, " ");
1025
+ }
1026
+ function ys(e, r, t) {
1027
+ return e = t && t.length > 0 ? `${e + " " + t.join(" ")}` : e, St(e, r, cr(e), cr(r), 0, 0, {});
1028
+ }
1029
+ var Ct = { exports: {} }, mt = {};
1030
+ /**
1031
+ * @license React
1032
+ * use-sync-external-store-shim.production.js
1033
+ *
1034
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
1035
+ *
1036
+ * This source code is licensed under the MIT license found in the
1037
+ * LICENSE file in the root directory of this source tree.
1038
+ */
1039
+ var dr;
1040
+ function ws() {
1041
+ if (dr) return mt;
1042
+ dr = 1;
1043
+ var e = T;
1044
+ function r(p, g) {
1045
+ return p === g && (p !== 0 || 1 / p === 1 / g) || p !== p && g !== g;
1046
+ }
1047
+ var t = typeof Object.is == "function" ? Object.is : r, n = e.useState, o = e.useEffect, l = e.useLayoutEffect, i = e.useDebugValue;
1048
+ function c(p, g) {
1049
+ var x = g(), y = n({ inst: { value: x, getSnapshot: g } }), v = y[0].inst, w = y[1];
1050
+ return l(
1051
+ function() {
1052
+ v.value = x, v.getSnapshot = g, d(v) && w({ inst: v });
1053
+ },
1054
+ [p, x, g]
1055
+ ), o(
1056
+ function() {
1057
+ return d(v) && w({ inst: v }), p(function() {
1058
+ d(v) && w({ inst: v });
1059
+ });
1060
+ },
1061
+ [p]
1062
+ ), i(x), x;
1063
+ }
1064
+ function d(p) {
1065
+ var g = p.getSnapshot;
1066
+ p = p.value;
1067
+ try {
1068
+ var x = g();
1069
+ return !t(p, x);
1070
+ } catch {
1071
+ return !0;
1072
+ }
1073
+ }
1074
+ function u(p, g) {
1075
+ return g();
1076
+ }
1077
+ var f = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? u : c;
1078
+ return mt.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : f, mt;
1079
+ }
1080
+ var gt = {};
1081
+ /**
1082
+ * @license React
1083
+ * use-sync-external-store-shim.development.js
1084
+ *
1085
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
1086
+ *
1087
+ * This source code is licensed under the MIT license found in the
1088
+ * LICENSE file in the root directory of this source tree.
1089
+ */
1090
+ var ur;
1091
+ function bs() {
1092
+ return ur || (ur = 1, process.env.NODE_ENV !== "production" && function() {
1093
+ function e(x, y) {
1094
+ return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
1095
+ }
1096
+ function r(x, y) {
1097
+ f || o.startTransition === void 0 || (f = !0, console.error(
1098
+ "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
1099
+ ));
1100
+ var v = y();
1101
+ if (!p) {
1102
+ var w = y();
1103
+ l(v, w) || (console.error(
1104
+ "The result of getSnapshot should be cached to avoid an infinite loop"
1105
+ ), p = !0);
1106
+ }
1107
+ w = i({
1108
+ inst: { value: v, getSnapshot: y }
1109
+ });
1110
+ var S = w[0].inst, h = w[1];
1111
+ return d(
1112
+ function() {
1113
+ S.value = v, S.getSnapshot = y, t(S) && h({ inst: S });
1114
+ },
1115
+ [x, v, y]
1116
+ ), c(
1117
+ function() {
1118
+ return t(S) && h({ inst: S }), x(function() {
1119
+ t(S) && h({ inst: S });
1120
+ });
1121
+ },
1122
+ [x]
1123
+ ), u(v), v;
1124
+ }
1125
+ function t(x) {
1126
+ var y = x.getSnapshot;
1127
+ x = x.value;
1128
+ try {
1129
+ var v = y();
1130
+ return !l(x, v);
1131
+ } catch {
1132
+ return !0;
1133
+ }
1134
+ }
1135
+ function n(x, y) {
1136
+ return y();
1137
+ }
1138
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
1139
+ var o = T, l = typeof Object.is == "function" ? Object.is : e, i = o.useState, c = o.useEffect, d = o.useLayoutEffect, u = o.useDebugValue, f = !1, p = !1, g = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? n : r;
1140
+ gt.useSyncExternalStore = o.useSyncExternalStore !== void 0 ? o.useSyncExternalStore : g, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1141
+ }()), gt;
1142
+ }
1143
+ process.env.NODE_ENV === "production" ? Ct.exports = ws() : Ct.exports = bs();
1144
+ var Ss = Ct.exports, Re = '[cmdk-group=""]', vt = '[cmdk-group-items=""]', Cs = '[cmdk-group-heading=""]', Zt = '[cmdk-item=""]', pr = `${Zt}:not([aria-disabled="true"])`, _t = "cmdk-item-select", he = "data-value", _s = (e, r, t) => ys(e, r, t), On = a.createContext(void 0), Ve = () => a.useContext(On), kn = a.createContext(void 0), Jt = () => a.useContext(kn), $n = a.createContext(void 0), Ln = a.forwardRef((e, r) => {
1145
+ let t = Ce(() => {
1146
+ var m, R;
1147
+ return { search: "", value: (R = (m = e.value) != null ? m : e.defaultValue) != null ? R : "", filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
1148
+ }), n = Ce(() => /* @__PURE__ */ new Set()), o = Ce(() => /* @__PURE__ */ new Map()), l = Ce(() => /* @__PURE__ */ new Map()), i = Ce(() => /* @__PURE__ */ new Set()), c = Vn(e), { label: d, children: u, value: f, onValueChange: p, filter: g, shouldFilter: x, loop: y, disablePointerSelection: v = !1, vimBindings: w = !0, ...S } = e, h = ne(), _ = ne(), L = ne(), V = a.useRef(null), j = Os();
1149
+ ye(() => {
1150
+ if (f !== void 0) {
1151
+ let m = f.trim();
1152
+ t.current.value = m, P.emit();
1153
+ }
1154
+ }, [f]), ye(() => {
1155
+ j(6, oe);
1156
+ }, []);
1157
+ let P = a.useMemo(() => ({ subscribe: (m) => (i.current.add(m), () => i.current.delete(m)), snapshot: () => t.current, setState: (m, R, M) => {
1158
+ var C, D, b;
1159
+ if (!Object.is(t.current[m], R)) {
1160
+ if (t.current[m] = R, m === "search") Z(), U(), j(1, re);
1161
+ else if (m === "value" && (M || j(5, oe), ((C = c.current) == null ? void 0 : C.value) !== void 0)) {
1162
+ let A = R ?? "";
1163
+ (b = (D = c.current).onValueChange) == null || b.call(D, A);
1164
+ return;
1165
+ }
1166
+ P.emit();
1167
+ }
1168
+ }, emit: () => {
1169
+ i.current.forEach((m) => m());
1170
+ } }), []), K = a.useMemo(() => ({ value: (m, R, M) => {
1171
+ var C;
1172
+ R !== ((C = l.current.get(m)) == null ? void 0 : C.value) && (l.current.set(m, { value: R, keywords: M }), t.current.filtered.items.set(m, G(R, M)), j(2, () => {
1173
+ U(), P.emit();
1174
+ }));
1175
+ }, item: (m, R) => (n.current.add(m), R && (o.current.has(R) ? o.current.get(R).add(m) : o.current.set(R, /* @__PURE__ */ new Set([m]))), j(3, () => {
1176
+ Z(), U(), t.current.value || re(), P.emit();
1177
+ }), () => {
1178
+ l.current.delete(m), n.current.delete(m), t.current.filtered.items.delete(m);
1179
+ let M = W();
1180
+ j(4, () => {
1181
+ Z(), (M == null ? void 0 : M.getAttribute("id")) === m && re(), P.emit();
1182
+ });
1183
+ }), group: (m) => (o.current.has(m) || o.current.set(m, /* @__PURE__ */ new Set()), () => {
1184
+ l.current.delete(m), o.current.delete(m);
1185
+ }), filter: () => c.current.shouldFilter, label: d || e["aria-label"], getDisablePointerSelection: () => c.current.disablePointerSelection, listId: h, inputId: L, labelId: _, listInnerRef: V }), []);
1186
+ function G(m, R) {
1187
+ var M, C;
1188
+ let D = (C = (M = c.current) == null ? void 0 : M.filter) != null ? C : _s;
1189
+ return m ? D(m, t.current.search, R) : 0;
1190
+ }
1191
+ function U() {
1192
+ if (!t.current.search || c.current.shouldFilter === !1) return;
1193
+ let m = t.current.filtered.items, R = [];
1194
+ t.current.filtered.groups.forEach((C) => {
1195
+ let D = o.current.get(C), b = 0;
1196
+ D.forEach((A) => {
1197
+ let O = m.get(A);
1198
+ b = Math.max(O, b);
1199
+ }), R.push([C, b]);
1200
+ });
1201
+ let M = V.current;
1202
+ J().sort((C, D) => {
1203
+ var b, A;
1204
+ let O = C.getAttribute("id"), k = D.getAttribute("id");
1205
+ return ((b = m.get(k)) != null ? b : 0) - ((A = m.get(O)) != null ? A : 0);
1206
+ }).forEach((C) => {
1207
+ let D = C.closest(vt);
1208
+ D ? D.appendChild(C.parentElement === D ? C : C.closest(`${vt} > *`)) : M.appendChild(C.parentElement === M ? C : C.closest(`${vt} > *`));
1209
+ }), R.sort((C, D) => D[1] - C[1]).forEach((C) => {
1210
+ var D;
1211
+ let b = (D = V.current) == null ? void 0 : D.querySelector(`${Re}[${he}="${encodeURIComponent(C[0])}"]`);
1212
+ b == null || b.parentElement.appendChild(b);
1213
+ });
1214
+ }
1215
+ function re() {
1216
+ let m = J().find((M) => M.getAttribute("aria-disabled") !== "true"), R = m == null ? void 0 : m.getAttribute(he);
1217
+ P.setState("value", R || void 0);
1218
+ }
1219
+ function Z() {
1220
+ var m, R, M, C;
1221
+ if (!t.current.search || c.current.shouldFilter === !1) {
1222
+ t.current.filtered.count = n.current.size;
1223
+ return;
1224
+ }
1225
+ t.current.filtered.groups = /* @__PURE__ */ new Set();
1226
+ let D = 0;
1227
+ for (let b of n.current) {
1228
+ let A = (R = (m = l.current.get(b)) == null ? void 0 : m.value) != null ? R : "", O = (C = (M = l.current.get(b)) == null ? void 0 : M.keywords) != null ? C : [], k = G(A, O);
1229
+ t.current.filtered.items.set(b, k), k > 0 && D++;
1230
+ }
1231
+ for (let [b, A] of o.current) for (let O of A) if (t.current.filtered.items.get(O) > 0) {
1232
+ t.current.filtered.groups.add(b);
1233
+ break;
1234
+ }
1235
+ t.current.filtered.count = D;
1236
+ }
1237
+ function oe() {
1238
+ var m, R, M;
1239
+ let C = W();
1240
+ C && (((m = C.parentElement) == null ? void 0 : m.firstChild) === C && ((M = (R = C.closest(Re)) == null ? void 0 : R.querySelector(Cs)) == null || M.scrollIntoView({ block: "nearest" })), C.scrollIntoView({ block: "nearest" }));
1241
+ }
1242
+ function W() {
1243
+ var m;
1244
+ return (m = V.current) == null ? void 0 : m.querySelector(`${Zt}[aria-selected="true"]`);
1245
+ }
1246
+ function J() {
1247
+ var m;
1248
+ return Array.from(((m = V.current) == null ? void 0 : m.querySelectorAll(pr)) || []);
1249
+ }
1250
+ function H(m) {
1251
+ let R = J()[m];
1252
+ R && P.setState("value", R.getAttribute(he));
1253
+ }
1254
+ function Q(m) {
1255
+ var R;
1256
+ let M = W(), C = J(), D = C.findIndex((A) => A === M), b = C[D + m];
1257
+ (R = c.current) != null && R.loop && (b = D + m < 0 ? C[C.length - 1] : D + m === C.length ? C[0] : C[D + m]), b && P.setState("value", b.getAttribute(he));
1258
+ }
1259
+ function z(m) {
1260
+ let R = W(), M = R == null ? void 0 : R.closest(Re), C;
1261
+ for (; M && !C; ) M = m > 0 ? Ts(M, Re) : js(M, Re), C = M == null ? void 0 : M.querySelector(pr);
1262
+ C ? P.setState("value", C.getAttribute(he)) : Q(m);
1263
+ }
1264
+ let N = () => H(J().length - 1), Y = (m) => {
1265
+ m.preventDefault(), m.metaKey ? N() : m.altKey ? z(1) : Q(1);
1266
+ }, X = (m) => {
1267
+ m.preventDefault(), m.metaKey ? H(0) : m.altKey ? z(-1) : Q(-1);
1268
+ };
1269
+ return a.createElement($.div, { ref: r, tabIndex: -1, ...S, "cmdk-root": "", onKeyDown: (m) => {
1270
+ var R;
1271
+ if ((R = S.onKeyDown) == null || R.call(S, m), !m.defaultPrevented) switch (m.key) {
1272
+ case "n":
1273
+ case "j": {
1274
+ w && m.ctrlKey && Y(m);
1275
+ break;
1276
+ }
1277
+ case "ArrowDown": {
1278
+ Y(m);
1279
+ break;
1280
+ }
1281
+ case "p":
1282
+ case "k": {
1283
+ w && m.ctrlKey && X(m);
1284
+ break;
1285
+ }
1286
+ case "ArrowUp": {
1287
+ X(m);
1288
+ break;
1289
+ }
1290
+ case "Home": {
1291
+ m.preventDefault(), H(0);
1292
+ break;
1293
+ }
1294
+ case "End": {
1295
+ m.preventDefault(), N();
1296
+ break;
1297
+ }
1298
+ case "Enter":
1299
+ if (!m.nativeEvent.isComposing && m.keyCode !== 229) {
1300
+ m.preventDefault();
1301
+ let M = W();
1302
+ if (M) {
1303
+ let C = new Event(_t);
1304
+ M.dispatchEvent(C);
1305
+ }
1306
+ }
1307
+ }
1308
+ } }, a.createElement("label", { "cmdk-label": "", htmlFor: K.inputId, id: K.labelId, style: $s }, d), tt(e, (m) => a.createElement(kn.Provider, { value: P }, a.createElement(On.Provider, { value: K }, m))));
1309
+ }), Ns = a.forwardRef((e, r) => {
1310
+ var t, n;
1311
+ let o = ne(), l = a.useRef(null), i = a.useContext($n), c = Ve(), d = Vn(e), u = (n = (t = d.current) == null ? void 0 : t.forceMount) != null ? n : i == null ? void 0 : i.forceMount;
1312
+ ye(() => {
1313
+ if (!u) return c.item(o, i == null ? void 0 : i.id);
1314
+ }, [u]);
1315
+ let f = Fn(o, l, [e.value, e.children, l], e.keywords), p = Jt(), g = we((j) => j.value && j.value === f.current), x = we((j) => u || c.filter() === !1 ? !0 : j.search ? j.filtered.items.get(o) > 0 : !0);
1316
+ a.useEffect(() => {
1317
+ let j = l.current;
1318
+ if (!(!j || e.disabled)) return j.addEventListener(_t, y), () => j.removeEventListener(_t, y);
1319
+ }, [x, e.onSelect, e.disabled]);
1320
+ function y() {
1321
+ var j, P;
1322
+ v(), (P = (j = d.current).onSelect) == null || P.call(j, f.current);
1323
+ }
1324
+ function v() {
1325
+ p.setState("value", f.current, !0);
1326
+ }
1327
+ if (!x) return null;
1328
+ let { disabled: w, value: S, onSelect: h, forceMount: _, keywords: L, ...V } = e;
1329
+ return a.createElement($.div, { ref: Te([l, r]), ...V, id: o, "cmdk-item": "", role: "option", "aria-disabled": !!w, "aria-selected": !!g, "data-disabled": !!w, "data-selected": !!g, onPointerMove: w || c.getDisablePointerSelection() ? void 0 : v, onClick: w ? void 0 : y }, e.children);
1330
+ }), Es = a.forwardRef((e, r) => {
1331
+ let { heading: t, children: n, forceMount: o, ...l } = e, i = ne(), c = a.useRef(null), d = a.useRef(null), u = ne(), f = Ve(), p = we((x) => o || f.filter() === !1 ? !0 : x.search ? x.filtered.groups.has(i) : !0);
1332
+ ye(() => f.group(i), []), Fn(i, c, [e.value, e.heading, d]);
1333
+ let g = a.useMemo(() => ({ id: i, forceMount: o }), [o]);
1334
+ return a.createElement($.div, { ref: Te([c, r]), ...l, "cmdk-group": "", role: "presentation", hidden: p ? void 0 : !0 }, t && a.createElement("div", { ref: d, "cmdk-group-heading": "", "aria-hidden": !0, id: u }, t), tt(e, (x) => a.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": t ? u : void 0 }, a.createElement($n.Provider, { value: g }, x))));
1335
+ }), Rs = a.forwardRef((e, r) => {
1336
+ let { alwaysRender: t, ...n } = e, o = a.useRef(null), l = we((i) => !i.search);
1337
+ return !t && !l ? null : a.createElement($.div, { ref: Te([o, r]), ...n, "cmdk-separator": "", role: "separator" });
1338
+ }), Is = a.forwardRef((e, r) => {
1339
+ let { onValueChange: t, ...n } = e, o = e.value != null, l = Jt(), i = we((f) => f.search), c = we((f) => f.value), d = Ve(), u = a.useMemo(() => {
1340
+ var f;
1341
+ let p = (f = d.listInnerRef.current) == null ? void 0 : f.querySelector(`${Zt}[${he}="${encodeURIComponent(c)}"]`);
1342
+ return p == null ? void 0 : p.getAttribute("id");
1343
+ }, []);
1344
+ return a.useEffect(() => {
1345
+ e.value != null && l.setState("search", e.value);
1346
+ }, [e.value]), a.createElement($.input, { ref: r, ...n, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": d.listId, "aria-labelledby": d.labelId, "aria-activedescendant": u, id: d.inputId, type: "text", value: o ? e.value : i, onChange: (f) => {
1347
+ o || l.setState("search", f.target.value), t == null || t(f.target.value);
1348
+ } });
1349
+ }), Ms = a.forwardRef((e, r) => {
1350
+ let { children: t, label: n = "Suggestions", ...o } = e, l = a.useRef(null), i = a.useRef(null), c = Ve();
1351
+ return a.useEffect(() => {
1352
+ if (i.current && l.current) {
1353
+ let d = i.current, u = l.current, f, p = new ResizeObserver(() => {
1354
+ f = requestAnimationFrame(() => {
1355
+ let g = d.offsetHeight;
1356
+ u.style.setProperty("--cmdk-list-height", g.toFixed(1) + "px");
1357
+ });
1358
+ });
1359
+ return p.observe(d), () => {
1360
+ cancelAnimationFrame(f), p.unobserve(d);
1361
+ };
1362
+ }
1363
+ }, []), a.createElement($.div, { ref: Te([l, r]), ...o, "cmdk-list": "", role: "listbox", "aria-label": n, id: c.listId }, tt(e, (d) => a.createElement("div", { ref: Te([i, c.listInnerRef]), "cmdk-list-sizer": "" }, d)));
1364
+ }), As = a.forwardRef((e, r) => {
1365
+ let { open: t, onOpenChange: n, overlayClassName: o, contentClassName: l, container: i, ...c } = e;
1366
+ return a.createElement(Ot, { open: t, onOpenChange: n }, a.createElement(kt, { container: i }, a.createElement(qe, { "cmdk-overlay": "", className: o }), a.createElement(Xe, { "aria-label": e.label, "cmdk-dialog": "", className: l }, a.createElement(Ln, { ref: r, ...c }))));
1367
+ }), Ds = a.forwardRef((e, r) => we((t) => t.filtered.count === 0) ? a.createElement($.div, { ref: r, ...e, "cmdk-empty": "", role: "presentation" }) : null), Ps = a.forwardRef((e, r) => {
1368
+ let { progress: t, children: n, label: o = "Loading...", ...l } = e;
1369
+ return a.createElement($.div, { ref: r, ...l, "cmdk-loading": "", role: "progressbar", "aria-valuenow": t, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": o }, tt(e, (i) => a.createElement("div", { "aria-hidden": !0 }, i)));
1370
+ }), le = Object.assign(Ln, { List: Ms, Item: Ns, Input: Is, Group: Es, Separator: Rs, Dialog: As, Empty: Ds, Loading: Ps });
1371
+ function Ts(e, r) {
1372
+ let t = e.nextElementSibling;
1373
+ for (; t; ) {
1374
+ if (t.matches(r)) return t;
1375
+ t = t.nextElementSibling;
1376
+ }
1377
+ }
1378
+ function js(e, r) {
1379
+ let t = e.previousElementSibling;
1380
+ for (; t; ) {
1381
+ if (t.matches(r)) return t;
1382
+ t = t.previousElementSibling;
1383
+ }
1384
+ }
1385
+ function Vn(e) {
1386
+ let r = a.useRef(e);
1387
+ return ye(() => {
1388
+ r.current = e;
1389
+ }), r;
1390
+ }
1391
+ var ye = typeof window > "u" ? a.useEffect : a.useLayoutEffect;
1392
+ function Ce(e) {
1393
+ let r = a.useRef();
1394
+ return r.current === void 0 && (r.current = e()), r;
1395
+ }
1396
+ function Te(e) {
1397
+ return (r) => {
1398
+ e.forEach((t) => {
1399
+ typeof t == "function" ? t(r) : t != null && (t.current = r);
1400
+ });
1401
+ };
1402
+ }
1403
+ function we(e) {
1404
+ let r = Jt(), t = () => e(r.snapshot());
1405
+ return Ss.useSyncExternalStore(r.subscribe, t, t);
1406
+ }
1407
+ function Fn(e, r, t, n = []) {
1408
+ let o = a.useRef(), l = Ve();
1409
+ return ye(() => {
1410
+ var i;
1411
+ let c = (() => {
1412
+ var u;
1413
+ for (let f of t) {
1414
+ if (typeof f == "string") return f.trim();
1415
+ if (typeof f == "object" && "current" in f) return f.current ? (u = f.current.textContent) == null ? void 0 : u.trim() : o.current;
1416
+ }
1417
+ })(), d = n.map((u) => u.trim());
1418
+ l.value(e, c, d), (i = r.current) == null || i.setAttribute(he, c), o.current = c;
1419
+ }), o;
1420
+ }
1421
+ var Os = () => {
1422
+ let [e, r] = a.useState(), t = Ce(() => /* @__PURE__ */ new Map());
1423
+ return ye(() => {
1424
+ t.current.forEach((n) => n()), t.current = /* @__PURE__ */ new Map();
1425
+ }, [e]), (n, o) => {
1426
+ t.current.set(n, o), r({});
1427
+ };
1428
+ };
1429
+ function ks(e) {
1430
+ let r = e.type;
1431
+ return typeof r == "function" ? r(e.props) : "render" in r ? r.render(e.props) : e;
1432
+ }
1433
+ function tt({ asChild: e, children: r }, t) {
1434
+ return e && a.isValidElement(r) ? a.cloneElement(ks(r), { ref: r.ref }, t(r.props.children)) : t(r);
1435
+ }
1436
+ var $s = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
1437
+ const Bn = ee(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
1438
+ le,
1439
+ {
1440
+ ref: t,
1441
+ className: E(
1442
+ "al-flex al-h-full al-w-full al-flex-col al-overflow-hidden al-rounded-md al-bg-popover al-text-popover-foreground",
1443
+ e
1444
+ ),
1445
+ ...r
1446
+ }
1447
+ ));
1448
+ Bn.displayName = le.displayName;
1449
+ const pd = ({ children: e, ...r }) => /* @__PURE__ */ s.jsx(Ma, { ...r, children: /* @__PURE__ */ s.jsx(Aa, { className: "al-overflow-hidden al-p-0 al-shadow-lg", children: /* @__PURE__ */ s.jsx(Bn, { className: "[&_[cmdk-group-heading]]:al-px-2 [&_[cmdk-group-heading]]:al-font-medium [&_[cmdk-group-heading]]:al-text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:al-pt-0 [&_[cmdk-group]]:al-px-2 [&_[cmdk-input-wrapper]_svg]:al-h-5 [&_[cmdk-input-wrapper]_svg]:al-w-5 [&_[cmdk-input]]:al-h-12 [&_[cmdk-item]]:al-px-2 [&_[cmdk-item]]:al-py-3 [&_[cmdk-item]_svg]:al-h-5 [&_[cmdk-item]_svg]:al-w-5", children: e }) }) }), Ls = ee(({ className: e, ...r }, t) => (
1450
+ // eslint-disable-next-line react/no-unknown-property
1451
+ /* @__PURE__ */ s.jsxs("div", { className: "al-flex al-items-center al-border-b al-px-3", "cmdk-input-wrapper": "", children: [
1452
+ /* @__PURE__ */ s.jsx(_a, { className: "al-mr-2 al-h-4 al-w-4 al-shrink-0 al-opacity-50" }),
1453
+ /* @__PURE__ */ s.jsx(
1454
+ le.Input,
1455
+ {
1456
+ ref: t,
1457
+ className: E(
1458
+ "al-flex al-h-11 al-w-full al-rounded-md al-bg-transparent al-py-3 al-text-sm al-outline-none placeholder:al-text-muted-foreground disabled:al-cursor-not-allowed disabled:al-opacity-50",
1459
+ e
1460
+ ),
1461
+ ...r
1462
+ }
1463
+ )
1464
+ ] })
1465
+ ));
1466
+ Ls.displayName = le.Input.displayName;
1467
+ const Vs = ee(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
1468
+ le.List,
1469
+ {
1470
+ ref: t,
1471
+ className: E("al-max-h-[300px] al-overflow-y-auto al-overflow-x-hidden", e),
1472
+ ...r
1473
+ }
1474
+ ));
1475
+ Vs.displayName = le.List.displayName;
1476
+ const Fs = ee((e, r) => /* @__PURE__ */ s.jsx(le.Empty, { ref: r, className: "al-py-6 al-text-center al-text-sm", ...e }));
1477
+ Fs.displayName = le.Empty.displayName;
1478
+ const Bs = ee(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
1479
+ le.Group,
1480
+ {
1481
+ ref: t,
1482
+ className: E(
1483
+ "al-overflow-hidden al-p-1 al-text-foreground [&_[cmdk-group-heading]]:al-px-2 [&_[cmdk-group-heading]]:al-py-1.5 [&_[cmdk-group-heading]]:al-text-xs [&_[cmdk-group-heading]]:al-font-medium [&_[cmdk-group-heading]]:al-text-muted-foreground",
1484
+ e
1485
+ ),
1486
+ ...r
1487
+ }
1488
+ ));
1489
+ Bs.displayName = le.Group.displayName;
1490
+ const Gs = ee(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
1491
+ le.Separator,
1492
+ {
1493
+ ref: t,
1494
+ className: E("al--mx-1 al-h-px al-bg-border", e),
1495
+ ...r
1496
+ }
1497
+ ));
1498
+ Gs.displayName = le.Separator.displayName;
1499
+ const Hs = ee(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
1500
+ le.Item,
1501
+ {
1502
+ ref: t,
1503
+ role: "option",
1504
+ className: E(
1505
+ "al-relative al-flex al-cursor-default al-gap-2 al-select-none al-items-center al-rounded-sm al-px-2 al-py-1.5 al-text-sm al-outline-none data-[disabled=true]:al-pointer-events-none data-[selected=true]:al-bg-accent data-[selected=true]:al-text-accent-foreground data-[disabled=true]:al-opacity-50 [&_svg]:al-pointer-events-none [&_svg]:al-size-4 [&_svg]:al-shrink-0",
1506
+ e
1507
+ ),
1508
+ ...r
1509
+ }
1510
+ ));
1511
+ Hs.displayName = le.Item.displayName;
1512
+ const Ks = ({ className: e, ...r }) => /* @__PURE__ */ s.jsx(
1513
+ "span",
1514
+ {
1515
+ className: E("al-ml-auto al-text-xs al-tracking-widest al-text-muted-foreground", e),
1516
+ ...r
1517
+ }
1518
+ );
1519
+ Ks.displayName = "CommandShortcut";
1520
+ const Us = Ze(
1521
+ "al-inline-flex al-items-center al-rounded-full al-border al-px-2.5 al-py-0.5 al-text-xs al-font-semibold al-transition-colors focus:al-outline-none focus:al-ring-2 focus:al-ring-ring focus:al-ring-offset-2",
1522
+ {
1523
+ variants: {
1524
+ variant: {
1525
+ default: "al-border-transparent al-bg-primary al-text-primary-foreground hover:al-bg-primary/80",
1526
+ secondary: "al-border-transparent al-bg-secondary al-text-secondary-foreground hover:al-bg-secondary/80",
1527
+ destructive: "al-border-transparent al-bg-destructive al-text-destructive-foreground hover:al-bg-destructive/80",
1528
+ success: "al-border-transparent al-bg-green-500 al-text-white hover:al-bg-green-600",
1529
+ outline: "al-text-foreground"
1530
+ },
1531
+ interactive: {
1532
+ true: "al-cursor-pointer focus:al-ring-2 focus:al-ring-ring focus:al-ring-offset-2",
1533
+ false: "al-cursor-default"
1534
+ }
1535
+ },
1536
+ defaultVariants: {
1537
+ variant: "default",
1538
+ interactive: !1
1539
+ }
1540
+ }
1541
+ );
1542
+ function fd({
1543
+ className: e,
1544
+ variant: r,
1545
+ interactive: t = !0,
1546
+ onAction: n,
1547
+ children: o,
1548
+ role: l = "status",
1549
+ tabIndex: i,
1550
+ onKeyDown: c,
1551
+ ...d
1552
+ }) {
1553
+ const u = (f) => {
1554
+ t && n && (f.key === "Enter" || f.key === " ") && (f.preventDefault(), n()), c == null || c(f);
1555
+ };
1556
+ return /* @__PURE__ */ s.jsx(
1557
+ "div",
1558
+ {
1559
+ className: E(Us({ variant: r, interactive: t }), e),
1560
+ role: t ? "button" : l,
1561
+ tabIndex: t ? 0 : i,
1562
+ onKeyDown: u,
1563
+ onClick: t ? n : void 0,
1564
+ "aria-disabled": t && !n,
1565
+ ...d,
1566
+ children: o
1567
+ }
1568
+ );
1569
+ }
1570
+ var Qt = "Collapsible", [Ws, Gn] = Ne(Qt), [zs, er] = Ws(Qt), Hn = a.forwardRef(
1571
+ (e, r) => {
1572
+ const {
1573
+ __scopeCollapsible: t,
1574
+ open: n,
1575
+ defaultOpen: o,
1576
+ disabled: l,
1577
+ onOpenChange: i,
1578
+ ...c
1579
+ } = e, [d = !1, u] = xe({
1580
+ prop: n,
1581
+ defaultProp: o,
1582
+ onChange: i
1583
+ });
1584
+ return /* @__PURE__ */ s.jsx(
1585
+ zs,
1586
+ {
1587
+ scope: t,
1588
+ disabled: l,
1589
+ contentId: ne(),
1590
+ open: d,
1591
+ onOpenToggle: a.useCallback(() => u((f) => !f), [u]),
1592
+ children: /* @__PURE__ */ s.jsx(
1593
+ $.div,
1594
+ {
1595
+ "data-state": rr(d),
1596
+ "data-disabled": l ? "" : void 0,
1597
+ ...c,
1598
+ ref: r
1599
+ }
1600
+ )
1601
+ }
1602
+ );
1603
+ }
1604
+ );
1605
+ Hn.displayName = Qt;
1606
+ var Kn = "CollapsibleTrigger", Un = a.forwardRef(
1607
+ (e, r) => {
1608
+ const { __scopeCollapsible: t, ...n } = e, o = er(Kn, t);
1609
+ return /* @__PURE__ */ s.jsx(
1610
+ $.button,
1611
+ {
1612
+ type: "button",
1613
+ "aria-controls": o.contentId,
1614
+ "aria-expanded": o.open || !1,
1615
+ "data-state": rr(o.open),
1616
+ "data-disabled": o.disabled ? "" : void 0,
1617
+ disabled: o.disabled,
1618
+ ...n,
1619
+ ref: r,
1620
+ onClick: I(e.onClick, o.onOpenToggle)
1621
+ }
1622
+ );
1623
+ }
1624
+ );
1625
+ Un.displayName = Kn;
1626
+ var tr = "CollapsibleContent", Wn = a.forwardRef(
1627
+ (e, r) => {
1628
+ const { forceMount: t, ...n } = e, o = er(tr, e.__scopeCollapsible);
1629
+ return /* @__PURE__ */ s.jsx(Oe, { present: t || o.open, children: ({ present: l }) => /* @__PURE__ */ s.jsx(Ys, { ...n, ref: r, present: l }) });
1630
+ }
1631
+ );
1632
+ Wn.displayName = tr;
1633
+ var Ys = a.forwardRef((e, r) => {
1634
+ const { __scopeCollapsible: t, present: n, children: o, ...l } = e, i = er(tr, t), [c, d] = a.useState(n), u = a.useRef(null), f = q(r, u), p = a.useRef(0), g = p.current, x = a.useRef(0), y = x.current, v = i.open || c, w = a.useRef(v), S = a.useRef(void 0);
1635
+ return a.useEffect(() => {
1636
+ const h = requestAnimationFrame(() => w.current = !1);
1637
+ return () => cancelAnimationFrame(h);
1638
+ }, []), ce(() => {
1639
+ const h = u.current;
1640
+ if (h) {
1641
+ S.current = S.current || {
1642
+ transitionDuration: h.style.transitionDuration,
1643
+ animationName: h.style.animationName
1644
+ }, h.style.transitionDuration = "0s", h.style.animationName = "none";
1645
+ const _ = h.getBoundingClientRect();
1646
+ p.current = _.height, x.current = _.width, w.current || (h.style.transitionDuration = S.current.transitionDuration, h.style.animationName = S.current.animationName), d(n);
1647
+ }
1648
+ }, [i.open, n]), /* @__PURE__ */ s.jsx(
1649
+ $.div,
1650
+ {
1651
+ "data-state": rr(i.open),
1652
+ "data-disabled": i.disabled ? "" : void 0,
1653
+ id: i.contentId,
1654
+ hidden: !v,
1655
+ ...l,
1656
+ ref: f,
1657
+ style: {
1658
+ "--radix-collapsible-content-height": g ? `${g}px` : void 0,
1659
+ "--radix-collapsible-content-width": y ? `${y}px` : void 0,
1660
+ ...e.style
1661
+ },
1662
+ children: v && o
1663
+ }
1664
+ );
1665
+ });
1666
+ function rr(e) {
1667
+ return e ? "open" : "closed";
1668
+ }
1669
+ var qs = Hn, Xs = Un, Zs = Wn, de = "Accordion", Js = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"], [nr, Qs, ei] = Vt(de), [rt, md] = Ne(de, [
1670
+ ei,
1671
+ Gn
1672
+ ]), or = Gn(), zn = T.forwardRef(
1673
+ (e, r) => {
1674
+ const { type: t, ...n } = e, o = n, l = n;
1675
+ return /* @__PURE__ */ s.jsx(nr.Provider, { scope: e.__scopeAccordion, children: t === "multiple" ? /* @__PURE__ */ s.jsx(oi, { ...l, ref: r }) : /* @__PURE__ */ s.jsx(ni, { ...o, ref: r }) });
1676
+ }
1677
+ );
1678
+ zn.displayName = de;
1679
+ var [Yn, ti] = rt(de), [qn, ri] = rt(
1680
+ de,
1681
+ { collapsible: !1 }
1682
+ ), ni = T.forwardRef(
1683
+ (e, r) => {
1684
+ const {
1685
+ value: t,
1686
+ defaultValue: n,
1687
+ onValueChange: o = () => {
1688
+ },
1689
+ collapsible: l = !1,
1690
+ ...i
1691
+ } = e, [c, d] = xe({
1692
+ prop: t,
1693
+ defaultProp: n,
1694
+ onChange: o
1695
+ });
1696
+ return /* @__PURE__ */ s.jsx(
1697
+ Yn,
1698
+ {
1699
+ scope: e.__scopeAccordion,
1700
+ value: c ? [c] : [],
1701
+ onItemOpen: d,
1702
+ onItemClose: T.useCallback(() => l && d(""), [l, d]),
1703
+ children: /* @__PURE__ */ s.jsx(qn, { scope: e.__scopeAccordion, collapsible: l, children: /* @__PURE__ */ s.jsx(Xn, { ...i, ref: r }) })
1704
+ }
1705
+ );
1706
+ }
1707
+ ), oi = T.forwardRef((e, r) => {
1708
+ const {
1709
+ value: t,
1710
+ defaultValue: n,
1711
+ onValueChange: o = () => {
1712
+ },
1713
+ ...l
1714
+ } = e, [i = [], c] = xe({
1715
+ prop: t,
1716
+ defaultProp: n,
1717
+ onChange: o
1718
+ }), d = T.useCallback(
1719
+ (f) => c((p = []) => [...p, f]),
1720
+ [c]
1721
+ ), u = T.useCallback(
1722
+ (f) => c((p = []) => p.filter((g) => g !== f)),
1723
+ [c]
1724
+ );
1725
+ return /* @__PURE__ */ s.jsx(
1726
+ Yn,
1727
+ {
1728
+ scope: e.__scopeAccordion,
1729
+ value: i,
1730
+ onItemOpen: d,
1731
+ onItemClose: u,
1732
+ children: /* @__PURE__ */ s.jsx(qn, { scope: e.__scopeAccordion, collapsible: !0, children: /* @__PURE__ */ s.jsx(Xn, { ...l, ref: r }) })
1733
+ }
1734
+ );
1735
+ }), [ai, nt] = rt(de), Xn = T.forwardRef(
1736
+ (e, r) => {
1737
+ const { __scopeAccordion: t, disabled: n, dir: o, orientation: l = "vertical", ...i } = e, c = T.useRef(null), d = q(c, r), u = Qs(t), p = Ft(o) === "ltr", g = I(e.onKeyDown, (x) => {
1738
+ var K;
1739
+ if (!Js.includes(x.key)) return;
1740
+ const y = x.target, v = u().filter((G) => {
1741
+ var U;
1742
+ return !((U = G.ref.current) != null && U.disabled);
1743
+ }), w = v.findIndex((G) => G.ref.current === y), S = v.length;
1744
+ if (w === -1) return;
1745
+ x.preventDefault();
1746
+ let h = w;
1747
+ const _ = 0, L = S - 1, V = () => {
1748
+ h = w + 1, h > L && (h = _);
1749
+ }, j = () => {
1750
+ h = w - 1, h < _ && (h = L);
1751
+ };
1752
+ switch (x.key) {
1753
+ case "Home":
1754
+ h = _;
1755
+ break;
1756
+ case "End":
1757
+ h = L;
1758
+ break;
1759
+ case "ArrowRight":
1760
+ l === "horizontal" && (p ? V() : j());
1761
+ break;
1762
+ case "ArrowDown":
1763
+ l === "vertical" && V();
1764
+ break;
1765
+ case "ArrowLeft":
1766
+ l === "horizontal" && (p ? j() : V());
1767
+ break;
1768
+ case "ArrowUp":
1769
+ l === "vertical" && j();
1770
+ break;
1771
+ }
1772
+ const P = h % S;
1773
+ (K = v[P].ref.current) == null || K.focus();
1774
+ });
1775
+ return /* @__PURE__ */ s.jsx(
1776
+ ai,
1777
+ {
1778
+ scope: t,
1779
+ disabled: n,
1780
+ direction: o,
1781
+ orientation: l,
1782
+ children: /* @__PURE__ */ s.jsx(nr.Slot, { scope: t, children: /* @__PURE__ */ s.jsx(
1783
+ $.div,
1784
+ {
1785
+ ...i,
1786
+ "data-orientation": l,
1787
+ ref: d,
1788
+ onKeyDown: n ? void 0 : g
1789
+ }
1790
+ ) })
1791
+ }
1792
+ );
1793
+ }
1794
+ ), We = "AccordionItem", [li, ar] = rt(We), Zn = T.forwardRef(
1795
+ (e, r) => {
1796
+ const { __scopeAccordion: t, value: n, ...o } = e, l = nt(We, t), i = ti(We, t), c = or(t), d = ne(), u = n && i.value.includes(n) || !1, f = l.disabled || e.disabled;
1797
+ return /* @__PURE__ */ s.jsx(
1798
+ li,
1799
+ {
1800
+ scope: t,
1801
+ open: u,
1802
+ disabled: f,
1803
+ triggerId: d,
1804
+ children: /* @__PURE__ */ s.jsx(
1805
+ qs,
1806
+ {
1807
+ "data-orientation": l.orientation,
1808
+ "data-state": no(u),
1809
+ ...c,
1810
+ ...o,
1811
+ ref: r,
1812
+ disabled: f,
1813
+ open: u,
1814
+ onOpenChange: (p) => {
1815
+ p ? i.onItemOpen(n) : i.onItemClose(n);
1816
+ }
1817
+ }
1818
+ )
1819
+ }
1820
+ );
1821
+ }
1822
+ );
1823
+ Zn.displayName = We;
1824
+ var Jn = "AccordionHeader", Qn = T.forwardRef(
1825
+ (e, r) => {
1826
+ const { __scopeAccordion: t, ...n } = e, o = nt(de, t), l = ar(Jn, t);
1827
+ return /* @__PURE__ */ s.jsx(
1828
+ $.h3,
1829
+ {
1830
+ "data-orientation": o.orientation,
1831
+ "data-state": no(l.open),
1832
+ "data-disabled": l.disabled ? "" : void 0,
1833
+ ...n,
1834
+ ref: r
1835
+ }
1836
+ );
1837
+ }
1838
+ );
1839
+ Qn.displayName = Jn;
1840
+ var Nt = "AccordionTrigger", eo = T.forwardRef(
1841
+ (e, r) => {
1842
+ const { __scopeAccordion: t, ...n } = e, o = nt(de, t), l = ar(Nt, t), i = ri(Nt, t), c = or(t);
1843
+ return /* @__PURE__ */ s.jsx(nr.ItemSlot, { scope: t, children: /* @__PURE__ */ s.jsx(
1844
+ Xs,
1845
+ {
1846
+ "aria-disabled": l.open && !i.collapsible || void 0,
1847
+ "data-orientation": o.orientation,
1848
+ id: l.triggerId,
1849
+ ...c,
1850
+ ...n,
1851
+ ref: r
1852
+ }
1853
+ ) });
1854
+ }
1855
+ );
1856
+ eo.displayName = Nt;
1857
+ var to = "AccordionContent", ro = T.forwardRef(
1858
+ (e, r) => {
1859
+ const { __scopeAccordion: t, ...n } = e, o = nt(de, t), l = ar(to, t), i = or(t);
1860
+ return /* @__PURE__ */ s.jsx(
1861
+ Zs,
1862
+ {
1863
+ role: "region",
1864
+ "aria-labelledby": l.triggerId,
1865
+ "data-orientation": o.orientation,
1866
+ ...i,
1867
+ ...n,
1868
+ ref: r,
1869
+ style: {
1870
+ "--radix-accordion-content-height": "var(--radix-collapsible-content-height)",
1871
+ "--radix-accordion-content-width": "var(--radix-collapsible-content-width)",
1872
+ ...e.style
1873
+ }
1874
+ }
1875
+ );
1876
+ }
1877
+ );
1878
+ ro.displayName = to;
1879
+ function no(e) {
1880
+ return e ? "open" : "closed";
1881
+ }
1882
+ var si = zn, ii = Zn, ci = Qn, di = eo, ui = ro;
1883
+ const gd = si, pi = a.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(ii, { ref: t, className: E("al-border-b", e), ...r }));
1884
+ pi.displayName = "AccordionItem";
1885
+ const fi = a.forwardRef(({ className: e, children: r, ...t }, n) => /* @__PURE__ */ s.jsx(ci, { className: "al-flex", children: /* @__PURE__ */ s.jsxs(
1886
+ di,
1887
+ {
1888
+ ref: n,
1889
+ className: E(
1890
+ "al-flex al-flex-1 al-items-center al-justify-between al-py-4 al-font-medium al-transition-all hover:al-underline [&[data-state=open]>svg]:al-rotate-180",
1891
+ e
1892
+ ),
1893
+ ...t,
1894
+ children: [
1895
+ r,
1896
+ /* @__PURE__ */ s.jsx(jt, { className: "al-h-4 al-w-4 al-shrink-0 al-transition-transform al-duration-200" })
1897
+ ]
1898
+ }
1899
+ ) }));
1900
+ fi.displayName = "AccordionTrigger";
1901
+ const mi = a.forwardRef(({ className: e, children: r, ...t }, n) => /* @__PURE__ */ s.jsx(
1902
+ ui,
1903
+ {
1904
+ ref: n,
1905
+ className: E(
1906
+ "al-overflow-hidden al-text-sm al-transition-all data-[state=closed]:al-animate-accordion-up data-[state=open]:al-animate-accordion-down",
1907
+ e
1908
+ ),
1909
+ ...t,
1910
+ children: /* @__PURE__ */ s.jsx("div", { className: "al-pb-4 al-pt-0", children: r })
1911
+ }
1912
+ ));
1913
+ mi.displayName = "AccordionContent";
1914
+ const gi = 1, vi = 1e6;
1915
+ let ht = 0;
1916
+ function hi() {
1917
+ return ht = (ht + 1) % Number.MAX_SAFE_INTEGER, ht.toString();
1918
+ }
1919
+ const xt = /* @__PURE__ */ new Map(), fr = (e) => {
1920
+ if (xt.has(e))
1921
+ return;
1922
+ const r = setTimeout(() => {
1923
+ xt.delete(e), Ae({
1924
+ type: "REMOVE_TOAST",
1925
+ toastId: e
1926
+ });
1927
+ }, vi);
1928
+ xt.set(e, r);
1929
+ }, xi = (e, r) => {
1930
+ switch (r.type) {
1931
+ case "ADD_TOAST":
1932
+ return {
1933
+ ...e,
1934
+ toasts: [r.toast, ...e.toasts].slice(0, gi)
1935
+ };
1936
+ case "UPDATE_TOAST":
1937
+ return {
1938
+ ...e,
1939
+ toasts: e.toasts.map((t) => t.id === r.toast.id ? { ...t, ...r.toast } : t)
1940
+ };
1941
+ case "DISMISS_TOAST": {
1942
+ const { toastId: t } = r;
1943
+ return t ? fr(t) : e.toasts.forEach((n) => {
1944
+ fr(n.id);
1945
+ }), {
1946
+ ...e,
1947
+ toasts: e.toasts.map(
1948
+ (n) => n.id === t || t === void 0 ? {
1949
+ ...n,
1950
+ open: !1
1951
+ } : n
1952
+ )
1953
+ };
1954
+ }
1955
+ case "REMOVE_TOAST":
1956
+ return r.toastId === void 0 ? {
1957
+ ...e,
1958
+ toasts: []
1959
+ } : {
1960
+ ...e,
1961
+ toasts: e.toasts.filter((t) => t.id !== r.toastId)
1962
+ };
1963
+ }
1964
+ }, Ge = [];
1965
+ let He = { toasts: [] };
1966
+ function Ae(e) {
1967
+ He = xi(He, e), Ge.forEach((r) => {
1968
+ r(He);
1969
+ });
1970
+ }
1971
+ function yi({ ...e }) {
1972
+ const r = hi(), t = (o) => Ae({
1973
+ type: "UPDATE_TOAST",
1974
+ toast: { ...o, id: r }
1975
+ }), n = () => Ae({ type: "DISMISS_TOAST", toastId: r });
1976
+ return Ae({
1977
+ type: "ADD_TOAST",
1978
+ toast: {
1979
+ ...e,
1980
+ id: r,
1981
+ open: !0,
1982
+ onOpenChange: (o) => {
1983
+ o || n();
1984
+ }
1985
+ }
1986
+ }), {
1987
+ id: r,
1988
+ dismiss: n,
1989
+ update: t
1990
+ };
1991
+ }
1992
+ function vd() {
1993
+ const [e, r] = a.useState(He);
1994
+ return a.useEffect(() => (Ge.push(r), () => {
1995
+ const t = Ge.indexOf(r);
1996
+ t > -1 && Ge.splice(t, 1);
1997
+ }), [e]), {
1998
+ ...e,
1999
+ toast: yi,
2000
+ dismiss: (t) => Ae({ type: "DISMISS_TOAST", toastId: t })
2001
+ };
2002
+ }
2003
+ const wi = Ze(
2004
+ E(
2005
+ "al-relative al-w-full al-rounded-lg al-border al-p-4",
2006
+ "[&>svg~*]:al-pl-7 [&>svg+div]:al-translate-y-[-3px] [&>svg]:al-absolute [&>svg]:al-left-4 [&>svg]:al-top-4 [&>svg]:al-text-foreground",
2007
+ "[&>i~*]:al-pl-7 [&>i+div]:al-translate-y-[-3px] [&>i]:al-absolute [&>i]:al-left-4 [&>i]:al-top-4 [&>i]:al-text-foreground"
2008
+ ),
2009
+ {
2010
+ variants: {
2011
+ variant: {
2012
+ default: "al-bg-background al-text-foreground",
2013
+ destructive: "al-border-destructive/50 al-text-destructive dark:al-border-destructive [&>svg]:al-text-destructive [&>i]:al-text-destructive",
2014
+ warning: "al-border-yellow-500/50 al-text-yellow-800 al-bg-yellow-50 [&>svg]:al-text-yellow-600 [&>i]:al-text-yellow-600",
2015
+ success: "al-border-green-500/50 al-text-green-800 al-bg-green-50 [&>svg]:al-text-green-600 [&>i]:al-text-green-600",
2016
+ info: "al-border-blue-500/50 al-text-blue-800 al-bg-blue-50 [&>svg]:al-text-blue-600 [&>i]:al-text-blue-600"
2017
+ }
2018
+ },
2019
+ defaultVariants: {
2020
+ variant: "default"
2021
+ }
2022
+ }
2023
+ ), bi = (e) => {
2024
+ switch (e) {
2025
+ case "destructive":
2026
+ return "error-alert";
2027
+ case "warning":
2028
+ return "warning-alert";
2029
+ case "success":
2030
+ return "success-alert";
2031
+ case "info":
2032
+ return "info-alert";
2033
+ default:
2034
+ return "status-alert";
2035
+ }
2036
+ }, Si = a.forwardRef(({ className: e, variant: r, ...t }, n) => /* @__PURE__ */ s.jsx(
2037
+ "div",
2038
+ {
2039
+ ref: n,
2040
+ role: "alert",
2041
+ "aria-label": bi(r),
2042
+ className: E(wi({ variant: r }), e),
2043
+ ...t
2044
+ }
2045
+ ));
2046
+ Si.displayName = "Alert";
2047
+ const Ci = a.forwardRef(
2048
+ ({ className: e, children: r, ...t }, n) => /* @__PURE__ */ s.jsx(
2049
+ "h5",
2050
+ {
2051
+ ref: n,
2052
+ className: E("al-mb-1 al-font-medium al-leading-none al-tracking-tight", e),
2053
+ ...t,
2054
+ children: r
2055
+ }
2056
+ )
2057
+ );
2058
+ Ci.displayName = "AlertTitle";
2059
+ const _i = a.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
2060
+ "div",
2061
+ {
2062
+ ref: t,
2063
+ className: E("al-text-sm [&_p]:al-leading-relaxed", e),
2064
+ role: "alert",
2065
+ "aria-label": "alert-description",
2066
+ ...r
2067
+ }
2068
+ ));
2069
+ _i.displayName = "AlertDescription";
2070
+ var Ni = a.forwardRef((e, r) => {
2071
+ const { children: t, ...n } = e, o = a.Children.toArray(t), l = o.find(Ei);
2072
+ if (l) {
2073
+ const i = l.props.children, c = o.map((d) => d === l ? a.Children.count(i) > 1 ? a.Children.only(null) : a.isValidElement(i) ? i.props.children : null : d);
2074
+ return /* @__PURE__ */ s.jsx(Et, { ...n, ref: r, children: a.isValidElement(i) ? a.cloneElement(i, void 0, c) : null });
2075
+ }
2076
+ return /* @__PURE__ */ s.jsx(Et, { ...n, ref: r, children: t });
2077
+ });
2078
+ Ni.displayName = "Slot";
2079
+ var Et = a.forwardRef((e, r) => {
2080
+ const { children: t, ...n } = e;
2081
+ if (a.isValidElement(t)) {
2082
+ const o = Ii(t);
2083
+ return a.cloneElement(t, {
2084
+ ...Ri(n, t.props),
2085
+ // @ts-ignore
2086
+ ref: r ? je(r, o) : o
2087
+ });
2088
+ }
2089
+ return a.Children.count(t) > 1 ? a.Children.only(null) : null;
2090
+ });
2091
+ Et.displayName = "SlotClone";
2092
+ var oo = ({ children: e }) => /* @__PURE__ */ s.jsx(s.Fragment, { children: e });
2093
+ function Ei(e) {
2094
+ return a.isValidElement(e) && e.type === oo;
2095
+ }
2096
+ function Ri(e, r) {
2097
+ const t = { ...r };
2098
+ for (const n in r) {
2099
+ const o = e[n], l = r[n];
2100
+ /^on[A-Z]/.test(n) ? o && l ? t[n] = (...c) => {
2101
+ l(...c), o(...c);
2102
+ } : o && (t[n] = o) : n === "style" ? t[n] = { ...o, ...l } : n === "className" && (t[n] = [o, l].filter(Boolean).join(" "));
2103
+ }
2104
+ return { ...e, ...t };
2105
+ }
2106
+ function Ii(e) {
2107
+ var n, o;
2108
+ let r = (n = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : n.get, t = r && "isReactWarning" in r && r.isReactWarning;
2109
+ return t ? e.ref : (r = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, t = r && "isReactWarning" in r && r.isReactWarning, t ? e.props.ref : e.props.ref || e.ref);
2110
+ }
2111
+ var ao = "AlertDialog", [Mi, hd] = Ne(ao, [
2112
+ Ar
2113
+ ]), ue = Ar(), lo = (e) => {
2114
+ const { __scopeAlertDialog: r, ...t } = e, n = ue(r);
2115
+ return /* @__PURE__ */ s.jsx(Ot, { ...n, ...t, modal: !0 });
2116
+ };
2117
+ lo.displayName = ao;
2118
+ var Ai = "AlertDialogTrigger", so = a.forwardRef(
2119
+ (e, r) => {
2120
+ const { __scopeAlertDialog: t, ...n } = e, o = ue(t);
2121
+ return /* @__PURE__ */ s.jsx(yr, { ...o, ...n, ref: r });
2122
+ }
2123
+ );
2124
+ so.displayName = Ai;
2125
+ var Di = "AlertDialogPortal", io = (e) => {
2126
+ const { __scopeAlertDialog: r, ...t } = e, n = ue(r);
2127
+ return /* @__PURE__ */ s.jsx(kt, { ...n, ...t });
2128
+ };
2129
+ io.displayName = Di;
2130
+ var Pi = "AlertDialogOverlay", co = a.forwardRef(
2131
+ (e, r) => {
2132
+ const { __scopeAlertDialog: t, ...n } = e, o = ue(t);
2133
+ return /* @__PURE__ */ s.jsx(qe, { ...o, ...n, ref: r });
2134
+ }
2135
+ );
2136
+ co.displayName = Pi;
2137
+ var _e = "AlertDialogContent", [Ti, ji] = Mi(_e), uo = a.forwardRef(
2138
+ (e, r) => {
2139
+ const { __scopeAlertDialog: t, children: n, ...o } = e, l = ue(t), i = a.useRef(null), c = q(r, i), d = a.useRef(null);
2140
+ return /* @__PURE__ */ s.jsx(
2141
+ Da,
2142
+ {
2143
+ contentName: _e,
2144
+ titleName: po,
2145
+ docsSlug: "alert-dialog",
2146
+ children: /* @__PURE__ */ s.jsx(Ti, { scope: t, cancelRef: d, children: /* @__PURE__ */ s.jsxs(
2147
+ Xe,
2148
+ {
2149
+ role: "alertdialog",
2150
+ ...l,
2151
+ ...o,
2152
+ ref: c,
2153
+ onOpenAutoFocus: I(o.onOpenAutoFocus, (u) => {
2154
+ var f;
2155
+ u.preventDefault(), (f = d.current) == null || f.focus({ preventScroll: !0 });
2156
+ }),
2157
+ onPointerDownOutside: (u) => u.preventDefault(),
2158
+ onInteractOutside: (u) => u.preventDefault(),
2159
+ children: [
2160
+ /* @__PURE__ */ s.jsx(oo, { children: n }),
2161
+ /* @__PURE__ */ s.jsx(ki, { contentRef: i })
2162
+ ]
2163
+ }
2164
+ ) })
2165
+ }
2166
+ );
2167
+ }
2168
+ );
2169
+ uo.displayName = _e;
2170
+ var po = "AlertDialogTitle", fo = a.forwardRef(
2171
+ (e, r) => {
2172
+ const { __scopeAlertDialog: t, ...n } = e, o = ue(t);
2173
+ return /* @__PURE__ */ s.jsx($t, { ...o, ...n, ref: r });
2174
+ }
2175
+ );
2176
+ fo.displayName = po;
2177
+ var mo = "AlertDialogDescription", go = a.forwardRef((e, r) => {
2178
+ const { __scopeAlertDialog: t, ...n } = e, o = ue(t);
2179
+ return /* @__PURE__ */ s.jsx(Lt, { ...o, ...n, ref: r });
2180
+ });
2181
+ go.displayName = mo;
2182
+ var Oi = "AlertDialogAction", vo = a.forwardRef(
2183
+ (e, r) => {
2184
+ const { __scopeAlertDialog: t, ...n } = e, o = ue(t);
2185
+ return /* @__PURE__ */ s.jsx(Ye, { ...o, ...n, ref: r });
2186
+ }
2187
+ );
2188
+ vo.displayName = Oi;
2189
+ var ho = "AlertDialogCancel", xo = a.forwardRef(
2190
+ (e, r) => {
2191
+ const { __scopeAlertDialog: t, ...n } = e, { cancelRef: o } = ji(ho, t), l = ue(t), i = q(r, o);
2192
+ return /* @__PURE__ */ s.jsx(Ye, { ...l, ...n, ref: i });
2193
+ }
2194
+ );
2195
+ xo.displayName = ho;
2196
+ var ki = ({ contentRef: e }) => {
2197
+ const r = `\`${_e}\` requires a description for the component to be accessible for screen reader users.
2198
+
2199
+ You can add a description to the \`${_e}\` by passing a \`${mo}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
2200
+
2201
+ Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${_e}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
2202
+
2203
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;
2204
+ return a.useEffect(() => {
2205
+ var n;
2206
+ document.getElementById(
2207
+ (n = e.current) == null ? void 0 : n.getAttribute("aria-describedby")
2208
+ ) || console.warn(r);
2209
+ }, [r, e]), null;
2210
+ }, $i = lo, Li = so, Vi = io, yo = co, wo = uo, bo = vo, So = xo, Co = fo, _o = go;
2211
+ const xd = $i, yd = Li, Fi = Vi, No = a.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
2212
+ yo,
2213
+ {
2214
+ className: E(
2215
+ "al-fixed al-inset-0 al-z-50 al-bg-black/80 al- data-[state=open]:al-animate-in data-[state=closed]:al-animate-out data-[state=closed]:al-fade-out-0 data-[state=open]:al-fade-in-0",
2216
+ e
2217
+ ),
2218
+ ...r,
2219
+ ref: t
2220
+ }
2221
+ ));
2222
+ No.displayName = yo.displayName;
2223
+ const Bi = a.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsxs(Fi, { children: [
2224
+ /* @__PURE__ */ s.jsx(No, {}),
2225
+ /* @__PURE__ */ s.jsx(
2226
+ wo,
2227
+ {
2228
+ ref: t,
2229
+ className: E(
2230
+ "al-fixed al-left-[50%] al-top-[50%] al-z-50 al-grid al-w-full al-max-w-lg al-translate-x-[-50%] al-translate-y-[-50%] al-gap-4 al-border al-bg-background al-p-6 al-shadow-lg al-duration-200 data-[state=open]:al-animate-in data-[state=closed]:al-animate-out data-[state=closed]:al-fade-out-0 data-[state=open]:al-fade-in-0 data-[state=closed]:al-zoom-out-95 data-[state=open]:al-zoom-in-95 data-[state=closed]:al-slide-out-to-left-1/2 data-[state=closed]:al-slide-out-to-top-[48%] data-[state=open]:al-slide-in-from-left-1/2 data-[state=open]:al-slide-in-from-top-[48%] sm:al-rounded-lg",
2231
+ e
2232
+ ),
2233
+ ...r
2234
+ }
2235
+ )
2236
+ ] }));
2237
+ Bi.displayName = wo.displayName;
2238
+ const Gi = ({ className: e, ...r }) => /* @__PURE__ */ s.jsx(
2239
+ "div",
2240
+ {
2241
+ className: E("al-flex al-flex-col al-space-y-2 al-text-center sm:al-text-left", e),
2242
+ ...r
2243
+ }
2244
+ );
2245
+ Gi.displayName = "AlertDialogHeader";
2246
+ const Hi = ({ className: e, ...r }) => /* @__PURE__ */ s.jsx(
2247
+ "div",
2248
+ {
2249
+ className: E(
2250
+ "al-flex al-flex-col-reverse sm:al-flex-row sm:al-justify-end sm:al-space-x-2",
2251
+ e
2252
+ ),
2253
+ ...r
2254
+ }
2255
+ );
2256
+ Hi.displayName = "AlertDialogFooter";
2257
+ const Ki = a.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
2258
+ Co,
2259
+ {
2260
+ ref: t,
2261
+ className: E("al-text-lg al-font-semibold", e),
2262
+ ...r
2263
+ }
2264
+ ));
2265
+ Ki.displayName = Co.displayName;
2266
+ const Ui = a.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
2267
+ _o,
2268
+ {
2269
+ ref: t,
2270
+ className: E("al-text-sm al-text-muted-foreground", e),
2271
+ ...r
2272
+ }
2273
+ ));
2274
+ Ui.displayName = _o.displayName;
2275
+ const Wi = a.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(bo, { ref: t, className: E(Dr(), e), ...r }));
2276
+ Wi.displayName = bo.displayName;
2277
+ const zi = a.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
2278
+ So,
2279
+ {
2280
+ ref: t,
2281
+ className: E(Dr({ variant: "outline" }), "al-mt-2 sm:al-mt-0", e),
2282
+ ...r
2283
+ }
2284
+ ));
2285
+ zi.displayName = So.displayName;
2286
+ function mr(e, [r, t]) {
2287
+ return Math.min(t, Math.max(r, e));
2288
+ }
2289
+ var Eo = a.forwardRef((e, r) => {
2290
+ const { children: t, ...n } = e, o = a.Children.toArray(t), l = o.find(qi);
2291
+ if (l) {
2292
+ const i = l.props.children, c = o.map((d) => d === l ? a.Children.count(i) > 1 ? a.Children.only(null) : a.isValidElement(i) ? i.props.children : null : d);
2293
+ return /* @__PURE__ */ s.jsx(Rt, { ...n, ref: r, children: a.isValidElement(i) ? a.cloneElement(i, void 0, c) : null });
2294
+ }
2295
+ return /* @__PURE__ */ s.jsx(Rt, { ...n, ref: r, children: t });
2296
+ });
2297
+ Eo.displayName = "Slot";
2298
+ var Rt = a.forwardRef((e, r) => {
2299
+ const { children: t, ...n } = e;
2300
+ if (a.isValidElement(t)) {
2301
+ const o = Zi(t);
2302
+ return a.cloneElement(t, {
2303
+ ...Xi(n, t.props),
2304
+ // @ts-ignore
2305
+ ref: r ? je(r, o) : o
2306
+ });
2307
+ }
2308
+ return a.Children.count(t) > 1 ? a.Children.only(null) : null;
2309
+ });
2310
+ Rt.displayName = "SlotClone";
2311
+ var Yi = ({ children: e }) => /* @__PURE__ */ s.jsx(s.Fragment, { children: e });
2312
+ function qi(e) {
2313
+ return a.isValidElement(e) && e.type === Yi;
2314
+ }
2315
+ function Xi(e, r) {
2316
+ const t = { ...r };
2317
+ for (const n in r) {
2318
+ const o = e[n], l = r[n];
2319
+ /^on[A-Z]/.test(n) ? o && l ? t[n] = (...c) => {
2320
+ l(...c), o(...c);
2321
+ } : o && (t[n] = o) : n === "style" ? t[n] = { ...o, ...l } : n === "className" && (t[n] = [o, l].filter(Boolean).join(" "));
2322
+ }
2323
+ return { ...e, ...t };
2324
+ }
2325
+ function Zi(e) {
2326
+ var n, o;
2327
+ let r = (n = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : n.get, t = r && "isReactWarning" in r && r.isReactWarning;
2328
+ return t ? e.ref : (r = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, t = r && "isReactWarning" in r && r.isReactWarning, t ? e.props.ref : e.props.ref || e.ref);
2329
+ }
2330
+ var Ji = [" ", "Enter", "ArrowUp", "ArrowDown"], Qi = [" ", "Enter"], Fe = "Select", [ot, at, ec] = Vt(Fe), [Ee, wd] = Ne(Fe, [
2331
+ ec,
2332
+ Je
2333
+ ]), lt = Je(), [tc, fe] = Ee(Fe), [rc, nc] = Ee(Fe), Ro = (e) => {
2334
+ const {
2335
+ __scopeSelect: r,
2336
+ children: t,
2337
+ open: n,
2338
+ defaultOpen: o,
2339
+ onOpenChange: l,
2340
+ value: i,
2341
+ defaultValue: c,
2342
+ onValueChange: d,
2343
+ dir: u,
2344
+ name: f,
2345
+ autoComplete: p,
2346
+ disabled: g,
2347
+ required: x,
2348
+ form: y
2349
+ } = e, v = lt(r), [w, S] = a.useState(null), [h, _] = a.useState(null), [L, V] = a.useState(!1), j = Ft(u), [P = !1, K] = xe({
2350
+ prop: n,
2351
+ defaultProp: o,
2352
+ onChange: l
2353
+ }), [G, U] = xe({
2354
+ prop: i,
2355
+ defaultProp: c,
2356
+ onChange: d
2357
+ }), re = a.useRef(null), Z = w ? y || !!w.closest("form") : !0, [oe, W] = a.useState(/* @__PURE__ */ new Set()), J = Array.from(oe).map((H) => H.props.value).join(";");
2358
+ return /* @__PURE__ */ s.jsx(Bt, { ...v, children: /* @__PURE__ */ s.jsxs(
2359
+ tc,
2360
+ {
2361
+ required: x,
2362
+ scope: r,
2363
+ trigger: w,
2364
+ onTriggerChange: S,
2365
+ valueNode: h,
2366
+ onValueNodeChange: _,
2367
+ valueNodeHasChildren: L,
2368
+ onValueNodeHasChildrenChange: V,
2369
+ contentId: ne(),
2370
+ value: G,
2371
+ onValueChange: U,
2372
+ open: P,
2373
+ onOpenChange: K,
2374
+ dir: j,
2375
+ triggerPointerDownPosRef: re,
2376
+ disabled: g,
2377
+ children: [
2378
+ /* @__PURE__ */ s.jsx(ot.Provider, { scope: r, children: /* @__PURE__ */ s.jsx(
2379
+ rc,
2380
+ {
2381
+ scope: e.__scopeSelect,
2382
+ onNativeOptionAdd: a.useCallback((H) => {
2383
+ W((Q) => new Set(Q).add(H));
2384
+ }, []),
2385
+ onNativeOptionRemove: a.useCallback((H) => {
2386
+ W((Q) => {
2387
+ const z = new Set(Q);
2388
+ return z.delete(H), z;
2389
+ });
2390
+ }, []),
2391
+ children: t
2392
+ }
2393
+ ) }),
2394
+ Z ? /* @__PURE__ */ s.jsxs(
2395
+ Qo,
2396
+ {
2397
+ "aria-hidden": !0,
2398
+ required: x,
2399
+ tabIndex: -1,
2400
+ name: f,
2401
+ autoComplete: p,
2402
+ value: G,
2403
+ onChange: (H) => U(H.target.value),
2404
+ disabled: g,
2405
+ form: y,
2406
+ children: [
2407
+ G === void 0 ? /* @__PURE__ */ s.jsx("option", { value: "" }) : null,
2408
+ Array.from(oe)
2409
+ ]
2410
+ },
2411
+ J
2412
+ ) : null
2413
+ ]
2414
+ }
2415
+ ) });
2416
+ };
2417
+ Ro.displayName = Fe;
2418
+ var Io = "SelectTrigger", Mo = a.forwardRef(
2419
+ (e, r) => {
2420
+ const { __scopeSelect: t, disabled: n = !1, ...o } = e, l = lt(t), i = fe(Io, t), c = i.disabled || n, d = q(r, i.onTriggerChange), u = at(t), f = a.useRef("touch"), [p, g, x] = ea((v) => {
2421
+ const w = u().filter((_) => !_.disabled), S = w.find((_) => _.value === i.value), h = ta(w, v, S);
2422
+ h !== void 0 && i.onValueChange(h.value);
2423
+ }), y = (v) => {
2424
+ c || (i.onOpenChange(!0), x()), v && (i.triggerPointerDownPosRef.current = {
2425
+ x: Math.round(v.pageX),
2426
+ y: Math.round(v.pageY)
2427
+ });
2428
+ };
2429
+ return /* @__PURE__ */ s.jsx(br, { asChild: !0, ...l, children: /* @__PURE__ */ s.jsx(
2430
+ $.button,
2431
+ {
2432
+ type: "button",
2433
+ role: "combobox",
2434
+ "aria-controls": i.contentId,
2435
+ "aria-expanded": i.open,
2436
+ "aria-required": i.required,
2437
+ "aria-autocomplete": "none",
2438
+ dir: i.dir,
2439
+ "data-state": i.open ? "open" : "closed",
2440
+ disabled: c,
2441
+ "data-disabled": c ? "" : void 0,
2442
+ "data-placeholder": Jo(i.value) ? "" : void 0,
2443
+ ...o,
2444
+ ref: d,
2445
+ onClick: I(o.onClick, (v) => {
2446
+ v.currentTarget.focus(), f.current !== "mouse" && y(v);
2447
+ }),
2448
+ onPointerDown: I(o.onPointerDown, (v) => {
2449
+ f.current = v.pointerType;
2450
+ const w = v.target;
2451
+ w.hasPointerCapture(v.pointerId) && w.releasePointerCapture(v.pointerId), v.button === 0 && v.ctrlKey === !1 && v.pointerType === "mouse" && (y(v), v.preventDefault());
2452
+ }),
2453
+ onKeyDown: I(o.onKeyDown, (v) => {
2454
+ const w = p.current !== "";
2455
+ !(v.ctrlKey || v.altKey || v.metaKey) && v.key.length === 1 && g(v.key), !(w && v.key === " ") && Ji.includes(v.key) && (y(), v.preventDefault());
2456
+ })
2457
+ }
2458
+ ) });
2459
+ }
2460
+ );
2461
+ Mo.displayName = Io;
2462
+ var Ao = "SelectValue", Do = a.forwardRef(
2463
+ (e, r) => {
2464
+ const { __scopeSelect: t, className: n, style: o, children: l, placeholder: i = "", ...c } = e, d = fe(Ao, t), { onValueNodeHasChildrenChange: u } = d, f = l !== void 0, p = q(r, d.onValueNodeChange);
2465
+ return ce(() => {
2466
+ u(f);
2467
+ }, [u, f]), /* @__PURE__ */ s.jsx(
2468
+ $.span,
2469
+ {
2470
+ ...c,
2471
+ ref: p,
2472
+ style: { pointerEvents: "none" },
2473
+ children: Jo(d.value) ? /* @__PURE__ */ s.jsx(s.Fragment, { children: i }) : l
2474
+ }
2475
+ );
2476
+ }
2477
+ );
2478
+ Do.displayName = Ao;
2479
+ var oc = "SelectIcon", Po = a.forwardRef(
2480
+ (e, r) => {
2481
+ const { __scopeSelect: t, children: n, ...o } = e;
2482
+ return /* @__PURE__ */ s.jsx($.span, { "aria-hidden": !0, ...o, ref: r, children: n || "▼" });
2483
+ }
2484
+ );
2485
+ Po.displayName = oc;
2486
+ var ac = "SelectPortal", To = (e) => /* @__PURE__ */ s.jsx(Mr, { asChild: !0, ...e });
2487
+ To.displayName = ac;
2488
+ var be = "SelectContent", jo = a.forwardRef(
2489
+ (e, r) => {
2490
+ const t = fe(be, e.__scopeSelect), [n, o] = a.useState();
2491
+ if (ce(() => {
2492
+ o(new DocumentFragment());
2493
+ }, []), !t.open) {
2494
+ const l = n;
2495
+ return l ? Pr.createPortal(
2496
+ /* @__PURE__ */ s.jsx(Oo, { scope: e.__scopeSelect, children: /* @__PURE__ */ s.jsx(ot.Slot, { scope: e.__scopeSelect, children: /* @__PURE__ */ s.jsx("div", { children: e.children }) }) }),
2497
+ l
2498
+ ) : null;
2499
+ }
2500
+ return /* @__PURE__ */ s.jsx(ko, { ...e, ref: r });
2501
+ }
2502
+ );
2503
+ jo.displayName = be;
2504
+ var ie = 10, [Oo, me] = Ee(be), lc = "SelectContentImpl", ko = a.forwardRef(
2505
+ (e, r) => {
2506
+ const {
2507
+ __scopeSelect: t,
2508
+ position: n = "item-aligned",
2509
+ onCloseAutoFocus: o,
2510
+ onEscapeKeyDown: l,
2511
+ onPointerDownOutside: i,
2512
+ //
2513
+ // PopperContent props
2514
+ side: c,
2515
+ sideOffset: d,
2516
+ align: u,
2517
+ alignOffset: f,
2518
+ arrowPadding: p,
2519
+ collisionBoundary: g,
2520
+ collisionPadding: x,
2521
+ sticky: y,
2522
+ hideWhenDetached: v,
2523
+ avoidCollisions: w,
2524
+ //
2525
+ ...S
2526
+ } = e, h = fe(be, t), [_, L] = a.useState(null), [V, j] = a.useState(null), P = q(r, (b) => L(b)), [K, G] = a.useState(null), [U, re] = a.useState(
2527
+ null
2528
+ ), Z = at(t), [oe, W] = a.useState(!1), J = a.useRef(!1);
2529
+ a.useEffect(() => {
2530
+ if (_) return Sr(_);
2531
+ }, [_]), Cr();
2532
+ const H = a.useCallback(
2533
+ (b) => {
2534
+ const [A, ...O] = Z().map((B) => B.ref.current), [k] = O.slice(-1), F = document.activeElement;
2535
+ for (const B of b)
2536
+ if (B === F || (B == null || B.scrollIntoView({ block: "nearest" }), B === A && V && (V.scrollTop = 0), B === k && V && (V.scrollTop = V.scrollHeight), B == null || B.focus(), document.activeElement !== F)) return;
2537
+ },
2538
+ [Z, V]
2539
+ ), Q = a.useCallback(
2540
+ () => H([K, _]),
2541
+ [H, K, _]
2542
+ );
2543
+ a.useEffect(() => {
2544
+ oe && Q();
2545
+ }, [oe, Q]);
2546
+ const { onOpenChange: z, triggerPointerDownPosRef: N } = h;
2547
+ a.useEffect(() => {
2548
+ if (_) {
2549
+ let b = { x: 0, y: 0 };
2550
+ const A = (k) => {
2551
+ var F, B;
2552
+ b = {
2553
+ x: Math.abs(Math.round(k.pageX) - (((F = N.current) == null ? void 0 : F.x) ?? 0)),
2554
+ y: Math.abs(Math.round(k.pageY) - (((B = N.current) == null ? void 0 : B.y) ?? 0))
2555
+ };
2556
+ }, O = (k) => {
2557
+ b.x <= 10 && b.y <= 10 ? k.preventDefault() : _.contains(k.target) || z(!1), document.removeEventListener("pointermove", A), N.current = null;
2558
+ };
2559
+ return N.current !== null && (document.addEventListener("pointermove", A), document.addEventListener("pointerup", O, { capture: !0, once: !0 })), () => {
2560
+ document.removeEventListener("pointermove", A), document.removeEventListener("pointerup", O, { capture: !0 });
2561
+ };
2562
+ }
2563
+ }, [_, z, N]), a.useEffect(() => {
2564
+ const b = () => z(!1);
2565
+ return window.addEventListener("blur", b), window.addEventListener("resize", b), () => {
2566
+ window.removeEventListener("blur", b), window.removeEventListener("resize", b);
2567
+ };
2568
+ }, [z]);
2569
+ const [Y, X] = ea((b) => {
2570
+ const A = Z().filter((F) => !F.disabled), O = A.find((F) => F.ref.current === document.activeElement), k = ta(A, b, O);
2571
+ k && setTimeout(() => k.ref.current.focus());
2572
+ }), m = a.useCallback(
2573
+ (b, A, O) => {
2574
+ const k = !J.current && !O;
2575
+ (h.value !== void 0 && h.value === A || k) && (G(b), k && (J.current = !0));
2576
+ },
2577
+ [h.value]
2578
+ ), R = a.useCallback(() => _ == null ? void 0 : _.focus(), [_]), M = a.useCallback(
2579
+ (b, A, O) => {
2580
+ const k = !J.current && !O;
2581
+ (h.value !== void 0 && h.value === A || k) && re(b);
2582
+ },
2583
+ [h.value]
2584
+ ), C = n === "popper" ? It : $o, D = C === It ? {
2585
+ side: c,
2586
+ sideOffset: d,
2587
+ align: u,
2588
+ alignOffset: f,
2589
+ arrowPadding: p,
2590
+ collisionBoundary: g,
2591
+ collisionPadding: x,
2592
+ sticky: y,
2593
+ hideWhenDetached: v,
2594
+ avoidCollisions: w
2595
+ } : {};
2596
+ return /* @__PURE__ */ s.jsx(
2597
+ Oo,
2598
+ {
2599
+ scope: t,
2600
+ content: _,
2601
+ viewport: V,
2602
+ onViewportChange: j,
2603
+ itemRefCallback: m,
2604
+ selectedItem: K,
2605
+ onItemLeave: R,
2606
+ itemTextRefCallback: M,
2607
+ focusSelectedItem: Q,
2608
+ selectedItemText: U,
2609
+ position: n,
2610
+ isPositioned: oe,
2611
+ searchRef: Y,
2612
+ children: /* @__PURE__ */ s.jsx(Ir, { as: Eo, allowPinchZoom: !0, children: /* @__PURE__ */ s.jsx(
2613
+ _r,
2614
+ {
2615
+ asChild: !0,
2616
+ trapped: h.open,
2617
+ onMountAutoFocus: (b) => {
2618
+ b.preventDefault();
2619
+ },
2620
+ onUnmountAutoFocus: I(o, (b) => {
2621
+ var A;
2622
+ (A = h.trigger) == null || A.focus({ preventScroll: !0 }), b.preventDefault();
2623
+ }),
2624
+ children: /* @__PURE__ */ s.jsx(
2625
+ Nr,
2626
+ {
2627
+ asChild: !0,
2628
+ disableOutsidePointerEvents: !0,
2629
+ onEscapeKeyDown: l,
2630
+ onPointerDownOutside: i,
2631
+ onFocusOutside: (b) => b.preventDefault(),
2632
+ onDismiss: () => h.onOpenChange(!1),
2633
+ children: /* @__PURE__ */ s.jsx(
2634
+ C,
2635
+ {
2636
+ role: "listbox",
2637
+ id: h.contentId,
2638
+ "data-state": h.open ? "open" : "closed",
2639
+ dir: h.dir,
2640
+ onContextMenu: (b) => b.preventDefault(),
2641
+ ...S,
2642
+ ...D,
2643
+ onPlaced: () => W(!0),
2644
+ ref: P,
2645
+ style: {
2646
+ // flex layout so we can place the scroll buttons properly
2647
+ display: "flex",
2648
+ flexDirection: "column",
2649
+ // reset the outline by default as the content MAY get focused
2650
+ outline: "none",
2651
+ ...S.style
2652
+ },
2653
+ onKeyDown: I(S.onKeyDown, (b) => {
2654
+ const A = b.ctrlKey || b.altKey || b.metaKey;
2655
+ if (b.key === "Tab" && b.preventDefault(), !A && b.key.length === 1 && X(b.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(b.key)) {
2656
+ let k = Z().filter((F) => !F.disabled).map((F) => F.ref.current);
2657
+ if (["ArrowUp", "End"].includes(b.key) && (k = k.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(b.key)) {
2658
+ const F = b.target, B = k.indexOf(F);
2659
+ k = k.slice(B + 1);
2660
+ }
2661
+ setTimeout(() => H(k)), b.preventDefault();
2662
+ }
2663
+ })
2664
+ }
2665
+ )
2666
+ }
2667
+ )
2668
+ }
2669
+ ) })
2670
+ }
2671
+ );
2672
+ }
2673
+ );
2674
+ ko.displayName = lc;
2675
+ var sc = "SelectItemAlignedPosition", $o = a.forwardRef((e, r) => {
2676
+ const { __scopeSelect: t, onPlaced: n, ...o } = e, l = fe(be, t), i = me(be, t), [c, d] = a.useState(null), [u, f] = a.useState(null), p = q(r, (P) => f(P)), g = at(t), x = a.useRef(!1), y = a.useRef(!0), { viewport: v, selectedItem: w, selectedItemText: S, focusSelectedItem: h } = i, _ = a.useCallback(() => {
2677
+ if (l.trigger && l.valueNode && c && u && v && w && S) {
2678
+ const P = l.trigger.getBoundingClientRect(), K = u.getBoundingClientRect(), G = l.valueNode.getBoundingClientRect(), U = S.getBoundingClientRect();
2679
+ if (l.dir !== "rtl") {
2680
+ const F = U.left - K.left, B = G.left - F, ge = P.left - B, ve = P.width + ge, ct = Math.max(ve, K.width), dt = window.innerWidth - ie, ut = mr(B, [
2681
+ ie,
2682
+ // Prevents the content from going off the starting edge of the
2683
+ // viewport. It may still go off the ending edge, but this can be
2684
+ // controlled by the user since they may want to manage overflow in a
2685
+ // specific way.
2686
+ // https://github.com/radix-ui/primitives/issues/2049
2687
+ Math.max(ie, dt - ct)
2688
+ ]);
2689
+ c.style.minWidth = ve + "px", c.style.left = ut + "px";
2690
+ } else {
2691
+ const F = K.right - U.right, B = window.innerWidth - G.right - F, ge = window.innerWidth - P.right - B, ve = P.width + ge, ct = Math.max(ve, K.width), dt = window.innerWidth - ie, ut = mr(B, [
2692
+ ie,
2693
+ Math.max(ie, dt - ct)
2694
+ ]);
2695
+ c.style.minWidth = ve + "px", c.style.right = ut + "px";
2696
+ }
2697
+ const re = g(), Z = window.innerHeight - ie * 2, oe = v.scrollHeight, W = window.getComputedStyle(u), J = parseInt(W.borderTopWidth, 10), H = parseInt(W.paddingTop, 10), Q = parseInt(W.borderBottomWidth, 10), z = parseInt(W.paddingBottom, 10), N = J + H + oe + z + Q, Y = Math.min(w.offsetHeight * 5, N), X = window.getComputedStyle(v), m = parseInt(X.paddingTop, 10), R = parseInt(X.paddingBottom, 10), M = P.top + P.height / 2 - ie, C = Z - M, D = w.offsetHeight / 2, b = w.offsetTop + D, A = J + H + b, O = N - A;
2698
+ if (A <= M) {
2699
+ const F = re.length > 0 && w === re[re.length - 1].ref.current;
2700
+ c.style.bottom = "0px";
2701
+ const B = u.clientHeight - v.offsetTop - v.offsetHeight, ge = Math.max(
2702
+ C,
2703
+ D + // viewport might have padding bottom, include it to avoid a scrollable viewport
2704
+ (F ? R : 0) + B + Q
2705
+ ), ve = A + ge;
2706
+ c.style.height = ve + "px";
2707
+ } else {
2708
+ const F = re.length > 0 && w === re[0].ref.current;
2709
+ c.style.top = "0px";
2710
+ const ge = Math.max(
2711
+ M,
2712
+ J + v.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
2713
+ (F ? m : 0) + D
2714
+ ) + O;
2715
+ c.style.height = ge + "px", v.scrollTop = A - M + v.offsetTop;
2716
+ }
2717
+ c.style.margin = `${ie}px 0`, c.style.minHeight = Y + "px", c.style.maxHeight = Z + "px", n == null || n(), requestAnimationFrame(() => x.current = !0);
2718
+ }
2719
+ }, [
2720
+ g,
2721
+ l.trigger,
2722
+ l.valueNode,
2723
+ c,
2724
+ u,
2725
+ v,
2726
+ w,
2727
+ S,
2728
+ l.dir,
2729
+ n
2730
+ ]);
2731
+ ce(() => _(), [_]);
2732
+ const [L, V] = a.useState();
2733
+ ce(() => {
2734
+ u && V(window.getComputedStyle(u).zIndex);
2735
+ }, [u]);
2736
+ const j = a.useCallback(
2737
+ (P) => {
2738
+ P && y.current === !0 && (_(), h == null || h(), y.current = !1);
2739
+ },
2740
+ [_, h]
2741
+ );
2742
+ return /* @__PURE__ */ s.jsx(
2743
+ cc,
2744
+ {
2745
+ scope: t,
2746
+ contentWrapper: c,
2747
+ shouldExpandOnScrollRef: x,
2748
+ onScrollButtonChange: j,
2749
+ children: /* @__PURE__ */ s.jsx(
2750
+ "div",
2751
+ {
2752
+ ref: d,
2753
+ style: {
2754
+ display: "flex",
2755
+ flexDirection: "column",
2756
+ position: "fixed",
2757
+ zIndex: L
2758
+ },
2759
+ children: /* @__PURE__ */ s.jsx(
2760
+ $.div,
2761
+ {
2762
+ ...o,
2763
+ ref: p,
2764
+ style: {
2765
+ // When we get the height of the content, it includes borders. If we were to set
2766
+ // the height without having `boxSizing: 'border-box'` it would be too big.
2767
+ boxSizing: "border-box",
2768
+ // We need to ensure the content doesn't get taller than the wrapper
2769
+ maxHeight: "100%",
2770
+ ...o.style
2771
+ }
2772
+ }
2773
+ )
2774
+ }
2775
+ )
2776
+ }
2777
+ );
2778
+ });
2779
+ $o.displayName = sc;
2780
+ var ic = "SelectPopperPosition", It = a.forwardRef((e, r) => {
2781
+ const {
2782
+ __scopeSelect: t,
2783
+ align: n = "start",
2784
+ collisionPadding: o = ie,
2785
+ ...l
2786
+ } = e, i = lt(t);
2787
+ return /* @__PURE__ */ s.jsx(
2788
+ Er,
2789
+ {
2790
+ ...i,
2791
+ ...l,
2792
+ ref: r,
2793
+ align: n,
2794
+ collisionPadding: o,
2795
+ style: {
2796
+ // Ensure border-box for floating-ui calculations
2797
+ boxSizing: "border-box",
2798
+ ...l.style,
2799
+ "--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
2800
+ "--radix-select-content-available-width": "var(--radix-popper-available-width)",
2801
+ "--radix-select-content-available-height": "var(--radix-popper-available-height)",
2802
+ "--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
2803
+ "--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
2804
+ }
2805
+ }
2806
+ );
2807
+ });
2808
+ It.displayName = ic;
2809
+ var [cc, lr] = Ee(be, {}), Mt = "SelectViewport", Lo = a.forwardRef(
2810
+ (e, r) => {
2811
+ const { __scopeSelect: t, nonce: n, ...o } = e, l = me(Mt, t), i = lr(Mt, t), c = q(r, l.onViewportChange), d = a.useRef(0);
2812
+ return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
2813
+ /* @__PURE__ */ s.jsx(
2814
+ "style",
2815
+ {
2816
+ dangerouslySetInnerHTML: {
2817
+ __html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
2818
+ },
2819
+ nonce: n
2820
+ }
2821
+ ),
2822
+ /* @__PURE__ */ s.jsx(ot.Slot, { scope: t, children: /* @__PURE__ */ s.jsx(
2823
+ $.div,
2824
+ {
2825
+ "data-radix-select-viewport": "",
2826
+ role: "presentation",
2827
+ ...o,
2828
+ ref: c,
2829
+ style: {
2830
+ // we use position: 'relative' here on the `viewport` so that when we call
2831
+ // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
2832
+ // (independent of the scrollUpButton).
2833
+ position: "relative",
2834
+ flex: 1,
2835
+ // Viewport should only be scrollable in the vertical direction.
2836
+ // This won't work in vertical writing modes, so we'll need to
2837
+ // revisit this if/when that is supported
2838
+ // https://developer.chrome.com/blog/vertical-form-controls
2839
+ overflow: "hidden auto",
2840
+ ...o.style
2841
+ },
2842
+ onScroll: I(o.onScroll, (u) => {
2843
+ const f = u.currentTarget, { contentWrapper: p, shouldExpandOnScrollRef: g } = i;
2844
+ if (g != null && g.current && p) {
2845
+ const x = Math.abs(d.current - f.scrollTop);
2846
+ if (x > 0) {
2847
+ const y = window.innerHeight - ie * 2, v = parseFloat(p.style.minHeight), w = parseFloat(p.style.height), S = Math.max(v, w);
2848
+ if (S < y) {
2849
+ const h = S + x, _ = Math.min(y, h), L = h - _;
2850
+ p.style.height = _ + "px", p.style.bottom === "0px" && (f.scrollTop = L > 0 ? L : 0, p.style.justifyContent = "flex-end");
2851
+ }
2852
+ }
2853
+ }
2854
+ d.current = f.scrollTop;
2855
+ })
2856
+ }
2857
+ ) })
2858
+ ] });
2859
+ }
2860
+ );
2861
+ Lo.displayName = Mt;
2862
+ var Vo = "SelectGroup", [dc, uc] = Ee(Vo), Fo = a.forwardRef(
2863
+ (e, r) => {
2864
+ const { __scopeSelect: t, ...n } = e, o = ne();
2865
+ return /* @__PURE__ */ s.jsx(dc, { scope: t, id: o, children: /* @__PURE__ */ s.jsx($.div, { role: "group", "aria-labelledby": o, ...n, ref: r }) });
2866
+ }
2867
+ );
2868
+ Fo.displayName = Vo;
2869
+ var Bo = "SelectLabel", Go = a.forwardRef(
2870
+ (e, r) => {
2871
+ const { __scopeSelect: t, ...n } = e, o = uc(Bo, t);
2872
+ return /* @__PURE__ */ s.jsx($.div, { id: o.id, ...n, ref: r });
2873
+ }
2874
+ );
2875
+ Go.displayName = Bo;
2876
+ var ze = "SelectItem", [pc, Ho] = Ee(ze), Ko = a.forwardRef(
2877
+ (e, r) => {
2878
+ const {
2879
+ __scopeSelect: t,
2880
+ value: n,
2881
+ disabled: o = !1,
2882
+ textValue: l,
2883
+ ...i
2884
+ } = e, c = fe(ze, t), d = me(ze, t), u = c.value === n, [f, p] = a.useState(l ?? ""), [g, x] = a.useState(!1), y = q(
2885
+ r,
2886
+ (h) => {
2887
+ var _;
2888
+ return (_ = d.itemRefCallback) == null ? void 0 : _.call(d, h, n, o);
2889
+ }
2890
+ ), v = ne(), w = a.useRef("touch"), S = () => {
2891
+ o || (c.onValueChange(n), c.onOpenChange(!1));
2892
+ };
2893
+ if (n === "")
2894
+ throw new Error(
2895
+ "A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder."
2896
+ );
2897
+ return /* @__PURE__ */ s.jsx(
2898
+ pc,
2899
+ {
2900
+ scope: t,
2901
+ value: n,
2902
+ disabled: o,
2903
+ textId: v,
2904
+ isSelected: u,
2905
+ onItemTextChange: a.useCallback((h) => {
2906
+ p((_) => _ || ((h == null ? void 0 : h.textContent) ?? "").trim());
2907
+ }, []),
2908
+ children: /* @__PURE__ */ s.jsx(
2909
+ ot.ItemSlot,
2910
+ {
2911
+ scope: t,
2912
+ value: n,
2913
+ disabled: o,
2914
+ textValue: f,
2915
+ children: /* @__PURE__ */ s.jsx(
2916
+ $.div,
2917
+ {
2918
+ role: "option",
2919
+ "aria-labelledby": v,
2920
+ "data-highlighted": g ? "" : void 0,
2921
+ "aria-selected": u && g,
2922
+ "data-state": u ? "checked" : "unchecked",
2923
+ "aria-disabled": o || void 0,
2924
+ "data-disabled": o ? "" : void 0,
2925
+ tabIndex: o ? void 0 : -1,
2926
+ ...i,
2927
+ ref: y,
2928
+ onFocus: I(i.onFocus, () => x(!0)),
2929
+ onBlur: I(i.onBlur, () => x(!1)),
2930
+ onClick: I(i.onClick, () => {
2931
+ w.current !== "mouse" && S();
2932
+ }),
2933
+ onPointerUp: I(i.onPointerUp, () => {
2934
+ w.current === "mouse" && S();
2935
+ }),
2936
+ onPointerDown: I(i.onPointerDown, (h) => {
2937
+ w.current = h.pointerType;
2938
+ }),
2939
+ onPointerMove: I(i.onPointerMove, (h) => {
2940
+ var _;
2941
+ w.current = h.pointerType, o ? (_ = d.onItemLeave) == null || _.call(d) : w.current === "mouse" && h.currentTarget.focus({ preventScroll: !0 });
2942
+ }),
2943
+ onPointerLeave: I(i.onPointerLeave, (h) => {
2944
+ var _;
2945
+ h.currentTarget === document.activeElement && ((_ = d.onItemLeave) == null || _.call(d));
2946
+ }),
2947
+ onKeyDown: I(i.onKeyDown, (h) => {
2948
+ var L;
2949
+ ((L = d.searchRef) == null ? void 0 : L.current) !== "" && h.key === " " || (Qi.includes(h.key) && S(), h.key === " " && h.preventDefault());
2950
+ })
2951
+ }
2952
+ )
2953
+ }
2954
+ )
2955
+ }
2956
+ );
2957
+ }
2958
+ );
2959
+ Ko.displayName = ze;
2960
+ var Me = "SelectItemText", Uo = a.forwardRef(
2961
+ (e, r) => {
2962
+ const { __scopeSelect: t, className: n, style: o, ...l } = e, i = fe(Me, t), c = me(Me, t), d = Ho(Me, t), u = nc(Me, t), [f, p] = a.useState(null), g = q(
2963
+ r,
2964
+ (S) => p(S),
2965
+ d.onItemTextChange,
2966
+ (S) => {
2967
+ var h;
2968
+ return (h = c.itemTextRefCallback) == null ? void 0 : h.call(c, S, d.value, d.disabled);
2969
+ }
2970
+ ), x = f == null ? void 0 : f.textContent, y = a.useMemo(
2971
+ () => /* @__PURE__ */ s.jsx("option", { value: d.value, disabled: d.disabled, children: x }, d.value),
2972
+ [d.disabled, d.value, x]
2973
+ ), { onNativeOptionAdd: v, onNativeOptionRemove: w } = u;
2974
+ return ce(() => (v(y), () => w(y)), [v, w, y]), /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
2975
+ /* @__PURE__ */ s.jsx($.span, { id: d.textId, ...l, ref: g }),
2976
+ d.isSelected && i.valueNode && !i.valueNodeHasChildren ? Pr.createPortal(l.children, i.valueNode) : null
2977
+ ] });
2978
+ }
2979
+ );
2980
+ Uo.displayName = Me;
2981
+ var Wo = "SelectItemIndicator", zo = a.forwardRef(
2982
+ (e, r) => {
2983
+ const { __scopeSelect: t, ...n } = e;
2984
+ return Ho(Wo, t).isSelected ? /* @__PURE__ */ s.jsx($.span, { "aria-hidden": !0, ...n, ref: r }) : null;
2985
+ }
2986
+ );
2987
+ zo.displayName = Wo;
2988
+ var At = "SelectScrollUpButton", Yo = a.forwardRef((e, r) => {
2989
+ const t = me(At, e.__scopeSelect), n = lr(At, e.__scopeSelect), [o, l] = a.useState(!1), i = q(r, n.onScrollButtonChange);
2990
+ return ce(() => {
2991
+ if (t.viewport && t.isPositioned) {
2992
+ let c = function() {
2993
+ const u = d.scrollTop > 0;
2994
+ l(u);
2995
+ };
2996
+ const d = t.viewport;
2997
+ return c(), d.addEventListener("scroll", c), () => d.removeEventListener("scroll", c);
2998
+ }
2999
+ }, [t.viewport, t.isPositioned]), o ? /* @__PURE__ */ s.jsx(
3000
+ Xo,
3001
+ {
3002
+ ...e,
3003
+ ref: i,
3004
+ onAutoScroll: () => {
3005
+ const { viewport: c, selectedItem: d } = t;
3006
+ c && d && (c.scrollTop = c.scrollTop - d.offsetHeight);
3007
+ }
3008
+ }
3009
+ ) : null;
3010
+ });
3011
+ Yo.displayName = At;
3012
+ var Dt = "SelectScrollDownButton", qo = a.forwardRef((e, r) => {
3013
+ const t = me(Dt, e.__scopeSelect), n = lr(Dt, e.__scopeSelect), [o, l] = a.useState(!1), i = q(r, n.onScrollButtonChange);
3014
+ return ce(() => {
3015
+ if (t.viewport && t.isPositioned) {
3016
+ let c = function() {
3017
+ const u = d.scrollHeight - d.clientHeight, f = Math.ceil(d.scrollTop) < u;
3018
+ l(f);
3019
+ };
3020
+ const d = t.viewport;
3021
+ return c(), d.addEventListener("scroll", c), () => d.removeEventListener("scroll", c);
3022
+ }
3023
+ }, [t.viewport, t.isPositioned]), o ? /* @__PURE__ */ s.jsx(
3024
+ Xo,
3025
+ {
3026
+ ...e,
3027
+ ref: i,
3028
+ onAutoScroll: () => {
3029
+ const { viewport: c, selectedItem: d } = t;
3030
+ c && d && (c.scrollTop = c.scrollTop + d.offsetHeight);
3031
+ }
3032
+ }
3033
+ ) : null;
3034
+ });
3035
+ qo.displayName = Dt;
3036
+ var Xo = a.forwardRef((e, r) => {
3037
+ const { __scopeSelect: t, onAutoScroll: n, ...o } = e, l = me("SelectScrollButton", t), i = a.useRef(null), c = at(t), d = a.useCallback(() => {
3038
+ i.current !== null && (window.clearInterval(i.current), i.current = null);
3039
+ }, []);
3040
+ return a.useEffect(() => () => d(), [d]), ce(() => {
3041
+ var f;
3042
+ const u = c().find((p) => p.ref.current === document.activeElement);
3043
+ (f = u == null ? void 0 : u.ref.current) == null || f.scrollIntoView({ block: "nearest" });
3044
+ }, [c]), /* @__PURE__ */ s.jsx(
3045
+ $.div,
3046
+ {
3047
+ "aria-hidden": !0,
3048
+ ...o,
3049
+ ref: r,
3050
+ style: { flexShrink: 0, ...o.style },
3051
+ onPointerDown: I(o.onPointerDown, () => {
3052
+ i.current === null && (i.current = window.setInterval(n, 50));
3053
+ }),
3054
+ onPointerMove: I(o.onPointerMove, () => {
3055
+ var u;
3056
+ (u = l.onItemLeave) == null || u.call(l), i.current === null && (i.current = window.setInterval(n, 50));
3057
+ }),
3058
+ onPointerLeave: I(o.onPointerLeave, () => {
3059
+ d();
3060
+ })
3061
+ }
3062
+ );
3063
+ }), fc = "SelectSeparator", Zo = a.forwardRef(
3064
+ (e, r) => {
3065
+ const { __scopeSelect: t, ...n } = e;
3066
+ return /* @__PURE__ */ s.jsx($.div, { "aria-hidden": !0, ...n, ref: r });
3067
+ }
3068
+ );
3069
+ Zo.displayName = fc;
3070
+ var Pt = "SelectArrow", mc = a.forwardRef(
3071
+ (e, r) => {
3072
+ const { __scopeSelect: t, ...n } = e, o = lt(t), l = fe(Pt, t), i = me(Pt, t);
3073
+ return l.open && i.position === "popper" ? /* @__PURE__ */ s.jsx(Rr, { ...o, ...n, ref: r }) : null;
3074
+ }
3075
+ );
3076
+ mc.displayName = Pt;
3077
+ function Jo(e) {
3078
+ return e === "" || e === void 0;
3079
+ }
3080
+ var Qo = a.forwardRef(
3081
+ (e, r) => {
3082
+ const { value: t, ...n } = e, o = a.useRef(null), l = q(r, o), i = Pa(t);
3083
+ return a.useEffect(() => {
3084
+ const c = o.current, d = window.HTMLSelectElement.prototype, f = Object.getOwnPropertyDescriptor(
3085
+ d,
3086
+ "value"
3087
+ ).set;
3088
+ if (i !== t && f) {
3089
+ const p = new Event("change", { bubbles: !0 });
3090
+ f.call(c, t), c.dispatchEvent(p);
3091
+ }
3092
+ }, [i, t]), /* @__PURE__ */ s.jsx(Ta, { asChild: !0, children: /* @__PURE__ */ s.jsx("select", { ...n, ref: l, defaultValue: t }) });
3093
+ }
3094
+ );
3095
+ Qo.displayName = "BubbleSelect";
3096
+ function ea(e) {
3097
+ const r = Qe(e), t = a.useRef(""), n = a.useRef(0), o = a.useCallback(
3098
+ (i) => {
3099
+ const c = t.current + i;
3100
+ r(c), function d(u) {
3101
+ t.current = u, window.clearTimeout(n.current), u !== "" && (n.current = window.setTimeout(() => d(""), 1e3));
3102
+ }(c);
3103
+ },
3104
+ [r]
3105
+ ), l = a.useCallback(() => {
3106
+ t.current = "", window.clearTimeout(n.current);
3107
+ }, []);
3108
+ return a.useEffect(() => () => window.clearTimeout(n.current), []), [t, o, l];
3109
+ }
3110
+ function ta(e, r, t) {
3111
+ const o = r.length > 1 && Array.from(r).every((u) => u === r[0]) ? r[0] : r, l = t ? e.indexOf(t) : -1;
3112
+ let i = gc(e, Math.max(l, 0));
3113
+ o.length === 1 && (i = i.filter((u) => u !== t));
3114
+ const d = i.find(
3115
+ (u) => u.textValue.toLowerCase().startsWith(o.toLowerCase())
3116
+ );
3117
+ return d !== t ? d : void 0;
3118
+ }
3119
+ function gc(e, r) {
3120
+ return e.map((t, n) => e[(r + n) % e.length]);
3121
+ }
3122
+ var vc = Ro, ra = Mo, hc = Do, xc = Po, yc = To, na = jo, wc = Lo, bc = Fo, oa = Go, aa = Ko, Sc = Uo, Cc = zo, la = Yo, sa = qo, ia = Zo;
3123
+ const _c = vc, bd = bc, Nc = hc, ca = a.forwardRef(({ className: e, children: r, ...t }, n) => /* @__PURE__ */ s.jsxs(
3124
+ ra,
3125
+ {
3126
+ ref: n,
3127
+ className: E(
3128
+ "al-flex al-h-10 al-items-center al-justify-between al-rounded-md al-border al-border-input al-bg-transparent al-px-3 al-py-2 al-text-sm al-ring-offset-background placeholder:al-text-muted-foreground focus:al-outline-none focus:al-ring-2 focus:al-ring-ring focus:al-ring-offset-2 disabled:al-cursor-not-allowed disabled:al-opacity-50 [&>span]:al-line-clamp-1 data-[placeholder]:al-text-muted-foreground",
3129
+ e
3130
+ ),
3131
+ ...t,
3132
+ children: [
3133
+ r,
3134
+ /* @__PURE__ */ s.jsx(xc, { asChild: !0, children: /* @__PURE__ */ s.jsx(jt, { className: "al-h-4 al-w-4 al-opacity-50 al-ml-2" }) })
3135
+ ]
3136
+ }
3137
+ ));
3138
+ ca.displayName = ra.displayName;
3139
+ const da = a.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
3140
+ la,
3141
+ {
3142
+ ref: t,
3143
+ className: E("al-flex al-cursor-default al-items-center al-justify-center al-py-1", e),
3144
+ ...r,
3145
+ children: /* @__PURE__ */ s.jsx(Na, { className: "al-h-4 al-w-4" })
3146
+ }
3147
+ ));
3148
+ da.displayName = la.displayName;
3149
+ const ua = a.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
3150
+ sa,
3151
+ {
3152
+ ref: t,
3153
+ className: E("al-flex al-cursor-default al-items-center al-justify-center al-py-1", e),
3154
+ ...r,
3155
+ children: /* @__PURE__ */ s.jsx(jt, { className: "al-h-4 al-w-4" })
3156
+ }
3157
+ ));
3158
+ ua.displayName = sa.displayName;
3159
+ const pa = a.forwardRef(({ className: e, children: r, position: t = "popper", ...n }, o) => /* @__PURE__ */ s.jsx(yc, { children: /* @__PURE__ */ s.jsxs(
3160
+ na,
3161
+ {
3162
+ ref: o,
3163
+ className: E(
3164
+ "al-relative al-z-[100] al-max-h-96 al-min-w-[8rem] al-overflow-hidden al-rounded-md al-border al-bg-popover al-text-popover-foreground al-shadow-md data-[state=open]:al-animate-in data-[state=closed]:al-animate-out data-[state=closed]:al-fade-out-0 data-[state=open]:al-fade-in-0 data-[state=closed]:al-zoom-out-95 data-[state=open]:al-zoom-in-95 data-[side=bottom]:al-slide-in-from-top-2 data-[side=left]:al-slide-in-from-right-2 data-[side=right]:al-slide-in-from-left-2 data-[side=top]:al-slide-in-from-bottom-2",
3165
+ t === "popper" && "data-[side=bottom]:al-translate-y-1 data-[side=left]:al--translate-x-1 data-[side=right]:al-translate-x-1 data-[side=top]:al--translate-y-1",
3166
+ e
3167
+ ),
3168
+ position: t,
3169
+ ...n,
3170
+ children: [
3171
+ /* @__PURE__ */ s.jsx(da, {}),
3172
+ /* @__PURE__ */ s.jsx(
3173
+ wc,
3174
+ {
3175
+ className: E(
3176
+ "al-p-1",
3177
+ t === "popper" && "al-h-[var(--radix-select-trigger-height)] al-w-full al-min-w-[var(--radix-select-trigger-width)]"
3178
+ ),
3179
+ children: r
3180
+ }
3181
+ ),
3182
+ /* @__PURE__ */ s.jsx(ua, {})
3183
+ ]
3184
+ }
3185
+ ) }));
3186
+ pa.displayName = na.displayName;
3187
+ const Ec = a.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
3188
+ oa,
3189
+ {
3190
+ ref: t,
3191
+ className: E("al-py-1.5 al-pl-8 al-pr-2 al-text-sm al-font-semibold", e),
3192
+ ...r
3193
+ }
3194
+ ));
3195
+ Ec.displayName = oa.displayName;
3196
+ const fa = a.forwardRef(({ className: e, children: r, ...t }, n) => /* @__PURE__ */ s.jsxs(
3197
+ aa,
3198
+ {
3199
+ ref: n,
3200
+ className: E(
3201
+ "al-relative al-flex al-w-full al-cursor-default al-select-none al-items-center al-rounded-sm al-py-1.5 al-pl-8 al-pr-2 al-text-sm al-outline-none focus:al-bg-accent focus:al-text-accent-foreground data-[disabled]:al-pointer-events-none data-[disabled]:al-opacity-50",
3202
+ e
3203
+ ),
3204
+ ...t,
3205
+ children: [
3206
+ /* @__PURE__ */ s.jsx("span", { className: "al-absolute al-left-2 al-flex al-h-3.5 al-w-3.5 al-items-center al-justify-center", children: /* @__PURE__ */ s.jsx(Cc, { children: /* @__PURE__ */ s.jsx(xr, { className: "al-h-4 al-w-4" }) }) }),
3207
+ /* @__PURE__ */ s.jsx(Sc, { children: r })
3208
+ ]
3209
+ }
3210
+ ));
3211
+ fa.displayName = aa.displayName;
3212
+ const Rc = a.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ s.jsx(
3213
+ ia,
3214
+ {
3215
+ ref: t,
3216
+ className: E("al--mx-1 al-my-1 al-h-px al-bg-muted", e),
3217
+ ...r
3218
+ }
3219
+ ));
3220
+ Rc.displayName = ia.displayName;
3221
+ const Ic = Ze(
3222
+ [
3223
+ "al-flex al-items-center al-justify-between al-rounded-md",
3224
+ "al-text-sm al-font-normal",
3225
+ "al-transition-colors",
3226
+ "focus-visible:al-outline-none focus-visible:al-ring-2 focus-visible:al-ring-ring focus-visible:al-ring-offset-2",
3227
+ "disabled:al-pointer-events-none disabled:al-opacity-50",
3228
+ "[&>span]:al-line-clamp-1",
3229
+ // Override base styles
3230
+ "!al-bg-transparent"
3231
+ ].join(" "),
3232
+ {
3233
+ variants: {
3234
+ variant: {
3235
+ default: [
3236
+ "!al-bg-primary !al-text-brand !al-border-primary",
3237
+ "hover:!al-bg-primary/90 hover:!al-text-white",
3238
+ "focus:!al-bg-primary/90 focus:!al-text-white"
3239
+ ].join(" "),
3240
+ destructive: [
3241
+ "!al-bg-destructive !al-text-destructive-foreground",
3242
+ "hover:!al-bg-destructive/90",
3243
+ "focus:!al-bg-destructive/90"
3244
+ ].join(" "),
3245
+ outline: [
3246
+ "!al-border !al-border-input !al-bg-background",
3247
+ "hover:!al-bg-accent hover:!al-text-accent-foreground",
3248
+ "focus:!al-bg-accent focus:!al-text-accent-foreground"
3249
+ ].join(" "),
3250
+ success: [
3251
+ "!al-bg-success !al-text-success-foreground",
3252
+ "hover:!al-bg-success/90",
3253
+ "focus:!al-bg-success/90"
3254
+ ].join(" "),
3255
+ secondary: [
3256
+ "!al-bg-secondary !al-text-secondary-foreground !al-border-2 !al-border-secondary",
3257
+ "hover:!al-bg-secondary/80",
3258
+ "focus:!al-bg-secondary/80"
3259
+ ].join(" "),
3260
+ ghost: [
3261
+ "!al-bg-transparent !al-text-foreground",
3262
+ "hover:!al-bg-accent hover:!al-text-accent-foreground",
3263
+ "focus:!al-bg-accent focus:!al-text-accent-foreground"
3264
+ ].join(" ")
3265
+ },
3266
+ size: {
3267
+ default: "!al-h-10 !al-px-4 !al-py-2",
3268
+ sm: "!al-h-9 !al-px-3",
3269
+ lg: "!al-h-11 !al-px-8"
3270
+ }
3271
+ },
3272
+ defaultVariants: {
3273
+ variant: "default",
3274
+ size: "default"
3275
+ }
3276
+ }
3277
+ ), Mc = ee(
3278
+ ({ options: e, onChange: r, value: t, placeholder: n, className: o, disabled: l, icon: i, variant: c, size: d, open: u }, f) => /* @__PURE__ */ s.jsxs(_c, { value: t, onValueChange: r, disabled: l, open: u, children: [
3279
+ /* @__PURE__ */ s.jsxs(ca, { ref: f, className: E(Ic({ variant: c, size: d, className: o })), children: [
3280
+ i && /* @__PURE__ */ s.jsx("div", { className: "al-mr-2", children: i }),
3281
+ /* @__PURE__ */ s.jsx(Nc, { placeholder: n })
3282
+ ] }),
3283
+ /* @__PURE__ */ s.jsx(pa, { children: e.map((p) => /* @__PURE__ */ s.jsx(fa, { value: p.value, children: p.label }, p.value)) })
3284
+ ] })
3285
+ );
3286
+ Mc.displayName = "NativeSelect";
3287
+ var Ac = (e) => e.type === "checkbox", Dc = (e) => e instanceof Date, ma = (e) => e == null;
3288
+ const Pc = (e) => typeof e == "object";
3289
+ var Be = (e) => !ma(e) && !Array.isArray(e) && Pc(e) && !Dc(e), Tc = (e) => Be(e) && e.target ? Ac(e.target) ? e.target.checked : e.target.value : e, jc = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Oc = (e, r) => e.has(jc(r)), kc = (e) => {
3290
+ const r = e.constructor && e.constructor.prototype;
3291
+ return Be(r) && r.hasOwnProperty("isPrototypeOf");
3292
+ }, $c = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
3293
+ function ga(e) {
3294
+ let r;
3295
+ const t = Array.isArray(e), n = typeof FileList < "u" ? e instanceof FileList : !1;
3296
+ if (e instanceof Date)
3297
+ r = new Date(e);
3298
+ else if (e instanceof Set)
3299
+ r = new Set(e);
3300
+ else if (!($c && (e instanceof Blob || n)) && (t || Be(e)))
3301
+ if (r = t ? [] : {}, !t && !kc(e))
3302
+ r = e;
3303
+ else
3304
+ for (const o in e)
3305
+ e.hasOwnProperty(o) && (r[o] = ga(e[o]));
3306
+ else
3307
+ return e;
3308
+ return r;
3309
+ }
3310
+ var va = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Tt = (e) => e === void 0, ae = (e, r, t) => {
3311
+ if (!r || !Be(e))
3312
+ return t;
3313
+ const n = va(r.split(/[,[\].]+?/)).reduce((o, l) => ma(o) ? o : o[l], e);
3314
+ return Tt(n) || n === e ? Tt(e[r]) ? t : e[r] : n;
3315
+ }, yt = (e) => typeof e == "boolean", Lc = (e) => /^\w*$/.test(e), Vc = (e) => va(e.replace(/["|']|\]/g, "").split(/\.|\[/)), gr = (e, r, t) => {
3316
+ let n = -1;
3317
+ const o = Lc(r) ? [r] : Vc(r), l = o.length, i = l - 1;
3318
+ for (; ++n < l; ) {
3319
+ const c = o[n];
3320
+ let d = t;
3321
+ if (n !== i) {
3322
+ const u = e[c];
3323
+ d = Be(u) || Array.isArray(u) ? u : isNaN(+o[n + 1]) ? {} : [];
3324
+ }
3325
+ if (c === "__proto__" || c === "constructor" || c === "prototype")
3326
+ return;
3327
+ e[c] = d, e = e[c];
3328
+ }
3329
+ };
3330
+ const vr = {
3331
+ BLUR: "blur",
3332
+ FOCUS_OUT: "focusout",
3333
+ CHANGE: "change"
3334
+ }, hr = {
3335
+ onBlur: "onBlur",
3336
+ onChange: "onChange",
3337
+ onSubmit: "onSubmit",
3338
+ onTouched: "onTouched",
3339
+ all: "all"
3340
+ }, ha = T.createContext(null), st = () => T.useContext(ha), Fc = (e) => {
3341
+ const { children: r, ...t } = e;
3342
+ return T.createElement(ha.Provider, { value: t }, r);
3343
+ };
3344
+ var Bc = (e, r, t, n = !0) => {
3345
+ const o = {
3346
+ defaultValues: r._defaultValues
3347
+ };
3348
+ for (const l in e)
3349
+ Object.defineProperty(o, l, {
3350
+ get: () => {
3351
+ const i = l;
3352
+ return r._proxyFormState[i] !== hr.all && (r._proxyFormState[i] = !n || hr.all), t && (t[i] = !0), e[i];
3353
+ }
3354
+ });
3355
+ return o;
3356
+ };
3357
+ const xa = typeof window < "u" ? a.useLayoutEffect : a.useEffect;
3358
+ function Gc(e) {
3359
+ const r = st(), { control: t = r.control, disabled: n, name: o, exact: l } = e || {}, [i, c] = T.useState(t._formState), d = T.useRef({
3360
+ isDirty: !1,
3361
+ isLoading: !1,
3362
+ dirtyFields: !1,
3363
+ touchedFields: !1,
3364
+ validatingFields: !1,
3365
+ isValidating: !1,
3366
+ isValid: !1,
3367
+ errors: !1
3368
+ });
3369
+ return xa(() => t._subscribe({
3370
+ name: o,
3371
+ formState: d.current,
3372
+ exact: l,
3373
+ callback: (u) => {
3374
+ !n && c({
3375
+ ...t._formState,
3376
+ ...u
3377
+ });
3378
+ }
3379
+ }), [o, n, l]), T.useEffect(() => {
3380
+ d.current.isValid && t._setValid(!0);
3381
+ }, [t]), T.useMemo(() => Bc(i, t, d.current, !1), [i, t]);
3382
+ }
3383
+ var Hc = (e) => typeof e == "string", Kc = (e, r, t, n, o) => Hc(e) ? ae(t, e, o) : Array.isArray(e) ? e.map((l) => ae(t, l)) : t;
3384
+ function Uc(e) {
3385
+ const r = st(), { control: t = r.control, name: n, defaultValue: o, disabled: l, exact: i } = e || {}, c = T.useRef(o), [d, u] = T.useState(t._getWatch(n, c.current));
3386
+ return xa(() => t._subscribe({
3387
+ name: n,
3388
+ formState: {
3389
+ values: !0
3390
+ },
3391
+ exact: i,
3392
+ callback: (f) => !l && u(Kc(n, t._names, f.values || t._formValues, !1, c.current))
3393
+ }), [n, t, l, i]), T.useEffect(() => t._removeUnmounted()), d;
3394
+ }
3395
+ function Wc(e) {
3396
+ const r = st(), { name: t, disabled: n, control: o = r.control, shouldUnregister: l } = e, i = Oc(o._names.array, t), c = Uc({
3397
+ control: o,
3398
+ name: t,
3399
+ defaultValue: ae(o._formValues, t, ae(o._defaultValues, t, e.defaultValue)),
3400
+ exact: !0
3401
+ }), d = Gc({
3402
+ control: o,
3403
+ name: t,
3404
+ exact: !0
3405
+ }), u = T.useRef(e), f = T.useRef(o.register(t, {
3406
+ ...e.rules,
3407
+ value: c,
3408
+ ...yt(e.disabled) ? { disabled: e.disabled } : {}
3409
+ })), p = T.useMemo(() => Object.defineProperties({}, {
3410
+ invalid: {
3411
+ enumerable: !0,
3412
+ get: () => !!ae(d.errors, t)
3413
+ },
3414
+ isDirty: {
3415
+ enumerable: !0,
3416
+ get: () => !!ae(d.dirtyFields, t)
3417
+ },
3418
+ isTouched: {
3419
+ enumerable: !0,
3420
+ get: () => !!ae(d.touchedFields, t)
3421
+ },
3422
+ isValidating: {
3423
+ enumerable: !0,
3424
+ get: () => !!ae(d.validatingFields, t)
3425
+ },
3426
+ error: {
3427
+ enumerable: !0,
3428
+ get: () => ae(d.errors, t)
3429
+ }
3430
+ }), [d, t]), g = T.useCallback((w) => f.current.onChange({
3431
+ target: {
3432
+ value: Tc(w),
3433
+ name: t
3434
+ },
3435
+ type: vr.CHANGE
3436
+ }), [t]), x = T.useCallback(() => f.current.onBlur({
3437
+ target: {
3438
+ value: ae(o._formValues, t),
3439
+ name: t
3440
+ },
3441
+ type: vr.BLUR
3442
+ }), [t, o._formValues]), y = T.useCallback((w) => {
3443
+ const S = ae(o._fields, t);
3444
+ S && w && (S._f.ref = {
3445
+ focus: () => w.focus(),
3446
+ select: () => w.select(),
3447
+ setCustomValidity: (h) => w.setCustomValidity(h),
3448
+ reportValidity: () => w.reportValidity()
3449
+ });
3450
+ }, [o._fields, t]), v = T.useMemo(() => ({
3451
+ name: t,
3452
+ value: c,
3453
+ ...yt(n) || d.disabled ? { disabled: d.disabled || n } : {},
3454
+ onChange: g,
3455
+ onBlur: x,
3456
+ ref: y
3457
+ }), [t, n, d.disabled, g, x, y, c]);
3458
+ return T.useEffect(() => {
3459
+ const w = o._options.shouldUnregister || l;
3460
+ o.register(t, {
3461
+ ...u.current.rules,
3462
+ ...yt(u.current.disabled) ? { disabled: u.current.disabled } : {}
3463
+ });
3464
+ const S = (h, _) => {
3465
+ const L = ae(o._fields, h);
3466
+ L && L._f && (L._f.mount = _);
3467
+ };
3468
+ if (S(t, !0), w) {
3469
+ const h = ga(ae(o._options.defaultValues, t));
3470
+ gr(o._defaultValues, t, h), Tt(ae(o._formValues, t)) && gr(o._formValues, t, h);
3471
+ }
3472
+ return !i && o.register(t), () => {
3473
+ (i ? w && !o._state.action : w) ? o.unregister(t) : S(t, !1);
3474
+ };
3475
+ }, [t, o, i, l]), T.useEffect(() => {
3476
+ o._setDisabledField({
3477
+ disabled: n,
3478
+ name: t
3479
+ });
3480
+ }, [n, t, o]), T.useMemo(() => ({
3481
+ field: v,
3482
+ formState: d,
3483
+ fieldState: p
3484
+ }), [v, d, p]);
3485
+ }
3486
+ const zc = (e) => e.render(Wc(e)), Sd = Fc, ya = a.createContext({}), Cd = ({
3487
+ ...e
3488
+ }) => /* @__PURE__ */ s.jsx(ya.Provider, { value: { name: e.name }, children: /* @__PURE__ */ s.jsx(zc, { ...e }) }), it = () => {
3489
+ const e = a.useContext(ya), r = a.useContext(wa), { getFieldState: t, formState: n } = st(), o = t(e.name, n);
3490
+ if (!e)
3491
+ throw new Error("useFormField should be used within <FormField>");
3492
+ const { id: l } = r;
3493
+ return {
3494
+ id: l,
3495
+ name: e.name,
3496
+ formItemId: `${l}-form-item`,
3497
+ formDescriptionId: `${l}-form-item-description`,
3498
+ formMessageId: `${l}-form-item-message`,
3499
+ ...o
3500
+ };
3501
+ }, wa = a.createContext({}), Yc = a.forwardRef(
3502
+ ({ className: e, ...r }, t) => {
3503
+ const n = a.useId();
3504
+ return /* @__PURE__ */ s.jsx(wa.Provider, { value: { id: n }, children: /* @__PURE__ */ s.jsx("div", { ref: t, className: E("al-space-y-2", e), ...r }) });
3505
+ }
3506
+ );
3507
+ Yc.displayName = "FormItem";
3508
+ const qc = a.forwardRef(({ className: e, ...r }, t) => {
3509
+ const { error: n, formItemId: o } = it();
3510
+ return /* @__PURE__ */ s.jsx(
3511
+ ja,
3512
+ {
3513
+ ref: t,
3514
+ className: E(n && "al-text-destructive", e),
3515
+ htmlFor: o,
3516
+ ...r
3517
+ }
3518
+ );
3519
+ });
3520
+ qc.displayName = "FormLabel";
3521
+ const Xc = a.forwardRef(({ ...e }, r) => {
3522
+ const { error: t, formItemId: n, formDescriptionId: o, formMessageId: l } = it();
3523
+ return /* @__PURE__ */ s.jsx(
3524
+ Oa,
3525
+ {
3526
+ ref: r,
3527
+ id: n,
3528
+ "aria-describedby": t ? `${o} ${l}` : `${o}`,
3529
+ "aria-invalid": !!t,
3530
+ ...e
3531
+ }
3532
+ );
3533
+ });
3534
+ Xc.displayName = "FormControl";
3535
+ const Zc = a.forwardRef(({ className: e, ...r }, t) => {
3536
+ const { formDescriptionId: n } = it();
3537
+ return /* @__PURE__ */ s.jsx(
3538
+ "p",
3539
+ {
3540
+ ref: t,
3541
+ id: n,
3542
+ className: E("al-text-sm al-text-muted-foreground", e),
3543
+ ...r
3544
+ }
3545
+ );
3546
+ });
3547
+ Zc.displayName = "FormDescription";
3548
+ const Jc = a.forwardRef(({ className: e, children: r, ...t }, n) => {
3549
+ const { error: o, formMessageId: l } = it(), i = o ? String((o == null ? void 0 : o.message) ?? "") : r;
3550
+ return i ? /* @__PURE__ */ s.jsx(
3551
+ "p",
3552
+ {
3553
+ ref: n,
3554
+ id: l,
3555
+ className: E("al-text-sm al-font-medium al-text-destructive", e),
3556
+ ...t,
3557
+ children: i
3558
+ }
3559
+ ) : null;
3560
+ });
3561
+ Jc.displayName = "FormMessage";
3562
+ export {
3563
+ fd as $,
3564
+ wl as A,
3565
+ Ga as B,
3566
+ Bn as C,
3567
+ ld as D,
3568
+ sd as E,
3569
+ os as F,
3570
+ Cl as G,
3571
+ as as H,
3572
+ Nl as I,
3573
+ ls as J,
3574
+ ss as K,
3575
+ _l as L,
3576
+ is as M,
3577
+ cs as N,
3578
+ ds as O,
3579
+ bl as P,
3580
+ id as Q,
3581
+ Rl as R,
3582
+ rd as S,
3583
+ cd as T,
3584
+ dd as U,
3585
+ ns as V,
3586
+ rs as W,
3587
+ ud as X,
3588
+ pd as Y,
3589
+ Ks as Z,
3590
+ Gs as _,
3591
+ Ls as a,
3592
+ Us as a0,
3593
+ gd as a1,
3594
+ pi as a2,
3595
+ fi as a3,
3596
+ mi as a4,
3597
+ xi as a5,
3598
+ yi as a6,
3599
+ Si as a7,
3600
+ Ci as a8,
3601
+ _i as a9,
3602
+ Xc as aA,
3603
+ Zc as aB,
3604
+ Jc as aC,
3605
+ Cd as aD,
3606
+ xd as aa,
3607
+ Fi as ab,
3608
+ No as ac,
3609
+ yd as ad,
3610
+ Bi as ae,
3611
+ Gi as af,
3612
+ Hi as ag,
3613
+ Ki as ah,
3614
+ Ui as ai,
3615
+ Wi as aj,
3616
+ zi as ak,
3617
+ Mc as al,
3618
+ _c as am,
3619
+ bd as an,
3620
+ Nc as ao,
3621
+ ca as ap,
3622
+ pa as aq,
3623
+ Ec as ar,
3624
+ fa as as,
3625
+ Rc as at,
3626
+ da as au,
3627
+ ua as av,
3628
+ it as aw,
3629
+ Sd as ax,
3630
+ Yc as ay,
3631
+ qc as az,
3632
+ Vs as b,
3633
+ Fs as c,
3634
+ Bs as d,
3635
+ Hs as e,
3636
+ La as f,
3637
+ mr as g,
3638
+ kr as h,
3639
+ Sl as i,
3640
+ El as j,
3641
+ Il as k,
3642
+ Ml as l,
3643
+ Al as m,
3644
+ Dl as n,
3645
+ Tl as o,
3646
+ jl as p,
3647
+ yl as q,
3648
+ Pl as r,
3649
+ ka as s,
3650
+ Tr as t,
3651
+ vd as u,
3652
+ nd as v,
3653
+ od as w,
3654
+ Va as x,
3655
+ Fa as y,
3656
+ Ba as z
3657
+ };