@enya-learning/nova 0.4.3 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/README.md +8 -19
  2. package/dist/chunks/dist-fahbq1psobj0ox6s.js +1327 -0
  3. package/dist/chunks/dist-fahbq1psobj0ox6s.js.map +1 -0
  4. package/dist/chunks/dist-o8x0ip0z71xkr2oh.js +37 -0
  5. package/dist/chunks/dist-o8x0ip0z71xkr2oh.js.map +1 -0
  6. package/dist/components/accordion.js +62 -0
  7. package/dist/components/accordion.js.map +1 -0
  8. package/dist/components/alert-dialog.js +108 -0
  9. package/dist/components/alert-dialog.js.map +1 -0
  10. package/dist/components/alert.js +49 -0
  11. package/dist/components/alert.js.map +1 -0
  12. package/dist/components/aspect-ratio.js +16 -0
  13. package/dist/components/aspect-ratio.js.map +1 -0
  14. package/dist/components/avatar.js +58 -0
  15. package/dist/components/avatar.js.map +1 -0
  16. package/dist/components/badge.js +33 -0
  17. package/dist/components/badge.js.map +1 -0
  18. package/dist/components/box.js +16 -0
  19. package/dist/components/box.js.map +1 -0
  20. package/dist/components/breadcrumb.js +85 -0
  21. package/dist/components/breadcrumb.js.map +1 -0
  22. package/dist/components/button-group.js +47 -0
  23. package/dist/components/button-group.js.map +1 -0
  24. package/dist/components/button.js +48 -3
  25. package/dist/components/button.js.map +1 -0
  26. package/dist/components/calendar.js +3004 -0
  27. package/dist/components/calendar.js.map +1 -0
  28. package/dist/components/card.js +65 -0
  29. package/dist/components/card.js.map +1 -0
  30. package/dist/components/carousel.js +1198 -0
  31. package/dist/components/carousel.js.map +1 -0
  32. package/dist/components/chart.js +10596 -0
  33. package/dist/components/chart.js.map +1 -0
  34. package/dist/components/checkbox.js +23 -0
  35. package/dist/components/checkbox.js.map +1 -0
  36. package/dist/components/collapsible.js +28 -0
  37. package/dist/components/collapsible.js.map +1 -0
  38. package/dist/components/combobox.js +192 -0
  39. package/dist/components/combobox.js.map +1 -0
  40. package/dist/components/command.js +663 -0
  41. package/dist/components/command.js.map +1 -0
  42. package/dist/components/context-menu.js +153 -0
  43. package/dist/components/context-menu.js.map +1 -0
  44. package/dist/components/dialog.js +104 -0
  45. package/dist/components/dialog.js.map +1 -0
  46. package/dist/components/direction.js +6 -0
  47. package/dist/components/drawer.js +1042 -0
  48. package/dist/components/drawer.js.map +1 -0
  49. package/dist/components/dropdown-menu.js +157 -0
  50. package/dist/components/dropdown-menu.js.map +1 -0
  51. package/dist/components/empty.js +67 -0
  52. package/dist/components/empty.js.map +1 -0
  53. package/dist/components/enya-logo.js +42 -42
  54. package/dist/components/enya-logo.js.map +1 -1
  55. package/dist/components/field.js +119 -0
  56. package/dist/components/field.js.map +1 -0
  57. package/dist/components/heading.js +39 -0
  58. package/dist/components/heading.js.map +1 -0
  59. package/dist/components/hover-card.js +40 -0
  60. package/dist/components/hover-card.js.map +1 -0
  61. package/dist/components/input-group.js +85 -0
  62. package/dist/components/input-group.js.map +1 -0
  63. package/dist/components/input-otp.js +417 -0
  64. package/dist/components/input-otp.js.map +1 -0
  65. package/dist/components/input.js +18 -0
  66. package/dist/components/input.js.map +1 -0
  67. package/dist/components/item.js +133 -0
  68. package/dist/components/item.js.map +1 -0
  69. package/dist/components/kbd.js +23 -0
  70. package/dist/components/kbd.js.map +1 -0
  71. package/dist/components/label.js +16 -0
  72. package/dist/components/label.js.map +1 -0
  73. package/dist/components/menubar.js +154 -0
  74. package/dist/components/menubar.js.map +1 -0
  75. package/dist/components/native-select.js +45 -0
  76. package/dist/components/native-select.js.map +1 -0
  77. package/dist/components/navigation-menu.js +95 -0
  78. package/dist/components/navigation-menu.js.map +1 -0
  79. package/dist/components/pagination.js +98 -0
  80. package/dist/components/pagination.js.map +1 -0
  81. package/dist/components/popover.js +62 -0
  82. package/dist/components/popover.js.map +1 -0
  83. package/dist/components/progress.js +50 -0
  84. package/dist/components/progress.js.map +1 -0
  85. package/dist/components/radio-group.js +30 -0
  86. package/dist/components/radio-group.js.map +1 -0
  87. package/dist/components/resizable.js +1562 -0
  88. package/dist/components/resizable.js.map +1 -0
  89. package/dist/components/scroll-area.js +40 -0
  90. package/dist/components/scroll-area.js.map +1 -0
  91. package/dist/components/select.js +116 -0
  92. package/dist/components/select.js.map +1 -0
  93. package/dist/components/separator.js +17 -0
  94. package/dist/components/separator.js.map +1 -0
  95. package/dist/components/sheet.js +99 -0
  96. package/dist/components/sheet.js.map +1 -0
  97. package/dist/components/sidebar.js +399 -0
  98. package/dist/components/sidebar.js.map +1 -0
  99. package/dist/components/skeleton.js +15 -0
  100. package/dist/components/skeleton.js.map +1 -0
  101. package/dist/components/slider.js +36 -0
  102. package/dist/components/slider.js.map +1 -0
  103. package/dist/components/sonner.js +738 -0
  104. package/dist/components/sonner.js.map +1 -0
  105. package/dist/components/spinner.js +19 -0
  106. package/dist/components/spinner.js.map +1 -0
  107. package/dist/components/switch.js +21 -0
  108. package/dist/components/switch.js.map +1 -0
  109. package/dist/components/table.js +76 -0
  110. package/dist/components/table.js.map +1 -0
  111. package/dist/components/tabs.js +51 -0
  112. package/dist/components/tabs.js.map +1 -0
  113. package/dist/components/text.js +47 -0
  114. package/dist/components/text.js.map +1 -0
  115. package/dist/components/textarea.js +16 -0
  116. package/dist/components/textarea.js.map +1 -0
  117. package/dist/components/toggle-group.js +55 -0
  118. package/dist/components/toggle-group.js.map +1 -0
  119. package/dist/components/toggle.js +39 -0
  120. package/dist/components/toggle.js.map +1 -0
  121. package/dist/components/tooltip.js +46 -0
  122. package/dist/components/tooltip.js.map +1 -0
  123. package/dist/index.js +25 -23241
  124. package/dist/src/components/badge/badge.d.ts +1 -1
  125. package/dist/src/components/box/box.d.ts +7 -0
  126. package/dist/src/components/box/index.d.ts +1 -0
  127. package/dist/src/components/button/button.d.ts +1 -1
  128. package/dist/src/components/heading/heading.d.ts +15 -0
  129. package/dist/src/components/heading/index.d.ts +1 -0
  130. package/dist/src/components/item/item.d.ts +1 -1
  131. package/dist/src/components/spinner/spinner.d.ts +2 -1
  132. package/dist/src/components/tabs/tabs.d.ts +1 -1
  133. package/dist/src/components/text/index.d.ts +1 -0
  134. package/dist/src/components/text/text.d.ts +13 -0
  135. package/dist/src/index.d.ts +4 -53
  136. package/dist/styles/nova-binding.css +355 -255
  137. package/dist/styles/nova.css +205 -38
  138. package/dist/styles/typography.css +22 -130
  139. package/package.json +31 -10
  140. package/src/eslint/no-primitive-colors.js +2 -2
  141. package/src/eslint/no-primitive-colors.test.ts +97 -0
  142. package/dist/chunks/button-kvgr8g13fe959ju0.js +0 -81
  143. package/dist/chunks/button-kvgr8g13fe959ju0.js.map +0 -1
  144. package/dist/index.js.map +0 -1
  145. package/dist/styles/globals.css +0 -77
  146. package/dist/styles/theme-nova.css +0 -201
@@ -0,0 +1,1327 @@
1
+ "use client";
2
+ import { Fragment as ve, jsx as g, jsxs as me } from "react/jsx-runtime";
3
+ import * as i from "react";
4
+ import { useState as st } from "react";
5
+ import * as ut from "react-dom";
6
+ import lt from "react-dom";
7
+ var Gn = !!(typeof window < "u" && window.document && window.document.createElement);
8
+ function T(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
9
+ return function(o) {
10
+ if (e?.(o), n === !1 || !o.defaultPrevented) return t?.(o);
11
+ };
12
+ }
13
+ function pe(e, t) {
14
+ if (typeof e == "function") return e(t);
15
+ e != null && (e.current = t);
16
+ }
17
+ function Ae(...e) {
18
+ return (t) => {
19
+ let n = !1;
20
+ const r = e.map((o) => {
21
+ const a = pe(o, t);
22
+ return !n && typeof a == "function" && (n = !0), a;
23
+ });
24
+ if (n) return () => {
25
+ for (let o = 0; o < r.length; o++) {
26
+ const a = r[o];
27
+ typeof a == "function" ? a() : pe(e[o], null);
28
+ }
29
+ };
30
+ };
31
+ }
32
+ function x(...e) {
33
+ return i.useCallback(Ae(...e), e);
34
+ }
35
+ function ft(e, t) {
36
+ const n = i.createContext(t), r = (a) => {
37
+ const { children: s, ...c } = a, f = i.useMemo(() => c, Object.values(c));
38
+ return /* @__PURE__ */ g(n.Provider, {
39
+ value: f,
40
+ children: s
41
+ });
42
+ };
43
+ r.displayName = e + "Provider";
44
+ function o(a) {
45
+ const s = i.useContext(n);
46
+ if (s) return s;
47
+ if (t !== void 0) return t;
48
+ throw new Error(`\`${a}\` must be used within \`${e}\``);
49
+ }
50
+ return [r, o];
51
+ }
52
+ function dt(e, t = []) {
53
+ let n = [];
54
+ function r(a, s) {
55
+ const c = i.createContext(s), f = n.length;
56
+ n = [...n, s];
57
+ const u = (v) => {
58
+ const { scope: p, children: h, ...C } = v, l = p?.[e]?.[f] || c, m = i.useMemo(() => C, Object.values(C));
59
+ return /* @__PURE__ */ g(l.Provider, {
60
+ value: m,
61
+ children: h
62
+ });
63
+ };
64
+ u.displayName = a + "Provider";
65
+ function d(v, p) {
66
+ const h = p?.[e]?.[f] || c, C = i.useContext(h);
67
+ if (C) return C;
68
+ if (s !== void 0) return s;
69
+ throw new Error(`\`${v}\` must be used within \`${a}\``);
70
+ }
71
+ return [u, d];
72
+ }
73
+ const o = () => {
74
+ const a = n.map((s) => i.createContext(s));
75
+ return function(c) {
76
+ const f = c?.[e] || a;
77
+ return i.useMemo(() => ({ [`__scope${e}`]: {
78
+ ...c,
79
+ [e]: f
80
+ } }), [c, f]);
81
+ };
82
+ };
83
+ return o.scopeName = e, [r, vt(o, ...t)];
84
+ }
85
+ function vt(...e) {
86
+ const t = e[0];
87
+ if (e.length === 1) return t;
88
+ const n = () => {
89
+ const r = e.map((o) => ({
90
+ useScope: o(),
91
+ scopeName: o.scopeName
92
+ }));
93
+ return function(a) {
94
+ const s = r.reduce((c, { useScope: f, scopeName: u }) => {
95
+ const d = f(a)[`__scope${u}`];
96
+ return {
97
+ ...c,
98
+ ...d
99
+ };
100
+ }, {});
101
+ return i.useMemo(() => ({ [`__scope${t.scopeName}`]: s }), [s]);
102
+ };
103
+ };
104
+ return n.scopeName = t.scopeName, n;
105
+ }
106
+ var U = globalThis?.document ? i.useLayoutEffect : () => {
107
+ }, mt = i[" useId ".trim().toString()] || (() => {
108
+ }), pt = 0;
109
+ function J(e) {
110
+ const [t, n] = i.useState(mt());
111
+ return U(() => {
112
+ e || n((r) => r ?? String(pt++));
113
+ }, [e]), e || (t ? `radix-${t}` : "");
114
+ }
115
+ var ht = i[" useInsertionEffect ".trim().toString()] || U;
116
+ function gt({ prop: e, defaultProp: t, onChange: n = () => {
117
+ }, caller: r }) {
118
+ const [o, a, s] = yt({
119
+ defaultProp: t,
120
+ onChange: n
121
+ }), c = e !== void 0, f = c ? e : o;
122
+ {
123
+ const u = i.useRef(e !== void 0);
124
+ i.useEffect(() => {
125
+ const d = u.current;
126
+ d !== c && console.warn(`${r} is changing from ${d ? "controlled" : "uncontrolled"} to ${c ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`), u.current = c;
127
+ }, [c, r]);
128
+ }
129
+ return [f, i.useCallback((u) => {
130
+ if (c) {
131
+ const d = Et(u) ? u(e) : u;
132
+ d !== e && s.current?.(d);
133
+ } else a(u);
134
+ }, [
135
+ c,
136
+ e,
137
+ a,
138
+ s
139
+ ])];
140
+ }
141
+ function yt({ defaultProp: e, onChange: t }) {
142
+ const [n, r] = i.useState(e), o = i.useRef(n), a = i.useRef(t);
143
+ return ht(() => {
144
+ a.current = t;
145
+ }, [t]), i.useEffect(() => {
146
+ o.current !== n && (a.current?.(n), o.current = n);
147
+ }, [n, o]), [
148
+ n,
149
+ r,
150
+ a
151
+ ];
152
+ }
153
+ function Et(e) {
154
+ return typeof e == "function";
155
+ }
156
+ // @__NO_SIDE_EFFECTS__
157
+ function Te(e) {
158
+ const t = /* @__PURE__ */ bt(e), n = i.forwardRef((r, o) => {
159
+ const { children: a, ...s } = r, c = i.Children.toArray(a), f = c.find(wt);
160
+ if (f) {
161
+ const u = f.props.children, d = c.map((v) => v === f ? i.Children.count(u) > 1 ? i.Children.only(null) : i.isValidElement(u) ? u.props.children : null : v);
162
+ return /* @__PURE__ */ g(t, {
163
+ ...s,
164
+ ref: o,
165
+ children: i.isValidElement(u) ? i.cloneElement(u, void 0, d) : null
166
+ });
167
+ }
168
+ return /* @__PURE__ */ g(t, {
169
+ ...s,
170
+ ref: o,
171
+ children: a
172
+ });
173
+ });
174
+ return n.displayName = `${e}.Slot`, n;
175
+ }
176
+ // @__NO_SIDE_EFFECTS__
177
+ function bt(e) {
178
+ const t = i.forwardRef((n, r) => {
179
+ const { children: o, ...a } = n;
180
+ if (i.isValidElement(o)) {
181
+ const s = Rt(o), c = St(a, o.props);
182
+ return o.type !== i.Fragment && (c.ref = r ? Ae(r, s) : s), i.cloneElement(o, c);
183
+ }
184
+ return i.Children.count(o) > 1 ? i.Children.only(null) : null;
185
+ });
186
+ return t.displayName = `${e}.SlotClone`, t;
187
+ }
188
+ var Ct = /* @__PURE__ */ Symbol("radix.slottable");
189
+ function wt(e) {
190
+ return i.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === Ct;
191
+ }
192
+ function St(e, t) {
193
+ const n = { ...t };
194
+ for (const r in t) {
195
+ const o = e[r], a = t[r];
196
+ /^on[A-Z]/.test(r) ? o && a ? n[r] = (...s) => {
197
+ const c = a(...s);
198
+ return o(...s), c;
199
+ } : o && (n[r] = o) : r === "style" ? n[r] = {
200
+ ...o,
201
+ ...a
202
+ } : r === "className" && (n[r] = [o, a].filter(Boolean).join(" "));
203
+ }
204
+ return {
205
+ ...e,
206
+ ...n
207
+ };
208
+ }
209
+ function Rt(e) {
210
+ let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
211
+ return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
212
+ }
213
+ var O = [
214
+ "a",
215
+ "button",
216
+ "div",
217
+ "form",
218
+ "h2",
219
+ "h3",
220
+ "img",
221
+ "input",
222
+ "label",
223
+ "li",
224
+ "nav",
225
+ "ol",
226
+ "p",
227
+ "select",
228
+ "span",
229
+ "svg",
230
+ "ul"
231
+ ].reduce((e, t) => {
232
+ const n = /* @__PURE__ */ Te(`Primitive.${t}`), r = i.forwardRef((o, a) => {
233
+ const { asChild: s, ...c } = o, f = s ? n : t;
234
+ return typeof window < "u" && (window[/* @__PURE__ */ Symbol.for("radix-ui")] = !0), /* @__PURE__ */ g(f, {
235
+ ...c,
236
+ ref: a
237
+ });
238
+ });
239
+ return r.displayName = `Primitive.${t}`, {
240
+ ...e,
241
+ [t]: r
242
+ };
243
+ }, {});
244
+ function Pt(e, t) {
245
+ e && ut.flushSync(() => e.dispatchEvent(t));
246
+ }
247
+ function $(e) {
248
+ const t = i.useRef(e);
249
+ return i.useEffect(() => {
250
+ t.current = e;
251
+ }), i.useMemo(() => (...n) => t.current?.(...n), []);
252
+ }
253
+ function Dt(e, t = globalThis?.document) {
254
+ const n = $(e);
255
+ i.useEffect(() => {
256
+ const r = (o) => {
257
+ o.key === "Escape" && n(o);
258
+ };
259
+ return t.addEventListener("keydown", r, { capture: !0 }), () => t.removeEventListener("keydown", r, { capture: !0 });
260
+ }, [n, t]);
261
+ }
262
+ var Nt = "DismissableLayer", ce = "dismissableLayer.update", Ot = "dismissableLayer.pointerDownOutside", At = "dismissableLayer.focusOutside", he, Me = i.createContext({
263
+ layers: /* @__PURE__ */ new Set(),
264
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
265
+ branches: /* @__PURE__ */ new Set()
266
+ }), Ie = i.forwardRef((e, t) => {
267
+ const { disableOutsidePointerEvents: n = !1, onEscapeKeyDown: r, onPointerDownOutside: o, onFocusOutside: a, onInteractOutside: s, onDismiss: c, ...f } = e, u = i.useContext(Me), [d, v] = i.useState(null), p = d?.ownerDocument ?? globalThis?.document, [, h] = i.useState({}), C = x(t, (E) => v(E)), l = Array.from(u.layers), [m] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), w = l.indexOf(m), S = d ? l.indexOf(d) : -1, b = u.layersWithOutsidePointerEventsDisabled.size > 0, y = S >= w, N = It((E) => {
268
+ const _ = E.target, M = [...u.branches].some((L) => L.contains(_));
269
+ !y || M || (o?.(E), s?.(E), E.defaultPrevented || c?.());
270
+ }, p), R = xt((E) => {
271
+ const _ = E.target;
272
+ [...u.branches].some((M) => M.contains(_)) || (a?.(E), s?.(E), E.defaultPrevented || c?.());
273
+ }, p);
274
+ return Dt((E) => {
275
+ S === u.layers.size - 1 && (r?.(E), !E.defaultPrevented && c && (E.preventDefault(), c()));
276
+ }, p), i.useEffect(() => {
277
+ if (d)
278
+ return n && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (he = p.body.style.pointerEvents, p.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(d)), u.layers.add(d), ge(), () => {
279
+ n && u.layersWithOutsidePointerEventsDisabled.size === 1 && (p.body.style.pointerEvents = he);
280
+ };
281
+ }, [
282
+ d,
283
+ p,
284
+ n,
285
+ u
286
+ ]), i.useEffect(() => () => {
287
+ d && (u.layers.delete(d), u.layersWithOutsidePointerEventsDisabled.delete(d), ge());
288
+ }, [d, u]), i.useEffect(() => {
289
+ const E = () => h({});
290
+ return document.addEventListener(ce, E), () => document.removeEventListener(ce, E);
291
+ }, []), /* @__PURE__ */ g(O.div, {
292
+ ...f,
293
+ ref: C,
294
+ style: {
295
+ pointerEvents: b ? y ? "auto" : "none" : void 0,
296
+ ...e.style
297
+ },
298
+ onFocusCapture: T(e.onFocusCapture, R.onFocusCapture),
299
+ onBlurCapture: T(e.onBlurCapture, R.onBlurCapture),
300
+ onPointerDownCapture: T(e.onPointerDownCapture, N.onPointerDownCapture)
301
+ });
302
+ });
303
+ Ie.displayName = Nt;
304
+ var Tt = "DismissableLayerBranch", Mt = i.forwardRef((e, t) => {
305
+ const n = i.useContext(Me), r = i.useRef(null), o = x(t, r);
306
+ return i.useEffect(() => {
307
+ const a = r.current;
308
+ if (a)
309
+ return n.branches.add(a), () => {
310
+ n.branches.delete(a);
311
+ };
312
+ }, [n.branches]), /* @__PURE__ */ g(O.div, {
313
+ ...e,
314
+ ref: o
315
+ });
316
+ });
317
+ Mt.displayName = Tt;
318
+ function It(e, t = globalThis?.document) {
319
+ const n = $(e), r = i.useRef(!1), o = i.useRef(() => {
320
+ });
321
+ return i.useEffect(() => {
322
+ const a = (c) => {
323
+ if (c.target && !r.current) {
324
+ let f = function() {
325
+ xe(Ot, n, u, { discrete: !0 });
326
+ };
327
+ const u = { originalEvent: c };
328
+ c.pointerType === "touch" ? (t.removeEventListener("click", o.current), o.current = f, t.addEventListener("click", o.current, { once: !0 })) : f();
329
+ } else t.removeEventListener("click", o.current);
330
+ r.current = !1;
331
+ }, s = window.setTimeout(() => {
332
+ t.addEventListener("pointerdown", a);
333
+ }, 0);
334
+ return () => {
335
+ window.clearTimeout(s), t.removeEventListener("pointerdown", a), t.removeEventListener("click", o.current);
336
+ };
337
+ }, [t, n]), { onPointerDownCapture: () => r.current = !0 };
338
+ }
339
+ function xt(e, t = globalThis?.document) {
340
+ const n = $(e), r = i.useRef(!1);
341
+ return i.useEffect(() => {
342
+ const o = (a) => {
343
+ a.target && !r.current && xe(At, n, { originalEvent: a }, { discrete: !1 });
344
+ };
345
+ return t.addEventListener("focusin", o), () => t.removeEventListener("focusin", o);
346
+ }, [t, n]), {
347
+ onFocusCapture: () => r.current = !0,
348
+ onBlurCapture: () => r.current = !1
349
+ };
350
+ }
351
+ function ge() {
352
+ const e = new CustomEvent(ce);
353
+ document.dispatchEvent(e);
354
+ }
355
+ function xe(e, t, n, { discrete: r }) {
356
+ const o = n.originalEvent.target, a = new CustomEvent(e, {
357
+ bubbles: !1,
358
+ cancelable: !0,
359
+ detail: n
360
+ });
361
+ t && o.addEventListener(e, t, { once: !0 }), r ? Pt(o, a) : o.dispatchEvent(a);
362
+ }
363
+ var ee = "focusScope.autoFocusOnMount", te = "focusScope.autoFocusOnUnmount", ye = {
364
+ bubbles: !1,
365
+ cancelable: !0
366
+ }, _t = "FocusScope", _e = i.forwardRef((e, t) => {
367
+ const { loop: n = !1, trapped: r = !1, onMountAutoFocus: o, onUnmountAutoFocus: a, ...s } = e, [c, f] = i.useState(null), u = $(o), d = $(a), v = i.useRef(null), p = x(t, (l) => f(l)), h = i.useRef({
368
+ paused: !1,
369
+ pause() {
370
+ this.paused = !0;
371
+ },
372
+ resume() {
373
+ this.paused = !1;
374
+ }
375
+ }).current;
376
+ i.useEffect(() => {
377
+ if (r) {
378
+ let l = function(b) {
379
+ if (h.paused || !c) return;
380
+ const y = b.target;
381
+ c.contains(y) ? v.current = y : A(v.current, { select: !0 });
382
+ }, m = function(b) {
383
+ if (h.paused || !c) return;
384
+ const y = b.relatedTarget;
385
+ y !== null && (c.contains(y) || A(v.current, { select: !0 }));
386
+ }, w = function(b) {
387
+ if (document.activeElement === document.body)
388
+ for (const y of b) y.removedNodes.length > 0 && A(c);
389
+ };
390
+ document.addEventListener("focusin", l), document.addEventListener("focusout", m);
391
+ const S = new MutationObserver(w);
392
+ return c && S.observe(c, {
393
+ childList: !0,
394
+ subtree: !0
395
+ }), () => {
396
+ document.removeEventListener("focusin", l), document.removeEventListener("focusout", m), S.disconnect();
397
+ };
398
+ }
399
+ }, [
400
+ r,
401
+ c,
402
+ h.paused
403
+ ]), i.useEffect(() => {
404
+ if (c) {
405
+ be.add(h);
406
+ const l = document.activeElement;
407
+ if (!c.contains(l)) {
408
+ const m = new CustomEvent(ee, ye);
409
+ c.addEventListener(ee, u), c.dispatchEvent(m), m.defaultPrevented || (Lt(Ut(Le(c)), { select: !0 }), document.activeElement === l && A(c));
410
+ }
411
+ return () => {
412
+ c.removeEventListener(ee, u), setTimeout(() => {
413
+ const m = new CustomEvent(te, ye);
414
+ c.addEventListener(te, d), c.dispatchEvent(m), m.defaultPrevented || A(l ?? document.body, { select: !0 }), c.removeEventListener(te, d), be.remove(h);
415
+ }, 0);
416
+ };
417
+ }
418
+ }, [
419
+ c,
420
+ u,
421
+ d,
422
+ h
423
+ ]);
424
+ const C = i.useCallback((l) => {
425
+ if (!n && !r || h.paused) return;
426
+ const m = l.key === "Tab" && !l.altKey && !l.ctrlKey && !l.metaKey, w = document.activeElement;
427
+ if (m && w) {
428
+ const S = l.currentTarget, [b, y] = Ft(S);
429
+ b && y ? !l.shiftKey && w === y ? (l.preventDefault(), n && A(b, { select: !0 })) : l.shiftKey && w === b && (l.preventDefault(), n && A(y, { select: !0 })) : w === S && l.preventDefault();
430
+ }
431
+ }, [
432
+ n,
433
+ r,
434
+ h.paused
435
+ ]);
436
+ return /* @__PURE__ */ g(O.div, {
437
+ tabIndex: -1,
438
+ ...s,
439
+ ref: p,
440
+ onKeyDown: C
441
+ });
442
+ });
443
+ _e.displayName = _t;
444
+ function Lt(e, { select: t = !1 } = {}) {
445
+ const n = document.activeElement;
446
+ for (const r of e)
447
+ if (A(r, { select: t }), document.activeElement !== n) return;
448
+ }
449
+ function Ft(e) {
450
+ const t = Le(e);
451
+ return [Ee(t, e), Ee(t.reverse(), e)];
452
+ }
453
+ function Le(e) {
454
+ const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: (r) => {
455
+ const o = r.tagName === "INPUT" && r.type === "hidden";
456
+ return r.disabled || r.hidden || o ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
457
+ } });
458
+ for (; n.nextNode(); ) t.push(n.currentNode);
459
+ return t;
460
+ }
461
+ function Ee(e, t) {
462
+ for (const n of e) if (!kt(n, { upTo: t })) return n;
463
+ }
464
+ function kt(e, { upTo: t }) {
465
+ if (getComputedStyle(e).visibility === "hidden") return !0;
466
+ for (; e; ) {
467
+ if (t !== void 0 && e === t) return !1;
468
+ if (getComputedStyle(e).display === "none") return !0;
469
+ e = e.parentElement;
470
+ }
471
+ return !1;
472
+ }
473
+ function Wt(e) {
474
+ return e instanceof HTMLInputElement && "select" in e;
475
+ }
476
+ function A(e, { select: t = !1 } = {}) {
477
+ if (e && e.focus) {
478
+ const n = document.activeElement;
479
+ e.focus({ preventScroll: !0 }), e !== n && Wt(e) && t && e.select();
480
+ }
481
+ }
482
+ var be = Bt();
483
+ function Bt() {
484
+ let e = [];
485
+ return {
486
+ add(t) {
487
+ const n = e[0];
488
+ t !== n && n?.pause(), e = Ce(e, t), e.unshift(t);
489
+ },
490
+ remove(t) {
491
+ e = Ce(e, t), e[0]?.resume();
492
+ }
493
+ };
494
+ }
495
+ function Ce(e, t) {
496
+ const n = [...e], r = n.indexOf(t);
497
+ return r !== -1 && n.splice(r, 1), n;
498
+ }
499
+ function Ut(e) {
500
+ return e.filter((t) => t.tagName !== "A");
501
+ }
502
+ var $t = "Portal", Fe = i.forwardRef((e, t) => {
503
+ const { container: n, ...r } = e, [o, a] = i.useState(!1);
504
+ U(() => a(!0), []);
505
+ const s = n || o && globalThis?.document?.body;
506
+ return s ? lt.createPortal(/* @__PURE__ */ g(O.div, {
507
+ ...r,
508
+ ref: t
509
+ }), s) : null;
510
+ });
511
+ Fe.displayName = $t;
512
+ function jt(e, t) {
513
+ return i.useReducer((n, r) => t[n][r] ?? n, e);
514
+ }
515
+ var Z = (e) => {
516
+ const { present: t, children: n } = e, r = Vt(t), o = typeof n == "function" ? n({ present: r.isPresent }) : i.Children.only(n), a = x(r.ref, Kt(o));
517
+ return typeof n == "function" || r.isPresent ? i.cloneElement(o, { ref: a }) : null;
518
+ };
519
+ Z.displayName = "Presence";
520
+ function Vt(e) {
521
+ const [t, n] = i.useState(), r = i.useRef(null), o = i.useRef(e), a = i.useRef("none"), [s, c] = jt(e ? "mounted" : "unmounted", {
522
+ mounted: {
523
+ UNMOUNT: "unmounted",
524
+ ANIMATION_OUT: "unmountSuspended"
525
+ },
526
+ unmountSuspended: {
527
+ MOUNT: "mounted",
528
+ ANIMATION_END: "unmounted"
529
+ },
530
+ unmounted: { MOUNT: "mounted" }
531
+ });
532
+ return i.useEffect(() => {
533
+ const f = j(r.current);
534
+ a.current = s === "mounted" ? f : "none";
535
+ }, [s]), U(() => {
536
+ const f = r.current, u = o.current;
537
+ if (u !== e) {
538
+ const d = a.current, v = j(f);
539
+ e ? c("MOUNT") : v === "none" || f?.display === "none" ? c("UNMOUNT") : c(u && d !== v ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
540
+ }
541
+ }, [e, c]), U(() => {
542
+ if (t) {
543
+ let f;
544
+ const u = t.ownerDocument.defaultView ?? window, d = (p) => {
545
+ const h = j(r.current).includes(CSS.escape(p.animationName));
546
+ if (p.target === t && h && (c("ANIMATION_END"), !o.current)) {
547
+ const C = t.style.animationFillMode;
548
+ t.style.animationFillMode = "forwards", f = u.setTimeout(() => {
549
+ t.style.animationFillMode === "forwards" && (t.style.animationFillMode = C);
550
+ });
551
+ }
552
+ }, v = (p) => {
553
+ p.target === t && (a.current = j(r.current));
554
+ };
555
+ return t.addEventListener("animationstart", v), t.addEventListener("animationcancel", d), t.addEventListener("animationend", d), () => {
556
+ u.clearTimeout(f), t.removeEventListener("animationstart", v), t.removeEventListener("animationcancel", d), t.removeEventListener("animationend", d);
557
+ };
558
+ } else c("ANIMATION_END");
559
+ }, [t, c]), {
560
+ isPresent: ["mounted", "unmountSuspended"].includes(s),
561
+ ref: i.useCallback((f) => {
562
+ r.current = f ? getComputedStyle(f) : null, n(f);
563
+ }, [])
564
+ };
565
+ }
566
+ function j(e) {
567
+ return e?.animationName || "none";
568
+ }
569
+ function Kt(e) {
570
+ let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
571
+ return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
572
+ }
573
+ var ne = 0;
574
+ function Gt() {
575
+ i.useEffect(() => {
576
+ const e = document.querySelectorAll("[data-radix-focus-guard]");
577
+ return document.body.insertAdjacentElement("afterbegin", e[0] ?? we()), document.body.insertAdjacentElement("beforeend", e[1] ?? we()), ne++, () => {
578
+ ne === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), ne--;
579
+ };
580
+ }, []);
581
+ }
582
+ function we() {
583
+ const e = document.createElement("span");
584
+ return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
585
+ }
586
+ var D = function() {
587
+ return D = Object.assign || function(t) {
588
+ for (var n, r = 1, o = arguments.length; r < o; r++) {
589
+ n = arguments[r];
590
+ for (var a in n) Object.prototype.hasOwnProperty.call(n, a) && (t[a] = n[a]);
591
+ }
592
+ return t;
593
+ }, D.apply(this, arguments);
594
+ };
595
+ function ke(e, t) {
596
+ var n = {};
597
+ for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
598
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
599
+ for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++) t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
600
+ return n;
601
+ }
602
+ function Ht(e, t, n) {
603
+ if (n || arguments.length === 2)
604
+ for (var r = 0, o = t.length, a; r < o; r++) (a || !(r in t)) && (a || (a = Array.prototype.slice.call(t, 0, r)), a[r] = t[r]);
605
+ return e.concat(a || Array.prototype.slice.call(t));
606
+ }
607
+ var Y = "right-scroll-bar-position", X = "width-before-scroll-bar", Yt = "with-scroll-bars-hidden", Xt = "--removed-body-scroll-bar-size";
608
+ function re(e, t) {
609
+ return typeof e == "function" ? e(t) : e && (e.current = t), e;
610
+ }
611
+ function zt(e, t) {
612
+ var n = st(function() {
613
+ return {
614
+ value: e,
615
+ callback: t,
616
+ facade: {
617
+ get current() {
618
+ return n.value;
619
+ },
620
+ set current(r) {
621
+ var o = n.value;
622
+ o !== r && (n.value = r, n.callback(r, o));
623
+ }
624
+ }
625
+ };
626
+ })[0];
627
+ return n.callback = t, n.facade;
628
+ }
629
+ var Zt = typeof window < "u" ? i.useLayoutEffect : i.useEffect, Se = /* @__PURE__ */ new WeakMap();
630
+ function qt(e, t) {
631
+ var n = zt(t || null, function(r) {
632
+ return e.forEach(function(o) {
633
+ return re(o, r);
634
+ });
635
+ });
636
+ return Zt(function() {
637
+ var r = Se.get(n);
638
+ if (r) {
639
+ var o = new Set(r), a = new Set(e), s = n.current;
640
+ o.forEach(function(c) {
641
+ a.has(c) || re(c, null);
642
+ }), a.forEach(function(c) {
643
+ o.has(c) || re(c, s);
644
+ });
645
+ }
646
+ Se.set(n, e);
647
+ }, [e]), n;
648
+ }
649
+ function Qt(e) {
650
+ return e;
651
+ }
652
+ function Jt(e, t) {
653
+ t === void 0 && (t = Qt);
654
+ var n = [], r = !1;
655
+ return {
656
+ read: function() {
657
+ if (r) throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
658
+ return n.length ? n[n.length - 1] : e;
659
+ },
660
+ useMedium: function(o) {
661
+ var a = t(o, r);
662
+ return n.push(a), function() {
663
+ n = n.filter(function(s) {
664
+ return s !== a;
665
+ });
666
+ };
667
+ },
668
+ assignSyncMedium: function(o) {
669
+ for (r = !0; n.length; ) {
670
+ var a = n;
671
+ n = [], a.forEach(o);
672
+ }
673
+ n = {
674
+ push: function(s) {
675
+ return o(s);
676
+ },
677
+ filter: function() {
678
+ return n;
679
+ }
680
+ };
681
+ },
682
+ assignMedium: function(o) {
683
+ r = !0;
684
+ var a = [];
685
+ if (n.length) {
686
+ var s = n;
687
+ n = [], s.forEach(o), a = n;
688
+ }
689
+ var c = function() {
690
+ var u = a;
691
+ a = [], u.forEach(o);
692
+ }, f = function() {
693
+ return Promise.resolve().then(c);
694
+ };
695
+ f(), n = {
696
+ push: function(u) {
697
+ a.push(u), f();
698
+ },
699
+ filter: function(u) {
700
+ return a = a.filter(u), n;
701
+ }
702
+ };
703
+ }
704
+ };
705
+ }
706
+ function en(e) {
707
+ e === void 0 && (e = {});
708
+ var t = Jt(null);
709
+ return t.options = D({
710
+ async: !0,
711
+ ssr: !1
712
+ }, e), t;
713
+ }
714
+ var We = function(e) {
715
+ var t = e.sideCar, n = ke(e, ["sideCar"]);
716
+ if (!t) throw new Error("Sidecar: please provide `sideCar` property to import the right car");
717
+ var r = t.read();
718
+ if (!r) throw new Error("Sidecar medium not found");
719
+ return i.createElement(r, D({}, n));
720
+ };
721
+ We.isSideCarExport = !0;
722
+ function tn(e, t) {
723
+ return e.useMedium(t), We;
724
+ }
725
+ var Be = en(), oe = function() {
726
+ }, q = i.forwardRef(function(e, t) {
727
+ var n = i.useRef(null), r = i.useState({
728
+ onScrollCapture: oe,
729
+ onWheelCapture: oe,
730
+ onTouchMoveCapture: oe
731
+ }), o = r[0], a = r[1], s = e.forwardProps, c = e.children, f = e.className, u = e.removeScrollBar, d = e.enabled, v = e.shards, p = e.sideCar, h = e.noRelative, C = e.noIsolation, l = e.inert, m = e.allowPinchZoom, w = e.as, S = w === void 0 ? "div" : w, b = e.gapMode, y = ke(e, [
732
+ "forwardProps",
733
+ "children",
734
+ "className",
735
+ "removeScrollBar",
736
+ "enabled",
737
+ "shards",
738
+ "sideCar",
739
+ "noRelative",
740
+ "noIsolation",
741
+ "inert",
742
+ "allowPinchZoom",
743
+ "as",
744
+ "gapMode"
745
+ ]), N = p, R = qt([n, t]), E = D(D({}, y), o);
746
+ return i.createElement(i.Fragment, null, d && i.createElement(N, {
747
+ sideCar: Be,
748
+ removeScrollBar: u,
749
+ shards: v,
750
+ noRelative: h,
751
+ noIsolation: C,
752
+ inert: l,
753
+ setCallbacks: a,
754
+ allowPinchZoom: !!m,
755
+ lockRef: n,
756
+ gapMode: b
757
+ }), s ? i.cloneElement(i.Children.only(c), D(D({}, E), { ref: R })) : i.createElement(S, D({}, E, {
758
+ className: f,
759
+ ref: R
760
+ }), c));
761
+ });
762
+ q.defaultProps = {
763
+ enabled: !0,
764
+ removeScrollBar: !0,
765
+ inert: !1
766
+ };
767
+ q.classNames = {
768
+ fullWidth: X,
769
+ zeroRight: Y
770
+ };
771
+ var Re, nn = function() {
772
+ if (Re) return Re;
773
+ if (typeof __webpack_nonce__ < "u") return __webpack_nonce__;
774
+ };
775
+ function rn() {
776
+ if (!document) return null;
777
+ var e = document.createElement("style");
778
+ e.type = "text/css";
779
+ var t = nn();
780
+ return t && e.setAttribute("nonce", t), e;
781
+ }
782
+ function on(e, t) {
783
+ e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
784
+ }
785
+ function an(e) {
786
+ (document.head || document.getElementsByTagName("head")[0]).appendChild(e);
787
+ }
788
+ var cn = function() {
789
+ var e = 0, t = null;
790
+ return {
791
+ add: function(n) {
792
+ e == 0 && (t = rn()) && (on(t, n), an(t)), e++;
793
+ },
794
+ remove: function() {
795
+ e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
796
+ }
797
+ };
798
+ }, sn = function() {
799
+ var e = cn();
800
+ return function(t, n) {
801
+ i.useEffect(function() {
802
+ return e.add(t), function() {
803
+ e.remove();
804
+ };
805
+ }, [t && n]);
806
+ };
807
+ }, Ue = function() {
808
+ var e = sn(), t = function(n) {
809
+ var r = n.styles, o = n.dynamic;
810
+ return e(r, o), null;
811
+ };
812
+ return t;
813
+ }, un = {
814
+ left: 0,
815
+ top: 0,
816
+ right: 0,
817
+ gap: 0
818
+ }, ae = function(e) {
819
+ return parseInt(e || "", 10) || 0;
820
+ }, ln = function(e) {
821
+ var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], o = t[e === "padding" ? "paddingRight" : "marginRight"];
822
+ return [
823
+ ae(n),
824
+ ae(r),
825
+ ae(o)
826
+ ];
827
+ }, fn = function(e) {
828
+ if (e === void 0 && (e = "margin"), typeof window > "u") return un;
829
+ var t = ln(e), n = document.documentElement.clientWidth, r = window.innerWidth;
830
+ return {
831
+ left: t[0],
832
+ top: t[1],
833
+ right: t[2],
834
+ gap: Math.max(0, r - n + t[2] - t[0])
835
+ };
836
+ }, dn = Ue(), B = "data-scroll-locked", vn = function(e, t, n, r) {
837
+ var o = e.left, a = e.top, s = e.right, c = e.gap;
838
+ return n === void 0 && (n = "margin"), `
839
+ .`.concat(Yt, ` {
840
+ overflow: hidden `).concat(r, `;
841
+ padding-right: `).concat(c, "px ").concat(r, `;
842
+ }
843
+ body[`).concat(B, `] {
844
+ overflow: hidden `).concat(r, `;
845
+ overscroll-behavior: contain;
846
+ `).concat([
847
+ t && "position: relative ".concat(r, ";"),
848
+ n === "margin" && `
849
+ padding-left: `.concat(o, `px;
850
+ padding-top: `).concat(a, `px;
851
+ padding-right: `).concat(s, `px;
852
+ margin-left:0;
853
+ margin-top:0;
854
+ margin-right: `).concat(c, "px ").concat(r, `;
855
+ `),
856
+ n === "padding" && "padding-right: ".concat(c, "px ").concat(r, ";")
857
+ ].filter(Boolean).join(""), `
858
+ }
859
+
860
+ .`).concat(Y, ` {
861
+ right: `).concat(c, "px ").concat(r, `;
862
+ }
863
+
864
+ .`).concat(X, ` {
865
+ margin-right: `).concat(c, "px ").concat(r, `;
866
+ }
867
+
868
+ .`).concat(Y, " .").concat(Y, ` {
869
+ right: 0 `).concat(r, `;
870
+ }
871
+
872
+ .`).concat(X, " .").concat(X, ` {
873
+ margin-right: 0 `).concat(r, `;
874
+ }
875
+
876
+ body[`).concat(B, `] {
877
+ `).concat(Xt, ": ").concat(c, `px;
878
+ }
879
+ `);
880
+ }, Pe = function() {
881
+ var e = parseInt(document.body.getAttribute("data-scroll-locked") || "0", 10);
882
+ return isFinite(e) ? e : 0;
883
+ }, mn = function() {
884
+ i.useEffect(function() {
885
+ return document.body.setAttribute(B, (Pe() + 1).toString()), function() {
886
+ var e = Pe() - 1;
887
+ e <= 0 ? document.body.removeAttribute(B) : document.body.setAttribute(B, e.toString());
888
+ };
889
+ }, []);
890
+ }, pn = function(e) {
891
+ var t = e.noRelative, n = e.noImportant, r = e.gapMode, o = r === void 0 ? "margin" : r;
892
+ mn();
893
+ var a = i.useMemo(function() {
894
+ return fn(o);
895
+ }, [o]);
896
+ return i.createElement(dn, { styles: vn(a, !t, o, n ? "" : "!important") });
897
+ }, se = !1;
898
+ if (typeof window < "u") try {
899
+ var V = Object.defineProperty({}, "passive", { get: function() {
900
+ return se = !0, !0;
901
+ } });
902
+ window.addEventListener("test", V, V), window.removeEventListener("test", V, V);
903
+ } catch {
904
+ se = !1;
905
+ }
906
+ var F = se ? { passive: !1 } : !1, hn = function(e) {
907
+ return e.tagName === "TEXTAREA";
908
+ }, $e = function(e, t) {
909
+ if (!(e instanceof Element)) return !1;
910
+ var n = window.getComputedStyle(e);
911
+ return n[t] !== "hidden" && !(n.overflowY === n.overflowX && !hn(e) && n[t] === "visible");
912
+ }, gn = function(e) {
913
+ return $e(e, "overflowY");
914
+ }, yn = function(e) {
915
+ return $e(e, "overflowX");
916
+ }, De = function(e, t) {
917
+ var n = t.ownerDocument, r = t;
918
+ do {
919
+ if (typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host), je(e, r)) {
920
+ var o = Ve(e, r);
921
+ if (o[1] > o[2]) return !0;
922
+ }
923
+ r = r.parentNode;
924
+ } while (r && r !== n.body);
925
+ return !1;
926
+ }, En = function(e) {
927
+ return [
928
+ e.scrollTop,
929
+ e.scrollHeight,
930
+ e.clientHeight
931
+ ];
932
+ }, bn = function(e) {
933
+ return [
934
+ e.scrollLeft,
935
+ e.scrollWidth,
936
+ e.clientWidth
937
+ ];
938
+ }, je = function(e, t) {
939
+ return e === "v" ? gn(t) : yn(t);
940
+ }, Ve = function(e, t) {
941
+ return e === "v" ? En(t) : bn(t);
942
+ }, Cn = function(e, t) {
943
+ return e === "h" && t === "rtl" ? -1 : 1;
944
+ }, wn = function(e, t, n, r, o) {
945
+ var a = Cn(e, window.getComputedStyle(t).direction), s = a * r, c = n.target, f = t.contains(c), u = !1, d = s > 0, v = 0, p = 0;
946
+ do {
947
+ if (!c) break;
948
+ var h = Ve(e, c), C = h[0], l = h[1] - h[2] - a * C;
949
+ (C || l) && je(e, c) && (v += l, p += C);
950
+ var m = c.parentNode;
951
+ c = m && m.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? m.host : m;
952
+ } while (!f && c !== document.body || f && (t.contains(c) || t === c));
953
+ return (d && (o && Math.abs(v) < 1 || !o && s > v) || !d && (o && Math.abs(p) < 1 || !o && -s > p)) && (u = !0), u;
954
+ }, K = function(e) {
955
+ return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
956
+ }, Ne = function(e) {
957
+ return [e.deltaX, e.deltaY];
958
+ }, Oe = function(e) {
959
+ return e && "current" in e ? e.current : e;
960
+ }, Sn = function(e, t) {
961
+ return e[0] === t[0] && e[1] === t[1];
962
+ }, Rn = function(e) {
963
+ return `
964
+ .block-interactivity-`.concat(e, ` {pointer-events: none;}
965
+ .allow-interactivity-`).concat(e, ` {pointer-events: all;}
966
+ `);
967
+ }, Pn = 0, k = [];
968
+ function Dn(e) {
969
+ var t = i.useRef([]), n = i.useRef([0, 0]), r = i.useRef(), o = i.useState(Pn++)[0], a = i.useState(Ue)[0], s = i.useRef(e);
970
+ i.useEffect(function() {
971
+ s.current = e;
972
+ }, [e]), i.useEffect(function() {
973
+ if (e.inert) {
974
+ document.body.classList.add("block-interactivity-".concat(o));
975
+ var l = Ht([e.lockRef.current], (e.shards || []).map(Oe), !0).filter(Boolean);
976
+ return l.forEach(function(m) {
977
+ return m.classList.add("allow-interactivity-".concat(o));
978
+ }), function() {
979
+ document.body.classList.remove("block-interactivity-".concat(o)), l.forEach(function(m) {
980
+ return m.classList.remove("allow-interactivity-".concat(o));
981
+ });
982
+ };
983
+ }
984
+ }, [
985
+ e.inert,
986
+ e.lockRef.current,
987
+ e.shards
988
+ ]);
989
+ var c = i.useCallback(function(l, m) {
990
+ if ("touches" in l && l.touches.length === 2 || l.type === "wheel" && l.ctrlKey) return !s.current.allowPinchZoom;
991
+ var w = K(l), S = n.current, b = "deltaX" in l ? l.deltaX : S[0] - w[0], y = "deltaY" in l ? l.deltaY : S[1] - w[1], N, R = l.target, E = Math.abs(b) > Math.abs(y) ? "h" : "v";
992
+ if ("touches" in l && E === "h" && R.type === "range") return !1;
993
+ var _ = window.getSelection(), M = _ && _.anchorNode;
994
+ if (M && (M === R || M.contains(R))) return !1;
995
+ var L = De(E, R);
996
+ if (!L) return !0;
997
+ if (L ? N = E : (N = E === "v" ? "h" : "v", L = De(E, R)), !L) return !1;
998
+ if (!r.current && "changedTouches" in l && (b || y) && (r.current = N), !N) return !0;
999
+ var de = r.current || N;
1000
+ return wn(de, m, l, de === "h" ? b : y, !0);
1001
+ }, []), f = i.useCallback(function(l) {
1002
+ var m = l;
1003
+ if (!(!k.length || k[k.length - 1] !== a)) {
1004
+ var w = "deltaY" in m ? Ne(m) : K(m), S = t.current.filter(function(y) {
1005
+ return y.name === m.type && (y.target === m.target || m.target === y.shadowParent) && Sn(y.delta, w);
1006
+ })[0];
1007
+ if (S && S.should) {
1008
+ m.cancelable && m.preventDefault();
1009
+ return;
1010
+ }
1011
+ if (!S) {
1012
+ var b = (s.current.shards || []).map(Oe).filter(Boolean).filter(function(y) {
1013
+ return y.contains(m.target);
1014
+ });
1015
+ (b.length > 0 ? c(m, b[0]) : !s.current.noIsolation) && m.cancelable && m.preventDefault();
1016
+ }
1017
+ }
1018
+ }, []), u = i.useCallback(function(l, m, w, S) {
1019
+ var b = {
1020
+ name: l,
1021
+ delta: m,
1022
+ target: w,
1023
+ should: S,
1024
+ shadowParent: Nn(w)
1025
+ };
1026
+ t.current.push(b), setTimeout(function() {
1027
+ t.current = t.current.filter(function(y) {
1028
+ return y !== b;
1029
+ });
1030
+ }, 1);
1031
+ }, []), d = i.useCallback(function(l) {
1032
+ n.current = K(l), r.current = void 0;
1033
+ }, []), v = i.useCallback(function(l) {
1034
+ u(l.type, Ne(l), l.target, c(l, e.lockRef.current));
1035
+ }, []), p = i.useCallback(function(l) {
1036
+ u(l.type, K(l), l.target, c(l, e.lockRef.current));
1037
+ }, []);
1038
+ i.useEffect(function() {
1039
+ return k.push(a), e.setCallbacks({
1040
+ onScrollCapture: v,
1041
+ onWheelCapture: v,
1042
+ onTouchMoveCapture: p
1043
+ }), document.addEventListener("wheel", f, F), document.addEventListener("touchmove", f, F), document.addEventListener("touchstart", d, F), function() {
1044
+ k = k.filter(function(l) {
1045
+ return l !== a;
1046
+ }), document.removeEventListener("wheel", f, F), document.removeEventListener("touchmove", f, F), document.removeEventListener("touchstart", d, F);
1047
+ };
1048
+ }, []);
1049
+ var h = e.removeScrollBar, C = e.inert;
1050
+ return i.createElement(i.Fragment, null, C ? i.createElement(a, { styles: Rn(o) }) : null, h ? i.createElement(pn, {
1051
+ noRelative: e.noRelative,
1052
+ gapMode: e.gapMode
1053
+ }) : null);
1054
+ }
1055
+ function Nn(e) {
1056
+ for (var t = null; e !== null; )
1057
+ e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
1058
+ return t;
1059
+ }
1060
+ var On = tn(Be, Dn), Ke = i.forwardRef(function(e, t) {
1061
+ return i.createElement(q, D({}, e, {
1062
+ ref: t,
1063
+ sideCar: On
1064
+ }));
1065
+ });
1066
+ Ke.classNames = q.classNames;
1067
+ var An = function(e) {
1068
+ return typeof document > "u" ? null : (Array.isArray(e) ? e[0] : e).ownerDocument.body;
1069
+ }, W = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), H = {}, ie = 0, Ge = function(e) {
1070
+ return e && (e.host || Ge(e.parentNode));
1071
+ }, Tn = function(e, t) {
1072
+ return t.map(function(n) {
1073
+ if (e.contains(n)) return n;
1074
+ var r = Ge(n);
1075
+ return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
1076
+ }).filter(function(n) {
1077
+ return !!n;
1078
+ });
1079
+ }, Mn = function(e, t, n, r) {
1080
+ var o = Tn(t, Array.isArray(e) ? e : [e]);
1081
+ H[n] || (H[n] = /* @__PURE__ */ new WeakMap());
1082
+ var a = H[n], s = [], c = /* @__PURE__ */ new Set(), f = new Set(o), u = function(v) {
1083
+ !v || c.has(v) || (c.add(v), u(v.parentNode));
1084
+ };
1085
+ o.forEach(u);
1086
+ var d = function(v) {
1087
+ !v || f.has(v) || Array.prototype.forEach.call(v.children, function(p) {
1088
+ if (c.has(p)) d(p);
1089
+ else try {
1090
+ var h = p.getAttribute(r), C = h !== null && h !== "false", l = (W.get(p) || 0) + 1, m = (a.get(p) || 0) + 1;
1091
+ W.set(p, l), a.set(p, m), s.push(p), l === 1 && C && G.set(p, !0), m === 1 && p.setAttribute(n, "true"), C || p.setAttribute(r, "true");
1092
+ } catch (w) {
1093
+ console.error("aria-hidden: cannot operate on ", p, w);
1094
+ }
1095
+ });
1096
+ };
1097
+ return d(t), c.clear(), ie++, function() {
1098
+ s.forEach(function(v) {
1099
+ var p = W.get(v) - 1, h = a.get(v) - 1;
1100
+ W.set(v, p), a.set(v, h), p || (G.has(v) || v.removeAttribute(r), G.delete(v)), h || v.removeAttribute(n);
1101
+ }), ie--, ie || (W = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), H = {});
1102
+ };
1103
+ }, In = function(e, t, n) {
1104
+ n === void 0 && (n = "data-aria-hidden");
1105
+ var r = Array.from(Array.isArray(e) ? e : [e]), o = t || An(e);
1106
+ return o ? (r.push.apply(r, Array.from(o.querySelectorAll("[aria-live], script"))), Mn(r, o, n, "aria-hidden")) : function() {
1107
+ return null;
1108
+ };
1109
+ }, Q = "Dialog", [He, Hn] = dt(Q), [xn, P] = He(Q), Ye = (e) => {
1110
+ const { __scopeDialog: t, children: n, open: r, defaultOpen: o, onOpenChange: a, modal: s = !0 } = e, c = i.useRef(null), f = i.useRef(null), [u, d] = gt({
1111
+ prop: r,
1112
+ defaultProp: o ?? !1,
1113
+ onChange: a,
1114
+ caller: Q
1115
+ });
1116
+ return /* @__PURE__ */ g(xn, {
1117
+ scope: t,
1118
+ triggerRef: c,
1119
+ contentRef: f,
1120
+ contentId: J(),
1121
+ titleId: J(),
1122
+ descriptionId: J(),
1123
+ open: u,
1124
+ onOpenChange: d,
1125
+ onOpenToggle: i.useCallback(() => d((v) => !v), [d]),
1126
+ modal: s,
1127
+ children: n
1128
+ });
1129
+ };
1130
+ Ye.displayName = Q;
1131
+ var Xe = "DialogTrigger", ze = i.forwardRef((e, t) => {
1132
+ const { __scopeDialog: n, ...r } = e, o = P(Xe, n), a = x(t, o.triggerRef);
1133
+ return /* @__PURE__ */ g(O.button, {
1134
+ type: "button",
1135
+ "aria-haspopup": "dialog",
1136
+ "aria-expanded": o.open,
1137
+ "aria-controls": o.contentId,
1138
+ "data-state": fe(o.open),
1139
+ ...r,
1140
+ ref: a,
1141
+ onClick: T(e.onClick, o.onOpenToggle)
1142
+ });
1143
+ });
1144
+ ze.displayName = Xe;
1145
+ var ue = "DialogPortal", [_n, Ze] = He(ue, { forceMount: void 0 }), qe = (e) => {
1146
+ const { __scopeDialog: t, forceMount: n, children: r, container: o } = e, a = P(ue, t);
1147
+ return /* @__PURE__ */ g(_n, {
1148
+ scope: t,
1149
+ forceMount: n,
1150
+ children: i.Children.map(r, (s) => /* @__PURE__ */ g(Z, {
1151
+ present: n || a.open,
1152
+ children: /* @__PURE__ */ g(Fe, {
1153
+ asChild: !0,
1154
+ container: o,
1155
+ children: s
1156
+ })
1157
+ }))
1158
+ });
1159
+ };
1160
+ qe.displayName = ue;
1161
+ var z = "DialogOverlay", Qe = i.forwardRef((e, t) => {
1162
+ const n = Ze(z, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, a = P(z, e.__scopeDialog);
1163
+ return a.modal ? /* @__PURE__ */ g(Z, {
1164
+ present: r || a.open,
1165
+ children: /* @__PURE__ */ g(Fn, {
1166
+ ...o,
1167
+ ref: t
1168
+ })
1169
+ }) : null;
1170
+ });
1171
+ Qe.displayName = z;
1172
+ var Ln = /* @__PURE__ */ Te("DialogOverlay.RemoveScroll"), Fn = i.forwardRef((e, t) => {
1173
+ const { __scopeDialog: n, ...r } = e, o = P(z, n);
1174
+ return /* @__PURE__ */ g(Ke, {
1175
+ as: Ln,
1176
+ allowPinchZoom: !0,
1177
+ shards: [o.contentRef],
1178
+ children: /* @__PURE__ */ g(O.div, {
1179
+ "data-state": fe(o.open),
1180
+ ...r,
1181
+ ref: t,
1182
+ style: {
1183
+ pointerEvents: "auto",
1184
+ ...r.style
1185
+ }
1186
+ })
1187
+ });
1188
+ }), I = "DialogContent", Je = i.forwardRef((e, t) => {
1189
+ const n = Ze(I, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, a = P(I, e.__scopeDialog);
1190
+ return /* @__PURE__ */ g(Z, {
1191
+ present: r || a.open,
1192
+ children: a.modal ? /* @__PURE__ */ g(kn, {
1193
+ ...o,
1194
+ ref: t
1195
+ }) : /* @__PURE__ */ g(Wn, {
1196
+ ...o,
1197
+ ref: t
1198
+ })
1199
+ });
1200
+ });
1201
+ Je.displayName = I;
1202
+ var kn = i.forwardRef((e, t) => {
1203
+ const n = P(I, e.__scopeDialog), r = i.useRef(null), o = x(t, n.contentRef, r);
1204
+ return i.useEffect(() => {
1205
+ const a = r.current;
1206
+ if (a) return In(a);
1207
+ }, []), /* @__PURE__ */ g(et, {
1208
+ ...e,
1209
+ ref: o,
1210
+ trapFocus: n.open,
1211
+ disableOutsidePointerEvents: !0,
1212
+ onCloseAutoFocus: T(e.onCloseAutoFocus, (a) => {
1213
+ a.preventDefault(), n.triggerRef.current?.focus();
1214
+ }),
1215
+ onPointerDownOutside: T(e.onPointerDownOutside, (a) => {
1216
+ const s = a.detail.originalEvent, c = s.button === 0 && s.ctrlKey === !0;
1217
+ (s.button === 2 || c) && a.preventDefault();
1218
+ }),
1219
+ onFocusOutside: T(e.onFocusOutside, (a) => a.preventDefault())
1220
+ });
1221
+ }), Wn = i.forwardRef((e, t) => {
1222
+ const n = P(I, e.__scopeDialog), r = i.useRef(!1), o = i.useRef(!1);
1223
+ return /* @__PURE__ */ g(et, {
1224
+ ...e,
1225
+ ref: t,
1226
+ trapFocus: !1,
1227
+ disableOutsidePointerEvents: !1,
1228
+ onCloseAutoFocus: (a) => {
1229
+ e.onCloseAutoFocus?.(a), a.defaultPrevented || (r.current || n.triggerRef.current?.focus(), a.preventDefault()), r.current = !1, o.current = !1;
1230
+ },
1231
+ onInteractOutside: (a) => {
1232
+ e.onInteractOutside?.(a), a.defaultPrevented || (r.current = !0, a.detail.originalEvent.type === "pointerdown" && (o.current = !0));
1233
+ const s = a.target;
1234
+ n.triggerRef.current?.contains(s) && a.preventDefault(), a.detail.originalEvent.type === "focusin" && o.current && a.preventDefault();
1235
+ }
1236
+ });
1237
+ }), et = i.forwardRef((e, t) => {
1238
+ const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: a, ...s } = e, c = P(I, n), f = i.useRef(null), u = x(t, f);
1239
+ return Gt(), /* @__PURE__ */ me(ve, { children: [/* @__PURE__ */ g(_e, {
1240
+ asChild: !0,
1241
+ loop: !0,
1242
+ trapped: r,
1243
+ onMountAutoFocus: o,
1244
+ onUnmountAutoFocus: a,
1245
+ children: /* @__PURE__ */ g(Ie, {
1246
+ role: "dialog",
1247
+ id: c.contentId,
1248
+ "aria-describedby": c.descriptionId,
1249
+ "aria-labelledby": c.titleId,
1250
+ "data-state": fe(c.open),
1251
+ ...s,
1252
+ ref: u,
1253
+ onDismiss: () => c.onOpenChange(!1)
1254
+ })
1255
+ }), /* @__PURE__ */ me(ve, { children: [/* @__PURE__ */ g(Bn, { titleId: c.titleId }), /* @__PURE__ */ g($n, {
1256
+ contentRef: f,
1257
+ descriptionId: c.descriptionId
1258
+ })] })] });
1259
+ }), le = "DialogTitle", tt = i.forwardRef((e, t) => {
1260
+ const { __scopeDialog: n, ...r } = e, o = P(le, n);
1261
+ return /* @__PURE__ */ g(O.h2, {
1262
+ id: o.titleId,
1263
+ ...r,
1264
+ ref: t
1265
+ });
1266
+ });
1267
+ tt.displayName = le;
1268
+ var nt = "DialogDescription", rt = i.forwardRef((e, t) => {
1269
+ const { __scopeDialog: n, ...r } = e, o = P(nt, n);
1270
+ return /* @__PURE__ */ g(O.p, {
1271
+ id: o.descriptionId,
1272
+ ...r,
1273
+ ref: t
1274
+ });
1275
+ });
1276
+ rt.displayName = nt;
1277
+ var ot = "DialogClose", at = i.forwardRef((e, t) => {
1278
+ const { __scopeDialog: n, ...r } = e, o = P(ot, n);
1279
+ return /* @__PURE__ */ g(O.button, {
1280
+ type: "button",
1281
+ ...r,
1282
+ ref: t,
1283
+ onClick: T(e.onClick, () => o.onOpenChange(!1))
1284
+ });
1285
+ });
1286
+ at.displayName = ot;
1287
+ function fe(e) {
1288
+ return e ? "open" : "closed";
1289
+ }
1290
+ var it = "DialogTitleWarning", [Yn, ct] = ft(it, {
1291
+ contentName: I,
1292
+ titleName: le,
1293
+ docsSlug: "dialog"
1294
+ }), Bn = ({ titleId: e }) => {
1295
+ const t = ct(it), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
1296
+
1297
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
1298
+
1299
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
1300
+ return i.useEffect(() => {
1301
+ e && (document.getElementById(e) || console.error(n));
1302
+ }, [n, e]), null;
1303
+ }, Un = "DialogDescriptionWarning", $n = ({ contentRef: e, descriptionId: t }) => {
1304
+ const n = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ct(Un).contentName}}.`;
1305
+ return i.useEffect(() => {
1306
+ const r = e.current?.getAttribute("aria-describedby");
1307
+ t && r && (document.getElementById(t) || console.warn(n));
1308
+ }, [
1309
+ n,
1310
+ e,
1311
+ t
1312
+ ]), null;
1313
+ }, Xn = Ye, zn = ze, Zn = qe, qn = Qe, Qn = Je, Jn = tt, er = rt, tr = at;
1314
+ export {
1315
+ Zn as a,
1316
+ zn as c,
1317
+ qn as i,
1318
+ J as l,
1319
+ Qn as n,
1320
+ Xn as o,
1321
+ er as r,
1322
+ Jn as s,
1323
+ tr as t,
1324
+ Ae as u
1325
+ };
1326
+
1327
+ //# sourceMappingURL=dist-fahbq1psobj0ox6s.js.map