@krosoft/react 0.0.78 → 0.0.80

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 (97) hide show
  1. package/dist/{LoadingState-CqRLmkxn.js → LoadingState-DQjGcT2l.js} +5 -5
  2. package/dist/MetricCard-4VI9Ki0g.js +83 -0
  3. package/dist/SearchInput-Cf5NHhnz.js +698 -0
  4. package/dist/TableFilter-DgChe4aX.js +406 -0
  5. package/dist/TableSettings-4YLJSh4G.js +2064 -0
  6. package/dist/{ThemeSelector-sTd9T2OD.js → ThemeSelector-MqD5QvHl.js} +8 -8
  7. package/dist/{Topbar-BqC05zWP.js → Topbar-DifQ00kV.js} +26 -27
  8. package/dist/{badge-kADcbb2Y.js → badge-Bw-aBz_H.js} +1 -1
  9. package/dist/components/core/cards/KpiCard.d.ts +1 -1
  10. package/dist/components/core/cards/KpiCard.d.ts.map +1 -1
  11. package/dist/components/core/cards/MetricCard.d.ts +1 -2
  12. package/dist/components/core/cards/MetricCard.d.ts.map +1 -1
  13. package/dist/components/core/cards/index.js +1 -1
  14. package/dist/components/core/filters/ActiveFilters.d.ts +10 -0
  15. package/dist/components/core/filters/ActiveFilters.d.ts.map +1 -0
  16. package/dist/components/core/filters/AdvancedFilters.d.ts +11 -0
  17. package/dist/components/core/filters/AdvancedFilters.d.ts.map +1 -0
  18. package/dist/components/core/filters/FilterField.d.ts +11 -0
  19. package/dist/components/core/filters/FilterField.d.ts.map +1 -0
  20. package/dist/components/core/filters/SearchableFilterPill.d.ts +15 -0
  21. package/dist/components/core/filters/SearchableFilterPill.d.ts.map +1 -0
  22. package/dist/components/core/filters/TableFilter.d.ts +17 -0
  23. package/dist/components/core/filters/TableFilter.d.ts.map +1 -0
  24. package/dist/components/core/filters/index.d.ts +5 -0
  25. package/dist/components/core/filters/index.d.ts.map +1 -0
  26. package/dist/components/core/filters/index.js +7 -0
  27. package/dist/components/core/index.d.ts +2 -0
  28. package/dist/components/core/index.d.ts.map +1 -1
  29. package/dist/components/core/index.js +34 -26
  30. package/dist/components/core/inputs/DatePicker.d.ts +9 -0
  31. package/dist/components/core/inputs/DatePicker.d.ts.map +1 -0
  32. package/dist/components/core/inputs/MultiSelect.d.ts +17 -0
  33. package/dist/components/core/inputs/MultiSelect.d.ts.map +1 -0
  34. package/dist/components/core/inputs/SearchInput.d.ts.map +1 -1
  35. package/dist/components/core/inputs/SearchableSelect.d.ts +14 -0
  36. package/dist/components/core/inputs/SearchableSelect.d.ts.map +1 -0
  37. package/dist/components/core/inputs/index.d.ts +3 -1
  38. package/dist/components/core/inputs/index.d.ts.map +1 -1
  39. package/dist/components/core/inputs/index.js +6 -3
  40. package/dist/components/core/navbar/index.js +1 -1
  41. package/dist/components/core/states/index.js +1 -1
  42. package/dist/components/core/table/DataTable.d.ts +17 -2
  43. package/dist/components/core/table/DataTable.d.ts.map +1 -1
  44. package/dist/components/core/table/TableBody.d.ts +2 -2
  45. package/dist/components/core/table/TableBody.d.ts.map +1 -1
  46. package/dist/components/core/table/TableHeader.d.ts +1 -1
  47. package/dist/components/core/table/TableHeader.d.ts.map +1 -1
  48. package/dist/components/core/table/index.d.ts +1 -3
  49. package/dist/components/core/table/index.d.ts.map +1 -1
  50. package/dist/components/core/table/index.js +9 -9
  51. package/dist/components/core/theme/ThemeSelector.d.ts +2 -1
  52. package/dist/components/core/theme/ThemeSelector.d.ts.map +1 -1
  53. package/dist/components/core/theme/index.js +1 -1
  54. package/dist/components/index.js +86 -63
  55. package/dist/components/ui/badge.d.ts +1 -1
  56. package/dist/components/ui/badge.d.ts.map +1 -1
  57. package/dist/components/ui/button.d.ts.map +1 -1
  58. package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
  59. package/dist/components/ui/index.d.ts +4 -1
  60. package/dist/components/ui/index.d.ts.map +1 -1
  61. package/dist/components/ui/index.js +50 -35
  62. package/dist/components/ui/label.d.ts +6 -0
  63. package/dist/components/ui/label.d.ts.map +1 -0
  64. package/dist/components/ui/select.d.ts +1 -1
  65. package/dist/components/ui/select.d.ts.map +1 -1
  66. package/dist/components/ui/sheet.d.ts.map +1 -1
  67. package/dist/components/ui/toast.d.ts +1 -1
  68. package/dist/components/ui/toast.d.ts.map +1 -1
  69. package/dist/{floating-ui.react-dom-BPCyLQfI.js → floating-ui.react-dom-BIcsGc3t.js} +553 -526
  70. package/dist/hooks/index.js +1 -1
  71. package/dist/hooks/ui/useDataTable.d.ts +1 -1
  72. package/dist/hooks/ui/useDataTable.d.ts.map +1 -1
  73. package/dist/hooks/ui/useToast.d.ts +5 -13
  74. package/dist/hooks/ui/useToast.d.ts.map +1 -1
  75. package/dist/popover-UjRQmYGN.js +5889 -0
  76. package/dist/select-CtU681LB.js +2070 -0
  77. package/dist/tailwind/index.d.ts.map +1 -1
  78. package/dist/tooltip-DzQngJZK.js +828 -0
  79. package/dist/types/FilterFieldConfig.d.ts +16 -0
  80. package/dist/types/FilterFieldConfig.d.ts.map +1 -0
  81. package/dist/types/FilterSection.d.ts +6 -0
  82. package/dist/types/FilterSection.d.ts.map +1 -0
  83. package/dist/types/index.d.ts +0 -1
  84. package/dist/types/index.d.ts.map +1 -1
  85. package/dist/{useTheme-D__o7mLN.js → useTheme-DsHPKCDp.js} +24 -18
  86. package/package.json +4 -2
  87. package/dist/Combination-CzdDhqdB.js +0 -564
  88. package/dist/DataTable-CjFA9p4V.js +0 -2216
  89. package/dist/DateRangePicker-rrXXEYz8.js +0 -1240
  90. package/dist/MetricCard-B1Y-27_U.js +0 -78
  91. package/dist/calendar-BMReToKR.js +0 -3911
  92. package/dist/checkbox-BI6Lm_p-.js +0 -358
  93. package/dist/chevron-down-ki5-dwtL.js +0 -11
  94. package/dist/select-B-hcmC3K.js +0 -1468
  95. package/dist/tooltip-gI1Mp9DG.js +0 -779
  96. package/dist/types/DataTableProps.d.ts +0 -19
  97. package/dist/types/DataTableProps.d.ts.map +0 -1
@@ -0,0 +1,2064 @@
1
+ import { jsx as a, jsxs as _ } from "react/jsx-runtime";
2
+ import { z as tt, c as nt, B as Dn } from "./popover-UjRQmYGN.js";
3
+ import { a as Oe, q as pe, u as O, d as Tn, e as N, f as V, g as On, h as kn, o as Fn, s as Ln, l as $n, i as Un, j as Kn, k as Gn, m as Bn, n as zn, p as de, r as Ie, t as rt, B as re } from "./floating-ui.react-dom-BIcsGc3t.js";
4
+ import "./card-7XPLAra3.js";
5
+ import { u as ot, j as Wn, R as jn, k as Vn, C as Hn } from "./select-CtU681LB.js";
6
+ import { c as Z } from "./createLucideIcon-CRdjzt2A.js";
7
+ import { L as Yn } from "./loader-circle-BhJXKs31.js";
8
+ import * as s from "react";
9
+ import q from "react";
10
+ import * as Xn from "react-dom";
11
+ import qn from "react-dom";
12
+ import { c as H } from "./index-gWiv5-6R.js";
13
+ /**
14
+ * @license lucide-react v1.16.0 - ISC
15
+ *
16
+ * This source code is licensed under the ISC license.
17
+ * See the LICENSE file in the root directory of this source tree.
18
+ */
19
+ const Zn = [
20
+ ["path", { d: "M12 5v14", key: "s699le" }],
21
+ ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
22
+ ], Jn = Z("arrow-down", Zn);
23
+ /**
24
+ * @license lucide-react v1.16.0 - ISC
25
+ *
26
+ * This source code is licensed under the ISC license.
27
+ * See the LICENSE file in the root directory of this source tree.
28
+ */
29
+ const Qn = [
30
+ ["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
31
+ ["path", { d: "M17 20V4", key: "1ejh1v" }],
32
+ ["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
33
+ ["path", { d: "M7 4v16", key: "1glfcx" }]
34
+ ], er = Z("arrow-up-down", Qn);
35
+ /**
36
+ * @license lucide-react v1.16.0 - ISC
37
+ *
38
+ * This source code is licensed under the ISC license.
39
+ * See the LICENSE file in the root directory of this source tree.
40
+ */
41
+ const tr = [
42
+ ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
43
+ ["path", { d: "M12 19V5", key: "x0mq9r" }]
44
+ ], nr = Z("arrow-up", tr);
45
+ /**
46
+ * @license lucide-react v1.16.0 - ISC
47
+ *
48
+ * This source code is licensed under the ISC license.
49
+ * See the LICENSE file in the root directory of this source tree.
50
+ */
51
+ const rr = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]], or = Z("circle", rr);
52
+ /**
53
+ * @license lucide-react v1.16.0 - ISC
54
+ *
55
+ * This source code is licensed under the ISC license.
56
+ * See the LICENSE file in the root directory of this source tree.
57
+ */
58
+ const ar = [
59
+ ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
60
+ ["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
61
+ ["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
62
+ ], sr = Z("ellipsis-vertical", ar);
63
+ /**
64
+ * @license lucide-react v1.16.0 - ISC
65
+ *
66
+ * This source code is licensed under the ISC license.
67
+ * See the LICENSE file in the root directory of this source tree.
68
+ */
69
+ const ir = [
70
+ ["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }],
71
+ ["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }],
72
+ ["circle", { cx: "9", cy: "19", r: "1", key: "fkjjf6" }],
73
+ ["circle", { cx: "15", cy: "12", r: "1", key: "1tmaij" }],
74
+ ["circle", { cx: "15", cy: "5", r: "1", key: "19l28e" }],
75
+ ["circle", { cx: "15", cy: "19", r: "1", key: "f4zoj3" }]
76
+ ], cr = Z("grip-vertical", ir);
77
+ /**
78
+ * @license lucide-react v1.16.0 - ISC
79
+ *
80
+ * This source code is licensed under the ISC license.
81
+ * See the LICENSE file in the root directory of this source tree.
82
+ */
83
+ const ur = [
84
+ [
85
+ "path",
86
+ {
87
+ d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",
88
+ key: "1i5ecw"
89
+ }
90
+ ],
91
+ ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
92
+ ], dr = Z("settings", ur);
93
+ // @__NO_SIDE_EFFECTS__
94
+ function Ce(e) {
95
+ const t = /* @__PURE__ */ lr(e), n = s.forwardRef((r, o) => {
96
+ const { children: i, ...d } = r, c = s.Children.toArray(i), p = c.find(pr);
97
+ if (p) {
98
+ const u = p.props.children, l = c.map((f) => f === p ? s.Children.count(u) > 1 ? s.Children.only(null) : s.isValidElement(u) ? u.props.children : null : f);
99
+ return /* @__PURE__ */ a(t, { ...d, ref: o, children: s.isValidElement(u) ? s.cloneElement(u, void 0, l) : null });
100
+ }
101
+ return /* @__PURE__ */ a(t, { ...d, ref: o, children: i });
102
+ });
103
+ return n.displayName = `${e}.Slot`, n;
104
+ }
105
+ // @__NO_SIDE_EFFECTS__
106
+ function lr(e) {
107
+ const t = s.forwardRef((n, r) => {
108
+ const { children: o, ...i } = n;
109
+ if (s.isValidElement(o)) {
110
+ const d = hr(o), c = mr(i, o.props);
111
+ return o.type !== s.Fragment && (c.ref = r ? Oe(r, d) : d), s.cloneElement(o, c);
112
+ }
113
+ return s.Children.count(o) > 1 ? s.Children.only(null) : null;
114
+ });
115
+ return t.displayName = `${e}.SlotClone`, t;
116
+ }
117
+ var fr = Symbol("radix.slottable");
118
+ function pr(e) {
119
+ return s.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === fr;
120
+ }
121
+ function mr(e, t) {
122
+ const n = { ...t };
123
+ for (const r in t) {
124
+ const o = e[r], i = t[r];
125
+ /^on[A-Z]/.test(r) ? o && i ? n[r] = (...c) => {
126
+ const p = i(...c);
127
+ return o(...c), p;
128
+ } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...i } : r === "className" && (n[r] = [o, i].filter(Boolean).join(" "));
129
+ }
130
+ return { ...e, ...n };
131
+ }
132
+ function hr(e) {
133
+ var r, o;
134
+ let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
135
+ return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
136
+ }
137
+ var vr = [
138
+ "a",
139
+ "button",
140
+ "div",
141
+ "form",
142
+ "h2",
143
+ "h3",
144
+ "img",
145
+ "input",
146
+ "label",
147
+ "li",
148
+ "nav",
149
+ "ol",
150
+ "p",
151
+ "select",
152
+ "span",
153
+ "svg",
154
+ "ul"
155
+ ], A = vr.reduce((e, t) => {
156
+ const n = /* @__PURE__ */ Ce(`Primitive.${t}`), r = s.forwardRef((o, i) => {
157
+ const { asChild: d, ...c } = o, p = d ? n : t;
158
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ a(p, { ...c, ref: i });
159
+ });
160
+ return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
161
+ }, {});
162
+ function at(e, t) {
163
+ e && Xn.flushSync(() => e.dispatchEvent(t));
164
+ }
165
+ function st(e) {
166
+ const t = e + "CollectionProvider", [n, r] = pe(t), [o, i] = n(
167
+ t,
168
+ { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
169
+ ), d = (h) => {
170
+ const { scope: g, children: y } = h, E = q.useRef(null), v = q.useRef(/* @__PURE__ */ new Map()).current;
171
+ return /* @__PURE__ */ a(o, { scope: g, itemMap: v, collectionRef: E, children: y });
172
+ };
173
+ d.displayName = t;
174
+ const c = e + "CollectionSlot", p = /* @__PURE__ */ Ce(c), u = q.forwardRef(
175
+ (h, g) => {
176
+ const { scope: y, children: E } = h, v = i(c, y), x = O(g, v.collectionRef);
177
+ return /* @__PURE__ */ a(p, { ref: x, children: E });
178
+ }
179
+ );
180
+ u.displayName = c;
181
+ const l = e + "CollectionItemSlot", f = "data-radix-collection-item", m = /* @__PURE__ */ Ce(l), w = q.forwardRef(
182
+ (h, g) => {
183
+ const { scope: y, children: E, ...v } = h, x = q.useRef(null), S = O(g, x), P = i(l, y);
184
+ return q.useEffect(() => (P.itemMap.set(x, { ref: x, ...v }), () => void P.itemMap.delete(x))), /* @__PURE__ */ a(m, { [f]: "", ref: S, children: E });
185
+ }
186
+ );
187
+ w.displayName = l;
188
+ function b(h) {
189
+ const g = i(e + "CollectionConsumer", h);
190
+ return q.useCallback(() => {
191
+ const E = g.collectionRef.current;
192
+ if (!E) return [];
193
+ const v = Array.from(E.querySelectorAll(`[${f}]`));
194
+ return Array.from(g.itemMap.values()).sort(
195
+ (P, M) => v.indexOf(P.ref.current) - v.indexOf(M.ref.current)
196
+ );
197
+ }, [g.collectionRef, g.itemMap]);
198
+ }
199
+ return [
200
+ { Provider: d, Slot: u, ItemSlot: w },
201
+ b,
202
+ r
203
+ ];
204
+ }
205
+ var gr = "DismissableLayer", Ae = "dismissableLayer.update", yr = "dismissableLayer.pointerDownOutside", wr = "dismissableLayer.focusOutside", Ye, it = s.createContext({
206
+ layers: /* @__PURE__ */ new Set(),
207
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
208
+ branches: /* @__PURE__ */ new Set()
209
+ }), ct = s.forwardRef(
210
+ (e, t) => {
211
+ const {
212
+ disableOutsidePointerEvents: n = !1,
213
+ onEscapeKeyDown: r,
214
+ onPointerDownOutside: o,
215
+ onFocusOutside: i,
216
+ onInteractOutside: d,
217
+ onDismiss: c,
218
+ ...p
219
+ } = e, u = s.useContext(it), [l, f] = s.useState(null), m = (l == null ? void 0 : l.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, w] = s.useState({}), b = O(t, (M) => f(M)), h = Array.from(u.layers), [g] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), y = h.indexOf(g), E = l ? h.indexOf(l) : -1, v = u.layersWithOutsidePointerEventsDisabled.size > 0, x = E >= y, S = Er((M) => {
220
+ const R = M.target, U = [...u.branches].some((k) => k.contains(R));
221
+ !x || U || (o == null || o(M), d == null || d(M), M.defaultPrevented || c == null || c());
222
+ }, m), P = xr((M) => {
223
+ const R = M.target;
224
+ [...u.branches].some((k) => k.contains(R)) || (i == null || i(M), d == null || d(M), M.defaultPrevented || c == null || c());
225
+ }, m);
226
+ return Tn((M) => {
227
+ E === u.layers.size - 1 && (r == null || r(M), !M.defaultPrevented && c && (M.preventDefault(), c()));
228
+ }, m), s.useEffect(() => {
229
+ if (l)
230
+ return n && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (Ye = m.body.style.pointerEvents, m.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(l)), u.layers.add(l), Xe(), () => {
231
+ n && u.layersWithOutsidePointerEventsDisabled.size === 1 && (m.body.style.pointerEvents = Ye);
232
+ };
233
+ }, [l, m, n, u]), s.useEffect(() => () => {
234
+ l && (u.layers.delete(l), u.layersWithOutsidePointerEventsDisabled.delete(l), Xe());
235
+ }, [l, u]), s.useEffect(() => {
236
+ const M = () => w({});
237
+ return document.addEventListener(Ae, M), () => document.removeEventListener(Ae, M);
238
+ }, []), /* @__PURE__ */ a(
239
+ A.div,
240
+ {
241
+ ...p,
242
+ ref: b,
243
+ style: {
244
+ pointerEvents: v ? x ? "auto" : "none" : void 0,
245
+ ...e.style
246
+ },
247
+ onFocusCapture: N(e.onFocusCapture, P.onFocusCapture),
248
+ onBlurCapture: N(e.onBlurCapture, P.onBlurCapture),
249
+ onPointerDownCapture: N(
250
+ e.onPointerDownCapture,
251
+ S.onPointerDownCapture
252
+ )
253
+ }
254
+ );
255
+ }
256
+ );
257
+ ct.displayName = gr;
258
+ var br = "DismissableLayerBranch", Cr = s.forwardRef((e, t) => {
259
+ const n = s.useContext(it), r = s.useRef(null), o = O(t, r);
260
+ return s.useEffect(() => {
261
+ const i = r.current;
262
+ if (i)
263
+ return n.branches.add(i), () => {
264
+ n.branches.delete(i);
265
+ };
266
+ }, [n.branches]), /* @__PURE__ */ a(A.div, { ...e, ref: o });
267
+ });
268
+ Cr.displayName = br;
269
+ function Er(e, t = globalThis == null ? void 0 : globalThis.document) {
270
+ const n = V(e), r = s.useRef(!1), o = s.useRef(() => {
271
+ });
272
+ return s.useEffect(() => {
273
+ const i = (c) => {
274
+ if (c.target && !r.current) {
275
+ let p = function() {
276
+ ut(
277
+ yr,
278
+ n,
279
+ u,
280
+ { discrete: !0 }
281
+ );
282
+ };
283
+ const u = { originalEvent: c };
284
+ c.pointerType === "touch" ? (t.removeEventListener("click", o.current), o.current = p, t.addEventListener("click", o.current, { once: !0 })) : p();
285
+ } else
286
+ t.removeEventListener("click", o.current);
287
+ r.current = !1;
288
+ }, d = window.setTimeout(() => {
289
+ t.addEventListener("pointerdown", i);
290
+ }, 0);
291
+ return () => {
292
+ window.clearTimeout(d), t.removeEventListener("pointerdown", i), t.removeEventListener("click", o.current);
293
+ };
294
+ }, [t, n]), {
295
+ // ensures we check React component tree (not just DOM tree)
296
+ onPointerDownCapture: () => r.current = !0
297
+ };
298
+ }
299
+ function xr(e, t = globalThis == null ? void 0 : globalThis.document) {
300
+ const n = V(e), r = s.useRef(!1);
301
+ return s.useEffect(() => {
302
+ const o = (i) => {
303
+ i.target && !r.current && ut(wr, n, { originalEvent: i }, {
304
+ discrete: !1
305
+ });
306
+ };
307
+ return t.addEventListener("focusin", o), () => t.removeEventListener("focusin", o);
308
+ }, [t, n]), {
309
+ onFocusCapture: () => r.current = !0,
310
+ onBlurCapture: () => r.current = !1
311
+ };
312
+ }
313
+ function Xe() {
314
+ const e = new CustomEvent(Ae);
315
+ document.dispatchEvent(e);
316
+ }
317
+ function ut(e, t, n, { discrete: r }) {
318
+ const o = n.originalEvent.target, i = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
319
+ t && o.addEventListener(e, t, { once: !0 }), r ? at(o, i) : o.dispatchEvent(i);
320
+ }
321
+ var _e = "focusScope.autoFocusOnMount", Pe = "focusScope.autoFocusOnUnmount", qe = { bubbles: !1, cancelable: !0 }, Nr = "FocusScope", dt = s.forwardRef((e, t) => {
322
+ const {
323
+ loop: n = !1,
324
+ trapped: r = !1,
325
+ onMountAutoFocus: o,
326
+ onUnmountAutoFocus: i,
327
+ ...d
328
+ } = e, [c, p] = s.useState(null), u = V(o), l = V(i), f = s.useRef(null), m = O(t, (h) => p(h)), w = s.useRef({
329
+ paused: !1,
330
+ pause() {
331
+ this.paused = !0;
332
+ },
333
+ resume() {
334
+ this.paused = !1;
335
+ }
336
+ }).current;
337
+ s.useEffect(() => {
338
+ if (r) {
339
+ let h = function(v) {
340
+ if (w.paused || !c) return;
341
+ const x = v.target;
342
+ c.contains(x) ? f.current = x : j(f.current, { select: !0 });
343
+ }, g = function(v) {
344
+ if (w.paused || !c) return;
345
+ const x = v.relatedTarget;
346
+ x !== null && (c.contains(x) || j(f.current, { select: !0 }));
347
+ }, y = function(v) {
348
+ if (document.activeElement === document.body)
349
+ for (const S of v)
350
+ S.removedNodes.length > 0 && j(c);
351
+ };
352
+ document.addEventListener("focusin", h), document.addEventListener("focusout", g);
353
+ const E = new MutationObserver(y);
354
+ return c && E.observe(c, { childList: !0, subtree: !0 }), () => {
355
+ document.removeEventListener("focusin", h), document.removeEventListener("focusout", g), E.disconnect();
356
+ };
357
+ }
358
+ }, [r, c, w.paused]), s.useEffect(() => {
359
+ if (c) {
360
+ Je.add(w);
361
+ const h = document.activeElement;
362
+ if (!c.contains(h)) {
363
+ const y = new CustomEvent(_e, qe);
364
+ c.addEventListener(_e, u), c.dispatchEvent(y), y.defaultPrevented || (Mr(Ir(lt(c)), { select: !0 }), document.activeElement === h && j(c));
365
+ }
366
+ return () => {
367
+ c.removeEventListener(_e, u), setTimeout(() => {
368
+ const y = new CustomEvent(Pe, qe);
369
+ c.addEventListener(Pe, l), c.dispatchEvent(y), y.defaultPrevented || j(h ?? document.body, { select: !0 }), c.removeEventListener(Pe, l), Je.remove(w);
370
+ }, 0);
371
+ };
372
+ }
373
+ }, [c, u, l, w]);
374
+ const b = s.useCallback(
375
+ (h) => {
376
+ if (!n && !r || w.paused) return;
377
+ const g = h.key === "Tab" && !h.altKey && !h.ctrlKey && !h.metaKey, y = document.activeElement;
378
+ if (g && y) {
379
+ const E = h.currentTarget, [v, x] = Rr(E);
380
+ v && x ? !h.shiftKey && y === x ? (h.preventDefault(), n && j(v, { select: !0 })) : h.shiftKey && y === v && (h.preventDefault(), n && j(x, { select: !0 })) : y === E && h.preventDefault();
381
+ }
382
+ },
383
+ [n, r, w.paused]
384
+ );
385
+ return /* @__PURE__ */ a(A.div, { tabIndex: -1, ...d, ref: m, onKeyDown: b });
386
+ });
387
+ dt.displayName = Nr;
388
+ function Mr(e, { select: t = !1 } = {}) {
389
+ const n = document.activeElement;
390
+ for (const r of e)
391
+ if (j(r, { select: t }), document.activeElement !== n) return;
392
+ }
393
+ function Rr(e) {
394
+ const t = lt(e), n = Ze(t, e), r = Ze(t.reverse(), e);
395
+ return [n, r];
396
+ }
397
+ function lt(e) {
398
+ const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
399
+ acceptNode: (r) => {
400
+ const o = r.tagName === "INPUT" && r.type === "hidden";
401
+ return r.disabled || r.hidden || o ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
402
+ }
403
+ });
404
+ for (; n.nextNode(); ) t.push(n.currentNode);
405
+ return t;
406
+ }
407
+ function Ze(e, t) {
408
+ for (const n of e)
409
+ if (!_r(n, { upTo: t })) return n;
410
+ }
411
+ function _r(e, { upTo: t }) {
412
+ if (getComputedStyle(e).visibility === "hidden") return !0;
413
+ for (; e; ) {
414
+ if (t !== void 0 && e === t) return !1;
415
+ if (getComputedStyle(e).display === "none") return !0;
416
+ e = e.parentElement;
417
+ }
418
+ return !1;
419
+ }
420
+ function Pr(e) {
421
+ return e instanceof HTMLInputElement && "select" in e;
422
+ }
423
+ function j(e, { select: t = !1 } = {}) {
424
+ if (e && e.focus) {
425
+ const n = document.activeElement;
426
+ e.focus({ preventScroll: !0 }), e !== n && Pr(e) && t && e.select();
427
+ }
428
+ }
429
+ var Je = Sr();
430
+ function Sr() {
431
+ let e = [];
432
+ return {
433
+ add(t) {
434
+ const n = e[0];
435
+ t !== n && (n == null || n.pause()), e = Qe(e, t), e.unshift(t);
436
+ },
437
+ remove(t) {
438
+ var n;
439
+ e = Qe(e, t), (n = e[0]) == null || n.resume();
440
+ }
441
+ };
442
+ }
443
+ function Qe(e, t) {
444
+ const n = [...e], r = n.indexOf(t);
445
+ return r !== -1 && n.splice(r, 1), n;
446
+ }
447
+ function Ir(e) {
448
+ return e.filter((t) => t.tagName !== "A");
449
+ }
450
+ var Ar = "Arrow", ft = s.forwardRef((e, t) => {
451
+ const { children: n, width: r = 10, height: o = 5, ...i } = e;
452
+ return /* @__PURE__ */ a(
453
+ A.svg,
454
+ {
455
+ ...i,
456
+ ref: t,
457
+ width: r,
458
+ height: o,
459
+ viewBox: "0 0 30 10",
460
+ preserveAspectRatio: "none",
461
+ children: e.asChild ? n : /* @__PURE__ */ a("polygon", { points: "0,0 30,0 15,10" })
462
+ }
463
+ );
464
+ });
465
+ ft.displayName = Ar;
466
+ var Dr = ft, ke = "Popper", [pt, mt] = pe(ke), [Tr, ht] = pt(ke), vt = (e) => {
467
+ const { __scopePopper: t, children: n } = e, [r, o] = s.useState(null);
468
+ return /* @__PURE__ */ a(Tr, { scope: t, anchor: r, onAnchorChange: o, children: n });
469
+ };
470
+ vt.displayName = ke;
471
+ var gt = "PopperAnchor", yt = s.forwardRef(
472
+ (e, t) => {
473
+ const { __scopePopper: n, virtualRef: r, ...o } = e, i = ht(gt, n), d = s.useRef(null), c = O(t, d), p = s.useRef(null);
474
+ return s.useEffect(() => {
475
+ const u = p.current;
476
+ p.current = (r == null ? void 0 : r.current) || d.current, u !== p.current && i.onAnchorChange(p.current);
477
+ }), r ? null : /* @__PURE__ */ a(A.div, { ...o, ref: c });
478
+ }
479
+ );
480
+ yt.displayName = gt;
481
+ var Fe = "PopperContent", [Or, kr] = pt(Fe), wt = s.forwardRef(
482
+ (e, t) => {
483
+ var z, se, L, ie, je, Ve;
484
+ const {
485
+ __scopePopper: n,
486
+ side: r = "bottom",
487
+ sideOffset: o = 0,
488
+ align: i = "center",
489
+ alignOffset: d = 0,
490
+ arrowPadding: c = 0,
491
+ avoidCollisions: p = !0,
492
+ collisionBoundary: u = [],
493
+ collisionPadding: l = 0,
494
+ sticky: f = "partial",
495
+ hideWhenDetached: m = !1,
496
+ updatePositionStrategy: w = "optimized",
497
+ onPlaced: b,
498
+ ...h
499
+ } = e, g = ht(Fe, n), [y, E] = s.useState(null), v = O(t, (ce) => E(ce)), [x, S] = s.useState(null), P = On(x), M = (P == null ? void 0 : P.width) ?? 0, R = (P == null ? void 0 : P.height) ?? 0, U = r + (i !== "center" ? "-" + i : ""), k = typeof l == "number" ? l : { top: 0, right: 0, bottom: 0, left: 0, ...l }, W = Array.isArray(u) ? u : [u], Y = W.length > 0, B = {
500
+ padding: k,
501
+ boundary: W.filter(Lr),
502
+ // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
503
+ altBoundary: Y
504
+ }, { refs: ee, floatingStyles: te, placement: K, isPositioned: ne, middlewareData: F } = kn({
505
+ // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
506
+ strategy: "fixed",
507
+ placement: U,
508
+ whileElementsMounted: (...ce) => zn(...ce, {
509
+ animationFrame: w === "always"
510
+ }),
511
+ elements: {
512
+ reference: g.anchor
513
+ },
514
+ middleware: [
515
+ Fn({ mainAxis: o + R, alignmentAxis: d }),
516
+ p && Ln({
517
+ mainAxis: !0,
518
+ crossAxis: !1,
519
+ limiter: f === "partial" ? $n() : void 0,
520
+ ...B
521
+ }),
522
+ p && Un({ ...B }),
523
+ Kn({
524
+ ...B,
525
+ apply: ({ elements: ce, rects: He, availableWidth: Pn, availableHeight: Sn }) => {
526
+ const { width: In, height: An } = He.reference, we = ce.floating.style;
527
+ we.setProperty("--radix-popper-available-width", `${Pn}px`), we.setProperty("--radix-popper-available-height", `${Sn}px`), we.setProperty("--radix-popper-anchor-width", `${In}px`), we.setProperty("--radix-popper-anchor-height", `${An}px`);
528
+ }
529
+ }),
530
+ x && Gn({ element: x, padding: c }),
531
+ $r({ arrowWidth: M, arrowHeight: R }),
532
+ m && Bn({ strategy: "referenceHidden", ...B })
533
+ ]
534
+ }), [C, T] = Et(K), I = V(b);
535
+ de(() => {
536
+ ne && (I == null || I());
537
+ }, [ne, I]);
538
+ const G = (z = F.arrow) == null ? void 0 : z.x, oe = (se = F.arrow) == null ? void 0 : se.y, ae = ((L = F.arrow) == null ? void 0 : L.centerOffset) !== 0, [ye, X] = s.useState();
539
+ return de(() => {
540
+ y && X(window.getComputedStyle(y).zIndex);
541
+ }, [y]), /* @__PURE__ */ a(
542
+ "div",
543
+ {
544
+ ref: ee.setFloating,
545
+ "data-radix-popper-content-wrapper": "",
546
+ style: {
547
+ ...te,
548
+ transform: ne ? te.transform : "translate(0, -200%)",
549
+ // keep off the page when measuring
550
+ minWidth: "max-content",
551
+ zIndex: ye,
552
+ "--radix-popper-transform-origin": [
553
+ (ie = F.transformOrigin) == null ? void 0 : ie.x,
554
+ (je = F.transformOrigin) == null ? void 0 : je.y
555
+ ].join(" "),
556
+ // hide the content if using the hide middleware and should be hidden
557
+ // set visibility to hidden and disable pointer events so the UI behaves
558
+ // as if the PopperContent isn't there at all
559
+ ...((Ve = F.hide) == null ? void 0 : Ve.referenceHidden) && {
560
+ visibility: "hidden",
561
+ pointerEvents: "none"
562
+ }
563
+ },
564
+ dir: e.dir,
565
+ children: /* @__PURE__ */ a(
566
+ Or,
567
+ {
568
+ scope: n,
569
+ placedSide: C,
570
+ onArrowChange: S,
571
+ arrowX: G,
572
+ arrowY: oe,
573
+ shouldHideArrow: ae,
574
+ children: /* @__PURE__ */ a(
575
+ A.div,
576
+ {
577
+ "data-side": C,
578
+ "data-align": T,
579
+ ...h,
580
+ ref: v,
581
+ style: {
582
+ ...h.style,
583
+ // if the PopperContent hasn't been placed yet (not all measurements done)
584
+ // we prevent animations so that users's animation don't kick in too early referring wrong sides
585
+ animation: ne ? void 0 : "none"
586
+ }
587
+ }
588
+ )
589
+ }
590
+ )
591
+ }
592
+ );
593
+ }
594
+ );
595
+ wt.displayName = Fe;
596
+ var bt = "PopperArrow", Fr = {
597
+ top: "bottom",
598
+ right: "left",
599
+ bottom: "top",
600
+ left: "right"
601
+ }, Ct = s.forwardRef(function(t, n) {
602
+ const { __scopePopper: r, ...o } = t, i = kr(bt, r), d = Fr[i.placedSide];
603
+ return (
604
+ // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
605
+ // doesn't report size as we'd expect on SVG elements.
606
+ // it reports their bounding box which is effectively the largest path inside the SVG.
607
+ /* @__PURE__ */ a(
608
+ "span",
609
+ {
610
+ ref: i.onArrowChange,
611
+ style: {
612
+ position: "absolute",
613
+ left: i.arrowX,
614
+ top: i.arrowY,
615
+ [d]: 0,
616
+ transformOrigin: {
617
+ top: "",
618
+ right: "0 0",
619
+ bottom: "center 0",
620
+ left: "100% 0"
621
+ }[i.placedSide],
622
+ transform: {
623
+ top: "translateY(100%)",
624
+ right: "translateY(50%) rotate(90deg) translateX(-50%)",
625
+ bottom: "rotate(180deg)",
626
+ left: "translateY(50%) rotate(-90deg) translateX(50%)"
627
+ }[i.placedSide],
628
+ visibility: i.shouldHideArrow ? "hidden" : void 0
629
+ },
630
+ children: /* @__PURE__ */ a(
631
+ Dr,
632
+ {
633
+ ...o,
634
+ ref: n,
635
+ style: {
636
+ ...o.style,
637
+ // ensures the element can be measured correctly (mostly for if SVG)
638
+ display: "block"
639
+ }
640
+ }
641
+ )
642
+ }
643
+ )
644
+ );
645
+ });
646
+ Ct.displayName = bt;
647
+ function Lr(e) {
648
+ return e !== null;
649
+ }
650
+ var $r = (e) => ({
651
+ name: "transformOrigin",
652
+ options: e,
653
+ fn(t) {
654
+ var g, y, E;
655
+ const { placement: n, rects: r, middlewareData: o } = t, d = ((g = o.arrow) == null ? void 0 : g.centerOffset) !== 0, c = d ? 0 : e.arrowWidth, p = d ? 0 : e.arrowHeight, [u, l] = Et(n), f = { start: "0%", center: "50%", end: "100%" }[l], m = (((y = o.arrow) == null ? void 0 : y.x) ?? 0) + c / 2, w = (((E = o.arrow) == null ? void 0 : E.y) ?? 0) + p / 2;
656
+ let b = "", h = "";
657
+ return u === "bottom" ? (b = d ? f : `${m}px`, h = `${-p}px`) : u === "top" ? (b = d ? f : `${m}px`, h = `${r.floating.height + p}px`) : u === "right" ? (b = `${-p}px`, h = d ? f : `${w}px`) : u === "left" && (b = `${r.floating.width + p}px`, h = d ? f : `${w}px`), { data: { x: b, y: h } };
658
+ }
659
+ });
660
+ function Et(e) {
661
+ const [t, n = "center"] = e.split("-");
662
+ return [t, n];
663
+ }
664
+ var Ur = vt, Kr = yt, Gr = wt, Br = Ct, zr = "Portal", xt = s.forwardRef((e, t) => {
665
+ var c;
666
+ const { container: n, ...r } = e, [o, i] = s.useState(!1);
667
+ de(() => i(!0), []);
668
+ const d = n || o && ((c = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : c.body);
669
+ return d ? qn.createPortal(/* @__PURE__ */ a(A.div, { ...r, ref: t }), d) : null;
670
+ });
671
+ xt.displayName = zr;
672
+ function Wr(e, t) {
673
+ return s.useReducer((n, r) => t[n][r] ?? n, e);
674
+ }
675
+ var me = (e) => {
676
+ const { present: t, children: n } = e, r = jr(t), o = typeof n == "function" ? n({ present: r.isPresent }) : s.Children.only(n), i = O(r.ref, Vr(o));
677
+ return typeof n == "function" || r.isPresent ? s.cloneElement(o, { ref: i }) : null;
678
+ };
679
+ me.displayName = "Presence";
680
+ function jr(e) {
681
+ const [t, n] = s.useState(), r = s.useRef(null), o = s.useRef(e), i = s.useRef("none"), d = e ? "mounted" : "unmounted", [c, p] = Wr(d, {
682
+ mounted: {
683
+ UNMOUNT: "unmounted",
684
+ ANIMATION_OUT: "unmountSuspended"
685
+ },
686
+ unmountSuspended: {
687
+ MOUNT: "mounted",
688
+ ANIMATION_END: "unmounted"
689
+ },
690
+ unmounted: {
691
+ MOUNT: "mounted"
692
+ }
693
+ });
694
+ return s.useEffect(() => {
695
+ const u = be(r.current);
696
+ i.current = c === "mounted" ? u : "none";
697
+ }, [c]), de(() => {
698
+ const u = r.current, l = o.current;
699
+ if (l !== e) {
700
+ const m = i.current, w = be(u);
701
+ e ? p("MOUNT") : w === "none" || (u == null ? void 0 : u.display) === "none" ? p("UNMOUNT") : p(l && m !== w ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
702
+ }
703
+ }, [e, p]), de(() => {
704
+ if (t) {
705
+ let u;
706
+ const l = t.ownerDocument.defaultView ?? window, f = (w) => {
707
+ const h = be(r.current).includes(CSS.escape(w.animationName));
708
+ if (w.target === t && h && (p("ANIMATION_END"), !o.current)) {
709
+ const g = t.style.animationFillMode;
710
+ t.style.animationFillMode = "forwards", u = l.setTimeout(() => {
711
+ t.style.animationFillMode === "forwards" && (t.style.animationFillMode = g);
712
+ });
713
+ }
714
+ }, m = (w) => {
715
+ w.target === t && (i.current = be(r.current));
716
+ };
717
+ return t.addEventListener("animationstart", m), t.addEventListener("animationcancel", f), t.addEventListener("animationend", f), () => {
718
+ l.clearTimeout(u), t.removeEventListener("animationstart", m), t.removeEventListener("animationcancel", f), t.removeEventListener("animationend", f);
719
+ };
720
+ } else
721
+ p("ANIMATION_END");
722
+ }, [t, p]), {
723
+ isPresent: ["mounted", "unmountSuspended"].includes(c),
724
+ ref: s.useCallback((u) => {
725
+ r.current = u ? getComputedStyle(u) : null, n(u);
726
+ }, [])
727
+ };
728
+ }
729
+ function be(e) {
730
+ return (e == null ? void 0 : e.animationName) || "none";
731
+ }
732
+ function Vr(e) {
733
+ var r, o;
734
+ let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
735
+ return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
736
+ }
737
+ var Se = "rovingFocusGroup.onEntryFocus", Hr = { bubbles: !1, cancelable: !0 }, he = "RovingFocusGroup", [De, Nt, Yr] = st(he), [Xr, Mt] = pe(
738
+ he,
739
+ [Yr]
740
+ ), [qr, Zr] = Xr(he), Rt = s.forwardRef(
741
+ (e, t) => /* @__PURE__ */ a(De.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ a(De.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ a(Jr, { ...e, ref: t }) }) })
742
+ );
743
+ Rt.displayName = he;
744
+ var Jr = s.forwardRef((e, t) => {
745
+ const {
746
+ __scopeRovingFocusGroup: n,
747
+ orientation: r,
748
+ loop: o = !1,
749
+ dir: i,
750
+ currentTabStopId: d,
751
+ defaultCurrentTabStopId: c,
752
+ onCurrentTabStopIdChange: p,
753
+ onEntryFocus: u,
754
+ preventScrollOnEntryFocus: l = !1,
755
+ ...f
756
+ } = e, m = s.useRef(null), w = O(t, m), b = ot(i), [h, g] = rt({
757
+ prop: d,
758
+ defaultProp: c ?? null,
759
+ onChange: p,
760
+ caller: he
761
+ }), [y, E] = s.useState(!1), v = V(u), x = Nt(n), S = s.useRef(!1), [P, M] = s.useState(0);
762
+ return s.useEffect(() => {
763
+ const R = m.current;
764
+ if (R)
765
+ return R.addEventListener(Se, v), () => R.removeEventListener(Se, v);
766
+ }, [v]), /* @__PURE__ */ a(
767
+ qr,
768
+ {
769
+ scope: n,
770
+ orientation: r,
771
+ dir: b,
772
+ loop: o,
773
+ currentTabStopId: h,
774
+ onItemFocus: s.useCallback(
775
+ (R) => g(R),
776
+ [g]
777
+ ),
778
+ onItemShiftTab: s.useCallback(() => E(!0), []),
779
+ onFocusableItemAdd: s.useCallback(
780
+ () => M((R) => R + 1),
781
+ []
782
+ ),
783
+ onFocusableItemRemove: s.useCallback(
784
+ () => M((R) => R - 1),
785
+ []
786
+ ),
787
+ children: /* @__PURE__ */ a(
788
+ A.div,
789
+ {
790
+ tabIndex: y || P === 0 ? -1 : 0,
791
+ "data-orientation": r,
792
+ ...f,
793
+ ref: w,
794
+ style: { outline: "none", ...e.style },
795
+ onMouseDown: N(e.onMouseDown, () => {
796
+ S.current = !0;
797
+ }),
798
+ onFocus: N(e.onFocus, (R) => {
799
+ const U = !S.current;
800
+ if (R.target === R.currentTarget && U && !y) {
801
+ const k = new CustomEvent(Se, Hr);
802
+ if (R.currentTarget.dispatchEvent(k), !k.defaultPrevented) {
803
+ const W = x().filter((K) => K.focusable), Y = W.find((K) => K.active), B = W.find((K) => K.id === h), te = [Y, B, ...W].filter(
804
+ Boolean
805
+ ).map((K) => K.ref.current);
806
+ St(te, l);
807
+ }
808
+ }
809
+ S.current = !1;
810
+ }),
811
+ onBlur: N(e.onBlur, () => E(!1))
812
+ }
813
+ )
814
+ }
815
+ );
816
+ }), _t = "RovingFocusGroupItem", Pt = s.forwardRef(
817
+ (e, t) => {
818
+ const {
819
+ __scopeRovingFocusGroup: n,
820
+ focusable: r = !0,
821
+ active: o = !1,
822
+ tabStopId: i,
823
+ children: d,
824
+ ...c
825
+ } = e, p = Ie(), u = i || p, l = Zr(_t, n), f = l.currentTabStopId === u, m = Nt(n), { onFocusableItemAdd: w, onFocusableItemRemove: b, currentTabStopId: h } = l;
826
+ return s.useEffect(() => {
827
+ if (r)
828
+ return w(), () => b();
829
+ }, [r, w, b]), /* @__PURE__ */ a(
830
+ De.ItemSlot,
831
+ {
832
+ scope: n,
833
+ id: u,
834
+ focusable: r,
835
+ active: o,
836
+ children: /* @__PURE__ */ a(
837
+ A.span,
838
+ {
839
+ tabIndex: f ? 0 : -1,
840
+ "data-orientation": l.orientation,
841
+ ...c,
842
+ ref: t,
843
+ onMouseDown: N(e.onMouseDown, (g) => {
844
+ r ? l.onItemFocus(u) : g.preventDefault();
845
+ }),
846
+ onFocus: N(e.onFocus, () => l.onItemFocus(u)),
847
+ onKeyDown: N(e.onKeyDown, (g) => {
848
+ if (g.key === "Tab" && g.shiftKey) {
849
+ l.onItemShiftTab();
850
+ return;
851
+ }
852
+ if (g.target !== g.currentTarget) return;
853
+ const y = to(g, l.orientation, l.dir);
854
+ if (y !== void 0) {
855
+ if (g.metaKey || g.ctrlKey || g.altKey || g.shiftKey) return;
856
+ g.preventDefault();
857
+ let v = m().filter((x) => x.focusable).map((x) => x.ref.current);
858
+ if (y === "last") v.reverse();
859
+ else if (y === "prev" || y === "next") {
860
+ y === "prev" && v.reverse();
861
+ const x = v.indexOf(g.currentTarget);
862
+ v = l.loop ? no(v, x + 1) : v.slice(x + 1);
863
+ }
864
+ setTimeout(() => St(v));
865
+ }
866
+ }),
867
+ children: typeof d == "function" ? d({ isCurrentTabStop: f, hasTabStop: h != null }) : d
868
+ }
869
+ )
870
+ }
871
+ );
872
+ }
873
+ );
874
+ Pt.displayName = _t;
875
+ var Qr = {
876
+ ArrowLeft: "prev",
877
+ ArrowUp: "prev",
878
+ ArrowRight: "next",
879
+ ArrowDown: "next",
880
+ PageUp: "first",
881
+ Home: "first",
882
+ PageDown: "last",
883
+ End: "last"
884
+ };
885
+ function eo(e, t) {
886
+ return t !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
887
+ }
888
+ function to(e, t, n) {
889
+ const r = eo(e.key, n);
890
+ if (!(t === "vertical" && ["ArrowLeft", "ArrowRight"].includes(r)) && !(t === "horizontal" && ["ArrowUp", "ArrowDown"].includes(r)))
891
+ return Qr[r];
892
+ }
893
+ function St(e, t = !1) {
894
+ const n = document.activeElement;
895
+ for (const r of e)
896
+ if (r === n || (r.focus({ preventScroll: t }), document.activeElement !== n)) return;
897
+ }
898
+ function no(e, t) {
899
+ return e.map((n, r) => e[(t + r) % e.length]);
900
+ }
901
+ var ro = Rt, oo = Pt, Te = ["Enter", " "], ao = ["ArrowDown", "PageUp", "Home"], It = ["ArrowUp", "PageDown", "End"], so = [...ao, ...It], io = {
902
+ ltr: [...Te, "ArrowRight"],
903
+ rtl: [...Te, "ArrowLeft"]
904
+ }, co = {
905
+ ltr: ["ArrowLeft"],
906
+ rtl: ["ArrowRight"]
907
+ }, ve = "Menu", [le, uo, lo] = st(ve), [J, At] = pe(ve, [
908
+ lo,
909
+ mt,
910
+ Mt
911
+ ]), Ne = mt(), Dt = Mt(), [fo, Q] = J(ve), [po, ge] = J(ve), Tt = (e) => {
912
+ const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: i, modal: d = !0 } = e, c = Ne(t), [p, u] = s.useState(null), l = s.useRef(!1), f = V(i), m = ot(o);
913
+ return s.useEffect(() => {
914
+ const w = () => {
915
+ l.current = !0, document.addEventListener("pointerdown", b, { capture: !0, once: !0 }), document.addEventListener("pointermove", b, { capture: !0, once: !0 });
916
+ }, b = () => l.current = !1;
917
+ return document.addEventListener("keydown", w, { capture: !0 }), () => {
918
+ document.removeEventListener("keydown", w, { capture: !0 }), document.removeEventListener("pointerdown", b, { capture: !0 }), document.removeEventListener("pointermove", b, { capture: !0 });
919
+ };
920
+ }, []), /* @__PURE__ */ a(Ur, { ...c, children: /* @__PURE__ */ a(
921
+ fo,
922
+ {
923
+ scope: t,
924
+ open: n,
925
+ onOpenChange: f,
926
+ content: p,
927
+ onContentChange: u,
928
+ children: /* @__PURE__ */ a(
929
+ po,
930
+ {
931
+ scope: t,
932
+ onClose: s.useCallback(() => f(!1), [f]),
933
+ isUsingKeyboardRef: l,
934
+ dir: m,
935
+ modal: d,
936
+ children: r
937
+ }
938
+ )
939
+ }
940
+ ) });
941
+ };
942
+ Tt.displayName = ve;
943
+ var mo = "MenuAnchor", Le = s.forwardRef(
944
+ (e, t) => {
945
+ const { __scopeMenu: n, ...r } = e, o = Ne(n);
946
+ return /* @__PURE__ */ a(Kr, { ...o, ...r, ref: t });
947
+ }
948
+ );
949
+ Le.displayName = mo;
950
+ var $e = "MenuPortal", [ho, Ot] = J($e, {
951
+ forceMount: void 0
952
+ }), kt = (e) => {
953
+ const { __scopeMenu: t, forceMount: n, children: r, container: o } = e, i = Q($e, t);
954
+ return /* @__PURE__ */ a(ho, { scope: t, forceMount: n, children: /* @__PURE__ */ a(me, { present: n || i.open, children: /* @__PURE__ */ a(xt, { asChild: !0, container: o, children: r }) }) });
955
+ };
956
+ kt.displayName = $e;
957
+ var $ = "MenuContent", [vo, Ue] = J($), Ft = s.forwardRef(
958
+ (e, t) => {
959
+ const n = Ot($, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, i = Q($, e.__scopeMenu), d = ge($, e.__scopeMenu);
960
+ return /* @__PURE__ */ a(le.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ a(me, { present: r || i.open, children: /* @__PURE__ */ a(le.Slot, { scope: e.__scopeMenu, children: d.modal ? /* @__PURE__ */ a(go, { ...o, ref: t }) : /* @__PURE__ */ a(yo, { ...o, ref: t }) }) }) });
961
+ }
962
+ ), go = s.forwardRef(
963
+ (e, t) => {
964
+ const n = Q($, e.__scopeMenu), r = s.useRef(null), o = O(t, r);
965
+ return s.useEffect(() => {
966
+ const i = r.current;
967
+ if (i) return Vn(i);
968
+ }, []), /* @__PURE__ */ a(
969
+ Ke,
970
+ {
971
+ ...e,
972
+ ref: o,
973
+ trapFocus: n.open,
974
+ disableOutsidePointerEvents: n.open,
975
+ disableOutsideScroll: !0,
976
+ onFocusOutside: N(
977
+ e.onFocusOutside,
978
+ (i) => i.preventDefault(),
979
+ { checkForDefaultPrevented: !1 }
980
+ ),
981
+ onDismiss: () => n.onOpenChange(!1)
982
+ }
983
+ );
984
+ }
985
+ ), yo = s.forwardRef((e, t) => {
986
+ const n = Q($, e.__scopeMenu);
987
+ return /* @__PURE__ */ a(
988
+ Ke,
989
+ {
990
+ ...e,
991
+ ref: t,
992
+ trapFocus: !1,
993
+ disableOutsidePointerEvents: !1,
994
+ disableOutsideScroll: !1,
995
+ onDismiss: () => n.onOpenChange(!1)
996
+ }
997
+ );
998
+ }), wo = /* @__PURE__ */ Ce("MenuContent.ScrollLock"), Ke = s.forwardRef(
999
+ (e, t) => {
1000
+ const {
1001
+ __scopeMenu: n,
1002
+ loop: r = !1,
1003
+ trapFocus: o,
1004
+ onOpenAutoFocus: i,
1005
+ onCloseAutoFocus: d,
1006
+ disableOutsidePointerEvents: c,
1007
+ onEntryFocus: p,
1008
+ onEscapeKeyDown: u,
1009
+ onPointerDownOutside: l,
1010
+ onFocusOutside: f,
1011
+ onInteractOutside: m,
1012
+ onDismiss: w,
1013
+ disableOutsideScroll: b,
1014
+ ...h
1015
+ } = e, g = Q($, n), y = ge($, n), E = Ne(n), v = Dt(n), x = uo(n), [S, P] = s.useState(null), M = s.useRef(null), R = O(t, M, g.onContentChange), U = s.useRef(0), k = s.useRef(""), W = s.useRef(0), Y = s.useRef(null), B = s.useRef("right"), ee = s.useRef(0), te = b ? jn : s.Fragment, K = b ? { as: wo, allowPinchZoom: !0 } : void 0, ne = (C) => {
1016
+ var z, se;
1017
+ const T = k.current + C, I = x().filter((L) => !L.disabled), G = document.activeElement, oe = (z = I.find((L) => L.ref.current === G)) == null ? void 0 : z.textValue, ae = I.map((L) => L.textValue), ye = Ao(ae, T, oe), X = (se = I.find((L) => L.textValue === ye)) == null ? void 0 : se.ref.current;
1018
+ (function L(ie) {
1019
+ k.current = ie, window.clearTimeout(U.current), ie !== "" && (U.current = window.setTimeout(() => L(""), 1e3));
1020
+ })(T), X && setTimeout(() => X.focus());
1021
+ };
1022
+ s.useEffect(() => () => window.clearTimeout(U.current), []), Wn();
1023
+ const F = s.useCallback((C) => {
1024
+ var I, G;
1025
+ return B.current === ((I = Y.current) == null ? void 0 : I.side) && To(C, (G = Y.current) == null ? void 0 : G.area);
1026
+ }, []);
1027
+ return /* @__PURE__ */ a(
1028
+ vo,
1029
+ {
1030
+ scope: n,
1031
+ searchRef: k,
1032
+ onItemEnter: s.useCallback(
1033
+ (C) => {
1034
+ F(C) && C.preventDefault();
1035
+ },
1036
+ [F]
1037
+ ),
1038
+ onItemLeave: s.useCallback(
1039
+ (C) => {
1040
+ var T;
1041
+ F(C) || ((T = M.current) == null || T.focus(), P(null));
1042
+ },
1043
+ [F]
1044
+ ),
1045
+ onTriggerLeave: s.useCallback(
1046
+ (C) => {
1047
+ F(C) && C.preventDefault();
1048
+ },
1049
+ [F]
1050
+ ),
1051
+ pointerGraceTimerRef: W,
1052
+ onPointerGraceIntentChange: s.useCallback((C) => {
1053
+ Y.current = C;
1054
+ }, []),
1055
+ children: /* @__PURE__ */ a(te, { ...K, children: /* @__PURE__ */ a(
1056
+ dt,
1057
+ {
1058
+ asChild: !0,
1059
+ trapped: o,
1060
+ onMountAutoFocus: N(i, (C) => {
1061
+ var T;
1062
+ C.preventDefault(), (T = M.current) == null || T.focus({ preventScroll: !0 });
1063
+ }),
1064
+ onUnmountAutoFocus: d,
1065
+ children: /* @__PURE__ */ a(
1066
+ ct,
1067
+ {
1068
+ asChild: !0,
1069
+ disableOutsidePointerEvents: c,
1070
+ onEscapeKeyDown: u,
1071
+ onPointerDownOutside: l,
1072
+ onFocusOutside: f,
1073
+ onInteractOutside: m,
1074
+ onDismiss: w,
1075
+ children: /* @__PURE__ */ a(
1076
+ ro,
1077
+ {
1078
+ asChild: !0,
1079
+ ...v,
1080
+ dir: y.dir,
1081
+ orientation: "vertical",
1082
+ loop: r,
1083
+ currentTabStopId: S,
1084
+ onCurrentTabStopIdChange: P,
1085
+ onEntryFocus: N(p, (C) => {
1086
+ y.isUsingKeyboardRef.current || C.preventDefault();
1087
+ }),
1088
+ preventScrollOnEntryFocus: !0,
1089
+ children: /* @__PURE__ */ a(
1090
+ Gr,
1091
+ {
1092
+ role: "menu",
1093
+ "aria-orientation": "vertical",
1094
+ "data-state": Jt(g.open),
1095
+ "data-radix-menu-content": "",
1096
+ dir: y.dir,
1097
+ ...E,
1098
+ ...h,
1099
+ ref: R,
1100
+ style: { outline: "none", ...h.style },
1101
+ onKeyDown: N(h.onKeyDown, (C) => {
1102
+ const I = C.target.closest("[data-radix-menu-content]") === C.currentTarget, G = C.ctrlKey || C.altKey || C.metaKey, oe = C.key.length === 1;
1103
+ I && (C.key === "Tab" && C.preventDefault(), !G && oe && ne(C.key));
1104
+ const ae = M.current;
1105
+ if (C.target !== ae || !so.includes(C.key)) return;
1106
+ C.preventDefault();
1107
+ const X = x().filter((z) => !z.disabled).map((z) => z.ref.current);
1108
+ It.includes(C.key) && X.reverse(), So(X);
1109
+ }),
1110
+ onBlur: N(e.onBlur, (C) => {
1111
+ C.currentTarget.contains(C.target) || (window.clearTimeout(U.current), k.current = "");
1112
+ }),
1113
+ onPointerMove: N(
1114
+ e.onPointerMove,
1115
+ fe((C) => {
1116
+ const T = C.target, I = ee.current !== C.clientX;
1117
+ if (C.currentTarget.contains(T) && I) {
1118
+ const G = C.clientX > ee.current ? "right" : "left";
1119
+ B.current = G, ee.current = C.clientX;
1120
+ }
1121
+ })
1122
+ )
1123
+ }
1124
+ )
1125
+ }
1126
+ )
1127
+ }
1128
+ )
1129
+ }
1130
+ ) })
1131
+ }
1132
+ );
1133
+ }
1134
+ );
1135
+ Ft.displayName = $;
1136
+ var bo = "MenuGroup", Ge = s.forwardRef(
1137
+ (e, t) => {
1138
+ const { __scopeMenu: n, ...r } = e;
1139
+ return /* @__PURE__ */ a(A.div, { role: "group", ...r, ref: t });
1140
+ }
1141
+ );
1142
+ Ge.displayName = bo;
1143
+ var Co = "MenuLabel", Lt = s.forwardRef(
1144
+ (e, t) => {
1145
+ const { __scopeMenu: n, ...r } = e;
1146
+ return /* @__PURE__ */ a(A.div, { ...r, ref: t });
1147
+ }
1148
+ );
1149
+ Lt.displayName = Co;
1150
+ var Ee = "MenuItem", et = "menu.itemSelect", Me = s.forwardRef(
1151
+ (e, t) => {
1152
+ const { disabled: n = !1, onSelect: r, ...o } = e, i = s.useRef(null), d = ge(Ee, e.__scopeMenu), c = Ue(Ee, e.__scopeMenu), p = O(t, i), u = s.useRef(!1), l = () => {
1153
+ const f = i.current;
1154
+ if (!n && f) {
1155
+ const m = new CustomEvent(et, { bubbles: !0, cancelable: !0 });
1156
+ f.addEventListener(et, (w) => r == null ? void 0 : r(w), { once: !0 }), at(f, m), m.defaultPrevented ? u.current = !1 : d.onClose();
1157
+ }
1158
+ };
1159
+ return /* @__PURE__ */ a(
1160
+ $t,
1161
+ {
1162
+ ...o,
1163
+ ref: p,
1164
+ disabled: n,
1165
+ onClick: N(e.onClick, l),
1166
+ onPointerDown: (f) => {
1167
+ var m;
1168
+ (m = e.onPointerDown) == null || m.call(e, f), u.current = !0;
1169
+ },
1170
+ onPointerUp: N(e.onPointerUp, (f) => {
1171
+ var m;
1172
+ u.current || (m = f.currentTarget) == null || m.click();
1173
+ }),
1174
+ onKeyDown: N(e.onKeyDown, (f) => {
1175
+ const m = c.searchRef.current !== "";
1176
+ n || m && f.key === " " || Te.includes(f.key) && (f.currentTarget.click(), f.preventDefault());
1177
+ })
1178
+ }
1179
+ );
1180
+ }
1181
+ );
1182
+ Me.displayName = Ee;
1183
+ var $t = s.forwardRef(
1184
+ (e, t) => {
1185
+ const { __scopeMenu: n, disabled: r = !1, textValue: o, ...i } = e, d = Ue(Ee, n), c = Dt(n), p = s.useRef(null), u = O(t, p), [l, f] = s.useState(!1), [m, w] = s.useState("");
1186
+ return s.useEffect(() => {
1187
+ const b = p.current;
1188
+ b && w((b.textContent ?? "").trim());
1189
+ }, [i.children]), /* @__PURE__ */ a(
1190
+ le.ItemSlot,
1191
+ {
1192
+ scope: n,
1193
+ disabled: r,
1194
+ textValue: o ?? m,
1195
+ children: /* @__PURE__ */ a(oo, { asChild: !0, ...c, focusable: !r, children: /* @__PURE__ */ a(
1196
+ A.div,
1197
+ {
1198
+ role: "menuitem",
1199
+ "data-highlighted": l ? "" : void 0,
1200
+ "aria-disabled": r || void 0,
1201
+ "data-disabled": r ? "" : void 0,
1202
+ ...i,
1203
+ ref: u,
1204
+ onPointerMove: N(
1205
+ e.onPointerMove,
1206
+ fe((b) => {
1207
+ r ? d.onItemLeave(b) : (d.onItemEnter(b), b.defaultPrevented || b.currentTarget.focus({ preventScroll: !0 }));
1208
+ })
1209
+ ),
1210
+ onPointerLeave: N(
1211
+ e.onPointerLeave,
1212
+ fe((b) => d.onItemLeave(b))
1213
+ ),
1214
+ onFocus: N(e.onFocus, () => f(!0)),
1215
+ onBlur: N(e.onBlur, () => f(!1))
1216
+ }
1217
+ ) })
1218
+ }
1219
+ );
1220
+ }
1221
+ ), Eo = "MenuCheckboxItem", Ut = s.forwardRef(
1222
+ (e, t) => {
1223
+ const { checked: n = !1, onCheckedChange: r, ...o } = e;
1224
+ return /* @__PURE__ */ a(Wt, { scope: e.__scopeMenu, checked: n, children: /* @__PURE__ */ a(
1225
+ Me,
1226
+ {
1227
+ role: "menuitemcheckbox",
1228
+ "aria-checked": xe(n) ? "mixed" : n,
1229
+ ...o,
1230
+ ref: t,
1231
+ "data-state": ze(n),
1232
+ onSelect: N(
1233
+ o.onSelect,
1234
+ () => r == null ? void 0 : r(xe(n) ? !0 : !n),
1235
+ { checkForDefaultPrevented: !1 }
1236
+ )
1237
+ }
1238
+ ) });
1239
+ }
1240
+ );
1241
+ Ut.displayName = Eo;
1242
+ var Kt = "MenuRadioGroup", [xo, No] = J(
1243
+ Kt,
1244
+ { value: void 0, onValueChange: () => {
1245
+ } }
1246
+ ), Gt = s.forwardRef(
1247
+ (e, t) => {
1248
+ const { value: n, onValueChange: r, ...o } = e, i = V(r);
1249
+ return /* @__PURE__ */ a(xo, { scope: e.__scopeMenu, value: n, onValueChange: i, children: /* @__PURE__ */ a(Ge, { ...o, ref: t }) });
1250
+ }
1251
+ );
1252
+ Gt.displayName = Kt;
1253
+ var Bt = "MenuRadioItem", zt = s.forwardRef(
1254
+ (e, t) => {
1255
+ const { value: n, ...r } = e, o = No(Bt, e.__scopeMenu), i = n === o.value;
1256
+ return /* @__PURE__ */ a(Wt, { scope: e.__scopeMenu, checked: i, children: /* @__PURE__ */ a(
1257
+ Me,
1258
+ {
1259
+ role: "menuitemradio",
1260
+ "aria-checked": i,
1261
+ ...r,
1262
+ ref: t,
1263
+ "data-state": ze(i),
1264
+ onSelect: N(
1265
+ r.onSelect,
1266
+ () => {
1267
+ var d;
1268
+ return (d = o.onValueChange) == null ? void 0 : d.call(o, n);
1269
+ },
1270
+ { checkForDefaultPrevented: !1 }
1271
+ )
1272
+ }
1273
+ ) });
1274
+ }
1275
+ );
1276
+ zt.displayName = Bt;
1277
+ var Be = "MenuItemIndicator", [Wt, Mo] = J(
1278
+ Be,
1279
+ { checked: !1 }
1280
+ ), jt = s.forwardRef(
1281
+ (e, t) => {
1282
+ const { __scopeMenu: n, forceMount: r, ...o } = e, i = Mo(Be, n);
1283
+ return /* @__PURE__ */ a(
1284
+ me,
1285
+ {
1286
+ present: r || xe(i.checked) || i.checked === !0,
1287
+ children: /* @__PURE__ */ a(
1288
+ A.span,
1289
+ {
1290
+ ...o,
1291
+ ref: t,
1292
+ "data-state": ze(i.checked)
1293
+ }
1294
+ )
1295
+ }
1296
+ );
1297
+ }
1298
+ );
1299
+ jt.displayName = Be;
1300
+ var Ro = "MenuSeparator", Vt = s.forwardRef(
1301
+ (e, t) => {
1302
+ const { __scopeMenu: n, ...r } = e;
1303
+ return /* @__PURE__ */ a(
1304
+ A.div,
1305
+ {
1306
+ role: "separator",
1307
+ "aria-orientation": "horizontal",
1308
+ ...r,
1309
+ ref: t
1310
+ }
1311
+ );
1312
+ }
1313
+ );
1314
+ Vt.displayName = Ro;
1315
+ var _o = "MenuArrow", Ht = s.forwardRef(
1316
+ (e, t) => {
1317
+ const { __scopeMenu: n, ...r } = e, o = Ne(n);
1318
+ return /* @__PURE__ */ a(Br, { ...o, ...r, ref: t });
1319
+ }
1320
+ );
1321
+ Ht.displayName = _o;
1322
+ var Po = "MenuSub", [Aa, Yt] = J(Po), ue = "MenuSubTrigger", Xt = s.forwardRef(
1323
+ (e, t) => {
1324
+ const n = Q(ue, e.__scopeMenu), r = ge(ue, e.__scopeMenu), o = Yt(ue, e.__scopeMenu), i = Ue(ue, e.__scopeMenu), d = s.useRef(null), { pointerGraceTimerRef: c, onPointerGraceIntentChange: p } = i, u = { __scopeMenu: e.__scopeMenu }, l = s.useCallback(() => {
1325
+ d.current && window.clearTimeout(d.current), d.current = null;
1326
+ }, []);
1327
+ return s.useEffect(() => l, [l]), s.useEffect(() => {
1328
+ const f = c.current;
1329
+ return () => {
1330
+ window.clearTimeout(f), p(null);
1331
+ };
1332
+ }, [c, p]), /* @__PURE__ */ a(Le, { asChild: !0, ...u, children: /* @__PURE__ */ a(
1333
+ $t,
1334
+ {
1335
+ id: o.triggerId,
1336
+ "aria-haspopup": "menu",
1337
+ "aria-expanded": n.open,
1338
+ "aria-controls": o.contentId,
1339
+ "data-state": Jt(n.open),
1340
+ ...e,
1341
+ ref: Oe(t, o.onTriggerChange),
1342
+ onClick: (f) => {
1343
+ var m;
1344
+ (m = e.onClick) == null || m.call(e, f), !(e.disabled || f.defaultPrevented) && (f.currentTarget.focus(), n.open || n.onOpenChange(!0));
1345
+ },
1346
+ onPointerMove: N(
1347
+ e.onPointerMove,
1348
+ fe((f) => {
1349
+ i.onItemEnter(f), !f.defaultPrevented && !e.disabled && !n.open && !d.current && (i.onPointerGraceIntentChange(null), d.current = window.setTimeout(() => {
1350
+ n.onOpenChange(!0), l();
1351
+ }, 100));
1352
+ })
1353
+ ),
1354
+ onPointerLeave: N(
1355
+ e.onPointerLeave,
1356
+ fe((f) => {
1357
+ var w, b;
1358
+ l();
1359
+ const m = (w = n.content) == null ? void 0 : w.getBoundingClientRect();
1360
+ if (m) {
1361
+ const h = (b = n.content) == null ? void 0 : b.dataset.side, g = h === "right", y = g ? -5 : 5, E = m[g ? "left" : "right"], v = m[g ? "right" : "left"];
1362
+ i.onPointerGraceIntentChange({
1363
+ area: [
1364
+ // Apply a bleed on clientX to ensure that our exit point is
1365
+ // consistently within polygon bounds
1366
+ { x: f.clientX + y, y: f.clientY },
1367
+ { x: E, y: m.top },
1368
+ { x: v, y: m.top },
1369
+ { x: v, y: m.bottom },
1370
+ { x: E, y: m.bottom }
1371
+ ],
1372
+ side: h
1373
+ }), window.clearTimeout(c.current), c.current = window.setTimeout(
1374
+ () => i.onPointerGraceIntentChange(null),
1375
+ 300
1376
+ );
1377
+ } else {
1378
+ if (i.onTriggerLeave(f), f.defaultPrevented) return;
1379
+ i.onPointerGraceIntentChange(null);
1380
+ }
1381
+ })
1382
+ ),
1383
+ onKeyDown: N(e.onKeyDown, (f) => {
1384
+ var w;
1385
+ const m = i.searchRef.current !== "";
1386
+ e.disabled || m && f.key === " " || io[r.dir].includes(f.key) && (n.onOpenChange(!0), (w = n.content) == null || w.focus(), f.preventDefault());
1387
+ })
1388
+ }
1389
+ ) });
1390
+ }
1391
+ );
1392
+ Xt.displayName = ue;
1393
+ var qt = "MenuSubContent", Zt = s.forwardRef(
1394
+ (e, t) => {
1395
+ const n = Ot($, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, i = Q($, e.__scopeMenu), d = ge($, e.__scopeMenu), c = Yt(qt, e.__scopeMenu), p = s.useRef(null), u = O(t, p);
1396
+ return /* @__PURE__ */ a(le.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ a(me, { present: r || i.open, children: /* @__PURE__ */ a(le.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ a(
1397
+ Ke,
1398
+ {
1399
+ id: c.contentId,
1400
+ "aria-labelledby": c.triggerId,
1401
+ ...o,
1402
+ ref: u,
1403
+ align: "start",
1404
+ side: d.dir === "rtl" ? "left" : "right",
1405
+ disableOutsidePointerEvents: !1,
1406
+ disableOutsideScroll: !1,
1407
+ trapFocus: !1,
1408
+ onOpenAutoFocus: (l) => {
1409
+ var f;
1410
+ d.isUsingKeyboardRef.current && ((f = p.current) == null || f.focus()), l.preventDefault();
1411
+ },
1412
+ onCloseAutoFocus: (l) => l.preventDefault(),
1413
+ onFocusOutside: N(e.onFocusOutside, (l) => {
1414
+ l.target !== c.trigger && i.onOpenChange(!1);
1415
+ }),
1416
+ onEscapeKeyDown: N(e.onEscapeKeyDown, (l) => {
1417
+ d.onClose(), l.preventDefault();
1418
+ }),
1419
+ onKeyDown: N(e.onKeyDown, (l) => {
1420
+ var w;
1421
+ const f = l.currentTarget.contains(l.target), m = co[d.dir].includes(l.key);
1422
+ f && m && (i.onOpenChange(!1), (w = c.trigger) == null || w.focus(), l.preventDefault());
1423
+ })
1424
+ }
1425
+ ) }) }) });
1426
+ }
1427
+ );
1428
+ Zt.displayName = qt;
1429
+ function Jt(e) {
1430
+ return e ? "open" : "closed";
1431
+ }
1432
+ function xe(e) {
1433
+ return e === "indeterminate";
1434
+ }
1435
+ function ze(e) {
1436
+ return xe(e) ? "indeterminate" : e ? "checked" : "unchecked";
1437
+ }
1438
+ function So(e) {
1439
+ const t = document.activeElement;
1440
+ for (const n of e)
1441
+ if (n === t || (n.focus(), document.activeElement !== t)) return;
1442
+ }
1443
+ function Io(e, t) {
1444
+ return e.map((n, r) => e[(t + r) % e.length]);
1445
+ }
1446
+ function Ao(e, t, n) {
1447
+ const o = t.length > 1 && Array.from(t).every((u) => u === t[0]) ? t[0] : t, i = n ? e.indexOf(n) : -1;
1448
+ let d = Io(e, Math.max(i, 0));
1449
+ o.length === 1 && (d = d.filter((u) => u !== n));
1450
+ const p = d.find(
1451
+ (u) => u.toLowerCase().startsWith(o.toLowerCase())
1452
+ );
1453
+ return p !== n ? p : void 0;
1454
+ }
1455
+ function Do(e, t) {
1456
+ const { x: n, y: r } = e;
1457
+ let o = !1;
1458
+ for (let i = 0, d = t.length - 1; i < t.length; d = i++) {
1459
+ const c = t[i], p = t[d], u = c.x, l = c.y, f = p.x, m = p.y;
1460
+ l > r != m > r && n < (f - u) * (r - l) / (m - l) + u && (o = !o);
1461
+ }
1462
+ return o;
1463
+ }
1464
+ function To(e, t) {
1465
+ if (!t) return !1;
1466
+ const n = { x: e.clientX, y: e.clientY };
1467
+ return Do(n, t);
1468
+ }
1469
+ function fe(e) {
1470
+ return (t) => t.pointerType === "mouse" ? e(t) : void 0;
1471
+ }
1472
+ var Oo = Tt, ko = Le, Fo = kt, Lo = Ft, $o = Ge, Uo = Lt, Ko = Me, Go = Ut, Bo = Gt, zo = zt, Wo = jt, jo = Vt, Vo = Ht, Ho = Xt, Yo = Zt, Re = "DropdownMenu", [Xo] = pe(
1473
+ Re,
1474
+ [At]
1475
+ ), D = At(), [qo, Qt] = Xo(Re), en = (e) => {
1476
+ const {
1477
+ __scopeDropdownMenu: t,
1478
+ children: n,
1479
+ dir: r,
1480
+ open: o,
1481
+ defaultOpen: i,
1482
+ onOpenChange: d,
1483
+ modal: c = !0
1484
+ } = e, p = D(t), u = s.useRef(null), [l, f] = rt({
1485
+ prop: o,
1486
+ defaultProp: i ?? !1,
1487
+ onChange: d,
1488
+ caller: Re
1489
+ });
1490
+ return /* @__PURE__ */ a(
1491
+ qo,
1492
+ {
1493
+ scope: t,
1494
+ triggerId: Ie(),
1495
+ triggerRef: u,
1496
+ contentId: Ie(),
1497
+ open: l,
1498
+ onOpenChange: f,
1499
+ onOpenToggle: s.useCallback(() => f((m) => !m), [f]),
1500
+ modal: c,
1501
+ children: /* @__PURE__ */ a(Oo, { ...p, open: l, onOpenChange: f, dir: r, modal: c, children: n })
1502
+ }
1503
+ );
1504
+ };
1505
+ en.displayName = Re;
1506
+ var tn = "DropdownMenuTrigger", nn = s.forwardRef(
1507
+ (e, t) => {
1508
+ const { __scopeDropdownMenu: n, disabled: r = !1, ...o } = e, i = Qt(tn, n), d = D(n);
1509
+ return /* @__PURE__ */ a(ko, { asChild: !0, ...d, children: /* @__PURE__ */ a(
1510
+ A.button,
1511
+ {
1512
+ type: "button",
1513
+ id: i.triggerId,
1514
+ "aria-haspopup": "menu",
1515
+ "aria-expanded": i.open,
1516
+ "aria-controls": i.open ? i.contentId : void 0,
1517
+ "data-state": i.open ? "open" : "closed",
1518
+ "data-disabled": r ? "" : void 0,
1519
+ disabled: r,
1520
+ ...o,
1521
+ ref: Oe(t, i.triggerRef),
1522
+ onPointerDown: N(e.onPointerDown, (c) => {
1523
+ !r && c.button === 0 && c.ctrlKey === !1 && (i.onOpenToggle(), i.open || c.preventDefault());
1524
+ }),
1525
+ onKeyDown: N(e.onKeyDown, (c) => {
1526
+ r || (["Enter", " "].includes(c.key) && i.onOpenToggle(), c.key === "ArrowDown" && i.onOpenChange(!0), ["Enter", " ", "ArrowDown"].includes(c.key) && c.preventDefault());
1527
+ })
1528
+ }
1529
+ ) });
1530
+ }
1531
+ );
1532
+ nn.displayName = tn;
1533
+ var Zo = "DropdownMenuPortal", rn = (e) => {
1534
+ const { __scopeDropdownMenu: t, ...n } = e, r = D(t);
1535
+ return /* @__PURE__ */ a(Fo, { ...r, ...n });
1536
+ };
1537
+ rn.displayName = Zo;
1538
+ var on = "DropdownMenuContent", an = s.forwardRef(
1539
+ (e, t) => {
1540
+ const { __scopeDropdownMenu: n, ...r } = e, o = Qt(on, n), i = D(n), d = s.useRef(!1);
1541
+ return /* @__PURE__ */ a(
1542
+ Lo,
1543
+ {
1544
+ id: o.contentId,
1545
+ "aria-labelledby": o.triggerId,
1546
+ ...i,
1547
+ ...r,
1548
+ ref: t,
1549
+ onCloseAutoFocus: N(e.onCloseAutoFocus, (c) => {
1550
+ var p;
1551
+ d.current || (p = o.triggerRef.current) == null || p.focus(), d.current = !1, c.preventDefault();
1552
+ }),
1553
+ onInteractOutside: N(e.onInteractOutside, (c) => {
1554
+ const p = c.detail.originalEvent, u = p.button === 0 && p.ctrlKey === !0, l = p.button === 2 || u;
1555
+ (!o.modal || l) && (d.current = !0);
1556
+ }),
1557
+ style: {
1558
+ ...e.style,
1559
+ "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
1560
+ "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
1561
+ "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
1562
+ "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
1563
+ "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
1564
+ }
1565
+ }
1566
+ );
1567
+ }
1568
+ );
1569
+ an.displayName = on;
1570
+ var Jo = "DropdownMenuGroup", Qo = s.forwardRef(
1571
+ (e, t) => {
1572
+ const { __scopeDropdownMenu: n, ...r } = e, o = D(n);
1573
+ return /* @__PURE__ */ a($o, { ...o, ...r, ref: t });
1574
+ }
1575
+ );
1576
+ Qo.displayName = Jo;
1577
+ var ea = "DropdownMenuLabel", sn = s.forwardRef(
1578
+ (e, t) => {
1579
+ const { __scopeDropdownMenu: n, ...r } = e, o = D(n);
1580
+ return /* @__PURE__ */ a(Uo, { ...o, ...r, ref: t });
1581
+ }
1582
+ );
1583
+ sn.displayName = ea;
1584
+ var ta = "DropdownMenuItem", cn = s.forwardRef(
1585
+ (e, t) => {
1586
+ const { __scopeDropdownMenu: n, ...r } = e, o = D(n);
1587
+ return /* @__PURE__ */ a(Ko, { ...o, ...r, ref: t });
1588
+ }
1589
+ );
1590
+ cn.displayName = ta;
1591
+ var na = "DropdownMenuCheckboxItem", un = s.forwardRef((e, t) => {
1592
+ const { __scopeDropdownMenu: n, ...r } = e, o = D(n);
1593
+ return /* @__PURE__ */ a(Go, { ...o, ...r, ref: t });
1594
+ });
1595
+ un.displayName = na;
1596
+ var ra = "DropdownMenuRadioGroup", oa = s.forwardRef((e, t) => {
1597
+ const { __scopeDropdownMenu: n, ...r } = e, o = D(n);
1598
+ return /* @__PURE__ */ a(Bo, { ...o, ...r, ref: t });
1599
+ });
1600
+ oa.displayName = ra;
1601
+ var aa = "DropdownMenuRadioItem", dn = s.forwardRef((e, t) => {
1602
+ const { __scopeDropdownMenu: n, ...r } = e, o = D(n);
1603
+ return /* @__PURE__ */ a(zo, { ...o, ...r, ref: t });
1604
+ });
1605
+ dn.displayName = aa;
1606
+ var sa = "DropdownMenuItemIndicator", ln = s.forwardRef((e, t) => {
1607
+ const { __scopeDropdownMenu: n, ...r } = e, o = D(n);
1608
+ return /* @__PURE__ */ a(Wo, { ...o, ...r, ref: t });
1609
+ });
1610
+ ln.displayName = sa;
1611
+ var ia = "DropdownMenuSeparator", fn = s.forwardRef((e, t) => {
1612
+ const { __scopeDropdownMenu: n, ...r } = e, o = D(n);
1613
+ return /* @__PURE__ */ a(jo, { ...o, ...r, ref: t });
1614
+ });
1615
+ fn.displayName = ia;
1616
+ var ca = "DropdownMenuArrow", ua = s.forwardRef(
1617
+ (e, t) => {
1618
+ const { __scopeDropdownMenu: n, ...r } = e, o = D(n);
1619
+ return /* @__PURE__ */ a(Vo, { ...o, ...r, ref: t });
1620
+ }
1621
+ );
1622
+ ua.displayName = ca;
1623
+ var da = "DropdownMenuSubTrigger", pn = s.forwardRef((e, t) => {
1624
+ const { __scopeDropdownMenu: n, ...r } = e, o = D(n);
1625
+ return /* @__PURE__ */ a(Ho, { ...o, ...r, ref: t });
1626
+ });
1627
+ pn.displayName = da;
1628
+ var la = "DropdownMenuSubContent", mn = s.forwardRef((e, t) => {
1629
+ const { __scopeDropdownMenu: n, ...r } = e, o = D(n);
1630
+ return /* @__PURE__ */ a(
1631
+ Yo,
1632
+ {
1633
+ ...o,
1634
+ ...r,
1635
+ ref: t,
1636
+ style: {
1637
+ ...e.style,
1638
+ "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
1639
+ "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
1640
+ "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
1641
+ "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
1642
+ "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
1643
+ }
1644
+ }
1645
+ );
1646
+ });
1647
+ mn.displayName = la;
1648
+ var fa = en, pa = nn, ma = rn, hn = an, vn = sn, gn = cn, yn = un, wn = dn, bn = ln, Cn = fn, En = pn, xn = mn;
1649
+ const Nn = fa, Mn = pa, ha = s.forwardRef(({ className: e, inset: t, children: n, ...r }, o) => /* @__PURE__ */ _(
1650
+ En,
1651
+ {
1652
+ ref: o,
1653
+ className: H(
1654
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",
1655
+ t === !0 && "pl-8",
1656
+ e
1657
+ ),
1658
+ ...r,
1659
+ children: [
1660
+ n,
1661
+ /* @__PURE__ */ a(tt, { className: "ml-auto size-4" })
1662
+ ]
1663
+ }
1664
+ ));
1665
+ ha.displayName = En.displayName;
1666
+ const va = s.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ a(
1667
+ xn,
1668
+ {
1669
+ ref: n,
1670
+ className: H(
1671
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1672
+ e
1673
+ ),
1674
+ ...t
1675
+ }
1676
+ ));
1677
+ va.displayName = xn.displayName;
1678
+ const We = s.forwardRef(({ className: e, sideOffset: t = 4, ...n }, r) => /* @__PURE__ */ a(ma, { children: /* @__PURE__ */ a(
1679
+ hn,
1680
+ {
1681
+ ref: r,
1682
+ sideOffset: t,
1683
+ className: H(
1684
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1685
+ e
1686
+ ),
1687
+ ...n
1688
+ }
1689
+ ) }));
1690
+ We.displayName = hn.displayName;
1691
+ const Rn = s.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */ a(
1692
+ gn,
1693
+ {
1694
+ ref: r,
1695
+ className: H(
1696
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",
1697
+ t === !0 && "pl-8",
1698
+ e
1699
+ ),
1700
+ ...n
1701
+ }
1702
+ ));
1703
+ Rn.displayName = gn.displayName;
1704
+ const _n = s.forwardRef(({ className: e, children: t, checked: n, ...r }, o) => /* @__PURE__ */ _(
1705
+ yn,
1706
+ {
1707
+ ref: o,
1708
+ className: H(
1709
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",
1710
+ e
1711
+ ),
1712
+ checked: n,
1713
+ ...r,
1714
+ children: [
1715
+ /* @__PURE__ */ a("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a(bn, { children: /* @__PURE__ */ a(Hn, { className: "size-4" }) }) }),
1716
+ t
1717
+ ]
1718
+ }
1719
+ ));
1720
+ _n.displayName = yn.displayName;
1721
+ const ga = s.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ _(
1722
+ wn,
1723
+ {
1724
+ ref: r,
1725
+ className: H(
1726
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",
1727
+ e
1728
+ ),
1729
+ ...n,
1730
+ children: [
1731
+ /* @__PURE__ */ a("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a(bn, { children: /* @__PURE__ */ a(or, { className: "h-2 w-2 fill-current" }) }) }),
1732
+ t
1733
+ ]
1734
+ }
1735
+ ));
1736
+ ga.displayName = wn.displayName;
1737
+ const ya = s.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */ a(vn, { ref: r, className: H("px-2 py-1.5 text-sm font-semibold", t === !0 && "pl-8", e), ...n }));
1738
+ ya.displayName = vn.displayName;
1739
+ const wa = s.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ a(Cn, { ref: n, className: H("-mx-1 my-1 h-px bg-muted", e), ...t }));
1740
+ wa.displayName = Cn.displayName;
1741
+ function ba({ actions: e, row: t }) {
1742
+ return /* @__PURE__ */ _(Nn, { children: [
1743
+ /* @__PURE__ */ a(Mn, { asChild: !0, children: /* @__PURE__ */ a(re, { variant: "ghost", size: "icon", className: "h-8 w-8 text-muted-foreground hover:text-foreground", children: /* @__PURE__ */ a(sr, { className: "size-4" }) }) }),
1744
+ /* @__PURE__ */ a(
1745
+ We,
1746
+ {
1747
+ align: "end",
1748
+ onClick: (n) => {
1749
+ n.stopPropagation();
1750
+ },
1751
+ children: e.map((n, r) => {
1752
+ const o = n.icon;
1753
+ return /* @__PURE__ */ _(
1754
+ Rn,
1755
+ {
1756
+ onClick: () => {
1757
+ n.onClick(t);
1758
+ },
1759
+ className: n.className,
1760
+ children: [
1761
+ o !== void 0 && /* @__PURE__ */ a("span", { className: "mr-2 size-4 flex items-center justify-center", children: /* @__PURE__ */ a(o, { className: "size-4" }) }),
1762
+ n.label
1763
+ ]
1764
+ },
1765
+ r
1766
+ );
1767
+ })
1768
+ }
1769
+ )
1770
+ ] });
1771
+ }
1772
+ function Da({
1773
+ isLoading: e,
1774
+ colSpanCount: t,
1775
+ noDataMessage: n,
1776
+ paginatedData: r,
1777
+ getRowId: o,
1778
+ onRowClick: i,
1779
+ hasBulkActions: d,
1780
+ selectedRows: c,
1781
+ toggleRowSelection: p,
1782
+ visibleColumnsArray: u,
1783
+ columnWidths: l,
1784
+ hasActions: f,
1785
+ actions: m,
1786
+ columns: w
1787
+ }) {
1788
+ const b = (h, g) => {
1789
+ const y = w.find((v) => v.key === g);
1790
+ if ((y == null ? void 0 : y.renderCell) !== void 0)
1791
+ return y.renderCell(h);
1792
+ const E = h[g];
1793
+ return /* @__PURE__ */ a("span", { className: "text-sm truncate", children: E != null ? String(E) : "-" });
1794
+ };
1795
+ return e ? /* @__PURE__ */ a("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-800", children: /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: t, className: "py-8 text-center", children: /* @__PURE__ */ _("div", { className: "flex flex-col items-center justify-center gap-2 text-muted-foreground", children: [
1796
+ /* @__PURE__ */ a(Yn, { className: "h-6 w-6 animate-spin text-primary" }),
1797
+ /* @__PURE__ */ a("span", { className: "text-sm", children: "Chargement..." })
1798
+ ] }) }) }) }) : r.length === 0 ? /* @__PURE__ */ a("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-800", children: /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: t, className: "py-8 text-center text-sm text-muted-foreground", children: n }) }) }) : /* @__PURE__ */ a("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-800", children: r.map((h) => {
1799
+ const g = o(h);
1800
+ return /* @__PURE__ */ _(
1801
+ "tr",
1802
+ {
1803
+ className: `group hover:bg-muted/50 dark:hover:bg-gray-900/50 transition-colors ${i !== void 0 ? "cursor-pointer" : ""}`,
1804
+ onClick: () => i == null ? void 0 : i(h),
1805
+ children: [
1806
+ d ? /* @__PURE__ */ a(
1807
+ "td",
1808
+ {
1809
+ className: "px-4 py-2 w-12",
1810
+ onClick: (y) => {
1811
+ y.stopPropagation();
1812
+ },
1813
+ children: /* @__PURE__ */ a(
1814
+ nt,
1815
+ {
1816
+ checked: c.includes(g),
1817
+ onCheckedChange: () => {
1818
+ p(g);
1819
+ }
1820
+ }
1821
+ )
1822
+ }
1823
+ ) : null,
1824
+ u.map((y, E) => {
1825
+ const v = E === u.length - 1;
1826
+ return /* @__PURE__ */ a(
1827
+ "td",
1828
+ {
1829
+ className: `px-2 py-2 border-r border-gray-100 dark:border-gray-800 relative ${v ? "border-r-0" : ""}`,
1830
+ style: { width: l[y.key] },
1831
+ children: /* @__PURE__ */ a("div", { className: "w-full h-full", children: b(h, y.key) })
1832
+ },
1833
+ y.key
1834
+ );
1835
+ }),
1836
+ f && m !== void 0 && m.length > 0 ? /* @__PURE__ */ a(
1837
+ "td",
1838
+ {
1839
+ className: "px-2 py-2 w-12 text-end",
1840
+ onClick: (y) => {
1841
+ y.stopPropagation();
1842
+ },
1843
+ children: /* @__PURE__ */ a(ba, { actions: m, row: h })
1844
+ }
1845
+ ) : null
1846
+ ]
1847
+ },
1848
+ g
1849
+ );
1850
+ }) });
1851
+ }
1852
+ function Ta({ selectedRows: e, setSelectedRows: t, bulkActions: n }) {
1853
+ return /* @__PURE__ */ _("div", { className: "bg-muted/60 dark:bg-gray-900/60 border border-border px-3 py-1.5 flex items-center justify-between rounded-lg", children: [
1854
+ /* @__PURE__ */ _("div", { className: "flex items-center gap-4", children: [
1855
+ /* @__PURE__ */ _("span", { className: "text-sm font-medium text-primary ml-1", children: [
1856
+ e.length,
1857
+ " sélectionné(s)"
1858
+ ] }),
1859
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: n.map((r, o) => {
1860
+ const i = r.icon;
1861
+ return /* @__PURE__ */ _(
1862
+ re,
1863
+ {
1864
+ variant: "outline",
1865
+ size: "sm",
1866
+ onClick: () => {
1867
+ r.onClick(e, () => {
1868
+ t([]);
1869
+ });
1870
+ },
1871
+ className: `h-7 bg-background shadow-sm text-xs px-2.5 ${r.variant === "destructive" ? "text-destructive border-destructive/30 hover:bg-destructive/10 hover:text-destructive" : "text-foreground"}`,
1872
+ children: [
1873
+ i !== void 0 && /* @__PURE__ */ a("span", { className: "mr-1.5 flex items-center justify-center", children: /* @__PURE__ */ a(i, { className: "h-3.5 w-3.5" }) }),
1874
+ r.label
1875
+ ]
1876
+ },
1877
+ o
1878
+ );
1879
+ }) })
1880
+ ] }),
1881
+ /* @__PURE__ */ a(
1882
+ re,
1883
+ {
1884
+ variant: "ghost",
1885
+ size: "sm",
1886
+ onClick: () => {
1887
+ t([]);
1888
+ },
1889
+ className: "text-xs text-muted-foreground hover:text-foreground h-7 px-2",
1890
+ children: "Désélectionner"
1891
+ }
1892
+ )
1893
+ ] });
1894
+ }
1895
+ function Oa({
1896
+ hasBulkActions: e,
1897
+ selectedRows: t,
1898
+ totalItems: n,
1899
+ toggleSelectAll: r,
1900
+ visibleColumnsArray: o,
1901
+ draggableColumns: i,
1902
+ resizableColumns: d,
1903
+ columnWidths: c,
1904
+ sortColumn: p,
1905
+ sortDirection: u,
1906
+ handleSort: l,
1907
+ handleDragStart: f,
1908
+ handleDragOver: m,
1909
+ handleDrop: w,
1910
+ handleMouseDown: b,
1911
+ hasActions: h,
1912
+ settingsNode: g
1913
+ }) {
1914
+ const y = (v) => v.sortable !== !0 ? null : p === v.key ? u === "asc" ? /* @__PURE__ */ a(nr, { className: "size-3.5 text-foreground" }) : /* @__PURE__ */ a(Jn, { className: "size-3.5 text-foreground" }) : /* @__PURE__ */ a(er, { className: "size-3.5 text-muted-foreground/50 group-hover:text-muted-foreground transition-colors" }), E = (v, x) => {
1915
+ const S = x !== !1, P = v.sortable === !0, M = p === v.key;
1916
+ return /* @__PURE__ */ _(
1917
+ "th",
1918
+ {
1919
+ className: [
1920
+ "px-2 py-2 text-left text-sm font-medium text-gray-900 dark:text-gray-100 relative group border-r border-gray-200 dark:border-gray-800",
1921
+ P ? "cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800 select-none" : "",
1922
+ M ? "bg-gray-100/80 dark:bg-gray-800/80" : ""
1923
+ ].filter(Boolean).join(" "),
1924
+ style: { width: c[v.key] },
1925
+ draggable: S,
1926
+ onClick: () => {
1927
+ l(v.key);
1928
+ },
1929
+ onDragStart: (R) => {
1930
+ S ? f(R, v.key) : R.preventDefault();
1931
+ },
1932
+ onDragOver: (R) => {
1933
+ m(R, v.key);
1934
+ },
1935
+ onDrop: (R) => {
1936
+ w(R, v.key);
1937
+ },
1938
+ children: [
1939
+ /* @__PURE__ */ _("div", { className: "flex items-center justify-between pr-2", children: [
1940
+ /* @__PURE__ */ _("div", { className: "flex items-center gap-1", children: [
1941
+ S ? /* @__PURE__ */ a(cr, { className: "size-4 text-gray-400 cursor-grab dark:text-gray-300 shrink-0" }) : null,
1942
+ /* @__PURE__ */ a("span", { className: "truncate", children: v.label })
1943
+ ] }),
1944
+ /* @__PURE__ */ a("div", { className: "ml-1 shrink-0", children: y(v) })
1945
+ ] }),
1946
+ d ? /* @__PURE__ */ a(
1947
+ "div",
1948
+ {
1949
+ className: "absolute right-0 top-0 bottom-0 w-2 cursor-col-resize hover:bg-blue-500 opacity-0 group-hover:opacity-50 transition-opacity",
1950
+ onMouseDown: (R) => {
1951
+ b(R, v.key);
1952
+ }
1953
+ }
1954
+ ) : null
1955
+ ]
1956
+ },
1957
+ v.key
1958
+ );
1959
+ };
1960
+ return /* @__PURE__ */ a("thead", { className: "bg-muted/50 dark:bg-gray-900/50 border-b border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ _("tr", { children: [
1961
+ e ? /* @__PURE__ */ a("th", { className: "px-4 py-2 w-12 flex-shrink-0 text-left", children: /* @__PURE__ */ a(
1962
+ nt,
1963
+ {
1964
+ checked: t.length === n && n > 0 ? !0 : t.length > 0 ? "indeterminate" : !1,
1965
+ onCheckedChange: r
1966
+ }
1967
+ ) }) : null,
1968
+ o.map((v) => E(v, i)),
1969
+ h || g !== void 0 ? /* @__PURE__ */ a("th", { className: "w-12 px-2 py-2 text-center align-middle", children: g }) : null
1970
+ ] }) });
1971
+ }
1972
+ function ka({
1973
+ totalItems: e,
1974
+ startIndex: t,
1975
+ endIndex: n,
1976
+ pageSize: r,
1977
+ setPageSize: o,
1978
+ currentPage: i,
1979
+ setCurrentPage: d,
1980
+ pageSizeOptions: c,
1981
+ totalPages: p
1982
+ }) {
1983
+ return /* @__PURE__ */ _("div", { className: "px-4 py-2 border-t border-gray-200 dark:border-gray-800 flex items-center justify-between bg-card dark:bg-gray-950 flex-wrap gap-2", children: [
1984
+ /* @__PURE__ */ _("div", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
1985
+ e === 0 ? "0" : `${String(t + 1)} - ${String(n)}`,
1986
+ " sur ",
1987
+ e
1988
+ ] }),
1989
+ /* @__PURE__ */ _("div", { className: "flex items-center gap-4", children: [
1990
+ /* @__PURE__ */ _("div", { className: "flex items-center gap-2", children: [
1991
+ /* @__PURE__ */ a("span", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Lignes par page :" }),
1992
+ /* @__PURE__ */ a(
1993
+ "select",
1994
+ {
1995
+ value: r,
1996
+ onChange: (u) => {
1997
+ o(Number(u.target.value)), d(1);
1998
+ },
1999
+ className: "border border-gray-300 dark:border-gray-700 dark:bg-gray-900 rounded px-2 py-1 text-sm text-foreground",
2000
+ children: c.map((u) => /* @__PURE__ */ a("option", { value: u, children: u }, u))
2001
+ }
2002
+ )
2003
+ ] }),
2004
+ /* @__PURE__ */ _("div", { className: "flex items-center gap-2", children: [
2005
+ /* @__PURE__ */ a(
2006
+ re,
2007
+ {
2008
+ variant: "outline",
2009
+ size: "sm",
2010
+ className: "h-8 w-8 p-0",
2011
+ onClick: () => {
2012
+ d((u) => Math.max(1, u - 1));
2013
+ },
2014
+ disabled: i === 1,
2015
+ children: /* @__PURE__ */ a(Dn, { className: "size-4" })
2016
+ }
2017
+ ),
2018
+ /* @__PURE__ */ _("span", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
2019
+ "Page ",
2020
+ i,
2021
+ " sur ",
2022
+ p
2023
+ ] }),
2024
+ /* @__PURE__ */ a(
2025
+ re,
2026
+ {
2027
+ variant: "outline",
2028
+ size: "sm",
2029
+ className: "h-8 w-8 p-0",
2030
+ onClick: () => {
2031
+ d((u) => Math.min(p, u + 1));
2032
+ },
2033
+ disabled: i === p,
2034
+ children: /* @__PURE__ */ a(tt, { className: "size-4" })
2035
+ }
2036
+ )
2037
+ ] })
2038
+ ] })
2039
+ ] });
2040
+ }
2041
+ function Fa({ columns: e, visibleColumns: t, toggleColumnVisibility: n }) {
2042
+ return /* @__PURE__ */ _(Nn, { children: [
2043
+ /* @__PURE__ */ a(Mn, { asChild: !0, children: /* @__PURE__ */ a(re, { variant: "outline", size: "sm", className: "size-8 p-0 bg-white hover:bg-gray-100 dark:bg-gray-900 shadow-sm border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ a(dr, { className: "size-4 text-gray-600 dark:text-gray-300" }) }) }),
2044
+ /* @__PURE__ */ a(We, { align: "end", className: "w-56", children: e.map((r) => /* @__PURE__ */ a(
2045
+ _n,
2046
+ {
2047
+ checked: t.has(r.key),
2048
+ onCheckedChange: () => {
2049
+ n(r.key);
2050
+ },
2051
+ children: r.label
2052
+ },
2053
+ r.key
2054
+ )) })
2055
+ ] });
2056
+ }
2057
+ export {
2058
+ ba as T,
2059
+ Da as a,
2060
+ Ta as b,
2061
+ Oa as c,
2062
+ ka as d,
2063
+ Fa as e
2064
+ };