@minimalstuff/ui 2.1.1 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,30 +1,34 @@
1
1
  import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
2
- import r, { createElement as i, useCallback as a, useEffect as o, useId as s, useMemo as c, useRef as l, useState as u, useSyncExternalStore as d } from "react";
3
- import { createPortal as f } from "react-dom";
2
+ import * as r from "react";
3
+ import i, { cloneElement as a, createContext as o, createElement as s, isValidElement as c, useCallback as l, useContext as u, useEffect as d, useId as f, useLayoutEffect as p, useMemo as m, useRef as h, useState as g, useSyncExternalStore as _ } from "react";
4
+ import * as v from "react-dom";
5
+ import { createPortal as y } from "react-dom";
4
6
  //#region node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
5
- function p(e) {
7
+ function b(e) {
6
8
  var t, n, r = "";
7
9
  if (typeof e == "string" || typeof e == "number") r += e;
8
- else if (typeof e == "object") if (Array.isArray(e)) {
9
- var i = e.length;
10
- for (t = 0; t < i; t++) e[t] && (n = p(e[t])) && (r && (r += " "), r += n);
11
- } else for (n in e) e[n] && (r && (r += " "), r += n);
10
+ else if (typeof e == "object") {
11
+ if (Array.isArray(e)) {
12
+ var i = e.length;
13
+ for (t = 0; t < i; t++) e[t] && (n = b(e[t])) && (r && (r += " "), r += n);
14
+ } else for (n in e) e[n] && (r && (r += " "), r += n);
15
+ }
12
16
  return r;
13
17
  }
14
- function m() {
15
- for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = p(e)) && (r && (r += " "), r += t);
18
+ function x() {
19
+ for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = b(e)) && (r && (r += " "), r += t);
16
20
  return r;
17
21
  }
18
22
  //#endregion
19
23
  //#region src/components/shared/radius.ts
20
- var h = {
24
+ var S = {
21
25
  none: "rounded-none",
22
26
  sm: "rounded-sm",
23
27
  md: "rounded-md",
24
28
  lg: "rounded-lg",
25
29
  xl: "rounded-xl",
26
30
  full: "rounded-full"
27
- }, g = {
31
+ }, C = "outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2", w = "focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent", T = "focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-offset-white dark:focus-within:ring-offset-gray-900", E = "focus-within:ring-blue-500", D = "focus-within:ring-red-500", O = {
28
32
  primary: {
29
33
  solid: "border-transparent bg-blue-600 text-white enabled:hover:bg-blue-700 enabled:active:bg-blue-800 dark:bg-blue-500 dark:enabled:hover:bg-blue-600 dark:enabled:active:bg-blue-700",
30
34
  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",
@@ -52,110 +56,166 @@ var h = {
52
56
  ghost: "border-transparent bg-transparent text-green-700 enabled:hover:bg-green-50 enabled:active:bg-green-100 dark:text-green-400 dark:enabled:hover:bg-green-950/40 dark:enabled:active:bg-green-950/60",
53
57
  subtle: "border-transparent bg-green-50 text-green-700 enabled:hover:bg-green-100 enabled:active:bg-green-200 dark:bg-green-500/10 dark:text-green-400 dark:enabled:hover:bg-green-500/20 dark:enabled:active:bg-green-500/30",
54
58
  focusOutline: "focus-visible:outline-green-500"
59
+ },
60
+ warning: {
61
+ solid: "border-transparent bg-yellow-600 text-white enabled:hover:bg-yellow-700 enabled:active:bg-yellow-800 dark:bg-yellow-500 dark:enabled:hover:bg-yellow-600 dark:enabled:active:bg-yellow-700",
62
+ outline: "border-yellow-300 bg-transparent text-yellow-700 enabled:hover:bg-yellow-50 enabled:active:bg-yellow-100 dark:border-yellow-800 dark:text-yellow-400 dark:enabled:hover:bg-yellow-950/40 dark:enabled:active:bg-yellow-950/60",
63
+ ghost: "border-transparent bg-transparent text-yellow-700 enabled:hover:bg-yellow-50 enabled:active:bg-yellow-100 dark:text-yellow-400 dark:enabled:hover:bg-yellow-950/40 dark:enabled:active:bg-yellow-950/60",
64
+ subtle: "border-transparent bg-yellow-50 text-yellow-700 enabled:hover:bg-yellow-100 enabled:active:bg-yellow-200 dark:bg-yellow-500/10 dark:text-yellow-400 dark:enabled:hover:bg-yellow-500/20 dark:enabled:active:bg-yellow-500/30",
65
+ focusOutline: "focus-visible:outline-yellow-500"
55
66
  }
56
- }, _ = "cursor-pointer inline-flex items-center justify-center transition-[color,background-color,border-color,transform] duration-200 enabled:active:duration-75 enabled:active:scale-[0.95] outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2 disabled:opacity-50 disabled:cursor-not-allowed", v = {
67
+ }, k = "inline-flex items-center justify-center disabled:opacity-50 disabled:cursor-not-allowed", A = `cursor-pointer transition-[color,background-color,border-color,transform] duration-200 enabled:active:duration-75 enabled:active:scale-[0.95] ${C}`, j = {
68
+ xs: "px-1.5 py-0.5 text-xs",
69
+ sm: "px-2.5 py-1 text-sm",
70
+ md: "px-3 py-1 text-base",
71
+ lg: "px-3.5 py-1.5 text-lg"
72
+ }, M = ({ children: e, color: n = "primary", variant: r = "subtle", size: i = "sm", radius: a = "md", className: o, ...s }) => /* @__PURE__ */ t("span", {
73
+ className: x("inline-flex items-center gap-1 border", S[a], j[i], O[n][r], o),
74
+ ...s,
75
+ children: e
76
+ }), N = {
57
77
  xs: "px-2 py-1 text-xs",
58
78
  sm: "px-3 py-1.5 text-sm",
59
79
  md: "px-4 py-2 text-sm",
60
80
  lg: "px-4 py-3 text-base"
61
- }, y = {
81
+ }, P = {
62
82
  xs: "w-3.5 h-3.5",
63
83
  sm: "w-4 h-4",
64
84
  md: "w-4 h-4",
65
85
  lg: "w-5 h-5"
66
- }, b = ({ variant: e = "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 }) => {
67
- let b = g[r], x = y[i];
86
+ };
87
+ function F(e) {
88
+ let { unstyled: r = !1, variant: i = "solid", color: a = "primary", size: o = "md", radius: s = "md", children: c, className: l, fullWidth: u = !1, loading: d = !1, startIcon: f, endIcon: p, disabled: m, ...h } = e, g = O[a], _ = P[o];
68
89
  return /* @__PURE__ */ n("button", {
69
90
  type: "button",
70
- className: m(_, "gap-2 font-medium", e !== "unstyled" && [
71
- "border",
72
- h[a],
73
- b[e],
74
- b.focusOutline
75
- ], v[i], c && "w-full", s),
76
- disabled: f ?? l,
77
- "aria-busy": l || void 0,
78
- ...p,
91
+ className: x(k, !r && [
92
+ A,
93
+ "gap-2 font-medium border",
94
+ S[s],
95
+ N[o],
96
+ g[i],
97
+ g.focusOutline
98
+ ], u && "w-full", l),
99
+ disabled: m ?? d,
100
+ "aria-busy": d || void 0,
101
+ ...h,
79
102
  children: [
80
- l && /* @__PURE__ */ t("span", {
81
- className: m("i-svg-spinners-3-dots-fade", x),
103
+ d && /* @__PURE__ */ t("span", {
104
+ className: x("i-svg-spinners-3-dots-fade", _),
82
105
  "aria-hidden": "true"
83
106
  }),
84
- !l && u && /* @__PURE__ */ t("span", {
85
- className: m(u, x),
107
+ !d && f && /* @__PURE__ */ t("span", {
108
+ className: x(f, _),
86
109
  "aria-hidden": "true"
87
110
  }),
88
- o,
89
- !l && d && /* @__PURE__ */ t("span", {
90
- className: m(d, x),
111
+ c,
112
+ !d && p && /* @__PURE__ */ t("span", {
113
+ className: x(p, _),
91
114
  "aria-hidden": "true"
92
115
  })
93
116
  ]
94
117
  });
95
- }, x = "text-xs text-gray-500 dark:text-gray-400 mt-1 text-right";
96
- function S(e) {
97
- return e === "overLimit" ? "text-red-600 dark:text-red-400" : e === "atLimit" ? "text-amber-600 dark:text-amber-400" : "";
98
118
  }
99
- function C({ current: e, min: r, max: i, showMin: a, showMax: o }) {
100
- let s = a === !0 || o === !0, c = r !== void 0 && e <= r ? "atLimit" : "ok", l = i !== void 0 && e > i ? "overLimit" : i !== void 0 && e >= i ? "atLimit" : "ok", u = s ? `${e}/${r} min` : `${e} (min ${r})`, d = s ? `${e}/${i} max` : `${e}/${i}`;
119
+ //#endregion
120
+ //#region src/components/character_count/character_count.tsx
121
+ var I = "text-xs text-gray-500 dark:text-gray-400 mt-1 text-right";
122
+ function L(e, t) {
123
+ return t ? "" : e === "overLimit" ? "text-red-600 dark:text-red-400" : e === "atLimit" ? "text-amber-600 dark:text-amber-400" : "";
124
+ }
125
+ function R({ current: e, min: r, max: i, showMin: a, showMax: o, unstyled: s = !1, className: c }) {
126
+ let l = a === !0 || o === !0, u = r !== void 0 && e <= r ? "atLimit" : "ok", d = i !== void 0 && e > i ? "overLimit" : i !== void 0 && e >= i ? "atLimit" : "ok", f = l ? `${e}/${r} min` : `${e} (min ${r})`, p = l ? `${e}/${i} max` : `${e}/${i}`;
101
127
  return /* @__PURE__ */ n("div", {
102
- className: x,
128
+ className: x(!s && I, c),
103
129
  children: [
104
130
  a && r !== void 0 && /* @__PURE__ */ t("span", {
105
- className: S(c),
106
- children: u
131
+ className: L(u, s),
132
+ children: f
107
133
  }),
108
134
  a && o && " · ",
109
135
  o && i !== void 0 && /* @__PURE__ */ t("span", {
110
- className: S(l),
111
- children: d
136
+ className: L(d, s),
137
+ children: p
112
138
  }),
113
139
  !a && !o && i !== void 0 && /* @__PURE__ */ t("span", {
114
- className: S(l),
115
- children: d
140
+ className: L(d, s),
141
+ children: p
116
142
  }),
117
143
  !a && !o && r !== void 0 && i === void 0 && /* @__PURE__ */ t("span", {
118
- className: S(c),
119
- children: u
144
+ className: L(u, s),
145
+ children: f
120
146
  })
121
147
  ]
122
148
  });
123
149
  }
124
150
  //#endregion
125
151
  //#region src/components/shared/surface_tokens.ts
126
- var w = "border-gray-300 dark:border-gray-600", T = "bg-white dark:bg-gray-800", E = "border-gray-200 dark:border-gray-700", D = "bg-white dark:bg-gray-900", O = "bg-blue-600 dark:bg-blue-500", k = "text-sm font-medium text-gray-700 dark:text-gray-300", A = "border-red-500 dark:border-red-400";
152
+ var z = "border-gray-300 dark:border-gray-600", ee = "bg-white dark:bg-gray-800", te = "border-gray-100 dark:border-gray-800", ne = "bg-white dark:bg-gray-900", B = `w-full border ${z} ${ee} text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 ${w} transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed`, re = "text-xs text-gray-500 dark:text-gray-400", ie = "text-xs text-red-600 dark:text-red-400", ae = "border-red-500 dark:border-red-400", oe = ({ id: e, error: n, className: r }) => n ? /* @__PURE__ */ t("p", {
153
+ id: e,
154
+ className: x(ie, r),
155
+ role: "alert",
156
+ children: n
157
+ }) : null;
158
+ //#endregion
159
+ //#region src/components/shared/use_field_ids.ts
160
+ function V(e) {
161
+ let t = f(), n = e ?? t;
162
+ return {
163
+ fieldId: n,
164
+ errorId: `${n}-error`,
165
+ descriptionId: `${n}-description`
166
+ };
167
+ }
168
+ //#endregion
169
+ //#region src/components/shared/field_description.tsx
170
+ var se = ({ id: e, description: n, className: r }) => n ? typeof n == "string" ? /* @__PURE__ */ t("p", {
171
+ id: e,
172
+ className: x(re, r),
173
+ children: n
174
+ }) : /* @__PURE__ */ t("span", {
175
+ id: e,
176
+ className: x(re, "block", r),
177
+ children: n
178
+ }) : null;
179
+ //#endregion
180
+ //#region src/components/shared/use_controlled_state.ts
181
+ function H(e, t) {
182
+ let [n, r] = g(t), i = e !== void 0, a = l((e) => {
183
+ i || r(e);
184
+ }, [i]);
185
+ return [i ? e : n, a];
186
+ }
127
187
  //#endregion
128
188
  //#region src/components/checkbox/checkbox.tsx
129
- function j({ label: e, description: r, error: i, radius: a = "sm", unstyled: o = !1, className: c, wrapperClassName: l, checked: d, defaultChecked: f = !1, onChange: p, id: g = "checkbox", ..._ }) {
130
- let v = `${g}-${s()}`, [y, b] = u(f), x = d !== void 0, S = x ? d : y, C = [r && `${v}-description`, i && `${v}-error`].filter(Boolean).join(" ") || void 0;
189
+ function ce({ label: r, description: i, error: a, radius: o = "sm", unstyled: s = !1, className: c, wrapperClassName: l, checked: u, defaultChecked: d = !1, onChange: f, id: p, ...m }) {
190
+ let { fieldId: h, errorId: g, descriptionId: _ } = V(p), [v, y] = H(u, d), b = [i && _, a && g].filter(Boolean).join(" ") || void 0;
131
191
  return /* @__PURE__ */ n("div", {
132
- className: m("w-full", l),
192
+ className: x("w-full", l),
133
193
  children: [
134
194
  /* @__PURE__ */ n("label", {
135
- htmlFor: v,
136
- className: m("flex items-start gap-3 cursor-pointer", _.disabled && "cursor-not-allowed opacity-50"),
195
+ htmlFor: h,
196
+ className: x("flex items-start gap-3 cursor-pointer", m.disabled && "cursor-not-allowed opacity-50"),
137
197
  children: [/* @__PURE__ */ n("span", {
138
- className: m("relative shrink-0 rounded", "focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-offset-white dark:focus-within:ring-offset-gray-900", i ? "focus-within:ring-red-500" : "focus-within:ring-blue-500"),
198
+ className: x("relative shrink-0", S[o], T, a ? D : E),
139
199
  children: [/* @__PURE__ */ t("input", {
140
200
  type: "checkbox",
141
- id: v,
201
+ id: h,
142
202
  className: "sr-only",
143
- checked: S,
203
+ checked: v,
144
204
  onChange: (e) => {
145
- x || b(e.target.checked), p?.(e);
205
+ y(e.target.checked), f?.(e);
146
206
  },
147
- "aria-invalid": !!i,
148
- "aria-describedby": C,
149
- ..._
207
+ "aria-invalid": !!a,
208
+ "aria-describedby": b,
209
+ ...m
150
210
  }), /* @__PURE__ */ t("span", {
151
- className: m("flex h-5 w-5 items-center justify-center transition-all duration-200", !o && [
152
- h[a],
211
+ className: x("flex h-5 w-5 items-center justify-center transition-all duration-200", !s && [
212
+ S[o],
153
213
  "border-2",
154
- S ? m("border-blue-600 dark:border-blue-500", "bg-blue-600 dark:bg-blue-500") : m("border-gray-300 dark:border-gray-600", "bg-white dark:bg-gray-800"),
155
- i && "border-red-500 dark:border-red-400"
214
+ v ? x("border-blue-600 dark:border-blue-500", "bg-blue-600 dark:bg-blue-500") : x("border-gray-300 dark:border-gray-600", "bg-white dark:bg-gray-800"),
215
+ a && "border-red-500 dark:border-red-400"
156
216
  ], c),
157
217
  "aria-hidden": !0,
158
- children: S && /* @__PURE__ */ t("svg", {
218
+ children: v && /* @__PURE__ */ t("svg", {
159
219
  className: "h-3 w-3 text-white",
160
220
  viewBox: "0 0 12 12",
161
221
  fill: "none",
@@ -166,252 +226,1497 @@ function j({ label: e, description: r, error: i, radius: a = "sm", unstyled: o =
166
226
  children: /* @__PURE__ */ t("polyline", { points: "2 6 5 9 10 3" })
167
227
  })
168
228
  })]
169
- }), typeof e == "string" ? /* @__PURE__ */ n("span", {
170
- className: m(k, "select-none"),
171
- children: [e, _.required && /* @__PURE__ */ t("span", {
229
+ }), r !== void 0 && (typeof r == "string" ? /* @__PURE__ */ n("span", {
230
+ className: x("text-sm font-medium text-gray-700 dark:text-gray-300", "select-none"),
231
+ children: [r, m.required && /* @__PURE__ */ t("span", {
172
232
  className: "text-red-500 dark:text-red-400 ml-1",
173
233
  children: "*"
174
234
  })]
175
- }) : e]
235
+ }) : /* @__PURE__ */ n(e, { children: [r, m.required && /* @__PURE__ */ t("span", {
236
+ className: "text-red-500 dark:text-red-400 ml-1",
237
+ children: "*"
238
+ })] }))]
239
+ }),
240
+ /* @__PURE__ */ t(se, {
241
+ id: _,
242
+ description: i,
243
+ className: "mt-1 ml-8"
176
244
  }),
177
- r && (typeof r == "string" ? /* @__PURE__ */ t("p", {
178
- id: `${v}-description`,
179
- className: m("text-xs text-gray-500 dark:text-gray-400", "mt-1 ml-8"),
180
- children: r
181
- }) : /* @__PURE__ */ t("span", {
182
- id: `${v}-description`,
183
- className: m("text-xs text-gray-500 dark:text-gray-400", "block mt-1 ml-8"),
184
- children: r
185
- })),
186
- i && /* @__PURE__ */ t("p", {
187
- id: `${v}-error`,
188
- className: m("text-xs text-red-600 dark:text-red-400", "mt-1 ml-8"),
189
- role: "alert",
190
- children: i
245
+ /* @__PURE__ */ t(oe, {
246
+ id: g,
247
+ error: a,
248
+ className: "mt-1 ml-8"
191
249
  })
192
250
  ]
193
251
  });
194
252
  }
195
253
  //#endregion
196
- //#region src/hooks/use_client_only/use_client_only.tsx
197
- var M = () => {
198
- let [e, t] = u(!1);
199
- return o(() => {
254
+ //#region src/hooks/use_is_client/use_is_client.tsx
255
+ var le = () => {
256
+ let [e, t] = g(!1);
257
+ return d(() => {
200
258
  requestAnimationFrame(() => {
201
259
  t(!0);
202
260
  });
203
261
  }, []), e;
204
- }, N = (e) => (n) => M() ? /* @__PURE__ */ t(e, { ...n }) : null;
262
+ };
205
263
  //#endregion
206
264
  //#region src/components/client_only/client_only.tsx
207
- function P({ children: n, fallback: r }) {
208
- return M() ? /* @__PURE__ */ t(e, { children: n }) : r ?? null;
265
+ function ue({ children: n, fallback: r }) {
266
+ return le() ? /* @__PURE__ */ t(e, { children: n }) : r ?? null;
209
267
  }
210
268
  //#endregion
211
- //#region src/components/input/input.tsx
212
- var F = `w-full border ${w} ${T} text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed`;
213
- function I({ label: e, error: r, showCharCount: i = !1, minLength: a, maxLength: o, radius: c = "md", unstyled: l = !1, className: d, wrapperClassName: f, value: p, defaultValue: g, onChange: _, id: v = "input", ...y }) {
214
- let b = `${v}-${s()}`, [x, S] = u(typeof g == "string" ? g.length : 0), w = typeof p == "string" ? p.length : p === void 0 ? x : 0, T = i && (a !== void 0 || o !== void 0), E = (e) => {
215
- p === void 0 && S(e.target.value.length), _?.(e);
216
- };
217
- return /* @__PURE__ */ n("div", {
218
- className: m("w-full", f),
219
- children: [
220
- typeof e == "string" ? /* @__PURE__ */ n("label", {
221
- className: m(k, "block mb-1"),
222
- htmlFor: b,
223
- children: [e, y.required && /* @__PURE__ */ t("span", {
224
- className: "text-red-500 dark:text-red-400 ml-1",
225
- children: "*"
226
- })]
227
- }) : e,
228
- /* @__PURE__ */ t("input", {
229
- id: b,
230
- className: m("w-full disabled:opacity-50 disabled:cursor-not-allowed", !l && [
231
- F,
232
- h[c],
233
- "px-3 py-2 text-sm"
234
- ], !l && r && m("border-red-500 dark:border-red-400", "focus:ring-red-500"), d),
235
- ...p === void 0 ? { defaultValue: g } : { value: p },
236
- minLength: a,
237
- maxLength: o,
238
- onChange: E,
239
- "aria-invalid": !!r,
240
- "aria-describedby": r ? `${b}-error` : void 0,
241
- ...y
242
- }),
243
- T && /* @__PURE__ */ t(C, {
244
- current: w,
245
- min: a,
246
- max: o,
247
- showMin: a !== void 0,
248
- showMax: o !== void 0
249
- }),
250
- r && /* @__PURE__ */ t("p", {
251
- id: `${b}-error`,
252
- className: m("text-xs text-red-600 dark:text-red-400", "mt-1"),
253
- role: "alert",
254
- children: r
255
- })
256
- ]
257
- });
258
- }
269
+ //#region src/components/shared/field.tsx
270
+ var de = ({ fieldId: r, errorId: i, label: a, error: o, required: s = !1, wrapperClassName: c, children: l }) => /* @__PURE__ */ n("div", {
271
+ className: x("w-full", c),
272
+ children: [
273
+ a !== void 0 && (typeof a == "string" ? /* @__PURE__ */ n("label", {
274
+ className: x("text-sm font-medium text-gray-700 dark:text-gray-300", "block mb-1"),
275
+ htmlFor: r,
276
+ children: [a, s && /* @__PURE__ */ t("span", {
277
+ className: "text-red-500 dark:text-red-400 ml-1",
278
+ children: "*"
279
+ })]
280
+ }) : /* @__PURE__ */ n(e, { children: [a, s && /* @__PURE__ */ t("span", {
281
+ className: "text-red-500 dark:text-red-400 ml-1",
282
+ children: "*"
283
+ })] })),
284
+ l,
285
+ /* @__PURE__ */ t(oe, {
286
+ id: i,
287
+ error: o,
288
+ className: "mt-1"
289
+ })
290
+ ]
291
+ });
259
292
  //#endregion
260
293
  //#region src/components/combobox/combobox.tsx
261
- function L({ options: e, label: r, error: i, placeholder: a, noResultsText: o = "No results found", radius: l = "md", unstyled: d = !1, disabled: f = !1, required: p = !1, className: g, wrapperClassName: _, value: v, defaultValue: y = "", onChange: b, id: x = "combobox" }) {
262
- let S = `${x}-${s()}`, C = `${S}-listbox`, [w, T] = u(y), E = v !== void 0, D = E ? v : w, O = e.find((e) => e.value === D), [A, j] = u(""), [M, N] = u(!1), [P, I] = u(!1), [L, R] = u(-1), z = c(() => M ? e.filter((e) => e.label.toLowerCase().includes(A.toLowerCase())) : e, [
294
+ function fe({ options: e, label: r, error: i, placeholder: a, noResultsText: o = "No results found", clearLabel: s = "Clear selection", radius: c = "md", unstyled: l = !1, disabled: u = !1, required: d = !1, className: f, wrapperClassName: p, value: h, defaultValue: _ = "", onChange: v, id: y }) {
295
+ let { fieldId: b, errorId: C } = V(y), w = `${b}-listbox`, [T, E] = H(h, _), D = e.find((e) => e.value === T), [O, k] = g(""), [A, j] = g(!1), [M, N] = g(!1), [P, F] = g(-1), I = m(() => A ? e.filter((e) => e.label.toLowerCase().includes(O.toLowerCase())) : e, [
263
296
  e,
264
- M,
265
- A
266
- ]), B = P ? A : O?.label ?? "", V = () => {
267
- f || (j(O?.label ?? ""), N(!1), I(!0), R(-1));
268
- }, H = () => {
269
- I(!1), N(!1), R(-1);
270
- }, U = (e) => {
271
- E || T(e.value), b?.(e.value), H();
272
- }, W = () => {
273
- E || T(""), b?.(""), j("");
274
- }, G = (e) => {
275
- j(e.target.value), N(!0), I(!0), R(0);
276
- }, K = (e) => {
277
- z.length !== 0 && R((t) => {
297
+ A,
298
+ O
299
+ ]), L = M ? O : D?.label ?? "", R = () => {
300
+ u || (k(D?.label ?? ""), j(!1), N(!0), F(-1));
301
+ }, z = () => {
302
+ N(!1), j(!1), F(-1);
303
+ }, ee = (e) => {
304
+ E(e.value), v?.(e.value), z();
305
+ }, te = () => {
306
+ E(""), v?.(""), k("");
307
+ }, ne = (e) => {
308
+ k(e.target.value), j(!0), N(!0), F(0);
309
+ }, re = (e) => {
310
+ I.length !== 0 && F((t) => {
278
311
  let n = t + e;
279
- return n < 0 ? z.length - 1 : n >= z.length ? 0 : n;
312
+ return n < 0 ? I.length - 1 : n >= I.length ? 0 : n;
280
313
  });
281
- }, q = (e) => {
314
+ }, ie = (e) => {
282
315
  if (e.key === "ArrowDown") {
283
- e.preventDefault(), P ? K(1) : V();
316
+ e.preventDefault(), M ? re(1) : R();
284
317
  return;
285
318
  }
286
319
  if (e.key === "ArrowUp") {
287
- e.preventDefault(), P ? K(-1) : V();
320
+ e.preventDefault(), M ? re(-1) : R();
288
321
  return;
289
322
  }
290
323
  if (e.key === "Enter") {
291
- if (!P) return;
324
+ if (!M) return;
292
325
  e.preventDefault();
293
- let t = z[L];
294
- t && U(t);
326
+ let t = I[P];
327
+ t && ee(t);
295
328
  return;
296
329
  }
297
330
  if (e.key === "Escape") {
298
- if (!P) return;
299
- e.preventDefault(), H();
331
+ if (!M) return;
332
+ e.preventDefault(), z();
300
333
  }
301
- }, ee = P && L >= 0 ? `${C}-option-${L}` : void 0;
302
- return /* @__PURE__ */ n("div", {
303
- className: m("w-full", _),
304
- children: [
305
- typeof r == "string" ? /* @__PURE__ */ n("label", {
306
- className: m(k, "block mb-1"),
307
- htmlFor: S,
308
- children: [r, p && /* @__PURE__ */ t("span", {
309
- className: "text-red-500 dark:text-red-400 ml-1",
310
- children: "*"
311
- })]
312
- }) : r,
313
- /* @__PURE__ */ n("div", {
314
- className: "relative",
315
- children: [
316
- !d && /* @__PURE__ */ t("span", {
317
- className: "i-mdi-magnify absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 dark:text-gray-500 pointer-events-none",
334
+ }, ae = M && P >= 0 ? `${w}-option-${P}` : void 0;
335
+ return /* @__PURE__ */ t(de, {
336
+ fieldId: b,
337
+ errorId: C,
338
+ label: r,
339
+ error: i,
340
+ required: d,
341
+ wrapperClassName: p,
342
+ children: /* @__PURE__ */ n("div", {
343
+ className: "relative",
344
+ children: [
345
+ !l && /* @__PURE__ */ t("span", {
346
+ className: "i-mdi-magnify absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 dark:text-gray-500 pointer-events-none",
347
+ "aria-hidden": !0
348
+ }),
349
+ /* @__PURE__ */ t("input", {
350
+ id: b,
351
+ role: "combobox",
352
+ type: "text",
353
+ autoComplete: "off",
354
+ disabled: u,
355
+ placeholder: a,
356
+ value: L,
357
+ onChange: ne,
358
+ onFocus: R,
359
+ onBlur: z,
360
+ onKeyDown: ie,
361
+ "aria-expanded": M,
362
+ "aria-controls": w,
363
+ "aria-autocomplete": "list",
364
+ "aria-activedescendant": ae,
365
+ "aria-invalid": !!i,
366
+ "aria-describedby": i ? C : void 0,
367
+ className: x("w-full disabled:opacity-50 disabled:cursor-not-allowed", !l && [
368
+ B,
369
+ S[c],
370
+ "pl-9 pr-8 py-2 text-sm"
371
+ ], !l && i && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), f)
372
+ }),
373
+ !l && D && !u && /* @__PURE__ */ t("button", {
374
+ type: "button",
375
+ "aria-label": s,
376
+ onMouseDown: (e) => e.preventDefault(),
377
+ onClick: te,
378
+ className: "absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300",
379
+ children: /* @__PURE__ */ t("span", {
380
+ className: "i-mdi-close block w-4 h-4",
318
381
  "aria-hidden": !0
319
- }),
320
- /* @__PURE__ */ t("input", {
321
- id: S,
322
- role: "combobox",
323
- type: "text",
324
- autoComplete: "off",
325
- disabled: f,
326
- placeholder: a,
327
- value: B,
328
- onChange: G,
329
- onFocus: V,
330
- onBlur: H,
331
- onKeyDown: q,
332
- "aria-expanded": P,
333
- "aria-controls": C,
334
- "aria-autocomplete": "list",
335
- "aria-activedescendant": ee,
336
- "aria-invalid": !!i,
337
- "aria-describedby": i ? `${S}-error` : void 0,
338
- className: m("w-full disabled:opacity-50 disabled:cursor-not-allowed", !d && [
339
- F,
340
- h[l],
341
- "pl-9 pr-8 py-2 text-sm"
342
- ], !d && i && m("border-red-500 dark:border-red-400", "focus:ring-red-500"), g)
343
- }),
344
- !d && O && !f && /* @__PURE__ */ t("button", {
345
- type: "button",
346
- "aria-label": "Clear selection",
347
- onMouseDown: (e) => e.preventDefault(),
348
- onClick: W,
349
- className: "absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300",
350
- children: /* @__PURE__ */ t("span", {
351
- className: "i-mdi-close block w-4 h-4",
352
- "aria-hidden": !0
353
- })
354
- }),
355
- P && /* @__PURE__ */ t("ul", {
356
- id: C,
357
- role: "listbox",
358
- className: m("absolute z-10 mt-1 w-full max-h-60 overflow-auto py-1 text-sm shadow-lg", !d && [
359
- "border",
360
- "bg-white dark:bg-gray-900",
361
- "border-gray-100 dark:border-gray-800",
362
- h[l]
363
- ]),
364
- children: z.length === 0 ? /* @__PURE__ */ t("li", {
365
- className: "px-3 py-2 text-gray-500 dark:text-gray-400",
366
- children: o
367
- }) : z.map((e, n) => /* @__PURE__ */ t("li", {
368
- id: `${C}-option-${n}`,
369
- role: "option",
370
- "aria-selected": e.value === D,
371
- onMouseDown: (e) => e.preventDefault(),
372
- onClick: () => U(e),
373
- className: m("px-3 py-2 cursor-pointer text-gray-900 dark:text-gray-100", n === L ? "bg-blue-50 dark:bg-blue-900/40" : "hover:bg-gray-50 dark:hover:bg-gray-800/60", e.value === D && "font-medium"),
374
- children: e.label
375
- }, e.value))
376
382
  })
377
- ]
378
- }),
379
- i && /* @__PURE__ */ t("p", {
380
- id: `${S}-error`,
381
- className: m("text-xs text-red-600 dark:text-red-400", "mt-1"),
382
- role: "alert",
383
- children: i
383
+ }),
384
+ M && /* @__PURE__ */ t("ul", {
385
+ id: w,
386
+ role: "listbox",
387
+ className: x("absolute z-10 mt-1 w-full max-h-60 overflow-auto py-1 text-sm shadow-lg", !l && [
388
+ "border",
389
+ "bg-white dark:bg-gray-900",
390
+ "border-gray-100 dark:border-gray-800",
391
+ S[c]
392
+ ]),
393
+ children: I.length === 0 ? /* @__PURE__ */ t("li", {
394
+ className: "px-3 py-2 text-gray-500 dark:text-gray-400",
395
+ children: o
396
+ }) : I.map((e, n) => /* @__PURE__ */ t("li", {
397
+ id: `${w}-option-${n}`,
398
+ role: "option",
399
+ "aria-selected": e.value === T,
400
+ onMouseDown: (e) => e.preventDefault(),
401
+ onClick: () => ee(e),
402
+ className: x("px-3 py-2 cursor-pointer text-gray-900 dark:text-gray-100", n === P ? "bg-blue-50 dark:bg-blue-900/40" : "hover:bg-gray-50 dark:hover:bg-gray-800/60", e.value === T && "font-medium"),
403
+ children: e.label
404
+ }, e.value))
405
+ })
406
+ ]
407
+ })
408
+ });
409
+ }
410
+ //#endregion
411
+ //#region node_modules/.pnpm/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
412
+ var pe = Math.min, U = Math.max, me = Math.round, he = Math.floor, W = (e) => ({
413
+ x: e,
414
+ y: e
415
+ }), ge = {
416
+ left: "right",
417
+ right: "left",
418
+ bottom: "top",
419
+ top: "bottom"
420
+ };
421
+ function _e(e, t, n) {
422
+ return U(e, pe(t, n));
423
+ }
424
+ function ve(e, t) {
425
+ return typeof e == "function" ? e(t) : e;
426
+ }
427
+ function ye(e) {
428
+ return e.split("-")[0];
429
+ }
430
+ function be(e) {
431
+ return e.split("-")[1];
432
+ }
433
+ function xe(e) {
434
+ return e === "x" ? "y" : "x";
435
+ }
436
+ function Se(e) {
437
+ return e === "y" ? "height" : "width";
438
+ }
439
+ function G(e) {
440
+ let t = e[0];
441
+ return t === "t" || t === "b" ? "y" : "x";
442
+ }
443
+ function Ce(e) {
444
+ return xe(G(e));
445
+ }
446
+ function we(e, t, n) {
447
+ n === void 0 && (n = !1);
448
+ let r = be(e), i = Ce(e), a = Se(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
449
+ return t.reference[a] > t.floating[a] && (o = Ne(o)), [o, Ne(o)];
450
+ }
451
+ function Te(e) {
452
+ let t = Ne(e);
453
+ return [
454
+ Ee(e),
455
+ t,
456
+ Ee(t)
457
+ ];
458
+ }
459
+ function Ee(e) {
460
+ return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
461
+ }
462
+ var De = ["left", "right"], Oe = ["right", "left"], ke = ["top", "bottom"], Ae = ["bottom", "top"];
463
+ function je(e, t, n) {
464
+ switch (e) {
465
+ case "top":
466
+ case "bottom": return n ? t ? Oe : De : t ? De : Oe;
467
+ case "left":
468
+ case "right": return t ? ke : Ae;
469
+ default: return [];
470
+ }
471
+ }
472
+ function Me(e, t, n, r) {
473
+ let i = be(e), a = je(ye(e), n === "start", r);
474
+ return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(Ee)))), a;
475
+ }
476
+ function Ne(e) {
477
+ let t = ye(e);
478
+ return ge[t] + e.slice(t.length);
479
+ }
480
+ function Pe(e) {
481
+ return {
482
+ top: e.top ?? 0,
483
+ right: e.right ?? 0,
484
+ bottom: e.bottom ?? 0,
485
+ left: e.left ?? 0
486
+ };
487
+ }
488
+ function Fe(e) {
489
+ return typeof e == "number" ? {
490
+ top: e,
491
+ right: e,
492
+ bottom: e,
493
+ left: e
494
+ } : Pe(e);
495
+ }
496
+ function Ie(e) {
497
+ let { x: t, y: n, width: r, height: i } = e;
498
+ return {
499
+ width: r,
500
+ height: i,
501
+ top: n,
502
+ left: t,
503
+ right: t + r,
504
+ bottom: n + i,
505
+ x: t,
506
+ y: n
507
+ };
508
+ }
509
+ //#endregion
510
+ //#region node_modules/.pnpm/@floating-ui+core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
511
+ function Le(e, t, n) {
512
+ let { reference: r, floating: i } = e, a = G(t), o = Ce(t), s = Se(o), c = ye(t), l = a === "y", u = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, f = r[s] / 2 - i[s] / 2, p;
513
+ switch (c) {
514
+ case "top":
515
+ p = {
516
+ x: u,
517
+ y: r.y - i.height
518
+ };
519
+ break;
520
+ case "bottom":
521
+ p = {
522
+ x: u,
523
+ y: r.y + r.height
524
+ };
525
+ break;
526
+ case "right":
527
+ p = {
528
+ x: r.x + r.width,
529
+ y: d
530
+ };
531
+ break;
532
+ case "left":
533
+ p = {
534
+ x: r.x - i.width,
535
+ y: d
536
+ };
537
+ break;
538
+ default: p = {
539
+ x: r.x,
540
+ y: r.y
541
+ };
542
+ }
543
+ let m = be(t);
544
+ return m && (p[o] += f * (m === "end" ? 1 : -1) * (n && l ? -1 : 1)), p;
545
+ }
546
+ async function Re(e, t) {
547
+ t === void 0 && (t = {});
548
+ let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } = ve(t, e), p = Fe(f), m = o[d ? u === "floating" ? "reference" : "floating" : u], h = Ie(await i.getClippingRect({
549
+ element: await (i.isElement == null ? void 0 : i.isElement(m)) ?? !0 ? m : m.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(o.floating)),
550
+ boundary: c,
551
+ rootBoundary: l,
552
+ strategy: s
553
+ })), g = u === "floating" ? {
554
+ x: n,
555
+ y: r,
556
+ width: a.floating.width,
557
+ height: a.floating.height
558
+ } : a.reference, _ = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(o.floating)), v = await (i.isElement == null ? void 0 : i.isElement(_)) && await (i.getScale == null ? void 0 : i.getScale(_)) || {
559
+ x: 1,
560
+ y: 1
561
+ }, y = Ie(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
562
+ elements: o,
563
+ rect: g,
564
+ offsetParent: _,
565
+ strategy: s
566
+ }) : g);
567
+ return {
568
+ top: (h.top - y.top + p.top) / v.y,
569
+ bottom: (y.bottom - h.bottom + p.bottom) / v.y,
570
+ left: (h.left - y.left + p.left) / v.x,
571
+ right: (y.right - h.right + p.right) / v.x
572
+ };
573
+ }
574
+ var ze = 50, Be = async (e, t, n) => {
575
+ let { placement: r = "bottom", strategy: i = "absolute", middleware: a = [], platform: o } = n, s = o.detectOverflow ? o : {
576
+ ...o,
577
+ detectOverflow: Re
578
+ }, c = await (o.isRTL == null ? void 0 : o.isRTL(t)), l = await o.getElementRects({
579
+ reference: e,
580
+ floating: t,
581
+ strategy: i
582
+ }), { x: u, y: d } = Le(l, r, c), f = r, p = 0, m = {};
583
+ for (let n = 0; n < a.length; n++) {
584
+ let h = a[n];
585
+ if (!h) continue;
586
+ let { name: g, fn: _ } = h, { x: v, y, data: b, reset: x } = await _({
587
+ x: u,
588
+ y: d,
589
+ initialPlacement: r,
590
+ placement: f,
591
+ strategy: i,
592
+ middlewareData: m,
593
+ rects: l,
594
+ platform: s,
595
+ elements: {
596
+ reference: e,
597
+ floating: t
598
+ }
599
+ });
600
+ u = v ?? u, d = y ?? d, m[g] = {
601
+ ...m[g],
602
+ ...b
603
+ }, x && p < ze && (p++, typeof x == "object" && (x.placement && (f = x.placement), x.rects && (l = x.rects === !0 ? await o.getElementRects({
604
+ reference: e,
605
+ floating: t,
606
+ strategy: i
607
+ }) : x.rects), {x: u, y: d} = Le(l, f, c)), n = -1);
608
+ }
609
+ return {
610
+ x: u,
611
+ y: d,
612
+ placement: f,
613
+ strategy: i,
614
+ middlewareData: m
615
+ };
616
+ }, Ve = (e) => ({
617
+ name: "arrow",
618
+ options: e,
619
+ async fn(t) {
620
+ let { x: n, y: r, placement: i, rects: a, platform: o, elements: s, middlewareData: c } = t, { element: l, padding: u = 0 } = ve(e, t) || {};
621
+ if (l == null) return {};
622
+ let d = Fe(u), f = {
623
+ x: n,
624
+ y: r
625
+ }, p = Ce(i), m = Se(p), h = await o.getDimensions(l), g = p === "y", _ = g ? "top" : "left", v = g ? "bottom" : "right", y = g ? "clientHeight" : "clientWidth", b = a.reference[m] + a.reference[p] - f[p] - a.floating[m], x = f[p] - a.reference[p], S = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l)), C = S ? S[y] : 0;
626
+ (!C || !await (o.isElement == null ? void 0 : o.isElement(S))) && (C = s.floating[y] || a.floating[m]);
627
+ let w = b / 2 - x / 2, T = C / 2 - h[m] / 2 - 1, E = pe(d[_], T), D = pe(d[v], T), O = C - h[m] - D, k = C / 2 - h[m] / 2 + w, A = _e(E, k, O), j = !c.arrow && be(i) != null && k !== A && a.reference[m] / 2 - (k < E ? E : D) - h[m] / 2 < 0, M = j ? k < E ? k - E : k - O : 0;
628
+ return {
629
+ [p]: f[p] + M,
630
+ data: {
631
+ [p]: A,
632
+ centerOffset: k - A - M,
633
+ ...j && { alignmentOffset: M }
634
+ },
635
+ reset: j
636
+ };
637
+ }
638
+ }), He = function(e) {
639
+ return e === void 0 && (e = {}), {
640
+ name: "flip",
641
+ options: e,
642
+ async fn(t) {
643
+ var n;
644
+ let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ...h } = ve(e, t);
645
+ if ((n = i.arrow) != null && n.alignmentOffset) return {};
646
+ let g = ye(r), _ = G(o), v = ye(o) === o, y = await (s.isRTL == null ? void 0 : s.isRTL(c.floating)), b = d || (v || !m ? [Ne(o)] : Te(o)), x = p !== "none";
647
+ !d && x && b.push(...Me(o, m, p, y));
648
+ let S = [o, ...b], C = await s.detectOverflow(t, h), w = [], T = i.flip?.overflows || [];
649
+ if (l && w.push(C[g]), u) {
650
+ let e = we(r, a, y);
651
+ w.push(C[e[0]], C[e[1]]);
652
+ }
653
+ if (T = [...T, {
654
+ placement: r,
655
+ overflows: w
656
+ }], !w.every((e) => e <= 0)) {
657
+ let e = (i.flip?.index || 0) + 1, t = S[e];
658
+ if (t && (u !== "alignment" || _ === G(t) || T.every((e) => G(e.placement) !== _ || e.overflows[0] > 0))) return {
659
+ data: {
660
+ index: e,
661
+ overflows: T
662
+ },
663
+ reset: { placement: t }
664
+ };
665
+ let n = T.filter((e) => e.overflows[0] <= 0).sort((e, t) => e.overflows[1] - t.overflows[1])[0]?.placement;
666
+ if (!n) switch (f) {
667
+ case "bestFit": {
668
+ let e = T.filter((e) => {
669
+ if (x) {
670
+ let t = G(e.placement);
671
+ return t === _ || t === "y";
672
+ }
673
+ return !0;
674
+ }).map((e) => [e.placement, e.overflows.filter((e) => e > 0).reduce((e, t) => e + t, 0)]).sort((e, t) => e[1] - t[1])[0]?.[0];
675
+ e && (n = e);
676
+ break;
677
+ }
678
+ case "initialPlacement": n = o;
679
+ }
680
+ if (r !== n) return { reset: { placement: n } };
681
+ }
682
+ return {};
683
+ }
684
+ };
685
+ }, Ue = /*#__PURE__*/ new Set(["left", "top"]);
686
+ async function We(e, t) {
687
+ let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = ye(n), s = be(n), c = G(n) === "y", l = Ue.has(o) ? -1 : 1, u = a && c ? -1 : 1, d = ve(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: m } = typeof d == "number" ? {
688
+ mainAxis: d,
689
+ crossAxis: 0,
690
+ alignmentAxis: null
691
+ } : {
692
+ mainAxis: d.mainAxis || 0,
693
+ crossAxis: d.crossAxis || 0,
694
+ alignmentAxis: d.alignmentAxis
695
+ };
696
+ return s && typeof m == "number" && (p = s === "end" ? m * -1 : m), c ? {
697
+ x: p * u,
698
+ y: f * l
699
+ } : {
700
+ x: f * l,
701
+ y: p * u
702
+ };
703
+ }
704
+ var Ge = function(e) {
705
+ return e === void 0 && (e = 0), {
706
+ name: "offset",
707
+ options: e,
708
+ async fn(t) {
709
+ var n;
710
+ let { x: r, y: i, placement: a, middlewareData: o } = t, s = await We(t, e);
711
+ return a === o.offset?.placement && (n = o.arrow) != null && n.alignmentOffset ? {} : {
712
+ x: r + s.x,
713
+ y: i + s.y,
714
+ data: {
715
+ ...s,
716
+ placement: a
717
+ }
718
+ };
719
+ }
720
+ };
721
+ }, Ke = function(e) {
722
+ return e === void 0 && (e = {}), {
723
+ name: "shift",
724
+ options: e,
725
+ async fn(t) {
726
+ let { x: n, y: r, placement: i, platform: a } = t, { mainAxis: o = !0, crossAxis: s = !1, limiter: c = { fn: (e) => {
727
+ let { x: t, y: n } = e;
728
+ return {
729
+ x: t,
730
+ y: n
731
+ };
732
+ } }, ...l } = ve(e, t), u = {
733
+ x: n,
734
+ y: r
735
+ }, d = await a.detectOverflow(t, l), f = G(i), p = xe(f), m = u[p], h = u[f], g = (e, t) => _e(t + d[e === "y" ? "top" : "left"], t, t - d[e === "y" ? "bottom" : "right"]);
736
+ o && (m = g(p, m)), s && (h = g(f, h));
737
+ let _ = c.fn({
738
+ ...t,
739
+ [p]: m,
740
+ [f]: h
741
+ });
742
+ return {
743
+ ..._,
744
+ data: {
745
+ x: _.x - n,
746
+ y: _.y - r,
747
+ enabled: {
748
+ [p]: o,
749
+ [f]: s
750
+ }
751
+ }
752
+ };
753
+ }
754
+ };
755
+ };
756
+ //#endregion
757
+ //#region node_modules/.pnpm/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
758
+ function qe() {
759
+ return typeof window < "u";
760
+ }
761
+ function Je(e) {
762
+ return Ye(e) ? (e.nodeName || "").toLowerCase() : "#document";
763
+ }
764
+ function K(e) {
765
+ var t;
766
+ return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
767
+ }
768
+ function q(e) {
769
+ return ((Ye(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
770
+ }
771
+ function Ye(e) {
772
+ return qe() ? e instanceof Node || e instanceof K(e).Node : !1;
773
+ }
774
+ function J(e) {
775
+ return qe() ? e instanceof Element || e instanceof K(e).Element : !1;
776
+ }
777
+ function Y(e) {
778
+ return qe() ? e instanceof HTMLElement || e instanceof K(e).HTMLElement : !1;
779
+ }
780
+ function Xe(e) {
781
+ return !qe() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof K(e).ShadowRoot;
782
+ }
783
+ function Ze(e) {
784
+ let { overflow: t, overflowX: n, overflowY: r, display: i } = Z(e);
785
+ return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && i !== "inline" && i !== "contents";
786
+ }
787
+ function Qe(e) {
788
+ return /^(table|td|th)$/.test(Je(e));
789
+ }
790
+ function $e(e) {
791
+ try {
792
+ if (e.matches(":popover-open")) return !0;
793
+ } catch {}
794
+ try {
795
+ return e.matches(":modal");
796
+ } catch {
797
+ return !1;
798
+ }
799
+ }
800
+ var et = /transform|translate|scale|rotate|perspective|filter/, tt = /paint|layout|strict|content/, X = (e) => !!e && e !== "none", nt;
801
+ function rt(e) {
802
+ let t = J(e) ? Z(e) : e;
803
+ return X(t.transform) || X(t.translate) || X(t.scale) || X(t.rotate) || X(t.perspective) || !at() && (X(t.backdropFilter) || X(t.filter)) || et.test(t.willChange || "") || tt.test(t.contain || "");
804
+ }
805
+ function it(e) {
806
+ let t = Q(e);
807
+ for (; Y(t) && !ot(t);) {
808
+ if (rt(t)) return t;
809
+ if ($e(t)) return null;
810
+ t = Q(t);
811
+ }
812
+ return null;
813
+ }
814
+ function at() {
815
+ return nt ??= typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"), nt;
816
+ }
817
+ function ot(e) {
818
+ return /^(html|body|#document)$/.test(Je(e));
819
+ }
820
+ function Z(e) {
821
+ return K(e).getComputedStyle(e);
822
+ }
823
+ function st(e) {
824
+ return J(e) ? {
825
+ scrollLeft: e.scrollLeft,
826
+ scrollTop: e.scrollTop
827
+ } : {
828
+ scrollLeft: e.scrollX,
829
+ scrollTop: e.scrollY
830
+ };
831
+ }
832
+ function Q(e) {
833
+ if (Je(e) === "html") return e;
834
+ let t = e.assignedSlot || e.parentNode || Xe(e) && e.host || q(e);
835
+ return Xe(t) ? t.host : t;
836
+ }
837
+ function ct(e) {
838
+ let t = Q(e);
839
+ return ot(t) ? (e.ownerDocument || e).body : Y(t) && Ze(t) ? t : ct(t);
840
+ }
841
+ function lt(e, t, n) {
842
+ t === void 0 && (t = []), n === void 0 && (n = !0);
843
+ let r = ct(e), i = r === e.ownerDocument?.body, a = K(r);
844
+ if (i) {
845
+ let e = ut(a);
846
+ return t.concat(a, a.visualViewport || [], Ze(r) ? r : [], e && n ? lt(e) : []);
847
+ }
848
+ return t.concat(r, lt(r, [], n));
849
+ }
850
+ function ut(e) {
851
+ return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
852
+ }
853
+ //#endregion
854
+ //#region node_modules/.pnpm/@floating-ui+dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
855
+ function dt(e) {
856
+ let t = Z(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = Y(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r, s = me(n) !== a || me(r) !== o;
857
+ return s && (n = a, r = o), {
858
+ width: n,
859
+ height: r,
860
+ $: s
861
+ };
862
+ }
863
+ function ft(e) {
864
+ return J(e) ? e : e.contextElement;
865
+ }
866
+ function pt(e) {
867
+ let t = ft(e);
868
+ if (!Y(t)) return W(1);
869
+ let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = dt(t), o = (a ? me(n.width) : n.width) / r, s = (a ? me(n.height) : n.height) / i;
870
+ return (!o || !Number.isFinite(o)) && (o = 1), (!s || !Number.isFinite(s)) && (s = 1), {
871
+ x: o,
872
+ y: s
873
+ };
874
+ }
875
+ var mt = /*#__PURE__*/ W(0);
876
+ function ht(e) {
877
+ let t = K(e);
878
+ return !at() || !t.visualViewport ? mt : {
879
+ x: t.visualViewport.offsetLeft,
880
+ y: t.visualViewport.offsetTop
881
+ };
882
+ }
883
+ function gt(e, t, n) {
884
+ return t === void 0 && (t = !1), !!n && t && n === K(e);
885
+ }
886
+ function $(e, t, n, r) {
887
+ t === void 0 && (t = !1), n === void 0 && (n = !1);
888
+ let i = e.getBoundingClientRect(), a = ft(e), o = W(1);
889
+ t && (r ? J(r) && (o = pt(r)) : o = pt(e));
890
+ let s = gt(a, n, r) ? ht(a) : W(0), c = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, u = i.width / o.x, d = i.height / o.y;
891
+ if (a && r) {
892
+ let e = K(a), t = J(r) ? K(r) : r, n = e, i = ut(n);
893
+ for (; i && t !== n;) {
894
+ let e = pt(i), t = i.getBoundingClientRect(), r = Z(i), a = t.left + (i.clientLeft + parseFloat(r.paddingLeft)) * e.x, o = t.top + (i.clientTop + parseFloat(r.paddingTop)) * e.y;
895
+ c *= e.x, l *= e.y, u *= e.x, d *= e.y, c += a, l += o, n = K(i), i = ut(n);
896
+ }
897
+ }
898
+ return Ie({
899
+ width: u,
900
+ height: d,
901
+ x: c,
902
+ y: l
903
+ });
904
+ }
905
+ function _t(e, t) {
906
+ let n = st(e).scrollLeft;
907
+ return t ? t.left + n : $(q(e)).left + n;
908
+ }
909
+ function vt(e, t) {
910
+ let n = e.getBoundingClientRect();
911
+ return {
912
+ x: n.left + t.scrollLeft - _t(e, n),
913
+ y: n.top + t.scrollTop
914
+ };
915
+ }
916
+ function yt(e) {
917
+ let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o = q(r), s = t ? $e(t.floating) : !1;
918
+ if (r === o || s && a) return n;
919
+ let c = {
920
+ scrollLeft: 0,
921
+ scrollTop: 0
922
+ }, l = W(1), u = W(0), d = Y(r);
923
+ if ((d || !a) && ((Je(r) !== "body" || Ze(o)) && (c = st(r)), d)) {
924
+ let e = $(r);
925
+ l = pt(r), u.x = e.x + r.clientLeft, u.y = e.y + r.clientTop;
926
+ }
927
+ let f = o && !d && !a ? vt(o, c) : W(0);
928
+ return {
929
+ width: n.width * l.x,
930
+ height: n.height * l.y,
931
+ x: n.x * l.x - c.scrollLeft * l.x + u.x + f.x,
932
+ y: n.y * l.y - c.scrollTop * l.y + u.y + f.y
933
+ };
934
+ }
935
+ function bt(e) {
936
+ return e.getClientRects ? Array.from(e.getClientRects()) : [];
937
+ }
938
+ function xt(e) {
939
+ let t = st(e), n = e.ownerDocument.body, r = U(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), i = U(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight), a = -t.scrollLeft + _t(e), o = -t.scrollTop;
940
+ return Z(n).direction === "rtl" && (a += U(e.clientWidth, n.clientWidth) - r), {
941
+ width: r,
942
+ height: i,
943
+ x: a,
944
+ y: o
945
+ };
946
+ }
947
+ var St = 25;
948
+ function Ct(e, t, n) {
949
+ n === void 0 && (n = "viewport");
950
+ let r = n === "layoutViewport", i = K(e), a = q(e), o = i.visualViewport, s = a.clientWidth, c = a.clientHeight, l = 0, u = 0;
951
+ if (o) {
952
+ let e = !at() || t === "fixed";
953
+ r ? e || (l = -o.offsetLeft, u = -o.offsetTop) : (s = o.width, c = o.height, e && (l = o.offsetLeft, u = o.offsetTop));
954
+ }
955
+ if (_t(a) <= 0) {
956
+ let e = a.ownerDocument, t = e.body, n = getComputedStyle(t), r = e.compatMode === "CSS1Compat" && parseFloat(n.marginLeft) + parseFloat(n.marginRight) || 0, i = Math.abs(a.clientWidth - t.clientWidth - r), o = getComputedStyle(a).scrollbarGutter === "stable both-edges" ? i / 2 : i;
957
+ o <= St && (s -= o);
958
+ }
959
+ return {
960
+ width: s,
961
+ height: c,
962
+ x: l,
963
+ y: u
964
+ };
965
+ }
966
+ function wt(e, t) {
967
+ let n = $(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = pt(e);
968
+ return {
969
+ width: e.clientWidth * a.x,
970
+ height: e.clientHeight * a.y,
971
+ x: i * a.x,
972
+ y: r * a.y
973
+ };
974
+ }
975
+ function Tt(e, t, n) {
976
+ let r;
977
+ if (t === "viewport" || t === "layoutViewport") r = Ct(e, n, t);
978
+ else if (t === "document") r = xt(q(e));
979
+ else if (J(t)) r = wt(t, n);
980
+ else {
981
+ let n = ht(e);
982
+ r = {
983
+ x: t.x - n.x,
984
+ y: t.y - n.y,
985
+ width: t.width,
986
+ height: t.height
987
+ };
988
+ }
989
+ return Ie(r);
990
+ }
991
+ function Et(e, t) {
992
+ let n = t.get(e);
993
+ if (n) return n;
994
+ let r = lt(e, [], !1).filter((e) => J(e) && Je(e) !== "body"), i = null, a = Z(e).position === "fixed", o = a ? Q(e) : e;
995
+ for (; J(o) && !ot(o);) {
996
+ let e = Z(o), t = rt(o), n = i ? i.position : a ? "fixed" : "";
997
+ !t && (n === "fixed" || n === "absolute" && e.position === "static") ? r = r.filter((e) => e !== o) : i = e, o = Q(o);
998
+ }
999
+ return t.set(e, r), r;
1000
+ }
1001
+ function Dt(e) {
1002
+ let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ? $e(t) ? [] : Et(t, this._c) : [].concat(n), r], o = Tt(t, a[0], i), s = o.top, c = o.right, l = o.bottom, u = o.left;
1003
+ for (let e = 1; e < a.length; e++) {
1004
+ let n = Tt(t, a[e], i);
1005
+ s = U(n.top, s), c = pe(n.right, c), l = pe(n.bottom, l), u = U(n.left, u);
1006
+ }
1007
+ return {
1008
+ width: c - u,
1009
+ height: l - s,
1010
+ x: u,
1011
+ y: s
1012
+ };
1013
+ }
1014
+ function Ot(e) {
1015
+ let { width: t, height: n } = dt(e);
1016
+ return {
1017
+ width: t,
1018
+ height: n
1019
+ };
1020
+ }
1021
+ function kt(e, t, n) {
1022
+ let r = Y(t), i = q(t), a = n === "fixed", o = $(e, !0, a, t), s = {
1023
+ scrollLeft: 0,
1024
+ scrollTop: 0
1025
+ }, c = W(0);
1026
+ if ((r || !a) && ((Je(t) !== "body" || Ze(i)) && (s = st(t)), r)) {
1027
+ let e = $(t, !0, a, t);
1028
+ c.x = e.x + t.clientLeft, c.y = e.y + t.clientTop;
1029
+ }
1030
+ !r && i && (c.x = _t(i));
1031
+ let l = i && !r && !a ? vt(i, s) : W(0);
1032
+ return {
1033
+ x: o.left + s.scrollLeft - c.x - l.x,
1034
+ y: o.top + s.scrollTop - c.y - l.y,
1035
+ width: o.width,
1036
+ height: o.height
1037
+ };
1038
+ }
1039
+ function At(e) {
1040
+ return Z(e).position === "static";
1041
+ }
1042
+ function jt(e, t) {
1043
+ if (!Y(e) || Z(e).position === "fixed") return null;
1044
+ if (t) return t(e);
1045
+ let n = e.offsetParent;
1046
+ return q(e) === n && (n = n.ownerDocument.body), n;
1047
+ }
1048
+ function Mt(e, t) {
1049
+ let n = K(e);
1050
+ if ($e(e)) return n;
1051
+ if (!Y(e)) {
1052
+ let t = Q(e);
1053
+ for (; t && !ot(t);) {
1054
+ if (J(t) && !At(t)) return t;
1055
+ t = Q(t);
1056
+ }
1057
+ return n;
1058
+ }
1059
+ let r = jt(e, t);
1060
+ for (; r && Qe(r) && At(r);) r = jt(r, t);
1061
+ return r && ot(r) && At(r) && !rt(r) ? n : r || it(e) || n;
1062
+ }
1063
+ var Nt = async function(e) {
1064
+ let t = this.getOffsetParent || Mt, n = this.getDimensions, r = await n(e.floating);
1065
+ return {
1066
+ reference: kt(e.reference, await t(e.floating), e.strategy),
1067
+ floating: {
1068
+ x: 0,
1069
+ y: 0,
1070
+ width: r.width,
1071
+ height: r.height
1072
+ }
1073
+ };
1074
+ };
1075
+ function Pt(e) {
1076
+ return Z(e).direction === "rtl";
1077
+ }
1078
+ var Ft = {
1079
+ convertOffsetParentRelativeRectToViewportRelativeRect: yt,
1080
+ getDocumentElement: q,
1081
+ getClippingRect: Dt,
1082
+ getOffsetParent: Mt,
1083
+ getElementRects: Nt,
1084
+ getClientRects: bt,
1085
+ getDimensions: Ot,
1086
+ getScale: pt,
1087
+ isElement: J,
1088
+ isRTL: Pt
1089
+ };
1090
+ function It(e, t) {
1091
+ return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
1092
+ }
1093
+ function Lt(e, t, n) {
1094
+ let r = null, i, a = q(e);
1095
+ function o() {
1096
+ var e;
1097
+ clearTimeout(i), (e = r) == null || e.disconnect(), r = null;
1098
+ }
1099
+ function s(n, c) {
1100
+ n === void 0 && (n = !1), c === void 0 && (c = 1), o();
1101
+ let l = e.getBoundingClientRect(), { left: u, top: d, width: f, height: p } = l;
1102
+ if (n || t(), !f || !p) return;
1103
+ let m = he(d), h = he(a.clientWidth - (u + f)), g = he(a.clientHeight - (d + p)), _ = he(u), v = {
1104
+ rootMargin: -m + "px " + -h + "px " + -g + "px " + -_ + "px",
1105
+ threshold: U(0, pe(1, c)) || 1
1106
+ }, y = !0;
1107
+ function b(t) {
1108
+ let n = t[0].intersectionRatio;
1109
+ if (!It(l, e.getBoundingClientRect())) return s();
1110
+ if (n !== c) {
1111
+ if (!y) return s();
1112
+ n ? s(!1, n) : i = setTimeout(() => {
1113
+ s(!1, 1e-7);
1114
+ }, 1e3);
1115
+ }
1116
+ y = !1;
1117
+ }
1118
+ try {
1119
+ r = new IntersectionObserver(b, {
1120
+ ...v,
1121
+ root: a.ownerDocument
1122
+ });
1123
+ } catch {
1124
+ r = new IntersectionObserver(b, v);
1125
+ }
1126
+ r.observe(e);
1127
+ }
1128
+ let c = K(e), l = () => s(n);
1129
+ return c.addEventListener("resize", l), s(!0), () => {
1130
+ c.removeEventListener("resize", l), o();
1131
+ };
1132
+ }
1133
+ function Rt(e, t, n, r) {
1134
+ r === void 0 && (r = {});
1135
+ let { ancestorScroll: i = !0, ancestorResize: a = !0, elementResize: o = typeof ResizeObserver == "function", layoutShift: s = typeof IntersectionObserver == "function", animationFrame: c = !1 } = r, l = ft(e), u = i || a ? [...l ? lt(l) : [], ...t ? lt(t) : []] : [];
1136
+ u.forEach((e) => {
1137
+ i && e.addEventListener("scroll", n), a && e.addEventListener("resize", n);
1138
+ });
1139
+ let d = l && s ? Lt(l, n, a) : null, f = -1, p = null;
1140
+ o && (p = new ResizeObserver((e) => {
1141
+ let [r] = e;
1142
+ r && r.target === l && p && t && (p.unobserve(t), cancelAnimationFrame(f), f = requestAnimationFrame(() => {
1143
+ var e;
1144
+ (e = p) == null || e.observe(t);
1145
+ })), n();
1146
+ }), l && !c && p.observe(l), t && p.observe(t));
1147
+ let m, h = c ? $(e) : null;
1148
+ c && g();
1149
+ function g() {
1150
+ let t = $(e);
1151
+ h && !It(h, t) && n(), h = t, m = requestAnimationFrame(g);
1152
+ }
1153
+ return n(), () => {
1154
+ var e;
1155
+ u.forEach((e) => {
1156
+ i && e.removeEventListener("scroll", n), a && e.removeEventListener("resize", n);
1157
+ }), d?.(), (e = p) == null || e.disconnect(), p = null, c && cancelAnimationFrame(m);
1158
+ };
1159
+ }
1160
+ var zt = Ge, Bt = Ke, Vt = He, Ht = Ve, Ut = (e, t, n) => {
1161
+ let r = /* @__PURE__ */ new Map(), i = n ?? {}, a = {
1162
+ ...Ft,
1163
+ ...i.platform,
1164
+ _c: r
1165
+ };
1166
+ return Be(e, t, {
1167
+ ...i,
1168
+ platform: a
1169
+ });
1170
+ }, Wt = typeof document < "u" ? p : function() {};
1171
+ function Gt(e, t) {
1172
+ if (e === t) return !0;
1173
+ if (typeof e != typeof t) return !1;
1174
+ if (typeof e == "function" && e.toString() === t.toString()) return !0;
1175
+ let n, r, i;
1176
+ if (e && t && typeof e == "object") {
1177
+ if (Array.isArray(e)) {
1178
+ if (n = e.length, n !== t.length) return !1;
1179
+ for (r = n; r-- !== 0;) if (!Gt(e[r], t[r])) return !1;
1180
+ return !0;
1181
+ }
1182
+ if (i = Object.keys(e), n = i.length, n !== Object.keys(t).length) return !1;
1183
+ for (r = n; r-- !== 0;) if (!{}.hasOwnProperty.call(t, i[r])) return !1;
1184
+ for (r = n; r-- !== 0;) {
1185
+ let n = i[r];
1186
+ if (!(n === "_owner" && e.$$typeof) && !Gt(e[n], t[n])) return !1;
1187
+ }
1188
+ return !0;
1189
+ }
1190
+ return e !== e && t !== t;
1191
+ }
1192
+ function Kt(e) {
1193
+ return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1194
+ }
1195
+ function qt(e, t) {
1196
+ let n = Kt(e);
1197
+ return Math.round(t * n) / n;
1198
+ }
1199
+ function Jt(e) {
1200
+ let t = r.useRef(e);
1201
+ return Wt(() => {
1202
+ t.current = e;
1203
+ }), t;
1204
+ }
1205
+ function Yt(e) {
1206
+ e === void 0 && (e = {});
1207
+ let { placement: t = "bottom", strategy: n = "absolute", middleware: i = [], platform: a, elements: { reference: o, floating: s } = {}, transform: c = !0, whileElementsMounted: l, open: u } = e, [d, f] = r.useState({
1208
+ x: 0,
1209
+ y: 0,
1210
+ strategy: n,
1211
+ placement: t,
1212
+ middlewareData: {},
1213
+ isPositioned: !1
1214
+ }), [p, m] = r.useState(i);
1215
+ Gt(p, i) || m(i);
1216
+ let [h, g] = r.useState(null), [_, y] = r.useState(null), b = r.useCallback((e) => {
1217
+ e !== w.current && (w.current = e, g(e));
1218
+ }, []), x = r.useCallback((e) => {
1219
+ e !== T.current && (T.current = e, y(e));
1220
+ }, []), S = o || h, C = s || _, w = r.useRef(null), T = r.useRef(null), E = r.useRef(d), D = l != null, O = Jt(l), k = Jt(a), A = Jt(u), j = r.useCallback(() => {
1221
+ if (!w.current || !T.current) return;
1222
+ let e = {
1223
+ placement: t,
1224
+ strategy: n,
1225
+ middleware: p
1226
+ };
1227
+ k.current && (e.platform = k.current), Ut(w.current, T.current, e).then((e) => {
1228
+ let t = {
1229
+ ...e,
1230
+ isPositioned: A.current !== !1
1231
+ };
1232
+ M.current && !Gt(E.current, t) && (E.current = t, v.flushSync(() => {
1233
+ f(t);
1234
+ }));
1235
+ });
1236
+ }, [
1237
+ p,
1238
+ t,
1239
+ n,
1240
+ k,
1241
+ A
1242
+ ]);
1243
+ Wt(() => {
1244
+ u === !1 && E.current.isPositioned && (E.current.isPositioned = !1, f((e) => ({
1245
+ ...e,
1246
+ isPositioned: !1
1247
+ })));
1248
+ }, [u]);
1249
+ let M = r.useRef(!1);
1250
+ Wt(() => (M.current = !0, () => {
1251
+ M.current = !1;
1252
+ }), []), Wt(() => {
1253
+ if (S && (w.current = S), C && (T.current = C), S && C) {
1254
+ if (O.current) return O.current(S, C, j);
1255
+ j();
1256
+ }
1257
+ }, [
1258
+ S,
1259
+ C,
1260
+ j,
1261
+ O,
1262
+ D
1263
+ ]);
1264
+ let N = r.useMemo(() => ({
1265
+ reference: w,
1266
+ floating: T,
1267
+ setReference: b,
1268
+ setFloating: x
1269
+ }), [b, x]), P = r.useMemo(() => ({
1270
+ reference: S,
1271
+ floating: C
1272
+ }), [S, C]), F = r.useMemo(() => {
1273
+ let e = {
1274
+ position: n,
1275
+ left: 0,
1276
+ top: 0
1277
+ };
1278
+ if (!P.floating) return e;
1279
+ let t = qt(P.floating, d.x), r = qt(P.floating, d.y);
1280
+ return c ? {
1281
+ ...e,
1282
+ transform: "translate(" + t + "px, " + r + "px)",
1283
+ ...Kt(P.floating) >= 1.5 && { willChange: "transform" }
1284
+ } : {
1285
+ position: n,
1286
+ left: t,
1287
+ top: r
1288
+ };
1289
+ }, [
1290
+ n,
1291
+ c,
1292
+ P.floating,
1293
+ d.x,
1294
+ d.y
1295
+ ]);
1296
+ return r.useMemo(() => ({
1297
+ ...d,
1298
+ update: j,
1299
+ refs: N,
1300
+ elements: P,
1301
+ floatingStyles: F
1302
+ }), [
1303
+ d,
1304
+ j,
1305
+ N,
1306
+ P,
1307
+ F
1308
+ ]);
1309
+ }
1310
+ var Xt = (e) => {
1311
+ function t(e) {
1312
+ return {}.hasOwnProperty.call(e, "current");
1313
+ }
1314
+ return {
1315
+ name: "arrow",
1316
+ options: e,
1317
+ fn(n) {
1318
+ let { element: r, padding: i } = typeof e == "function" ? e(n) : e;
1319
+ return r && t(r) ? r.current == null ? {} : Ht({
1320
+ element: r.current,
1321
+ padding: i
1322
+ }).fn(n) : r ? Ht({
1323
+ element: r,
1324
+ padding: i
1325
+ }).fn(n) : {};
1326
+ }
1327
+ };
1328
+ }, Zt = (e, t) => {
1329
+ let n = zt(e);
1330
+ return {
1331
+ name: n.name,
1332
+ fn: n.fn,
1333
+ options: [e, t]
1334
+ };
1335
+ }, Qt = (e, t) => {
1336
+ let n = Bt(e);
1337
+ return {
1338
+ name: n.name,
1339
+ fn: n.fn,
1340
+ options: [e, t]
1341
+ };
1342
+ }, $t = (e, t) => {
1343
+ let n = Vt(e);
1344
+ return {
1345
+ name: n.name,
1346
+ fn: n.fn,
1347
+ options: [e, t]
1348
+ };
1349
+ }, en = (e, t) => {
1350
+ let n = Xt(e);
1351
+ return {
1352
+ name: n.name,
1353
+ fn: n.fn,
1354
+ options: [e, t]
1355
+ };
1356
+ }, tn = o(null);
1357
+ function nn() {
1358
+ return u(tn);
1359
+ }
1360
+ //#endregion
1361
+ //#region src/components/menu/menu_surface.tsx
1362
+ var rn = "[role=\"menuitem\"]:not(:disabled)";
1363
+ function an(e, t) {
1364
+ let n = Array.from(e.querySelectorAll(rn));
1365
+ n.length !== 0 && n[(t % n.length + n.length) % n.length]?.focus({ preventScroll: !0 });
1366
+ }
1367
+ function on({ setFloating: r, floatingStyles: i, isVisible: a, isPositioned: o, radius: s, onClose: c, children: l }) {
1368
+ let u = h(null);
1369
+ return d(() => {
1370
+ if (!o) return;
1371
+ let e = u.current;
1372
+ e && e.querySelector(rn)?.focus({ preventScroll: !0 });
1373
+ }, [o]), y(/* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("div", {
1374
+ className: "fixed inset-0 z-40",
1375
+ onClick: c,
1376
+ "aria-hidden": "true"
1377
+ }), /* @__PURE__ */ t("div", {
1378
+ ref: r,
1379
+ style: i,
1380
+ className: "z-50",
1381
+ children: /* @__PURE__ */ t("div", {
1382
+ ref: u,
1383
+ role: "menu",
1384
+ tabIndex: -1,
1385
+ "data-state": a ? "open" : "closed",
1386
+ onKeyDown: (e) => {
1387
+ let t = u.current;
1388
+ if (!t) return;
1389
+ let n = Array.from(t.querySelectorAll(rn)), r = n.indexOf(document.activeElement);
1390
+ e.key === "ArrowDown" ? (e.preventDefault(), an(t, r + 1)) : e.key === "ArrowUp" ? (e.preventDefault(), an(t, r - 1)) : e.key === "Home" ? (e.preventDefault(), an(t, 0)) : e.key === "End" ? (e.preventDefault(), an(t, n.length - 1)) : (e.key === "Escape" || e.key === "Tab") && c();
1391
+ },
1392
+ className: x("w-max min-w-40 max-w-xs origin-top border py-1 shadow-lg backdrop-blur-sm", "transition-[opacity,transform] duration-150 ease-out", a ? "scale-100 opacity-100" : "scale-95 opacity-0", ne, te, S[s]),
1393
+ onClick: (e) => e.stopPropagation(),
1394
+ children: /* @__PURE__ */ t(tn.Provider, {
1395
+ value: c,
1396
+ children: l
384
1397
  })
1398
+ })
1399
+ })] }), document.body);
1400
+ }
1401
+ //#endregion
1402
+ //#region src/components/shared/use_overlay_state.ts
1403
+ function sn() {
1404
+ let [e, t] = g(!1), [n, r] = g(!1), i = h(void 0);
1405
+ return d(() => () => clearTimeout(i.current), []), {
1406
+ isMounted: e,
1407
+ isVisible: n,
1408
+ setIsVisible: r,
1409
+ open: l((e) => {
1410
+ clearTimeout(i.current), t(!0), e && r(!0);
1411
+ }, []),
1412
+ close: l(() => {
1413
+ clearTimeout(i.current), r(!1), i.current = setTimeout(() => t(!1), 150);
1414
+ }, [])
1415
+ };
1416
+ }
1417
+ function cn(e, t, n) {
1418
+ d(() => {
1419
+ if (!e || !t) return;
1420
+ let r = requestAnimationFrame(() => n(!0));
1421
+ return () => cancelAnimationFrame(r);
1422
+ }, [
1423
+ e,
1424
+ t,
1425
+ n
1426
+ ]);
1427
+ }
1428
+ //#endregion
1429
+ //#region src/components/context_menu/context_menu.tsx
1430
+ var ln = 2;
1431
+ function un(e, t) {
1432
+ return { getBoundingClientRect: () => ({
1433
+ width: 0,
1434
+ height: 0,
1435
+ x: e,
1436
+ y: t,
1437
+ top: t,
1438
+ left: e,
1439
+ right: e,
1440
+ bottom: t
1441
+ }) };
1442
+ }
1443
+ function dn(e) {
1444
+ if (e.clientX !== 0 || e.clientY !== 0) return {
1445
+ x: e.clientX,
1446
+ y: e.clientY
1447
+ };
1448
+ let t = e.target?.getBoundingClientRect();
1449
+ return t ? {
1450
+ x: t.left,
1451
+ y: t.bottom
1452
+ } : {
1453
+ x: 0,
1454
+ y: 0
1455
+ };
1456
+ }
1457
+ function fn({ children: e, items: r, radius: i = "md", className: a, ref: o }) {
1458
+ let s = h(null), { isMounted: c, isVisible: u, setIsVisible: d, open: f, close: p } = sn(), { refs: m, floatingStyles: g, isPositioned: _ } = Yt({
1459
+ placement: "bottom-start",
1460
+ open: c,
1461
+ whileElementsMounted: Rt,
1462
+ middleware: [
1463
+ Zt(ln),
1464
+ $t(),
1465
+ Qt({ padding: 8 })
385
1466
  ]
386
1467
  });
1468
+ cn(c, _, d);
1469
+ let v = l(() => {
1470
+ p(), s.current?.focus();
1471
+ }, [p]);
1472
+ return /* @__PURE__ */ n("div", {
1473
+ ref: o,
1474
+ className: a,
1475
+ onContextMenu: (e) => {
1476
+ e.preventDefault(), s.current = document.activeElement;
1477
+ let { x: t, y: n } = dn(e);
1478
+ m.setReference(un(t, n)), f(!1);
1479
+ },
1480
+ children: [e, c && /* @__PURE__ */ t(on, {
1481
+ setFloating: m.setFloating,
1482
+ floatingStyles: g,
1483
+ isVisible: u,
1484
+ isPositioned: _,
1485
+ radius: i,
1486
+ onClose: v,
1487
+ children: r
1488
+ })]
1489
+ });
1490
+ }
1491
+ //#endregion
1492
+ //#region src/lib/surface_error.ts
1493
+ function pn(e, t) {
1494
+ if (t) {
1495
+ t(e);
1496
+ return;
1497
+ }
1498
+ queueMicrotask(() => {
1499
+ throw e;
1500
+ });
1501
+ }
1502
+ //#endregion
1503
+ //#region src/components/copy_button/copy_button.tsx
1504
+ var mn = 2e3;
1505
+ function hn({ value: n, children: r, onError: i }) {
1506
+ let [a, o] = g(!1), s = h(void 0);
1507
+ return d(() => () => clearTimeout(s.current), []), /* @__PURE__ */ t(e, { children: r({
1508
+ copied: a,
1509
+ copy: async () => {
1510
+ try {
1511
+ await navigator.clipboard.writeText(n), o(!0), clearTimeout(s.current), s.current = setTimeout(() => o(!1), mn);
1512
+ } catch (e) {
1513
+ pn(e, i);
1514
+ }
1515
+ }
1516
+ }) });
1517
+ }
1518
+ //#endregion
1519
+ //#region src/lib/split_into_highlight_segments.ts
1520
+ function gn(e, t) {
1521
+ if (t.length === 0) return [{
1522
+ text: e,
1523
+ isMatch: !1
1524
+ }];
1525
+ let n = [], r = 0;
1526
+ for (let i = 0; i < t.length; i += 2) {
1527
+ let a = t[i], o = t[i + 1];
1528
+ a !== void 0 && o !== void 0 && (a > r && n.push({
1529
+ text: e.slice(r, a),
1530
+ isMatch: !1
1531
+ }), n.push({
1532
+ text: e.slice(a, o),
1533
+ isMatch: !0
1534
+ }), r = o);
1535
+ }
1536
+ return r < e.length && n.push({
1537
+ text: e.slice(r),
1538
+ isMatch: !1
1539
+ }), n;
1540
+ }
1541
+ //#endregion
1542
+ //#region src/components/highlight/highlight.tsx
1543
+ function _n({ text: n, ranges: r }) {
1544
+ let i = gn(n, r), a = 0;
1545
+ return /* @__PURE__ */ t(e, { children: i.map((e) => {
1546
+ let n = a;
1547
+ return a += e.text.length, e.isMatch ? /* @__PURE__ */ t("mark", {
1548
+ className: "rounded bg-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:text-yellow-100",
1549
+ children: e.text
1550
+ }, n) : /* @__PURE__ */ t("span", { children: e.text }, n);
1551
+ }) });
387
1552
  }
388
1553
  //#endregion
389
1554
  //#region src/components/icon_button/icon_button.tsx
390
- var R = {
391
- sm: "p-1",
1555
+ var vn = {
1556
+ xs: "p-1",
1557
+ sm: "p-2",
392
1558
  md: "p-2",
393
1559
  lg: "p-3"
394
- }, z = {
1560
+ }, yn = {
1561
+ xs: "w-4 h-4",
395
1562
  sm: "w-4 h-4",
396
1563
  md: "w-5 h-5",
397
1564
  lg: "w-6 h-6"
398
- }, B = ({ icon: e, "aria-label": r, variant: i = "outline", color: a = "neutral", size: o = "md", radius: s = "md", className: c, children: l, ref: u, ...d }) => {
399
- let f = g[a];
1565
+ };
1566
+ function bn(e) {
1567
+ let { icon: r, "aria-label": i, unstyled: a = !1, variant: o = "outline", color: s = "neutral", size: c = "md", radius: l = "md", className: u, children: d, ref: f, ...p } = e, m = O[s];
400
1568
  return /* @__PURE__ */ n("button", {
401
- ref: u,
1569
+ ref: f,
402
1570
  type: "button",
403
- "aria-label": r,
404
- className: m(_, i !== "unstyled" && [
1571
+ "aria-label": i,
1572
+ className: x(k, !a && [
1573
+ A,
405
1574
  "border",
406
- h[s],
407
- f[i],
408
- f.focusOutline
409
- ], R[o], c),
410
- ...d,
411
- children: [/* @__PURE__ */ t("div", { className: m(e, z[o], l && "mr-1") }), l]
1575
+ S[l],
1576
+ vn[c],
1577
+ m[o],
1578
+ m.focusOutline
1579
+ ], u),
1580
+ ...p,
1581
+ children: [/* @__PURE__ */ t("div", { className: x(r, yn[c], d && "mr-1") }), d]
412
1582
  });
413
- }, V = [];
414
- function H() {
1583
+ }
1584
+ //#endregion
1585
+ //#region src/components/shared/use_controlled_length.ts
1586
+ function xn(e) {
1587
+ return typeof e == "string" ? e.length : 0;
1588
+ }
1589
+ function Sn(e, t) {
1590
+ let [n, r] = g(xn(t)), i = e !== void 0;
1591
+ return {
1592
+ length: i ? xn(e) : n,
1593
+ trackLength: (e) => {
1594
+ i || r(e.length);
1595
+ }
1596
+ };
1597
+ }
1598
+ //#endregion
1599
+ //#region src/components/input/input.tsx
1600
+ function Cn({ label: e, error: r, showCharCount: i = !1, minLength: a, maxLength: o, radius: s = "md", unstyled: c = !1, className: l, wrapperClassName: u, value: d, defaultValue: f, onChange: p, id: m, ...h }) {
1601
+ let { fieldId: g, errorId: _ } = V(m), { length: v, trackLength: y } = Sn(d, f), b = i && (a !== void 0 || o !== void 0), C = (e) => {
1602
+ y(e.target.value), p?.(e);
1603
+ };
1604
+ return /* @__PURE__ */ n(de, {
1605
+ fieldId: g,
1606
+ errorId: _,
1607
+ label: e,
1608
+ error: r,
1609
+ required: h.required,
1610
+ wrapperClassName: u,
1611
+ children: [/* @__PURE__ */ t("input", {
1612
+ id: g,
1613
+ className: x("w-full disabled:opacity-50 disabled:cursor-not-allowed", !c && [
1614
+ B,
1615
+ S[s],
1616
+ "px-3 py-2 text-sm"
1617
+ ], !c && r && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), l),
1618
+ ...d === void 0 ? { defaultValue: f } : { value: d },
1619
+ minLength: a,
1620
+ maxLength: o,
1621
+ onChange: C,
1622
+ "aria-invalid": !!r,
1623
+ "aria-describedby": r ? _ : void 0,
1624
+ ...h
1625
+ }), b && /* @__PURE__ */ t(R, {
1626
+ current: v,
1627
+ min: a,
1628
+ max: o,
1629
+ showMin: a !== void 0,
1630
+ showMax: o !== void 0
1631
+ })]
1632
+ });
1633
+ }
1634
+ //#endregion
1635
+ //#region src/components/kbd/kbd.tsx
1636
+ var wn = {
1637
+ xs: "px-1.5 py-0.5 text-xs",
1638
+ sm: "px-2 py-0.5 text-xs",
1639
+ md: "px-2.5 py-1 text-sm",
1640
+ lg: "px-3 py-1 text-base"
1641
+ }, Tn = ({ children: e, size: n = "sm", radius: r = "sm", unstyled: i = !1, className: a }) => /* @__PURE__ */ t("kbd", {
1642
+ className: x("inline-flex items-center", wn[n], !i && [
1643
+ "border font-semibold uppercase",
1644
+ "text-gray-500 dark:text-gray-400",
1645
+ "bg-gray-100 dark:bg-gray-700",
1646
+ "border-gray-200 dark:border-gray-600",
1647
+ S[r]
1648
+ ], a),
1649
+ children: e
1650
+ });
1651
+ //#endregion
1652
+ //#region src/lib/merge_refs.ts
1653
+ function En(...e) {
1654
+ return (t) => {
1655
+ for (let n of e) typeof n == "function" ? n(t) : n && (n.current = t);
1656
+ };
1657
+ }
1658
+ //#endregion
1659
+ //#region src/components/menu/menu.tsx
1660
+ var Dn = 4;
1661
+ function On(e, t) {
1662
+ return t === "center" ? e : `${e}-${t}`;
1663
+ }
1664
+ function kn({ trigger: e, children: r, side: i = "bottom", align: o = "start", radius: s = "md", className: u, ref: d }) {
1665
+ let f = h(null), { isMounted: p, isVisible: m, setIsVisible: g, open: _, close: v } = sn(), { refs: y, floatingStyles: b, isPositioned: S } = Yt({
1666
+ placement: On(i, o),
1667
+ open: p,
1668
+ whileElementsMounted: Rt,
1669
+ middleware: [
1670
+ Zt(Dn),
1671
+ $t(),
1672
+ Qt({ padding: 8 })
1673
+ ]
1674
+ });
1675
+ cn(p, S, g);
1676
+ let C = l(() => {
1677
+ v(), f.current?.querySelector("button, [href], [tabindex]")?.focus();
1678
+ }, [v]), w = l((e) => En(y.setReference, f, d)(e), [y, d]), T = {
1679
+ onClick: (t) => {
1680
+ t.stopPropagation(), m ? v() : _(S), c(e) && e.props.onClick?.(t);
1681
+ },
1682
+ "aria-haspopup": "menu",
1683
+ "aria-expanded": p
1684
+ }, E = c(e) ? a(e, T) : e;
1685
+ return /* @__PURE__ */ n("span", {
1686
+ ref: w,
1687
+ className: x("inline-block", u),
1688
+ children: [E, p && /* @__PURE__ */ t(on, {
1689
+ setFloating: y.setFloating,
1690
+ floatingStyles: b,
1691
+ isVisible: m,
1692
+ isPositioned: S,
1693
+ radius: s,
1694
+ onClose: C,
1695
+ children: r
1696
+ })]
1697
+ });
1698
+ }
1699
+ //#endregion
1700
+ //#region src/components/menu_item/menu_item.tsx
1701
+ function An({ icon: e, onClick: r, danger: i = !1, disabled: a = !1, children: o, className: s, ref: c }) {
1702
+ let l = nn();
1703
+ return /* @__PURE__ */ n("button", {
1704
+ ref: c,
1705
+ type: "button",
1706
+ role: "menuitem",
1707
+ tabIndex: -1,
1708
+ onClick: (e) => {
1709
+ e.stopPropagation(), r(e), l?.();
1710
+ },
1711
+ disabled: a,
1712
+ className: x("flex w-full cursor-pointer items-center gap-2 whitespace-nowrap px-4 py-2 text-left text-sm transition-colors", "hover:enabled:bg-gray-100 dark:hover:enabled:bg-gray-700", "focus-visible:bg-gray-100 focus-visible:outline-none dark:focus-visible:bg-gray-700", "disabled:cursor-not-allowed disabled:opacity-50", i ? "text-red-600 dark:text-red-400" : "text-gray-700 dark:text-gray-300", s),
1713
+ children: [e && /* @__PURE__ */ t("div", { className: x(e, "h-4 w-4 flex-shrink-0") }), o]
1714
+ });
1715
+ }
1716
+ //#endregion
1717
+ //#region node_modules/.pnpm/react-call@2.0.2_react-dom@19.2.8_react@19.2.8__react@19.2.8_vite@8.2.1_@types+node@26.2.0_es_s57p6lt2ddgt4vomhz3tbzqsbu/node_modules/react-call/dist/main.js
1718
+ var jn = [];
1719
+ function Mn() {
415
1720
  let e = 0, t = [], n = null, r = /* @__PURE__ */ new Set(), i = () => {
416
1721
  for (let e of r) e(t);
417
1722
  };
@@ -432,7 +1737,7 @@ function H() {
432
1737
  r.delete(i), r.size || (e = 0, t = [], n = null);
433
1738
  }),
434
1739
  getSnapshot: () => t,
435
- getServerSnapshot: () => V,
1740
+ getServerSnapshot: () => jn,
436
1741
  getListenersSize: () => r.size,
437
1742
  getUpsertPromise: () => n,
438
1743
  setUpsertPromise: (e) => {
@@ -440,39 +1745,39 @@ function H() {
440
1745
  }
441
1746
  };
442
1747
  }
443
- var U = /* @__PURE__ */ new Map();
444
- function W(e, t = 0) {
445
- let n = { current: H() }, r = (e) => (r) => {
1748
+ var Nn = /* @__PURE__ */ new Map();
1749
+ function Pn(e, t = 0) {
1750
+ let n = { current: Mn() }, r = (e) => (r) => {
446
1751
  let i = /* @__PURE__ */ new Set();
447
1752
  n.current.set(e, (e) => (e.resolve(r), i.add(e.promise), {
448
1753
  ...e,
449
1754
  ended: !0
450
1755
  })), globalThis.setTimeout(() => n.current.remove(i), t);
451
- }, a = () => {
1756
+ }, i = () => {
452
1757
  let e = n.current.getListenersSize();
453
1758
  if (!e) throw Error("No <Root> found!");
454
1759
  if (e > 1) throw Error("Multiple instances of <Root> found!");
455
- }, o = (e) => {
456
- a();
457
- let t, i = new Promise((e) => {
1760
+ }, a = (e) => {
1761
+ i();
1762
+ let t, a = new Promise((e) => {
458
1763
  t = e;
459
1764
  });
460
1765
  return n.current.add({
461
1766
  props: e,
462
- end: r(i),
1767
+ end: r(a),
463
1768
  ended: !1,
464
- promise: i,
1769
+ promise: a,
465
1770
  resolve: t
466
- }), i;
467
- }, s = (e) => {
468
- a();
1771
+ }), a;
1772
+ }, o = (e) => {
1773
+ i();
469
1774
  let t = n.current.getUpsertPromise();
470
1775
  if (t) return n.current.set(t, (t) => ({
471
1776
  ...t,
472
1777
  props: e
473
1778
  })), t;
474
- let i, o = new Promise((e) => {
475
- i = e;
1779
+ let a, o = new Promise((e) => {
1780
+ a = e;
476
1781
  });
477
1782
  return n.current.setUpsertPromise(o), n.current.add({
478
1783
  props: e,
@@ -481,7 +1786,7 @@ function W(e, t = 0) {
481
1786
  },
482
1787
  ended: !1,
483
1788
  promise: o,
484
- resolve: i
1789
+ resolve: a
485
1790
  }), o;
486
1791
  }, c = (...e) => {
487
1792
  let t = e.length === 2, i = t ? e[0] : null, a = t ? e[1] : e[0];
@@ -496,78 +1801,78 @@ function W(e, t = 0) {
496
1801
  }
497
1802
  }));
498
1803
  }, u = function(t) {
499
- return d(n.current.subscribe, n.current.getSnapshot, n.current.getServerSnapshot).map(({ props: n, key: r, end: a, ended: o }, s, c) => /* @__PURE__ */ i(e, {
1804
+ return _(n.current.subscribe, n.current.getSnapshot, n.current.getServerSnapshot).map(({ props: n, key: r, end: i, ended: a }, o, c) => /* @__PURE__ */ s(e, {
500
1805
  ...n,
501
1806
  key: r,
502
1807
  call: {
503
1808
  key: r,
504
- end: a,
505
- ended: o,
1809
+ end: i,
1810
+ ended: a,
506
1811
  root: t,
507
- index: s,
1812
+ index: o,
508
1813
  stackSize: c.length
509
1814
  }
510
1815
  }));
511
- }, f = Object.assign(u, {
1816
+ }, d = Object.assign(u, {
512
1817
  Root: u,
513
- call: o,
514
- upsert: s,
1818
+ call: a,
1819
+ upsert: o,
515
1820
  end: c,
516
1821
  update: l
517
1822
  });
518
1823
  if (process.env.NODE_ENV !== "production") {
519
- Object.defineProperty(f, "name", {
1824
+ Object.defineProperty(d, "name", {
520
1825
  value: "Root",
521
1826
  configurable: !0
522
1827
  });
523
1828
  let e, t = !1;
524
- Object.defineProperty(f, "displayName", {
1829
+ Object.defineProperty(d, "displayName", {
525
1830
  configurable: !0,
526
1831
  enumerable: !0,
527
1832
  get: () => e,
528
1833
  set: (r) => {
529
1834
  if (t || (e = r, !r)) return;
530
1835
  t = !0;
531
- let i = U.get(r);
532
- i ? n.current = i : U.set(r, n.current);
1836
+ let i = Nn.get(r);
1837
+ i ? n.current = i : Nn.set(r, n.current);
533
1838
  }
534
1839
  });
535
1840
  }
536
- return f;
1841
+ return d;
537
1842
  }
538
1843
  //#endregion
539
1844
  //#region src/components/modal/modal_shell.tsx
540
- var G = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])", K = {
1845
+ var Fn = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])", In = {
541
1846
  sm: "max-w-md",
542
1847
  md: "max-w-lg",
543
1848
  lg: "max-w-2xl",
544
1849
  xl: "max-w-4xl"
545
1850
  };
546
- function q({ isEnded: e, onDismiss: r, title: i, children: a, footer: c, size: d = "md", radius: p = "xl", className: g, dismissible: _ = !0 }) {
547
- let [v, y] = u(!1), b = l(null), x = l(null), S = l(null), C = s();
548
- o(() => {
549
- document.body.style.overflow = "hidden", S.current = document.activeElement;
550
- let e = b.current;
551
- (x.current?.querySelector(G) ?? e?.querySelector(G) ?? e)?.focus();
1851
+ function Ln({ isEnded: e, onDismiss: r, title: i, children: a, footer: o, size: s = "md", radius: c = "xl", className: l, dismissible: u = !0, closeLabel: p = "Close" }) {
1852
+ let [m, _] = g(!1), v = h(null), b = h(null), C = h(null), w = f();
1853
+ d(() => {
1854
+ document.body.style.overflow = "hidden", C.current = document.activeElement;
1855
+ let e = v.current;
1856
+ (b.current?.querySelector(Fn) ?? e?.querySelector(Fn) ?? e)?.focus();
552
1857
  let t = requestAnimationFrame(() => {
553
- requestAnimationFrame(() => y(!0));
1858
+ requestAnimationFrame(() => _(!0));
554
1859
  });
555
1860
  return () => {
556
1861
  cancelAnimationFrame(t), document.body.style.overflow = "";
557
1862
  };
558
- }, []), o(() => {
559
- e && S.current?.focus();
560
- }, [e]), o(() => {
1863
+ }, []), d(() => {
1864
+ e && C.current?.focus();
1865
+ }, [e]), d(() => {
561
1866
  if (e) return;
562
1867
  let t = (e) => {
563
1868
  if (e.key === "Escape") {
564
- _ && r();
1869
+ u && r();
565
1870
  return;
566
1871
  }
567
1872
  if (e.key !== "Tab") return;
568
- let t = b.current;
1873
+ let t = v.current;
569
1874
  if (!t) return;
570
- let n = Array.from(t.querySelectorAll(G));
1875
+ let n = Array.from(t.querySelectorAll(Fn));
571
1876
  if (n.length === 0) return;
572
1877
  let i = n[0], a = n[n.length - 1];
573
1878
  e.shiftKey && document.activeElement === i ? (e.preventDefault(), a.focus()) : !e.shiftKey && document.activeElement === a && (e.preventDefault(), i.focus());
@@ -576,36 +1881,36 @@ function q({ isEnded: e, onDismiss: r, title: i, children: a, footer: c, size: d
576
1881
  }, [
577
1882
  e,
578
1883
  r,
579
- _
1884
+ u
580
1885
  ]);
581
- let w = () => {
582
- !e && _ && r();
583
- }, T = v && !e;
584
- return f(/* @__PURE__ */ n("div", {
585
- className: m("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"),
586
- onClick: w,
1886
+ let T = () => {
1887
+ !e && u && r();
1888
+ }, E = m && !e;
1889
+ return y(/* @__PURE__ */ n("div", {
1890
+ className: x("fixed inset-0 z-50 flex items-start justify-center", "p-2 sm:py-[3rem] lg:py-[5rem]", "transition-opacity duration-200 ease-out", E ? "opacity-100" : "opacity-0"),
1891
+ onClick: T,
587
1892
  children: [/* @__PURE__ */ t("div", {
588
- className: m("fixed inset-0 bg-black/60 backdrop-blur-md", "transition-opacity duration-200 ease-out", T ? "opacity-100" : "opacity-0"),
1893
+ className: x("fixed inset-0 bg-black/60 backdrop-blur-md", "transition-opacity duration-200 ease-out", E ? "opacity-100" : "opacity-0"),
589
1894
  "aria-hidden": "true"
590
1895
  }), /* @__PURE__ */ n("div", {
591
- ref: b,
1896
+ ref: v,
592
1897
  role: "dialog",
593
1898
  "aria-modal": "true",
594
- "aria-labelledby": i ? C : void 0,
1899
+ "aria-labelledby": i ? w : void 0,
595
1900
  tabIndex: -1,
596
- className: m("relative w-full", K[d], D, "shadow-2xl", h[p], "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"),
1901
+ className: x("relative w-full", In[s], ne, "shadow-2xl", S[c], "max-h-[calc(100vh-4rem)] sm:max-h-[calc(100vh-10rem)] overflow-hidden flex flex-col", "transition-all duration-200 ease-out", "focus:outline-none", E ? "opacity-100 scale-100 translate-y-0" : "opacity-0 scale-95 translate-y-1"),
597
1902
  onClick: (e) => e.stopPropagation(),
598
1903
  children: [
599
1904
  i && /* @__PURE__ */ n("div", {
600
1905
  className: "flex items-center justify-between gap-4 px-6 pt-5 pb-4 flex-shrink-0",
601
1906
  children: [/* @__PURE__ */ t("h2", {
602
- id: C,
1907
+ id: w,
603
1908
  className: "text-base font-medium tracking-tight text-gray-900 dark:text-gray-100",
604
1909
  children: i
605
- }), _ && /* @__PURE__ */ t(B, {
1910
+ }), u && /* @__PURE__ */ t(bn, {
606
1911
  icon: "i-mdi-close",
607
1912
  onClick: r,
608
- "aria-label": "Close",
1913
+ "aria-label": p,
609
1914
  variant: "subtle",
610
1915
  size: "sm",
611
1916
  radius: "full",
@@ -613,21 +1918,21 @@ function q({ isEnded: e, onDismiss: r, title: i, children: a, footer: c, size: d
613
1918
  })]
614
1919
  }),
615
1920
  /* @__PURE__ */ t("div", {
616
- ref: x,
617
- className: m("flex-1 overflow-y-auto px-6 pb-6 text-sm leading-relaxed text-gray-600 dark:text-gray-400 min-h-0", !i && "pt-6", g),
1921
+ ref: b,
1922
+ className: x("flex-1 overflow-y-auto px-6 pb-6 text-sm leading-relaxed text-gray-600 dark:text-gray-400 min-h-0", !i && "pt-6", l),
618
1923
  children: a
619
1924
  }),
620
- c && /* @__PURE__ */ t("div", {
621
- className: m("flex items-center justify-end gap-3 px-6 py-4 border-t flex-shrink-0", "border-gray-100 dark:border-gray-800"),
622
- children: c
1925
+ o && /* @__PURE__ */ t("div", {
1926
+ 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"),
1927
+ children: o
623
1928
  })
624
1929
  ]
625
1930
  })]
626
1931
  }), document.body);
627
1932
  }
628
1933
  //#endregion
629
- //#region node_modules/.pnpm/zustand@5.0.14_@types+react@19.2.17_react@19.2.7_use-sync-external-store@1.6.0_react@19.2.7_/node_modules/zustand/esm/vanilla.mjs
630
- var ee = (e) => {
1934
+ //#region node_modules/.pnpm/zustand@5.0.14_@types+react@19.2.18_react@19.2.8_use-sync-external-store@1.6.0_react@19.2.8_/node_modules/zustand/esm/vanilla.mjs
1935
+ var Rn = (e) => {
631
1936
  let t, n = /* @__PURE__ */ new Set(), r = (e, r) => {
632
1937
  let i = typeof e == "function" ? e(t) : e;
633
1938
  if (!Object.is(i, t)) {
@@ -641,437 +1946,441 @@ var ee = (e) => {
641
1946
  subscribe: (e) => (n.add(e), () => n.delete(e))
642
1947
  }, o = t = e(r, i, a);
643
1948
  return a;
644
- }, te = ((e) => e ? ee(e) : ee), ne = (e) => e;
645
- function re(e, t = ne) {
646
- let n = r.useSyncExternalStore(e.subscribe, r.useCallback(() => t(e.getState()), [e, t]), r.useCallback(() => t(e.getInitialState()), [e, t]));
647
- return r.useDebugValue(n), n;
1949
+ }, zn = ((e) => e ? Rn(e) : Rn), Bn = (e) => e;
1950
+ function Vn(e, t = Bn) {
1951
+ let n = i.useSyncExternalStore(e.subscribe, i.useCallback(() => t(e.getState()), [e, t]), i.useCallback(() => t(e.getInitialState()), [e, t]));
1952
+ return i.useDebugValue(n), n;
648
1953
  }
649
- var ie = (e) => {
650
- let t = te(e), n = (e) => re(t, e);
1954
+ var Hn = (e) => {
1955
+ let t = zn(e), n = (e) => Vn(t, e);
651
1956
  return Object.assign(n, t), n;
652
- }, ae = ((e) => e ? ie(e) : ie), J = ae((e) => ({
1957
+ }, Un = ((e) => e ? Hn(e) : Hn), Wn = Un((e) => ({
653
1958
  globalHotkeysEnabled: !0,
654
1959
  setGlobalHotkeysEnabled: (t) => e({ globalHotkeysEnabled: t })
655
- })), Y = 0;
656
- function X() {
657
- o(() => (Y += 1, Y === 1 && J.getState().setGlobalHotkeysEnabled(!1), () => {
658
- --Y, Y === 0 && J.getState().setGlobalHotkeysEnabled(!0);
1960
+ })), Gn = 0;
1961
+ function Kn() {
1962
+ d(() => (Gn += 1, Gn === 1 && Wn.getState().setGlobalHotkeysEnabled(!1), () => {
1963
+ --Gn, Gn === 0 && Wn.getState().setGlobalHotkeysEnabled(!0);
659
1964
  }), []);
660
1965
  }
661
1966
  //#endregion
662
1967
  //#region src/components/modal/confirm_modal.tsx
663
- var oe = {
664
- red: "danger",
665
- blue: "primary",
666
- green: "success"
667
- }, se = {
668
- red: "i-mdi-alert-circle",
669
- blue: "i-mdi-help-circle",
670
- green: "i-mdi-check-circle"
671
- }, ce = {
672
- red: "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400",
673
- blue: "bg-blue-50 text-blue-600 dark:bg-blue-500/10 dark:text-blue-400",
674
- green: "bg-green-50 text-green-600 dark:bg-green-500/10 dark:text-green-400"
1968
+ var qn = {
1969
+ danger: "i-mdi-alert-circle",
1970
+ primary: "i-mdi-help-circle",
1971
+ success: "i-mdi-check-circle"
1972
+ }, Jn = {
1973
+ danger: "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400",
1974
+ primary: "bg-blue-50 text-blue-600 dark:bg-blue-500/10 dark:text-blue-400",
1975
+ success: "bg-green-50 text-green-600 dark:bg-green-500/10 dark:text-green-400"
675
1976
  };
676
- function le({ title: e, color: r }) {
1977
+ function Yn({ title: e, color: r }) {
677
1978
  return /* @__PURE__ */ n("div", {
678
1979
  className: "flex items-center gap-3",
679
1980
  children: [/* @__PURE__ */ t("span", {
680
- className: m("flex h-9 w-9 shrink-0 items-center justify-center rounded-full", ce[r]),
1981
+ className: x("flex h-9 w-9 shrink-0 items-center justify-center rounded-full", Jn[r]),
681
1982
  "aria-hidden": "true",
682
- children: /* @__PURE__ */ t("span", { className: m(se[r], "h-5 w-5") })
1983
+ children: /* @__PURE__ */ t("span", { className: x(qn[r], "h-5 w-5") })
683
1984
  }), e]
684
1985
  });
685
1986
  }
686
- var ue = W(({ call: r, title: i, children: a, confirmLabel: o, cancelLabel: s, confirmColor: c, radius: l, onConfirm: d }) => {
687
- X();
688
- let [f, p] = u(!1), m = () => r.end(!1), h = async () => {
1987
+ var Xn = Pn(({ call: r, title: i, children: a, confirmLabel: o, cancelLabel: s, confirmColor: c, radius: l, closeLabel: u, onConfirm: d, onError: f }) => {
1988
+ Kn();
1989
+ let [p, m] = g(!1), h = () => r.end(!1), _ = async () => {
689
1990
  if (!d) {
690
1991
  r.end(!0);
691
1992
  return;
692
1993
  }
693
- p(!0);
1994
+ m(!0);
694
1995
  try {
695
1996
  await d(), r.end(!0);
696
- } finally {
697
- p(!1);
1997
+ } catch (e) {
1998
+ m(!1), pn(e, f);
698
1999
  }
699
- }, g = f, _ = o ?? "Confirm", v = s ?? "Cancel", y = c ?? "blue";
700
- return /* @__PURE__ */ t(q, {
2000
+ }, v = p, y = o ?? "Confirm", b = s ?? "Cancel", x = c ?? "primary";
2001
+ return /* @__PURE__ */ t(Ln, {
701
2002
  isEnded: r.ended,
702
- onDismiss: m,
703
- title: /* @__PURE__ */ t(le, {
2003
+ onDismiss: h,
2004
+ title: /* @__PURE__ */ t(Yn, {
704
2005
  title: i,
705
- color: y
2006
+ color: x
706
2007
  }),
707
2008
  size: "sm",
708
2009
  radius: l,
709
- footer: /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t(b, {
2010
+ closeLabel: u,
2011
+ footer: /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t(F, {
710
2012
  variant: "outline",
711
2013
  color: "neutral",
712
- onClick: m,
713
- disabled: g,
2014
+ onClick: h,
2015
+ disabled: v,
714
2016
  size: "sm",
715
- children: v
716
- }), /* @__PURE__ */ t(b, {
717
- color: oe[y],
2017
+ children: b
2018
+ }), /* @__PURE__ */ t(F, {
2019
+ color: x,
718
2020
  onClick: () => {
719
- h();
2021
+ _();
720
2022
  },
721
- loading: g,
722
- disabled: g,
2023
+ loading: v,
2024
+ disabled: v,
723
2025
  size: "sm",
724
- children: _
2026
+ children: y
725
2027
  })] }),
726
2028
  children: a
727
2029
  });
728
- }, 200), de = 200;
729
- function fe(e, t) {
2030
+ }, 200);
2031
+ //#endregion
2032
+ //#region src/components/modal/modal.tsx
2033
+ function Zn(e, t) {
730
2034
  return typeof e == "function" ? e(t) : e;
731
2035
  }
732
- var pe = W(({ call: e, title: n, children: r, footer: i, size: a, radius: o, className: s, dismissible: c }) => {
733
- X();
734
- let l = () => e.end();
735
- return /* @__PURE__ */ t(q, {
2036
+ var Qn = o(null), $n = Pn(({ call: e, title: n, children: r, size: i, radius: a, className: o, dismissible: s, closeLabel: c }) => {
2037
+ Kn();
2038
+ let [l, u] = g(null), d = () => e.end();
2039
+ return /* @__PURE__ */ t(Ln, {
736
2040
  isEnded: e.ended,
737
- onDismiss: l,
2041
+ onDismiss: d,
738
2042
  title: n,
739
- footer: fe(i, l),
740
- size: a,
741
- radius: o,
742
- className: s,
743
- dismissible: c,
744
- children: fe(r, l)
2043
+ footer: l,
2044
+ size: i,
2045
+ radius: a,
2046
+ className: o,
2047
+ dismissible: s,
2048
+ closeLabel: c,
2049
+ children: /* @__PURE__ */ t(Qn.Provider, {
2050
+ value: u,
2051
+ children: Zn(r, d)
2052
+ })
745
2053
  });
746
- }, de);
2054
+ }, 200);
2055
+ //#endregion
2056
+ //#region src/components/modal/modal_footer.tsx
2057
+ function er({ children: e }) {
2058
+ let t = u(Qn);
2059
+ return d(() => (t?.(e), () => t?.(null)), [t, e]), null;
2060
+ }
747
2061
  //#endregion
748
2062
  //#region src/components/modal_provider/modal_provider.tsx
749
- function me() {
750
- return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t(pe, {}), /* @__PURE__ */ t(ue, {})] });
2063
+ function tr() {
2064
+ return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t($n, {}), /* @__PURE__ */ t(Xn, {})] });
2065
+ }
2066
+ //#endregion
2067
+ //#region src/components/radio_options/radio_option_row.tsx
2068
+ function nr({ option: e, optionId: r, descriptionId: i, name: a, orientation: o, isSelected: s, isDisabled: c, isFirstOption: l, required: u, error: d, radius: f, unstyled: p, className: m, onSelect: h }) {
2069
+ return /* @__PURE__ */ n("label", {
2070
+ htmlFor: r,
2071
+ className: x("flex cursor-pointer items-start gap-3 transition-colors duration-150", o === "horizontal" && "flex-1", T, d ? D : E, !p && [
2072
+ S[f],
2073
+ "border px-3 py-2.5",
2074
+ s ? d ? x("border-red-500 dark:border-red-400", "bg-red-50 dark:bg-red-950/20") : "border-blue-500 bg-blue-50 dark:border-blue-500 dark:bg-blue-950/25" : d ? "border-red-300 bg-white dark:border-red-800/50 dark:bg-gray-800/50" : x("border-gray-200 dark:border-gray-700", "bg-gray-50 hover:border-gray-300 hover:bg-white dark:bg-gray-800/50 dark:hover:border-gray-600 dark:hover:bg-gray-800")
2075
+ ], c && "cursor-not-allowed opacity-50", m),
2076
+ children: [
2077
+ /* @__PURE__ */ t("input", {
2078
+ type: "radio",
2079
+ id: r,
2080
+ name: a,
2081
+ value: e.value,
2082
+ checked: s,
2083
+ onChange: () => h(e.value),
2084
+ disabled: c,
2085
+ required: u && l,
2086
+ "aria-invalid": d ? !0 : void 0,
2087
+ "aria-describedby": e.description ? i : void 0,
2088
+ className: "sr-only"
2089
+ }),
2090
+ /* @__PURE__ */ t("span", {
2091
+ className: x("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors duration-150", s ? d ? ae : "border-blue-600 dark:border-blue-500" : d ? "border-red-400 dark:border-red-600" : z),
2092
+ "aria-hidden": !0,
2093
+ children: s && /* @__PURE__ */ t("span", { className: x("h-2 w-2 rounded-full", d ? "bg-red-500 dark:bg-red-400" : "bg-blue-600 dark:bg-blue-500") })
2094
+ }),
2095
+ /* @__PURE__ */ n("span", {
2096
+ className: "flex min-w-0 flex-col",
2097
+ children: [/* @__PURE__ */ n("span", {
2098
+ className: "flex items-center gap-1.5",
2099
+ children: [e.icon && /* @__PURE__ */ t("span", {
2100
+ className: x(e.icon, "h-4 w-4 shrink-0", s ? d ? "text-red-600 dark:text-red-400" : "text-blue-600 dark:text-blue-400" : "text-gray-500 dark:text-gray-400"),
2101
+ "aria-hidden": !0
2102
+ }), /* @__PURE__ */ t("span", {
2103
+ className: x("select-none text-sm font-medium", s ? d ? "text-red-700 dark:text-red-300" : "text-blue-700 dark:text-blue-300" : "text-gray-700 dark:text-gray-300"),
2104
+ children: e.label
2105
+ })]
2106
+ }), e.description && /* @__PURE__ */ t("span", {
2107
+ id: i,
2108
+ className: x("text-xs text-gray-500 dark:text-gray-400", "mt-0.5"),
2109
+ children: e.description
2110
+ })]
2111
+ })
2112
+ ]
2113
+ });
751
2114
  }
752
2115
  //#endregion
753
2116
  //#region src/components/radio_options/radio_options.tsx
754
- function he({ options: e, orientation: r = "vertical", value: i, defaultValue: a, onChange: o, name: c, label: l, error: d, required: f, disabled: p, radius: g = "lg", unstyled: _ = !1, className: v, wrapperClassName: y, id: b = "radio", ...x }) {
755
- let S = `${b}-${s()}`, C = c ?? S, [T, E] = u(a ?? ""), D = i !== void 0, O = D ? i : T, k = e.map((e) => typeof e == "string" ? {
2117
+ function rr({ options: e, orientation: r = "vertical", value: i, defaultValue: a, onChange: o, name: s, label: c, error: l, required: u, disabled: d, radius: f = "lg", unstyled: p = !1, className: m, wrapperClassName: h, id: g, ..._ }) {
2118
+ let { fieldId: v, errorId: y } = V(g), b = s ?? v, [S, C] = H(i, a ?? ""), w = e.map((e) => typeof e == "string" ? {
756
2119
  value: e,
757
2120
  label: e
758
- } : e), j = `${S}-error`, M = (e) => {
759
- D || E(e), o?.(e);
2121
+ } : e), T = (e) => {
2122
+ C(e), o?.(e);
760
2123
  };
761
2124
  return /* @__PURE__ */ n("fieldset", {
762
- className: m("m-0 border-0 p-0", y),
763
- disabled: p,
764
- "aria-describedby": d ? j : void 0,
765
- "aria-required": f,
766
- ...x,
2125
+ className: x("m-0 border-0 p-0", h),
2126
+ disabled: d,
2127
+ "aria-describedby": l ? y : void 0,
2128
+ "aria-required": u,
2129
+ ..._,
767
2130
  children: [
768
- l && /* @__PURE__ */ n("legend", {
769
- className: m("text-sm font-medium text-gray-700 dark:text-gray-300", "mb-2", v),
770
- children: [l, f && /* @__PURE__ */ t("span", {
2131
+ c && /* @__PURE__ */ n("legend", {
2132
+ className: x("text-sm font-medium text-gray-700 dark:text-gray-300", "mb-2"),
2133
+ children: [c, u && /* @__PURE__ */ t("span", {
771
2134
  className: "text-red-500 dark:text-red-400 ml-1",
772
2135
  children: "*"
773
2136
  })]
774
2137
  }),
775
2138
  /* @__PURE__ */ t("div", {
776
- className: m(r === "horizontal" ? "flex flex-row gap-2" : "flex flex-col gap-2"),
777
- children: k.map((e, i) => {
778
- let a = `${S}-${i}`, o = `${S}-${i}-desc`, s = O === e.value, c = p ?? e.disabled;
779
- return /* @__PURE__ */ n("label", {
780
- htmlFor: a,
781
- className: m("flex cursor-pointer items-start gap-3 transition-colors duration-150", r === "horizontal" && "flex-1", "focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2", "focus-within:ring-offset-white dark:focus-within:ring-offset-gray-900", d ? "focus-within:ring-red-500" : "focus-within:ring-blue-500", !_ && [
782
- h[g],
783
- "border px-3 py-2.5",
784
- s ? d ? m("border-red-500 dark:border-red-400", "bg-red-50 dark:bg-red-950/20") : "border-blue-500 bg-blue-50 dark:border-blue-500 dark:bg-blue-950/25" : d ? "border-red-300 bg-white dark:border-red-800/50 dark:bg-gray-800/50" : m("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")
785
- ], c && "cursor-not-allowed opacity-50"),
786
- children: [
787
- /* @__PURE__ */ t("input", {
788
- type: "radio",
789
- id: a,
790
- name: C,
791
- value: e.value,
792
- checked: s,
793
- onChange: () => M(e.value),
794
- disabled: c,
795
- required: f && i === 0,
796
- "aria-invalid": d ? !0 : void 0,
797
- "aria-describedby": e.description ? o : void 0,
798
- className: "sr-only"
799
- }),
800
- /* @__PURE__ */ t("span", {
801
- className: m("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors duration-150", s ? d ? A : "border-blue-600 dark:border-blue-500" : d ? "border-red-400 dark:border-red-600" : w),
802
- "aria-hidden": !0,
803
- children: s && /* @__PURE__ */ t("span", { className: m("h-2 w-2 rounded-full", d ? "bg-red-500 dark:bg-red-400" : "bg-blue-600 dark:bg-blue-500") })
804
- }),
805
- /* @__PURE__ */ n("span", {
806
- className: "flex min-w-0 flex-col",
807
- children: [/* @__PURE__ */ n("span", {
808
- className: "flex items-center gap-1.5",
809
- children: [e.icon && /* @__PURE__ */ t("span", {
810
- className: m(e.icon, "h-4 w-4 shrink-0", s ? d ? "text-red-600 dark:text-red-400" : "text-blue-600 dark:text-blue-400" : "text-gray-500 dark:text-gray-400"),
811
- "aria-hidden": !0
812
- }), /* @__PURE__ */ t("span", {
813
- className: m("select-none text-sm font-medium", s ? d ? "text-red-700 dark:text-red-300" : "text-blue-700 dark:text-blue-300" : "text-gray-700 dark:text-gray-300"),
814
- children: e.label
815
- })]
816
- }), e.description && /* @__PURE__ */ t("span", {
817
- id: o,
818
- className: m("text-xs text-gray-500 dark:text-gray-400", "mt-0.5"),
819
- children: e.description
820
- })]
821
- })
822
- ]
823
- }, e.value);
824
- })
2139
+ className: x(r === "horizontal" ? "flex flex-row gap-2" : "flex flex-col gap-2"),
2140
+ children: w.map((e, n) => /* @__PURE__ */ t(nr, {
2141
+ option: e,
2142
+ optionId: `${v}-${n}`,
2143
+ descriptionId: `${v}-${n}-desc`,
2144
+ name: b,
2145
+ orientation: r,
2146
+ isSelected: S === e.value,
2147
+ isDisabled: d === !0 || e.disabled === !0,
2148
+ isFirstOption: n === 0,
2149
+ required: u,
2150
+ error: l,
2151
+ radius: f,
2152
+ unstyled: p,
2153
+ className: m,
2154
+ onSelect: T
2155
+ }, e.value))
825
2156
  }),
826
- d && /* @__PURE__ */ t("p", {
827
- id: j,
828
- className: m("text-xs text-red-600 dark:text-red-400", "mt-2"),
829
- role: "alert",
830
- children: d
2157
+ /* @__PURE__ */ t(oe, {
2158
+ id: y,
2159
+ error: l,
2160
+ className: "mt-2"
831
2161
  })
832
2162
  ]
833
2163
  });
834
2164
  }
835
2165
  //#endregion
836
2166
  //#region src/components/select/select.tsx
837
- function ge({ options: e, label: r, error: i, placeholder: a, radius: o = "md", unstyled: c = !1, className: l, wrapperClassName: u, value: d, defaultValue: f, onChange: p, id: g = "select", ..._ }) {
838
- let v = `${g}-${s()}`;
839
- return /* @__PURE__ */ n("div", {
840
- className: m("w-full", u),
841
- children: [
842
- typeof r == "string" ? /* @__PURE__ */ n("label", {
843
- className: m(k, "block mb-1"),
844
- htmlFor: v,
845
- children: [r, _.required && /* @__PURE__ */ t("span", {
846
- className: "text-red-500 dark:text-red-400 ml-1",
847
- children: "*"
848
- })]
849
- }) : r,
850
- /* @__PURE__ */ n("select", {
851
- id: v,
852
- className: m("w-full disabled:opacity-50 disabled:cursor-not-allowed", !c && [
853
- F,
854
- h[o],
855
- "pl-3 pr-8 py-2 text-sm appearance-none bg-[length:1rem_1rem] bg-[position:right_0.5rem_center] bg-no-repeat",
856
- "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\")]"
857
- ], !c && i && m("border-red-500 dark:border-red-400", "focus:ring-red-500"), l),
858
- ...d === void 0 ? { defaultValue: f } : { value: d },
859
- onChange: p,
860
- "aria-invalid": !!i,
861
- "aria-describedby": i ? `${v}-error` : void 0,
862
- ..._,
863
- children: [a !== void 0 && /* @__PURE__ */ t("option", {
864
- value: "",
865
- children: a
866
- }), e.map((e) => /* @__PURE__ */ t("option", {
867
- value: e.value,
868
- children: e.label
869
- }, e.value))]
870
- }),
871
- i && /* @__PURE__ */ t("p", {
872
- id: `${v}-error`,
873
- className: m("text-xs text-red-600 dark:text-red-400", "mt-1"),
874
- role: "alert",
875
- children: i
876
- })
877
- ]
2167
+ function ir({ options: e, label: r, error: i, placeholder: a, radius: o = "md", unstyled: s = !1, className: c, wrapperClassName: l, value: u, defaultValue: d, onChange: f, id: p, ...m }) {
2168
+ let { fieldId: h, errorId: g } = V(p);
2169
+ return /* @__PURE__ */ t(de, {
2170
+ fieldId: h,
2171
+ errorId: g,
2172
+ label: r,
2173
+ error: i,
2174
+ required: m.required,
2175
+ wrapperClassName: l,
2176
+ children: /* @__PURE__ */ n("select", {
2177
+ id: h,
2178
+ className: x("w-full disabled:opacity-50 disabled:cursor-not-allowed", !s && [
2179
+ B,
2180
+ S[o],
2181
+ "pl-3 pr-8 py-2 text-sm appearance-none bg-[length:1rem_1rem] bg-[position:right_0.5rem_center] bg-no-repeat",
2182
+ "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\")]"
2183
+ ], !s && i && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), c),
2184
+ ...u === void 0 ? { defaultValue: d } : { value: u },
2185
+ onChange: f,
2186
+ "aria-invalid": !!i,
2187
+ "aria-describedby": i ? g : void 0,
2188
+ ...m,
2189
+ children: [a !== void 0 && /* @__PURE__ */ t("option", {
2190
+ value: "",
2191
+ children: a
2192
+ }), e.map((e) => /* @__PURE__ */ t("option", {
2193
+ value: e.value,
2194
+ children: e.label
2195
+ }, e.value))]
2196
+ })
878
2197
  });
879
2198
  }
880
2199
  //#endregion
881
2200
  //#region src/components/switch/switch.tsx
882
- function _e({ label: r, description: i, error: a, className: o, wrapperClassName: c, checked: l, defaultChecked: d = !1, onChange: f, id: p = "switch", ...h }) {
883
- let g = `${p}-${s()}`, [_, v] = u(d), y = l !== void 0, b = y ? l : _, x = [i && `${g}-description`, a && `${g}-error`].filter(Boolean).join(" ") || void 0;
2201
+ function ar({ label: r, description: i, error: a, unstyled: o = !1, className: s, wrapperClassName: c, checked: l, defaultChecked: u = !1, onChange: d, id: f, ...p }) {
2202
+ let { fieldId: m, errorId: h, descriptionId: g } = V(f), [_, v] = H(l, u), y = [i && g, a && h].filter(Boolean).join(" ") || void 0;
884
2203
  return /* @__PURE__ */ n("div", {
885
- className: m("w-full", c),
2204
+ className: x("w-full", c),
886
2205
  children: [
887
2206
  /* @__PURE__ */ n("label", {
888
- htmlFor: g,
889
- className: m("flex items-center gap-3 cursor-pointer", h.disabled && "cursor-not-allowed opacity-50"),
2207
+ htmlFor: m,
2208
+ className: x("flex items-center gap-3 cursor-pointer", p.disabled && "cursor-not-allowed opacity-50"),
890
2209
  children: [/* @__PURE__ */ n("span", {
891
- className: m("relative inline-flex w-11 shrink-0 rounded-full border-2 border-transparent", "transition-colors duration-200 ease-in-out", "focus-within:outline-none focus-within:ring-2 focus-within:ring-blue-500 focus-within:ring-offset-2", "disabled:opacity-50", b ? O : "bg-gray-200 dark:bg-gray-600", a && "ring-2 ring-red-500 dark:ring-red-400", o),
2210
+ className: x("relative inline-flex w-11 shrink-0", "transition-colors duration-200 ease-in-out", T, E, !o && [
2211
+ "rounded-full border-2 border-transparent",
2212
+ _ ? "bg-blue-600 dark:bg-blue-500" : "bg-gray-200 dark:bg-gray-600",
2213
+ a && "ring-2 ring-red-500 dark:ring-red-400"
2214
+ ], s),
892
2215
  children: [/* @__PURE__ */ t("input", {
893
2216
  type: "checkbox",
894
2217
  role: "switch",
895
- id: g,
2218
+ id: m,
896
2219
  className: "sr-only",
897
- checked: b,
2220
+ checked: _,
898
2221
  onChange: (e) => {
899
- y || v(e.target.checked), f?.(e);
2222
+ v(e.target.checked), d?.(e);
900
2223
  },
901
2224
  "aria-invalid": !!a,
902
- "aria-describedby": x,
903
- ...h
2225
+ "aria-describedby": y,
2226
+ ...p
904
2227
  }), /* @__PURE__ */ t("span", {
905
- className: m("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0", "transition duration-200 ease-in-out", b ? "translate-x-5.25" : "translate-x-0"),
2228
+ className: x("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0", "transition duration-200 ease-in-out", _ ? "translate-x-5.25" : "translate-x-0"),
906
2229
  "aria-hidden": !0
907
2230
  })]
908
2231
  }), r && /* @__PURE__ */ t(e, { children: typeof r == "string" ? /* @__PURE__ */ n("span", {
909
- className: m("text-sm font-medium text-gray-700 dark:text-gray-300", "select-none"),
910
- children: [r, h.required && /* @__PURE__ */ t("span", {
2232
+ className: x("text-sm font-medium text-gray-700 dark:text-gray-300", "select-none"),
2233
+ children: [r, p.required && /* @__PURE__ */ t("span", {
911
2234
  className: "text-red-500 dark:text-red-400 ml-1",
912
2235
  children: "*"
913
2236
  })]
914
- }) : /* @__PURE__ */ n(e, { children: [r, h.required && /* @__PURE__ */ t("span", {
2237
+ }) : /* @__PURE__ */ n(e, { children: [r, p.required && /* @__PURE__ */ t("span", {
915
2238
  className: "text-red-500 dark:text-red-400 ml-1",
916
2239
  children: "*"
917
2240
  })] }) })]
918
2241
  }),
919
- i && (typeof i == "string" ? /* @__PURE__ */ t("p", {
920
- id: `${g}-description`,
921
- className: m("text-xs text-gray-500 dark:text-gray-400", "mt-1 ml-14"),
922
- children: i
923
- }) : /* @__PURE__ */ t("span", {
924
- id: `${g}-description`,
925
- className: m("text-xs text-gray-500 dark:text-gray-400", "block mt-1 ml-14"),
926
- children: i
927
- })),
928
- a && /* @__PURE__ */ t("p", {
929
- id: `${g}-error`,
930
- className: m("text-xs text-red-600 dark:text-red-400", "mt-1 ml-14"),
931
- role: "alert",
932
- children: a
2242
+ /* @__PURE__ */ t(se, {
2243
+ id: g,
2244
+ description: i,
2245
+ className: "mt-1 ml-14"
2246
+ }),
2247
+ /* @__PURE__ */ t(oe, {
2248
+ id: h,
2249
+ error: a,
2250
+ className: "mt-1 ml-14"
933
2251
  })
934
2252
  ]
935
2253
  });
936
2254
  }
937
2255
  //#endregion
938
2256
  //#region src/components/tabs/tabs.tsx
939
- function ve({ items: e, defaultIndex: r = 0, radius: i = "md", className: a, tabListClassName: o, panelClassName: c, onChange: d }) {
940
- let [f, p] = u(r), g = s(), _ = l([]), v = (t) => {
941
- e[t]?.disabled || (p(t), d?.(t));
942
- }, y = (e) => {
943
- _.current[e]?.focus(), v(e);
944
- }, b = (t) => {
2257
+ function or({ items: e, value: r, defaultIndex: i = 0, radius: a = "md", unstyled: o = !1, className: s, tabListClassName: c, panelClassName: l, onChange: u }) {
2258
+ let [d, p] = H(r, i), m = f(), g = h([]), _ = (t) => {
2259
+ e[t]?.disabled || (p(t), u?.(t));
2260
+ }, v = (e) => {
2261
+ g.current[e]?.focus(), _(e);
2262
+ }, y = (t) => {
945
2263
  let n = e.map((e, t) => t).filter((t) => !e[t]?.disabled);
946
2264
  if (n.length === 0) return;
947
- let r = n.indexOf(f);
948
- t.key === "ArrowRight" ? (t.preventDefault(), y(n[(r + 1) % n.length])) : t.key === "ArrowLeft" ? (t.preventDefault(), y(n[(r - 1 + n.length) % n.length])) : t.key === "Home" ? (t.preventDefault(), y(n[0])) : t.key === "End" && (t.preventDefault(), y(n[n.length - 1]));
949
- }, x = e[f];
2265
+ let r = n.indexOf(d);
2266
+ t.key === "ArrowRight" ? (t.preventDefault(), v(n[(r + 1) % n.length])) : t.key === "ArrowLeft" ? (t.preventDefault(), v(n[(r - 1 + n.length) % n.length])) : t.key === "Home" ? (t.preventDefault(), v(n[0])) : t.key === "End" && (t.preventDefault(), v(n[n.length - 1]));
2267
+ }, b = e[d];
950
2268
  return /* @__PURE__ */ n("div", {
951
- className: m("w-full", a),
2269
+ className: x("w-full", s),
952
2270
  children: [/* @__PURE__ */ t("div", {
953
2271
  role: "tablist",
954
- className: m("flex gap-1 p-1 bg-gray-100 dark:bg-gray-800/50 border", E, h[i], o),
2272
+ className: x("flex gap-1 p-1", !o && [
2273
+ "bg-gray-100 dark:bg-gray-800/50 border",
2274
+ "border-gray-200 dark:border-gray-700",
2275
+ S[a]
2276
+ ], c),
955
2277
  children: e.map((e, r) => /* @__PURE__ */ n("button", {
956
2278
  ref: (e) => {
957
- _.current[r] = e;
2279
+ g.current[r] = e;
958
2280
  },
959
- id: `${g}-tab-${r}`,
2281
+ id: `${m}-tab-${r}`,
960
2282
  role: "tab",
961
2283
  type: "button",
962
- "aria-selected": f === r,
2284
+ "aria-selected": d === r,
963
2285
  "aria-disabled": e.disabled,
964
- "aria-controls": `${g}-panel-${r}`,
965
- tabIndex: f === r ? 0 : -1,
2286
+ "aria-controls": `${m}-panel-${r}`,
2287
+ tabIndex: d === r ? 0 : -1,
966
2288
  disabled: e.disabled,
967
- onClick: () => v(r),
968
- onKeyDown: b,
969
- className: m("flex items-center gap-2 px-4 py-2.5 text-sm font-medium", h[i], f === r ? m("bg-white dark:bg-gray-700 text-blue-600 dark:text-blue-400 shadow-sm border", E) : m("text-gray-600 dark:text-gray-400 border border-transparent", e.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-200/50 dark:hover:bg-gray-700/50")),
970
- children: [e.icon && /* @__PURE__ */ t("span", { className: m("w-4 h-4 block shrink-0", e.icon, f === r ? "text-blue-600 dark:text-blue-400" : "text-gray-500 dark:text-gray-400") }), e.title]
971
- }, r))
2289
+ onClick: () => _(r),
2290
+ onKeyDown: y,
2291
+ className: x("flex items-center gap-2 px-4 py-2.5 text-sm font-medium", e.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer", !o && [S[a], d === r ? x("bg-white dark:bg-gray-700 text-blue-600 dark:text-blue-400 shadow-sm border", "border-gray-200 dark:border-gray-700") : x("text-gray-600 dark:text-gray-400 border border-transparent", !e.disabled && "hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-200/50 dark:hover:bg-gray-700/50")]),
2292
+ children: [e.icon && /* @__PURE__ */ t("span", { className: x("w-4 h-4 block shrink-0", e.icon, !o && (d === r ? "text-blue-600 dark:text-blue-400" : "text-gray-500 dark:text-gray-400")) }), e.title]
2293
+ }, e.title))
972
2294
  }), /* @__PURE__ */ t("div", {
973
2295
  role: "tabpanel",
974
- id: `${g}-panel-${f}`,
975
- "aria-labelledby": `${g}-tab-${f}`,
2296
+ id: `${m}-panel-${d}`,
2297
+ "aria-labelledby": `${m}-tab-${d}`,
976
2298
  tabIndex: 0,
977
- className: m("mt-3 border bg-white dark:bg-gray-800/50 p-4 overflow-hidden focus:outline-none", E, h[i], c),
2299
+ className: x("mt-3 overflow-hidden focus:outline-none", !o && [
2300
+ "border bg-white dark:bg-gray-800/50 p-4",
2301
+ "border-gray-200 dark:border-gray-700",
2302
+ S[a]
2303
+ ], l),
978
2304
  children: /* @__PURE__ */ t("div", {
979
2305
  className: "tabs-panel-inner",
980
- children: x?.content
981
- }, f)
2306
+ children: b?.content
2307
+ }, d)
982
2308
  })]
983
2309
  });
984
2310
  }
985
2311
  //#endregion
986
2312
  //#region src/components/textarea/textarea.tsx
987
- function ye({ label: e, error: r, showCharCount: i = !1, minLength: a, maxLength: o, radius: c = "md", unstyled: l = !1, className: d, wrapperClassName: f, value: p, defaultValue: g, onChange: _, id: v = "textarea", ...y }) {
988
- let b = `${v}-${s()}`, [x, S] = u(typeof g == "string" ? g.length : 0), w = typeof p == "string" ? p.length : p === void 0 ? x : 0, T = i && (a !== void 0 || o !== void 0), E = (e) => {
989
- p === void 0 && S(e.target.value.length), _?.(e);
2313
+ function sr({ label: e, error: r, showCharCount: i = !1, minLength: a, maxLength: o, radius: s = "md", unstyled: c = !1, className: l, wrapperClassName: u, value: d, defaultValue: f, onChange: p, id: m, ...h }) {
2314
+ let { fieldId: g, errorId: _ } = V(m), { length: v, trackLength: y } = Sn(d, f), b = i && (a !== void 0 || o !== void 0), C = (e) => {
2315
+ y(e.target.value), p?.(e);
990
2316
  };
991
- return /* @__PURE__ */ n("div", {
992
- className: m("w-full", f),
993
- children: [
994
- typeof e == "string" ? /* @__PURE__ */ n("label", {
995
- className: m(k, "block mb-1"),
996
- htmlFor: b,
997
- children: [e, y.required && /* @__PURE__ */ t("span", {
998
- className: "text-red-500 dark:text-red-400 ml-1",
999
- children: "*"
1000
- })]
1001
- }) : e,
1002
- /* @__PURE__ */ t("textarea", {
1003
- id: b,
1004
- className: m("w-full min-h-[80px] resize-y disabled:opacity-50 disabled:cursor-not-allowed", !l && [
1005
- F,
1006
- h[c],
1007
- "px-3 py-2 text-sm"
1008
- ], !l && r && m("border-red-500 dark:border-red-400", "focus:ring-red-500"), d),
1009
- ...p === void 0 ? { defaultValue: g } : { value: p },
1010
- minLength: a,
1011
- maxLength: o,
1012
- onChange: E,
1013
- "aria-invalid": !!r,
1014
- "aria-describedby": r ? `${b}-error` : void 0,
1015
- ...y
1016
- }),
1017
- T && /* @__PURE__ */ t(C, {
1018
- current: w,
1019
- min: a,
1020
- max: o,
1021
- showMin: a !== void 0,
1022
- showMax: o !== void 0
1023
- }),
1024
- r && /* @__PURE__ */ t("p", {
1025
- id: `${b}-error`,
1026
- className: m("text-xs text-red-600 dark:text-red-400", "mt-1"),
1027
- role: "alert",
1028
- children: r
1029
- })
1030
- ]
2317
+ return /* @__PURE__ */ n(de, {
2318
+ fieldId: g,
2319
+ errorId: _,
2320
+ label: e,
2321
+ error: r,
2322
+ required: h.required,
2323
+ wrapperClassName: u,
2324
+ children: [/* @__PURE__ */ t("textarea", {
2325
+ id: g,
2326
+ className: x("w-full min-h-[80px] resize-y disabled:opacity-50 disabled:cursor-not-allowed", !c && [
2327
+ B,
2328
+ S[s],
2329
+ "px-3 py-2 text-sm"
2330
+ ], !c && r && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), l),
2331
+ ...d === void 0 ? { defaultValue: f } : { value: d },
2332
+ minLength: a,
2333
+ maxLength: o,
2334
+ onChange: C,
2335
+ "aria-invalid": !!r,
2336
+ "aria-describedby": r ? _ : void 0,
2337
+ ...h
2338
+ }), b && /* @__PURE__ */ t(R, {
2339
+ current: v,
2340
+ min: a,
2341
+ max: o,
2342
+ showMin: a !== void 0,
2343
+ showMax: o !== void 0
2344
+ })]
1031
2345
  });
1032
2346
  }
1033
2347
  //#endregion
1034
2348
  //#region src/stores/theme_store/theme_store.ts
1035
- var Z = "theme";
1036
- function be(e) {
2349
+ var cr = "theme";
2350
+ function lr(e) {
1037
2351
  return e === "light" || e === "dark" || e === "system";
1038
2352
  }
1039
- function Q() {
2353
+ function ur() {
1040
2354
  return globalThis.window !== void 0 && globalThis.document !== void 0;
1041
2355
  }
1042
- function xe(e) {
2356
+ function dr(e) {
1043
2357
  let t = window.matchMedia("(prefers-color-scheme: dark)").matches, n = e === "dark" || e === "system" && t;
1044
2358
  document.documentElement.classList.toggle("dark", n);
1045
2359
  }
1046
- function Se() {
1047
- if (!Q()) return "system";
1048
- let e = globalThis.localStorage.getItem(Z);
1049
- return be(e) ? e : "system";
2360
+ function fr() {
2361
+ if (!ur()) return "system";
2362
+ let e = globalThis.localStorage.getItem(cr);
2363
+ return lr(e) ? e : "system";
1050
2364
  }
1051
- var $ = ae((e) => ({
1052
- theme: Se(),
2365
+ var pr = fr();
2366
+ ur() && dr(pr);
2367
+ var mr = Un((e) => ({
2368
+ theme: pr,
1053
2369
  setTheme: (t) => {
1054
- xe(t), Q() && globalThis.localStorage.setItem(Z, t), e({ theme: t });
2370
+ dr(t), ur() && globalThis.localStorage.setItem(cr, t), e({ theme: t });
1055
2371
  }
1056
2372
  }));
1057
- Q() && (globalThis.addEventListener("storage", (e) => {
1058
- if (e.key !== Z) return;
1059
- let t = be(e.newValue) ? e.newValue : "system";
1060
- xe(t), $.setState({ theme: t });
2373
+ ur() && (globalThis.addEventListener("storage", (e) => {
2374
+ if (e.key !== cr) return;
2375
+ let t = lr(e.newValue) ? e.newValue : "system";
2376
+ dr(t), mr.setState({ theme: t });
1061
2377
  }), globalThis.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
1062
- $.getState().theme === "system" && xe("system");
2378
+ mr.getState().theme === "system" && dr("system");
1063
2379
  }));
1064
2380
  //#endregion
1065
- //#region src/hooks/use_is_client/use_is_client.tsx
1066
- var Ce = () => {
1067
- let [e, t] = u(!1);
1068
- return o(() => {
1069
- requestAnimationFrame(() => {
1070
- t(!0);
1071
- });
1072
- }, []), e;
1073
- }, we = 750, Te = "ease-in-out";
1074
- async function Ee({ theme: e, element: t, transitionDuration: n = we, transitionEasing: r = Te, applyThemeCallback: i }) {
2381
+ //#region src/lib/theme_transition.ts
2382
+ var hr = 750, gr = "ease-in-out";
2383
+ async function _r({ theme: e, element: t, transitionDuration: n = hr, transitionEasing: r = gr, applyThemeCallback: i }) {
1075
2384
  if (!document.startViewTransition || globalThis.matchMedia("(prefers-reduced-motion: reduce)").matches) {
1076
2385
  i(e);
1077
2386
  return;
@@ -1085,24 +2394,23 @@ async function Ee({ theme: e, element: t, transitionDuration: n = we, transition
1085
2394
  pseudoElement: "::view-transition-new(root)"
1086
2395
  });
1087
2396
  }
1088
- function De(e) {
2397
+ function vr(e) {
1089
2398
  return e === "light" ? "dark" : e === "dark" ? "system" : "light";
1090
2399
  }
1091
2400
  //#endregion
1092
2401
  //#region src/components/theme_toggle/theme_toggle.tsx
1093
- var Oe = {
2402
+ var yr = {
1094
2403
  light: "i-tabler-sun text-yellow-500",
1095
2404
  dark: "i-tabler-moon-stars text-gray-700 dark:text-yellow-500",
1096
2405
  system: "i-tabler-device-desktop text-blue-500"
1097
- }, ke = "i-tabler-device-desktop text-gray-400";
1098
- function Ae({ isTransitionEnabled: e = !0, transitionDuration: n, transitionEasing: r, size: i = "md", radius: s }) {
1099
- let c = $((e) => e.theme), u = $((e) => e.setTheme), d = Ce(), f = l(null);
1100
- o(() => {
1101
- u($.getState().theme);
1102
- }, [u]);
1103
- let p = a(async () => {
1104
- let t = De(c), i = f.current;
1105
- i && e ? await Ee({
2406
+ }, br = "i-tabler-device-desktop text-gray-400";
2407
+ function xr(e) {
2408
+ return `Current theme: ${e}`;
2409
+ }
2410
+ function Sr({ isTransitionEnabled: e = !0, transitionDuration: n, transitionEasing: r, size: i = "md", radius: a, variant: o, getAriaLabel: s = xr }) {
2411
+ let c = mr((e) => e.theme), u = mr((e) => e.setTheme), d = le(), f = h(null), p = l(async () => {
2412
+ let t = vr(c), i = f.current;
2413
+ i && e ? await _r({
1106
2414
  theme: t,
1107
2415
  element: i,
1108
2416
  transitionDuration: n,
@@ -1115,25 +2423,100 @@ function Ae({ isTransitionEnabled: e = !0, transitionDuration: n, transitionEasi
1115
2423
  n,
1116
2424
  r,
1117
2425
  u
1118
- ]);
1119
- return /* @__PURE__ */ t(B, {
2426
+ ]), m = d ? yr[c] : br;
2427
+ return /* @__PURE__ */ t(bn, {
1120
2428
  ref: f,
1121
- icon: d ? Oe[c] : ke,
1122
- "aria-label": `Thème actuel: ${c}`,
2429
+ icon: m,
2430
+ "aria-label": s(c),
1123
2431
  size: i,
1124
- radius: s,
2432
+ radius: a,
2433
+ variant: o,
1125
2434
  onClick: () => {
1126
2435
  p();
1127
2436
  }
1128
2437
  });
1129
2438
  }
1130
2439
  //#endregion
1131
- //#region src/hooks/use_run_after_animation/use_run_after_animation.ts
1132
- function je(e) {
1133
- return a((t) => {
1134
- let n = setTimeout(t, e);
1135
- return () => clearTimeout(n);
1136
- }, [e]);
2440
+ //#region src/components/tooltip/tooltip.tsx
2441
+ var Cr = 8, wr = 8, Tr = {
2442
+ top: "data-[state=closed]:translate-y-1",
2443
+ bottom: "data-[state=closed]:-translate-y-1",
2444
+ left: "data-[state=closed]:translate-x-1",
2445
+ right: "data-[state=closed]:-translate-x-1"
2446
+ }, Er = {
2447
+ top: "bottom",
2448
+ bottom: "top",
2449
+ left: "right",
2450
+ right: "left"
2451
+ };
2452
+ function Dr({ content: r, children: i, position: o = "top", showOnClick: s = !1, temporaryContent: u, temporaryDuration: p = 2e3, disabled: m = !1, radius: _ = "lg", onTemporaryShow: v, className: b, ref: C }) {
2453
+ let { isMounted: w, isVisible: T, setIsVisible: E, open: D, close: O } = sn(), [k, A] = g(!1), j = f(), M = h(null), N = h(void 0), { refs: P, floatingStyles: F, placement: I, middlewareData: L, isPositioned: R } = Yt({
2454
+ placement: o,
2455
+ open: w,
2456
+ whileElementsMounted: Rt,
2457
+ middleware: [
2458
+ Zt(Cr),
2459
+ $t(),
2460
+ Qt({ padding: 8 }),
2461
+ en({ element: M })
2462
+ ]
2463
+ }), z = I.split("-")[0];
2464
+ cn(w, R, E);
2465
+ let ee = l((e) => En(P.setReference, C)(e), [P, C]), te = () => {
2466
+ A(!1), O();
2467
+ }, ne = () => {
2468
+ m || !u || (A(!0), D(R), clearTimeout(N.current), N.current = setTimeout(te, p), v?.());
2469
+ }, B = () => {
2470
+ m || D(R);
2471
+ }, re = () => {
2472
+ clearTimeout(N.current), te();
2473
+ };
2474
+ d(() => () => clearTimeout(N.current), []);
2475
+ let ie = w && !m, ae = k && u ? u : r, oe = {
2476
+ onClick: (e) => {
2477
+ s && u && ne(), c(i) && i.props.onClick?.(e);
2478
+ },
2479
+ "aria-describedby": ie ? j : void 0
2480
+ }, V = c(i) ? a(i, oe) : i, se = L.arrow?.x, H = L.arrow?.y, ce = Er[z];
2481
+ return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", {
2482
+ ref: ee,
2483
+ className: x("inline-block", b),
2484
+ onMouseEnter: B,
2485
+ onMouseLeave: re,
2486
+ onFocus: B,
2487
+ onBlur: re,
2488
+ children: V
2489
+ }), ie && y(/* @__PURE__ */ t("div", {
2490
+ ref: P.setFloating,
2491
+ style: F,
2492
+ className: "z-50 inline-block pointer-events-none",
2493
+ children: /* @__PURE__ */ n("div", {
2494
+ id: j,
2495
+ role: "tooltip",
2496
+ "data-state": T ? "open" : "closed",
2497
+ 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", Tr[z], S[_]),
2498
+ children: [ae, /* @__PURE__ */ t("div", {
2499
+ ref: M,
2500
+ style: {
2501
+ position: "absolute",
2502
+ width: `${wr}px`,
2503
+ height: `${wr}px`,
2504
+ left: se === void 0 ? void 0 : `${se}px`,
2505
+ top: H === void 0 ? void 0 : `${H}px`,
2506
+ [ce]: `-${wr / 2}px`
2507
+ },
2508
+ className: "rotate-45 bg-gray-900 dark:bg-gray-100"
2509
+ })]
2510
+ })
2511
+ }), document.body)] });
1137
2512
  }
1138
2513
  //#endregion
1139
- export { F as BASE_INPUT_STYLES, b as Button, C as CharacterCount, j as Checkbox, P as ClientOnly, L as Combobox, ue as ConfirmModal, B as IconButton, I as Input, pe as Modal, me as ModalProvider, he as RadioOptions, ge as Select, _e as Switch, ve as Tabs, ye as Textarea, Ae as ThemeToggle, M as useClientOnly, X as useDisableHotkeysWhileMounted, J as useGlobalHotkeysStore, Ce as useIsClient, je as useRunAfterAnimation, $ as useThemeStore, N as withClientOnly };
2514
+ //#region src/hooks/use_is_client/with_client_only.tsx
2515
+ var Or = (e) => {
2516
+ function n(n) {
2517
+ return le() ? /* @__PURE__ */ t(e, { ...n }) : null;
2518
+ }
2519
+ return n;
2520
+ };
2521
+ //#endregion
2522
+ export { B as BASE_INPUT_STYLES, M as Badge, F as Button, R as CharacterCount, ce as Checkbox, ue as ClientOnly, fe as Combobox, Xn as ConfirmModal, fn as ContextMenu, hn as CopyButton, _n as Highlight, bn as IconButton, Cn as Input, Tn as Kbd, kn as Menu, An as MenuItem, $n as Modal, er as ModalFooter, tr as ModalProvider, rr as RadioOptions, ir as Select, ar as Switch, or as Tabs, sr as Textarea, Sr as ThemeToggle, Dr as Tooltip, gn as splitIntoHighlightSegments, Kn as useDisableHotkeysWhileMounted, Wn as useGlobalHotkeysStore, le as useIsClient, mr as useThemeStore, Or as withClientOnly };