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