@moises.ai/design-system 1.0.22 → 1.0.24

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.
@@ -0,0 +1,2313 @@
1
+ import { b9 as rt, l as se, s as ie, ba as ae, j as D, bb as Fr, aB as P, u as Y, bc as ot, bd as Ae, be as To, bf as yo, bg as Eo, bh as wo, bi as Ro, bj as _o, bk as Io, bl as Ao, bm as So, m as de, t as nt, bn as xo, bo as Mo, bp as Po, bq as Fo, br as No, bs as Oo, bt as Do, o as Se, bu as Lo, bv as ko, bw as Vo, bx as Nr, by as Or, b3 as Re, bz as Go, bA as $o, bB as Dr, bC as Ko, k as Bo, bD as Lr, aD as jo, aC as Ho } from "./index-BIjOAs1j.js";
2
+ import { bE as As, bF as Ss, bG as xs, bH as Ms, bI as Ps, bJ as Fs, bK as Ns, r as Os, bL as Ds, bM as Ls, bN as ks, bO as Vs, bP as Gs, bQ as $s, bR as Ks, bS as Bs, bT as js, bU as Hs, bV as zs, bW as Us, bX as Ws, bY as qs, bZ as Ys, b_ as Xs, b$ as Zs } from "./index-BIjOAs1j.js";
3
+ import * as a from "react";
4
+ import q from "react";
5
+ import { jsx as i, Fragment as at, jsxs as st } from "react/jsx-runtime";
6
+ import * as zo from "react-dom";
7
+ import { flushSync as ue } from "react-dom";
8
+ var Rr = a[" useEffectEvent ".trim().toString()], _r = a[" useInsertionEffect ".trim().toString()];
9
+ function kr(e) {
10
+ if (typeof Rr == "function")
11
+ return Rr(e);
12
+ const r = a.useRef(() => {
13
+ throw new Error("Cannot call an event handler while rendering.");
14
+ });
15
+ return typeof _r == "function" ? _r(() => {
16
+ r.current = e;
17
+ }) : rt(() => {
18
+ r.current = e;
19
+ }), a.useMemo(() => (...t) => {
20
+ var o;
21
+ return (o = r.current) == null ? void 0 : o.call(r, ...t);
22
+ }, []);
23
+ }
24
+ var xe = "Collapsible", [Uo, it] = se(xe), [Wo, ct] = Uo(xe), lt = a.forwardRef(
25
+ (e, r) => {
26
+ const {
27
+ __scopeCollapsible: t,
28
+ open: o,
29
+ defaultOpen: n,
30
+ disabled: s,
31
+ onOpenChange: u,
32
+ ...c
33
+ } = e, [f, d] = ie({
34
+ prop: o,
35
+ defaultProp: n ?? !1,
36
+ onChange: u,
37
+ caller: xe
38
+ });
39
+ return /* @__PURE__ */ i(
40
+ Wo,
41
+ {
42
+ scope: t,
43
+ disabled: s,
44
+ contentId: ae(),
45
+ open: f,
46
+ onOpenToggle: a.useCallback(() => d((b) => !b), [d]),
47
+ children: /* @__PURE__ */ i(
48
+ D.div,
49
+ {
50
+ "data-state": pt(f),
51
+ "data-disabled": s ? "" : void 0,
52
+ ...c,
53
+ ref: r
54
+ }
55
+ )
56
+ }
57
+ );
58
+ }
59
+ );
60
+ lt.displayName = xe;
61
+ var Vr = "CollapsibleTrigger", ut = a.forwardRef(
62
+ (e, r) => {
63
+ const { __scopeCollapsible: t, ...o } = e, n = ct(Vr, t);
64
+ return /* @__PURE__ */ i(
65
+ D.button,
66
+ {
67
+ type: "button",
68
+ "aria-controls": n.contentId,
69
+ "aria-expanded": n.open || !1,
70
+ "data-state": pt(n.open),
71
+ "data-disabled": n.disabled ? "" : void 0,
72
+ disabled: n.disabled,
73
+ ...o,
74
+ ref: r,
75
+ onClick: P(e.onClick, n.onOpenToggle)
76
+ }
77
+ );
78
+ }
79
+ );
80
+ ut.displayName = Vr;
81
+ var dt = "CollapsibleContent", ft = a.forwardRef(
82
+ (e, r) => {
83
+ const { forceMount: t, ...o } = e, n = ct(dt, e.__scopeCollapsible);
84
+ return /* @__PURE__ */ i(Fr, { present: t || n.open, children: ({ present: s }) => /* @__PURE__ */ i(qo, { ...o, ref: r, present: s }) });
85
+ }
86
+ );
87
+ ft.displayName = dt;
88
+ var qo = a.forwardRef((e, r) => {
89
+ const { __scopeCollapsible: t, present: o, children: n, ...s } = e, u = ct(dt, t), [c, f] = a.useState(o), d = a.useRef(null), b = Y(r, d), w = a.useRef(0), I = w.current, R = a.useRef(0), _ = R.current, m = u.open || c, p = a.useRef(m), T = a.useRef(void 0);
90
+ return a.useEffect(() => {
91
+ const l = requestAnimationFrame(() => p.current = !1);
92
+ return () => cancelAnimationFrame(l);
93
+ }, []), rt(() => {
94
+ const l = d.current;
95
+ if (l) {
96
+ T.current = T.current || {
97
+ transitionDuration: l.style.transitionDuration,
98
+ animationName: l.style.animationName
99
+ }, l.style.transitionDuration = "0s", l.style.animationName = "none";
100
+ const h = l.getBoundingClientRect();
101
+ w.current = h.height, R.current = h.width, p.current || (l.style.transitionDuration = T.current.transitionDuration, l.style.animationName = T.current.animationName), f(o);
102
+ }
103
+ }, [u.open, o]), /* @__PURE__ */ i(
104
+ D.div,
105
+ {
106
+ "data-state": pt(u.open),
107
+ "data-disabled": u.disabled ? "" : void 0,
108
+ id: u.contentId,
109
+ hidden: !m,
110
+ ...s,
111
+ ref: b,
112
+ style: {
113
+ "--radix-collapsible-content-height": I ? `${I}px` : void 0,
114
+ "--radix-collapsible-content-width": _ ? `${_}px` : void 0,
115
+ ...e.style
116
+ },
117
+ children: m && n
118
+ }
119
+ );
120
+ });
121
+ function pt(e) {
122
+ return e ? "open" : "closed";
123
+ }
124
+ var Gr = lt, $r = ut, Kr = ft;
125
+ const vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
126
+ __proto__: null,
127
+ Collapsible: lt,
128
+ CollapsibleContent: ft,
129
+ CollapsibleTrigger: ut,
130
+ Content: Kr,
131
+ Root: Gr,
132
+ Trigger: $r,
133
+ createCollapsibleScope: it
134
+ }, Symbol.toStringTag, { value: "Module" }));
135
+ var J = "Accordion", Yo = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"], [mt, Xo, Zo] = ot(J), [Me, Jo] = se(J, [
136
+ Zo,
137
+ it
138
+ ]), vt = it(), bt = q.forwardRef(
139
+ (e, r) => {
140
+ const { type: t, ...o } = e, n = o, s = o;
141
+ return /* @__PURE__ */ i(mt.Provider, { scope: e.__scopeAccordion, children: t === "multiple" ? /* @__PURE__ */ i(rn, { ...s, ref: r }) : /* @__PURE__ */ i(tn, { ...n, ref: r }) });
142
+ }
143
+ );
144
+ bt.displayName = J;
145
+ var [Br, Qo] = Me(J), [jr, en] = Me(
146
+ J,
147
+ { collapsible: !1 }
148
+ ), tn = q.forwardRef(
149
+ (e, r) => {
150
+ const {
151
+ value: t,
152
+ defaultValue: o,
153
+ onValueChange: n = () => {
154
+ },
155
+ collapsible: s = !1,
156
+ ...u
157
+ } = e, [c, f] = ie({
158
+ prop: t,
159
+ defaultProp: o ?? "",
160
+ onChange: n,
161
+ caller: J
162
+ });
163
+ return /* @__PURE__ */ i(
164
+ Br,
165
+ {
166
+ scope: e.__scopeAccordion,
167
+ value: q.useMemo(() => c ? [c] : [], [c]),
168
+ onItemOpen: f,
169
+ onItemClose: q.useCallback(() => s && f(""), [s, f]),
170
+ children: /* @__PURE__ */ i(jr, { scope: e.__scopeAccordion, collapsible: s, children: /* @__PURE__ */ i(Hr, { ...u, ref: r }) })
171
+ }
172
+ );
173
+ }
174
+ ), rn = q.forwardRef((e, r) => {
175
+ const {
176
+ value: t,
177
+ defaultValue: o,
178
+ onValueChange: n = () => {
179
+ },
180
+ ...s
181
+ } = e, [u, c] = ie({
182
+ prop: t,
183
+ defaultProp: o ?? [],
184
+ onChange: n,
185
+ caller: J
186
+ }), f = q.useCallback(
187
+ (b) => c((w = []) => [...w, b]),
188
+ [c]
189
+ ), d = q.useCallback(
190
+ (b) => c((w = []) => w.filter((I) => I !== b)),
191
+ [c]
192
+ );
193
+ return /* @__PURE__ */ i(
194
+ Br,
195
+ {
196
+ scope: e.__scopeAccordion,
197
+ value: u,
198
+ onItemOpen: f,
199
+ onItemClose: d,
200
+ children: /* @__PURE__ */ i(jr, { scope: e.__scopeAccordion, collapsible: !0, children: /* @__PURE__ */ i(Hr, { ...s, ref: r }) })
201
+ }
202
+ );
203
+ }), [on, Pe] = Me(J), Hr = q.forwardRef(
204
+ (e, r) => {
205
+ const { __scopeAccordion: t, disabled: o, dir: n, orientation: s = "vertical", ...u } = e, c = q.useRef(null), f = Y(c, r), d = Xo(t), w = Ae(n) === "ltr", I = P(e.onKeyDown, (R) => {
206
+ var N;
207
+ if (!Yo.includes(R.key)) return;
208
+ const _ = R.target, m = d().filter((M) => {
209
+ var v;
210
+ return !((v = M.ref.current) != null && v.disabled);
211
+ }), p = m.findIndex((M) => M.ref.current === _), T = m.length;
212
+ if (p === -1) return;
213
+ R.preventDefault();
214
+ let l = p;
215
+ const h = 0, S = T - 1, F = () => {
216
+ l = p + 1, l > S && (l = h);
217
+ }, x = () => {
218
+ l = p - 1, l < h && (l = S);
219
+ };
220
+ switch (R.key) {
221
+ case "Home":
222
+ l = h;
223
+ break;
224
+ case "End":
225
+ l = S;
226
+ break;
227
+ case "ArrowRight":
228
+ s === "horizontal" && (w ? F() : x());
229
+ break;
230
+ case "ArrowDown":
231
+ s === "vertical" && F();
232
+ break;
233
+ case "ArrowLeft":
234
+ s === "horizontal" && (w ? x() : F());
235
+ break;
236
+ case "ArrowUp":
237
+ s === "vertical" && x();
238
+ break;
239
+ }
240
+ const V = l % T;
241
+ (N = m[V].ref.current) == null || N.focus();
242
+ });
243
+ return /* @__PURE__ */ i(
244
+ on,
245
+ {
246
+ scope: t,
247
+ disabled: o,
248
+ direction: n,
249
+ orientation: s,
250
+ children: /* @__PURE__ */ i(mt.Slot, { scope: t, children: /* @__PURE__ */ i(
251
+ D.div,
252
+ {
253
+ ...u,
254
+ "data-orientation": s,
255
+ ref: f,
256
+ onKeyDown: o ? void 0 : I
257
+ }
258
+ ) })
259
+ }
260
+ );
261
+ }
262
+ ), _e = "AccordionItem", [nn, gt] = Me(_e), ht = q.forwardRef(
263
+ (e, r) => {
264
+ const { __scopeAccordion: t, value: o, ...n } = e, s = Pe(_e, t), u = Qo(_e, t), c = vt(t), f = ae(), d = o && u.value.includes(o) || !1, b = s.disabled || e.disabled;
265
+ return /* @__PURE__ */ i(
266
+ nn,
267
+ {
268
+ scope: t,
269
+ open: d,
270
+ disabled: b,
271
+ triggerId: f,
272
+ children: /* @__PURE__ */ i(
273
+ Gr,
274
+ {
275
+ "data-orientation": s.orientation,
276
+ "data-state": Wr(d),
277
+ ...c,
278
+ ...n,
279
+ ref: r,
280
+ disabled: b,
281
+ open: d,
282
+ onOpenChange: (w) => {
283
+ w ? u.onItemOpen(o) : u.onItemClose(o);
284
+ }
285
+ }
286
+ )
287
+ }
288
+ );
289
+ }
290
+ );
291
+ ht.displayName = _e;
292
+ var zr = "AccordionHeader", Ct = q.forwardRef(
293
+ (e, r) => {
294
+ const { __scopeAccordion: t, ...o } = e, n = Pe(J, t), s = gt(zr, t);
295
+ return /* @__PURE__ */ i(
296
+ D.h3,
297
+ {
298
+ "data-orientation": n.orientation,
299
+ "data-state": Wr(s.open),
300
+ "data-disabled": s.disabled ? "" : void 0,
301
+ ...o,
302
+ ref: r
303
+ }
304
+ );
305
+ }
306
+ );
307
+ Ct.displayName = zr;
308
+ var Ke = "AccordionTrigger", Tt = q.forwardRef(
309
+ (e, r) => {
310
+ const { __scopeAccordion: t, ...o } = e, n = Pe(J, t), s = gt(Ke, t), u = en(Ke, t), c = vt(t);
311
+ return /* @__PURE__ */ i(mt.ItemSlot, { scope: t, children: /* @__PURE__ */ i(
312
+ $r,
313
+ {
314
+ "aria-disabled": s.open && !u.collapsible || void 0,
315
+ "data-orientation": n.orientation,
316
+ id: s.triggerId,
317
+ ...c,
318
+ ...o,
319
+ ref: r
320
+ }
321
+ ) });
322
+ }
323
+ );
324
+ Tt.displayName = Ke;
325
+ var Ur = "AccordionContent", yt = q.forwardRef(
326
+ (e, r) => {
327
+ const { __scopeAccordion: t, ...o } = e, n = Pe(J, t), s = gt(Ur, t), u = vt(t);
328
+ return /* @__PURE__ */ i(
329
+ Kr,
330
+ {
331
+ role: "region",
332
+ "aria-labelledby": s.triggerId,
333
+ "data-orientation": n.orientation,
334
+ ...u,
335
+ ...o,
336
+ ref: r,
337
+ style: {
338
+ "--radix-accordion-content-height": "var(--radix-collapsible-content-height)",
339
+ "--radix-accordion-content-width": "var(--radix-collapsible-content-width)",
340
+ ...e.style
341
+ }
342
+ }
343
+ );
344
+ }
345
+ );
346
+ yt.displayName = Ur;
347
+ function Wr(e) {
348
+ return e ? "open" : "closed";
349
+ }
350
+ var an = bt, sn = ht, cn = Ct, ln = Tt, un = yt;
351
+ const bs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
352
+ __proto__: null,
353
+ Accordion: bt,
354
+ AccordionContent: yt,
355
+ AccordionHeader: Ct,
356
+ AccordionItem: ht,
357
+ AccordionTrigger: Tt,
358
+ Content: un,
359
+ Header: cn,
360
+ Item: sn,
361
+ Root: an,
362
+ Trigger: ln,
363
+ createAccordionScope: Jo
364
+ }, Symbol.toStringTag, { value: "Module" }));
365
+ var dn = "Label", Fe = a.forwardRef((e, r) => /* @__PURE__ */ i(
366
+ D.label,
367
+ {
368
+ ...e,
369
+ ref: r,
370
+ onMouseDown: (t) => {
371
+ var n;
372
+ t.target.closest("button, input, select, textarea") || ((n = e.onMouseDown) == null || n.call(e, t), !t.defaultPrevented && t.detail > 1 && t.preventDefault());
373
+ }
374
+ }
375
+ ));
376
+ Fe.displayName = dn;
377
+ var fn = Fe;
378
+ const gs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
379
+ __proto__: null,
380
+ Label: Fe,
381
+ Root: fn
382
+ }, Symbol.toStringTag, { value: "Module" }));
383
+ var [Et, pn] = se("Form"), wt = "Form", [mn, fe] = Et(wt), [vn, qr] = Et(wt), Rt = a.forwardRef(
384
+ (e, r) => {
385
+ const { __scopeForm: t, onClearServerErrors: o = () => {
386
+ }, ...n } = e, s = a.useRef(null), u = Y(r, s), [c, f] = a.useState({}), d = a.useCallback(
387
+ (v) => c[v],
388
+ [c]
389
+ ), b = a.useCallback(
390
+ (v, g) => f((y) => ({
391
+ ...y,
392
+ [v]: { ...y[v] ?? {}, ...g }
393
+ })),
394
+ []
395
+ ), w = a.useCallback((v) => {
396
+ f((g) => ({ ...g, [v]: void 0 })), l((g) => ({ ...g, [v]: {} }));
397
+ }, []), [I, R] = a.useState({}), _ = a.useCallback(
398
+ (v) => I[v] ?? [],
399
+ [I]
400
+ ), m = a.useCallback((v, g) => {
401
+ R((y) => ({
402
+ ...y,
403
+ [v]: [...y[v] ?? [], g]
404
+ }));
405
+ }, []), p = a.useCallback((v, g) => {
406
+ R((y) => ({
407
+ ...y,
408
+ [v]: (y[v] ?? []).filter(
409
+ (O) => O.id !== g
410
+ )
411
+ }));
412
+ }, []), [T, l] = a.useState({}), h = a.useCallback(
413
+ (v) => T[v] ?? {},
414
+ [T]
415
+ ), S = a.useCallback((v, g) => {
416
+ l((y) => ({
417
+ ...y,
418
+ [v]: { ...y[v] ?? {}, ...g }
419
+ }));
420
+ }, []), [F, x] = a.useState({}), V = a.useCallback((v, g) => {
421
+ x((y) => {
422
+ const O = new Set(y[v]).add(g);
423
+ return { ...y, [v]: O };
424
+ });
425
+ }, []), N = a.useCallback((v, g) => {
426
+ x((y) => {
427
+ const O = new Set(y[v]);
428
+ return O.delete(g), { ...y, [v]: O };
429
+ });
430
+ }, []), M = a.useCallback(
431
+ (v) => Array.from(F[v] ?? []).join(" ") || void 0,
432
+ [F]
433
+ );
434
+ return /* @__PURE__ */ i(
435
+ mn,
436
+ {
437
+ scope: t,
438
+ getFieldValidity: d,
439
+ onFieldValidityChange: b,
440
+ getFieldCustomMatcherEntries: _,
441
+ onFieldCustomMatcherEntryAdd: m,
442
+ onFieldCustomMatcherEntryRemove: p,
443
+ getFieldCustomErrors: h,
444
+ onFieldCustomErrorsChange: S,
445
+ onFieldValiditionClear: w,
446
+ children: /* @__PURE__ */ i(
447
+ vn,
448
+ {
449
+ scope: t,
450
+ onFieldMessageIdAdd: V,
451
+ onFieldMessageIdRemove: N,
452
+ getFieldDescription: M,
453
+ children: /* @__PURE__ */ i(
454
+ D.form,
455
+ {
456
+ ...n,
457
+ ref: u,
458
+ onInvalid: P(e.onInvalid, (v) => {
459
+ const g = Yr(v.currentTarget);
460
+ g === v.target && g.focus(), v.preventDefault();
461
+ }),
462
+ onSubmit: P(e.onSubmit, o, {
463
+ checkForDefaultPrevented: !1
464
+ }),
465
+ onReset: P(e.onReset, o)
466
+ }
467
+ )
468
+ }
469
+ )
470
+ }
471
+ );
472
+ }
473
+ );
474
+ Rt.displayName = wt;
475
+ var _t = "FormField", [bn, Ne] = Et(_t), It = a.forwardRef(
476
+ (e, r) => {
477
+ const { __scopeForm: t, name: o, serverInvalid: n = !1, ...s } = e, c = fe(_t, t).getFieldValidity(o), f = ae();
478
+ return /* @__PURE__ */ i(bn, { scope: t, id: f, name: o, serverInvalid: n, children: /* @__PURE__ */ i(
479
+ D.div,
480
+ {
481
+ "data-valid": Nt(c, n),
482
+ "data-invalid": Ot(c, n),
483
+ ...s,
484
+ ref: r
485
+ }
486
+ ) });
487
+ }
488
+ );
489
+ It.displayName = _t;
490
+ var Be = "FormLabel", At = a.forwardRef(
491
+ (e, r) => {
492
+ const { __scopeForm: t, ...o } = e, n = fe(Be, t), s = Ne(Be, t), u = o.htmlFor || s.id, c = n.getFieldValidity(s.name);
493
+ return /* @__PURE__ */ i(
494
+ Fe,
495
+ {
496
+ "data-valid": Nt(c, s.serverInvalid),
497
+ "data-invalid": Ot(c, s.serverInvalid),
498
+ ...o,
499
+ ref: r,
500
+ htmlFor: u
501
+ }
502
+ );
503
+ }
504
+ );
505
+ At.displayName = Be;
506
+ var we = "FormControl", St = a.forwardRef(
507
+ (e, r) => {
508
+ const { __scopeForm: t, ...o } = e, n = fe(we, t), s = Ne(we, t), u = qr(we, t), c = a.useRef(null), f = Y(r, c), d = o.name || s.name, b = o.id || s.id, w = n.getFieldCustomMatcherEntries(d), { onFieldValidityChange: I, onFieldCustomErrorsChange: R, onFieldValiditionClear: _ } = n, m = a.useCallback(
509
+ async (l) => {
510
+ if (Xr(l.validity)) {
511
+ const y = Ge(l.validity);
512
+ I(d, y);
513
+ return;
514
+ }
515
+ const h = l.form ? new FormData(l.form) : new FormData(), S = [l.value, h], F = [], x = [];
516
+ w.forEach((y) => {
517
+ Rn(y, S) ? x.push(y) : _n(y) && F.push(y);
518
+ });
519
+ const V = F.map(({ id: y, match: O }) => [y, O(...S)]), N = Object.fromEntries(V), M = Object.values(N).some(Boolean), v = M;
520
+ l.setCustomValidity(v ? ge : "");
521
+ const g = Ge(l.validity);
522
+ if (I(d, g), R(d, N), !M && x.length > 0) {
523
+ const y = x.map(
524
+ ({ id: H, match: Q }) => Q(...S).then((W) => [H, W])
525
+ ), O = await Promise.all(y), C = Object.fromEntries(O), k = Object.values(C).some(Boolean);
526
+ l.setCustomValidity(k ? ge : "");
527
+ const X = Ge(l.validity);
528
+ I(d, X), R(d, C);
529
+ }
530
+ },
531
+ [w, d, R, I]
532
+ );
533
+ a.useEffect(() => {
534
+ const l = c.current;
535
+ if (l) {
536
+ const h = () => m(l);
537
+ return l.addEventListener("change", h), () => l.removeEventListener("change", h);
538
+ }
539
+ }, [m]);
540
+ const p = a.useCallback(() => {
541
+ const l = c.current;
542
+ l && (l.setCustomValidity(""), _(d));
543
+ }, [d, _]);
544
+ a.useEffect(() => {
545
+ var h;
546
+ const l = (h = c.current) == null ? void 0 : h.form;
547
+ if (l)
548
+ return l.addEventListener("reset", p), () => l.removeEventListener("reset", p);
549
+ }, [p]), a.useEffect(() => {
550
+ const l = c.current, h = l == null ? void 0 : l.closest("form");
551
+ if (h && s.serverInvalid) {
552
+ const S = Yr(h);
553
+ S === l && S.focus();
554
+ }
555
+ }, [s.serverInvalid]);
556
+ const T = n.getFieldValidity(d);
557
+ return /* @__PURE__ */ i(
558
+ D.input,
559
+ {
560
+ "data-valid": Nt(T, s.serverInvalid),
561
+ "data-invalid": Ot(T, s.serverInvalid),
562
+ "aria-invalid": s.serverInvalid ? !0 : void 0,
563
+ "aria-describedby": u.getFieldDescription(d),
564
+ title: "",
565
+ ...o,
566
+ ref: f,
567
+ id: b,
568
+ name: d,
569
+ onInvalid: P(e.onInvalid, (l) => {
570
+ const h = l.currentTarget;
571
+ m(h);
572
+ }),
573
+ onChange: P(e.onChange, (l) => {
574
+ p();
575
+ })
576
+ }
577
+ );
578
+ }
579
+ );
580
+ St.displayName = we;
581
+ var ge = "This value is not valid", gn = {
582
+ badInput: ge,
583
+ patternMismatch: "This value does not match the required pattern",
584
+ rangeOverflow: "This value is too large",
585
+ rangeUnderflow: "This value is too small",
586
+ stepMismatch: "This value does not match the required step",
587
+ tooLong: "This value is too long",
588
+ tooShort: "This value is too short",
589
+ typeMismatch: "This value does not match the required type",
590
+ valid: void 0,
591
+ valueMissing: "This value is missing"
592
+ }, he = "FormMessage", xt = a.forwardRef(
593
+ (e, r) => {
594
+ const { match: t, name: o, ...n } = e, s = Ne(he, e.__scopeForm), u = o ?? s.name;
595
+ return t === void 0 ? /* @__PURE__ */ i(Mt, { ...n, ref: r, name: u, children: e.children || ge }) : typeof t == "function" ? /* @__PURE__ */ i(Cn, { match: t, ...n, ref: r, name: u }) : /* @__PURE__ */ i(hn, { match: t, ...n, ref: r, name: u });
596
+ }
597
+ );
598
+ xt.displayName = he;
599
+ var hn = a.forwardRef(
600
+ (e, r) => {
601
+ const { match: t, forceMatch: o = !1, name: n, children: s, ...u } = e, f = fe(he, u.__scopeForm).getFieldValidity(n);
602
+ return o || (f == null ? void 0 : f[t]) ? /* @__PURE__ */ i(Mt, { ref: r, ...u, name: n, children: s ?? gn[t] }) : null;
603
+ }
604
+ ), Cn = a.forwardRef(
605
+ (e, r) => {
606
+ const { match: t, forceMatch: o = !1, name: n, id: s, children: u, ...c } = e, f = fe(he, c.__scopeForm), d = a.useRef(null), b = Y(r, d), w = ae(), I = s ?? w, R = a.useMemo(() => ({ id: I, match: t }), [I, t]), { onFieldCustomMatcherEntryAdd: _, onFieldCustomMatcherEntryRemove: m } = f;
607
+ a.useEffect(() => (_(n, R), () => m(n, R.id)), [R, n, _, m]);
608
+ const p = f.getFieldValidity(n), l = f.getFieldCustomErrors(n)[I];
609
+ return o || p && !Xr(p) && l ? /* @__PURE__ */ i(Mt, { id: I, ref: b, ...c, name: n, children: u ?? ge }) : null;
610
+ }
611
+ ), Mt = a.forwardRef(
612
+ (e, r) => {
613
+ const { __scopeForm: t, id: o, name: n, ...s } = e, u = qr(he, t), c = ae(), f = o ?? c, { onFieldMessageIdAdd: d, onFieldMessageIdRemove: b } = u;
614
+ return a.useEffect(() => (d(n, f), () => b(n, f)), [n, f, d, b]), /* @__PURE__ */ i(D.span, { id: f, ...s, ref: r });
615
+ }
616
+ ), je = "FormValidityState", Pt = (e) => {
617
+ const { __scopeForm: r, name: t, children: o } = e, n = fe(je, r), s = Ne(je, r), u = t ?? s.name, c = n.getFieldValidity(u);
618
+ return /* @__PURE__ */ i(at, { children: o(c) });
619
+ };
620
+ Pt.displayName = je;
621
+ var Tn = "FormSubmit", Ft = a.forwardRef(
622
+ (e, r) => {
623
+ const { __scopeForm: t, ...o } = e;
624
+ return /* @__PURE__ */ i(D.button, { type: "submit", ...o, ref: r });
625
+ }
626
+ );
627
+ Ft.displayName = Tn;
628
+ function Ge(e) {
629
+ const r = {};
630
+ for (const t in e)
631
+ r[t] = e[t];
632
+ return r;
633
+ }
634
+ function yn(e) {
635
+ return e instanceof HTMLElement;
636
+ }
637
+ function En(e) {
638
+ return "validity" in e;
639
+ }
640
+ function wn(e) {
641
+ return En(e) && (e.validity.valid === !1 || e.getAttribute("aria-invalid") === "true");
642
+ }
643
+ function Yr(e) {
644
+ const r = e.elements, [t] = Array.from(r).filter(yn).filter(wn);
645
+ return t;
646
+ }
647
+ function Rn(e, r) {
648
+ return e.match.constructor.name === "AsyncFunction" || In(e.match, r);
649
+ }
650
+ function _n(e) {
651
+ return e.match.constructor.name === "Function";
652
+ }
653
+ function In(e, r) {
654
+ return e(...r) instanceof Promise;
655
+ }
656
+ function Xr(e) {
657
+ let r = !1;
658
+ for (const t in e) {
659
+ const o = t;
660
+ if (o !== "valid" && o !== "customError" && e[o]) {
661
+ r = !0;
662
+ break;
663
+ }
664
+ }
665
+ return r;
666
+ }
667
+ function Nt(e, r) {
668
+ if ((e == null ? void 0 : e.valid) === !0 && !r) return !0;
669
+ }
670
+ function Ot(e, r) {
671
+ if ((e == null ? void 0 : e.valid) === !1 || r) return !0;
672
+ }
673
+ var An = Rt, Sn = It, xn = At, Mn = St, Pn = xt, Fn = Pt, Nn = Ft;
674
+ const hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
675
+ __proto__: null,
676
+ Control: Mn,
677
+ Field: Sn,
678
+ Form: Rt,
679
+ FormControl: St,
680
+ FormField: It,
681
+ FormLabel: At,
682
+ FormMessage: xt,
683
+ FormSubmit: Ft,
684
+ FormValidityState: Pt,
685
+ Label: xn,
686
+ Message: Pn,
687
+ Root: An,
688
+ Submit: Nn,
689
+ ValidityState: Fn,
690
+ createFormScope: pn
691
+ }, Symbol.toStringTag, { value: "Module" }));
692
+ var Ce = "Menubar", [He, On, Dn] = ot(Ce), [Zr, Ln] = se(Ce, [
693
+ Dn,
694
+ de
695
+ ]), j = To(), Jr = de(), [kn, Dt] = Zr(Ce), Lt = a.forwardRef(
696
+ (e, r) => {
697
+ const {
698
+ __scopeMenubar: t,
699
+ value: o,
700
+ onValueChange: n,
701
+ defaultValue: s,
702
+ loop: u = !0,
703
+ dir: c,
704
+ ...f
705
+ } = e, d = Ae(c), b = Jr(t), [w, I] = ie({
706
+ prop: o,
707
+ onChange: n,
708
+ defaultProp: s ?? "",
709
+ caller: Ce
710
+ }), [R, _] = a.useState(null);
711
+ return /* @__PURE__ */ i(
712
+ kn,
713
+ {
714
+ scope: t,
715
+ value: w,
716
+ onMenuOpen: a.useCallback(
717
+ (m) => {
718
+ I(m), _(m);
719
+ },
720
+ [I]
721
+ ),
722
+ onMenuClose: a.useCallback(() => I(""), [I]),
723
+ onMenuToggle: a.useCallback(
724
+ (m) => {
725
+ I((p) => p ? "" : m), _(m);
726
+ },
727
+ [I]
728
+ ),
729
+ dir: d,
730
+ loop: u,
731
+ children: /* @__PURE__ */ i(He.Provider, { scope: t, children: /* @__PURE__ */ i(He.Slot, { scope: t, children: /* @__PURE__ */ i(
732
+ nt,
733
+ {
734
+ asChild: !0,
735
+ ...b,
736
+ orientation: "horizontal",
737
+ loop: u,
738
+ dir: d,
739
+ currentTabStopId: R,
740
+ onCurrentTabStopIdChange: _,
741
+ children: /* @__PURE__ */ i(D.div, { role: "menubar", ...f, ref: r })
742
+ }
743
+ ) }) })
744
+ }
745
+ );
746
+ }
747
+ );
748
+ Lt.displayName = Ce;
749
+ var kt = "MenubarMenu", [Vn, Qr] = Zr(kt), Vt = (e) => {
750
+ const { __scopeMenubar: r, value: t, ...o } = e, n = ae(), s = t || n || "LEGACY_REACT_AUTO_VALUE", u = Dt(kt, r), c = j(r), f = a.useRef(null), d = a.useRef(!1), b = u.value === s;
751
+ return a.useEffect(() => {
752
+ b || (d.current = !1);
753
+ }, [b]), /* @__PURE__ */ i(
754
+ Vn,
755
+ {
756
+ scope: r,
757
+ value: s,
758
+ triggerId: ae(),
759
+ triggerRef: f,
760
+ contentId: ae(),
761
+ wasKeyboardTriggerOpenRef: d,
762
+ children: /* @__PURE__ */ i(
763
+ So,
764
+ {
765
+ ...c,
766
+ open: b,
767
+ onOpenChange: (w) => {
768
+ w || u.onMenuClose();
769
+ },
770
+ modal: !1,
771
+ dir: u.dir,
772
+ ...o
773
+ }
774
+ )
775
+ }
776
+ );
777
+ };
778
+ Vt.displayName = kt;
779
+ var ze = "MenubarTrigger", Gt = a.forwardRef(
780
+ (e, r) => {
781
+ const { __scopeMenubar: t, disabled: o = !1, ...n } = e, s = Jr(t), u = j(t), c = Dt(ze, t), f = Qr(ze, t), d = a.useRef(null), b = Y(r, d, f.triggerRef), [w, I] = a.useState(!1), R = c.value === f.value;
782
+ return /* @__PURE__ */ i(He.ItemSlot, { scope: t, value: f.value, disabled: o, children: /* @__PURE__ */ i(
783
+ Se,
784
+ {
785
+ asChild: !0,
786
+ ...s,
787
+ focusable: !o,
788
+ tabStopId: f.value,
789
+ children: /* @__PURE__ */ i(Lo, { asChild: !0, ...u, children: /* @__PURE__ */ i(
790
+ D.button,
791
+ {
792
+ type: "button",
793
+ role: "menuitem",
794
+ id: f.triggerId,
795
+ "aria-haspopup": "menu",
796
+ "aria-expanded": R,
797
+ "aria-controls": R ? f.contentId : void 0,
798
+ "data-highlighted": w ? "" : void 0,
799
+ "data-state": R ? "open" : "closed",
800
+ "data-disabled": o ? "" : void 0,
801
+ disabled: o,
802
+ ...n,
803
+ ref: b,
804
+ onPointerDown: P(e.onPointerDown, (_) => {
805
+ !o && _.button === 0 && _.ctrlKey === !1 && (c.onMenuOpen(f.value), R || _.preventDefault());
806
+ }),
807
+ onPointerEnter: P(e.onPointerEnter, () => {
808
+ var m;
809
+ !!c.value && !R && (c.onMenuOpen(f.value), (m = d.current) == null || m.focus());
810
+ }),
811
+ onKeyDown: P(e.onKeyDown, (_) => {
812
+ o || (["Enter", " "].includes(_.key) && c.onMenuToggle(f.value), _.key === "ArrowDown" && c.onMenuOpen(f.value), ["Enter", " ", "ArrowDown"].includes(_.key) && (f.wasKeyboardTriggerOpenRef.current = !0, _.preventDefault()));
813
+ }),
814
+ onFocus: P(e.onFocus, () => I(!0)),
815
+ onBlur: P(e.onBlur, () => I(!1))
816
+ }
817
+ ) })
818
+ }
819
+ ) });
820
+ }
821
+ );
822
+ Gt.displayName = ze;
823
+ var Gn = "MenubarPortal", $t = (e) => {
824
+ const { __scopeMenubar: r, ...t } = e, o = j(r);
825
+ return /* @__PURE__ */ i(xo, { ...o, ...t });
826
+ };
827
+ $t.displayName = Gn;
828
+ var Ue = "MenubarContent", Kt = a.forwardRef(
829
+ (e, r) => {
830
+ const { __scopeMenubar: t, align: o = "start", ...n } = e, s = j(t), u = Dt(Ue, t), c = Qr(Ue, t), f = On(t), d = a.useRef(!1);
831
+ return /* @__PURE__ */ i(
832
+ wo,
833
+ {
834
+ id: c.contentId,
835
+ "aria-labelledby": c.triggerId,
836
+ "data-radix-menubar-content": "",
837
+ ...s,
838
+ ...n,
839
+ ref: r,
840
+ align: o,
841
+ onCloseAutoFocus: P(e.onCloseAutoFocus, (b) => {
842
+ var I;
843
+ !!!u.value && !d.current && ((I = c.triggerRef.current) == null || I.focus()), d.current = !1, b.preventDefault();
844
+ }),
845
+ onFocusOutside: P(e.onFocusOutside, (b) => {
846
+ const w = b.target;
847
+ f().some((R) => {
848
+ var _;
849
+ return (_ = R.ref.current) == null ? void 0 : _.contains(w);
850
+ }) && b.preventDefault();
851
+ }),
852
+ onInteractOutside: P(e.onInteractOutside, () => {
853
+ d.current = !0;
854
+ }),
855
+ onEntryFocus: (b) => {
856
+ c.wasKeyboardTriggerOpenRef.current || b.preventDefault();
857
+ },
858
+ onKeyDown: P(
859
+ e.onKeyDown,
860
+ (b) => {
861
+ if (["ArrowRight", "ArrowLeft"].includes(b.key)) {
862
+ const w = b.target, I = w.hasAttribute("data-radix-menubar-subtrigger"), R = w.closest("[data-radix-menubar-content]") !== b.currentTarget, m = (u.dir === "rtl" ? "ArrowRight" : "ArrowLeft") === b.key;
863
+ if (!m && I || R && m) return;
864
+ let l = f().filter((F) => !F.disabled).map((F) => F.value);
865
+ m && l.reverse();
866
+ const h = l.indexOf(c.value);
867
+ l = u.loop ? Zn(l, h + 1) : l.slice(h + 1);
868
+ const [S] = l;
869
+ S && u.onMenuOpen(S);
870
+ }
871
+ },
872
+ { checkForDefaultPrevented: !1 }
873
+ ),
874
+ style: {
875
+ ...e.style,
876
+ "--radix-menubar-content-transform-origin": "var(--radix-popper-transform-origin)",
877
+ "--radix-menubar-content-available-width": "var(--radix-popper-available-width)",
878
+ "--radix-menubar-content-available-height": "var(--radix-popper-available-height)",
879
+ "--radix-menubar-trigger-width": "var(--radix-popper-anchor-width)",
880
+ "--radix-menubar-trigger-height": "var(--radix-popper-anchor-height)"
881
+ }
882
+ }
883
+ );
884
+ }
885
+ );
886
+ Kt.displayName = Ue;
887
+ var $n = "MenubarGroup", Bt = a.forwardRef(
888
+ (e, r) => {
889
+ const { __scopeMenubar: t, ...o } = e, n = j(t);
890
+ return /* @__PURE__ */ i(Ro, { ...n, ...o, ref: r });
891
+ }
892
+ );
893
+ Bt.displayName = $n;
894
+ var Kn = "MenubarLabel", jt = a.forwardRef(
895
+ (e, r) => {
896
+ const { __scopeMenubar: t, ...o } = e, n = j(t);
897
+ return /* @__PURE__ */ i(Ao, { ...n, ...o, ref: r });
898
+ }
899
+ );
900
+ jt.displayName = Kn;
901
+ var Bn = "MenubarItem", Ht = a.forwardRef(
902
+ (e, r) => {
903
+ const { __scopeMenubar: t, ...o } = e, n = j(t);
904
+ return /* @__PURE__ */ i(_o, { ...n, ...o, ref: r });
905
+ }
906
+ );
907
+ Ht.displayName = Bn;
908
+ var jn = "MenubarCheckboxItem", zt = a.forwardRef(
909
+ (e, r) => {
910
+ const { __scopeMenubar: t, ...o } = e, n = j(t);
911
+ return /* @__PURE__ */ i(Eo, { ...n, ...o, ref: r });
912
+ }
913
+ );
914
+ zt.displayName = jn;
915
+ var Hn = "MenubarRadioGroup", Ut = a.forwardRef(
916
+ (e, r) => {
917
+ const { __scopeMenubar: t, ...o } = e, n = j(t);
918
+ return /* @__PURE__ */ i(Mo, { ...n, ...o, ref: r });
919
+ }
920
+ );
921
+ Ut.displayName = Hn;
922
+ var zn = "MenubarRadioItem", Wt = a.forwardRef(
923
+ (e, r) => {
924
+ const { __scopeMenubar: t, ...o } = e, n = j(t);
925
+ return /* @__PURE__ */ i(Po, { ...n, ...o, ref: r });
926
+ }
927
+ );
928
+ Wt.displayName = zn;
929
+ var Un = "MenubarItemIndicator", qt = a.forwardRef((e, r) => {
930
+ const { __scopeMenubar: t, ...o } = e, n = j(t);
931
+ return /* @__PURE__ */ i(Io, { ...n, ...o, ref: r });
932
+ });
933
+ qt.displayName = Un;
934
+ var Wn = "MenubarSeparator", Yt = a.forwardRef(
935
+ (e, r) => {
936
+ const { __scopeMenubar: t, ...o } = e, n = j(t);
937
+ return /* @__PURE__ */ i(Fo, { ...n, ...o, ref: r });
938
+ }
939
+ );
940
+ Yt.displayName = Wn;
941
+ var qn = "MenubarArrow", Xt = a.forwardRef(
942
+ (e, r) => {
943
+ const { __scopeMenubar: t, ...o } = e, n = j(t);
944
+ return /* @__PURE__ */ i(yo, { ...n, ...o, ref: r });
945
+ }
946
+ );
947
+ Xt.displayName = qn;
948
+ var eo = "MenubarSub", Zt = (e) => {
949
+ const { __scopeMenubar: r, children: t, open: o, onOpenChange: n, defaultOpen: s } = e, u = j(r), [c, f] = ie({
950
+ prop: o,
951
+ defaultProp: s ?? !1,
952
+ onChange: n,
953
+ caller: eo
954
+ });
955
+ return /* @__PURE__ */ i(No, { ...u, open: c, onOpenChange: f, children: t });
956
+ };
957
+ Zt.displayName = eo;
958
+ var Yn = "MenubarSubTrigger", Jt = a.forwardRef(
959
+ (e, r) => {
960
+ const { __scopeMenubar: t, ...o } = e, n = j(t);
961
+ return /* @__PURE__ */ i(
962
+ Do,
963
+ {
964
+ "data-radix-menubar-subtrigger": "",
965
+ ...n,
966
+ ...o,
967
+ ref: r
968
+ }
969
+ );
970
+ }
971
+ );
972
+ Jt.displayName = Yn;
973
+ var Xn = "MenubarSubContent", Qt = a.forwardRef(
974
+ (e, r) => {
975
+ const { __scopeMenubar: t, ...o } = e, n = j(t);
976
+ return /* @__PURE__ */ i(
977
+ Oo,
978
+ {
979
+ ...n,
980
+ "data-radix-menubar-content": "",
981
+ ...o,
982
+ ref: r,
983
+ style: {
984
+ ...e.style,
985
+ "--radix-menubar-content-transform-origin": "var(--radix-popper-transform-origin)",
986
+ "--radix-menubar-content-available-width": "var(--radix-popper-available-width)",
987
+ "--radix-menubar-content-available-height": "var(--radix-popper-available-height)",
988
+ "--radix-menubar-trigger-width": "var(--radix-popper-anchor-width)",
989
+ "--radix-menubar-trigger-height": "var(--radix-popper-anchor-height)"
990
+ }
991
+ }
992
+ );
993
+ }
994
+ );
995
+ Qt.displayName = Xn;
996
+ function Zn(e, r) {
997
+ return e.map((t, o) => e[(r + o) % e.length]);
998
+ }
999
+ var Jn = Lt, Qn = Vt, ea = Gt, ta = $t, ra = Kt, oa = Bt, na = jt, aa = Ht, sa = zt, ia = Ut, ca = Wt, la = qt, ua = Yt, da = Xt, fa = Zt, pa = Jt, ma = Qt;
1000
+ const Cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1001
+ __proto__: null,
1002
+ Arrow: da,
1003
+ CheckboxItem: sa,
1004
+ Content: ra,
1005
+ Group: oa,
1006
+ Item: aa,
1007
+ ItemIndicator: la,
1008
+ Label: na,
1009
+ Menu: Qn,
1010
+ Menubar: Lt,
1011
+ MenubarArrow: Xt,
1012
+ MenubarCheckboxItem: zt,
1013
+ MenubarContent: Kt,
1014
+ MenubarGroup: Bt,
1015
+ MenubarItem: Ht,
1016
+ MenubarItemIndicator: qt,
1017
+ MenubarLabel: jt,
1018
+ MenubarMenu: Vt,
1019
+ MenubarPortal: $t,
1020
+ MenubarRadioGroup: Ut,
1021
+ MenubarRadioItem: Wt,
1022
+ MenubarSeparator: Yt,
1023
+ MenubarSub: Zt,
1024
+ MenubarSubContent: Qt,
1025
+ MenubarSubTrigger: Jt,
1026
+ MenubarTrigger: Gt,
1027
+ Portal: ta,
1028
+ RadioGroup: ia,
1029
+ RadioItem: ca,
1030
+ Root: Jn,
1031
+ Separator: ua,
1032
+ Sub: fa,
1033
+ SubContent: ma,
1034
+ SubTrigger: pa,
1035
+ Trigger: ea,
1036
+ createMenubarScope: Ln
1037
+ }, Symbol.toStringTag, { value: "Module" }));
1038
+ var Ie = {
1039
+ numeric: {
1040
+ type: "numeric",
1041
+ regexp: /[^\d]/g,
1042
+ pattern: "\\d{1}",
1043
+ inputMode: "numeric"
1044
+ },
1045
+ alpha: {
1046
+ type: "alpha",
1047
+ regexp: /[^a-zA-Z]/g,
1048
+ pattern: "[a-zA-Z]{1}",
1049
+ inputMode: "text"
1050
+ },
1051
+ alphanumeric: {
1052
+ type: "alphanumeric",
1053
+ regexp: /[^a-zA-Z0-9]/g,
1054
+ pattern: "[a-zA-Z0-9]{1}",
1055
+ inputMode: "text"
1056
+ },
1057
+ none: null
1058
+ }, er = "OneTimePasswordField", [We, { useCollection: va, createCollectionScope: ba, useInitCollection: ga }] = ko(er), [ha] = se(er, [
1059
+ ba,
1060
+ de
1061
+ ]), to = de(), [Ca, ro] = ha(er), Ir = a.forwardRef(
1062
+ function({
1063
+ __scopeOneTimePasswordField: r,
1064
+ defaultValue: t,
1065
+ value: o,
1066
+ onValueChange: n,
1067
+ autoSubmit: s = !1,
1068
+ children: u,
1069
+ onPaste: c,
1070
+ onAutoSubmit: f,
1071
+ disabled: d = !1,
1072
+ readOnly: b = !1,
1073
+ autoComplete: w = "one-time-code",
1074
+ autoFocus: I = !1,
1075
+ form: R,
1076
+ name: _,
1077
+ placeholder: m,
1078
+ type: p = "text",
1079
+ // TODO: Change default to vertical when inputs use vertical writing mode
1080
+ orientation: T = "horizontal",
1081
+ dir: l,
1082
+ validationType: h = "numeric",
1083
+ sanitizeValue: S,
1084
+ ...F
1085
+ }, x) {
1086
+ var me;
1087
+ const V = to(r), N = Ae(l), M = ga(), [v] = M, g = Ie[h] ? Ie[h] : null, y = a.useCallback(
1088
+ (A) => {
1089
+ if (Array.isArray(A) ? A = A.map(xr).join("") : A = xr(A), g) {
1090
+ const $ = new RegExp(g.regexp);
1091
+ A = A.replace($, "");
1092
+ } else S && (A = S(A));
1093
+ return A.split("");
1094
+ },
1095
+ [g, S]
1096
+ ), O = a.useMemo(() => o != null ? y(o) : void 0, [o, y]), [C, L] = ie({
1097
+ caller: "OneTimePasswordField",
1098
+ prop: O,
1099
+ defaultProp: t != null ? y(t) : [],
1100
+ onChange: a.useCallback(
1101
+ (A) => n == null ? void 0 : n(A.join("")),
1102
+ [n]
1103
+ )
1104
+ }), k = kr((A) => {
1105
+ var $, ve, gr, hr, Cr, Tr, yr, Er, wr;
1106
+ switch (A.type) {
1107
+ case "SET_CHAR": {
1108
+ const { index: te, char: U } = A, Z = ($ = v.at(te)) == null ? void 0 : $.element;
1109
+ if (C[te] === U) {
1110
+ const ne = Z && ((ve = v.from(Z, 1)) == null ? void 0 : ve.element);
1111
+ re(ne);
1112
+ return;
1113
+ }
1114
+ if (U === "")
1115
+ return;
1116
+ if (g) {
1117
+ const ne = new RegExp(g.regexp);
1118
+ if (U.replace(ne, "") !== U)
1119
+ return;
1120
+ }
1121
+ if (C.length >= v.size) {
1122
+ const ne = [...C];
1123
+ ne[te] = U, ue(() => L(ne));
1124
+ const ye = Z && ((gr = v.from(Z, 1)) == null ? void 0 : gr.element);
1125
+ re(ye);
1126
+ return;
1127
+ }
1128
+ const le = [...C];
1129
+ le[te] = U;
1130
+ const Ve = (hr = v.at(-1)) == null ? void 0 : hr.element;
1131
+ if (ue(() => L(le)), Z !== Ve) {
1132
+ const ne = Z && ((Cr = v.from(Z, 1)) == null ? void 0 : Cr.element);
1133
+ re(ne);
1134
+ } else
1135
+ Z == null || Z.select();
1136
+ return;
1137
+ }
1138
+ case "CLEAR_CHAR": {
1139
+ const { index: te, reason: U } = A;
1140
+ if (!C[te])
1141
+ return;
1142
+ const Z = C.filter((ne, ye) => ye !== te), le = (Tr = v.at(te)) == null ? void 0 : Tr.element, Ve = le && ((yr = v.from(le, -1)) == null ? void 0 : yr.element);
1143
+ ue(() => L(Z)), U === "Backspace" ? re(Ve) : (U === "Delete" || U === "Cut") && re(le);
1144
+ return;
1145
+ }
1146
+ case "CLEAR": {
1147
+ if (C.length === 0)
1148
+ return;
1149
+ A.reason === "Backspace" || A.reason === "Delete" ? (ue(() => L([])), re((Er = v.at(0)) == null ? void 0 : Er.element)) : L([]);
1150
+ return;
1151
+ }
1152
+ case "PASTE": {
1153
+ const { value: te } = A, U = y(te);
1154
+ if (!U)
1155
+ return;
1156
+ ue(() => L(U)), re((wr = v.at(U.length - 1)) == null ? void 0 : wr.element);
1157
+ return;
1158
+ }
1159
+ }
1160
+ }), X = a.useRef(g);
1161
+ a.useEffect(() => {
1162
+ var A;
1163
+ g && ((A = X.current) == null ? void 0 : A.type) !== g.type && (X.current = g, L(y(C.join(""))));
1164
+ }, [y, L, g, C]);
1165
+ const H = a.useRef(null), Q = a.useRef(null), W = a.useRef(null), pe = Y(x, W), oe = (me = v.at(0)) == null ? void 0 : me.element, z = a.useCallback(() => {
1166
+ var $;
1167
+ let A;
1168
+ if (R) {
1169
+ const ve = ((($ = W.current) == null ? void 0 : $.ownerDocument) ?? document).getElementById(R);
1170
+ Ta(ve) && (A = ve);
1171
+ } else H.current ? A = H.current.form : oe && (A = oe.form);
1172
+ return A ?? null;
1173
+ }, [R, oe]), E = a.useCallback(() => {
1174
+ const A = z();
1175
+ A == null || A.requestSubmit();
1176
+ }, [z]);
1177
+ a.useEffect(() => {
1178
+ const A = z();
1179
+ if (A) {
1180
+ const $ = () => k({ type: "CLEAR", reason: "Reset" });
1181
+ return A.addEventListener("reset", $), () => A.removeEventListener("reset", $);
1182
+ }
1183
+ }, [k, z]);
1184
+ const K = C.join(""), B = a.useRef(K), G = v.size;
1185
+ a.useEffect(() => {
1186
+ const A = B.current;
1187
+ B.current = K, A !== K && s && C.every(($) => $ !== "") && C.length === G && (f == null || f(C.join("")), E());
1188
+ }, [E, s, K, G, f, C]);
1189
+ const ee = Or();
1190
+ return /* @__PURE__ */ i(
1191
+ Ca,
1192
+ {
1193
+ scope: r,
1194
+ value: C,
1195
+ attemptSubmit: E,
1196
+ disabled: d,
1197
+ readOnly: b,
1198
+ autoComplete: w,
1199
+ autoFocus: I,
1200
+ form: R,
1201
+ name: _,
1202
+ placeholder: m,
1203
+ type: p,
1204
+ hiddenInputRef: H,
1205
+ userActionRef: Q,
1206
+ dispatch: k,
1207
+ validationType: h,
1208
+ orientation: T,
1209
+ isHydrated: ee,
1210
+ sanitizeValue: y,
1211
+ children: /* @__PURE__ */ i(We.Provider, { scope: r, state: M, children: /* @__PURE__ */ i(We.Slot, { scope: r, children: /* @__PURE__ */ i(
1212
+ nt,
1213
+ {
1214
+ asChild: !0,
1215
+ ...V,
1216
+ orientation: T,
1217
+ dir: N,
1218
+ children: /* @__PURE__ */ i(
1219
+ Nr.div,
1220
+ {
1221
+ ...F,
1222
+ role: "group",
1223
+ ref: pe,
1224
+ onPaste: P(
1225
+ c,
1226
+ (A) => {
1227
+ A.preventDefault();
1228
+ const $ = A.clipboardData.getData("Text");
1229
+ k({ type: "PASTE", value: $ });
1230
+ }
1231
+ ),
1232
+ children: u
1233
+ }
1234
+ )
1235
+ }
1236
+ ) }) })
1237
+ }
1238
+ );
1239
+ }
1240
+ ), Ar = a.forwardRef(function({ __scopeOneTimePasswordField: r, ...t }, o) {
1241
+ const { value: n, hiddenInputRef: s, name: u } = ro(
1242
+ "OneTimePasswordFieldHiddenInput",
1243
+ r
1244
+ ), c = Y(s, o);
1245
+ return /* @__PURE__ */ i(
1246
+ "input",
1247
+ {
1248
+ ref: c,
1249
+ name: u,
1250
+ value: n.join("").trim(),
1251
+ autoComplete: "off",
1252
+ autoFocus: !1,
1253
+ autoCapitalize: "off",
1254
+ autoCorrect: "off",
1255
+ autoSave: "off",
1256
+ spellCheck: !1,
1257
+ ...t,
1258
+ type: "hidden",
1259
+ readOnly: !0
1260
+ }
1261
+ );
1262
+ }), Sr = a.forwardRef(function({
1263
+ __scopeOneTimePasswordField: r,
1264
+ onInvalidChange: t,
1265
+ index: o,
1266
+ ...n
1267
+ }, s) {
1268
+ const {
1269
+ value: u,
1270
+ defaultValue: c,
1271
+ disabled: f,
1272
+ readOnly: d,
1273
+ autoComplete: b,
1274
+ autoFocus: w,
1275
+ form: I,
1276
+ name: R,
1277
+ placeholder: _,
1278
+ type: m,
1279
+ ...p
1280
+ } = n, T = ro(
1281
+ "OneTimePasswordFieldInput",
1282
+ r
1283
+ ), { dispatch: l, userActionRef: h, validationType: S, isHydrated: F } = T, x = va(r), V = to(r), N = a.useRef(null), [M, v] = a.useState(null), g = o ?? (M ? x.indexOf(M) : -1), y = o != null || F;
1284
+ let O;
1285
+ y && T.placeholder && T.value.length === 0 && (O = T.placeholder[g]);
1286
+ const C = Y(s, N, v), L = T.value[g] ?? "", k = a.useRef(null);
1287
+ a.useEffect(() => () => {
1288
+ window.clearTimeout(k.current);
1289
+ }, []);
1290
+ const X = T.value.join("").trim(), H = Vo(X.length, [0, x.size - 1]), Q = g <= H, W = S in Ie ? Ie[S] : void 0;
1291
+ return /* @__PURE__ */ i(We.ItemSlot, { scope: r, children: /* @__PURE__ */ i(
1292
+ Se,
1293
+ {
1294
+ ...V,
1295
+ asChild: !0,
1296
+ focusable: !T.disabled && Q,
1297
+ active: g === H,
1298
+ children: ({ hasTabStop: pe, isCurrentTabStop: oe }) => {
1299
+ const z = pe ? oe : g === 0;
1300
+ return /* @__PURE__ */ i(
1301
+ Nr.input,
1302
+ {
1303
+ ref: C,
1304
+ type: T.type,
1305
+ "aria-label": `Character ${g + 1} of ${x.size}`,
1306
+ autoComplete: z ? T.autoComplete : "off",
1307
+ "data-1p-ignore": z ? void 0 : "true",
1308
+ "data-lpignore": z ? void 0 : "true",
1309
+ "data-protonpass-ignore": z ? void 0 : "true",
1310
+ "data-bwignore": z ? void 0 : "true",
1311
+ inputMode: W == null ? void 0 : W.inputMode,
1312
+ maxLength: 1,
1313
+ pattern: W == null ? void 0 : W.pattern,
1314
+ readOnly: T.readOnly,
1315
+ value: L,
1316
+ placeholder: O,
1317
+ "data-radix-otp-input": "",
1318
+ "data-radix-index": g,
1319
+ ...p,
1320
+ onFocus: P(n.onFocus, (E) => {
1321
+ E.currentTarget.select();
1322
+ }),
1323
+ onCut: P(n.onCut, (E) => {
1324
+ E.currentTarget.value !== "" && (h.current = {
1325
+ type: "cut"
1326
+ }, k.current = window.setTimeout(() => {
1327
+ h.current = null;
1328
+ }, 10));
1329
+ }),
1330
+ onInput: P(n.onInput, (E) => {
1331
+ const K = E.currentTarget.value;
1332
+ K.length > 1 && (E.preventDefault(), l({ type: "PASTE", value: K }));
1333
+ }),
1334
+ onChange: P(n.onChange, (E) => {
1335
+ const K = E.target.value;
1336
+ E.preventDefault();
1337
+ const B = h.current;
1338
+ if (h.current = null, B)
1339
+ switch (B.type) {
1340
+ case "cut":
1341
+ l({ type: "CLEAR_CHAR", index: g, reason: "Cut" });
1342
+ return;
1343
+ case "keydown": {
1344
+ if (B.key === "Char")
1345
+ return;
1346
+ const G = B.key === "Backspace" && (B.metaKey || B.ctrlKey);
1347
+ B.key === "Clear" || G ? l({ type: "CLEAR", reason: "Backspace" }) : l({ type: "CLEAR_CHAR", index: g, reason: B.key });
1348
+ return;
1349
+ }
1350
+ default:
1351
+ return;
1352
+ }
1353
+ if (E.target.validity.valid)
1354
+ if (K === "") {
1355
+ let G = "Backspace";
1356
+ if (ya(E.nativeEvent)) {
1357
+ const ee = E.nativeEvent.inputType;
1358
+ ee === "deleteContentBackward" ? G = "Backspace" : ee === "deleteByCut" && (G = "Cut");
1359
+ }
1360
+ l({ type: "CLEAR_CHAR", index: g, reason: G });
1361
+ } else
1362
+ l({ type: "SET_CHAR", char: K, index: g, event: E });
1363
+ else {
1364
+ const G = E.target;
1365
+ t == null || t(G.value), requestAnimationFrame(() => {
1366
+ G.ownerDocument.activeElement === G && G.select();
1367
+ });
1368
+ }
1369
+ }),
1370
+ onKeyDown: P(n.onKeyDown, (E) => {
1371
+ var K, B, G;
1372
+ switch (E.key) {
1373
+ case "Clear":
1374
+ case "Delete":
1375
+ case "Backspace": {
1376
+ if (E.currentTarget.value === "") {
1377
+ if (E.key === "Delete") return;
1378
+ if (E.key === "Clear" || E.metaKey || E.ctrlKey)
1379
+ l({ type: "CLEAR", reason: "Backspace" });
1380
+ else {
1381
+ const A = E.currentTarget;
1382
+ requestAnimationFrame(() => {
1383
+ var $;
1384
+ re(($ = x.from(A, -1)) == null ? void 0 : $.element);
1385
+ });
1386
+ }
1387
+ } else
1388
+ h.current = {
1389
+ type: "keydown",
1390
+ key: E.key,
1391
+ metaKey: E.metaKey,
1392
+ ctrlKey: E.ctrlKey
1393
+ }, k.current = window.setTimeout(() => {
1394
+ h.current = null;
1395
+ }, 10);
1396
+ return;
1397
+ }
1398
+ case "Enter": {
1399
+ E.preventDefault(), T.attemptSubmit();
1400
+ return;
1401
+ }
1402
+ case "ArrowDown":
1403
+ case "ArrowUp": {
1404
+ T.orientation === "horizontal" && E.preventDefault();
1405
+ return;
1406
+ }
1407
+ default:
1408
+ if (E.currentTarget.value === E.key) {
1409
+ const ee = E.currentTarget;
1410
+ E.preventDefault(), re((K = x.from(ee, 1)) == null ? void 0 : K.element);
1411
+ return;
1412
+ } else if (
1413
+ // input already has a value, but...
1414
+ E.currentTarget.value && // the value is not selected
1415
+ !(E.currentTarget.selectionStart === 0 && E.currentTarget.selectionEnd != null && E.currentTarget.selectionEnd > 0)
1416
+ ) {
1417
+ const ee = E.key;
1418
+ if (E.key.length > 1 || E.key === " ")
1419
+ return;
1420
+ {
1421
+ const me = (B = x.from(E.currentTarget, 1)) == null ? void 0 : B.element, A = (G = x.at(-1)) == null ? void 0 : G.element;
1422
+ me !== A && E.currentTarget !== A && (E.currentTarget.selectionStart === 0 ? l({ type: "SET_CHAR", char: ee, index: g, event: E }) : l({
1423
+ type: "SET_CHAR",
1424
+ char: ee,
1425
+ index: g + 1,
1426
+ event: E
1427
+ }), h.current = {
1428
+ type: "keydown",
1429
+ key: "Char",
1430
+ metaKey: E.metaKey,
1431
+ ctrlKey: E.ctrlKey
1432
+ }, k.current = window.setTimeout(() => {
1433
+ h.current = null;
1434
+ }, 10));
1435
+ }
1436
+ }
1437
+ }
1438
+ }),
1439
+ onPointerDown: P(n.onPointerDown, (E) => {
1440
+ var G;
1441
+ E.preventDefault();
1442
+ const K = Math.min(g, H), B = (G = x.at(K)) == null ? void 0 : G.element;
1443
+ re(B);
1444
+ })
1445
+ }
1446
+ );
1447
+ }
1448
+ }
1449
+ ) });
1450
+ });
1451
+ function Ta(e) {
1452
+ return (e == null ? void 0 : e.tagName) === "FORM";
1453
+ }
1454
+ function xr(e) {
1455
+ return e.replace(/\s/g, "");
1456
+ }
1457
+ function re(e) {
1458
+ e && (e.ownerDocument.activeElement === e ? window.requestAnimationFrame(() => {
1459
+ var r;
1460
+ (r = e.select) == null || r.call(e);
1461
+ }) : e.focus());
1462
+ }
1463
+ function ya(e) {
1464
+ return e.type === "input";
1465
+ }
1466
+ const Ts = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1467
+ __proto__: null,
1468
+ HiddenInput: Ar,
1469
+ Input: Sr,
1470
+ OneTimePasswordField: Ir,
1471
+ OneTimePasswordFieldHiddenInput: Ar,
1472
+ OneTimePasswordFieldInput: Sr,
1473
+ Root: Ir
1474
+ }, Symbol.toStringTag, { value: "Module" }));
1475
+ var ce = "PasswordToggleField", [Ea] = se(ce), [wa, Oe] = Ea(ce), be = {
1476
+ clickTriggered: !1,
1477
+ selectionStart: null,
1478
+ selectionEnd: null
1479
+ }, qe = ({
1480
+ __scopePasswordToggleField: e,
1481
+ ...r
1482
+ }) => {
1483
+ const o = `${ae(r.id)}-input`, [n, s] = a.useState(o), u = n ?? o, c = a.useCallback(
1484
+ (p) => s(p != null ? String(p) : null),
1485
+ []
1486
+ ), { visible: f, defaultVisible: d, onVisiblityChange: b, children: w } = r, [I = !1, R] = ie({
1487
+ caller: ce,
1488
+ prop: f,
1489
+ defaultProp: d ?? !1,
1490
+ onChange: b
1491
+ }), _ = a.useRef(null), m = a.useRef(be);
1492
+ return /* @__PURE__ */ i(
1493
+ wa,
1494
+ {
1495
+ scope: e,
1496
+ inputId: u,
1497
+ inputRef: _,
1498
+ setVisible: R,
1499
+ syncInputId: c,
1500
+ visible: I,
1501
+ focusState: m,
1502
+ children: w
1503
+ }
1504
+ );
1505
+ };
1506
+ qe.displayName = ce;
1507
+ var oo = ce + "Input", Ye = a.forwardRef(
1508
+ ({
1509
+ __scopePasswordToggleField: e,
1510
+ autoComplete: r = "current-password",
1511
+ autoCapitalize: t = "off",
1512
+ spellCheck: o = !1,
1513
+ id: n,
1514
+ ...s
1515
+ }, u) => {
1516
+ const { visible: c, inputRef: f, inputId: d, syncInputId: b, setVisible: w, focusState: I } = Oe(oo, e);
1517
+ a.useEffect(() => {
1518
+ b(n);
1519
+ }, [n, b]);
1520
+ const R = kr(w);
1521
+ return a.useEffect(() => {
1522
+ const _ = f.current, m = _ == null ? void 0 : _.form;
1523
+ if (!m)
1524
+ return;
1525
+ const p = new AbortController();
1526
+ return m.addEventListener(
1527
+ "reset",
1528
+ (T) => {
1529
+ T.defaultPrevented || R(!1);
1530
+ },
1531
+ { signal: p.signal }
1532
+ ), m.addEventListener(
1533
+ "submit",
1534
+ () => {
1535
+ R(!1);
1536
+ },
1537
+ { signal: p.signal }
1538
+ ), () => {
1539
+ p.abort();
1540
+ };
1541
+ }, [f, R]), /* @__PURE__ */ i(
1542
+ D.input,
1543
+ {
1544
+ ...s,
1545
+ id: n ?? d,
1546
+ autoCapitalize: t,
1547
+ autoComplete: r,
1548
+ ref: Y(u, f),
1549
+ spellCheck: o,
1550
+ type: c ? "text" : "password",
1551
+ onBlur: P(s.onBlur, (_) => {
1552
+ const { selectionStart: m, selectionEnd: p } = _.currentTarget;
1553
+ I.current.selectionStart = m, I.current.selectionEnd = p;
1554
+ })
1555
+ }
1556
+ );
1557
+ }
1558
+ );
1559
+ Ye.displayName = oo;
1560
+ var no = ce + "Toggle", Xe = a.forwardRef(
1561
+ ({
1562
+ __scopePasswordToggleField: e,
1563
+ onClick: r,
1564
+ onPointerDown: t,
1565
+ onPointerCancel: o,
1566
+ onPointerUp: n,
1567
+ onFocus: s,
1568
+ children: u,
1569
+ "aria-label": c,
1570
+ "aria-controls": f,
1571
+ "aria-hidden": d,
1572
+ tabIndex: b,
1573
+ ...w
1574
+ }, I) => {
1575
+ const { setVisible: R, visible: _, inputRef: m, inputId: p, focusState: T } = Oe(
1576
+ no,
1577
+ e
1578
+ ), [l, h] = a.useState(void 0), S = a.useRef(null), F = Y(I, S), x = Or();
1579
+ a.useEffect(() => {
1580
+ const N = S.current;
1581
+ if (!N || c) {
1582
+ h(void 0);
1583
+ return;
1584
+ }
1585
+ const M = _ ? "Hide password" : "Show password";
1586
+ function v(y) {
1587
+ h(y || void 0 ? void 0 : M);
1588
+ }
1589
+ v(N.textContent);
1590
+ const g = new MutationObserver((y) => {
1591
+ let O;
1592
+ for (const C of y)
1593
+ C.type === "characterData" && N.textContent && (O = N.textContent);
1594
+ v(O);
1595
+ });
1596
+ return g.observe(N, { characterData: !0, subtree: !0 }), () => {
1597
+ g.disconnect();
1598
+ };
1599
+ }, [_, c]);
1600
+ const V = c || l;
1601
+ return x ? f ?? (f = p) : (d ?? (d = !0), b ?? (b = -1)), a.useEffect(() => {
1602
+ var y, O;
1603
+ let N = () => {
1604
+ };
1605
+ const M = ((O = (y = S.current) == null ? void 0 : y.ownerDocument) == null ? void 0 : O.defaultView) || window, v = () => T.current.clickTriggered = !1, g = () => N = Ra(M, v);
1606
+ return M.addEventListener("pointerup", g), () => {
1607
+ N(), M.removeEventListener("pointerup", g);
1608
+ };
1609
+ }, [T]), /* @__PURE__ */ i(
1610
+ D.button,
1611
+ {
1612
+ "aria-controls": f,
1613
+ "aria-hidden": d,
1614
+ "aria-label": V,
1615
+ ref: F,
1616
+ id: p,
1617
+ ...w,
1618
+ onPointerDown: P(t, () => {
1619
+ T.current.clickTriggered = !0;
1620
+ }),
1621
+ onPointerCancel: (N) => {
1622
+ o == null || o(N), T.current = be;
1623
+ },
1624
+ onClick: (N) => {
1625
+ if (r == null || r(N), N.defaultPrevented) {
1626
+ T.current = be;
1627
+ return;
1628
+ }
1629
+ if (ue(() => {
1630
+ R((M) => !M);
1631
+ }), T.current.clickTriggered) {
1632
+ const M = m.current;
1633
+ if (M) {
1634
+ const { selectionStart: v, selectionEnd: g } = T.current;
1635
+ M.focus(), (v !== null || g !== null) && requestAnimationFrame(() => {
1636
+ M.ownerDocument.activeElement === M && (M.selectionStart = v, M.selectionEnd = g);
1637
+ });
1638
+ }
1639
+ }
1640
+ T.current = be;
1641
+ },
1642
+ onPointerUp: (N) => {
1643
+ n == null || n(N), setTimeout(() => {
1644
+ T.current = be;
1645
+ }, 50);
1646
+ },
1647
+ type: "button",
1648
+ children: u
1649
+ }
1650
+ );
1651
+ }
1652
+ );
1653
+ Xe.displayName = no;
1654
+ var ao = ce + "Slot", Ze = ({
1655
+ __scopePasswordToggleField: e,
1656
+ ...r
1657
+ }) => {
1658
+ const { visible: t } = Oe(
1659
+ ao,
1660
+ e
1661
+ );
1662
+ return "render" in r ? (
1663
+ //
1664
+ r.render({ visible: t })
1665
+ ) : t ? r.visible : r.hidden;
1666
+ };
1667
+ Ze.displayName = ao;
1668
+ var so = ce + "Icon", Je = a.forwardRef(
1669
+ ({
1670
+ __scopePasswordToggleField: e,
1671
+ // @ts-expect-error
1672
+ children: r,
1673
+ ...t
1674
+ }, o) => {
1675
+ const { visible: n } = Oe(
1676
+ so,
1677
+ e
1678
+ ), { visible: s, hidden: u, ...c } = t;
1679
+ return /* @__PURE__ */ i(D.svg, { ...c, ref: o, "aria-hidden": !0, asChild: !0, children: n ? s : u });
1680
+ }
1681
+ );
1682
+ Je.displayName = so;
1683
+ function Ra(e, r, t) {
1684
+ if (e.requestIdleCallback) {
1685
+ const s = e.requestIdleCallback(r, t);
1686
+ return () => {
1687
+ e.cancelIdleCallback(s);
1688
+ };
1689
+ }
1690
+ const o = Date.now(), n = e.setTimeout(() => {
1691
+ r({ didTimeout: !1, timeRemaining: () => Math.max(0, 50 - (Date.now() - o)) });
1692
+ }, 1);
1693
+ return () => {
1694
+ e.clearTimeout(n);
1695
+ };
1696
+ }
1697
+ const ys = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1698
+ __proto__: null,
1699
+ Icon: Je,
1700
+ Input: Ye,
1701
+ PasswordToggleField: qe,
1702
+ PasswordToggleFieldIcon: Je,
1703
+ PasswordToggleFieldInput: Ye,
1704
+ PasswordToggleFieldSlot: Ze,
1705
+ PasswordToggleFieldToggle: Xe,
1706
+ Root: qe,
1707
+ Slot: Ze,
1708
+ Toggle: Xe
1709
+ }, Symbol.toStringTag, { value: "Module" }));
1710
+ var _a = "Separator", Mr = "horizontal", Ia = ["horizontal", "vertical"], tr = a.forwardRef((e, r) => {
1711
+ const { decorative: t, orientation: o = Mr, ...n } = e, s = Aa(o) ? o : Mr, c = t ? { role: "none" } : { "aria-orientation": s === "vertical" ? s : void 0, role: "separator" };
1712
+ return /* @__PURE__ */ i(
1713
+ D.div,
1714
+ {
1715
+ "data-orientation": s,
1716
+ ...c,
1717
+ ...n,
1718
+ ref: r
1719
+ }
1720
+ );
1721
+ });
1722
+ tr.displayName = _a;
1723
+ function Aa(e) {
1724
+ return Ia.includes(e);
1725
+ }
1726
+ var io = tr;
1727
+ const Es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1728
+ __proto__: null,
1729
+ Root: io,
1730
+ Separator: tr
1731
+ }, Symbol.toStringTag, { value: "Module" }));
1732
+ var rr = "ToastProvider", [or, Sa, xa] = ot("Toast"), [co, Ma] = se("Toast", [xa]), [Pa, De] = co(rr), nr = (e) => {
1733
+ const {
1734
+ __scopeToast: r,
1735
+ label: t = "Notification",
1736
+ duration: o = 5e3,
1737
+ swipeDirection: n = "right",
1738
+ swipeThreshold: s = 50,
1739
+ children: u
1740
+ } = e, [c, f] = a.useState(null), [d, b] = a.useState(0), w = a.useRef(!1), I = a.useRef(!1);
1741
+ return t.trim() || console.error(
1742
+ `Invalid prop \`label\` supplied to \`${rr}\`. Expected non-empty \`string\`.`
1743
+ ), /* @__PURE__ */ i(or.Provider, { scope: r, children: /* @__PURE__ */ i(
1744
+ Pa,
1745
+ {
1746
+ scope: r,
1747
+ label: t,
1748
+ duration: o,
1749
+ swipeDirection: n,
1750
+ swipeThreshold: s,
1751
+ toastCount: d,
1752
+ viewport: c,
1753
+ onViewportChange: f,
1754
+ onToastAdd: a.useCallback(() => b((R) => R + 1), []),
1755
+ onToastRemove: a.useCallback(() => b((R) => R - 1), []),
1756
+ isFocusedToastEscapeKeyDownRef: w,
1757
+ isClosePausedRef: I,
1758
+ children: u
1759
+ }
1760
+ ) });
1761
+ };
1762
+ nr.displayName = rr;
1763
+ var lo = "ToastViewport", Fa = ["F8"], Qe = "toast.viewportPause", et = "toast.viewportResume", ar = a.forwardRef(
1764
+ (e, r) => {
1765
+ const {
1766
+ __scopeToast: t,
1767
+ hotkey: o = Fa,
1768
+ label: n = "Notifications ({hotkey})",
1769
+ ...s
1770
+ } = e, u = De(lo, t), c = Sa(t), f = a.useRef(null), d = a.useRef(null), b = a.useRef(null), w = a.useRef(null), I = Y(r, w, u.onViewportChange), R = o.join("+").replace(/Key/g, "").replace(/Digit/g, ""), _ = u.toastCount > 0;
1771
+ a.useEffect(() => {
1772
+ const p = (T) => {
1773
+ var h;
1774
+ o.length !== 0 && o.every((S) => T[S] || T.code === S) && ((h = w.current) == null || h.focus());
1775
+ };
1776
+ return document.addEventListener("keydown", p), () => document.removeEventListener("keydown", p);
1777
+ }, [o]), a.useEffect(() => {
1778
+ const p = f.current, T = w.current;
1779
+ if (_ && p && T) {
1780
+ const l = () => {
1781
+ if (!u.isClosePausedRef.current) {
1782
+ const x = new CustomEvent(Qe);
1783
+ T.dispatchEvent(x), u.isClosePausedRef.current = !0;
1784
+ }
1785
+ }, h = () => {
1786
+ if (u.isClosePausedRef.current) {
1787
+ const x = new CustomEvent(et);
1788
+ T.dispatchEvent(x), u.isClosePausedRef.current = !1;
1789
+ }
1790
+ }, S = (x) => {
1791
+ !p.contains(x.relatedTarget) && h();
1792
+ }, F = () => {
1793
+ p.contains(document.activeElement) || h();
1794
+ };
1795
+ return p.addEventListener("focusin", l), p.addEventListener("focusout", S), p.addEventListener("pointermove", l), p.addEventListener("pointerleave", F), window.addEventListener("blur", l), window.addEventListener("focus", h), () => {
1796
+ p.removeEventListener("focusin", l), p.removeEventListener("focusout", S), p.removeEventListener("pointermove", l), p.removeEventListener("pointerleave", F), window.removeEventListener("blur", l), window.removeEventListener("focus", h);
1797
+ };
1798
+ }
1799
+ }, [_, u.isClosePausedRef]);
1800
+ const m = a.useCallback(
1801
+ ({ tabbingDirection: p }) => {
1802
+ const l = c().map((h) => {
1803
+ const S = h.ref.current, F = [S, ...za(S)];
1804
+ return p === "forwards" ? F : F.reverse();
1805
+ });
1806
+ return (p === "forwards" ? l.reverse() : l).flat();
1807
+ },
1808
+ [c]
1809
+ );
1810
+ return a.useEffect(() => {
1811
+ const p = w.current;
1812
+ if (p) {
1813
+ const T = (l) => {
1814
+ var F, x, V;
1815
+ const h = l.altKey || l.ctrlKey || l.metaKey;
1816
+ if (l.key === "Tab" && !h) {
1817
+ const N = document.activeElement, M = l.shiftKey;
1818
+ if (l.target === p && M) {
1819
+ (F = d.current) == null || F.focus();
1820
+ return;
1821
+ }
1822
+ const y = m({ tabbingDirection: M ? "backwards" : "forwards" }), O = y.findIndex((C) => C === N);
1823
+ $e(y.slice(O + 1)) ? l.preventDefault() : M ? (x = d.current) == null || x.focus() : (V = b.current) == null || V.focus();
1824
+ }
1825
+ };
1826
+ return p.addEventListener("keydown", T), () => p.removeEventListener("keydown", T);
1827
+ }
1828
+ }, [c, m]), /* @__PURE__ */ st(
1829
+ Go,
1830
+ {
1831
+ ref: f,
1832
+ role: "region",
1833
+ "aria-label": n.replace("{hotkey}", R),
1834
+ tabIndex: -1,
1835
+ style: { pointerEvents: _ ? void 0 : "none" },
1836
+ children: [
1837
+ _ && /* @__PURE__ */ i(
1838
+ tt,
1839
+ {
1840
+ ref: d,
1841
+ onFocusFromOutsideViewport: () => {
1842
+ const p = m({
1843
+ tabbingDirection: "forwards"
1844
+ });
1845
+ $e(p);
1846
+ }
1847
+ }
1848
+ ),
1849
+ /* @__PURE__ */ i(or.Slot, { scope: t, children: /* @__PURE__ */ i(D.ol, { tabIndex: -1, ...s, ref: I }) }),
1850
+ _ && /* @__PURE__ */ i(
1851
+ tt,
1852
+ {
1853
+ ref: b,
1854
+ onFocusFromOutsideViewport: () => {
1855
+ const p = m({
1856
+ tabbingDirection: "backwards"
1857
+ });
1858
+ $e(p);
1859
+ }
1860
+ }
1861
+ )
1862
+ ]
1863
+ }
1864
+ );
1865
+ }
1866
+ );
1867
+ ar.displayName = lo;
1868
+ var uo = "ToastFocusProxy", tt = a.forwardRef(
1869
+ (e, r) => {
1870
+ const { __scopeToast: t, onFocusFromOutsideViewport: o, ...n } = e, s = De(uo, t);
1871
+ return /* @__PURE__ */ i(
1872
+ Dr,
1873
+ {
1874
+ "aria-hidden": !0,
1875
+ tabIndex: 0,
1876
+ ...n,
1877
+ ref: r,
1878
+ style: { position: "fixed" },
1879
+ onFocus: (u) => {
1880
+ var d;
1881
+ const c = u.relatedTarget;
1882
+ !((d = s.viewport) != null && d.contains(c)) && o();
1883
+ }
1884
+ }
1885
+ );
1886
+ }
1887
+ );
1888
+ tt.displayName = uo;
1889
+ var Te = "Toast", Na = "toast.swipeStart", Oa = "toast.swipeMove", Da = "toast.swipeCancel", La = "toast.swipeEnd", sr = a.forwardRef(
1890
+ (e, r) => {
1891
+ const { forceMount: t, open: o, defaultOpen: n, onOpenChange: s, ...u } = e, [c, f] = ie({
1892
+ prop: o,
1893
+ defaultProp: n ?? !0,
1894
+ onChange: s,
1895
+ caller: Te
1896
+ });
1897
+ return /* @__PURE__ */ i(Fr, { present: t || c, children: /* @__PURE__ */ i(
1898
+ Ga,
1899
+ {
1900
+ open: c,
1901
+ ...u,
1902
+ ref: r,
1903
+ onClose: () => f(!1),
1904
+ onPause: Re(e.onPause),
1905
+ onResume: Re(e.onResume),
1906
+ onSwipeStart: P(e.onSwipeStart, (d) => {
1907
+ d.currentTarget.setAttribute("data-swipe", "start");
1908
+ }),
1909
+ onSwipeMove: P(e.onSwipeMove, (d) => {
1910
+ const { x: b, y: w } = d.detail.delta;
1911
+ d.currentTarget.setAttribute("data-swipe", "move"), d.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${b}px`), d.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${w}px`);
1912
+ }),
1913
+ onSwipeCancel: P(e.onSwipeCancel, (d) => {
1914
+ d.currentTarget.setAttribute("data-swipe", "cancel"), d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"), d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y");
1915
+ }),
1916
+ onSwipeEnd: P(e.onSwipeEnd, (d) => {
1917
+ const { x: b, y: w } = d.detail.delta;
1918
+ d.currentTarget.setAttribute("data-swipe", "end"), d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), d.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${b}px`), d.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${w}px`), f(!1);
1919
+ })
1920
+ }
1921
+ ) });
1922
+ }
1923
+ );
1924
+ sr.displayName = Te;
1925
+ var [ka, Va] = co(Te, {
1926
+ onClose() {
1927
+ }
1928
+ }), Ga = a.forwardRef(
1929
+ (e, r) => {
1930
+ const {
1931
+ __scopeToast: t,
1932
+ type: o = "foreground",
1933
+ duration: n,
1934
+ open: s,
1935
+ onClose: u,
1936
+ onEscapeKeyDown: c,
1937
+ onPause: f,
1938
+ onResume: d,
1939
+ onSwipeStart: b,
1940
+ onSwipeMove: w,
1941
+ onSwipeCancel: I,
1942
+ onSwipeEnd: R,
1943
+ ..._
1944
+ } = e, m = De(Te, t), [p, T] = a.useState(null), l = Y(r, (C) => T(C)), h = a.useRef(null), S = a.useRef(null), F = n || m.duration, x = a.useRef(0), V = a.useRef(F), N = a.useRef(0), { onToastAdd: M, onToastRemove: v } = m, g = Re(() => {
1945
+ var L;
1946
+ (p == null ? void 0 : p.contains(document.activeElement)) && ((L = m.viewport) == null || L.focus()), u();
1947
+ }), y = a.useCallback(
1948
+ (C) => {
1949
+ !C || C === 1 / 0 || (window.clearTimeout(N.current), x.current = (/* @__PURE__ */ new Date()).getTime(), N.current = window.setTimeout(g, C));
1950
+ },
1951
+ [g]
1952
+ );
1953
+ a.useEffect(() => {
1954
+ const C = m.viewport;
1955
+ if (C) {
1956
+ const L = () => {
1957
+ y(V.current), d == null || d();
1958
+ }, k = () => {
1959
+ const X = (/* @__PURE__ */ new Date()).getTime() - x.current;
1960
+ V.current = V.current - X, window.clearTimeout(N.current), f == null || f();
1961
+ };
1962
+ return C.addEventListener(Qe, k), C.addEventListener(et, L), () => {
1963
+ C.removeEventListener(Qe, k), C.removeEventListener(et, L);
1964
+ };
1965
+ }
1966
+ }, [m.viewport, F, f, d, y]), a.useEffect(() => {
1967
+ s && !m.isClosePausedRef.current && y(F);
1968
+ }, [s, F, m.isClosePausedRef, y]), a.useEffect(() => (M(), () => v()), [M, v]);
1969
+ const O = a.useMemo(() => p ? vo(p) : null, [p]);
1970
+ return m.viewport ? /* @__PURE__ */ st(at, { children: [
1971
+ O && /* @__PURE__ */ i(
1972
+ $a,
1973
+ {
1974
+ __scopeToast: t,
1975
+ role: "status",
1976
+ "aria-live": o === "foreground" ? "assertive" : "polite",
1977
+ "aria-atomic": !0,
1978
+ children: O
1979
+ }
1980
+ ),
1981
+ /* @__PURE__ */ i(ka, { scope: t, onClose: g, children: zo.createPortal(
1982
+ /* @__PURE__ */ i(or.ItemSlot, { scope: t, children: /* @__PURE__ */ i(
1983
+ $o,
1984
+ {
1985
+ asChild: !0,
1986
+ onEscapeKeyDown: P(c, () => {
1987
+ m.isFocusedToastEscapeKeyDownRef.current || g(), m.isFocusedToastEscapeKeyDownRef.current = !1;
1988
+ }),
1989
+ children: /* @__PURE__ */ i(
1990
+ D.li,
1991
+ {
1992
+ role: "status",
1993
+ "aria-live": "off",
1994
+ "aria-atomic": !0,
1995
+ tabIndex: 0,
1996
+ "data-state": s ? "open" : "closed",
1997
+ "data-swipe-direction": m.swipeDirection,
1998
+ ..._,
1999
+ ref: l,
2000
+ style: { userSelect: "none", touchAction: "none", ...e.style },
2001
+ onKeyDown: P(e.onKeyDown, (C) => {
2002
+ C.key === "Escape" && (c == null || c(C.nativeEvent), C.nativeEvent.defaultPrevented || (m.isFocusedToastEscapeKeyDownRef.current = !0, g()));
2003
+ }),
2004
+ onPointerDown: P(e.onPointerDown, (C) => {
2005
+ C.button === 0 && (h.current = { x: C.clientX, y: C.clientY });
2006
+ }),
2007
+ onPointerMove: P(e.onPointerMove, (C) => {
2008
+ if (!h.current) return;
2009
+ const L = C.clientX - h.current.x, k = C.clientY - h.current.y, X = !!S.current, H = ["left", "right"].includes(m.swipeDirection), Q = ["left", "up"].includes(m.swipeDirection) ? Math.min : Math.max, W = H ? Q(0, L) : 0, pe = H ? 0 : Q(0, k), oe = C.pointerType === "touch" ? 10 : 2, z = { x: W, y: pe }, E = { originalEvent: C, delta: z };
2010
+ X ? (S.current = z, Ee(Oa, w, E, {
2011
+ discrete: !1
2012
+ })) : Pr(z, m.swipeDirection, oe) ? (S.current = z, Ee(Na, b, E, {
2013
+ discrete: !1
2014
+ }), C.target.setPointerCapture(C.pointerId)) : (Math.abs(L) > oe || Math.abs(k) > oe) && (h.current = null);
2015
+ }),
2016
+ onPointerUp: P(e.onPointerUp, (C) => {
2017
+ const L = S.current, k = C.target;
2018
+ if (k.hasPointerCapture(C.pointerId) && k.releasePointerCapture(C.pointerId), S.current = null, h.current = null, L) {
2019
+ const X = C.currentTarget, H = { originalEvent: C, delta: L };
2020
+ Pr(L, m.swipeDirection, m.swipeThreshold) ? Ee(La, R, H, {
2021
+ discrete: !0
2022
+ }) : Ee(
2023
+ Da,
2024
+ I,
2025
+ H,
2026
+ {
2027
+ discrete: !0
2028
+ }
2029
+ ), X.addEventListener("click", (Q) => Q.preventDefault(), {
2030
+ once: !0
2031
+ });
2032
+ }
2033
+ })
2034
+ }
2035
+ )
2036
+ }
2037
+ ) }),
2038
+ m.viewport
2039
+ ) })
2040
+ ] }) : null;
2041
+ }
2042
+ ), $a = (e) => {
2043
+ const { __scopeToast: r, children: t, ...o } = e, n = De(Te, r), [s, u] = a.useState(!1), [c, f] = a.useState(!1);
2044
+ return ja(() => u(!0)), a.useEffect(() => {
2045
+ const d = window.setTimeout(() => f(!0), 1e3);
2046
+ return () => window.clearTimeout(d);
2047
+ }, []), c ? null : /* @__PURE__ */ i(Ko, { asChild: !0, children: /* @__PURE__ */ i(Dr, { ...o, children: s && /* @__PURE__ */ st(at, { children: [
2048
+ n.label,
2049
+ " ",
2050
+ t
2051
+ ] }) }) });
2052
+ }, Ka = "ToastTitle", ir = a.forwardRef(
2053
+ (e, r) => {
2054
+ const { __scopeToast: t, ...o } = e;
2055
+ return /* @__PURE__ */ i(D.div, { ...o, ref: r });
2056
+ }
2057
+ );
2058
+ ir.displayName = Ka;
2059
+ var Ba = "ToastDescription", cr = a.forwardRef(
2060
+ (e, r) => {
2061
+ const { __scopeToast: t, ...o } = e;
2062
+ return /* @__PURE__ */ i(D.div, { ...o, ref: r });
2063
+ }
2064
+ );
2065
+ cr.displayName = Ba;
2066
+ var fo = "ToastAction", lr = a.forwardRef(
2067
+ (e, r) => {
2068
+ const { altText: t, ...o } = e;
2069
+ return t.trim() ? /* @__PURE__ */ i(mo, { altText: t, asChild: !0, children: /* @__PURE__ */ i(Le, { ...o, ref: r }) }) : (console.error(
2070
+ `Invalid prop \`altText\` supplied to \`${fo}\`. Expected non-empty \`string\`.`
2071
+ ), null);
2072
+ }
2073
+ );
2074
+ lr.displayName = fo;
2075
+ var po = "ToastClose", Le = a.forwardRef(
2076
+ (e, r) => {
2077
+ const { __scopeToast: t, ...o } = e, n = Va(po, t);
2078
+ return /* @__PURE__ */ i(mo, { asChild: !0, children: /* @__PURE__ */ i(
2079
+ D.button,
2080
+ {
2081
+ type: "button",
2082
+ ...o,
2083
+ ref: r,
2084
+ onClick: P(e.onClick, n.onClose)
2085
+ }
2086
+ ) });
2087
+ }
2088
+ );
2089
+ Le.displayName = po;
2090
+ var mo = a.forwardRef((e, r) => {
2091
+ const { __scopeToast: t, altText: o, ...n } = e;
2092
+ return /* @__PURE__ */ i(
2093
+ D.div,
2094
+ {
2095
+ "data-radix-toast-announce-exclude": "",
2096
+ "data-radix-toast-announce-alt": o || void 0,
2097
+ ...n,
2098
+ ref: r
2099
+ }
2100
+ );
2101
+ });
2102
+ function vo(e) {
2103
+ const r = [];
2104
+ return Array.from(e.childNodes).forEach((o) => {
2105
+ if (o.nodeType === o.TEXT_NODE && o.textContent && r.push(o.textContent), Ha(o)) {
2106
+ const n = o.ariaHidden || o.hidden || o.style.display === "none", s = o.dataset.radixToastAnnounceExclude === "";
2107
+ if (!n)
2108
+ if (s) {
2109
+ const u = o.dataset.radixToastAnnounceAlt;
2110
+ u && r.push(u);
2111
+ } else
2112
+ r.push(...vo(o));
2113
+ }
2114
+ }), r;
2115
+ }
2116
+ function Ee(e, r, t, { discrete: o }) {
2117
+ const n = t.originalEvent.currentTarget, s = new CustomEvent(e, { bubbles: !0, cancelable: !0, detail: t });
2118
+ r && n.addEventListener(e, r, { once: !0 }), o ? Bo(n, s) : n.dispatchEvent(s);
2119
+ }
2120
+ var Pr = (e, r, t = 0) => {
2121
+ const o = Math.abs(e.x), n = Math.abs(e.y), s = o > n;
2122
+ return r === "left" || r === "right" ? s && o > t : !s && n > t;
2123
+ };
2124
+ function ja(e = () => {
2125
+ }) {
2126
+ const r = Re(e);
2127
+ rt(() => {
2128
+ let t = 0, o = 0;
2129
+ return t = window.requestAnimationFrame(() => o = window.requestAnimationFrame(r)), () => {
2130
+ window.cancelAnimationFrame(t), window.cancelAnimationFrame(o);
2131
+ };
2132
+ }, [r]);
2133
+ }
2134
+ function Ha(e) {
2135
+ return e.nodeType === e.ELEMENT_NODE;
2136
+ }
2137
+ function za(e) {
2138
+ const r = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
2139
+ acceptNode: (o) => {
2140
+ const n = o.tagName === "INPUT" && o.type === "hidden";
2141
+ return o.disabled || o.hidden || n ? NodeFilter.FILTER_SKIP : o.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
2142
+ }
2143
+ });
2144
+ for (; t.nextNode(); ) r.push(t.currentNode);
2145
+ return r;
2146
+ }
2147
+ function $e(e) {
2148
+ const r = document.activeElement;
2149
+ return e.some((t) => t === r ? !0 : (t.focus(), document.activeElement !== r));
2150
+ }
2151
+ var Ua = nr, Wa = ar, qa = sr, Ya = ir, Xa = cr, Za = lr, Ja = Le;
2152
+ const ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2153
+ __proto__: null,
2154
+ Action: Za,
2155
+ Close: Ja,
2156
+ Description: Xa,
2157
+ Provider: Ua,
2158
+ Root: qa,
2159
+ Title: Ya,
2160
+ Toast: sr,
2161
+ ToastAction: lr,
2162
+ ToastClose: Le,
2163
+ ToastDescription: cr,
2164
+ ToastProvider: nr,
2165
+ ToastTitle: ir,
2166
+ ToastViewport: ar,
2167
+ Viewport: Wa,
2168
+ createToastScope: Ma
2169
+ }, Symbol.toStringTag, { value: "Module" }));
2170
+ var ur = "Toolbar", [Qa, es] = se(ur, [
2171
+ de,
2172
+ Lr
2173
+ ]), dr = de(), bo = Lr(), [ts, go] = Qa(ur), fr = a.forwardRef(
2174
+ (e, r) => {
2175
+ const { __scopeToolbar: t, orientation: o = "horizontal", dir: n, loop: s = !0, ...u } = e, c = dr(t), f = Ae(n);
2176
+ return /* @__PURE__ */ i(ts, { scope: t, orientation: o, dir: f, children: /* @__PURE__ */ i(
2177
+ nt,
2178
+ {
2179
+ asChild: !0,
2180
+ ...c,
2181
+ orientation: o,
2182
+ dir: f,
2183
+ loop: s,
2184
+ children: /* @__PURE__ */ i(
2185
+ D.div,
2186
+ {
2187
+ role: "toolbar",
2188
+ "aria-orientation": o,
2189
+ dir: f,
2190
+ ...u,
2191
+ ref: r
2192
+ }
2193
+ )
2194
+ }
2195
+ ) });
2196
+ }
2197
+ );
2198
+ fr.displayName = ur;
2199
+ var ho = "ToolbarSeparator", pr = a.forwardRef(
2200
+ (e, r) => {
2201
+ const { __scopeToolbar: t, ...o } = e, n = go(ho, t);
2202
+ return /* @__PURE__ */ i(
2203
+ io,
2204
+ {
2205
+ orientation: n.orientation === "horizontal" ? "vertical" : "horizontal",
2206
+ ...o,
2207
+ ref: r
2208
+ }
2209
+ );
2210
+ }
2211
+ );
2212
+ pr.displayName = ho;
2213
+ var rs = "ToolbarButton", ke = a.forwardRef(
2214
+ (e, r) => {
2215
+ const { __scopeToolbar: t, ...o } = e, n = dr(t);
2216
+ return /* @__PURE__ */ i(Se, { asChild: !0, ...n, focusable: !e.disabled, children: /* @__PURE__ */ i(D.button, { type: "button", ...o, ref: r }) });
2217
+ }
2218
+ );
2219
+ ke.displayName = rs;
2220
+ var os = "ToolbarLink", mr = a.forwardRef(
2221
+ (e, r) => {
2222
+ const { __scopeToolbar: t, ...o } = e, n = dr(t);
2223
+ return /* @__PURE__ */ i(Se, { asChild: !0, ...n, focusable: !0, children: /* @__PURE__ */ i(
2224
+ D.a,
2225
+ {
2226
+ ...o,
2227
+ ref: r,
2228
+ onKeyDown: P(e.onKeyDown, (s) => {
2229
+ s.key === " " && s.currentTarget.click();
2230
+ })
2231
+ }
2232
+ ) });
2233
+ }
2234
+ );
2235
+ mr.displayName = os;
2236
+ var Co = "ToolbarToggleGroup", vr = a.forwardRef(
2237
+ (e, r) => {
2238
+ const { __scopeToolbar: t, ...o } = e, n = go(Co, t), s = bo(t);
2239
+ return /* @__PURE__ */ i(
2240
+ jo,
2241
+ {
2242
+ "data-orientation": n.orientation,
2243
+ dir: n.dir,
2244
+ ...s,
2245
+ ...o,
2246
+ ref: r,
2247
+ rovingFocus: !1
2248
+ }
2249
+ );
2250
+ }
2251
+ );
2252
+ vr.displayName = Co;
2253
+ var ns = "ToolbarToggleItem", br = a.forwardRef(
2254
+ (e, r) => {
2255
+ const { __scopeToolbar: t, ...o } = e, n = bo(t), s = { __scopeToolbar: e.__scopeToolbar };
2256
+ return /* @__PURE__ */ i(ke, { asChild: !0, ...s, children: /* @__PURE__ */ i(Ho, { ...n, ...o, ref: r }) });
2257
+ }
2258
+ );
2259
+ br.displayName = ns;
2260
+ var as = fr, ss = pr, is = ke, cs = mr, ls = vr, us = br;
2261
+ const Rs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2262
+ __proto__: null,
2263
+ Button: is,
2264
+ Link: cs,
2265
+ Root: as,
2266
+ Separator: ss,
2267
+ ToggleGroup: ls,
2268
+ ToggleItem: us,
2269
+ Toolbar: fr,
2270
+ ToolbarButton: ke,
2271
+ ToolbarLink: mr,
2272
+ ToolbarSeparator: pr,
2273
+ ToolbarToggleGroup: vr,
2274
+ ToolbarToggleItem: br,
2275
+ createToolbarScope: es
2276
+ }, Symbol.toStringTag, { value: "Module" }));
2277
+ export {
2278
+ As as AccessibleIcon,
2279
+ bs as Accordion,
2280
+ Ss as AlertDialog,
2281
+ xs as AspectRatio,
2282
+ Ms as Avatar,
2283
+ Ps as Checkbox,
2284
+ vs as Collapsible,
2285
+ Fs as ContextMenu,
2286
+ Ns as Dialog,
2287
+ Os as Direction,
2288
+ Ds as DropdownMenu,
2289
+ hs as Form,
2290
+ Ls as HoverCard,
2291
+ gs as Label,
2292
+ Cs as Menubar,
2293
+ ks as NavigationMenu,
2294
+ Vs as Popover,
2295
+ Gs as Portal,
2296
+ $s as Progress,
2297
+ Ks as RadioGroup,
2298
+ Bs as ScrollArea,
2299
+ js as Select,
2300
+ Es as Separator,
2301
+ Hs as Slider,
2302
+ zs as Slot,
2303
+ Us as Switch,
2304
+ Ws as Tabs,
2305
+ ws as Toast,
2306
+ qs as Toggle,
2307
+ Ys as ToggleGroup,
2308
+ Rs as Toolbar,
2309
+ Xs as Tooltip,
2310
+ Zs as VisuallyHidden,
2311
+ Ts as unstable_OneTimePasswordField,
2312
+ ys as unstable_PasswordToggleField
2313
+ };