@strapi/ui-primitives 1.8.2 → 1.10.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,43 +1,43 @@
1
- import { jsx as f, jsxs as Ae, Fragment as _e } from "react/jsx-runtime";
1
+ import { jsx as p, jsxs as Me, Fragment as Oe } from "react/jsx-runtime";
2
2
  import * as l from "react";
3
3
  import { useComposedRefs as M } from "@radix-ui/react-compose-refs";
4
- import { createContextScope as ot, createContext as nt } from "@radix-ui/react-context";
5
- import { Slot as Te } from "@radix-ui/react-slot";
4
+ import { createContextScope as st, createContext as ct } from "@radix-ui/react-context";
5
+ import { Slot as Ve } from "@radix-ui/react-slot";
6
6
  import { composeEventHandlers as T } from "@radix-ui/primitive";
7
7
  import { composeEventHandlers as An } from "@radix-ui/primitive";
8
- import { DismissableLayer as rt } from "@radix-ui/react-dismissable-layer";
9
- import { useFocusGuards as lt } from "@radix-ui/react-focus-guards";
10
- import { FocusScope as st } from "@radix-ui/react-focus-scope";
8
+ import { DismissableLayer as it } from "@radix-ui/react-dismissable-layer";
9
+ import { useFocusGuards as at } from "@radix-ui/react-focus-guards";
10
+ import { FocusScope as ut } from "@radix-ui/react-focus-scope";
11
11
  import { useId as re } from "@radix-ui/react-id";
12
12
  import * as le from "@radix-ui/react-popper";
13
- import { createPopperScope as ct } from "@radix-ui/react-popper";
14
- import { Portal as it } from "@radix-ui/react-portal";
15
- import { Primitive as N } from "@radix-ui/react-primitive";
13
+ import { createPopperScope as dt } from "@radix-ui/react-popper";
14
+ import { Portal as pt } from "@radix-ui/react-portal";
15
+ import { Primitive as R } from "@radix-ui/react-primitive";
16
16
  import { useControllableState as ie } from "@radix-ui/react-use-controllable-state";
17
17
  import { useLayoutEffect as L } from "@radix-ui/react-use-layout-effect";
18
- import { hideOthers as at } from "aria-hidden";
18
+ import { hideOthers as ft } from "aria-hidden";
19
19
  import * as Ce from "react-dom";
20
- import { RemoveScroll as ut } from "react-remove-scroll";
21
- import { clamp as Qe } from "@radix-ui/number";
22
- import { createCollection as Nt } from "@radix-ui/react-collection";
23
- import { useDirection as At } from "@radix-ui/react-direction";
24
- import { usePrevious as _t } from "@radix-ui/react-use-previous";
25
- import { VisuallyHidden as Mt } from "@radix-ui/react-visually-hidden";
26
- import { useCallbackRef as Ot } from "@radix-ui/react-use-callback-ref";
20
+ import { RemoveScroll as mt } from "react-remove-scroll";
21
+ import { clamp as rt } from "@radix-ui/number";
22
+ import { createCollection as Gt } from "@radix-ui/react-collection";
23
+ import { useDirection as jt } from "@radix-ui/react-direction";
24
+ import { usePrevious as Yt } from "@radix-ui/react-use-previous";
25
+ import { VisuallyHidden as qt } from "@radix-ui/react-visually-hidden";
26
+ import { useCallbackRef as Xt } from "@radix-ui/react-use-callback-ref";
27
27
  import { useCallbackRef as Mn } from "@radix-ui/react-use-callback-ref";
28
- function Dt(r) {
29
- const c = `${r}CollectionProvider`, [e, t] = ot(c), [o, n] = e(c, {
28
+ function Zt(r) {
29
+ const c = `${r}CollectionProvider`, [e, t] = st(c), [o, n] = e(c, {
30
30
  collectionRef: { current: null },
31
31
  itemMap: /* @__PURE__ */ new Map(),
32
32
  listeners: /* @__PURE__ */ new Set()
33
33
  }), i = (d) => {
34
34
  const { scope: h, children: v } = d, C = l.useRef(null), b = l.useRef(/* @__PURE__ */ new Map()).current, g = l.useRef(/* @__PURE__ */ new Set()).current;
35
- return /* @__PURE__ */ f(o, { scope: h, itemMap: b, collectionRef: C, listeners: g, children: v });
35
+ return /* @__PURE__ */ p(o, { scope: h, itemMap: b, collectionRef: C, listeners: g, children: v });
36
36
  };
37
37
  i.displayName = c;
38
38
  const s = `${r}CollectionSlot`, a = l.forwardRef((d, h) => {
39
39
  const { scope: v, children: C } = d, b = n(s, v), g = M(h, b.collectionRef);
40
- return /* @__PURE__ */ f(Te, { ref: g, children: C });
40
+ return /* @__PURE__ */ p(Ve, { ref: g, children: C });
41
41
  });
42
42
  a.displayName = s;
43
43
  const m = `${r}CollectionItemSlot`, u = "data-radix-collection-item", x = l.forwardRef((d, h) => {
@@ -48,10 +48,10 @@ function Dt(r) {
48
48
  const A = Array.from(E.itemMap.values());
49
49
  E.itemMap.delete(g), E.listeners.forEach((_) => _(Array.from(E.itemMap.values()), A));
50
50
  };
51
- }), /* @__PURE__ */ f(Te, { [u]: "", ref: I, children: C });
51
+ }), /* @__PURE__ */ p(Ve, { [u]: "", ref: I, children: C });
52
52
  });
53
53
  x.displayName = m;
54
- function p(d) {
54
+ function f(d) {
55
55
  const h = n(`${r}CollectionConsumer`, d), v = l.useCallback(() => {
56
56
  const b = h.collectionRef.current;
57
57
  if (!b)
@@ -68,20 +68,20 @@ function Dt(r) {
68
68
  }
69
69
  return [
70
70
  { Provider: i, Slot: a, ItemSlot: x },
71
- p,
71
+ f,
72
72
  t
73
73
  ];
74
74
  }
75
- let ye = /* @__PURE__ */ new Map();
76
- function kt(r, c) {
77
- let e = r + (c ? Object.entries(c).sort((o, n) => o[0] < n[0] ? -1 : 1).join() : "");
78
- if (ye.has(e))
79
- return ye.get(e);
80
- let t = new Intl.Collator(r, c);
81
- return ye.set(e, t), t;
75
+ const Te = /* @__PURE__ */ new Map();
76
+ function Jt(r, c) {
77
+ const e = r + (c ? Object.entries(c).sort((o, n) => o[0] < n[0] ? -1 : 1).join() : "");
78
+ if (Te.has(e))
79
+ return Te.get(e);
80
+ const t = new Intl.Collator(r, c);
81
+ return Te.set(e, t), t;
82
82
  }
83
- function Me(r, c) {
84
- let e = kt(r, {
83
+ function De(r, c) {
84
+ const e = Jt(r, {
85
85
  usage: "search",
86
86
  ...c
87
87
  });
@@ -96,9 +96,10 @@ function Me(r, c) {
96
96
  if (o.length === 0)
97
97
  return !0;
98
98
  t = t.normalize("NFC"), o = o.normalize("NFC");
99
- let n = 0, i = o.length;
99
+ let n = 0;
100
+ const i = o.length;
100
101
  for (; n + i <= t.length; n++) {
101
- let s = t.slice(n, n + i);
102
+ const s = t.slice(n, n + i);
102
103
  if (e.compare(o, s) === 0)
103
104
  return !0;
104
105
  }
@@ -106,12 +107,12 @@ function Me(r, c) {
106
107
  }
107
108
  };
108
109
  }
109
- const Ft = (r) => {
110
+ const Qt = (r) => {
110
111
  const c = l.useRef();
111
112
  return l.useEffect(() => {
112
113
  c.current = r;
113
114
  }), c.current;
114
- }, Lt = [" ", "Enter", "ArrowUp", "ArrowDown"], Bt = ["Enter"], Ht = (r) => !!(r.length === 1 && r.match(/\S| /)), dt = "Combobox", [ae, me] = Dt(dt), [$t, K] = nt(dt), Ut = ({ children: r }) => /* @__PURE__ */ f(le.Root, { children: /* @__PURE__ */ f(ae.Provider, { scope: void 0, children: r }) }), Kt = (r) => {
115
+ }, eo = [" ", "Enter", "ArrowUp", "ArrowDown"], to = ["Enter"], oo = (r) => !!(r.length === 1 && r.match(/\S| /)), ht = "Combobox", [ae, me] = Zt(ht), [no, K] = ct(ht), ro = ({ children: r }) => /* @__PURE__ */ p(le.Root, { children: /* @__PURE__ */ p(ae.Provider, { scope: void 0, children: r }) }), lo = (r) => {
115
116
  const {
116
117
  allowCustomValue: c = !1,
117
118
  autocomplete: e = "none",
@@ -124,14 +125,14 @@ const Ft = (r) => {
124
125
  onValueChange: m,
125
126
  disabled: u,
126
127
  required: x = !1,
127
- locale: p = "en-EN",
128
+ locale: f = "en-EN",
128
129
  onTextValueChange: d,
129
130
  textValue: h,
130
131
  defaultTextValue: v,
131
132
  filterValue: C,
132
133
  defaultFilterValue: b,
133
134
  onFilterValueChange: g,
134
- isPrintableCharacter: I = Ht
135
+ isPrintableCharacter: I = oo
135
136
  } = r, [E, O] = l.useState(null), [A, _] = l.useState(null), [k, q] = l.useState(null), [W, B] = l.useState(null), [D = !1, H] = ie({
136
137
  prop: o,
137
138
  defaultProp: n,
@@ -149,16 +150,16 @@ const Ft = (r) => {
149
150
  defaultProp: b,
150
151
  onChange: g
151
152
  }), de = re(), se = l.useCallback(
152
- (fe, Q) => {
153
- const Z = Q.map((y) => y.ref.current), [ce, ...ee] = Z, [S] = ee.slice(-1), V = W ?? Q.find((y) => y.value === F)?.ref.current;
154
- for (const y of fe) {
155
- if (y === V)
153
+ (pe, Q) => {
154
+ const Z = Q.map((w) => w.ref.current), [ce, ...ee] = Z, [S] = ee.slice(-1), V = W ?? Q.find((w) => w.value === F)?.ref.current;
155
+ for (const w of pe) {
156
+ if (w === V)
156
157
  return;
157
- if (y?.scrollIntoView({ block: "nearest" }), y === ce && A && (A.scrollTop = 0), y === S && A && (A.scrollTop = A.scrollHeight), B(y), e === "both") {
158
- const w = Q.find((P) => P.ref.current === y);
159
- w && $(w.textValue);
158
+ if (w?.scrollIntoView({ block: "nearest" }), w === ce && A && (A.scrollTop = 0), w === S && A && (A.scrollTop = A.scrollHeight), B(w), e === "both") {
159
+ const y = Q.find((P) => P.ref.current === w);
160
+ y && $(y.textValue);
160
161
  }
161
- if (y !== V)
162
+ if (w !== V)
162
163
  return;
163
164
  }
164
165
  },
@@ -168,9 +169,9 @@ const Ft = (r) => {
168
169
  e !== "both" && B(null);
169
170
  }, [G, e]), l.useEffect(() => {
170
171
  if (k && E)
171
- return at([k, E]);
172
- }, [k, E]), /* @__PURE__ */ f(Ut, { children: /* @__PURE__ */ f(
173
- $t,
172
+ return ft([k, E]);
173
+ }, [k, E]), /* @__PURE__ */ p(ro, { children: /* @__PURE__ */ p(
174
+ no,
174
175
  {
175
176
  allowCustomValue: c,
176
177
  autocomplete: e,
@@ -183,7 +184,7 @@ const Ft = (r) => {
183
184
  open: D,
184
185
  onOpenChange: H,
185
186
  disabled: u,
186
- locale: p,
187
+ locale: f,
187
188
  focusFirst: se,
188
189
  textValue: G,
189
190
  onTextValueChange: $,
@@ -197,12 +198,12 @@ const Ft = (r) => {
197
198
  children: t
198
199
  }
199
200
  ) });
200
- }, Wt = "ComboboxTrigger", zt = l.forwardRef((r, c) => {
201
- const { ...e } = r, t = K(Wt), o = () => {
201
+ }, gt = "ComboboxTrigger", xt = l.forwardRef((r, c) => {
202
+ const { ...e } = r, t = K(gt), o = () => {
202
203
  t.disabled || t.onOpenChange(!0);
203
204
  };
204
- return /* @__PURE__ */ f(le.Anchor, { asChild: !0, children: /* @__PURE__ */ f(
205
- st,
205
+ return /* @__PURE__ */ p(le.Anchor, { asChild: !0, children: /* @__PURE__ */ p(
206
+ ut,
206
207
  {
207
208
  asChild: !0,
208
209
  trapped: t.open,
@@ -212,7 +213,7 @@ const Ft = (r) => {
212
213
  onUnmountAutoFocus: (n) => {
213
214
  t.trigger?.focus({ preventScroll: !0 }), document.getSelection()?.empty(), n.preventDefault();
214
215
  },
215
- children: /* @__PURE__ */ f(
216
+ children: /* @__PURE__ */ p(
216
217
  "div",
217
218
  {
218
219
  ref: c,
@@ -229,21 +230,23 @@ const Ft = (r) => {
229
230
  )
230
231
  }
231
232
  ) });
232
- }), ft = "ComboboxInput", Gt = l.forwardRef((r, c) => {
233
- const e = K(ft), t = l.useRef(null), { getItems: o } = me(void 0), { startsWith: n } = Me(e.locale, { sensitivity: "base" }), i = e.disabled, s = M(t, c, e.onTriggerChange), a = () => {
233
+ });
234
+ xt.displayName = gt;
235
+ const Ct = "ComboboxInput", vt = l.forwardRef((r, c) => {
236
+ const e = K(Ct), t = l.useRef(null), { getItems: o } = me(void 0), { startsWith: n } = De(e.locale, { sensitivity: "base" }), i = e.disabled, s = M(t, c, e.onTriggerChange), a = () => {
234
237
  i || e.onOpenChange(!0);
235
- }, m = Ft(e.filterValue);
238
+ }, m = Qt(e.filterValue);
236
239
  return L(() => {
237
240
  const u = setTimeout(() => {
238
241
  if (e.textValue === "" || e.textValue === void 0 || e.filterValue === "" || e.filterValue === void 0)
239
242
  return;
240
243
  const x = o().find(
241
244
  (d) => d.type === "option" && n(d.textValue, e.textValue)
242
- ), p = So(m ?? "", e.filterValue);
243
- x && !e.visuallyFocussedItem && p === e.filterValue.length && t.current?.setSelectionRange(e.filterValue.length, e.textValue.length);
245
+ ), f = So(m ?? "", e.filterValue);
246
+ x && !e.visuallyFocussedItem && f === e.filterValue.length && t.current?.setSelectionRange(e.filterValue.length, e.textValue.length);
244
247
  });
245
248
  return () => clearTimeout(u);
246
- }, [e.textValue, e.filterValue, n, e.visuallyFocussedItem, o, m]), /* @__PURE__ */ f(
249
+ }, [e.textValue, e.filterValue, n, e.visuallyFocussedItem, o, m]), /* @__PURE__ */ p(
247
250
  "input",
248
251
  {
249
252
  type: "text",
@@ -264,31 +267,31 @@ const Ft = (r) => {
264
267
  onKeyDown: T(r.onKeyDown, (u) => {
265
268
  if (["ArrowUp", "ArrowDown", "Home", "End"].includes(u.key))
266
269
  e.open || a(), setTimeout(() => {
267
- let p = o().filter((d) => !d.disabled && d.isVisible).map((d) => d.ref.current);
268
- if (["ArrowUp", "End"].includes(u.key) && (p = p.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(u.key)) {
270
+ let f = o().filter((d) => !d.disabled && d.isVisible).map((d) => d.ref.current);
271
+ if (["ArrowUp", "End"].includes(u.key) && (f = f.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(u.key)) {
269
272
  const d = e.visuallyFocussedItem ?? o().find((h) => h.value === e.value)?.ref.current;
270
273
  if (d) {
271
- let h = p.indexOf(d);
272
- h === p.length - 1 && (h = -1), p = p.slice(h + 1);
274
+ let h = f.indexOf(d);
275
+ h === f.length - 1 && (h = -1), f = f.slice(h + 1);
273
276
  }
274
277
  }
275
- if (["ArrowDown"].includes(u.key) && e.autocomplete === "both" && p.length > 1) {
276
- const [d, ...h] = p, v = o().find((C) => C.ref.current === d).textValue;
277
- e.textValue === v && (p = h);
278
+ if (["ArrowDown"].includes(u.key) && e.autocomplete === "both" && f.length > 1) {
279
+ const [d, ...h] = f, v = o().find((C) => C.ref.current === d).textValue;
280
+ e.textValue === v && (f = h);
278
281
  }
279
- e.focusFirst(p, o());
282
+ e.focusFirst(f, o());
280
283
  }), u.preventDefault();
281
284
  else if (["Tab"].includes(u.key) && e.open)
282
285
  u.preventDefault();
283
286
  else if (["Escape"].includes(u.key))
284
287
  e.open ? e.onOpenChange(!1) : (e.onValueChange(void 0), e.onTextValueChange("")), u.preventDefault();
285
- else if (Bt.includes(u.key)) {
288
+ else if (to.includes(u.key)) {
286
289
  if (e.visuallyFocussedItem) {
287
- const x = o().find((p) => p.ref.current === e.visuallyFocussedItem);
290
+ const x = o().find((f) => f.ref.current === e.visuallyFocussedItem);
288
291
  x && (e.onValueChange(x.value), e.onTextValueChange(x.textValue), e.autocomplete === "both" && e.onFilterValueChange(x.textValue), x.ref.current?.click());
289
292
  } else {
290
293
  const x = o().find(
291
- (p) => p.type === "option" && !p.disabled && p.textValue === e.textValue
294
+ (f) => f.type === "option" && !f.disabled && f.textValue === e.textValue
292
295
  );
293
296
  x && (e.onValueChange(x.value), e.onTextValueChange(x.textValue), e.autocomplete === "both" && e.onFilterValueChange(x.textValue), x.ref.current?.click());
294
297
  }
@@ -302,12 +305,12 @@ const Ft = (r) => {
302
305
  onKeyUp: T(r.onKeyUp, (u) => {
303
306
  if (!e.open && (e.isPrintableCharacter(u.key) || ["Backspace"].includes(u.key)) && a(), setTimeout(() => {
304
307
  if (e.autocomplete === "both" && e.isPrintableCharacter(u.key) && e.filterValue !== void 0) {
305
- const x = e.filterValue, p = o().find((d) => n(d.textValue, x));
306
- p && e.onTextValueChange(p.textValue);
308
+ const x = e.filterValue, f = o().find((d) => n(d.textValue, x));
309
+ f && e.onTextValueChange(f.textValue);
307
310
  }
308
311
  }), e.autocomplete === "none" && e.isPrintableCharacter(u.key)) {
309
- const x = e.textValue ?? "", p = o().find((d) => n(d.textValue, x));
310
- p && (e.onVisuallyFocussedItemChange(p.ref.current), p.ref.current?.scrollIntoView());
312
+ const x = e.textValue ?? "", f = o().find((d) => n(d.textValue, x));
313
+ f && (e.onVisuallyFocussedItemChange(f.ref.current), f.ref.current?.scrollIntoView());
311
314
  }
312
315
  }),
313
316
  onBlur: T(r.onBlur, () => {
@@ -315,7 +318,7 @@ const Ft = (r) => {
315
318
  return;
316
319
  e.onVisuallyFocussedItemChange(null);
317
320
  const [u] = o().filter(
318
- (p) => p.textValue === e.textValue && p.type === "option"
321
+ (f) => f.textValue === e.textValue && f.type === "option"
319
322
  );
320
323
  if (u) {
321
324
  e.onValueChange(u.value), e.autocomplete === "both" && e.onFilterValueChange(u.textValue);
@@ -325,17 +328,19 @@ const Ft = (r) => {
325
328
  e.onValueChange(e.textValue), e.autocomplete === "both" && e.onFilterValueChange(e.textValue);
326
329
  return;
327
330
  }
328
- const [x] = o().filter((p) => p.value === e.value && p.type === "option");
331
+ const [x] = o().filter((f) => f.value === e.value && f.type === "option");
329
332
  x && e.textValue !== "" ? (e.onTextValueChange(x.textValue), e.autocomplete === "both" && e.onFilterValueChange(x.textValue)) : (e.onValueChange(void 0), e.onTextValueChange(""));
330
333
  })
331
334
  }
332
335
  );
333
- }), jt = l.forwardRef((r, c) => {
334
- const { children: e, ...t } = r, o = K(ft), n = o.disabled, i = () => {
336
+ });
337
+ vt.displayName = "ComboboxTextInput";
338
+ const bt = l.forwardRef((r, c) => {
339
+ const { children: e, ...t } = r, o = K(Ct), n = o.disabled, i = () => {
335
340
  n || (o.onOpenChange(!0), o.trigger?.focus());
336
341
  };
337
- return /* @__PURE__ */ f(
338
- N.button,
342
+ return /* @__PURE__ */ p(
343
+ R.button,
339
344
  {
340
345
  "aria-hidden": !0,
341
346
  type: "button",
@@ -354,15 +359,17 @@ const Ft = (r) => {
354
359
  s.button === 0 && s.ctrlKey === !1 && (i(), s.preventDefault());
355
360
  }),
356
361
  onKeyDown: T(t.onKeyDown, (s) => {
357
- Lt.includes(s.key) && (i(), s.preventDefault());
362
+ eo.includes(s.key) && (i(), s.preventDefault());
358
363
  }),
359
364
  children: e || "▼"
360
365
  }
361
366
  );
362
- }), Yt = "ComboboxPortal", pt = (r) => /* @__PURE__ */ f(it, { asChild: !0, ...r });
363
- pt.displayName = Yt;
364
- const mt = "ComboboxContent", qt = l.forwardRef((r, c) => {
365
- const e = K(mt), { getItems: t } = me(void 0), [o, n] = l.useState();
367
+ });
368
+ bt.displayName = "ComboboxIcon";
369
+ const so = "ComboboxPortal", St = (r) => /* @__PURE__ */ p(pt, { asChild: !0, ...r });
370
+ St.displayName = so;
371
+ const ke = "ComboboxContent", It = l.forwardRef((r, c) => {
372
+ const e = K(ke), { getItems: t } = me(void 0), [o, n] = l.useState();
366
373
  if (L(() => {
367
374
  n(new DocumentFragment());
368
375
  }, []), L(() => {
@@ -372,23 +379,25 @@ const mt = "ComboboxContent", qt = l.forwardRef((r, c) => {
372
379
  }, [t, e.autocomplete, e.value, e.open]), !e.open) {
373
380
  const i = o;
374
381
  return i ? Ce.createPortal(
375
- /* @__PURE__ */ f(ae.Slot, { scope: void 0, children: /* @__PURE__ */ f("div", { children: r.children }) }),
382
+ /* @__PURE__ */ p(ae.Slot, { scope: void 0, children: /* @__PURE__ */ p("div", { children: r.children }) }),
376
383
  i
377
384
  ) : null;
378
385
  }
379
- return /* @__PURE__ */ f(Zt, { ...r, ref: c });
380
- }), Xt = 10, Zt = l.forwardRef(
386
+ return /* @__PURE__ */ p(yt, { ...r, ref: c });
387
+ });
388
+ It.displayName = ke;
389
+ const co = 10, yt = l.forwardRef(
381
390
  (r, c) => {
382
- const { onEscapeKeyDown: e, onPointerDownOutside: t, ...o } = r, n = K(mt), i = M(c, (a) => n.onContentChange(a)), { onOpenChange: s } = n;
383
- return lt(), l.useEffect(() => {
391
+ const { onEscapeKeyDown: e, onPointerDownOutside: t, ...o } = r, n = K(ke), i = M(c, (a) => n.onContentChange(a)), { onOpenChange: s } = n;
392
+ return at(), l.useEffect(() => {
384
393
  const a = () => {
385
394
  s(!1);
386
395
  };
387
396
  return window.addEventListener("blur", a), window.addEventListener("resize", a), () => {
388
397
  window.removeEventListener("blur", a), window.removeEventListener("resize", a);
389
398
  };
390
- }, [s]), /* @__PURE__ */ f(ut, { allowPinchZoom: !0, children: /* @__PURE__ */ f(
391
- rt,
399
+ }, [s]), /* @__PURE__ */ p(mt, { allowPinchZoom: !0, children: /* @__PURE__ */ p(
400
+ it,
392
401
  {
393
402
  asChild: !0,
394
403
  onEscapeKeyDown: e,
@@ -399,8 +408,8 @@ const mt = "ComboboxContent", qt = l.forwardRef((r, c) => {
399
408
  onDismiss: () => {
400
409
  n.onOpenChange(!1), n.trigger?.focus({ preventScroll: !0 });
401
410
  },
402
- children: /* @__PURE__ */ f(
403
- Jt,
411
+ children: /* @__PURE__ */ p(
412
+ wt,
404
413
  {
405
414
  role: "listbox",
406
415
  id: n.contentId,
@@ -421,10 +430,12 @@ const mt = "ComboboxContent", qt = l.forwardRef((r, c) => {
421
430
  }
422
431
  ) });
423
432
  }
424
- ), Jt = l.forwardRef(
433
+ );
434
+ yt.displayName = "ComboboxContentImpl";
435
+ const wt = l.forwardRef(
425
436
  (r, c) => {
426
- const { align: e = "start", collisionPadding: t = Xt, ...o } = r;
427
- return /* @__PURE__ */ f(
437
+ const { align: e = "start", collisionPadding: t = co, ...o } = r;
438
+ return /* @__PURE__ */ p(
428
439
  le.Content,
429
440
  {
430
441
  ...o,
@@ -444,10 +455,12 @@ const mt = "ComboboxContent", qt = l.forwardRef((r, c) => {
444
455
  }
445
456
  );
446
457
  }
447
- ), Qt = "ComboboxViewport", eo = l.forwardRef((r, c) => {
448
- const e = K(Qt), t = M(c, e.onViewportChange);
449
- return /* @__PURE__ */ Ae(_e, { children: [
450
- /* @__PURE__ */ f(
458
+ );
459
+ wt.displayName = "ComboboxPopperPosition";
460
+ const Tt = "ComboboxViewport", Vt = l.forwardRef((r, c) => {
461
+ const e = K(Tt), t = M(c, e.onViewportChange);
462
+ return /* @__PURE__ */ Me(Oe, { children: [
463
+ /* @__PURE__ */ p(
451
464
  "style",
452
465
  {
453
466
  dangerouslySetInnerHTML: {
@@ -455,8 +468,8 @@ const mt = "ComboboxContent", qt = l.forwardRef((r, c) => {
455
468
  }
456
469
  }
457
470
  ),
458
- /* @__PURE__ */ f(ae.Slot, { scope: void 0, children: /* @__PURE__ */ f(
459
- N.div,
471
+ /* @__PURE__ */ p(ae.Slot, { scope: void 0, children: /* @__PURE__ */ p(
472
+ R.div,
460
473
  {
461
474
  "data-radix-combobox-viewport": "",
462
475
  role: "presentation",
@@ -474,66 +487,70 @@ const mt = "ComboboxContent", qt = l.forwardRef((r, c) => {
474
487
  }
475
488
  ) })
476
489
  ] });
477
- }), Oe = "ComboboxItem", [et, De] = nt(Oe), ht = l.forwardRef((r, c) => {
490
+ });
491
+ Vt.displayName = Tt;
492
+ const ve = "ComboboxItem", [lt, Fe] = ct(ve), Le = l.forwardRef((r, c) => {
478
493
  const { value: e, disabled: t = !1, textValue: o, ...n } = r, [i, s] = l.useState();
479
494
  L(() => {
480
495
  s(new DocumentFragment());
481
496
  }, []);
482
- const { onTextValueChange: a, textValue: m, ...u } = K(Oe), x = re(), [p, d] = l.useState(o ?? ""), h = u.value === e, { startsWith: v } = Me(u.locale, { sensitivity: "base" }), C = l.useCallback((b) => {
497
+ const { onTextValueChange: a, textValue: m, ...u } = K(ve), x = re(), [f, d] = l.useState(o ?? ""), h = u.value === e, { startsWith: v } = De(u.locale, { sensitivity: "base" }), C = l.useCallback((b) => {
483
498
  d((g) => g || (b?.textContent ?? "").trim());
484
499
  }, []);
485
500
  return l.useEffect(() => {
486
- h && m === void 0 && p !== "" && a(p);
487
- }, [p, h, m, a]), u.autocomplete === "both" && p && u.filterValue && !v(p, u.filterValue) || u.autocomplete === "list" && p && m && !v(p, m) ? i ? Ce.createPortal(
488
- /* @__PURE__ */ f(
489
- et,
501
+ h && m === void 0 && f !== "" && a(f);
502
+ }, [f, h, m, a]), u.autocomplete === "both" && f && u.filterValue && !v(f, u.filterValue) || u.autocomplete === "list" && f && m && !v(f, m) ? i ? Ce.createPortal(
503
+ /* @__PURE__ */ p(
504
+ lt,
490
505
  {
491
506
  textId: x,
492
507
  onTextValueChange: C,
493
508
  isSelected: h,
494
- textValue: p,
495
- children: /* @__PURE__ */ f(
509
+ textValue: f,
510
+ children: /* @__PURE__ */ p(
496
511
  ae.ItemSlot,
497
512
  {
498
513
  scope: void 0,
499
514
  value: e,
500
- textValue: p,
515
+ textValue: f,
501
516
  disabled: t,
502
517
  type: "option",
503
518
  isVisible: !1,
504
- children: /* @__PURE__ */ f(tt, { ref: c, value: e, disabled: t, ...n })
519
+ children: /* @__PURE__ */ p(Pe, { ref: c, value: e, disabled: t, ...n })
505
520
  }
506
521
  )
507
522
  }
508
523
  ),
509
524
  i
510
- ) : null : /* @__PURE__ */ f(
511
- et,
525
+ ) : null : /* @__PURE__ */ p(
526
+ lt,
512
527
  {
513
528
  textId: x,
514
529
  onTextValueChange: C,
515
530
  isSelected: h,
516
- textValue: p,
517
- children: /* @__PURE__ */ f(
531
+ textValue: f,
532
+ children: /* @__PURE__ */ p(
518
533
  ae.ItemSlot,
519
534
  {
520
535
  scope: void 0,
521
536
  value: e,
522
- textValue: p,
537
+ textValue: f,
523
538
  disabled: t,
524
539
  type: "option",
525
540
  isVisible: !0,
526
- children: /* @__PURE__ */ f(tt, { ref: c, value: e, disabled: t, ...n })
541
+ children: /* @__PURE__ */ p(Pe, { ref: c, value: e, disabled: t, ...n })
527
542
  }
528
543
  )
529
544
  }
530
545
  );
531
- }), to = "ComboboxItemImpl", tt = l.forwardRef((r, c) => {
532
- const { value: e, disabled: t = !1, ...o } = r, n = l.useRef(null), i = M(c, n), { getItems: s } = me(void 0), { onTextValueChange: a, visuallyFocussedItem: m, ...u } = K(Oe), { isSelected: x, textValue: p, textId: d } = De(to), h = () => {
533
- t || (u.onValueChange(e), a(p), u.onOpenChange(!1), u.autocomplete === "both" && u.onFilterValueChange(p), u.trigger?.focus({ preventScroll: !0 }));
546
+ });
547
+ Le.displayName = ve;
548
+ const Pt = "ComboboxItemImpl", Pe = l.forwardRef((r, c) => {
549
+ const { value: e, disabled: t = !1, ...o } = r, n = l.useRef(null), i = M(c, n), { getItems: s } = me(void 0), { onTextValueChange: a, visuallyFocussedItem: m, ...u } = K(ve), { isSelected: x, textValue: f, textId: d } = Fe(Pt), h = () => {
550
+ t || (u.onValueChange(e), a(f), u.onOpenChange(!1), u.autocomplete === "both" && u.onFilterValueChange(f), u.trigger?.focus({ preventScroll: !0 }));
534
551
  }, v = l.useMemo(() => m === s().find((b) => b.ref.current === n.current)?.ref.current, [s, m]), C = re();
535
- return /* @__PURE__ */ f(
536
- N.div,
552
+ return /* @__PURE__ */ p(
553
+ R.div,
537
554
  {
538
555
  role: "option",
539
556
  "aria-labelledby": d,
@@ -549,14 +566,20 @@ const mt = "ComboboxContent", qt = l.forwardRef((r, c) => {
549
566
  onPointerUp: T(o.onPointerUp, h)
550
567
  }
551
568
  );
552
- }), oo = "ComboboxItemText", no = l.forwardRef((r, c) => {
553
- const { className: e, style: t, ...o } = r, n = De(oo), i = M(c, n.onTextValueChange);
554
- return /* @__PURE__ */ f(N.span, { id: n.textId, ...o, ref: i });
555
- }), ro = "ComboboxItemIndicator", lo = l.forwardRef((r, c) => {
556
- const { isSelected: e } = De(ro);
557
- return e ? /* @__PURE__ */ f(N.span, { "aria-hidden": !0, ...r, ref: c }) : null;
558
- }), gt = "ComboboxNoValueFound", so = l.forwardRef((r, c) => {
559
- const { textValue: e = "", filterValue: t = "", locale: o, autocomplete: n } = K(gt), [i, s] = l.useState([]), { subscribe: a } = me(void 0), { startsWith: m } = Me(o, { sensitivity: "base" });
569
+ });
570
+ Pe.displayName = Pt;
571
+ const Et = "ComboboxItemText", Nt = l.forwardRef((r, c) => {
572
+ const { className: e, style: t, ...o } = r, n = Fe(Et), i = M(c, n.onTextValueChange);
573
+ return /* @__PURE__ */ p(R.span, { id: n.textId, ...o, ref: i });
574
+ });
575
+ Nt.displayName = Et;
576
+ const Rt = "ComboboxItemIndicator", At = l.forwardRef((r, c) => {
577
+ const { isSelected: e } = Fe(Rt);
578
+ return e ? /* @__PURE__ */ p(R.span, { "aria-hidden": !0, ...r, ref: c }) : null;
579
+ });
580
+ At.displayName = Rt;
581
+ const Be = "ComboboxNoValueFound", _t = l.forwardRef((r, c) => {
582
+ const { textValue: e = "", filterValue: t = "", locale: o, autocomplete: n } = K(Be), [i, s] = l.useState([]), { subscribe: a } = me(void 0), { startsWith: m } = De(o, { sensitivity: "base" });
560
583
  return l.useEffect(() => {
561
584
  const u = a((x) => {
562
585
  s(x);
@@ -564,9 +587,11 @@ const mt = "ComboboxContent", qt = l.forwardRef((r, c) => {
564
587
  return () => {
565
588
  u();
566
589
  };
567
- }, [a]), i.length === 0 || n === "none" || n === "list" && i.some((u) => m(u.textValue, e)) || n === "both" && i.some((u) => m(u.textValue, t)) ? null : /* @__PURE__ */ f(N.div, { ...r, ref: c });
568
- }), co = l.forwardRef((r, c) => {
569
- const { disabled: e = !1, ...t } = r, o = K(gt), { textValue: n, visuallyFocussedItem: i } = o, { getItems: s, subscribe: a } = me(void 0), m = l.useRef(null), [u, x] = l.useState(!1), p = M(c, m), d = l.useMemo(() => i === s().find((C) => C.ref.current === m.current)?.ref.current, [s, i]), h = re(), v = () => {
590
+ }, [a]), i.length === 0 || n === "none" || n === "list" && i.some((u) => m(u.textValue, e)) || n === "both" && i.some((u) => m(u.textValue, t)) ? null : /* @__PURE__ */ p(R.div, { ...r, ref: c });
591
+ });
592
+ _t.displayName = Be;
593
+ const Mt = l.forwardRef((r, c) => {
594
+ const { disabled: e = !1, ...t } = r, o = K(Be), { textValue: n, visuallyFocussedItem: i } = o, { getItems: s, subscribe: a } = me(void 0), m = l.useRef(null), [u, x] = l.useState(!1), f = M(c, m), d = l.useMemo(() => i === s().find((C) => C.ref.current === m.current)?.ref.current, [s, i]), h = re(), v = () => {
570
595
  !e && n && (o.onValueChange(n), o.onTextValueChange(n), o.onOpenChange(!1), o.autocomplete === "both" && o.onFilterValueChange(n), o.trigger?.focus({ preventScroll: !0 }));
571
596
  };
572
597
  return L(() => {
@@ -576,7 +601,7 @@ const mt = "ComboboxContent", qt = l.forwardRef((r, c) => {
576
601
  return s().length === 0 && x(!0), () => {
577
602
  C();
578
603
  };
579
- }, [n, a, s]), !n || !u ? null : /* @__PURE__ */ f(
604
+ }, [n, a, s]), !n || !u ? null : /* @__PURE__ */ p(
580
605
  ae.ItemSlot,
581
606
  {
582
607
  scope: void 0,
@@ -585,8 +610,8 @@ const mt = "ComboboxContent", qt = l.forwardRef((r, c) => {
585
610
  disabled: e,
586
611
  isVisible: !0,
587
612
  type: "create",
588
- children: /* @__PURE__ */ f(
589
- N.div,
613
+ children: /* @__PURE__ */ p(
614
+ R.div,
590
615
  {
591
616
  role: "option",
592
617
  tabIndex: e ? void 0 : -1,
@@ -595,13 +620,15 @@ const mt = "ComboboxContent", qt = l.forwardRef((r, c) => {
595
620
  "data-highlighted": d ? "" : void 0,
596
621
  ...t,
597
622
  id: h,
598
- ref: p,
623
+ ref: f,
599
624
  onPointerUp: T(t.onPointerUp, v)
600
625
  }
601
626
  )
602
627
  }
603
628
  );
604
- }), io = Kt, ao = zt, uo = Gt, fo = jt, po = pt, mo = qt, ho = eo, go = ht, xo = no, Co = lo, vo = so, bo = co;
629
+ });
630
+ Mt.displayName = "ComboboxCreateItem";
631
+ const io = lo, ao = xt, uo = vt, po = bt, fo = St, mo = It, ho = Vt, go = Le, xo = Nt, Co = At, vo = _t, bo = Mt;
605
632
  function So(r, c) {
606
633
  const e = Math.min(r.length, c.length);
607
634
  for (let t = 0; t < e; t++)
@@ -611,23 +638,23 @@ function So(r, c) {
611
638
  }
612
639
  const Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
613
640
  __proto__: null,
614
- ComboboxItem: ht,
641
+ ComboboxItem: Le,
615
642
  Content: mo,
616
643
  CreateItem: bo,
617
- Icon: fo,
644
+ Icon: po,
618
645
  Item: go,
619
646
  ItemIndicator: Co,
620
647
  ItemText: xo,
621
648
  NoValueFound: vo,
622
- Portal: po,
649
+ Portal: fo,
623
650
  Root: io,
624
651
  TextInput: uo,
625
652
  Trigger: ao,
626
653
  Viewport: ho
627
- }, Symbol.toStringTag, { value: "Module" })), Io = [" ", "Enter", "ArrowUp", "ArrowDown"], wo = [" ", "Enter"], he = "Select", [ve, ge, yo] = Nt(he), [ue, To] = ot(he, [
628
- yo,
629
- ct
630
- ]), be = ct(), [Vo, Y] = ue(he), [Po, Eo] = ue(he), ke = (r) => {
654
+ }, Symbol.toStringTag, { value: "Module" })), Io = [" ", "Enter", "ArrowUp", "ArrowDown"], yo = [" ", "Enter"], he = "Select", [be, ge, wo] = Gt(he), [ue, To] = st(he, [
655
+ wo,
656
+ dt
657
+ ]), Se = dt(), [Vo, Y] = ue(he), [Po, Eo] = ue(he), He = (r) => {
631
658
  const {
632
659
  __scopeSelect: c,
633
660
  children: e,
@@ -642,8 +669,8 @@ const Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
642
669
  // autoComplete,
643
670
  disabled: u,
644
671
  required: x,
645
- multi: p = !1
646
- } = r, d = be(c), [h, v] = l.useState(null), [C, b] = l.useState(null), [g, I] = l.useState(!1), E = At(m), [O = !1, A] = ie({
672
+ multi: f = !1
673
+ } = r, d = Se(c), [h, v] = l.useState(null), [C, b] = l.useState(null), [g, I] = l.useState(!1), E = jt(m), [O = !1, A] = ie({
647
674
  prop: t,
648
675
  defaultProp: o,
649
676
  onChange: n
@@ -654,7 +681,7 @@ const Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
654
681
  a && (Array.isArray(D), a(D));
655
682
  }
656
683
  }), q = l.useRef(null), [W, B] = l.useState(/* @__PURE__ */ new Set());
657
- return /* @__PURE__ */ f(le.Root, { ...d, children: /* @__PURE__ */ f(
684
+ return /* @__PURE__ */ p(le.Root, { ...d, children: /* @__PURE__ */ p(
658
685
  Vo,
659
686
  {
660
687
  required: x,
@@ -673,8 +700,8 @@ const Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
673
700
  dir: E,
674
701
  triggerPointerDownPosRef: q,
675
702
  disabled: u,
676
- multi: p,
677
- children: /* @__PURE__ */ f(ve.Provider, { scope: c, children: /* @__PURE__ */ f(
703
+ multi: f,
704
+ children: /* @__PURE__ */ p(be.Provider, { scope: c, children: /* @__PURE__ */ p(
678
705
  Po,
679
706
  {
680
707
  scope: r.__scopeSelect,
@@ -693,20 +720,20 @@ const Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
693
720
  }
694
721
  ) });
695
722
  };
696
- ke.displayName = he;
697
- const xt = "SelectTrigger", Fe = l.forwardRef(
723
+ He.displayName = he;
724
+ const Ot = "SelectTrigger", $e = l.forwardRef(
698
725
  (r, c) => {
699
- const { __scopeSelect: e, ...t } = r, o = be(e), n = Y(xt, e), i = n.disabled, s = M(c, n.onTriggerChange), a = ge(e), [m, u, x] = Pt((d) => {
700
- const h = a().filter((b) => !b.disabled), v = h.find((b) => b.value === n.value), C = Et(h, d, v);
726
+ const { __scopeSelect: e, ...t } = r, o = Se(e), n = Y(Ot, e), i = n.disabled, s = M(c, n.onTriggerChange), a = ge(e), [m, u, x] = Kt((d) => {
727
+ const h = a().filter((b) => !b.disabled), v = h.find((b) => b.value === n.value), C = Wt(h, d, v);
701
728
  if (C !== void 0 && !Array.isArray(C.value)) {
702
729
  const b = n.multi ? [C.value] : C.value;
703
730
  n.onValueChange(b);
704
731
  }
705
- }), p = () => {
732
+ }), f = () => {
706
733
  i || (n.onOpenChange(!0), x());
707
734
  };
708
- return /* @__PURE__ */ f(le.Anchor, { asChild: !0, ...o, children: /* @__PURE__ */ f(
709
- N.div,
735
+ return /* @__PURE__ */ p(le.Anchor, { asChild: !0, ...o, children: /* @__PURE__ */ p(
736
+ R.div,
710
737
  {
711
738
  role: "combobox",
712
739
  "aria-controls": n.contentId,
@@ -725,29 +752,29 @@ const xt = "SelectTrigger", Fe = l.forwardRef(
725
752
  }),
726
753
  onPointerDown: T(t.onPointerDown, (d) => {
727
754
  const h = d.target;
728
- h.hasPointerCapture(d.pointerId) && h.releasePointerCapture(d.pointerId), (h.closest("button") ?? h.closest("div")) === d.currentTarget && d.button === 0 && d.ctrlKey === !1 && (p(), n.triggerPointerDownPosRef.current = {
755
+ h.hasPointerCapture(d.pointerId) && h.releasePointerCapture(d.pointerId), (h.closest("button") ?? h.closest("div")) === d.currentTarget && d.button === 0 && d.ctrlKey === !1 && (f(), n.triggerPointerDownPosRef.current = {
729
756
  x: Math.round(d.pageX),
730
757
  y: Math.round(d.pageY)
731
758
  }, d.preventDefault());
732
759
  }),
733
760
  onKeyDown: T(t.onKeyDown, (d) => {
734
761
  const h = m.current !== "", v = d.ctrlKey || d.altKey || d.metaKey, C = d.target;
735
- (C.closest("button") ?? C.closest("div")) === d.currentTarget && (!v && d.key.length === 1 && u(d.key), !(h && d.key === " ") && Io.includes(d.key) && (p(), d.preventDefault()));
762
+ (C.closest("button") ?? C.closest("div")) === d.currentTarget && (!v && d.key.length === 1 && u(d.key), !(h && d.key === " ") && Io.includes(d.key) && (f(), d.preventDefault()));
736
763
  })
737
764
  }
738
765
  ) });
739
766
  }
740
767
  );
741
- Fe.displayName = xt;
742
- const Ct = "SelectValue", Le = l.forwardRef(
768
+ $e.displayName = Ot;
769
+ const Dt = "SelectValue", Ue = l.forwardRef(
743
770
  (r, c) => {
744
- const { __scopeSelect: e, children: t, placeholder: o, ...n } = r, i = Y(Ct, e), { onValueNodeHasChildrenChange: s } = i, a = t !== void 0, m = M(c, i.onValueNodeChange), [u, x] = l.useState([]), p = ge(e);
771
+ const { __scopeSelect: e, children: t, placeholder: o, ...n } = r, i = Y(Dt, e), { onValueNodeHasChildrenChange: s } = i, a = t !== void 0, m = M(c, i.onValueNodeChange), [u, x] = l.useState([]), f = ge(e);
745
772
  L(() => {
746
773
  s(a);
747
774
  }, [s, a]), l.useLayoutEffect(() => {
748
775
  if (Array.isArray(i.value) && u.length !== i.value.length) {
749
776
  const h = setTimeout(() => {
750
- const v = p().filter(
777
+ const v = f().filter(
751
778
  (C) => Array.isArray(C.value) ? !1 : i.value?.includes(C.value)
752
779
  );
753
780
  x(v);
@@ -756,10 +783,10 @@ const Ct = "SelectValue", Le = l.forwardRef(
756
783
  clearTimeout(h);
757
784
  };
758
785
  }
759
- }, [i.value, p, u]);
786
+ }, [i.value, f, u]);
760
787
  let d;
761
788
  if ((i.value === void 0 || i.value.length === 0) && o !== void 0)
762
- d = /* @__PURE__ */ f("span", { children: o });
789
+ d = /* @__PURE__ */ p("span", { children: o });
763
790
  else if (typeof t == "function")
764
791
  if (Array.isArray(i.value)) {
765
792
  const h = i.value.map((v) => {
@@ -771,20 +798,20 @@ const Ct = "SelectValue", Le = l.forwardRef(
771
798
  d = t(i.value);
772
799
  else
773
800
  d = t;
774
- return /* @__PURE__ */ f(N.span, { ...n, ref: m, children: d || null });
801
+ return /* @__PURE__ */ p(R.span, { ...n, ref: m, children: d || null });
775
802
  }
776
803
  );
777
- Le.displayName = Ct;
778
- const Ro = "SelectIcon", Be = l.forwardRef(
804
+ Ue.displayName = Dt;
805
+ const No = "SelectIcon", Ke = l.forwardRef(
779
806
  (r, c) => {
780
807
  const { __scopeSelect: e, children: t, ...o } = r;
781
- return /* @__PURE__ */ f(N.span, { "aria-hidden": !0, ...o, ref: c, children: t || "▼" });
808
+ return /* @__PURE__ */ p(R.span, { "aria-hidden": !0, ...o, ref: c, children: t || "▼" });
782
809
  }
783
810
  );
784
- Be.displayName = Ro;
785
- const No = "SelectPortal", He = (r) => /* @__PURE__ */ f(it, { asChild: !0, ...r });
786
- He.displayName = No;
787
- const ne = "SelectContent", $e = l.forwardRef(
811
+ Ke.displayName = No;
812
+ const Ro = "SelectPortal", We = (r) => /* @__PURE__ */ p(pt, { asChild: !0, ...r });
813
+ We.displayName = Ro;
814
+ const ne = "SelectContent", ze = l.forwardRef(
788
815
  (r, c) => {
789
816
  const e = Y(ne, r.__scopeSelect), [t, o] = l.useState();
790
817
  if (L(() => {
@@ -792,15 +819,15 @@ const ne = "SelectContent", $e = l.forwardRef(
792
819
  }, []), !e.open) {
793
820
  const n = t;
794
821
  return n ? Ce.createPortal(
795
- /* @__PURE__ */ f(vt, { scope: r.__scopeSelect, children: /* @__PURE__ */ f(ve.Slot, { scope: r.__scopeSelect, children: /* @__PURE__ */ f("div", { children: r.children }) }) }),
822
+ /* @__PURE__ */ p(kt, { scope: r.__scopeSelect, children: /* @__PURE__ */ p(be.Slot, { scope: r.__scopeSelect, children: /* @__PURE__ */ p("div", { children: r.children }) }) }),
796
823
  n
797
824
  ) : null;
798
825
  }
799
- return /* @__PURE__ */ f(bt, { ...r, ref: c });
826
+ return /* @__PURE__ */ p(Ft, { ...r, ref: c });
800
827
  }
801
828
  );
802
- $e.displayName = ne;
803
- const j = 10, [vt, J] = ue(ne), Ao = "SelectContentImpl", bt = l.forwardRef(
829
+ ze.displayName = ne;
830
+ const j = 10, [kt, J] = ue(ne), Ao = "SelectContentImpl", Ft = l.forwardRef(
804
831
  (r, c) => {
805
832
  const {
806
833
  __scopeSelect: e,
@@ -815,7 +842,7 @@ const j = 10, [vt, J] = ue(ne), Ao = "SelectContentImpl", bt = l.forwardRef(
815
842
  align: m,
816
843
  alignOffset: u,
817
844
  arrowPadding: x,
818
- collisionBoundary: p,
845
+ collisionBoundary: f,
819
846
  collisionPadding: d,
820
847
  sticky: h,
821
848
  hideWhenDetached: v,
@@ -825,13 +852,13 @@ const j = 10, [vt, J] = ue(ne), Ao = "SelectContentImpl", bt = l.forwardRef(
825
852
  } = r, g = Y(ne, e), [I, E] = l.useState(null), [O, A] = l.useState(null), _ = M(c, (S) => E(S)), [k, q] = l.useState(null), [W, B] = l.useState(null), D = ge(e), [H, F] = l.useState(!1), z = l.useRef(!1);
826
853
  l.useEffect(() => {
827
854
  if (I)
828
- return at(I);
829
- }, [I]), lt();
855
+ return ft(I);
856
+ }, [I]), at();
830
857
  const G = l.useCallback(
831
858
  (S) => {
832
- const [V, ...y] = D().map((R) => R.ref.current), [w] = y.slice(-1), P = document.activeElement;
833
- for (const R of S)
834
- if (R === P || (R?.scrollIntoView({ block: "nearest" }), R === V && O && (O.scrollTop = 0), R === w && O && (O.scrollTop = O.scrollHeight), R?.focus(), document.activeElement !== P))
859
+ const [V, ...w] = D().map((N) => N.ref.current), [y] = w.slice(-1), P = document.activeElement;
860
+ for (const N of S)
861
+ if (N === P || (N?.scrollIntoView({ block: "nearest" }), N === V && O && (O.scrollTop = 0), N === y && O && (O.scrollTop = O.scrollHeight), N?.focus(), document.activeElement !== P))
835
862
  return;
836
863
  },
837
864
  [D, O]
@@ -846,16 +873,16 @@ const j = 10, [vt, J] = ue(ne), Ao = "SelectContentImpl", bt = l.forwardRef(
846
873
  l.useEffect(() => {
847
874
  if (I) {
848
875
  let S = { x: 0, y: 0 };
849
- const V = (w) => {
876
+ const V = (y) => {
850
877
  S = {
851
- x: Math.abs(Math.round(w.pageX) - (U.current?.x ?? 0)),
852
- y: Math.abs(Math.round(w.pageY) - (U.current?.y ?? 0))
878
+ x: Math.abs(Math.round(y.pageX) - (U.current?.x ?? 0)),
879
+ y: Math.abs(Math.round(y.pageY) - (U.current?.y ?? 0))
853
880
  };
854
- }, y = (w) => {
855
- S.x <= 10 && S.y <= 10 ? w.preventDefault() : I.contains(w.target) || X(!1), document.removeEventListener("pointermove", V), U.current = null;
881
+ }, w = (y) => {
882
+ S.x <= 10 && S.y <= 10 ? y.preventDefault() : I.contains(y.target) || X(!1), document.removeEventListener("pointermove", V), U.current = null;
856
883
  };
857
- return U.current !== null && (document.addEventListener("pointermove", V), document.addEventListener("pointerup", y, { capture: !0, once: !0 })), () => {
858
- document.removeEventListener("pointermove", V), document.removeEventListener("pointerup", y, { capture: !0 });
884
+ return U.current !== null && (document.addEventListener("pointermove", V), document.addEventListener("pointerup", w, { capture: !0, once: !0 })), () => {
885
+ document.removeEventListener("pointermove", V), document.removeEventListener("pointerup", w, { capture: !0 });
859
886
  };
860
887
  }
861
888
  }, [I, X, U]), l.useEffect(() => {
@@ -864,41 +891,41 @@ const j = 10, [vt, J] = ue(ne), Ao = "SelectContentImpl", bt = l.forwardRef(
864
891
  window.removeEventListener("blur", S), window.removeEventListener("resize", S);
865
892
  };
866
893
  }, [X]);
867
- const [de, se] = Pt((S) => {
868
- const V = D().filter((P) => !P.disabled), y = V.find((P) => P.ref.current === document.activeElement), w = Et(V, S, y);
869
- w && setTimeout(() => w.ref.current.focus());
870
- }), fe = l.useCallback(
871
- (S, V, y) => {
872
- const w = !z.current && !y;
873
- (g.value !== void 0 && g.value === V || w) && (q(S), w && (z.current = !0));
894
+ const [de, se] = Kt((S) => {
895
+ const V = D().filter((P) => !P.disabled), w = V.find((P) => P.ref.current === document.activeElement), y = Wt(V, S, w);
896
+ y && setTimeout(() => y.ref.current.focus());
897
+ }), pe = l.useCallback(
898
+ (S, V, w) => {
899
+ const y = !z.current && !w;
900
+ (g.value !== void 0 && g.value === V || y) && (q(S), y && (z.current = !0));
874
901
  },
875
902
  [g.value]
876
903
  ), Q = l.useCallback(() => I?.focus(), [I]), Z = l.useCallback(
877
- (S, V, y) => {
878
- const w = !z.current && !y;
879
- (g.value !== void 0 && (Array.isArray(V) ? V.every((R) => g.value?.includes(R)) : g.value === V) || w) && B(S);
904
+ (S, V, w) => {
905
+ const y = !z.current && !w;
906
+ (g.value !== void 0 && (Array.isArray(V) ? V.every((N) => g.value?.includes(N)) : g.value === V) || y) && B(S);
880
907
  },
881
908
  [g.value]
882
- ), ce = t === "popper" ? Ve : St, ee = ce === Ve ? {
909
+ ), ce = t === "popper" ? Ee : Lt, ee = ce === Ee ? {
883
910
  side: s,
884
911
  sideOffset: a,
885
912
  align: m,
886
913
  alignOffset: u,
887
914
  arrowPadding: x,
888
- collisionBoundary: p,
915
+ collisionBoundary: f,
889
916
  collisionPadding: d,
890
917
  sticky: h,
891
918
  hideWhenDetached: v,
892
919
  avoidCollisions: C
893
920
  } : {};
894
- return /* @__PURE__ */ f(
895
- vt,
921
+ return /* @__PURE__ */ p(
922
+ kt,
896
923
  {
897
924
  scope: e,
898
925
  content: I,
899
926
  viewport: O,
900
927
  onViewportChange: A,
901
- itemRefCallback: fe,
928
+ itemRefCallback: pe,
902
929
  selectedItem: k,
903
930
  onItemLeave: Q,
904
931
  itemTextRefCallback: Z,
@@ -907,8 +934,8 @@ const j = 10, [vt, J] = ue(ne), Ao = "SelectContentImpl", bt = l.forwardRef(
907
934
  position: t,
908
935
  isPositioned: H,
909
936
  searchRef: de,
910
- children: /* @__PURE__ */ f(ut, { as: Te, allowPinchZoom: !0, children: /* @__PURE__ */ f(
911
- st,
937
+ children: /* @__PURE__ */ p(mt, { as: Ve, allowPinchZoom: !0, children: /* @__PURE__ */ p(
938
+ ut,
912
939
  {
913
940
  asChild: !0,
914
941
  trapped: g.open,
@@ -918,8 +945,8 @@ const j = 10, [vt, J] = ue(ne), Ao = "SelectContentImpl", bt = l.forwardRef(
918
945
  onUnmountAutoFocus: T(o, (S) => {
919
946
  g.trigger?.focus({ preventScroll: !0 }), document.getSelection()?.empty(), S.preventDefault();
920
947
  }),
921
- children: /* @__PURE__ */ f(
922
- rt,
948
+ children: /* @__PURE__ */ p(
949
+ it,
923
950
  {
924
951
  asChild: !0,
925
952
  disableOutsidePointerEvents: !0,
@@ -927,7 +954,7 @@ const j = 10, [vt, J] = ue(ne), Ao = "SelectContentImpl", bt = l.forwardRef(
927
954
  onPointerDownOutside: i,
928
955
  onFocusOutside: (S) => S.preventDefault(),
929
956
  onDismiss: () => g.onOpenChange(!1),
930
- children: /* @__PURE__ */ f(
957
+ children: /* @__PURE__ */ p(
931
958
  ce,
932
959
  {
933
960
  role: "listbox",
@@ -951,12 +978,12 @@ const j = 10, [vt, J] = ue(ne), Ao = "SelectContentImpl", bt = l.forwardRef(
951
978
  onKeyDown: T(b.onKeyDown, (S) => {
952
979
  const V = S.ctrlKey || S.altKey || S.metaKey;
953
980
  if (S.key === "Tab" && S.preventDefault(), !V && S.key.length === 1 && se(S.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(S.key)) {
954
- let w = D().filter((P) => !P.disabled).map((P) => P.ref.current);
955
- if (["ArrowUp", "End"].includes(S.key) && (w = w.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(S.key)) {
956
- const P = S.target, R = w.indexOf(P);
957
- w = w.slice(R + 1);
981
+ let y = D().filter((P) => !P.disabled).map((P) => P.ref.current);
982
+ if (["ArrowUp", "End"].includes(S.key) && (y = y.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(S.key)) {
983
+ const P = S.target, N = y.indexOf(P);
984
+ y = y.slice(N + 1);
958
985
  }
959
- setTimeout(() => G(w)), S.preventDefault();
986
+ setTimeout(() => G(y)), S.preventDefault();
960
987
  }
961
988
  })
962
989
  }
@@ -969,27 +996,27 @@ const j = 10, [vt, J] = ue(ne), Ao = "SelectContentImpl", bt = l.forwardRef(
969
996
  );
970
997
  }
971
998
  );
972
- bt.displayName = Ao;
973
- const _o = "SelectItemAlignedPosition", St = l.forwardRef(
999
+ Ft.displayName = Ao;
1000
+ const _o = "SelectItemAlignedPosition", Lt = l.forwardRef(
974
1001
  (r, c) => {
975
- const { __scopeSelect: e, onPlaced: t, ...o } = r, n = Y(ne, e), i = J(ne, e), [s, a] = l.useState(null), [m, u] = l.useState(null), x = M(c, (_) => u(_)), p = ge(e), d = l.useRef(!1), h = l.useRef(!0), { viewport: v, selectedItem: C, selectedItemText: b, focusSelectedItem: g } = i, I = l.useCallback(() => {
1002
+ const { __scopeSelect: e, onPlaced: t, ...o } = r, n = Y(ne, e), i = J(ne, e), [s, a] = l.useState(null), [m, u] = l.useState(null), x = M(c, (_) => u(_)), f = ge(e), d = l.useRef(!1), h = l.useRef(!0), { viewport: v, selectedItem: C, selectedItemText: b, focusSelectedItem: g } = i, I = l.useCallback(() => {
976
1003
  if (n.trigger && n.valueNode && s && m && v && C && b) {
977
1004
  const _ = n.trigger.getBoundingClientRect(), k = m.getBoundingClientRect(), q = n.valueNode.getBoundingClientRect(), W = b.getBoundingClientRect();
978
1005
  if (n.dir !== "rtl") {
979
- const P = W.left - k.left, R = q.left - P, te = _.left - R, oe = _.width + te, Se = Math.max(oe, k.width), Ie = window.innerWidth - j, we = Qe(R, [j, Ie - Se]);
1006
+ const P = W.left - k.left, N = q.left - P, te = _.left - N, oe = _.width + te, Ie = Math.max(oe, k.width), ye = window.innerWidth - j, we = rt(N, [j, ye - Ie]);
980
1007
  s.style.minWidth = `${oe}px`, s.style.left = `${we}px`;
981
1008
  } else {
982
- const P = k.right - W.right, R = window.innerWidth - q.right - P, te = window.innerWidth - _.right - R, oe = _.width + te, Se = Math.max(oe, k.width), Ie = window.innerWidth - j, we = Qe(R, [j, Ie - Se]);
1009
+ const P = k.right - W.right, N = window.innerWidth - q.right - P, te = window.innerWidth - _.right - N, oe = _.width + te, Ie = Math.max(oe, k.width), ye = window.innerWidth - j, we = rt(N, [j, ye - Ie]);
983
1010
  s.style.minWidth = `${oe}px`, s.style.right = `${we}px`;
984
1011
  }
985
- const B = p(), D = window.innerHeight - j * 2, H = v.scrollHeight, F = window.getComputedStyle(m), z = parseInt(F.borderTopWidth, 10), G = parseInt(F.paddingTop, 10), $ = parseInt(F.borderBottomWidth, 10), X = parseInt(F.paddingBottom, 10), U = z + G + H + X + $, de = Math.min(C.offsetHeight * 5, U), se = window.getComputedStyle(v), fe = parseInt(se.paddingTop, 10), Q = parseInt(se.paddingBottom, 10), Z = _.top + _.height / 2 - j, ce = D - Z, ee = C.offsetHeight / 2, S = C.offsetTop + ee, V = z + G + S, y = U - V;
1012
+ const B = f(), D = window.innerHeight - j * 2, H = v.scrollHeight, F = window.getComputedStyle(m), z = parseInt(F.borderTopWidth, 10), G = parseInt(F.paddingTop, 10), $ = parseInt(F.borderBottomWidth, 10), X = parseInt(F.paddingBottom, 10), U = z + G + H + X + $, de = Math.min(C.offsetHeight * 5, U), se = window.getComputedStyle(v), pe = parseInt(se.paddingTop, 10), Q = parseInt(se.paddingBottom, 10), Z = _.top + _.height / 2 - j, ce = D - Z, ee = C.offsetHeight / 2, S = C.offsetTop + ee, V = z + G + S, w = U - V;
986
1013
  if (V <= Z) {
987
1014
  const P = C === B[B.length - 1].ref.current;
988
1015
  s.style.bottom = "0px";
989
- const R = m.clientHeight - v.offsetTop - v.offsetHeight, te = Math.max(
1016
+ const N = m.clientHeight - v.offsetTop - v.offsetHeight, te = Math.max(
990
1017
  ce,
991
1018
  ee + // viewport might have padding bottom, include it to avoid a scrollable viewport
992
- (P ? Q : 0) + R + $
1019
+ (P ? Q : 0) + N + $
993
1020
  ), oe = V + te;
994
1021
  s.style.height = `${oe}px`;
995
1022
  } else {
@@ -998,14 +1025,14 @@ const _o = "SelectItemAlignedPosition", St = l.forwardRef(
998
1025
  const te = Math.max(
999
1026
  Z,
1000
1027
  z + v.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
1001
- (P ? fe : 0) + ee
1002
- ) + y;
1028
+ (P ? pe : 0) + ee
1029
+ ) + w;
1003
1030
  s.style.height = `${te}px`, v.scrollTop = V - Z + v.offsetTop;
1004
1031
  }
1005
1032
  s.style.margin = `${j}px 0`, s.style.minHeight = `${de}px`, s.style.maxHeight = `${D}px`, t?.(), requestAnimationFrame(() => d.current = !0);
1006
1033
  }
1007
1034
  }, [
1008
- p,
1035
+ f,
1009
1036
  n.trigger,
1010
1037
  n.valueNode,
1011
1038
  s,
@@ -1027,14 +1054,14 @@ const _o = "SelectItemAlignedPosition", St = l.forwardRef(
1027
1054
  },
1028
1055
  [I, g]
1029
1056
  );
1030
- return /* @__PURE__ */ f(
1057
+ return /* @__PURE__ */ p(
1031
1058
  Oo,
1032
1059
  {
1033
1060
  scope: e,
1034
1061
  contentWrapper: s,
1035
1062
  shouldExpandOnScrollRef: d,
1036
1063
  onScrollButtonChange: A,
1037
- children: /* @__PURE__ */ f(
1064
+ children: /* @__PURE__ */ p(
1038
1065
  "div",
1039
1066
  {
1040
1067
  ref: a,
@@ -1044,8 +1071,8 @@ const _o = "SelectItemAlignedPosition", St = l.forwardRef(
1044
1071
  position: "fixed",
1045
1072
  zIndex: E
1046
1073
  },
1047
- children: /* @__PURE__ */ f(
1048
- N.div,
1074
+ children: /* @__PURE__ */ p(
1075
+ R.div,
1049
1076
  {
1050
1077
  ...o,
1051
1078
  ref: x,
@@ -1065,11 +1092,11 @@ const _o = "SelectItemAlignedPosition", St = l.forwardRef(
1065
1092
  );
1066
1093
  }
1067
1094
  );
1068
- St.displayName = _o;
1069
- const Mo = "SelectPopperPosition", Ve = l.forwardRef(
1095
+ Lt.displayName = _o;
1096
+ const Mo = "SelectPopperPosition", Ee = l.forwardRef(
1070
1097
  (r, c) => {
1071
- const { __scopeSelect: e, align: t = "start", collisionPadding: o = j, ...n } = r, i = be(e);
1072
- return /* @__PURE__ */ f(
1098
+ const { __scopeSelect: e, align: t = "start", collisionPadding: o = j, ...n } = r, i = Se(e);
1099
+ return /* @__PURE__ */ p(
1073
1100
  le.Content,
1074
1101
  {
1075
1102
  ...i,
@@ -1091,15 +1118,15 @@ const Mo = "SelectPopperPosition", Ve = l.forwardRef(
1091
1118
  );
1092
1119
  }
1093
1120
  );
1094
- Ve.displayName = Mo;
1095
- const [Oo, Ue] = ue(
1121
+ Ee.displayName = Mo;
1122
+ const [Oo, Ge] = ue(
1096
1123
  ne,
1097
1124
  {}
1098
- ), Pe = "SelectViewport", Ke = l.forwardRef(
1125
+ ), Ne = "SelectViewport", je = l.forwardRef(
1099
1126
  (r, c) => {
1100
- const { __scopeSelect: e, ...t } = r, o = J(Pe, e), n = Ue(Pe, e), i = M(c, o.onViewportChange), s = l.useRef(0);
1101
- return /* @__PURE__ */ Ae(_e, { children: [
1102
- /* @__PURE__ */ f(
1127
+ const { __scopeSelect: e, ...t } = r, o = J(Ne, e), n = Ge(Ne, e), i = M(c, o.onViewportChange), s = l.useRef(0);
1128
+ return /* @__PURE__ */ Me(Oe, { children: [
1129
+ /* @__PURE__ */ p(
1103
1130
  "style",
1104
1131
  {
1105
1132
  dangerouslySetInnerHTML: {
@@ -1107,8 +1134,8 @@ const [Oo, Ue] = ue(
1107
1134
  }
1108
1135
  }
1109
1136
  ),
1110
- /* @__PURE__ */ f(ve.Slot, { scope: e, children: /* @__PURE__ */ f(
1111
- N.div,
1137
+ /* @__PURE__ */ p(be.Slot, { scope: e, children: /* @__PURE__ */ p(
1138
+ R.div,
1112
1139
  {
1113
1140
  "data-radix-select-viewport": "",
1114
1141
  role: "presentation",
@@ -1126,11 +1153,11 @@ const [Oo, Ue] = ue(
1126
1153
  onScroll: T(t.onScroll, (a) => {
1127
1154
  const m = a.currentTarget, { contentWrapper: u, shouldExpandOnScrollRef: x } = n;
1128
1155
  if (x?.current && u) {
1129
- const p = Math.abs(s.current - m.scrollTop);
1130
- if (p > 0) {
1156
+ const f = Math.abs(s.current - m.scrollTop);
1157
+ if (f > 0) {
1131
1158
  const d = window.innerHeight - j * 2, h = parseFloat(u.style.minHeight), v = parseFloat(u.style.height), C = Math.max(h, v);
1132
1159
  if (C < d) {
1133
- const b = C + p, g = Math.min(d, b), I = b - g;
1160
+ const b = C + f, g = Math.min(d, b), I = b - g;
1134
1161
  u.style.height = `${g}px`, u.style.bottom === "0px" && (m.scrollTop = I > 0 ? I : 0, u.style.justifyContent = "flex-end");
1135
1162
  }
1136
1163
  }
@@ -1142,35 +1169,35 @@ const [Oo, Ue] = ue(
1142
1169
  ] });
1143
1170
  }
1144
1171
  );
1145
- Ke.displayName = Pe;
1146
- const It = "SelectGroup", [Do, ko] = ue(It), We = l.forwardRef(
1172
+ je.displayName = Ne;
1173
+ const Bt = "SelectGroup", [Do, ko] = ue(Bt), Ye = l.forwardRef(
1147
1174
  (r, c) => {
1148
1175
  const { __scopeSelect: e, ...t } = r, o = re();
1149
- return /* @__PURE__ */ f(Do, { scope: e, id: o, children: /* @__PURE__ */ f(N.div, { role: "group", "aria-labelledby": o, ...t, ref: c }) });
1176
+ return /* @__PURE__ */ p(Do, { scope: e, id: o, children: /* @__PURE__ */ p(R.div, { role: "group", "aria-labelledby": o, ...t, ref: c }) });
1150
1177
  }
1151
1178
  );
1152
- We.displayName = It;
1153
- const wt = "SelectLabel", ze = l.forwardRef(
1179
+ Ye.displayName = Bt;
1180
+ const Ht = "SelectLabel", qe = l.forwardRef(
1154
1181
  (r, c) => {
1155
- const { __scopeSelect: e, ...t } = r, o = ko(wt, e);
1156
- return /* @__PURE__ */ f(N.div, { id: o.id, ...t, ref: c });
1182
+ const { __scopeSelect: e, ...t } = r, o = ko(Ht, e);
1183
+ return /* @__PURE__ */ p(R.div, { id: o.id, ...t, ref: c });
1157
1184
  }
1158
1185
  );
1159
- ze.displayName = wt;
1160
- const xe = "SelectItem", [Fo, yt] = ue(xe), Ge = l.forwardRef(
1186
+ qe.displayName = Ht;
1187
+ const xe = "SelectItem", [Fo, $t] = ue(xe), Xe = l.forwardRef(
1161
1188
  (r, c) => {
1162
- const { __scopeSelect: e, value: t, disabled: o = !1, textValue: n, ...i } = r, s = Y(xe, e), a = J(xe, e), m = typeof t == "string" ? Array.isArray(s.value) ? s.value.includes(t) : s.value === t : t.every((g) => s.value?.includes(g)), u = Array.isArray(s.value) && Array.isArray(t) && t.some((g) => s.value?.includes(g)), [x, p] = l.useState(n ?? ""), [d, h] = l.useState(!1), v = M(
1189
+ const { __scopeSelect: e, value: t, disabled: o = !1, textValue: n, ...i } = r, s = Y(xe, e), a = J(xe, e), m = typeof t == "string" ? Array.isArray(s.value) ? s.value.includes(t) : s.value === t : t.every((g) => s.value?.includes(g)), u = Array.isArray(s.value) && Array.isArray(t) && t.some((g) => s.value?.includes(g)), [x, f] = l.useState(n ?? ""), [d, h] = l.useState(!1), v = M(
1163
1190
  c,
1164
1191
  (g) => a.itemRefCallback?.(g, t, o)
1165
1192
  ), C = re(), b = () => {
1166
1193
  if (!o) {
1167
1194
  let g = s.multi && typeof t == "string" ? [t] : t;
1168
- u && !m ? s.onValueChange(g) : Array.isArray(s.value) && (g = Rt(t, s.value)), s.onValueChange(g), s.multi || s.onOpenChange(!1);
1195
+ u && !m ? s.onValueChange(g) : Array.isArray(s.value) && (g = zt(t, s.value)), s.onValueChange(g), s.multi || s.onOpenChange(!1);
1169
1196
  }
1170
1197
  };
1171
1198
  if (!s.multi && Array.isArray(t))
1172
1199
  throw new Error("You can only pass an array of values in multi selects");
1173
- return /* @__PURE__ */ f(
1200
+ return /* @__PURE__ */ p(
1174
1201
  Fo,
1175
1202
  {
1176
1203
  scope: e,
@@ -1180,10 +1207,10 @@ const xe = "SelectItem", [Fo, yt] = ue(xe), Ge = l.forwardRef(
1180
1207
  isSelected: m,
1181
1208
  isIntermediate: u,
1182
1209
  onItemTextChange: l.useCallback((g) => {
1183
- p((I) => I || (g?.textContent ?? "").trim());
1210
+ f((I) => I || (g?.textContent ?? "").trim());
1184
1211
  }, []),
1185
- children: /* @__PURE__ */ f(ve.ItemSlot, { scope: e, value: t, disabled: o, textValue: x, children: /* @__PURE__ */ f(
1186
- N.div,
1212
+ children: /* @__PURE__ */ p(be.ItemSlot, { scope: e, value: t, disabled: o, textValue: x, children: /* @__PURE__ */ p(
1213
+ R.div,
1187
1214
  {
1188
1215
  role: "option",
1189
1216
  "aria-labelledby": C,
@@ -1206,7 +1233,7 @@ const xe = "SelectItem", [Fo, yt] = ue(xe), Ge = l.forwardRef(
1206
1233
  g.currentTarget === document.activeElement && a.onItemLeave?.();
1207
1234
  }),
1208
1235
  onKeyDown: T(i.onKeyDown, (g) => {
1209
- a.searchRef?.current !== "" && g.key === " " || (wo.includes(g.key) && b(), g.key === " " && g.preventDefault());
1236
+ a.searchRef?.current !== "" && g.key === " " || (yo.includes(g.key) && b(), g.key === " " && g.preventDefault());
1210
1237
  })
1211
1238
  }
1212
1239
  ) })
@@ -1214,16 +1241,16 @@ const xe = "SelectItem", [Fo, yt] = ue(xe), Ge = l.forwardRef(
1214
1241
  );
1215
1242
  }
1216
1243
  );
1217
- Ge.displayName = xe;
1218
- const pe = "SelectItemText", je = l.forwardRef(
1244
+ Xe.displayName = xe;
1245
+ const fe = "SelectItemText", Ze = l.forwardRef(
1219
1246
  (r, c) => {
1220
- const { __scopeSelect: e, className: t, style: o, ...n } = r, i = Y(pe, e), s = J(pe, e), a = yt(pe, e), m = Eo(pe, e), [u, x] = l.useState(null), p = M(
1247
+ const { __scopeSelect: e, className: t, style: o, ...n } = r, i = Y(fe, e), s = J(fe, e), a = $t(fe, e), m = Eo(fe, e), [u, x] = l.useState(null), f = M(
1221
1248
  c,
1222
1249
  (b) => x(b),
1223
1250
  a.onItemTextChange,
1224
1251
  (b) => s.itemTextRefCallback?.(b, a.value, a.disabled)
1225
1252
  ), d = u?.textContent, h = l.useMemo(
1226
- () => /* @__PURE__ */ f(
1253
+ () => /* @__PURE__ */ p(
1227
1254
  "option",
1228
1255
  {
1229
1256
  value: a.value,
@@ -1234,26 +1261,26 @@ const pe = "SelectItemText", je = l.forwardRef(
1234
1261
  ),
1235
1262
  [a.disabled, a.value, d]
1236
1263
  ), { onNativeOptionAdd: v, onNativeOptionRemove: C } = m;
1237
- return L(() => (v(h), () => C(h)), [v, C, h]), /* @__PURE__ */ Ae(_e, { children: [
1238
- /* @__PURE__ */ f(N.span, { id: a.textId, ...n, ref: p }),
1264
+ return L(() => (v(h), () => C(h)), [v, C, h]), /* @__PURE__ */ Me(Oe, { children: [
1265
+ /* @__PURE__ */ p(R.span, { id: a.textId, ...n, ref: f }),
1239
1266
  a.isSelected && i.valueNode && !i.valueNodeHasChildren ? Ce.createPortal(n.children, i.valueNode) : null
1240
1267
  ] });
1241
1268
  }
1242
1269
  );
1243
- je.displayName = pe;
1244
- const Tt = "SelectItemIndicator", Ye = l.forwardRef(
1270
+ Ze.displayName = fe;
1271
+ const Ut = "SelectItemIndicator", Je = l.forwardRef(
1245
1272
  (r, c) => {
1246
- const { __scopeSelect: e, children: t, ...o } = r, n = yt(Tt, e);
1247
- return typeof t == "function" ? /* @__PURE__ */ f(N.span, { "aria-hidden": !0, ...o, ref: c, children: t({
1273
+ const { __scopeSelect: e, children: t, ...o } = r, n = $t(Ut, e);
1274
+ return typeof t == "function" ? /* @__PURE__ */ p(R.span, { "aria-hidden": !0, ...o, ref: c, children: t({
1248
1275
  isSelected: n.isSelected,
1249
1276
  isIntermediate: n.isIntermediate
1250
- }) }) : n.isSelected ? /* @__PURE__ */ f(N.span, { "aria-hidden": !0, ...o, ref: c, children: t }) : null;
1277
+ }) }) : n.isSelected ? /* @__PURE__ */ p(R.span, { "aria-hidden": !0, ...o, ref: c, children: t }) : null;
1251
1278
  }
1252
1279
  );
1253
- Ye.displayName = Tt;
1254
- const Ee = "SelectScrollUpButton", qe = l.forwardRef(
1280
+ Je.displayName = Ut;
1281
+ const Re = "SelectScrollUpButton", Qe = l.forwardRef(
1255
1282
  (r, c) => {
1256
- const e = J(Ee, r.__scopeSelect), t = Ue(Ee, r.__scopeSelect), [o, n] = l.useState(!1), i = M(c, t.onScrollButtonChange);
1283
+ const e = J(Re, r.__scopeSelect), t = Ge(Re, r.__scopeSelect), [o, n] = l.useState(!1), i = M(c, t.onScrollButtonChange);
1257
1284
  return L(() => {
1258
1285
  if (e.viewport && e.isPositioned) {
1259
1286
  const s = e.viewport, a = () => {
@@ -1262,8 +1289,8 @@ const Ee = "SelectScrollUpButton", qe = l.forwardRef(
1262
1289
  };
1263
1290
  return a(), s.addEventListener("scroll", a), () => s.removeEventListener("scroll", a);
1264
1291
  }
1265
- }, [e.viewport, e.isPositioned]), o ? /* @__PURE__ */ f(
1266
- Vt,
1292
+ }, [e.viewport, e.isPositioned]), o ? /* @__PURE__ */ p(
1293
+ tt,
1267
1294
  {
1268
1295
  ...r,
1269
1296
  ref: i,
@@ -1275,10 +1302,10 @@ const Ee = "SelectScrollUpButton", qe = l.forwardRef(
1275
1302
  ) : null;
1276
1303
  }
1277
1304
  );
1278
- qe.displayName = Ee;
1279
- const Re = "SelectScrollDownButton", Xe = l.forwardRef(
1305
+ Qe.displayName = Re;
1306
+ const Ae = "SelectScrollDownButton", et = l.forwardRef(
1280
1307
  (r, c) => {
1281
- const e = J(Re, r.__scopeSelect), t = Ue(Re, r.__scopeSelect), [o, n] = l.useState(!1), i = M(c, t.onScrollButtonChange);
1308
+ const e = J(Ae, r.__scopeSelect), t = Ge(Ae, r.__scopeSelect), [o, n] = l.useState(!1), i = M(c, t.onScrollButtonChange);
1282
1309
  return L(() => {
1283
1310
  if (e.viewport && e.isPositioned) {
1284
1311
  const s = e.viewport, a = () => {
@@ -1287,8 +1314,8 @@ const Re = "SelectScrollDownButton", Xe = l.forwardRef(
1287
1314
  };
1288
1315
  return a(), s.addEventListener("scroll", a), () => s.removeEventListener("scroll", a);
1289
1316
  }
1290
- }, [e.viewport, e.isPositioned]), o ? /* @__PURE__ */ f(
1291
- Vt,
1317
+ }, [e.viewport, e.isPositioned]), o ? /* @__PURE__ */ p(
1318
+ tt,
1292
1319
  {
1293
1320
  ...r,
1294
1321
  ref: i,
@@ -1300,16 +1327,16 @@ const Re = "SelectScrollDownButton", Xe = l.forwardRef(
1300
1327
  ) : null;
1301
1328
  }
1302
1329
  );
1303
- Xe.displayName = Re;
1304
- const Vt = l.forwardRef(
1330
+ et.displayName = Ae;
1331
+ const tt = l.forwardRef(
1305
1332
  (r, c) => {
1306
1333
  const { __scopeSelect: e, onAutoScroll: t, ...o } = r, n = J("SelectScrollButton", e), i = l.useRef(null), s = ge(e), a = l.useCallback(() => {
1307
1334
  i.current !== null && (window.clearInterval(i.current), i.current = null);
1308
1335
  }, []);
1309
1336
  return l.useEffect(() => () => a(), [a]), L(() => {
1310
1337
  s().find((u) => u.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
1311
- }, [s]), /* @__PURE__ */ f(
1312
- N.div,
1338
+ }, [s]), /* @__PURE__ */ p(
1339
+ R.div,
1313
1340
  {
1314
1341
  "aria-hidden": !0,
1315
1342
  ...o,
@@ -1324,32 +1351,34 @@ const Vt = l.forwardRef(
1324
1351
  }
1325
1352
  );
1326
1353
  }
1327
- ), Lo = "SelectSeparator", Ze = l.forwardRef(
1354
+ );
1355
+ tt.displayName = "SelectScrollButtonImpl";
1356
+ const Lo = "SelectSeparator", ot = l.forwardRef(
1328
1357
  (r, c) => {
1329
1358
  const { __scopeSelect: e, ...t } = r;
1330
- return /* @__PURE__ */ f(N.div, { "aria-hidden": !0, ...t, ref: c });
1359
+ return /* @__PURE__ */ p(R.div, { "aria-hidden": !0, ...t, ref: c });
1331
1360
  }
1332
1361
  );
1333
- Ze.displayName = Lo;
1334
- const Ne = "SelectArrow", Je = l.forwardRef(
1362
+ ot.displayName = Lo;
1363
+ const _e = "SelectArrow", nt = l.forwardRef(
1335
1364
  (r, c) => {
1336
- const { __scopeSelect: e, ...t } = r, o = be(e), n = Y(Ne, e), i = J(Ne, e);
1337
- return n.open && i.position === "popper" ? /* @__PURE__ */ f(le.Arrow, { ...o, ...t, ref: c }) : null;
1365
+ const { __scopeSelect: e, ...t } = r, o = Se(e), n = Y(_e, e), i = J(_e, e);
1366
+ return n.open && i.position === "popper" ? /* @__PURE__ */ p(le.Arrow, { ...o, ...t, ref: c }) : null;
1338
1367
  }
1339
1368
  );
1340
- Je.displayName = Ne;
1369
+ nt.displayName = _e;
1341
1370
  const Bo = "BubbleSelect", Ho = l.forwardRef(
1342
1371
  (r, c) => {
1343
- const { value: e, ...t } = r, o = l.useRef(null), n = M(c, o), i = _t(e), s = Y(Bo, void 0);
1372
+ const { value: e, ...t } = r, o = l.useRef(null), n = M(c, o), i = Yt(e), s = Y(Bo, void 0);
1344
1373
  l.useEffect(() => {
1345
- const m = o.current, u = window.HTMLSelectElement.prototype, p = Object.getOwnPropertyDescriptor(u, "value").set;
1346
- if (i !== e && p) {
1374
+ const m = o.current, u = window.HTMLSelectElement.prototype, f = Object.getOwnPropertyDescriptor(u, "value").set;
1375
+ if (i !== e && f) {
1347
1376
  const d = new Event("change", { bubbles: !0 });
1348
- p.call(m, e), m.dispatchEvent(d);
1377
+ f.call(m, e), m.dispatchEvent(d);
1349
1378
  }
1350
1379
  }, [i, e]);
1351
1380
  let a = e;
1352
- return s.multi && !Array.isArray(e) && (a = []), /* @__PURE__ */ f(Mt, { asChild: !0, children: /* @__PURE__ */ f(
1381
+ return s.multi && !Array.isArray(e) && (a = []), /* @__PURE__ */ p(qt, { asChild: !0, children: /* @__PURE__ */ p(
1353
1382
  "select",
1354
1383
  {
1355
1384
  ...t,
@@ -1361,8 +1390,8 @@ const Bo = "BubbleSelect", Ho = l.forwardRef(
1361
1390
  }
1362
1391
  );
1363
1392
  Ho.displayName = "BubbleSelect";
1364
- function Pt(r) {
1365
- const c = Ot(r), e = l.useRef(""), t = l.useRef(0), o = l.useCallback(
1393
+ function Kt(r) {
1394
+ const c = Xt(r), e = l.useRef(""), t = l.useRef(0), o = l.useCallback(
1366
1395
  (i) => {
1367
1396
  const s = e.current + i;
1368
1397
  c(s), function a(m) {
@@ -1375,7 +1404,7 @@ function Pt(r) {
1375
1404
  }, []);
1376
1405
  return l.useEffect(() => () => window.clearTimeout(t.current), []), [e, o, n];
1377
1406
  }
1378
- function Et(r, c, e) {
1407
+ function Wt(r, c, e) {
1379
1408
  const o = c.length > 1 && Array.from(c).every((m) => m === c[0]) ? c[0] : c, n = e ? r.indexOf(e) : -1;
1380
1409
  let i = $o(r, Math.max(n, 0));
1381
1410
  o.length === 1 && (i = i.filter((m) => m !== e));
@@ -1385,12 +1414,12 @@ function Et(r, c, e) {
1385
1414
  function $o(r, c) {
1386
1415
  return r.map((e, t) => r[(c + t) % r.length]);
1387
1416
  }
1388
- const Rt = (r, c = []) => {
1417
+ const zt = (r, c = []) => {
1389
1418
  if (Array.isArray(r))
1390
- return r.reduce((t, o) => Rt(o, t), c);
1419
+ return r.reduce((t, o) => zt(o, t), c);
1391
1420
  const e = c.indexOf(r);
1392
1421
  return e === -1 ? [...c, r] : [...c.slice(0, e), ...c.slice(e + 1)];
1393
- }, Uo = ke, Ko = Fe, Wo = Le, zo = Be, Go = He, jo = $e, Yo = Ke, qo = We, Xo = ze, Zo = Ge, Jo = je, Qo = Ye, en = qe, tn = Xe, on = Ze, nn = Je, En = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1422
+ }, Uo = He, Ko = $e, Wo = Ue, zo = Ke, Go = We, jo = ze, Yo = je, qo = Ye, Xo = qe, Zo = Xe, Jo = Ze, Qo = Je, en = Qe, tn = et, on = ot, nn = nt, En = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1394
1423
  __proto__: null,
1395
1424
  Arrow: nn,
1396
1425
  Content: jo,
@@ -1404,22 +1433,22 @@ const Rt = (r, c = []) => {
1404
1433
  Root: Uo,
1405
1434
  ScrollDownButton: tn,
1406
1435
  ScrollUpButton: en,
1407
- Select: ke,
1408
- SelectArrow: Je,
1409
- SelectContent: $e,
1410
- SelectGroup: We,
1411
- SelectIcon: Be,
1412
- SelectItem: Ge,
1413
- SelectItemIndicator: Ye,
1414
- SelectItemText: je,
1415
- SelectLabel: ze,
1416
- SelectPortal: He,
1417
- SelectScrollDownButton: Xe,
1418
- SelectScrollUpButton: qe,
1419
- SelectSeparator: Ze,
1420
- SelectTrigger: Fe,
1421
- SelectValue: Le,
1422
- SelectViewport: Ke,
1436
+ Select: He,
1437
+ SelectArrow: nt,
1438
+ SelectContent: ze,
1439
+ SelectGroup: Ye,
1440
+ SelectIcon: Ke,
1441
+ SelectItem: Xe,
1442
+ SelectItemIndicator: Je,
1443
+ SelectItemText: Ze,
1444
+ SelectLabel: qe,
1445
+ SelectPortal: We,
1446
+ SelectScrollDownButton: et,
1447
+ SelectScrollUpButton: Qe,
1448
+ SelectSeparator: ot,
1449
+ SelectTrigger: $e,
1450
+ SelectValue: Ue,
1451
+ SelectViewport: je,
1423
1452
  Separator: on,
1424
1453
  Trigger: Ko,
1425
1454
  Value: Wo,
@@ -1430,6 +1459,6 @@ export {
1430
1459
  Pn as Combobox,
1431
1460
  En as Select,
1432
1461
  An as composeEventHandlers,
1433
- Dt as createCollection,
1462
+ Zt as createCollection,
1434
1463
  Mn as useCallbackRef
1435
1464
  };