@minimalstuff/ui 3.1.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
2
- import * as r from "react";
3
- import i, { cloneElement as a, createContext as o, createElement as s, isValidElement as c, useCallback as l, useContext as u, useEffect as d, useId as f, useLayoutEffect as p, useMemo as m, useRef as h, useState as g, useSyncExternalStore as _ } from "react";
1
+ import * as e from "react";
2
+ import t, { cloneElement as n, createContext as r, createElement as i, isValidElement as a, useCallback as o, useContext as s, useEffect as c, useId as l, useLayoutEffect as u, useMemo as d, useRef as f, useState as p, useSyncExternalStore as m } from "react";
3
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
4
4
  import * as v from "react-dom";
5
5
  import { createPortal as y } from "react-dom";
6
6
  //#region node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
@@ -28,9 +28,12 @@ var S = {
28
28
  lg: "rounded-lg",
29
29
  xl: "rounded-xl",
30
30
  full: "rounded-full"
31
- }, C = "outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2", w = "focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent", T = "focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-offset-white dark:focus-within:ring-offset-gray-900", E = "focus-within:ring-blue-500", D = "focus-within:ring-red-500", O = {
31
+ }, C = {
32
+ ...S,
33
+ full: S.lg
34
+ }, w = "outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2", T = "focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent", E = "has-[:focus-visible]:outline-none has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-offset-2 has-[:focus-visible]:ring-offset-white dark:has-[:focus-visible]:ring-offset-gray-900", D = "has-[:focus-visible]:ring-blue-500", O = "has-[:focus-visible]:ring-red-500", k = "outline-hidden focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-blue-500 dark:focus-visible:outline-blue-400", A = {
32
35
  primary: {
33
- solid: "border-transparent bg-blue-600 text-white enabled:hover:bg-blue-700 enabled:active:bg-blue-800 dark:bg-blue-500 dark:enabled:hover:bg-blue-600 dark:enabled:active:bg-blue-700",
36
+ solid: "border-transparent bg-blue-600 text-white enabled:hover:bg-blue-700 enabled:active:bg-blue-800",
34
37
  outline: "border-blue-300 bg-transparent text-blue-700 enabled:hover:bg-blue-50 enabled:active:bg-blue-100 dark:border-blue-800 dark:text-blue-400 dark:enabled:hover:bg-blue-950/40 dark:enabled:active:bg-blue-950/60",
35
38
  ghost: "border-transparent bg-transparent text-blue-700 enabled:hover:bg-blue-50 enabled:active:bg-blue-100 dark:text-blue-400 dark:enabled:hover:bg-blue-950/40 dark:enabled:active:bg-blue-950/60",
36
39
  subtle: "border-transparent bg-blue-50 text-blue-700 enabled:hover:bg-blue-100 enabled:active:bg-blue-200 dark:bg-blue-500/10 dark:text-blue-400 dark:enabled:hover:bg-blue-500/20 dark:enabled:active:bg-blue-500/30",
@@ -41,220 +44,474 @@ var S = {
41
44
  outline: "border-gray-300 bg-transparent text-gray-700 enabled:hover:bg-gray-50 enabled:active:bg-gray-100 dark:border-gray-600 dark:text-gray-300 dark:enabled:hover:bg-gray-800/50 dark:enabled:active:bg-gray-800/80",
42
45
  ghost: "border-transparent bg-transparent text-gray-700 enabled:hover:bg-gray-100 enabled:active:bg-gray-200 dark:text-gray-300 dark:enabled:hover:bg-gray-700/50 dark:enabled:active:bg-gray-700/80",
43
46
  subtle: "border-transparent bg-gray-100 text-gray-700 enabled:hover:bg-gray-200 enabled:active:bg-gray-300 dark:bg-gray-700/50 dark:text-gray-300 dark:enabled:hover:bg-gray-600/50 dark:enabled:active:bg-gray-600/80",
44
- focusOutline: "focus-visible:outline-gray-400"
47
+ focusOutline: "focus-visible:outline-gray-500 dark:focus-visible:outline-gray-400"
45
48
  },
46
49
  danger: {
47
- solid: "border-transparent bg-red-600 text-white enabled:hover:bg-red-700 enabled:active:bg-red-800 dark:bg-red-500 dark:enabled:hover:bg-red-600 dark:enabled:active:bg-red-700",
50
+ solid: "border-transparent bg-red-600 text-white enabled:hover:bg-red-700 enabled:active:bg-red-800",
48
51
  outline: "border-red-300 bg-transparent text-red-700 enabled:hover:bg-red-50 enabled:active:bg-red-100 dark:border-red-800 dark:text-red-400 dark:enabled:hover:bg-red-950/40 dark:enabled:active:bg-red-950/60",
49
52
  ghost: "border-transparent bg-transparent text-red-700 enabled:hover:bg-red-50 enabled:active:bg-red-100 dark:text-red-400 dark:enabled:hover:bg-red-950/40 dark:enabled:active:bg-red-950/60",
50
53
  subtle: "border-transparent bg-red-50 text-red-700 enabled:hover:bg-red-100 enabled:active:bg-red-200 dark:bg-red-500/10 dark:text-red-400 dark:enabled:hover:bg-red-500/20 dark:enabled:active:bg-red-500/30",
51
54
  focusOutline: "focus-visible:outline-red-500"
52
55
  },
53
56
  success: {
54
- solid: "border-transparent bg-green-600 text-white enabled:hover:bg-green-700 enabled:active:bg-green-800 dark:bg-green-500 dark:enabled:hover:bg-green-600 dark:enabled:active:bg-green-700",
57
+ solid: "border-transparent bg-green-700 text-white enabled:hover:bg-green-800 enabled:active:bg-green-900",
55
58
  outline: "border-green-300 bg-transparent text-green-700 enabled:hover:bg-green-50 enabled:active:bg-green-100 dark:border-green-800 dark:text-green-400 dark:enabled:hover:bg-green-950/40 dark:enabled:active:bg-green-950/60",
56
59
  ghost: "border-transparent bg-transparent text-green-700 enabled:hover:bg-green-50 enabled:active:bg-green-100 dark:text-green-400 dark:enabled:hover:bg-green-950/40 dark:enabled:active:bg-green-950/60",
57
60
  subtle: "border-transparent bg-green-50 text-green-700 enabled:hover:bg-green-100 enabled:active:bg-green-200 dark:bg-green-500/10 dark:text-green-400 dark:enabled:hover:bg-green-500/20 dark:enabled:active:bg-green-500/30",
58
- focusOutline: "focus-visible:outline-green-500"
61
+ focusOutline: "focus-visible:outline-green-600"
59
62
  },
60
63
  warning: {
61
- solid: "border-transparent bg-yellow-600 text-white enabled:hover:bg-yellow-700 enabled:active:bg-yellow-800 dark:bg-yellow-500 dark:enabled:hover:bg-yellow-600 dark:enabled:active:bg-yellow-700",
64
+ solid: "border-transparent bg-yellow-700 text-white enabled:hover:bg-yellow-800 enabled:active:bg-yellow-900",
62
65
  outline: "border-yellow-300 bg-transparent text-yellow-700 enabled:hover:bg-yellow-50 enabled:active:bg-yellow-100 dark:border-yellow-800 dark:text-yellow-400 dark:enabled:hover:bg-yellow-950/40 dark:enabled:active:bg-yellow-950/60",
63
66
  ghost: "border-transparent bg-transparent text-yellow-700 enabled:hover:bg-yellow-50 enabled:active:bg-yellow-100 dark:text-yellow-400 dark:enabled:hover:bg-yellow-950/40 dark:enabled:active:bg-yellow-950/60",
64
67
  subtle: "border-transparent bg-yellow-50 text-yellow-700 enabled:hover:bg-yellow-100 enabled:active:bg-yellow-200 dark:bg-yellow-500/10 dark:text-yellow-400 dark:enabled:hover:bg-yellow-500/20 dark:enabled:active:bg-yellow-500/30",
65
- focusOutline: "focus-visible:outline-yellow-500"
68
+ focusOutline: "focus-visible:outline-yellow-700 dark:focus-visible:outline-yellow-500"
66
69
  }
67
- }, k = "inline-flex items-center justify-center disabled:opacity-50 disabled:cursor-not-allowed", A = `cursor-pointer transition-[color,background-color,border-color,transform] duration-200 enabled:active:duration-75 enabled:active:scale-[0.95] ${C}`, j = {
70
+ }, j = "inline-flex items-center justify-center disabled:opacity-50 disabled:cursor-not-allowed", M = `cursor-pointer transition-[color,background-color,border-color,transform] duration-200 enabled:active:duration-75 enabled:active:scale-[0.95] ${w}`, N = {
71
+ xs: "h-6 w-6 text-xs",
72
+ sm: "h-8 w-8 text-sm",
73
+ md: "h-10 w-10 text-base",
74
+ lg: "h-12 w-12 text-xl"
75
+ }, P = new Intl.Segmenter(void 0, { granularity: "grapheme" });
76
+ function F(e) {
77
+ let t = e.trim();
78
+ if (t.length === 0) return "";
79
+ let [n] = P.segment(t);
80
+ return n.segment.toUpperCase();
81
+ }
82
+ function I({ name: e, src: t, size: n = "sm", color: r = "primary", radius: i = "full", unstyled: a = !1, className: o }) {
83
+ let [s, c] = p(null), l = t !== void 0 && t !== s, u = e.trim().length > 0, d = l ? /* @__PURE__ */ g("img", {
84
+ src: t,
85
+ alt: "",
86
+ onError: () => c(t ?? null),
87
+ className: "h-full w-full object-cover"
88
+ }) : /* @__PURE__ */ g("span", {
89
+ "aria-hidden": "true",
90
+ children: F(e)
91
+ });
92
+ return /* @__PURE__ */ g("span", {
93
+ role: u ? "img" : void 0,
94
+ "aria-label": u ? e : void 0,
95
+ "aria-hidden": !u || void 0,
96
+ className: x("inline-flex flex-shrink-0 items-center justify-center overflow-hidden", N[n], !a && S[i], !a && !l && ["border font-semibold", A[r].solid], o),
97
+ children: d
98
+ });
99
+ }
100
+ //#endregion
101
+ //#region src/components/badge/badge.tsx
102
+ var ee = {
68
103
  xs: "px-1.5 py-0.5 text-xs",
69
104
  sm: "px-2.5 py-1 text-sm",
70
105
  md: "px-3 py-1 text-base",
71
106
  lg: "px-3.5 py-1.5 text-lg"
72
- }, M = ({ children: e, color: n = "primary", variant: r = "subtle", size: i = "sm", radius: a = "md", className: o, ...s }) => /* @__PURE__ */ t("span", {
73
- className: x("inline-flex items-center gap-1 border", S[a], j[i], O[n][r], o),
74
- ...s,
107
+ }, L = ({ children: e, color: t = "primary", variant: n = "subtle", size: r = "sm", radius: i = "md", className: a, ...o }) => /* @__PURE__ */ g("span", {
108
+ className: x("inline-flex items-center gap-1 border", S[i], ee[r], A[t][n], a),
109
+ ...o,
75
110
  children: e
76
- }), N = {
111
+ }), te = {
77
112
  xs: "px-2 py-1 text-xs",
78
113
  sm: "px-3 py-1.5 text-sm",
79
114
  md: "px-4 py-2 text-sm",
80
115
  lg: "px-4 py-3 text-base"
81
- }, P = {
116
+ }, ne = {
82
117
  xs: "w-3.5 h-3.5",
83
118
  sm: "w-4 h-4",
84
119
  md: "w-4 h-4",
85
120
  lg: "w-5 h-5"
86
121
  };
87
- function F(e) {
88
- let { unstyled: r = !1, variant: i = "solid", color: a = "primary", size: o = "md", radius: s = "md", children: c, className: l, fullWidth: u = !1, loading: d = !1, startIcon: f, endIcon: p, disabled: m, ...h } = e, g = O[a], _ = P[o];
89
- return /* @__PURE__ */ n("button", {
122
+ function R(e) {
123
+ let { unstyled: t = !1, variant: n = "solid", color: r = "primary", size: i = "md", radius: a = "md", children: o, className: s, fullWidth: c = !1, loading: l = !1, startIcon: u, endIcon: d, disabled: f, ...p } = e, m = A[r], h = ne[i];
124
+ return /* @__PURE__ */ _("button", {
90
125
  type: "button",
91
- className: x(k, !r && [
92
- A,
126
+ className: x(j, !t && [
127
+ M,
93
128
  "gap-2 font-medium border",
94
- S[s],
95
- N[o],
96
- g[i],
97
- g.focusOutline
98
- ], u && "w-full", l),
99
- disabled: m ?? d,
100
- "aria-busy": d || void 0,
101
- ...h,
129
+ S[a],
130
+ te[i],
131
+ m[n],
132
+ m.focusOutline
133
+ ], c && "w-full", s),
134
+ disabled: f ?? l,
135
+ "aria-busy": l || void 0,
136
+ ...p,
102
137
  children: [
103
- d && /* @__PURE__ */ t("span", {
104
- className: x("i-svg-spinners-3-dots-fade", _),
138
+ l && /* @__PURE__ */ g("span", {
139
+ className: x("i-svg-spinners-3-dots-fade", h),
105
140
  "aria-hidden": "true"
106
141
  }),
107
- !d && f && /* @__PURE__ */ t("span", {
108
- className: x(f, _),
142
+ !l && u && /* @__PURE__ */ g("span", {
143
+ className: x(u, h),
109
144
  "aria-hidden": "true"
110
145
  }),
111
- c,
112
- !d && p && /* @__PURE__ */ t("span", {
113
- className: x(p, _),
146
+ o,
147
+ !l && d && /* @__PURE__ */ g("span", {
148
+ className: x(d, h),
114
149
  "aria-hidden": "true"
115
150
  })
116
151
  ]
117
152
  });
118
153
  }
119
154
  //#endregion
155
+ //#region src/components/shared/surface_tokens.ts
156
+ var re = "border-gray-300 dark:border-gray-600", z = "bg-white dark:bg-gray-800", B = "border-gray-200 dark:border-gray-700", ie = "border-gray-100 dark:border-gray-800", V = "bg-white dark:bg-gray-900", H = {
157
+ 2: "h2",
158
+ 3: "h3",
159
+ 4: "h4"
160
+ };
161
+ function ae({ title: e, titleId: t, level: n, description: r, actions: i }) {
162
+ let a = H[n];
163
+ return /* @__PURE__ */ _("div", {
164
+ className: "mb-4",
165
+ children: [/* @__PURE__ */ _("div", {
166
+ className: "flex items-center justify-between gap-4",
167
+ children: [/* @__PURE__ */ g(a, {
168
+ id: t,
169
+ className: "text-lg font-medium text-gray-900 dark:text-gray-100",
170
+ children: e
171
+ }), i]
172
+ }), r && /* @__PURE__ */ g("p", {
173
+ className: "mt-1 text-sm text-gray-500 dark:text-gray-400",
174
+ children: r
175
+ })]
176
+ });
177
+ }
178
+ //#endregion
179
+ //#region src/components/card/card.tsx
180
+ var oe = {
181
+ none: "",
182
+ sm: "p-4",
183
+ md: "p-6",
184
+ lg: "p-8"
185
+ };
186
+ function U({ children: e, title: t, description: n, actions: r, headingLevel: i = 2, padding: a = "md", radius: o = "lg", unstyled: s = !1, className: c }) {
187
+ let u = l(), d = !!t;
188
+ return /* @__PURE__ */ _("div", {
189
+ role: d ? "region" : void 0,
190
+ "aria-labelledby": d ? u : void 0,
191
+ className: x(!s && [
192
+ "border",
193
+ "bg-white dark:bg-gray-800",
194
+ "border-gray-200 dark:border-gray-700",
195
+ S[o],
196
+ oe[a]
197
+ ], c),
198
+ children: [d && /* @__PURE__ */ g(ae, {
199
+ title: t,
200
+ titleId: u,
201
+ level: i,
202
+ description: n,
203
+ actions: r
204
+ }), e]
205
+ });
206
+ }
207
+ //#endregion
120
208
  //#region src/components/character_count/character_count.tsx
121
- var I = "text-xs text-gray-500 dark:text-gray-400 mt-1 text-right";
122
- function L(e, t) {
123
- return t ? "" : e === "overLimit" ? "text-red-600 dark:text-red-400" : e === "atLimit" ? "text-amber-600 dark:text-amber-400" : "";
124
- }
125
- function R({ current: e, min: r, max: i, showMin: a, showMax: o, unstyled: s = !1, className: c }) {
126
- let l = a === !0 || o === !0, u = r !== void 0 && e <= r ? "atLimit" : "ok", d = i !== void 0 && e > i ? "overLimit" : i !== void 0 && e >= i ? "atLimit" : "ok", f = l ? `${e}/${r} min` : `${e} (min ${r})`, p = l ? `${e}/${i} max` : `${e}/${i}`;
127
- return /* @__PURE__ */ n("div", {
128
- className: x(!s && I, c),
209
+ var se = "text-xs text-gray-500 dark:text-gray-400 mt-1 text-right";
210
+ function W(e, t) {
211
+ return t ? "" : e === "overLimit" ? "text-red-600 dark:text-red-400" : e === "atLimit" ? "text-amber-700 dark:text-amber-400" : "";
212
+ }
213
+ function ce({ current: e, min: t, max: n, showMin: r, showMax: i, unstyled: a = !1, id: o, className: s }) {
214
+ let c = r === !0 || i === !0, l = t !== void 0 && e <= t ? "atLimit" : "ok", u = n !== void 0 && e > n ? "overLimit" : n !== void 0 && e >= n ? "atLimit" : "ok", d = c ? `${e}/${t} min` : `${e} (min ${t})`, f = c ? `${e}/${n} max` : `${e}/${n}`;
215
+ return /* @__PURE__ */ _("div", {
216
+ id: o,
217
+ className: x(!a && se, s),
129
218
  children: [
130
- a && r !== void 0 && /* @__PURE__ */ t("span", {
131
- className: L(u, s),
132
- children: f
133
- }),
134
- a && o && " · ",
135
- o && i !== void 0 && /* @__PURE__ */ t("span", {
136
- className: L(d, s),
137
- children: p
219
+ r && t !== void 0 && /* @__PURE__ */ g("span", {
220
+ className: W(l, a),
221
+ children: d
138
222
  }),
139
- !a && !o && i !== void 0 && /* @__PURE__ */ t("span", {
140
- className: L(d, s),
141
- children: p
223
+ r && i && " · ",
224
+ i && n !== void 0 && /* @__PURE__ */ g("span", {
225
+ className: W(u, a),
226
+ children: f
142
227
  }),
143
- !a && !o && r !== void 0 && i === void 0 && /* @__PURE__ */ t("span", {
144
- className: L(u, s),
228
+ !r && !i && n !== void 0 && /* @__PURE__ */ g("span", {
229
+ className: W(u, a),
145
230
  children: f
231
+ }),
232
+ !r && !i && t !== void 0 && n === void 0 && /* @__PURE__ */ g("span", {
233
+ className: W(l, a),
234
+ children: d
146
235
  })
147
236
  ]
148
237
  });
149
238
  }
150
239
  //#endregion
151
- //#region src/components/shared/surface_tokens.ts
152
- var z = "border-gray-300 dark:border-gray-600", ee = "bg-white dark:bg-gray-800", te = "border-gray-100 dark:border-gray-800", ne = "bg-white dark:bg-gray-900", B = `w-full border ${z} ${ee} text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 ${w} transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed`, re = "text-xs text-gray-500 dark:text-gray-400", ie = "text-xs text-red-600 dark:text-red-400", ae = "border-red-500 dark:border-red-400", oe = ({ id: e, error: n, className: r }) => n ? /* @__PURE__ */ t("p", {
240
+ //#region src/components/shared/join_ids.ts
241
+ function G(...e) {
242
+ return e.filter(Boolean).join(" ") || void 0;
243
+ }
244
+ var le = `w-full border ${re} ${z} text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 ${T} transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed`, ue = "text-sm font-medium text-gray-700 dark:text-gray-300", de = "text-xs text-gray-600 dark:text-gray-400", fe = "text-xs text-red-600 dark:text-red-400", pe = "border-red-500 dark:border-red-400", me = ({ id: e, error: t, className: n }) => t ? /* @__PURE__ */ g("p", {
153
245
  id: e,
154
- className: x(ie, r),
246
+ className: x(fe, n),
155
247
  role: "alert",
156
- children: n
248
+ children: t
157
249
  }) : null;
158
250
  //#endregion
159
251
  //#region src/components/shared/use_field_ids.ts
160
- function V(e) {
161
- let t = f(), n = e ?? t;
252
+ function K(e) {
253
+ let t = l(), n = e ?? t;
162
254
  return {
163
255
  fieldId: n,
164
256
  errorId: `${n}-error`,
165
- descriptionId: `${n}-description`
257
+ descriptionId: `${n}-description`,
258
+ labelId: `${n}-label`,
259
+ characterCountId: `${n}-character-count`
166
260
  };
167
261
  }
168
262
  //#endregion
263
+ //#region src/components/shared/checkmark_icon.tsx
264
+ function he() {
265
+ return /* @__PURE__ */ g("svg", {
266
+ className: "h-3 w-3 text-white",
267
+ viewBox: "0 0 12 12",
268
+ fill: "none",
269
+ stroke: "currentColor",
270
+ strokeWidth: "2.5",
271
+ strokeLinecap: "round",
272
+ strokeLinejoin: "round",
273
+ children: /* @__PURE__ */ g("polyline", { points: "2 6 5 9 10 3" })
274
+ });
275
+ }
276
+ //#endregion
169
277
  //#region src/components/shared/field_description.tsx
170
- var se = ({ id: e, description: n, className: r }) => n ? typeof n == "string" ? /* @__PURE__ */ t("p", {
278
+ var ge = ({ id: e, description: t, className: n }) => t ? typeof t == "string" ? /* @__PURE__ */ g("p", {
171
279
  id: e,
172
- className: x(re, r),
173
- children: n
174
- }) : /* @__PURE__ */ t("span", {
280
+ className: x(de, n),
281
+ children: t
282
+ }) : /* @__PURE__ */ g("span", {
175
283
  id: e,
176
- className: x(re, "block", r),
177
- children: n
284
+ className: x(de, "block", n),
285
+ children: t
178
286
  }) : null;
179
287
  //#endregion
288
+ //#region src/components/shared/option_card_styles.ts
289
+ function _e(e) {
290
+ let { isSelected: t, isError: n, isDisabled: r, radius: i, unstyled: a } = e;
291
+ return x("flex cursor-pointer items-start gap-3 transition-colors duration-150", E, n ? O : D, !a && [
292
+ S[i],
293
+ "border px-3 py-2.5",
294
+ t ? n ? x("border-red-500 dark:border-red-400", "bg-red-50 dark:bg-red-950/20") : "border-blue-500 bg-blue-50 dark:border-blue-500 dark:bg-blue-950/25" : n ? "border-red-300 bg-white dark:border-red-800/50 dark:bg-gray-800/50" : x("border-gray-200 dark:border-gray-700", "bg-gray-50 hover:border-gray-300 hover:bg-white dark:bg-gray-800/50 dark:hover:border-gray-600 dark:hover:bg-gray-800")
295
+ ], r && "cursor-not-allowed opacity-50");
296
+ }
297
+ function ve(e) {
298
+ let { isSelected: t, isError: n } = e;
299
+ return t ? n ? pe : "border-blue-600 dark:border-blue-500" : n ? "border-red-400 dark:border-red-600" : re;
300
+ }
301
+ //#endregion
180
302
  //#region src/components/shared/use_controlled_state.ts
181
- function H(e, t) {
182
- let [n, r] = g(t), i = e !== void 0, a = l((e) => {
303
+ function ye(e, t) {
304
+ let [n, r] = p(t), i = e !== void 0, a = o((e) => {
183
305
  i || r(e);
184
306
  }, [i]);
185
307
  return [i ? e : n, a];
186
308
  }
187
309
  //#endregion
188
310
  //#region src/components/checkbox/checkbox.tsx
189
- function ce({ label: r, description: i, error: a, radius: o = "sm", unstyled: s = !1, className: c, wrapperClassName: l, checked: u, defaultChecked: d = !1, onChange: f, id: p, ...m }) {
190
- let { fieldId: h, errorId: g, descriptionId: _ } = V(p), [v, y] = H(u, d), b = [i && _, a && g].filter(Boolean).join(" ") || void 0;
191
- return /* @__PURE__ */ n("div", {
192
- className: x("w-full", l),
311
+ function be(e, t, n) {
312
+ return e === void 0 ? null : typeof e == "string" ? /* @__PURE__ */ _("span", {
313
+ className: t,
314
+ children: [e, n && /* @__PURE__ */ g("span", {
315
+ className: "text-red-500 dark:text-red-400 ml-1",
316
+ children: "*"
317
+ })]
318
+ }) : /* @__PURE__ */ _(h, { children: [e, n && /* @__PURE__ */ g("span", {
319
+ className: "text-red-500 dark:text-red-400 ml-1",
320
+ children: "*"
321
+ })] });
322
+ }
323
+ function xe({ label: e, description: t, error: n, radius: r = "sm", unstyled: i = !1, fullWidth: a = !1, variant: o = "inline", className: s, wrapperClassName: c, checked: l, defaultChecked: u = !1, onChange: d, id: f, "aria-describedby": p, ...m }) {
324
+ let { fieldId: h, errorId: v, descriptionId: y } = K(f), [b, C] = ye(l, u), w = o === "card", T = G(p, !!t && y, n && v), E = (e) => {
325
+ C(e.target.checked), d?.(e);
326
+ }, D = w ? _e({
327
+ isSelected: b,
328
+ isError: !!n,
329
+ isDisabled: m.disabled === !0,
330
+ radius: r,
331
+ unstyled: i
332
+ }) : x("flex items-start gap-3 cursor-pointer", m.disabled && "cursor-not-allowed opacity-50"), O = w ? x("select-none text-sm font-medium", b ? n ? "text-red-700 dark:text-red-300" : "text-blue-700 dark:text-blue-300" : "text-gray-700 dark:text-gray-300") : x(ue, "select-none"), k = x("relative shrink-0", S[r], !w && ["has-[:focus-visible]:outline-none has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-offset-2 has-[:focus-visible]:ring-offset-white dark:has-[:focus-visible]:ring-offset-gray-900", n ? "has-[:focus-visible]:ring-red-500" : "has-[:focus-visible]:ring-blue-500"]), A = be(e, O, m.required === !0);
333
+ return /* @__PURE__ */ _("div", {
334
+ className: x(a ? "w-full" : "w-fit", c),
193
335
  children: [
194
- /* @__PURE__ */ n("label", {
336
+ /* @__PURE__ */ _("label", {
195
337
  htmlFor: h,
196
- className: x("flex items-start gap-3 cursor-pointer", m.disabled && "cursor-not-allowed opacity-50"),
197
- children: [/* @__PURE__ */ n("span", {
198
- className: x("relative shrink-0", S[o], T, a ? D : E),
199
- children: [/* @__PURE__ */ t("input", {
338
+ className: D,
339
+ children: [/* @__PURE__ */ _("span", {
340
+ className: k,
341
+ children: [/* @__PURE__ */ g("input", {
200
342
  type: "checkbox",
201
343
  id: h,
202
344
  className: "sr-only",
203
- checked: v,
204
- onChange: (e) => {
205
- y(e.target.checked), f?.(e);
206
- },
207
- "aria-invalid": !!a,
208
- "aria-describedby": b,
345
+ checked: b,
346
+ onChange: E,
347
+ "aria-invalid": !!n,
348
+ "aria-describedby": T,
209
349
  ...m
210
- }), /* @__PURE__ */ t("span", {
211
- className: x("flex h-5 w-5 items-center justify-center transition-all duration-200", !s && [
212
- S[o],
350
+ }), /* @__PURE__ */ g("span", {
351
+ className: x("flex h-5 w-5 items-center justify-center transition-all duration-200", !i && [
352
+ S[r],
213
353
  "border-2",
214
- v ? x("border-blue-600 dark:border-blue-500", "bg-blue-600 dark:bg-blue-500") : x("border-gray-300 dark:border-gray-600", "bg-white dark:bg-gray-800"),
215
- a && "border-red-500 dark:border-red-400"
216
- ], c),
354
+ b ? x("border-blue-600 dark:border-blue-500", "bg-blue-600 dark:bg-blue-500") : x("border-gray-300 dark:border-gray-600", "bg-white dark:bg-gray-800"),
355
+ n && "border-red-500 dark:border-red-400"
356
+ ], s),
217
357
  "aria-hidden": !0,
218
- children: v && /* @__PURE__ */ t("svg", {
219
- className: "h-3 w-3 text-white",
220
- viewBox: "0 0 12 12",
221
- fill: "none",
222
- stroke: "currentColor",
223
- strokeWidth: "2.5",
224
- strokeLinecap: "round",
225
- strokeLinejoin: "round",
226
- children: /* @__PURE__ */ t("polyline", { points: "2 6 5 9 10 3" })
227
- })
358
+ children: b && /* @__PURE__ */ g(he, {})
228
359
  })]
229
- }), r !== void 0 && (typeof r == "string" ? /* @__PURE__ */ n("span", {
230
- className: x("text-sm font-medium text-gray-700 dark:text-gray-300", "select-none"),
231
- children: [r, m.required && /* @__PURE__ */ t("span", {
232
- className: "text-red-500 dark:text-red-400 ml-1",
233
- children: "*"
360
+ }), w ? /* @__PURE__ */ _("span", {
361
+ className: "flex min-w-0 flex-col",
362
+ children: [A, t && /* @__PURE__ */ g("span", {
363
+ id: y,
364
+ className: x("text-xs text-gray-600 dark:text-gray-400", "mt-0.5"),
365
+ children: t
234
366
  })]
235
- }) : /* @__PURE__ */ n(e, { children: [r, m.required && /* @__PURE__ */ t("span", {
367
+ }) : A]
368
+ }),
369
+ !w && /* @__PURE__ */ g(ge, {
370
+ id: y,
371
+ description: t,
372
+ className: "mt-1 ml-8"
373
+ }),
374
+ /* @__PURE__ */ g(me, {
375
+ id: v,
376
+ error: n,
377
+ className: w ? "mt-1" : "mt-1 ml-8"
378
+ })
379
+ ]
380
+ });
381
+ }
382
+ //#endregion
383
+ //#region src/components/shared/option_row.tsx
384
+ function Se({ item: e, htmlFor: t, descriptionId: n, orientation: r, isSelected: i, isDisabled: a, isError: o, radius: s, unstyled: c, className: l, control: u, indicator: d }) {
385
+ return /* @__PURE__ */ _("label", {
386
+ htmlFor: t,
387
+ className: x(_e({
388
+ isSelected: i,
389
+ isError: o,
390
+ isDisabled: a,
391
+ radius: s,
392
+ unstyled: c
393
+ }), r === "horizontal" && "flex-1", l),
394
+ children: [
395
+ u,
396
+ d,
397
+ /* @__PURE__ */ _("span", {
398
+ className: "flex min-w-0 flex-col",
399
+ children: [/* @__PURE__ */ _("span", {
400
+ className: "flex items-center gap-1.5",
401
+ children: [e.icon && /* @__PURE__ */ g("span", {
402
+ className: x(e.icon, "h-4 w-4 shrink-0", i ? o ? "text-red-600 dark:text-red-400" : "text-blue-600 dark:text-blue-400" : "text-gray-500 dark:text-gray-400"),
403
+ "aria-hidden": !0
404
+ }), /* @__PURE__ */ g("span", {
405
+ className: x("select-none text-sm font-medium", i ? o ? "text-red-700 dark:text-red-300" : "text-blue-700 dark:text-blue-300" : "text-gray-700 dark:text-gray-300"),
406
+ children: e.label
407
+ })]
408
+ }), e.description && /* @__PURE__ */ g("span", {
409
+ id: n,
410
+ className: x("text-xs text-gray-600 dark:text-gray-400", "mt-0.5"),
411
+ children: e.description
412
+ })]
413
+ })
414
+ ]
415
+ });
416
+ }
417
+ //#endregion
418
+ //#region src/components/checkbox_options/checkbox_option_row.tsx
419
+ function Ce({ option: e, optionId: t, descriptionId: n, name: r, orientation: i, isSelected: a, isDisabled: o, error: s, radius: c, unstyled: l, className: u, onToggle: d }) {
420
+ let f = !!s;
421
+ return /* @__PURE__ */ g(Se, {
422
+ item: e,
423
+ htmlFor: t,
424
+ descriptionId: n,
425
+ orientation: i,
426
+ isSelected: a,
427
+ isDisabled: o,
428
+ isError: f,
429
+ radius: c,
430
+ unstyled: l,
431
+ className: u,
432
+ control: /* @__PURE__ */ g("input", {
433
+ type: "checkbox",
434
+ id: t,
435
+ name: r,
436
+ value: e.value,
437
+ checked: a,
438
+ onChange: () => d(e.value),
439
+ disabled: o,
440
+ "aria-invalid": s ? !0 : void 0,
441
+ "aria-describedby": e.description ? n : void 0,
442
+ className: "sr-only"
443
+ }),
444
+ indicator: /* @__PURE__ */ g("span", {
445
+ className: x("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center border-2 transition-colors duration-150", S.sm, ve({
446
+ isSelected: a,
447
+ isError: f
448
+ }), a && (f ? "bg-red-500 dark:bg-red-400" : "bg-blue-600 dark:bg-blue-500")),
449
+ "aria-hidden": !0,
450
+ children: a && /* @__PURE__ */ g(he, {})
451
+ })
452
+ });
453
+ }
454
+ //#endregion
455
+ //#region src/components/checkbox_options/checkbox_options.tsx
456
+ function we(e, t, n) {
457
+ let r = t.includes(n) ? t.filter((e) => e !== n) : [...t, n];
458
+ return e.map((e) => e.value).filter((e) => r.includes(e));
459
+ }
460
+ function Te({ options: e, orientation: t = "vertical", values: n, defaultValues: r, onChange: i, name: a, label: o, error: s, required: c, requiredLabel: l = "required", disabled: u, radius: d = "lg", unstyled: f = !1, className: p, wrapperClassName: m, id: v, "aria-describedby": y, ...b }) {
461
+ let { fieldId: S, errorId: C } = K(v), w = a ?? S, [T, E] = ye(n, r ?? []), D = e.map((e) => typeof e == "string" ? {
462
+ value: e,
463
+ label: e
464
+ } : e), O = (e) => {
465
+ let t = we(D, T, e);
466
+ E(t), i?.(t);
467
+ };
468
+ return /* @__PURE__ */ _("fieldset", {
469
+ className: x("m-0 border-0 p-0", m),
470
+ disabled: u,
471
+ "aria-describedby": G(y, s && C),
472
+ ...b,
473
+ children: [
474
+ o && /* @__PURE__ */ _("legend", {
475
+ className: x("text-sm font-medium text-gray-700 dark:text-gray-300", "mb-2"),
476
+ children: [o, c && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("span", {
236
477
  className: "text-red-500 dark:text-red-400 ml-1",
478
+ "aria-hidden": "true",
237
479
  children: "*"
238
- })] }))]
480
+ }), /* @__PURE__ */ g("span", {
481
+ className: "sr-only",
482
+ children: ` (${l})`
483
+ })] })]
239
484
  }),
240
- /* @__PURE__ */ t(se, {
241
- id: _,
242
- description: i,
243
- className: "mt-1 ml-8"
485
+ /* @__PURE__ */ g("div", {
486
+ className: x(t === "horizontal" ? "flex flex-row gap-2" : "flex flex-col gap-2"),
487
+ children: D.map((e, n) => /* @__PURE__ */ g(Ce, {
488
+ option: e,
489
+ optionId: `${S}-${n}`,
490
+ descriptionId: `${S}-${n}-desc`,
491
+ name: w,
492
+ orientation: t,
493
+ isSelected: T.includes(e.value),
494
+ isDisabled: u === !0 || e.disabled === !0,
495
+ error: s,
496
+ radius: d,
497
+ unstyled: f,
498
+ className: p,
499
+ onToggle: O
500
+ }, e.value))
244
501
  }),
245
- /* @__PURE__ */ t(oe, {
246
- id: g,
247
- error: a,
248
- className: "mt-1 ml-8"
502
+ /* @__PURE__ */ g(me, {
503
+ id: C,
504
+ error: s,
505
+ className: "mt-2"
249
506
  })
250
507
  ]
251
508
  });
252
509
  }
253
510
  //#endregion
254
511
  //#region src/hooks/use_is_client/use_is_client.tsx
255
- var le = () => {
256
- let [e, t] = g(!1);
257
- return d(() => {
512
+ var Ee = () => {
513
+ let [e, t] = p(!1);
514
+ return c(() => {
258
515
  requestAnimationFrame(() => {
259
516
  t(!0);
260
517
  });
@@ -262,146 +519,201 @@ var le = () => {
262
519
  };
263
520
  //#endregion
264
521
  //#region src/components/client_only/client_only.tsx
265
- function ue({ children: n, fallback: r }) {
266
- return le() ? /* @__PURE__ */ t(e, { children: n }) : r ?? null;
522
+ function De({ children: e, fallback: t }) {
523
+ return Ee() ? /* @__PURE__ */ g(h, { children: e }) : t ?? null;
267
524
  }
268
525
  //#endregion
269
526
  //#region src/components/shared/field.tsx
270
- var de = ({ fieldId: r, errorId: i, label: a, error: o, required: s = !1, wrapperClassName: c, children: l }) => /* @__PURE__ */ n("div", {
271
- className: x("w-full", c),
527
+ var Oe = ({ fieldId: e, errorId: t, label: n, error: r, required: i = !1, wrapperClassName: a, children: o }) => /* @__PURE__ */ _("div", {
528
+ className: x("w-full", a),
272
529
  children: [
273
- a !== void 0 && (typeof a == "string" ? /* @__PURE__ */ n("label", {
530
+ n !== void 0 && (typeof n == "string" ? /* @__PURE__ */ _("label", {
531
+ id: `${e}-label`,
274
532
  className: x("text-sm font-medium text-gray-700 dark:text-gray-300", "block mb-1"),
275
- htmlFor: r,
276
- children: [a, s && /* @__PURE__ */ t("span", {
533
+ htmlFor: e,
534
+ children: [n, i && /* @__PURE__ */ g("span", {
277
535
  className: "text-red-500 dark:text-red-400 ml-1",
536
+ "aria-hidden": "true",
278
537
  children: "*"
279
538
  })]
280
- }) : /* @__PURE__ */ n(e, { children: [a, s && /* @__PURE__ */ t("span", {
539
+ }) : /* @__PURE__ */ _(h, { children: [n, i && /* @__PURE__ */ g("span", {
281
540
  className: "text-red-500 dark:text-red-400 ml-1",
541
+ "aria-hidden": "true",
282
542
  children: "*"
283
543
  })] })),
284
- l,
285
- /* @__PURE__ */ t(oe, {
286
- id: i,
287
- error: o,
544
+ o,
545
+ /* @__PURE__ */ g(me, {
546
+ id: t,
547
+ error: r,
288
548
  className: "mt-1"
289
549
  })
290
550
  ]
291
- });
551
+ }), ke = -1;
552
+ function Ae(e, t) {
553
+ return e >= 0 && e < t ? e : ke;
554
+ }
555
+ function je({ optionCount: e, getOptionId: t, isOpen: n }) {
556
+ let [r, i] = p(ke), a = Ae(r, e), s = o((t) => {
557
+ e !== 0 && i((n) => {
558
+ let r = Ae(n, e) + t;
559
+ return r < 0 ? e - 1 : r >= e ? 0 : r;
560
+ });
561
+ }, [e]), l = o(() => {
562
+ i(0);
563
+ }, []), u = o(() => {
564
+ i(e - 1);
565
+ }, [e]), d = o(() => {
566
+ i(ke);
567
+ }, []), f = n && a >= 0 ? t(a) : void 0;
568
+ return c(() => {
569
+ f !== void 0 && document.getElementById(f)?.scrollIntoView?.({ block: "nearest" });
570
+ }, [f]), {
571
+ activeIndex: a,
572
+ activeOptionId: f,
573
+ move: s,
574
+ first: l,
575
+ last: u,
576
+ reset: d
577
+ };
578
+ }
292
579
  //#endregion
293
580
  //#region src/components/combobox/combobox.tsx
294
- function fe({ options: e, label: r, error: i, placeholder: a, noResultsText: o = "No results found", clearLabel: s = "Clear selection", radius: c = "md", unstyled: l = !1, disabled: u = !1, required: d = !1, className: f, wrapperClassName: p, value: h, defaultValue: _ = "", onChange: v, id: y }) {
295
- let { fieldId: b, errorId: C } = V(y), w = `${b}-listbox`, [T, E] = H(h, _), D = e.find((e) => e.value === T), [O, k] = g(""), [A, j] = g(!1), [M, N] = g(!1), [P, F] = g(-1), I = m(() => A ? e.filter((e) => e.label.toLowerCase().includes(O.toLowerCase())) : e, [
581
+ function Me({ options: e, label: t, "aria-label": n, error: r, placeholder: i, noResultsText: a = "No results found", clearLabel: o = "Clear selection", radius: s = "md", unstyled: c = !1, disabled: l = !1, required: u = !1, className: m, wrapperClassName: h, value: v, defaultValue: y = "", onChange: b, id: C }) {
582
+ let { fieldId: w, errorId: T } = K(C), E = `${w}-listbox`, D = f(null), [O, k] = ye(v, y), j = e.find((e) => e.value === O), [M, N] = p(""), [P, F] = p(!1), [I, ee] = p(!1), L = d(() => P ? e.filter((e) => e.label.toLowerCase().includes(M.toLowerCase())) : e, [
296
583
  e,
297
- A,
298
- O
299
- ]), L = M ? O : D?.label ?? "", R = () => {
300
- u || (k(D?.label ?? ""), j(!1), N(!0), F(-1));
301
- }, z = () => {
302
- N(!1), j(!1), F(-1);
303
- }, ee = (e) => {
304
- E(e.value), v?.(e.value), z();
305
- }, te = () => {
306
- E(""), v?.(""), k("");
307
- }, ne = (e) => {
308
- k(e.target.value), j(!0), N(!0), F(0);
309
- }, re = (e) => {
310
- I.length !== 0 && F((t) => {
311
- let n = t + e;
312
- return n < 0 ? I.length - 1 : n >= I.length ? 0 : n;
313
- });
314
- }, ie = (e) => {
315
- if (e.key === "ArrowDown") {
316
- e.preventDefault(), M ? re(1) : R();
584
+ P,
585
+ M
586
+ ]), { activeIndex: te, activeOptionId: ne, move: R, first: re, last: z, reset: B } = je({
587
+ optionCount: L.length,
588
+ getOptionId: (e) => `${E}-option-${e}`,
589
+ isOpen: I
590
+ }), ie = I ? M : j?.label ?? "", V = () => {
591
+ l || (N(j?.label ?? ""), F(!1), ee(!0), B());
592
+ }, H = () => {
593
+ ee(!1), F(!1), B();
594
+ }, ae = (e) => {
595
+ k(e.value), b?.(e.value), H();
596
+ }, oe = () => {
597
+ k(""), b?.(""), N(""), D.current?.focus();
598
+ }, U = (e) => {
599
+ N(e.target.value), F(!0), ee(!0), re();
600
+ }, se = () => {
601
+ I || V();
602
+ }, W = (e) => {
603
+ if (e.preventDefault(), e.altKey) {
604
+ I || V();
317
605
  return;
318
606
  }
319
- if (e.key === "ArrowUp") {
320
- e.preventDefault(), M ? re(-1) : R();
607
+ if (!I) {
608
+ V(), re();
321
609
  return;
322
610
  }
323
- if (e.key === "Enter") {
324
- if (!M) return;
325
- e.preventDefault();
326
- let t = I[P];
327
- t && ee(t);
611
+ R(1);
612
+ }, ce = (e) => {
613
+ if (e.preventDefault(), e.altKey) {
614
+ I && H();
328
615
  return;
329
616
  }
330
- if (e.key === "Escape") {
331
- if (!M) return;
332
- e.preventDefault(), z();
617
+ if (!I) {
618
+ V(), z();
619
+ return;
333
620
  }
334
- }, ae = M && P >= 0 ? `${w}-option-${P}` : void 0;
335
- return /* @__PURE__ */ t(de, {
336
- fieldId: b,
337
- errorId: C,
338
- label: r,
339
- error: i,
340
- required: d,
341
- wrapperClassName: p,
342
- children: /* @__PURE__ */ n("div", {
621
+ R(-1);
622
+ }, G = (e) => {
623
+ if (!I) return;
624
+ let t = L[te];
625
+ if (!t) {
626
+ H();
627
+ return;
628
+ }
629
+ e.preventDefault(), ae(t);
630
+ }, ue = (e) => {
631
+ I && (e.preventDefault(), H());
632
+ };
633
+ return /* @__PURE__ */ g(Oe, {
634
+ fieldId: w,
635
+ errorId: T,
636
+ label: t,
637
+ error: r,
638
+ required: u,
639
+ wrapperClassName: h,
640
+ children: /* @__PURE__ */ _("div", {
343
641
  className: "relative",
344
642
  children: [
345
- !l && /* @__PURE__ */ t("span", {
643
+ !c && /* @__PURE__ */ g("span", {
346
644
  className: "i-mdi-magnify absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 dark:text-gray-500 pointer-events-none",
347
645
  "aria-hidden": !0
348
646
  }),
349
- /* @__PURE__ */ t("input", {
350
- id: b,
647
+ /* @__PURE__ */ g("input", {
648
+ ref: D,
649
+ id: w,
351
650
  role: "combobox",
352
651
  type: "text",
353
652
  autoComplete: "off",
354
- disabled: u,
355
- placeholder: a,
356
- value: L,
357
- onChange: ne,
358
- onFocus: R,
359
- onBlur: z,
360
- onKeyDown: ie,
361
- "aria-expanded": M,
362
- "aria-controls": w,
653
+ disabled: l,
654
+ placeholder: i,
655
+ value: ie,
656
+ onChange: U,
657
+ onClick: se,
658
+ onBlur: H,
659
+ onKeyDown: (e) => {
660
+ if (e.key === "ArrowDown") return W(e);
661
+ if (e.key === "ArrowUp") return ce(e);
662
+ if (e.key === "Enter") return G(e);
663
+ if (e.key === "Escape") return ue(e);
664
+ },
665
+ "aria-expanded": I,
666
+ "aria-controls": E,
363
667
  "aria-autocomplete": "list",
364
- "aria-activedescendant": ae,
365
- "aria-invalid": !!i,
366
- "aria-describedby": i ? C : void 0,
367
- className: x("w-full disabled:opacity-50 disabled:cursor-not-allowed", !l && [
368
- B,
369
- S[c],
668
+ "aria-label": n,
669
+ "aria-activedescendant": ne,
670
+ "aria-invalid": !!r,
671
+ "aria-required": u || void 0,
672
+ "aria-describedby": r ? T : void 0,
673
+ className: x("w-full disabled:opacity-50 disabled:cursor-not-allowed", !c && [
674
+ le,
675
+ S[s],
370
676
  "pl-9 pr-8 py-2 text-sm"
371
- ], !l && i && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), f)
677
+ ], !c && r && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), m)
372
678
  }),
373
- !l && D && !u && /* @__PURE__ */ t("button", {
679
+ !c && j && !l && /* @__PURE__ */ g("button", {
374
680
  type: "button",
375
- "aria-label": s,
376
- onMouseDown: (e) => e.preventDefault(),
377
- onClick: te,
378
- className: "absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300",
379
- children: /* @__PURE__ */ t("span", {
681
+ "aria-label": o,
682
+ onMouseDown: (e) => {
683
+ e.preventDefault();
684
+ },
685
+ onClick: oe,
686
+ className: x("absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300", "outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2", A.primary.focusOutline),
687
+ children: /* @__PURE__ */ g("span", {
380
688
  className: "i-mdi-close block w-4 h-4",
381
689
  "aria-hidden": !0
382
690
  })
383
691
  }),
384
- M && /* @__PURE__ */ t("ul", {
385
- id: w,
386
- role: "listbox",
387
- className: x("absolute z-10 mt-1 w-full max-h-60 overflow-auto py-1 text-sm shadow-lg", !l && [
692
+ I && /* @__PURE__ */ _("div", {
693
+ className: x("absolute z-10 mt-1 w-full text-sm shadow-lg", !c && [
388
694
  "border",
389
695
  "bg-white dark:bg-gray-900",
390
696
  "border-gray-100 dark:border-gray-800",
391
- S[c]
697
+ S[s]
392
698
  ]),
393
- children: I.length === 0 ? /* @__PURE__ */ t("li", {
394
- className: "px-3 py-2 text-gray-500 dark:text-gray-400",
395
- children: o
396
- }) : I.map((e, n) => /* @__PURE__ */ t("li", {
397
- id: `${w}-option-${n}`,
398
- role: "option",
399
- "aria-selected": e.value === T,
400
- onMouseDown: (e) => e.preventDefault(),
401
- onClick: () => ee(e),
402
- className: x("px-3 py-2 cursor-pointer text-gray-900 dark:text-gray-100", n === P ? "bg-blue-50 dark:bg-blue-900/40" : "hover:bg-gray-50 dark:hover:bg-gray-800/60", e.value === T && "font-medium"),
403
- children: e.label
404
- }, e.value))
699
+ children: [/* @__PURE__ */ g("ul", {
700
+ id: E,
701
+ role: "listbox",
702
+ className: "max-h-60 overflow-auto py-1",
703
+ children: L.map((e, t) => /* @__PURE__ */ g("li", {
704
+ id: `${E}-option-${t}`,
705
+ role: "option",
706
+ "aria-selected": e.value === O,
707
+ onMouseDown: (e) => e.preventDefault(),
708
+ onClick: () => ae(e),
709
+ className: x("px-3 py-2 cursor-pointer text-gray-900 dark:text-gray-100", t === te ? x("bg-blue-50 dark:bg-blue-900/40", "outline-2 -outline-offset-2 outline-blue-500 dark:outline-blue-400") : "hover:bg-gray-50 dark:hover:bg-gray-800/60", e.value === O && "font-medium"),
710
+ children: e.label
711
+ }, e.value))
712
+ }), /* @__PURE__ */ g("div", {
713
+ role: "status",
714
+ className: L.length === 0 ? "px-3 py-2 text-gray-500 dark:text-gray-400" : void 0,
715
+ children: L.length === 0 ? a : ""
716
+ })]
405
717
  })
406
718
  ]
407
719
  })
@@ -409,75 +721,75 @@ function fe({ options: e, label: r, error: i, placeholder: a, noResultsText: o =
409
721
  }
410
722
  //#endregion
411
723
  //#region node_modules/.pnpm/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
412
- var pe = Math.min, U = Math.max, me = Math.round, he = Math.floor, W = (e) => ({
724
+ var q = Math.min, Ne = Math.max, Pe = Math.round, Fe = Math.floor, J = (e) => ({
413
725
  x: e,
414
726
  y: e
415
- }), ge = {
727
+ }), Ie = {
416
728
  left: "right",
417
729
  right: "left",
418
730
  bottom: "top",
419
731
  top: "bottom"
420
732
  };
421
- function _e(e, t, n) {
422
- return U(e, pe(t, n));
733
+ function Le(e, t, n) {
734
+ return Ne(e, q(t, n));
423
735
  }
424
- function ve(e, t) {
736
+ function Re(e, t) {
425
737
  return typeof e == "function" ? e(t) : e;
426
738
  }
427
- function ye(e) {
739
+ function ze(e) {
428
740
  return e.split("-")[0];
429
741
  }
430
- function be(e) {
742
+ function Be(e) {
431
743
  return e.split("-")[1];
432
744
  }
433
- function xe(e) {
745
+ function Ve(e) {
434
746
  return e === "x" ? "y" : "x";
435
747
  }
436
- function Se(e) {
748
+ function He(e) {
437
749
  return e === "y" ? "height" : "width";
438
750
  }
439
- function G(e) {
751
+ function Y(e) {
440
752
  let t = e[0];
441
753
  return t === "t" || t === "b" ? "y" : "x";
442
754
  }
443
- function Ce(e) {
444
- return xe(G(e));
755
+ function Ue(e) {
756
+ return Ve(Y(e));
445
757
  }
446
- function we(e, t, n) {
758
+ function We(e, t, n) {
447
759
  n === void 0 && (n = !1);
448
- let r = be(e), i = Ce(e), a = Se(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
449
- return t.reference[a] > t.floating[a] && (o = Ne(o)), [o, Ne(o)];
760
+ let r = Be(e), i = Ue(e), a = He(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
761
+ return t.reference[a] > t.floating[a] && (o = $e(o)), [o, $e(o)];
450
762
  }
451
- function Te(e) {
452
- let t = Ne(e);
763
+ function Ge(e) {
764
+ let t = $e(e);
453
765
  return [
454
- Ee(e),
766
+ Ke(e),
455
767
  t,
456
- Ee(t)
768
+ Ke(t)
457
769
  ];
458
770
  }
459
- function Ee(e) {
771
+ function Ke(e) {
460
772
  return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
461
773
  }
462
- var De = ["left", "right"], Oe = ["right", "left"], ke = ["top", "bottom"], Ae = ["bottom", "top"];
463
- function je(e, t, n) {
774
+ var qe = ["left", "right"], Je = ["right", "left"], Ye = ["top", "bottom"], Xe = ["bottom", "top"];
775
+ function Ze(e, t, n) {
464
776
  switch (e) {
465
777
  case "top":
466
- case "bottom": return n ? t ? Oe : De : t ? De : Oe;
778
+ case "bottom": return n ? t ? Je : qe : t ? qe : Je;
467
779
  case "left":
468
- case "right": return t ? ke : Ae;
780
+ case "right": return t ? Ye : Xe;
469
781
  default: return [];
470
782
  }
471
783
  }
472
- function Me(e, t, n, r) {
473
- let i = be(e), a = je(ye(e), n === "start", r);
474
- return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(Ee)))), a;
784
+ function Qe(e, t, n, r) {
785
+ let i = Be(e), a = Ze(ze(e), n === "start", r);
786
+ return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(Ke)))), a;
475
787
  }
476
- function Ne(e) {
477
- let t = ye(e);
478
- return ge[t] + e.slice(t.length);
788
+ function $e(e) {
789
+ let t = ze(e);
790
+ return Ie[t] + e.slice(t.length);
479
791
  }
480
- function Pe(e) {
792
+ function et(e) {
481
793
  return {
482
794
  top: e.top ?? 0,
483
795
  right: e.right ?? 0,
@@ -485,15 +797,15 @@ function Pe(e) {
485
797
  left: e.left ?? 0
486
798
  };
487
799
  }
488
- function Fe(e) {
800
+ function tt(e) {
489
801
  return typeof e == "number" ? {
490
802
  top: e,
491
803
  right: e,
492
804
  bottom: e,
493
805
  left: e
494
- } : Pe(e);
806
+ } : et(e);
495
807
  }
496
- function Ie(e) {
808
+ function nt(e) {
497
809
  let { x: t, y: n, width: r, height: i } = e;
498
810
  return {
499
811
  width: r,
@@ -508,8 +820,8 @@ function Ie(e) {
508
820
  }
509
821
  //#endregion
510
822
  //#region node_modules/.pnpm/@floating-ui+core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
511
- function Le(e, t, n) {
512
- let { reference: r, floating: i } = e, a = G(t), o = Ce(t), s = Se(o), c = ye(t), l = a === "y", u = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, f = r[s] / 2 - i[s] / 2, p;
823
+ function rt(e, t, n) {
824
+ let { reference: r, floating: i } = e, a = Y(t), o = Ue(t), s = He(o), c = ze(t), l = a === "y", u = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, f = r[s] / 2 - i[s] / 2, p;
513
825
  switch (c) {
514
826
  case "top":
515
827
  p = {
@@ -540,12 +852,12 @@ function Le(e, t, n) {
540
852
  y: r.y
541
853
  };
542
854
  }
543
- let m = be(t);
855
+ let m = Be(t);
544
856
  return m && (p[o] += f * (m === "end" ? 1 : -1) * (n && l ? -1 : 1)), p;
545
857
  }
546
- async function Re(e, t) {
858
+ async function it(e, t) {
547
859
  t === void 0 && (t = {});
548
- let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } = ve(t, e), p = Fe(f), m = o[d ? u === "floating" ? "reference" : "floating" : u], h = Ie(await i.getClippingRect({
860
+ let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } = Re(t, e), p = tt(f), m = o[d ? u === "floating" ? "reference" : "floating" : u], h = nt(await i.getClippingRect({
549
861
  element: await (i.isElement == null ? void 0 : i.isElement(m)) ?? !0 ? m : m.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(o.floating)),
550
862
  boundary: c,
551
863
  rootBoundary: l,
@@ -558,7 +870,7 @@ async function Re(e, t) {
558
870
  } : a.reference, _ = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(o.floating)), v = await (i.isElement == null ? void 0 : i.isElement(_)) && await (i.getScale == null ? void 0 : i.getScale(_)) || {
559
871
  x: 1,
560
872
  y: 1
561
- }, y = Ie(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
873
+ }, y = nt(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
562
874
  elements: o,
563
875
  rect: g,
564
876
  offsetParent: _,
@@ -571,15 +883,15 @@ async function Re(e, t) {
571
883
  right: (y.right - h.right + p.right) / v.x
572
884
  };
573
885
  }
574
- var ze = 50, Be = async (e, t, n) => {
886
+ var at = 50, ot = async (e, t, n) => {
575
887
  let { placement: r = "bottom", strategy: i = "absolute", middleware: a = [], platform: o } = n, s = o.detectOverflow ? o : {
576
888
  ...o,
577
- detectOverflow: Re
889
+ detectOverflow: it
578
890
  }, c = await (o.isRTL == null ? void 0 : o.isRTL(t)), l = await o.getElementRects({
579
891
  reference: e,
580
892
  floating: t,
581
893
  strategy: i
582
- }), { x: u, y: d } = Le(l, r, c), f = r, p = 0, m = {};
894
+ }), { x: u, y: d } = rt(l, r, c), f = r, p = 0, m = {};
583
895
  for (let n = 0; n < a.length; n++) {
584
896
  let h = a[n];
585
897
  if (!h) continue;
@@ -600,11 +912,11 @@ var ze = 50, Be = async (e, t, n) => {
600
912
  u = v ?? u, d = y ?? d, m[g] = {
601
913
  ...m[g],
602
914
  ...b
603
- }, x && p < ze && (p++, typeof x == "object" && (x.placement && (f = x.placement), x.rects && (l = x.rects === !0 ? await o.getElementRects({
915
+ }, x && p < at && (p++, typeof x == "object" && (x.placement && (f = x.placement), x.rects && (l = x.rects === !0 ? await o.getElementRects({
604
916
  reference: e,
605
917
  floating: t,
606
918
  strategy: i
607
- }) : x.rects), {x: u, y: d} = Le(l, f, c)), n = -1);
919
+ }) : x.rects), {x: u, y: d} = rt(l, f, c)), n = -1);
608
920
  }
609
921
  return {
610
922
  x: u,
@@ -613,18 +925,18 @@ var ze = 50, Be = async (e, t, n) => {
613
925
  strategy: i,
614
926
  middlewareData: m
615
927
  };
616
- }, Ve = (e) => ({
928
+ }, st = (e) => ({
617
929
  name: "arrow",
618
930
  options: e,
619
931
  async fn(t) {
620
- let { x: n, y: r, placement: i, rects: a, platform: o, elements: s, middlewareData: c } = t, { element: l, padding: u = 0 } = ve(e, t) || {};
932
+ let { x: n, y: r, placement: i, rects: a, platform: o, elements: s, middlewareData: c } = t, { element: l, padding: u = 0 } = Re(e, t) || {};
621
933
  if (l == null) return {};
622
- let d = Fe(u), f = {
934
+ let d = tt(u), f = {
623
935
  x: n,
624
936
  y: r
625
- }, p = Ce(i), m = Se(p), h = await o.getDimensions(l), g = p === "y", _ = g ? "top" : "left", v = g ? "bottom" : "right", y = g ? "clientHeight" : "clientWidth", b = a.reference[m] + a.reference[p] - f[p] - a.floating[m], x = f[p] - a.reference[p], S = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l)), C = S ? S[y] : 0;
937
+ }, p = Ue(i), m = He(p), h = await o.getDimensions(l), g = p === "y", _ = g ? "top" : "left", v = g ? "bottom" : "right", y = g ? "clientHeight" : "clientWidth", b = a.reference[m] + a.reference[p] - f[p] - a.floating[m], x = f[p] - a.reference[p], S = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l)), C = S ? S[y] : 0;
626
938
  (!C || !await (o.isElement == null ? void 0 : o.isElement(S))) && (C = s.floating[y] || a.floating[m]);
627
- let w = b / 2 - x / 2, T = C / 2 - h[m] / 2 - 1, E = pe(d[_], T), D = pe(d[v], T), O = C - h[m] - D, k = C / 2 - h[m] / 2 + w, A = _e(E, k, O), j = !c.arrow && be(i) != null && k !== A && a.reference[m] / 2 - (k < E ? E : D) - h[m] / 2 < 0, M = j ? k < E ? k - E : k - O : 0;
939
+ let w = b / 2 - x / 2, T = C / 2 - h[m] / 2 - 1, E = q(d[_], T), D = q(d[v], T), O = C - h[m] - D, k = C / 2 - h[m] / 2 + w, A = Le(E, k, O), j = !c.arrow && Be(i) != null && k !== A && a.reference[m] / 2 - (k < E ? E : D) - h[m] / 2 < 0, M = j ? k < E ? k - E : k - O : 0;
628
940
  return {
629
941
  [p]: f[p] + M,
630
942
  data: {
@@ -635,19 +947,19 @@ var ze = 50, Be = async (e, t, n) => {
635
947
  reset: j
636
948
  };
637
949
  }
638
- }), He = function(e) {
950
+ }), ct = function(e) {
639
951
  return e === void 0 && (e = {}), {
640
952
  name: "flip",
641
953
  options: e,
642
954
  async fn(t) {
643
955
  var n;
644
- let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ...h } = ve(e, t);
956
+ let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ...h } = Re(e, t);
645
957
  if ((n = i.arrow) != null && n.alignmentOffset) return {};
646
- let g = ye(r), _ = G(o), v = ye(o) === o, y = await (s.isRTL == null ? void 0 : s.isRTL(c.floating)), b = d || (v || !m ? [Ne(o)] : Te(o)), x = p !== "none";
647
- !d && x && b.push(...Me(o, m, p, y));
958
+ let g = ze(r), _ = Y(o), v = ze(o) === o, y = await (s.isRTL == null ? void 0 : s.isRTL(c.floating)), b = d || (v || !m ? [$e(o)] : Ge(o)), x = p !== "none";
959
+ !d && x && b.push(...Qe(o, m, p, y));
648
960
  let S = [o, ...b], C = await s.detectOverflow(t, h), w = [], T = i.flip?.overflows || [];
649
961
  if (l && w.push(C[g]), u) {
650
- let e = we(r, a, y);
962
+ let e = We(r, a, y);
651
963
  w.push(C[e[0]], C[e[1]]);
652
964
  }
653
965
  if (T = [...T, {
@@ -655,7 +967,7 @@ var ze = 50, Be = async (e, t, n) => {
655
967
  overflows: w
656
968
  }], !w.every((e) => e <= 0)) {
657
969
  let e = (i.flip?.index || 0) + 1, t = S[e];
658
- if (t && (u !== "alignment" || _ === G(t) || T.every((e) => G(e.placement) !== _ || e.overflows[0] > 0))) return {
970
+ if (t && (u !== "alignment" || _ === Y(t) || T.every((e) => Y(e.placement) !== _ || e.overflows[0] > 0))) return {
659
971
  data: {
660
972
  index: e,
661
973
  overflows: T
@@ -667,7 +979,7 @@ var ze = 50, Be = async (e, t, n) => {
667
979
  case "bestFit": {
668
980
  let e = T.filter((e) => {
669
981
  if (x) {
670
- let t = G(e.placement);
982
+ let t = Y(e.placement);
671
983
  return t === _ || t === "y";
672
984
  }
673
985
  return !0;
@@ -682,9 +994,9 @@ var ze = 50, Be = async (e, t, n) => {
682
994
  return {};
683
995
  }
684
996
  };
685
- }, Ue = /*#__PURE__*/ new Set(["left", "top"]);
686
- async function We(e, t) {
687
- let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = ye(n), s = be(n), c = G(n) === "y", l = Ue.has(o) ? -1 : 1, u = a && c ? -1 : 1, d = ve(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: m } = typeof d == "number" ? {
997
+ }, lt = /*#__PURE__*/ new Set(["left", "top"]);
998
+ async function ut(e, t) {
999
+ let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = ze(n), s = Be(n), c = Y(n) === "y", l = lt.has(o) ? -1 : 1, u = a && c ? -1 : 1, d = Re(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: m } = typeof d == "number" ? {
688
1000
  mainAxis: d,
689
1001
  crossAxis: 0,
690
1002
  alignmentAxis: null
@@ -701,13 +1013,13 @@ async function We(e, t) {
701
1013
  y: p * u
702
1014
  };
703
1015
  }
704
- var Ge = function(e) {
1016
+ var dt = function(e) {
705
1017
  return e === void 0 && (e = 0), {
706
1018
  name: "offset",
707
1019
  options: e,
708
1020
  async fn(t) {
709
1021
  var n;
710
- let { x: r, y: i, placement: a, middlewareData: o } = t, s = await We(t, e);
1022
+ let { x: r, y: i, placement: a, middlewareData: o } = t, s = await ut(t, e);
711
1023
  return a === o.offset?.placement && (n = o.arrow) != null && n.alignmentOffset ? {} : {
712
1024
  x: r + s.x,
713
1025
  y: i + s.y,
@@ -718,7 +1030,7 @@ var Ge = function(e) {
718
1030
  };
719
1031
  }
720
1032
  };
721
- }, Ke = function(e) {
1033
+ }, ft = function(e) {
722
1034
  return e === void 0 && (e = {}), {
723
1035
  name: "shift",
724
1036
  options: e,
@@ -729,10 +1041,10 @@ var Ge = function(e) {
729
1041
  x: t,
730
1042
  y: n
731
1043
  };
732
- } }, ...l } = ve(e, t), u = {
1044
+ } }, ...l } = Re(e, t), u = {
733
1045
  x: n,
734
1046
  y: r
735
- }, d = await a.detectOverflow(t, l), f = G(i), p = xe(f), m = u[p], h = u[f], g = (e, t) => _e(t + d[e === "y" ? "top" : "left"], t, t - d[e === "y" ? "bottom" : "right"]);
1047
+ }, d = await a.detectOverflow(t, l), f = Y(i), p = Ve(f), m = u[p], h = u[f], g = (e, t) => Le(t + d[e === "y" ? "top" : "left"], t, t - d[e === "y" ? "bottom" : "right"]);
736
1048
  o && (m = g(p, m)), s && (h = g(f, h));
737
1049
  let _ = c.fn({
738
1050
  ...t,
@@ -755,39 +1067,39 @@ var Ge = function(e) {
755
1067
  };
756
1068
  //#endregion
757
1069
  //#region node_modules/.pnpm/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
758
- function qe() {
1070
+ function pt() {
759
1071
  return typeof window < "u";
760
1072
  }
761
- function Je(e) {
762
- return Ye(e) ? (e.nodeName || "").toLowerCase() : "#document";
1073
+ function mt(e) {
1074
+ return ht(e) ? (e.nodeName || "").toLowerCase() : "#document";
763
1075
  }
764
- function K(e) {
1076
+ function X(e) {
765
1077
  var t;
766
1078
  return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
767
1079
  }
768
- function q(e) {
769
- return ((Ye(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
1080
+ function Z(e) {
1081
+ return ((ht(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
770
1082
  }
771
- function Ye(e) {
772
- return qe() ? e instanceof Node || e instanceof K(e).Node : !1;
1083
+ function ht(e) {
1084
+ return pt() ? e instanceof Node || e instanceof X(e).Node : !1;
773
1085
  }
774
- function J(e) {
775
- return qe() ? e instanceof Element || e instanceof K(e).Element : !1;
1086
+ function Q(e) {
1087
+ return pt() ? e instanceof Element || e instanceof X(e).Element : !1;
776
1088
  }
777
- function Y(e) {
778
- return qe() ? e instanceof HTMLElement || e instanceof K(e).HTMLElement : !1;
1089
+ function gt(e) {
1090
+ return pt() ? e instanceof HTMLElement || e instanceof X(e).HTMLElement : !1;
779
1091
  }
780
- function Xe(e) {
781
- return !qe() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof K(e).ShadowRoot;
1092
+ function _t(e) {
1093
+ return !pt() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof X(e).ShadowRoot;
782
1094
  }
783
- function Ze(e) {
784
- let { overflow: t, overflowX: n, overflowY: r, display: i } = Z(e);
1095
+ function vt(e) {
1096
+ let { overflow: t, overflowX: n, overflowY: r, display: i } = $(e);
785
1097
  return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && i !== "inline" && i !== "contents";
786
1098
  }
787
- function Qe(e) {
788
- return /^(table|td|th)$/.test(Je(e));
1099
+ function yt(e) {
1100
+ return /^(table|td|th)$/.test(mt(e));
789
1101
  }
790
- function $e(e) {
1102
+ function bt(e) {
791
1103
  try {
792
1104
  if (e.matches(":popover-open")) return !0;
793
1105
  } catch {}
@@ -797,31 +1109,31 @@ function $e(e) {
797
1109
  return !1;
798
1110
  }
799
1111
  }
800
- var et = /transform|translate|scale|rotate|perspective|filter/, tt = /paint|layout|strict|content/, X = (e) => !!e && e !== "none", nt;
801
- function rt(e) {
802
- let t = J(e) ? Z(e) : e;
803
- return X(t.transform) || X(t.translate) || X(t.scale) || X(t.rotate) || X(t.perspective) || !at() && (X(t.backdropFilter) || X(t.filter)) || et.test(t.willChange || "") || tt.test(t.contain || "");
804
- }
805
- function it(e) {
806
- let t = Q(e);
807
- for (; Y(t) && !ot(t);) {
808
- if (rt(t)) return t;
809
- if ($e(t)) return null;
810
- t = Q(t);
1112
+ var xt = /transform|translate|scale|rotate|perspective|filter/, St = /paint|layout|strict|content/, Ct = (e) => !!e && e !== "none", wt;
1113
+ function Tt(e) {
1114
+ let t = Q(e) ? $(e) : e;
1115
+ return Ct(t.transform) || Ct(t.translate) || Ct(t.scale) || Ct(t.rotate) || Ct(t.perspective) || !Dt() && (Ct(t.backdropFilter) || Ct(t.filter)) || xt.test(t.willChange || "") || St.test(t.contain || "");
1116
+ }
1117
+ function Et(e) {
1118
+ let t = At(e);
1119
+ for (; gt(t) && !Ot(t);) {
1120
+ if (Tt(t)) return t;
1121
+ if (bt(t)) return null;
1122
+ t = At(t);
811
1123
  }
812
1124
  return null;
813
1125
  }
814
- function at() {
815
- return nt ??= typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"), nt;
1126
+ function Dt() {
1127
+ return wt ??= typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"), wt;
816
1128
  }
817
- function ot(e) {
818
- return /^(html|body|#document)$/.test(Je(e));
1129
+ function Ot(e) {
1130
+ return /^(html|body|#document)$/.test(mt(e));
819
1131
  }
820
- function Z(e) {
821
- return K(e).getComputedStyle(e);
1132
+ function $(e) {
1133
+ return X(e).getComputedStyle(e);
822
1134
  }
823
- function st(e) {
824
- return J(e) ? {
1135
+ function kt(e) {
1136
+ return Q(e) ? {
825
1137
  scrollLeft: e.scrollLeft,
826
1138
  scrollTop: e.scrollTop
827
1139
  } : {
@@ -829,102 +1141,102 @@ function st(e) {
829
1141
  scrollTop: e.scrollY
830
1142
  };
831
1143
  }
832
- function Q(e) {
833
- if (Je(e) === "html") return e;
834
- let t = e.assignedSlot || e.parentNode || Xe(e) && e.host || q(e);
835
- return Xe(t) ? t.host : t;
1144
+ function At(e) {
1145
+ if (mt(e) === "html") return e;
1146
+ let t = e.assignedSlot || e.parentNode || _t(e) && e.host || Z(e);
1147
+ return _t(t) ? t.host : t;
836
1148
  }
837
- function ct(e) {
838
- let t = Q(e);
839
- return ot(t) ? (e.ownerDocument || e).body : Y(t) && Ze(t) ? t : ct(t);
1149
+ function jt(e) {
1150
+ let t = At(e);
1151
+ return Ot(t) ? (e.ownerDocument || e).body : gt(t) && vt(t) ? t : jt(t);
840
1152
  }
841
- function lt(e, t, n) {
1153
+ function Mt(e, t, n) {
842
1154
  t === void 0 && (t = []), n === void 0 && (n = !0);
843
- let r = ct(e), i = r === e.ownerDocument?.body, a = K(r);
1155
+ let r = jt(e), i = r === e.ownerDocument?.body, a = X(r);
844
1156
  if (i) {
845
- let e = ut(a);
846
- return t.concat(a, a.visualViewport || [], Ze(r) ? r : [], e && n ? lt(e) : []);
1157
+ let e = Nt(a);
1158
+ return t.concat(a, a.visualViewport || [], vt(r) ? r : [], e && n ? Mt(e) : []);
847
1159
  }
848
- return t.concat(r, lt(r, [], n));
1160
+ return t.concat(r, Mt(r, [], n));
849
1161
  }
850
- function ut(e) {
1162
+ function Nt(e) {
851
1163
  return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
852
1164
  }
853
1165
  //#endregion
854
1166
  //#region node_modules/.pnpm/@floating-ui+dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
855
- function dt(e) {
856
- let t = Z(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = Y(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r, s = me(n) !== a || me(r) !== o;
1167
+ function Pt(e) {
1168
+ let t = $(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = gt(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r, s = Pe(n) !== a || Pe(r) !== o;
857
1169
  return s && (n = a, r = o), {
858
1170
  width: n,
859
1171
  height: r,
860
1172
  $: s
861
1173
  };
862
1174
  }
863
- function ft(e) {
864
- return J(e) ? e : e.contextElement;
1175
+ function Ft(e) {
1176
+ return Q(e) ? e : e.contextElement;
865
1177
  }
866
- function pt(e) {
867
- let t = ft(e);
868
- if (!Y(t)) return W(1);
869
- let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = dt(t), o = (a ? me(n.width) : n.width) / r, s = (a ? me(n.height) : n.height) / i;
1178
+ function It(e) {
1179
+ let t = Ft(e);
1180
+ if (!gt(t)) return J(1);
1181
+ let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = Pt(t), o = (a ? Pe(n.width) : n.width) / r, s = (a ? Pe(n.height) : n.height) / i;
870
1182
  return (!o || !Number.isFinite(o)) && (o = 1), (!s || !Number.isFinite(s)) && (s = 1), {
871
1183
  x: o,
872
1184
  y: s
873
1185
  };
874
1186
  }
875
- var mt = /*#__PURE__*/ W(0);
876
- function ht(e) {
877
- let t = K(e);
878
- return !at() || !t.visualViewport ? mt : {
1187
+ var Lt = /*#__PURE__*/ J(0);
1188
+ function Rt(e) {
1189
+ let t = X(e);
1190
+ return !Dt() || !t.visualViewport ? Lt : {
879
1191
  x: t.visualViewport.offsetLeft,
880
1192
  y: t.visualViewport.offsetTop
881
1193
  };
882
1194
  }
883
- function gt(e, t, n) {
884
- return t === void 0 && (t = !1), !!n && t && n === K(e);
1195
+ function zt(e, t, n) {
1196
+ return t === void 0 && (t = !1), !!n && t && n === X(e);
885
1197
  }
886
- function $(e, t, n, r) {
1198
+ function Bt(e, t, n, r) {
887
1199
  t === void 0 && (t = !1), n === void 0 && (n = !1);
888
- let i = e.getBoundingClientRect(), a = ft(e), o = W(1);
889
- t && (r ? J(r) && (o = pt(r)) : o = pt(e));
890
- let s = gt(a, n, r) ? ht(a) : W(0), c = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, u = i.width / o.x, d = i.height / o.y;
1200
+ let i = e.getBoundingClientRect(), a = Ft(e), o = J(1);
1201
+ t && (r ? Q(r) && (o = It(r)) : o = It(e));
1202
+ let s = zt(a, n, r) ? Rt(a) : J(0), c = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, u = i.width / o.x, d = i.height / o.y;
891
1203
  if (a && r) {
892
- let e = K(a), t = J(r) ? K(r) : r, n = e, i = ut(n);
1204
+ let e = X(a), t = Q(r) ? X(r) : r, n = e, i = Nt(n);
893
1205
  for (; i && t !== n;) {
894
- let e = pt(i), t = i.getBoundingClientRect(), r = Z(i), a = t.left + (i.clientLeft + parseFloat(r.paddingLeft)) * e.x, o = t.top + (i.clientTop + parseFloat(r.paddingTop)) * e.y;
895
- c *= e.x, l *= e.y, u *= e.x, d *= e.y, c += a, l += o, n = K(i), i = ut(n);
1206
+ let e = It(i), t = i.getBoundingClientRect(), r = $(i), a = t.left + (i.clientLeft + parseFloat(r.paddingLeft)) * e.x, o = t.top + (i.clientTop + parseFloat(r.paddingTop)) * e.y;
1207
+ c *= e.x, l *= e.y, u *= e.x, d *= e.y, c += a, l += o, n = X(i), i = Nt(n);
896
1208
  }
897
1209
  }
898
- return Ie({
1210
+ return nt({
899
1211
  width: u,
900
1212
  height: d,
901
1213
  x: c,
902
1214
  y: l
903
1215
  });
904
1216
  }
905
- function _t(e, t) {
906
- let n = st(e).scrollLeft;
907
- return t ? t.left + n : $(q(e)).left + n;
1217
+ function Vt(e, t) {
1218
+ let n = kt(e).scrollLeft;
1219
+ return t ? t.left + n : Bt(Z(e)).left + n;
908
1220
  }
909
- function vt(e, t) {
1221
+ function Ht(e, t) {
910
1222
  let n = e.getBoundingClientRect();
911
1223
  return {
912
- x: n.left + t.scrollLeft - _t(e, n),
1224
+ x: n.left + t.scrollLeft - Vt(e, n),
913
1225
  y: n.top + t.scrollTop
914
1226
  };
915
1227
  }
916
- function yt(e) {
917
- let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o = q(r), s = t ? $e(t.floating) : !1;
1228
+ function Ut(e) {
1229
+ let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o = Z(r), s = t ? bt(t.floating) : !1;
918
1230
  if (r === o || s && a) return n;
919
1231
  let c = {
920
1232
  scrollLeft: 0,
921
1233
  scrollTop: 0
922
- }, l = W(1), u = W(0), d = Y(r);
923
- if ((d || !a) && ((Je(r) !== "body" || Ze(o)) && (c = st(r)), d)) {
924
- let e = $(r);
925
- l = pt(r), u.x = e.x + r.clientLeft, u.y = e.y + r.clientTop;
1234
+ }, l = J(1), u = J(0), d = gt(r);
1235
+ if ((d || !a) && ((mt(r) !== "body" || vt(o)) && (c = kt(r)), d)) {
1236
+ let e = Bt(r);
1237
+ l = It(r), u.x = e.x + r.clientLeft, u.y = e.y + r.clientTop;
926
1238
  }
927
- let f = o && !d && !a ? vt(o, c) : W(0);
1239
+ let f = o && !d && !a ? Ht(o, c) : J(0);
928
1240
  return {
929
1241
  width: n.width * l.x,
930
1242
  height: n.height * l.y,
@@ -932,29 +1244,29 @@ function yt(e) {
932
1244
  y: n.y * l.y - c.scrollTop * l.y + u.y + f.y
933
1245
  };
934
1246
  }
935
- function bt(e) {
1247
+ function Wt(e) {
936
1248
  return e.getClientRects ? Array.from(e.getClientRects()) : [];
937
1249
  }
938
- function xt(e) {
939
- let t = st(e), n = e.ownerDocument.body, r = U(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), i = U(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight), a = -t.scrollLeft + _t(e), o = -t.scrollTop;
940
- return Z(n).direction === "rtl" && (a += U(e.clientWidth, n.clientWidth) - r), {
1250
+ function Gt(e) {
1251
+ let t = kt(e), n = e.ownerDocument.body, r = Ne(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), i = Ne(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight), a = -t.scrollLeft + Vt(e), o = -t.scrollTop;
1252
+ return $(n).direction === "rtl" && (a += Ne(e.clientWidth, n.clientWidth) - r), {
941
1253
  width: r,
942
1254
  height: i,
943
1255
  x: a,
944
1256
  y: o
945
1257
  };
946
1258
  }
947
- var St = 25;
948
- function Ct(e, t, n) {
1259
+ var Kt = 25;
1260
+ function qt(e, t, n) {
949
1261
  n === void 0 && (n = "viewport");
950
- let r = n === "layoutViewport", i = K(e), a = q(e), o = i.visualViewport, s = a.clientWidth, c = a.clientHeight, l = 0, u = 0;
1262
+ let r = n === "layoutViewport", i = X(e), a = Z(e), o = i.visualViewport, s = a.clientWidth, c = a.clientHeight, l = 0, u = 0;
951
1263
  if (o) {
952
- let e = !at() || t === "fixed";
1264
+ let e = !Dt() || t === "fixed";
953
1265
  r ? e || (l = -o.offsetLeft, u = -o.offsetTop) : (s = o.width, c = o.height, e && (l = o.offsetLeft, u = o.offsetTop));
954
1266
  }
955
- if (_t(a) <= 0) {
1267
+ if (Vt(a) <= 0) {
956
1268
  let e = a.ownerDocument, t = e.body, n = getComputedStyle(t), r = e.compatMode === "CSS1Compat" && parseFloat(n.marginLeft) + parseFloat(n.marginRight) || 0, i = Math.abs(a.clientWidth - t.clientWidth - r), o = getComputedStyle(a).scrollbarGutter === "stable both-edges" ? i / 2 : i;
957
- o <= St && (s -= o);
1269
+ o <= Kt && (s -= o);
958
1270
  }
959
1271
  return {
960
1272
  width: s,
@@ -963,8 +1275,8 @@ function Ct(e, t, n) {
963
1275
  y: u
964
1276
  };
965
1277
  }
966
- function wt(e, t) {
967
- let n = $(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = pt(e);
1278
+ function Jt(e, t) {
1279
+ let n = Bt(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = It(e);
968
1280
  return {
969
1281
  width: e.clientWidth * a.x,
970
1282
  height: e.clientHeight * a.y,
@@ -972,13 +1284,13 @@ function wt(e, t) {
972
1284
  y: r * a.y
973
1285
  };
974
1286
  }
975
- function Tt(e, t, n) {
1287
+ function Yt(e, t, n) {
976
1288
  let r;
977
- if (t === "viewport" || t === "layoutViewport") r = Ct(e, n, t);
978
- else if (t === "document") r = xt(q(e));
979
- else if (J(t)) r = wt(t, n);
1289
+ if (t === "viewport" || t === "layoutViewport") r = qt(e, n, t);
1290
+ else if (t === "document") r = Gt(Z(e));
1291
+ else if (Q(t)) r = Jt(t, n);
980
1292
  else {
981
- let n = ht(e);
1293
+ let n = Rt(e);
982
1294
  r = {
983
1295
  x: t.x - n.x,
984
1296
  y: t.y - n.y,
@@ -986,23 +1298,23 @@ function Tt(e, t, n) {
986
1298
  height: t.height
987
1299
  };
988
1300
  }
989
- return Ie(r);
1301
+ return nt(r);
990
1302
  }
991
- function Et(e, t) {
1303
+ function Xt(e, t) {
992
1304
  let n = t.get(e);
993
1305
  if (n) return n;
994
- let r = lt(e, [], !1).filter((e) => J(e) && Je(e) !== "body"), i = null, a = Z(e).position === "fixed", o = a ? Q(e) : e;
995
- for (; J(o) && !ot(o);) {
996
- let e = Z(o), t = rt(o), n = i ? i.position : a ? "fixed" : "";
997
- !t && (n === "fixed" || n === "absolute" && e.position === "static") ? r = r.filter((e) => e !== o) : i = e, o = Q(o);
1306
+ let r = Mt(e, [], !1).filter((e) => Q(e) && mt(e) !== "body"), i = null, a = $(e).position === "fixed", o = a ? At(e) : e;
1307
+ for (; Q(o) && !Ot(o);) {
1308
+ let e = $(o), t = Tt(o), n = i ? i.position : a ? "fixed" : "";
1309
+ !t && (n === "fixed" || n === "absolute" && e.position === "static") ? r = r.filter((e) => e !== o) : i = e, o = At(o);
998
1310
  }
999
1311
  return t.set(e, r), r;
1000
1312
  }
1001
- function Dt(e) {
1002
- let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ? $e(t) ? [] : Et(t, this._c) : [].concat(n), r], o = Tt(t, a[0], i), s = o.top, c = o.right, l = o.bottom, u = o.left;
1313
+ function Zt(e) {
1314
+ let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ? bt(t) ? [] : Xt(t, this._c) : [].concat(n), r], o = Yt(t, a[0], i), s = o.top, c = o.right, l = o.bottom, u = o.left;
1003
1315
  for (let e = 1; e < a.length; e++) {
1004
- let n = Tt(t, a[e], i);
1005
- s = U(n.top, s), c = pe(n.right, c), l = pe(n.bottom, l), u = U(n.left, u);
1316
+ let n = Yt(t, a[e], i);
1317
+ s = Ne(n.top, s), c = q(n.right, c), l = q(n.bottom, l), u = Ne(n.left, u);
1006
1318
  }
1007
1319
  return {
1008
1320
  width: c - u,
@@ -1011,24 +1323,24 @@ function Dt(e) {
1011
1323
  y: s
1012
1324
  };
1013
1325
  }
1014
- function Ot(e) {
1015
- let { width: t, height: n } = dt(e);
1326
+ function Qt(e) {
1327
+ let { width: t, height: n } = Pt(e);
1016
1328
  return {
1017
1329
  width: t,
1018
1330
  height: n
1019
1331
  };
1020
1332
  }
1021
- function kt(e, t, n) {
1022
- let r = Y(t), i = q(t), a = n === "fixed", o = $(e, !0, a, t), s = {
1333
+ function $t(e, t, n) {
1334
+ let r = gt(t), i = Z(t), a = n === "fixed", o = Bt(e, !0, a, t), s = {
1023
1335
  scrollLeft: 0,
1024
1336
  scrollTop: 0
1025
- }, c = W(0);
1026
- if ((r || !a) && ((Je(t) !== "body" || Ze(i)) && (s = st(t)), r)) {
1027
- let e = $(t, !0, a, t);
1337
+ }, c = J(0);
1338
+ if ((r || !a) && ((mt(t) !== "body" || vt(i)) && (s = kt(t)), r)) {
1339
+ let e = Bt(t, !0, a, t);
1028
1340
  c.x = e.x + t.clientLeft, c.y = e.y + t.clientTop;
1029
1341
  }
1030
- !r && i && (c.x = _t(i));
1031
- let l = i && !r && !a ? vt(i, s) : W(0);
1342
+ !r && i && (c.x = Vt(i));
1343
+ let l = i && !r && !a ? Ht(i, s) : J(0);
1032
1344
  return {
1033
1345
  x: o.left + s.scrollLeft - c.x - l.x,
1034
1346
  y: o.top + s.scrollTop - c.y - l.y,
@@ -1036,34 +1348,34 @@ function kt(e, t, n) {
1036
1348
  height: o.height
1037
1349
  };
1038
1350
  }
1039
- function At(e) {
1040
- return Z(e).position === "static";
1351
+ function en(e) {
1352
+ return $(e).position === "static";
1041
1353
  }
1042
- function jt(e, t) {
1043
- if (!Y(e) || Z(e).position === "fixed") return null;
1354
+ function tn(e, t) {
1355
+ if (!gt(e) || $(e).position === "fixed") return null;
1044
1356
  if (t) return t(e);
1045
1357
  let n = e.offsetParent;
1046
- return q(e) === n && (n = n.ownerDocument.body), n;
1047
- }
1048
- function Mt(e, t) {
1049
- let n = K(e);
1050
- if ($e(e)) return n;
1051
- if (!Y(e)) {
1052
- let t = Q(e);
1053
- for (; t && !ot(t);) {
1054
- if (J(t) && !At(t)) return t;
1055
- t = Q(t);
1358
+ return Z(e) === n && (n = n.ownerDocument.body), n;
1359
+ }
1360
+ function nn(e, t) {
1361
+ let n = X(e);
1362
+ if (bt(e)) return n;
1363
+ if (!gt(e)) {
1364
+ let t = At(e);
1365
+ for (; t && !Ot(t);) {
1366
+ if (Q(t) && !en(t)) return t;
1367
+ t = At(t);
1056
1368
  }
1057
1369
  return n;
1058
1370
  }
1059
- let r = jt(e, t);
1060
- for (; r && Qe(r) && At(r);) r = jt(r, t);
1061
- return r && ot(r) && At(r) && !rt(r) ? n : r || it(e) || n;
1371
+ let r = tn(e, t);
1372
+ for (; r && yt(r) && en(r);) r = tn(r, t);
1373
+ return r && Ot(r) && en(r) && !Tt(r) ? n : r || Et(e) || n;
1062
1374
  }
1063
- var Nt = async function(e) {
1064
- let t = this.getOffsetParent || Mt, n = this.getDimensions, r = await n(e.floating);
1375
+ var rn = async function(e) {
1376
+ let t = this.getOffsetParent || nn, n = this.getDimensions, r = await n(e.floating);
1065
1377
  return {
1066
- reference: kt(e.reference, await t(e.floating), e.strategy),
1378
+ reference: $t(e.reference, await t(e.floating), e.strategy),
1067
1379
  floating: {
1068
1380
  x: 0,
1069
1381
  y: 0,
@@ -1072,26 +1384,26 @@ var Nt = async function(e) {
1072
1384
  }
1073
1385
  };
1074
1386
  };
1075
- function Pt(e) {
1076
- return Z(e).direction === "rtl";
1077
- }
1078
- var Ft = {
1079
- convertOffsetParentRelativeRectToViewportRelativeRect: yt,
1080
- getDocumentElement: q,
1081
- getClippingRect: Dt,
1082
- getOffsetParent: Mt,
1083
- getElementRects: Nt,
1084
- getClientRects: bt,
1085
- getDimensions: Ot,
1086
- getScale: pt,
1087
- isElement: J,
1088
- isRTL: Pt
1387
+ function an(e) {
1388
+ return $(e).direction === "rtl";
1389
+ }
1390
+ var on = {
1391
+ convertOffsetParentRelativeRectToViewportRelativeRect: Ut,
1392
+ getDocumentElement: Z,
1393
+ getClippingRect: Zt,
1394
+ getOffsetParent: nn,
1395
+ getElementRects: rn,
1396
+ getClientRects: Wt,
1397
+ getDimensions: Qt,
1398
+ getScale: It,
1399
+ isElement: Q,
1400
+ isRTL: an
1089
1401
  };
1090
- function It(e, t) {
1402
+ function sn(e, t) {
1091
1403
  return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
1092
1404
  }
1093
- function Lt(e, t, n) {
1094
- let r = null, i, a = q(e);
1405
+ function cn(e, t, n) {
1406
+ let r = null, i, a = Z(e);
1095
1407
  function o() {
1096
1408
  var e;
1097
1409
  clearTimeout(i), (e = r) == null || e.disconnect(), r = null;
@@ -1100,13 +1412,13 @@ function Lt(e, t, n) {
1100
1412
  n === void 0 && (n = !1), c === void 0 && (c = 1), o();
1101
1413
  let l = e.getBoundingClientRect(), { left: u, top: d, width: f, height: p } = l;
1102
1414
  if (n || t(), !f || !p) return;
1103
- let m = he(d), h = he(a.clientWidth - (u + f)), g = he(a.clientHeight - (d + p)), _ = he(u), v = {
1415
+ let m = Fe(d), h = Fe(a.clientWidth - (u + f)), g = Fe(a.clientHeight - (d + p)), _ = Fe(u), v = {
1104
1416
  rootMargin: -m + "px " + -h + "px " + -g + "px " + -_ + "px",
1105
- threshold: U(0, pe(1, c)) || 1
1417
+ threshold: Ne(0, q(1, c)) || 1
1106
1418
  }, y = !0;
1107
1419
  function b(t) {
1108
1420
  let n = t[0].intersectionRatio;
1109
- if (!It(l, e.getBoundingClientRect())) return s();
1421
+ if (!sn(l, e.getBoundingClientRect())) return s();
1110
1422
  if (n !== c) {
1111
1423
  if (!y) return s();
1112
1424
  n ? s(!1, n) : i = setTimeout(() => {
@@ -1125,18 +1437,18 @@ function Lt(e, t, n) {
1125
1437
  }
1126
1438
  r.observe(e);
1127
1439
  }
1128
- let c = K(e), l = () => s(n);
1440
+ let c = X(e), l = () => s(n);
1129
1441
  return c.addEventListener("resize", l), s(!0), () => {
1130
1442
  c.removeEventListener("resize", l), o();
1131
1443
  };
1132
1444
  }
1133
- function Rt(e, t, n, r) {
1445
+ function ln(e, t, n, r) {
1134
1446
  r === void 0 && (r = {});
1135
- let { ancestorScroll: i = !0, ancestorResize: a = !0, elementResize: o = typeof ResizeObserver == "function", layoutShift: s = typeof IntersectionObserver == "function", animationFrame: c = !1 } = r, l = ft(e), u = i || a ? [...l ? lt(l) : [], ...t ? lt(t) : []] : [];
1447
+ let { ancestorScroll: i = !0, ancestorResize: a = !0, elementResize: o = typeof ResizeObserver == "function", layoutShift: s = typeof IntersectionObserver == "function", animationFrame: c = !1 } = r, l = Ft(e), u = i || a ? [...l ? Mt(l) : [], ...t ? Mt(t) : []] : [];
1136
1448
  u.forEach((e) => {
1137
1449
  i && e.addEventListener("scroll", n), a && e.addEventListener("resize", n);
1138
1450
  });
1139
- let d = l && s ? Lt(l, n, a) : null, f = -1, p = null;
1451
+ let d = l && s ? cn(l, n, a) : null, f = -1, p = null;
1140
1452
  o && (p = new ResizeObserver((e) => {
1141
1453
  let [r] = e;
1142
1454
  r && r.target === l && p && t && (p.unobserve(t), cancelAnimationFrame(f), f = requestAnimationFrame(() => {
@@ -1144,11 +1456,11 @@ function Rt(e, t, n, r) {
1144
1456
  (e = p) == null || e.observe(t);
1145
1457
  })), n();
1146
1458
  }), l && !c && p.observe(l), t && p.observe(t));
1147
- let m, h = c ? $(e) : null;
1459
+ let m, h = c ? Bt(e) : null;
1148
1460
  c && g();
1149
1461
  function g() {
1150
- let t = $(e);
1151
- h && !It(h, t) && n(), h = t, m = requestAnimationFrame(g);
1462
+ let t = Bt(e);
1463
+ h && !sn(h, t) && n(), h = t, m = requestAnimationFrame(g);
1152
1464
  }
1153
1465
  return n(), () => {
1154
1466
  var e;
@@ -1157,18 +1469,18 @@ function Rt(e, t, n, r) {
1157
1469
  }), d?.(), (e = p) == null || e.disconnect(), p = null, c && cancelAnimationFrame(m);
1158
1470
  };
1159
1471
  }
1160
- var zt = Ge, Bt = Ke, Vt = He, Ht = Ve, Ut = (e, t, n) => {
1472
+ var un = dt, dn = ft, fn = ct, pn = st, mn = (e, t, n) => {
1161
1473
  let r = /* @__PURE__ */ new Map(), i = n ?? {}, a = {
1162
- ...Ft,
1474
+ ...on,
1163
1475
  ...i.platform,
1164
1476
  _c: r
1165
1477
  };
1166
- return Be(e, t, {
1478
+ return ot(e, t, {
1167
1479
  ...i,
1168
1480
  platform: a
1169
1481
  });
1170
- }, Wt = typeof document < "u" ? p : function() {};
1171
- function Gt(e, t) {
1482
+ }, hn = typeof document < "u" ? u : function() {};
1483
+ function gn(e, t) {
1172
1484
  if (e === t) return !0;
1173
1485
  if (typeof e != typeof t) return !1;
1174
1486
  if (typeof e == "function" && e.toString() === t.toString()) return !0;
@@ -1176,80 +1488,80 @@ function Gt(e, t) {
1176
1488
  if (e && t && typeof e == "object") {
1177
1489
  if (Array.isArray(e)) {
1178
1490
  if (n = e.length, n !== t.length) return !1;
1179
- for (r = n; r-- !== 0;) if (!Gt(e[r], t[r])) return !1;
1491
+ for (r = n; r-- !== 0;) if (!gn(e[r], t[r])) return !1;
1180
1492
  return !0;
1181
1493
  }
1182
1494
  if (i = Object.keys(e), n = i.length, n !== Object.keys(t).length) return !1;
1183
1495
  for (r = n; r-- !== 0;) if (!{}.hasOwnProperty.call(t, i[r])) return !1;
1184
1496
  for (r = n; r-- !== 0;) {
1185
1497
  let n = i[r];
1186
- if (!(n === "_owner" && e.$$typeof) && !Gt(e[n], t[n])) return !1;
1498
+ if (!(n === "_owner" && e.$$typeof) && !gn(e[n], t[n])) return !1;
1187
1499
  }
1188
1500
  return !0;
1189
1501
  }
1190
1502
  return e !== e && t !== t;
1191
1503
  }
1192
- function Kt(e) {
1504
+ function _n(e) {
1193
1505
  return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1194
1506
  }
1195
- function qt(e, t) {
1196
- let n = Kt(e);
1507
+ function vn(e, t) {
1508
+ let n = _n(e);
1197
1509
  return Math.round(t * n) / n;
1198
1510
  }
1199
- function Jt(e) {
1200
- let t = r.useRef(e);
1201
- return Wt(() => {
1202
- t.current = e;
1203
- }), t;
1511
+ function yn(t) {
1512
+ let n = e.useRef(t);
1513
+ return hn(() => {
1514
+ n.current = t;
1515
+ }), n;
1204
1516
  }
1205
- function Yt(e) {
1206
- e === void 0 && (e = {});
1207
- let { placement: t = "bottom", strategy: n = "absolute", middleware: i = [], platform: a, elements: { reference: o, floating: s } = {}, transform: c = !0, whileElementsMounted: l, open: u } = e, [d, f] = r.useState({
1517
+ function bn(t) {
1518
+ t === void 0 && (t = {});
1519
+ let { placement: n = "bottom", strategy: r = "absolute", middleware: i = [], platform: a, elements: { reference: o, floating: s } = {}, transform: c = !0, whileElementsMounted: l, open: u } = t, [d, f] = e.useState({
1208
1520
  x: 0,
1209
1521
  y: 0,
1210
- strategy: n,
1211
- placement: t,
1522
+ strategy: r,
1523
+ placement: n,
1212
1524
  middlewareData: {},
1213
1525
  isPositioned: !1
1214
- }), [p, m] = r.useState(i);
1215
- Gt(p, i) || m(i);
1216
- let [h, g] = r.useState(null), [_, y] = r.useState(null), b = r.useCallback((e) => {
1526
+ }), [p, m] = e.useState(i);
1527
+ gn(p, i) || m(i);
1528
+ let [h, g] = e.useState(null), [_, y] = e.useState(null), b = e.useCallback((e) => {
1217
1529
  e !== w.current && (w.current = e, g(e));
1218
- }, []), x = r.useCallback((e) => {
1530
+ }, []), x = e.useCallback((e) => {
1219
1531
  e !== T.current && (T.current = e, y(e));
1220
- }, []), S = o || h, C = s || _, w = r.useRef(null), T = r.useRef(null), E = r.useRef(d), D = l != null, O = Jt(l), k = Jt(a), A = Jt(u), j = r.useCallback(() => {
1532
+ }, []), S = o || h, C = s || _, w = e.useRef(null), T = e.useRef(null), E = e.useRef(d), D = l != null, O = yn(l), k = yn(a), A = yn(u), j = e.useCallback(() => {
1221
1533
  if (!w.current || !T.current) return;
1222
1534
  let e = {
1223
- placement: t,
1224
- strategy: n,
1535
+ placement: n,
1536
+ strategy: r,
1225
1537
  middleware: p
1226
1538
  };
1227
- k.current && (e.platform = k.current), Ut(w.current, T.current, e).then((e) => {
1539
+ k.current && (e.platform = k.current), mn(w.current, T.current, e).then((e) => {
1228
1540
  let t = {
1229
1541
  ...e,
1230
1542
  isPositioned: A.current !== !1
1231
1543
  };
1232
- M.current && !Gt(E.current, t) && (E.current = t, v.flushSync(() => {
1544
+ M.current && !gn(E.current, t) && (E.current = t, v.flushSync(() => {
1233
1545
  f(t);
1234
1546
  }));
1235
1547
  });
1236
1548
  }, [
1237
1549
  p,
1238
- t,
1239
1550
  n,
1551
+ r,
1240
1552
  k,
1241
1553
  A
1242
1554
  ]);
1243
- Wt(() => {
1555
+ hn(() => {
1244
1556
  u === !1 && E.current.isPositioned && (E.current.isPositioned = !1, f((e) => ({
1245
1557
  ...e,
1246
1558
  isPositioned: !1
1247
1559
  })));
1248
1560
  }, [u]);
1249
- let M = r.useRef(!1);
1250
- Wt(() => (M.current = !0, () => {
1561
+ let M = e.useRef(!1);
1562
+ hn(() => (M.current = !0, () => {
1251
1563
  M.current = !1;
1252
- }), []), Wt(() => {
1564
+ }), []), hn(() => {
1253
1565
  if (S && (w.current = S), C && (T.current = C), S && C) {
1254
1566
  if (O.current) return O.current(S, C, j);
1255
1567
  j();
@@ -1261,39 +1573,39 @@ function Yt(e) {
1261
1573
  O,
1262
1574
  D
1263
1575
  ]);
1264
- let N = r.useMemo(() => ({
1576
+ let N = e.useMemo(() => ({
1265
1577
  reference: w,
1266
1578
  floating: T,
1267
1579
  setReference: b,
1268
1580
  setFloating: x
1269
- }), [b, x]), P = r.useMemo(() => ({
1581
+ }), [b, x]), P = e.useMemo(() => ({
1270
1582
  reference: S,
1271
1583
  floating: C
1272
- }), [S, C]), F = r.useMemo(() => {
1584
+ }), [S, C]), F = e.useMemo(() => {
1273
1585
  let e = {
1274
- position: n,
1586
+ position: r,
1275
1587
  left: 0,
1276
1588
  top: 0
1277
1589
  };
1278
1590
  if (!P.floating) return e;
1279
- let t = qt(P.floating, d.x), r = qt(P.floating, d.y);
1591
+ let t = vn(P.floating, d.x), n = vn(P.floating, d.y);
1280
1592
  return c ? {
1281
1593
  ...e,
1282
- transform: "translate(" + t + "px, " + r + "px)",
1283
- ...Kt(P.floating) >= 1.5 && { willChange: "transform" }
1594
+ transform: "translate(" + t + "px, " + n + "px)",
1595
+ ..._n(P.floating) >= 1.5 && { willChange: "transform" }
1284
1596
  } : {
1285
- position: n,
1597
+ position: r,
1286
1598
  left: t,
1287
- top: r
1599
+ top: n
1288
1600
  };
1289
1601
  }, [
1290
- n,
1602
+ r,
1291
1603
  c,
1292
1604
  P.floating,
1293
1605
  d.x,
1294
1606
  d.y
1295
1607
  ]);
1296
- return r.useMemo(() => ({
1608
+ return e.useMemo(() => ({
1297
1609
  ...d,
1298
1610
  update: j,
1299
1611
  refs: N,
@@ -1307,7 +1619,7 @@ function Yt(e) {
1307
1619
  F
1308
1620
  ]);
1309
1621
  }
1310
- var Xt = (e) => {
1622
+ var xn = (e) => {
1311
1623
  function t(e) {
1312
1624
  return {}.hasOwnProperty.call(e, "current");
1313
1625
  }
@@ -1316,106 +1628,140 @@ var Xt = (e) => {
1316
1628
  options: e,
1317
1629
  fn(n) {
1318
1630
  let { element: r, padding: i } = typeof e == "function" ? e(n) : e;
1319
- return r && t(r) ? r.current == null ? {} : Ht({
1631
+ return r && t(r) ? r.current == null ? {} : pn({
1320
1632
  element: r.current,
1321
1633
  padding: i
1322
- }).fn(n) : r ? Ht({
1634
+ }).fn(n) : r ? pn({
1323
1635
  element: r,
1324
1636
  padding: i
1325
1637
  }).fn(n) : {};
1326
1638
  }
1327
1639
  };
1328
- }, Zt = (e, t) => {
1329
- let n = zt(e);
1640
+ }, Sn = (e, t) => {
1641
+ let n = un(e);
1330
1642
  return {
1331
1643
  name: n.name,
1332
1644
  fn: n.fn,
1333
1645
  options: [e, t]
1334
1646
  };
1335
- }, Qt = (e, t) => {
1336
- let n = Bt(e);
1647
+ }, Cn = (e, t) => {
1648
+ let n = dn(e);
1337
1649
  return {
1338
1650
  name: n.name,
1339
1651
  fn: n.fn,
1340
1652
  options: [e, t]
1341
1653
  };
1342
- }, $t = (e, t) => {
1343
- let n = Vt(e);
1654
+ }, wn = (e, t) => {
1655
+ let n = fn(e);
1344
1656
  return {
1345
1657
  name: n.name,
1346
1658
  fn: n.fn,
1347
1659
  options: [e, t]
1348
1660
  };
1349
- }, en = (e, t) => {
1350
- let n = Xt(e);
1661
+ }, Tn = (e, t) => {
1662
+ let n = xn(e);
1351
1663
  return {
1352
1664
  name: n.name,
1353
1665
  fn: n.fn,
1354
1666
  options: [e, t]
1355
1667
  };
1356
- }, tn = o(null);
1357
- function nn() {
1358
- return u(tn);
1668
+ }, En = r(null);
1669
+ function Dn() {
1670
+ return s(En);
1671
+ }
1672
+ //#endregion
1673
+ //#region src/components/menu/find_typeahead_index.ts
1674
+ var On = -1;
1675
+ function kn(e, t, n) {
1676
+ let r = n.toLowerCase(), i = e.length;
1677
+ for (let n = 1; n <= i; n += 1) {
1678
+ let a = (t + n + i) % i;
1679
+ if (e[a]?.toLowerCase().startsWith(r)) return a;
1680
+ }
1681
+ return On;
1359
1682
  }
1360
1683
  //#endregion
1361
1684
  //#region src/components/menu/menu_surface.tsx
1362
- var rn = "[role=\"menuitem\"]:not(:disabled):not([aria-disabled=\"true\"])";
1363
- function an(e, t) {
1364
- let n = Array.from(e.querySelectorAll(rn));
1685
+ var An = ":not(:disabled):not([aria-disabled=\"true\"])", jn = `[role="menuitem"]${An}, [role="menuitemradio"]${An}`;
1686
+ function Mn(e) {
1687
+ return Array.from(e.querySelectorAll(jn));
1688
+ }
1689
+ function Nn(e, t) {
1690
+ let n = Mn(e);
1365
1691
  n.length !== 0 && n[(t % n.length + n.length) % n.length]?.focus({ preventScroll: !0 });
1366
1692
  }
1367
- function on({ setFloating: r, floatingStyles: i, isVisible: a, isPositioned: o, radius: s, onClose: c, children: l }) {
1368
- let u = h(null);
1369
- return d(() => {
1370
- if (!o) return;
1371
- let e = u.current;
1372
- e && e.querySelector(rn)?.focus({ preventScroll: !0 });
1373
- }, [o]), y(/* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("div", {
1693
+ function Pn(e, t, n, r) {
1694
+ if (e.key === "ArrowDown") Nn(t, r + 1);
1695
+ else if (e.key === "ArrowUp") Nn(t, r - 1);
1696
+ else if (e.key === "Home") Nn(t, 0);
1697
+ else if (e.key === "End") Nn(t, n.length - 1);
1698
+ else return !1;
1699
+ return e.preventDefault(), !0;
1700
+ }
1701
+ function Fn(e) {
1702
+ return e.key.length === 1 && e.key !== " " && !e.ctrlKey && !e.metaKey && !e.altKey;
1703
+ }
1704
+ function In(e, t, n, r) {
1705
+ let i = kn(t.map((e) => e.textContent?.trim() ?? ""), n, r);
1706
+ i !== -1 && Nn(e, i);
1707
+ }
1708
+ function Ln({ setFloating: e, floatingStyles: t, isVisible: n, isPositioned: r, radius: i, onClose: a, children: o, id: s, labelledBy: l, "aria-label": u, initialFocus: d = "first" }) {
1709
+ let p = f(null);
1710
+ return c(() => {
1711
+ if (!r) return;
1712
+ let e = p.current;
1713
+ if (!e) return;
1714
+ let t = Mn(e);
1715
+ (d === "last" ? t[t.length - 1] : t[0])?.focus({ preventScroll: !0 });
1716
+ }, [r, d]), y(/* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
1374
1717
  className: "fixed inset-0 z-40",
1375
- onClick: c,
1718
+ onClick: a,
1376
1719
  "aria-hidden": "true"
1377
- }), /* @__PURE__ */ t("div", {
1378
- ref: r,
1379
- style: i,
1720
+ }), /* @__PURE__ */ g("div", {
1721
+ ref: e,
1722
+ style: t,
1380
1723
  className: "z-50",
1381
- children: /* @__PURE__ */ t("div", {
1382
- ref: u,
1724
+ children: /* @__PURE__ */ g("div", {
1725
+ ref: p,
1726
+ id: s,
1383
1727
  role: "menu",
1728
+ "aria-label": u,
1729
+ "aria-labelledby": l,
1384
1730
  tabIndex: -1,
1385
- "data-state": a ? "open" : "closed",
1731
+ "data-state": n ? "open" : "closed",
1386
1732
  onKeyDown: (e) => {
1387
- let t = u.current;
1733
+ let t = p.current;
1388
1734
  if (!t) return;
1389
- let n = Array.from(t.querySelectorAll(rn)), r = n.indexOf(document.activeElement);
1390
- e.key === "ArrowDown" ? (e.preventDefault(), an(t, r + 1)) : e.key === "ArrowUp" ? (e.preventDefault(), an(t, r - 1)) : e.key === "Home" ? (e.preventDefault(), an(t, 0)) : e.key === "End" ? (e.preventDefault(), an(t, n.length - 1)) : (e.key === "Escape" || e.key === "Tab") && c();
1735
+ let n = Mn(t), r = n.indexOf(document.activeElement);
1736
+ Pn(e, t, n, r) || (e.key === "Escape" ? (e.preventDefault(), a()) : e.key === "Tab" ? a() : Fn(e) && In(t, n, r, e.key));
1391
1737
  },
1392
- className: x("w-max min-w-40 max-w-xs origin-top border py-1 shadow-lg backdrop-blur-sm", "transition-[opacity,transform] duration-150 ease-out", a ? "scale-100 opacity-100" : "scale-95 opacity-0", ne, te, S[s]),
1738
+ className: x("w-max min-w-40 max-w-xs origin-top border py-1 shadow-lg backdrop-blur-sm", "transition-[opacity,transform] duration-150 ease-out", n ? "scale-100 opacity-100" : "scale-95 opacity-0", V, ie, S[i]),
1393
1739
  onClick: (e) => e.stopPropagation(),
1394
- children: /* @__PURE__ */ t(tn.Provider, {
1395
- value: c,
1396
- children: l
1740
+ children: /* @__PURE__ */ g(En.Provider, {
1741
+ value: a,
1742
+ children: o
1397
1743
  })
1398
1744
  })
1399
1745
  })] }), document.body);
1400
1746
  }
1401
1747
  //#endregion
1402
1748
  //#region src/components/shared/use_overlay_state.ts
1403
- function sn() {
1404
- let [e, t] = g(!1), [n, r] = g(!1), i = h(void 0);
1405
- return d(() => () => clearTimeout(i.current), []), {
1749
+ function Rn() {
1750
+ let [e, t] = p(!1), [n, r] = p(!1), i = f(void 0);
1751
+ return c(() => () => clearTimeout(i.current), []), {
1406
1752
  isMounted: e,
1407
1753
  isVisible: n,
1408
1754
  setIsVisible: r,
1409
- open: l((e) => {
1755
+ open: o((e) => {
1410
1756
  clearTimeout(i.current), t(!0), e && r(!0);
1411
1757
  }, []),
1412
- close: l(() => {
1758
+ close: o(() => {
1413
1759
  clearTimeout(i.current), r(!1), i.current = setTimeout(() => t(!1), 150);
1414
1760
  }, [])
1415
1761
  };
1416
1762
  }
1417
- function cn(e, t, n) {
1418
- d(() => {
1763
+ function zn(e, t, n) {
1764
+ c(() => {
1419
1765
  if (!e || !t) return;
1420
1766
  let r = requestAnimationFrame(() => n(!0));
1421
1767
  return () => cancelAnimationFrame(r);
@@ -1427,8 +1773,8 @@ function cn(e, t, n) {
1427
1773
  }
1428
1774
  //#endregion
1429
1775
  //#region src/components/context_menu/context_menu.tsx
1430
- var ln = 2;
1431
- function un(e, t) {
1776
+ var Bn = 2;
1777
+ function Vn(e, t) {
1432
1778
  return { getBoundingClientRect: () => ({
1433
1779
  width: 0,
1434
1780
  height: 0,
@@ -1440,7 +1786,7 @@ function un(e, t) {
1440
1786
  bottom: t
1441
1787
  }) };
1442
1788
  }
1443
- function dn(e) {
1789
+ function Hn(e) {
1444
1790
  if (e.clientX !== 0 || e.clientY !== 0) return {
1445
1791
  x: e.clientX,
1446
1792
  y: e.clientY
@@ -1454,43 +1800,44 @@ function dn(e) {
1454
1800
  y: 0
1455
1801
  };
1456
1802
  }
1457
- function fn({ children: e, items: r, radius: i = "md", className: a, ref: o }) {
1458
- let s = h(null), { isMounted: c, isVisible: u, setIsVisible: d, open: f, close: p } = sn(), { refs: m, floatingStyles: g, isPositioned: _ } = Yt({
1803
+ function Un({ children: e, items: t, radius: n = "md", className: r, ref: i, "aria-label": a }) {
1804
+ let s = f(null), { isMounted: c, isVisible: l, setIsVisible: u, open: d, close: p } = Rn(), { refs: m, floatingStyles: h, isPositioned: v } = bn({
1459
1805
  placement: "bottom-start",
1460
1806
  open: c,
1461
- whileElementsMounted: Rt,
1807
+ whileElementsMounted: ln,
1462
1808
  middleware: [
1463
- Zt(ln),
1464
- $t(),
1465
- Qt({ padding: 8 })
1809
+ Sn(Bn),
1810
+ wn(),
1811
+ Cn({ padding: 8 })
1466
1812
  ]
1467
1813
  });
1468
- cn(c, _, d);
1469
- let v = l(() => {
1814
+ zn(c, v, u);
1815
+ let y = o(() => {
1470
1816
  p(), s.current?.focus();
1471
1817
  }, [p]);
1472
- return /* @__PURE__ */ n("div", {
1473
- ref: o,
1474
- className: a,
1818
+ return /* @__PURE__ */ _("div", {
1819
+ ref: i,
1820
+ className: r,
1475
1821
  onContextMenu: (e) => {
1476
1822
  e.preventDefault(), s.current = document.activeElement;
1477
- let { x: t, y: n } = dn(e);
1478
- m.setReference(un(t, n)), f(!1);
1823
+ let { x: t, y: n } = Hn(e);
1824
+ m.setReference(Vn(t, n)), d(!1);
1479
1825
  },
1480
- children: [e, c && /* @__PURE__ */ t(on, {
1826
+ children: [e, c && /* @__PURE__ */ g(Ln, {
1827
+ "aria-label": a,
1481
1828
  setFloating: m.setFloating,
1482
- floatingStyles: g,
1483
- isVisible: u,
1484
- isPositioned: _,
1485
- radius: i,
1486
- onClose: v,
1487
- children: r
1829
+ floatingStyles: h,
1830
+ isVisible: l,
1831
+ isPositioned: v,
1832
+ radius: n,
1833
+ onClose: y,
1834
+ children: t
1488
1835
  })]
1489
1836
  });
1490
1837
  }
1491
1838
  //#endregion
1492
1839
  //#region src/lib/surface_error.ts
1493
- function pn(e, t) {
1840
+ function Wn(e, t) {
1494
1841
  if (t) {
1495
1842
  t(e);
1496
1843
  return;
@@ -1501,23 +1848,23 @@ function pn(e, t) {
1501
1848
  }
1502
1849
  //#endregion
1503
1850
  //#region src/components/copy_button/copy_button.tsx
1504
- var mn = 2e3;
1505
- function hn({ value: n, children: r, onError: i }) {
1506
- let [a, o] = g(!1), s = h(void 0);
1507
- return d(() => () => clearTimeout(s.current), []), /* @__PURE__ */ t(e, { children: r({
1508
- copied: a,
1851
+ var Gn = 2e3;
1852
+ function Kn({ value: e, children: t, onError: n }) {
1853
+ let [r, i] = p(!1), a = f(void 0);
1854
+ return c(() => () => clearTimeout(a.current), []), /* @__PURE__ */ g(h, { children: t({
1855
+ copied: r,
1509
1856
  copy: async () => {
1510
1857
  try {
1511
- await navigator.clipboard.writeText(n), o(!0), clearTimeout(s.current), s.current = setTimeout(() => o(!1), mn);
1858
+ await navigator.clipboard.writeText(e), i(!0), clearTimeout(a.current), a.current = setTimeout(() => i(!1), Gn);
1512
1859
  } catch (e) {
1513
- pn(e, i);
1860
+ Wn(e, n);
1514
1861
  }
1515
1862
  }
1516
1863
  }) });
1517
1864
  }
1518
1865
  //#endregion
1519
1866
  //#region src/lib/split_into_highlight_segments.ts
1520
- function gn(e, t) {
1867
+ function qn(e, t) {
1521
1868
  if (t.length === 0) return [{
1522
1869
  text: e,
1523
1870
  isMatch: !1
@@ -1540,56 +1887,63 @@ function gn(e, t) {
1540
1887
  }
1541
1888
  //#endregion
1542
1889
  //#region src/components/highlight/highlight.tsx
1543
- function _n({ text: n, ranges: r }) {
1544
- let i = gn(n, r), a = 0;
1545
- return /* @__PURE__ */ t(e, { children: i.map((e) => {
1546
- let n = a;
1547
- return a += e.text.length, e.isMatch ? /* @__PURE__ */ t("mark", {
1548
- className: "rounded bg-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:text-yellow-100",
1549
- children: e.text
1550
- }, n) : /* @__PURE__ */ t("span", { children: e.text }, n);
1551
- }) });
1890
+ function Jn(e) {
1891
+ let t = 0;
1892
+ return e.map((e) => {
1893
+ let n = t;
1894
+ return t += e.text.length, {
1895
+ ...e,
1896
+ start: n
1897
+ };
1898
+ });
1899
+ }
1900
+ function Yn({ text: e, ranges: t }) {
1901
+ let n = Jn(qn(e, t));
1902
+ return /* @__PURE__ */ g(h, { children: n.map((e) => e.isMatch ? /* @__PURE__ */ g("mark", {
1903
+ className: "rounded bg-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:text-yellow-100",
1904
+ children: e.text
1905
+ }, e.start) : /* @__PURE__ */ g("span", { children: e.text }, e.start)) });
1552
1906
  }
1553
1907
  //#endregion
1554
1908
  //#region src/components/icon_button/icon_button.tsx
1555
- var vn = {
1909
+ var Xn = {
1556
1910
  xs: "p-1",
1557
1911
  sm: "p-2",
1558
1912
  md: "p-2",
1559
1913
  lg: "p-3"
1560
- }, yn = {
1914
+ }, Zn = {
1561
1915
  xs: "w-4 h-4",
1562
1916
  sm: "w-4 h-4",
1563
1917
  md: "w-5 h-5",
1564
1918
  lg: "w-6 h-6"
1565
1919
  };
1566
- function bn(e) {
1567
- let { icon: r, "aria-label": i, unstyled: a = !1, variant: o = "outline", color: s = "neutral", size: c = "md", radius: l = "md", className: u, children: d, ref: f, ...p } = e, m = O[s];
1568
- return /* @__PURE__ */ n("button", {
1569
- ref: f,
1920
+ function Qn(e) {
1921
+ let { icon: t, "aria-label": n, unstyled: r = !1, variant: i = "outline", color: a = "neutral", size: o = "md", radius: s = "md", className: c, children: l, ref: u, ...d } = e, f = A[a];
1922
+ return /* @__PURE__ */ _("button", {
1923
+ ref: u,
1570
1924
  type: "button",
1571
- "aria-label": i,
1572
- className: x(k, !a && [
1573
- A,
1925
+ "aria-label": n,
1926
+ className: x(j, !r && [
1927
+ M,
1574
1928
  "border",
1575
- S[l],
1576
- vn[c],
1577
- m[o],
1578
- m.focusOutline
1579
- ], u),
1580
- ...p,
1581
- children: [/* @__PURE__ */ t("div", { className: x(r, yn[c], d && "mr-1") }), d]
1929
+ S[s],
1930
+ Xn[o],
1931
+ f[i],
1932
+ f.focusOutline
1933
+ ], c),
1934
+ ...d,
1935
+ children: [/* @__PURE__ */ g("div", { className: x(t, Zn[o], l && "mr-1") }), l]
1582
1936
  });
1583
1937
  }
1584
1938
  //#endregion
1585
1939
  //#region src/components/shared/use_controlled_length.ts
1586
- function xn(e) {
1940
+ function $n(e) {
1587
1941
  return typeof e == "string" ? e.length : 0;
1588
1942
  }
1589
- function Sn(e, t) {
1590
- let [n, r] = g(xn(t)), i = e !== void 0;
1943
+ function er(e, t) {
1944
+ let [n, r] = p($n(t)), i = e !== void 0;
1591
1945
  return {
1592
- length: i ? xn(e) : n,
1946
+ length: i ? $n(e) : n,
1593
1947
  trackLength: (e) => {
1594
1948
  i || r(e.length);
1595
1949
  }
@@ -1597,160 +1951,219 @@ function Sn(e, t) {
1597
1951
  }
1598
1952
  //#endregion
1599
1953
  //#region src/components/input/input.tsx
1600
- function Cn({ label: e, error: r, showCharCount: i = !1, minLength: a, maxLength: o, radius: s = "md", unstyled: c = !1, className: l, wrapperClassName: u, value: d, defaultValue: f, onChange: p, id: m, ...h }) {
1601
- let { fieldId: g, errorId: _ } = V(m), { length: v, trackLength: y } = Sn(d, f), b = i && (a !== void 0 || o !== void 0), C = (e) => {
1602
- y(e.target.value), p?.(e);
1954
+ function tr({ label: e, error: t, showCharCount: n = !1, minLength: r, maxLength: i, radius: a = "md", unstyled: o = !1, className: s, wrapperClassName: c, value: l, defaultValue: u, onChange: d, id: f, "aria-describedby": p, ...m }) {
1955
+ let { fieldId: h, errorId: v, characterCountId: y } = K(f), { length: b, trackLength: C } = er(l, u), w = n && (r !== void 0 || i !== void 0), T = (e) => {
1956
+ C(e.target.value), d?.(e);
1603
1957
  };
1604
- return /* @__PURE__ */ n(de, {
1605
- fieldId: g,
1606
- errorId: _,
1958
+ return /* @__PURE__ */ _(Oe, {
1959
+ fieldId: h,
1960
+ errorId: v,
1607
1961
  label: e,
1608
- error: r,
1609
- required: h.required,
1610
- wrapperClassName: u,
1611
- children: [/* @__PURE__ */ t("input", {
1612
- id: g,
1613
- className: x("w-full disabled:opacity-50 disabled:cursor-not-allowed", !c && [
1614
- B,
1615
- S[s],
1962
+ error: t,
1963
+ required: m.required,
1964
+ wrapperClassName: c,
1965
+ children: [/* @__PURE__ */ g("input", {
1966
+ id: h,
1967
+ className: x("w-full disabled:opacity-50 disabled:cursor-not-allowed", !o && [
1968
+ le,
1969
+ S[a],
1616
1970
  "px-3 py-2 text-sm"
1617
- ], !c && r && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), l),
1618
- ...d === void 0 ? { defaultValue: f } : { value: d },
1619
- minLength: a,
1620
- maxLength: o,
1621
- onChange: C,
1622
- "aria-invalid": !!r,
1623
- "aria-describedby": r ? _ : void 0,
1624
- ...h
1625
- }), b && /* @__PURE__ */ t(R, {
1626
- current: v,
1627
- min: a,
1628
- max: o,
1629
- showMin: a !== void 0,
1630
- showMax: o !== void 0
1971
+ ], !o && t && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), s),
1972
+ ...l === void 0 ? { defaultValue: u } : { value: l },
1973
+ minLength: r,
1974
+ maxLength: i,
1975
+ onChange: T,
1976
+ "aria-invalid": !!t,
1977
+ "aria-describedby": G(p, t && v, w && y),
1978
+ ...m
1979
+ }), w && /* @__PURE__ */ g(ce, {
1980
+ id: y,
1981
+ current: b,
1982
+ min: r,
1983
+ max: i,
1984
+ showMin: r !== void 0,
1985
+ showMax: i !== void 0
1631
1986
  })]
1632
1987
  });
1633
1988
  }
1634
1989
  //#endregion
1635
1990
  //#region src/components/kbd/kbd.tsx
1636
- var wn = {
1991
+ var nr = {
1637
1992
  xs: "px-1.5 py-0.5 text-xs",
1638
1993
  sm: "px-2 py-0.5 text-xs",
1639
1994
  md: "px-2.5 py-1 text-sm",
1640
1995
  lg: "px-3 py-1 text-base"
1641
- }, Tn = ({ children: e, size: n = "sm", radius: r = "sm", unstyled: i = !1, className: a }) => /* @__PURE__ */ t("kbd", {
1642
- className: x("inline-flex items-center", wn[n], !i && [
1996
+ }, rr = ({ children: e, size: t = "sm", radius: n = "sm", unstyled: r = !1, className: i }) => /* @__PURE__ */ g("kbd", {
1997
+ className: x("inline-flex items-center", nr[t], !r && [
1643
1998
  "border font-semibold uppercase",
1644
- "text-gray-500 dark:text-gray-400",
1999
+ "text-gray-600 dark:text-gray-300",
1645
2000
  "bg-gray-100 dark:bg-gray-700",
1646
2001
  "border-gray-200 dark:border-gray-600",
1647
- S[r]
1648
- ], a),
2002
+ S[n]
2003
+ ], i),
1649
2004
  children: e
1650
2005
  });
1651
2006
  //#endregion
1652
2007
  //#region src/lib/merge_refs.ts
1653
- function En(...e) {
2008
+ function ir(...e) {
1654
2009
  return (t) => {
1655
2010
  for (let n of e) typeof n == "function" ? n(t) : n && (n.current = t);
1656
2011
  };
1657
2012
  }
1658
2013
  //#endregion
1659
2014
  //#region src/components/menu/menu.tsx
1660
- var Dn = 4;
1661
- function On(e, t) {
2015
+ var ar = 4;
2016
+ function or(e, t) {
1662
2017
  return t === "center" ? e : `${e}-${t}`;
1663
2018
  }
1664
- function kn({ trigger: e, children: r, side: i = "bottom", align: o = "start", radius: s = "md", className: u, ref: d }) {
1665
- let f = h(null), { isMounted: p, isVisible: m, setIsVisible: g, open: _, close: v } = sn(), { refs: y, floatingStyles: b, isPositioned: S } = Yt({
1666
- placement: On(i, o),
1667
- open: p,
1668
- whileElementsMounted: Rt,
2019
+ function sr({ trigger: e, children: t, side: r = "bottom", align: i = "start", radius: s = "md", className: c, ref: u }) {
2020
+ let d = f(null), [m, h] = p("first"), { isMounted: v, isVisible: y, setIsVisible: b, open: S, close: C } = Rn(), { refs: w, floatingStyles: T, isPositioned: E } = bn({
2021
+ placement: or(r, i),
2022
+ open: v,
2023
+ whileElementsMounted: ln,
1669
2024
  middleware: [
1670
- Zt(Dn),
1671
- $t(),
1672
- Qt({ padding: 8 })
2025
+ Sn(ar),
2026
+ wn(),
2027
+ Cn({ padding: 8 })
1673
2028
  ]
1674
2029
  });
1675
- cn(p, S, g);
1676
- let C = l(() => {
1677
- v(), f.current?.querySelector("button, [href], [tabindex]")?.focus();
1678
- }, [v]), w = l((e) => En(y.setReference, f, d)(e), [y, d]), T = {
2030
+ zn(v, E, b);
2031
+ let D = l(), O = (a(e) ? e.props.id : void 0) ?? D, k = `${O}-menu`, A = o(() => {
2032
+ C(), d.current?.querySelector("button, [href], [tabindex]")?.focus();
2033
+ }, [C]), j = o((e) => ir(w.setReference, d, u)(e), [w, u]), M = {
2034
+ id: O,
1679
2035
  onClick: (t) => {
1680
- t.stopPropagation(), m ? v() : _(S), c(e) && e.props.onClick?.(t);
2036
+ t.stopPropagation(), y ? C() : (h("first"), S(E)), a(e) && e.props.onClick?.(t);
2037
+ },
2038
+ onKeyDown: (t) => {
2039
+ !y && t.key === "ArrowDown" ? (t.preventDefault(), h("first"), S(E)) : !y && t.key === "ArrowUp" && (t.preventDefault(), h("last"), S(E)), a(e) && e.props.onKeyDown?.(t);
1681
2040
  },
1682
2041
  "aria-haspopup": "menu",
1683
- "aria-expanded": p
1684
- }, E = c(e) ? a(e, T) : e;
1685
- return /* @__PURE__ */ n("span", {
1686
- ref: w,
1687
- className: x("inline-block", u),
1688
- children: [E, p && /* @__PURE__ */ t(on, {
1689
- setFloating: y.setFloating,
1690
- floatingStyles: b,
1691
- isVisible: m,
1692
- isPositioned: S,
2042
+ "aria-expanded": v,
2043
+ "aria-controls": v ? k : void 0
2044
+ }, N = a(e) ? n(e, M) : e;
2045
+ return /* @__PURE__ */ _("span", {
2046
+ ref: j,
2047
+ className: x("inline-block", c),
2048
+ children: [N, v && /* @__PURE__ */ g(Ln, {
2049
+ id: k,
2050
+ labelledBy: O,
2051
+ setFloating: w.setFloating,
2052
+ floatingStyles: T,
2053
+ isVisible: y,
2054
+ isPositioned: E,
1693
2055
  radius: s,
1694
- onClose: C,
1695
- children: r
2056
+ onClose: A,
2057
+ initialFocus: m,
2058
+ children: t
1696
2059
  })]
1697
2060
  });
1698
2061
  }
1699
2062
  //#endregion
1700
- //#region src/components/menu_item/menu_item.tsx
1701
- var An = "_blank", jn = "noopener noreferrer", Mn = ["flex w-full cursor-pointer items-center gap-2 whitespace-nowrap px-4 py-2 text-left text-sm transition-colors", "focus-visible:bg-gray-100 focus-visible:outline-none dark:focus-visible:bg-gray-700"], Nn = ["hover:enabled:bg-gray-100 dark:hover:enabled:bg-gray-700", "disabled:cursor-not-allowed disabled:opacity-50"], Pn = ["no-underline hover:bg-gray-100 dark:hover:bg-gray-700", "aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-50"];
1702
- function Fn(e, t, n) {
1703
- return x(Mn, e, t ? "text-red-600 dark:text-red-400" : "text-gray-700 dark:text-gray-300", n);
2063
+ //#region src/components/menu_group/menu_group.tsx
2064
+ function cr({ label: e, children: t, unstyled: n = !1, className: r, wrapperClassName: i }) {
2065
+ let a = l();
2066
+ return /* @__PURE__ */ _("div", {
2067
+ role: "group",
2068
+ "aria-labelledby": a,
2069
+ className: i,
2070
+ children: [/* @__PURE__ */ g("div", {
2071
+ id: a,
2072
+ role: "presentation",
2073
+ className: x(!n && "px-4 py-1.5 text-xs font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400", r),
2074
+ children: e
2075
+ }), t]
2076
+ });
1704
2077
  }
1705
- var In = ({ icon: r, children: i }) => /* @__PURE__ */ n(e, { children: [r && /* @__PURE__ */ t("div", {
1706
- className: x(r, "h-4 w-4 flex-shrink-0"),
1707
- "aria-hidden": "true"
1708
- }), i] });
1709
- function Ln({ icon: e, onClick: n, danger: r = !1, disabled: i = !1, children: a, className: o, ref: s }) {
1710
- let c = nn();
1711
- return /* @__PURE__ */ t("button", {
1712
- ref: s,
1713
- type: "button",
1714
- role: "menuitem",
1715
- tabIndex: -1,
1716
- onClick: (e) => {
1717
- e.stopPropagation(), n(e), c?.();
1718
- },
1719
- disabled: i,
1720
- className: Fn(Nn, r, o),
1721
- children: /* @__PURE__ */ t(In, {
1722
- icon: e,
1723
- children: a
1724
- })
2078
+ //#endregion
2079
+ //#region src/components/menu_item/menu_item_end.tsx
2080
+ function lr({ trailing: e, selected: t }) {
2081
+ let n = t !== void 0;
2082
+ return !e && !n ? null : /* @__PURE__ */ _("span", {
2083
+ className: "ml-auto flex flex-shrink-0 items-center gap-2 pl-2",
2084
+ children: [e && /* @__PURE__ */ g("span", {
2085
+ className: "text-xs text-gray-500 dark:text-gray-400",
2086
+ children: e
2087
+ }), n && /* @__PURE__ */ g("span", {
2088
+ className: x("i-mdi-check h-4 w-4", !t && "invisible"),
2089
+ "aria-hidden": "true"
2090
+ })]
1725
2091
  });
1726
2092
  }
1727
- function Rn({ icon: e, href: n, target: r, rel: i, danger: a = !1, disabled: o = !1, children: s, className: c, ref: l }) {
1728
- let u = nn();
1729
- return /* @__PURE__ */ t("a", {
2093
+ //#endregion
2094
+ //#region src/components/menu_item/menu_item_styles.ts
2095
+ var ur = [
2096
+ "flex w-full cursor-pointer items-center gap-2 whitespace-nowrap px-4 py-2 text-left text-sm transition-colors",
2097
+ "focus-visible:bg-gray-100 dark:focus-visible:bg-gray-700",
2098
+ k
2099
+ ];
2100
+ function dr(e, t, n) {
2101
+ return x(ur, e, t ? "text-red-700 dark:text-red-300" : "text-gray-700 dark:text-gray-300", n);
2102
+ }
2103
+ //#endregion
2104
+ //#region src/components/menu_item/menu_item_content.tsx
2105
+ var fr = ({ icon: e, children: t }) => /* @__PURE__ */ _(h, { children: [e && /* @__PURE__ */ g("div", {
2106
+ className: x(e, "h-4 w-4 flex-shrink-0"),
2107
+ "aria-hidden": "true"
2108
+ }), t] }), pr = "_blank", mr = "noopener noreferrer", hr = ["no-underline hover:bg-gray-100 dark:hover:bg-gray-700", "aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-50"];
2109
+ function gr({ icon: e, trailing: t, href: n, target: r, rel: i, danger: a = !1, disabled: o = !1, children: s, className: c, ref: l }) {
2110
+ let u = Dn();
2111
+ return /* @__PURE__ */ _("a", {
1730
2112
  ref: l,
1731
2113
  role: "menuitem",
1732
2114
  tabIndex: -1,
1733
2115
  href: o ? void 0 : n,
1734
2116
  target: r,
1735
- rel: i ?? (r === An ? jn : void 0),
2117
+ rel: i ?? (r === pr ? mr : void 0),
1736
2118
  "aria-disabled": o || void 0,
1737
2119
  onClick: (e) => {
1738
2120
  e.stopPropagation(), u?.();
1739
2121
  },
1740
- className: Fn(Pn, a, c),
1741
- children: /* @__PURE__ */ t(In, {
2122
+ className: dr(hr, a, c),
2123
+ children: [/* @__PURE__ */ g(fr, {
1742
2124
  icon: e,
1743
2125
  children: s
1744
- })
2126
+ }), /* @__PURE__ */ g(lr, { trailing: t })]
1745
2127
  });
1746
2128
  }
1747
- function zn(e) {
1748
- return e.href === void 0 ? /* @__PURE__ */ t(Ln, { ...e }) : /* @__PURE__ */ t(Rn, { ...e });
2129
+ //#endregion
2130
+ //#region src/components/menu_item/menu_item_button.tsx
2131
+ var _r = ["hover:enabled:bg-gray-100 dark:hover:enabled:bg-gray-700", "disabled:cursor-not-allowed disabled:opacity-50"];
2132
+ function vr({ icon: e, trailing: t, onClick: n, selected: r, danger: i = !1, disabled: a = !1, children: o, className: s, ref: c }) {
2133
+ let l = Dn();
2134
+ return /* @__PURE__ */ _("button", {
2135
+ ref: c,
2136
+ type: "button",
2137
+ role: r === void 0 ? "menuitem" : "menuitemradio",
2138
+ "aria-checked": r,
2139
+ tabIndex: -1,
2140
+ onClick: (e) => {
2141
+ e.stopPropagation(), n(e), l?.();
2142
+ },
2143
+ disabled: a,
2144
+ className: dr(_r, i, s),
2145
+ children: [/* @__PURE__ */ g(fr, {
2146
+ icon: e,
2147
+ children: o
2148
+ }), /* @__PURE__ */ g(lr, {
2149
+ trailing: t,
2150
+ selected: r
2151
+ })]
2152
+ });
2153
+ }
2154
+ //#endregion
2155
+ //#region src/components/menu_item/menu_item.tsx
2156
+ function yr(e) {
2157
+ return e.href === void 0 ? /* @__PURE__ */ g(vr, { ...e }) : /* @__PURE__ */ g(gr, { ...e });
1749
2158
  }
1750
2159
  //#endregion
1751
- //#region node_modules/.pnpm/react-call@2.0.2_react-dom@19.2.8_react@19.2.8__react@19.2.8_vite@8.2.1_@types+node@26.2.0_es_s57p6lt2ddgt4vomhz3tbzqsbu/node_modules/react-call/dist/main.js
1752
- var Bn = [];
1753
- function Vn() {
2160
+ //#region src/components/menu_separator/menu_separator.tsx
2161
+ var br = ({ unstyled: e = !1, className: t }) => /* @__PURE__ */ g("hr", {
2162
+ role: "separator",
2163
+ "aria-orientation": "horizontal",
2164
+ className: x("w-full", !e && ["my-1 border-0 border-t", "border-gray-200 dark:border-gray-700"], t)
2165
+ }), xr = [];
2166
+ function Sr() {
1754
2167
  let e = 0, t = [], n = null, r = /* @__PURE__ */ new Set(), i = () => {
1755
2168
  for (let e of r) e(t);
1756
2169
  };
@@ -1771,7 +2184,7 @@ function Vn() {
1771
2184
  r.delete(i), r.size || (e = 0, t = [], n = null);
1772
2185
  }),
1773
2186
  getSnapshot: () => t,
1774
- getServerSnapshot: () => Bn,
2187
+ getServerSnapshot: () => xr,
1775
2188
  getListenersSize: () => r.size,
1776
2189
  getUpsertPromise: () => n,
1777
2190
  setUpsertPromise: (e) => {
@@ -1779,39 +2192,39 @@ function Vn() {
1779
2192
  }
1780
2193
  };
1781
2194
  }
1782
- var Hn = /* @__PURE__ */ new Map();
1783
- function Un(e, t = 0) {
1784
- let n = { current: Vn() }, r = (e) => (r) => {
2195
+ var Cr = /* @__PURE__ */ new Map();
2196
+ function wr(e, t = 0) {
2197
+ let n = { current: Sr() }, r = (e) => (r) => {
1785
2198
  let i = /* @__PURE__ */ new Set();
1786
2199
  n.current.set(e, (e) => (e.resolve(r), i.add(e.promise), {
1787
2200
  ...e,
1788
2201
  ended: !0
1789
2202
  })), globalThis.setTimeout(() => n.current.remove(i), t);
1790
- }, i = () => {
2203
+ }, a = () => {
1791
2204
  let e = n.current.getListenersSize();
1792
2205
  if (!e) throw Error("No <Root> found!");
1793
2206
  if (e > 1) throw Error("Multiple instances of <Root> found!");
1794
- }, a = (e) => {
1795
- i();
1796
- let t, a = new Promise((e) => {
2207
+ }, o = (e) => {
2208
+ a();
2209
+ let t, i = new Promise((e) => {
1797
2210
  t = e;
1798
2211
  });
1799
2212
  return n.current.add({
1800
2213
  props: e,
1801
- end: r(a),
2214
+ end: r(i),
1802
2215
  ended: !1,
1803
- promise: a,
2216
+ promise: i,
1804
2217
  resolve: t
1805
- }), a;
1806
- }, o = (e) => {
1807
- i();
2218
+ }), i;
2219
+ }, s = (e) => {
2220
+ a();
1808
2221
  let t = n.current.getUpsertPromise();
1809
2222
  if (t) return n.current.set(t, (t) => ({
1810
2223
  ...t,
1811
2224
  props: e
1812
2225
  })), t;
1813
- let a, o = new Promise((e) => {
1814
- a = e;
2226
+ let i, o = new Promise((e) => {
2227
+ i = e;
1815
2228
  });
1816
2229
  return n.current.setUpsertPromise(o), n.current.add({
1817
2230
  props: e,
@@ -1820,7 +2233,7 @@ function Un(e, t = 0) {
1820
2233
  },
1821
2234
  ended: !1,
1822
2235
  promise: o,
1823
- resolve: a
2236
+ resolve: i
1824
2237
  }), o;
1825
2238
  }, c = (...e) => {
1826
2239
  let t = e.length === 2, i = t ? e[0] : null, a = t ? e[1] : e[0];
@@ -1835,22 +2248,22 @@ function Un(e, t = 0) {
1835
2248
  }
1836
2249
  }));
1837
2250
  }, u = function(t) {
1838
- return _(n.current.subscribe, n.current.getSnapshot, n.current.getServerSnapshot).map(({ props: n, key: r, end: i, ended: a }, o, c) => /* @__PURE__ */ s(e, {
2251
+ return m(n.current.subscribe, n.current.getSnapshot, n.current.getServerSnapshot).map(({ props: n, key: r, end: a, ended: o }, s, c) => /* @__PURE__ */ i(e, {
1839
2252
  ...n,
1840
2253
  key: r,
1841
2254
  call: {
1842
2255
  key: r,
1843
- end: i,
1844
- ended: a,
2256
+ end: a,
2257
+ ended: o,
1845
2258
  root: t,
1846
- index: o,
2259
+ index: s,
1847
2260
  stackSize: c.length
1848
2261
  }
1849
2262
  }));
1850
2263
  }, d = Object.assign(u, {
1851
2264
  Root: u,
1852
- call: a,
1853
- upsert: o,
2265
+ call: o,
2266
+ upsert: s,
1854
2267
  end: c,
1855
2268
  update: l
1856
2269
  });
@@ -1867,106 +2280,185 @@ function Un(e, t = 0) {
1867
2280
  set: (r) => {
1868
2281
  if (t || (e = r, !r)) return;
1869
2282
  t = !0;
1870
- let i = Hn.get(r);
1871
- i ? n.current = i : Hn.set(r, n.current);
2283
+ let i = Cr.get(r);
2284
+ i ? n.current = i : Cr.set(r, n.current);
1872
2285
  }
1873
2286
  });
1874
2287
  }
1875
2288
  return d;
1876
2289
  }
1877
2290
  //#endregion
2291
+ //#region src/components/shared/tabbable.ts
2292
+ var Tr = [
2293
+ "a[href]",
2294
+ "button",
2295
+ "input",
2296
+ "select",
2297
+ "textarea",
2298
+ "summary",
2299
+ "audio[controls]",
2300
+ "video[controls]",
2301
+ "[contenteditable]:not([contenteditable=\"false\"])",
2302
+ "[tabindex]"
2303
+ ].join(", ");
2304
+ function Er(e) {
2305
+ return e.matches(":disabled");
2306
+ }
2307
+ function Dr(e) {
2308
+ return e.getAttribute("tabindex") === "-1";
2309
+ }
2310
+ function Or(e) {
2311
+ return e.matches("input[type=\"hidden\"]");
2312
+ }
2313
+ function kr(e) {
2314
+ return e.closest("[inert]") !== null;
2315
+ }
2316
+ function Ar(e) {
2317
+ return typeof e.checkVisibility != "function" || e.checkVisibility();
2318
+ }
2319
+ function jr(e) {
2320
+ return !Er(e) && !Dr(e) && !Or(e) && !kr(e) && Ar(e);
2321
+ }
2322
+ function Mr(e) {
2323
+ return e instanceof HTMLInputElement && e.type === "radio" && e.name !== "";
2324
+ }
2325
+ function Nr(e) {
2326
+ let t = /* @__PURE__ */ new Map();
2327
+ for (let n of e) {
2328
+ let e = t.get(n.form) ?? /* @__PURE__ */ new Map();
2329
+ t.set(n.form, e);
2330
+ let r = e.get(n.name) ?? [];
2331
+ r.push(n), e.set(n.name, r);
2332
+ }
2333
+ return Array.from(t.values()).flatMap((e) => Array.from(e.values()));
2334
+ }
2335
+ function Pr(e) {
2336
+ return e.find((e) => e.checked) ?? e[0];
2337
+ }
2338
+ function Fr(e) {
2339
+ let t = Array.from(e.querySelectorAll(Tr)).filter(jr), n = t.filter(Mr), r = new Set(Nr(n).map(Pr));
2340
+ return t.filter((e) => !Mr(e) || r.has(e));
2341
+ }
2342
+ //#endregion
2343
+ //#region src/components/modal/modal_stack.ts
2344
+ var Ir = [];
2345
+ function Lr(e) {
2346
+ return Ir.push(e), () => {
2347
+ let t = Ir.indexOf(e);
2348
+ t !== -1 && Ir.splice(t, 1);
2349
+ };
2350
+ }
2351
+ function Rr(e) {
2352
+ return Ir[Ir.length - 1] === e;
2353
+ }
2354
+ //#endregion
1878
2355
  //#region src/components/modal/modal_shell.tsx
1879
- var Wn = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])", Gn = {
2356
+ var zr = {
1880
2357
  sm: "max-w-md",
1881
2358
  md: "max-w-lg",
1882
2359
  lg: "max-w-2xl",
1883
2360
  xl: "max-w-4xl"
1884
2361
  };
1885
- function Kn({ isEnded: e, onDismiss: r, title: i, children: a, footer: o, size: s = "md", radius: c = "xl", className: l, dismissible: u = !0, closeLabel: p = "Close" }) {
1886
- let [m, _] = g(!1), v = h(null), b = h(null), C = h(null), w = f();
1887
- d(() => {
1888
- document.body.style.overflow = "hidden", C.current = document.activeElement;
1889
- let e = v.current;
1890
- (b.current?.querySelector(Wn) ?? e?.querySelector(Wn) ?? e)?.focus();
1891
- let t = requestAnimationFrame(() => {
1892
- requestAnimationFrame(() => _(!0));
2362
+ function Br({ isEnded: e, onDismiss: t, title: n, children: r, footer: i, size: a = "md", radius: o = "xl", className: s, dismissible: u = !0, closeLabel: d = "Close", role: m = "dialog", initialFocusRef: h, "aria-label": v }) {
2363
+ let [b, C] = p(!1), [w] = p(() => Symbol("modal")), T = f(null), E = f(null), D = f(null), O = l(), k = l();
2364
+ c(() => {
2365
+ if (!e) return Lr(w);
2366
+ }, [e, w]), c(() => {
2367
+ document.body.style.overflow = "hidden", D.current = document.activeElement;
2368
+ let e = T.current, t = (E.current && Fr(E.current)[0]) ?? (e && Fr(e)[0]);
2369
+ (h?.current ?? t ?? e)?.focus();
2370
+ let n = requestAnimationFrame(() => {
2371
+ requestAnimationFrame(() => C(!0));
1893
2372
  });
1894
2373
  return () => {
1895
- cancelAnimationFrame(t), document.body.style.overflow = "";
2374
+ cancelAnimationFrame(n), document.body.style.overflow = "";
1896
2375
  };
1897
- }, []), d(() => {
1898
- e && C.current?.focus();
1899
- }, [e]), d(() => {
2376
+ }, []), c(() => {
2377
+ e && D.current?.focus();
2378
+ }, [e]), c(() => {
1900
2379
  if (e) return;
1901
- let t = (e) => {
2380
+ let n = (e) => {
2381
+ if (!Rr(w)) return;
1902
2382
  if (e.key === "Escape") {
1903
- u && r();
2383
+ if (e.defaultPrevented) return;
2384
+ e.preventDefault(), u && t();
1904
2385
  return;
1905
2386
  }
1906
2387
  if (e.key !== "Tab") return;
1907
- let t = v.current;
1908
- if (!t) return;
1909
- let n = Array.from(t.querySelectorAll(Wn));
1910
- if (n.length === 0) return;
1911
- let i = n[0], a = n[n.length - 1];
1912
- e.shiftKey && document.activeElement === i ? (e.preventDefault(), a.focus()) : !e.shiftKey && document.activeElement === a && (e.preventDefault(), i.focus());
2388
+ let n = T.current;
2389
+ if (!n) return;
2390
+ let r = Fr(n);
2391
+ if (r.length === 0) {
2392
+ e.preventDefault(), n.focus();
2393
+ return;
2394
+ }
2395
+ let i = r[0], a = r[r.length - 1], o = document.activeElement;
2396
+ if ((o instanceof HTMLElement ? r.indexOf(o) : -1) === -1) {
2397
+ e.preventDefault(), (e.shiftKey ? a : i).focus();
2398
+ return;
2399
+ }
2400
+ e.shiftKey && o === i ? (e.preventDefault(), a.focus()) : !e.shiftKey && o === a && (e.preventDefault(), i.focus());
1913
2401
  };
1914
- return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
2402
+ return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
1915
2403
  }, [
1916
2404
  e,
1917
- r,
1918
- u
2405
+ t,
2406
+ u,
2407
+ w
1919
2408
  ]);
1920
- let T = () => {
1921
- !e && u && r();
1922
- }, E = m && !e;
1923
- return y(/* @__PURE__ */ n("div", {
1924
- className: x("fixed inset-0 z-50 flex items-start justify-center", "p-2 sm:py-[3rem] lg:py-[5rem]", "transition-opacity duration-200 ease-out", E ? "opacity-100" : "opacity-0"),
1925
- onClick: T,
1926
- children: [/* @__PURE__ */ t("div", {
1927
- className: x("fixed inset-0 bg-black/60 backdrop-blur-md", "transition-opacity duration-200 ease-out", E ? "opacity-100" : "opacity-0"),
2409
+ let A = () => {
2410
+ !e && u && t();
2411
+ }, j = m === "alertdialog" && !!r, M = b && !e;
2412
+ return y(/* @__PURE__ */ _("div", {
2413
+ className: x("fixed inset-0 z-50 flex items-start justify-center", "p-2 sm:py-[3rem] lg:py-[5rem]", "transition-opacity duration-200 ease-out", M ? "opacity-100" : "opacity-0"),
2414
+ onClick: A,
2415
+ children: [/* @__PURE__ */ g("div", {
2416
+ className: x("fixed inset-0 bg-black/60 backdrop-blur-md", "transition-opacity duration-200 ease-out", M ? "opacity-100" : "opacity-0"),
1928
2417
  "aria-hidden": "true"
1929
- }), /* @__PURE__ */ n("div", {
1930
- ref: v,
1931
- role: "dialog",
2418
+ }), /* @__PURE__ */ _("div", {
2419
+ ref: T,
2420
+ role: m,
1932
2421
  "aria-modal": "true",
1933
- "aria-labelledby": i ? w : void 0,
2422
+ "aria-labelledby": n ? O : void 0,
2423
+ "aria-label": n ? void 0 : v,
2424
+ "aria-describedby": j ? k : void 0,
1934
2425
  tabIndex: -1,
1935
- className: x("relative w-full", Gn[s], ne, "shadow-2xl", S[c], "max-h-[calc(100vh-4rem)] sm:max-h-[calc(100vh-10rem)] overflow-hidden flex flex-col", "transition-all duration-200 ease-out", "focus:outline-none", E ? "opacity-100 scale-100 translate-y-0" : "opacity-0 scale-95 translate-y-1"),
2426
+ className: x("relative w-full", zr[a], V, "shadow-2xl", S[o], "max-h-[calc(100vh-4rem)] sm:max-h-[calc(100vh-10rem)] overflow-hidden flex flex-col", "transition-all duration-200 ease-out", "focus:outline-none", M ? "opacity-100 scale-100 translate-y-0" : "opacity-0 scale-95 translate-y-1"),
1936
2427
  onClick: (e) => e.stopPropagation(),
1937
2428
  children: [
1938
- i && /* @__PURE__ */ n("div", {
2429
+ n && /* @__PURE__ */ _("div", {
1939
2430
  className: "flex items-center justify-between gap-4 px-6 pt-5 pb-4 flex-shrink-0",
1940
- children: [/* @__PURE__ */ t("h2", {
1941
- id: w,
2431
+ children: [/* @__PURE__ */ g("h2", {
2432
+ id: O,
1942
2433
  className: "text-base font-medium tracking-tight text-gray-900 dark:text-gray-100",
1943
- children: i
1944
- }), u && /* @__PURE__ */ t(bn, {
2434
+ children: n
2435
+ }), u && /* @__PURE__ */ g(Qn, {
1945
2436
  icon: "i-mdi-close",
1946
- onClick: r,
1947
- "aria-label": p,
2437
+ onClick: t,
2438
+ "aria-label": d,
1948
2439
  variant: "subtle",
1949
2440
  size: "sm",
1950
2441
  radius: "full",
1951
2442
  className: "-mr-1"
1952
2443
  })]
1953
2444
  }),
1954
- /* @__PURE__ */ t("div", {
1955
- ref: b,
1956
- className: x("flex-1 overflow-y-auto px-6 pb-6 text-sm leading-relaxed text-gray-600 dark:text-gray-400 min-h-0", !i && "pt-6", l),
1957
- children: a
2445
+ /* @__PURE__ */ g("div", {
2446
+ ref: E,
2447
+ id: j ? k : void 0,
2448
+ className: x("flex-1 overflow-y-auto px-6 pb-6 text-sm leading-relaxed text-gray-600 dark:text-gray-400 min-h-0", !n && "pt-6", s),
2449
+ children: r
1958
2450
  }),
1959
- o && /* @__PURE__ */ t("div", {
2451
+ i && /* @__PURE__ */ g("div", {
1960
2452
  className: x("flex items-center justify-end gap-3 px-6 py-4 border-t flex-shrink-0", "border-gray-100 dark:border-gray-800"),
1961
- children: o
2453
+ children: i
1962
2454
  })
1963
2455
  ]
1964
2456
  })]
1965
2457
  }), document.body);
1966
2458
  }
1967
2459
  //#endregion
1968
- //#region node_modules/.pnpm/zustand@5.0.15_@types+react@19.2.18_react@19.2.8_use-sync-external-store@1.6.0_react@19.2.8_/node_modules/zustand/esm/vanilla.mjs
1969
- var qn = (e) => {
2460
+ //#region node_modules/.pnpm/zustand@5.0.15_@types+react@19.3.0_react@19.3.0_use-sync-external-store@1.6.0_react@19.3.0_/node_modules/zustand/esm/vanilla.mjs
2461
+ var Vr = (e) => {
1970
2462
  let t, n = /* @__PURE__ */ new Set(), r = (e, r) => {
1971
2463
  let i = typeof e == "function" ? e(t) : e;
1972
2464
  if (!Object.is(i, t)) {
@@ -1980,217 +2472,446 @@ var qn = (e) => {
1980
2472
  subscribe: (e) => (n.add(e), () => n.delete(e))
1981
2473
  }, o = t = e(r, i, a);
1982
2474
  return a;
1983
- }, Jn = ((e) => e ? qn(e) : qn), Yn = (e) => e;
1984
- function Xn(e, t = Yn) {
1985
- let n = i.useSyncExternalStore(e.subscribe, i.useCallback(() => t(e.getState()), [e, t]), i.useCallback(() => t(e.getInitialState()), [e, t]));
1986
- return i.useDebugValue(n), n;
2475
+ }, Hr = ((e) => e ? Vr(e) : Vr), Ur = (e) => e;
2476
+ function Wr(e, n = Ur) {
2477
+ let r = t.useSyncExternalStore(e.subscribe, t.useCallback(() => n(e.getState()), [e, n]), t.useCallback(() => n(e.getInitialState()), [e, n]));
2478
+ return t.useDebugValue(r), r;
1987
2479
  }
1988
- var Zn = (e) => {
1989
- let t = Jn(e), n = (e) => Xn(t, e);
2480
+ var Gr = (e) => {
2481
+ let t = Hr(e), n = (e) => Wr(t, e);
1990
2482
  return Object.assign(n, t), n;
1991
- }, Qn = ((e) => e ? Zn(e) : Zn), $n = Qn((e) => ({
2483
+ }, Kr = ((e) => e ? Gr(e) : Gr), qr = Kr((e) => ({
1992
2484
  globalHotkeysEnabled: !0,
1993
2485
  setGlobalHotkeysEnabled: (t) => e({ globalHotkeysEnabled: t })
1994
- })), er = 0;
1995
- function tr() {
1996
- d(() => (er += 1, er === 1 && $n.getState().setGlobalHotkeysEnabled(!1), () => {
1997
- --er, er === 0 && $n.getState().setGlobalHotkeysEnabled(!0);
2486
+ })), Jr = 0;
2487
+ function Yr() {
2488
+ c(() => (Jr += 1, Jr === 1 && qr.getState().setGlobalHotkeysEnabled(!1), () => {
2489
+ --Jr, Jr === 0 && qr.getState().setGlobalHotkeysEnabled(!0);
1998
2490
  }), []);
1999
2491
  }
2000
2492
  //#endregion
2001
2493
  //#region src/components/modal/confirm_modal.tsx
2002
- var nr = {
2494
+ var Xr = {
2003
2495
  danger: "i-mdi-alert-circle",
2004
2496
  primary: "i-mdi-help-circle",
2005
2497
  success: "i-mdi-check-circle"
2006
- }, rr = {
2498
+ }, Zr = {
2007
2499
  danger: "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400",
2008
2500
  primary: "bg-blue-50 text-blue-600 dark:bg-blue-500/10 dark:text-blue-400",
2009
2501
  success: "bg-green-50 text-green-600 dark:bg-green-500/10 dark:text-green-400"
2010
2502
  };
2011
- function ir({ title: e, color: r }) {
2012
- return /* @__PURE__ */ n("div", {
2503
+ function Qr({ title: e, color: t }) {
2504
+ return /* @__PURE__ */ _("div", {
2013
2505
  className: "flex items-center gap-3",
2014
- children: [/* @__PURE__ */ t("span", {
2015
- className: x("flex h-9 w-9 shrink-0 items-center justify-center rounded-full", rr[r]),
2506
+ children: [/* @__PURE__ */ g("span", {
2507
+ className: x("flex h-9 w-9 shrink-0 items-center justify-center rounded-full", Zr[t]),
2016
2508
  "aria-hidden": "true",
2017
- children: /* @__PURE__ */ t("span", { className: x(nr[r], "h-5 w-5") })
2509
+ children: /* @__PURE__ */ g("span", { className: x(Xr[t], "h-5 w-5") })
2018
2510
  }), e]
2019
2511
  });
2020
2512
  }
2021
- var ar = Un(({ call: r, title: i, children: a, confirmLabel: o, cancelLabel: s, confirmColor: c, radius: l, closeLabel: u, onConfirm: d, onError: f }) => {
2022
- tr();
2023
- let [p, m] = g(!1), h = () => r.end(!1), _ = async () => {
2024
- if (!d) {
2025
- r.end(!0);
2513
+ var $r = wr(({ call: e, title: t, children: n, confirmLabel: r, cancelLabel: i, confirmColor: a, radius: o, closeLabel: s, onConfirm: c, onError: l }) => {
2514
+ Yr();
2515
+ let [u, d] = p(!1), m = f(null), v = () => e.end(!1), y = async () => {
2516
+ if (!c) {
2517
+ e.end(!0);
2026
2518
  return;
2027
2519
  }
2028
- m(!0);
2520
+ d(!0);
2029
2521
  try {
2030
- await d(), r.end(!0);
2522
+ await c(), e.end(!0);
2031
2523
  } catch (e) {
2032
- m(!1), pn(e, f);
2524
+ d(!1), Wn(e, l);
2033
2525
  }
2034
- }, v = p, y = o ?? "Confirm", b = s ?? "Cancel", x = c ?? "primary";
2035
- return /* @__PURE__ */ t(Kn, {
2036
- isEnded: r.ended,
2037
- onDismiss: h,
2038
- title: /* @__PURE__ */ t(ir, {
2039
- title: i,
2040
- color: x
2526
+ }, b = u, x = r ?? "Confirm", S = i ?? "Cancel", C = a ?? "primary";
2527
+ return /* @__PURE__ */ g(Br, {
2528
+ isEnded: e.ended,
2529
+ onDismiss: v,
2530
+ title: /* @__PURE__ */ g(Qr, {
2531
+ title: t,
2532
+ color: C
2041
2533
  }),
2042
2534
  size: "sm",
2043
- radius: l,
2044
- closeLabel: u,
2045
- footer: /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t(F, {
2535
+ radius: o,
2536
+ closeLabel: s,
2537
+ role: "alertdialog",
2538
+ initialFocusRef: m,
2539
+ footer: /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(R, {
2540
+ ref: m,
2046
2541
  variant: "outline",
2047
2542
  color: "neutral",
2048
- onClick: h,
2049
- disabled: v,
2543
+ onClick: v,
2544
+ disabled: b,
2050
2545
  size: "sm",
2051
- children: b
2052
- }), /* @__PURE__ */ t(F, {
2053
- color: x,
2546
+ children: S
2547
+ }), /* @__PURE__ */ g(R, {
2548
+ color: C,
2054
2549
  onClick: () => {
2055
- _();
2550
+ y();
2056
2551
  },
2057
- loading: v,
2058
- disabled: v,
2552
+ loading: b,
2553
+ disabled: b,
2059
2554
  size: "sm",
2060
- children: y
2555
+ children: x
2061
2556
  })] }),
2062
- children: a
2557
+ children: n
2063
2558
  });
2064
2559
  }, 200);
2065
2560
  //#endregion
2066
2561
  //#region src/components/modal/modal.tsx
2067
- function or(e, t) {
2562
+ function ei(e, t) {
2068
2563
  return typeof e == "function" ? e(t) : e;
2069
2564
  }
2070
- var sr = o(null), cr = Un(({ call: e, title: n, children: r, size: i, radius: a, className: o, dismissible: s, closeLabel: c }) => {
2071
- tr();
2072
- let [l, u] = g(null), d = () => e.end();
2073
- return /* @__PURE__ */ t(Kn, {
2565
+ var ti = r(null), ni = wr(({ call: e, title: t, children: n, size: r, radius: i, className: a, dismissible: o, closeLabel: s, "aria-label": c }) => {
2566
+ Yr();
2567
+ let [l, u] = p(null), d = () => e.end();
2568
+ return /* @__PURE__ */ g(Br, {
2074
2569
  isEnded: e.ended,
2075
2570
  onDismiss: d,
2076
- title: n,
2571
+ title: t,
2077
2572
  footer: l,
2078
- size: i,
2079
- radius: a,
2080
- className: o,
2081
- dismissible: s,
2082
- closeLabel: c,
2083
- children: /* @__PURE__ */ t(sr.Provider, {
2573
+ size: r,
2574
+ radius: i,
2575
+ className: a,
2576
+ dismissible: o,
2577
+ closeLabel: s,
2578
+ "aria-label": c,
2579
+ children: /* @__PURE__ */ g(ti.Provider, {
2084
2580
  value: u,
2085
- children: or(r, d)
2581
+ children: ei(n, d)
2086
2582
  })
2087
2583
  });
2088
2584
  }, 200);
2089
2585
  //#endregion
2090
2586
  //#region src/components/modal/modal_footer.tsx
2091
- function lr({ children: e }) {
2092
- let t = u(sr);
2093
- return d(() => (t?.(e), () => t?.(null)), [t, e]), null;
2587
+ function ri({ children: e }) {
2588
+ let t = s(ti);
2589
+ return c(() => (t?.(e), () => t?.(null)), [t, e]), null;
2094
2590
  }
2095
2591
  //#endregion
2096
2592
  //#region src/components/modal_provider/modal_provider.tsx
2097
- function ur() {
2098
- return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t(cr, {}), /* @__PURE__ */ t(ar, {})] });
2593
+ function ii() {
2594
+ return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(ni, {}), /* @__PURE__ */ g($r, {})] });
2099
2595
  }
2100
2596
  //#endregion
2101
- //#region src/components/radio_options/radio_option_row.tsx
2102
- function dr({ option: e, optionId: r, descriptionId: i, name: a, orientation: o, isSelected: s, isDisabled: c, isFirstOption: l, required: u, error: d, radius: f, unstyled: p, className: m, onSelect: h }) {
2103
- return /* @__PURE__ */ n("label", {
2104
- htmlFor: r,
2105
- className: x("flex cursor-pointer items-start gap-3 transition-colors duration-150", o === "horizontal" && "flex-1", T, d ? D : E, !p && [
2106
- S[f],
2107
- "border px-3 py-2.5",
2108
- s ? d ? x("border-red-500 dark:border-red-400", "bg-red-50 dark:bg-red-950/20") : "border-blue-500 bg-blue-50 dark:border-blue-500 dark:bg-blue-950/25" : d ? "border-red-300 bg-white dark:border-red-800/50 dark:bg-gray-800/50" : x("border-gray-200 dark:border-gray-700", "bg-gray-50 hover:border-gray-300 hover:bg-white dark:bg-gray-800/50 dark:hover:border-gray-600 dark:hover:bg-gray-800")
2109
- ], c && "cursor-not-allowed opacity-50", m),
2110
- children: [
2111
- /* @__PURE__ */ t("input", {
2112
- type: "radio",
2113
- id: r,
2114
- name: a,
2115
- value: e.value,
2116
- checked: s,
2117
- onChange: () => h(e.value),
2118
- disabled: c,
2119
- required: u && l,
2120
- "aria-invalid": d ? !0 : void 0,
2121
- "aria-describedby": e.description ? i : void 0,
2122
- className: "sr-only"
2123
- }),
2124
- /* @__PURE__ */ t("span", {
2125
- className: x("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors duration-150", s ? d ? ae : "border-blue-600 dark:border-blue-500" : d ? "border-red-400 dark:border-red-600" : z),
2126
- "aria-hidden": !0,
2127
- children: s && /* @__PURE__ */ t("span", { className: x("h-2 w-2 rounded-full", d ? "bg-red-500 dark:bg-red-400" : "bg-blue-600 dark:bg-blue-500") })
2128
- }),
2129
- /* @__PURE__ */ n("span", {
2130
- className: "flex min-w-0 flex-col",
2131
- children: [/* @__PURE__ */ n("span", {
2132
- className: "flex items-center gap-1.5",
2133
- children: [e.icon && /* @__PURE__ */ t("span", {
2134
- className: x(e.icon, "h-4 w-4 shrink-0", s ? d ? "text-red-600 dark:text-red-400" : "text-blue-600 dark:text-blue-400" : "text-gray-500 dark:text-gray-400"),
2135
- "aria-hidden": !0
2136
- }), /* @__PURE__ */ t("span", {
2137
- className: x("select-none text-sm font-medium", s ? d ? "text-red-700 dark:text-red-300" : "text-blue-700 dark:text-blue-300" : "text-gray-700 dark:text-gray-300"),
2597
+ //#region src/components/multi_combobox/multi_combobox.tsx
2598
+ var ai = 2;
2599
+ function oi(e, t, n, r) {
2600
+ return r?.(e, t) ? !0 : n === void 0 || t.includes(e) ? !1 : t.length >= n;
2601
+ }
2602
+ function si(e, t) {
2603
+ return e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
2604
+ }
2605
+ function ci(e, t) {
2606
+ if (e.length <= t) return {
2607
+ visibleOptions: e,
2608
+ hiddenCount: 0
2609
+ };
2610
+ let n = Math.max(t - 1, 0);
2611
+ return {
2612
+ visibleOptions: e.slice(0, n),
2613
+ hiddenCount: e.length - n
2614
+ };
2615
+ }
2616
+ var li = "inline-flex items-center rounded-full bg-gray-200 dark:bg-gray-700 px-2 py-0.5 text-xs text-gray-900 dark:text-gray-100";
2617
+ function ui({ options: e, label: t, "aria-label": n, error: r, placeholder: i, searchPlaceholder: a = "Search", noResultsText: s = "No results found", clearLabel: l = "Clear selection", clearText: u = "Clear", maxSelectedValues: m, isOptionDisabled: v, maxDisplayedValues: y = ai, formatOverflowCount: b = (e) => `+${e} more`, formatSelectedCount: w = (e) => `${e} selected`, formatMaxSelectedHint: T = (e) => `You can select up to ${e} items`, radius: E = "sm", unstyled: D = !1, disabled: O = !1, required: k = !1, className: j, wrapperClassName: M, values: N, defaultValues: P = [], onChange: F, onDropdownClose: I, id: ee }) {
2618
+ let { fieldId: L, errorId: te, labelId: ne } = K(ee), R = `${L}-listbox`, re = `${L}-max-hint`, z = f(null), B = f(null), ie = f(null), [V, H] = ye(N, P), [ae, oe] = p(""), [U, se] = p(!1), W = d(() => {
2619
+ let t = ae.trim().toLowerCase();
2620
+ return t ? e.filter((e) => e.label.toLowerCase().includes(t)) : e;
2621
+ }, [e, ae]), { activeIndex: ce, activeOptionId: G, move: ue, first: de, last: fe, reset: pe } = je({
2622
+ optionCount: W.length,
2623
+ getOptionId: (e) => `${R}-option-${e}`,
2624
+ isOpen: U
2625
+ }), me = d(() => e.filter((e) => V.includes(e.value)), [e, V]), { visibleOptions: he, hiddenCount: ge } = ci(me, y), _e = () => {
2626
+ O || se(!0);
2627
+ }, ve = o(() => {
2628
+ se(!1), oe(""), pe(), I?.(V);
2629
+ }, [
2630
+ pe,
2631
+ I,
2632
+ V
2633
+ ]), be = () => {
2634
+ U ? ve() : _e();
2635
+ }, xe = (e) => {
2636
+ if (oi(e, V, m, v)) return;
2637
+ let t = si(V, e);
2638
+ H(t), F?.(t);
2639
+ }, Se = () => {
2640
+ H([]), F?.([]);
2641
+ }, Ce = (e) => {
2642
+ e.stopPropagation(), Se(), U || I?.([]), z.current?.focus();
2643
+ }, we = () => {
2644
+ Se(), ie.current?.focus();
2645
+ }, Te = () => {
2646
+ O || be();
2647
+ }, Ee = (e) => {
2648
+ oe(e.target.value), pe();
2649
+ }, De = (e) => {
2650
+ if (e.preventDefault(), !U) {
2651
+ _e(), de();
2652
+ return;
2653
+ }
2654
+ ue(1);
2655
+ }, ke = (e) => {
2656
+ if (e.preventDefault(), !U) {
2657
+ _e(), fe();
2658
+ return;
2659
+ }
2660
+ ue(-1);
2661
+ }, Ae = (e) => {
2662
+ if (!U) return;
2663
+ e.preventDefault();
2664
+ let t = W[ce];
2665
+ t && xe(t.value);
2666
+ }, Me = (e) => {
2667
+ U && (e.preventDefault(), ve(), z.current?.focus());
2668
+ }, q = (e) => {
2669
+ if (e.key === "ArrowDown") return De(e);
2670
+ if (e.key === "ArrowUp") return ke(e);
2671
+ if (e.key === "Enter") return Ae(e);
2672
+ if (e.key === "Escape") return Me(e);
2673
+ };
2674
+ return c(() => {
2675
+ if (!U) return;
2676
+ let e = (e) => {
2677
+ B.current && !B.current.contains(e.target) && ve();
2678
+ };
2679
+ return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
2680
+ }, [U, ve]), /* @__PURE__ */ g(Oe, {
2681
+ fieldId: L,
2682
+ errorId: te,
2683
+ label: t,
2684
+ error: r,
2685
+ required: k,
2686
+ wrapperClassName: M,
2687
+ children: /* @__PURE__ */ _("div", {
2688
+ ref: B,
2689
+ className: "relative",
2690
+ onBlur: (e) => {
2691
+ if (!U) return;
2692
+ let t = e.relatedTarget;
2693
+ t instanceof Node && B.current?.contains(t) || ve();
2694
+ },
2695
+ children: [
2696
+ /* @__PURE__ */ g("button", {
2697
+ ref: z,
2698
+ type: "button",
2699
+ id: L,
2700
+ role: "combobox",
2701
+ disabled: O,
2702
+ "aria-expanded": U,
2703
+ "aria-controls": R,
2704
+ "aria-haspopup": "listbox",
2705
+ "aria-invalid": !!r,
2706
+ "aria-required": k || void 0,
2707
+ "aria-describedby": r ? te : void 0,
2708
+ "aria-labelledby": typeof t == "string" ? ne : void 0,
2709
+ "aria-label": n,
2710
+ onClick: Te,
2711
+ onKeyDown: q,
2712
+ className: x("w-full flex flex-wrap items-center gap-1 text-left disabled:opacity-50 disabled:cursor-not-allowed", !D && [
2713
+ le,
2714
+ S[E],
2715
+ "pl-3 pr-8 py-2 text-sm min-h-10"
2716
+ ], !D && r && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), j),
2717
+ children: me.length === 0 ? /* @__PURE__ */ g("span", {
2718
+ className: x(!D && "text-gray-500 dark:text-gray-400"),
2719
+ children: i
2720
+ }) : /* @__PURE__ */ _(h, { children: [he.map((e) => /* @__PURE__ */ g("span", {
2721
+ className: x(!D && li),
2138
2722
  children: e.label
2139
- })]
2140
- }), e.description && /* @__PURE__ */ t("span", {
2141
- id: i,
2142
- className: x("text-xs text-gray-500 dark:text-gray-400", "mt-0.5"),
2143
- children: e.description
2144
- })]
2145
- })
2146
- ]
2723
+ }, e.value)), ge > 0 && /* @__PURE__ */ g("span", {
2724
+ className: x(!D && li),
2725
+ children: b(ge)
2726
+ })] })
2727
+ }),
2728
+ !D && V.length > 0 && !O && /* @__PURE__ */ g("button", {
2729
+ type: "button",
2730
+ "aria-label": l,
2731
+ onMouseDown: (e) => e.preventDefault(),
2732
+ onClick: Ce,
2733
+ className: x("absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300", "outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2", A.primary.focusOutline),
2734
+ children: /* @__PURE__ */ g("span", {
2735
+ className: "i-mdi-close block w-4 h-4",
2736
+ "aria-hidden": !0
2737
+ })
2738
+ }),
2739
+ U && /* @__PURE__ */ _("div", {
2740
+ onMouseDown: (e) => {
2741
+ e.target !== ie.current && e.preventDefault();
2742
+ },
2743
+ className: x("absolute z-10 mt-1 w-full text-sm shadow-lg", !D && [
2744
+ "border overflow-hidden",
2745
+ "bg-white dark:bg-gray-900",
2746
+ "border-gray-100 dark:border-gray-800",
2747
+ C[E]
2748
+ ]),
2749
+ children: [
2750
+ /* @__PURE__ */ g("input", {
2751
+ ref: ie,
2752
+ type: "text",
2753
+ autoFocus: !0,
2754
+ autoComplete: "off",
2755
+ value: ae,
2756
+ onChange: Ee,
2757
+ onKeyDown: q,
2758
+ placeholder: a,
2759
+ "aria-label": a,
2760
+ "aria-controls": R,
2761
+ "aria-activedescendant": G,
2762
+ "aria-describedby": m === void 0 ? void 0 : re,
2763
+ className: x("w-full", !D && [
2764
+ "px-3 py-2 border-b bg-transparent focus:outline-none",
2765
+ "text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400",
2766
+ "border-gray-100 dark:border-gray-800"
2767
+ ])
2768
+ }),
2769
+ m !== void 0 && /* @__PURE__ */ g("div", {
2770
+ id: re,
2771
+ className: x("px-3 py-1 text-xs", !D && ["border-b", "border-gray-100 dark:border-gray-800"], !D && "text-gray-500 dark:text-gray-400"),
2772
+ children: T(m)
2773
+ }),
2774
+ /* @__PURE__ */ g("ul", {
2775
+ id: R,
2776
+ role: "listbox",
2777
+ "aria-multiselectable": !0,
2778
+ className: "max-h-60 overflow-auto py-1",
2779
+ children: W.map((e, t) => {
2780
+ let n = V.includes(e.value), r = oi(e.value, V, m, v);
2781
+ return /* @__PURE__ */ _("li", {
2782
+ id: `${R}-option-${t}`,
2783
+ role: "option",
2784
+ "aria-selected": n,
2785
+ "aria-disabled": r,
2786
+ onClick: () => xe(e.value),
2787
+ className: x("px-3 py-2 flex items-center gap-2 text-gray-900 dark:text-gray-100", r ? "opacity-50 cursor-not-allowed" : "cursor-pointer", t === ce ? x("bg-blue-50 dark:bg-blue-900/40", "outline-2 -outline-offset-2 outline-blue-500 dark:outline-blue-400") : !r && "hover:bg-gray-50 dark:hover:bg-gray-800/60"),
2788
+ children: [/* @__PURE__ */ g("span", {
2789
+ "aria-hidden": !0,
2790
+ className: x("flex h-4 w-4 shrink-0 items-center justify-center", !D && [
2791
+ "border-2",
2792
+ S[E],
2793
+ n ? x("border-blue-600 dark:border-blue-500", "bg-blue-600 dark:bg-blue-500") : x("border-gray-300 dark:border-gray-600", "bg-white dark:bg-gray-800")
2794
+ ]),
2795
+ children: n && /* @__PURE__ */ g("svg", {
2796
+ className: "h-3 w-3 text-white",
2797
+ viewBox: "0 0 12 12",
2798
+ fill: "none",
2799
+ stroke: "currentColor",
2800
+ strokeWidth: "2.5",
2801
+ strokeLinecap: "round",
2802
+ strokeLinejoin: "round",
2803
+ children: /* @__PURE__ */ g("polyline", { points: "2 6 5 9 10 3" })
2804
+ })
2805
+ }), e.label]
2806
+ }, e.value);
2807
+ })
2808
+ }),
2809
+ /* @__PURE__ */ g("div", {
2810
+ role: "status",
2811
+ className: W.length === 0 ? "px-3 py-2 text-gray-500 dark:text-gray-400" : void 0,
2812
+ children: W.length === 0 ? s : ""
2813
+ }),
2814
+ m !== void 0 && /* @__PURE__ */ _("div", {
2815
+ className: x("flex items-center justify-between px-3 py-2", !D && ["border-t", "border-gray-100 dark:border-gray-800"]),
2816
+ children: [/* @__PURE__ */ g("span", {
2817
+ className: "text-xs text-gray-500 dark:text-gray-400",
2818
+ children: w(V.length)
2819
+ }), /* @__PURE__ */ g("button", {
2820
+ type: "button",
2821
+ disabled: V.length === 0,
2822
+ onClick: we,
2823
+ className: "text-xs font-medium text-blue-600 hover:text-blue-700 disabled:opacity-50 disabled:cursor-not-allowed dark:text-blue-400 dark:hover:text-blue-300",
2824
+ children: u
2825
+ })]
2826
+ })
2827
+ ]
2828
+ })
2829
+ ]
2830
+ })
2831
+ });
2832
+ }
2833
+ //#endregion
2834
+ //#region src/components/radio_options/radio_option_row.tsx
2835
+ function di({ option: e, optionId: t, descriptionId: n, name: r, orientation: i, isSelected: a, isDisabled: o, isFirstOption: s, required: c, error: l, radius: u, unstyled: d, className: f, onSelect: p }) {
2836
+ let m = !!l;
2837
+ return /* @__PURE__ */ g(Se, {
2838
+ item: e,
2839
+ htmlFor: t,
2840
+ descriptionId: n,
2841
+ orientation: i,
2842
+ isSelected: a,
2843
+ isDisabled: o,
2844
+ isError: m,
2845
+ radius: u,
2846
+ unstyled: d,
2847
+ className: f,
2848
+ control: /* @__PURE__ */ g("input", {
2849
+ type: "radio",
2850
+ id: t,
2851
+ name: r,
2852
+ value: e.value,
2853
+ checked: a,
2854
+ onChange: () => p(e.value),
2855
+ disabled: o,
2856
+ required: c && s,
2857
+ "aria-invalid": l ? !0 : void 0,
2858
+ "aria-describedby": e.description ? n : void 0,
2859
+ className: "sr-only"
2860
+ }),
2861
+ indicator: /* @__PURE__ */ g("span", {
2862
+ className: x("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors duration-150", ve({
2863
+ isSelected: a,
2864
+ isError: m
2865
+ })),
2866
+ "aria-hidden": !0,
2867
+ children: a && /* @__PURE__ */ g("span", { className: x("h-2 w-2 rounded-full", l ? "bg-red-500 dark:bg-red-400" : "bg-blue-600 dark:bg-blue-500") })
2868
+ })
2147
2869
  });
2148
2870
  }
2149
2871
  //#endregion
2150
2872
  //#region src/components/radio_options/radio_options.tsx
2151
- function fr({ options: e, orientation: r = "vertical", value: i, defaultValue: a, onChange: o, name: s, label: c, error: l, required: u, disabled: d, radius: f = "lg", unstyled: p = !1, className: m, wrapperClassName: h, id: g, ..._ }) {
2152
- let { fieldId: v, errorId: y } = V(g), b = s ?? v, [S, C] = H(i, a ?? ""), w = e.map((e) => typeof e == "string" ? {
2873
+ function fi({ options: e, orientation: t = "vertical", value: n, defaultValue: r, onChange: i, name: a, label: o, error: s, required: c, disabled: l, radius: u = "lg", unstyled: d = !1, className: f, wrapperClassName: p, id: m, "aria-describedby": h, ...v }) {
2874
+ let { fieldId: y, errorId: b } = K(m), S = a ?? y, [C, w] = ye(n, r ?? ""), T = e.map((e) => typeof e == "string" ? {
2153
2875
  value: e,
2154
2876
  label: e
2155
- } : e), T = (e) => {
2156
- C(e), o?.(e);
2877
+ } : e), E = (e) => {
2878
+ w(e), i?.(e);
2157
2879
  };
2158
- return /* @__PURE__ */ n("fieldset", {
2159
- className: x("m-0 border-0 p-0", h),
2160
- disabled: d,
2161
- "aria-describedby": l ? y : void 0,
2162
- "aria-required": u,
2163
- ..._,
2880
+ return /* @__PURE__ */ _("fieldset", {
2881
+ className: x("m-0 border-0 p-0", p),
2882
+ disabled: l,
2883
+ "aria-describedby": G(h, s && b),
2884
+ ...v,
2164
2885
  children: [
2165
- c && /* @__PURE__ */ n("legend", {
2886
+ o && /* @__PURE__ */ _("legend", {
2166
2887
  className: x("text-sm font-medium text-gray-700 dark:text-gray-300", "mb-2"),
2167
- children: [c, u && /* @__PURE__ */ t("span", {
2888
+ children: [o, c && /* @__PURE__ */ g("span", {
2168
2889
  className: "text-red-500 dark:text-red-400 ml-1",
2169
2890
  children: "*"
2170
2891
  })]
2171
2892
  }),
2172
- /* @__PURE__ */ t("div", {
2173
- className: x(r === "horizontal" ? "flex flex-row gap-2" : "flex flex-col gap-2"),
2174
- children: w.map((e, n) => /* @__PURE__ */ t(dr, {
2893
+ /* @__PURE__ */ g("div", {
2894
+ className: x(t === "horizontal" ? "flex flex-row gap-2" : "flex flex-col gap-2"),
2895
+ children: T.map((e, n) => /* @__PURE__ */ g(di, {
2175
2896
  option: e,
2176
- optionId: `${v}-${n}`,
2177
- descriptionId: `${v}-${n}-desc`,
2178
- name: b,
2179
- orientation: r,
2180
- isSelected: S === e.value,
2181
- isDisabled: d === !0 || e.disabled === !0,
2897
+ optionId: `${y}-${n}`,
2898
+ descriptionId: `${y}-${n}-desc`,
2899
+ name: S,
2900
+ orientation: t,
2901
+ isSelected: C === e.value,
2902
+ isDisabled: l === !0 || e.disabled === !0,
2182
2903
  isFirstOption: n === 0,
2183
- required: u,
2184
- error: l,
2185
- radius: f,
2186
- unstyled: p,
2187
- className: m,
2188
- onSelect: T
2904
+ required: c,
2905
+ error: s,
2906
+ radius: u,
2907
+ unstyled: d,
2908
+ className: f,
2909
+ onSelect: E
2189
2910
  }, e.value))
2190
2911
  }),
2191
- /* @__PURE__ */ t(oe, {
2192
- id: y,
2193
- error: l,
2912
+ /* @__PURE__ */ g(me, {
2913
+ id: b,
2914
+ error: s,
2194
2915
  className: "mt-2"
2195
2916
  })
2196
2917
  ]
@@ -2198,32 +2919,32 @@ function fr({ options: e, orientation: r = "vertical", value: i, defaultValue: a
2198
2919
  }
2199
2920
  //#endregion
2200
2921
  //#region src/components/select/select.tsx
2201
- function pr({ options: e, label: r, error: i, placeholder: a, radius: o = "md", unstyled: s = !1, className: c, wrapperClassName: l, value: u, defaultValue: d, onChange: f, id: p, ...m }) {
2202
- let { fieldId: h, errorId: g } = V(p);
2203
- return /* @__PURE__ */ t(de, {
2204
- fieldId: h,
2205
- errorId: g,
2206
- label: r,
2207
- error: i,
2208
- required: m.required,
2209
- wrapperClassName: l,
2210
- children: /* @__PURE__ */ n("select", {
2211
- id: h,
2212
- className: x("w-full disabled:opacity-50 disabled:cursor-not-allowed", !s && [
2213
- B,
2214
- S[o],
2922
+ function pi({ options: e, label: t, error: n, placeholder: r, radius: i = "md", unstyled: a = !1, className: o, wrapperClassName: s, value: c, defaultValue: l, onChange: u, id: d, "aria-describedby": f, ...p }) {
2923
+ let { fieldId: m, errorId: h } = K(d);
2924
+ return /* @__PURE__ */ g(Oe, {
2925
+ fieldId: m,
2926
+ errorId: h,
2927
+ label: t,
2928
+ error: n,
2929
+ required: p.required,
2930
+ wrapperClassName: s,
2931
+ children: /* @__PURE__ */ _("select", {
2932
+ id: m,
2933
+ className: x("w-full disabled:opacity-50 disabled:cursor-not-allowed", !a && [
2934
+ le,
2935
+ S[i],
2215
2936
  "pl-3 pr-8 py-2 text-sm appearance-none bg-[length:1rem_1rem] bg-[position:right_0.5rem_center] bg-no-repeat",
2216
2937
  "bg-[url(\"data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27none%27 viewBox=%270 0 20 20%27%3e%3cpath stroke=%27%236b7280%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%271.5%27 d=%27M6 8l4 4 4-4%27/%3e%3c/svg%3e\")]"
2217
- ], !s && i && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), c),
2218
- ...u === void 0 ? { defaultValue: d } : { value: u },
2219
- onChange: f,
2220
- "aria-invalid": !!i,
2221
- "aria-describedby": i ? g : void 0,
2222
- ...m,
2223
- children: [a !== void 0 && /* @__PURE__ */ t("option", {
2938
+ ], !a && n && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), o),
2939
+ ...c === void 0 ? { defaultValue: l } : { value: c },
2940
+ onChange: u,
2941
+ "aria-invalid": !!n,
2942
+ "aria-describedby": G(f, n && h),
2943
+ ...p,
2944
+ children: [r !== void 0 && /* @__PURE__ */ g("option", {
2224
2945
  value: "",
2225
- children: a
2226
- }), e.map((e) => /* @__PURE__ */ t("option", {
2946
+ children: r
2947
+ }), e.map((e) => /* @__PURE__ */ g("option", {
2227
2948
  value: e.value,
2228
2949
  children: e.label
2229
2950
  }, e.value))]
@@ -2232,189 +2953,354 @@ function pr({ options: e, label: r, error: i, placeholder: a, radius: o = "md",
2232
2953
  }
2233
2954
  //#endregion
2234
2955
  //#region src/components/switch/switch.tsx
2235
- function mr({ label: r, description: i, error: a, unstyled: o = !1, className: s, wrapperClassName: c, checked: l, defaultChecked: u = !1, onChange: d, id: f, ...p }) {
2236
- let { fieldId: m, errorId: h, descriptionId: g } = V(f), [_, v] = H(l, u), y = [i && g, a && h].filter(Boolean).join(" ") || void 0;
2237
- return /* @__PURE__ */ n("div", {
2238
- className: x("w-full", c),
2956
+ function mi({ label: e, description: t, error: n, unstyled: r = !1, fullWidth: i = !1, className: a, wrapperClassName: o, checked: s, defaultChecked: c = !1, onChange: l, id: u, "aria-describedby": d, ...f }) {
2957
+ let { fieldId: p, errorId: m, descriptionId: v } = K(u), [y, b] = ye(s, c), S = G(d, !!t && v, n && m);
2958
+ return /* @__PURE__ */ _("div", {
2959
+ className: x(i ? "w-full" : "w-fit", o),
2239
2960
  children: [
2240
- /* @__PURE__ */ n("label", {
2241
- htmlFor: m,
2242
- className: x("flex items-center gap-3 cursor-pointer", p.disabled && "cursor-not-allowed opacity-50"),
2243
- children: [/* @__PURE__ */ n("span", {
2244
- className: x("relative inline-flex w-11 shrink-0", "transition-colors duration-200 ease-in-out", T, E, !o && [
2961
+ /* @__PURE__ */ _("label", {
2962
+ htmlFor: p,
2963
+ className: x("flex items-center gap-3 cursor-pointer", f.disabled && "cursor-not-allowed opacity-50"),
2964
+ children: [/* @__PURE__ */ _("span", {
2965
+ className: x("relative inline-flex w-11 shrink-0", "transition-colors duration-200 ease-in-out", E, D, !r && [
2245
2966
  "rounded-full border-2 border-transparent",
2246
- _ ? "bg-blue-600 dark:bg-blue-500" : "bg-gray-200 dark:bg-gray-600",
2247
- a && "ring-2 ring-red-500 dark:ring-red-400"
2248
- ], s),
2249
- children: [/* @__PURE__ */ t("input", {
2967
+ y ? "bg-blue-600 dark:bg-blue-500" : "bg-gray-200 dark:bg-gray-600",
2968
+ n && "ring-2 ring-red-500 dark:ring-red-400"
2969
+ ], a),
2970
+ children: [/* @__PURE__ */ g("input", {
2250
2971
  type: "checkbox",
2251
2972
  role: "switch",
2252
- id: m,
2973
+ id: p,
2253
2974
  className: "sr-only",
2254
- checked: _,
2975
+ checked: y,
2255
2976
  onChange: (e) => {
2256
- v(e.target.checked), d?.(e);
2977
+ b(e.target.checked), l?.(e);
2257
2978
  },
2258
- "aria-invalid": !!a,
2259
- "aria-describedby": y,
2260
- ...p
2261
- }), /* @__PURE__ */ t("span", {
2262
- className: x("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0", "transition duration-200 ease-in-out", _ ? "translate-x-5.25" : "translate-x-0"),
2979
+ "aria-invalid": !!n,
2980
+ "aria-describedby": S,
2981
+ ...f
2982
+ }), /* @__PURE__ */ g("span", {
2983
+ className: x("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0", "transition duration-200 ease-in-out", y ? "translate-x-5.25" : "translate-x-0"),
2263
2984
  "aria-hidden": !0
2264
2985
  })]
2265
- }), r && /* @__PURE__ */ t(e, { children: typeof r == "string" ? /* @__PURE__ */ n("span", {
2986
+ }), e && /* @__PURE__ */ g(h, { children: typeof e == "string" ? /* @__PURE__ */ _("span", {
2266
2987
  className: x("text-sm font-medium text-gray-700 dark:text-gray-300", "select-none"),
2267
- children: [r, p.required && /* @__PURE__ */ t("span", {
2988
+ children: [e, f.required && /* @__PURE__ */ g("span", {
2268
2989
  className: "text-red-500 dark:text-red-400 ml-1",
2269
2990
  children: "*"
2270
2991
  })]
2271
- }) : /* @__PURE__ */ n(e, { children: [r, p.required && /* @__PURE__ */ t("span", {
2992
+ }) : /* @__PURE__ */ _(h, { children: [e, f.required && /* @__PURE__ */ g("span", {
2272
2993
  className: "text-red-500 dark:text-red-400 ml-1",
2273
2994
  children: "*"
2274
2995
  })] }) })]
2275
2996
  }),
2276
- /* @__PURE__ */ t(se, {
2277
- id: g,
2278
- description: i,
2997
+ /* @__PURE__ */ g(ge, {
2998
+ id: v,
2999
+ description: t,
2279
3000
  className: "mt-1 ml-14"
2280
3001
  }),
2281
- /* @__PURE__ */ t(oe, {
2282
- id: h,
2283
- error: a,
3002
+ /* @__PURE__ */ g(me, {
3003
+ id: m,
3004
+ error: n,
2284
3005
  className: "mt-1 ml-14"
2285
3006
  })
2286
3007
  ]
2287
3008
  });
2288
3009
  }
2289
3010
  //#endregion
3011
+ //#region src/components/tabs/tabs_styles.ts
3012
+ var hi = {
3013
+ line: {
3014
+ list: `gap-1 border-b ${B}`,
3015
+ tab: "-mb-px border-b-2",
3016
+ activeTab: "border-transparent text-gray-900 dark:text-gray-100",
3017
+ idleTab: "border-transparent text-gray-500 dark:text-gray-400",
3018
+ idleHover: "hover:text-gray-900 hover:border-gray-300 dark:hover:text-gray-100 dark:hover:border-gray-600",
3019
+ indicator: "absolute inset-x-0 -bottom-0.5 h-0.5 bg-blue-600 dark:bg-blue-400"
3020
+ },
3021
+ segmented: {
3022
+ list: "gap-1 p-1 bg-gray-100 dark:bg-gray-800/50",
3023
+ tab: "",
3024
+ activeTab: "text-gray-900 dark:text-gray-100",
3025
+ idleTab: "text-gray-600 dark:text-gray-400",
3026
+ idleHover: "hover:text-gray-900 dark:hover:text-gray-100",
3027
+ indicator: `absolute inset-0 ${z} border border-gray-200 dark:border-gray-700`
3028
+ }
3029
+ }, gi = {
3030
+ xs: "px-2 py-1 text-xs",
3031
+ sm: "px-3 py-1.5 text-sm",
3032
+ md: "px-4 py-2.5 text-sm",
3033
+ lg: "px-5 py-3 text-base"
3034
+ }, _i = {
3035
+ xs: "w-3.5 h-3.5",
3036
+ sm: "w-4 h-4",
3037
+ md: "w-4 h-4",
3038
+ lg: "w-5 h-5"
3039
+ }, vi = x(w, A.primary.focusOutline);
3040
+ function yi(e) {
3041
+ let { variant: t, radius: n, unstyled: r, isFullWidth: i, className: a } = e;
3042
+ return x("flex items-center", i && "w-full", !r && hi[t].list, !r && t === "segmented" && S[n], a);
3043
+ }
3044
+ function bi(e) {
3045
+ let { variant: t, size: n, radius: r, unstyled: i, isActive: a, isDisabled: o, isFullWidth: s, className: c } = e, l = hi[t];
3046
+ return x("relative flex items-center gap-2 whitespace-nowrap", s && "flex-1 justify-center", o ? "opacity-50 cursor-not-allowed" : "cursor-pointer", !i && [
3047
+ "font-medium transition-colors duration-200",
3048
+ gi[n],
3049
+ l.tab,
3050
+ a ? l.activeTab : [l.idleTab, !o && l.idleHover],
3051
+ t === "segmented" && S[r],
3052
+ vi
3053
+ ], c);
3054
+ }
3055
+ function xi(e) {
3056
+ let { variant: t, radius: n } = e;
3057
+ return x("tabs-indicator pointer-events-none", hi[t].indicator, t === "segmented" && S[n]);
3058
+ }
3059
+ //#endregion
3060
+ //#region src/components/tabs/tab_button.tsx
3061
+ function Si({ item: e, isActive: t, isTabStop: n, isFullWidth: r, variant: i, size: a, radius: o, unstyled: s, tabId: c, panelId: l, onSelect: u, onKeyDown: d, ref: f, indicatorRef: p }) {
3062
+ let m = !!e.disabled;
3063
+ return /* @__PURE__ */ _("button", {
3064
+ ref: f,
3065
+ id: c,
3066
+ role: "tab",
3067
+ type: "button",
3068
+ "aria-selected": t,
3069
+ "aria-disabled": e.disabled,
3070
+ "aria-controls": t ? l : void 0,
3071
+ tabIndex: n ? 0 : -1,
3072
+ disabled: e.disabled,
3073
+ onClick: u,
3074
+ onKeyDown: d,
3075
+ className: bi({
3076
+ variant: i,
3077
+ size: a,
3078
+ radius: o,
3079
+ unstyled: s,
3080
+ isActive: t,
3081
+ isDisabled: m,
3082
+ isFullWidth: r
3083
+ }),
3084
+ children: [
3085
+ t && !s && /* @__PURE__ */ g("span", {
3086
+ ref: p,
3087
+ "aria-hidden": "true",
3088
+ className: xi({
3089
+ variant: i,
3090
+ radius: o
3091
+ })
3092
+ }),
3093
+ e.icon && /* @__PURE__ */ g("span", {
3094
+ "aria-hidden": "true",
3095
+ className: x("relative shrink-0", _i[a], e.icon)
3096
+ }),
3097
+ /* @__PURE__ */ g("span", {
3098
+ className: "relative",
3099
+ children: e.title
3100
+ })
3101
+ ]
3102
+ });
3103
+ }
3104
+ //#endregion
3105
+ //#region src/components/tabs/use_tab_indicator_transition.ts
3106
+ var Ci = 200, wi = "ease-out", Ti = "(prefers-reduced-motion: reduce)";
3107
+ function Ei() {
3108
+ return typeof window > "u" || typeof window.matchMedia != "function" ? !1 : window.matchMedia(Ti).matches;
3109
+ }
3110
+ function Di(e, t, n) {
3111
+ e.animate([{
3112
+ transform: `translateX(${t.left - n.left}px)`,
3113
+ width: `${t.width}px`
3114
+ }, {
3115
+ transform: "none",
3116
+ width: `${n.width}px`
3117
+ }], {
3118
+ duration: Ci,
3119
+ easing: wi
3120
+ });
3121
+ }
3122
+ function Oi(e, t, n) {
3123
+ return !e || !t || !n ? !1 : !Ei();
3124
+ }
3125
+ function ki(e) {
3126
+ let { activeIndex: t, indicatorRef: n, isAnimated: r } = e, i = f(null);
3127
+ u(() => {
3128
+ let e = n.current;
3129
+ if (!e) {
3130
+ i.current = null;
3131
+ return;
3132
+ }
3133
+ let t = e.getBoundingClientRect(), a = typeof e.animate == "function";
3134
+ Oi(i.current, r, a) && Di(e, i.current, t), i.current = t;
3135
+ }, [
3136
+ t,
3137
+ n,
3138
+ r
3139
+ ]);
3140
+ }
3141
+ //#endregion
3142
+ //#region src/components/tabs/use_tabs_keyboard_navigation.ts
3143
+ var Ai = {
3144
+ ArrowRight: (e, t) => (e + 1) % t,
3145
+ ArrowLeft: (e, t) => (e - 1 + t) % t,
3146
+ Home: () => 0,
3147
+ End: (e, t) => t - 1
3148
+ };
3149
+ function ji(e) {
3150
+ return e.flatMap((e, t) => e.disabled ? [] : [t]);
3151
+ }
3152
+ function Mi(e, t) {
3153
+ let n = e[t];
3154
+ return n && !n.disabled ? t : ji(e)[0] ?? -1;
3155
+ }
3156
+ function Ni(e) {
3157
+ let { items: t, activeIndex: n, onNavigate: r } = e;
3158
+ return (e) => {
3159
+ let i = Ai[e.key];
3160
+ if (!i) return;
3161
+ let a = ji(t);
3162
+ if (a.length === 0) return;
3163
+ e.preventDefault();
3164
+ let o = i(a.indexOf(n), a.length);
3165
+ r(a[o]);
3166
+ };
3167
+ }
3168
+ //#endregion
2290
3169
  //#region src/components/tabs/tabs.tsx
2291
- function hr({ items: e, value: r, defaultIndex: i = 0, radius: a = "md", unstyled: o = !1, className: s, tabListClassName: c, panelClassName: l, onChange: u }) {
2292
- let [d, p] = H(r, i), m = f(), g = h([]), _ = (t) => {
2293
- e[t]?.disabled || (p(t), u?.(t));
2294
- }, v = (e) => {
2295
- g.current[e]?.focus(), _(e);
2296
- }, y = (t) => {
2297
- let n = e.map((e, t) => t).filter((t) => !e[t]?.disabled);
2298
- if (n.length === 0) return;
2299
- let r = n.indexOf(d);
2300
- t.key === "ArrowRight" ? (t.preventDefault(), v(n[(r + 1) % n.length])) : t.key === "ArrowLeft" ? (t.preventDefault(), v(n[(r - 1 + n.length) % n.length])) : t.key === "Home" ? (t.preventDefault(), v(n[0])) : t.key === "End" && (t.preventDefault(), v(n[n.length - 1]));
2301
- }, b = e[d];
2302
- return /* @__PURE__ */ n("div", {
2303
- className: x("w-full", s),
2304
- children: [/* @__PURE__ */ t("div", {
3170
+ function Pi({ items: e, value: t, defaultIndex: n = 0, variant: r = "line", size: i = "md", radius: a = "md", fullWidth: o = !1, unstyled: s = !1, animated: c = !0, className: u, tabListClassName: d, panelClassName: p, onChange: m }) {
3171
+ let [h, v] = ye(t, n), y = l(), b = f([]), S = f(null), C = (t) => {
3172
+ e[t]?.disabled || (v(t), m?.(t));
3173
+ }, w = (e) => {
3174
+ b.current[e]?.focus(), C(e);
3175
+ }, T = Mi(e, h), E = Ni({
3176
+ items: e,
3177
+ activeIndex: T,
3178
+ onNavigate: w
3179
+ }), D = e[h];
3180
+ return ki({
3181
+ activeIndex: h,
3182
+ indicatorRef: S,
3183
+ isAnimated: c
3184
+ }), /* @__PURE__ */ _("div", {
3185
+ className: x("w-full", u),
3186
+ children: [/* @__PURE__ */ g("div", {
2305
3187
  role: "tablist",
2306
- className: x("flex gap-1 p-1", !o && [
2307
- "bg-gray-100 dark:bg-gray-800/50 border",
2308
- "border-gray-200 dark:border-gray-700",
2309
- S[a]
2310
- ], c),
2311
- children: e.map((e, r) => /* @__PURE__ */ n("button", {
3188
+ className: yi({
3189
+ variant: r,
3190
+ radius: a,
3191
+ unstyled: s,
3192
+ isFullWidth: o,
3193
+ className: d
3194
+ }),
3195
+ children: e.map((e, t) => /* @__PURE__ */ g(Si, {
2312
3196
  ref: (e) => {
2313
- g.current[r] = e;
3197
+ b.current[t] = e;
2314
3198
  },
2315
- id: `${m}-tab-${r}`,
2316
- role: "tab",
2317
- type: "button",
2318
- "aria-selected": d === r,
2319
- "aria-disabled": e.disabled,
2320
- "aria-controls": `${m}-panel-${r}`,
2321
- tabIndex: d === r ? 0 : -1,
2322
- disabled: e.disabled,
2323
- onClick: () => _(r),
2324
- onKeyDown: y,
2325
- className: x("flex items-center gap-2 px-4 py-2.5 text-sm font-medium", e.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer", !o && [S[a], d === r ? x("bg-white dark:bg-gray-700 text-blue-600 dark:text-blue-400 shadow-sm border", "border-gray-200 dark:border-gray-700") : x("text-gray-600 dark:text-gray-400 border border-transparent", !e.disabled && "hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-200/50 dark:hover:bg-gray-700/50")]),
2326
- children: [e.icon && /* @__PURE__ */ t("span", { className: x("w-4 h-4 block shrink-0", e.icon, !o && (d === r ? "text-blue-600 dark:text-blue-400" : "text-gray-500 dark:text-gray-400")) }), e.title]
3199
+ indicatorRef: S,
3200
+ item: e,
3201
+ isActive: h === t,
3202
+ isTabStop: T === t,
3203
+ isFullWidth: o,
3204
+ variant: r,
3205
+ size: i,
3206
+ radius: a,
3207
+ unstyled: s,
3208
+ tabId: `${y}-tab-${t}`,
3209
+ panelId: `${y}-panel-${t}`,
3210
+ onSelect: () => C(t),
3211
+ onKeyDown: E
2327
3212
  }, e.title))
2328
- }), /* @__PURE__ */ t("div", {
3213
+ }), /* @__PURE__ */ g("div", {
2329
3214
  role: "tabpanel",
2330
- id: `${m}-panel-${d}`,
2331
- "aria-labelledby": `${m}-tab-${d}`,
3215
+ id: `${y}-panel-${h}`,
3216
+ "aria-labelledby": `${y}-tab-${h}`,
2332
3217
  tabIndex: 0,
2333
- className: x("mt-3 overflow-hidden focus:outline-none", !o && [
2334
- "border bg-white dark:bg-gray-800/50 p-4",
2335
- "border-gray-200 dark:border-gray-700",
2336
- S[a]
2337
- ], l),
2338
- children: /* @__PURE__ */ t("div", {
2339
- className: "tabs-panel-inner",
2340
- children: b?.content
2341
- }, d)
3218
+ className: x(!s && [
3219
+ "mt-4",
3220
+ "outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2",
3221
+ A.primary.focusOutline
3222
+ ], p),
3223
+ children: /* @__PURE__ */ g("div", {
3224
+ className: x(c && !s && "tabs-panel-inner"),
3225
+ children: D?.content
3226
+ }, h)
2342
3227
  })]
2343
3228
  });
2344
3229
  }
2345
3230
  //#endregion
2346
3231
  //#region src/components/textarea/textarea.tsx
2347
- function gr({ label: e, error: r, showCharCount: i = !1, minLength: a, maxLength: o, radius: s = "md", unstyled: c = !1, className: l, wrapperClassName: u, value: d, defaultValue: f, onChange: p, id: m, ...h }) {
2348
- let { fieldId: g, errorId: _ } = V(m), { length: v, trackLength: y } = Sn(d, f), b = i && (a !== void 0 || o !== void 0), C = (e) => {
2349
- y(e.target.value), p?.(e);
3232
+ function Fi({ label: e, error: t, showCharCount: n = !1, minLength: r, maxLength: i, radius: a = "md", unstyled: o = !1, className: s, wrapperClassName: c, value: l, defaultValue: u, onChange: d, id: f, "aria-describedby": p, ...m }) {
3233
+ let { fieldId: h, errorId: v, characterCountId: y } = K(f), { length: b, trackLength: C } = er(l, u), w = n && (r !== void 0 || i !== void 0), T = (e) => {
3234
+ C(e.target.value), d?.(e);
2350
3235
  };
2351
- return /* @__PURE__ */ n(de, {
2352
- fieldId: g,
2353
- errorId: _,
3236
+ return /* @__PURE__ */ _(Oe, {
3237
+ fieldId: h,
3238
+ errorId: v,
2354
3239
  label: e,
2355
- error: r,
2356
- required: h.required,
2357
- wrapperClassName: u,
2358
- children: [/* @__PURE__ */ t("textarea", {
2359
- id: g,
2360
- className: x("w-full min-h-[80px] resize-y disabled:opacity-50 disabled:cursor-not-allowed", !c && [
2361
- B,
2362
- S[s],
3240
+ error: t,
3241
+ required: m.required,
3242
+ wrapperClassName: c,
3243
+ children: [/* @__PURE__ */ g("textarea", {
3244
+ id: h,
3245
+ className: x("w-full min-h-[80px] resize-y disabled:opacity-50 disabled:cursor-not-allowed", !o && [
3246
+ le,
3247
+ S[a],
2363
3248
  "px-3 py-2 text-sm"
2364
- ], !c && r && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), l),
2365
- ...d === void 0 ? { defaultValue: f } : { value: d },
2366
- minLength: a,
2367
- maxLength: o,
2368
- onChange: C,
2369
- "aria-invalid": !!r,
2370
- "aria-describedby": r ? _ : void 0,
2371
- ...h
2372
- }), b && /* @__PURE__ */ t(R, {
2373
- current: v,
2374
- min: a,
2375
- max: o,
2376
- showMin: a !== void 0,
2377
- showMax: o !== void 0
3249
+ ], !o && t && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), s),
3250
+ ...l === void 0 ? { defaultValue: u } : { value: l },
3251
+ minLength: r,
3252
+ maxLength: i,
3253
+ onChange: T,
3254
+ "aria-invalid": !!t,
3255
+ "aria-describedby": G(p, t && v, w && y),
3256
+ ...m
3257
+ }), w && /* @__PURE__ */ g(ce, {
3258
+ id: y,
3259
+ current: b,
3260
+ min: r,
3261
+ max: i,
3262
+ showMin: r !== void 0,
3263
+ showMax: i !== void 0
2378
3264
  })]
2379
3265
  });
2380
3266
  }
2381
3267
  //#endregion
2382
3268
  //#region src/stores/theme_store/theme_store.ts
2383
- var _r = "theme";
2384
- function vr(e) {
3269
+ var Ii = "theme";
3270
+ function Li(e) {
2385
3271
  return e === "light" || e === "dark" || e === "system";
2386
3272
  }
2387
- function yr() {
3273
+ function Ri() {
2388
3274
  return globalThis.window !== void 0 && globalThis.document !== void 0;
2389
3275
  }
2390
- function br(e) {
3276
+ function zi(e) {
2391
3277
  let t = window.matchMedia("(prefers-color-scheme: dark)").matches, n = e === "dark" || e === "system" && t;
2392
3278
  document.documentElement.classList.toggle("dark", n);
2393
3279
  }
2394
- function xr() {
2395
- if (!yr()) return "system";
2396
- let e = globalThis.localStorage.getItem(_r);
2397
- return vr(e) ? e : "system";
3280
+ function Bi() {
3281
+ if (!Ri()) return "system";
3282
+ let e = globalThis.localStorage.getItem(Ii);
3283
+ return Li(e) ? e : "system";
2398
3284
  }
2399
- var Sr = xr();
2400
- yr() && br(Sr);
2401
- var Cr = Qn((e) => ({
2402
- theme: Sr,
3285
+ var Vi = Bi();
3286
+ Ri() && zi(Vi);
3287
+ var Hi = Kr((e) => ({
3288
+ theme: Vi,
2403
3289
  setTheme: (t) => {
2404
- br(t), yr() && globalThis.localStorage.setItem(_r, t), e({ theme: t });
3290
+ zi(t), Ri() && globalThis.localStorage.setItem(Ii, t), e({ theme: t });
2405
3291
  }
2406
3292
  }));
2407
- yr() && (globalThis.addEventListener("storage", (e) => {
2408
- if (e.key !== _r) return;
2409
- let t = vr(e.newValue) ? e.newValue : "system";
2410
- br(t), Cr.setState({ theme: t });
3293
+ Ri() && (globalThis.addEventListener("storage", (e) => {
3294
+ if (e.key !== Ii) return;
3295
+ let t = Li(e.newValue) ? e.newValue : "system";
3296
+ zi(t), Hi.setState({ theme: t });
2411
3297
  }), globalThis.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
2412
- Cr.getState().theme === "system" && br("system");
3298
+ Hi.getState().theme === "system" && zi("system");
2413
3299
  }));
2414
3300
  //#endregion
2415
3301
  //#region src/lib/theme_transition.ts
2416
- var wr = 750, Tr = "ease-in-out";
2417
- async function Er({ theme: e, element: t, transitionDuration: n = wr, transitionEasing: r = Tr, applyThemeCallback: i }) {
3302
+ var Ui = 750, Wi = "ease-in-out";
3303
+ async function Gi({ theme: e, element: t, transitionDuration: n = Ui, transitionEasing: r = Wi, applyThemeCallback: i }) {
2418
3304
  if (!document.startViewTransition || globalThis.matchMedia("(prefers-reduced-motion: reduce)").matches) {
2419
3305
  i(e);
2420
3306
  return;
@@ -2428,43 +3314,43 @@ async function Er({ theme: e, element: t, transitionDuration: n = wr, transition
2428
3314
  pseudoElement: "::view-transition-new(root)"
2429
3315
  });
2430
3316
  }
2431
- function Dr(e) {
3317
+ function Ki(e) {
2432
3318
  return e === "light" ? "dark" : e === "dark" ? "system" : "light";
2433
3319
  }
2434
3320
  //#endregion
2435
3321
  //#region src/components/theme_toggle/theme_toggle.tsx
2436
- var Or = {
3322
+ var qi = {
2437
3323
  light: "i-tabler-sun text-yellow-500",
2438
3324
  dark: "i-tabler-moon-stars text-gray-700 dark:text-yellow-500",
2439
3325
  system: "i-tabler-device-desktop text-blue-500"
2440
- }, kr = "i-tabler-device-desktop text-gray-400";
2441
- function Ar(e) {
3326
+ }, Ji = "i-tabler-device-desktop text-gray-400";
3327
+ function Yi(e) {
2442
3328
  return `Current theme: ${e}`;
2443
3329
  }
2444
- function jr({ isTransitionEnabled: e = !0, transitionDuration: n, transitionEasing: r, size: i = "md", radius: a, variant: o, getAriaLabel: s = Ar }) {
2445
- let c = Cr((e) => e.theme), u = Cr((e) => e.setTheme), d = le(), f = h(null), p = l(async () => {
2446
- let t = Dr(c), i = f.current;
2447
- i && e ? await Er({
2448
- theme: t,
3330
+ function Xi({ isTransitionEnabled: e = !0, transitionDuration: t, transitionEasing: n, size: r = "md", radius: i, variant: a, getAriaLabel: s = Yi }) {
3331
+ let c = Hi((e) => e.theme), l = Hi((e) => e.setTheme), u = Ee(), d = f(null), p = o(async () => {
3332
+ let r = Ki(c), i = d.current;
3333
+ i && e ? await Gi({
3334
+ theme: r,
2449
3335
  element: i,
2450
- transitionDuration: n,
2451
- transitionEasing: r,
2452
- applyThemeCallback: u
2453
- }) : u(t);
3336
+ transitionDuration: t,
3337
+ transitionEasing: n,
3338
+ applyThemeCallback: l
3339
+ }) : l(r);
2454
3340
  }, [
2455
3341
  c,
2456
3342
  e,
3343
+ t,
2457
3344
  n,
2458
- r,
2459
- u
2460
- ]), m = d ? Or[c] : kr;
2461
- return /* @__PURE__ */ t(bn, {
2462
- ref: f,
3345
+ l
3346
+ ]), m = u ? qi[c] : Ji;
3347
+ return /* @__PURE__ */ g(Qn, {
3348
+ ref: d,
2463
3349
  icon: m,
2464
3350
  "aria-label": s(c),
2465
- size: i,
2466
- radius: a,
2467
- variant: o,
3351
+ size: r,
3352
+ radius: i,
3353
+ variant: a,
2468
3354
  onClick: () => {
2469
3355
  p();
2470
3356
  }
@@ -2472,72 +3358,82 @@ function jr({ isTransitionEnabled: e = !0, transitionDuration: n, transitionEasi
2472
3358
  }
2473
3359
  //#endregion
2474
3360
  //#region src/components/tooltip/tooltip.tsx
2475
- var Mr = 8, Nr = 8, Pr = {
3361
+ var Zi = 8, Qi = 8, $i = {
2476
3362
  top: "data-[state=closed]:translate-y-1",
2477
3363
  bottom: "data-[state=closed]:-translate-y-1",
2478
3364
  left: "data-[state=closed]:translate-x-1",
2479
3365
  right: "data-[state=closed]:-translate-x-1"
2480
- }, Fr = {
3366
+ }, ea = {
2481
3367
  top: "bottom",
2482
3368
  bottom: "top",
2483
3369
  left: "right",
2484
3370
  right: "left"
2485
3371
  };
2486
- function Ir({ content: r, children: i, position: o = "top", showOnClick: s = !1, temporaryContent: u, temporaryDuration: p = 2e3, disabled: m = !1, radius: _ = "lg", onTemporaryShow: v, className: b, ref: C }) {
2487
- let { isMounted: w, isVisible: T, setIsVisible: E, open: D, close: O } = sn(), [k, A] = g(!1), j = f(), M = h(null), N = h(void 0), { refs: P, floatingStyles: F, placement: I, middlewareData: L, isPositioned: R } = Yt({
2488
- placement: o,
3372
+ function ta({ content: e, children: t, position: r = "top", showOnClick: i = !1, temporaryContent: s, temporaryDuration: u = 2e3, disabled: d = !1, radius: m = "lg", onTemporaryShow: v, className: b, ref: C }) {
3373
+ let { isMounted: w, isVisible: T, setIsVisible: E, open: D, close: O } = Rn(), [k, A] = p(!1), j = l(), M = f(null), N = f(void 0), { refs: P, floatingStyles: F, placement: I, middlewareData: ee, isPositioned: L } = bn({
3374
+ placement: r,
2489
3375
  open: w,
2490
- whileElementsMounted: Rt,
3376
+ whileElementsMounted: ln,
2491
3377
  middleware: [
2492
- Zt(Mr),
2493
- $t(),
2494
- Qt({ padding: 8 }),
2495
- en({ element: M })
3378
+ Sn(Zi),
3379
+ wn(),
3380
+ Cn({ padding: 8 }),
3381
+ Tn({ element: M })
2496
3382
  ]
2497
- }), z = I.split("-")[0];
2498
- cn(w, R, E);
2499
- let ee = l((e) => En(P.setReference, C)(e), [P, C]), te = () => {
3383
+ }), te = I.split("-")[0];
3384
+ zn(w, L, E);
3385
+ let ne = o((e) => ir(P.setReference, C)(e), [P, C]), R = o(() => {
2500
3386
  A(!1), O();
2501
- }, ne = () => {
2502
- m || !u || (A(!0), D(R), clearTimeout(N.current), N.current = setTimeout(te, p), v?.());
2503
- }, B = () => {
2504
- m || D(R);
2505
- }, re = () => {
2506
- clearTimeout(N.current), te();
2507
- };
2508
- d(() => () => clearTimeout(N.current), []);
2509
- let ie = w && !m, ae = k && u ? u : r, oe = {
3387
+ }, [O]), re = () => {
3388
+ !d && s && (A(!0), D(L), clearTimeout(N.current), N.current = setTimeout(R, u), v?.());
3389
+ }, z = () => {
3390
+ d || D(L);
3391
+ }, B = o(() => {
3392
+ clearTimeout(N.current), R();
3393
+ }, [R]);
3394
+ c(() => () => clearTimeout(N.current), []), c(() => {
3395
+ if (!w) return;
3396
+ let e = (e) => {
3397
+ e.key === "Escape" && B();
3398
+ };
3399
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
3400
+ }, [w, B]);
3401
+ let ie = w && !d, V = k && s ? s : e, H = {
2510
3402
  onClick: (e) => {
2511
- s && u && ne(), c(i) && i.props.onClick?.(e);
3403
+ i && s && re(), a(t) && t.props.onClick?.(e);
2512
3404
  },
2513
- "aria-describedby": ie ? j : void 0
2514
- }, V = c(i) ? a(i, oe) : i, se = L.arrow?.x, H = L.arrow?.y, ce = Fr[z];
2515
- return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", {
2516
- ref: ee,
3405
+ "aria-describedby": G(a(t) ? t.props["aria-describedby"] : void 0, ie && j)
3406
+ }, ae = a(t) ? n(t, H) : t, oe = ee.arrow?.x, U = ee.arrow?.y, se = ea[te];
3407
+ return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _("span", {
3408
+ ref: ne,
2517
3409
  className: x("inline-block", b),
2518
- onMouseEnter: B,
2519
- onMouseLeave: re,
2520
- onFocus: B,
2521
- onBlur: re,
2522
- children: V
2523
- }), ie && y(/* @__PURE__ */ t("div", {
3410
+ onMouseEnter: z,
3411
+ onMouseLeave: B,
3412
+ onFocus: z,
3413
+ onBlur: B,
3414
+ children: [ae, s !== void 0 && /* @__PURE__ */ g("span", {
3415
+ role: "status",
3416
+ className: "sr-only",
3417
+ children: k ? s : null
3418
+ })]
3419
+ }), ie && y(/* @__PURE__ */ g("div", {
2524
3420
  ref: P.setFloating,
2525
3421
  style: F,
2526
3422
  className: "z-50 inline-block pointer-events-none",
2527
- children: /* @__PURE__ */ n("div", {
3423
+ children: /* @__PURE__ */ _("div", {
2528
3424
  id: j,
2529
3425
  role: "tooltip",
2530
3426
  "data-state": T ? "open" : "closed",
2531
- className: x("px-3 py-1.5 text-sm whitespace-nowrap", "text-white dark:text-gray-900 bg-gray-900 dark:bg-gray-100 shadow-lg", "transition-[opacity,transform] duration-150 ease-out", T ? "opacity-100" : "opacity-0", Pr[z], S[_]),
2532
- children: [ae, /* @__PURE__ */ t("div", {
3427
+ className: x("px-3 py-1.5 text-sm whitespace-nowrap", "text-white dark:text-gray-900 bg-gray-900 dark:bg-gray-100 shadow-lg", "transition-[opacity,transform] duration-150 ease-out", T ? "opacity-100" : "opacity-0", $i[te], S[m]),
3428
+ children: [V, /* @__PURE__ */ g("div", {
2533
3429
  ref: M,
2534
3430
  style: {
2535
3431
  position: "absolute",
2536
- width: `${Nr}px`,
2537
- height: `${Nr}px`,
2538
- left: se === void 0 ? void 0 : `${se}px`,
2539
- top: H === void 0 ? void 0 : `${H}px`,
2540
- [ce]: `-${Nr / 2}px`
3432
+ width: `${Qi}px`,
3433
+ height: `${Qi}px`,
3434
+ left: oe === void 0 ? void 0 : `${oe}px`,
3435
+ top: U === void 0 ? void 0 : `${U}px`,
3436
+ [se]: `-${Qi / 2}px`
2541
3437
  },
2542
3438
  className: "rotate-45 bg-gray-900 dark:bg-gray-100"
2543
3439
  })]
@@ -2546,11 +3442,11 @@ function Ir({ content: r, children: i, position: o = "top", showOnClick: s = !1,
2546
3442
  }
2547
3443
  //#endregion
2548
3444
  //#region src/hooks/use_is_client/with_client_only.tsx
2549
- var Lr = (e) => {
2550
- function n(n) {
2551
- return le() ? /* @__PURE__ */ t(e, { ...n }) : null;
3445
+ var na = (e) => {
3446
+ function t(t) {
3447
+ return Ee() ? /* @__PURE__ */ g(e, { ...t }) : null;
2552
3448
  }
2553
- return n;
3449
+ return t;
2554
3450
  };
2555
3451
  //#endregion
2556
- export { B as BASE_INPUT_STYLES, M as Badge, F as Button, R as CharacterCount, ce as Checkbox, ue as ClientOnly, fe as Combobox, ar as ConfirmModal, fn as ContextMenu, hn as CopyButton, _n as Highlight, bn as IconButton, Cn as Input, Tn as Kbd, kn as Menu, zn as MenuItem, cr as Modal, lr as ModalFooter, ur as ModalProvider, fr as RadioOptions, pr as Select, mr as Switch, hr as Tabs, gr as Textarea, jr as ThemeToggle, Ir as Tooltip, gn as splitIntoHighlightSegments, tr as useDisableHotkeysWhileMounted, $n as useGlobalHotkeysStore, le as useIsClient, Cr as useThemeStore, Lr as withClientOnly };
3452
+ export { I as Avatar, le as BASE_INPUT_STYLES, L as Badge, R as Button, U as Card, ce as CharacterCount, xe as Checkbox, Te as CheckboxOptions, De as ClientOnly, Me as Combobox, $r as ConfirmModal, Un as ContextMenu, Kn as CopyButton, Yn as Highlight, Qn as IconButton, tr as Input, rr as Kbd, sr as Menu, cr as MenuGroup, yr as MenuItem, br as MenuSeparator, ni as Modal, ri as ModalFooter, ii as ModalProvider, ui as MultiCombobox, fi as RadioOptions, pi as Select, mi as Switch, Pi as Tabs, Fi as Textarea, Xi as ThemeToggle, ta as Tooltip, qn as splitIntoHighlightSegments, Yr as useDisableHotkeysWhileMounted, qr as useGlobalHotkeysStore, Ee as useIsClient, Hi as useThemeStore, na as withClientOnly };