@opencxh/ui-kit 3.5.0 → 3.13.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.
package/dist/index.js CHANGED
@@ -1,37 +1,37 @@
1
- import { clsx as De } from "clsx";
2
- import { jsxs as c, jsx as e, Fragment as Le } from "react/jsx-runtime";
3
- import se, { forwardRef as ce, useState as O, useRef as ee, useEffect as J, useMemo as ie, useCallback as ne, createContext as Ae, Component as Te } from "react";
4
- import { FileText as xe, HardDrive as Ne, X as Ie, ArrowLeft as Me, Search as je, FolderPlus as Be, Upload as Pe, Folder as we, ChevronDownIcon as Ve, ChevronRight as Fe } from "lucide-react";
5
- function b(...r) {
6
- return De(r);
1
+ import { clsx as Te } from "clsx";
2
+ import { jsxs as c, jsx as e, Fragment as Ee } from "react/jsx-runtime";
3
+ import se, { forwardRef as ce, useState as V, useRef as Q, useCallback as ae, useEffect as G, useMemo as ie, createContext as Ae, Component as Ie } from "react";
4
+ import { ChevronDown as je, FileText as pe, HardDrive as Ne, X as Be, ArrowLeft as Me, Search as Pe, FolderPlus as _e, Upload as Oe, Folder as we, ChevronDownIcon as Ve, ChevronRight as Fe } from "lucide-react";
5
+ function x(...r) {
6
+ return Te(r);
7
7
  }
8
- function Fr(r) {
8
+ function Rr(r) {
9
9
  return (l, t) => r[l]?.[t] || "";
10
10
  }
11
- function Or(r) {
11
+ function qr(r) {
12
12
  return (l) => r[l] || "";
13
13
  }
14
- const Oe = {
14
+ const We = {
15
15
  primary: "btn o__primary",
16
16
  secondary: "btn o__secondary",
17
17
  outline: "btn o__secondary",
18
18
  ghost: "btn text-gray-700",
19
19
  destructive: "btn o__destructive"
20
- }, _e = {
20
+ }, Re = {
21
21
  xs: "px-2 py-1 text-xs",
22
22
  sm: "px-3 py-1.5 text-sm",
23
23
  md: "px-4 py-2 text-sm",
24
24
  lg: "px-6 py-3 text-base",
25
25
  xl: "px-8 py-4 text-lg",
26
26
  full: "px-4 py-3 text-base"
27
- }, We = {
27
+ }, qe = {
28
28
  xs: "p-1",
29
29
  sm: "p-1.5",
30
30
  md: "p-2",
31
31
  lg: "p-3",
32
32
  xl: "p-4",
33
33
  full: "p-4"
34
- }, Q = ce(
34
+ }, ee = ce(
35
35
  ({
36
36
  variant: r = "primary",
37
37
  size: l = "md",
@@ -39,32 +39,32 @@ const Oe = {
39
39
  loading: a = !1,
40
40
  leftIcon: o,
41
41
  rightIcon: i,
42
- iconOnly: f = !1,
43
- className: p,
44
- children: x,
45
- disabled: v,
42
+ iconOnly: h = !1,
43
+ className: g,
44
+ children: f,
45
+ disabled: b,
46
46
  ...m
47
- }, s) => {
48
- const d = v || a;
47
+ }, n) => {
48
+ const d = b || a;
49
49
  return /* @__PURE__ */ c(
50
50
  "button",
51
51
  {
52
- ref: s,
52
+ ref: n,
53
53
  type: "button",
54
- className: b(
54
+ className: x(
55
55
  // Base styles
56
56
  "inline-flex items-center justify-center font-medium rounded-lg transition-colors duration-200",
57
57
  "focus:outline-none focus:ring-1 focus:ring-offset-1",
58
58
  "disabled:opacity-50 disabled:cursor-not-allowed",
59
59
  // Variant styles
60
- Oe[r],
60
+ We[r],
61
61
  // Size styles
62
- f ? We[l] : _e[l],
62
+ h ? qe[l] : Re[l],
63
63
  // Full width
64
64
  t && "w-full",
65
65
  // Loading state
66
66
  a && "cursor-wait",
67
- p
67
+ g
68
68
  ),
69
69
  disabled: d,
70
70
  ...m,
@@ -72,9 +72,9 @@ const Oe = {
72
72
  a && /* @__PURE__ */ c(
73
73
  "svg",
74
74
  {
75
- className: b(
75
+ className: x(
76
76
  "animate-spin",
77
- f ? "h-4 w-4" : "h-4 w-4 mr-2"
77
+ h ? "h-4 w-4" : "h-4 w-4 mr-2"
78
78
  ),
79
79
  fill: "none",
80
80
  viewBox: "0 0 24 24",
@@ -101,24 +101,24 @@ const Oe = {
101
101
  ]
102
102
  }
103
103
  ),
104
- !a && o && /* @__PURE__ */ e("span", { className: b("flex-shrink-0", !f && "mr-2"), children: o }),
105
- !f && x,
106
- !a && i && /* @__PURE__ */ e("span", { className: b("flex-shrink-0", !f && "ml-2"), children: i }),
107
- f && !a && !o && !i && x
104
+ !a && o && /* @__PURE__ */ e("span", { className: x("flex-shrink-0", !h && "mr-2"), children: o }),
105
+ !h && f,
106
+ !a && i && /* @__PURE__ */ e("span", { className: x("flex-shrink-0", !h && "ml-2"), children: i }),
107
+ h && !a && !o && !i && f
108
108
  ]
109
109
  }
110
110
  );
111
111
  }
112
112
  );
113
- Q.displayName = "Button";
114
- const _r = ({
113
+ ee.displayName = "Button";
114
+ const Hr = ({
115
115
  children: r,
116
116
  size: l = "md",
117
117
  orientation: t = "horizontal",
118
118
  attached: a = !0,
119
119
  className: o
120
120
  }) => {
121
- const i = b(
121
+ const i = x(
122
122
  "inline-flex",
123
123
  {
124
124
  // Orientation
@@ -141,20 +141,20 @@ const _r = ({
141
141
  o
142
142
  );
143
143
  return /* @__PURE__ */ e("div", { className: i, role: "group", children: r });
144
- }, Wr = ({
144
+ }, Ur = ({
145
145
  variant: r = "default",
146
146
  size: l = "md",
147
147
  color: t = "primary",
148
148
  disabled: a = !1,
149
149
  external: o = !1,
150
150
  className: i,
151
- children: f,
152
- href: p,
153
- target: x,
154
- rel: v,
151
+ children: h,
152
+ href: g,
153
+ target: f,
154
+ rel: b,
155
155
  ...m
156
156
  }) => {
157
- const s = o || p && (p.startsWith("http") || p.startsWith("mailto:")), d = b(
157
+ const n = o || g && (g.startsWith("http") || g.startsWith("mailto:")), d = x(
158
158
  // Base styles
159
159
  "inline-flex items-center gap-1 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2",
160
160
  // Size variants
@@ -208,15 +208,15 @@ const _r = ({
208
208
  "opacity-50 cursor-not-allowed pointer-events-none": a
209
209
  },
210
210
  i
211
- ), h = {
211
+ ), p = {
212
212
  ...m,
213
- href: a ? void 0 : p,
214
- target: s ? "_blank" : x,
215
- rel: s ? "noopener noreferrer" : v
213
+ href: a ? void 0 : g,
214
+ target: n ? "_blank" : f,
215
+ rel: n ? "noopener noreferrer" : b
216
216
  };
217
- return /* @__PURE__ */ c("a", { className: d, ...h, children: [
218
- f,
219
- s && /* @__PURE__ */ e(
217
+ return /* @__PURE__ */ c("a", { className: d, ...p, children: [
218
+ h,
219
+ n && /* @__PURE__ */ e(
220
220
  "svg",
221
221
  {
222
222
  className: "w-3 h-3 ml-1",
@@ -236,12 +236,92 @@ const _r = ({
236
236
  }
237
237
  )
238
238
  ] });
239
- }, Re = {
239
+ }, Ce = {
240
+ primary: "btn o__primary",
241
+ secondary: "btn o__secondary",
242
+ outline: "btn o__secondary"
243
+ }, He = {
244
+ sm: "px-3 py-1.5 text-sm",
245
+ md: "px-4 py-2 text-sm"
246
+ };
247
+ function Ue({
248
+ label: r,
249
+ onClick: l,
250
+ variant: t = "primary",
251
+ size: a = "md",
252
+ icon: o,
253
+ options: i,
254
+ disabled: h = !1
255
+ }) {
256
+ const [g, f] = V(!1), b = Q(null), m = ae(() => {
257
+ f((n) => !n);
258
+ }, []);
259
+ return G(() => {
260
+ const n = (d) => {
261
+ b.current && !b.current.contains(d.target) && f(!1);
262
+ };
263
+ return document.addEventListener("mousedown", n), () => document.removeEventListener("mousedown", n);
264
+ }, []), /* @__PURE__ */ c("div", { ref: b, className: "relative inline-flex items-center gap-px", children: [
265
+ /* @__PURE__ */ c(
266
+ "button",
267
+ {
268
+ type: "button",
269
+ onClick: l,
270
+ disabled: h,
271
+ className: x(
272
+ "inline-flex items-center justify-center font-medium transition-colors duration-200",
273
+ "focus:outline-none focus:ring-1 focus:ring-offset-1",
274
+ "disabled:opacity-50 disabled:cursor-not-allowed",
275
+ Ce[t],
276
+ He[a],
277
+ "!rounded-r-none"
278
+ ),
279
+ children: [
280
+ o && /* @__PURE__ */ e("span", { className: "mr-2 flex-shrink-0", children: o }),
281
+ r
282
+ ]
283
+ }
284
+ ),
285
+ /* @__PURE__ */ e(
286
+ "button",
287
+ {
288
+ type: "button",
289
+ onClick: m,
290
+ disabled: h,
291
+ className: x(
292
+ "inline-flex items-center justify-center font-medium transition-colors duration-200",
293
+ "focus:outline-none focus:ring-1 focus:ring-offset-1",
294
+ "disabled:opacity-50 disabled:cursor-not-allowed",
295
+ Ce[t],
296
+ a === "sm" ? "px-1.5 py-1.5" : "px-2 py-2",
297
+ "!rounded-l-none"
298
+ ),
299
+ children: /* @__PURE__ */ e(je, { className: "h-4 w-4" })
300
+ }
301
+ ),
302
+ g && i.length > 0 && /* @__PURE__ */ e("div", { className: "absolute right-0 top-full mt-1 z-50 min-w-[160px] rounded-lg border border-gray-200 bg-white shadow-lg py-1", children: i.map((n) => /* @__PURE__ */ e(
303
+ "button",
304
+ {
305
+ type: "button",
306
+ onClick: () => {
307
+ n.onClick(), f(!1);
308
+ },
309
+ className: x(
310
+ "w-full text-left px-3 py-2 text-sm hover:bg-gray-50 transition-colors",
311
+ n.variant === "destructive" ? "text-red-600 hover:bg-red-50" : "text-gray-700"
312
+ ),
313
+ children: n.label
314
+ },
315
+ n.id
316
+ )) })
317
+ ] });
318
+ }
319
+ const Ke = {
240
320
  sm: "h-4 w-4",
241
321
  md: "h-5 w-5",
242
322
  lg: "h-6 w-6",
243
323
  full: "h-6 w-6"
244
- }, qe = {
324
+ }, Ge = {
245
325
  sm: "text-sm",
246
326
  md: "text-sm",
247
327
  lg: "text-base",
@@ -254,46 +334,46 @@ const _r = ({
254
334
  size: a = "md",
255
335
  indeterminate: o = !1,
256
336
  containerClassName: i,
257
- labelClassName: f,
258
- className: p,
259
- id: x,
260
- ...v
337
+ labelClassName: h,
338
+ className: g,
339
+ id: f,
340
+ ...b
261
341
  }, m) => {
262
- const s = x || `checkbox-${Math.random().toString(36).substr(2, 9)}`, d = !!t;
342
+ const n = f || `checkbox-${Math.random().toString(36).substr(2, 9)}`, d = !!t;
263
343
  return se.useEffect(() => {
264
344
  m && typeof m == "object" && m.current && (m.current.indeterminate = o);
265
- }, [o, m]), /* @__PURE__ */ c("div", { className: b("flex flex-col", i), children: [
345
+ }, [o, m]), /* @__PURE__ */ c("div", { className: x("flex flex-col", i), children: [
266
346
  /* @__PURE__ */ c("div", { className: "flex items-start", children: [
267
347
  /* @__PURE__ */ e("div", { className: "flex items-center h-5", children: /* @__PURE__ */ e(
268
348
  "input",
269
349
  {
270
350
  ref: m,
271
- id: s,
351
+ id: n,
272
352
  type: "checkbox",
273
- className: b(
353
+ className: x(
274
354
  // Base styles
275
355
  "rounded border transition-colors duration-200",
276
356
  "focus:ring-2 focus:ring-offset-2 focus:outline-none",
277
357
  "disabled:opacity-50 disabled:cursor-not-allowed",
278
358
  // Size styles
279
- Re[a],
359
+ Ke[a],
280
360
  // State styles
281
361
  d ? "border-error text-error focus:border-error focus:ring-error" : "border-gray-100 text-primary focus:border-primary focus:ring-primary dark:border-gray-600 dark:bg-secondary-800",
282
- p
362
+ g
283
363
  ),
284
- ...v
364
+ ...b
285
365
  }
286
366
  ) }),
287
367
  r && /* @__PURE__ */ c("div", { className: "ml-3 flex-1", children: [
288
368
  /* @__PURE__ */ e(
289
369
  "label",
290
370
  {
291
- htmlFor: s,
292
- className: b(
371
+ htmlFor: n,
372
+ className: x(
293
373
  "font-medium cursor-pointer",
294
374
  d ? "text-error" : "text-secondary-900 dark:text-secondary-100",
295
- qe[a],
296
- f
375
+ Ge[a],
376
+ h
297
377
  ),
298
378
  children: r
299
379
  }
@@ -306,55 +386,55 @@ const _r = ({
306
386
  }
307
387
  );
308
388
  be.displayName = "Checkbox";
309
- const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), Ue = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "m15 18-6-6 6-6" }) }), Ke = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "m9 18 6-6-6-6" }) }), ye = ce(({
389
+ const Je = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), Ye = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "m15 18-6-6 6-6" }) }), Ze = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "m9 18 6-6-6-6" }) }), ye = ce(({
310
390
  value: r,
311
391
  onChange: l,
312
392
  placeholder: t = "Select date",
313
393
  disabled: a = !1,
314
394
  required: o = !1,
315
395
  size: i = "md",
316
- className: f,
317
- minDate: p,
318
- maxDate: x,
319
- format: v = "MM/dd/yyyy"
396
+ className: h,
397
+ minDate: g,
398
+ maxDate: f,
399
+ format: b = "MM/dd/yyyy"
320
400
  }, m) => {
321
- const [s, d] = O(!1), [h, N] = O(() => r || /* @__PURE__ */ new Date()), y = ee(null);
322
- J(() => {
323
- const z = (g) => {
324
- y.current && !y.current.contains(g.target) && d(!1);
401
+ const [n, d] = V(!1), [p, N] = V(() => r || /* @__PURE__ */ new Date()), v = Q(null);
402
+ G(() => {
403
+ const z = (y) => {
404
+ v.current && !v.current.contains(y.target) && d(!1);
325
405
  };
326
- return s && document.addEventListener("mousedown", z), () => {
406
+ return n && document.addEventListener("mousedown", z), () => {
327
407
  document.removeEventListener("mousedown", z);
328
408
  };
329
- }, [s]);
409
+ }, [n]);
330
410
  const S = (z) => {
331
411
  if (!z) return "";
332
- const g = z.getDate().toString().padStart(2, "0"), A = (z.getMonth() + 1).toString().padStart(2, "0"), u = z.getFullYear();
333
- switch (v) {
412
+ const y = z.getDate().toString().padStart(2, "0"), T = (z.getMonth() + 1).toString().padStart(2, "0"), u = z.getFullYear();
413
+ switch (b) {
334
414
  case "dd/MM/yyyy":
335
- return `${g}/${A}/${u}`;
415
+ return `${y}/${T}/${u}`;
336
416
  case "yyyy-MM-dd":
337
- return `${u}-${A}-${g}`;
417
+ return `${u}-${T}-${y}`;
338
418
  case "MM/dd/yyyy":
339
419
  default:
340
- return `${A}/${g}/${u}`;
420
+ return `${T}/${y}/${u}`;
341
421
  }
342
422
  }, B = () => {
343
- const z = h.getFullYear(), g = h.getMonth(), A = new Date(z, g, 1), u = new Date(A);
344
- u.setDate(u.getDate() - A.getDay());
423
+ const z = p.getFullYear(), y = p.getMonth(), T = new Date(z, y, 1), u = new Date(T);
424
+ u.setDate(u.getDate() - T.getDay());
345
425
  const $ = [], L = new Date(u);
346
426
  for (let D = 0; D < 42; D++)
347
427
  $.push(new Date(L)), L.setDate(L.getDate() + 1);
348
428
  return $;
349
429
  }, k = (z) => {
350
- z.getMonth() === h.getMonth() && (p && z < p || x && z > x || (l?.(z), d(!1)));
430
+ z.getMonth() === p.getMonth() && (g && z < g || f && z > f || (l?.(z), d(!1)));
351
431
  }, q = () => {
352
- N(new Date(h.getFullYear(), h.getMonth() - 1, 1));
432
+ N(new Date(p.getFullYear(), p.getMonth() - 1, 1));
353
433
  }, K = () => {
354
- N(new Date(h.getFullYear(), h.getMonth() + 1, 1));
434
+ N(new Date(p.getFullYear(), p.getMonth() + 1, 1));
355
435
  }, H = () => {
356
436
  l?.(null), d(!1);
357
- }, _ = b(
437
+ }, F = x(
358
438
  "w-full border border-neutral-100 dark:border-neutral-600 rounded-md transition-colors duration-200",
359
439
  "bg-white dark:bg-neutral-800 text-gray-700 dark:text-gray-300",
360
440
  "placeholder:text-gray-800 dark:placeholder:text-gray-500",
@@ -366,8 +446,8 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
366
446
  "px-4 py-3 text-lg": i === "lg",
367
447
  "px-4 py-3 text-base": i === "full"
368
448
  },
369
- f
370
- ), E = B(), G = [
449
+ h
450
+ ), M = B(), J = [
371
451
  "January",
372
452
  "February",
373
453
  "March",
@@ -381,7 +461,7 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
381
461
  "November",
382
462
  "December"
383
463
  ];
384
- return /* @__PURE__ */ c("div", { ref: y, className: "relative", children: [
464
+ return /* @__PURE__ */ c("div", { ref: v, className: "relative", children: [
385
465
  /* @__PURE__ */ c("div", { className: "relative", children: [
386
466
  /* @__PURE__ */ e(
387
467
  "input",
@@ -393,57 +473,57 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
393
473
  disabled: a,
394
474
  required: o,
395
475
  readOnly: !0,
396
- onClick: () => !a && d(!s),
397
- className: b(_, "pr-10 cursor-pointer")
476
+ onClick: () => !a && d(!n),
477
+ className: x(F, "pr-10 cursor-pointer")
398
478
  }
399
479
  ),
400
480
  /* @__PURE__ */ e(
401
481
  "button",
402
482
  {
403
483
  type: "button",
404
- onClick: () => !a && d(!s),
484
+ onClick: () => !a && d(!n),
405
485
  disabled: a,
406
486
  className: "absolute inset-y-0 right-0 flex items-center pr-3 text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-300",
407
- children: /* @__PURE__ */ e(He, {})
487
+ children: /* @__PURE__ */ e(Je, {})
408
488
  }
409
489
  )
410
490
  ] }),
411
- s && /* @__PURE__ */ c("div", { className: "absolute z-50 mt-1 bg-white dark:bg-neutral-800 border border-neutral-100 dark:border-neutral-600 rounded-md shadow-lg p-4 min-w-[280px]", children: [
491
+ n && /* @__PURE__ */ c("div", { className: "absolute z-50 mt-1 bg-white dark:bg-neutral-800 border border-neutral-100 dark:border-neutral-600 rounded-md shadow-lg p-4 min-w-[280px]", children: [
412
492
  /* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-4", children: [
413
493
  /* @__PURE__ */ e(
414
494
  "button",
415
495
  {
416
496
  onClick: q,
417
497
  className: "p-1 hover:bg-neutral-100 dark:hover:bg-neutral-700 rounded",
418
- children: /* @__PURE__ */ e(Ue, {})
498
+ children: /* @__PURE__ */ e(Ye, {})
419
499
  }
420
500
  ),
421
501
  /* @__PURE__ */ c("h3", { className: "text-sm font-medium text-neutral-900 dark:text-neutral-100", children: [
422
- G[h.getMonth()],
502
+ J[p.getMonth()],
423
503
  " ",
424
- h.getFullYear()
504
+ p.getFullYear()
425
505
  ] }),
426
506
  /* @__PURE__ */ e(
427
507
  "button",
428
508
  {
429
509
  onClick: K,
430
510
  className: "p-1 hover:bg-neutral-100 dark:hover:bg-neutral-700 rounded",
431
- children: /* @__PURE__ */ e(Ke, {})
511
+ children: /* @__PURE__ */ e(Ze, {})
432
512
  }
433
513
  )
434
514
  ] }),
435
515
  /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((z) => /* @__PURE__ */ e("div", { className: "text-xs font-medium text-neutral-500 dark:text-neutral-400 text-center py-1", children: z }, z)) }),
436
- /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: E.map((z, g) => {
437
- const A = z.getMonth() === h.getMonth(), u = r && z.toDateString() === r.toDateString(), $ = z.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), L = !A || p && z < p || x && z > x;
516
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: M.map((z, y) => {
517
+ const T = z.getMonth() === p.getMonth(), u = r && z.toDateString() === r.toDateString(), $ = z.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), L = !T || g && z < g || f && z > f;
438
518
  return /* @__PURE__ */ e(
439
519
  "button",
440
520
  {
441
521
  onClick: () => !L && k(z),
442
522
  disabled: L,
443
- className: b(
523
+ className: x(
444
524
  "w-8 h-8 text-sm rounded transition-colors duration-200",
445
525
  {
446
- "text-neutral-900 dark:text-neutral-100 hover:bg-neutral-100 dark:hover:bg-neutral-700": A && !u && !L,
526
+ "text-neutral-900 dark:text-neutral-100 hover:bg-neutral-100 dark:hover:bg-neutral-700": T && !u && !L,
447
527
  "bg-primary text-white": u,
448
528
  "bg-neutral-100 dark:bg-neutral-700 text-neutral-900 dark:text-neutral-100": $ && !u,
449
529
  "text-neutral-300 dark:text-neutral-600 cursor-not-allowed": L
@@ -451,7 +531,7 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
451
531
  ),
452
532
  children: z.getDate()
453
533
  },
454
- g
534
+ y
455
535
  );
456
536
  }) }),
457
537
  /* @__PURE__ */ c("div", { className: "flex justify-between items-center mt-4 pt-3 border-t border-neutral-200 dark:border-neutral-700", children: [
@@ -474,7 +554,7 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
474
554
  ] })
475
555
  ] })
476
556
  ] });
477
- }), de = (...r) => r.filter(Boolean).join(" "), Ge = (r) => /* @__PURE__ */ e(
557
+ }), de = (...r) => r.filter(Boolean).join(" "), Xe = (r) => /* @__PURE__ */ e(
478
558
  "svg",
479
559
  {
480
560
  ...r,
@@ -492,7 +572,7 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
492
572
  }
493
573
  )
494
574
  }
495
- ), Je = (r) => /* @__PURE__ */ e(
575
+ ), Qe = (r) => /* @__PURE__ */ e(
496
576
  "svg",
497
577
  {
498
578
  ...r,
@@ -510,57 +590,57 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
510
590
  }
511
591
  )
512
592
  }
513
- ), Ye = {
593
+ ), er = {
514
594
  sm: "px-3 py-1.5 text-sm",
515
595
  md: "px-3 py-2 text-sm",
516
596
  lg: "px-3 py-2 text-sm",
517
597
  full: "px-3 py-2 text-sm"
518
- }, pe = {
598
+ }, xe = {
519
599
  sm: "h-4 w-4",
520
600
  md: "h-5 w-5",
521
601
  lg: "h-6 w-6",
522
602
  full: "h-6 w-6"
523
- }, Ze = ce(
603
+ }, rr = ce(
524
604
  ({
525
605
  label: r,
526
606
  helperText: l,
527
607
  error: t,
528
608
  size: a = "md",
529
609
  fullWidth: o = !1,
530
- startIcon: i = /* @__PURE__ */ e(Ge, {}),
531
- loading: f = !1,
532
- containerClassName: p,
533
- labelClassName: x,
534
- className: v,
610
+ startIcon: i = /* @__PURE__ */ e(Xe, {}),
611
+ loading: h = !1,
612
+ containerClassName: g,
613
+ labelClassName: f,
614
+ className: b,
535
615
  id: m,
536
- options: s,
616
+ options: n,
537
617
  onRemoteSearch: d,
538
- onSelect: h,
618
+ onSelect: p,
539
619
  debounceTime: N = 500,
540
- value: y,
620
+ value: v,
541
621
  onChange: S,
542
622
  ...B
543
623
  }, k) => {
544
- const q = m || `searchfield-${Math.random().toString(36).substr(2, 9)}`, K = !!t, H = ee(null), _ = ee(null), [E, G] = O(y || ""), [z, g] = O(!1), [A, u] = O(!1);
545
- J(() => {
546
- y !== void 0 && G(y);
547
- }, [y]);
624
+ const q = m || `searchfield-${Math.random().toString(36).substr(2, 9)}`, K = !!t, H = Q(null), F = Q(null), [M, J] = V(v || ""), [z, y] = V(!1), [T, u] = V(!1);
625
+ G(() => {
626
+ v !== void 0 && J(v);
627
+ }, [v]);
548
628
  const $ = ie(() => {
549
- if (!E) return s;
550
- const W = String(E).toLowerCase();
551
- return s.filter(
629
+ if (!M) return n;
630
+ const W = String(M).toLowerCase();
631
+ return n.filter(
552
632
  (C) => String(C.label).toLowerCase().includes(W)
553
633
  );
554
- }, [E, s]);
555
- J(() => {
556
- if (!d || !E) {
634
+ }, [M, n]);
635
+ G(() => {
636
+ if (!d || !M) {
557
637
  u(!1);
558
638
  return;
559
639
  }
560
640
  const W = setTimeout(async () => {
561
641
  u(!0);
562
642
  try {
563
- await d(String(E));
643
+ await d(String(M));
564
644
  } catch (C) {
565
645
  console.error("Remote search failed:", C);
566
646
  } finally {
@@ -570,27 +650,27 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
570
650
  return () => {
571
651
  clearTimeout(W), u(!1);
572
652
  };
573
- }, [E, N, d]), J(() => {
653
+ }, [M, N, d]), G(() => {
574
654
  const W = (C) => {
575
- H.current && !H.current.contains(C.target) && g(!1);
655
+ H.current && !H.current.contains(C.target) && y(!1);
576
656
  };
577
657
  return document.addEventListener("mousedown", W), () => document.removeEventListener("mousedown", W);
578
658
  }, []);
579
659
  const L = (W) => {
580
660
  const C = W.target.value;
581
- G(C), g(!0), S && S(W);
661
+ J(C), y(!0), S && S(W);
582
662
  }, D = (W) => {
583
- G(W.label), g(!1), h && h(W.value);
663
+ J(W.label), y(!1), p && p(W.value);
584
664
  }, P = () => {
585
- (s.length > 0 || d) && g(!0);
586
- }, M = f || A, re = z && ($.length > 0 || M), ae = ie(() => k || _, [k]);
665
+ (n.length > 0 || d) && y(!0);
666
+ }, E = h || T, re = z && ($.length > 0 || E), ne = ie(() => k || F, [k]);
587
667
  return /* @__PURE__ */ c(
588
668
  "div",
589
669
  {
590
670
  className: de(
591
671
  "flex flex-col",
592
672
  o ? "w-full" : "",
593
- p || "",
673
+ g || "",
594
674
  "relative"
595
675
  ),
596
676
  ref: H,
@@ -602,19 +682,19 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
602
682
  className: de(
603
683
  "block text-sm font-medium mb-1",
604
684
  K ? "text-red-500" : "text-gray-700 dark:text-gray-300",
605
- x || ""
685
+ f || ""
606
686
  ),
607
687
  children: r
608
688
  }
609
689
  ),
610
690
  /* @__PURE__ */ c("div", { className: "relative", children: [
611
- i && /* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className: de("text-gray-400", pe[a]), children: i }) }),
691
+ i && /* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className: de("text-gray-400", xe[a]), children: i }) }),
612
692
  /* @__PURE__ */ e(
613
693
  "input",
614
694
  {
615
- ref: ae,
695
+ ref: ne,
616
696
  id: q,
617
- value: E,
697
+ value: M,
618
698
  onChange: L,
619
699
  onFocus: P,
620
700
  className: de(
@@ -623,24 +703,24 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
623
703
  "placeholder-gray-500 dark:placeholder-gray-500 focus:outline-none",
624
704
  "disabled:opacity-50 disabled:cursor-not-allowed",
625
705
  // Size styles
626
- Ye[a],
706
+ er[a],
627
707
  // Icon padding
628
708
  i ? "pl-10" : "",
629
709
  "pr-10",
630
710
  // Altijd padding rechts voor de dropdown/loading icon
631
711
  // State styles
632
712
  K ? "border-red-500 text-red-500 focus:border-red-500 focus:ring-red-500" : "border-gray-300 text-gray-900 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-100",
633
- v || ""
713
+ b || ""
634
714
  ),
635
715
  ...B
636
716
  }
637
717
  ),
638
- /* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: M || f ? (
718
+ /* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: E || h ? (
639
719
  // Loading Spinner
640
720
  /* @__PURE__ */ c(
641
721
  "svg",
642
722
  {
643
- className: de("animate-spin text-blue-500", pe[a]),
723
+ className: de("animate-spin text-blue-500", xe[a]),
644
724
  xmlns: "http://www.w3.org/2000/svg",
645
725
  fill: "none",
646
726
  viewBox: "0 0 24 24",
@@ -670,14 +750,14 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
670
750
  ) : (
671
751
  // Dropdown Chevron
672
752
  /* @__PURE__ */ e(
673
- Je,
753
+ Qe,
674
754
  {
675
755
  className: de(
676
756
  "text-gray-400 cursor-pointer transition-transform",
677
- pe[a],
757
+ xe[a],
678
758
  z ? "rotate-180" : "rotate-0"
679
759
  ),
680
- onClick: () => g((W) => !W)
760
+ onClick: () => y((W) => !W)
681
761
  }
682
762
  )
683
763
  ) })
@@ -693,11 +773,11 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
693
773
  className: "px-4 py-2 cursor-pointer text-gray-900 dark:text-gray-100 hover:bg-blue-500 hover:text-white transition-colors",
694
774
  onClick: () => D(W),
695
775
  role: "option",
696
- "aria-selected": E === W.label,
776
+ "aria-selected": M === W.label,
697
777
  children: W.label
698
778
  },
699
779
  W.value
700
- )) : /* @__PURE__ */ e("li", { className: "px-4 py-2 text-gray-500 dark:text-gray-400", children: M || f ? "Zoeken op afstand..." : "Geen resultaten gevonden." })
780
+ )) : /* @__PURE__ */ e("li", { className: "px-4 py-2 text-gray-500 dark:text-gray-400", children: E || h ? "Zoeken op afstand..." : "Geen resultaten gevonden." })
701
781
  }
702
782
  ),
703
783
  (t || l) && /* @__PURE__ */ e(
@@ -712,15 +792,15 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
712
792
  ),
713
793
  d && /* @__PURE__ */ c("p", { className: "mt-2 text-xs text-green-600 dark:text-green-400", children: [
714
794
  "Huidige zoekterm (niet-gedebounced): ",
715
- String(E)
795
+ String(M)
716
796
  ] })
717
797
  ]
718
798
  }
719
799
  );
720
800
  }
721
801
  );
722
- Ze.displayName = "SearchableTextField";
723
- const Xe = {
802
+ rr.displayName = "SearchableTextField";
803
+ const tr = {
724
804
  sm: "px-3 py-1.5 text-sm",
725
805
  md: "px-3 py-2 text-sm",
726
806
  lg: "px-3 py-2 text-sm",
@@ -733,80 +813,80 @@ const Xe = {
733
813
  size: a = "md",
734
814
  fullWidth: o = !1,
735
815
  options: i,
736
- placeholder: f,
737
- containerClassName: p,
738
- labelClassName: x,
739
- className: v,
816
+ placeholder: h,
817
+ containerClassName: g,
818
+ labelClassName: f,
819
+ className: b,
740
820
  id: m,
741
- searchable: s,
821
+ searchable: n,
742
822
  multiple: d,
743
- value: h,
823
+ value: p,
744
824
  onChange: N,
745
- allowCreate: y,
825
+ allowCreate: v,
746
826
  onCreateOption: S,
747
827
  ...B
748
828
  }, k) => {
749
- const q = m || `select-${Math.random().toString(36).substr(2, 9)}`, K = !!t, [H, _] = se.useState(!1), [E, G] = se.useState(""), z = se.useRef(null), [g, A] = se.useState(i);
829
+ const q = m || `select-${Math.random().toString(36).substr(2, 9)}`, K = !!t, [H, F] = se.useState(!1), [M, J] = se.useState(""), z = se.useRef(null), [y, T] = se.useState(i);
750
830
  se.useImperativeHandle(k, () => z.current), se.useEffect(() => {
751
831
  const C = (I) => {
752
- z.current && !z.current.contains(I.target) && _(!1);
832
+ z.current && !z.current.contains(I.target) && F(!1);
753
833
  };
754
834
  return document.addEventListener("mousedown", C), () => document.removeEventListener("mousedown", C);
755
835
  }, []);
756
836
  const u = se.useCallback(
757
837
  (C, I) => C.some(
758
- (F) => me(F.value) === me(I) || me(F.label) === me(I)
838
+ (O) => me(O.value) === me(I) || me(O.label) === me(I)
759
839
  ),
760
840
  []
761
841
  ), $ = se.useCallback(
762
842
  (C, I) => {
763
- const F = [...C], T = (X) => {
843
+ const O = [...C], A = (X) => {
764
844
  const te = (X ?? "").trim();
765
- te && (u(F, te) || F.push({ value: te, label: te }));
845
+ te && (u(O, te) || O.push({ value: te, label: te }));
766
846
  };
767
- return Array.isArray(I) ? I.forEach(T) : T(I), F;
847
+ return Array.isArray(I) ? I.forEach(A) : A(I), O;
768
848
  },
769
849
  [u]
770
850
  );
771
851
  se.useEffect(() => {
772
- A((C) => {
852
+ T((C) => {
773
853
  const I = [...i];
774
- return C.forEach((F) => {
775
- !u(I, F.value) && !u(I, F.label) && I.push(F);
776
- }), $(I, h);
854
+ return C.forEach((O) => {
855
+ !u(I, O.value) && !u(I, O.label) && I.push(O);
856
+ }), $(I, p);
777
857
  });
778
- }, [i, h, $, u]);
858
+ }, [i, p, $, u]);
779
859
  const L = (C) => {
780
860
  if (d) {
781
- const I = Array.isArray(h) ? h : [], F = I.includes(C) ? I.filter((T) => T !== C) : [...I, C];
782
- N?.(F);
861
+ const I = Array.isArray(p) ? p : [], O = I.includes(C) ? I.filter((A) => A !== C) : [...I, C];
862
+ N?.(O);
783
863
  } else
784
- N?.(C), _(!1), G("");
785
- }, D = d ? null : g.find((C) => C.value === h), P = d ? g.filter(
786
- (C) => Array.isArray(h) && h.includes(C.value)
787
- ) : [], M = s && E ? g.filter(
788
- (C) => C.label.toLowerCase().includes(E.toLowerCase())
789
- ) : g, re = !!y && !!s && !!E.trim() && !u(g, E), ae = (C) => {
864
+ N?.(C), F(!1), J("");
865
+ }, D = d ? null : y.find((C) => C.value === p), P = d ? y.filter(
866
+ (C) => Array.isArray(p) && p.includes(C.value)
867
+ ) : [], E = n && M ? y.filter(
868
+ (C) => C.label.toLowerCase().includes(M.toLowerCase())
869
+ ) : y, re = !!v && !!n && !!M.trim() && !u(y, M), ne = (C) => {
790
870
  const I = C.trim();
791
871
  if (!I) return;
792
- const F = S?.(I) ?? {
872
+ const O = S?.(I) ?? {
793
873
  value: I,
794
874
  label: I
795
875
  };
796
- if (u(g, F.value) || u(g, F.label)) {
797
- L(F.value), G(""), d || _(!1);
876
+ if (u(y, O.value) || u(y, O.label)) {
877
+ L(O.value), J(""), d || F(!1);
798
878
  return;
799
879
  }
800
- A((T) => [...T, F]), L(F.value), G(""), d || _(!1);
801
- }, W = () => d ? P.length > 0 ? P.map((C) => C.label).join(", ") : f || "Select options" : D?.label || f || "Select an option";
880
+ T((A) => [...A, O]), L(O.value), J(""), d || F(!1);
881
+ }, W = () => d ? P.length > 0 ? P.map((C) => C.label).join(", ") : h || "Select options" : D?.label || h || "Select an option";
802
882
  return /* @__PURE__ */ c(
803
883
  "div",
804
884
  {
805
885
  ref: z,
806
- className: b(
886
+ className: x(
807
887
  "relative flex flex-col",
808
888
  o && "w-full",
809
- p
889
+ g
810
890
  ),
811
891
  ...B,
812
892
  children: [
@@ -814,11 +894,11 @@ const Xe = {
814
894
  "label",
815
895
  {
816
896
  htmlFor: q,
817
- onClick: () => _(!H),
818
- className: b(
897
+ onClick: () => F(!H),
898
+ className: x(
819
899
  "block text-sm font-medium mb-1",
820
900
  K ? "text-error" : "text-secondary-700 dark:text-secondary-300",
821
- x
901
+ f
822
902
  ),
823
903
  children: r
824
904
  }
@@ -829,31 +909,31 @@ const Xe = {
829
909
  {
830
910
  type: "button",
831
911
  id: q,
832
- onClick: () => _(!H),
833
- className: b(
912
+ onClick: () => F(!H),
913
+ className: x(
834
914
  "block w-full rounded-lg border transition-colors duration-200 text-left",
835
915
  "focus:outline-none focus:ring-0 focus:ring-offset-0",
836
916
  "disabled:opacity-50 disabled:cursor-not-allowed",
837
917
  "bg-white dark:bg-secondary-800",
838
- Xe[a],
918
+ tr[a],
839
919
  K ? "border-error text-error focus:border-error focus:ring-error" : "border-neutral text-secondary-900 dark:border-neutral-700 dark:bg-secondary-800 dark:text-secondary-100",
840
- v
920
+ b
841
921
  ),
842
922
  children: /* @__PURE__ */ e("span", { className: "block truncate", children: W() })
843
923
  }
844
924
  ),
845
925
  H && /* @__PURE__ */ c("div", { className: "absolute z-10 mt-1 w-full rounded-md bg-white dark:bg-secondary-800 shadow-lg border border-neutral dark:border-neutral-700", children: [
846
- s && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e(
926
+ n && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e(
847
927
  "input",
848
928
  {
849
929
  type: "text",
850
930
  placeholder: "Search...",
851
- value: E,
852
- onChange: (C) => G(C.target.value),
931
+ value: M,
932
+ onChange: (C) => J(C.target.value),
853
933
  onKeyDown: (C) => {
854
- C.key === "Enter" && re && (C.preventDefault(), ae(E));
934
+ C.key === "Enter" && re && (C.preventDefault(), ne(M));
855
935
  },
856
- className: b(
936
+ className: x(
857
937
  "w-full px-3 py-2 text-sm rounded-md border",
858
938
  "text-secondary-900 border-gray-100 dark:border-gray-600 focus:outline-none focus:ring-0"
859
939
  )
@@ -862,36 +942,36 @@ const Xe = {
862
942
  re && /* @__PURE__ */ c(
863
943
  "div",
864
944
  {
865
- className: b(
945
+ className: x(
866
946
  "px-4 py-2 text-sm cursor-pointer",
867
947
  "text-primary hover:bg-gray-100 dark:hover:bg-secondary-700"
868
948
  ),
869
- onClick: () => ae(E),
949
+ onClick: () => ne(M),
870
950
  children: [
871
951
  "+: “",
872
- E.trim(),
952
+ M.trim(),
873
953
  "”"
874
954
  ]
875
955
  }
876
956
  ),
877
957
  /* @__PURE__ */ c("ul", { className: "max-h-60 overflow-auto py-1", children: [
878
- f && !d && /* @__PURE__ */ e(
958
+ h && !d && /* @__PURE__ */ e(
879
959
  "li",
880
960
  {
881
961
  className: "px-4 py-2 text-sm text-secondary-500 cursor-pointer hover:bg-gray-100 dark:hover:bg-secondary-700",
882
962
  onClick: () => {
883
- N?.(""), _(!1);
963
+ N?.(""), F(!1);
884
964
  },
885
- children: f
965
+ children: h
886
966
  }
887
967
  ),
888
- M.map((C) => {
889
- const I = d ? Array.isArray(h) && h.includes(C.value) : h === C.value;
968
+ E.map((C) => {
969
+ const I = d ? Array.isArray(p) && p.includes(C.value) : p === C.value;
890
970
  return /* @__PURE__ */ e(
891
971
  "li",
892
972
  {
893
973
  onClick: () => !C.disabled && L(C.value),
894
- className: b(
974
+ className: x(
895
975
  "px-4 py-2 text-sm cursor-pointer",
896
976
  "text-secondary-900 dark:text-secondary-100",
897
977
  C.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-gray-100 dark:hover:bg-secondary-700",
@@ -919,7 +999,7 @@ const Xe = {
919
999
  (t || l) && /* @__PURE__ */ e(
920
1000
  "p",
921
1001
  {
922
- className: b(
1002
+ className: x(
923
1003
  "mt-1 text-xs",
924
1004
  K ? "text-error" : "text-secondary-500"
925
1005
  ),
@@ -932,7 +1012,7 @@ const Xe = {
932
1012
  }
933
1013
  );
934
1014
  ve.displayName = "Select";
935
- const Qe = {
1015
+ const ar = {
936
1016
  sm: "px-3 py-1.5 text-sm",
937
1017
  md: "px-3 py-2 text-sm",
938
1018
  lg: "px-4 py-3 text-base",
@@ -945,23 +1025,23 @@ const Qe = {
945
1025
  size: a = "md",
946
1026
  fullWidth: o = !1,
947
1027
  loading: i = !1,
948
- containerClassName: f,
949
- labelClassName: p,
950
- className: x,
951
- id: v,
1028
+ containerClassName: h,
1029
+ labelClassName: g,
1030
+ className: f,
1031
+ id: b,
952
1032
  rows: m = 4,
953
- ...s
1033
+ ...n
954
1034
  }, d) => {
955
- const h = v || `textarea-${Math.random().toString(36).substr(2, 9)}`, N = !!t;
956
- return /* @__PURE__ */ c("div", { className: b("flex flex-col", o && "w-full", f), children: [
1035
+ const p = b || `textarea-${Math.random().toString(36).substr(2, 9)}`, N = !!t;
1036
+ return /* @__PURE__ */ c("div", { className: x("flex flex-col", o && "w-full", h), children: [
957
1037
  r && /* @__PURE__ */ e(
958
1038
  "label",
959
1039
  {
960
- htmlFor: h,
961
- className: b(
1040
+ htmlFor: p,
1041
+ className: x(
962
1042
  "block text-sm font-medium mb-1",
963
1043
  N ? "text-error" : "text-secondary-700 dark:text-secondary-300",
964
- p
1044
+ g
965
1045
  ),
966
1046
  children: r
967
1047
  }
@@ -971,20 +1051,20 @@ const Qe = {
971
1051
  "textarea",
972
1052
  {
973
1053
  ref: d,
974
- id: h,
1054
+ id: p,
975
1055
  rows: m,
976
- className: b(
1056
+ className: x(
977
1057
  // Base styles
978
1058
  "block w-full rounded-lg border transition-colors duration-200 resize-vertical",
979
1059
  "placeholder-secondary-400 focus:outline-none focus:ring-0",
980
1060
  "disabled:opacity-50 disabled:cursor-not-allowed",
981
1061
  // Size styles
982
- Qe[a],
1062
+ ar[a],
983
1063
  // State styles
984
1064
  N ? "border-error text-error focus:border-error focus:ring-error" : "border-gray-100 text-secondary-900 dark:border-gray-600 dark:bg-secondary-800 dark:text-secondary-100",
985
- x
1065
+ f
986
1066
  ),
987
- ...s
1067
+ ...n
988
1068
  }
989
1069
  ),
990
1070
  i && /* @__PURE__ */ e("div", { className: "absolute top-3 right-3", children: /* @__PURE__ */ c(
@@ -1020,7 +1100,7 @@ const Qe = {
1020
1100
  (t || l) && /* @__PURE__ */ e(
1021
1101
  "p",
1022
1102
  {
1023
- className: b(
1103
+ className: x(
1024
1104
  "mt-1 text-xs",
1025
1105
  N ? "text-error" : "text-secondary-500"
1026
1106
  ),
@@ -1031,7 +1111,7 @@ const Qe = {
1031
1111
  }
1032
1112
  );
1033
1113
  ke.displayName = "TextArea";
1034
- const er = {
1114
+ const nr = {
1035
1115
  sm: "px-3 py-1.5 text-sm",
1036
1116
  md: "px-3 py-2 text-sm",
1037
1117
  lg: "px-3 py-2 text-sm",
@@ -1049,57 +1129,57 @@ const er = {
1049
1129
  size: a = "md",
1050
1130
  fullWidth: o = !1,
1051
1131
  startIcon: i,
1052
- endIcon: f,
1053
- loading: p = !1,
1054
- containerClassName: x,
1055
- labelClassName: v,
1132
+ endIcon: h,
1133
+ loading: g = !1,
1134
+ containerClassName: f,
1135
+ labelClassName: b,
1056
1136
  className: m,
1057
- id: s,
1137
+ id: n,
1058
1138
  ...d
1059
- }, h) => {
1060
- const N = s || `textfield-${Math.random().toString(36).substr(2, 9)}`, y = !!t;
1061
- return /* @__PURE__ */ c("div", { className: b("flex flex-col", o && "w-full", x), children: [
1139
+ }, p) => {
1140
+ const N = n || `textfield-${Math.random().toString(36).substr(2, 9)}`, v = !!t;
1141
+ return /* @__PURE__ */ c("div", { className: x("flex flex-col", o && "w-full", f), children: [
1062
1142
  r && /* @__PURE__ */ e(
1063
1143
  "label",
1064
1144
  {
1065
1145
  htmlFor: N,
1066
- className: b(
1146
+ className: x(
1067
1147
  "block text-sm font-medium mb-1",
1068
- y ? "text-error" : "text-secondary-700 dark:text-secondary-300",
1069
- v
1148
+ v ? "text-error" : "text-secondary-700 dark:text-secondary-300",
1149
+ b
1070
1150
  ),
1071
1151
  children: r
1072
1152
  }
1073
1153
  ),
1074
1154
  /* @__PURE__ */ c("div", { className: "relative", children: [
1075
1155
  i && // Todo fix inset not showing correctly on different sizes
1076
- /* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className: b("text-secondary-400", ge[a]), children: i }) }),
1156
+ /* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className: x("text-secondary-400", ge[a]), children: i }) }),
1077
1157
  /* @__PURE__ */ e(
1078
1158
  "input",
1079
1159
  {
1080
- ref: h,
1160
+ ref: p,
1081
1161
  id: N,
1082
- className: b(
1162
+ className: x(
1083
1163
  // Base styles
1084
1164
  "block w-full rounded-lg border dark:border-gray-600 transition-colors duration-200",
1085
1165
  "placeholder-gray-500 dark:placeholder-gray-500 focus:outline-none focus:ring-1 focus:ring-offset-0",
1086
1166
  "disabled:opacity-50 disabled:cursor-not-allowed",
1087
1167
  // Size styles
1088
- er[a],
1168
+ nr[a],
1089
1169
  // Icon padding
1090
1170
  i && "pl-10",
1091
- f && "pr-10",
1171
+ h && "pr-10",
1092
1172
  // State styles
1093
- y ? "border-error text-error focus:border-error focus:ring-error" : "border-gray-100 text-secondary-900 focus:border-primary focus:ring-primary dark:border-gray-600 dark:bg-secondary-800 dark:text-secondary-100",
1173
+ v ? "border-error text-error focus:border-error focus:ring-error" : "border-gray-100 text-secondary-900 focus:border-primary focus:ring-primary dark:border-gray-600 dark:bg-secondary-800 dark:text-secondary-100",
1094
1174
  m
1095
1175
  ),
1096
1176
  ...d
1097
1177
  }
1098
1178
  ),
1099
- (f || p) && /* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: p ? /* @__PURE__ */ c(
1179
+ (h || g) && /* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: g ? /* @__PURE__ */ c(
1100
1180
  "svg",
1101
1181
  {
1102
- className: b("animate-spin text-secondary-400", ge[a]),
1182
+ className: x("animate-spin text-secondary-400", ge[a]),
1103
1183
  fill: "none",
1104
1184
  viewBox: "0 0 24 24",
1105
1185
  children: [
@@ -1124,14 +1204,14 @@ const er = {
1124
1204
  )
1125
1205
  ]
1126
1206
  }
1127
- ) : f && /* @__PURE__ */ e("span", { className: b("text-secondary-400", ge[a]), children: f }) })
1207
+ ) : h && /* @__PURE__ */ e("span", { className: x("text-secondary-400", ge[a]), children: h }) })
1128
1208
  ] }),
1129
1209
  (t || l) && /* @__PURE__ */ e(
1130
1210
  "p",
1131
1211
  {
1132
- className: b(
1212
+ className: x(
1133
1213
  "mt-1 text-xs",
1134
- y ? "text-error" : "text-secondary-500"
1214
+ v ? "text-error" : "text-secondary-500"
1135
1215
  ),
1136
1216
  children: t || l
1137
1217
  }
@@ -1147,10 +1227,10 @@ const oe = ({
1147
1227
  clickable: a = !1,
1148
1228
  onClick: o,
1149
1229
  className: i,
1150
- "aria-label": f,
1151
- ...p
1230
+ "aria-label": h,
1231
+ ...g
1152
1232
  }) => {
1153
- const x = typeof l == "number" ? l : rr(l), v = b(
1233
+ const f = typeof l == "number" ? l : lr(l), b = x(
1154
1234
  "inline-block",
1155
1235
  // Color variants
1156
1236
  {
@@ -1171,20 +1251,20 @@ const oe = ({
1171
1251
  },
1172
1252
  i
1173
1253
  ), m = {
1174
- size: x,
1175
- className: v,
1254
+ size: f,
1255
+ className: b,
1176
1256
  onClick: a ? o : void 0,
1177
- "aria-label": f,
1257
+ "aria-label": h,
1178
1258
  role: a ? "button" : void 0,
1179
1259
  tabIndex: a ? 0 : void 0,
1180
- onKeyDown: a ? (s) => {
1181
- (s.key === "Enter" || s.key === " ") && (s.preventDefault(), o?.());
1260
+ onKeyDown: a ? (n) => {
1261
+ (n.key === "Enter" || n.key === " ") && (n.preventDefault(), o?.());
1182
1262
  } : void 0,
1183
- ...p
1263
+ ...g
1184
1264
  };
1185
1265
  return /* @__PURE__ */ e(r, { ...m });
1186
1266
  };
1187
- function rr(r) {
1267
+ function lr(r) {
1188
1268
  return {
1189
1269
  xs: 12,
1190
1270
  sm: 16,
@@ -1193,14 +1273,14 @@ function rr(r) {
1193
1273
  xl: 32
1194
1274
  }[r];
1195
1275
  }
1196
- function tr({
1276
+ function sr({
1197
1277
  children: r,
1198
1278
  showTableSkeleton: l = !1,
1199
1279
  tableColumns: t = 6,
1200
1280
  tableRows: a = 8
1201
1281
  }) {
1202
1282
  return r ? /* @__PURE__ */ e("main", { className: "flex-1 bg-gray-50 dark:bg-gray-950 p-6", children: /* @__PURE__ */ e("div", { className: "w-full max-w-6xl mx-auto animate-pulse", children: r }) }) : /* @__PURE__ */ e("main", { className: "flex-1 bg-gray-50 dark:bg-gray-950 p-6", children: /* @__PURE__ */ c("div", { className: "w-full mx-auto space-y-6 animate-pulse", children: [
1203
- !l && /* @__PURE__ */ c(Le, { children: [
1283
+ !l && /* @__PURE__ */ c(Ee, { children: [
1204
1284
  /* @__PURE__ */ e("div", { className: "h-6 bg-gray-200 dark:bg-gray-700 rounded w-1/4" }),
1205
1285
  /* @__PURE__ */ c("div", { className: "space-y-2", children: [
1206
1286
  /* @__PURE__ */ e("div", { className: "h-4 bg-gray-200 dark:bg-gray-700 rounded w-3/4" }),
@@ -1219,12 +1299,12 @@ function tr({
1219
1299
  "div",
1220
1300
  {
1221
1301
  className: `grid grid-cols-${t} gap-2 p-3 border-t border-gray-100 dark:border-gray-800`,
1222
- children: Array.from({ length: t }).map((f, p) => /* @__PURE__ */ e(
1302
+ children: Array.from({ length: t }).map((h, g) => /* @__PURE__ */ e(
1223
1303
  "div",
1224
1304
  {
1225
1305
  className: "h-4 bg-gray-200 dark:bg-gray-700 rounded w-full"
1226
1306
  },
1227
- `cell-${i}-${p}`
1307
+ `cell-${i}-${g}`
1228
1308
  ))
1229
1309
  },
1230
1310
  `row-${i}`
@@ -1232,61 +1312,61 @@ function tr({
1232
1312
  ] })
1233
1313
  ] }) });
1234
1314
  }
1235
- const ar = ({
1315
+ const or = ({
1236
1316
  trigger: r,
1237
1317
  options: l,
1238
1318
  value: t,
1239
1319
  onSelect: a,
1240
1320
  placement: o = "bottom-start",
1241
1321
  disabled: i = !1,
1242
- className: f,
1243
- showCheck: p = !0,
1244
- header: x
1322
+ className: h,
1323
+ showCheck: g = !0,
1324
+ header: f
1245
1325
  }) => {
1246
- const [v, m] = O(!1), [s, d] = O(null), [h, N] = O({ top: 0, left: 0 }), y = ee(null), S = ee(null), B = ee(null), k = ee(null);
1247
- J(() => {
1248
- const g = (A) => {
1249
- y.current && (!y.current.contains(A.target) || B.current && !B.current.contains(A.target)) && (m(!1), d(null), k.current && (clearTimeout(k.current), k.current = null));
1326
+ const [b, m] = V(!1), [n, d] = V(null), [p, N] = V({ top: 0, left: 0 }), v = Q(null), S = Q(null), B = Q(null), k = Q(null);
1327
+ G(() => {
1328
+ const y = (T) => {
1329
+ v.current && (!v.current.contains(T.target) || B.current && !B.current.contains(T.target)) && (m(!1), d(null), k.current && (clearTimeout(k.current), k.current = null));
1250
1330
  };
1251
- return v && document.addEventListener("mousedown", g), () => {
1252
- document.removeEventListener("mousedown", g);
1331
+ return b && document.addEventListener("mousedown", y), () => {
1332
+ document.removeEventListener("mousedown", y);
1253
1333
  };
1254
- }, [v]), J(() => {
1255
- const g = (A) => {
1256
- A.key === "Escape" && (m(!1), d(null), k.current && (clearTimeout(k.current), k.current = null));
1334
+ }, [b]), G(() => {
1335
+ const y = (T) => {
1336
+ T.key === "Escape" && (m(!1), d(null), k.current && (clearTimeout(k.current), k.current = null));
1257
1337
  };
1258
- return v && document.addEventListener("keydown", g), () => {
1259
- document.removeEventListener("keydown", g);
1338
+ return b && document.addEventListener("keydown", y), () => {
1339
+ document.removeEventListener("keydown", y);
1260
1340
  };
1261
- }, [v]), J(() => {
1262
- if (s && y.current) {
1263
- const g = y.current.querySelector(
1264
- `[data-option-value="${s}"]`
1341
+ }, [b]), G(() => {
1342
+ if (n && v.current) {
1343
+ const y = v.current.querySelector(
1344
+ `[data-option-value="${n}"]`
1265
1345
  );
1266
- if (g) {
1267
- const A = g.getBoundingClientRect();
1346
+ if (y) {
1347
+ const T = y.getBoundingClientRect();
1268
1348
  N({
1269
- top: A.top,
1270
- left: A.right + 8
1349
+ top: T.top,
1350
+ left: T.right + 8
1271
1351
  });
1272
1352
  }
1273
1353
  }
1274
- }, [s]), J(() => () => {
1354
+ }, [n]), G(() => () => {
1275
1355
  k.current && clearTimeout(k.current);
1276
1356
  }, []);
1277
- const q = (g) => {
1278
- g.stopPropagation(), i || (m(!v), d(null), k.current && (clearTimeout(k.current), k.current = null));
1279
- }, K = (g, A, u) => {
1280
- g.stopPropagation(), !A.disabled && !A.divider && (!A.children || A.children.length === 0) && (a?.(A.value, u), m(!1), d(null));
1281
- }, H = (g) => {
1282
- k.current && (clearTimeout(k.current), k.current = null), g.children && g.children.length > 0 ? d(g.value) : d(null);
1283
- }, _ = (g) => {
1284
- g.children && g.children.length > 0 ? k.current = setTimeout(() => {
1357
+ const q = (y) => {
1358
+ y.stopPropagation(), i || (m(!b), d(null), k.current && (clearTimeout(k.current), k.current = null));
1359
+ }, K = (y, T, u) => {
1360
+ y.stopPropagation(), !T.disabled && !T.divider && (!T.children || T.children.length === 0) && (a?.(T.value, u), m(!1), d(null));
1361
+ }, H = (y) => {
1362
+ k.current && (clearTimeout(k.current), k.current = null), y.children && y.children.length > 0 ? d(y.value) : d(null);
1363
+ }, F = (y) => {
1364
+ y.children && y.children.length > 0 ? k.current = setTimeout(() => {
1285
1365
  d(null);
1286
1366
  }, 150) : d(null);
1287
- }, E = (g, A, u) => {
1288
- g.stopPropagation(), !A.disabled && !A.divider && (a?.(A.value, u), m(!1), d(null));
1289
- }, G = b(
1367
+ }, M = (y, T, u) => {
1368
+ y.stopPropagation(), !T.disabled && !T.divider && (a?.(T.value, u), m(!1), d(null));
1369
+ }, J = x(
1290
1370
  "absolute z-50 min-w-[200px] bg-white dark:bg-gray-800 rounded-md shadow-xs border border-gray-100 dark:border-gray-600",
1291
1371
  "max-h-60 overflow-auto",
1292
1372
  {
@@ -1295,17 +1375,17 @@ const ar = ({
1295
1375
  "bottom-full left-0 mb-2": o === "top-start",
1296
1376
  "bottom-full right-0 mb-2": o === "top-end"
1297
1377
  }
1298
- ), z = b(
1378
+ ), z = x(
1299
1379
  "fixed z-[60] min-w-[200px] bg-white dark:bg-gray-800 rounded-md shadow-lg border border-gray-100 dark:border-gray-600",
1300
1380
  "max-h-60 overflow-auto"
1301
1381
  );
1302
1382
  return /* @__PURE__ */ c(
1303
1383
  "div",
1304
1384
  {
1305
- ref: y,
1306
- className: b(
1385
+ ref: v,
1386
+ className: x(
1307
1387
  "relative flex flex-row items-center justify-center rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700",
1308
- f
1388
+ h
1309
1389
  ),
1310
1390
  children: [
1311
1391
  /* @__PURE__ */ e(
@@ -1314,50 +1394,50 @@ const ar = ({
1314
1394
  ref: S,
1315
1395
  onClick: q,
1316
1396
  disabled: i,
1317
- className: b("inline-flex items-center justify-center", {
1397
+ className: x("inline-flex items-center justify-center", {
1318
1398
  "opacity-50 cursor-not-allowed": i
1319
1399
  }),
1320
1400
  children: r
1321
1401
  }
1322
1402
  ),
1323
- v && /* @__PURE__ */ e("div", { className: G, children: /* @__PURE__ */ c("div", { className: "p-2", children: [
1324
- x && (typeof x == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider px-3 py-2", children: x }) : x),
1325
- l.map((g, A) => {
1326
- if (g.divider)
1403
+ b && /* @__PURE__ */ e("div", { className: J, children: /* @__PURE__ */ c("div", { className: "p-2", children: [
1404
+ f && (typeof f == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider px-3 py-2", children: f }) : f),
1405
+ l.map((y, T) => {
1406
+ if (y.divider)
1327
1407
  return /* @__PURE__ */ e(
1328
1408
  "div",
1329
1409
  {
1330
1410
  className: "border-t border-gray-200 dark:border-gray-700 my-2"
1331
1411
  },
1332
- `divider-${A}`
1412
+ `divider-${T}`
1333
1413
  );
1334
- const u = g.children && g.children.length > 0, $ = s === g.value;
1414
+ const u = y.children && y.children.length > 0, $ = n === y.value;
1335
1415
  return /* @__PURE__ */ c("div", { className: "relative group", children: [
1336
1416
  /* @__PURE__ */ c(
1337
1417
  "button",
1338
1418
  {
1339
- "data-option-value": g.value,
1340
- onClick: (L) => K(L, g),
1341
- onMouseEnter: () => H(g),
1342
- onMouseLeave: () => _(g),
1343
- disabled: g.disabled,
1344
- className: b(
1419
+ "data-option-value": y.value,
1420
+ onClick: (L) => K(L, y),
1421
+ onMouseEnter: () => H(y),
1422
+ onMouseLeave: () => F(y),
1423
+ disabled: y.disabled,
1424
+ className: x(
1345
1425
  "w-full flex items-center justify-between px-3 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md transition-colors",
1346
1426
  {
1347
- "opacity-50 cursor-not-allowed": g.disabled,
1427
+ "opacity-50 cursor-not-allowed": y.disabled,
1348
1428
  "bg-gray-100 dark:bg-gray-700": $ && u
1349
1429
  }
1350
1430
  ),
1351
1431
  children: [
1352
1432
  /* @__PURE__ */ c("div", { className: "flex items-center space-x-2 min-w-0", children: [
1353
- g.icon && /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: g.icon }),
1433
+ y.icon && /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: y.icon }),
1354
1434
  /* @__PURE__ */ c("div", { className: "flex flex-col items-start min-w-0", children: [
1355
- /* @__PURE__ */ e("span", { className: "font-base truncate", children: g.label }),
1356
- g.description && /* @__PURE__ */ e("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: g.description })
1435
+ /* @__PURE__ */ e("span", { className: "font-base truncate", children: y.label }),
1436
+ y.description && /* @__PURE__ */ e("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: y.description })
1357
1437
  ] })
1358
1438
  ] }),
1359
1439
  /* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
1360
- p && t === g.value && /* @__PURE__ */ e("span", { className: "h-4 w-4 text-green-600 flex-shrink-0 text-sm font-bold", children: "✓" }),
1440
+ g && t === y.value && /* @__PURE__ */ e("span", { className: "h-4 w-4 text-green-600 flex-shrink-0 text-sm font-bold", children: "✓" }),
1361
1441
  u && /* @__PURE__ */ e("span", { className: "text-gray-400 dark:text-gray-500 text-xs", children: "▶" })
1362
1442
  ] })
1363
1443
  ]
@@ -1369,18 +1449,18 @@ const ar = ({
1369
1449
  ref: B,
1370
1450
  className: z,
1371
1451
  style: {
1372
- top: `${h.top}px`,
1373
- left: `${h.left}px`
1452
+ top: `${p.top}px`,
1453
+ left: `${p.left}px`
1374
1454
  },
1375
1455
  onMouseEnter: () => {
1376
- k.current && (clearTimeout(k.current), k.current = null), d(g.value);
1456
+ k.current && (clearTimeout(k.current), k.current = null), d(y.value);
1377
1457
  },
1378
1458
  onMouseLeave: () => {
1379
1459
  k.current = setTimeout(() => {
1380
1460
  d(null);
1381
1461
  }, 150);
1382
1462
  },
1383
- children: /* @__PURE__ */ e("div", { className: "p-2", children: g.children.map((L, D) => {
1463
+ children: /* @__PURE__ */ e("div", { className: "p-2", children: y.children.map((L, D) => {
1384
1464
  if (L.divider)
1385
1465
  return /* @__PURE__ */ e(
1386
1466
  "div",
@@ -1389,19 +1469,19 @@ const ar = ({
1389
1469
  },
1390
1470
  `divider-${D}`
1391
1471
  );
1392
- const P = typeof t == "object" && t[g.value] && t[g.value].includes(
1472
+ const P = typeof t == "object" && t[y.value] && t[y.value].includes(
1393
1473
  L.value
1394
1474
  ) || t === L.value;
1395
1475
  return /* @__PURE__ */ c(
1396
1476
  "button",
1397
1477
  {
1398
- onClick: (M) => E(
1399
- M,
1478
+ onClick: (E) => M(
1479
+ E,
1400
1480
  L,
1401
- g.value
1481
+ y.value
1402
1482
  ),
1403
1483
  disabled: L.disabled,
1404
- className: b(
1484
+ className: x(
1405
1485
  "w-full flex items-center justify-between px-3 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md transition-colors",
1406
1486
  {
1407
1487
  "opacity-50 cursor-not-allowed": L.disabled
@@ -1415,7 +1495,7 @@ const ar = ({
1415
1495
  L.description && /* @__PURE__ */ e("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: L.description })
1416
1496
  ] })
1417
1497
  ] }),
1418
- p && P && /* @__PURE__ */ e("span", { className: "h-4 w-4 text-green-600 flex-shrink-0 text-sm font-bold", children: "✓" })
1498
+ g && P && /* @__PURE__ */ e("span", { className: "h-4 w-4 text-green-600 flex-shrink-0 text-sm font-bold", children: "✓" })
1419
1499
  ]
1420
1500
  },
1421
1501
  L.value
@@ -1423,16 +1503,16 @@ const ar = ({
1423
1503
  }) })
1424
1504
  }
1425
1505
  )
1426
- ] }, g.value);
1506
+ ] }, y.value);
1427
1507
  }),
1428
1508
  (() => {
1429
- const g = l.reduce((A, u) => {
1430
- if (u.divider) return A;
1509
+ const y = l.reduce((T, u) => {
1510
+ if (u.divider) return T;
1431
1511
  const $ = u.children ? u.children.filter((L) => !L.divider).length : 0;
1432
- return A + 1 + $;
1512
+ return T + 1 + $;
1433
1513
  }, 0);
1434
- return g > 1 && /* @__PURE__ */ e("div", { className: "border-t border-gray-200 dark:border-gray-600 mt-2 pt-2", children: /* @__PURE__ */ c("div", { className: "text-xs text-gray-500 dark:text-gray-400 px-3 py-1", children: [
1435
- g,
1514
+ return y > 1 && /* @__PURE__ */ e("div", { className: "border-t border-gray-200 dark:border-gray-600 mt-2 pt-2", children: /* @__PURE__ */ c("div", { className: "text-xs text-gray-500 dark:text-gray-400 px-3 py-1", children: [
1515
+ y,
1436
1516
  " options available"
1437
1517
  ] }) });
1438
1518
  })()
@@ -1440,7 +1520,7 @@ const ar = ({
1440
1520
  ]
1441
1521
  }
1442
1522
  );
1443
- }, nr = () => /* @__PURE__ */ e(
1523
+ }, cr = () => /* @__PURE__ */ e(
1444
1524
  "svg",
1445
1525
  {
1446
1526
  className: "h-4 w-4",
@@ -1457,10 +1537,10 @@ const ar = ({
1457
1537
  }
1458
1538
  )
1459
1539
  }
1460
- ), lr = ({ active: r }) => /* @__PURE__ */ e(
1540
+ ), dr = ({ active: r }) => /* @__PURE__ */ e(
1461
1541
  "svg",
1462
1542
  {
1463
- className: b(
1543
+ className: x(
1464
1544
  "h-3 w-3",
1465
1545
  r ? "text-neutral-900 dark:text-neutral-100" : "text-neutral-400"
1466
1546
  ),
@@ -1477,10 +1557,10 @@ const ar = ({
1477
1557
  }
1478
1558
  )
1479
1559
  }
1480
- ), sr = ({ active: r }) => /* @__PURE__ */ e(
1560
+ ), ir = ({ active: r }) => /* @__PURE__ */ e(
1481
1561
  "svg",
1482
1562
  {
1483
- className: b(
1563
+ className: x(
1484
1564
  "h-3 w-3",
1485
1565
  r ? "text-neutral-900 dark:text-neutral-100" : "text-neutral-400"
1486
1566
  ),
@@ -1497,7 +1577,7 @@ const ar = ({
1497
1577
  }
1498
1578
  )
1499
1579
  }
1500
- ), or = () => /* @__PURE__ */ e(
1580
+ ), ur = () => /* @__PURE__ */ e(
1501
1581
  "svg",
1502
1582
  {
1503
1583
  className: "h-4 w-4",
@@ -1514,7 +1594,7 @@ const ar = ({
1514
1594
  }
1515
1595
  )
1516
1596
  }
1517
- ), cr = () => /* @__PURE__ */ e(
1597
+ ), mr = () => /* @__PURE__ */ e(
1518
1598
  "svg",
1519
1599
  {
1520
1600
  className: "h-4 w-4",
@@ -1531,7 +1611,7 @@ const ar = ({
1531
1611
  }
1532
1612
  )
1533
1613
  }
1534
- ), dr = () => /* @__PURE__ */ e(
1614
+ ), hr = () => /* @__PURE__ */ e(
1535
1615
  "svg",
1536
1616
  {
1537
1617
  className: "h-4 w-4",
@@ -1548,7 +1628,7 @@ const ar = ({
1548
1628
  }
1549
1629
  )
1550
1630
  }
1551
- ), ir = () => /* @__PURE__ */ e(
1631
+ ), fr = () => /* @__PURE__ */ e(
1552
1632
  "svg",
1553
1633
  {
1554
1634
  className: "h-4 w-4",
@@ -1565,7 +1645,7 @@ const ar = ({
1565
1645
  }
1566
1646
  )
1567
1647
  }
1568
- ), Ee = () => /* @__PURE__ */ e(
1648
+ ), $e = () => /* @__PURE__ */ e(
1569
1649
  "svg",
1570
1650
  {
1571
1651
  className: "h-4 w-4",
@@ -1582,7 +1662,7 @@ const ar = ({
1582
1662
  }
1583
1663
  )
1584
1664
  }
1585
- ), ur = (r) => {
1665
+ ), pr = (r) => {
1586
1666
  const l = (a) => r.multiSelect && Array.isArray(r.value) ? r.value?.includes(a) : r.value === a, t = (a) => {
1587
1667
  r.multiSelect && Array.isArray(r.value) ? r.onChange(r.value.filter((o) => o !== a)) : r.onChange(a);
1588
1668
  };
@@ -1601,7 +1681,7 @@ const ar = ({
1601
1681
  /* @__PURE__ */ e("span", { className: "text-gray-800", children: r.multiSelect && Array.isArray(r.value) ? r.value?.map(
1602
1682
  (a) => r.options?.find((o) => o.value === a)?.label
1603
1683
  ).join(", ") : r.options?.find((a) => a.value === r.value)?.label }),
1604
- /* @__PURE__ */ e("span", { className: "text-gray-500 text-sm group-open:rotate-180 transition-transform", children: /* @__PURE__ */ e(Ee, {}) })
1684
+ /* @__PURE__ */ e("span", { className: "text-gray-500 text-sm group-open:rotate-180 transition-transform", children: /* @__PURE__ */ e($e, {}) })
1605
1685
  ] }),
1606
1686
  /* @__PURE__ */ c("div", { className: "absolute z-10 left-0 mt-1 bg-white border border-gray-100 rounded-lg shadow-sm p-2 w-48", children: [
1607
1687
  r.options?.map((a) => /* @__PURE__ */ e(
@@ -1612,7 +1692,7 @@ const ar = ({
1612
1692
  children: /* @__PURE__ */ e(
1613
1693
  "span",
1614
1694
  {
1615
- className: b(l(a.value) && "text-primary-500"),
1695
+ className: x(l(a.value) && "text-primary-500"),
1616
1696
  children: a.label
1617
1697
  }
1618
1698
  )
@@ -1629,189 +1709,189 @@ const ar = ({
1629
1709
  )
1630
1710
  ] })
1631
1711
  ] }) }) });
1632
- }, Ce = ({
1712
+ }, Se = ({
1633
1713
  data: r,
1634
1714
  columns: l,
1635
1715
  loading: t = !1,
1636
1716
  searchable: a = !1,
1637
1717
  searchPlaceholder: o = "Search...",
1638
1718
  filters: i = [],
1639
- paginated: f = !1,
1640
- pageSizeOptions: p = [10, 25, 50, 100],
1641
- defaultPageSize: x = 10,
1642
- actions: v = [],
1719
+ paginated: h = !1,
1720
+ pageSizeOptions: g = [10, 25, 50, 100],
1721
+ defaultPageSize: f = 10,
1722
+ actions: b = [],
1643
1723
  onRowClick: m,
1644
- selectable: s = !1,
1724
+ selectable: n = !1,
1645
1725
  selectedRows: d = [],
1646
- onSelectionChange: h,
1647
- getRowKey: N = (H, _) => _,
1648
- emptyContent: y,
1726
+ onSelectionChange: p,
1727
+ getRowKey: N = (H, F) => F,
1728
+ emptyContent: v,
1649
1729
  hoverable: S = !0,
1650
1730
  bordered: B = !1,
1651
1731
  striped: k = !1,
1652
1732
  className: q,
1653
1733
  rowClassName: K
1654
1734
  }) => {
1655
- const [H, _] = O(""), [E, G] = O({
1735
+ const [H, F] = V(""), [M, J] = V({
1656
1736
  column: null,
1657
1737
  direction: null
1658
- }), [z, g] = O({
1738
+ }), [z, y] = V({
1659
1739
  page: 0,
1660
- pageSize: x
1661
- }), A = ee(null), u = ie(() => {
1662
- let n = r;
1740
+ pageSize: f
1741
+ }), T = Q(null), u = ie(() => {
1742
+ let s = r;
1663
1743
  if (a && H.trim()) {
1664
1744
  const w = l.filter(
1665
1745
  (R) => R.searchable !== !1
1666
- ), V = H.toLowerCase();
1667
- n = n.filter((R) => w.some((j) => {
1746
+ ), _ = H.toLowerCase();
1747
+ s = s.filter((R) => w.some((j) => {
1668
1748
  const Y = typeof j.accessor == "function" ? j.accessor(R) : R[j.accessor];
1669
- return String(Y || "").toLowerCase().includes(V);
1749
+ return String(Y || "").toLowerCase().includes(_);
1670
1750
  }));
1671
1751
  }
1672
1752
  return i.forEach((w) => {
1673
- w.value && w.value !== "all" && (n = n.filter((V) => {
1753
+ w.value && w.value !== "all" && (s = s.filter((_) => {
1674
1754
  const R = l.find((Y) => Y.id === w.id);
1675
1755
  if (!R) return !0;
1676
- const j = typeof R.accessor == "function" ? R.accessor(V) : V[R.accessor];
1756
+ const j = typeof R.accessor == "function" ? R.accessor(_) : _[R.accessor];
1677
1757
  return String(j || "") === w.value;
1678
1758
  }));
1679
- }), n;
1759
+ }), s;
1680
1760
  }, [r, H, l, a, i]), $ = ie(() => {
1681
- if (!E.column || !E.direction) return u;
1682
- const n = l.find((w) => w.id === E.column);
1683
- return n ? [...u].sort((w, V) => {
1684
- const R = typeof n.accessor == "function" ? n.accessor(w) : w[n.accessor], j = typeof n.accessor == "function" ? n.accessor(V) : V[n.accessor];
1761
+ if (!M.column || !M.direction) return u;
1762
+ const s = l.find((w) => w.id === M.column);
1763
+ return s ? [...u].sort((w, _) => {
1764
+ const R = typeof s.accessor == "function" ? s.accessor(w) : w[s.accessor], j = typeof s.accessor == "function" ? s.accessor(_) : _[s.accessor];
1685
1765
  let Y = 0;
1686
- return R < j ? Y = -1 : R > j && (Y = 1), E.direction === "desc" ? -Y : Y;
1766
+ return R < j ? Y = -1 : R > j && (Y = 1), M.direction === "desc" ? -Y : Y;
1687
1767
  }) : u;
1688
- }, [u, E, l]), L = ie(() => {
1689
- if (!f) return $;
1690
- const n = z.page * z.pageSize, w = n + z.pageSize;
1691
- return $.slice(n, w);
1692
- }, [$, z, f]), D = ne(
1693
- (n) => {
1694
- l.find((V) => V.id === n)?.sortable && G((V) => V.column !== n ? { column: n, direction: "asc" } : V.direction === "asc" ? { column: n, direction: "desc" } : { column: null, direction: null });
1768
+ }, [u, M, l]), L = ie(() => {
1769
+ if (!h) return $;
1770
+ const s = z.page * z.pageSize, w = s + z.pageSize;
1771
+ return $.slice(s, w);
1772
+ }, [$, z, h]), D = ae(
1773
+ (s) => {
1774
+ l.find((_) => _.id === s)?.sortable && J((_) => _.column !== s ? { column: s, direction: "asc" } : _.direction === "asc" ? { column: s, direction: "desc" } : { column: null, direction: null });
1695
1775
  },
1696
1776
  [l]
1697
- ), P = ne((n) => {
1698
- g((w) => ({ ...w, page: n }));
1699
- }, []), M = ne((n) => {
1700
- g({ page: 0, pageSize: n });
1701
- }, []), re = ne(
1702
- (n, w) => {
1703
- if (!h) return;
1704
- const V = N(n, 0);
1705
- d.map((R, j) => N(R, j)), h(w ? [...d, n] : d.filter(
1706
- (R, j) => N(d[j], j) !== V
1777
+ ), P = ae((s) => {
1778
+ y((w) => ({ ...w, page: s }));
1779
+ }, []), E = ae((s) => {
1780
+ y({ page: 0, pageSize: s });
1781
+ }, []), re = ae(
1782
+ (s, w) => {
1783
+ if (!p) return;
1784
+ const _ = N(s, 0);
1785
+ d.map((R, j) => N(R, j)), p(w ? [...d, s] : d.filter(
1786
+ (R, j) => N(d[j], j) !== _
1707
1787
  ));
1708
1788
  },
1709
- [d, h, N]
1710
- ), ae = ne(
1711
- (n) => {
1712
- h && h(n ? [...L] : []);
1789
+ [d, p, N]
1790
+ ), ne = ae(
1791
+ (s) => {
1792
+ p && p(s ? [...L] : []);
1713
1793
  },
1714
- [L, h]
1794
+ [L, p]
1715
1795
  );
1716
- J(() => {
1717
- g((n) => ({ ...n, page: 0 }));
1718
- }, [H, E]), J(() => {
1719
- g((n) => ({ ...n, page: 0 }));
1720
- }, [i.map((n) => n.value).join(",")]);
1721
- const W = $.length, C = Math.ceil(W / z.pageSize), I = z.page * z.pageSize + 1, F = Math.min(I + z.pageSize - 1, W), T = L.length > 0 && L.every((n) => {
1722
- const w = N(n, 0);
1796
+ G(() => {
1797
+ y((s) => ({ ...s, page: 0 }));
1798
+ }, [H, M]), G(() => {
1799
+ y((s) => ({ ...s, page: 0 }));
1800
+ }, [i.map((s) => s.value).join(",")]);
1801
+ const W = $.length, C = Math.ceil(W / z.pageSize), I = z.page * z.pageSize + 1, O = Math.min(I + z.pageSize - 1, W), A = L.length > 0 && L.every((s) => {
1802
+ const w = N(s, 0);
1723
1803
  return d.some(
1724
- (V, R) => N(V, R) === w
1804
+ (_, R) => N(_, R) === w
1725
1805
  );
1726
- }), X = L.some((n) => {
1727
- const w = N(n, 0);
1806
+ }), X = L.some((s) => {
1807
+ const w = N(s, 0);
1728
1808
  return d.some(
1729
- (V, R) => N(V, R) === w
1809
+ (_, R) => N(_, R) === w
1730
1810
  );
1731
- }), te = b(
1811
+ }), te = x(
1732
1812
  "w-full text-sm leading-5 text-[var(--text-default)] border-collapse",
1733
1813
  q
1734
- ), U = b("bg-[var(--base-module)]"), le = b(
1814
+ ), U = x("bg-[var(--base-module)]"), le = x(
1735
1815
  "text-[var(--text-default)] dark:text-[var(--text-on-neutral)] p-3 border-b border-[var(--neutral-border)]"
1736
- ), he = b("h-12", {
1816
+ ), he = x("h-12", {
1737
1817
  "hover:bg-[var(--neutral-container)] dark:hover:bg-[var(--neutral-container-emphasis)]": S,
1738
1818
  "cursor-pointer": m
1739
1819
  });
1740
1820
  return /* @__PURE__ */ c("div", { className: "space-y-4", children: [
1741
1821
  (a || i.length > 0) && /* @__PURE__ */ e("div", { className: "pt-4 pb-2", children: /* @__PURE__ */ c("div", { className: "flex flex-wrap gap-4 items-start", children: [
1742
- i.map((n) => /* @__PURE__ */ e(ur, { ...n }, n.id)),
1822
+ i.map((s) => /* @__PURE__ */ e(pr, { ...s }, s.id)),
1743
1823
  /* @__PURE__ */ e("div", { className: "w-full sm:w-auto sm:ml-auto min-w-[200px]", children: /* @__PURE__ */ e(
1744
1824
  ue,
1745
1825
  {
1746
1826
  placeholder: o,
1747
1827
  value: H,
1748
- onChange: (n) => _(n.target.value),
1749
- startIcon: /* @__PURE__ */ e(nr, {}),
1828
+ onChange: (s) => F(s.target.value),
1829
+ startIcon: /* @__PURE__ */ e(cr, {}),
1750
1830
  className: "max-w-sm"
1751
1831
  }
1752
1832
  ) })
1753
1833
  ] }) }),
1754
1834
  /* @__PURE__ */ c("div", { className: "relative w-full overflow-x-auto min-h-[400px]", children: [
1755
1835
  t && /* @__PURE__ */ e("div", { className: "flex items-center justify-center z-10", children: /* @__PURE__ */ e(
1756
- tr,
1836
+ sr,
1757
1837
  {
1758
1838
  showTableSkeleton: !0,
1759
1839
  tableRows: 10,
1760
1840
  tableColumns: l.length
1761
1841
  }
1762
1842
  ) }),
1763
- /* @__PURE__ */ c("table", { ref: A, className: b(te, "min-w-full"), children: [
1843
+ /* @__PURE__ */ c("table", { ref: T, className: x(te, "min-w-full"), children: [
1764
1844
  /* @__PURE__ */ e("thead", { className: U, children: /* @__PURE__ */ c("tr", { children: [
1765
- s && /* @__PURE__ */ e("th", { className: b(le, "w-12"), children: /* @__PURE__ */ e(
1845
+ n && /* @__PURE__ */ e("th", { className: x(le, "w-12"), children: /* @__PURE__ */ e(
1766
1846
  "input",
1767
1847
  {
1768
1848
  type: "checkbox",
1769
- checked: T,
1770
- ref: (n) => {
1771
- n && (n.indeterminate = X && !T);
1849
+ checked: A,
1850
+ ref: (s) => {
1851
+ s && (s.indeterminate = X && !A);
1772
1852
  },
1773
- onChange: (n) => ae(n.target.checked),
1853
+ onChange: (s) => ne(s.target.checked),
1774
1854
  className: "rounded border-neutral-300 dark:border-neutral-600"
1775
1855
  }
1776
1856
  ) }),
1777
- !t && l.map((n) => /* @__PURE__ */ e(
1857
+ !t && l.map((s) => /* @__PURE__ */ e(
1778
1858
  "th",
1779
1859
  {
1780
- className: b(
1860
+ className: x(
1781
1861
  le,
1782
1862
  "font-semibold text-xs text-[var(--text-muted)] dark:text-[var(--text-muted)] uppercase tracking-wider",
1783
1863
  "group",
1784
1864
  {
1785
- "text-left": n.align === "left" || !n.align,
1786
- "text-center": n.align === "center",
1787
- "text-right": n.align === "right",
1788
- "cursor-pointer select-none": n.sortable,
1789
- "sticky left-0 bg-white dark:bg-neutral-900": n.sticky === "left",
1790
- "sticky right-0 bg-white dark:bg-neutral-900": n.sticky === "right"
1865
+ "text-left": s.align === "left" || !s.align,
1866
+ "text-center": s.align === "center",
1867
+ "text-right": s.align === "right",
1868
+ "cursor-pointer select-none": s.sortable,
1869
+ "sticky left-0 bg-white dark:bg-neutral-900": s.sticky === "left",
1870
+ "sticky right-0 bg-white dark:bg-neutral-900": s.sticky === "right"
1791
1871
  }
1792
1872
  ),
1793
- style: { width: n.width },
1794
- onClick: () => n.sortable && D(n.id),
1873
+ style: { width: s.width },
1874
+ onClick: () => s.sortable && D(s.id),
1795
1875
  children: /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
1796
- n.headerCell ? n.headerCell() : n.header,
1797
- n.sortable && /* @__PURE__ */ c(
1876
+ s.headerCell ? s.headerCell() : s.header,
1877
+ s.sortable && /* @__PURE__ */ c(
1798
1878
  "div",
1799
1879
  {
1800
- className: b(
1880
+ className: x(
1801
1881
  "flex flex-col opacity-0 group-hover:opacity-100 transition-opacity",
1802
- E.column === n.id && "opacity-100"
1882
+ M.column === s.id && "opacity-100"
1803
1883
  ),
1804
1884
  children: [
1805
1885
  /* @__PURE__ */ e(
1806
- lr,
1886
+ dr,
1807
1887
  {
1808
- active: E.column === n.id && E.direction === "asc"
1888
+ active: M.column === s.id && M.direction === "asc"
1809
1889
  }
1810
1890
  ),
1811
1891
  /* @__PURE__ */ e(
1812
- sr,
1892
+ ir,
1813
1893
  {
1814
- active: E.column === n.id && E.direction === "desc"
1894
+ active: M.column === s.id && M.direction === "desc"
1815
1895
  }
1816
1896
  )
1817
1897
  ]
@@ -1819,100 +1899,100 @@ const ar = ({
1819
1899
  )
1820
1900
  ] })
1821
1901
  },
1822
- n.id
1902
+ s.id
1823
1903
  )),
1824
- v.length > 0 && /* @__PURE__ */ e("th", { className: b(le, "w-20"), children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Actions" }) })
1904
+ b.length > 0 && /* @__PURE__ */ e("th", { className: x(le, "w-20"), children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Actions" }) })
1825
1905
  ] }) }),
1826
1906
  /* @__PURE__ */ e("tbody", { children: L.length === 0 || t ? !t && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
1827
1907
  "td",
1828
1908
  {
1829
- colSpan: l.length + (s ? 1 : 0) + (v.length > 0 ? 1 : 0),
1830
- className: b(
1909
+ colSpan: l.length + (n ? 1 : 0) + (b.length > 0 ? 1 : 0),
1910
+ className: x(
1831
1911
  le,
1832
1912
  "text-center py-8 text-neutral-500 dark:text-neutral-400"
1833
1913
  ),
1834
- children: y || "No data available"
1914
+ children: v || "No data available"
1835
1915
  }
1836
- ) }) : L.map((n, w) => {
1837
- const V = N(n, w), R = d.some(
1838
- (j, Y) => N(j, Y) === V
1916
+ ) }) : L.map((s, w) => {
1917
+ const _ = N(s, w), R = d.some(
1918
+ (j, Y) => N(j, Y) === _
1839
1919
  );
1840
1920
  return /* @__PURE__ */ c(
1841
1921
  "tr",
1842
1922
  {
1843
- className: b(
1923
+ className: x(
1844
1924
  he,
1845
1925
  { "bg-blue-50 dark:bg-blue-900/20": R },
1846
- K?.(n, w)
1926
+ K?.(s, w)
1847
1927
  ),
1848
1928
  onClick: (j) => {
1849
- j.stopPropagation(), m?.(n, w);
1929
+ j.stopPropagation(), m?.(s, w);
1850
1930
  },
1851
1931
  children: [
1852
- s && /* @__PURE__ */ e("td", { className: le, children: /* @__PURE__ */ e(
1932
+ n && /* @__PURE__ */ e("td", { className: le, children: /* @__PURE__ */ e(
1853
1933
  "input",
1854
1934
  {
1855
1935
  type: "checkbox",
1856
1936
  checked: R,
1857
1937
  onChange: (j) => {
1858
- j.stopPropagation(), re(n, j.target.checked);
1938
+ j.stopPropagation(), re(s, j.target.checked);
1859
1939
  },
1860
1940
  className: "rounded border-neutral-300 dark:border-neutral-600"
1861
1941
  }
1862
1942
  ) }),
1863
1943
  l.map((j) => {
1864
- const Y = typeof j.accessor == "function" ? j.accessor(n) : n[j.accessor];
1944
+ const Y = typeof j.accessor == "function" ? j.accessor(s) : s[j.accessor];
1865
1945
  return /* @__PURE__ */ e(
1866
1946
  "td",
1867
1947
  {
1868
- className: b(le, {
1948
+ className: x(le, {
1869
1949
  "text-left": j.align === "left" || !j.align,
1870
1950
  "text-center": j.align === "center",
1871
1951
  "text-right": j.align === "right",
1872
1952
  "sticky left-0 bg-white dark:bg-neutral-900": j.sticky === "left",
1873
1953
  "sticky right-0 bg-white dark:bg-neutral-900": j.sticky === "right"
1874
1954
  }),
1875
- children: j.cell ? j.cell(Y, n, w) : String(Y || "")
1955
+ children: j.cell ? j.cell(Y, s, w) : String(Y || "")
1876
1956
  },
1877
1957
  j.id
1878
1958
  );
1879
1959
  }),
1880
- v.length > 0 && /* @__PURE__ */ e("td", { className: le, children: /* @__PURE__ */ e(
1881
- ar,
1960
+ b.length > 0 && /* @__PURE__ */ e("td", { className: le, children: /* @__PURE__ */ e(
1961
+ or,
1882
1962
  {
1883
1963
  trigger: /* @__PURE__ */ c("div", { className: "inline-flex items-center gap-1 px-2 py-1 text-sm text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-100", children: [
1884
1964
  /* @__PURE__ */ e("span", { children: "Options" }),
1885
- /* @__PURE__ */ e(Ee, {})
1965
+ /* @__PURE__ */ e($e, {})
1886
1966
  ] }),
1887
- options: v.map((j) => ({
1967
+ options: b.map((j) => ({
1888
1968
  value: j.id,
1889
1969
  label: j.label,
1890
1970
  icon: j.icon,
1891
- disabled: j.disabled?.(n)
1971
+ disabled: j.disabled?.(s)
1892
1972
  })),
1893
1973
  onSelect: (j) => {
1894
- const Y = v.find(
1974
+ const Y = b.find(
1895
1975
  (fe) => fe.id === j
1896
1976
  );
1897
- Y && Y.onClick(n, w);
1977
+ Y && Y.onClick(s, w);
1898
1978
  },
1899
1979
  placement: "bottom-end"
1900
1980
  }
1901
1981
  ) })
1902
1982
  ]
1903
1983
  },
1904
- V
1984
+ _
1905
1985
  );
1906
1986
  }) })
1907
1987
  ] })
1908
1988
  ] }),
1909
- f && W > 0 && /* @__PURE__ */ c("div", { className: "flex items-center justify-between px-6", children: [
1989
+ h && W > 0 && /* @__PURE__ */ c("div", { className: "flex items-center justify-between px-6", children: [
1910
1990
  /* @__PURE__ */ c("div", { className: "flex items-center gap-4", children: [
1911
1991
  /* @__PURE__ */ c("span", { className: "text-sm text-neutral-600 dark:text-neutral-400", children: [
1912
1992
  "Showing ",
1913
1993
  I,
1914
1994
  " to ",
1915
- F,
1995
+ O,
1916
1996
  " of ",
1917
1997
  W,
1918
1998
  " results"
@@ -1923,34 +2003,34 @@ const ar = ({
1923
2003
  "select",
1924
2004
  {
1925
2005
  value: z.pageSize,
1926
- onChange: (n) => M(Number(n.target.value)),
2006
+ onChange: (s) => E(Number(s.target.value)),
1927
2007
  className: "border border-[var(--neutral-border)] text-[var(--text-default)] dark:text-[var(--text-on-neutral)] rounded-md px-2 py-1 text-sm bg-[var(--base-input)] dark:bg-[var(--base-input)] w-16",
1928
- children: p.map((n) => /* @__PURE__ */ e("option", { value: n, children: n }, n))
2008
+ children: g.map((s) => /* @__PURE__ */ e("option", { value: s, children: s }, s))
1929
2009
  }
1930
2010
  )
1931
2011
  ] })
1932
2012
  ] }),
1933
2013
  /* @__PURE__ */ c("div", { className: "flex items-center gap-1", children: [
1934
2014
  /* @__PURE__ */ e(
1935
- Q,
2015
+ ee,
1936
2016
  {
1937
2017
  size: "sm",
1938
2018
  variant: "ghost",
1939
2019
  onClick: () => P(0),
1940
2020
  disabled: z.page === 0,
1941
2021
  iconOnly: !0,
1942
- children: /* @__PURE__ */ e(dr, {})
2022
+ children: /* @__PURE__ */ e(hr, {})
1943
2023
  }
1944
2024
  ),
1945
2025
  /* @__PURE__ */ e(
1946
- Q,
2026
+ ee,
1947
2027
  {
1948
2028
  size: "sm",
1949
2029
  variant: "ghost",
1950
2030
  onClick: () => P(z.page - 1),
1951
2031
  disabled: z.page === 0,
1952
2032
  iconOnly: !0,
1953
- children: /* @__PURE__ */ e(or, {})
2033
+ children: /* @__PURE__ */ e(ur, {})
1954
2034
  }
1955
2035
  ),
1956
2036
  /* @__PURE__ */ c("span", { className: "px-3 py-1 text-sm text-gray-500 dark:text-gray-400", children: [
@@ -1960,79 +2040,79 @@ const ar = ({
1960
2040
  C
1961
2041
  ] }),
1962
2042
  /* @__PURE__ */ e(
1963
- Q,
2043
+ ee,
1964
2044
  {
1965
2045
  size: "sm",
1966
2046
  variant: "ghost",
1967
2047
  onClick: () => P(z.page + 1),
1968
2048
  disabled: z.page >= C - 1,
1969
2049
  iconOnly: !0,
1970
- children: /* @__PURE__ */ e(cr, {})
2050
+ children: /* @__PURE__ */ e(mr, {})
1971
2051
  }
1972
2052
  ),
1973
2053
  /* @__PURE__ */ e(
1974
- Q,
2054
+ ee,
1975
2055
  {
1976
2056
  size: "sm",
1977
2057
  variant: "ghost",
1978
2058
  onClick: () => P(C - 1),
1979
2059
  disabled: z.page >= C - 1,
1980
2060
  iconOnly: !0,
1981
- children: /* @__PURE__ */ e(ir, {})
2061
+ children: /* @__PURE__ */ e(fr, {})
1982
2062
  }
1983
2063
  )
1984
2064
  ] })
1985
2065
  ] })
1986
2066
  ] });
1987
- }, mr = Ae(null), Rr = ({
2067
+ }, xr = Ae(null), Kr = ({
1988
2068
  items: r,
1989
2069
  activeTab: l,
1990
2070
  onTabChange: t,
1991
2071
  className: a
1992
2072
  }) => {
1993
- const [o, i] = O(r[0]?.id || ""), f = l || o, p = (x) => {
1994
- t ? t(x) : i(x);
2073
+ const [o, i] = V(r[0]?.id || ""), h = l || o, g = (f) => {
2074
+ t ? t(f) : i(f);
1995
2075
  };
1996
- return /* @__PURE__ */ e("div", { className: b("border-b border-neutral-200 dark:border-neutral-700", a), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: r.map((x) => /* @__PURE__ */ e(
2076
+ return /* @__PURE__ */ e("div", { className: x("border-b border-neutral-200 dark:border-neutral-700", a), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: r.map((f) => /* @__PURE__ */ e(
1997
2077
  "button",
1998
2078
  {
1999
- onClick: () => !x.disabled && p(x.id),
2000
- disabled: x.disabled,
2001
- className: b(
2079
+ onClick: () => !f.disabled && g(f.id),
2080
+ disabled: f.disabled,
2081
+ className: x(
2002
2082
  "border-b-2 py-2 px-1 text-sm font-medium transition-colors duration-200",
2003
2083
  {
2004
- "border-primary text-primary": f === x.id,
2005
- "border-transparent text-neutral-500 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-300": f !== x.id && !x.disabled,
2006
- "border-transparent text-neutral-300 cursor-not-allowed dark:text-neutral-600": x.disabled
2084
+ "border-primary text-primary": h === f.id,
2085
+ "border-transparent text-neutral-500 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-300": h !== f.id && !f.disabled,
2086
+ "border-transparent text-neutral-300 cursor-not-allowed dark:text-neutral-600": f.disabled
2007
2087
  }
2008
2088
  ),
2009
2089
  children: /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: [
2010
- x.label,
2011
- x.badge && /* @__PURE__ */ e("span", { className: b(
2090
+ f.label,
2091
+ f.badge && /* @__PURE__ */ e("span", { className: x(
2012
2092
  "inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",
2013
- f === x.id ? "bg-primary/10 text-primary" : "bg-neutral-100 text-neutral-600 dark:bg-neutral-800 dark:text-neutral-400"
2014
- ), children: x.badge })
2093
+ h === f.id ? "bg-primary/10 text-primary" : "bg-neutral-100 text-neutral-600 dark:bg-neutral-800 dark:text-neutral-400"
2094
+ ), children: f.badge })
2015
2095
  ] })
2016
2096
  },
2017
- x.id
2097
+ f.id
2018
2098
  )) }) });
2019
- }, hr = ({
2099
+ }, gr = ({
2020
2100
  items: r,
2021
2101
  defaultTab: l,
2022
2102
  activeTab: t,
2023
2103
  onTabChange: a,
2024
2104
  variant: o = "default",
2025
2105
  size: i = "md",
2026
- className: f
2106
+ className: h
2027
2107
  }) => {
2028
- const [p, x] = O(
2108
+ const [g, f] = V(
2029
2109
  l || t || r[0]?.id || ""
2030
- ), v = t || p, m = (y) => {
2031
- a ? a(y) : x(y);
2032
- }, s = {
2033
- activeTab: v,
2110
+ ), b = t || g, m = (v) => {
2111
+ a ? a(v) : f(v);
2112
+ }, n = {
2113
+ activeTab: b,
2034
2114
  setActiveTab: m
2035
- }, d = r.find((y) => y.id === v), h = b(
2115
+ }, d = r.find((v) => v.id === b), p = x(
2036
2116
  "flex",
2037
2117
  {
2038
2118
  "border-b border-neutral-200 dark:border-neutral-700 px-2": o === "default" || o === "underline",
@@ -2040,8 +2120,8 @@ const ar = ({
2040
2120
  "space-x-1": o === "pills",
2041
2121
  "space-x-8": o === "default" || o === "underline"
2042
2122
  },
2043
- f
2044
- ), N = (y, S) => {
2123
+ h
2124
+ ), N = (v, S) => {
2045
2125
  const B = "transition-colors duration-200 font-medium", k = {
2046
2126
  "text-xs px-2 py-1": i === "sm",
2047
2127
  "text-sm px-3 py-2": i === "md",
@@ -2054,100 +2134,100 @@ const ar = ({
2054
2134
  // Underline variant
2055
2135
  "border-b-2 pb-2": o === "underline"
2056
2136
  }, K = {
2057
- "opacity-50 cursor-not-allowed": y.disabled,
2058
- "cursor-pointer": !y.disabled
2137
+ "opacity-50 cursor-not-allowed": v.disabled,
2138
+ "cursor-pointer": !v.disabled
2059
2139
  }, H = S ? {
2060
2140
  "border-primary text-primary": o === "default" || o === "underline",
2061
2141
  "bg-white dark:bg-neutral-700 text-neutral-900 dark:text-neutral-100 shadow-sm": o === "pills"
2062
- } : {}, _ = !S && !y.disabled ? {
2142
+ } : {}, F = !S && !v.disabled ? {
2063
2143
  "border-transparent text-neutral-600 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100": o === "default",
2064
2144
  "text-neutral-600 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100": o === "pills",
2065
2145
  "border-transparent text-neutral-600 hover:text-neutral-900 hover:border-neutral-300 dark:text-neutral-400 dark:hover:text-neutral-100": o === "underline"
2066
2146
  } : {};
2067
- return b(B, k, q, K, H, _);
2147
+ return x(B, k, q, K, H, F);
2068
2148
  };
2069
- return /* @__PURE__ */ e(mr.Provider, { value: s, children: /* @__PURE__ */ c("div", { children: [
2070
- /* @__PURE__ */ e("div", { className: h, role: "tablist", children: r.map((y) => /* @__PURE__ */ e(
2149
+ return /* @__PURE__ */ e(xr.Provider, { value: n, children: /* @__PURE__ */ c("div", { children: [
2150
+ /* @__PURE__ */ e("div", { className: p, role: "tablist", children: r.map((v) => /* @__PURE__ */ e(
2071
2151
  "button",
2072
2152
  {
2073
2153
  type: "button",
2074
2154
  role: "tab",
2075
- "aria-selected": v === y.id,
2076
- "aria-controls": `tabpanel-${y.id}`,
2077
- disabled: y.disabled,
2078
- onClick: () => !y.disabled && m(y.id),
2079
- className: N(y, v === y.id),
2155
+ "aria-selected": b === v.id,
2156
+ "aria-controls": `tabpanel-${v.id}`,
2157
+ disabled: v.disabled,
2158
+ onClick: () => !v.disabled && m(v.id),
2159
+ className: N(v, b === v.id),
2080
2160
  children: /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: [
2081
- y.label,
2082
- y.badge && /* @__PURE__ */ e("span", { className: "inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-neutral-200 text-neutral-700 dark:bg-neutral-700 dark:text-neutral-300", children: y.badge })
2161
+ v.label,
2162
+ v.badge && /* @__PURE__ */ e("span", { className: "inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-neutral-200 text-neutral-700 dark:bg-neutral-700 dark:text-neutral-300", children: v.badge })
2083
2163
  ] })
2084
2164
  },
2085
- y.id
2165
+ v.id
2086
2166
  )) }),
2087
2167
  d?.content && /* @__PURE__ */ e(
2088
2168
  "div",
2089
2169
  {
2090
2170
  role: "tabpanel",
2091
- id: `tabpanel-${v}`,
2092
- "aria-labelledby": `tab-${v}`,
2171
+ id: `tabpanel-${b}`,
2172
+ "aria-labelledby": `tab-${b}`,
2093
2173
  className: "mt-4",
2094
2174
  children: d.content
2095
2175
  }
2096
2176
  )
2097
2177
  ] }) });
2098
- }, fr = {
2178
+ }, br = {
2099
2179
  sm: "max-w-md",
2100
2180
  md: "max-w-lg",
2101
2181
  lg: "max-w-2xl",
2102
2182
  xl: "max-w-4xl",
2103
2183
  full: "max-w-full mx-4"
2104
2184
  };
2105
- function xr({
2185
+ function yr({
2106
2186
  open: r,
2107
2187
  onClose: l,
2108
2188
  title: t,
2109
2189
  size: a = "md",
2110
2190
  closeOnBackdropClick: o = !0,
2111
2191
  closeOnEscape: i = !0,
2112
- className: f,
2113
- backdropClassName: p,
2114
- children: x,
2115
- footer: v,
2192
+ className: h,
2193
+ backdropClassName: g,
2194
+ children: f,
2195
+ footer: b,
2116
2196
  showCloseButton: m = !0
2117
2197
  }) {
2118
- const s = ee(null), d = ee(null);
2119
- J(() => {
2198
+ const n = Q(null), d = Q(null);
2199
+ G(() => {
2120
2200
  if (!r || !i) return;
2121
- const N = (y) => {
2122
- y.key === "Escape" && l();
2201
+ const N = (v) => {
2202
+ v.key === "Escape" && l();
2123
2203
  };
2124
2204
  return document.addEventListener("keydown", N), () => document.removeEventListener("keydown", N);
2125
- }, [r, i, l]), J(() => (r ? (d.current = document.activeElement, s.current && s.current.focus(), document.body.style.overflow = "hidden") : (d.current && d.current.focus(), document.body.style.overflow = ""), () => {
2205
+ }, [r, i, l]), G(() => (r ? (d.current = document.activeElement, n.current && n.current.focus(), document.body.style.overflow = "hidden") : (d.current && d.current.focus(), document.body.style.overflow = ""), () => {
2126
2206
  document.body.style.overflow = "";
2127
2207
  }), [r]);
2128
- const h = (N) => {
2208
+ const p = (N) => {
2129
2209
  o && N.target === N.currentTarget && l();
2130
2210
  };
2131
2211
  return r ? /* @__PURE__ */ e(
2132
2212
  "div",
2133
2213
  {
2134
- className: b(
2214
+ className: x(
2135
2215
  "fixed inset-0 z-50 flex items-center justify-center p-4",
2136
2216
  "bg-black/20",
2137
2217
  // 'animate-fade-in',
2138
- p
2218
+ g
2139
2219
  ),
2140
- onClick: h,
2220
+ onClick: p,
2141
2221
  children: /* @__PURE__ */ c(
2142
2222
  "div",
2143
2223
  {
2144
- ref: s,
2145
- className: b(
2224
+ ref: n,
2225
+ className: x(
2146
2226
  "relative w-full bg-white dark:bg-secondary-800 rounded-modal shadow-modal rounded-md",
2147
2227
  // 'animate-scale-in',
2148
2228
  "focus:outline-none",
2149
- fr[a],
2150
- f
2229
+ br[a],
2230
+ h
2151
2231
  ),
2152
2232
  role: "dialog",
2153
2233
  "aria-modal": "true",
@@ -2173,8 +2253,8 @@ function xr({
2173
2253
  }
2174
2254
  )
2175
2255
  ] }),
2176
- /* @__PURE__ */ e("div", { className: "p-6", children: x }),
2177
- v && /* @__PURE__ */ e("div", { className: "px-6 py-4", children: v })
2256
+ /* @__PURE__ */ e("div", { className: "p-6", children: f }),
2257
+ b && /* @__PURE__ */ e("div", { className: "px-6 py-4", children: b })
2178
2258
  ]
2179
2259
  }
2180
2260
  )
@@ -2188,15 +2268,15 @@ const Z = ({
2188
2268
  color: a = "current",
2189
2269
  align: o = "left",
2190
2270
  truncate: i = !1,
2191
- italic: f = !1,
2192
- underline: p = !1,
2193
- lineHeight: x = "normal",
2194
- as: v,
2271
+ italic: h = !1,
2272
+ underline: g = !1,
2273
+ lineHeight: f = "normal",
2274
+ as: b,
2195
2275
  className: m,
2196
- children: s,
2276
+ children: n,
2197
2277
  ...d
2198
2278
  }) => {
2199
- const h = v || pr(r), N = b(
2279
+ const p = b || vr(r), N = x(
2200
2280
  // Base styles
2201
2281
  "font-primary",
2202
2282
  // Variant styles
@@ -2244,21 +2324,21 @@ const Z = ({
2244
2324
  },
2245
2325
  // Line height (override variant line heights)
2246
2326
  r === "body" && {
2247
- "leading-tight": x === "tight",
2248
- "leading-normal": x === "normal",
2249
- "leading-relaxed": x === "relaxed"
2327
+ "leading-tight": f === "tight",
2328
+ "leading-normal": f === "normal",
2329
+ "leading-relaxed": f === "relaxed"
2250
2330
  },
2251
2331
  // Text decorations
2252
2332
  {
2253
- italic: f,
2254
- underline: p,
2333
+ italic: h,
2334
+ underline: g,
2255
2335
  truncate: i
2256
2336
  },
2257
2337
  m
2258
2338
  );
2259
- return /* @__PURE__ */ e(h, { className: N, ...d, children: s });
2339
+ return /* @__PURE__ */ e(p, { className: N, ...d, children: n });
2260
2340
  };
2261
- function pr(r) {
2341
+ function vr(r) {
2262
2342
  return {
2263
2343
  body: "p",
2264
2344
  caption: "span",
@@ -2266,56 +2346,56 @@ function pr(r) {
2266
2346
  code: "code"
2267
2347
  }[r] || "p";
2268
2348
  }
2269
- const gr = ({
2349
+ const kr = ({
2270
2350
  value: r,
2271
2351
  onChange: l,
2272
2352
  label: t,
2273
2353
  placeholder: a = "Select or upload a file",
2274
2354
  error: o,
2275
2355
  disabled: i,
2276
- accept: f,
2277
- onListFiles: p,
2278
- onListMounts: x,
2279
- onUploadFile: v,
2356
+ accept: h,
2357
+ onListFiles: g,
2358
+ onListMounts: f,
2359
+ onUploadFile: b,
2280
2360
  onDownloadFile: m,
2281
- onRegisterFile: s
2361
+ onRegisterFile: n
2282
2362
  }) => {
2283
- const [d, h] = O(!1), [N, y] = O([]), [S, B] = O(null), [k, q] = O("/"), [K, H] = O([]), [_, E] = O(!1), [G, z] = O(""), [g, A] = O(
2363
+ const [d, p] = V(!1), [N, v] = V([]), [S, B] = V(null), [k, q] = V("/"), [K, H] = V([]), [F, M] = V(!1), [J, z] = V(""), [y, T] = V(
2284
2364
  typeof r == "object" ? r : null
2285
- ), [u, $] = O(!1), [L, D] = O(""), P = ee(null);
2286
- J(() => {
2287
- d && M();
2288
- }, [d]), J(() => {
2365
+ ), [u, $] = V(!1), [L, D] = V(""), P = Q(null);
2366
+ G(() => {
2367
+ d && E();
2368
+ }, [d]), G(() => {
2289
2369
  d && S && re();
2290
- }, [d, S, k, G]);
2291
- const M = async () => {
2292
- E(!0);
2370
+ }, [d, S, k, J]);
2371
+ const E = async () => {
2372
+ M(!0);
2293
2373
  try {
2294
- const n = await x?.();
2295
- n?.data && y(n.data);
2296
- } catch (n) {
2297
- console.error("Failed to load mounts", n);
2374
+ const s = await f?.();
2375
+ s?.data && v(s.data);
2376
+ } catch (s) {
2377
+ console.error("Failed to load mounts", s);
2298
2378
  } finally {
2299
- E(!1);
2379
+ M(!1);
2300
2380
  }
2301
2381
  }, re = async () => {
2302
2382
  if (S) {
2303
- E(!0);
2383
+ M(!0);
2304
2384
  try {
2305
- const n = await p?.({ mountId: S.id, name: G, path: k });
2306
- n?.data && H(n.data);
2307
- } catch (n) {
2308
- console.error("Failed to load files", n);
2385
+ const s = await g?.({ mountId: S.id, name: J, path: k });
2386
+ s?.data && H(s.data);
2387
+ } catch (s) {
2388
+ console.error("Failed to load files", s);
2309
2389
  } finally {
2310
- E(!1);
2390
+ M(!1);
2311
2391
  }
2312
2392
  }
2313
- }, ae = async (n) => {
2314
- const w = n.target.files?.[0];
2393
+ }, ne = async (s) => {
2394
+ const w = s.target.files?.[0];
2315
2395
  if (w) {
2316
- E(!0);
2396
+ M(!0);
2317
2397
  try {
2318
- const V = await w.arrayBuffer(), R = new Uint8Array(V), j = {
2398
+ const _ = await w.arrayBuffer(), R = new Uint8Array(_), j = {
2319
2399
  id: `local-${Date.now()}`,
2320
2400
  name: w.name,
2321
2401
  type: "file",
@@ -2326,20 +2406,20 @@ const gr = ({
2326
2406
  providerKey: w.name,
2327
2407
  ownerId: "me"
2328
2408
  };
2329
- A(j), l(j, R), h(!1);
2330
- } catch (V) {
2331
- console.error("Local file selection failed", V);
2409
+ T(j), l(j, R), p(!1);
2410
+ } catch (_) {
2411
+ console.error("Local file selection failed", _);
2332
2412
  } finally {
2333
- E(!1);
2413
+ M(!1);
2334
2414
  }
2335
2415
  }
2336
- }, W = async (n) => {
2337
- const w = n.target.files?.[0];
2416
+ }, W = async (s) => {
2417
+ const w = s.target.files?.[0];
2338
2418
  if (!(!w || !S)) {
2339
- E(!0);
2419
+ M(!0);
2340
2420
  try {
2341
- const V = await w.arrayBuffer(), R = await v?.({
2342
- file: new Uint8Array(V),
2421
+ const _ = await w.arrayBuffer(), R = await b?.({
2422
+ file: new Uint8Array(_),
2343
2423
  filename: w.name,
2344
2424
  mimeType: w.type || "application/octet-stream",
2345
2425
  mountId: S.id,
@@ -2347,118 +2427,118 @@ const gr = ({
2347
2427
  });
2348
2428
  if (R?.data) {
2349
2429
  const j = R.data;
2350
- A(j), l(j, new Uint8Array(V)), h(!1);
2430
+ T(j), l(j, new Uint8Array(_)), p(!1);
2351
2431
  }
2352
- } catch (V) {
2353
- console.error("Upload failed", V);
2432
+ } catch (_) {
2433
+ console.error("Upload failed", _);
2354
2434
  } finally {
2355
- E(!1);
2435
+ M(!1);
2356
2436
  }
2357
2437
  }
2358
2438
  }, C = async () => {
2359
2439
  if (!(!L || !S)) {
2360
- E(!0);
2440
+ M(!0);
2361
2441
  try {
2362
- const n = `${k}${L}/`;
2363
- s && (await s({
2442
+ const s = `${k}${L}/`;
2443
+ n && (await n({
2364
2444
  name: L,
2365
2445
  type: "folder",
2366
2446
  path: k,
2367
2447
  mimeType: "application/x-directory",
2368
2448
  size: 0,
2369
2449
  mountId: S.id,
2370
- providerKey: n,
2450
+ providerKey: s,
2371
2451
  ownerId: "me"
2372
2452
  }), await re()), $(!1), D("");
2373
- } catch (n) {
2374
- console.error("Failed to create folder", n);
2453
+ } catch (s) {
2454
+ console.error("Failed to create folder", s);
2375
2455
  } finally {
2376
- E(!1);
2456
+ M(!1);
2377
2457
  }
2378
2458
  }
2379
- }, I = async (n) => {
2380
- E(!0);
2459
+ }, I = async (s) => {
2460
+ M(!0);
2381
2461
  try {
2382
- const w = await m?.(n.id);
2383
- A(n), l(n, w), h(!1);
2462
+ const w = await m?.(s.id);
2463
+ T(s), l(s, w), p(!1);
2384
2464
  } catch (w) {
2385
2465
  console.error("Failed to download file", w);
2386
2466
  } finally {
2387
- E(!1);
2467
+ M(!1);
2388
2468
  }
2389
- }, F = (n) => {
2390
- n.stopPropagation(), A(null), l(null);
2391
- }, T = ie(() => {
2392
- const n = /* @__PURE__ */ new Set(), w = [];
2393
- return K.forEach((V) => {
2394
- if (V.type === "folder") {
2395
- V.path === k && n.add(V.name);
2469
+ }, O = (s) => {
2470
+ s.stopPropagation(), T(null), l(null);
2471
+ }, A = ie(() => {
2472
+ const s = /* @__PURE__ */ new Set(), w = [];
2473
+ return K.forEach((_) => {
2474
+ if (_.type === "folder") {
2475
+ _.path === k && s.add(_.name);
2396
2476
  return;
2397
2477
  }
2398
- const R = V.providerKey || V.name, Y = (k ? R.substring(k.length) : R).split("/").filter((fe) => fe !== "");
2399
- Y.length > 1 ? n.add(Y[0]) : Y.length === 1 && w.push(V);
2478
+ const R = _.providerKey || _.name, Y = (k ? R.substring(k.length) : R).split("/").filter((fe) => fe !== "");
2479
+ Y.length > 1 ? s.add(Y[0]) : Y.length === 1 && w.push(_);
2400
2480
  }), {
2401
- folders: Array.from(n).sort(),
2402
- files: w.sort((V, R) => V.name.localeCompare(R.name))
2481
+ folders: Array.from(s).sort(),
2482
+ files: w.sort((_, R) => _.name.localeCompare(R.name))
2403
2483
  };
2404
- }, [K, k]), X = (n) => {
2405
- q((w) => `${w}${n}/`);
2484
+ }, [K, k]), X = (s) => {
2485
+ q((w) => `${w}${s}/`);
2406
2486
  }, te = () => {
2407
- const n = k.split("/").filter((w) => w !== "");
2408
- n.pop(), n.length === 0 ? q("/") : q(`${n.join("/")}/`);
2487
+ const s = k.split("/").filter((w) => w !== "");
2488
+ s.pop(), s.length === 0 ? q("/") : q(`${s.join("/")}/`);
2409
2489
  }, U = ie(() => {
2410
- const n = T.folders.map((w) => ({
2490
+ const s = A.folders.map((w) => ({
2411
2491
  id: `folder-${w}`,
2412
2492
  name: w,
2413
2493
  type: "folder"
2414
2494
  }));
2415
- return T.files.forEach((w) => {
2416
- n.push({
2495
+ return A.files.forEach((w) => {
2496
+ s.push({
2417
2497
  ...w,
2418
2498
  type: "file"
2419
2499
  });
2420
- }), n;
2421
- }, [T]), le = [
2500
+ }), s;
2501
+ }, [A]), le = [
2422
2502
  {
2423
2503
  id: "name",
2424
2504
  header: "Name",
2425
2505
  accessor: "name",
2426
- cell: (n, w) => /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
2506
+ cell: (s, w) => /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
2427
2507
  /* @__PURE__ */ e(
2428
2508
  oe,
2429
2509
  {
2430
- icon: w.type === "folder" ? we : xe,
2510
+ icon: w.type === "folder" ? we : pe,
2431
2511
  size: "sm",
2432
2512
  color: w.type === "folder" ? "warning" : "secondary"
2433
2513
  }
2434
2514
  ),
2435
- /* @__PURE__ */ e("span", { className: b(w.type === "folder" && "font-medium"), children: n })
2515
+ /* @__PURE__ */ e("span", { className: x(w.type === "folder" && "font-medium"), children: s })
2436
2516
  ] })
2437
2517
  },
2438
2518
  {
2439
2519
  id: "type",
2440
2520
  header: "Type",
2441
- accessor: (n) => n.type === "folder" ? "Folder" : n.mimeType
2521
+ accessor: (s) => s.type === "folder" ? "Folder" : s.mimeType
2442
2522
  },
2443
2523
  {
2444
2524
  id: "size",
2445
2525
  header: "Size",
2446
- accessor: (n) => n.type === "file" ? `${(n.size / 1024).toFixed(1)} KB` : "-"
2526
+ accessor: (s) => s.type === "file" ? `${(s.size / 1024).toFixed(1)} KB` : "-"
2447
2527
  },
2448
2528
  {
2449
2529
  id: "actions",
2450
2530
  header: "",
2451
2531
  accessor: "id",
2452
2532
  align: "right",
2453
- cell: (n, w) => /* @__PURE__ */ e(
2454
- Q,
2533
+ cell: (s, w) => /* @__PURE__ */ e(
2534
+ ee,
2455
2535
  {
2456
2536
  size: "sm",
2457
2537
  variant: "outline",
2458
- onClick: (V) => {
2459
- V.stopPropagation(), w.type === "folder" ? X(w.name) : I(w);
2538
+ onClick: (_) => {
2539
+ _.stopPropagation(), w.type === "folder" ? X(w.name) : I(w);
2460
2540
  },
2461
- loading: _ && w.type === "file" && g?.id === w.id,
2541
+ loading: F && w.type === "file" && y?.id === w.id,
2462
2542
  children: w.type === "folder" ? "Open" : "Select"
2463
2543
  }
2464
2544
  )
@@ -2468,9 +2548,9 @@ const gr = ({
2468
2548
  id: "name",
2469
2549
  header: "Mount Name",
2470
2550
  accessor: "name",
2471
- cell: (n) => /* @__PURE__ */ c("div", { className: "flex items-center gap-2 font-medium", children: [
2551
+ cell: (s) => /* @__PURE__ */ c("div", { className: "flex items-center gap-2 font-medium", children: [
2472
2552
  /* @__PURE__ */ e(oe, { icon: Ne, size: "sm", color: "primary" }),
2473
- /* @__PURE__ */ e("span", { children: n })
2553
+ /* @__PURE__ */ e("span", { children: s })
2474
2554
  ] })
2475
2555
  },
2476
2556
  {
@@ -2478,7 +2558,7 @@ const gr = ({
2478
2558
  header: "",
2479
2559
  accessor: "id",
2480
2560
  align: "right",
2481
- cell: (n, w) => /* @__PURE__ */ e(Q, { size: "sm", variant: "outline", onClick: () => B(w), children: "Open" })
2561
+ cell: (s, w) => /* @__PURE__ */ e(ee, { size: "sm", variant: "outline", onClick: () => B(w), children: "Open" })
2482
2562
  }
2483
2563
  ];
2484
2564
  return /* @__PURE__ */ c("div", { className: "space-y-1", children: [
@@ -2486,22 +2566,22 @@ const gr = ({
2486
2566
  /* @__PURE__ */ c(
2487
2567
  "div",
2488
2568
  {
2489
- onClick: () => !i && h(!0),
2490
- className: b(
2569
+ onClick: () => !i && p(!0),
2570
+ className: x(
2491
2571
  "flex items-center gap-3 px-3 py-2 border rounded-lg cursor-pointer transition-colors",
2492
2572
  "hover:border-primary-400 bg-white dark:bg-secondary-800",
2493
2573
  o ? "border-error" : "border-neutral-200 dark:border-neutral-700",
2494
2574
  i && "opacity-50 cursor-not-allowed bg-neutral-50"
2495
2575
  ),
2496
2576
  children: [
2497
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(oe, { icon: g ? xe : Ne, color: g ? "primary" : "secondary" }) }),
2498
- /* @__PURE__ */ e("div", { className: "flex-grow truncate", children: g ? /* @__PURE__ */ e("span", { className: "text-sm text-neutral-900 dark:text-neutral-100 font-medium", children: g.name }) : /* @__PURE__ */ e("span", { className: "text-sm text-neutral-500", children: a }) }),
2499
- g && !i && /* @__PURE__ */ e(
2577
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(oe, { icon: y ? pe : Ne, color: y ? "primary" : "secondary" }) }),
2578
+ /* @__PURE__ */ e("div", { className: "flex-grow truncate", children: y ? /* @__PURE__ */ e("span", { className: "text-sm text-neutral-900 dark:text-neutral-100 font-medium", children: y.name }) : /* @__PURE__ */ e("span", { className: "text-sm text-neutral-500", children: a }) }),
2579
+ y && !i && /* @__PURE__ */ e(
2500
2580
  "button",
2501
2581
  {
2502
- onClick: F,
2582
+ onClick: O,
2503
2583
  className: "p-1 hover:bg-neutral-100 dark:hover:bg-neutral-700 rounded",
2504
- children: /* @__PURE__ */ e(oe, { icon: Ie, size: "xs" })
2584
+ children: /* @__PURE__ */ e(oe, { icon: Be, size: "xs" })
2505
2585
  }
2506
2586
  )
2507
2587
  ]
@@ -2509,26 +2589,26 @@ const gr = ({
2509
2589
  ),
2510
2590
  o && /* @__PURE__ */ e(Z, { variant: "body", size: "xs", className: "text-error", children: o }),
2511
2591
  /* @__PURE__ */ e(
2512
- xr,
2592
+ yr,
2513
2593
  {
2514
2594
  open: d,
2515
2595
  onClose: () => {
2516
- h(!1), B(null), q("/"), $(!1);
2596
+ p(!1), B(null), q("/"), $(!1);
2517
2597
  },
2518
2598
  title: S ? `Explorer: ${S.name}` : "Select Storage Mount",
2519
2599
  size: "lg",
2520
2600
  children: /* @__PURE__ */ e(
2521
- hr,
2601
+ gr,
2522
2602
  {
2523
2603
  variant: "pills",
2524
2604
  items: [
2525
2605
  {
2526
2606
  id: "remote",
2527
2607
  label: "Platform Storage",
2528
- content: /* @__PURE__ */ e("div", { className: "space-y-4", children: S ? /* @__PURE__ */ c(Le, { children: [
2608
+ content: /* @__PURE__ */ e("div", { className: "space-y-4", children: S ? /* @__PURE__ */ c(Ee, { children: [
2529
2609
  /* @__PURE__ */ c("div", { className: "flex flex-wrap items-center gap-2", children: [
2530
2610
  /* @__PURE__ */ e(
2531
- Q,
2611
+ ee,
2532
2612
  {
2533
2613
  variant: "ghost",
2534
2614
  size: "sm",
@@ -2544,32 +2624,32 @@ const gr = ({
2544
2624
  ue,
2545
2625
  {
2546
2626
  placeholder: "Search...",
2547
- value: G,
2548
- onChange: (n) => z(n.target.value),
2549
- startIcon: /* @__PURE__ */ e(je, { size: 14 }),
2627
+ value: J,
2628
+ onChange: (s) => z(s.target.value),
2629
+ startIcon: /* @__PURE__ */ e(Pe, { size: 14 }),
2550
2630
  fullWidth: !0,
2551
2631
  size: "sm"
2552
2632
  }
2553
2633
  ) }),
2554
2634
  /* @__PURE__ */ c("div", { className: "flex items-center gap-1", children: [
2555
2635
  /* @__PURE__ */ e(
2556
- Q,
2636
+ ee,
2557
2637
  {
2558
2638
  variant: "outline",
2559
2639
  size: "sm",
2560
2640
  onClick: () => $(!0),
2561
- leftIcon: /* @__PURE__ */ e(oe, { icon: Be, size: "xs" }),
2641
+ leftIcon: /* @__PURE__ */ e(oe, { icon: _e, size: "xs" }),
2562
2642
  children: "New Folder"
2563
2643
  }
2564
2644
  ),
2565
2645
  /* @__PURE__ */ e(
2566
- Q,
2646
+ ee,
2567
2647
  {
2568
2648
  variant: "primary",
2569
2649
  size: "sm",
2570
2650
  onClick: () => P.current?.click(),
2571
- leftIcon: /* @__PURE__ */ e(oe, { icon: Pe, size: "xs" }),
2572
- loading: _,
2651
+ leftIcon: /* @__PURE__ */ e(oe, { icon: Oe, size: "xs" }),
2652
+ loading: F,
2573
2653
  children: "Upload"
2574
2654
  }
2575
2655
  ),
@@ -2580,7 +2660,7 @@ const gr = ({
2580
2660
  className: "hidden",
2581
2661
  ref: P,
2582
2662
  onChange: W,
2583
- accept: f
2663
+ accept: h
2584
2664
  }
2585
2665
  )
2586
2666
  ] })
@@ -2593,31 +2673,31 @@ const gr = ({
2593
2673
  size: "sm",
2594
2674
  placeholder: "Folder name",
2595
2675
  value: L,
2596
- onChange: (n) => D(n.target.value),
2676
+ onChange: (s) => D(s.target.value),
2597
2677
  autoFocus: !0
2598
2678
  }
2599
2679
  ),
2600
- /* @__PURE__ */ e(Q, { size: "sm", onClick: C, loading: _, children: "Create" }),
2601
- /* @__PURE__ */ e(Q, { size: "sm", variant: "ghost", onClick: () => $(!1), children: "Cancel" })
2680
+ /* @__PURE__ */ e(ee, { size: "sm", onClick: C, loading: F, children: "Create" }),
2681
+ /* @__PURE__ */ e(ee, { size: "sm", variant: "ghost", onClick: () => $(!1), children: "Cancel" })
2602
2682
  ] }),
2603
2683
  /* @__PURE__ */ e("div", { className: "max-h-[400px] overflow-auto rounded-lg border border-neutral-200 dark:border-neutral-700", children: /* @__PURE__ */ e(
2604
- Ce,
2684
+ Se,
2605
2685
  {
2606
2686
  data: U,
2607
2687
  columns: le,
2608
- loading: _,
2688
+ loading: F,
2609
2689
  emptyContent: "This folder is empty",
2610
- onRowClick: (n) => n.type === "folder" ? X(n.name) : I(n)
2690
+ onRowClick: (s) => s.type === "folder" ? X(s.name) : I(s)
2611
2691
  }
2612
2692
  ) })
2613
2693
  ] }) : /* @__PURE__ */ e("div", { className: "max-h-[400px] overflow-auto rounded-lg border border-neutral-200 dark:border-neutral-700", children: /* @__PURE__ */ e(
2614
- Ce,
2694
+ Se,
2615
2695
  {
2616
2696
  data: N,
2617
2697
  columns: he,
2618
- loading: _,
2698
+ loading: F,
2619
2699
  emptyContent: "No storage mounts configured",
2620
- onRowClick: (n) => B(n)
2700
+ onRowClick: (s) => B(s)
2621
2701
  }
2622
2702
  ) }) })
2623
2703
  },
@@ -2625,7 +2705,7 @@ const gr = ({
2625
2705
  id: "local",
2626
2706
  label: "Local File",
2627
2707
  content: /* @__PURE__ */ e("div", { className: "space-y-6", children: /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center py-12 border-2 border-dashed border-neutral-200 dark:border-neutral-700 rounded-xl bg-neutral-50 dark:bg-secondary-900/50", children: [
2628
- /* @__PURE__ */ e("div", { className: "p-4 bg-primary/10 rounded-full mb-4", children: /* @__PURE__ */ e(oe, { icon: xe, size: "xl", color: "primary" }) }),
2708
+ /* @__PURE__ */ e("div", { className: "p-4 bg-primary/10 rounded-full mb-4", children: /* @__PURE__ */ e(oe, { icon: pe, size: "xl", color: "primary" }) }),
2629
2709
  /* @__PURE__ */ e(Z, { variant: "label", size: "lg", weight: "semibold", children: "Select a file from your computer" }),
2630
2710
  /* @__PURE__ */ c(Z, { variant: "body", size: "sm", className: "text-neutral-500 mt-1 mb-6 text-center max-w-xs", children: [
2631
2711
  "This file will be used directly in the form and will ",
@@ -2633,11 +2713,11 @@ const gr = ({
2633
2713
  " be uploaded to platform storage."
2634
2714
  ] }),
2635
2715
  /* @__PURE__ */ c("label", { className: "cursor-pointer", children: [
2636
- /* @__PURE__ */ c("div", { className: b(
2716
+ /* @__PURE__ */ c("div", { className: x(
2637
2717
  "inline-flex items-center justify-center font-medium rounded-lg transition-colors duration-200 px-6 py-3 text-base bg-primary text-white hover:bg-primary-600",
2638
- _ && "opacity-50 cursor-wait"
2718
+ F && "opacity-50 cursor-wait"
2639
2719
  ), children: [
2640
- _ && /* @__PURE__ */ c("svg", { className: "animate-spin h-4 w-4 mr-2", fill: "none", viewBox: "0 0 24 24", children: [
2720
+ F && /* @__PURE__ */ c("svg", { className: "animate-spin h-4 w-4 mr-2", fill: "none", viewBox: "0 0 24 24", children: [
2641
2721
  /* @__PURE__ */ e("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
2642
2722
  /* @__PURE__ */ e("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
2643
2723
  ] }),
@@ -2648,9 +2728,9 @@ const gr = ({
2648
2728
  {
2649
2729
  type: "file",
2650
2730
  className: "hidden",
2651
- onChange: ae,
2652
- accept: f,
2653
- disabled: _
2731
+ onChange: ne,
2732
+ accept: h,
2733
+ disabled: F
2654
2734
  }
2655
2735
  )
2656
2736
  ] })
@@ -2663,54 +2743,54 @@ const gr = ({
2663
2743
  )
2664
2744
  ] });
2665
2745
  };
2666
- function Se(r, l) {
2746
+ function Le(r, l) {
2667
2747
  return l.split(".").reduce(
2668
2748
  (t, a) => t && typeof t == "object" && a in t ? t[a] : void 0,
2669
2749
  r
2670
2750
  );
2671
2751
  }
2672
- function br(r, l, t) {
2752
+ function Nr(r, l, t) {
2673
2753
  const a = l.split("."), o = Array.isArray(r) ? [...r] : { ...r };
2674
2754
  let i = o;
2675
- for (let f = 0; f < a.length - 1; f++) {
2676
- const p = a[f], x = i[p];
2677
- i[p] = x && typeof x == "object" ? Array.isArray(x) ? [...x] : { ...x } : {}, i = i[p];
2755
+ for (let h = 0; h < a.length - 1; h++) {
2756
+ const g = a[h], f = i[g];
2757
+ i[g] = f && typeof f == "object" ? Array.isArray(f) ? [...f] : { ...f } : {}, i = i[g];
2678
2758
  }
2679
2759
  return i[a[a.length - 1]] = t, o;
2680
2760
  }
2681
- function yr(r, l) {
2761
+ function wr(r, l) {
2682
2762
  const t = l.split("."), a = Array.isArray(r) ? [...r] : { ...r };
2683
2763
  let o = a;
2684
2764
  for (let i = 0; i < t.length - 1; i++) {
2685
- const f = t[i];
2686
- if (!o[f] || typeof o[f] != "object") return a;
2687
- o[f] = Array.isArray(o[f]) ? [...o[f]] : { ...o[f] }, o = o[f];
2765
+ const h = t[i];
2766
+ if (!o[h] || typeof o[h] != "object") return a;
2767
+ o[h] = Array.isArray(o[h]) ? [...o[h]] : { ...o[h] }, o = o[h];
2688
2768
  }
2689
2769
  return delete o[t[t.length - 1]], a;
2690
2770
  }
2691
- const qr = ({
2771
+ const Gr = ({
2692
2772
  groups: r,
2693
2773
  data: l,
2694
2774
  onSubmit: t,
2695
2775
  onCancel: a,
2696
2776
  onChange: o,
2697
2777
  transform: i,
2698
- validate: f,
2699
- submitButton: p = { label: "Submit", variant: "primary" },
2700
- cancelButton: x = { label: "Cancel", variant: "outline" },
2701
- showButtons: v = !0,
2778
+ validate: h,
2779
+ submitButton: g = { label: "Submit", variant: "primary" },
2780
+ cancelButton: f = { label: "Cancel", variant: "outline" },
2781
+ showButtons: b = !0,
2702
2782
  layout: m = "vertical",
2703
- size: s = "md",
2783
+ size: n = "md",
2704
2784
  loading: d = !1,
2705
- className: h,
2785
+ className: p,
2706
2786
  ref: N,
2707
- sdk: y
2787
+ sdk: v
2708
2788
  }) => {
2709
- const [S, B] = O(l || {}), [k, q] = O({}), [K, H] = O({});
2710
- J(() => {
2789
+ const [S, B] = V(l || {}), [k, q] = V({}), [K, H] = V({});
2790
+ G(() => {
2711
2791
  l && B({ ...l });
2712
2792
  }, [l]);
2713
- const _ = ne(
2793
+ const F = ae(
2714
2794
  (u, $, L) => {
2715
2795
  const D = r.flatMap((P) => P.items).find((P) => P.name === u);
2716
2796
  if (!D) return null;
@@ -2723,57 +2803,57 @@ const qr = ({
2723
2803
  return `${D.label} must be an array.`;
2724
2804
  if (Array.isArray($) && D.arrayFields) {
2725
2805
  const P = [];
2726
- let M = !1;
2727
- if ($.forEach((re, ae) => {
2806
+ let E = !1;
2807
+ if ($.forEach((re, ne) => {
2728
2808
  const W = {};
2729
2809
  for (const C of D.arrayFields) {
2730
2810
  const I = re?.[C.name];
2731
2811
  if (C.required && (I == null || I === ""))
2732
- W[C.name] = `${C.label} is required`, M = !0;
2812
+ W[C.name] = `${C.label} is required`, E = !0;
2733
2813
  else if (C.validator) {
2734
- const F = C.validator(I, re);
2735
- F && (W[C.name] = F, M = !0);
2814
+ const O = C.validator(I, re);
2815
+ O && (W[C.name] = O, E = !0);
2736
2816
  }
2737
2817
  }
2738
- P[ae] = W;
2739
- }), M)
2818
+ P[ne] = W;
2819
+ }), E)
2740
2820
  return JSON.stringify(P);
2741
2821
  }
2742
2822
  }
2743
2823
  return D.validator ? D.validator($, L) : null;
2744
2824
  },
2745
2825
  [r]
2746
- ), E = ne(
2826
+ ), M = ae(
2747
2827
  (u, $) => {
2748
- let L = br(
2828
+ let L = Nr(
2749
2829
  S,
2750
2830
  u,
2751
2831
  $
2752
2832
  );
2753
- r.flatMap((M) => M.items).find((M) => M.name === u)?.removeIfEmpty && ($ == null || $ === "") && (L = yr(L, u)), B(L), H((M) => ({ ...M, [u]: !0 }));
2754
- const P = _(u, $, L);
2755
- q((M) => ({
2756
- ...M,
2833
+ r.flatMap((E) => E.items).find((E) => E.name === u)?.removeIfEmpty && ($ == null || $ === "") && (L = wr(L, u)), B(L), H((E) => ({ ...E, [u]: !0 }));
2834
+ const P = F(u, $, L);
2835
+ q((E) => ({
2836
+ ...E,
2757
2837
  [u]: P || ""
2758
2838
  })), o?.(L, u);
2759
2839
  },
2760
- [S, r, _, o]
2761
- ), G = ne(
2840
+ [S, r, F, o]
2841
+ ), J = ae(
2762
2842
  async (u) => {
2763
2843
  if (console.log("handleSubmit"), u.preventDefault(), d) return;
2764
2844
  const $ = {}, L = r.flatMap((P) => P.items);
2765
2845
  for (const P of L) {
2766
2846
  if (P.hidden || P.conditional && !P.conditional(S))
2767
2847
  continue;
2768
- const M = _(
2848
+ const E = F(
2769
2849
  P.name,
2770
- Se(S, P.name),
2850
+ Le(S, P.name),
2771
2851
  S
2772
2852
  );
2773
- M && ($[P.name] = M);
2853
+ E && ($[P.name] = E);
2774
2854
  }
2775
- if (f) {
2776
- const P = f(S);
2855
+ if (h) {
2856
+ const P = h(S);
2777
2857
  P && Object.assign($, P);
2778
2858
  }
2779
2859
  if (q($), console.log("newErrors", $), Object.keys($).some((P) => $[P]))
@@ -2781,10 +2861,10 @@ const qr = ({
2781
2861
  const D = i ? i(S) : S;
2782
2862
  await t?.(S, D);
2783
2863
  },
2784
- [S, r, _, f, i, t, d]
2785
- ), z = ne(
2864
+ [S, r, F, h, i, t, d]
2865
+ ), z = ae(
2786
2866
  (u) => {
2787
- const $ = Se(S, u.name), L = K[u.name] ? k[u.name] : void 0, D = u.disabled || d, P = {
2867
+ const $ = Le(S, u.name), L = K[u.name] ? k[u.name] : void 0, D = u.disabled || d, P = {
2788
2868
  value: $ || "",
2789
2869
  disabled: D,
2790
2870
  required: u.required,
@@ -2802,11 +2882,11 @@ const qr = ({
2802
2882
  ue,
2803
2883
  {
2804
2884
  ...P,
2805
- onChange: (M) => E(u.name, M.target.value),
2885
+ onChange: (E) => M(u.name, E.target.value),
2806
2886
  type: u.textType || u.type,
2807
2887
  autoComplete: u.autocomplete,
2808
2888
  error: L,
2809
- size: s
2889
+ size: n
2810
2890
  }
2811
2891
  );
2812
2892
  case "textarea":
@@ -2814,10 +2894,10 @@ const qr = ({
2814
2894
  ke,
2815
2895
  {
2816
2896
  ...P,
2817
- onChange: (M) => E(u.name, M.target.value),
2897
+ onChange: (E) => M(u.name, E.target.value),
2818
2898
  rows: 4,
2819
2899
  error: L,
2820
- size: s
2900
+ size: n
2821
2901
  }
2822
2902
  );
2823
2903
  case "select":
@@ -2825,16 +2905,16 @@ const qr = ({
2825
2905
  ve,
2826
2906
  {
2827
2907
  ...P,
2828
- onChange: (M) => E(u.name, M),
2829
- options: (u.options || []).map((M) => ({
2830
- ...M,
2831
- value: String(M.value)
2908
+ onChange: (E) => M(u.name, E),
2909
+ options: (u.options || []).map((E) => ({
2910
+ ...E,
2911
+ value: String(E.value)
2832
2912
  })),
2833
2913
  searchable: u.searchable,
2834
2914
  multiple: u.multiple,
2835
2915
  allowCreate: u.allowCreate,
2836
2916
  error: L,
2837
- size: s
2917
+ size: n
2838
2918
  }
2839
2919
  );
2840
2920
  case "checkbox":
@@ -2843,117 +2923,117 @@ const qr = ({
2843
2923
  {
2844
2924
  ...P,
2845
2925
  checked: !!$,
2846
- onChange: (M) => E(u.name, M.target.checked),
2847
- size: s
2926
+ onChange: (E) => M(u.name, E.target.checked),
2927
+ size: n
2848
2928
  }
2849
2929
  );
2850
2930
  case "radio":
2851
- return /* @__PURE__ */ e("div", { className: "space-y-1", children: u.options?.map((M) => /* @__PURE__ */ c("label", { className: "flex items-center gap-2", children: [
2931
+ return /* @__PURE__ */ e("div", { className: "space-y-1", children: u.options?.map((E) => /* @__PURE__ */ c("label", { className: "flex items-center gap-2", children: [
2852
2932
  /* @__PURE__ */ e(
2853
2933
  "input",
2854
2934
  {
2855
2935
  type: "radio",
2856
2936
  name: u.name,
2857
- value: M.value,
2858
- checked: $ === M.value,
2859
- onChange: () => E(u.name, M.value),
2860
- disabled: D || M.disabled,
2937
+ value: E.value,
2938
+ checked: $ === E.value,
2939
+ onChange: () => M(u.name, E.value),
2940
+ disabled: D || E.disabled,
2861
2941
  className: "rounded-full border-neutral-100 dark:border-neutral-600"
2862
2942
  }
2863
2943
  ),
2864
- /* @__PURE__ */ e(Z, { variant: "label", size: "sm", children: M.label })
2865
- ] }, M.value)) });
2944
+ /* @__PURE__ */ e(Z, { variant: "label", size: "sm", children: E.label })
2945
+ ] }, E.value)) });
2866
2946
  case "date":
2867
2947
  return /* @__PURE__ */ e(
2868
2948
  ye,
2869
2949
  {
2870
2950
  ...P,
2871
2951
  value: $ ? new Date($) : null,
2872
- onChange: (M) => E(u.name, M),
2873
- size: s
2952
+ onChange: (E) => M(u.name, E),
2953
+ size: n
2874
2954
  }
2875
2955
  );
2876
2956
  case "file":
2877
2957
  return /* @__PURE__ */ e(
2878
- gr,
2958
+ kr,
2879
2959
  {
2880
2960
  ...P,
2881
2961
  value: $,
2882
- onChange: (M) => E(u.name, M),
2962
+ onChange: (E) => M(u.name, E),
2883
2963
  error: L,
2884
- onListFiles: (M) => y?.http.invoke({
2964
+ onListFiles: (E) => v?.http.invoke({
2885
2965
  method: "POST",
2886
2966
  action: "storage.file.list",
2887
- body: M
2967
+ body: E
2888
2968
  }),
2889
- onListMounts: () => y?.http.invoke({
2969
+ onListMounts: () => v?.http.invoke({
2890
2970
  method: "GET",
2891
2971
  action: "storage.mount"
2892
2972
  }),
2893
- onUploadFile: (M) => y?.http.invoke({
2973
+ onUploadFile: (E) => v?.http.invoke({
2894
2974
  method: "POST",
2895
2975
  action: "storage.file.upload",
2896
- body: M
2976
+ body: E
2897
2977
  }),
2898
- onDownloadFile: (M) => y?.http.invoke({
2978
+ onDownloadFile: (E) => v?.http.invoke({
2899
2979
  method: "GET",
2900
- action: `storage.file.${M}.download`
2980
+ action: `storage.file.${E}.download`
2901
2981
  }),
2902
- onRegisterFile: (M) => y?.http.invoke({
2982
+ onRegisterFile: (E) => v?.http.invoke({
2903
2983
  method: "POST",
2904
2984
  action: "storage.file.folder",
2905
- body: M
2985
+ body: E
2906
2986
  })
2907
2987
  }
2908
2988
  );
2909
2989
  case "custom":
2910
2990
  return u.customComponent?.({
2911
2991
  value: $,
2912
- onChange: (M) => E(u.name, M),
2992
+ onChange: (E) => M(u.name, E),
2913
2993
  error: L,
2914
2994
  disabled: D
2915
2995
  });
2916
2996
  case "array": {
2917
- const M = $ || [];
2997
+ const E = $ || [];
2918
2998
  let re = [];
2919
2999
  if (typeof L == "string" && L.startsWith("["))
2920
3000
  try {
2921
3001
  re = JSON.parse(L);
2922
3002
  } catch {
2923
3003
  }
2924
- const ae = () => {
2925
- E(u.name, [...M, {}]);
3004
+ const ne = () => {
3005
+ M(u.name, [...E, {}]);
2926
3006
  }, W = (I) => {
2927
- E(
3007
+ M(
2928
3008
  u.name,
2929
- M.filter((F, T) => T !== I)
3009
+ E.filter((O, A) => A !== I)
2930
3010
  );
2931
- }, C = (I, F, T) => {
2932
- const X = [...M];
3011
+ }, C = (I, O, A) => {
3012
+ const X = [...E];
2933
3013
  X[I] = {
2934
3014
  ...X[I],
2935
- [F]: T
2936
- }, E(u.name, X);
3015
+ [O]: A
3016
+ }, M(u.name, X);
2937
3017
  };
2938
3018
  return /* @__PURE__ */ c("div", { className: "space-y-2", children: [
2939
- M.map((I, F) => /* @__PURE__ */ c(
3019
+ E.map((I, O) => /* @__PURE__ */ c(
2940
3020
  "div",
2941
3021
  {
2942
3022
  className: "p-4 border rounded-md dark:border-neutral-700 space-y-2 relative",
2943
3023
  children: [
2944
3024
  /* @__PURE__ */ e("div", { className: "absolute top-2 right-2", children: /* @__PURE__ */ e(
2945
- Q,
3025
+ ee,
2946
3026
  {
2947
3027
  type: "button",
2948
3028
  variant: "ghost",
2949
3029
  size: "sm",
2950
- onClick: () => W(F),
3030
+ onClick: () => W(O),
2951
3031
  disabled: D,
2952
3032
  children: "Remove"
2953
3033
  }
2954
3034
  ) }),
2955
- /* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: u.arrayFields?.map((T) => {
2956
- const X = re?.[F]?.[T.name];
3035
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: u.arrayFields?.map((A) => {
3036
+ const X = re?.[O]?.[A.name];
2957
3037
  return /* @__PURE__ */ c(
2958
3038
  "div",
2959
3039
  {
@@ -2966,20 +3046,20 @@ const qr = ({
2966
3046
  size: "sm",
2967
3047
  className: "font-semibold text-neutral-700 dark:text-neutral-300",
2968
3048
  children: [
2969
- T.label,
2970
- T.required && /* @__PURE__ */ e("span", { className: "text-red-500 ml-1", children: "*" })
3049
+ A.label,
3050
+ A.required && /* @__PURE__ */ e("span", { className: "text-red-500 ml-1", children: "*" })
2971
3051
  ]
2972
3052
  }
2973
3053
  ) }),
2974
3054
  (() => {
2975
3055
  const te = {
2976
- value: I?.[T.name] || "",
3056
+ value: I?.[A.name] || "",
2977
3057
  disabled: D,
2978
- required: T.required,
2979
- placeholder: T.placeholder,
2980
- ...T.fieldProps
3058
+ required: A.required,
3059
+ placeholder: A.placeholder,
3060
+ ...A.fieldProps
2981
3061
  };
2982
- switch (T.type) {
3062
+ switch (A.type) {
2983
3063
  case "text":
2984
3064
  case "email":
2985
3065
  case "password":
@@ -2991,14 +3071,14 @@ const qr = ({
2991
3071
  {
2992
3072
  ...te,
2993
3073
  onChange: (U) => C(
2994
- F,
2995
- T.name,
3074
+ O,
3075
+ A.name,
2996
3076
  U.target.value
2997
3077
  ),
2998
- type: T.textType || T.type,
2999
- autoComplete: T.autocomplete,
3078
+ type: A.textType || A.type,
3079
+ autoComplete: A.autocomplete,
3000
3080
  error: X,
3001
- size: s
3081
+ size: n
3002
3082
  }
3003
3083
  );
3004
3084
  case "textarea":
@@ -3007,13 +3087,13 @@ const qr = ({
3007
3087
  {
3008
3088
  ...te,
3009
3089
  onChange: (U) => C(
3010
- F,
3011
- T.name,
3090
+ O,
3091
+ A.name,
3012
3092
  U.target.value
3013
3093
  ),
3014
3094
  rows: 4,
3015
3095
  error: X,
3016
- size: s
3096
+ size: n
3017
3097
  }
3018
3098
  );
3019
3099
  case "select":
@@ -3022,21 +3102,21 @@ const qr = ({
3022
3102
  {
3023
3103
  ...te,
3024
3104
  onChange: (U) => C(
3025
- F,
3026
- T.name,
3105
+ O,
3106
+ A.name,
3027
3107
  U
3028
3108
  ),
3029
- options: (T.options || []).map(
3109
+ options: (A.options || []).map(
3030
3110
  (U) => ({
3031
3111
  ...U,
3032
3112
  value: String(U.value)
3033
3113
  })
3034
3114
  ),
3035
- searchable: T.searchable,
3036
- multiple: T.multiple,
3037
- allowCreate: T.allowCreate,
3115
+ searchable: A.searchable,
3116
+ multiple: A.multiple,
3117
+ allowCreate: A.allowCreate,
3038
3118
  error: X,
3039
- size: s
3119
+ size: n
3040
3120
  }
3041
3121
  );
3042
3122
  case "checkbox":
@@ -3044,17 +3124,17 @@ const qr = ({
3044
3124
  be,
3045
3125
  {
3046
3126
  ...te,
3047
- checked: !!I?.[T.name],
3127
+ checked: !!I?.[A.name],
3048
3128
  onChange: (U) => C(
3049
- F,
3050
- T.name,
3129
+ O,
3130
+ A.name,
3051
3131
  U.target.checked
3052
3132
  ),
3053
- size: s
3133
+ size: n
3054
3134
  }
3055
3135
  );
3056
3136
  case "radio":
3057
- return /* @__PURE__ */ e("div", { className: "space-y-1", children: T.options?.map((U) => /* @__PURE__ */ c(
3137
+ return /* @__PURE__ */ e("div", { className: "space-y-1", children: A.options?.map((U) => /* @__PURE__ */ c(
3058
3138
  "label",
3059
3139
  {
3060
3140
  className: "flex items-center gap-2",
@@ -3063,12 +3143,12 @@ const qr = ({
3063
3143
  "input",
3064
3144
  {
3065
3145
  type: "radio",
3066
- name: `${u.name}.${F}.${T.name}`,
3146
+ name: `${u.name}.${O}.${A.name}`,
3067
3147
  value: U.value,
3068
- checked: I?.[T.name] === U.value,
3148
+ checked: I?.[A.name] === U.value,
3069
3149
  onChange: () => C(
3070
- F,
3071
- T.name,
3150
+ O,
3151
+ A.name,
3072
3152
  U.value
3073
3153
  ),
3074
3154
  disabled: D || U.disabled,
@@ -3081,27 +3161,27 @@ const qr = ({
3081
3161
  U.value
3082
3162
  )) });
3083
3163
  case "date": {
3084
- const U = I?.[T.name];
3164
+ const U = I?.[A.name];
3085
3165
  return /* @__PURE__ */ e(
3086
3166
  ye,
3087
3167
  {
3088
3168
  ...te,
3089
3169
  value: U ? new Date(U) : null,
3090
3170
  onChange: (le) => C(
3091
- F,
3092
- T.name,
3171
+ O,
3172
+ A.name,
3093
3173
  le
3094
3174
  ),
3095
- size: s
3175
+ size: n
3096
3176
  }
3097
3177
  );
3098
3178
  }
3099
3179
  case "custom":
3100
- return T.customComponent?.({
3101
- value: I?.[T.name],
3180
+ return A.customComponent?.({
3181
+ value: I?.[A.name],
3102
3182
  onChange: (U) => C(
3103
- F,
3104
- T.name,
3183
+ O,
3184
+ A.name,
3105
3185
  U
3106
3186
  ),
3107
3187
  error: X,
@@ -3112,7 +3192,7 @@ const qr = ({
3112
3192
  return /* @__PURE__ */ c("p", { children: [
3113
3193
  "Unsupported field type in array:",
3114
3194
  " ",
3115
- T.type
3195
+ A.type
3116
3196
  ] });
3117
3197
  }
3118
3198
  })(),
@@ -3127,20 +3207,20 @@ const qr = ({
3127
3207
  )
3128
3208
  ]
3129
3209
  },
3130
- T.name
3210
+ A.name
3131
3211
  );
3132
3212
  }) })
3133
3213
  ]
3134
3214
  },
3135
- F
3215
+ O
3136
3216
  )),
3137
3217
  /* @__PURE__ */ c(
3138
- Q,
3218
+ ee,
3139
3219
  {
3140
3220
  type: "button",
3141
3221
  variant: "outline",
3142
3222
  size: "sm",
3143
- onClick: ae,
3223
+ onClick: ne,
3144
3224
  disabled: D,
3145
3225
  children: [
3146
3226
  "Add ",
@@ -3154,14 +3234,14 @@ const qr = ({
3154
3234
  return null;
3155
3235
  }
3156
3236
  },
3157
- [S, K, k, d, s, E]
3158
- ), g = ne(
3237
+ [S, K, k, d, n, M]
3238
+ ), y = ae(
3159
3239
  (u) => {
3160
3240
  if (u.conditional && !u.conditional(S))
3161
3241
  return null;
3162
3242
  const $ = u.items.filter((D) => !(D.hidden || D.conditional && !D.conditional(S)));
3163
3243
  if ($.length === 0) return null;
3164
- const L = b(
3244
+ const L = x(
3165
3245
  "space-y-2",
3166
3246
  {
3167
3247
  "grid gap-2": u.layout === "grid",
@@ -3204,7 +3284,7 @@ const qr = ({
3204
3284
  /* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: L, children: $.map((D) => (K[D.name] && k[D.name], /* @__PURE__ */ c(
3205
3285
  "div",
3206
3286
  {
3207
- className: b(
3287
+ className: x(
3208
3288
  "space-y-1",
3209
3289
  D.width && typeof D.width == "string" && `w-[${D.width}]`,
3210
3290
  D.width && typeof D.width == "number" && `col-span-${D.width}`
@@ -3233,46 +3313,46 @@ const qr = ({
3233
3313
  );
3234
3314
  },
3235
3315
  [S, K, k, z]
3236
- ), A = b(
3316
+ ), T = x(
3237
3317
  "space-y-6",
3238
3318
  {
3239
- "max-w-md": s === "sm",
3240
- "max-w-2xl": s === "md",
3241
- "max-w-4xl": s === "lg",
3242
- "max-w-full": s === "full"
3319
+ "max-w-md": n === "sm",
3320
+ "max-w-2xl": n === "md",
3321
+ "max-w-4xl": n === "lg",
3322
+ "max-w-full": n === "full"
3243
3323
  },
3244
- h
3324
+ p
3245
3325
  );
3246
- return /* @__PURE__ */ c("form", { ref: N, onSubmit: G, className: A, children: [
3247
- /* @__PURE__ */ e("div", { className: "space-y-8", children: r.map(g) }),
3248
- v && /* @__PURE__ */ c("div", { className: b("flex gap-3 justify-end pt-8"), children: [
3326
+ return /* @__PURE__ */ c("form", { ref: N, onSubmit: J, className: T, children: [
3327
+ /* @__PURE__ */ e("div", { className: "space-y-8", children: r.map(y) }),
3328
+ b && /* @__PURE__ */ c("div", { className: x("flex gap-3 justify-end pt-8"), children: [
3249
3329
  a && /* @__PURE__ */ e(
3250
- Q,
3330
+ ee,
3251
3331
  {
3252
3332
  type: "button",
3253
- variant: x.variant,
3254
- size: x.size || s,
3255
- disabled: x.disabled || d,
3333
+ variant: f.variant,
3334
+ size: f.size || n,
3335
+ disabled: f.disabled || d,
3256
3336
  onClick: a,
3257
- className: x.className,
3258
- children: x.label
3337
+ className: f.className,
3338
+ children: f.label
3259
3339
  }
3260
3340
  ),
3261
3341
  /* @__PURE__ */ e(
3262
- Q,
3342
+ ee,
3263
3343
  {
3264
3344
  type: "submit",
3265
- variant: p.variant,
3266
- size: p.size || s,
3267
- disabled: p.disabled || d,
3345
+ variant: g.variant,
3346
+ size: g.size || n,
3347
+ disabled: g.disabled || d,
3268
3348
  loading: d,
3269
- className: p.className,
3270
- children: p.label
3349
+ className: g.className,
3350
+ children: g.label
3271
3351
  }
3272
3352
  )
3273
3353
  ] })
3274
3354
  ] });
3275
- }, vr = {
3355
+ }, Cr = {
3276
3356
  default: "bg-secondary-100 text-secondary-800 dark:bg-secondary-800 dark:text-secondary-200",
3277
3357
  primary: "bg-primary-100 text-primary-800 dark:bg-primary-900 dark:text-primary-200",
3278
3358
  secondary: "bg-secondary-100 text-secondary-800 dark:bg-secondary-800 dark:text-secondary-200",
@@ -3280,11 +3360,11 @@ const qr = ({
3280
3360
  warning: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",
3281
3361
  error: "bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",
3282
3362
  info: "bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200"
3283
- }, kr = {
3363
+ }, Sr = {
3284
3364
  sm: "px-2 py-0.5 text-xs",
3285
3365
  md: "px-2.5 py-1 text-sm",
3286
3366
  lg: "px-3 py-1.5 text-base"
3287
- }, Nr = {
3367
+ }, Lr = {
3288
3368
  default: "bg-secondary-400",
3289
3369
  primary: "bg-primary-500",
3290
3370
  secondary: "bg-secondary-400",
@@ -3293,42 +3373,42 @@ const qr = ({
3293
3373
  error: "bg-red-500",
3294
3374
  info: "bg-blue-500"
3295
3375
  };
3296
- function Hr({
3376
+ function Jr({
3297
3377
  variant: r = "default",
3298
3378
  size: l = "md",
3299
3379
  dot: t = !1,
3300
3380
  icon: a,
3301
3381
  dismissible: o = !1,
3302
3382
  onDismiss: i,
3303
- className: f,
3304
- children: p,
3305
- ...x
3383
+ className: h,
3384
+ children: g,
3385
+ ...f
3306
3386
  }) {
3307
3387
  return /* @__PURE__ */ c(
3308
3388
  "span",
3309
3389
  {
3310
- className: b(
3390
+ className: x(
3311
3391
  // Base styles
3312
3392
  "inline-flex items-center font-medium rounded-full",
3313
3393
  // Variant styles
3314
- vr[r],
3394
+ Cr[r],
3315
3395
  // Size styles
3316
- kr[l],
3317
- f
3396
+ Sr[l],
3397
+ h
3318
3398
  ),
3319
- ...x,
3399
+ ...f,
3320
3400
  children: [
3321
3401
  t && /* @__PURE__ */ e(
3322
3402
  "span",
3323
3403
  {
3324
- className: b(
3404
+ className: x(
3325
3405
  "w-2 h-2 rounded-full mr-1.5",
3326
- Nr[r]
3406
+ Lr[r]
3327
3407
  )
3328
3408
  }
3329
3409
  ),
3330
- a && /* @__PURE__ */ e("span", { className: b("flex-shrink-0", p && "mr-1"), children: a }),
3331
- p,
3410
+ a && /* @__PURE__ */ e("span", { className: x("flex-shrink-0", g && "mr-1"), children: a }),
3411
+ g,
3332
3412
  o && i && /* @__PURE__ */ e(
3333
3413
  "button",
3334
3414
  {
@@ -3349,25 +3429,25 @@ function Hr({
3349
3429
  }
3350
3430
  );
3351
3431
  }
3352
- const wr = {
3432
+ const Er = {
3353
3433
  xs: "h-3 w-3",
3354
3434
  sm: "h-4 w-4",
3355
3435
  md: "h-6 w-6",
3356
3436
  lg: "h-8 w-8",
3357
3437
  xl: "h-12 w-12"
3358
- }, Cr = {
3438
+ }, Mr = {
3359
3439
  primary: "text-primary",
3360
3440
  secondary: "text-secondary-600",
3361
3441
  white: "text-white",
3362
3442
  current: "text-current"
3363
- }, Sr = {
3443
+ }, $r = {
3364
3444
  xs: "text-xs",
3365
3445
  sm: "text-sm",
3366
3446
  md: "text-sm",
3367
3447
  lg: "text-base",
3368
3448
  xl: "text-lg"
3369
3449
  };
3370
- function Ur({
3450
+ function Yr({
3371
3451
  size: r = "md",
3372
3452
  variant: l = "primary",
3373
3453
  label: t = "Loading...",
@@ -3378,7 +3458,7 @@ function Ur({
3378
3458
  return /* @__PURE__ */ c(
3379
3459
  "div",
3380
3460
  {
3381
- className: b(
3461
+ className: x(
3382
3462
  "inline-flex items-center",
3383
3463
  a ? "flex-col space-y-2" : "",
3384
3464
  o
@@ -3388,10 +3468,10 @@ function Ur({
3388
3468
  /* @__PURE__ */ c(
3389
3469
  "svg",
3390
3470
  {
3391
- className: b(
3471
+ className: x(
3392
3472
  "animate-spin",
3393
- wr[r],
3394
- Cr[l]
3473
+ Er[r],
3474
+ Mr[l]
3395
3475
  ),
3396
3476
  fill: "none",
3397
3477
  viewBox: "0 0 24 24",
@@ -3423,9 +3503,9 @@ function Ur({
3423
3503
  a && /* @__PURE__ */ e(
3424
3504
  "span",
3425
3505
  {
3426
- className: b(
3506
+ className: x(
3427
3507
  "text-secondary-600 dark:text-secondary-400",
3428
- Sr[r]
3508
+ $r[r]
3429
3509
  ),
3430
3510
  children: t
3431
3511
  }
@@ -3435,31 +3515,31 @@ function Ur({
3435
3515
  }
3436
3516
  );
3437
3517
  }
3438
- const Kr = ({
3518
+ const Zr = ({
3439
3519
  src: r,
3440
3520
  alt: l,
3441
3521
  size: t = "md",
3442
3522
  aspectRatio: a = "auto",
3443
3523
  radius: o = "md",
3444
3524
  showLoading: i = !0,
3445
- showError: f = !0,
3446
- fallback: p,
3447
- loadingContent: x,
3448
- errorContent: v,
3525
+ showError: h = !0,
3526
+ fallback: g,
3527
+ loadingContent: f,
3528
+ errorContent: b,
3449
3529
  className: m,
3450
- onLoad: s,
3530
+ onLoad: n,
3451
3531
  onError: d,
3452
- ...h
3532
+ ...p
3453
3533
  }) => {
3454
- const [N, y] = O(!0), [S, B] = O(!1), [k, q] = O(r), K = (A) => {
3455
- y(!1), B(!1), s?.(A);
3456
- }, H = (A) => {
3457
- if (y(!1), B(!0), p && k !== p) {
3458
- q(p), B(!1), y(!0);
3534
+ const [N, v] = V(!0), [S, B] = V(!1), [k, q] = V(r), K = (T) => {
3535
+ v(!1), B(!1), n?.(T);
3536
+ }, H = (T) => {
3537
+ if (v(!1), B(!0), g && k !== g) {
3538
+ q(g), B(!1), v(!0);
3459
3539
  return;
3460
3540
  }
3461
- d?.(A);
3462
- }, _ = b(
3541
+ d?.(T);
3542
+ }, F = x(
3463
3543
  "relative overflow-hidden bg-neutral-100 dark:bg-neutral-800",
3464
3544
  // Size variants
3465
3545
  {
@@ -3487,16 +3567,16 @@ const Kr = ({
3487
3567
  "rounded-full": o === "full"
3488
3568
  },
3489
3569
  m
3490
- ), E = b(
3570
+ ), M = x(
3491
3571
  "w-full h-full object-cover transition-opacity duration-200",
3492
3572
  {
3493
3573
  "opacity-0": N || S,
3494
3574
  "opacity-100": !N && !S
3495
3575
  }
3496
- ), G = b(
3576
+ ), J = x(
3497
3577
  "absolute inset-0 flex items-center justify-center",
3498
3578
  "text-neutral-400 dark:text-neutral-500"
3499
- ), z = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-neutral-300 dark:bg-neutral-600 rounded" }) }), g = /* @__PURE__ */ c("div", { className: "text-center", children: [
3579
+ ), z = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-neutral-300 dark:bg-neutral-600 rounded" }) }), y = /* @__PURE__ */ c("div", { className: "text-center", children: [
3500
3580
  /* @__PURE__ */ e(
3501
3581
  "svg",
3502
3582
  {
@@ -3517,64 +3597,64 @@ const Kr = ({
3517
3597
  ),
3518
3598
  /* @__PURE__ */ e("span", { className: "text-xs", children: "Failed to load" })
3519
3599
  ] });
3520
- return /* @__PURE__ */ c("div", { className: _, children: [
3600
+ return /* @__PURE__ */ c("div", { className: F, children: [
3521
3601
  /* @__PURE__ */ e(
3522
3602
  "img",
3523
3603
  {
3524
- ...h,
3604
+ ...p,
3525
3605
  src: k,
3526
3606
  alt: l,
3527
- className: E,
3607
+ className: M,
3528
3608
  onLoad: K,
3529
3609
  onError: H
3530
3610
  }
3531
3611
  ),
3532
- N && i && /* @__PURE__ */ e("div", { className: G, children: x || z }),
3533
- S && f && /* @__PURE__ */ e("div", { className: G, children: v || g })
3612
+ N && i && /* @__PURE__ */ e("div", { className: J, children: f || z }),
3613
+ S && h && /* @__PURE__ */ e("div", { className: J, children: b || y })
3534
3614
  ] });
3535
- }, Gr = ({
3615
+ }, Xr = ({
3536
3616
  title: r,
3537
3617
  subtitle: l,
3538
3618
  actions: t = [],
3539
3619
  children: a,
3540
3620
  className: o,
3541
3621
  backLabel: i = "Back",
3542
- backClassName: f,
3543
- onBack: p,
3544
- editable: x = !1,
3545
- onTitleChange: v
3622
+ backClassName: h,
3623
+ onBack: g,
3624
+ editable: f = !1,
3625
+ onTitleChange: b
3546
3626
  }) => {
3547
- const [m, s] = O(!1), [d, h] = O(r), N = ee(null);
3548
- J(() => {
3549
- h(r);
3550
- }, [r]), J(() => {
3627
+ const [m, n] = V(!1), [d, p] = V(r), N = Q(null);
3628
+ G(() => {
3629
+ p(r);
3630
+ }, [r]), G(() => {
3551
3631
  m && N.current && (N.current.focus(), N.current.select());
3552
3632
  }, [m]);
3553
- const y = () => {
3554
- x && s(!0);
3633
+ const v = () => {
3634
+ f && n(!0);
3555
3635
  }, S = () => {
3556
- s(!1), d.trim() !== "" && d !== r && v ? v(d.trim()) : h(r);
3636
+ n(!1), d.trim() !== "" && d !== r && b ? b(d.trim()) : p(r);
3557
3637
  }, B = (k) => {
3558
- k.key === "Enter" ? N.current?.blur() : k.key === "Escape" && (h(r), s(!1));
3638
+ k.key === "Enter" ? N.current?.blur() : k.key === "Escape" && (p(r), n(!1));
3559
3639
  };
3560
3640
  return /* @__PURE__ */ c(
3561
3641
  "div",
3562
3642
  {
3563
- className: b(
3643
+ className: x(
3564
3644
  "p-5 pb-3 border-b border-gray-100 dark:border-gray-700",
3565
3645
  o
3566
3646
  ),
3567
3647
  children: [
3568
3648
  /* @__PURE__ */ c("div", { className: "flex flex-col sm:flex-row sm:items-start sm:justify-between items-center gap-4", children: [
3569
3649
  /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ c("div", { className: "flex items-center gap-2 text-neutral-900 dark:text-neutral-100", children: [
3570
- p && /* @__PURE__ */ e(
3650
+ g && /* @__PURE__ */ e(
3571
3651
  "button",
3572
3652
  {
3573
3653
  type: "button",
3574
- onClick: p,
3575
- className: b(
3654
+ onClick: g,
3655
+ className: x(
3576
3656
  "flex items-center text-sm dark:hover:text-neutral-300 cursor-pointer transition",
3577
- f
3657
+ h
3578
3658
  ),
3579
3659
  children: /* @__PURE__ */ e(Me, { size: 16, color: "currentColor" })
3580
3660
  }
@@ -3585,7 +3665,7 @@ const Kr = ({
3585
3665
  ref: N,
3586
3666
  type: "text",
3587
3667
  value: d,
3588
- onChange: (k) => h(k.target.value),
3668
+ onChange: (k) => p(k.target.value),
3589
3669
  onBlur: S,
3590
3670
  onKeyDown: B,
3591
3671
  className: "text-1xl font-semibold bg-transparent border-b-1 border-gray-200 dark:border-gray-700 rounded-lg outline-none focus:border-none px-1 -mx-1 min-w-0 flex-1"
@@ -3593,50 +3673,63 @@ const Kr = ({
3593
3673
  ) : /* @__PURE__ */ e(
3594
3674
  "h2",
3595
3675
  {
3596
- onClick: y,
3597
- className: b(
3676
+ onClick: v,
3677
+ className: x(
3598
3678
  "text-2xl font-semibold truncate",
3599
- x && "cursor-pointer hover:text-blue-600 dark:hover:text-blue-400 transition-colors"
3679
+ f && "cursor-pointer hover:text-blue-600 dark:hover:text-blue-400 transition-colors"
3600
3680
  ),
3601
- title: x ? "Klik om te bewerken" : void 0,
3681
+ title: f ? "Klik om te bewerken" : void 0,
3602
3682
  children: r
3603
3683
  }
3604
3684
  )
3605
3685
  ] }) }),
3606
- t.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap sm:flex-nowrap gap-2 sm:gap-3", children: t.map((k) => /* @__PURE__ */ c(
3607
- "button",
3608
- {
3609
- type: "button",
3610
- onClick: (q) => {
3611
- q.stopPropagation(), q.target.blur(), k.onClick();
3686
+ t.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap sm:flex-nowrap gap-2 sm:gap-3", children: t.map(
3687
+ (k) => k.splitOptions && k.splitOptions.length > 0 ? /* @__PURE__ */ e(
3688
+ Ue,
3689
+ {
3690
+ label: k.label,
3691
+ onClick: k.onClick,
3692
+ icon: k.icon,
3693
+ variant: k.variant === "primary" ? "primary" : "secondary",
3694
+ options: k.splitOptions,
3695
+ disabled: k.disabled
3612
3696
  },
3613
- disabled: k.disabled,
3614
- className: b("btn", {
3615
- o__primary: k.variant === "primary",
3616
- o__secondary: k.variant === "secondary" || k.variant === "outline",
3617
- o__ghost: k.variant === "ghost",
3618
- o__destructive: k.variant === "destructive"
3619
- }),
3620
- children: [
3621
- k.icon && /* @__PURE__ */ e("span", { className: "mr-2", children: k.icon }),
3622
- k.label
3623
- ]
3624
- },
3625
- k.id
3626
- )) })
3697
+ k.id
3698
+ ) : /* @__PURE__ */ c(
3699
+ "button",
3700
+ {
3701
+ type: "button",
3702
+ onClick: (q) => {
3703
+ q.stopPropagation(), q.target.blur(), k.onClick();
3704
+ },
3705
+ disabled: k.disabled,
3706
+ className: x("btn", {
3707
+ o__primary: k.variant === "primary",
3708
+ o__secondary: k.variant === "secondary" || k.variant === "outline",
3709
+ o__ghost: k.variant === "ghost",
3710
+ o__destructive: k.variant === "destructive"
3711
+ }),
3712
+ children: [
3713
+ k.icon && /* @__PURE__ */ e("span", { className: "mr-2", children: k.icon }),
3714
+ k.label
3715
+ ]
3716
+ },
3717
+ k.id
3718
+ )
3719
+ ) })
3627
3720
  ] }),
3628
3721
  a && /* @__PURE__ */ e("div", { className: "mt-4", children: a })
3629
3722
  ]
3630
3723
  }
3631
3724
  );
3632
3725
  };
3633
- function Lr(r, l) {
3726
+ function zr(r, l) {
3634
3727
  return l.split(".").reduce(
3635
3728
  (t, a) => t && typeof t == "object" && a in t ? t[a] : void 0,
3636
3729
  r
3637
3730
  );
3638
3731
  }
3639
- const Jr = ({
3732
+ const Qr = ({
3640
3733
  groups: r,
3641
3734
  data: l,
3642
3735
  size: t = "md",
@@ -3653,16 +3746,16 @@ const Jr = ({
3653
3746
  } catch {
3654
3747
  return String(m);
3655
3748
  }
3656
- }, i = (m) => m ? "Ja" : "Nee", f = (m, s) => {
3657
- if (!s) return String(m || "-");
3658
- const d = s.find((h) => h.value === m);
3749
+ }, i = (m) => m ? "Ja" : "Nee", h = (m, n) => {
3750
+ if (!n) return String(m || "-");
3751
+ const d = n.find((p) => p.value === m);
3659
3752
  return d ? d.label : String(m || "-");
3660
- }, p = ne(
3753
+ }, g = ae(
3661
3754
  (m) => {
3662
- const s = Lr(l, m.name);
3755
+ const n = zr(l, m.name);
3663
3756
  if (m.type === "array") {
3664
- const h = s;
3665
- return !h || h.length === 0 ? /* @__PURE__ */ e(
3757
+ const p = n;
3758
+ return !p || p.length === 0 ? /* @__PURE__ */ e(
3666
3759
  Z,
3667
3760
  {
3668
3761
  variant: "body",
@@ -3670,7 +3763,7 @@ const Jr = ({
3670
3763
  className: "text-neutral-500 dark:text-neutral-400",
3671
3764
  children: "Geen items"
3672
3765
  }
3673
- ) : /* @__PURE__ */ e("div", { className: "space-y-3", children: h.map((N, y) => /* @__PURE__ */ c(
3766
+ ) : /* @__PURE__ */ e("div", { className: "space-y-3", children: p.map((N, v) => /* @__PURE__ */ c(
3674
3767
  "div",
3675
3768
  {
3676
3769
  className: "p-4 border border-neutral-200 dark:border-neutral-700 rounded-lg space-y-3",
@@ -3685,7 +3778,7 @@ const Jr = ({
3685
3778
  children: [
3686
3779
  m.label,
3687
3780
  " ",
3688
- y + 1
3781
+ v + 1
3689
3782
  ]
3690
3783
  }
3691
3784
  ) }),
@@ -3703,7 +3796,7 @@ const Jr = ({
3703
3796
  break;
3704
3797
  case "select":
3705
3798
  case "radio":
3706
- k = f(
3799
+ k = h(
3707
3800
  B,
3708
3801
  S.options
3709
3802
  );
@@ -3745,20 +3838,20 @@ const Jr = ({
3745
3838
  }) })
3746
3839
  ]
3747
3840
  },
3748
- y
3841
+ v
3749
3842
  )) });
3750
3843
  }
3751
3844
  if (m.type === "custom" && m.customComponent)
3752
- return m.customComponent({ value: s });
3845
+ return m.customComponent({ value: n });
3753
3846
  if (m.format) {
3754
- const h = m.format(s, l);
3847
+ const p = m.format(n, l);
3755
3848
  return /* @__PURE__ */ e(
3756
3849
  Z,
3757
3850
  {
3758
3851
  variant: "body",
3759
3852
  size: "sm",
3760
3853
  className: "text-neutral-900 dark:text-neutral-100",
3761
- children: h
3854
+ children: p
3762
3855
  }
3763
3856
  );
3764
3857
  }
@@ -3770,23 +3863,23 @@ const Jr = ({
3770
3863
  case "number":
3771
3864
  case "tel":
3772
3865
  case "url":
3773
- d = s ? String(s) : "-";
3866
+ d = n ? String(n) : "-";
3774
3867
  break;
3775
3868
  case "textarea":
3776
- d = s ? /* @__PURE__ */ e("div", { className: "whitespace-pre-wrap", children: String(s || "-") }) : "-";
3869
+ d = n ? /* @__PURE__ */ e("div", { className: "whitespace-pre-wrap", children: String(n || "-") }) : "-";
3777
3870
  break;
3778
3871
  case "select":
3779
3872
  case "radio":
3780
- d = f(s, m.options);
3873
+ d = h(n, m.options);
3781
3874
  break;
3782
3875
  case "checkbox":
3783
- d = i(s);
3876
+ d = i(n);
3784
3877
  break;
3785
3878
  case "date":
3786
- d = o(s);
3879
+ d = o(n);
3787
3880
  break;
3788
3881
  default:
3789
- d = s ? String(s) : "-";
3882
+ d = n ? String(n) : "-";
3790
3883
  }
3791
3884
  return /* @__PURE__ */ e(
3792
3885
  Z,
@@ -3799,13 +3892,13 @@ const Jr = ({
3799
3892
  );
3800
3893
  },
3801
3894
  [l]
3802
- ), x = ne(
3895
+ ), f = ae(
3803
3896
  (m) => {
3804
3897
  if (m.conditional && !m.conditional(l))
3805
3898
  return null;
3806
- const s = m.items.filter((h) => !(h.hidden || h.conditional && !h.conditional(l)));
3807
- if (s.length === 0) return null;
3808
- const d = b(
3899
+ const n = m.items.filter((p) => !(p.hidden || p.conditional && !p.conditional(l)));
3900
+ if (n.length === 0) return null;
3901
+ const d = x(
3809
3902
  "space-y-4",
3810
3903
  {
3811
3904
  "grid gap-4": m.layout === "grid",
@@ -3845,36 +3938,36 @@ const Jr = ({
3845
3938
  }
3846
3939
  )
3847
3940
  ] }),
3848
- /* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: d, children: s.map((h) => /* @__PURE__ */ c(
3941
+ /* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: d, children: n.map((p) => /* @__PURE__ */ c(
3849
3942
  "div",
3850
3943
  {
3851
- className: b(
3944
+ className: x(
3852
3945
  "space-y-1",
3853
- h.width && typeof h.width == "string" && `w-[${h.width}]`,
3854
- h.width && typeof h.width == "number" && `col-span-${h.width}`
3946
+ p.width && typeof p.width == "string" && `w-[${p.width}]`,
3947
+ p.width && typeof p.width == "number" && `col-span-${p.width}`
3855
3948
  ),
3856
3949
  children: [
3857
- h.type !== "custom" && /* @__PURE__ */ e(
3950
+ p.type !== "custom" && /* @__PURE__ */ e(
3858
3951
  Z,
3859
3952
  {
3860
3953
  variant: "label",
3861
3954
  size: "sm",
3862
3955
  className: "font-medium text-neutral-700 dark:text-neutral-300",
3863
- children: h.label
3956
+ children: p.label
3864
3957
  }
3865
3958
  ),
3866
- p(h)
3959
+ g(p)
3867
3960
  ]
3868
3961
  },
3869
- h.name
3962
+ p.name
3870
3963
  )) }) })
3871
3964
  ]
3872
3965
  },
3873
3966
  m.id
3874
3967
  );
3875
3968
  },
3876
- [l, p]
3877
- ), v = b(
3969
+ [l, g]
3970
+ ), b = x(
3878
3971
  "space-y-6",
3879
3972
  {
3880
3973
  "max-w-md": t === "sm",
@@ -3884,25 +3977,25 @@ const Jr = ({
3884
3977
  },
3885
3978
  a
3886
3979
  );
3887
- return /* @__PURE__ */ e("div", { className: v, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: r.map(x) }) });
3888
- }, $e = ({ item: r, isSelectedHandler: l, onClick: t }) => {
3889
- const [a, o] = O(!1), i = r.children && r.children.length > 0, f = () => {
3980
+ return /* @__PURE__ */ e("div", { className: b, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: r.map(f) }) });
3981
+ }, ze = ({ item: r, isSelectedHandler: l, onClick: t }) => {
3982
+ const [a, o] = V(!1), i = r.children && r.children.length > 0, h = () => {
3890
3983
  i && o(!a);
3891
- }, p = l ? l(r.path) : !1;
3984
+ }, g = l ? l(r.path) : !1;
3892
3985
  return /* @__PURE__ */ c("li", { children: [
3893
3986
  /* @__PURE__ */ c(
3894
3987
  "div",
3895
3988
  {
3896
- className: b(
3989
+ className: x(
3897
3990
  "flex flex-row w-full py-1 rounded-lg items-center h-8 transition-colors cursor-pointer px-3 pr-1 no-underline text-sm",
3898
3991
  {
3899
- "active-nav-item": p && !i,
3900
- "shadow-lvl-0": p && !i,
3901
- "font-semibold": p || i || r.children !== void 0
3992
+ "active-nav-item": g && !i,
3993
+ "shadow-lvl-0": g && !i,
3994
+ "font-semibold": g || i || r.children !== void 0
3902
3995
  }
3903
3996
  ),
3904
3997
  onClick: () => {
3905
- i ? f() : r.path && t?.(r.path);
3998
+ i ? h() : r.path && t?.(r.path);
3906
3999
  },
3907
4000
  children: [
3908
4001
  r.icon && /* @__PURE__ */ e("span", { className: "mr-2", children: r.icon }),
@@ -3912,17 +4005,17 @@ const Jr = ({
3912
4005
  ]
3913
4006
  }
3914
4007
  ),
3915
- i && !a && /* @__PURE__ */ e("ul", { className: "sidebar-menu-nested-items mb-1", children: r.children?.map((x, v) => /* @__PURE__ */ e(
3916
- $e,
4008
+ i && !a && /* @__PURE__ */ e("ul", { className: "sidebar-menu-nested-items mb-1", children: r.children?.map((f, b) => /* @__PURE__ */ e(
4009
+ ze,
3917
4010
  {
3918
- item: x,
4011
+ item: f,
3919
4012
  isSelectedHandler: l,
3920
4013
  onClick: t
3921
4014
  },
3922
- v
4015
+ b
3923
4016
  )) })
3924
4017
  ] });
3925
- }, Yr = ({
4018
+ }, et = ({
3926
4019
  title: r,
3927
4020
  actionIcons: l,
3928
4021
  items: t,
@@ -3932,43 +4025,43 @@ const Jr = ({
3932
4025
  }) => /* @__PURE__ */ c("div", { className: "flex flex-col h-screen mb-6", children: [
3933
4026
  /* @__PURE__ */ c("div", { className: "sidebar-menu-header", children: [
3934
4027
  /* @__PURE__ */ e("span", { className: "text-xl font-semibold text-gray-800 mb-2", children: r }),
3935
- /* @__PURE__ */ e("div", { className: "sidebar-menu-actions", children: l?.map((f, p) => /* @__PURE__ */ e("span", { className: "sidebar-menu-action-icon", children: f }, p)) })
4028
+ /* @__PURE__ */ e("div", { className: "sidebar-menu-actions", children: l?.map((h, g) => /* @__PURE__ */ e("span", { className: "sidebar-menu-action-icon", children: h }, g)) })
3936
4029
  ] }),
3937
4030
  i && /* @__PURE__ */ e("div", { className: "sidebar-menu-pre-items mb-4", children: i }),
3938
4031
  /* @__PURE__ */ e("ul", { children: t.map(
3939
- (f, p) => !f.path && !f.label && !f.children ? /* @__PURE__ */ e("span", { className: "flex w-full h-4" }, p) : /* @__PURE__ */ e(
3940
- $e,
4032
+ (h, g) => !h.path && !h.label && !h.children ? /* @__PURE__ */ e("span", { className: "flex w-full h-4" }, g) : /* @__PURE__ */ e(
4033
+ ze,
3941
4034
  {
3942
- item: f,
4035
+ item: h,
3943
4036
  isSelectedHandler: a,
3944
4037
  onClick: o
3945
4038
  },
3946
- p
4039
+ g
3947
4040
  )
3948
4041
  ) })
3949
- ] }), Zr = ({
4042
+ ] }), rt = ({
3950
4043
  level: r = 1,
3951
4044
  size: l,
3952
4045
  weight: t = "bold",
3953
4046
  color: a = "current",
3954
4047
  align: o = "left",
3955
4048
  truncate: i = !1,
3956
- className: f,
3957
- children: p,
3958
- ...x
4049
+ className: h,
4050
+ children: g,
4051
+ ...f
3959
4052
  }) => {
3960
- const v = l || Mr(r), m = b(
4053
+ const b = l || Dr(r), m = x(
3961
4054
  "font-primary",
3962
4055
  // Size variants
3963
4056
  {
3964
- "text-xs": v === "xs",
3965
- "text-sm": v === "sm",
3966
- "text-base": v === "md",
3967
- "text-lg": v === "lg",
3968
- "text-xl": v === "xl",
3969
- "text-2xl": v === "2xl",
3970
- "text-3xl": v === "3xl",
3971
- "text-4xl": v === "4xl"
4057
+ "text-xs": b === "xs",
4058
+ "text-sm": b === "sm",
4059
+ "text-base": b === "md",
4060
+ "text-lg": b === "lg",
4061
+ "text-xl": b === "xl",
4062
+ "text-2xl": b === "2xl",
4063
+ "text-3xl": b === "3xl",
4064
+ "text-4xl": b === "4xl"
3972
4065
  },
3973
4066
  // Weight variants
3974
4067
  {
@@ -4000,11 +4093,11 @@ const Jr = ({
4000
4093
  {
4001
4094
  truncate: i
4002
4095
  },
4003
- f
4004
- ), s = `h${r}`;
4005
- return /* @__PURE__ */ e(s, { className: m, ...x, children: p });
4096
+ h
4097
+ ), n = `h${r}`;
4098
+ return /* @__PURE__ */ e(n, { className: m, ...f, children: g });
4006
4099
  };
4007
- function Mr(r) {
4100
+ function Dr(r) {
4008
4101
  return {
4009
4102
  1: "4xl",
4010
4103
  2: "3xl",
@@ -4014,16 +4107,16 @@ function Mr(r) {
4014
4107
  6: "md"
4015
4108
  }[r] || "md";
4016
4109
  }
4017
- const Xr = ({
4110
+ const tt = ({
4018
4111
  items: r,
4019
4112
  type: l = "unordered",
4020
4113
  variant: t = "default",
4021
4114
  size: a = "md",
4022
4115
  interactive: o = !1,
4023
4116
  className: i,
4024
- itemClassName: f
4117
+ itemClassName: h
4025
4118
  }) => {
4026
- const p = b(
4119
+ const g = x(
4027
4120
  // Base styles
4028
4121
  "space-y-1",
4029
4122
  // Variant styles
@@ -4044,7 +4137,7 @@ const Xr = ({
4044
4137
  "text-lg": a === "lg"
4045
4138
  },
4046
4139
  i
4047
- ), x = (s, d) => b(
4140
+ ), f = (n, d) => x(
4048
4141
  // Base item styles
4049
4142
  "transition-colors duration-200",
4050
4143
  // Size-based padding
@@ -4054,55 +4147,55 @@ const Xr = ({
4054
4147
  "py-3 px-4": a === "lg" && (t === "bordered" || t === "divided")
4055
4148
  },
4056
4149
  // Interactive styles
4057
- o && !s.disabled && {
4150
+ o && !n.disabled && {
4058
4151
  "cursor-pointer hover:bg-neutral-50 dark:hover:bg-neutral-800": !0,
4059
4152
  "focus:outline-none focus:bg-neutral-100 dark:focus:bg-neutral-700": !0
4060
4153
  },
4061
4154
  // Disabled styles
4062
- s.disabled && {
4155
+ n.disabled && {
4063
4156
  "opacity-50 cursor-not-allowed": !0
4064
4157
  },
4065
- f
4066
- ), v = (s) => {
4067
- o && !s.disabled && s.onClick && s.onClick();
4068
- }, m = (s, d) => {
4069
- o && !d.disabled && (s.key === "Enter" || s.key === " ") && (s.preventDefault(), d.onClick?.());
4158
+ h
4159
+ ), b = (n) => {
4160
+ o && !n.disabled && n.onClick && n.onClick();
4161
+ }, m = (n, d) => {
4162
+ o && !d.disabled && (n.key === "Enter" || n.key === " ") && (n.preventDefault(), d.onClick?.());
4070
4163
  };
4071
- return l === "ordered" ? /* @__PURE__ */ e("ol", { className: p, children: r.map((s, d) => /* @__PURE__ */ e(
4164
+ return l === "ordered" ? /* @__PURE__ */ e("ol", { className: g, children: r.map((n, d) => /* @__PURE__ */ e(
4072
4165
  "li",
4073
4166
  {
4074
- className: x(s),
4075
- onClick: () => v(s),
4076
- onKeyDown: (h) => m(h, s),
4077
- tabIndex: o && !s.disabled ? 0 : void 0,
4167
+ className: f(n),
4168
+ onClick: () => b(n),
4169
+ onKeyDown: (p) => m(p, n),
4170
+ tabIndex: o && !n.disabled ? 0 : void 0,
4078
4171
  role: o ? "button" : void 0,
4079
- children: s.content
4172
+ children: n.content
4080
4173
  },
4081
- s.id || d
4082
- )) }) : l === "description" ? /* @__PURE__ */ e("dl", { className: p, children: r.map((s, d) => /* @__PURE__ */ e(
4174
+ n.id || d
4175
+ )) }) : l === "description" ? /* @__PURE__ */ e("dl", { className: g, children: r.map((n, d) => /* @__PURE__ */ e(
4083
4176
  "div",
4084
4177
  {
4085
- className: x(s),
4086
- onClick: () => v(s),
4087
- onKeyDown: (h) => m(h, s),
4088
- tabIndex: o && !s.disabled ? 0 : void 0,
4178
+ className: f(n),
4179
+ onClick: () => b(n),
4180
+ onKeyDown: (p) => m(p, n),
4181
+ tabIndex: o && !n.disabled ? 0 : void 0,
4089
4182
  role: o ? "button" : void 0,
4090
- children: s.content
4183
+ children: n.content
4091
4184
  },
4092
- s.id || d
4093
- )) }) : /* @__PURE__ */ e("ul", { className: p, children: r.map((s, d) => /* @__PURE__ */ e(
4185
+ n.id || d
4186
+ )) }) : /* @__PURE__ */ e("ul", { className: g, children: r.map((n, d) => /* @__PURE__ */ e(
4094
4187
  "li",
4095
4188
  {
4096
- className: x(s),
4097
- onClick: () => v(s),
4098
- onKeyDown: (h) => m(h, s),
4099
- tabIndex: o && !s.disabled ? 0 : void 0,
4189
+ className: f(n),
4190
+ onClick: () => b(n),
4191
+ onKeyDown: (p) => m(p, n),
4192
+ tabIndex: o && !n.disabled ? 0 : void 0,
4100
4193
  role: o ? "button" : void 0,
4101
- children: s.content
4194
+ children: n.content
4102
4195
  },
4103
- s.id || d
4196
+ n.id || d
4104
4197
  )) });
4105
- }, Qr = ({
4198
+ }, at = ({
4106
4199
  commands: r,
4107
4200
  isOpen: l,
4108
4201
  onClose: t,
@@ -4110,36 +4203,36 @@ const Xr = ({
4110
4203
  initialCommandPath: o,
4111
4204
  initialActiveIndex: i
4112
4205
  }) => {
4113
- const [f, p] = O(""), [x, v] = O(o || []), [m, s] = O(i || 0), d = ee(null), N = (x.length ? r.find((y) => y.id === x[0])?.subCommands || [] : r).filter(
4114
- (y) => y.label.toLowerCase().includes(f.toLowerCase())
4206
+ const [h, g] = V(""), [f, b] = V(o || []), [m, n] = V(i || 0), d = Q(null), N = (f.length ? r.find((v) => v.id === f[0])?.subCommands || [] : r).filter(
4207
+ (v) => v.label.toLowerCase().includes(h.toLowerCase())
4115
4208
  );
4116
- return J(() => {
4117
- l || (p(""), v(o || []), s(i || 0));
4118
- }, [l]), J(() => {
4119
- const y = (S) => {
4209
+ return G(() => {
4210
+ l || (g(""), b(o || []), n(i || 0));
4211
+ }, [l]), G(() => {
4212
+ const v = (S) => {
4120
4213
  if (l) {
4121
4214
  if (S.key === "Escape")
4122
4215
  t();
4123
4216
  else if (S.key === "ArrowUp")
4124
- s(
4217
+ n(
4125
4218
  (B) => B > 0 ? B - 1 : N.length - 1
4126
4219
  );
4127
4220
  else if (S.key === "ArrowDown")
4128
- s(
4221
+ n(
4129
4222
  (B) => B < N.length - 1 ? B + 1 : 0
4130
4223
  );
4131
4224
  else if (S.key === "Enter") {
4132
4225
  const B = N[m];
4133
- B && (B.subCommands ? (v([...x, B.id]), s(0)) : B.action && (B.action(), t()));
4226
+ B && (B.subCommands ? (b([...f, B.id]), n(0)) : B.action && (B.action(), t()));
4134
4227
  }
4135
4228
  }
4136
4229
  };
4137
- return document.addEventListener("keydown", y), () => document.removeEventListener("keydown", y);
4138
- }, [l, t, N, m, x]), J(() => {
4139
- const y = (S) => {
4230
+ return document.addEventListener("keydown", v), () => document.removeEventListener("keydown", v);
4231
+ }, [l, t, N, m, f]), G(() => {
4232
+ const v = (S) => {
4140
4233
  d.current && !d.current.contains(S.target) && t();
4141
4234
  };
4142
- return l && document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y);
4235
+ return l && document.addEventListener("mousedown", v), () => document.removeEventListener("mousedown", v);
4143
4236
  }, [l, t]), l ? /* @__PURE__ */ e("div", { className: "fixed inset-0 z-50 flex items-center justify-center shadow-lvl-0", children: /* @__PURE__ */ c(
4144
4237
  "div",
4145
4238
  {
@@ -4151,28 +4244,28 @@ const Xr = ({
4151
4244
  {
4152
4245
  type: "text",
4153
4246
  placeholder: a?.searchPlaceholder || "Search commands...",
4154
- value: f,
4155
- onChange: (y) => p(y.target.value),
4247
+ value: h,
4248
+ onChange: (v) => g(v.target.value),
4156
4249
  className: "w-full px-4 py-2 text-gray-800 border-none border-b border-gray-200 focus:outline-none focus:ring-0 rounded-lg bg-transparent"
4157
4250
  }
4158
4251
  ),
4159
4252
  /* @__PURE__ */ c("div", { className: "mt-2 pt-2 text-sm border-t border-gray-200", children: [
4160
4253
  N.length === 0 && /* @__PURE__ */ e("div", { className: "text-gray-500 text-center text-sm", children: a?.noCommandsFound || "No commands found" }),
4161
- N.map((y, S) => /* @__PURE__ */ c(
4254
+ N.map((v, S) => /* @__PURE__ */ c(
4162
4255
  "div",
4163
4256
  {
4164
4257
  className: `flex items-center p-2 cursor-pointer rounded-md text-secondary-800 ${S === m ? "bg-gray-100" : ""}`,
4165
4258
  onClick: () => {
4166
- y.subCommands ? (v([...x, y.id]), s(0)) : y.action && (y.action(), t());
4259
+ v.subCommands ? (b([...f, v.id]), n(0)) : v.action && (v.action(), t());
4167
4260
  },
4168
- onMouseEnter: () => s(S),
4261
+ onMouseEnter: () => n(S),
4169
4262
  children: [
4170
- y.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: y.icon }),
4171
- /* @__PURE__ */ e("span", { className: "flex-grow", children: y.label }),
4172
- y.subCommands && /* @__PURE__ */ e("span", { className: "text-gray-400", children: /* @__PURE__ */ e(Fe, { className: "w-4 h-4" }) })
4263
+ v.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: v.icon }),
4264
+ /* @__PURE__ */ e("span", { className: "flex-grow", children: v.label }),
4265
+ v.subCommands && /* @__PURE__ */ e("span", { className: "text-gray-400", children: /* @__PURE__ */ e(Fe, { className: "w-4 h-4" }) })
4173
4266
  ]
4174
4267
  },
4175
- y.id
4268
+ v.id
4176
4269
  ))
4177
4270
  ] }),
4178
4271
  /* @__PURE__ */ c("div", { className: "flex items-center justify-between pt-2 mt-2 text-xs text-gray-500 border-t border-gray-200", children: [
@@ -4195,7 +4288,7 @@ const Xr = ({
4195
4288
  ]
4196
4289
  }
4197
4290
  ) }) : null;
4198
- }, Er = {
4291
+ }, Tr = {
4199
4292
  none: "p-0",
4200
4293
  xs: "p-1",
4201
4294
  sm: "p-2",
@@ -4203,7 +4296,7 @@ const Xr = ({
4203
4296
  lg: "p-6",
4204
4297
  xl: "p-8",
4205
4298
  "2xl": "p-12"
4206
- }, $r = {
4299
+ }, Ar = {
4207
4300
  none: "m-0",
4208
4301
  xs: "m-1",
4209
4302
  sm: "m-2",
@@ -4211,7 +4304,7 @@ const Xr = ({
4211
4304
  lg: "m-6",
4212
4305
  xl: "m-8",
4213
4306
  "2xl": "m-12"
4214
- }, zr = {
4307
+ }, Ir = {
4215
4308
  none: "",
4216
4309
  primary: "bg-primary",
4217
4310
  secondary: "bg-secondary",
@@ -4223,26 +4316,26 @@ const Xr = ({
4223
4316
  neutral: "bg-neutral",
4224
4317
  white: "bg-white",
4225
4318
  module: "bg-module"
4226
- }, Dr = {
4319
+ }, jr = {
4227
4320
  none: "rounded-none",
4228
4321
  sm: "rounded-sm",
4229
4322
  md: "rounded-md",
4230
4323
  lg: "rounded-lg",
4231
4324
  xl: "rounded-xl",
4232
4325
  full: "rounded-full"
4233
- }, Ar = {
4326
+ }, Br = {
4234
4327
  none: "shadow-none",
4235
4328
  sm: "shadow-sm shadow-lvl-0",
4236
4329
  md: "shadow-md shadow-lvl-0",
4237
4330
  lg: "shadow-lg shadow-lvl-0",
4238
4331
  xl: "shadow-xl shadow-lvl-0",
4239
4332
  "2xl": "shadow-2xl shadow-lvl-0"
4240
- }, Tr = {
4333
+ }, Pr = {
4241
4334
  none: "border-0",
4242
4335
  sm: "border",
4243
4336
  md: "border-2",
4244
4337
  lg: "border-4"
4245
- }, Ir = {
4338
+ }, _r = {
4246
4339
  primary: "border-primary",
4247
4340
  secondary: "border-secondary",
4248
4341
  accent: "border-accent",
@@ -4252,7 +4345,7 @@ const Xr = ({
4252
4345
  info: "border-info",
4253
4346
  neutral: "border-neutral",
4254
4347
  white: "border-white"
4255
- }, ze = ce(
4348
+ }, De = ce(
4256
4349
  ({
4257
4350
  padding: r,
4258
4351
  margin: l,
@@ -4260,35 +4353,35 @@ const Xr = ({
4260
4353
  radius: a,
4261
4354
  shadow: o,
4262
4355
  border: i,
4263
- borderColor: f,
4264
- className: p,
4265
- children: x,
4266
- ...v
4356
+ borderColor: h,
4357
+ className: g,
4358
+ children: f,
4359
+ ...b
4267
4360
  }, m) => /* @__PURE__ */ e(
4268
4361
  "div",
4269
4362
  {
4270
4363
  ref: m,
4271
- className: b(
4272
- r && Er[r],
4273
- l && $r[l],
4274
- t && zr[t],
4275
- a && Dr[a],
4276
- o && Ar[o],
4277
- i && Tr[i],
4278
- f && Ir[f],
4279
- p
4364
+ className: x(
4365
+ r && Tr[r],
4366
+ l && Ar[l],
4367
+ t && Ir[t],
4368
+ a && jr[a],
4369
+ o && Br[o],
4370
+ i && Pr[i],
4371
+ h && _r[h],
4372
+ g
4280
4373
  ),
4281
- ...v,
4282
- children: x
4374
+ ...b,
4375
+ children: f
4283
4376
  }
4284
4377
  )
4285
4378
  );
4286
- ze.displayName = "Box";
4287
- const et = ({ children: r, title: l, ...t }) => /* @__PURE__ */ c(ze, { background: "module", radius: "xl", shadow: "sm", ...t, children: [
4379
+ De.displayName = "Box";
4380
+ const nt = ({ children: r, title: l, ...t }) => /* @__PURE__ */ c(De, { background: "module", radius: "xl", shadow: "sm", ...t, children: [
4288
4381
  l && /* @__PURE__ */ e("span", { className: "text-base font-medium text-gray-800 mb-2", children: l }),
4289
4382
  r
4290
4383
  ] });
4291
- function rt({
4384
+ function lt({
4292
4385
  identifier: r,
4293
4386
  resourceLoader: l,
4294
4387
  framework: t = "react",
@@ -4296,47 +4389,47 @@ function rt({
4296
4389
  componentProps: o,
4297
4390
  className: i
4298
4391
  }) {
4299
- const f = ee(null), [p, x] = O(!0), [v, m] = O(null), s = ee(null);
4300
- return ee(null), J(() => {
4392
+ const h = Q(null), [g, f] = V(!0), [b, m] = V(null), n = Q(null);
4393
+ return Q(null), G(() => {
4301
4394
  let d = !0;
4302
4395
  return (async () => {
4303
- x(!0);
4396
+ f(!0);
4304
4397
  try {
4305
4398
  const N = await l();
4306
4399
  if (!d) return;
4307
- const y = N.component || N.default || N;
4308
- m(t === "react" ? () => y : () => N);
4400
+ const v = N.component || N.default || N;
4401
+ m(t === "react" ? () => v : () => N);
4309
4402
  } catch (N) {
4310
4403
  console.error(`[FederatedResource] Load failed: ${r}`, N);
4311
4404
  } finally {
4312
- d && x(!1);
4405
+ d && f(!1);
4313
4406
  }
4314
4407
  })(), () => {
4315
4408
  d = !1;
4316
4409
  };
4317
- }, [r, l]), J(() => {
4318
- if (p || !v || t === "react") return;
4319
- const d = f.current;
4410
+ }, [r, l]), G(() => {
4411
+ if (g || !b || t === "react") return;
4412
+ const d = h.current;
4320
4413
  if (d) {
4321
4414
  if (t === "svelte") {
4322
- const h = v.default || v, N = new h({ target: d, props: o || {} });
4323
- return s.current = N, () => N.$destroy();
4415
+ const p = b.default || b, N = new p({ target: d, props: o || {} });
4416
+ return n.current = N, () => N.$destroy();
4324
4417
  }
4325
- if (v.mount) {
4326
- const h = v.mount({ container: d, props: o || {} });
4418
+ if (b.mount) {
4419
+ const p = b.mount({ container: d, props: o || {} });
4327
4420
  return () => {
4328
- typeof h == "function" ? h() : v.unmount?.(d);
4421
+ typeof p == "function" ? p() : b.unmount?.(d);
4329
4422
  };
4330
4423
  }
4331
4424
  }
4332
- }, [v, t, p]), J(() => {
4333
- t === "svelte" && s.current && s.current.$set?.(o);
4334
- }, [o, t]), /* @__PURE__ */ c("div", { ref: f, className: i, style: { display: "contents" }, children: [
4335
- p && a,
4336
- t === "react" && v && /* @__PURE__ */ e(v, { ...o })
4425
+ }, [b, t, g]), G(() => {
4426
+ t === "svelte" && n.current && n.current.$set?.(o);
4427
+ }, [o, t]), /* @__PURE__ */ c("div", { ref: h, className: i, style: { display: "contents" }, children: [
4428
+ g && a,
4429
+ t === "react" && b && /* @__PURE__ */ e(b, { ...o })
4337
4430
  ] });
4338
4431
  }
4339
- class tt extends Te {
4432
+ class st extends Ie {
4340
4433
  constructor() {
4341
4434
  super(...arguments), this.state = {
4342
4435
  hasError: !1,
@@ -4365,40 +4458,41 @@ class tt extends Te {
4365
4458
  }
4366
4459
  }
4367
4460
  export {
4368
- Hr as Badge,
4369
- ze as Box,
4370
- Q as Button,
4371
- _r as ButtonGroup,
4372
- et as Card,
4461
+ Jr as Badge,
4462
+ De as Box,
4463
+ ee as Button,
4464
+ Hr as ButtonGroup,
4465
+ nt as Card,
4373
4466
  be as Checkbox,
4374
- Qr as CommandPalette,
4375
- tr as ContentLoading,
4467
+ at as CommandPalette,
4468
+ sr as ContentLoading,
4376
4469
  ye as DatePicker,
4377
- ar as Dropdown,
4378
- tt as ErrorBoundary,
4379
- rt as FederatedResource,
4380
- qr as Form,
4381
- Zr as Heading,
4470
+ or as Dropdown,
4471
+ st as ErrorBoundary,
4472
+ lt as FederatedResource,
4473
+ Gr as Form,
4474
+ rt as Heading,
4382
4475
  oe as Icon,
4383
- Kr as Image,
4384
- Wr as Link,
4385
- Xr as List,
4386
- xr as Modal,
4387
- Gr as PageHeader,
4388
- Ze as SearchableTextField,
4476
+ Zr as Image,
4477
+ Ur as Link,
4478
+ tt as List,
4479
+ yr as Modal,
4480
+ Xr as PageHeader,
4481
+ rr as SearchableTextField,
4389
4482
  ve as Select,
4390
- Yr as SidebarMenu,
4391
- Ur as Spinner,
4392
- gr as StorageInput,
4393
- Rr as TabBar,
4394
- Ce as Table,
4395
- hr as Tabs,
4483
+ et as SidebarMenu,
4484
+ Yr as Spinner,
4485
+ Ue as SplitButton,
4486
+ kr as StorageInput,
4487
+ Kr as TabBar,
4488
+ Se as Table,
4489
+ gr as Tabs,
4396
4490
  Z as Text,
4397
4491
  ke as TextArea,
4398
4492
  ue as TextField,
4399
- Jr as View,
4400
- b as cn,
4401
- Or as createSizes,
4402
- Fr as createVariants
4493
+ Qr as View,
4494
+ x as cn,
4495
+ qr as createSizes,
4496
+ Rr as createVariants
4403
4497
  };
4404
4498
  //# sourceMappingURL=index.js.map