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