@facto-to/design-system 0.1.0-beta.8 → 0.1.0-beta.9

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/index.js CHANGED
@@ -1,1464 +1,2118 @@
1
1
  "use client";
2
- import { jsx as n, jsxs as _, Fragment as J } from "react/jsx-runtime";
3
- import * as Z from "@radix-ui/react-popover";
4
- import * as K from "@radix-ui/react-dropdown-menu";
5
- import * as Q from "@radix-ui/react-tooltip";
6
- import * as V from "@radix-ui/react-toast";
7
- import { createPortal as yt } from "react-dom";
8
- import * as lt from "@radix-ui/react-checkbox";
9
- import * as x from "@radix-ui/react-dialog";
10
- import * as L from "@radix-ui/react-select";
11
- import * as dt from "@radix-ui/react-switch";
12
- import * as ot from "@radix-ui/react-tabs";
13
- import { useContext as B, useSyncExternalStore as wt, createContext as st, useRef as T, useLayoutEffect as O, useState as H, useEffect as E, useId as j, forwardRef as X, Children as kt, isValidElement as Ct, cloneElement as Tt, useCallback as z, useMemo as Mt } from "react";
14
- const S = {
2
+ import { jsx as e, jsxs as u, Fragment as et } from "react/jsx-runtime";
3
+ import * as it from "@radix-ui/react-popover";
4
+ import * as at from "@radix-ui/react-dropdown-menu";
5
+ import * as st from "@radix-ui/react-tooltip";
6
+ import * as J from "@radix-ui/react-toast";
7
+ import { createPortal as Kt } from "react-dom";
8
+ import * as St from "@radix-ui/react-checkbox";
9
+ import * as F from "@radix-ui/react-dialog";
10
+ import * as V from "@radix-ui/react-select";
11
+ import * as Mt from "@radix-ui/react-switch";
12
+ import * as vt from "@radix-ui/react-tabs";
13
+ import { useContext as W, useSyncExternalStore as Yt, createContext as wt, useRef as x, useLayoutEffect as Z, useState as A, useEffect as q, useId as G, forwardRef as dt, Children as Qt, isValidElement as Xt, cloneElement as Zt, Fragment as Jt, useCallback as X, useMemo as te } from "react";
14
+ const z = {
15
15
  duration: { feedback: 160, content: 180, surface: 220, overlay: 240 },
16
16
  easing: { standard: "cubic-bezier(.22, 1, .36, 1)" }
17
- }, pt = st("auto"), gt = "(prefers-reduced-motion: reduce)", Rt = (t) => {
18
- const e = window.matchMedia?.(gt);
19
- return e?.addEventListener("change", t), () => e?.removeEventListener("change", t);
20
- }, $t = () => typeof window < "u" && !!window.matchMedia?.(gt).matches, St = () => !0;
21
- function tt(t) {
22
- const e = B(pt), o = wt(Rt, $t, St), a = t ?? e;
23
- return { motion: a, reduced: o, enabled: a === "auto" && !o };
24
- }
25
- function A(t) {
26
- const { enabled: e } = tt(t);
27
- return { "--facto-motion-scale": e ? 1 : 0 };
28
- }
29
- function at({ motion: t, children: e }) {
30
- const o = tt(t);
31
- return /* @__PURE__ */ n(pt.Provider, { value: o.motion, children: /* @__PURE__ */ n("div", { "data-facto-motion": o.motion, style: { display: "contents", "--facto-motion-scale": o.enabled ? 1 : 0 }, children: e }) });
32
- }
33
- const rt = (...t) => t.filter(Boolean).join(" ");
34
- function D(t, e) {
35
- e.current?.cancel(), e.current = null, t.style.height = "", t.style.overflow = "";
36
- }
37
- function it(t) {
38
- return tt(t).enabled;
39
- }
40
- function vt(t, e, o) {
41
- const a = T(null), c = T(null), i = T(t), r = T(!1), u = T(0), [s, f] = H(t);
42
- return O(() => {
43
- const m = a.current;
44
- if (!m) return;
17
+ }, It = wt("auto"), Bt = "(prefers-reduced-motion: reduce)", ee = (t) => {
18
+ const n = window.matchMedia?.(Bt);
19
+ return n?.addEventListener("change", t), () => n?.removeEventListener("change", t);
20
+ }, ne = () => typeof window < "u" && !!window.matchMedia?.(Bt).matches, ae = () => !0;
21
+ function ut(t) {
22
+ const n = W(It), a = Yt(ee, ne, ae), o = t ?? n;
23
+ return { motion: o, reduced: a, enabled: o === "auto" && !a };
24
+ }
25
+ function Y(t) {
26
+ const { enabled: n } = ut(t);
27
+ return { "--facto-motion-scale": n ? 1 : 0 };
28
+ }
29
+ function gt({ motion: t, children: n }) {
30
+ const a = ut(t);
31
+ return /* @__PURE__ */ e(It.Provider, { value: a.motion, children: /* @__PURE__ */ e("div", { "data-facto-motion": a.motion, style: { display: "contents", "--facto-motion-scale": a.enabled ? 1 : 0 }, children: n }) });
32
+ }
33
+ const bt = (...t) => t.filter(Boolean).join(" ");
34
+ function H(t, n) {
35
+ n.current?.cancel(), n.current = null, t.style.height = "", t.style.overflow = "";
36
+ }
37
+ function _t(t) {
38
+ return ut(t).enabled;
39
+ }
40
+ function Et(t, n, a) {
41
+ const o = x(null), r = x(null), i = x(t), c = x(!1), l = x(0), [s, h] = A(t);
42
+ return Z(() => {
43
+ const f = o.current;
44
+ if (!f) return;
45
45
  const p = i.current !== t;
46
- if (i.current = t, !e) {
47
- r.current = !1, D(m, c), f(t);
46
+ if (i.current = t, !n) {
47
+ c.current = !1, H(f, r), h(t);
48
48
  return;
49
49
  }
50
- if (p && (u.current = m.getBoundingClientRect().height, D(m, c), r.current = !0, t && !s)) {
51
- f(!0);
50
+ if (p && (l.current = f.getBoundingClientRect().height, H(f, r), c.current = !0, t && !s)) {
51
+ h(!0);
52
52
  return;
53
53
  }
54
- if (!r.current || !s) return;
55
- r.current = !1;
56
- const y = t ? u.current || 0 : u.current, w = t ? m.scrollHeight : 0;
57
- if (!m.animate || Math.abs(w - y) < 1) {
58
- D(m, c), t || f(!1);
54
+ if (!c.current || !s) return;
55
+ c.current = !1;
56
+ const v = t ? l.current || 0 : l.current, k = t ? f.scrollHeight : 0;
57
+ if (!f.animate || Math.abs(k - v) < 1) {
58
+ H(f, r), t || h(!1);
59
59
  return;
60
60
  }
61
- m.style.height = `${y}px`, m.style.overflow = "hidden";
62
- const C = m.animate(
63
- [{ height: `${y}px`, opacity: t ? 0.85 : 1 }, { height: `${w}px`, opacity: t ? 1 : 0 }],
64
- { duration: o, easing: S.easing.standard, fill: "forwards" }
61
+ f.style.height = `${v}px`, f.style.overflow = "hidden";
62
+ const w = f.animate(
63
+ [{ height: `${v}px`, opacity: t ? 0.85 : 1 }, { height: `${k}px`, opacity: t ? 1 : 0 }],
64
+ { duration: a, easing: z.easing.standard, fill: "forwards" }
65
65
  );
66
- c.current = C, C.onfinish = () => {
67
- c.current === C && (D(m, c), t || f(!1));
66
+ r.current = w, w.onfinish = () => {
67
+ r.current === w && (H(f, r), t || h(!1));
68
68
  };
69
- }, [e, s, t, o]), O(() => () => {
70
- const m = a.current;
71
- m && D(m, c);
72
- }, []), { rootRef: a, mounted: s };
73
- }
74
- function Gt({ stepKey: t, children: e, motion: o, className: a, ...c }) {
75
- const i = it(o), r = T(null), u = T(null), s = T(null), f = T(null), m = T(t), p = T(null), y = T(null), w = T(null), C = () => {
76
- const v = r.current, l = u.current;
77
- !v || !l || (D(v, s), p.current = l.getBoundingClientRect().height, y.current = null);
78
- }, M = (v, l) => {
79
- const d = r.current;
80
- if (!d || !i || !d.animate || Math.abs(l - v) < 1) {
81
- C();
69
+ }, [n, s, t, a]), Z(() => () => {
70
+ const f = o.current;
71
+ f && H(f, r);
72
+ }, []), { rootRef: o, mounted: s };
73
+ }
74
+ function oe({ stepKey: t, children: n, motion: a, className: o, ...r }) {
75
+ const i = _t(a), c = x(null), l = x(null), s = x(null), h = x(null), f = x(t), p = x(null), v = x(null), k = x(null), w = () => {
76
+ const g = c.current, d = l.current;
77
+ !g || !d || (H(g, s), p.current = d.getBoundingClientRect().height, v.current = null);
78
+ }, C = (g, d) => {
79
+ const m = c.current;
80
+ if (!m || !i || !m.animate || Math.abs(d - g) < 1) {
81
+ w();
82
82
  return;
83
83
  }
84
- D(d, s), d.style.height = `${v}px`, d.style.overflow = "hidden", y.current = l;
85
- const b = d.animate(
86
- [{ height: `${v}px` }, { height: `${l}px` }],
87
- { duration: S.duration.surface, easing: S.easing.standard, fill: "forwards" }
84
+ H(m, s), m.style.height = `${g}px`, m.style.overflow = "hidden", v.current = d;
85
+ const y = m.animate(
86
+ [{ height: `${g}px` }, { height: `${d}px` }],
87
+ { duration: z.duration.surface, easing: z.easing.standard, fill: "forwards" }
88
88
  );
89
- s.current = b, b.onfinish = () => {
90
- s.current === b && C();
89
+ s.current = y, y.onfinish = () => {
90
+ s.current === y && w();
91
91
  };
92
92
  };
93
- return O(() => {
94
- const v = r.current, l = u.current;
95
- if (!v || !l) return;
96
- const d = m.current !== t;
97
- if (m.current = t, !i) {
98
- D(v, s), f.current?.cancel(), f.current = null, p.current = l.getBoundingClientRect().height, y.current = null;
93
+ return Z(() => {
94
+ const g = c.current, d = l.current;
95
+ if (!g || !d) return;
96
+ const m = f.current !== t;
97
+ if (f.current = t, !i) {
98
+ H(g, s), h.current?.cancel(), h.current = null, p.current = d.getBoundingClientRect().height, v.current = null;
99
99
  return;
100
100
  }
101
- if (!d) {
102
- s.current || (p.current = l.getBoundingClientRect().height);
101
+ if (!m) {
102
+ s.current || (p.current = d.getBoundingClientRect().height);
103
103
  return;
104
104
  }
105
- const b = s.current ? v.getBoundingClientRect().height : p.current ?? v.getBoundingClientRect().height;
106
- D(v, s), f.current?.cancel(), f.current = null;
107
- const g = l.getBoundingClientRect().height;
105
+ const y = s.current ? g.getBoundingClientRect().height : p.current ?? g.getBoundingClientRect().height;
106
+ H(g, s), h.current?.cancel(), h.current = null;
107
+ const b = d.getBoundingClientRect().height;
108
108
  if (p.current == null) {
109
- p.current = g;
109
+ p.current = b;
110
110
  return;
111
111
  }
112
- M(b, g);
113
- const N = l.animate?.(
112
+ C(y, b);
113
+ const N = d.animate?.(
114
114
  [{ opacity: 0.35, transform: "translateY(6px)" }, { opacity: 1, transform: "translateY(0)" }],
115
- { duration: S.duration.content, easing: S.easing.standard }
115
+ { duration: z.duration.content, easing: z.easing.standard }
116
116
  );
117
- f.current = N ?? null, N?.addEventListener("finish", () => {
118
- f.current === N && (N.cancel(), f.current = null);
117
+ h.current = N ?? null, N?.addEventListener("finish", () => {
118
+ h.current === N && (N.cancel(), h.current = null);
119
119
  }, { once: !0 });
120
- }, [e, i, t]), O(() => {
121
- if (!r.current || typeof ResizeObserver > "u") return;
122
- const l = new ResizeObserver(() => w.current?.()), d = u.current;
123
- if (d)
124
- return l.observe(d), () => l.disconnect();
125
- }, []), w.current = () => {
126
- const v = r.current, l = u.current;
127
- if (!v || !l) return;
128
- const d = l.getBoundingClientRect().height;
120
+ }, [n, i, t]), Z(() => {
121
+ if (!c.current || typeof ResizeObserver > "u") return;
122
+ const d = new ResizeObserver(() => k.current?.()), m = l.current;
123
+ if (m)
124
+ return d.observe(m), () => d.disconnect();
125
+ }, []), k.current = () => {
126
+ const g = c.current, d = l.current;
127
+ if (!g || !d) return;
128
+ const m = d.getBoundingClientRect().height;
129
129
  if (!s.current) {
130
- p.current = d;
130
+ p.current = m;
131
131
  return;
132
132
  }
133
- y.current != null && Math.abs(d - y.current) >= 1 && M(v.getBoundingClientRect().height, d);
134
- }, O(() => () => {
135
- const v = r.current;
136
- v && D(v, s), f.current?.cancel(), f.current = null;
137
- }, []), /* @__PURE__ */ n("div", { ...c, ref: r, className: rt("facto-step-transition", a), children: /* @__PURE__ */ n("div", { ref: u, className: "facto-step-transition__content", children: e }) });
138
- }
139
- function Jt({ open: t, children: e, motion: o, className: a, ...c }) {
140
- const { rootRef: i, mounted: r } = vt(t, it(o), S.duration.content);
141
- return /* @__PURE__ */ n("div", { ...c, ref: i, className: rt("facto-animated-disclosure", a), "aria-hidden": t ? void 0 : !0, inert: !t, hidden: !r, children: e });
142
- }
143
- function Ut({ show: t, children: e, motion: o, className: a, role: c = "alert", ...i }) {
144
- const { rootRef: r, mounted: u } = vt(t, it(o), S.duration.feedback);
145
- return /* @__PURE__ */ n("div", { ...i, ref: r, className: rt("facto-animated-feedback", a), role: t ? c : void 0, "aria-hidden": t ? void 0 : !0, inert: !t, hidden: !u, children: e });
146
- }
147
- function Zt({ children: t, ready: e = !0, motion: o, className: a, ...c }) {
148
- const i = it(o), r = T(null), u = T(e);
149
- return O(() => {
150
- const s = r.current, f = !u.current && e;
151
- if (u.current = e, !s || !f || !i || !s.animate) return;
152
- const m = s.animate([{ opacity: 0.85 }, { opacity: 1 }], { duration: S.duration.content, easing: S.easing.standard });
153
- return m.addEventListener("finish", () => m.cancel(), { once: !0 }), () => m.cancel();
154
- }, [i, e]), /* @__PURE__ */ n("div", { ...c, ref: r, className: rt("facto-content-reveal", a), "aria-busy": e ? void 0 : !0, children: t });
155
- }
156
- const ut = (t) => {
157
- t.forEach((e) => e.cancel()), t.length = 0;
133
+ v.current != null && Math.abs(m - v.current) >= 1 && C(g.getBoundingClientRect().height, m);
134
+ }, Z(() => () => {
135
+ const g = c.current;
136
+ g && H(g, s), h.current?.cancel(), h.current = null;
137
+ }, []), /* @__PURE__ */ e("div", { ...r, ref: c, className: bt("facto-step-transition", o), children: /* @__PURE__ */ e("div", { ref: l, className: "facto-step-transition__content", children: n }) });
138
+ }
139
+ function Re({ open: t, children: n, motion: a, className: o, ...r }) {
140
+ const { rootRef: i, mounted: c } = Et(t, _t(a), z.duration.content);
141
+ return /* @__PURE__ */ e("div", { ...r, ref: i, className: bt("facto-animated-disclosure", o), "aria-hidden": t ? void 0 : !0, inert: !t, hidden: !c, children: n });
142
+ }
143
+ function $e({ show: t, children: n, motion: a, className: o, role: r = "alert", ...i }) {
144
+ const { rootRef: c, mounted: l } = Et(t, _t(a), z.duration.feedback);
145
+ return /* @__PURE__ */ e("div", { ...i, ref: c, className: bt("facto-animated-feedback", o), role: t ? r : void 0, "aria-hidden": t ? void 0 : !0, inert: !t, hidden: !l, children: n });
146
+ }
147
+ function Le({ children: t, ready: n = !0, motion: a, className: o, ...r }) {
148
+ const i = _t(a), c = x(null), l = x(n);
149
+ return Z(() => {
150
+ const s = c.current, h = !l.current && n;
151
+ if (l.current = n, !s || !h || !i || !s.animate) return;
152
+ const f = s.animate([{ opacity: 0.85 }, { opacity: 1 }], { duration: z.duration.content, easing: z.easing.standard });
153
+ return f.addEventListener("finish", () => f.cancel(), { once: !0 }), () => f.cancel();
154
+ }, [i, n]), /* @__PURE__ */ e("div", { ...r, ref: c, className: bt("facto-content-reveal", o), "aria-busy": n ? void 0 : !0, children: t });
155
+ }
156
+ const Rt = (t) => {
157
+ t.forEach((n) => n.cancel()), t.length = 0;
158
158
  };
159
- function Qt(t, e, { motion: o } = {}) {
160
- const { enabled: a } = tt(o), c = T(/* @__PURE__ */ new Map()), i = T(/* @__PURE__ */ new Set()), r = T(null), u = T([]), s = JSON.stringify(e);
161
- O(() => {
162
- const f = t.current, m = () => {
163
- if (!f) return /* @__PURE__ */ new Map();
164
- const M = f.getBoundingClientRect();
159
+ function Ie(t, n, { motion: a } = {}) {
160
+ const { enabled: o } = ut(a), r = x(/* @__PURE__ */ new Map()), i = x(/* @__PURE__ */ new Set()), c = x(null), l = x([]), s = JSON.stringify(n);
161
+ Z(() => {
162
+ const h = t.current, f = () => {
163
+ if (!h) return /* @__PURE__ */ new Map();
164
+ const C = h.getBoundingClientRect();
165
165
  return new Map(
166
- Array.from(f.querySelectorAll("[data-list-motion-key]")).map((v) => {
167
- const l = v.dataset.listMotionKey, d = v.getBoundingClientRect();
168
- return l === void 0 ? null : [l, {
169
- left: d.left - M.left + f.scrollLeft,
170
- top: d.top - M.top + f.scrollTop
166
+ Array.from(h.querySelectorAll("[data-list-motion-key]")).map((g) => {
167
+ const d = g.dataset.listMotionKey, m = g.getBoundingClientRect();
168
+ return d === void 0 ? null : [d, {
169
+ left: m.left - C.left + h.scrollLeft,
170
+ top: m.top - C.top + h.scrollTop
171
171
  }];
172
- }).filter((v) => v !== null)
172
+ }).filter((g) => g !== null)
173
173
  );
174
174
  };
175
- ut(u.current);
176
- const p = m();
177
- if (!f || !a) {
178
- c.current = p, i.current = new Set(p.keys()), r.current = s;
175
+ Rt(l.current);
176
+ const p = f();
177
+ if (!h || !o) {
178
+ r.current = p, i.current = new Set(p.keys()), c.current = s;
179
179
  return;
180
180
  }
181
- const y = r.current !== null && r.current !== s, w = c.current, C = i.current;
182
- if (y) {
183
- const M = new Map(
184
- Array.from(f.querySelectorAll("[data-list-motion-key]")).map((v) => [v.dataset.listMotionKey, v]).filter((v) => v[0] !== void 0)
181
+ const v = c.current !== null && c.current !== s, k = r.current, w = i.current;
182
+ if (v) {
183
+ const C = new Map(
184
+ Array.from(h.querySelectorAll("[data-list-motion-key]")).map((g) => [g.dataset.listMotionKey, g]).filter((g) => g[0] !== void 0)
185
185
  );
186
- for (const [v, l] of p) {
187
- const d = M.get(v);
188
- if (!d || typeof d.animate != "function") continue;
189
- const b = C.has(v) ? w.get(v) : void 0, g = b ? (() => {
190
- const N = b.left - l.left, k = b.top - l.top;
191
- return Math.abs(N) > 0.5 || Math.abs(k) > 0.5 ? [{ transform: `translate(${N}px, ${k}px)` }, { transform: "none" }] : null;
186
+ for (const [g, d] of p) {
187
+ const m = C.get(g);
188
+ if (!m || typeof m.animate != "function") continue;
189
+ const y = w.has(g) ? k.get(g) : void 0, b = y ? (() => {
190
+ const N = y.left - d.left, T = y.top - d.top;
191
+ return Math.abs(N) > 0.5 || Math.abs(T) > 0.5 ? [{ transform: `translate(${N}px, ${T}px)` }, { transform: "none" }] : null;
192
192
  })() : [{ opacity: 0, transform: "translateY(-4px)" }, { opacity: 1, transform: "none" }];
193
- g && u.current.push(d.animate(g, {
194
- duration: b ? S.duration.content : S.duration.feedback,
195
- easing: S.easing.standard
193
+ b && l.current.push(m.animate(b, {
194
+ duration: y ? z.duration.content : z.duration.feedback,
195
+ easing: z.easing.standard
196
196
  }));
197
197
  }
198
198
  }
199
- return c.current = p, i.current = new Set(p.keys()), r.current = s, () => ut(u.current);
200
- }, [a, t, s]);
201
- }
202
- function Xt({ motion: t, className: e, children: o, ...a }) {
203
- const { enabled: c } = tt(t), i = T(null), r = T(null), u = T(null), s = T(null);
204
- return O(() => {
205
- const f = i.current, m = r.current;
206
- if (!f || !m) return;
207
- const p = (l) => {
208
- const d = f.querySelector('[aria-pressed="true"], [aria-selected="true"]');
209
- if (!d) {
210
- s.current?.cancel(), s.current = null, m.hidden = !0, u.current = null;
199
+ return r.current = p, i.current = new Set(p.keys()), c.current = s, () => Rt(l.current);
200
+ }, [o, t, s]);
201
+ }
202
+ function Be({ motion: t, className: n, children: a, ...o }) {
203
+ const { enabled: r } = ut(t), i = x(null), c = x(null), l = x(null), s = x(null);
204
+ return Z(() => {
205
+ const h = i.current, f = c.current;
206
+ if (!h || !f) return;
207
+ const p = (d) => {
208
+ const m = h.querySelector('[aria-pressed="true"], [aria-selected="true"]');
209
+ if (!m) {
210
+ s.current?.cancel(), s.current = null, f.hidden = !0, l.current = null;
211
211
  return;
212
212
  }
213
- const b = f.getBoundingClientRect(), g = d.getBoundingClientRect(), N = u.current, k = !m.hidden && s.current ? m.getBoundingClientRect() : N;
214
- s.current?.cancel(), s.current = null, m.hidden = !1, Object.assign(m.style, {
215
- left: `${g.left - b.left + f.scrollLeft}px`,
216
- top: `${g.top - b.top + f.scrollTop}px`,
217
- width: `${g.width}px`,
218
- height: `${g.height}px`
219
- }), l && c && k && g.width > 0 && g.height > 0 && typeof m.animate == "function" && (s.current = m.animate([
213
+ const y = h.getBoundingClientRect(), b = m.getBoundingClientRect(), N = l.current, T = !f.hidden && s.current ? f.getBoundingClientRect() : N;
214
+ s.current?.cancel(), s.current = null, f.hidden = !1, Object.assign(f.style, {
215
+ left: `${b.left - y.left + h.scrollLeft}px`,
216
+ top: `${b.top - y.top + h.scrollTop}px`,
217
+ width: `${b.width}px`,
218
+ height: `${b.height}px`
219
+ }), d && r && T && b.width > 0 && b.height > 0 && typeof f.animate == "function" && (s.current = f.animate([
220
220
  {
221
- transform: `translate(${k.left - g.left}px, ${k.top - g.top}px) scale(${k.width / g.width}, ${k.height / g.height})`
221
+ transform: `translate(${T.left - b.left}px, ${T.top - b.top}px) scale(${T.width / b.width}, ${T.height / b.height})`
222
222
  },
223
223
  { transform: "none" }
224
- ], { duration: S.duration.surface, easing: S.easing.standard })), u.current = g;
225
- }, y = typeof ResizeObserver > "u" ? null : new ResizeObserver(() => p(!1)), w = /* @__PURE__ */ new Set(), C = () => {
226
- w.forEach((l) => {
227
- f.contains(l) || (y?.unobserve(l), w.delete(l));
228
- }), f.querySelectorAll("[aria-pressed], [aria-selected]").forEach((l) => {
229
- w.has(l) || (w.add(l), y?.observe(l));
224
+ ], { duration: z.duration.surface, easing: z.easing.standard })), l.current = b;
225
+ }, v = typeof ResizeObserver > "u" ? null : new ResizeObserver(() => p(!1)), k = /* @__PURE__ */ new Set(), w = () => {
226
+ k.forEach((d) => {
227
+ h.contains(d) || (v?.unobserve(d), k.delete(d));
228
+ }), h.querySelectorAll("[aria-pressed], [aria-selected]").forEach((d) => {
229
+ k.has(d) || (k.add(d), v?.observe(d));
230
230
  });
231
231
  };
232
- p(!1), C();
233
- const M = new MutationObserver((l) => {
234
- const d = l.some(
235
- (b) => b.type === "attributes" && (b.attributeName === "aria-pressed" || b.attributeName === "aria-selected")
232
+ p(!1), w();
233
+ const C = new MutationObserver((d) => {
234
+ const m = d.some(
235
+ (y) => y.type === "attributes" && (y.attributeName === "aria-pressed" || y.attributeName === "aria-selected")
236
236
  );
237
- C(), p(d);
237
+ w(), p(m);
238
238
  });
239
- M.observe(f, {
239
+ C.observe(h, {
240
240
  subtree: !0,
241
241
  childList: !0,
242
242
  characterData: !0,
243
243
  attributes: !0,
244
244
  attributeFilter: ["aria-pressed", "aria-selected"]
245
- }), y?.observe(f);
246
- const v = () => p(!1);
247
- return window.addEventListener("resize", v), () => {
248
- s.current?.cancel(), s.current = null, M.disconnect(), y?.disconnect(), window.removeEventListener("resize", v);
245
+ }), v?.observe(h);
246
+ const g = () => p(!1);
247
+ return window.addEventListener("resize", g), () => {
248
+ s.current?.cancel(), s.current = null, C.disconnect(), v?.disconnect(), window.removeEventListener("resize", g);
249
249
  };
250
- }, [c]), /* @__PURE__ */ _("div", { ...a, ref: i, className: ["facto-selection-motion", e].filter(Boolean).join(" "), children: [
251
- /* @__PURE__ */ n("span", { ref: r, className: "facto-selection-motion__indicator", "aria-hidden": "true", hidden: !0 }),
252
- o
250
+ }, [r]), /* @__PURE__ */ u("div", { ...o, ref: i, className: ["facto-selection-motion", n].filter(Boolean).join(" "), children: [
251
+ /* @__PURE__ */ e("span", { ref: c, className: "facto-selection-motion__indicator", "aria-hidden": "true", hidden: !0 }),
252
+ a
253
253
  ] });
254
254
  }
255
- function bt() {
256
- const [t, e] = H(null);
257
- return E(() => {
258
- const o = window.visualViewport;
259
- if (!t || !o) return;
260
- let a = 0;
261
- const c = () => {
255
+ function Pt() {
256
+ const [t, n] = A(null);
257
+ return q(() => {
258
+ const a = window.visualViewport;
259
+ if (!t || !a) return;
260
+ let o = 0;
261
+ const r = () => {
262
262
  delete t.dataset.keyboardOpen, t.style.removeProperty("--facto-visible-height"), t.style.removeProperty("--facto-visible-top");
263
263
  }, i = () => {
264
- cancelAnimationFrame(a), a = requestAnimationFrame(() => {
265
- const r = document.activeElement, u = r instanceof HTMLElement && t.contains(r) && r.matches('input, textarea, [contenteditable="true"]'), s = (window.innerWidth <= 700 || window.matchMedia?.("(pointer: coarse)").matches) && o.scale === 1 && window.innerHeight - o.height > 120, f = t.dataset.keyboardOpen === "true" && r instanceof HTMLElement && t.contains(r);
266
- if (!s || !u && !f) {
267
- c();
264
+ cancelAnimationFrame(o), o = requestAnimationFrame(() => {
265
+ const c = document.activeElement, l = c instanceof HTMLElement && t.contains(c) && c.matches('input, textarea, [contenteditable="true"]'), s = (window.innerWidth <= 700 || window.matchMedia?.("(pointer: coarse)").matches) && a.scale === 1 && window.innerHeight - a.height > 120, h = t.dataset.keyboardOpen === "true" && c instanceof HTMLElement && t.contains(c);
266
+ if (!s || !l && !h) {
267
+ r();
268
268
  return;
269
269
  }
270
- if (t.dataset.keyboardOpen = "true", t.style.setProperty("--facto-visible-height", `${o.height}px`), t.style.setProperty("--facto-visible-top", `${o.offsetTop}px`), u) {
271
- const m = r.getBoundingClientRect();
272
- (m.top < o.offsetTop + 12 || m.bottom > o.offsetTop + o.height - 12) && r.scrollIntoView({ block: "nearest", behavior: "instant" });
270
+ if (t.dataset.keyboardOpen = "true", t.style.setProperty("--facto-visible-height", `${a.height}px`), t.style.setProperty("--facto-visible-top", `${a.offsetTop}px`), l) {
271
+ const f = c.getBoundingClientRect();
272
+ (f.top < a.offsetTop + 12 || f.bottom > a.offsetTop + a.height - 12) && c.scrollIntoView({ block: "nearest", behavior: "instant" });
273
273
  }
274
274
  });
275
275
  };
276
- return o.addEventListener("resize", i), o.addEventListener("scroll", i), t.addEventListener("focusin", i), t.addEventListener("focusout", i), i(), () => {
277
- cancelAnimationFrame(a), o.removeEventListener("resize", i), o.removeEventListener("scroll", i), t.removeEventListener("focusin", i), t.removeEventListener("focusout", i), c();
276
+ return a.addEventListener("resize", i), a.addEventListener("scroll", i), t.addEventListener("focusin", i), t.addEventListener("focusout", i), i(), () => {
277
+ cancelAnimationFrame(o), a.removeEventListener("resize", i), a.removeEventListener("scroll", i), t.removeEventListener("focusin", i), t.removeEventListener("focusout", i), r();
278
278
  };
279
- }, [t]), e;
279
+ }, [t]), n;
280
280
  }
281
- const nt = /* @__PURE__ */ new WeakMap();
282
- function xt(t) {
283
- const e = Array.from(t.ownerDocument.body.children).filter(
284
- (a) => a instanceof HTMLElement && !a.hasAttribute("data-radix-focus-guard") && !a.contains(t)
281
+ const ht = /* @__PURE__ */ new WeakMap();
282
+ function ce(t) {
283
+ const n = Array.from(t.ownerDocument.body.children).filter(
284
+ (o) => o instanceof HTMLElement && !o.hasAttribute("data-radix-focus-guard") && !o.contains(t)
285
285
  );
286
- for (const a of e) {
287
- const c = nt.get(a);
288
- c ? c.count += 1 : (nt.set(a, { count: 1, wasInert: a.inert }), a.inert = !0);
286
+ for (const o of n) {
287
+ const r = ht.get(o);
288
+ r ? r.count += 1 : (ht.set(o, { count: 1, wasInert: o.inert }), o.inert = !0);
289
289
  }
290
- let o = !0;
290
+ let a = !0;
291
291
  return () => {
292
- if (o) {
293
- o = !1;
294
- for (const a of e) {
295
- const c = nt.get(a);
296
- c && (c.count -= 1, c.count === 0 && (c.wasInert || (a.inert = !1), nt.delete(a)));
292
+ if (a) {
293
+ a = !1;
294
+ for (const o of n) {
295
+ const r = ht.get(o);
296
+ r && (r.count -= 1, r.count === 0 && (r.wasInert || (o.inert = !1), ht.delete(o)));
297
297
  }
298
298
  }
299
299
  };
300
300
  }
301
- const q = (...t) => t.filter(Boolean).join(" "), te = X(function(e, o) {
302
- const { leading: a, title: c, description: i, value: r, status: u, trailing: s, className: f } = e, m = /* @__PURE__ */ _(J, { children: [
303
- a != null && /* @__PURE__ */ n("span", { className: "facto-list-row__leading", children: a }),
304
- /* @__PURE__ */ _("span", { className: "facto-list-row__copy", children: [
305
- /* @__PURE__ */ n("span", { className: "facto-list-row__title", children: c }),
306
- i != null && /* @__PURE__ */ n("span", { className: "facto-list-row__description", children: i })
301
+ const tt = (...t) => t.filter(Boolean).join(" "), Ee = dt(function(n, a) {
302
+ const { leading: o, title: r, description: i, value: c, status: l, trailing: s, className: h } = n, f = /* @__PURE__ */ u(et, { children: [
303
+ o != null && /* @__PURE__ */ e("span", { className: "facto-list-row__leading", children: o }),
304
+ /* @__PURE__ */ u("span", { className: "facto-list-row__copy", children: [
305
+ /* @__PURE__ */ e("span", { className: "facto-list-row__title", children: r }),
306
+ i != null && /* @__PURE__ */ e("span", { className: "facto-list-row__description", children: i })
307
307
  ] }),
308
- (r != null || u != null) && /* @__PURE__ */ _("span", { className: "facto-list-row__meta", children: [
309
- r != null && /* @__PURE__ */ n("span", { className: "facto-list-row__value", children: r }),
310
- u != null && /* @__PURE__ */ n("span", { className: "facto-list-row__status", children: u })
308
+ (c != null || l != null) && /* @__PURE__ */ u("span", { className: "facto-list-row__meta", children: [
309
+ c != null && /* @__PURE__ */ e("span", { className: "facto-list-row__value", children: c }),
310
+ l != null && /* @__PURE__ */ e("span", { className: "facto-list-row__status", children: l })
311
311
  ] }),
312
- s != null && /* @__PURE__ */ n("span", { className: "facto-list-row__trailing", children: s })
313
- ] }), p = q("facto-list-row", f);
314
- if ("href" in e && typeof e.href == "string") {
315
- const { leading: g, title: N, description: k, value: R, status: W, trailing: I, className: et, ...$ } = e;
316
- return /* @__PURE__ */ n("a", { ...$, ref: o, className: p, children: m });
312
+ s != null && /* @__PURE__ */ e("span", { className: "facto-list-row__trailing", children: s })
313
+ ] }), p = tt("facto-list-row", h);
314
+ if ("href" in n && typeof n.href == "string") {
315
+ const { leading: b, title: N, description: T, value: L, status: j, trailing: P, className: O, ...M } = n;
316
+ return /* @__PURE__ */ e("a", { ...M, ref: a, className: p, children: f });
317
317
  }
318
- if ("onClick" in e && typeof e.onClick == "function") {
319
- const { leading: g, title: N, description: k, value: R, status: W, trailing: I, className: et, type: $ = "button", ...P } = e;
320
- return /* @__PURE__ */ n("button", { ...P, ref: o, type: $, className: p, children: m });
318
+ if ("onClick" in n && typeof n.onClick == "function") {
319
+ const { leading: b, title: N, description: T, value: L, status: j, trailing: P, className: O, type: M = "button", ...I } = n;
320
+ return /* @__PURE__ */ e("button", { ...I, ref: a, type: M, className: p, children: f });
321
321
  }
322
- const { leading: y, title: w, description: C, value: M, status: v, trailing: l, className: d, ...b } = e;
323
- return /* @__PURE__ */ n("div", { ...b, ref: o, className: p, children: m });
322
+ const { leading: v, title: k, description: w, value: C, status: g, trailing: d, className: m, ...y } = n;
323
+ return /* @__PURE__ */ e("div", { ...y, ref: a, className: p, children: f });
324
324
  });
325
- function ee({ heading: t, children: e, className: o, ...a }) {
326
- const c = j();
327
- return /* @__PURE__ */ _("section", { ...a, className: q("facto-list-group", o), "aria-labelledby": t ? c : a["aria-labelledby"], children: [
328
- t && /* @__PURE__ */ n("h2", { id: c, className: "facto-list-group__heading", children: t }),
329
- /* @__PURE__ */ n("div", { className: "facto-list-group__rows", children: e })
325
+ function Pe({ heading: t, children: n, className: a, ...o }) {
326
+ const r = G();
327
+ return /* @__PURE__ */ u("section", { ...o, className: tt("facto-list-group", a), "aria-labelledby": t ? r : o["aria-labelledby"], children: [
328
+ t && /* @__PURE__ */ e("h2", { id: r, className: "facto-list-group__heading", children: t }),
329
+ /* @__PURE__ */ e("div", { className: "facto-list-group__rows", children: n })
330
330
  ] });
331
331
  }
332
- function Bt({ src: t, alt: e = "", fallback: o, size: a = "md", className: c, onError: i, ...r }) {
333
- const [u, s] = H(!1);
334
- E(() => s(!1), [t]);
335
- const f = o ?? (e ? e.slice(0, 1).toUpperCase() : null);
336
- return /* @__PURE__ */ n("span", { className: q("facto-avatar", `facto-avatar--${a}`, c), children: t && !u ? /* @__PURE__ */ n("img", { ...r, src: t, alt: e, onError: (m) => {
337
- s(!0), i?.(m);
338
- } }) : /* @__PURE__ */ n("span", { className: "facto-avatar__fallback", role: e ? "img" : void 0, "aria-label": e || void 0, "aria-hidden": e ? void 0 : !0, children: f }) });
339
- }
340
- function ne({ logos: t, size: e = "md", max: o, className: a, ...c }) {
341
- const i = o === void 0 ? t : t.slice(0, o), r = t.length - i.length;
342
- return /* @__PURE__ */ _("div", { ...c, className: q("facto-logo-stack", `facto-logo-stack--${e}`, a), children: [
343
- i.map((u, s) => /* @__PURE__ */ n(Bt, { ...u, size: e }, `${u.src ?? "fallback"}-${s}`)),
344
- r > 0 && /* @__PURE__ */ _("span", { className: "facto-logo-stack__more", "aria-label": `${r} more logos`, children: [
332
+ function re({ src: t, alt: n = "", fallback: a, size: o = "md", className: r, onError: i, ...c }) {
333
+ const [l, s] = A(!1);
334
+ q(() => s(!1), [t]);
335
+ const h = a ?? (n ? n.slice(0, 1).toUpperCase() : null);
336
+ return /* @__PURE__ */ e("span", { className: tt("facto-avatar", `facto-avatar--${o}`, r), children: t && !l ? /* @__PURE__ */ e("img", { ...c, src: t, alt: n, onError: (f) => {
337
+ s(!0), i?.(f);
338
+ } }) : /* @__PURE__ */ e("span", { className: "facto-avatar__fallback", role: n ? "img" : void 0, "aria-label": n || void 0, "aria-hidden": n ? void 0 : !0, children: h }) });
339
+ }
340
+ function De({ logos: t, size: n = "md", max: a, className: o, ...r }) {
341
+ const i = a === void 0 ? t : t.slice(0, a), c = t.length - i.length;
342
+ return /* @__PURE__ */ u("div", { ...r, className: tt("facto-logo-stack", `facto-logo-stack--${n}`, o), children: [
343
+ i.map((l, s) => /* @__PURE__ */ e(re, { ...l, size: n }, `${l.src ?? "fallback"}-${s}`)),
344
+ c > 0 && /* @__PURE__ */ u("span", { className: "facto-logo-stack__more", "aria-label": `${c} more logos`, children: [
345
345
  "+",
346
- r
346
+ c
347
347
  ] })
348
348
  ] });
349
349
  }
350
- function oe({ title: t, description: e, retryLabel: o = "Try again", onRetry: a, className: c, ...i }) {
351
- return /* @__PURE__ */ _("div", { ...i, className: q("facto-error-state", c), role: "alert", children: [
352
- /* @__PURE__ */ n("strong", { children: t }),
353
- e && /* @__PURE__ */ n("p", { children: e }),
354
- a && /* @__PURE__ */ n("button", { type: "button", className: "facto-error-state__retry", onClick: a, children: o })
350
+ function Ae({ title: t, description: n, retryLabel: a = "Try again", onRetry: o, className: r, ...i }) {
351
+ return /* @__PURE__ */ u("div", { ...i, className: tt("facto-error-state", r), role: "alert", children: [
352
+ /* @__PURE__ */ e("strong", { children: t }),
353
+ n && /* @__PURE__ */ e("p", { children: n }),
354
+ o && /* @__PURE__ */ e("button", { type: "button", className: "facto-error-state__retry", onClick: o, children: a })
355
355
  ] });
356
356
  }
357
- function ae({ label: t = "Loading more", className: e, ...o }) {
358
- return /* @__PURE__ */ _("div", { ...o, className: q("facto-loading-more", e), role: "status", "aria-live": "polite", children: [
359
- /* @__PURE__ */ n("span", { className: "facto-loading-more__spinner", "aria-hidden": "true" }),
360
- /* @__PURE__ */ n("span", { children: t })
357
+ function ze({ label: t = "Loading more", className: n, ...a }) {
358
+ return /* @__PURE__ */ u("div", { ...a, className: tt("facto-loading-more", n), role: "status", "aria-live": "polite", children: [
359
+ /* @__PURE__ */ e("span", { className: "facto-loading-more__spinner", "aria-hidden": "true" }),
360
+ /* @__PURE__ */ e("span", { children: t })
361
361
  ] });
362
362
  }
363
- function re({ steps: t, className: e, ...o }) {
364
- return /* @__PURE__ */ n("ol", { ...o, className: q("facto-step-checklist", e), children: t.map((a, c) => {
365
- const i = a.state ?? "upcoming";
366
- return /* @__PURE__ */ _("li", { className: `facto-step-checklist__item facto-step-checklist__item--${i}`, "aria-current": i === "current" ? "step" : void 0, children: [
367
- /* @__PURE__ */ n("span", { className: "facto-step-checklist__marker", "aria-hidden": "true", children: i === "complete" ? "✓" : c + 1 }),
368
- /* @__PURE__ */ _("span", { className: "facto-step-checklist__copy", children: [
369
- /* @__PURE__ */ _("span", { children: [
370
- a.label,
371
- i === "complete" && /* @__PURE__ */ n("span", { className: "facto-visually-hidden", children: ", completed" })
363
+ function Fe({ steps: t, className: n, ...a }) {
364
+ return /* @__PURE__ */ e("ol", { ...a, className: tt("facto-step-checklist", n), children: t.map((o, r) => {
365
+ const i = o.state ?? "upcoming";
366
+ return /* @__PURE__ */ u("li", { className: `facto-step-checklist__item facto-step-checklist__item--${i}`, "aria-current": i === "current" ? "step" : void 0, children: [
367
+ /* @__PURE__ */ e("span", { className: "facto-step-checklist__marker", "aria-hidden": "true", children: i === "complete" ? "✓" : r + 1 }),
368
+ /* @__PURE__ */ u("span", { className: "facto-step-checklist__copy", children: [
369
+ /* @__PURE__ */ u("span", { children: [
370
+ o.label,
371
+ i === "complete" && /* @__PURE__ */ e("span", { className: "facto-visually-hidden", children: ", completed" })
372
372
  ] }),
373
- a.description != null && /* @__PURE__ */ n("small", { children: a.description })
373
+ o.description != null && /* @__PURE__ */ e("small", { children: o.description })
374
374
  ] })
375
- ] }, c);
375
+ ] }, r);
376
376
  }) });
377
377
  }
378
- const U = (...t) => t.filter(Boolean).join(" "), It = (...t) => t.filter(Boolean).join(" ") || void 0;
379
- function ie({
378
+ const nt = (...t) => t.filter(Boolean).join(" "), ie = (...t) => t.filter(Boolean).join(" ") || void 0;
379
+ function je({
380
380
  label: t,
381
- leading: e,
382
- trailing: o,
383
- children: a,
384
- invalid: c,
381
+ leading: n,
382
+ trailing: a,
383
+ children: o,
384
+ invalid: r,
385
385
  inputId: i,
386
- className: r,
387
- ...u
386
+ className: c,
387
+ ...l
388
388
  }) {
389
- return /* @__PURE__ */ _(
389
+ return /* @__PURE__ */ u(
390
390
  "div",
391
391
  {
392
- ...u,
393
- className: U("facto-inset-field", c && "facto-inset-field--invalid", r),
392
+ ...l,
393
+ className: nt("facto-inset-field", r && "facto-inset-field--invalid", c),
394
394
  children: [
395
- t && /* @__PURE__ */ n("label", { className: "facto-inset-field__label", htmlFor: i, children: t }),
396
- /* @__PURE__ */ _("span", { className: "facto-inset-field__control", children: [
397
- e && /* @__PURE__ */ n("span", { className: "facto-inset-field__slot facto-inset-field__slot--leading", children: e }),
398
- kt.map(a, (s) => Ct(s) && typeof s.type == "string" && ["input", "textarea", "select"].includes(s.type) ? Tt(s, { id: i, "aria-invalid": c || s.props["aria-invalid"] }) : s),
399
- o && /* @__PURE__ */ n("span", { className: "facto-inset-field__slot facto-inset-field__slot--trailing", children: o })
395
+ t && /* @__PURE__ */ e("label", { className: "facto-inset-field__label", htmlFor: i, children: t }),
396
+ /* @__PURE__ */ u("span", { className: "facto-inset-field__control", children: [
397
+ n && /* @__PURE__ */ e("span", { className: "facto-inset-field__slot facto-inset-field__slot--leading", children: n }),
398
+ Qt.map(o, (s) => Xt(s) && typeof s.type == "string" && ["input", "textarea", "select"].includes(s.type) ? Zt(s, { id: i, "aria-invalid": r || s.props["aria-invalid"] }) : s),
399
+ a && /* @__PURE__ */ e("span", { className: "facto-inset-field__slot facto-inset-field__slot--trailing", children: a })
400
400
  ] })
401
401
  ]
402
402
  }
403
403
  );
404
404
  }
405
- const ft = (t, e) => t.replace(/\D/g, "").slice(0, e);
406
- function ce({
405
+ const mt = (t, n, a = !1) => (a ? t.replace(/[^a-z0-9]/gi, "").toUpperCase() : t.replace(/\D/g, "")).slice(0, n);
406
+ function pt({
407
407
  value: t,
408
- onValueChange: e,
409
- length: o = 6,
410
- onComplete: a,
411
- completionDelay: c = 300,
412
- pending: i,
413
- pendingLabel: r = "Verifying code…",
414
- label: u,
415
- helperText: s,
416
- error: f,
417
- id: m,
418
- className: p,
419
- containerClassName: y,
420
- disabled: w,
421
- readOnly: C,
422
- onPaste: M,
423
- onFocus: v,
424
- onBlur: l,
425
- ...d
408
+ onValueChange: n,
409
+ length: a = 6,
410
+ split: o = !1,
411
+ alphanumeric: r = !1,
412
+ verified: i = !1,
413
+ onComplete: c,
414
+ completionDelay: l = 300,
415
+ pending: s,
416
+ pendingLabel: h = "Verifying code…",
417
+ label: f,
418
+ helperText: p,
419
+ error: v,
420
+ id: k,
421
+ className: w,
422
+ containerClassName: C,
423
+ disabled: g,
424
+ readOnly: d,
425
+ onPaste: m,
426
+ onFocus: y,
427
+ onBlur: b,
428
+ onSelect: N,
429
+ onClick: T,
430
+ ...L
426
431
  }) {
427
- const b = j(), g = m ?? b, N = f || s ? `${g}-description` : void 0, k = Number.isFinite(o) ? Math.min(32, Math.max(1, Math.floor(o))) : 6, R = ft(t, k), W = T(void 0), I = T(a);
428
- E(() => {
429
- I.current = a;
430
- }, [a]), E(() => {
431
- if (w || C || i) return;
432
- if (R.length !== k) {
433
- W.current = void 0;
432
+ const j = G(), P = k ?? j, O = v || p ? `${P}-description` : void 0, M = Number.isFinite(a) ? Math.min(32, Math.max(1, Math.floor(a))) : 6, I = mt(t, M, r), [B, R] = A({ start: 0, end: 0 }), E = x(void 0), rt = x(c);
433
+ q(() => {
434
+ rt.current = c;
435
+ }, [c]), q(() => {
436
+ if (g || d || s) return;
437
+ if (I.length !== M) {
438
+ E.current = void 0;
434
439
  return;
435
440
  }
436
- if (W.current === R) return;
437
- const $ = window.setTimeout(() => {
438
- W.current = R, I.current?.(R);
439
- }, Math.max(0, c));
440
- return () => window.clearTimeout($);
441
- }, [c, w, k, R, i, C]);
442
- const et = ($) => {
443
- if (w || C || i) return;
444
- const P = ft($, k);
445
- P !== R && e(P);
441
+ if (E.current === I) return;
442
+ const S = window.setTimeout(() => {
443
+ E.current = I, rt.current?.(I);
444
+ }, Math.max(0, l));
445
+ return () => window.clearTimeout(S);
446
+ }, [l, g, M, I, s, d]);
447
+ const Ct = (S) => {
448
+ if (g || d || s) return;
449
+ const $ = mt(S, M, r);
450
+ $ !== I && n($);
451
+ }, Tt = o && M === 6 ? 2 : o && M === 8 ? 3 : -1, jt = M >= 8 ? 42 : M <= 4 ? 56 : 54, Nt = M >= 8 ? 6 : 8, Ot = Tt >= 0 ? Nt + 6 : 0, Wt = M * jt + (M - 1) * Nt + Ot, Vt = M >= 8 ? 19 : 22, Ht = Math.min(B.start, I.length, M - 1), qt = {
452
+ "--facto-otp-max-width": `${Wt}px`,
453
+ "--facto-otp-gap": `${Nt}px`,
454
+ "--facto-otp-font-size": `${Vt}px`
446
455
  };
447
- return /* @__PURE__ */ _("div", { className: U("facto-otp", y), children: [
448
- u && /* @__PURE__ */ n("label", { className: "facto-otp__label", htmlFor: g, children: u }),
449
- /* @__PURE__ */ _(
456
+ return /* @__PURE__ */ u("div", { className: nt("facto-otp", C), children: [
457
+ f && /* @__PURE__ */ e("label", { className: "facto-otp__label", htmlFor: P, children: f }),
458
+ /* @__PURE__ */ u(
450
459
  "div",
451
460
  {
452
- className: U("facto-otp__cells", !!f && "facto-otp__cells--error", p),
453
- "data-disabled": w ? "" : void 0,
454
- "data-pending": i ? "" : void 0,
461
+ className: nt(
462
+ "facto-otp__cells",
463
+ !!v && "facto-otp__cells--error",
464
+ i && !v && "facto-otp__cells--verified",
465
+ w
466
+ ),
467
+ style: qt,
468
+ "data-disabled": g ? "" : void 0,
469
+ "data-pending": s ? "" : void 0,
455
470
  children: [
456
- /* @__PURE__ */ n(
471
+ /* @__PURE__ */ e(
457
472
  "input",
458
473
  {
459
- ...d,
460
- id: g,
474
+ ...L,
475
+ id: P,
461
476
  className: "facto-otp__input",
462
477
  type: "text",
463
- inputMode: "numeric",
478
+ inputMode: r ? "text" : "numeric",
464
479
  autoComplete: "one-time-code",
465
- pattern: "[0-9]*",
466
- maxLength: k,
467
- disabled: w || i,
468
- readOnly: C,
469
- value: R,
470
- "aria-invalid": !!f || d["aria-invalid"],
471
- "aria-busy": i || void 0,
472
- "aria-describedby": It(d["aria-describedby"], N, i ? `${g}-pending` : void 0),
473
- "aria-errormessage": f ? N : void 0,
474
- onChange: ($) => et($.currentTarget.value),
475
- onPaste: ($) => {
476
- M?.($), !$.defaultPrevented && ($.preventDefault(), et($.clipboardData.getData("text")));
480
+ autoCapitalize: r ? "characters" : "off",
481
+ spellCheck: !1,
482
+ pattern: r ? "[A-Za-z0-9]*" : "[0-9]*",
483
+ maxLength: M,
484
+ disabled: g || s,
485
+ readOnly: d,
486
+ value: I,
487
+ "aria-invalid": !!v || L["aria-invalid"],
488
+ "aria-busy": s || void 0,
489
+ "aria-describedby": ie(L["aria-describedby"], O, s ? `${P}-pending` : void 0),
490
+ "aria-errormessage": v ? O : void 0,
491
+ onChange: (S) => {
492
+ const $ = S.currentTarget.selectionStart ?? S.currentTarget.value.length, Q = mt(S.currentTarget.value.slice(0, $), M, r).length;
493
+ R({ start: Q, end: Q }), Ct(S.currentTarget.value);
494
+ },
495
+ onSelect: (S) => {
496
+ R({
497
+ start: S.currentTarget.selectionStart ?? 0,
498
+ end: S.currentTarget.selectionEnd ?? 0
499
+ }), N?.(S);
500
+ },
501
+ onClick: (S) => {
502
+ T?.(S);
503
+ const $ = S.currentTarget;
504
+ if (S.detail !== 1 || S.shiftKey || $.selectionStart !== $.selectionEnd) return;
505
+ const Q = $.parentElement?.querySelectorAll(".facto-otp__cell");
506
+ if (!Q || Q.length === 0) return;
507
+ let K = -1;
508
+ if (Q.forEach((Ut, Gt) => {
509
+ const xt = Ut.getBoundingClientRect();
510
+ S.clientX >= xt.left && S.clientX <= xt.right && (K = Gt);
511
+ }), K >= 0 && K < I.length) {
512
+ $.setSelectionRange(K, K + 1), R({ start: K, end: K + 1 });
513
+ return;
514
+ }
515
+ const ft = I.length;
516
+ $.setSelectionRange(ft, ft), R({ start: ft, end: ft });
517
+ },
518
+ onPaste: (S) => {
519
+ if (m?.(S), S.defaultPrevented) return;
520
+ S.preventDefault();
521
+ const $ = mt(S.clipboardData.getData("text"), M, r);
522
+ R({ start: $.length, end: $.length }), Ct($);
477
523
  },
478
- onFocus: v,
479
- onBlur: l
524
+ onFocus: (S) => {
525
+ R({
526
+ start: S.currentTarget.selectionStart ?? I.length,
527
+ end: S.currentTarget.selectionEnd ?? I.length
528
+ }), y?.(S);
529
+ },
530
+ onBlur: b
480
531
  }
481
532
  ),
482
- /* @__PURE__ */ n("span", { className: "facto-otp__visual", style: { gridTemplateColumns: `repeat(${Math.min(k, 8)}, minmax(0, 1fr))` }, "aria-hidden": "true", children: Array.from({ length: k }, ($, P) => /* @__PURE__ */ n("span", { className: "facto-otp__cell", children: R[P] && /* @__PURE__ */ n("span", { className: "facto-otp__digit", children: R[P] }, `${P}-${R[P]}`) }, P)) })
533
+ /* @__PURE__ */ e("span", { className: "facto-otp__visual", "aria-hidden": "true", children: Array.from({ length: M }, (S, $) => {
534
+ const Q = B.end > B.start && $ >= B.start && $ < B.end, K = $ === Ht && B.start === B.end;
535
+ return /* @__PURE__ */ u(Jt, { children: [
536
+ /* @__PURE__ */ e(
537
+ "span",
538
+ {
539
+ className: nt(
540
+ "facto-otp__cell",
541
+ !!I[$] && "facto-otp__cell--filled",
542
+ K && "facto-otp__cell--active",
543
+ Q && "facto-otp__cell--selected"
544
+ ),
545
+ style: { "--facto-otp-index": $ },
546
+ children: I[$] ? /* @__PURE__ */ e("span", { className: "facto-otp__digit", children: I[$] }, `${$}-${I[$]}`) : null
547
+ }
548
+ ),
549
+ $ === Tt ? /* @__PURE__ */ e("span", { className: "facto-otp__sep" }) : null
550
+ ] }, $);
551
+ }) })
483
552
  ]
484
553
  }
485
554
  ),
486
- (f || s) && /* @__PURE__ */ n(
555
+ (v || p) && /* @__PURE__ */ e(
487
556
  "span",
488
557
  {
489
- id: N,
490
- className: U("facto-otp__message", !!f && "facto-otp__message--error"),
491
- role: f ? "alert" : void 0,
492
- children: f ?? s
558
+ id: O,
559
+ className: nt("facto-otp__message", !!v && "facto-otp__message--error"),
560
+ role: v ? "alert" : void 0,
561
+ children: v ?? p
493
562
  }
494
563
  ),
495
- i && /* @__PURE__ */ n("span", { className: "facto-otp__pending", id: `${g}-pending`, role: "status", children: r })
564
+ s && /* @__PURE__ */ e("span", { className: "facto-otp__pending", id: `${P}-pending`, role: "status", children: h })
496
565
  ] });
497
566
  }
498
- const ct = (t) => t instanceof Date ? t.getTime() : t ?? 0, Pt = (t, e) => Math.max(0, Math.ceil((ct(t) - e) / 1e3)), Lt = (t) => `Resend code in ${Math.floor(t / 60)}:${String(t % 60).padStart(2, "0")}`;
499
- function se({
567
+ const kt = (t) => t instanceof Date ? t.getTime() : t ?? 0, se = (t, n) => Math.max(0, Math.ceil((kt(t) - n) / 1e3)), le = (t) => `Resend code in ${Math.floor(t / 60)}:${String(t % 60).padStart(2, "0")}`;
568
+ function Dt({
500
569
  deadline: t,
501
- pending: e,
502
- disabled: o,
503
- children: a = "Resend code",
504
- formatCountdown: c = Lt,
570
+ pending: n,
571
+ disabled: a,
572
+ children: o = "Resend code",
573
+ formatCountdown: r = le,
505
574
  className: i,
506
- onClick: r,
507
- ...u
575
+ onClick: c,
576
+ ...l
508
577
  }) {
509
- const [s, f] = H(null), m = s === null ? 0 : Pt(t, s);
510
- E(() => {
511
- let y;
512
- const w = () => {
513
- const C = Date.now();
514
- f(C);
515
- const M = ct(t) - C;
516
- Number.isFinite(M) && M > 0 && (y = window.setTimeout(w, Math.min(M, 250)));
578
+ const [s, h] = A(null), f = s === null ? 0 : se(t, s);
579
+ q(() => {
580
+ let v;
581
+ const k = () => {
582
+ const w = Date.now();
583
+ h(w);
584
+ const C = kt(t) - w;
585
+ Number.isFinite(C) && C > 0 && (v = window.setTimeout(k, Math.min(C, 250)));
517
586
  };
518
- return w(), () => window.clearTimeout(y);
587
+ return k(), () => window.clearTimeout(v);
519
588
  }, [t]);
520
- const p = s === null ? ct(t) > 0 : m > 0;
521
- return /* @__PURE__ */ _(
589
+ const p = s === null ? kt(t) > 0 : f > 0;
590
+ return /* @__PURE__ */ u(
522
591
  "button",
523
592
  {
524
- ...u,
593
+ ...l,
525
594
  type: "button",
526
- className: U("facto-resend-code", e && "facto-resend-code--pending", i),
527
- disabled: !!(o || e || p),
528
- "aria-busy": e || void 0,
529
- onClick: r,
595
+ className: nt("facto-resend-code", n && "facto-resend-code--pending", i),
596
+ disabled: !!(a || n || p),
597
+ "aria-busy": n || void 0,
598
+ onClick: c,
530
599
  children: [
531
- e && /* @__PURE__ */ n("span", { className: "facto-resend-code__spinner", "aria-hidden": "true" }),
532
- p && s !== null ? c(m) : a
600
+ n && /* @__PURE__ */ e("span", { className: "facto-resend-code__spinner", "aria-hidden": "true" }),
601
+ p && s !== null ? r(f) : o
533
602
  ]
534
603
  }
535
604
  );
536
605
  }
537
- const _t = st(null);
538
- function le({
606
+ const At = wt(null);
607
+ function Oe({
539
608
  children: t,
540
- duration: e,
541
- maxVisible: o = 3,
542
- label: a = "Notifications ({hotkey})"
609
+ duration: n,
610
+ maxVisible: a = 3,
611
+ label: o = "Notifications ({hotkey})"
543
612
  }) {
544
- const [c, i] = H([]), r = T([]), u = T(0), s = T(0), f = Number.isFinite(o) ? Math.max(1, Math.floor(o)) : 3, m = e ?? 2600, p = z((l) => {
545
- r.current = l, i(l);
613
+ const [r, i] = A([]), c = x([]), l = x(0), s = x(0), h = Number.isFinite(a) ? Math.max(1, Math.floor(a)) : 3, f = n ?? 2600, p = X((d) => {
614
+ c.current = d, i(d);
546
615
  }, []);
547
- E(() => {
548
- p(r.current.slice(-f));
549
- }, [p, f]);
550
- const y = z((l, d, b = {}) => {
551
- const g = b.id ?? `toast-${++u.current}`, N = ++s.current, k = {
552
- id: g,
553
- tone: l,
554
- title: d,
555
- description: b.description,
556
- action: b.action,
557
- duration: l === "loading" ? b.duration ?? 1 / 0 : b.duration,
616
+ q(() => {
617
+ p(c.current.slice(-h));
618
+ }, [p, h]);
619
+ const v = X((d, m, y = {}) => {
620
+ const b = y.id ?? `toast-${++l.current}`, N = ++s.current, T = {
621
+ id: b,
622
+ tone: d,
623
+ title: m,
624
+ description: y.description,
625
+ action: y.action,
626
+ duration: d === "loading" ? y.duration ?? 1 / 0 : y.duration,
558
627
  generation: N
559
- }, R = r.current, W = R.findIndex((I) => I.id === g);
560
- return p(W >= 0 ? R.map((I) => I.id === g ? { ...I, ...k } : I) : [...R, k].slice(-f)), { id: g, generation: N };
561
- }, [p, f]), w = z((l, d, b) => {
562
- const g = r.current, N = g.findIndex((R) => R.id === l);
563
- if (N < 0 || b !== void 0 && g[N].generation !== b) return !1;
564
- const k = ++s.current;
565
- p(g.map((R) => R.id !== l ? R : {
566
- ...R,
567
- ...d.title === void 0 ? {} : { title: d.title },
568
- ...d.tone === void 0 ? {} : { tone: d.tone },
569
- ...d.description === void 0 ? {} : { description: d.description },
570
- ...d.action === void 0 ? {} : { action: d.action },
571
- duration: d.duration ?? (R.tone === "loading" && (d.tone ?? R.tone) !== "loading" ? m : (d.tone ?? R.tone) === "loading" ? 1 / 0 : R.duration),
572
- generation: k
628
+ }, L = c.current, j = L.findIndex((P) => P.id === b);
629
+ return p(j >= 0 ? L.map((P) => P.id === b ? { ...P, ...T } : P) : [...L, T].slice(-h)), { id: b, generation: N };
630
+ }, [p, h]), k = X((d, m, y) => {
631
+ const b = c.current, N = b.findIndex((L) => L.id === d);
632
+ if (N < 0 || y !== void 0 && b[N].generation !== y) return !1;
633
+ const T = ++s.current;
634
+ p(b.map((L) => L.id !== d ? L : {
635
+ ...L,
636
+ ...m.title === void 0 ? {} : { title: m.title },
637
+ ...m.tone === void 0 ? {} : { tone: m.tone },
638
+ ...m.description === void 0 ? {} : { description: m.description },
639
+ ...m.action === void 0 ? {} : { action: m.action },
640
+ duration: m.duration ?? (L.tone === "loading" && (m.tone ?? L.tone) !== "loading" ? f : (m.tone ?? L.tone) === "loading" ? 1 / 0 : L.duration),
641
+ generation: T
573
642
  }));
574
- }, [p, m]), C = z((l, d) => (w(l, d), l), [w]), M = z((l, d) => {
575
- const b = r.current, g = l === void 0 ? void 0 : b.find((N) => N.id === l);
576
- l !== void 0 && (!g || d !== void 0 && g.generation !== d) || p(l === void 0 ? [] : b.filter((N) => N.id !== l));
577
- }, [p]), v = Mt(() => ({
578
- success: (l, d) => y("success", l, d).id,
579
- error: (l, d) => y("error", l, d).id,
580
- warning: (l, d) => y("warning", l, d).id,
581
- info: (l, d) => y("info", l, d).id,
582
- loading: (l, d) => y("loading", l, d).id,
583
- update: C,
584
- dismiss: M,
585
- promise: (l, d, b) => {
586
- const g = y("loading", d.loading, b);
587
- return Promise.resolve(l).then(
588
- (N) => (w(g.id, {
589
- title: typeof d.success == "function" ? d.success(N) : d.success,
643
+ }, [p, f]), w = X((d, m) => (k(d, m), d), [k]), C = X((d, m) => {
644
+ const y = c.current, b = d === void 0 ? void 0 : y.find((N) => N.id === d);
645
+ d !== void 0 && (!b || m !== void 0 && b.generation !== m) || p(d === void 0 ? [] : y.filter((N) => N.id !== d));
646
+ }, [p]), g = te(() => ({
647
+ success: (d, m) => v("success", d, m).id,
648
+ error: (d, m) => v("error", d, m).id,
649
+ warning: (d, m) => v("warning", d, m).id,
650
+ info: (d, m) => v("info", d, m).id,
651
+ loading: (d, m) => v("loading", d, m).id,
652
+ update: w,
653
+ dismiss: C,
654
+ promise: (d, m, y) => {
655
+ const b = v("loading", m.loading, y);
656
+ return Promise.resolve(d).then(
657
+ (N) => (k(b.id, {
658
+ title: typeof m.success == "function" ? m.success(N) : m.success,
590
659
  tone: "success",
591
- duration: b?.duration ?? m
592
- }, g.generation), N),
660
+ duration: y?.duration ?? f
661
+ }, b.generation), N),
593
662
  (N) => {
594
- throw w(g.id, {
595
- title: typeof d.error == "function" ? d.error(N) : d.error,
663
+ throw k(b.id, {
664
+ title: typeof m.error == "function" ? m.error(N) : m.error,
596
665
  tone: "error",
597
- duration: b?.duration ?? m
598
- }, g.generation), N;
666
+ duration: y?.duration ?? f
667
+ }, b.generation), N;
599
668
  }
600
669
  );
601
670
  }
602
- }), [y, m, M, C, w]);
603
- return /* @__PURE__ */ n(_t.Provider, { value: v, children: /* @__PURE__ */ _(zt, { duration: e, children: [
671
+ }), [v, f, C, w, k]);
672
+ return /* @__PURE__ */ e(At.Provider, { value: g, children: /* @__PURE__ */ u(ye, { duration: n, children: [
604
673
  t,
605
- c.map((l) => /* @__PURE__ */ _(
606
- Ot,
674
+ r.map((d) => /* @__PURE__ */ u(
675
+ Ne,
607
676
  {
608
- duration: l.duration,
609
- icon: l.tone === "loading" ? /* @__PURE__ */ n("span", { className: "facto-notification-spinner" }) : void 0,
610
- tone: l.tone === "error" ? "danger" : l.tone === "loading" ? "info" : l.tone,
611
- type: l.tone === "error" ? "foreground" : "background",
677
+ duration: d.duration,
678
+ icon: d.tone === "loading" ? /* @__PURE__ */ e("span", { className: "facto-notification-spinner" }) : void 0,
679
+ tone: d.tone === "error" ? "danger" : d.tone === "loading" ? "info" : d.tone,
680
+ type: d.tone === "error" ? "foreground" : "background",
612
681
  open: !0,
613
- onOpenChange: (d) => {
614
- d || M(l.id, l.generation);
682
+ onOpenChange: (m) => {
683
+ m || C(d.id, d.generation);
615
684
  },
616
685
  children: [
617
- /* @__PURE__ */ n(Ht, { children: l.title }),
618
- l.tone === "loading" && /* @__PURE__ */ n(ht, { children: /* @__PURE__ */ n("span", { role: "status", children: "Loading" }) }),
619
- l.description != null && /* @__PURE__ */ n(ht, { children: l.description }),
620
- l.action && /* @__PURE__ */ n(jt, { altText: l.action.altText, onClick: l.action.onClick, children: l.action.label }),
621
- /* @__PURE__ */ n(Wt, {})
686
+ /* @__PURE__ */ e(ke, { children: d.title }),
687
+ d.tone === "loading" && /* @__PURE__ */ e(Lt, { children: /* @__PURE__ */ e("span", { role: "status", children: "Loading" }) }),
688
+ d.description != null && /* @__PURE__ */ e(Lt, { children: d.description }),
689
+ d.action && /* @__PURE__ */ e(we, { altText: d.action.altText, onClick: d.action.onClick, children: d.action.label }),
690
+ /* @__PURE__ */ e(Ce, {})
622
691
  ]
623
692
  },
624
- `${l.id}-${l.generation}`
693
+ `${d.id}-${d.generation}`
625
694
  )),
626
- /* @__PURE__ */ n(Vt, { label: a })
695
+ /* @__PURE__ */ e(Te, { label: o })
627
696
  ] }) });
628
697
  }
629
- function de() {
630
- const t = B(_t);
698
+ function We() {
699
+ const t = W(At);
631
700
  if (!t) throw new Error("useToast must be used within a NotificationsProvider");
632
701
  return t;
633
702
  }
634
- const h = (...t) => t.filter(Boolean).join(" "), G = (...t) => t.filter(Boolean).join(" ") || void 0, F = st({}), Dt = (t) => Object.fromEntries(
635
- Object.entries(t ?? {}).filter(([e, o]) => e.startsWith("--facto-") && o !== void 0 && o !== null)
703
+ const D = (...t) => t.filter(Boolean).join(" "), de = () => /* @__PURE__ */ u("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", focusable: "false", children: [
704
+ /* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2.5" }),
705
+ /* @__PURE__ */ e("path", { d: "M3.5 7l8.5 6 8.5-6" })
706
+ ] }), lt = ({ size: t = 16, className: n }) => /* @__PURE__ */ e("svg", { className: n, width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ e("path", { d: "M5 13l4 4L19 7" }) }), zt = () => /* @__PURE__ */ u("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", focusable: "false", children: [
707
+ /* @__PURE__ */ e("rect", { x: "9", y: "9", width: "11", height: "11", rx: "2" }),
708
+ /* @__PURE__ */ e("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
709
+ ] }), ue = () => /* @__PURE__ */ e("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ e("path", { d: "M12 3v12m0 0l-4-4m4 4l4-4M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2" }) }), fe = () => /* @__PURE__ */ u("svg", { width: "64", height: "64", viewBox: "0 0 64 64", fill: "none", "aria-hidden": "true", focusable: "false", children: [
710
+ /* @__PURE__ */ e("rect", { x: "8", y: "8", width: "48", height: "48", rx: "16", fill: "var(--facto-accent-soft)", stroke: "var(--facto-notice-success-border)" }),
711
+ /* @__PURE__ */ e("path", { d: "M24 29v-4a8 8 0 1 1 16 0v4", stroke: "var(--facto-accent-strong)", strokeWidth: "2.4", strokeLinecap: "round" }),
712
+ /* @__PURE__ */ e("rect", { x: "20", y: "29", width: "24", height: "18", rx: "5", fill: "var(--facto-surface)", stroke: "var(--facto-accent-strong)", strokeWidth: "2.2" }),
713
+ /* @__PURE__ */ e("circle", { cx: "32", cy: "37", r: "2.2", fill: "var(--facto-accent-strong)" }),
714
+ /* @__PURE__ */ e("path", { d: "M32 39.2V42", stroke: "var(--facto-accent-strong)", strokeWidth: "2.2", strokeLinecap: "round" })
715
+ ] });
716
+ function Ve({
717
+ surface: t = "page",
718
+ wide: n = !1,
719
+ stepKey: a,
720
+ motion: o,
721
+ brand: r,
722
+ badge: i,
723
+ children: c,
724
+ className: l,
725
+ ...s
726
+ }) {
727
+ const h = a !== void 0 ? /* @__PURE__ */ e(oe, { stepKey: a, motion: o, children: c }) : c;
728
+ return t === "plain" ? /* @__PURE__ */ e("div", { ...s, className: D("facto-auth-shell", "facto-auth-shell--plain", l), children: /* @__PURE__ */ e("div", { className: D("facto-auth-shell__column", n && "facto-auth-shell__column--wide"), children: h }) }) : /* @__PURE__ */ u("div", { ...s, className: D("facto-auth-shell", "facto-auth-shell--page", l), children: [
729
+ (r || i) && /* @__PURE__ */ u("header", { className: "facto-auth-shell__header", children: [
730
+ /* @__PURE__ */ e("div", { children: r }),
731
+ /* @__PURE__ */ e("div", { children: i })
732
+ ] }),
733
+ /* @__PURE__ */ e("div", { className: "facto-auth-shell__body", children: /* @__PURE__ */ e("div", { className: D("facto-auth-shell__column", n && "facto-auth-shell__column--wide"), children: h }) })
734
+ ] });
735
+ }
736
+ function yt({
737
+ current: t,
738
+ total: n,
739
+ label: a,
740
+ className: o,
741
+ ...r
742
+ }) {
743
+ const i = Math.max(1, Math.floor(n)), c = Math.min(i, Math.max(1, Math.floor(t))), l = a ?? `Step ${c} of ${i}`;
744
+ return /* @__PURE__ */ u(
745
+ "div",
746
+ {
747
+ ...r,
748
+ className: D("facto-step-progress", o),
749
+ role: "progressbar",
750
+ "aria-valuenow": c,
751
+ "aria-valuemin": 1,
752
+ "aria-valuemax": i,
753
+ "aria-label": typeof l == "string" ? l : `Step ${c} of ${i}`,
754
+ children: [
755
+ /* @__PURE__ */ e("div", { className: "facto-step-progress__bars", "aria-hidden": "true", children: Array.from({ length: i }, (s, h) => {
756
+ const f = h + 1;
757
+ return /* @__PURE__ */ e(
758
+ "span",
759
+ {
760
+ className: D(
761
+ "facto-step-progress__bar",
762
+ f < c && "facto-step-progress__bar--done",
763
+ f === c && "facto-step-progress__bar--active"
764
+ )
765
+ },
766
+ f
767
+ );
768
+ }) }),
769
+ /* @__PURE__ */ e("span", { className: "facto-step-progress__label", children: l })
770
+ ]
771
+ }
772
+ );
773
+ }
774
+ function he({
775
+ value: t,
776
+ onEdit: n,
777
+ editLabel: a = "Edit",
778
+ className: o,
779
+ ...r
780
+ }) {
781
+ return /* @__PURE__ */ u("div", { ...r, className: D("facto-identity-pill", o), children: [
782
+ /* @__PURE__ */ e("span", { className: "facto-identity-pill__value", children: t }),
783
+ n && /* @__PURE__ */ e(
784
+ "button",
785
+ {
786
+ type: "button",
787
+ className: "facto-auth-link-btn facto-auth-link-btn--accent",
788
+ style: { minHeight: 28, padding: "2px 4px" },
789
+ onClick: n,
790
+ children: a
791
+ }
792
+ )
793
+ ] });
794
+ }
795
+ function me({
796
+ value: t,
797
+ displayValue: n,
798
+ copyLabel: a = "Copy",
799
+ copiedLabel: o = "Copied",
800
+ onCopy: r,
801
+ className: i,
802
+ ariaLabel: c = "Copy setup key"
803
+ }) {
804
+ const [l, s] = A(!1), h = () => {
805
+ typeof navigator < "u" && navigator.clipboard?.writeText && navigator.clipboard.writeText(t).catch(() => {
806
+ }), s(!0), r?.(t), window.setTimeout(() => s(!1), 2e3);
807
+ };
808
+ return /* @__PURE__ */ u(
809
+ "button",
810
+ {
811
+ type: "button",
812
+ className: D("facto-secret-key", l && "facto-secret-key--copied", i),
813
+ "aria-label": c,
814
+ onClick: h,
815
+ children: [
816
+ /* @__PURE__ */ e("code", { className: "facto-secret-key__code", children: n ?? t }),
817
+ /* @__PURE__ */ u("span", { className: "facto-secret-key__action", children: [
818
+ l ? /* @__PURE__ */ e(lt, { size: 15, className: "facto-auth-check-pop" }) : /* @__PURE__ */ e(zt, {}),
819
+ /* @__PURE__ */ e("span", { children: l ? o : a })
820
+ ] })
821
+ ]
822
+ }
823
+ );
824
+ }
825
+ function He({
826
+ email: t,
827
+ code: n,
828
+ onCodeChange: a,
829
+ onSubmit: o,
830
+ onEmailChange: r,
831
+ onBack: i,
832
+ onResend: c,
833
+ resendDeadline: l,
834
+ resendPending: s,
835
+ step: h,
836
+ title: f = "Check your inbox",
837
+ description: p = "Enter the 6-digit code we sent to your email.",
838
+ helperText: v = "Code expires in 10 minutes",
839
+ error: k,
840
+ pending: w = !1,
841
+ verified: C = !1,
842
+ autoSubmit: g = !1,
843
+ length: d = 6,
844
+ alphanumeric: m = !1,
845
+ unreadCount: y = 1,
846
+ submitLabel: b = "Verify email",
847
+ backLabel: N = "Back",
848
+ className: T
849
+ }) {
850
+ const [L, j] = A(!1), [P, O] = A(t), M = G(), I = (R) => {
851
+ R.preventDefault(), n.length === d && !w && o?.(n);
852
+ }, B = (R) => {
853
+ R.preventDefault();
854
+ const E = P.trim();
855
+ E && (r?.(E), j(!1));
856
+ };
857
+ return /* @__PURE__ */ u("div", { className: D("facto-email-verify", T), children: [
858
+ h && /* @__PURE__ */ e(yt, { current: h.current, total: h.total, label: h.label }),
859
+ /* @__PURE__ */ u("div", { className: "facto-auth-head facto-auth-head--center", children: [
860
+ /* @__PURE__ */ u("div", { className: D("facto-mail-badge", C && "facto-mail-badge--verified"), "aria-hidden": "true", children: [
861
+ C ? /* @__PURE__ */ e(lt, { size: 22, className: "facto-auth-check-pop" }) : /* @__PURE__ */ e(de, {}),
862
+ /* @__PURE__ */ e("span", { className: "facto-mail-badge__count", children: C ? "✓" : y })
863
+ ] }),
864
+ /* @__PURE__ */ e("h1", { className: "facto-auth-head__title", children: f }),
865
+ p && /* @__PURE__ */ e("p", { className: "facto-auth-head__description", children: p })
866
+ ] }),
867
+ L && r ? /* @__PURE__ */ u("form", { className: "facto-email-verify__edit", onSubmit: B, children: [
868
+ /* @__PURE__ */ e("label", { htmlFor: M, className: "facto-visually-hidden", children: "Email address" }),
869
+ /* @__PURE__ */ e(
870
+ "input",
871
+ {
872
+ id: M,
873
+ type: "email",
874
+ className: "facto-email-verify__edit-input",
875
+ value: P,
876
+ onChange: (R) => O(R.target.value),
877
+ required: !0
878
+ }
879
+ ),
880
+ /* @__PURE__ */ u("div", { className: "facto-auth-actions-row", children: [
881
+ /* @__PURE__ */ e("button", { type: "button", className: "facto-auth-link-btn facto-auth-link-btn--muted", onClick: () => {
882
+ O(t), j(!1);
883
+ }, children: "Cancel" }),
884
+ /* @__PURE__ */ e("button", { type: "submit", className: "facto-auth-primary-btn", style: { width: "auto", minHeight: 36, padding: "6px 16px" }, children: "Save and resend" })
885
+ ] })
886
+ ] }) : /* @__PURE__ */ e(
887
+ he,
888
+ {
889
+ value: t,
890
+ onEdit: r ? () => {
891
+ O(t), j(!0);
892
+ } : void 0
893
+ }
894
+ ),
895
+ /* @__PURE__ */ u("form", { className: "facto-auth-stack", onSubmit: I, children: [
896
+ /* @__PURE__ */ e("div", { className: "facto-email-verify__otp", children: /* @__PURE__ */ e(
897
+ pt,
898
+ {
899
+ "aria-label": "Verification code",
900
+ value: n,
901
+ onValueChange: a,
902
+ onComplete: g ? o : void 0,
903
+ length: d,
904
+ split: d === 6 || d === 8,
905
+ alphanumeric: m,
906
+ pending: w,
907
+ verified: C,
908
+ error: k,
909
+ helperText: !k && !C ? v : void 0
910
+ }
911
+ ) }),
912
+ !g && /* @__PURE__ */ u(
913
+ "button",
914
+ {
915
+ type: "submit",
916
+ className: "facto-auth-primary-btn",
917
+ disabled: w || n.length < d,
918
+ "aria-busy": w || void 0,
919
+ children: [
920
+ w && /* @__PURE__ */ e("span", { className: "facto-auth-spinner", "aria-hidden": "true" }),
921
+ b
922
+ ]
923
+ }
924
+ )
925
+ ] }),
926
+ (i || c) && /* @__PURE__ */ u("div", { className: "facto-auth-actions-row", children: [
927
+ i ? /* @__PURE__ */ e("button", { type: "button", className: "facto-auth-link-btn facto-auth-link-btn--muted", onClick: i, children: N }) : /* @__PURE__ */ e("span", {}),
928
+ c ? /* @__PURE__ */ e(
929
+ Dt,
930
+ {
931
+ deadline: l,
932
+ pending: s,
933
+ onClick: c
934
+ }
935
+ ) : null
936
+ ] })
937
+ ] });
938
+ }
939
+ function qe({
940
+ step: t,
941
+ illustration: n,
942
+ title: a = "Secure your account",
943
+ description: o = "Add a passkey for faster, phishing-resistant sign-in on this device.",
944
+ capabilities: r = [
945
+ "Works with Touch ID, Face ID, or a hardware security key",
946
+ "Bound to this domain to protect against phishing links"
947
+ ],
948
+ ctaLabel: i = "Create passkey",
949
+ pendingLabel: c = "Waiting for your device…",
950
+ pending: l = !1,
951
+ verified: s = !1,
952
+ verifiedMessage: h = "Passkey registered on this device.",
953
+ error: f,
954
+ onCreatePasskey: p,
955
+ onSwitchAlternative: v,
956
+ alternativeLabel: k = "Use an authenticator app instead",
957
+ className: w
958
+ }) {
959
+ return /* @__PURE__ */ u("div", { className: D("facto-passkey-card", w), children: [
960
+ t && /* @__PURE__ */ e(yt, { current: t.current, total: t.total, label: t.label }),
961
+ /* @__PURE__ */ u("div", { className: "facto-auth-head facto-auth-head--center", children: [
962
+ /* @__PURE__ */ e(
963
+ "div",
964
+ {
965
+ className: D(
966
+ "facto-passkey-card__hero",
967
+ l && "facto-passkey-card__hero--pending",
968
+ s && !f && "facto-passkey-card__hero--verified"
969
+ ),
970
+ children: n ?? /* @__PURE__ */ e(fe, {})
971
+ }
972
+ ),
973
+ /* @__PURE__ */ e("h1", { className: "facto-auth-head__title", children: a }),
974
+ o && /* @__PURE__ */ e("p", { className: "facto-auth-head__description", children: o })
975
+ ] }),
976
+ r.length > 0 && /* @__PURE__ */ e("div", { className: "facto-passkey-card__panel", children: /* @__PURE__ */ e("ul", { className: "facto-passkey-card__list", children: r.map((C, g) => /* @__PURE__ */ u("li", { children: [
977
+ /* @__PURE__ */ e(lt, { size: 15, className: "facto-passkey-card__check" }),
978
+ /* @__PURE__ */ e("span", { children: C })
979
+ ] }, g)) }) }),
980
+ f && /* @__PURE__ */ e("div", { className: "facto-auth-alert", role: "alert", children: f }),
981
+ s && !f && /* @__PURE__ */ u("div", { className: "facto-auth-status", role: "status", children: [
982
+ /* @__PURE__ */ e(lt, { size: 15 }),
983
+ /* @__PURE__ */ e("span", { children: h })
984
+ ] }),
985
+ /* @__PURE__ */ u("div", { className: "facto-auth-stack facto-auth-stack--tight", children: [
986
+ /* @__PURE__ */ u(
987
+ "button",
988
+ {
989
+ type: "button",
990
+ className: "facto-auth-primary-btn",
991
+ disabled: l,
992
+ "aria-busy": l || void 0,
993
+ onClick: p,
994
+ children: [
995
+ l && /* @__PURE__ */ e("span", { className: "facto-auth-spinner", "aria-hidden": "true" }),
996
+ l ? c : i
997
+ ]
998
+ }
999
+ ),
1000
+ v && /* @__PURE__ */ e("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ e("button", { type: "button", className: "facto-auth-link-btn facto-auth-link-btn--muted", onClick: v, children: k }) })
1001
+ ] })
1002
+ ] });
1003
+ }
1004
+ function Ue({
1005
+ step: t,
1006
+ title: n = "Set up an authenticator app",
1007
+ description: a = "Scan the QR code in Google Authenticator, 1Password, or another TOTP app.",
1008
+ issuer: o,
1009
+ accountLabel: r,
1010
+ qrCode: i,
1011
+ manualKey: c,
1012
+ displayManualKey: l,
1013
+ code: s,
1014
+ onCodeChange: h,
1015
+ onSubmit: f,
1016
+ emailFactor: p,
1017
+ error: v,
1018
+ pending: k = !1,
1019
+ verified: w = !1,
1020
+ submitLabel: C = "Verify and continue",
1021
+ onSwitchAlternative: g,
1022
+ alternativeLabel: d = "Use a passkey instead",
1023
+ className: m
1024
+ }) {
1025
+ const y = !p || p.code.length === 6, b = s.length === 6 && y && !k, N = (T) => {
1026
+ T.preventDefault(), b && f(s);
1027
+ };
1028
+ return /* @__PURE__ */ u("div", { className: D("facto-totp-card", m), children: [
1029
+ t && /* @__PURE__ */ e(yt, { current: t.current, total: t.total, label: t.label }),
1030
+ /* @__PURE__ */ u("div", { className: "facto-auth-head", children: [
1031
+ /* @__PURE__ */ e("h1", { className: "facto-auth-head__title", children: n }),
1032
+ a && /* @__PURE__ */ e("p", { className: "facto-auth-head__description", children: a })
1033
+ ] }),
1034
+ /* @__PURE__ */ u("div", { className: "facto-totp-card__qr-row", children: [
1035
+ /* @__PURE__ */ e("div", { className: "facto-totp-card__qr-frame", children: i }),
1036
+ /* @__PURE__ */ u("div", { className: "facto-totp-card__qr-meta", children: [
1037
+ /* @__PURE__ */ u("div", { className: "facto-totp-card__issuer", children: [
1038
+ o,
1039
+ ": ",
1040
+ r
1041
+ ] }),
1042
+ /* @__PURE__ */ e("div", { className: "facto-totp-card__caption", children: "Scan this QR code or copy the setup key below." })
1043
+ ] })
1044
+ ] }),
1045
+ /* @__PURE__ */ e(me, { value: c, displayValue: l ?? c }),
1046
+ /* @__PURE__ */ u("form", { className: "facto-auth-stack", onSubmit: N, children: [
1047
+ p ? /* @__PURE__ */ u("div", { className: "facto-totp-card__dual", children: [
1048
+ /* @__PURE__ */ u("div", { className: "facto-totp-card__factor-row", children: [
1049
+ /* @__PURE__ */ u("div", { className: "facto-totp-card__factor-head", children: [
1050
+ /* @__PURE__ */ u("div", { children: [
1051
+ /* @__PURE__ */ e("div", { className: "facto-totp-card__factor-title", children: p.title ?? "Email verification code" }),
1052
+ /* @__PURE__ */ e("div", { className: "facto-totp-card__factor-sub", children: p.description ?? "Confirm your account email." })
1053
+ ] }),
1054
+ /* @__PURE__ */ e(
1055
+ Dt,
1056
+ {
1057
+ deadline: p.deadline,
1058
+ pending: p.sending,
1059
+ onClick: p.onSend,
1060
+ children: "Send code"
1061
+ }
1062
+ )
1063
+ ] }),
1064
+ /* @__PURE__ */ e(
1065
+ pt,
1066
+ {
1067
+ "aria-label": "Email verification code",
1068
+ value: p.code,
1069
+ onValueChange: p.onCodeChange,
1070
+ length: 6,
1071
+ split: !0,
1072
+ pending: k
1073
+ }
1074
+ )
1075
+ ] }),
1076
+ /* @__PURE__ */ u("div", { className: "facto-totp-card__factor-row", children: [
1077
+ /* @__PURE__ */ u("div", { children: [
1078
+ /* @__PURE__ */ e("div", { className: "facto-totp-card__factor-title", children: "Authenticator 6-digit code" }),
1079
+ /* @__PURE__ */ e("div", { className: "facto-totp-card__factor-sub", children: "Enter the current code from your authenticator app." })
1080
+ ] }),
1081
+ /* @__PURE__ */ e(
1082
+ pt,
1083
+ {
1084
+ "aria-label": "Authenticator 6-digit code",
1085
+ value: s,
1086
+ onValueChange: h,
1087
+ length: 6,
1088
+ split: !0,
1089
+ pending: k,
1090
+ verified: w,
1091
+ error: void 0
1092
+ }
1093
+ )
1094
+ ] })
1095
+ ] }) : /* @__PURE__ */ e(
1096
+ pt,
1097
+ {
1098
+ label: "6-digit authenticator code",
1099
+ value: s,
1100
+ onValueChange: h,
1101
+ length: 6,
1102
+ split: !0,
1103
+ pending: k,
1104
+ verified: w,
1105
+ error: v
1106
+ }
1107
+ ),
1108
+ p && v && /* @__PURE__ */ e("div", { className: "facto-auth-alert", role: "alert", children: v }),
1109
+ /* @__PURE__ */ u(
1110
+ "button",
1111
+ {
1112
+ type: "submit",
1113
+ className: "facto-auth-primary-btn",
1114
+ disabled: !b,
1115
+ "aria-busy": k || void 0,
1116
+ children: [
1117
+ k && /* @__PURE__ */ e("span", { className: "facto-auth-spinner", "aria-hidden": "true" }),
1118
+ C
1119
+ ]
1120
+ }
1121
+ )
1122
+ ] }),
1123
+ g && /* @__PURE__ */ e("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ e("button", { type: "button", className: "facto-auth-link-btn facto-auth-link-btn--muted", onClick: g, children: d }) })
1124
+ ] });
1125
+ }
1126
+ function pe(t, n = {}) {
1127
+ return [...[
1128
+ `${n.issuer ?? "Facto"} — Recovery Codes`,
1129
+ ...n.account ? [`Account: ${n.account}`] : [],
1130
+ "",
1131
+ "Each code can be used once to recover account access.",
1132
+ "Store these codes in a password manager or secure offline location.",
1133
+ ""
1134
+ ], ...t.map((o, r) => `${r + 1}. ${o}`), ""].join(`
1135
+ `);
1136
+ }
1137
+ function Ge({
1138
+ codes: t,
1139
+ usedIndices: n = [],
1140
+ variant: a = "onboarding",
1141
+ step: o,
1142
+ title: r,
1143
+ description: i,
1144
+ confirmationLabel: c = "I have saved these recovery codes in a safe place",
1145
+ continueLabel: l = "Continue",
1146
+ regenerateLabel: s = "Generate new codes",
1147
+ onCopyAll: h,
1148
+ onDownload: f,
1149
+ onContinue: p,
1150
+ onRegenerate: v,
1151
+ className: k
1152
+ }) {
1153
+ const [w, C] = A(!1), [g, d] = A(!1), [m, y] = A(null), b = G(), N = a === "manage", T = new Set(n), L = t.filter((B, R) => !T.has(R)).length, j = r ?? (N ? "Recovery codes" : "Save your recovery codes"), P = i ?? (N ? `${L} of ${t.length} one-time recovery codes remaining. Regenerating invalidates all existing codes.` : "Store these one-time codes somewhere safe. You will need one to register a replacement passkey if you lose this device."), O = (B, R) => {
1154
+ T.has(R) || (typeof navigator < "u" && navigator.clipboard?.writeText && navigator.clipboard.writeText(B).catch(() => {
1155
+ }), y(R), window.setTimeout(() => y((E) => E === R ? null : E), 1200));
1156
+ }, M = () => {
1157
+ typeof navigator < "u" && navigator.clipboard?.writeText && navigator.clipboard.writeText(t.join(`
1158
+ `)).catch(() => {
1159
+ }), d(!0), N || C(!0), h?.(t), window.setTimeout(() => d(!1), 2e3);
1160
+ }, I = () => {
1161
+ if (N || C(!0), f) {
1162
+ f(t);
1163
+ return;
1164
+ }
1165
+ if (typeof document > "u" || typeof URL > "u") return;
1166
+ const B = new Blob([pe(t)], { type: "text/plain;charset=utf-8" }), R = URL.createObjectURL(B), E = document.createElement("a");
1167
+ E.href = R, E.download = "facto-recovery-codes.txt", document.body.appendChild(E), E.click(), E.remove(), window.setTimeout(() => URL.revokeObjectURL(R), 1e3);
1168
+ };
1169
+ return /* @__PURE__ */ u("div", { className: D("facto-recovery-step", k), children: [
1170
+ o && /* @__PURE__ */ e(yt, { current: o.current, total: o.total, label: o.label }),
1171
+ /* @__PURE__ */ u("div", { className: "facto-auth-head", children: [
1172
+ /* @__PURE__ */ e("h1", { className: "facto-auth-head__title", children: j }),
1173
+ /* @__PURE__ */ e("p", { className: "facto-auth-head__description", children: P })
1174
+ ] }),
1175
+ /* @__PURE__ */ u("div", { className: "facto-recovery-step__panel", children: [
1176
+ /* @__PURE__ */ e("div", { className: "facto-recovery-step__grid", "aria-label": "Recovery codes", children: t.map((B, R) => {
1177
+ const E = N && T.has(R), rt = m === R;
1178
+ return /* @__PURE__ */ e(
1179
+ "button",
1180
+ {
1181
+ type: "button",
1182
+ className: D(
1183
+ "facto-recovery-step__code",
1184
+ E && "facto-recovery-step__code--used",
1185
+ rt && "facto-recovery-step__code--copied"
1186
+ ),
1187
+ disabled: E,
1188
+ "aria-label": E ? `${B}, used` : `Copy recovery code ${B}`,
1189
+ onClick: () => O(B, R),
1190
+ children: rt ? "Copied ✓" : B
1191
+ },
1192
+ `${B}-${R}`
1193
+ );
1194
+ }) }),
1195
+ /* @__PURE__ */ u("div", { className: "facto-recovery-step__toolbar", children: [
1196
+ /* @__PURE__ */ u("button", { type: "button", className: "facto-recovery-step__utility-btn", onClick: M, children: [
1197
+ g ? /* @__PURE__ */ e(lt, { size: 15, className: "facto-auth-check-pop" }) : /* @__PURE__ */ e(zt, {}),
1198
+ /* @__PURE__ */ e("span", { children: g ? "Copied all" : "Copy codes" })
1199
+ ] }),
1200
+ /* @__PURE__ */ u("button", { type: "button", className: "facto-recovery-step__utility-btn", onClick: I, children: [
1201
+ /* @__PURE__ */ e(ue, {}),
1202
+ /* @__PURE__ */ e("span", { children: "Download .txt" })
1203
+ ] })
1204
+ ] })
1205
+ ] }),
1206
+ N ? v ? /* @__PURE__ */ e("button", { type: "button", className: "facto-auth-primary-btn", onClick: v, children: s }) : null : /* @__PURE__ */ u(et, { children: [
1207
+ /* @__PURE__ */ u("label", { className: "facto-recovery-step__confirm", htmlFor: b, children: [
1208
+ /* @__PURE__ */ e(
1209
+ "input",
1210
+ {
1211
+ id: b,
1212
+ type: "checkbox",
1213
+ className: "facto-recovery-step__checkbox",
1214
+ checked: w,
1215
+ onChange: (B) => C(B.target.checked)
1216
+ }
1217
+ ),
1218
+ /* @__PURE__ */ e("span", { children: c })
1219
+ ] }),
1220
+ /* @__PURE__ */ e(
1221
+ "button",
1222
+ {
1223
+ type: "button",
1224
+ className: "facto-auth-primary-btn",
1225
+ disabled: !w,
1226
+ onClick: p,
1227
+ children: l
1228
+ }
1229
+ )
1230
+ ] })
1231
+ ] });
1232
+ }
1233
+ function Ke({
1234
+ options: t,
1235
+ value: n,
1236
+ onValueChange: a,
1237
+ columns: o = 2,
1238
+ ariaLabel: r,
1239
+ className: i,
1240
+ ...c
1241
+ }) {
1242
+ return /* @__PURE__ */ e(
1243
+ "div",
1244
+ {
1245
+ ...c,
1246
+ role: "radiogroup",
1247
+ "aria-label": r,
1248
+ className: D("facto-selection-group", o === 1 && "facto-selection-group--single", i),
1249
+ children: t.map((l) => {
1250
+ const s = l.value === n;
1251
+ return /* @__PURE__ */ u(
1252
+ "button",
1253
+ {
1254
+ type: "button",
1255
+ role: "radio",
1256
+ "aria-checked": s,
1257
+ disabled: l.disabled,
1258
+ className: D("facto-selection-card", s && "facto-selection-card--selected"),
1259
+ onClick: () => a(l.value),
1260
+ children: [
1261
+ /* @__PURE__ */ u("span", { className: "facto-selection-card__head", children: [
1262
+ /* @__PURE__ */ u("span", { className: "facto-selection-card__title", children: [
1263
+ l.icon,
1264
+ /* @__PURE__ */ e("span", { children: l.title })
1265
+ ] }),
1266
+ /* @__PURE__ */ e("span", { className: "facto-selection-card__radio", "aria-hidden": "true" })
1267
+ ] }),
1268
+ l.description && /* @__PURE__ */ e("p", { className: "facto-selection-card__desc", children: l.description }),
1269
+ l.meta && /* @__PURE__ */ e("span", { className: D("facto-selection-card__meta", l.metaTone === "accent" && "facto-selection-card__meta--accent"), children: l.meta })
1270
+ ]
1271
+ },
1272
+ l.value
1273
+ );
1274
+ })
1275
+ }
1276
+ );
1277
+ }
1278
+ const _ = (...t) => t.filter(Boolean).join(" "), ct = (...t) => t.filter(Boolean).join(" ") || void 0, U = wt({}), ve = (t) => Object.fromEntries(
1279
+ Object.entries(t ?? {}).filter(([n, a]) => n.startsWith("--facto-") && a !== void 0 && a !== null)
636
1280
  );
637
- function ue({ className: t, tokens: e, style: o, motion: a, ...c }) {
638
- const i = B(F), r = { ...e, ...o }, u = { ...i, ...Dt(r) };
639
- return /* @__PURE__ */ n(at, { motion: a, children: /* @__PURE__ */ n(F.Provider, { value: u, children: /* @__PURE__ */ n("div", { ...c, style: r, className: h("facto-theme", t) }) }) });
640
- }
641
- function Y({ name: t, size: e = 20, ...o }) {
642
- return /* @__PURE__ */ n("svg", { width: e, height: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", focusable: "false", ...o, children: {
643
- plus: /* @__PURE__ */ n("path", { d: "M12 5v14M5 12h14" }),
644
- chevronLeft: /* @__PURE__ */ n("path", { d: "m15 6-6 6 6 6" }),
645
- copy: /* @__PURE__ */ _(J, { children: [
646
- /* @__PURE__ */ n("rect", { x: "8", y: "8", width: "12", height: "12", rx: "2" }),
647
- /* @__PURE__ */ n("path", { d: "M16 8V4H4v12h4" })
1281
+ function Ye({ className: t, tokens: n, style: a, motion: o, ...r }) {
1282
+ const i = W(U), c = { ...n, ...a }, l = { ...i, ...ve(c) };
1283
+ return /* @__PURE__ */ e(gt, { motion: o, children: /* @__PURE__ */ e(U.Provider, { value: l, children: /* @__PURE__ */ e("div", { ...r, style: c, className: _("facto-theme", t) }) }) });
1284
+ }
1285
+ function ot({ name: t, size: n = 20, ...a }) {
1286
+ return /* @__PURE__ */ e("svg", { width: n, height: n, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", focusable: "false", ...a, children: {
1287
+ plus: /* @__PURE__ */ e("path", { d: "M12 5v14M5 12h14" }),
1288
+ chevronLeft: /* @__PURE__ */ e("path", { d: "m15 6-6 6 6 6" }),
1289
+ copy: /* @__PURE__ */ u(et, { children: [
1290
+ /* @__PURE__ */ e("rect", { x: "8", y: "8", width: "12", height: "12", rx: "2" }),
1291
+ /* @__PURE__ */ e("path", { d: "M16 8V4H4v12h4" })
648
1292
  ] }),
649
- search: /* @__PURE__ */ _(J, { children: [
650
- /* @__PURE__ */ n("circle", { cx: "10", cy: "10", r: "6" }),
651
- /* @__PURE__ */ n("path", { d: "m15 15 5 5" })
1293
+ search: /* @__PURE__ */ u(et, { children: [
1294
+ /* @__PURE__ */ e("circle", { cx: "10", cy: "10", r: "6" }),
1295
+ /* @__PURE__ */ e("path", { d: "m15 15 5 5" })
652
1296
  ] }),
653
- close: /* @__PURE__ */ n("path", { d: "m6 6 12 12M18 6 6 18" }),
654
- arrowLeft: /* @__PURE__ */ n("path", { d: "m12 5-7 7 7 7M5 12h14" }),
655
- check: /* @__PURE__ */ n("path", { d: "m5 12 4 4L19 6" }),
656
- chevronDown: /* @__PURE__ */ n("path", { d: "m6 9 6 6 6-6" }),
657
- chevronRight: /* @__PURE__ */ n("path", { d: "m9 6 6 6-6 6" }),
658
- info: /* @__PURE__ */ _(J, { children: [
659
- /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "9" }),
660
- /* @__PURE__ */ n("path", { d: "M12 11v6M12 7v1" })
1297
+ close: /* @__PURE__ */ e("path", { d: "m6 6 12 12M18 6 6 18" }),
1298
+ arrowLeft: /* @__PURE__ */ e("path", { d: "m12 5-7 7 7 7M5 12h14" }),
1299
+ check: /* @__PURE__ */ e("path", { d: "m5 12 4 4L19 6" }),
1300
+ chevronDown: /* @__PURE__ */ e("path", { d: "m6 9 6 6 6-6" }),
1301
+ chevronRight: /* @__PURE__ */ e("path", { d: "m9 6 6 6-6 6" }),
1302
+ info: /* @__PURE__ */ u(et, { children: [
1303
+ /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "9" }),
1304
+ /* @__PURE__ */ e("path", { d: "M12 11v6M12 7v1" })
661
1305
  ] }),
662
- warning: /* @__PURE__ */ _(J, { children: [
663
- /* @__PURE__ */ n("path", { d: "m12 3 10 18H2L12 3Z" }),
664
- /* @__PURE__ */ n("path", { d: "M12 9v5M12 17v1" })
1306
+ warning: /* @__PURE__ */ u(et, { children: [
1307
+ /* @__PURE__ */ e("path", { d: "m12 3 10 18H2L12 3Z" }),
1308
+ /* @__PURE__ */ e("path", { d: "M12 9v5M12 17v1" })
665
1309
  ] })
666
1310
  }[t] });
667
1311
  }
668
- function fe({ className: t, ...e }) {
669
- return /* @__PURE__ */ n("div", { ...e, className: h("facto-modal-header", t) });
1312
+ function Qe({ className: t, ...n }) {
1313
+ return /* @__PURE__ */ e("div", { ...n, className: _("facto-modal-header", t) });
670
1314
  }
671
- function me({ className: t, ...e }) {
672
- return /* @__PURE__ */ n("div", { ...e, className: h("facto-modal-footer", t) });
1315
+ function Xe({ className: t, ...n }) {
1316
+ return /* @__PURE__ */ e("div", { ...n, className: _("facto-modal-footer", t) });
673
1317
  }
674
- const he = X(
1318
+ const Ze = dt(
675
1319
  function({
676
- variant: e = "primary",
677
- size: o = "md",
678
- fullWidth: a,
679
- loading: c,
1320
+ variant: n = "primary",
1321
+ size: a = "md",
1322
+ fullWidth: o,
1323
+ loading: r,
680
1324
  motion: i,
681
- style: r,
682
- leadingIcon: u,
1325
+ style: c,
1326
+ leadingIcon: l,
683
1327
  trailingIcon: s,
684
- className: f,
685
- children: m,
1328
+ className: h,
1329
+ children: f,
686
1330
  disabled: p,
687
- type: y = "button",
688
- ...w
689
- }, C) {
690
- const M = A(i);
691
- return /* @__PURE__ */ _(
1331
+ type: v = "button",
1332
+ ...k
1333
+ }, w) {
1334
+ const C = Y(i);
1335
+ return /* @__PURE__ */ u(
692
1336
  "button",
693
1337
  {
694
- ...w,
695
- ref: C,
696
- style: { ...r, ...M },
697
- type: y,
698
- disabled: p || c,
699
- "aria-busy": c || void 0,
700
- className: h(
1338
+ ...k,
1339
+ ref: w,
1340
+ style: { ...c, ...C },
1341
+ type: v,
1342
+ disabled: p || r,
1343
+ "aria-busy": r || void 0,
1344
+ className: _(
701
1345
  "facto-button",
702
- `facto-button--${e}`,
703
- `facto-button--${o}`,
704
- a && "facto-button--full",
705
- f
1346
+ `facto-button--${n}`,
1347
+ `facto-button--${a}`,
1348
+ o && "facto-button--full",
1349
+ h
706
1350
  ),
707
1351
  children: [
708
- /* @__PURE__ */ _("span", { className: "facto-button__content", style: c ? { opacity: 0 } : void 0, children: [
709
- u,
710
- /* @__PURE__ */ n("span", { children: m }),
1352
+ /* @__PURE__ */ u("span", { className: "facto-button__content", style: r ? { opacity: 0 } : void 0, children: [
1353
+ l,
1354
+ /* @__PURE__ */ e("span", { children: f }),
711
1355
  s
712
1356
  ] }),
713
- c && /* @__PURE__ */ n("span", { className: "facto-button__spinner", "aria-hidden": "true" })
1357
+ r && /* @__PURE__ */ e("span", { className: "facto-button__spinner", "aria-hidden": "true" })
714
1358
  ]
715
1359
  }
716
1360
  );
717
1361
  }
718
- ), pe = X(
719
- function({ ariaLabel: e, size: o = "md", className: a, title: c, type: i = "button", children: r, ...u }, s) {
720
- return /* @__PURE__ */ n(
1362
+ ), Je = dt(
1363
+ function({ ariaLabel: n, size: a = "md", className: o, title: r, type: i = "button", children: c, ...l }, s) {
1364
+ return /* @__PURE__ */ e(
721
1365
  "button",
722
1366
  {
723
- ...u,
1367
+ ...l,
724
1368
  ref: s,
725
1369
  type: i,
726
- "aria-label": e,
727
- title: c ?? e,
728
- className: h(
1370
+ "aria-label": n,
1371
+ title: r ?? n,
1372
+ className: _(
729
1373
  "facto-icon-button",
730
- `facto-icon-button--${o}`,
731
- a
1374
+ `facto-icon-button--${a}`,
1375
+ o
732
1376
  ),
733
- children: /* @__PURE__ */ n("span", { className: "facto-icon-button__visual", children: r })
1377
+ children: /* @__PURE__ */ e("span", { className: "facto-icon-button__visual", children: c })
734
1378
  }
735
1379
  );
736
1380
  }
737
1381
  );
738
- function Nt({ padding: t = "lg", className: e, ...o }) {
739
- return /* @__PURE__ */ n(
1382
+ function Ft({ padding: t = "lg", className: n, ...a }) {
1383
+ return /* @__PURE__ */ e(
740
1384
  "div",
741
1385
  {
742
- ...o,
743
- className: h(
1386
+ ...a,
1387
+ className: _(
744
1388
  "facto-surface",
745
1389
  `facto-surface--padding-${t}`,
746
- e
1390
+ n
747
1391
  )
748
1392
  }
749
1393
  );
750
1394
  }
751
- function ge(t) {
752
- return /* @__PURE__ */ n(Nt, { ...t });
1395
+ function tn(t) {
1396
+ return /* @__PURE__ */ e(Ft, { ...t });
753
1397
  }
754
- function ve({ span: t = 1, className: e, ...o }) {
755
- return /* @__PURE__ */ n(
756
- Nt,
1398
+ function en({ span: t = 1, className: n, ...a }) {
1399
+ return /* @__PURE__ */ e(
1400
+ Ft,
757
1401
  {
758
- ...o,
1402
+ ...a,
759
1403
  padding: "md",
760
- className: h(
1404
+ className: _(
761
1405
  "facto-widget",
762
1406
  t === 2 && "facto-widget--span-2",
763
- e
1407
+ n
764
1408
  )
765
1409
  }
766
1410
  );
767
1411
  }
768
- function be({ className: t, children: e, ...o }) {
769
- return /* @__PURE__ */ n("div", { ...o, className: h("facto-dashboard-container", t), children: /* @__PURE__ */ n("div", { className: "facto-dashboard-grid", children: e }) });
1412
+ function nn({ className: t, children: n, ...a }) {
1413
+ return /* @__PURE__ */ e("div", { ...a, className: _("facto-dashboard-container", t), children: /* @__PURE__ */ e("div", { className: "facto-dashboard-grid", children: n }) });
770
1414
  }
771
- function _e({ withAction: t, className: e, ...o }) {
772
- return /* @__PURE__ */ n(
1415
+ function an({ withAction: t, className: n, ...a }) {
1416
+ return /* @__PURE__ */ e(
773
1417
  "div",
774
1418
  {
775
- ...o,
776
- className: h("facto-widget-head", t && "facto-widget-head--with-action", e)
1419
+ ...a,
1420
+ className: _("facto-widget-head", t && "facto-widget-head--with-action", n)
777
1421
  }
778
1422
  );
779
1423
  }
780
- function Ne({ className: t, ...e }) {
781
- return /* @__PURE__ */ n("div", { ...e, className: h("facto-widget-list", t) });
1424
+ function on({ className: t, ...n }) {
1425
+ return /* @__PURE__ */ e("div", { ...n, className: _("facto-widget-list", t) });
782
1426
  }
783
- function ye({ className: t, ...e }) {
784
- return /* @__PURE__ */ n("div", { ...e, className: h("facto-widget-kv", t) });
1427
+ function cn({ className: t, ...n }) {
1428
+ return /* @__PURE__ */ e("div", { ...n, className: _("facto-widget-kv", t) });
785
1429
  }
786
- function we({ className: t, ...e }) {
787
- return /* @__PURE__ */ n("div", { ...e, className: h("facto-widget-amount", t) });
1430
+ function rn({ className: t, ...n }) {
1431
+ return /* @__PURE__ */ e("div", { ...n, className: _("facto-widget-amount", t) });
788
1432
  }
789
- function ke(t) {
790
- const e = h("facto-widget-action", t.dark && "facto-widget-action--dark", t.className);
1433
+ function sn(t) {
1434
+ const n = _("facto-widget-action", t.dark && "facto-widget-action--dark", t.className);
791
1435
  if (typeof t.href == "string") {
792
- const { dark: r, className: u, ...s } = t;
793
- return /* @__PURE__ */ n("a", { ...s, className: e });
1436
+ const { dark: c, className: l, ...s } = t;
1437
+ return /* @__PURE__ */ e("a", { ...s, className: n });
794
1438
  }
795
- const { dark: o, className: a, type: c = "button", ...i } = t;
796
- return /* @__PURE__ */ n("button", { ...i, type: c, className: e });
1439
+ const { dark: a, className: o, type: r = "button", ...i } = t;
1440
+ return /* @__PURE__ */ e("button", { ...i, type: r, className: n });
797
1441
  }
798
- function Ce({
1442
+ function ln({
799
1443
  className: t,
800
- type: e = "button",
801
- ...o
1444
+ type: n = "button",
1445
+ ...a
802
1446
  }) {
803
- return /* @__PURE__ */ n(
1447
+ return /* @__PURE__ */ e(
804
1448
  "button",
805
1449
  {
806
- ...o,
807
- type: e,
808
- className: h("facto-widget-row", t)
1450
+ ...a,
1451
+ type: n,
1452
+ className: _("facto-widget-row", t)
809
1453
  }
810
1454
  );
811
1455
  }
812
- function Et({
1456
+ function ge({
813
1457
  label: t,
814
- helperText: e,
815
- error: o,
816
- id: a,
817
- containerClassName: c,
1458
+ helperText: n,
1459
+ error: a,
1460
+ id: o,
1461
+ containerClassName: r,
818
1462
  className: i,
819
- ...r
1463
+ ...c
820
1464
  }) {
821
- const u = j(), s = a ?? u, f = o || e ? `${s}-description` : void 0;
822
- return /* @__PURE__ */ _("div", { className: h("facto-field", c), children: [
823
- t && /* @__PURE__ */ n("label", { className: "facto-field__label", htmlFor: s, children: t }),
824
- /* @__PURE__ */ n(
1465
+ const l = G(), s = o ?? l, h = a || n ? `${s}-description` : void 0;
1466
+ return /* @__PURE__ */ u("div", { className: _("facto-field", r), children: [
1467
+ t && /* @__PURE__ */ e("label", { className: "facto-field__label", htmlFor: s, children: t }),
1468
+ /* @__PURE__ */ e(
825
1469
  "input",
826
1470
  {
827
- ...r,
1471
+ ...c,
828
1472
  id: s,
829
- "aria-invalid": !!o || r["aria-invalid"],
830
- "aria-describedby": G(r["aria-describedby"], f),
831
- className: h(
1473
+ "aria-invalid": !!a || c["aria-invalid"],
1474
+ "aria-describedby": ct(c["aria-describedby"], h),
1475
+ className: _(
832
1476
  "facto-input",
833
- !!o && "facto-input--error",
1477
+ !!a && "facto-input--error",
834
1478
  i
835
1479
  )
836
1480
  }
837
1481
  ),
838
- (o || e) && /* @__PURE__ */ n(
1482
+ (a || n) && /* @__PURE__ */ e(
839
1483
  "span",
840
1484
  {
841
- id: f,
842
- className: h(
1485
+ id: h,
1486
+ className: _(
843
1487
  "facto-field__message",
844
- !!o && "facto-field__message--error"
1488
+ !!a && "facto-field__message--error"
845
1489
  ),
846
- children: o ?? e
1490
+ children: a ?? n
847
1491
  }
848
1492
  )
849
1493
  ] });
850
1494
  }
851
- function Te({
1495
+ function dn({
852
1496
  label: t,
853
- helperText: e,
854
- error: o,
855
- id: a,
856
- containerClassName: c,
1497
+ helperText: n,
1498
+ error: a,
1499
+ id: o,
1500
+ containerClassName: r,
857
1501
  className: i,
858
- ...r
1502
+ ...c
859
1503
  }) {
860
- const u = j(), s = a ?? u, f = o || e ? `${s}-description` : void 0;
861
- return /* @__PURE__ */ _("div", { className: h("facto-field", c), children: [
862
- t && /* @__PURE__ */ n("label", { className: "facto-field__label", htmlFor: s, children: t }),
863
- /* @__PURE__ */ n(
1504
+ const l = G(), s = o ?? l, h = a || n ? `${s}-description` : void 0;
1505
+ return /* @__PURE__ */ u("div", { className: _("facto-field", r), children: [
1506
+ t && /* @__PURE__ */ e("label", { className: "facto-field__label", htmlFor: s, children: t }),
1507
+ /* @__PURE__ */ e(
864
1508
  "textarea",
865
1509
  {
866
- ...r,
1510
+ ...c,
867
1511
  id: s,
868
- "aria-invalid": !!o || r["aria-invalid"],
869
- "aria-describedby": G(r["aria-describedby"], f),
870
- className: h(
1512
+ "aria-invalid": !!a || c["aria-invalid"],
1513
+ "aria-describedby": ct(c["aria-describedby"], h),
1514
+ className: _(
871
1515
  "facto-textarea",
872
- !!o && "facto-input--error",
1516
+ !!a && "facto-input--error",
873
1517
  i
874
1518
  )
875
1519
  }
876
1520
  ),
877
- (o || e) && /* @__PURE__ */ n(
1521
+ (a || n) && /* @__PURE__ */ e(
878
1522
  "span",
879
1523
  {
880
- id: f,
881
- className: h(
1524
+ id: h,
1525
+ className: _(
882
1526
  "facto-field__message",
883
- !!o && "facto-field__message--error"
1527
+ !!a && "facto-field__message--error"
884
1528
  ),
885
- children: o ?? e
1529
+ children: a ?? n
886
1530
  }
887
1531
  )
888
1532
  ] });
889
1533
  }
890
- function Me({ tone: t = "neutral", className: e, ...o }) {
891
- return /* @__PURE__ */ n(
1534
+ function un({ tone: t = "neutral", className: n, ...a }) {
1535
+ return /* @__PURE__ */ e(
892
1536
  "span",
893
1537
  {
894
- ...o,
895
- className: h("facto-badge", `facto-badge--${t}`, e)
1538
+ ...a,
1539
+ className: _("facto-badge", `facto-badge--${t}`, n)
896
1540
  }
897
1541
  );
898
1542
  }
899
- function Re({
1543
+ function fn({
900
1544
  options: t,
901
- value: e,
902
- defaultValue: o,
903
- onValueChange: a,
904
- placeholder: c = "Select an option",
1545
+ value: n,
1546
+ defaultValue: a,
1547
+ onValueChange: o,
1548
+ placeholder: r = "Select an option",
905
1549
  label: i,
906
- error: r,
907
- disabled: u,
1550
+ error: c,
1551
+ disabled: l,
908
1552
  bordered: s = !1,
909
- name: f,
910
- id: m,
1553
+ name: h,
1554
+ id: f,
911
1555
  ariaLabel: p,
912
- "aria-describedby": y,
913
- className: w
1556
+ "aria-describedby": v,
1557
+ className: k
914
1558
  }) {
915
- const C = B(F), M = A(), v = j(), l = m ?? v, d = r ? `${l}-description` : void 0, b = T(null), g = z(() => {
916
- b.current?.(), b.current = null;
917
- }, []), N = z(
918
- (k) => {
919
- g(), k && (b.current = xt(k));
1559
+ const w = W(U), C = Y(), g = G(), d = f ?? g, m = c ? `${d}-description` : void 0, y = x(null), b = X(() => {
1560
+ y.current?.(), y.current = null;
1561
+ }, []), N = X(
1562
+ (T) => {
1563
+ b(), T && (y.current = ce(T));
920
1564
  },
921
- [g]
1565
+ [b]
922
1566
  );
923
- return E(() => g, [g]), /* @__PURE__ */ _("div", { className: h("facto-field", w), children: [
924
- i && /* @__PURE__ */ n("label", { className: "facto-field__label", htmlFor: l, children: i }),
925
- /* @__PURE__ */ _(
926
- L.Root,
1567
+ return q(() => b, [b]), /* @__PURE__ */ u("div", { className: _("facto-field", k), children: [
1568
+ i && /* @__PURE__ */ e("label", { className: "facto-field__label", htmlFor: d, children: i }),
1569
+ /* @__PURE__ */ u(
1570
+ V.Root,
927
1571
  {
928
- value: e,
929
- defaultValue: o,
930
- onValueChange: a,
931
- disabled: u,
932
- name: f,
1572
+ value: n,
1573
+ defaultValue: a,
1574
+ onValueChange: o,
1575
+ disabled: l,
1576
+ name: h,
933
1577
  children: [
934
- /* @__PURE__ */ _(
935
- L.Trigger,
1578
+ /* @__PURE__ */ u(
1579
+ V.Trigger,
936
1580
  {
937
- id: l,
938
- className: h("facto-select", s && "facto-select--bordered", !!r && "facto-input--error"),
1581
+ id: d,
1582
+ className: _("facto-select", s && "facto-select--bordered", !!c && "facto-input--error"),
939
1583
  "aria-label": p,
940
- "aria-describedby": G(y, d),
941
- "aria-invalid": !!r,
1584
+ "aria-describedby": ct(v, m),
1585
+ "aria-invalid": !!c,
942
1586
  children: [
943
- /* @__PURE__ */ n(L.Value, { placeholder: c }),
944
- /* @__PURE__ */ n(L.Icon, { className: "facto-select__chevron", children: /* @__PURE__ */ n(Y, { name: "chevronDown", size: 16 }) })
1587
+ /* @__PURE__ */ e(V.Value, { placeholder: r }),
1588
+ /* @__PURE__ */ e(V.Icon, { className: "facto-select__chevron", children: /* @__PURE__ */ e(ot, { name: "chevronDown", size: 16 }) })
945
1589
  ]
946
1590
  }
947
1591
  ),
948
- /* @__PURE__ */ n(L.Portal, { children: /* @__PURE__ */ n(
949
- L.Content,
1592
+ /* @__PURE__ */ e(V.Portal, { children: /* @__PURE__ */ e(
1593
+ V.Content,
950
1594
  {
951
1595
  ref: N,
952
1596
  className: "facto-theme facto-select-content",
953
- style: { ...C, ...M },
1597
+ style: { ...w, ...C },
954
1598
  position: "popper",
955
1599
  side: "bottom",
956
1600
  align: "start",
957
1601
  sideOffset: 8,
958
1602
  collisionPadding: 16,
959
- onCloseAutoFocus: g,
960
- children: /* @__PURE__ */ n(L.Viewport, { children: t.map((k) => /* @__PURE__ */ _(
961
- L.Item,
1603
+ onCloseAutoFocus: b,
1604
+ children: /* @__PURE__ */ e(V.Viewport, { children: t.map((T) => /* @__PURE__ */ u(
1605
+ V.Item,
962
1606
  {
963
- value: k.value,
964
- disabled: k.disabled,
1607
+ value: T.value,
1608
+ disabled: T.disabled,
965
1609
  className: "facto-select-item",
966
1610
  children: [
967
- /* @__PURE__ */ n(L.ItemText, { children: k.label }),
968
- /* @__PURE__ */ n(L.ItemIndicator, { children: /* @__PURE__ */ n(Y, { name: "check", size: 16 }) })
1611
+ /* @__PURE__ */ e(V.ItemText, { children: T.label }),
1612
+ /* @__PURE__ */ e(V.ItemIndicator, { children: /* @__PURE__ */ e(ot, { name: "check", size: 16 }) })
969
1613
  ]
970
1614
  },
971
- k.value
1615
+ T.value
972
1616
  )) })
973
1617
  }
974
1618
  ) })
975
1619
  ]
976
1620
  }
977
1621
  ),
978
- r && /* @__PURE__ */ n(
1622
+ c && /* @__PURE__ */ e(
979
1623
  "span",
980
1624
  {
981
- id: d,
1625
+ id: m,
982
1626
  className: "facto-field__message facto-field__message--error",
983
- children: r
1627
+ children: c
984
1628
  }
985
1629
  )
986
1630
  ] });
987
1631
  }
988
- function $e({
1632
+ function hn({
989
1633
  label: t,
990
- description: e,
991
- className: o,
992
- id: a,
993
- ...c
1634
+ description: n,
1635
+ className: a,
1636
+ id: o,
1637
+ ...r
994
1638
  }) {
995
- const i = j(), r = a ?? i, u = e ? `${r}-description` : void 0, s = /* @__PURE__ */ n(
996
- dt.Root,
1639
+ const i = G(), c = o ?? i, l = n ? `${c}-description` : void 0, s = /* @__PURE__ */ e(
1640
+ Mt.Root,
997
1641
  {
998
- ...c,
999
- id: r,
1000
- "aria-describedby": G(c["aria-describedby"], u),
1001
- className: h("facto-switch", o),
1002
- children: /* @__PURE__ */ n("span", { className: "facto-switch__track", "aria-hidden": "true", children: /* @__PURE__ */ n(dt.Thumb, { className: "facto-switch__thumb" }) })
1642
+ ...r,
1643
+ id: c,
1644
+ "aria-describedby": ct(r["aria-describedby"], l),
1645
+ className: _("facto-switch", a),
1646
+ children: /* @__PURE__ */ e("span", { className: "facto-switch__track", "aria-hidden": "true", children: /* @__PURE__ */ e(Mt.Thumb, { className: "facto-switch__thumb" }) })
1003
1647
  }
1004
1648
  );
1005
- return t ? /* @__PURE__ */ _("div", { className: "facto-check-field", children: [
1649
+ return t ? /* @__PURE__ */ u("div", { className: "facto-check-field", children: [
1006
1650
  s,
1007
- /* @__PURE__ */ _("span", { children: [
1008
- /* @__PURE__ */ n("label", { htmlFor: r, children: /* @__PURE__ */ n("strong", { children: t }) }),
1009
- e && /* @__PURE__ */ n("small", { id: u, children: e })
1651
+ /* @__PURE__ */ u("span", { children: [
1652
+ /* @__PURE__ */ e("label", { htmlFor: c, children: /* @__PURE__ */ e("strong", { children: t }) }),
1653
+ n && /* @__PURE__ */ e("small", { id: l, children: n })
1010
1654
  ] })
1011
1655
  ] }) : s;
1012
1656
  }
1013
- function Se({
1657
+ function mn({
1014
1658
  label: t,
1015
- description: e,
1016
- className: o,
1017
- id: a,
1018
- ...c
1659
+ description: n,
1660
+ className: a,
1661
+ id: o,
1662
+ ...r
1019
1663
  }) {
1020
- const i = j(), r = a ?? i, u = e ? `${r}-description` : void 0, s = /* @__PURE__ */ n(
1021
- lt.Root,
1664
+ const i = G(), c = o ?? i, l = n ? `${c}-description` : void 0, s = /* @__PURE__ */ e(
1665
+ St.Root,
1022
1666
  {
1023
- ...c,
1024
- id: r,
1025
- "aria-describedby": G(c["aria-describedby"], u),
1026
- className: h("facto-checkbox", o),
1027
- children: /* @__PURE__ */ n("span", { className: "facto-checkbox__visual", "aria-hidden": "true", children: /* @__PURE__ */ n(lt.Indicator, { className: "facto-checkbox__indicator", children: /* @__PURE__ */ n(Y, { name: "check", size: 16 }) }) })
1667
+ ...r,
1668
+ id: c,
1669
+ "aria-describedby": ct(r["aria-describedby"], l),
1670
+ className: _("facto-checkbox", a),
1671
+ children: /* @__PURE__ */ e("span", { className: "facto-checkbox__visual", "aria-hidden": "true", children: /* @__PURE__ */ e(St.Indicator, { className: "facto-checkbox__indicator", children: /* @__PURE__ */ e(ot, { name: "check", size: 16 }) }) })
1028
1672
  }
1029
1673
  );
1030
- return t ? /* @__PURE__ */ _("div", { className: "facto-check-field", children: [
1674
+ return t ? /* @__PURE__ */ u("div", { className: "facto-check-field", children: [
1031
1675
  s,
1032
- /* @__PURE__ */ _("span", { children: [
1033
- /* @__PURE__ */ n("label", { htmlFor: r, children: /* @__PURE__ */ n("strong", { children: t }) }),
1034
- e && /* @__PURE__ */ n("small", { id: u, children: e })
1676
+ /* @__PURE__ */ u("span", { children: [
1677
+ /* @__PURE__ */ e("label", { htmlFor: c, children: /* @__PURE__ */ e("strong", { children: t }) }),
1678
+ n && /* @__PURE__ */ e("small", { id: l, children: n })
1035
1679
  ] })
1036
1680
  ] }) : s;
1037
1681
  }
1038
- const xe = ot.Root;
1039
- function Be({
1682
+ const pn = vt.Root;
1683
+ function vn({
1040
1684
  className: t,
1041
- ...e
1685
+ ...n
1042
1686
  }) {
1043
- return /* @__PURE__ */ n(
1044
- ot.List,
1687
+ return /* @__PURE__ */ e(
1688
+ vt.List,
1045
1689
  {
1046
- ...e,
1047
- className: h("facto-tabs-list", t)
1690
+ ...n,
1691
+ className: _("facto-tabs-list", t)
1048
1692
  }
1049
1693
  );
1050
1694
  }
1051
- function Ie({
1695
+ function gn({
1052
1696
  className: t,
1053
- ...e
1697
+ ...n
1054
1698
  }) {
1055
- return /* @__PURE__ */ n(
1056
- ot.Trigger,
1699
+ return /* @__PURE__ */ e(
1700
+ vt.Trigger,
1057
1701
  {
1058
- ...e,
1059
- className: h("facto-tabs-trigger", t)
1702
+ ...n,
1703
+ className: _("facto-tabs-trigger", t)
1060
1704
  }
1061
1705
  );
1062
1706
  }
1063
- function Pe({
1707
+ function bn({
1064
1708
  className: t,
1065
- ...e
1709
+ ...n
1066
1710
  }) {
1067
- return /* @__PURE__ */ n(
1068
- ot.Content,
1711
+ return /* @__PURE__ */ e(
1712
+ vt.Content,
1069
1713
  {
1070
- ...e,
1071
- className: h("facto-tabs-content", t)
1714
+ ...n,
1715
+ className: _("facto-tabs-content", t)
1072
1716
  }
1073
1717
  );
1074
1718
  }
1075
- const Le = x.Root, De = x.Trigger, Ee = x.Close, Ft = X(
1076
- function({ className: e, children: o, tabIndex: a, ...c }, i) {
1077
- const r = T(null), [u, s] = H(!1), f = z((m) => {
1078
- if (r.current = m, typeof i == "function") {
1079
- const p = i(m);
1719
+ const _n = F.Root, yn = F.Trigger, Nn = F.Close, be = dt(
1720
+ function({ className: n, children: a, tabIndex: o, ...r }, i) {
1721
+ const c = x(null), [l, s] = A(!1), h = X((f) => {
1722
+ if (c.current = f, typeof i == "function") {
1723
+ const p = i(f);
1080
1724
  if (typeof p == "function")
1081
1725
  return () => {
1082
- r.current === m && (r.current = null), p();
1726
+ c.current === f && (c.current = null), p();
1083
1727
  };
1084
- } else i && (i.current = m);
1728
+ } else i && (i.current = f);
1085
1729
  }, [i]);
1086
- return E(() => {
1087
- const m = r.current;
1088
- if (!m) return;
1089
- const p = () => s(m.scrollHeight > m.clientHeight + 1);
1730
+ return q(() => {
1731
+ const f = c.current;
1732
+ if (!f) return;
1733
+ const p = () => s(f.scrollHeight > f.clientHeight + 1);
1090
1734
  p();
1091
- const y = new ResizeObserver(p), w = new MutationObserver(p);
1092
- return y.observe(m), w.observe(m, { childList: !0, characterData: !0, subtree: !0 }), () => {
1093
- y.disconnect(), w.disconnect();
1735
+ const v = new ResizeObserver(p), k = new MutationObserver(p);
1736
+ return v.observe(f), k.observe(f, { childList: !0, characterData: !0, subtree: !0 }), () => {
1737
+ v.disconnect(), k.disconnect();
1094
1738
  };
1095
- }, [o]), /* @__PURE__ */ n(x.Title, { ...c, ref: f, tabIndex: u ? a ?? 0 : a, className: h("facto-modal-title", e), children: o });
1739
+ }, [a]), /* @__PURE__ */ e(F.Title, { ...r, ref: h, tabIndex: l ? o ?? 0 : o, className: _("facto-modal-title", n), children: a });
1096
1740
  }
1097
- ), At = X(function({ className: e, ...o }, a) {
1098
- return /* @__PURE__ */ n(x.Description, { ...o, ref: a, className: h("facto-modal-description", e) });
1741
+ ), _e = dt(function({ className: n, ...a }, o) {
1742
+ return /* @__PURE__ */ e(F.Description, { ...a, ref: o, className: _("facto-modal-description", n) });
1099
1743
  });
1100
- function Fe({
1744
+ function kn({
1101
1745
  size: t = "sm",
1102
- motionVariant: e = "auto",
1103
- motion: o,
1104
- className: a,
1105
- style: c,
1746
+ motionVariant: n = "auto",
1747
+ motion: a,
1748
+ className: o,
1749
+ style: r,
1106
1750
  children: i,
1107
- ...r
1751
+ ...c
1108
1752
  }) {
1109
- const u = B(F), s = A(o), f = bt();
1110
- return /* @__PURE__ */ n(at, { motion: o, children: /* @__PURE__ */ _(x.Portal, { children: [
1111
- /* @__PURE__ */ n(x.Overlay, { className: "facto-dialog-overlay", "data-motion": e, style: { ...u, ...s } }),
1112
- /* @__PURE__ */ n(
1113
- x.Content,
1753
+ const l = W(U), s = Y(a), h = Pt();
1754
+ return /* @__PURE__ */ e(gt, { motion: a, children: /* @__PURE__ */ u(F.Portal, { children: [
1755
+ /* @__PURE__ */ e(F.Overlay, { className: "facto-dialog-overlay", "data-motion": n, style: { ...l, ...s } }),
1756
+ /* @__PURE__ */ e(
1757
+ F.Content,
1114
1758
  {
1115
- ...r,
1116
- ref: f,
1117
- "data-motion": e,
1118
- style: { ...u, ...c, ...s },
1119
- className: h(
1759
+ ...c,
1760
+ ref: h,
1761
+ "data-motion": n,
1762
+ style: { ...l, ...r, ...s },
1763
+ className: _(
1120
1764
  "facto-theme",
1121
1765
  "facto-dialog",
1122
1766
  `facto-dialog--${t}`,
1123
- a
1767
+ o
1124
1768
  ),
1125
1769
  children: i
1126
1770
  }
1127
1771
  )
1128
1772
  ] }) });
1129
1773
  }
1130
- const Ae = x.Root, ze = x.Trigger, Oe = x.Close, He = Ft, je = At;
1131
- function We({
1774
+ const wn = F.Root, Cn = F.Trigger, Tn = F.Close, xn = be, Sn = _e;
1775
+ function Mn({
1132
1776
  side: t = "center",
1133
- motionVariant: e = "auto",
1134
- motion: o,
1135
- className: a,
1136
- style: c,
1777
+ motionVariant: n = "auto",
1778
+ motion: a,
1779
+ className: o,
1780
+ style: r,
1137
1781
  children: i,
1138
- ...r
1782
+ ...c
1139
1783
  }) {
1140
- const u = B(F), s = A(o), f = bt();
1141
- return /* @__PURE__ */ n(at, { motion: o, children: /* @__PURE__ */ _(x.Portal, { children: [
1142
- /* @__PURE__ */ n(x.Overlay, { className: "facto-dialog-overlay", "data-motion": e, style: { ...u, ...s } }),
1143
- /* @__PURE__ */ n(
1144
- x.Content,
1784
+ const l = W(U), s = Y(a), h = Pt();
1785
+ return /* @__PURE__ */ e(gt, { motion: a, children: /* @__PURE__ */ u(F.Portal, { children: [
1786
+ /* @__PURE__ */ e(F.Overlay, { className: "facto-dialog-overlay", "data-motion": n, style: { ...l, ...s } }),
1787
+ /* @__PURE__ */ e(
1788
+ F.Content,
1145
1789
  {
1146
- ...r,
1147
- ref: f,
1148
- "data-motion": e,
1149
- style: { ...u, ...c, ...s },
1150
- className: h(
1790
+ ...c,
1791
+ ref: h,
1792
+ "data-motion": n,
1793
+ style: { ...l, ...r, ...s },
1794
+ className: _(
1151
1795
  "facto-theme",
1152
1796
  "facto-sheet",
1153
1797
  `facto-sheet--${t}`,
1154
- a
1798
+ o
1155
1799
  ),
1156
1800
  children: i
1157
1801
  }
1158
1802
  )
1159
1803
  ] }) });
1160
1804
  }
1161
- function mt({
1805
+ function $t({
1162
1806
  width: t,
1163
- height: e,
1164
- circle: o,
1165
- className: a,
1166
- style: c,
1807
+ height: n,
1808
+ circle: a,
1809
+ className: o,
1810
+ style: r,
1167
1811
  ...i
1168
1812
  }) {
1169
- return /* @__PURE__ */ n(
1813
+ return /* @__PURE__ */ e(
1170
1814
  "span",
1171
1815
  {
1172
1816
  ...i,
1173
1817
  "aria-hidden": "true",
1174
- className: h(
1818
+ className: _(
1175
1819
  "facto-skeleton",
1176
- o && "facto-skeleton--circle",
1177
- a
1820
+ a && "facto-skeleton--circle",
1821
+ o
1178
1822
  ),
1179
- style: { ...c, width: t, height: e }
1823
+ style: { ...r, width: t, height: n }
1180
1824
  }
1181
1825
  );
1182
1826
  }
1183
- function Ve({
1827
+ function Rn({
1184
1828
  title: t,
1185
- description: e,
1186
- action: o,
1187
- icon: a,
1188
- className: c,
1829
+ description: n,
1830
+ action: a,
1831
+ icon: o,
1832
+ className: r,
1189
1833
  ...i
1190
1834
  }) {
1191
- return /* @__PURE__ */ _("div", { ...i, className: h("facto-empty-state", c), children: [
1192
- a && /* @__PURE__ */ n("div", { className: "facto-empty-state__icon", "aria-hidden": "true", children: a }),
1193
- /* @__PURE__ */ n("strong", { children: t }),
1194
- e && /* @__PURE__ */ n("p", { children: e }),
1195
- o && /* @__PURE__ */ n("div", { children: o })
1835
+ return /* @__PURE__ */ u("div", { ...i, className: _("facto-empty-state", r), children: [
1836
+ o && /* @__PURE__ */ e("div", { className: "facto-empty-state__icon", "aria-hidden": "true", children: o }),
1837
+ /* @__PURE__ */ e("strong", { children: t }),
1838
+ n && /* @__PURE__ */ e("p", { children: n }),
1839
+ a && /* @__PURE__ */ e("div", { children: a })
1196
1840
  ] });
1197
1841
  }
1198
- function qe({
1842
+ function $n({
1199
1843
  tone: t = "info",
1200
- title: e,
1201
- description: o,
1202
- action: a,
1203
- className: c,
1844
+ title: n,
1845
+ description: a,
1846
+ action: o,
1847
+ className: r,
1204
1848
  ...i
1205
1849
  }) {
1206
- return /* @__PURE__ */ _(
1850
+ return /* @__PURE__ */ u(
1207
1851
  "div",
1208
1852
  {
1209
1853
  ...i,
1210
1854
  role: t === "danger" ? "alert" : "status",
1211
- className: h("facto-notice", `facto-notice--${t}`, c),
1855
+ className: _("facto-notice", `facto-notice--${t}`, r),
1212
1856
  children: [
1213
- /* @__PURE__ */ _("div", { children: [
1214
- /* @__PURE__ */ n("strong", { children: e }),
1215
- o && /* @__PURE__ */ n("span", { children: o })
1857
+ /* @__PURE__ */ u("div", { children: [
1858
+ /* @__PURE__ */ e("strong", { children: n }),
1859
+ a && /* @__PURE__ */ e("span", { children: a })
1216
1860
  ] }),
1217
- a
1861
+ o
1218
1862
  ]
1219
1863
  }
1220
1864
  );
1221
1865
  }
1222
- function Ke({
1866
+ function Ln({
1223
1867
  gap: t = 3,
1224
- direction: e = "vertical",
1225
- align: o = "stretch",
1226
- justify: a = "start",
1227
- className: c,
1868
+ direction: n = "vertical",
1869
+ align: a = "stretch",
1870
+ justify: o = "start",
1871
+ className: r,
1228
1872
  ...i
1229
1873
  }) {
1230
- return /* @__PURE__ */ n(
1874
+ return /* @__PURE__ */ e(
1231
1875
  "div",
1232
1876
  {
1233
1877
  ...i,
1234
- className: h(
1878
+ className: _(
1235
1879
  "facto-stack",
1236
- `facto-stack--${e}`,
1880
+ `facto-stack--${n}`,
1237
1881
  `facto-stack--gap-${t}`,
1238
- `facto-stack--align-${o}`,
1239
- `facto-stack--justify-${a}`,
1240
- c
1882
+ `facto-stack--align-${a}`,
1883
+ `facto-stack--justify-${o}`,
1884
+ r
1241
1885
  )
1242
1886
  }
1243
1887
  );
1244
1888
  }
1245
- function Ye({ delayDuration: t = 300, ...e }) {
1246
- return /* @__PURE__ */ n(Q.Provider, { ...e, delayDuration: t });
1889
+ function In({ delayDuration: t = 300, ...n }) {
1890
+ return /* @__PURE__ */ e(st.Provider, { ...n, delayDuration: t });
1247
1891
  }
1248
- const Ge = Q.Root, Je = Q.Trigger;
1249
- function Ue({ variant: t = "default", className: e, style: o, sideOffset: a = 6, collisionPadding: c = 16, children: i, ...r }) {
1250
- const u = B(F), s = A();
1251
- return /* @__PURE__ */ n(Q.Portal, { children: /* @__PURE__ */ n(
1252
- Q.Content,
1892
+ const Bn = st.Root, En = st.Trigger;
1893
+ function Pn({ variant: t = "default", className: n, style: a, sideOffset: o = 6, collisionPadding: r = 16, children: i, ...c }) {
1894
+ const l = W(U), s = Y();
1895
+ return /* @__PURE__ */ e(st.Portal, { children: /* @__PURE__ */ e(
1896
+ st.Content,
1253
1897
  {
1254
- ...r,
1255
- sideOffset: a,
1256
- collisionPadding: c,
1257
- className: h("facto-theme", "facto-tooltip", t === "content" && "facto-tooltip--content", e),
1258
- style: { ...u, ...o, ...s },
1898
+ ...c,
1899
+ sideOffset: o,
1900
+ collisionPadding: r,
1901
+ className: _("facto-theme", "facto-tooltip", t === "content" && "facto-tooltip--content", n),
1902
+ style: { ...l, ...a, ...s },
1259
1903
  children: i
1260
1904
  }
1261
1905
  ) });
1262
1906
  }
1263
- function zt({ duration: t = 2600, ...e }) {
1264
- return /* @__PURE__ */ n(V.Provider, { ...e, duration: t });
1907
+ function ye({ duration: t = 2600, ...n }) {
1908
+ return /* @__PURE__ */ e(J.Provider, { ...n, duration: t });
1265
1909
  }
1266
- function Ot({ tone: t = "success", icon: e, className: o, style: a, motion: c, children: i, ...r }) {
1267
- const u = B(F), s = A(c);
1268
- return /* @__PURE__ */ n(at, { motion: c, children: /* @__PURE__ */ _(V.Root, { ...r, className: h("facto-theme", "facto-toast", `facto-toast--${t}`, o), style: { ...u, ...a, ...s }, children: [
1269
- /* @__PURE__ */ n("span", { className: "facto-toast__icon", "aria-hidden": "true", children: e ?? /* @__PURE__ */ n(Y, { name: t === "danger" ? "close" : t === "warning" ? "warning" : t === "info" ? "info" : "check" }) }),
1270
- /* @__PURE__ */ n("div", { className: "facto-toast__copy", children: i })
1910
+ function Ne({ tone: t = "success", icon: n, className: a, style: o, motion: r, children: i, ...c }) {
1911
+ const l = W(U), s = Y(r);
1912
+ return /* @__PURE__ */ e(gt, { motion: r, children: /* @__PURE__ */ u(J.Root, { ...c, className: _("facto-theme", "facto-toast", `facto-toast--${t}`, a), style: { ...l, ...o, ...s }, children: [
1913
+ /* @__PURE__ */ e("span", { className: "facto-toast__icon", "aria-hidden": "true", children: n ?? /* @__PURE__ */ e(ot, { name: t === "danger" ? "close" : t === "warning" ? "warning" : t === "info" ? "info" : "check" }) }),
1914
+ /* @__PURE__ */ e("div", { className: "facto-toast__copy", children: i })
1271
1915
  ] }) });
1272
1916
  }
1273
- function Ht({ className: t, ...e }) {
1274
- return /* @__PURE__ */ n(V.Title, { ...e, className: h("facto-toast__title", t) });
1917
+ function ke({ className: t, ...n }) {
1918
+ return /* @__PURE__ */ e(J.Title, { ...n, className: _("facto-toast__title", t) });
1275
1919
  }
1276
- function ht({ className: t, ...e }) {
1277
- return /* @__PURE__ */ n(V.Description, { ...e, className: h("facto-toast__description", t) });
1920
+ function Lt({ className: t, ...n }) {
1921
+ return /* @__PURE__ */ e(J.Description, { ...n, className: _("facto-toast__description", t) });
1278
1922
  }
1279
- function jt({ className: t, ...e }) {
1280
- return /* @__PURE__ */ n(V.Action, { ...e, className: h("facto-button", "facto-button--secondary", "facto-button--sm", t) });
1923
+ function we({ className: t, ...n }) {
1924
+ return /* @__PURE__ */ e(J.Action, { ...n, className: _("facto-button", "facto-button--secondary", "facto-button--sm", t) });
1281
1925
  }
1282
- function Wt({ className: t, children: e = /* @__PURE__ */ n(Y, { name: "close" }), "aria-label": o = "Dismiss notification", ...a }) {
1283
- return /* @__PURE__ */ n(V.Close, { ...a, "aria-label": o, className: h("facto-toast__close", t), children: e });
1926
+ function Ce({ className: t, children: n = /* @__PURE__ */ e(ot, { name: "close" }), "aria-label": a = "Dismiss notification", ...o }) {
1927
+ return /* @__PURE__ */ e(J.Close, { ...o, "aria-label": a, className: _("facto-toast__close", t), children: n });
1284
1928
  }
1285
- function Vt({ className: t, style: e, ...o }) {
1286
- const a = B(F), c = A(), [i, r] = H(!1);
1287
- return E(() => r(!0), []), i ? yt(/* @__PURE__ */ n(V.Viewport, { ...o, className: h("facto-toast-viewport", t), style: { ...a, ...e, ...c } }), document.body) : null;
1929
+ function Te({ className: t, style: n, ...a }) {
1930
+ const o = W(U), r = Y(), [i, c] = A(!1);
1931
+ return q(() => c(!0), []), i ? Kt(/* @__PURE__ */ e(J.Viewport, { ...a, className: _("facto-toast-viewport", t), style: { ...o, ...n, ...r } }), document.body) : null;
1288
1932
  }
1289
- function Ze({ value: t, defaultValue: e = "", onValueChange: o, clearLabel: a = "Clear search", label: c = "Search", helperText: i, error: r, id: u, containerClassName: s, className: f, disabled: m, readOnly: p, ...y }) {
1290
- const w = j(), C = u ?? w, M = r || i ? `${C}-description` : void 0, [v, l] = H(e), d = t ?? v, b = T(null);
1291
- E(() => {
1292
- const N = b.current?.form;
1933
+ function Dn({ value: t, defaultValue: n = "", onValueChange: a, clearLabel: o = "Clear search", label: r = "Search", helperText: i, error: c, id: l, containerClassName: s, className: h, disabled: f, readOnly: p, ...v }) {
1934
+ const k = G(), w = l ?? k, C = c || i ? `${w}-description` : void 0, [g, d] = A(n), m = t ?? g, y = x(null);
1935
+ q(() => {
1936
+ const N = y.current?.form;
1293
1937
  if (!N || t !== void 0) return;
1294
- const k = (R) => {
1938
+ const T = (L) => {
1295
1939
  queueMicrotask(() => {
1296
- R.defaultPrevented || (l(e), o?.(e));
1940
+ L.defaultPrevented || (d(n), a?.(n));
1297
1941
  });
1298
1942
  };
1299
- return N.addEventListener("reset", k), () => N.removeEventListener("reset", k);
1300
- }, [e, t, o]);
1301
- const g = (N) => {
1302
- t === void 0 && l(N), o?.(N);
1943
+ return N.addEventListener("reset", T), () => N.removeEventListener("reset", T);
1944
+ }, [n, t, a]);
1945
+ const b = (N) => {
1946
+ t === void 0 && d(N), a?.(N);
1303
1947
  };
1304
- return /* @__PURE__ */ _("div", { className: h("facto-field", s), children: [
1305
- c && /* @__PURE__ */ n("label", { className: "facto-field__label", htmlFor: C, children: c }),
1306
- /* @__PURE__ */ _("div", { className: "facto-search", children: [
1307
- /* @__PURE__ */ _("svg", { className: "facto-search__icon", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", "aria-hidden": "true", children: [
1308
- /* @__PURE__ */ n("circle", { cx: "10.5", cy: "10.5", r: "6.5" }),
1309
- /* @__PURE__ */ n("path", { d: "m16 16 5 5" })
1948
+ return /* @__PURE__ */ u("div", { className: _("facto-field", s), children: [
1949
+ r && /* @__PURE__ */ e("label", { className: "facto-field__label", htmlFor: w, children: r }),
1950
+ /* @__PURE__ */ u("div", { className: "facto-search", children: [
1951
+ /* @__PURE__ */ u("svg", { className: "facto-search__icon", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", "aria-hidden": "true", children: [
1952
+ /* @__PURE__ */ e("circle", { cx: "10.5", cy: "10.5", r: "6.5" }),
1953
+ /* @__PURE__ */ e("path", { d: "m16 16 5 5" })
1310
1954
  ] }),
1311
- /* @__PURE__ */ n(
1955
+ /* @__PURE__ */ e(
1312
1956
  "input",
1313
1957
  {
1314
- ...y,
1315
- ref: b,
1316
- id: C,
1958
+ ...v,
1959
+ ref: y,
1960
+ id: w,
1317
1961
  type: "search",
1318
- disabled: m,
1962
+ disabled: f,
1319
1963
  readOnly: p,
1320
- value: d,
1321
- onChange: (N) => g(N.target.value),
1322
- "aria-invalid": !!r || y["aria-invalid"],
1323
- "aria-describedby": G(y["aria-describedby"], M),
1324
- className: h("facto-input", "facto-search__input", !!r && "facto-input--error", f)
1964
+ value: m,
1965
+ onChange: (N) => b(N.target.value),
1966
+ "aria-invalid": !!c || v["aria-invalid"],
1967
+ "aria-describedby": ct(v["aria-describedby"], C),
1968
+ className: _("facto-input", "facto-search__input", !!c && "facto-input--error", h)
1325
1969
  }
1326
1970
  ),
1327
- d && !p && /* @__PURE__ */ n(
1971
+ m && !p && /* @__PURE__ */ e(
1328
1972
  "button",
1329
1973
  {
1330
1974
  type: "button",
1331
1975
  className: "facto-search__clear",
1332
- disabled: m,
1333
- "aria-label": a,
1976
+ disabled: f,
1977
+ "aria-label": o,
1334
1978
  onClick: () => {
1335
- g(""), b.current?.focus();
1979
+ b(""), y.current?.focus();
1336
1980
  },
1337
- children: /* @__PURE__ */ n(Y, { name: "close", size: 16 })
1981
+ children: /* @__PURE__ */ e(ot, { name: "close", size: 16 })
1338
1982
  }
1339
1983
  )
1340
1984
  ] }),
1341
- (r || i) && /* @__PURE__ */ n("span", { id: M, className: h("facto-field__message", !!r && "facto-field__message--error"), children: r ?? i })
1985
+ (c || i) && /* @__PURE__ */ e("span", { id: C, className: _("facto-field__message", !!c && "facto-field__message--error"), children: c ?? i })
1342
1986
  ] });
1343
1987
  }
1344
- function Qe({ className: t, ...e }) {
1345
- return /* @__PURE__ */ n(Et, { ...e, type: "search", className: h("facto-search-field", t) });
1988
+ function An({ className: t, ...n }) {
1989
+ return /* @__PURE__ */ e(ge, { ...n, type: "search", className: _("facto-search-field", t) });
1346
1990
  }
1347
- const Xe = Z.Root, tn = Z.Trigger, en = Z.Close;
1348
- function nn({ className: t, style: e, sideOffset: o = 8, collisionPadding: a = 16, ...c }) {
1349
- const i = B(F), r = A();
1350
- return /* @__PURE__ */ n(Z.Portal, { children: /* @__PURE__ */ n(Z.Content, { ...c, sideOffset: o, collisionPadding: a, className: h("facto-theme", "facto-popover", t), style: { ...i, ...e, ...r } }) });
1991
+ const zn = it.Root, Fn = it.Trigger, jn = it.Close;
1992
+ function On({ className: t, style: n, sideOffset: a = 8, collisionPadding: o = 16, ...r }) {
1993
+ const i = W(U), c = Y();
1994
+ return /* @__PURE__ */ e(it.Portal, { children: /* @__PURE__ */ e(it.Content, { ...r, sideOffset: a, collisionPadding: o, className: _("facto-theme", "facto-popover", t), style: { ...i, ...n, ...c } }) });
1351
1995
  }
1352
- function on({ modal: t = !1, ...e }) {
1353
- return /* @__PURE__ */ n(K.Root, { ...e, modal: t });
1996
+ function Wn({ modal: t = !1, ...n }) {
1997
+ return /* @__PURE__ */ e(at.Root, { ...n, modal: t });
1354
1998
  }
1355
- const an = K.Trigger;
1356
- function rn({ className: t, style: e, sideOffset: o = 8, collisionPadding: a = 16, ...c }) {
1357
- const i = B(F), r = A();
1358
- return /* @__PURE__ */ n(K.Portal, { children: /* @__PURE__ */ n(K.Content, { ...c, sideOffset: o, collisionPadding: a, className: h("facto-theme", "facto-menu", t), style: { ...i, ...e, ...r } }) });
1999
+ const Vn = at.Trigger;
2000
+ function Hn({ className: t, style: n, sideOffset: a = 8, collisionPadding: o = 16, ...r }) {
2001
+ const i = W(U), c = Y();
2002
+ return /* @__PURE__ */ e(at.Portal, { children: /* @__PURE__ */ e(at.Content, { ...r, sideOffset: a, collisionPadding: o, className: _("facto-theme", "facto-menu", t), style: { ...i, ...n, ...c } }) });
1359
2003
  }
1360
- function cn({ className: t, ...e }) {
1361
- return /* @__PURE__ */ n(K.Item, { ...e, className: h("facto-menu-item", t) });
2004
+ function qn({ className: t, ...n }) {
2005
+ return /* @__PURE__ */ e(at.Item, { ...n, className: _("facto-menu-item", t) });
1362
2006
  }
1363
- function sn({ className: t, ...e }) {
1364
- return /* @__PURE__ */ n(K.Separator, { ...e, className: h("facto-menu-separator", t) });
2007
+ function Un({ className: t, ...n }) {
2008
+ return /* @__PURE__ */ e(at.Separator, { ...n, className: _("facto-menu-separator", t) });
1365
2009
  }
1366
- function ln({ selected: t = !1, className: e, type: o = "button", ...a }) {
1367
- return /* @__PURE__ */ n("button", { ...a, type: o, "aria-pressed": t, className: h("facto-filter-chip", e) });
2010
+ function Gn({ selected: t = !1, className: n, type: a = "button", ...o }) {
2011
+ return /* @__PURE__ */ e("button", { ...o, type: a, "aria-pressed": t, className: _("facto-filter-chip", n) });
1368
2012
  }
1369
- function dn({ rows: t = 3, label: e = "Loading", className: o, ...a }) {
1370
- const c = Number.isFinite(t) ? Math.min(20, Math.max(1, Math.floor(t))) : 3;
1371
- return /* @__PURE__ */ n("div", { ...a, className: h("facto-list-skeleton", o), role: "status", "aria-label": e, children: Array.from({ length: c }, (i, r) => /* @__PURE__ */ _("div", { "aria-hidden": "true", className: "facto-list-skeleton__row", children: [
1372
- /* @__PURE__ */ n(mt, { style: { width: 32, height: 32 } }),
1373
- /* @__PURE__ */ n(mt, { style: { width: "60%", height: 16 } })
1374
- ] }, r)) });
2013
+ function Kn({ rows: t = 3, label: n = "Loading", className: a, ...o }) {
2014
+ const r = Number.isFinite(t) ? Math.min(20, Math.max(1, Math.floor(t))) : 3;
2015
+ return /* @__PURE__ */ e("div", { ...o, className: _("facto-list-skeleton", a), role: "status", "aria-label": n, children: Array.from({ length: r }, (i, c) => /* @__PURE__ */ u("div", { "aria-hidden": "true", className: "facto-list-skeleton__row", children: [
2016
+ /* @__PURE__ */ e($t, { style: { width: 32, height: 32 } }),
2017
+ /* @__PURE__ */ e($t, { style: { width: "60%", height: 16 } })
2018
+ ] }, c)) });
1375
2019
  }
1376
2020
  export {
1377
- Jt as AnimatedDisclosure,
1378
- Ut as AnimatedFeedback,
1379
- Bt as Avatar,
1380
- Me as Badge,
1381
- he as Button,
1382
- ge as Card,
1383
- Se as Checkbox,
1384
- Zt as ContentReveal,
1385
- be as DashboardGrid,
1386
- Le as Dialog,
1387
- Ee as DialogClose,
1388
- Fe as DialogContent,
1389
- At as DialogDescription,
1390
- Ft as DialogTitle,
1391
- De as DialogTrigger,
1392
- on as DropdownMenu,
1393
- rn as DropdownMenuContent,
1394
- cn as DropdownMenuItem,
1395
- sn as DropdownMenuSeparator,
1396
- an as DropdownMenuTrigger,
1397
- Ve as EmptyState,
1398
- Ze as EnhancedSearchField,
1399
- oe as ErrorState,
1400
- at as FactoMotionProvider,
1401
- ue as FactoTheme,
1402
- ie as Field,
1403
- ln as FilterChip,
1404
- Y as Icon,
1405
- pe as IconButton,
1406
- ee as ListGroup,
1407
- te as ListRow,
1408
- dn as ListSkeleton,
1409
- ae as LoadingMore,
1410
- ne as LogoStack,
1411
- me as ModalFooter,
1412
- fe as ModalHeader,
1413
- qe as Notice,
1414
- le as NotificationsProvider,
1415
- ce as OtpInput,
1416
- Xe as Popover,
1417
- en as PopoverClose,
1418
- nn as PopoverContent,
1419
- tn as PopoverTrigger,
1420
- se as ResendCodeButton,
1421
- Qe as SearchField,
1422
- Re as Select,
1423
- Xt as SelectionMotion,
1424
- Ae as Sheet,
1425
- Oe as SheetClose,
1426
- We as SheetContent,
1427
- je as SheetDescription,
1428
- He as SheetTitle,
1429
- ze as SheetTrigger,
1430
- mt as Skeleton,
1431
- Ke as Stack,
1432
- re as StepChecklist,
1433
- Gt as StepTransition,
1434
- Nt as Surface,
1435
- $e as Switch,
1436
- xe as Tabs,
1437
- Pe as TabsContent,
1438
- Be as TabsList,
1439
- Ie as TabsTrigger,
1440
- Et as TextField,
1441
- Te as Textarea,
1442
- Ot as Toast,
1443
- jt as ToastAction,
1444
- Wt as ToastClose,
1445
- ht as ToastDescription,
1446
- zt as ToastProvider,
1447
- Ht as ToastTitle,
1448
- Vt as ToastViewport,
1449
- Ge as Tooltip,
1450
- Ue as TooltipContent,
1451
- Ye as TooltipProvider,
1452
- Je as TooltipTrigger,
1453
- ve as Widget,
1454
- ke as WidgetAction,
1455
- we as WidgetAmount,
1456
- _e as WidgetHeader,
1457
- ye as WidgetKeyValue,
1458
- Ne as WidgetList,
1459
- Ce as WidgetRow,
1460
- S as motionTokens,
1461
- Qt as useKeyedListMotion,
1462
- tt as useMotion,
1463
- de as useToast
2021
+ Re as AnimatedDisclosure,
2022
+ $e as AnimatedFeedback,
2023
+ Ve as AuthFlowShell,
2024
+ re as Avatar,
2025
+ un as Badge,
2026
+ Ze as Button,
2027
+ tn as Card,
2028
+ mn as Checkbox,
2029
+ Le as ContentReveal,
2030
+ me as CopyableSecretKey,
2031
+ nn as DashboardGrid,
2032
+ _n as Dialog,
2033
+ Nn as DialogClose,
2034
+ kn as DialogContent,
2035
+ _e as DialogDescription,
2036
+ be as DialogTitle,
2037
+ yn as DialogTrigger,
2038
+ Wn as DropdownMenu,
2039
+ Hn as DropdownMenuContent,
2040
+ qn as DropdownMenuItem,
2041
+ Un as DropdownMenuSeparator,
2042
+ Vn as DropdownMenuTrigger,
2043
+ He as EmailVerificationStep,
2044
+ Rn as EmptyState,
2045
+ Dn as EnhancedSearchField,
2046
+ Ae as ErrorState,
2047
+ gt as FactoMotionProvider,
2048
+ Ye as FactoTheme,
2049
+ je as Field,
2050
+ Gn as FilterChip,
2051
+ ot as Icon,
2052
+ Je as IconButton,
2053
+ he as IdentityEchoPill,
2054
+ Pe as ListGroup,
2055
+ Ee as ListRow,
2056
+ Kn as ListSkeleton,
2057
+ ze as LoadingMore,
2058
+ De as LogoStack,
2059
+ Xe as ModalFooter,
2060
+ Qe as ModalHeader,
2061
+ $n as Notice,
2062
+ Oe as NotificationsProvider,
2063
+ pt as OtpInput,
2064
+ qe as PasskeySetupCard,
2065
+ zn as Popover,
2066
+ jn as PopoverClose,
2067
+ On as PopoverContent,
2068
+ Fn as PopoverTrigger,
2069
+ Ge as RecoveryCodesStep,
2070
+ Dt as ResendCodeButton,
2071
+ An as SearchField,
2072
+ fn as Select,
2073
+ Ke as SelectionCardGroup,
2074
+ Be as SelectionMotion,
2075
+ wn as Sheet,
2076
+ Tn as SheetClose,
2077
+ Mn as SheetContent,
2078
+ Sn as SheetDescription,
2079
+ xn as SheetTitle,
2080
+ Cn as SheetTrigger,
2081
+ $t as Skeleton,
2082
+ Ln as Stack,
2083
+ Fe as StepChecklist,
2084
+ yt as StepProgress,
2085
+ oe as StepTransition,
2086
+ Ft as Surface,
2087
+ hn as Switch,
2088
+ pn as Tabs,
2089
+ bn as TabsContent,
2090
+ vn as TabsList,
2091
+ gn as TabsTrigger,
2092
+ ge as TextField,
2093
+ dn as Textarea,
2094
+ Ne as Toast,
2095
+ we as ToastAction,
2096
+ Ce as ToastClose,
2097
+ Lt as ToastDescription,
2098
+ ye as ToastProvider,
2099
+ ke as ToastTitle,
2100
+ Te as ToastViewport,
2101
+ Bn as Tooltip,
2102
+ Pn as TooltipContent,
2103
+ In as TooltipProvider,
2104
+ En as TooltipTrigger,
2105
+ Ue as TotpEnrollmentCard,
2106
+ en as Widget,
2107
+ sn as WidgetAction,
2108
+ rn as WidgetAmount,
2109
+ an as WidgetHeader,
2110
+ cn as WidgetKeyValue,
2111
+ on as WidgetList,
2112
+ ln as WidgetRow,
2113
+ pe as formatRecoveryCodesText,
2114
+ z as motionTokens,
2115
+ Ie as useKeyedListMotion,
2116
+ ut as useMotion,
2117
+ We as useToast
1464
2118
  };