lizaui 6.0.3 → 6.0.5

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 (38) hide show
  1. package/dist/chunks/chevron-down-BJdjIpSS.js +2 -0
  2. package/dist/chunks/chevron-down-BJdjIpSS.js.map +1 -0
  3. package/dist/chunks/chevron-down-BarFwo2L.js +75 -0
  4. package/dist/chunks/chevron-down-BarFwo2L.js.map +1 -0
  5. package/dist/chunks/search-BUtVV_ij.js +2 -0
  6. package/dist/chunks/search-BUtVV_ij.js.map +1 -0
  7. package/dist/chunks/search-YTvzxtJf.js +9 -0
  8. package/dist/chunks/search-YTvzxtJf.js.map +1 -0
  9. package/dist/chunks/select-BBV4-uzN.js +2 -0
  10. package/dist/chunks/select-BBV4-uzN.js.map +1 -0
  11. package/dist/chunks/select-KroYdQPb.js +1251 -0
  12. package/dist/chunks/select-KroYdQPb.js.map +1 -0
  13. package/dist/components/phone-input/index.d.ts +2 -0
  14. package/dist/components/phone-input/index.d.ts.map +1 -0
  15. package/dist/components/phone-input/phone-input.d.ts +28 -0
  16. package/dist/components/phone-input/phone-input.d.ts.map +1 -0
  17. package/dist/components/select-input/style/select-theme.style.d.ts.map +1 -1
  18. package/dist/components/select-input/sub-component/option-item.d.ts.map +1 -1
  19. package/dist/pagination/index.cjs.js +1 -1
  20. package/dist/pagination/index.es.js +1 -1
  21. package/dist/phone-input/index.cjs.js +15 -0
  22. package/dist/phone-input/index.cjs.js.map +1 -0
  23. package/dist/phone-input/index.es.js +3402 -0
  24. package/dist/phone-input/index.es.js.map +1 -0
  25. package/dist/phone-input.d.ts +2 -0
  26. package/dist/select-input/index.cjs.js +3 -3
  27. package/dist/select-input/index.cjs.js.map +1 -1
  28. package/dist/select-input/index.es.js +320 -321
  29. package/dist/select-input/index.es.js.map +1 -1
  30. package/dist/ui/index.cjs.js +4 -4
  31. package/dist/ui/index.cjs.js.map +1 -1
  32. package/dist/ui/index.es.js +743 -745
  33. package/dist/ui/index.es.js.map +1 -1
  34. package/package.json +7 -1
  35. package/dist/chunks/select-C25qmFpo.js +0 -1321
  36. package/dist/chunks/select-C25qmFpo.js.map +0 -1
  37. package/dist/chunks/select-DW1tRhcQ.js +0 -2
  38. package/dist/chunks/select-DW1tRhcQ.js.map +0 -1
@@ -0,0 +1,1251 @@
1
+ import { j as r } from "./jsx-runtime-Cl_4eDuT.js";
2
+ import * as n from "react";
3
+ import ne from "react";
4
+ import * as je from "react-dom";
5
+ import { c as Ie, P as E, u as Y, a as Me, b as Ee, d as Re, e as bt, f as _, h as Pt, g as It, R as Rt, F as Tt, D as Nt } from "./textarea-ClUh9LtQ.js";
6
+ import { u as L, c as Se } from "./index-Do-g2tEs.js";
7
+ import { u as _t, o as Et, s as At, f as jt, b as Mt, a as Ot, h as Dt, l as Lt } from "./floating-ui.react-dom-DoFTdqmA.js";
8
+ import { q as kt } from "./floating-ui.dom-DvdgQsph.js";
9
+ import { c as Z } from "./utils-BFAOD39w.js";
10
+ import { c as Ht, C as Bt, a as Oe } from "./chevron-down-BarFwo2L.js";
11
+ function Vt(e) {
12
+ const o = e + "CollectionProvider", [t, l] = Ie(o), [a, d] = t(
13
+ o,
14
+ { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
15
+ ), s = (u) => {
16
+ const { scope: h, children: x } = u, f = ne.useRef(null), g = ne.useRef(/* @__PURE__ */ new Map()).current;
17
+ return /* @__PURE__ */ r.jsx(a, { scope: h, itemMap: g, collectionRef: f, children: x });
18
+ };
19
+ s.displayName = o;
20
+ const c = e + "CollectionSlot", i = Se(c), p = ne.forwardRef(
21
+ (u, h) => {
22
+ const { scope: x, children: f } = u, g = d(c, x), R = L(h, g.collectionRef);
23
+ return /* @__PURE__ */ r.jsx(i, { ref: R, children: f });
24
+ }
25
+ );
26
+ p.displayName = c;
27
+ const v = e + "CollectionItemSlot", S = "data-radix-collection-item", P = Se(v), y = ne.forwardRef(
28
+ (u, h) => {
29
+ const { scope: x, children: f, ...g } = u, R = ne.useRef(null), A = L(h, R), k = d(v, x);
30
+ return ne.useEffect(() => (k.itemMap.set(R, { ref: R, ...g }), () => void k.itemMap.delete(R))), /* @__PURE__ */ r.jsx(P, { [S]: "", ref: A, children: f });
31
+ }
32
+ );
33
+ y.displayName = v;
34
+ function w(u) {
35
+ const h = d(e + "CollectionConsumer", u);
36
+ return ne.useCallback(() => {
37
+ const f = h.collectionRef.current;
38
+ if (!f) return [];
39
+ const g = Array.from(f.querySelectorAll(`[${S}]`));
40
+ return Array.from(h.itemMap.values()).sort(
41
+ (k, N) => g.indexOf(k.ref.current) - g.indexOf(N.ref.current)
42
+ );
43
+ }, [h.collectionRef, h.itemMap]);
44
+ }
45
+ return [
46
+ { Provider: s, Slot: p, ItemSlot: y },
47
+ w,
48
+ l
49
+ ];
50
+ }
51
+ var zt = n.createContext(void 0);
52
+ function Wt(e) {
53
+ const o = n.useContext(zt);
54
+ return e || o || "ltr";
55
+ }
56
+ var $t = "Arrow", De = n.forwardRef((e, o) => {
57
+ const { children: t, width: l = 10, height: a = 5, ...d } = e;
58
+ return /* @__PURE__ */ r.jsx(
59
+ E.svg,
60
+ {
61
+ ...d,
62
+ ref: o,
63
+ width: l,
64
+ height: a,
65
+ viewBox: "0 0 30 10",
66
+ preserveAspectRatio: "none",
67
+ children: e.asChild ? t : /* @__PURE__ */ r.jsx("polygon", { points: "0,0 30,0 15,10" })
68
+ }
69
+ );
70
+ });
71
+ De.displayName = $t;
72
+ var Ft = De;
73
+ function Ut(e) {
74
+ const [o, t] = n.useState(void 0);
75
+ return Y(() => {
76
+ if (e) {
77
+ t({ width: e.offsetWidth, height: e.offsetHeight });
78
+ const l = new ResizeObserver((a) => {
79
+ if (!Array.isArray(a) || !a.length)
80
+ return;
81
+ const d = a[0];
82
+ let s, c;
83
+ if ("borderBoxSize" in d) {
84
+ const i = d.borderBoxSize, p = Array.isArray(i) ? i[0] : i;
85
+ s = p.inlineSize, c = p.blockSize;
86
+ } else
87
+ s = e.offsetWidth, c = e.offsetHeight;
88
+ t({ width: s, height: c });
89
+ });
90
+ return l.observe(e, { box: "border-box" }), () => l.unobserve(e);
91
+ } else
92
+ t(void 0);
93
+ }, [e]), o;
94
+ }
95
+ var Te = "Popper", [Le, ke] = Ie(Te), [Kt, He] = Le(Te), Be = (e) => {
96
+ const { __scopePopper: o, children: t } = e, [l, a] = n.useState(null);
97
+ return /* @__PURE__ */ r.jsx(Kt, { scope: o, anchor: l, onAnchorChange: a, children: t });
98
+ };
99
+ Be.displayName = Te;
100
+ var Ve = "PopperAnchor", ze = n.forwardRef(
101
+ (e, o) => {
102
+ const { __scopePopper: t, virtualRef: l, ...a } = e, d = He(Ve, t), s = n.useRef(null), c = L(o, s), i = n.useRef(null);
103
+ return n.useEffect(() => {
104
+ const p = i.current;
105
+ i.current = l?.current || s.current, p !== i.current && d.onAnchorChange(i.current);
106
+ }), l ? null : /* @__PURE__ */ r.jsx(E.div, { ...a, ref: c });
107
+ }
108
+ );
109
+ ze.displayName = Ve;
110
+ var Ne = "PopperContent", [Yt, Gt] = Le(Ne), We = n.forwardRef(
111
+ (e, o) => {
112
+ const {
113
+ __scopePopper: t,
114
+ side: l = "bottom",
115
+ sideOffset: a = 0,
116
+ align: d = "center",
117
+ alignOffset: s = 0,
118
+ arrowPadding: c = 0,
119
+ avoidCollisions: i = !0,
120
+ collisionBoundary: p = [],
121
+ collisionPadding: v = 0,
122
+ sticky: S = "partial",
123
+ hideWhenDetached: P = !1,
124
+ updatePositionStrategy: y = "optimized",
125
+ onPlaced: w,
126
+ ...u
127
+ } = e, h = He(Ne, t), [x, f] = n.useState(null), g = L(o, (m) => f(m)), [R, A] = n.useState(null), k = Ut(R), N = k?.width ?? 0, H = k?.height ?? 0, G = l + (d !== "center" ? "-" + d : ""), X = typeof v == "number" ? v : { top: 0, right: 0, bottom: 0, left: 0, ...v }, V = Array.isArray(p) ? p : [p], $ = V.length > 0, B = {
128
+ padding: X,
129
+ boundary: V.filter(qt),
130
+ // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
131
+ altBoundary: $
132
+ }, { refs: F, floatingStyles: z, placement: j, isPositioned: O, middlewareData: M } = _t({
133
+ // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
134
+ strategy: "fixed",
135
+ placement: G,
136
+ whileElementsMounted: (...m) => kt(...m, {
137
+ animationFrame: y === "always"
138
+ }),
139
+ elements: {
140
+ reference: h.anchor
141
+ },
142
+ middleware: [
143
+ Et({ mainAxis: a + H, alignmentAxis: s }),
144
+ i && At({
145
+ mainAxis: !0,
146
+ crossAxis: !1,
147
+ limiter: S === "partial" ? Lt() : void 0,
148
+ ...B
149
+ }),
150
+ i && jt({ ...B }),
151
+ Mt({
152
+ ...B,
153
+ apply: ({ elements: m, rects: I, availableWidth: D, availableHeight: C }) => {
154
+ const { width: b, height: T } = I.reference, W = m.floating.style;
155
+ W.setProperty("--radix-popper-available-width", `${D}px`), W.setProperty("--radix-popper-available-height", `${C}px`), W.setProperty("--radix-popper-anchor-width", `${b}px`), W.setProperty("--radix-popper-anchor-height", `${T}px`);
156
+ }
157
+ }),
158
+ R && Ot({ element: R, padding: c }),
159
+ Zt({ arrowWidth: N, arrowHeight: H }),
160
+ P && Dt({ strategy: "referenceHidden", ...B })
161
+ ]
162
+ }), [U, le] = Ue(j), ee = Me(w);
163
+ Y(() => {
164
+ O && ee?.();
165
+ }, [O, ee]);
166
+ const ce = M.arrow?.x, de = M.arrow?.y, q = M.arrow?.centerOffset !== 0, [ae, te] = n.useState();
167
+ return Y(() => {
168
+ x && te(window.getComputedStyle(x).zIndex);
169
+ }, [x]), /* @__PURE__ */ r.jsx(
170
+ "div",
171
+ {
172
+ ref: F.setFloating,
173
+ "data-radix-popper-content-wrapper": "",
174
+ style: {
175
+ ...z,
176
+ transform: O ? z.transform : "translate(0, -200%)",
177
+ // keep off the page when measuring
178
+ minWidth: "max-content",
179
+ zIndex: ae,
180
+ "--radix-popper-transform-origin": [
181
+ M.transformOrigin?.x,
182
+ M.transformOrigin?.y
183
+ ].join(" "),
184
+ // hide the content if using the hide middleware and should be hidden
185
+ // set visibility to hidden and disable pointer events so the UI behaves
186
+ // as if the PopperContent isn't there at all
187
+ ...M.hide?.referenceHidden && {
188
+ visibility: "hidden",
189
+ pointerEvents: "none"
190
+ }
191
+ },
192
+ dir: e.dir,
193
+ children: /* @__PURE__ */ r.jsx(
194
+ Yt,
195
+ {
196
+ scope: t,
197
+ placedSide: U,
198
+ onArrowChange: A,
199
+ arrowX: ce,
200
+ arrowY: de,
201
+ shouldHideArrow: q,
202
+ children: /* @__PURE__ */ r.jsx(
203
+ E.div,
204
+ {
205
+ "data-side": U,
206
+ "data-align": le,
207
+ ...u,
208
+ ref: g,
209
+ style: {
210
+ ...u.style,
211
+ // if the PopperContent hasn't been placed yet (not all measurements done)
212
+ // we prevent animations so that users's animation don't kick in too early referring wrong sides
213
+ animation: O ? void 0 : "none"
214
+ }
215
+ }
216
+ )
217
+ }
218
+ )
219
+ }
220
+ );
221
+ }
222
+ );
223
+ We.displayName = Ne;
224
+ var $e = "PopperArrow", Xt = {
225
+ top: "bottom",
226
+ right: "left",
227
+ bottom: "top",
228
+ left: "right"
229
+ }, Fe = n.forwardRef(function(o, t) {
230
+ const { __scopePopper: l, ...a } = o, d = Gt($e, l), s = Xt[d.placedSide];
231
+ return (
232
+ // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
233
+ // doesn't report size as we'd expect on SVG elements.
234
+ // it reports their bounding box which is effectively the largest path inside the SVG.
235
+ /* @__PURE__ */ r.jsx(
236
+ "span",
237
+ {
238
+ ref: d.onArrowChange,
239
+ style: {
240
+ position: "absolute",
241
+ left: d.arrowX,
242
+ top: d.arrowY,
243
+ [s]: 0,
244
+ transformOrigin: {
245
+ top: "",
246
+ right: "0 0",
247
+ bottom: "center 0",
248
+ left: "100% 0"
249
+ }[d.placedSide],
250
+ transform: {
251
+ top: "translateY(100%)",
252
+ right: "translateY(50%) rotate(90deg) translateX(-50%)",
253
+ bottom: "rotate(180deg)",
254
+ left: "translateY(50%) rotate(-90deg) translateX(50%)"
255
+ }[d.placedSide],
256
+ visibility: d.shouldHideArrow ? "hidden" : void 0
257
+ },
258
+ children: /* @__PURE__ */ r.jsx(
259
+ Ft,
260
+ {
261
+ ...a,
262
+ ref: t,
263
+ style: {
264
+ ...a.style,
265
+ // ensures the element can be measured correctly (mostly for if SVG)
266
+ display: "block"
267
+ }
268
+ }
269
+ )
270
+ }
271
+ )
272
+ );
273
+ });
274
+ Fe.displayName = $e;
275
+ function qt(e) {
276
+ return e !== null;
277
+ }
278
+ var Zt = (e) => ({
279
+ name: "transformOrigin",
280
+ options: e,
281
+ fn(o) {
282
+ const { placement: t, rects: l, middlewareData: a } = o, s = a.arrow?.centerOffset !== 0, c = s ? 0 : e.arrowWidth, i = s ? 0 : e.arrowHeight, [p, v] = Ue(t), S = { start: "0%", center: "50%", end: "100%" }[v], P = (a.arrow?.x ?? 0) + c / 2, y = (a.arrow?.y ?? 0) + i / 2;
283
+ let w = "", u = "";
284
+ return p === "bottom" ? (w = s ? S : `${P}px`, u = `${-i}px`) : p === "top" ? (w = s ? S : `${P}px`, u = `${l.floating.height + i}px`) : p === "right" ? (w = `${-i}px`, u = s ? S : `${y}px`) : p === "left" && (w = `${l.floating.width + i}px`, u = s ? S : `${y}px`), { data: { x: w, y: u } };
285
+ }
286
+ });
287
+ function Ue(e) {
288
+ const [o, t = "center"] = e.split("-");
289
+ return [o, t];
290
+ }
291
+ var Jt = Be, Qt = ze, eo = We, to = Fe;
292
+ const oo = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]], no = Ht("chevron-up", oo);
293
+ function ro(e) {
294
+ const o = n.useRef({ value: e, previous: e });
295
+ return n.useMemo(() => (o.current.value !== e && (o.current.previous = o.current.value, o.current.value = e), o.current.previous), [e]);
296
+ }
297
+ var Ke = Object.freeze({
298
+ // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
299
+ position: "absolute",
300
+ border: 0,
301
+ width: 1,
302
+ height: 1,
303
+ padding: 0,
304
+ margin: -1,
305
+ overflow: "hidden",
306
+ clip: "rect(0, 0, 0, 0)",
307
+ whiteSpace: "nowrap",
308
+ wordWrap: "normal"
309
+ }), so = "VisuallyHidden", Ye = n.forwardRef(
310
+ (e, o) => /* @__PURE__ */ r.jsx(
311
+ E.span,
312
+ {
313
+ ...e,
314
+ ref: o,
315
+ style: { ...Ke, ...e.style }
316
+ }
317
+ )
318
+ );
319
+ Ye.displayName = so;
320
+ var Jo = Ye;
321
+ function Ae(e, [o, t]) {
322
+ return Math.min(t, Math.max(o, e));
323
+ }
324
+ var ao = [" ", "Enter", "ArrowUp", "ArrowDown"], io = [" ", "Enter"], re = "Select", [fe, me, lo] = Vt(re), [ie, Qo] = Ie(re, [
325
+ lo,
326
+ ke
327
+ ]), he = ke(), [co, J] = ie(re), [uo, po] = ie(re), Ge = (e) => {
328
+ const {
329
+ __scopeSelect: o,
330
+ children: t,
331
+ open: l,
332
+ defaultOpen: a,
333
+ onOpenChange: d,
334
+ value: s,
335
+ defaultValue: c,
336
+ onValueChange: i,
337
+ dir: p,
338
+ name: v,
339
+ autoComplete: S,
340
+ disabled: P,
341
+ required: y,
342
+ form: w
343
+ } = e, u = he(o), [h, x] = n.useState(null), [f, g] = n.useState(null), [R, A] = n.useState(!1), k = Wt(p), [N, H] = Ee({
344
+ prop: l,
345
+ defaultProp: a ?? !1,
346
+ onChange: d,
347
+ caller: re
348
+ }), [G, X] = Ee({
349
+ prop: s,
350
+ defaultProp: c,
351
+ onChange: i,
352
+ caller: re
353
+ }), V = n.useRef(null), $ = h ? w || !!h.closest("form") : !0, [B, F] = n.useState(/* @__PURE__ */ new Set()), z = Array.from(B).map((j) => j.props.value).join(";");
354
+ return /* @__PURE__ */ r.jsx(Jt, { ...u, children: /* @__PURE__ */ r.jsxs(
355
+ co,
356
+ {
357
+ required: y,
358
+ scope: o,
359
+ trigger: h,
360
+ onTriggerChange: x,
361
+ valueNode: f,
362
+ onValueNodeChange: g,
363
+ valueNodeHasChildren: R,
364
+ onValueNodeHasChildrenChange: A,
365
+ contentId: Re(),
366
+ value: G,
367
+ onValueChange: X,
368
+ open: N,
369
+ onOpenChange: H,
370
+ dir: k,
371
+ triggerPointerDownPosRef: V,
372
+ disabled: P,
373
+ children: [
374
+ /* @__PURE__ */ r.jsx(fe.Provider, { scope: o, children: /* @__PURE__ */ r.jsx(
375
+ uo,
376
+ {
377
+ scope: e.__scopeSelect,
378
+ onNativeOptionAdd: n.useCallback((j) => {
379
+ F((O) => new Set(O).add(j));
380
+ }, []),
381
+ onNativeOptionRemove: n.useCallback((j) => {
382
+ F((O) => {
383
+ const M = new Set(O);
384
+ return M.delete(j), M;
385
+ });
386
+ }, []),
387
+ children: t
388
+ }
389
+ ) }),
390
+ $ ? /* @__PURE__ */ r.jsxs(
391
+ St,
392
+ {
393
+ "aria-hidden": !0,
394
+ required: y,
395
+ tabIndex: -1,
396
+ name: v,
397
+ autoComplete: S,
398
+ value: G,
399
+ onChange: (j) => X(j.target.value),
400
+ disabled: P,
401
+ form: w,
402
+ children: [
403
+ G === void 0 ? /* @__PURE__ */ r.jsx("option", { value: "" }) : null,
404
+ Array.from(B)
405
+ ]
406
+ },
407
+ z
408
+ ) : null
409
+ ]
410
+ }
411
+ ) });
412
+ };
413
+ Ge.displayName = re;
414
+ var Xe = "SelectTrigger", qe = n.forwardRef(
415
+ (e, o) => {
416
+ const { __scopeSelect: t, disabled: l = !1, ...a } = e, d = he(t), s = J(Xe, t), c = s.disabled || l, i = L(o, s.onTriggerChange), p = me(t), v = n.useRef("touch"), [S, P, y] = yt((u) => {
417
+ const h = p().filter((g) => !g.disabled), x = h.find((g) => g.value === s.value), f = Ct(h, u, x);
418
+ f !== void 0 && s.onValueChange(f.value);
419
+ }), w = (u) => {
420
+ c || (s.onOpenChange(!0), y()), u && (s.triggerPointerDownPosRef.current = {
421
+ x: Math.round(u.pageX),
422
+ y: Math.round(u.pageY)
423
+ });
424
+ };
425
+ return /* @__PURE__ */ r.jsx(Qt, { asChild: !0, ...d, children: /* @__PURE__ */ r.jsx(
426
+ E.button,
427
+ {
428
+ type: "button",
429
+ role: "combobox",
430
+ "aria-controls": s.contentId,
431
+ "aria-expanded": s.open,
432
+ "aria-required": s.required,
433
+ "aria-autocomplete": "none",
434
+ dir: s.dir,
435
+ "data-state": s.open ? "open" : "closed",
436
+ disabled: c,
437
+ "data-disabled": c ? "" : void 0,
438
+ "data-placeholder": wt(s.value) ? "" : void 0,
439
+ ...a,
440
+ ref: i,
441
+ onClick: _(a.onClick, (u) => {
442
+ u.currentTarget.focus(), v.current !== "mouse" && w(u);
443
+ }),
444
+ onPointerDown: _(a.onPointerDown, (u) => {
445
+ v.current = u.pointerType;
446
+ const h = u.target;
447
+ h.hasPointerCapture(u.pointerId) && h.releasePointerCapture(u.pointerId), u.button === 0 && u.ctrlKey === !1 && u.pointerType === "mouse" && (w(u), u.preventDefault());
448
+ }),
449
+ onKeyDown: _(a.onKeyDown, (u) => {
450
+ const h = S.current !== "";
451
+ !(u.ctrlKey || u.altKey || u.metaKey) && u.key.length === 1 && P(u.key), !(h && u.key === " ") && ao.includes(u.key) && (w(), u.preventDefault());
452
+ })
453
+ }
454
+ ) });
455
+ }
456
+ );
457
+ qe.displayName = Xe;
458
+ var Ze = "SelectValue", Je = n.forwardRef(
459
+ (e, o) => {
460
+ const { __scopeSelect: t, className: l, style: a, children: d, placeholder: s = "", ...c } = e, i = J(Ze, t), { onValueNodeHasChildrenChange: p } = i, v = d !== void 0, S = L(o, i.onValueNodeChange);
461
+ return Y(() => {
462
+ p(v);
463
+ }, [p, v]), /* @__PURE__ */ r.jsx(
464
+ E.span,
465
+ {
466
+ ...c,
467
+ ref: S,
468
+ style: { pointerEvents: "none" },
469
+ children: wt(i.value) ? /* @__PURE__ */ r.jsx(r.Fragment, { children: s }) : d
470
+ }
471
+ );
472
+ }
473
+ );
474
+ Je.displayName = Ze;
475
+ var fo = "SelectIcon", Qe = n.forwardRef(
476
+ (e, o) => {
477
+ const { __scopeSelect: t, children: l, ...a } = e;
478
+ return /* @__PURE__ */ r.jsx(E.span, { "aria-hidden": !0, ...a, ref: o, children: l || "▼" });
479
+ }
480
+ );
481
+ Qe.displayName = fo;
482
+ var mo = "SelectPortal", et = (e) => /* @__PURE__ */ r.jsx(bt, { asChild: !0, ...e });
483
+ et.displayName = mo;
484
+ var se = "SelectContent", tt = n.forwardRef(
485
+ (e, o) => {
486
+ const t = J(se, e.__scopeSelect), [l, a] = n.useState();
487
+ if (Y(() => {
488
+ a(new DocumentFragment());
489
+ }, []), !t.open) {
490
+ const d = l;
491
+ return d ? je.createPortal(
492
+ /* @__PURE__ */ r.jsx(ot, { scope: e.__scopeSelect, children: /* @__PURE__ */ r.jsx(fe.Slot, { scope: e.__scopeSelect, children: /* @__PURE__ */ r.jsx("div", { children: e.children }) }) }),
493
+ d
494
+ ) : null;
495
+ }
496
+ return /* @__PURE__ */ r.jsx(nt, { ...e, ref: o });
497
+ }
498
+ );
499
+ tt.displayName = se;
500
+ var K = 10, [ot, Q] = ie(se), ho = "SelectContentImpl", go = Se("SelectContent.RemoveScroll"), nt = n.forwardRef(
501
+ (e, o) => {
502
+ const {
503
+ __scopeSelect: t,
504
+ position: l = "item-aligned",
505
+ onCloseAutoFocus: a,
506
+ onEscapeKeyDown: d,
507
+ onPointerDownOutside: s,
508
+ //
509
+ // PopperContent props
510
+ side: c,
511
+ sideOffset: i,
512
+ align: p,
513
+ alignOffset: v,
514
+ arrowPadding: S,
515
+ collisionBoundary: P,
516
+ collisionPadding: y,
517
+ sticky: w,
518
+ hideWhenDetached: u,
519
+ avoidCollisions: h,
520
+ //
521
+ ...x
522
+ } = e, f = J(se, t), [g, R] = n.useState(null), [A, k] = n.useState(null), N = L(o, (m) => R(m)), [H, G] = n.useState(null), [X, V] = n.useState(
523
+ null
524
+ ), $ = me(t), [B, F] = n.useState(!1), z = n.useRef(!1);
525
+ n.useEffect(() => {
526
+ if (g) return Pt(g);
527
+ }, [g]), It();
528
+ const j = n.useCallback(
529
+ (m) => {
530
+ const [I, ...D] = $().map((T) => T.ref.current), [C] = D.slice(-1), b = document.activeElement;
531
+ for (const T of m)
532
+ if (T === b || (T?.scrollIntoView({ block: "nearest" }), T === I && A && (A.scrollTop = 0), T === C && A && (A.scrollTop = A.scrollHeight), T?.focus(), document.activeElement !== b)) return;
533
+ },
534
+ [$, A]
535
+ ), O = n.useCallback(
536
+ () => j([H, g]),
537
+ [j, H, g]
538
+ );
539
+ n.useEffect(() => {
540
+ B && O();
541
+ }, [B, O]);
542
+ const { onOpenChange: M, triggerPointerDownPosRef: U } = f;
543
+ n.useEffect(() => {
544
+ if (g) {
545
+ let m = { x: 0, y: 0 };
546
+ const I = (C) => {
547
+ m = {
548
+ x: Math.abs(Math.round(C.pageX) - (U.current?.x ?? 0)),
549
+ y: Math.abs(Math.round(C.pageY) - (U.current?.y ?? 0))
550
+ };
551
+ }, D = (C) => {
552
+ m.x <= 10 && m.y <= 10 ? C.preventDefault() : g.contains(C.target) || M(!1), document.removeEventListener("pointermove", I), U.current = null;
553
+ };
554
+ return U.current !== null && (document.addEventListener("pointermove", I), document.addEventListener("pointerup", D, { capture: !0, once: !0 })), () => {
555
+ document.removeEventListener("pointermove", I), document.removeEventListener("pointerup", D, { capture: !0 });
556
+ };
557
+ }
558
+ }, [g, M, U]), n.useEffect(() => {
559
+ const m = () => M(!1);
560
+ return window.addEventListener("blur", m), window.addEventListener("resize", m), () => {
561
+ window.removeEventListener("blur", m), window.removeEventListener("resize", m);
562
+ };
563
+ }, [M]);
564
+ const [le, ee] = yt((m) => {
565
+ const I = $().filter((b) => !b.disabled), D = I.find((b) => b.ref.current === document.activeElement), C = Ct(I, m, D);
566
+ C && setTimeout(() => C.ref.current.focus());
567
+ }), ce = n.useCallback(
568
+ (m, I, D) => {
569
+ const C = !z.current && !D;
570
+ (f.value !== void 0 && f.value === I || C) && (G(m), C && (z.current = !0));
571
+ },
572
+ [f.value]
573
+ ), de = n.useCallback(() => g?.focus(), [g]), q = n.useCallback(
574
+ (m, I, D) => {
575
+ const C = !z.current && !D;
576
+ (f.value !== void 0 && f.value === I || C) && V(m);
577
+ },
578
+ [f.value]
579
+ ), ae = l === "popper" ? we : rt, te = ae === we ? {
580
+ side: c,
581
+ sideOffset: i,
582
+ align: p,
583
+ alignOffset: v,
584
+ arrowPadding: S,
585
+ collisionBoundary: P,
586
+ collisionPadding: y,
587
+ sticky: w,
588
+ hideWhenDetached: u,
589
+ avoidCollisions: h
590
+ } : {};
591
+ return /* @__PURE__ */ r.jsx(
592
+ ot,
593
+ {
594
+ scope: t,
595
+ content: g,
596
+ viewport: A,
597
+ onViewportChange: k,
598
+ itemRefCallback: ce,
599
+ selectedItem: H,
600
+ onItemLeave: de,
601
+ itemTextRefCallback: q,
602
+ focusSelectedItem: O,
603
+ selectedItemText: X,
604
+ position: l,
605
+ isPositioned: B,
606
+ searchRef: le,
607
+ children: /* @__PURE__ */ r.jsx(Rt, { as: go, allowPinchZoom: !0, children: /* @__PURE__ */ r.jsx(
608
+ Tt,
609
+ {
610
+ asChild: !0,
611
+ trapped: f.open,
612
+ onMountAutoFocus: (m) => {
613
+ m.preventDefault();
614
+ },
615
+ onUnmountAutoFocus: _(a, (m) => {
616
+ f.trigger?.focus({ preventScroll: !0 }), m.preventDefault();
617
+ }),
618
+ children: /* @__PURE__ */ r.jsx(
619
+ Nt,
620
+ {
621
+ asChild: !0,
622
+ disableOutsidePointerEvents: !0,
623
+ onEscapeKeyDown: d,
624
+ onPointerDownOutside: s,
625
+ onFocusOutside: (m) => m.preventDefault(),
626
+ onDismiss: () => f.onOpenChange(!1),
627
+ children: /* @__PURE__ */ r.jsx(
628
+ ae,
629
+ {
630
+ role: "listbox",
631
+ id: f.contentId,
632
+ "data-state": f.open ? "open" : "closed",
633
+ dir: f.dir,
634
+ onContextMenu: (m) => m.preventDefault(),
635
+ ...x,
636
+ ...te,
637
+ onPlaced: () => F(!0),
638
+ ref: N,
639
+ style: {
640
+ // flex layout so we can place the scroll buttons properly
641
+ display: "flex",
642
+ flexDirection: "column",
643
+ // reset the outline by default as the content MAY get focused
644
+ outline: "none",
645
+ ...x.style
646
+ },
647
+ onKeyDown: _(x.onKeyDown, (m) => {
648
+ const I = m.ctrlKey || m.altKey || m.metaKey;
649
+ if (m.key === "Tab" && m.preventDefault(), !I && m.key.length === 1 && ee(m.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(m.key)) {
650
+ let C = $().filter((b) => !b.disabled).map((b) => b.ref.current);
651
+ if (["ArrowUp", "End"].includes(m.key) && (C = C.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(m.key)) {
652
+ const b = m.target, T = C.indexOf(b);
653
+ C = C.slice(T + 1);
654
+ }
655
+ setTimeout(() => j(C)), m.preventDefault();
656
+ }
657
+ })
658
+ }
659
+ )
660
+ }
661
+ )
662
+ }
663
+ ) })
664
+ }
665
+ );
666
+ }
667
+ );
668
+ nt.displayName = ho;
669
+ var vo = "SelectItemAlignedPosition", rt = n.forwardRef((e, o) => {
670
+ const { __scopeSelect: t, onPlaced: l, ...a } = e, d = J(se, t), s = Q(se, t), [c, i] = n.useState(null), [p, v] = n.useState(null), S = L(o, (N) => v(N)), P = me(t), y = n.useRef(!1), w = n.useRef(!0), { viewport: u, selectedItem: h, selectedItemText: x, focusSelectedItem: f } = s, g = n.useCallback(() => {
671
+ if (d.trigger && d.valueNode && c && p && u && h && x) {
672
+ const N = d.trigger.getBoundingClientRect(), H = p.getBoundingClientRect(), G = d.valueNode.getBoundingClientRect(), X = x.getBoundingClientRect();
673
+ if (d.dir !== "rtl") {
674
+ const b = X.left - H.left, T = G.left - b, W = N.left - T, oe = N.width + W, ge = Math.max(oe, H.width), ve = window.innerWidth - K, xe = Ae(T, [
675
+ K,
676
+ // Prevents the content from going off the starting edge of the
677
+ // viewport. It may still go off the ending edge, but this can be
678
+ // controlled by the user since they may want to manage overflow in a
679
+ // specific way.
680
+ // https://github.com/radix-ui/primitives/issues/2049
681
+ Math.max(K, ve - ge)
682
+ ]);
683
+ c.style.minWidth = oe + "px", c.style.left = xe + "px";
684
+ } else {
685
+ const b = H.right - X.right, T = window.innerWidth - G.right - b, W = window.innerWidth - N.right - T, oe = N.width + W, ge = Math.max(oe, H.width), ve = window.innerWidth - K, xe = Ae(T, [
686
+ K,
687
+ Math.max(K, ve - ge)
688
+ ]);
689
+ c.style.minWidth = oe + "px", c.style.right = xe + "px";
690
+ }
691
+ const V = P(), $ = window.innerHeight - K * 2, B = u.scrollHeight, F = window.getComputedStyle(p), z = parseInt(F.borderTopWidth, 10), j = parseInt(F.paddingTop, 10), O = parseInt(F.borderBottomWidth, 10), M = parseInt(F.paddingBottom, 10), U = z + j + B + M + O, le = Math.min(h.offsetHeight * 5, U), ee = window.getComputedStyle(u), ce = parseInt(ee.paddingTop, 10), de = parseInt(ee.paddingBottom, 10), q = N.top + N.height / 2 - K, ae = $ - q, te = h.offsetHeight / 2, m = h.offsetTop + te, I = z + j + m, D = U - I;
692
+ if (I <= q) {
693
+ const b = V.length > 0 && h === V[V.length - 1].ref.current;
694
+ c.style.bottom = "0px";
695
+ const T = p.clientHeight - u.offsetTop - u.offsetHeight, W = Math.max(
696
+ ae,
697
+ te + // viewport might have padding bottom, include it to avoid a scrollable viewport
698
+ (b ? de : 0) + T + O
699
+ ), oe = I + W;
700
+ c.style.height = oe + "px";
701
+ } else {
702
+ const b = V.length > 0 && h === V[0].ref.current;
703
+ c.style.top = "0px";
704
+ const W = Math.max(
705
+ q,
706
+ z + u.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
707
+ (b ? ce : 0) + te
708
+ ) + D;
709
+ c.style.height = W + "px", u.scrollTop = I - q + u.offsetTop;
710
+ }
711
+ c.style.margin = `${K}px 0`, c.style.minHeight = le + "px", c.style.maxHeight = $ + "px", l?.(), requestAnimationFrame(() => y.current = !0);
712
+ }
713
+ }, [
714
+ P,
715
+ d.trigger,
716
+ d.valueNode,
717
+ c,
718
+ p,
719
+ u,
720
+ h,
721
+ x,
722
+ d.dir,
723
+ l
724
+ ]);
725
+ Y(() => g(), [g]);
726
+ const [R, A] = n.useState();
727
+ Y(() => {
728
+ p && A(window.getComputedStyle(p).zIndex);
729
+ }, [p]);
730
+ const k = n.useCallback(
731
+ (N) => {
732
+ N && w.current === !0 && (g(), f?.(), w.current = !1);
733
+ },
734
+ [g, f]
735
+ );
736
+ return /* @__PURE__ */ r.jsx(
737
+ So,
738
+ {
739
+ scope: t,
740
+ contentWrapper: c,
741
+ shouldExpandOnScrollRef: y,
742
+ onScrollButtonChange: k,
743
+ children: /* @__PURE__ */ r.jsx(
744
+ "div",
745
+ {
746
+ ref: i,
747
+ style: {
748
+ display: "flex",
749
+ flexDirection: "column",
750
+ position: "fixed",
751
+ zIndex: R
752
+ },
753
+ children: /* @__PURE__ */ r.jsx(
754
+ E.div,
755
+ {
756
+ ...a,
757
+ ref: S,
758
+ style: {
759
+ // When we get the height of the content, it includes borders. If we were to set
760
+ // the height without having `boxSizing: 'border-box'` it would be too big.
761
+ boxSizing: "border-box",
762
+ // We need to ensure the content doesn't get taller than the wrapper
763
+ maxHeight: "100%",
764
+ ...a.style
765
+ }
766
+ }
767
+ )
768
+ }
769
+ )
770
+ }
771
+ );
772
+ });
773
+ rt.displayName = vo;
774
+ var xo = "SelectPopperPosition", we = n.forwardRef((e, o) => {
775
+ const {
776
+ __scopeSelect: t,
777
+ align: l = "start",
778
+ collisionPadding: a = K,
779
+ ...d
780
+ } = e, s = he(t);
781
+ return /* @__PURE__ */ r.jsx(
782
+ eo,
783
+ {
784
+ ...s,
785
+ ...d,
786
+ ref: o,
787
+ align: l,
788
+ collisionPadding: a,
789
+ style: {
790
+ // Ensure border-box for floating-ui calculations
791
+ boxSizing: "border-box",
792
+ ...d.style,
793
+ "--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
794
+ "--radix-select-content-available-width": "var(--radix-popper-available-width)",
795
+ "--radix-select-content-available-height": "var(--radix-popper-available-height)",
796
+ "--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
797
+ "--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
798
+ }
799
+ }
800
+ );
801
+ });
802
+ we.displayName = xo;
803
+ var [So, _e] = ie(se, {}), ye = "SelectViewport", st = n.forwardRef(
804
+ (e, o) => {
805
+ const { __scopeSelect: t, nonce: l, ...a } = e, d = Q(ye, t), s = _e(ye, t), c = L(o, d.onViewportChange), i = n.useRef(0);
806
+ return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
807
+ /* @__PURE__ */ r.jsx(
808
+ "style",
809
+ {
810
+ dangerouslySetInnerHTML: {
811
+ __html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
812
+ },
813
+ nonce: l
814
+ }
815
+ ),
816
+ /* @__PURE__ */ r.jsx(fe.Slot, { scope: t, children: /* @__PURE__ */ r.jsx(
817
+ E.div,
818
+ {
819
+ "data-radix-select-viewport": "",
820
+ role: "presentation",
821
+ ...a,
822
+ ref: c,
823
+ style: {
824
+ // we use position: 'relative' here on the `viewport` so that when we call
825
+ // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
826
+ // (independent of the scrollUpButton).
827
+ position: "relative",
828
+ flex: 1,
829
+ // Viewport should only be scrollable in the vertical direction.
830
+ // This won't work in vertical writing modes, so we'll need to
831
+ // revisit this if/when that is supported
832
+ // https://developer.chrome.com/blog/vertical-form-controls
833
+ overflow: "hidden auto",
834
+ ...a.style
835
+ },
836
+ onScroll: _(a.onScroll, (p) => {
837
+ const v = p.currentTarget, { contentWrapper: S, shouldExpandOnScrollRef: P } = s;
838
+ if (P?.current && S) {
839
+ const y = Math.abs(i.current - v.scrollTop);
840
+ if (y > 0) {
841
+ const w = window.innerHeight - K * 2, u = parseFloat(S.style.minHeight), h = parseFloat(S.style.height), x = Math.max(u, h);
842
+ if (x < w) {
843
+ const f = x + y, g = Math.min(w, f), R = f - g;
844
+ S.style.height = g + "px", S.style.bottom === "0px" && (v.scrollTop = R > 0 ? R : 0, S.style.justifyContent = "flex-end");
845
+ }
846
+ }
847
+ }
848
+ i.current = v.scrollTop;
849
+ })
850
+ }
851
+ ) })
852
+ ] });
853
+ }
854
+ );
855
+ st.displayName = ye;
856
+ var at = "SelectGroup", [wo, yo] = ie(at), it = n.forwardRef(
857
+ (e, o) => {
858
+ const { __scopeSelect: t, ...l } = e, a = Re();
859
+ return /* @__PURE__ */ r.jsx(wo, { scope: t, id: a, children: /* @__PURE__ */ r.jsx(E.div, { role: "group", "aria-labelledby": a, ...l, ref: o }) });
860
+ }
861
+ );
862
+ it.displayName = at;
863
+ var lt = "SelectLabel", ct = n.forwardRef(
864
+ (e, o) => {
865
+ const { __scopeSelect: t, ...l } = e, a = yo(lt, t);
866
+ return /* @__PURE__ */ r.jsx(E.div, { id: a.id, ...l, ref: o });
867
+ }
868
+ );
869
+ ct.displayName = lt;
870
+ var pe = "SelectItem", [Co, dt] = ie(pe), ut = n.forwardRef(
871
+ (e, o) => {
872
+ const {
873
+ __scopeSelect: t,
874
+ value: l,
875
+ disabled: a = !1,
876
+ textValue: d,
877
+ ...s
878
+ } = e, c = J(pe, t), i = Q(pe, t), p = c.value === l, [v, S] = n.useState(d ?? ""), [P, y] = n.useState(!1), w = L(
879
+ o,
880
+ (f) => i.itemRefCallback?.(f, l, a)
881
+ ), u = Re(), h = n.useRef("touch"), x = () => {
882
+ a || (c.onValueChange(l), c.onOpenChange(!1));
883
+ };
884
+ if (l === "")
885
+ throw new Error(
886
+ "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."
887
+ );
888
+ return /* @__PURE__ */ r.jsx(
889
+ Co,
890
+ {
891
+ scope: t,
892
+ value: l,
893
+ disabled: a,
894
+ textId: u,
895
+ isSelected: p,
896
+ onItemTextChange: n.useCallback((f) => {
897
+ S((g) => g || (f?.textContent ?? "").trim());
898
+ }, []),
899
+ children: /* @__PURE__ */ r.jsx(
900
+ fe.ItemSlot,
901
+ {
902
+ scope: t,
903
+ value: l,
904
+ disabled: a,
905
+ textValue: v,
906
+ children: /* @__PURE__ */ r.jsx(
907
+ E.div,
908
+ {
909
+ role: "option",
910
+ "aria-labelledby": u,
911
+ "data-highlighted": P ? "" : void 0,
912
+ "aria-selected": p && P,
913
+ "data-state": p ? "checked" : "unchecked",
914
+ "aria-disabled": a || void 0,
915
+ "data-disabled": a ? "" : void 0,
916
+ tabIndex: a ? void 0 : -1,
917
+ ...s,
918
+ ref: w,
919
+ onFocus: _(s.onFocus, () => y(!0)),
920
+ onBlur: _(s.onBlur, () => y(!1)),
921
+ onClick: _(s.onClick, () => {
922
+ h.current !== "mouse" && x();
923
+ }),
924
+ onPointerUp: _(s.onPointerUp, () => {
925
+ h.current === "mouse" && x();
926
+ }),
927
+ onPointerDown: _(s.onPointerDown, (f) => {
928
+ h.current = f.pointerType;
929
+ }),
930
+ onPointerMove: _(s.onPointerMove, (f) => {
931
+ h.current = f.pointerType, a ? i.onItemLeave?.() : h.current === "mouse" && f.currentTarget.focus({ preventScroll: !0 });
932
+ }),
933
+ onPointerLeave: _(s.onPointerLeave, (f) => {
934
+ f.currentTarget === document.activeElement && i.onItemLeave?.();
935
+ }),
936
+ onKeyDown: _(s.onKeyDown, (f) => {
937
+ i.searchRef?.current !== "" && f.key === " " || (io.includes(f.key) && x(), f.key === " " && f.preventDefault());
938
+ })
939
+ }
940
+ )
941
+ }
942
+ )
943
+ }
944
+ );
945
+ }
946
+ );
947
+ ut.displayName = pe;
948
+ var ue = "SelectItemText", pt = n.forwardRef(
949
+ (e, o) => {
950
+ const { __scopeSelect: t, className: l, style: a, ...d } = e, s = J(ue, t), c = Q(ue, t), i = dt(ue, t), p = po(ue, t), [v, S] = n.useState(null), P = L(
951
+ o,
952
+ (x) => S(x),
953
+ i.onItemTextChange,
954
+ (x) => c.itemTextRefCallback?.(x, i.value, i.disabled)
955
+ ), y = v?.textContent, w = n.useMemo(
956
+ () => /* @__PURE__ */ r.jsx("option", { value: i.value, disabled: i.disabled, children: y }, i.value),
957
+ [i.disabled, i.value, y]
958
+ ), { onNativeOptionAdd: u, onNativeOptionRemove: h } = p;
959
+ return Y(() => (u(w), () => h(w)), [u, h, w]), /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
960
+ /* @__PURE__ */ r.jsx(E.span, { id: i.textId, ...d, ref: P }),
961
+ i.isSelected && s.valueNode && !s.valueNodeHasChildren ? je.createPortal(d.children, s.valueNode) : null
962
+ ] });
963
+ }
964
+ );
965
+ pt.displayName = ue;
966
+ var ft = "SelectItemIndicator", mt = n.forwardRef(
967
+ (e, o) => {
968
+ const { __scopeSelect: t, ...l } = e;
969
+ return dt(ft, t).isSelected ? /* @__PURE__ */ r.jsx(E.span, { "aria-hidden": !0, ...l, ref: o }) : null;
970
+ }
971
+ );
972
+ mt.displayName = ft;
973
+ var Ce = "SelectScrollUpButton", ht = n.forwardRef((e, o) => {
974
+ const t = Q(Ce, e.__scopeSelect), l = _e(Ce, e.__scopeSelect), [a, d] = n.useState(!1), s = L(o, l.onScrollButtonChange);
975
+ return Y(() => {
976
+ if (t.viewport && t.isPositioned) {
977
+ let c = function() {
978
+ const p = i.scrollTop > 0;
979
+ d(p);
980
+ };
981
+ const i = t.viewport;
982
+ return c(), i.addEventListener("scroll", c), () => i.removeEventListener("scroll", c);
983
+ }
984
+ }, [t.viewport, t.isPositioned]), a ? /* @__PURE__ */ r.jsx(
985
+ vt,
986
+ {
987
+ ...e,
988
+ ref: s,
989
+ onAutoScroll: () => {
990
+ const { viewport: c, selectedItem: i } = t;
991
+ c && i && (c.scrollTop = c.scrollTop - i.offsetHeight);
992
+ }
993
+ }
994
+ ) : null;
995
+ });
996
+ ht.displayName = Ce;
997
+ var be = "SelectScrollDownButton", gt = n.forwardRef((e, o) => {
998
+ const t = Q(be, e.__scopeSelect), l = _e(be, e.__scopeSelect), [a, d] = n.useState(!1), s = L(o, l.onScrollButtonChange);
999
+ return Y(() => {
1000
+ if (t.viewport && t.isPositioned) {
1001
+ let c = function() {
1002
+ const p = i.scrollHeight - i.clientHeight, v = Math.ceil(i.scrollTop) < p;
1003
+ d(v);
1004
+ };
1005
+ const i = t.viewport;
1006
+ return c(), i.addEventListener("scroll", c), () => i.removeEventListener("scroll", c);
1007
+ }
1008
+ }, [t.viewport, t.isPositioned]), a ? /* @__PURE__ */ r.jsx(
1009
+ vt,
1010
+ {
1011
+ ...e,
1012
+ ref: s,
1013
+ onAutoScroll: () => {
1014
+ const { viewport: c, selectedItem: i } = t;
1015
+ c && i && (c.scrollTop = c.scrollTop + i.offsetHeight);
1016
+ }
1017
+ }
1018
+ ) : null;
1019
+ });
1020
+ gt.displayName = be;
1021
+ var vt = n.forwardRef((e, o) => {
1022
+ const { __scopeSelect: t, onAutoScroll: l, ...a } = e, d = Q("SelectScrollButton", t), s = n.useRef(null), c = me(t), i = n.useCallback(() => {
1023
+ s.current !== null && (window.clearInterval(s.current), s.current = null);
1024
+ }, []);
1025
+ return n.useEffect(() => () => i(), [i]), Y(() => {
1026
+ c().find((v) => v.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
1027
+ }, [c]), /* @__PURE__ */ r.jsx(
1028
+ E.div,
1029
+ {
1030
+ "aria-hidden": !0,
1031
+ ...a,
1032
+ ref: o,
1033
+ style: { flexShrink: 0, ...a.style },
1034
+ onPointerDown: _(a.onPointerDown, () => {
1035
+ s.current === null && (s.current = window.setInterval(l, 50));
1036
+ }),
1037
+ onPointerMove: _(a.onPointerMove, () => {
1038
+ d.onItemLeave?.(), s.current === null && (s.current = window.setInterval(l, 50));
1039
+ }),
1040
+ onPointerLeave: _(a.onPointerLeave, () => {
1041
+ i();
1042
+ })
1043
+ }
1044
+ );
1045
+ }), bo = "SelectSeparator", xt = n.forwardRef(
1046
+ (e, o) => {
1047
+ const { __scopeSelect: t, ...l } = e;
1048
+ return /* @__PURE__ */ r.jsx(E.div, { "aria-hidden": !0, ...l, ref: o });
1049
+ }
1050
+ );
1051
+ xt.displayName = bo;
1052
+ var Pe = "SelectArrow", Po = n.forwardRef(
1053
+ (e, o) => {
1054
+ const { __scopeSelect: t, ...l } = e, a = he(t), d = J(Pe, t), s = Q(Pe, t);
1055
+ return d.open && s.position === "popper" ? /* @__PURE__ */ r.jsx(to, { ...a, ...l, ref: o }) : null;
1056
+ }
1057
+ );
1058
+ Po.displayName = Pe;
1059
+ var Io = "SelectBubbleInput", St = n.forwardRef(
1060
+ ({ __scopeSelect: e, value: o, ...t }, l) => {
1061
+ const a = n.useRef(null), d = L(l, a), s = ro(o);
1062
+ return n.useEffect(() => {
1063
+ const c = a.current;
1064
+ if (!c) return;
1065
+ const i = window.HTMLSelectElement.prototype, v = Object.getOwnPropertyDescriptor(
1066
+ i,
1067
+ "value"
1068
+ ).set;
1069
+ if (s !== o && v) {
1070
+ const S = new Event("change", { bubbles: !0 });
1071
+ v.call(c, o), c.dispatchEvent(S);
1072
+ }
1073
+ }, [s, o]), /* @__PURE__ */ r.jsx(
1074
+ E.select,
1075
+ {
1076
+ ...t,
1077
+ style: { ...Ke, ...t.style },
1078
+ ref: d,
1079
+ defaultValue: o
1080
+ }
1081
+ );
1082
+ }
1083
+ );
1084
+ St.displayName = Io;
1085
+ function wt(e) {
1086
+ return e === "" || e === void 0;
1087
+ }
1088
+ function yt(e) {
1089
+ const o = Me(e), t = n.useRef(""), l = n.useRef(0), a = n.useCallback(
1090
+ (s) => {
1091
+ const c = t.current + s;
1092
+ o(c), (function i(p) {
1093
+ t.current = p, window.clearTimeout(l.current), p !== "" && (l.current = window.setTimeout(() => i(""), 1e3));
1094
+ })(c);
1095
+ },
1096
+ [o]
1097
+ ), d = n.useCallback(() => {
1098
+ t.current = "", window.clearTimeout(l.current);
1099
+ }, []);
1100
+ return n.useEffect(() => () => window.clearTimeout(l.current), []), [t, a, d];
1101
+ }
1102
+ function Ct(e, o, t) {
1103
+ const a = o.length > 1 && Array.from(o).every((p) => p === o[0]) ? o[0] : o, d = t ? e.indexOf(t) : -1;
1104
+ let s = Ro(e, Math.max(d, 0));
1105
+ a.length === 1 && (s = s.filter((p) => p !== t));
1106
+ const i = s.find(
1107
+ (p) => p.textValue.toLowerCase().startsWith(a.toLowerCase())
1108
+ );
1109
+ return i !== t ? i : void 0;
1110
+ }
1111
+ function Ro(e, o) {
1112
+ return e.map((t, l) => e[(o + l) % e.length]);
1113
+ }
1114
+ var To = Ge, No = qe, _o = Je, Eo = Qe, Ao = et, jo = tt, Mo = st, Oo = it, Do = ct, Lo = ut, ko = pt, Ho = mt, Bo = ht, Vo = gt, zo = xt;
1115
+ function en({ ...e }) {
1116
+ return /* @__PURE__ */ r.jsx(To, { "data-slot": "select", ...e });
1117
+ }
1118
+ function tn({ ...e }) {
1119
+ return /* @__PURE__ */ r.jsx(Oo, { "data-slot": "select-group", ...e });
1120
+ }
1121
+ function on({ ...e }) {
1122
+ return /* @__PURE__ */ r.jsx(_o, { "data-slot": "select-value", ...e });
1123
+ }
1124
+ function nn({
1125
+ className: e,
1126
+ size: o = "default",
1127
+ children: t,
1128
+ ...l
1129
+ }) {
1130
+ return /* @__PURE__ */ r.jsxs(
1131
+ No,
1132
+ {
1133
+ "data-slot": "select-trigger",
1134
+ "data-size": o,
1135
+ className: Z(
1136
+ "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1137
+ e
1138
+ ),
1139
+ ...l,
1140
+ children: [
1141
+ t,
1142
+ /* @__PURE__ */ r.jsx(Eo, { asChild: !0, children: /* @__PURE__ */ r.jsx(Oe, { className: "size-4 opacity-50" }) })
1143
+ ]
1144
+ }
1145
+ );
1146
+ }
1147
+ function rn({ className: e, children: o, position: t = "popper", ...l }) {
1148
+ return /* @__PURE__ */ r.jsx(Ao, { children: /* @__PURE__ */ r.jsxs(
1149
+ jo,
1150
+ {
1151
+ "data-slot": "select-content",
1152
+ className: Z(
1153
+ "bg-content1 text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md shadow-medium",
1154
+ t === "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",
1155
+ e
1156
+ ),
1157
+ position: t,
1158
+ ...l,
1159
+ children: [
1160
+ /* @__PURE__ */ r.jsx(Wo, {}),
1161
+ /* @__PURE__ */ r.jsx(
1162
+ Mo,
1163
+ {
1164
+ className: Z(
1165
+ "p-1",
1166
+ t === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
1167
+ ),
1168
+ children: o
1169
+ }
1170
+ ),
1171
+ /* @__PURE__ */ r.jsx($o, {})
1172
+ ]
1173
+ }
1174
+ ) });
1175
+ }
1176
+ function sn({ className: e, ...o }) {
1177
+ return /* @__PURE__ */ r.jsx(Do, { "data-slot": "select-label", className: Z("text-muted-foreground px-2 py-1.5 text-xs", e), ...o });
1178
+ }
1179
+ function an({ className: e, children: o, ...t }) {
1180
+ return /* @__PURE__ */ r.jsxs(
1181
+ Lo,
1182
+ {
1183
+ "data-slot": "select-item",
1184
+ className: Z(
1185
+ "focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
1186
+ e
1187
+ ),
1188
+ ...t,
1189
+ children: [
1190
+ /* @__PURE__ */ r.jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ r.jsx(Ho, { children: /* @__PURE__ */ r.jsx(Bt, { className: "size-4" }) }) }),
1191
+ /* @__PURE__ */ r.jsx(ko, { children: o })
1192
+ ]
1193
+ }
1194
+ );
1195
+ }
1196
+ function ln({ className: e, ...o }) {
1197
+ return /* @__PURE__ */ r.jsx(
1198
+ zo,
1199
+ {
1200
+ "data-slot": "select-separator",
1201
+ className: Z("bg-border pointer-events-none -mx-1 my-1 h-px", e),
1202
+ ...o
1203
+ }
1204
+ );
1205
+ }
1206
+ function Wo({ className: e, ...o }) {
1207
+ return /* @__PURE__ */ r.jsx(
1208
+ Bo,
1209
+ {
1210
+ "data-slot": "select-scroll-up-button",
1211
+ className: Z("flex cursor-default items-center justify-center py-1", e),
1212
+ ...o,
1213
+ children: /* @__PURE__ */ r.jsx(no, { className: "size-4" })
1214
+ }
1215
+ );
1216
+ }
1217
+ function $o({ className: e, ...o }) {
1218
+ return /* @__PURE__ */ r.jsx(
1219
+ Vo,
1220
+ {
1221
+ "data-slot": "select-scroll-down-button",
1222
+ className: Z("flex cursor-default items-center justify-center py-1", e),
1223
+ ...o,
1224
+ children: /* @__PURE__ */ r.jsx(Oe, { className: "size-4" })
1225
+ }
1226
+ );
1227
+ }
1228
+ export {
1229
+ Qt as A,
1230
+ eo as C,
1231
+ Jt as R,
1232
+ en as S,
1233
+ nn as a,
1234
+ on as b,
1235
+ rn as c,
1236
+ tn as d,
1237
+ sn as e,
1238
+ an as f,
1239
+ Vt as g,
1240
+ ke as h,
1241
+ to as i,
1242
+ Jo as j,
1243
+ ro as k,
1244
+ Ae as l,
1245
+ Ut as m,
1246
+ $o as n,
1247
+ Wo as o,
1248
+ ln as p,
1249
+ Wt as u
1250
+ };
1251
+ //# sourceMappingURL=select-KroYdQPb.js.map