laif-ds 0.1.35 → 0.1.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/_virtual/index.js +5 -2
  2. package/dist/_virtual/index3.js +2 -7
  3. package/dist/_virtual/index4.js +2 -5
  4. package/dist/_virtual/index5.js +4 -4
  5. package/dist/_virtual/index6.js +5 -2
  6. package/dist/_virtual/index7.js +5 -2
  7. package/dist/_virtual/index8.js +5 -0
  8. package/dist/_virtual/index9.js +5 -0
  9. package/dist/_virtual/use-sync-external-store-shim.development.js +5 -0
  10. package/dist/_virtual/use-sync-external-store-shim.production.js +5 -0
  11. package/dist/components/ui/checkbox.js +12 -12
  12. package/dist/components/ui/gantt/components/Chart/Chart.js +1 -1
  13. package/dist/components/ui/message-input.js +1 -1
  14. package/dist/components/ui/tables/data-cross-table/data-cross-table.js +348 -0
  15. package/dist/components/ui/tables/data-cross-table/edit-controls.js +47 -0
  16. package/dist/components/ui/tables/data-cross-table/editable-input.js +100 -0
  17. package/dist/components/ui/tables/data-cross-table/truncated-text.js +19 -0
  18. package/dist/index.d.ts +30 -4
  19. package/dist/index.js +1 -1
  20. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +126 -122
  21. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +10 -6
  22. package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +44 -42
  23. package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +33 -43
  24. package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +237 -120
  25. package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +17 -16
  26. package/dist/node_modules/@radix-ui/react-context-menu/dist/index.js +95 -94
  27. package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +20 -19
  28. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +3 -3
  29. package/dist/node_modules/@radix-ui/react-hover-card/dist/index.js +14 -13
  30. package/dist/node_modules/@radix-ui/react-menu/dist/index.js +136 -136
  31. package/dist/node_modules/@radix-ui/react-menubar/dist/index.js +70 -68
  32. package/dist/node_modules/@radix-ui/react-navigation-menu/dist/index.js +66 -64
  33. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +10 -9
  34. package/dist/node_modules/@radix-ui/react-presence/dist/index.js +16 -16
  35. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +11 -10
  36. package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js +161 -146
  37. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +87 -84
  38. package/dist/node_modules/@radix-ui/react-select/dist/index.js +269 -257
  39. package/dist/node_modules/@radix-ui/react-slider/dist/index.js +3 -3
  40. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +29 -28
  41. package/dist/node_modules/@radix-ui/react-switch/dist/index.js +101 -86
  42. package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +23 -22
  43. package/dist/node_modules/@radix-ui/react-toggle/dist/index.js +17 -16
  44. package/dist/node_modules/@radix-ui/react-toggle-group/dist/index.js +25 -23
  45. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +77 -76
  46. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +43 -21
  47. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +16 -0
  48. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +18 -18
  49. package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js +36 -0
  50. package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +491 -0
  51. package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +53 -0
  52. package/dist/node_modules/classnames/index.js +1 -1
  53. package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
  54. package/dist/node_modules/property-information/lib/html.js +9 -9
  55. package/dist/node_modules/react-hook-form/dist/index.esm.js +88 -88
  56. package/dist/node_modules/react-is/index.js +1 -1
  57. package/dist/node_modules/react-resizable-panels/dist/react-resizable-panels.browser.esm.js +830 -801
  58. package/dist/node_modules/recharts/es6/util/ReactUtils.js +1 -1
  59. package/dist/node_modules/remeda/dist/chunk-AIG3BDKO.js +9 -0
  60. package/dist/node_modules/remeda/dist/{chunk-A3PVMI4K.js → chunk-KI5X74E2.js} +1 -1
  61. package/dist/node_modules/style-to-object/cjs/index.js +1 -1
  62. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +3 -3
  63. package/dist/node_modules/unified/lib/index.js +1 -1
  64. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +68 -0
  65. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +56 -0
  66. package/dist/node_modules/use-sync-external-store/shim/index.js +11 -0
  67. package/dist/styles.css +1 -1
  68. package/package.json +2 -1
  69. package/dist/components/ui/data-cross-table.js +0 -216
  70. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-arrow/dist/index.js +0 -25
  71. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-collection/dist/index.js +0 -49
  72. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -128
  73. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -138
  74. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-menu/dist/index.js +0 -625
  75. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-popper/dist/index.js +0 -221
  76. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-portal/dist/index.js +0 -17
  77. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-primitive/dist/index.js +0 -37
  78. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-roving-focus/dist/index.js +0 -184
  79. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -55
  80. package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-collection/dist/index.js +0 -49
  81. package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-primitive/dist/index.js +0 -33
  82. package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -55
  83. package/dist/node_modules/remeda/dist/chunk-OAMXQXGR.js +0 -9
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import * as t from "react";
3
- import * as Ee from "react-dom";
3
+ import * as be from "react-dom";
4
4
  import { clamp as Re } from "../../number/dist/index.js";
5
- import { composeEventHandlers as b } from "../../primitive/dist/index.js";
5
+ import { composeEventHandlers as E } from "../../primitive/dist/index.js";
6
6
  import { createCollection as st } from "../../react-collection/dist/index.js";
7
- import { useComposedRefs as V } from "../../react-compose-refs/dist/index.js";
7
+ import { useComposedRefs as B } from "../../react-compose-refs/dist/index.js";
8
8
  import { createContextScope as lt } from "../../react-context/dist/index.js";
9
9
  import { useDirection as ct } from "../../react-direction/dist/index.js";
10
10
  import { DismissableLayer as it } from "../../react-dismissable-layer/dist/index.js";
@@ -16,21 +16,21 @@ import { Portal as ht } from "../../react-portal/dist/index.js";
16
16
  import { Primitive as M } from "../../react-primitive/dist/index.js";
17
17
  import { createSlot as vt } from "../../react-slot/dist/index.js";
18
18
  import { useCallbackRef as gt } from "../../react-use-callback-ref/dist/index.js";
19
- import { useControllableState as be } from "../../react-use-controllable-state/dist/index.js";
20
- import { useLayoutEffect as j } from "../../react-use-layout-effect/dist/index.js";
19
+ import { useControllableState as Ee } from "../../react-use-controllable-state/dist/index.js";
20
+ import { useLayoutEffect as Y } from "../../react-use-layout-effect/dist/index.js";
21
21
  import { usePrevious as St } from "../../react-use-previous/dist/index.js";
22
- import { VisuallyHidden as wt } from "../../react-visually-hidden/dist/index.js";
22
+ import { VISUALLY_HIDDEN_STYLES as wt } from "../../react-visually-hidden/dist/index.js";
23
23
  import { hideOthers as Ct } from "../../../aria-hidden/dist/es2015/index.js";
24
24
  import yt from "../../../react-remove-scroll/dist/es2015/Combination.js";
25
- import { jsx as f, jsxs as ce, Fragment as Te } from "react/jsx-runtime";
26
- var xt = [" ", "Enter", "ArrowUp", "ArrowDown"], It = [" ", "Enter"], re = "Select", [ae, de, Tt] = st(re), [ee, ao] = lt(re, [
25
+ import { jsx as m, jsxs as ce, Fragment as Te } from "react/jsx-runtime";
26
+ var xt = [" ", "Enter", "ArrowUp", "ArrowDown"], It = [" ", "Enter"], J = "Select", [ae, de, Tt] = st(J), [te, uo] = lt(J, [
27
27
  Tt,
28
28
  _e
29
- ]), ue = _e(), [Pt, Y] = ee(re), [Rt, bt] = ee(re), Ne = (n) => {
29
+ ]), ue = _e(), [Pt, j] = te(J), [Rt, Et] = te(J), Ne = (n) => {
30
30
  const {
31
- __scopeSelect: i,
31
+ __scopeSelect: c,
32
32
  children: e,
33
- open: c,
33
+ open: i,
34
34
  defaultOpen: l,
35
35
  onOpenChange: u,
36
36
  value: r,
@@ -42,20 +42,22 @@ var xt = [" ", "Enter", "ArrowUp", "ArrowDown"], It = [" ", "Enter"], re = "Sele
42
42
  disabled: P,
43
43
  required: R,
44
44
  form: T
45
- } = n, a = ue(i), [v, y] = t.useState(null), [d, h] = t.useState(null), [A, O] = t.useState(!1), te = ct(p), [E = !1, L] = be({
46
- prop: c,
47
- defaultProp: l,
48
- onChange: u
49
- }), [K, X] = be({
45
+ } = n, a = ue(c), [v, y] = t.useState(null), [d, h] = t.useState(null), [A, O] = t.useState(!1), oe = ct(p), [b, L] = Ee({
46
+ prop: i,
47
+ defaultProp: l ?? !1,
48
+ onChange: u,
49
+ caller: J
50
+ }), [K, X] = Ee({
50
51
  prop: r,
51
52
  defaultProp: s,
52
- onChange: o
53
- }), B = t.useRef(null), H = v ? T || !!v.closest("form") : !0, [G, W] = t.useState(/* @__PURE__ */ new Set()), F = Array.from(G).map((_) => _.props.value).join(";");
54
- return /* @__PURE__ */ f(ut, { ...a, children: /* @__PURE__ */ ce(
53
+ onChange: o,
54
+ caller: J
55
+ }), V = t.useRef(null), H = v ? T || !!v.closest("form") : !0, [G, U] = t.useState(/* @__PURE__ */ new Set()), W = Array.from(G).map((_) => _.props.value).join(";");
56
+ return /* @__PURE__ */ m(ut, { ...a, children: /* @__PURE__ */ ce(
55
57
  Pt,
56
58
  {
57
59
  required: R,
58
- scope: i,
60
+ scope: c,
59
61
  trigger: v,
60
62
  onTriggerChange: y,
61
63
  valueNode: d,
@@ -65,30 +67,30 @@ var xt = [" ", "Enter", "ArrowUp", "ArrowDown"], It = [" ", "Enter"], re = "Sele
65
67
  contentId: Ie(),
66
68
  value: K,
67
69
  onValueChange: X,
68
- open: E,
70
+ open: b,
69
71
  onOpenChange: L,
70
- dir: te,
71
- triggerPointerDownPosRef: B,
72
+ dir: oe,
73
+ triggerPointerDownPosRef: V,
72
74
  disabled: P,
73
75
  children: [
74
- /* @__PURE__ */ f(ae.Provider, { scope: i, children: /* @__PURE__ */ f(
76
+ /* @__PURE__ */ m(ae.Provider, { scope: c, children: /* @__PURE__ */ m(
75
77
  Rt,
76
78
  {
77
79
  scope: n.__scopeSelect,
78
80
  onNativeOptionAdd: t.useCallback((_) => {
79
- W((k) => new Set(k).add(_));
81
+ U((k) => new Set(k).add(_));
80
82
  }, []),
81
83
  onNativeOptionRemove: t.useCallback((_) => {
82
- W((k) => {
83
- const U = new Set(k);
84
- return U.delete(_), U;
84
+ U((k) => {
85
+ const F = new Set(k);
86
+ return F.delete(_), F;
85
87
  });
86
88
  }, []),
87
89
  children: e
88
90
  }
89
91
  ) }),
90
92
  H ? /* @__PURE__ */ ce(
91
- ot,
93
+ tt,
92
94
  {
93
95
  "aria-hidden": !0,
94
96
  required: R,
@@ -100,20 +102,20 @@ var xt = [" ", "Enter", "ArrowUp", "ArrowDown"], It = [" ", "Enter"], re = "Sele
100
102
  disabled: P,
101
103
  form: T,
102
104
  children: [
103
- K === void 0 ? /* @__PURE__ */ f("option", { value: "" }) : null,
105
+ K === void 0 ? /* @__PURE__ */ m("option", { value: "" }) : null,
104
106
  Array.from(G)
105
107
  ]
106
108
  },
107
- F
109
+ W
108
110
  ) : null
109
111
  ]
110
112
  }
111
113
  ) });
112
114
  };
113
- Ne.displayName = re;
115
+ Ne.displayName = J;
114
116
  var Me = "SelectTrigger", Ae = t.forwardRef(
115
- (n, i) => {
116
- const { __scopeSelect: e, disabled: c = !1, ...l } = n, u = ue(e), r = Y(Me, e), s = r.disabled || c, o = V(i, r.onTriggerChange), p = de(e), g = t.useRef("touch"), [C, P, R] = nt((a) => {
117
+ (n, c) => {
118
+ const { __scopeSelect: e, disabled: i = !1, ...l } = n, u = ue(e), r = j(Me, e), s = r.disabled || i, o = B(c, r.onTriggerChange), p = de(e), g = t.useRef("touch"), [C, P, R] = nt((a) => {
117
119
  const v = p().filter((h) => !h.disabled), y = v.find((h) => h.value === r.value), d = rt(v, a, y);
118
120
  d !== void 0 && r.onValueChange(d.value);
119
121
  }), T = (a) => {
@@ -122,7 +124,7 @@ var Me = "SelectTrigger", Ae = t.forwardRef(
122
124
  y: Math.round(a.pageY)
123
125
  });
124
126
  };
125
- return /* @__PURE__ */ f(pt, { asChild: !0, ...u, children: /* @__PURE__ */ f(
127
+ return /* @__PURE__ */ m(pt, { asChild: !0, ...u, children: /* @__PURE__ */ m(
126
128
  M.button,
127
129
  {
128
130
  type: "button",
@@ -135,18 +137,18 @@ var Me = "SelectTrigger", Ae = t.forwardRef(
135
137
  "data-state": r.open ? "open" : "closed",
136
138
  disabled: s,
137
139
  "data-disabled": s ? "" : void 0,
138
- "data-placeholder": tt(r.value) ? "" : void 0,
140
+ "data-placeholder": ot(r.value) ? "" : void 0,
139
141
  ...l,
140
142
  ref: o,
141
- onClick: b(l.onClick, (a) => {
143
+ onClick: E(l.onClick, (a) => {
142
144
  a.currentTarget.focus(), g.current !== "mouse" && T(a);
143
145
  }),
144
- onPointerDown: b(l.onPointerDown, (a) => {
146
+ onPointerDown: E(l.onPointerDown, (a) => {
145
147
  g.current = a.pointerType;
146
148
  const v = a.target;
147
149
  v.hasPointerCapture(a.pointerId) && v.releasePointerCapture(a.pointerId), a.button === 0 && a.ctrlKey === !1 && a.pointerType === "mouse" && (T(a), a.preventDefault());
148
150
  }),
149
- onKeyDown: b(l.onKeyDown, (a) => {
151
+ onKeyDown: E(l.onKeyDown, (a) => {
150
152
  const v = C.current !== "";
151
153
  !(a.ctrlKey || a.altKey || a.metaKey) && a.key.length === 1 && P(a.key), !(v && a.key === " ") && xt.includes(a.key) && (T(), a.preventDefault());
152
154
  })
@@ -156,52 +158,52 @@ var Me = "SelectTrigger", Ae = t.forwardRef(
156
158
  );
157
159
  Ae.displayName = Me;
158
160
  var Oe = "SelectValue", De = t.forwardRef(
159
- (n, i) => {
160
- const { __scopeSelect: e, className: c, style: l, children: u, placeholder: r = "", ...s } = n, o = Y(Oe, e), { onValueNodeHasChildrenChange: p } = o, g = u !== void 0, C = V(i, o.onValueNodeChange);
161
- return j(() => {
161
+ (n, c) => {
162
+ const { __scopeSelect: e, className: i, style: l, children: u, placeholder: r = "", ...s } = n, o = j(Oe, e), { onValueNodeHasChildrenChange: p } = o, g = u !== void 0, C = B(c, o.onValueNodeChange);
163
+ return Y(() => {
162
164
  p(g);
163
- }, [p, g]), /* @__PURE__ */ f(
165
+ }, [p, g]), /* @__PURE__ */ m(
164
166
  M.span,
165
167
  {
166
168
  ...s,
167
169
  ref: C,
168
170
  style: { pointerEvents: "none" },
169
- children: tt(o.value) ? /* @__PURE__ */ f(Te, { children: r }) : u
171
+ children: ot(o.value) ? /* @__PURE__ */ m(Te, { children: r }) : u
170
172
  }
171
173
  );
172
174
  }
173
175
  );
174
176
  De.displayName = Oe;
175
- var Et = "SelectIcon", Le = t.forwardRef(
176
- (n, i) => {
177
- const { __scopeSelect: e, children: c, ...l } = n;
178
- return /* @__PURE__ */ f(M.span, { "aria-hidden": !0, ...l, ref: i, children: c || "▼" });
177
+ var bt = "SelectIcon", Le = t.forwardRef(
178
+ (n, c) => {
179
+ const { __scopeSelect: e, children: i, ...l } = n;
180
+ return /* @__PURE__ */ m(M.span, { "aria-hidden": !0, ...l, ref: c, children: i || "▼" });
179
181
  }
180
182
  );
181
- Le.displayName = Et;
182
- var _t = "SelectPortal", ke = (n) => /* @__PURE__ */ f(ht, { asChild: !0, ...n });
183
+ Le.displayName = bt;
184
+ var _t = "SelectPortal", ke = (n) => /* @__PURE__ */ m(ht, { asChild: !0, ...n });
183
185
  ke.displayName = _t;
184
- var J = "SelectContent", Ve = t.forwardRef(
185
- (n, i) => {
186
- const e = Y(J, n.__scopeSelect), [c, l] = t.useState();
187
- if (j(() => {
186
+ var Q = "SelectContent", Be = t.forwardRef(
187
+ (n, c) => {
188
+ const e = j(Q, n.__scopeSelect), [i, l] = t.useState();
189
+ if (Y(() => {
188
190
  l(new DocumentFragment());
189
191
  }, []), !e.open) {
190
- const u = c;
191
- return u ? Ee.createPortal(
192
- /* @__PURE__ */ f(Be, { scope: n.__scopeSelect, children: /* @__PURE__ */ f(ae.Slot, { scope: n.__scopeSelect, children: /* @__PURE__ */ f("div", { children: n.children }) }) }),
192
+ const u = i;
193
+ return u ? be.createPortal(
194
+ /* @__PURE__ */ m(Ve, { scope: n.__scopeSelect, children: /* @__PURE__ */ m(ae.Slot, { scope: n.__scopeSelect, children: /* @__PURE__ */ m("div", { children: n.children }) }) }),
193
195
  u
194
196
  ) : null;
195
197
  }
196
- return /* @__PURE__ */ f(He, { ...n, ref: i });
198
+ return /* @__PURE__ */ m(He, { ...n, ref: c });
197
199
  }
198
200
  );
199
- Ve.displayName = J;
200
- var D = 10, [Be, q] = ee(J), Nt = "SelectContentImpl", Mt = vt("SelectContent.RemoveScroll"), He = t.forwardRef(
201
- (n, i) => {
201
+ Be.displayName = Q;
202
+ var D = 10, [Ve, q] = te(Q), Nt = "SelectContentImpl", Mt = vt("SelectContent.RemoveScroll"), He = t.forwardRef(
203
+ (n, c) => {
202
204
  const {
203
205
  __scopeSelect: e,
204
- position: c = "item-aligned",
206
+ position: i = "item-aligned",
205
207
  onCloseAutoFocus: l,
206
208
  onEscapeKeyDown: u,
207
209
  onPointerDownOutside: r,
@@ -219,16 +221,16 @@ var D = 10, [Be, q] = ee(J), Nt = "SelectContentImpl", Mt = vt("SelectContent.Re
219
221
  avoidCollisions: v,
220
222
  //
221
223
  ...y
222
- } = n, d = Y(J, e), [h, A] = t.useState(null), [O, te] = t.useState(null), E = V(i, (m) => A(m)), [L, K] = t.useState(null), [X, B] = t.useState(
224
+ } = n, d = j(Q, e), [h, A] = t.useState(null), [O, oe] = t.useState(null), b = B(c, (f) => A(f)), [L, K] = t.useState(null), [X, V] = t.useState(
223
225
  null
224
- ), H = de(e), [G, W] = t.useState(!1), F = t.useRef(!1);
226
+ ), H = de(e), [G, U] = t.useState(!1), W = t.useRef(!1);
225
227
  t.useEffect(() => {
226
228
  if (h) return Ct(h);
227
229
  }, [h]), at();
228
230
  const _ = t.useCallback(
229
- (m) => {
231
+ (f) => {
230
232
  const [I, ...N] = H().map((w) => w.ref.current), [x] = N.slice(-1), S = document.activeElement;
231
- for (const w of m)
233
+ for (const w of f)
232
234
  if (w === S || (w == null || w.scrollIntoView({ block: "nearest" }), w === I && O && (O.scrollTop = 0), w === x && O && (O.scrollTop = O.scrollHeight), w == null || w.focus(), document.activeElement !== S)) return;
233
235
  },
234
236
  [H, O]
@@ -239,45 +241,45 @@ var D = 10, [Be, q] = ee(J), Nt = "SelectContentImpl", Mt = vt("SelectContent.Re
239
241
  t.useEffect(() => {
240
242
  G && k();
241
243
  }, [G, k]);
242
- const { onOpenChange: U, triggerPointerDownPosRef: z } = d;
244
+ const { onOpenChange: F, triggerPointerDownPosRef: z } = d;
243
245
  t.useEffect(() => {
244
246
  if (h) {
245
- let m = { x: 0, y: 0 };
247
+ let f = { x: 0, y: 0 };
246
248
  const I = (x) => {
247
249
  var S, w;
248
- m = {
250
+ f = {
249
251
  x: Math.abs(Math.round(x.pageX) - (((S = z.current) == null ? void 0 : S.x) ?? 0)),
250
252
  y: Math.abs(Math.round(x.pageY) - (((w = z.current) == null ? void 0 : w.y) ?? 0))
251
253
  };
252
254
  }, N = (x) => {
253
- m.x <= 10 && m.y <= 10 ? x.preventDefault() : h.contains(x.target) || U(!1), document.removeEventListener("pointermove", I), z.current = null;
255
+ f.x <= 10 && f.y <= 10 ? x.preventDefault() : h.contains(x.target) || F(!1), document.removeEventListener("pointermove", I), z.current = null;
254
256
  };
255
257
  return z.current !== null && (document.addEventListener("pointermove", I), document.addEventListener("pointerup", N, { capture: !0, once: !0 })), () => {
256
258
  document.removeEventListener("pointermove", I), document.removeEventListener("pointerup", N, { capture: !0 });
257
259
  };
258
260
  }
259
- }, [h, U, z]), t.useEffect(() => {
260
- const m = () => U(!1);
261
- return window.addEventListener("blur", m), window.addEventListener("resize", m), () => {
262
- window.removeEventListener("blur", m), window.removeEventListener("resize", m);
261
+ }, [h, F, z]), t.useEffect(() => {
262
+ const f = () => F(!1);
263
+ return window.addEventListener("blur", f), window.addEventListener("resize", f), () => {
264
+ window.removeEventListener("blur", f), window.removeEventListener("resize", f);
263
265
  };
264
- }, [U]);
265
- const [pe, se] = nt((m) => {
266
- const I = H().filter((S) => !S.disabled), N = I.find((S) => S.ref.current === document.activeElement), x = rt(I, m, N);
266
+ }, [F]);
267
+ const [pe, se] = nt((f) => {
268
+ const I = H().filter((S) => !S.disabled), N = I.find((S) => S.ref.current === document.activeElement), x = rt(I, f, N);
267
269
  x && setTimeout(() => x.ref.current.focus());
268
270
  }), fe = t.useCallback(
269
- (m, I, N) => {
270
- const x = !F.current && !N;
271
- (d.value !== void 0 && d.value === I || x) && (K(m), x && (F.current = !0));
271
+ (f, I, N) => {
272
+ const x = !W.current && !N;
273
+ (d.value !== void 0 && d.value === I || x) && (K(f), x && (W.current = !0));
272
274
  },
273
275
  [d.value]
274
- ), me = t.useCallback(() => h == null ? void 0 : h.focus(), [h]), Q = t.useCallback(
275
- (m, I, N) => {
276
- const x = !F.current && !N;
277
- (d.value !== void 0 && d.value === I || x) && B(m);
276
+ ), me = t.useCallback(() => h == null ? void 0 : h.focus(), [h]), ee = t.useCallback(
277
+ (f, I, N) => {
278
+ const x = !W.current && !N;
279
+ (d.value !== void 0 && d.value === I || x) && V(f);
278
280
  },
279
281
  [d.value]
280
- ), le = c === "popper" ? Se : We, oe = le === Se ? {
282
+ ), le = i === "popper" ? Se : Ue, ne = le === Se ? {
281
283
  side: s,
282
284
  sideOffset: o,
283
285
  align: p,
@@ -289,55 +291,55 @@ var D = 10, [Be, q] = ee(J), Nt = "SelectContentImpl", Mt = vt("SelectContent.Re
289
291
  hideWhenDetached: a,
290
292
  avoidCollisions: v
291
293
  } : {};
292
- return /* @__PURE__ */ f(
293
- Be,
294
+ return /* @__PURE__ */ m(
295
+ Ve,
294
296
  {
295
297
  scope: e,
296
298
  content: h,
297
299
  viewport: O,
298
- onViewportChange: te,
300
+ onViewportChange: oe,
299
301
  itemRefCallback: fe,
300
302
  selectedItem: L,
301
303
  onItemLeave: me,
302
- itemTextRefCallback: Q,
304
+ itemTextRefCallback: ee,
303
305
  focusSelectedItem: k,
304
306
  selectedItemText: X,
305
- position: c,
307
+ position: i,
306
308
  isPositioned: G,
307
309
  searchRef: pe,
308
- children: /* @__PURE__ */ f(yt, { as: Mt, allowPinchZoom: !0, children: /* @__PURE__ */ f(
310
+ children: /* @__PURE__ */ m(yt, { as: Mt, allowPinchZoom: !0, children: /* @__PURE__ */ m(
309
311
  dt,
310
312
  {
311
313
  asChild: !0,
312
314
  trapped: d.open,
313
- onMountAutoFocus: (m) => {
314
- m.preventDefault();
315
+ onMountAutoFocus: (f) => {
316
+ f.preventDefault();
315
317
  },
316
- onUnmountAutoFocus: b(l, (m) => {
318
+ onUnmountAutoFocus: E(l, (f) => {
317
319
  var I;
318
- (I = d.trigger) == null || I.focus({ preventScroll: !0 }), m.preventDefault();
320
+ (I = d.trigger) == null || I.focus({ preventScroll: !0 }), f.preventDefault();
319
321
  }),
320
- children: /* @__PURE__ */ f(
322
+ children: /* @__PURE__ */ m(
321
323
  it,
322
324
  {
323
325
  asChild: !0,
324
326
  disableOutsidePointerEvents: !0,
325
327
  onEscapeKeyDown: u,
326
328
  onPointerDownOutside: r,
327
- onFocusOutside: (m) => m.preventDefault(),
329
+ onFocusOutside: (f) => f.preventDefault(),
328
330
  onDismiss: () => d.onOpenChange(!1),
329
- children: /* @__PURE__ */ f(
331
+ children: /* @__PURE__ */ m(
330
332
  le,
331
333
  {
332
334
  role: "listbox",
333
335
  id: d.contentId,
334
336
  "data-state": d.open ? "open" : "closed",
335
337
  dir: d.dir,
336
- onContextMenu: (m) => m.preventDefault(),
338
+ onContextMenu: (f) => f.preventDefault(),
337
339
  ...y,
338
- ...oe,
339
- onPlaced: () => W(!0),
340
- ref: E,
340
+ ...ne,
341
+ onPlaced: () => U(!0),
342
+ ref: b,
341
343
  style: {
342
344
  // flex layout so we can place the scroll buttons properly
343
345
  display: "flex",
@@ -346,15 +348,15 @@ var D = 10, [Be, q] = ee(J), Nt = "SelectContentImpl", Mt = vt("SelectContent.Re
346
348
  outline: "none",
347
349
  ...y.style
348
350
  },
349
- onKeyDown: b(y.onKeyDown, (m) => {
350
- const I = m.ctrlKey || m.altKey || m.metaKey;
351
- if (m.key === "Tab" && m.preventDefault(), !I && m.key.length === 1 && se(m.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(m.key)) {
351
+ onKeyDown: E(y.onKeyDown, (f) => {
352
+ const I = f.ctrlKey || f.altKey || f.metaKey;
353
+ if (f.key === "Tab" && f.preventDefault(), !I && f.key.length === 1 && se(f.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(f.key)) {
352
354
  let x = H().filter((S) => !S.disabled).map((S) => S.ref.current);
353
- if (["ArrowUp", "End"].includes(m.key) && (x = x.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(m.key)) {
354
- const S = m.target, w = x.indexOf(S);
355
+ if (["ArrowUp", "End"].includes(f.key) && (x = x.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(f.key)) {
356
+ const S = f.target, w = x.indexOf(S);
355
357
  x = x.slice(w + 1);
356
358
  }
357
- setTimeout(() => _(x)), m.preventDefault();
359
+ setTimeout(() => _(x)), f.preventDefault();
358
360
  }
359
361
  })
360
362
  }
@@ -368,12 +370,12 @@ var D = 10, [Be, q] = ee(J), Nt = "SelectContentImpl", Mt = vt("SelectContent.Re
368
370
  }
369
371
  );
370
372
  He.displayName = Nt;
371
- var At = "SelectItemAlignedPosition", We = t.forwardRef((n, i) => {
372
- const { __scopeSelect: e, onPlaced: c, ...l } = n, u = Y(J, e), r = q(J, e), [s, o] = t.useState(null), [p, g] = t.useState(null), C = V(i, (E) => g(E)), P = de(e), R = t.useRef(!1), T = t.useRef(!0), { viewport: a, selectedItem: v, selectedItemText: y, focusSelectedItem: d } = r, h = t.useCallback(() => {
373
+ var At = "SelectItemAlignedPosition", Ue = t.forwardRef((n, c) => {
374
+ const { __scopeSelect: e, onPlaced: i, ...l } = n, u = j(Q, e), r = q(Q, e), [s, o] = t.useState(null), [p, g] = t.useState(null), C = B(c, (b) => g(b)), P = de(e), R = t.useRef(!1), T = t.useRef(!0), { viewport: a, selectedItem: v, selectedItemText: y, focusSelectedItem: d } = r, h = t.useCallback(() => {
373
375
  if (u.trigger && u.valueNode && s && p && a && v && y) {
374
- const E = u.trigger.getBoundingClientRect(), L = p.getBoundingClientRect(), K = u.valueNode.getBoundingClientRect(), X = y.getBoundingClientRect();
376
+ const b = u.trigger.getBoundingClientRect(), L = p.getBoundingClientRect(), K = u.valueNode.getBoundingClientRect(), X = y.getBoundingClientRect();
375
377
  if (u.dir !== "rtl") {
376
- const S = X.left - L.left, w = K.left - S, Z = E.left - w, $ = E.width + Z, he = Math.max($, L.width), ve = window.innerWidth - D, ge = Re(w, [
378
+ const S = X.left - L.left, w = K.left - S, Z = b.left - w, $ = b.width + Z, he = Math.max($, L.width), ve = window.innerWidth - D, ge = Re(w, [
377
379
  D,
378
380
  // Prevents the content from going off the starting edge of the
379
381
  // viewport. It may still go off the ending edge, but this can be
@@ -384,33 +386,33 @@ var At = "SelectItemAlignedPosition", We = t.forwardRef((n, i) => {
384
386
  ]);
385
387
  s.style.minWidth = $ + "px", s.style.left = ge + "px";
386
388
  } else {
387
- const S = L.right - X.right, w = window.innerWidth - K.right - S, Z = window.innerWidth - E.right - w, $ = E.width + Z, he = Math.max($, L.width), ve = window.innerWidth - D, ge = Re(w, [
389
+ const S = L.right - X.right, w = window.innerWidth - K.right - S, Z = window.innerWidth - b.right - w, $ = b.width + Z, he = Math.max($, L.width), ve = window.innerWidth - D, ge = Re(w, [
388
390
  D,
389
391
  Math.max(D, ve - he)
390
392
  ]);
391
393
  s.style.minWidth = $ + "px", s.style.right = ge + "px";
392
394
  }
393
- const B = P(), H = window.innerHeight - D * 2, G = a.scrollHeight, W = window.getComputedStyle(p), F = parseInt(W.borderTopWidth, 10), _ = parseInt(W.paddingTop, 10), k = parseInt(W.borderBottomWidth, 10), U = parseInt(W.paddingBottom, 10), z = F + _ + G + U + k, pe = Math.min(v.offsetHeight * 5, z), se = window.getComputedStyle(a), fe = parseInt(se.paddingTop, 10), me = parseInt(se.paddingBottom, 10), Q = E.top + E.height / 2 - D, le = H - Q, oe = v.offsetHeight / 2, m = v.offsetTop + oe, I = F + _ + m, N = z - I;
394
- if (I <= Q) {
395
- const S = B.length > 0 && v === B[B.length - 1].ref.current;
395
+ const V = P(), H = window.innerHeight - D * 2, G = a.scrollHeight, U = window.getComputedStyle(p), W = parseInt(U.borderTopWidth, 10), _ = parseInt(U.paddingTop, 10), k = parseInt(U.borderBottomWidth, 10), F = parseInt(U.paddingBottom, 10), z = W + _ + G + F + k, pe = Math.min(v.offsetHeight * 5, z), se = window.getComputedStyle(a), fe = parseInt(se.paddingTop, 10), me = parseInt(se.paddingBottom, 10), ee = b.top + b.height / 2 - D, le = H - ee, ne = v.offsetHeight / 2, f = v.offsetTop + ne, I = W + _ + f, N = z - I;
396
+ if (I <= ee) {
397
+ const S = V.length > 0 && v === V[V.length - 1].ref.current;
396
398
  s.style.bottom = "0px";
397
399
  const w = p.clientHeight - a.offsetTop - a.offsetHeight, Z = Math.max(
398
400
  le,
399
- oe + // viewport might have padding bottom, include it to avoid a scrollable viewport
401
+ ne + // viewport might have padding bottom, include it to avoid a scrollable viewport
400
402
  (S ? me : 0) + w + k
401
403
  ), $ = I + Z;
402
404
  s.style.height = $ + "px";
403
405
  } else {
404
- const S = B.length > 0 && v === B[0].ref.current;
406
+ const S = V.length > 0 && v === V[0].ref.current;
405
407
  s.style.top = "0px";
406
408
  const Z = Math.max(
407
- Q,
408
- F + a.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
409
- (S ? fe : 0) + oe
409
+ ee,
410
+ W + a.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
411
+ (S ? fe : 0) + ne
410
412
  ) + N;
411
- s.style.height = Z + "px", a.scrollTop = I - Q + a.offsetTop;
413
+ s.style.height = Z + "px", a.scrollTop = I - ee + a.offsetTop;
412
414
  }
413
- s.style.margin = `${D}px 0`, s.style.minHeight = pe + "px", s.style.maxHeight = H + "px", c == null || c(), requestAnimationFrame(() => R.current = !0);
415
+ s.style.margin = `${D}px 0`, s.style.minHeight = pe + "px", s.style.maxHeight = H + "px", i == null || i(), requestAnimationFrame(() => R.current = !0);
414
416
  }
415
417
  }, [
416
418
  P,
@@ -422,27 +424,27 @@ var At = "SelectItemAlignedPosition", We = t.forwardRef((n, i) => {
422
424
  v,
423
425
  y,
424
426
  u.dir,
425
- c
427
+ i
426
428
  ]);
427
- j(() => h(), [h]);
429
+ Y(() => h(), [h]);
428
430
  const [A, O] = t.useState();
429
- j(() => {
431
+ Y(() => {
430
432
  p && O(window.getComputedStyle(p).zIndex);
431
433
  }, [p]);
432
- const te = t.useCallback(
433
- (E) => {
434
- E && T.current === !0 && (h(), d == null || d(), T.current = !1);
434
+ const oe = t.useCallback(
435
+ (b) => {
436
+ b && T.current === !0 && (h(), d == null || d(), T.current = !1);
435
437
  },
436
438
  [h, d]
437
439
  );
438
- return /* @__PURE__ */ f(
440
+ return /* @__PURE__ */ m(
439
441
  Dt,
440
442
  {
441
443
  scope: e,
442
444
  contentWrapper: s,
443
445
  shouldExpandOnScrollRef: R,
444
- onScrollButtonChange: te,
445
- children: /* @__PURE__ */ f(
446
+ onScrollButtonChange: oe,
447
+ children: /* @__PURE__ */ m(
446
448
  "div",
447
449
  {
448
450
  ref: o,
@@ -452,7 +454,7 @@ var At = "SelectItemAlignedPosition", We = t.forwardRef((n, i) => {
452
454
  position: "fixed",
453
455
  zIndex: A
454
456
  },
455
- children: /* @__PURE__ */ f(
457
+ children: /* @__PURE__ */ m(
456
458
  M.div,
457
459
  {
458
460
  ...l,
@@ -472,21 +474,21 @@ var At = "SelectItemAlignedPosition", We = t.forwardRef((n, i) => {
472
474
  }
473
475
  );
474
476
  });
475
- We.displayName = At;
476
- var Ot = "SelectPopperPosition", Se = t.forwardRef((n, i) => {
477
+ Ue.displayName = At;
478
+ var Ot = "SelectPopperPosition", Se = t.forwardRef((n, c) => {
477
479
  const {
478
480
  __scopeSelect: e,
479
- align: c = "start",
481
+ align: i = "start",
480
482
  collisionPadding: l = D,
481
483
  ...u
482
484
  } = n, r = ue(e);
483
- return /* @__PURE__ */ f(
485
+ return /* @__PURE__ */ m(
484
486
  ft,
485
487
  {
486
488
  ...r,
487
489
  ...u,
488
- ref: i,
489
- align: c,
490
+ ref: c,
491
+ align: i,
490
492
  collisionPadding: l,
491
493
  style: {
492
494
  // Ensure border-box for floating-ui calculations
@@ -502,20 +504,20 @@ var Ot = "SelectPopperPosition", Se = t.forwardRef((n, i) => {
502
504
  );
503
505
  });
504
506
  Se.displayName = Ot;
505
- var [Dt, Pe] = ee(J, {}), we = "SelectViewport", Fe = t.forwardRef(
506
- (n, i) => {
507
- const { __scopeSelect: e, nonce: c, ...l } = n, u = q(we, e), r = Pe(we, e), s = V(i, u.onViewportChange), o = t.useRef(0);
507
+ var [Dt, Pe] = te(Q, {}), we = "SelectViewport", We = t.forwardRef(
508
+ (n, c) => {
509
+ const { __scopeSelect: e, nonce: i, ...l } = n, u = q(we, e), r = Pe(we, e), s = B(c, u.onViewportChange), o = t.useRef(0);
508
510
  return /* @__PURE__ */ ce(Te, { children: [
509
- /* @__PURE__ */ f(
511
+ /* @__PURE__ */ m(
510
512
  "style",
511
513
  {
512
514
  dangerouslySetInnerHTML: {
513
515
  __html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
514
516
  },
515
- nonce: c
517
+ nonce: i
516
518
  }
517
519
  ),
518
- /* @__PURE__ */ f(ae.Slot, { scope: e, children: /* @__PURE__ */ f(
520
+ /* @__PURE__ */ m(ae.Slot, { scope: e, children: /* @__PURE__ */ m(
519
521
  M.div,
520
522
  {
521
523
  "data-radix-select-viewport": "",
@@ -535,7 +537,7 @@ var [Dt, Pe] = ee(J, {}), we = "SelectViewport", Fe = t.forwardRef(
535
537
  overflow: "hidden auto",
536
538
  ...l.style
537
539
  },
538
- onScroll: b(l.onScroll, (p) => {
540
+ onScroll: E(l.onScroll, (p) => {
539
541
  const g = p.currentTarget, { contentWrapper: C, shouldExpandOnScrollRef: P } = r;
540
542
  if (P != null && P.current && C) {
541
543
  const R = Math.abs(o.current - g.scrollTop);
@@ -554,61 +556,61 @@ var [Dt, Pe] = ee(J, {}), we = "SelectViewport", Fe = t.forwardRef(
554
556
  ] });
555
557
  }
556
558
  );
557
- Fe.displayName = we;
558
- var Ue = "SelectGroup", [Lt, kt] = ee(Ue), Ke = t.forwardRef(
559
- (n, i) => {
560
- const { __scopeSelect: e, ...c } = n, l = Ie();
561
- return /* @__PURE__ */ f(Lt, { scope: e, id: l, children: /* @__PURE__ */ f(M.div, { role: "group", "aria-labelledby": l, ...c, ref: i }) });
559
+ We.displayName = we;
560
+ var Fe = "SelectGroup", [Lt, kt] = te(Fe), Ke = t.forwardRef(
561
+ (n, c) => {
562
+ const { __scopeSelect: e, ...i } = n, l = Ie();
563
+ return /* @__PURE__ */ m(Lt, { scope: e, id: l, children: /* @__PURE__ */ m(M.div, { role: "group", "aria-labelledby": l, ...i, ref: c }) });
562
564
  }
563
565
  );
564
- Ke.displayName = Ue;
566
+ Ke.displayName = Fe;
565
567
  var Ge = "SelectLabel", ze = t.forwardRef(
566
- (n, i) => {
567
- const { __scopeSelect: e, ...c } = n, l = kt(Ge, e);
568
- return /* @__PURE__ */ f(M.div, { id: l.id, ...c, ref: i });
568
+ (n, c) => {
569
+ const { __scopeSelect: e, ...i } = n, l = kt(Ge, e);
570
+ return /* @__PURE__ */ m(M.div, { id: l.id, ...i, ref: c });
569
571
  }
570
572
  );
571
573
  ze.displayName = Ge;
572
- var ie = "SelectItem", [Vt, je] = ee(ie), Ye = t.forwardRef(
573
- (n, i) => {
574
+ var ie = "SelectItem", [Bt, Ye] = te(ie), je = t.forwardRef(
575
+ (n, c) => {
574
576
  const {
575
577
  __scopeSelect: e,
576
- value: c,
578
+ value: i,
577
579
  disabled: l = !1,
578
580
  textValue: u,
579
581
  ...r
580
- } = n, s = Y(ie, e), o = q(ie, e), p = s.value === c, [g, C] = t.useState(u ?? ""), [P, R] = t.useState(!1), T = V(
581
- i,
582
+ } = n, s = j(ie, e), o = q(ie, e), p = s.value === i, [g, C] = t.useState(u ?? ""), [P, R] = t.useState(!1), T = B(
583
+ c,
582
584
  (d) => {
583
585
  var h;
584
- return (h = o.itemRefCallback) == null ? void 0 : h.call(o, d, c, l);
586
+ return (h = o.itemRefCallback) == null ? void 0 : h.call(o, d, i, l);
585
587
  }
586
588
  ), a = Ie(), v = t.useRef("touch"), y = () => {
587
- l || (s.onValueChange(c), s.onOpenChange(!1));
589
+ l || (s.onValueChange(i), s.onOpenChange(!1));
588
590
  };
589
- if (c === "")
591
+ if (i === "")
590
592
  throw new Error(
591
593
  "A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder."
592
594
  );
593
- return /* @__PURE__ */ f(
594
- Vt,
595
+ return /* @__PURE__ */ m(
596
+ Bt,
595
597
  {
596
598
  scope: e,
597
- value: c,
599
+ value: i,
598
600
  disabled: l,
599
601
  textId: a,
600
602
  isSelected: p,
601
603
  onItemTextChange: t.useCallback((d) => {
602
604
  C((h) => h || ((d == null ? void 0 : d.textContent) ?? "").trim());
603
605
  }, []),
604
- children: /* @__PURE__ */ f(
606
+ children: /* @__PURE__ */ m(
605
607
  ae.ItemSlot,
606
608
  {
607
609
  scope: e,
608
- value: c,
610
+ value: i,
609
611
  disabled: l,
610
612
  textValue: g,
611
- children: /* @__PURE__ */ f(
613
+ children: /* @__PURE__ */ m(
612
614
  M.div,
613
615
  {
614
616
  role: "option",
@@ -621,26 +623,26 @@ var ie = "SelectItem", [Vt, je] = ee(ie), Ye = t.forwardRef(
621
623
  tabIndex: l ? void 0 : -1,
622
624
  ...r,
623
625
  ref: T,
624
- onFocus: b(r.onFocus, () => R(!0)),
625
- onBlur: b(r.onBlur, () => R(!1)),
626
- onClick: b(r.onClick, () => {
626
+ onFocus: E(r.onFocus, () => R(!0)),
627
+ onBlur: E(r.onBlur, () => R(!1)),
628
+ onClick: E(r.onClick, () => {
627
629
  v.current !== "mouse" && y();
628
630
  }),
629
- onPointerUp: b(r.onPointerUp, () => {
631
+ onPointerUp: E(r.onPointerUp, () => {
630
632
  v.current === "mouse" && y();
631
633
  }),
632
- onPointerDown: b(r.onPointerDown, (d) => {
634
+ onPointerDown: E(r.onPointerDown, (d) => {
633
635
  v.current = d.pointerType;
634
636
  }),
635
- onPointerMove: b(r.onPointerMove, (d) => {
637
+ onPointerMove: E(r.onPointerMove, (d) => {
636
638
  var h;
637
639
  v.current = d.pointerType, l ? (h = o.onItemLeave) == null || h.call(o) : v.current === "mouse" && d.currentTarget.focus({ preventScroll: !0 });
638
640
  }),
639
- onPointerLeave: b(r.onPointerLeave, (d) => {
641
+ onPointerLeave: E(r.onPointerLeave, (d) => {
640
642
  var h;
641
643
  d.currentTarget === document.activeElement && ((h = o.onItemLeave) == null || h.call(o));
642
644
  }),
643
- onKeyDown: b(r.onKeyDown, (d) => {
645
+ onKeyDown: E(r.onKeyDown, (d) => {
644
646
  var A;
645
647
  ((A = o.searchRef) == null ? void 0 : A.current) !== "" && d.key === " " || (It.includes(d.key) && y(), d.key === " " && d.preventDefault());
646
648
  })
@@ -652,11 +654,11 @@ var ie = "SelectItem", [Vt, je] = ee(ie), Ye = t.forwardRef(
652
654
  );
653
655
  }
654
656
  );
655
- Ye.displayName = ie;
656
- var ne = "SelectItemText", qe = t.forwardRef(
657
- (n, i) => {
658
- const { __scopeSelect: e, className: c, style: l, ...u } = n, r = Y(ne, e), s = q(ne, e), o = je(ne, e), p = bt(ne, e), [g, C] = t.useState(null), P = V(
659
- i,
657
+ je.displayName = ie;
658
+ var re = "SelectItemText", qe = t.forwardRef(
659
+ (n, c) => {
660
+ const { __scopeSelect: e, className: i, style: l, ...u } = n, r = j(re, e), s = q(re, e), o = Ye(re, e), p = Et(re, e), [g, C] = t.useState(null), P = B(
661
+ c,
660
662
  (y) => C(y),
661
663
  o.onItemTextChange,
662
664
  (y) => {
@@ -664,26 +666,26 @@ var ne = "SelectItemText", qe = t.forwardRef(
664
666
  return (d = s.itemTextRefCallback) == null ? void 0 : d.call(s, y, o.value, o.disabled);
665
667
  }
666
668
  ), R = g == null ? void 0 : g.textContent, T = t.useMemo(
667
- () => /* @__PURE__ */ f("option", { value: o.value, disabled: o.disabled, children: R }, o.value),
669
+ () => /* @__PURE__ */ m("option", { value: o.value, disabled: o.disabled, children: R }, o.value),
668
670
  [o.disabled, o.value, R]
669
671
  ), { onNativeOptionAdd: a, onNativeOptionRemove: v } = p;
670
- return j(() => (a(T), () => v(T)), [a, v, T]), /* @__PURE__ */ ce(Te, { children: [
671
- /* @__PURE__ */ f(M.span, { id: o.textId, ...u, ref: P }),
672
- o.isSelected && r.valueNode && !r.valueNodeHasChildren ? Ee.createPortal(u.children, r.valueNode) : null
672
+ return Y(() => (a(T), () => v(T)), [a, v, T]), /* @__PURE__ */ ce(Te, { children: [
673
+ /* @__PURE__ */ m(M.span, { id: o.textId, ...u, ref: P }),
674
+ o.isSelected && r.valueNode && !r.valueNodeHasChildren ? be.createPortal(u.children, r.valueNode) : null
673
675
  ] });
674
676
  }
675
677
  );
676
- qe.displayName = ne;
678
+ qe.displayName = re;
677
679
  var Xe = "SelectItemIndicator", Ze = t.forwardRef(
678
- (n, i) => {
679
- const { __scopeSelect: e, ...c } = n;
680
- return je(Xe, e).isSelected ? /* @__PURE__ */ f(M.span, { "aria-hidden": !0, ...c, ref: i }) : null;
680
+ (n, c) => {
681
+ const { __scopeSelect: e, ...i } = n;
682
+ return Ye(Xe, e).isSelected ? /* @__PURE__ */ m(M.span, { "aria-hidden": !0, ...i, ref: c }) : null;
681
683
  }
682
684
  );
683
685
  Ze.displayName = Xe;
684
- var Ce = "SelectScrollUpButton", $e = t.forwardRef((n, i) => {
685
- const e = q(Ce, n.__scopeSelect), c = Pe(Ce, n.__scopeSelect), [l, u] = t.useState(!1), r = V(i, c.onScrollButtonChange);
686
- return j(() => {
686
+ var Ce = "SelectScrollUpButton", $e = t.forwardRef((n, c) => {
687
+ const e = q(Ce, n.__scopeSelect), i = Pe(Ce, n.__scopeSelect), [l, u] = t.useState(!1), r = B(c, i.onScrollButtonChange);
688
+ return Y(() => {
687
689
  if (e.viewport && e.isPositioned) {
688
690
  let s = function() {
689
691
  const p = o.scrollTop > 0;
@@ -692,7 +694,7 @@ var Ce = "SelectScrollUpButton", $e = t.forwardRef((n, i) => {
692
694
  const o = e.viewport;
693
695
  return s(), o.addEventListener("scroll", s), () => o.removeEventListener("scroll", s);
694
696
  }
695
- }, [e.viewport, e.isPositioned]), l ? /* @__PURE__ */ f(
697
+ }, [e.viewport, e.isPositioned]), l ? /* @__PURE__ */ m(
696
698
  Qe,
697
699
  {
698
700
  ...n,
@@ -705,9 +707,9 @@ var Ce = "SelectScrollUpButton", $e = t.forwardRef((n, i) => {
705
707
  ) : null;
706
708
  });
707
709
  $e.displayName = Ce;
708
- var ye = "SelectScrollDownButton", Je = t.forwardRef((n, i) => {
709
- const e = q(ye, n.__scopeSelect), c = Pe(ye, n.__scopeSelect), [l, u] = t.useState(!1), r = V(i, c.onScrollButtonChange);
710
- return j(() => {
710
+ var ye = "SelectScrollDownButton", Je = t.forwardRef((n, c) => {
711
+ const e = q(ye, n.__scopeSelect), i = Pe(ye, n.__scopeSelect), [l, u] = t.useState(!1), r = B(c, i.onScrollButtonChange);
712
+ return Y(() => {
711
713
  if (e.viewport && e.isPositioned) {
712
714
  let s = function() {
713
715
  const p = o.scrollHeight - o.clientHeight, g = Math.ceil(o.scrollTop) < p;
@@ -716,7 +718,7 @@ var ye = "SelectScrollDownButton", Je = t.forwardRef((n, i) => {
716
718
  const o = e.viewport;
717
719
  return s(), o.addEventListener("scroll", s), () => o.removeEventListener("scroll", s);
718
720
  }
719
- }, [e.viewport, e.isPositioned]), l ? /* @__PURE__ */ f(
721
+ }, [e.viewport, e.isPositioned]), l ? /* @__PURE__ */ m(
720
722
  Qe,
721
723
  {
722
724
  ...n,
@@ -729,82 +731,92 @@ var ye = "SelectScrollDownButton", Je = t.forwardRef((n, i) => {
729
731
  ) : null;
730
732
  });
731
733
  Je.displayName = ye;
732
- var Qe = t.forwardRef((n, i) => {
733
- const { __scopeSelect: e, onAutoScroll: c, ...l } = n, u = q("SelectScrollButton", e), r = t.useRef(null), s = de(e), o = t.useCallback(() => {
734
+ var Qe = t.forwardRef((n, c) => {
735
+ const { __scopeSelect: e, onAutoScroll: i, ...l } = n, u = q("SelectScrollButton", e), r = t.useRef(null), s = de(e), o = t.useCallback(() => {
734
736
  r.current !== null && (window.clearInterval(r.current), r.current = null);
735
737
  }, []);
736
- return t.useEffect(() => () => o(), [o]), j(() => {
738
+ return t.useEffect(() => () => o(), [o]), Y(() => {
737
739
  var g;
738
740
  const p = s().find((C) => C.ref.current === document.activeElement);
739
741
  (g = p == null ? void 0 : p.ref.current) == null || g.scrollIntoView({ block: "nearest" });
740
- }, [s]), /* @__PURE__ */ f(
742
+ }, [s]), /* @__PURE__ */ m(
741
743
  M.div,
742
744
  {
743
745
  "aria-hidden": !0,
744
746
  ...l,
745
- ref: i,
747
+ ref: c,
746
748
  style: { flexShrink: 0, ...l.style },
747
- onPointerDown: b(l.onPointerDown, () => {
748
- r.current === null && (r.current = window.setInterval(c, 50));
749
+ onPointerDown: E(l.onPointerDown, () => {
750
+ r.current === null && (r.current = window.setInterval(i, 50));
749
751
  }),
750
- onPointerMove: b(l.onPointerMove, () => {
752
+ onPointerMove: E(l.onPointerMove, () => {
751
753
  var p;
752
- (p = u.onItemLeave) == null || p.call(u), r.current === null && (r.current = window.setInterval(c, 50));
754
+ (p = u.onItemLeave) == null || p.call(u), r.current === null && (r.current = window.setInterval(i, 50));
753
755
  }),
754
- onPointerLeave: b(l.onPointerLeave, () => {
756
+ onPointerLeave: E(l.onPointerLeave, () => {
755
757
  o();
756
758
  })
757
759
  }
758
760
  );
759
- }), Bt = "SelectSeparator", et = t.forwardRef(
760
- (n, i) => {
761
- const { __scopeSelect: e, ...c } = n;
762
- return /* @__PURE__ */ f(M.div, { "aria-hidden": !0, ...c, ref: i });
761
+ }), Vt = "SelectSeparator", et = t.forwardRef(
762
+ (n, c) => {
763
+ const { __scopeSelect: e, ...i } = n;
764
+ return /* @__PURE__ */ m(M.div, { "aria-hidden": !0, ...i, ref: c });
763
765
  }
764
766
  );
765
- et.displayName = Bt;
767
+ et.displayName = Vt;
766
768
  var xe = "SelectArrow", Ht = t.forwardRef(
767
- (n, i) => {
768
- const { __scopeSelect: e, ...c } = n, l = ue(e), u = Y(xe, e), r = q(xe, e);
769
- return u.open && r.position === "popper" ? /* @__PURE__ */ f(mt, { ...l, ...c, ref: i }) : null;
769
+ (n, c) => {
770
+ const { __scopeSelect: e, ...i } = n, l = ue(e), u = j(xe, e), r = q(xe, e);
771
+ return u.open && r.position === "popper" ? /* @__PURE__ */ m(mt, { ...l, ...i, ref: c }) : null;
770
772
  }
771
773
  );
772
774
  Ht.displayName = xe;
773
- function tt(n) {
774
- return n === "" || n === void 0;
775
- }
776
- var ot = t.forwardRef(
777
- (n, i) => {
778
- const { value: e, ...c } = n, l = t.useRef(null), u = V(i, l), r = St(e);
775
+ var Ut = "SelectBubbleInput", tt = t.forwardRef(
776
+ ({ __scopeSelect: n, value: c, ...e }, i) => {
777
+ const l = t.useRef(null), u = B(i, l), r = St(c);
779
778
  return t.useEffect(() => {
780
- const s = l.current, o = window.HTMLSelectElement.prototype, g = Object.getOwnPropertyDescriptor(
779
+ const s = l.current;
780
+ if (!s) return;
781
+ const o = window.HTMLSelectElement.prototype, g = Object.getOwnPropertyDescriptor(
781
782
  o,
782
783
  "value"
783
784
  ).set;
784
- if (r !== e && g) {
785
+ if (r !== c && g) {
785
786
  const C = new Event("change", { bubbles: !0 });
786
- g.call(s, e), s.dispatchEvent(C);
787
+ g.call(s, c), s.dispatchEvent(C);
788
+ }
789
+ }, [r, c]), /* @__PURE__ */ m(
790
+ M.select,
791
+ {
792
+ ...e,
793
+ style: { ...wt, ...e.style },
794
+ ref: u,
795
+ defaultValue: c
787
796
  }
788
- }, [r, e]), /* @__PURE__ */ f(wt, { asChild: !0, children: /* @__PURE__ */ f("select", { ...c, ref: u, defaultValue: e }) });
797
+ );
789
798
  }
790
799
  );
791
- ot.displayName = "BubbleSelect";
800
+ tt.displayName = Ut;
801
+ function ot(n) {
802
+ return n === "" || n === void 0;
803
+ }
792
804
  function nt(n) {
793
- const i = gt(n), e = t.useRef(""), c = t.useRef(0), l = t.useCallback(
805
+ const c = gt(n), e = t.useRef(""), i = t.useRef(0), l = t.useCallback(
794
806
  (r) => {
795
807
  const s = e.current + r;
796
- i(s), function o(p) {
797
- e.current = p, window.clearTimeout(c.current), p !== "" && (c.current = window.setTimeout(() => o(""), 1e3));
808
+ c(s), function o(p) {
809
+ e.current = p, window.clearTimeout(i.current), p !== "" && (i.current = window.setTimeout(() => o(""), 1e3));
798
810
  }(s);
799
811
  },
800
- [i]
812
+ [c]
801
813
  ), u = t.useCallback(() => {
802
- e.current = "", window.clearTimeout(c.current);
814
+ e.current = "", window.clearTimeout(i.current);
803
815
  }, []);
804
- return t.useEffect(() => () => window.clearTimeout(c.current), []), [e, l, u];
816
+ return t.useEffect(() => () => window.clearTimeout(i.current), []), [e, l, u];
805
817
  }
806
- function rt(n, i, e) {
807
- const l = i.length > 1 && Array.from(i).every((p) => p === i[0]) ? i[0] : i, u = e ? n.indexOf(e) : -1;
818
+ function rt(n, c, e) {
819
+ const l = c.length > 1 && Array.from(c).every((p) => p === c[0]) ? c[0] : c, u = e ? n.indexOf(e) : -1;
808
820
  let r = Wt(n, Math.max(u, 0));
809
821
  l.length === 1 && (r = r.filter((p) => p !== e));
810
822
  const o = r.find(
@@ -812,28 +824,28 @@ function rt(n, i, e) {
812
824
  );
813
825
  return o !== e ? o : void 0;
814
826
  }
815
- function Wt(n, i) {
816
- return n.map((e, c) => n[(i + c) % n.length]);
827
+ function Wt(n, c) {
828
+ return n.map((e, i) => n[(c + i) % n.length]);
817
829
  }
818
- var uo = Ne, po = Ae, fo = De, mo = Le, ho = ke, vo = Ve, go = Fe, So = Ke, wo = ze, Co = Ye, yo = qe, xo = Ze, Io = $e, To = Je, Po = et;
830
+ var po = Ne, fo = Ae, mo = De, ho = Le, vo = ke, go = Be, So = We, wo = Ke, Co = ze, yo = je, xo = qe, Io = Ze, To = $e, Po = Je, Ro = et;
819
831
  export {
820
- vo as Content,
821
- So as Group,
822
- mo as Icon,
823
- Co as Item,
824
- xo as ItemIndicator,
825
- yo as ItemText,
826
- wo as Label,
827
- ho as Portal,
828
- uo as Root,
829
- To as ScrollDownButton,
830
- Io as ScrollUpButton,
832
+ go as Content,
833
+ wo as Group,
834
+ ho as Icon,
835
+ yo as Item,
836
+ Io as ItemIndicator,
837
+ xo as ItemText,
838
+ Co as Label,
839
+ vo as Portal,
840
+ po as Root,
841
+ Po as ScrollDownButton,
842
+ To as ScrollUpButton,
831
843
  Ne as Select,
832
844
  Ht as SelectArrow,
833
- Ve as SelectContent,
845
+ Be as SelectContent,
834
846
  Ke as SelectGroup,
835
847
  Le as SelectIcon,
836
- Ye as SelectItem,
848
+ je as SelectItem,
837
849
  Ze as SelectItemIndicator,
838
850
  qe as SelectItemText,
839
851
  ze as SelectLabel,
@@ -843,10 +855,10 @@ export {
843
855
  et as SelectSeparator,
844
856
  Ae as SelectTrigger,
845
857
  De as SelectValue,
846
- Fe as SelectViewport,
847
- Po as Separator,
848
- po as Trigger,
849
- fo as Value,
850
- go as Viewport,
851
- ao as createSelectScope
858
+ We as SelectViewport,
859
+ Ro as Separator,
860
+ fo as Trigger,
861
+ mo as Value,
862
+ So as Viewport,
863
+ uo as createSelectScope
852
864
  };