@krosoft/react 0.0.124 → 0.0.126

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 (62) hide show
  1. package/dist/{AppActions-po4LjUcM.js → AppActions-BbAnhStS.js} +22 -18
  2. package/dist/{AppSubTitle-CWrsJYFJ.js → AppSubTitle-lg3d5NWc.js} +1 -1
  3. package/dist/{AppTitle-CDxWr_0y.js → AppTitle-uboDuil4.js} +1 -1
  4. package/dist/{AppVerticalTabs-CdqoObXx.js → AppVerticalTabs-CBijkDF_.js} +33 -49
  5. package/dist/ConfirmationDialog-Co5yl0yA.js +184 -0
  6. package/dist/{DataTable-CrJoeR_0.js → DataTable-DSIgTHZS.js} +174 -218
  7. package/dist/ErrorAlert-DH1onuyt.js +17 -0
  8. package/dist/GenericForm-QoeireeW.js +339 -0
  9. package/dist/ImageInput-DLTYJMwr.js +65 -0
  10. package/dist/KpiCardsLayout-C3LmSeL1.js +22 -0
  11. package/dist/{LoadingState-PhGi7HXH.js → LoadingState-BN0YaPSs.js} +3 -3
  12. package/dist/{MetricCard-C-ewNR_i.js → MetricCard-CPw-fiNS.js} +6 -6
  13. package/dist/{MultiSelect-BoisW4Kn.js → MultiSelect-CX051kfk.js} +32 -27
  14. package/dist/SearchInput-D6LmcOjp.js +249 -0
  15. package/dist/SkeletonCards-BIEnyOuZ.js +62 -0
  16. package/dist/{TableFilter-CLjQU36k.js → TableFilter-Wh_Womy4.js} +114 -123
  17. package/dist/{ThemeSelector--w3R6Ff3.js → ThemeSelector-Qv8QBlYq.js} +2 -2
  18. package/dist/{Topbar-DFu_OdSs.js → Topbar-DVww-tU8.js} +49 -59
  19. package/dist/{alert-B34E_4uH.js → alert-B78CiTYe.js} +2 -2
  20. package/dist/components/core/cards/index.js +2 -2
  21. package/dist/components/core/dialogs/index.js +2 -2
  22. package/dist/components/core/filters/index.js +1 -1
  23. package/dist/components/core/forms/index.js +1 -1
  24. package/dist/components/core/index.js +19 -19
  25. package/dist/components/core/inputs/index.js +3 -3
  26. package/dist/components/core/layouts/index.js +4 -4
  27. package/dist/components/core/navbar/index.js +1 -1
  28. package/dist/components/core/states/index.js +2 -2
  29. package/dist/components/core/table/index.js +1 -1
  30. package/dist/components/core/tabs/index.js +1 -1
  31. package/dist/components/core/theme/index.js +1 -1
  32. package/dist/components/index.js +270 -270
  33. package/dist/components/ui/index.js +213 -213
  34. package/dist/helpers/index.js +1 -1
  35. package/dist/hooks/behavior/index.js +1 -1
  36. package/dist/hooks/index.js +1 -1
  37. package/dist/select-MWzbMBAS.js +106 -0
  38. package/dist/tailwind.helper-B6yFEsav.js +8 -0
  39. package/dist/toaster-DTC8Duvh.js +75 -0
  40. package/dist/toggle-group-CSdAiS44.js +1694 -0
  41. package/dist/tooltip-BWyFpIxo.js +56 -0
  42. package/dist/useConfirmDeleteDialog-CiBQmRxg.js +65 -0
  43. package/package.json +4 -4
  44. package/dist/ConfirmationDialog-CkMyyh_3.js +0 -221
  45. package/dist/ErrorAlert-C6BbHHRZ.js +0 -33
  46. package/dist/GenericForm-CmwqEXiQ.js +0 -11410
  47. package/dist/ImageInput-C8HcxE8t.js +0 -82
  48. package/dist/KpiCardsLayout-CETMpB7A.js +0 -15
  49. package/dist/SearchInput-DJ_F3emq.js +0 -586
  50. package/dist/SkeletonCards-C5lXTSrB.js +0 -57
  51. package/dist/badge-CfWlt79h.js +0 -26
  52. package/dist/createLucideIcon-MP_wDWjs.js +0 -116
  53. package/dist/ellipsis-vertical-kB5yFb-i.js +0 -15
  54. package/dist/grip-vertical-DGywJXzS.js +0 -18
  55. package/dist/index-Be16PP7H.js +0 -34
  56. package/dist/loader-circle-CKy7u7JW.js +0 -11
  57. package/dist/select-DlQvLtI3.js +0 -1763
  58. package/dist/tailwind.helper-gWiv5-6R.js +0 -2278
  59. package/dist/toaster-CKoOjjKr.js +0 -134
  60. package/dist/toggle-group-wIgXZYDq.js +0 -29086
  61. package/dist/tooltip-YhBPXbcJ.js +0 -2477
  62. package/dist/useConfirmDeleteDialog-BOb3XFpz.js +0 -75
@@ -1,1763 +0,0 @@
1
- import { jsx as v, jsxs as q, Fragment as Ge } from "react/jsx-runtime";
2
- import { c as Q } from "./tailwind.helper-gWiv5-6R.js";
3
- import * as a from "react";
4
- import re, { useState as fn } from "react";
5
- import * as ut from "react-dom";
6
- import pn from "react-dom";
7
- import { f as dt, g as ft, u as B, h as We, P as A, i as G, A as mn, j as M, k as Ye, l as pt, D as vn, m as hn, n as qe, R as gn, V as Sn, o as yn, C as mt } from "./tooltip-YhBPXbcJ.js";
8
- import { c as Xe } from "./createLucideIcon-MP_wDWjs.js";
9
- // @__NO_SIDE_EFFECTS__
10
- function Qe(e) {
11
- const t = /* @__PURE__ */ wn(e), n = a.forwardRef((r, o) => {
12
- const { children: i, ...s } = r, c = a.Children.toArray(i), u = c.find(bn);
13
- if (u) {
14
- const d = u.props.children, S = c.map((h) => h === u ? a.Children.count(d) > 1 ? a.Children.only(null) : a.isValidElement(d) ? d.props.children : null : h);
15
- return /* @__PURE__ */ v(t, { ...s, ref: o, children: a.isValidElement(d) ? a.cloneElement(d, void 0, S) : null });
16
- }
17
- return /* @__PURE__ */ v(t, { ...s, ref: o, children: i });
18
- });
19
- return n.displayName = `${e}.Slot`, n;
20
- }
21
- // @__NO_SIDE_EFFECTS__
22
- function wn(e) {
23
- const t = a.forwardRef((n, r) => {
24
- const { children: o, ...i } = n;
25
- if (a.isValidElement(o)) {
26
- const s = xn(o), c = En(i, o.props);
27
- return o.type !== a.Fragment && (c.ref = r ? dt(r, s) : s), a.cloneElement(o, c);
28
- }
29
- return a.Children.count(o) > 1 ? a.Children.only(null) : null;
30
- });
31
- return t.displayName = `${e}.SlotClone`, t;
32
- }
33
- var Cn = Symbol("radix.slottable");
34
- function bn(e) {
35
- return a.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === Cn;
36
- }
37
- function En(e, t) {
38
- const n = { ...t };
39
- for (const r in t) {
40
- const o = e[r], i = t[r];
41
- /^on[A-Z]/.test(r) ? o && i ? n[r] = (...c) => {
42
- const u = i(...c);
43
- return o(...c), u;
44
- } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...i } : r === "className" && (n[r] = [o, i].filter(Boolean).join(" "));
45
- }
46
- return { ...e, ...n };
47
- }
48
- function xn(e) {
49
- var r, o;
50
- let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
51
- return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
52
- }
53
- function Rn(e) {
54
- const t = e + "CollectionProvider", [n, r] = ft(t), [o, i] = n(
55
- t,
56
- { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
57
- ), s = (l) => {
58
- const { scope: p, children: g } = l, f = re.useRef(null), m = re.useRef(/* @__PURE__ */ new Map()).current;
59
- return /* @__PURE__ */ v(o, { scope: p, itemMap: m, collectionRef: f, children: g });
60
- };
61
- s.displayName = t;
62
- const c = e + "CollectionSlot", u = /* @__PURE__ */ Qe(c), d = re.forwardRef(
63
- (l, p) => {
64
- const { scope: g, children: f } = l, m = i(c, g), b = B(p, m.collectionRef);
65
- return /* @__PURE__ */ v(u, { ref: b, children: f });
66
- }
67
- );
68
- d.displayName = c;
69
- const S = e + "CollectionItemSlot", h = "data-radix-collection-item", y = /* @__PURE__ */ Qe(S), w = re.forwardRef(
70
- (l, p) => {
71
- const { scope: g, children: f, ...m } = l, b = re.useRef(null), x = B(p, b), _ = i(S, g);
72
- return re.useEffect(() => (_.itemMap.set(b, { ref: b, ...m }), () => void _.itemMap.delete(b))), /* @__PURE__ */ v(y, { [h]: "", ref: x, children: f });
73
- }
74
- );
75
- w.displayName = S;
76
- function E(l) {
77
- const p = i(e + "CollectionConsumer", l);
78
- return re.useCallback(() => {
79
- const f = p.collectionRef.current;
80
- if (!f) return [];
81
- const m = Array.from(f.querySelectorAll(`[${h}]`));
82
- return Array.from(p.itemMap.values()).sort(
83
- (_, R) => m.indexOf(_.ref.current) - m.indexOf(R.ref.current)
84
- );
85
- }, [p.collectionRef, p.itemMap]);
86
- }
87
- return [
88
- { Provider: s, Slot: d, ItemSlot: w },
89
- E,
90
- r
91
- ];
92
- }
93
- var Nn = a.createContext(void 0);
94
- function Tn(e) {
95
- const t = a.useContext(Nn);
96
- return e || t || "ltr";
97
- }
98
- /**
99
- * @license lucide-react v1.17.0 - ISC
100
- *
101
- * This source code is licensed under the ISC license.
102
- * See the LICENSE file in the root directory of this source tree.
103
- */
104
- const In = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], Pn = Xe("check", In);
105
- /**
106
- * @license lucide-react v1.17.0 - ISC
107
- *
108
- * This source code is licensed under the ISC license.
109
- * See the LICENSE file in the root directory of this source tree.
110
- */
111
- const _n = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]], Mn = Xe("chevron-up", _n);
112
- /**
113
- * @license lucide-react v1.17.0 - ISC
114
- *
115
- * This source code is licensed under the ISC license.
116
- * See the LICENSE file in the root directory of this source tree.
117
- */
118
- const An = [
119
- ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
120
- ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
121
- ], On = Xe("x", An);
122
- var Oe = "focusScope.autoFocusOnMount", ke = "focusScope.autoFocusOnUnmount", Je = { bubbles: !1, cancelable: !0 }, kn = "FocusScope", vt = a.forwardRef((e, t) => {
123
- const {
124
- loop: n = !1,
125
- trapped: r = !1,
126
- onMountAutoFocus: o,
127
- onUnmountAutoFocus: i,
128
- ...s
129
- } = e, [c, u] = a.useState(null), d = We(o), S = We(i), h = a.useRef(null), y = B(t, (l) => u(l)), w = a.useRef({
130
- paused: !1,
131
- pause() {
132
- this.paused = !0;
133
- },
134
- resume() {
135
- this.paused = !1;
136
- }
137
- }).current;
138
- a.useEffect(() => {
139
- if (r) {
140
- let l = function(m) {
141
- if (w.paused || !c) return;
142
- const b = m.target;
143
- c.contains(b) ? h.current = b : Z(h.current, { select: !0 });
144
- }, p = function(m) {
145
- if (w.paused || !c) return;
146
- const b = m.relatedTarget;
147
- b !== null && (c.contains(b) || Z(h.current, { select: !0 }));
148
- }, g = function(m) {
149
- if (document.activeElement === document.body)
150
- for (const x of m)
151
- x.removedNodes.length > 0 && Z(c);
152
- };
153
- document.addEventListener("focusin", l), document.addEventListener("focusout", p);
154
- const f = new MutationObserver(g);
155
- return c && f.observe(c, { childList: !0, subtree: !0 }), () => {
156
- document.removeEventListener("focusin", l), document.removeEventListener("focusout", p), f.disconnect();
157
- };
158
- }
159
- }, [r, c, w.paused]), a.useEffect(() => {
160
- if (c) {
161
- tt.add(w);
162
- const l = document.activeElement;
163
- if (!c.contains(l)) {
164
- const g = new CustomEvent(Oe, Je);
165
- c.addEventListener(Oe, d), c.dispatchEvent(g), g.defaultPrevented || (Ln(Wn(ht(c)), { select: !0 }), document.activeElement === l && Z(c));
166
- }
167
- return () => {
168
- c.removeEventListener(Oe, d), setTimeout(() => {
169
- const g = new CustomEvent(ke, Je);
170
- c.addEventListener(ke, S), c.dispatchEvent(g), g.defaultPrevented || Z(l ?? document.body, { select: !0 }), c.removeEventListener(ke, S), tt.remove(w);
171
- }, 0);
172
- };
173
- }
174
- }, [c, d, S, w]);
175
- const E = a.useCallback(
176
- (l) => {
177
- if (!n && !r || w.paused) return;
178
- const p = l.key === "Tab" && !l.altKey && !l.ctrlKey && !l.metaKey, g = document.activeElement;
179
- if (p && g) {
180
- const f = l.currentTarget, [m, b] = Dn(f);
181
- m && b ? !l.shiftKey && g === b ? (l.preventDefault(), n && Z(m, { select: !0 })) : l.shiftKey && g === m && (l.preventDefault(), n && Z(b, { select: !0 })) : g === f && l.preventDefault();
182
- }
183
- },
184
- [n, r, w.paused]
185
- );
186
- return /* @__PURE__ */ v(A.div, { tabIndex: -1, ...s, ref: y, onKeyDown: E });
187
- });
188
- vt.displayName = kn;
189
- function Ln(e, { select: t = !1 } = {}) {
190
- const n = document.activeElement;
191
- for (const r of e)
192
- if (Z(r, { select: t }), document.activeElement !== n) return;
193
- }
194
- function Dn(e) {
195
- const t = ht(e), n = et(t, e), r = et(t.reverse(), e);
196
- return [n, r];
197
- }
198
- function ht(e) {
199
- const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
200
- acceptNode: (r) => {
201
- const o = r.tagName === "INPUT" && r.type === "hidden";
202
- return r.disabled || r.hidden || o ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
203
- }
204
- });
205
- for (; n.nextNode(); ) t.push(n.currentNode);
206
- return t;
207
- }
208
- function et(e, t) {
209
- for (const n of e)
210
- if (!Bn(n, { upTo: t })) return n;
211
- }
212
- function Bn(e, { upTo: t }) {
213
- if (getComputedStyle(e).visibility === "hidden") return !0;
214
- for (; e; ) {
215
- if (t !== void 0 && e === t) return !1;
216
- if (getComputedStyle(e).display === "none") return !0;
217
- e = e.parentElement;
218
- }
219
- return !1;
220
- }
221
- function Vn(e) {
222
- return e instanceof HTMLInputElement && "select" in e;
223
- }
224
- function Z(e, { select: t = !1 } = {}) {
225
- if (e && e.focus) {
226
- const n = document.activeElement;
227
- e.focus({ preventScroll: !0 }), e !== n && Vn(e) && t && e.select();
228
- }
229
- }
230
- var tt = Fn();
231
- function Fn() {
232
- let e = [];
233
- return {
234
- add(t) {
235
- const n = e[0];
236
- t !== n && (n == null || n.pause()), e = nt(e, t), e.unshift(t);
237
- },
238
- remove(t) {
239
- var n;
240
- e = nt(e, t), (n = e[0]) == null || n.resume();
241
- }
242
- };
243
- }
244
- function nt(e, t) {
245
- const n = [...e], r = n.indexOf(t);
246
- return r !== -1 && n.splice(r, 1), n;
247
- }
248
- function Wn(e) {
249
- return e.filter((t) => t.tagName !== "A");
250
- }
251
- var Hn = "Portal", gt = a.forwardRef((e, t) => {
252
- var c;
253
- const { container: n, ...r } = e, [o, i] = a.useState(!1);
254
- G(() => i(!0), []);
255
- const s = n || o && ((c = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : c.body);
256
- return s ? pn.createPortal(/* @__PURE__ */ v(A.div, { ...r, ref: t }), s) : null;
257
- });
258
- gt.displayName = Hn;
259
- var Le = 0;
260
- function Un() {
261
- a.useEffect(() => {
262
- const e = document.querySelectorAll("[data-radix-focus-guard]");
263
- return document.body.insertAdjacentElement("afterbegin", e[0] ?? rt()), document.body.insertAdjacentElement("beforeend", e[1] ?? rt()), Le++, () => {
264
- Le === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), Le--;
265
- };
266
- }, []);
267
- }
268
- function rt() {
269
- const e = document.createElement("span");
270
- 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;
271
- }
272
- var U = function() {
273
- return U = Object.assign || function(t) {
274
- for (var n, r = 1, o = arguments.length; r < o; r++) {
275
- n = arguments[r];
276
- for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);
277
- }
278
- return t;
279
- }, U.apply(this, arguments);
280
- };
281
- function St(e, t) {
282
- var n = {};
283
- for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
284
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
285
- for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
286
- t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
287
- return n;
288
- }
289
- function Kn(e, t, n) {
290
- if (n || arguments.length === 2) for (var r = 0, o = t.length, i; r < o; r++)
291
- (i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
292
- return e.concat(i || Array.prototype.slice.call(t));
293
- }
294
- var we = "right-scroll-bar-position", Ce = "width-before-scroll-bar", $n = "with-scroll-bars-hidden", jn = "--removed-body-scroll-bar-size";
295
- function De(e, t) {
296
- return typeof e == "function" ? e(t) : e && (e.current = t), e;
297
- }
298
- function zn(e, t) {
299
- var n = fn(function() {
300
- return {
301
- // value
302
- value: e,
303
- // last callback
304
- callback: t,
305
- // "memoized" public interface
306
- facade: {
307
- get current() {
308
- return n.value;
309
- },
310
- set current(r) {
311
- var o = n.value;
312
- o !== r && (n.value = r, n.callback(r, o));
313
- }
314
- }
315
- };
316
- })[0];
317
- return n.callback = t, n.facade;
318
- }
319
- var Gn = typeof window < "u" ? a.useLayoutEffect : a.useEffect, ot = /* @__PURE__ */ new WeakMap();
320
- function Yn(e, t) {
321
- var n = zn(null, function(r) {
322
- return e.forEach(function(o) {
323
- return De(o, r);
324
- });
325
- });
326
- return Gn(function() {
327
- var r = ot.get(n);
328
- if (r) {
329
- var o = new Set(r), i = new Set(e), s = n.current;
330
- o.forEach(function(c) {
331
- i.has(c) || De(c, null);
332
- }), i.forEach(function(c) {
333
- o.has(c) || De(c, s);
334
- });
335
- }
336
- ot.set(n, e);
337
- }, [e]), n;
338
- }
339
- function Xn(e) {
340
- return e;
341
- }
342
- function Zn(e, t) {
343
- t === void 0 && (t = Xn);
344
- var n = [], r = !1, o = {
345
- read: function() {
346
- if (r)
347
- throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
348
- return n.length ? n[n.length - 1] : e;
349
- },
350
- useMedium: function(i) {
351
- var s = t(i, r);
352
- return n.push(s), function() {
353
- n = n.filter(function(c) {
354
- return c !== s;
355
- });
356
- };
357
- },
358
- assignSyncMedium: function(i) {
359
- for (r = !0; n.length; ) {
360
- var s = n;
361
- n = [], s.forEach(i);
362
- }
363
- n = {
364
- push: function(c) {
365
- return i(c);
366
- },
367
- filter: function() {
368
- return n;
369
- }
370
- };
371
- },
372
- assignMedium: function(i) {
373
- r = !0;
374
- var s = [];
375
- if (n.length) {
376
- var c = n;
377
- n = [], c.forEach(i), s = n;
378
- }
379
- var u = function() {
380
- var S = s;
381
- s = [], S.forEach(i);
382
- }, d = function() {
383
- return Promise.resolve().then(u);
384
- };
385
- d(), n = {
386
- push: function(S) {
387
- s.push(S), d();
388
- },
389
- filter: function(S) {
390
- return s = s.filter(S), n;
391
- }
392
- };
393
- }
394
- };
395
- return o;
396
- }
397
- function qn(e) {
398
- e === void 0 && (e = {});
399
- var t = Zn(null);
400
- return t.options = U({ async: !0, ssr: !1 }, e), t;
401
- }
402
- var yt = function(e) {
403
- var t = e.sideCar, n = St(e, ["sideCar"]);
404
- if (!t)
405
- throw new Error("Sidecar: please provide `sideCar` property to import the right car");
406
- var r = t.read();
407
- if (!r)
408
- throw new Error("Sidecar medium not found");
409
- return a.createElement(r, U({}, n));
410
- };
411
- yt.isSideCarExport = !0;
412
- function Qn(e, t) {
413
- return e.useMedium(t), yt;
414
- }
415
- var wt = qn(), Be = function() {
416
- }, Ee = a.forwardRef(function(e, t) {
417
- var n = a.useRef(null), r = a.useState({
418
- onScrollCapture: Be,
419
- onWheelCapture: Be,
420
- onTouchMoveCapture: Be
421
- }), o = r[0], i = r[1], s = e.forwardProps, c = e.children, u = e.className, d = e.removeScrollBar, S = e.enabled, h = e.shards, y = e.sideCar, w = e.noRelative, E = e.noIsolation, l = e.inert, p = e.allowPinchZoom, g = e.as, f = g === void 0 ? "div" : g, m = e.gapMode, b = St(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), x = y, _ = Yn([n, t]), R = U(U({}, b), o);
422
- return a.createElement(
423
- a.Fragment,
424
- null,
425
- S && a.createElement(x, { sideCar: wt, removeScrollBar: d, shards: h, noRelative: w, noIsolation: E, inert: l, setCallbacks: i, allowPinchZoom: !!p, lockRef: n, gapMode: m }),
426
- s ? a.cloneElement(a.Children.only(c), U(U({}, R), { ref: _ })) : a.createElement(f, U({}, R, { className: u, ref: _ }), c)
427
- );
428
- });
429
- Ee.defaultProps = {
430
- enabled: !0,
431
- removeScrollBar: !0,
432
- inert: !1
433
- };
434
- Ee.classNames = {
435
- fullWidth: Ce,
436
- zeroRight: we
437
- };
438
- var Jn = function() {
439
- if (typeof __webpack_nonce__ < "u")
440
- return __webpack_nonce__;
441
- };
442
- function er() {
443
- if (!document)
444
- return null;
445
- var e = document.createElement("style");
446
- e.type = "text/css";
447
- var t = Jn();
448
- return t && e.setAttribute("nonce", t), e;
449
- }
450
- function tr(e, t) {
451
- e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
452
- }
453
- function nr(e) {
454
- var t = document.head || document.getElementsByTagName("head")[0];
455
- t.appendChild(e);
456
- }
457
- var rr = function() {
458
- var e = 0, t = null;
459
- return {
460
- add: function(n) {
461
- e == 0 && (t = er()) && (tr(t, n), nr(t)), e++;
462
- },
463
- remove: function() {
464
- e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
465
- }
466
- };
467
- }, or = function() {
468
- var e = rr();
469
- return function(t, n) {
470
- a.useEffect(function() {
471
- return e.add(t), function() {
472
- e.remove();
473
- };
474
- }, [t && n]);
475
- };
476
- }, Ct = function() {
477
- var e = or(), t = function(n) {
478
- var r = n.styles, o = n.dynamic;
479
- return e(r, o), null;
480
- };
481
- return t;
482
- }, ar = {
483
- left: 0,
484
- top: 0,
485
- right: 0,
486
- gap: 0
487
- }, Ve = function(e) {
488
- return parseInt(e || "", 10) || 0;
489
- }, cr = function(e) {
490
- var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], o = t[e === "padding" ? "paddingRight" : "marginRight"];
491
- return [Ve(n), Ve(r), Ve(o)];
492
- }, ir = function(e) {
493
- if (e === void 0 && (e = "margin"), typeof window > "u")
494
- return ar;
495
- var t = cr(e), n = document.documentElement.clientWidth, r = window.innerWidth;
496
- return {
497
- left: t[0],
498
- top: t[1],
499
- right: t[2],
500
- gap: Math.max(0, r - n + t[2] - t[0])
501
- };
502
- }, lr = Ct(), ue = "data-scroll-locked", sr = function(e, t, n, r) {
503
- var o = e.left, i = e.top, s = e.right, c = e.gap;
504
- return n === void 0 && (n = "margin"), `
505
- .`.concat($n, ` {
506
- overflow: hidden `).concat(r, `;
507
- padding-right: `).concat(c, "px ").concat(r, `;
508
- }
509
- body[`).concat(ue, `] {
510
- overflow: hidden `).concat(r, `;
511
- overscroll-behavior: contain;
512
- `).concat([
513
- t && "position: relative ".concat(r, ";"),
514
- n === "margin" && `
515
- padding-left: `.concat(o, `px;
516
- padding-top: `).concat(i, `px;
517
- padding-right: `).concat(s, `px;
518
- margin-left:0;
519
- margin-top:0;
520
- margin-right: `).concat(c, "px ").concat(r, `;
521
- `),
522
- n === "padding" && "padding-right: ".concat(c, "px ").concat(r, ";")
523
- ].filter(Boolean).join(""), `
524
- }
525
-
526
- .`).concat(we, ` {
527
- right: `).concat(c, "px ").concat(r, `;
528
- }
529
-
530
- .`).concat(Ce, ` {
531
- margin-right: `).concat(c, "px ").concat(r, `;
532
- }
533
-
534
- .`).concat(we, " .").concat(we, ` {
535
- right: 0 `).concat(r, `;
536
- }
537
-
538
- .`).concat(Ce, " .").concat(Ce, ` {
539
- margin-right: 0 `).concat(r, `;
540
- }
541
-
542
- body[`).concat(ue, `] {
543
- `).concat(jn, ": ").concat(c, `px;
544
- }
545
- `);
546
- }, at = function() {
547
- var e = parseInt(document.body.getAttribute(ue) || "0", 10);
548
- return isFinite(e) ? e : 0;
549
- }, ur = function() {
550
- a.useEffect(function() {
551
- return document.body.setAttribute(ue, (at() + 1).toString()), function() {
552
- var e = at() - 1;
553
- e <= 0 ? document.body.removeAttribute(ue) : document.body.setAttribute(ue, e.toString());
554
- };
555
- }, []);
556
- }, dr = function(e) {
557
- var t = e.noRelative, n = e.noImportant, r = e.gapMode, o = r === void 0 ? "margin" : r;
558
- ur();
559
- var i = a.useMemo(function() {
560
- return ir(o);
561
- }, [o]);
562
- return a.createElement(lr, { styles: sr(i, !t, o, n ? "" : "!important") });
563
- }, He = !1;
564
- if (typeof window < "u")
565
- try {
566
- var he = Object.defineProperty({}, "passive", {
567
- get: function() {
568
- return He = !0, !0;
569
- }
570
- });
571
- window.addEventListener("test", he, he), window.removeEventListener("test", he, he);
572
- } catch {
573
- He = !1;
574
- }
575
- var ie = He ? { passive: !1 } : !1, fr = function(e) {
576
- return e.tagName === "TEXTAREA";
577
- }, bt = function(e, t) {
578
- if (!(e instanceof Element))
579
- return !1;
580
- var n = window.getComputedStyle(e);
581
- return (
582
- // not-not-scrollable
583
- n[t] !== "hidden" && // contains scroll inside self
584
- !(n.overflowY === n.overflowX && !fr(e) && n[t] === "visible")
585
- );
586
- }, pr = function(e) {
587
- return bt(e, "overflowY");
588
- }, mr = function(e) {
589
- return bt(e, "overflowX");
590
- }, ct = function(e, t) {
591
- var n = t.ownerDocument, r = t;
592
- do {
593
- typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
594
- var o = Et(e, r);
595
- if (o) {
596
- var i = xt(e, r), s = i[1], c = i[2];
597
- if (s > c)
598
- return !0;
599
- }
600
- r = r.parentNode;
601
- } while (r && r !== n.body);
602
- return !1;
603
- }, vr = function(e) {
604
- var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
605
- return [
606
- t,
607
- n,
608
- r
609
- ];
610
- }, hr = function(e) {
611
- var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
612
- return [
613
- t,
614
- n,
615
- r
616
- ];
617
- }, Et = function(e, t) {
618
- return e === "v" ? pr(t) : mr(t);
619
- }, xt = function(e, t) {
620
- return e === "v" ? vr(t) : hr(t);
621
- }, gr = function(e, t) {
622
- return e === "h" && t === "rtl" ? -1 : 1;
623
- }, Sr = function(e, t, n, r, o) {
624
- var i = gr(e, window.getComputedStyle(t).direction), s = i * r, c = n.target, u = t.contains(c), d = !1, S = s > 0, h = 0, y = 0;
625
- do {
626
- if (!c)
627
- break;
628
- var w = xt(e, c), E = w[0], l = w[1], p = w[2], g = l - p - i * E;
629
- (E || g) && Et(e, c) && (h += g, y += E);
630
- var f = c.parentNode;
631
- c = f && f.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? f.host : f;
632
- } while (
633
- // portaled content
634
- !u && c !== document.body || // self content
635
- u && (t.contains(c) || t === c)
636
- );
637
- return (S && Math.abs(h) < 1 || !S && Math.abs(y) < 1) && (d = !0), d;
638
- }, ge = function(e) {
639
- return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
640
- }, it = function(e) {
641
- return [e.deltaX, e.deltaY];
642
- }, lt = function(e) {
643
- return e && "current" in e ? e.current : e;
644
- }, yr = function(e, t) {
645
- return e[0] === t[0] && e[1] === t[1];
646
- }, wr = function(e) {
647
- return `
648
- .block-interactivity-`.concat(e, ` {pointer-events: none;}
649
- .allow-interactivity-`).concat(e, ` {pointer-events: all;}
650
- `);
651
- }, Cr = 0, le = [];
652
- function br(e) {
653
- var t = a.useRef([]), n = a.useRef([0, 0]), r = a.useRef(), o = a.useState(Cr++)[0], i = a.useState(Ct)[0], s = a.useRef(e);
654
- a.useEffect(function() {
655
- s.current = e;
656
- }, [e]), a.useEffect(function() {
657
- if (e.inert) {
658
- document.body.classList.add("block-interactivity-".concat(o));
659
- var l = Kn([e.lockRef.current], (e.shards || []).map(lt), !0).filter(Boolean);
660
- return l.forEach(function(p) {
661
- return p.classList.add("allow-interactivity-".concat(o));
662
- }), function() {
663
- document.body.classList.remove("block-interactivity-".concat(o)), l.forEach(function(p) {
664
- return p.classList.remove("allow-interactivity-".concat(o));
665
- });
666
- };
667
- }
668
- }, [e.inert, e.lockRef.current, e.shards]);
669
- var c = a.useCallback(function(l, p) {
670
- if ("touches" in l && l.touches.length === 2 || l.type === "wheel" && l.ctrlKey)
671
- return !s.current.allowPinchZoom;
672
- var g = ge(l), f = n.current, m = "deltaX" in l ? l.deltaX : f[0] - g[0], b = "deltaY" in l ? l.deltaY : f[1] - g[1], x, _ = l.target, R = Math.abs(m) > Math.abs(b) ? "h" : "v";
673
- if ("touches" in l && R === "h" && _.type === "range")
674
- return !1;
675
- var L = window.getSelection(), V = L && L.anchorNode, K = V ? V === _ || V.contains(_) : !1;
676
- if (K)
677
- return !1;
678
- var O = ct(R, _);
679
- if (!O)
680
- return !0;
681
- if (O ? x = R : (x = R === "v" ? "h" : "v", O = ct(R, _)), !O)
682
- return !1;
683
- if (!r.current && "changedTouches" in l && (m || b) && (r.current = x), !x)
684
- return !0;
685
- var F = r.current || x;
686
- return Sr(F, p, l, F === "h" ? m : b);
687
- }, []), u = a.useCallback(function(l) {
688
- var p = l;
689
- if (!(!le.length || le[le.length - 1] !== i)) {
690
- var g = "deltaY" in p ? it(p) : ge(p), f = t.current.filter(function(x) {
691
- return x.name === p.type && (x.target === p.target || p.target === x.shadowParent) && yr(x.delta, g);
692
- })[0];
693
- if (f && f.should) {
694
- p.cancelable && p.preventDefault();
695
- return;
696
- }
697
- if (!f) {
698
- var m = (s.current.shards || []).map(lt).filter(Boolean).filter(function(x) {
699
- return x.contains(p.target);
700
- }), b = m.length > 0 ? c(p, m[0]) : !s.current.noIsolation;
701
- b && p.cancelable && p.preventDefault();
702
- }
703
- }
704
- }, []), d = a.useCallback(function(l, p, g, f) {
705
- var m = { name: l, delta: p, target: g, should: f, shadowParent: Er(g) };
706
- t.current.push(m), setTimeout(function() {
707
- t.current = t.current.filter(function(b) {
708
- return b !== m;
709
- });
710
- }, 1);
711
- }, []), S = a.useCallback(function(l) {
712
- n.current = ge(l), r.current = void 0;
713
- }, []), h = a.useCallback(function(l) {
714
- d(l.type, it(l), l.target, c(l, e.lockRef.current));
715
- }, []), y = a.useCallback(function(l) {
716
- d(l.type, ge(l), l.target, c(l, e.lockRef.current));
717
- }, []);
718
- a.useEffect(function() {
719
- return le.push(i), e.setCallbacks({
720
- onScrollCapture: h,
721
- onWheelCapture: h,
722
- onTouchMoveCapture: y
723
- }), document.addEventListener("wheel", u, ie), document.addEventListener("touchmove", u, ie), document.addEventListener("touchstart", S, ie), function() {
724
- le = le.filter(function(l) {
725
- return l !== i;
726
- }), document.removeEventListener("wheel", u, ie), document.removeEventListener("touchmove", u, ie), document.removeEventListener("touchstart", S, ie);
727
- };
728
- }, []);
729
- var w = e.removeScrollBar, E = e.inert;
730
- return a.createElement(
731
- a.Fragment,
732
- null,
733
- E ? a.createElement(i, { styles: wr(o) }) : null,
734
- w ? a.createElement(dr, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
735
- );
736
- }
737
- function Er(e) {
738
- for (var t = null; e !== null; )
739
- e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
740
- return t;
741
- }
742
- const xr = Qn(wt, br);
743
- var Rt = a.forwardRef(function(e, t) {
744
- return a.createElement(Ee, U({}, e, { ref: t, sideCar: xr }));
745
- });
746
- Rt.classNames = Ee.classNames;
747
- var Rr = function(e) {
748
- if (typeof document > "u")
749
- return null;
750
- var t = Array.isArray(e) ? e[0] : e;
751
- return t.ownerDocument.body;
752
- }, se = /* @__PURE__ */ new WeakMap(), Se = /* @__PURE__ */ new WeakMap(), ye = {}, Fe = 0, Nt = function(e) {
753
- return e && (e.host || Nt(e.parentNode));
754
- }, Nr = function(e, t) {
755
- return t.map(function(n) {
756
- if (e.contains(n))
757
- return n;
758
- var r = Nt(n);
759
- return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
760
- }).filter(function(n) {
761
- return !!n;
762
- });
763
- }, Tr = function(e, t, n, r) {
764
- var o = Nr(t, Array.isArray(e) ? e : [e]);
765
- ye[n] || (ye[n] = /* @__PURE__ */ new WeakMap());
766
- var i = ye[n], s = [], c = /* @__PURE__ */ new Set(), u = new Set(o), d = function(h) {
767
- !h || c.has(h) || (c.add(h), d(h.parentNode));
768
- };
769
- o.forEach(d);
770
- var S = function(h) {
771
- !h || u.has(h) || Array.prototype.forEach.call(h.children, function(y) {
772
- if (c.has(y))
773
- S(y);
774
- else
775
- try {
776
- var w = y.getAttribute(r), E = w !== null && w !== "false", l = (se.get(y) || 0) + 1, p = (i.get(y) || 0) + 1;
777
- se.set(y, l), i.set(y, p), s.push(y), l === 1 && E && Se.set(y, !0), p === 1 && y.setAttribute(n, "true"), E || y.setAttribute(r, "true");
778
- } catch (g) {
779
- console.error("aria-hidden: cannot operate on ", y, g);
780
- }
781
- });
782
- };
783
- return S(t), c.clear(), Fe++, function() {
784
- s.forEach(function(h) {
785
- var y = se.get(h) - 1, w = i.get(h) - 1;
786
- se.set(h, y), i.set(h, w), y || (Se.has(h) || h.removeAttribute(r), Se.delete(h)), w || h.removeAttribute(n);
787
- }), Fe--, Fe || (se = /* @__PURE__ */ new WeakMap(), se = /* @__PURE__ */ new WeakMap(), Se = /* @__PURE__ */ new WeakMap(), ye = {});
788
- };
789
- }, Ir = function(e, t, n) {
790
- n === void 0 && (n = "data-aria-hidden");
791
- var r = Array.from(Array.isArray(e) ? e : [e]), o = Rr(e);
792
- return o ? (r.push.apply(r, Array.from(o.querySelectorAll("[aria-live], script"))), Tr(r, o, n, "aria-hidden")) : function() {
793
- return null;
794
- };
795
- };
796
- function Pr(e) {
797
- const t = a.useRef({ value: e, previous: e });
798
- return a.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
799
- }
800
- function st(e, [t, n]) {
801
- return Math.min(n, Math.max(t, e));
802
- }
803
- // @__NO_SIDE_EFFECTS__
804
- function _r(e) {
805
- const t = /* @__PURE__ */ Mr(e), n = a.forwardRef((r, o) => {
806
- const { children: i, ...s } = r, c = a.Children.toArray(i), u = c.find(Or);
807
- if (u) {
808
- const d = u.props.children, S = c.map((h) => h === u ? a.Children.count(d) > 1 ? a.Children.only(null) : a.isValidElement(d) ? d.props.children : null : h);
809
- return /* @__PURE__ */ v(t, { ...s, ref: o, children: a.isValidElement(d) ? a.cloneElement(d, void 0, S) : null });
810
- }
811
- return /* @__PURE__ */ v(t, { ...s, ref: o, children: i });
812
- });
813
- return n.displayName = `${e}.Slot`, n;
814
- }
815
- // @__NO_SIDE_EFFECTS__
816
- function Mr(e) {
817
- const t = a.forwardRef((n, r) => {
818
- const { children: o, ...i } = n;
819
- if (a.isValidElement(o)) {
820
- const s = Lr(o), c = kr(i, o.props);
821
- return o.type !== a.Fragment && (c.ref = r ? dt(r, s) : s), a.cloneElement(o, c);
822
- }
823
- return a.Children.count(o) > 1 ? a.Children.only(null) : null;
824
- });
825
- return t.displayName = `${e}.SlotClone`, t;
826
- }
827
- var Ar = Symbol("radix.slottable");
828
- function Or(e) {
829
- return a.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === Ar;
830
- }
831
- function kr(e, t) {
832
- const n = { ...t };
833
- for (const r in t) {
834
- const o = e[r], i = t[r];
835
- /^on[A-Z]/.test(r) ? o && i ? n[r] = (...c) => {
836
- const u = i(...c);
837
- return o(...c), u;
838
- } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...i } : r === "className" && (n[r] = [o, i].filter(Boolean).join(" "));
839
- }
840
- return { ...e, ...n };
841
- }
842
- function Lr(e) {
843
- var r, o;
844
- let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
845
- return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
846
- }
847
- var Dr = [" ", "Enter", "ArrowUp", "ArrowDown"], Br = [" ", "Enter"], oe = "Select", [xe, Re, Vr] = Rn(oe), [de] = ft(oe, [
848
- Vr,
849
- pt
850
- ]), Ne = pt(), [Fr, J] = de(oe), [Wr, Hr] = de(oe), Tt = (e) => {
851
- const {
852
- __scopeSelect: t,
853
- children: n,
854
- open: r,
855
- defaultOpen: o,
856
- onOpenChange: i,
857
- value: s,
858
- defaultValue: c,
859
- onValueChange: u,
860
- dir: d,
861
- name: S,
862
- autoComplete: h,
863
- disabled: y,
864
- required: w,
865
- form: E
866
- } = e, l = Ne(t), [p, g] = a.useState(null), [f, m] = a.useState(null), [b, x] = a.useState(!1), _ = Tn(d), [R, L] = qe({
867
- prop: r,
868
- defaultProp: o ?? !1,
869
- onChange: i,
870
- caller: oe
871
- }), [V, K] = qe({
872
- prop: s,
873
- defaultProp: c,
874
- onChange: u,
875
- caller: oe
876
- }), O = a.useRef(null), F = p ? E || !!p.closest("form") : !0, [Y, $] = a.useState(/* @__PURE__ */ new Set()), j = Array.from(Y).map((k) => k.props.value).join(";");
877
- return /* @__PURE__ */ v(gn, { ...l, children: /* @__PURE__ */ q(
878
- Fr,
879
- {
880
- required: w,
881
- scope: t,
882
- trigger: p,
883
- onTriggerChange: g,
884
- valueNode: f,
885
- onValueNodeChange: m,
886
- valueNodeHasChildren: b,
887
- onValueNodeHasChildrenChange: x,
888
- contentId: Ye(),
889
- value: V,
890
- onValueChange: K,
891
- open: R,
892
- onOpenChange: L,
893
- dir: _,
894
- triggerPointerDownPosRef: O,
895
- disabled: y,
896
- children: [
897
- /* @__PURE__ */ v(xe.Provider, { scope: t, children: /* @__PURE__ */ v(
898
- Wr,
899
- {
900
- scope: e.__scopeSelect,
901
- onNativeOptionAdd: a.useCallback((k) => {
902
- $((H) => new Set(H).add(k));
903
- }, []),
904
- onNativeOptionRemove: a.useCallback((k) => {
905
- $((H) => {
906
- const z = new Set(H);
907
- return z.delete(k), z;
908
- });
909
- }, []),
910
- children: n
911
- }
912
- ) }),
913
- F ? /* @__PURE__ */ q(
914
- Qt,
915
- {
916
- "aria-hidden": !0,
917
- required: w,
918
- tabIndex: -1,
919
- name: S,
920
- autoComplete: h,
921
- value: V,
922
- onChange: (k) => K(k.target.value),
923
- disabled: y,
924
- form: E,
925
- children: [
926
- V === void 0 ? /* @__PURE__ */ v("option", { value: "" }) : null,
927
- Array.from(Y)
928
- ]
929
- },
930
- j
931
- ) : null
932
- ]
933
- }
934
- ) });
935
- };
936
- Tt.displayName = oe;
937
- var It = "SelectTrigger", Pt = a.forwardRef(
938
- (e, t) => {
939
- const { __scopeSelect: n, disabled: r = !1, ...o } = e, i = Ne(n), s = J(It, n), c = s.disabled || r, u = B(t, s.onTriggerChange), d = Re(n), S = a.useRef("touch"), [h, y, w] = en((l) => {
940
- const p = d().filter((m) => !m.disabled), g = p.find((m) => m.value === s.value), f = tn(p, l, g);
941
- f !== void 0 && s.onValueChange(f.value);
942
- }), E = (l) => {
943
- c || (s.onOpenChange(!0), w()), l && (s.triggerPointerDownPosRef.current = {
944
- x: Math.round(l.pageX),
945
- y: Math.round(l.pageY)
946
- });
947
- };
948
- return /* @__PURE__ */ v(mn, { asChild: !0, ...i, children: /* @__PURE__ */ v(
949
- A.button,
950
- {
951
- type: "button",
952
- role: "combobox",
953
- "aria-controls": s.contentId,
954
- "aria-expanded": s.open,
955
- "aria-required": s.required,
956
- "aria-autocomplete": "none",
957
- dir: s.dir,
958
- "data-state": s.open ? "open" : "closed",
959
- disabled: c,
960
- "data-disabled": c ? "" : void 0,
961
- "data-placeholder": Jt(s.value) ? "" : void 0,
962
- ...o,
963
- ref: u,
964
- onClick: M(o.onClick, (l) => {
965
- l.currentTarget.focus(), S.current !== "mouse" && E(l);
966
- }),
967
- onPointerDown: M(o.onPointerDown, (l) => {
968
- S.current = l.pointerType;
969
- const p = l.target;
970
- p.hasPointerCapture(l.pointerId) && p.releasePointerCapture(l.pointerId), l.button === 0 && l.ctrlKey === !1 && l.pointerType === "mouse" && (E(l), l.preventDefault());
971
- }),
972
- onKeyDown: M(o.onKeyDown, (l) => {
973
- const p = h.current !== "";
974
- !(l.ctrlKey || l.altKey || l.metaKey) && l.key.length === 1 && y(l.key), !(p && l.key === " ") && Dr.includes(l.key) && (E(), l.preventDefault());
975
- })
976
- }
977
- ) });
978
- }
979
- );
980
- Pt.displayName = It;
981
- var _t = "SelectValue", Mt = a.forwardRef(
982
- (e, t) => {
983
- const { __scopeSelect: n, className: r, style: o, children: i, placeholder: s = "", ...c } = e, u = J(_t, n), { onValueNodeHasChildrenChange: d } = u, S = i !== void 0, h = B(t, u.onValueNodeChange);
984
- return G(() => {
985
- d(S);
986
- }, [d, S]), /* @__PURE__ */ v(
987
- A.span,
988
- {
989
- ...c,
990
- ref: h,
991
- style: { pointerEvents: "none" },
992
- children: Jt(u.value) ? /* @__PURE__ */ v(Ge, { children: s }) : i
993
- }
994
- );
995
- }
996
- );
997
- Mt.displayName = _t;
998
- var Ur = "SelectIcon", At = a.forwardRef(
999
- (e, t) => {
1000
- const { __scopeSelect: n, children: r, ...o } = e;
1001
- return /* @__PURE__ */ v(A.span, { "aria-hidden": !0, ...o, ref: t, children: r || "▼" });
1002
- }
1003
- );
1004
- At.displayName = Ur;
1005
- var Kr = "SelectPortal", Ot = (e) => /* @__PURE__ */ v(gt, { asChild: !0, ...e });
1006
- Ot.displayName = Kr;
1007
- var ae = "SelectContent", kt = a.forwardRef(
1008
- (e, t) => {
1009
- const n = J(ae, e.__scopeSelect), [r, o] = a.useState();
1010
- if (G(() => {
1011
- o(new DocumentFragment());
1012
- }, []), !n.open) {
1013
- const i = r;
1014
- return i ? ut.createPortal(
1015
- /* @__PURE__ */ v(Lt, { scope: e.__scopeSelect, children: /* @__PURE__ */ v(xe.Slot, { scope: e.__scopeSelect, children: /* @__PURE__ */ v("div", { children: e.children }) }) }),
1016
- i
1017
- ) : null;
1018
- }
1019
- return /* @__PURE__ */ v(Dt, { ...e, ref: t });
1020
- }
1021
- );
1022
- kt.displayName = ae;
1023
- var W = 10, [Lt, ee] = de(ae), $r = "SelectContentImpl", jr = /* @__PURE__ */ _r("SelectContent.RemoveScroll"), Dt = a.forwardRef(
1024
- (e, t) => {
1025
- const {
1026
- __scopeSelect: n,
1027
- position: r = "item-aligned",
1028
- onCloseAutoFocus: o,
1029
- onEscapeKeyDown: i,
1030
- onPointerDownOutside: s,
1031
- //
1032
- // PopperContent props
1033
- side: c,
1034
- sideOffset: u,
1035
- align: d,
1036
- alignOffset: S,
1037
- arrowPadding: h,
1038
- collisionBoundary: y,
1039
- collisionPadding: w,
1040
- sticky: E,
1041
- hideWhenDetached: l,
1042
- avoidCollisions: p,
1043
- //
1044
- ...g
1045
- } = e, f = J(ae, n), [m, b] = a.useState(null), [x, _] = a.useState(null), R = B(t, (C) => b(C)), [L, V] = a.useState(null), [K, O] = a.useState(
1046
- null
1047
- ), F = Re(n), [Y, $] = a.useState(!1), j = a.useRef(!1);
1048
- a.useEffect(() => {
1049
- if (m) return Ir(m);
1050
- }, [m]), Un();
1051
- const k = a.useCallback(
1052
- (C) => {
1053
- const [P, ...D] = F().map((T) => T.ref.current), [I] = D.slice(-1), N = document.activeElement;
1054
- for (const T of C)
1055
- if (T === N || (T == null || T.scrollIntoView({ block: "nearest" }), T === P && x && (x.scrollTop = 0), T === I && x && (x.scrollTop = x.scrollHeight), T == null || T.focus(), document.activeElement !== N)) return;
1056
- },
1057
- [F, x]
1058
- ), H = a.useCallback(
1059
- () => k([L, m]),
1060
- [k, L, m]
1061
- );
1062
- a.useEffect(() => {
1063
- Y && H();
1064
- }, [Y, H]);
1065
- const { onOpenChange: z, triggerPointerDownPosRef: X } = f;
1066
- a.useEffect(() => {
1067
- if (m) {
1068
- let C = { x: 0, y: 0 };
1069
- const P = (I) => {
1070
- var N, T;
1071
- C = {
1072
- x: Math.abs(Math.round(I.pageX) - (((N = X.current) == null ? void 0 : N.x) ?? 0)),
1073
- y: Math.abs(Math.round(I.pageY) - (((T = X.current) == null ? void 0 : T.y) ?? 0))
1074
- };
1075
- }, D = (I) => {
1076
- C.x <= 10 && C.y <= 10 ? I.preventDefault() : m.contains(I.target) || z(!1), document.removeEventListener("pointermove", P), X.current = null;
1077
- };
1078
- return X.current !== null && (document.addEventListener("pointermove", P), document.addEventListener("pointerup", D, { capture: !0, once: !0 })), () => {
1079
- document.removeEventListener("pointermove", P), document.removeEventListener("pointerup", D, { capture: !0 });
1080
- };
1081
- }
1082
- }, [m, z, X]), a.useEffect(() => {
1083
- const C = () => z(!1);
1084
- return window.addEventListener("blur", C), window.addEventListener("resize", C), () => {
1085
- window.removeEventListener("blur", C), window.removeEventListener("resize", C);
1086
- };
1087
- }, [z]);
1088
- const [Te, me] = en((C) => {
1089
- const P = F().filter((N) => !N.disabled), D = P.find((N) => N.ref.current === document.activeElement), I = tn(P, C, D);
1090
- I && setTimeout(() => I.ref.current.focus());
1091
- }), Ie = a.useCallback(
1092
- (C, P, D) => {
1093
- const I = !j.current && !D;
1094
- (f.value !== void 0 && f.value === P || I) && (V(C), I && (j.current = !0));
1095
- },
1096
- [f.value]
1097
- ), Pe = a.useCallback(() => m == null ? void 0 : m.focus(), [m]), ce = a.useCallback(
1098
- (C, P, D) => {
1099
- const I = !j.current && !D;
1100
- (f.value !== void 0 && f.value === P || I) && O(C);
1101
- },
1102
- [f.value]
1103
- ), ve = r === "popper" ? Ue : Bt, fe = ve === Ue ? {
1104
- side: c,
1105
- sideOffset: u,
1106
- align: d,
1107
- alignOffset: S,
1108
- arrowPadding: h,
1109
- collisionBoundary: y,
1110
- collisionPadding: w,
1111
- sticky: E,
1112
- hideWhenDetached: l,
1113
- avoidCollisions: p
1114
- } : {};
1115
- return /* @__PURE__ */ v(
1116
- Lt,
1117
- {
1118
- scope: n,
1119
- content: m,
1120
- viewport: x,
1121
- onViewportChange: _,
1122
- itemRefCallback: Ie,
1123
- selectedItem: L,
1124
- onItemLeave: Pe,
1125
- itemTextRefCallback: ce,
1126
- focusSelectedItem: H,
1127
- selectedItemText: K,
1128
- position: r,
1129
- isPositioned: Y,
1130
- searchRef: Te,
1131
- children: /* @__PURE__ */ v(Rt, { as: jr, allowPinchZoom: !0, children: /* @__PURE__ */ v(
1132
- vt,
1133
- {
1134
- asChild: !0,
1135
- trapped: f.open,
1136
- onMountAutoFocus: (C) => {
1137
- C.preventDefault();
1138
- },
1139
- onUnmountAutoFocus: M(o, (C) => {
1140
- var P;
1141
- (P = f.trigger) == null || P.focus({ preventScroll: !0 }), C.preventDefault();
1142
- }),
1143
- children: /* @__PURE__ */ v(
1144
- vn,
1145
- {
1146
- asChild: !0,
1147
- disableOutsidePointerEvents: !0,
1148
- onEscapeKeyDown: i,
1149
- onPointerDownOutside: s,
1150
- onFocusOutside: (C) => C.preventDefault(),
1151
- onDismiss: () => f.onOpenChange(!1),
1152
- children: /* @__PURE__ */ v(
1153
- ve,
1154
- {
1155
- role: "listbox",
1156
- id: f.contentId,
1157
- "data-state": f.open ? "open" : "closed",
1158
- dir: f.dir,
1159
- onContextMenu: (C) => C.preventDefault(),
1160
- ...g,
1161
- ...fe,
1162
- onPlaced: () => $(!0),
1163
- ref: R,
1164
- style: {
1165
- // flex layout so we can place the scroll buttons properly
1166
- display: "flex",
1167
- flexDirection: "column",
1168
- // reset the outline by default as the content MAY get focused
1169
- outline: "none",
1170
- ...g.style
1171
- },
1172
- onKeyDown: M(g.onKeyDown, (C) => {
1173
- const P = C.ctrlKey || C.altKey || C.metaKey;
1174
- if (C.key === "Tab" && C.preventDefault(), !P && C.key.length === 1 && me(C.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(C.key)) {
1175
- let I = F().filter((N) => !N.disabled).map((N) => N.ref.current);
1176
- if (["ArrowUp", "End"].includes(C.key) && (I = I.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(C.key)) {
1177
- const N = C.target, T = I.indexOf(N);
1178
- I = I.slice(T + 1);
1179
- }
1180
- setTimeout(() => k(I)), C.preventDefault();
1181
- }
1182
- })
1183
- }
1184
- )
1185
- }
1186
- )
1187
- }
1188
- ) })
1189
- }
1190
- );
1191
- }
1192
- );
1193
- Dt.displayName = $r;
1194
- var zr = "SelectItemAlignedPosition", Bt = a.forwardRef((e, t) => {
1195
- const { __scopeSelect: n, onPlaced: r, ...o } = e, i = J(ae, n), s = ee(ae, n), [c, u] = a.useState(null), [d, S] = a.useState(null), h = B(t, (R) => S(R)), y = Re(n), w = a.useRef(!1), E = a.useRef(!0), { viewport: l, selectedItem: p, selectedItemText: g, focusSelectedItem: f } = s, m = a.useCallback(() => {
1196
- if (i.trigger && i.valueNode && c && d && l && p && g) {
1197
- const R = i.trigger.getBoundingClientRect(), L = d.getBoundingClientRect(), V = i.valueNode.getBoundingClientRect(), K = g.getBoundingClientRect();
1198
- if (i.dir !== "rtl") {
1199
- const N = K.left - L.left, T = V.left - N, te = R.left - T, ne = R.width + te, _e = Math.max(ne, L.width), Me = window.innerWidth - W, Ae = st(T, [
1200
- W,
1201
- // Prevents the content from going off the starting edge of the
1202
- // viewport. It may still go off the ending edge, but this can be
1203
- // controlled by the user since they may want to manage overflow in a
1204
- // specific way.
1205
- // https://github.com/radix-ui/primitives/issues/2049
1206
- Math.max(W, Me - _e)
1207
- ]);
1208
- c.style.minWidth = ne + "px", c.style.left = Ae + "px";
1209
- } else {
1210
- const N = L.right - K.right, T = window.innerWidth - V.right - N, te = window.innerWidth - R.right - T, ne = R.width + te, _e = Math.max(ne, L.width), Me = window.innerWidth - W, Ae = st(T, [
1211
- W,
1212
- Math.max(W, Me - _e)
1213
- ]);
1214
- c.style.minWidth = ne + "px", c.style.right = Ae + "px";
1215
- }
1216
- const O = y(), F = window.innerHeight - W * 2, Y = l.scrollHeight, $ = window.getComputedStyle(d), j = parseInt($.borderTopWidth, 10), k = parseInt($.paddingTop, 10), H = parseInt($.borderBottomWidth, 10), z = parseInt($.paddingBottom, 10), X = j + k + Y + z + H, Te = Math.min(p.offsetHeight * 5, X), me = window.getComputedStyle(l), Ie = parseInt(me.paddingTop, 10), Pe = parseInt(me.paddingBottom, 10), ce = R.top + R.height / 2 - W, ve = F - ce, fe = p.offsetHeight / 2, C = p.offsetTop + fe, P = j + k + C, D = X - P;
1217
- if (P <= ce) {
1218
- const N = O.length > 0 && p === O[O.length - 1].ref.current;
1219
- c.style.bottom = "0px";
1220
- const T = d.clientHeight - l.offsetTop - l.offsetHeight, te = Math.max(
1221
- ve,
1222
- fe + // viewport might have padding bottom, include it to avoid a scrollable viewport
1223
- (N ? Pe : 0) + T + H
1224
- ), ne = P + te;
1225
- c.style.height = ne + "px";
1226
- } else {
1227
- const N = O.length > 0 && p === O[0].ref.current;
1228
- c.style.top = "0px";
1229
- const te = Math.max(
1230
- ce,
1231
- j + l.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
1232
- (N ? Ie : 0) + fe
1233
- ) + D;
1234
- c.style.height = te + "px", l.scrollTop = P - ce + l.offsetTop;
1235
- }
1236
- c.style.margin = `${W}px 0`, c.style.minHeight = Te + "px", c.style.maxHeight = F + "px", r == null || r(), requestAnimationFrame(() => w.current = !0);
1237
- }
1238
- }, [
1239
- y,
1240
- i.trigger,
1241
- i.valueNode,
1242
- c,
1243
- d,
1244
- l,
1245
- p,
1246
- g,
1247
- i.dir,
1248
- r
1249
- ]);
1250
- G(() => m(), [m]);
1251
- const [b, x] = a.useState();
1252
- G(() => {
1253
- d && x(window.getComputedStyle(d).zIndex);
1254
- }, [d]);
1255
- const _ = a.useCallback(
1256
- (R) => {
1257
- R && E.current === !0 && (m(), f == null || f(), E.current = !1);
1258
- },
1259
- [m, f]
1260
- );
1261
- return /* @__PURE__ */ v(
1262
- Yr,
1263
- {
1264
- scope: n,
1265
- contentWrapper: c,
1266
- shouldExpandOnScrollRef: w,
1267
- onScrollButtonChange: _,
1268
- children: /* @__PURE__ */ v(
1269
- "div",
1270
- {
1271
- ref: u,
1272
- style: {
1273
- display: "flex",
1274
- flexDirection: "column",
1275
- position: "fixed",
1276
- zIndex: b
1277
- },
1278
- children: /* @__PURE__ */ v(
1279
- A.div,
1280
- {
1281
- ...o,
1282
- ref: h,
1283
- style: {
1284
- // When we get the height of the content, it includes borders. If we were to set
1285
- // the height without having `boxSizing: 'border-box'` it would be too big.
1286
- boxSizing: "border-box",
1287
- // We need to ensure the content doesn't get taller than the wrapper
1288
- maxHeight: "100%",
1289
- ...o.style
1290
- }
1291
- }
1292
- )
1293
- }
1294
- )
1295
- }
1296
- );
1297
- });
1298
- Bt.displayName = zr;
1299
- var Gr = "SelectPopperPosition", Ue = a.forwardRef((e, t) => {
1300
- const {
1301
- __scopeSelect: n,
1302
- align: r = "start",
1303
- collisionPadding: o = W,
1304
- ...i
1305
- } = e, s = Ne(n);
1306
- return /* @__PURE__ */ v(
1307
- hn,
1308
- {
1309
- ...s,
1310
- ...i,
1311
- ref: t,
1312
- align: r,
1313
- collisionPadding: o,
1314
- style: {
1315
- // Ensure border-box for floating-ui calculations
1316
- boxSizing: "border-box",
1317
- ...i.style,
1318
- "--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
1319
- "--radix-select-content-available-width": "var(--radix-popper-available-width)",
1320
- "--radix-select-content-available-height": "var(--radix-popper-available-height)",
1321
- "--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
1322
- "--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
1323
- }
1324
- }
1325
- );
1326
- });
1327
- Ue.displayName = Gr;
1328
- var [Yr, Ze] = de(ae, {}), Ke = "SelectViewport", Vt = a.forwardRef(
1329
- (e, t) => {
1330
- const { __scopeSelect: n, nonce: r, ...o } = e, i = ee(Ke, n), s = Ze(Ke, n), c = B(t, i.onViewportChange), u = a.useRef(0);
1331
- return /* @__PURE__ */ q(Ge, { children: [
1332
- /* @__PURE__ */ v(
1333
- "style",
1334
- {
1335
- dangerouslySetInnerHTML: {
1336
- __html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
1337
- },
1338
- nonce: r
1339
- }
1340
- ),
1341
- /* @__PURE__ */ v(xe.Slot, { scope: n, children: /* @__PURE__ */ v(
1342
- A.div,
1343
- {
1344
- "data-radix-select-viewport": "",
1345
- role: "presentation",
1346
- ...o,
1347
- ref: c,
1348
- style: {
1349
- // we use position: 'relative' here on the `viewport` so that when we call
1350
- // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
1351
- // (independent of the scrollUpButton).
1352
- position: "relative",
1353
- flex: 1,
1354
- // Viewport should only be scrollable in the vertical direction.
1355
- // This won't work in vertical writing modes, so we'll need to
1356
- // revisit this if/when that is supported
1357
- // https://developer.chrome.com/blog/vertical-form-controls
1358
- overflow: "hidden auto",
1359
- ...o.style
1360
- },
1361
- onScroll: M(o.onScroll, (d) => {
1362
- const S = d.currentTarget, { contentWrapper: h, shouldExpandOnScrollRef: y } = s;
1363
- if (y != null && y.current && h) {
1364
- const w = Math.abs(u.current - S.scrollTop);
1365
- if (w > 0) {
1366
- const E = window.innerHeight - W * 2, l = parseFloat(h.style.minHeight), p = parseFloat(h.style.height), g = Math.max(l, p);
1367
- if (g < E) {
1368
- const f = g + w, m = Math.min(E, f), b = f - m;
1369
- h.style.height = m + "px", h.style.bottom === "0px" && (S.scrollTop = b > 0 ? b : 0, h.style.justifyContent = "flex-end");
1370
- }
1371
- }
1372
- }
1373
- u.current = S.scrollTop;
1374
- })
1375
- }
1376
- ) })
1377
- ] });
1378
- }
1379
- );
1380
- Vt.displayName = Ke;
1381
- var Ft = "SelectGroup", [Xr, Zr] = de(Ft), Wt = a.forwardRef(
1382
- (e, t) => {
1383
- const { __scopeSelect: n, ...r } = e, o = Ye();
1384
- return /* @__PURE__ */ v(Xr, { scope: n, id: o, children: /* @__PURE__ */ v(A.div, { role: "group", "aria-labelledby": o, ...r, ref: t }) });
1385
- }
1386
- );
1387
- Wt.displayName = Ft;
1388
- var Ht = "SelectLabel", Ut = a.forwardRef(
1389
- (e, t) => {
1390
- const { __scopeSelect: n, ...r } = e, o = Zr(Ht, n);
1391
- return /* @__PURE__ */ v(A.div, { id: o.id, ...r, ref: t });
1392
- }
1393
- );
1394
- Ut.displayName = Ht;
1395
- var be = "SelectItem", [qr, Kt] = de(be), $t = a.forwardRef(
1396
- (e, t) => {
1397
- const {
1398
- __scopeSelect: n,
1399
- value: r,
1400
- disabled: o = !1,
1401
- textValue: i,
1402
- ...s
1403
- } = e, c = J(be, n), u = ee(be, n), d = c.value === r, [S, h] = a.useState(i ?? ""), [y, w] = a.useState(!1), E = B(
1404
- t,
1405
- (f) => {
1406
- var m;
1407
- return (m = u.itemRefCallback) == null ? void 0 : m.call(u, f, r, o);
1408
- }
1409
- ), l = Ye(), p = a.useRef("touch"), g = () => {
1410
- o || (c.onValueChange(r), c.onOpenChange(!1));
1411
- };
1412
- if (r === "")
1413
- throw new Error(
1414
- "A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder."
1415
- );
1416
- return /* @__PURE__ */ v(
1417
- qr,
1418
- {
1419
- scope: n,
1420
- value: r,
1421
- disabled: o,
1422
- textId: l,
1423
- isSelected: d,
1424
- onItemTextChange: a.useCallback((f) => {
1425
- h((m) => m || ((f == null ? void 0 : f.textContent) ?? "").trim());
1426
- }, []),
1427
- children: /* @__PURE__ */ v(
1428
- xe.ItemSlot,
1429
- {
1430
- scope: n,
1431
- value: r,
1432
- disabled: o,
1433
- textValue: S,
1434
- children: /* @__PURE__ */ v(
1435
- A.div,
1436
- {
1437
- role: "option",
1438
- "aria-labelledby": l,
1439
- "data-highlighted": y ? "" : void 0,
1440
- "aria-selected": d && y,
1441
- "data-state": d ? "checked" : "unchecked",
1442
- "aria-disabled": o || void 0,
1443
- "data-disabled": o ? "" : void 0,
1444
- tabIndex: o ? void 0 : -1,
1445
- ...s,
1446
- ref: E,
1447
- onFocus: M(s.onFocus, () => w(!0)),
1448
- onBlur: M(s.onBlur, () => w(!1)),
1449
- onClick: M(s.onClick, () => {
1450
- p.current !== "mouse" && g();
1451
- }),
1452
- onPointerUp: M(s.onPointerUp, () => {
1453
- p.current === "mouse" && g();
1454
- }),
1455
- onPointerDown: M(s.onPointerDown, (f) => {
1456
- p.current = f.pointerType;
1457
- }),
1458
- onPointerMove: M(s.onPointerMove, (f) => {
1459
- var m;
1460
- p.current = f.pointerType, o ? (m = u.onItemLeave) == null || m.call(u) : p.current === "mouse" && f.currentTarget.focus({ preventScroll: !0 });
1461
- }),
1462
- onPointerLeave: M(s.onPointerLeave, (f) => {
1463
- var m;
1464
- f.currentTarget === document.activeElement && ((m = u.onItemLeave) == null || m.call(u));
1465
- }),
1466
- onKeyDown: M(s.onKeyDown, (f) => {
1467
- var b;
1468
- ((b = u.searchRef) == null ? void 0 : b.current) !== "" && f.key === " " || (Br.includes(f.key) && g(), f.key === " " && f.preventDefault());
1469
- })
1470
- }
1471
- )
1472
- }
1473
- )
1474
- }
1475
- );
1476
- }
1477
- );
1478
- $t.displayName = be;
1479
- var pe = "SelectItemText", jt = a.forwardRef(
1480
- (e, t) => {
1481
- const { __scopeSelect: n, className: r, style: o, ...i } = e, s = J(pe, n), c = ee(pe, n), u = Kt(pe, n), d = Hr(pe, n), [S, h] = a.useState(null), y = B(
1482
- t,
1483
- (g) => h(g),
1484
- u.onItemTextChange,
1485
- (g) => {
1486
- var f;
1487
- return (f = c.itemTextRefCallback) == null ? void 0 : f.call(c, g, u.value, u.disabled);
1488
- }
1489
- ), w = S == null ? void 0 : S.textContent, E = a.useMemo(
1490
- () => /* @__PURE__ */ v("option", { value: u.value, disabled: u.disabled, children: w }, u.value),
1491
- [u.disabled, u.value, w]
1492
- ), { onNativeOptionAdd: l, onNativeOptionRemove: p } = d;
1493
- return G(() => (l(E), () => p(E)), [l, p, E]), /* @__PURE__ */ q(Ge, { children: [
1494
- /* @__PURE__ */ v(A.span, { id: u.textId, ...i, ref: y }),
1495
- u.isSelected && s.valueNode && !s.valueNodeHasChildren ? ut.createPortal(i.children, s.valueNode) : null
1496
- ] });
1497
- }
1498
- );
1499
- jt.displayName = pe;
1500
- var zt = "SelectItemIndicator", Gt = a.forwardRef(
1501
- (e, t) => {
1502
- const { __scopeSelect: n, ...r } = e;
1503
- return Kt(zt, n).isSelected ? /* @__PURE__ */ v(A.span, { "aria-hidden": !0, ...r, ref: t }) : null;
1504
- }
1505
- );
1506
- Gt.displayName = zt;
1507
- var $e = "SelectScrollUpButton", Yt = a.forwardRef((e, t) => {
1508
- const n = ee($e, e.__scopeSelect), r = Ze($e, e.__scopeSelect), [o, i] = a.useState(!1), s = B(t, r.onScrollButtonChange);
1509
- return G(() => {
1510
- if (n.viewport && n.isPositioned) {
1511
- let c = function() {
1512
- const d = u.scrollTop > 0;
1513
- i(d);
1514
- };
1515
- const u = n.viewport;
1516
- return c(), u.addEventListener("scroll", c), () => u.removeEventListener("scroll", c);
1517
- }
1518
- }, [n.viewport, n.isPositioned]), o ? /* @__PURE__ */ v(
1519
- Zt,
1520
- {
1521
- ...e,
1522
- ref: s,
1523
- onAutoScroll: () => {
1524
- const { viewport: c, selectedItem: u } = n;
1525
- c && u && (c.scrollTop = c.scrollTop - u.offsetHeight);
1526
- }
1527
- }
1528
- ) : null;
1529
- });
1530
- Yt.displayName = $e;
1531
- var je = "SelectScrollDownButton", Xt = a.forwardRef((e, t) => {
1532
- const n = ee(je, e.__scopeSelect), r = Ze(je, e.__scopeSelect), [o, i] = a.useState(!1), s = B(t, r.onScrollButtonChange);
1533
- return G(() => {
1534
- if (n.viewport && n.isPositioned) {
1535
- let c = function() {
1536
- const d = u.scrollHeight - u.clientHeight, S = Math.ceil(u.scrollTop) < d;
1537
- i(S);
1538
- };
1539
- const u = n.viewport;
1540
- return c(), u.addEventListener("scroll", c), () => u.removeEventListener("scroll", c);
1541
- }
1542
- }, [n.viewport, n.isPositioned]), o ? /* @__PURE__ */ v(
1543
- Zt,
1544
- {
1545
- ...e,
1546
- ref: s,
1547
- onAutoScroll: () => {
1548
- const { viewport: c, selectedItem: u } = n;
1549
- c && u && (c.scrollTop = c.scrollTop + u.offsetHeight);
1550
- }
1551
- }
1552
- ) : null;
1553
- });
1554
- Xt.displayName = je;
1555
- var Zt = a.forwardRef((e, t) => {
1556
- const { __scopeSelect: n, onAutoScroll: r, ...o } = e, i = ee("SelectScrollButton", n), s = a.useRef(null), c = Re(n), u = a.useCallback(() => {
1557
- s.current !== null && (window.clearInterval(s.current), s.current = null);
1558
- }, []);
1559
- return a.useEffect(() => () => u(), [u]), G(() => {
1560
- var S;
1561
- const d = c().find((h) => h.ref.current === document.activeElement);
1562
- (S = d == null ? void 0 : d.ref.current) == null || S.scrollIntoView({ block: "nearest" });
1563
- }, [c]), /* @__PURE__ */ v(
1564
- A.div,
1565
- {
1566
- "aria-hidden": !0,
1567
- ...o,
1568
- ref: t,
1569
- style: { flexShrink: 0, ...o.style },
1570
- onPointerDown: M(o.onPointerDown, () => {
1571
- s.current === null && (s.current = window.setInterval(r, 50));
1572
- }),
1573
- onPointerMove: M(o.onPointerMove, () => {
1574
- var d;
1575
- (d = i.onItemLeave) == null || d.call(i), s.current === null && (s.current = window.setInterval(r, 50));
1576
- }),
1577
- onPointerLeave: M(o.onPointerLeave, () => {
1578
- u();
1579
- })
1580
- }
1581
- );
1582
- }), Qr = "SelectSeparator", qt = a.forwardRef(
1583
- (e, t) => {
1584
- const { __scopeSelect: n, ...r } = e;
1585
- return /* @__PURE__ */ v(A.div, { "aria-hidden": !0, ...r, ref: t });
1586
- }
1587
- );
1588
- qt.displayName = Qr;
1589
- var ze = "SelectArrow", Jr = a.forwardRef(
1590
- (e, t) => {
1591
- const { __scopeSelect: n, ...r } = e, o = Ne(n), i = J(ze, n), s = ee(ze, n);
1592
- return i.open && s.position === "popper" ? /* @__PURE__ */ v(yn, { ...o, ...r, ref: t }) : null;
1593
- }
1594
- );
1595
- Jr.displayName = ze;
1596
- var eo = "SelectBubbleInput", Qt = a.forwardRef(
1597
- ({ __scopeSelect: e, value: t, ...n }, r) => {
1598
- const o = a.useRef(null), i = B(r, o), s = Pr(t);
1599
- return a.useEffect(() => {
1600
- const c = o.current;
1601
- if (!c) return;
1602
- const u = window.HTMLSelectElement.prototype, S = Object.getOwnPropertyDescriptor(
1603
- u,
1604
- "value"
1605
- ).set;
1606
- if (s !== t && S) {
1607
- const h = new Event("change", { bubbles: !0 });
1608
- S.call(c, t), c.dispatchEvent(h);
1609
- }
1610
- }, [s, t]), /* @__PURE__ */ v(
1611
- A.select,
1612
- {
1613
- ...n,
1614
- style: { ...Sn, ...n.style },
1615
- ref: i,
1616
- defaultValue: t
1617
- }
1618
- );
1619
- }
1620
- );
1621
- Qt.displayName = eo;
1622
- function Jt(e) {
1623
- return e === "" || e === void 0;
1624
- }
1625
- function en(e) {
1626
- const t = We(e), n = a.useRef(""), r = a.useRef(0), o = a.useCallback(
1627
- (s) => {
1628
- const c = n.current + s;
1629
- t(c), (function u(d) {
1630
- n.current = d, window.clearTimeout(r.current), d !== "" && (r.current = window.setTimeout(() => u(""), 1e3));
1631
- })(c);
1632
- },
1633
- [t]
1634
- ), i = a.useCallback(() => {
1635
- n.current = "", window.clearTimeout(r.current);
1636
- }, []);
1637
- return a.useEffect(() => () => window.clearTimeout(r.current), []), [n, o, i];
1638
- }
1639
- function tn(e, t, n) {
1640
- const o = t.length > 1 && Array.from(t).every((d) => d === t[0]) ? t[0] : t, i = n ? e.indexOf(n) : -1;
1641
- let s = to(e, Math.max(i, 0));
1642
- o.length === 1 && (s = s.filter((d) => d !== n));
1643
- const u = s.find(
1644
- (d) => d.textValue.toLowerCase().startsWith(o.toLowerCase())
1645
- );
1646
- return u !== n ? u : void 0;
1647
- }
1648
- function to(e, t) {
1649
- return e.map((n, r) => e[(t + r) % e.length]);
1650
- }
1651
- var no = Tt, nn = Pt, ro = Mt, oo = At, ao = Ot, rn = kt, co = Vt, io = Wt, on = Ut, an = $t, lo = jt, so = Gt, cn = Yt, ln = Xt, sn = qt;
1652
- const bo = no, Eo = io, xo = ro, uo = a.forwardRef(
1653
- ({ className: e, children: t, onClear: n, ...r }, o) => /* @__PURE__ */ q(
1654
- nn,
1655
- {
1656
- ref: o,
1657
- className: Q(
1658
- "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
1659
- e
1660
- ),
1661
- ...r,
1662
- children: [
1663
- t,
1664
- /* @__PURE__ */ q("div", { className: "flex items-center gap-1", children: [
1665
- n && /* @__PURE__ */ v(
1666
- "span",
1667
- {
1668
- role: "button",
1669
- tabIndex: -1,
1670
- onPointerDown: (i) => {
1671
- i.preventDefault(), i.stopPropagation(), n(i);
1672
- },
1673
- className: "text-muted-foreground hover:text-foreground",
1674
- children: /* @__PURE__ */ v(On, { className: "size-4" })
1675
- }
1676
- ),
1677
- /* @__PURE__ */ v(oo, { asChild: !0, children: /* @__PURE__ */ v(mt, { className: "size-4 opacity-50" }) })
1678
- ] })
1679
- ]
1680
- }
1681
- )
1682
- );
1683
- uo.displayName = nn.displayName;
1684
- const un = a.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ v(cn, { ref: n, className: Q("flex cursor-default items-center justify-center py-1", e), ...t, children: /* @__PURE__ */ v(Mn, { className: "size-4" }) }));
1685
- un.displayName = cn.displayName;
1686
- const dn = a.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ v(ln, { ref: n, className: Q("flex cursor-default items-center justify-center py-1", e), ...t, children: /* @__PURE__ */ v(mt, { className: "size-4" }) }));
1687
- dn.displayName = ln.displayName;
1688
- const fo = a.forwardRef(
1689
- ({ className: e, children: t, position: n = "popper", ...r }, o) => /* @__PURE__ */ v(ao, { children: /* @__PURE__ */ q(
1690
- rn,
1691
- {
1692
- ref: o,
1693
- className: Q(
1694
- "relative z-[100] max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1695
- n === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
1696
- e
1697
- ),
1698
- position: n,
1699
- ...r,
1700
- children: [
1701
- /* @__PURE__ */ v(un, {}),
1702
- /* @__PURE__ */ v(
1703
- co,
1704
- {
1705
- className: Q("p-1", n === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),
1706
- children: t
1707
- }
1708
- ),
1709
- /* @__PURE__ */ v(dn, {})
1710
- ]
1711
- }
1712
- ) })
1713
- );
1714
- fo.displayName = rn.displayName;
1715
- const po = a.forwardRef(
1716
- ({ className: e, ...t }, n) => /* @__PURE__ */ v(on, { ref: n, className: Q("py-1.5 pl-8 pr-2 text-sm font-semibold", e), ...t })
1717
- );
1718
- po.displayName = on.displayName;
1719
- const mo = a.forwardRef(
1720
- ({ className: e, children: t, ...n }, r) => /* @__PURE__ */ q(
1721
- an,
1722
- {
1723
- ref: r,
1724
- className: Q(
1725
- "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1726
- e
1727
- ),
1728
- ...n,
1729
- children: [
1730
- /* @__PURE__ */ v("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ v(so, { children: /* @__PURE__ */ v(Pn, { className: "size-4" }) }) }),
1731
- /* @__PURE__ */ v(lo, { children: t })
1732
- ]
1733
- }
1734
- )
1735
- );
1736
- mo.displayName = an.displayName;
1737
- const vo = a.forwardRef(
1738
- ({ className: e, ...t }, n) => /* @__PURE__ */ v(sn, { ref: n, className: Q("-mx-1 my-1 h-px bg-muted", e), ...t })
1739
- );
1740
- vo.displayName = sn.displayName;
1741
- export {
1742
- Pn as C,
1743
- vt as F,
1744
- gt as P,
1745
- Rt as R,
1746
- bo as S,
1747
- On as X,
1748
- fo as a,
1749
- Eo as b,
1750
- mo as c,
1751
- po as d,
1752
- dn as e,
1753
- un as f,
1754
- vo as g,
1755
- uo as h,
1756
- xo as i,
1757
- Rn as j,
1758
- Ir as k,
1759
- Un as l,
1760
- Pr as m,
1761
- st as n,
1762
- Tn as u
1763
- };