@opencxh/ui-kit 3.134.0 → 3.136.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { clsx as We } from "clsx";
2
2
  import { jsxs as c, jsx as e, Fragment as xe } from "react/jsx-runtime";
3
3
  import { VideoOff as Ke, User as Ge, MicOff as Je, Mic as Ye, X as we, ChevronDown as ge, ExternalLink as Xe, Calendar as Ze, ChevronLeft as ke, ChevronRight as Ce, ChevronDownIcon as Qe, Loader2 as et, Search as Se, Check as Te, ChevronUp as tt, ChevronsLeft as rt, ChevronsRight as nt, FileText as Ee, HardDrive as _e, ArrowLeft as st, FolderPlus as at, Upload as lt, Folder as Ae, Trash2 as ot, Plus as ct, Sparkles as it, ImageOff as dt, Pencil as ut, ArrowUpRight as mt } from "lucide-react";
4
- import oe, { useRef as se, useEffect as Q, forwardRef as me, useState as B, useLayoutEffect as ft, useMemo as he, useCallback as ue, createContext as ht, Component as xt } from "react";
4
+ import oe, { useRef as se, useEffect as Q, forwardRef as me, useState as R, useLayoutEffect as ft, useMemo as he, useCallback as ue, createContext as ht, Component as xt } from "react";
5
5
  import bt from "dompurify";
6
6
  import pt from "react-markdown";
7
7
  import gt from "remark-gfm";
@@ -112,15 +112,15 @@ const vt = {
112
112
  iconOnly: l = !1,
113
113
  shape: u = "default",
114
114
  className: m,
115
- children: y,
116
- disabled: h,
117
- ...f
118
- }, x) => {
119
- const p = h || s;
115
+ children: N,
116
+ disabled: f,
117
+ ...h
118
+ }, b) => {
119
+ const p = f || s;
120
120
  return /* @__PURE__ */ c(
121
121
  "button",
122
122
  {
123
- ref: x,
123
+ ref: b,
124
124
  type: "button",
125
125
  className: d(
126
126
  "inline-flex shrink-0 items-center justify-center gap-2 cursor-pointer font-semibold",
@@ -137,7 +137,7 @@ const vt = {
137
137
  ),
138
138
  disabled: p,
139
139
  "aria-busy": s || void 0,
140
- ...f,
140
+ ...h,
141
141
  children: [
142
142
  s && /* @__PURE__ */ e(
143
143
  "span",
@@ -147,9 +147,9 @@ const vt = {
147
147
  }
148
148
  ),
149
149
  !s && a && /* @__PURE__ */ e("span", { className: "flex items-center justify-center shrink-0", children: a }),
150
- !l && y,
150
+ !l && N,
151
151
  !s && o && /* @__PURE__ */ e("span", { className: "flex items-center justify-center shrink-0", children: o }),
152
- l && !s && !a && !o && y
152
+ l && !s && !a && !o && N
153
153
  ]
154
154
  }
155
155
  );
@@ -206,7 +206,7 @@ const ln = ({
206
206
  "aria-label": l,
207
207
  ...u
208
208
  }) => {
209
- const m = typeof r == "number" ? r : kt(r), y = d(
209
+ const m = typeof r == "number" ? r : kt(r), N = d(
210
210
  "inline-block shrink-0",
211
211
  wt[n],
212
212
  s && [
@@ -214,21 +214,21 @@ const ln = ({
214
214
  "focus-visible:outline-none focus-visible:focus-ring"
215
215
  ],
216
216
  o
217
- ), h = {
217
+ ), f = {
218
218
  size: m,
219
219
  strokeWidth: 2,
220
- className: y,
220
+ className: N,
221
221
  onClick: s ? a : void 0,
222
222
  "aria-label": l,
223
223
  "aria-hidden": l ? void 0 : !0,
224
224
  role: s ? "button" : void 0,
225
225
  tabIndex: s ? 0 : void 0,
226
- onKeyDown: s ? (f) => {
227
- (f.key === "Enter" || f.key === " ") && (f.preventDefault(), a?.());
226
+ onKeyDown: s ? (h) => {
227
+ (h.key === "Enter" || h.key === " ") && (h.preventDefault(), a?.());
228
228
  } : void 0,
229
229
  ...u
230
230
  };
231
- return /* @__PURE__ */ e(t, { ...h });
231
+ return /* @__PURE__ */ e(t, { ...f });
232
232
  };
233
233
  function kt(t) {
234
234
  return {
@@ -256,11 +256,11 @@ function on({
256
256
  caret: l = !1,
257
257
  onClear: u,
258
258
  clearLabel: m = "Filter wissen",
259
- onClick: y,
260
- title: h,
261
- className: f
259
+ onClick: N,
260
+ title: f,
261
+ className: h
262
262
  }) {
263
- const x = o && !!u, p = s === "pill" ? "rounded-full" : "rounded-md", w = d(
263
+ const b = o && !!u, p = s === "pill" ? "rounded-full" : "rounded-md", C = d(
264
264
  // A button's default cursor is an arrow, so it has to be asked for.
265
265
  "inline-flex cursor-pointer select-none items-center text-sm font-semibold",
266
266
  a === "sm" ? "h-control-sm" : "h-control-md",
@@ -268,19 +268,19 @@ function on({
268
268
  p,
269
269
  // Picking a value outranks whatever the value happens to mean.
270
270
  o ? "bg-accent text-accent-fg" : d("border", Ct[n]),
271
- f
271
+ h
272
272
  ), g = /* @__PURE__ */ c(xe, { children: [
273
273
  r,
274
274
  t,
275
275
  l && /* @__PURE__ */ e(Y, { icon: ge, size: "xs" })
276
- ] }), b = d(
276
+ ] }), x = d(
277
277
  "inline-flex items-center gap-1.5 pl-3",
278
278
  p,
279
- x ? "pr-1.5" : "pr-3",
279
+ b ? "pr-1.5" : "pr-3",
280
280
  "focus-visible:outline-none focus-visible:focus-ring"
281
281
  );
282
- return x ? /* @__PURE__ */ c("span", { className: w, title: h, children: [
283
- /* @__PURE__ */ e("button", { type: "button", onClick: y, className: b, children: g }),
282
+ return b ? /* @__PURE__ */ c("span", { className: C, title: f, children: [
283
+ /* @__PURE__ */ e("button", { type: "button", onClick: N, className: x, children: g }),
284
284
  /* @__PURE__ */ e(
285
285
  "button",
286
286
  {
@@ -291,7 +291,7 @@ function on({
291
291
  children: /* @__PURE__ */ e(Y, { icon: we, size: "xs" })
292
292
  }
293
293
  )
294
- ] }) : /* @__PURE__ */ e("button", { type: "button", title: h, onClick: y, className: d(w, b), children: g });
294
+ ] }) : /* @__PURE__ */ e("button", { type: "button", title: f, onClick: N, className: d(C, x), children: g });
295
295
  }
296
296
  const St = {
297
297
  xs: "text-xs",
@@ -327,10 +327,10 @@ const St = {
327
327
  children: l,
328
328
  href: u,
329
329
  target: m,
330
- rel: y,
331
- ...h
330
+ rel: N,
331
+ ...f
332
332
  }) => {
333
- const f = a || u && (u.startsWith("http") || u.startsWith("mailto:")), x = d(
333
+ const h = a || u && (u.startsWith("http") || u.startsWith("mailto:")), b = d(
334
334
  "inline-flex items-center gap-1 underline-offset-2",
335
335
  "transition-colors duration-fast ease-out",
336
336
  "focus-visible:outline-none focus-visible:focus-ring",
@@ -345,15 +345,15 @@ const St = {
345
345
  s && "pointer-events-none cursor-not-allowed text-text-disabled opacity-50",
346
346
  o
347
347
  ), p = {
348
- ...h,
348
+ ...f,
349
349
  href: s ? void 0 : u,
350
- target: f ? "_blank" : m,
351
- rel: f ? "noopener noreferrer" : y,
350
+ target: h ? "_blank" : m,
351
+ rel: h ? "noopener noreferrer" : N,
352
352
  "aria-disabled": s || void 0
353
353
  };
354
- return /* @__PURE__ */ c("a", { className: x, ...p, children: [
354
+ return /* @__PURE__ */ c("a", { className: b, ...p, children: [
355
355
  l,
356
- f && /* @__PURE__ */ e(Xe, { className: "size-icon-sm shrink-0", "aria-hidden": !0 })
356
+ h && /* @__PURE__ */ e(Xe, { className: "size-icon-sm shrink-0", "aria-hidden": !0 })
357
357
  ] });
358
358
  }, Mt = {
359
359
  sm: "h-control-sm px-3 text-sm",
@@ -398,14 +398,14 @@ function dn({
398
398
  );
399
399
  }
400
400
  function ze(t, r, { gap: n = 6, matchWidth: s = !1, placement: a = "bottom-start" } = {}) {
401
- const [o, l] = B({});
401
+ const [o, l] = R({});
402
402
  return ft(() => {
403
403
  if (!t) return;
404
404
  const u = () => {
405
405
  const m = r.current;
406
406
  if (!m) return;
407
- const y = m.getBoundingClientRect(), h = window.innerHeight - y.bottom, f = y.top, x = a.startsWith("top"), p = x ? f < 200 && h > f : h < 200 && f > h, w = x !== p, g = { position: "fixed" };
408
- w ? (g.bottom = window.innerHeight - y.top + n, g.maxHeight = Math.max(120, f - n * 2)) : (g.top = y.bottom + n, g.maxHeight = Math.max(120, h - n * 2)), a.endsWith("end") ? g.right = window.innerWidth - y.right : g.left = y.left, s && (g.width = y.width), l(g);
407
+ const N = m.getBoundingClientRect(), f = window.innerHeight - N.bottom, h = N.top, b = a.startsWith("top"), p = b ? h < 200 && f > h : f < 200 && h > f, C = b !== p, g = { position: "fixed" };
408
+ C ? (g.bottom = window.innerHeight - N.top + n, g.maxHeight = Math.max(120, h - n * 2)) : (g.top = N.bottom + n, g.maxHeight = Math.max(120, f - n * 2)), a.endsWith("end") ? g.right = window.innerWidth - N.right : g.left = N.left, s && (g.width = N.width), l(g);
409
409
  };
410
410
  return u(), window.addEventListener("scroll", u, !0), window.addEventListener("resize", u), () => {
411
411
  window.removeEventListener("scroll", u, !0), window.removeEventListener("resize", u);
@@ -422,26 +422,26 @@ const $t = ({
422
422
  disabled: l = !1,
423
423
  triggerLabel: u
424
424
  }) => {
425
- const [m, y] = B(!1), h = se(null), f = se(null), x = ze(m, f, { placement: n });
425
+ const [m, N] = R(!1), f = se(null), h = se(null), b = ze(m, h, { placement: n });
426
426
  Q(() => {
427
427
  if (!m) return;
428
- const g = (A) => {
429
- h.current && !h.current.contains(A.target) && y(!1);
430
- }, b = (A) => {
431
- A.key === "Escape" && y(!1);
428
+ const g = (_) => {
429
+ f.current && !f.current.contains(_.target) && N(!1);
430
+ }, x = (_) => {
431
+ _.key === "Escape" && N(!1);
432
432
  };
433
- return document.addEventListener("mousedown", g), document.addEventListener("keydown", b), () => {
434
- document.removeEventListener("mousedown", g), document.removeEventListener("keydown", b);
433
+ return document.addEventListener("mousedown", g), document.addEventListener("keydown", x), () => {
434
+ document.removeEventListener("mousedown", g), document.removeEventListener("keydown", x);
435
435
  };
436
436
  }, [m]);
437
437
  const p = (g) => {
438
- g.stopPropagation(), !l && y((b) => !b);
439
- }, w = () => y(!1);
440
- return /* @__PURE__ */ c("div", { ref: h, className: d("relative inline-flex", a), children: [
438
+ g.stopPropagation(), !l && N((x) => !x);
439
+ }, C = () => N(!1);
440
+ return /* @__PURE__ */ c("div", { ref: f, className: d("relative inline-flex", a), children: [
441
441
  /* @__PURE__ */ e(
442
442
  "button",
443
443
  {
444
- ref: f,
444
+ ref: h,
445
445
  type: "button",
446
446
  onClick: p,
447
447
  disabled: l,
@@ -464,8 +464,8 @@ const $t = ({
464
464
  "fixed z-overlay overflow-y-auto rounded-lg border border-border bg-surface shadow-overlay",
465
465
  s
466
466
  ),
467
- style: x,
468
- children: typeof r == "function" ? r(w) : r
467
+ style: b,
468
+ children: typeof r == "function" ? r(C) : r
469
469
  }
470
470
  )
471
471
  ] });
@@ -477,7 +477,7 @@ const $t = ({
477
477
  sm: "h-control-sm w-7",
478
478
  md: "h-control-md w-8"
479
479
  };
480
- function Be({
480
+ function Re({
481
481
  label: t,
482
482
  onClick: r,
483
483
  variant: n = "primary",
@@ -487,9 +487,9 @@ function Be({
487
487
  disabled: l = !1,
488
488
  loading: u = !1,
489
489
  menuPlacement: m = "bottom-end",
490
- menuLabel: y = "More options"
490
+ menuLabel: N = "More options"
491
491
  }) {
492
- const h = l || u, f = o.length > 0;
492
+ const f = l || u, h = o.length > 0;
493
493
  return /* @__PURE__ */ c("div", { className: d("inline-flex items-center", n === "primary" && "gap-0.5"), children: [
494
494
  /* @__PURE__ */ e(
495
495
  ne,
@@ -500,16 +500,16 @@ function Be({
500
500
  disabled: l,
501
501
  loading: u,
502
502
  leftIcon: a,
503
- className: d(f && "rounded-r-none"),
503
+ className: d(h && "rounded-r-none"),
504
504
  children: t
505
505
  }
506
506
  ),
507
- f && /* @__PURE__ */ e(
507
+ h && /* @__PURE__ */ e(
508
508
  $t,
509
509
  {
510
510
  placement: m,
511
- disabled: h,
512
- triggerLabel: y,
511
+ disabled: f,
512
+ triggerLabel: N,
513
513
  className: "min-w-menu py-1",
514
514
  trigger: /* @__PURE__ */ e(
515
515
  "span",
@@ -520,17 +520,17 @@ function Be({
520
520
  "transition-colors duration-fast ease-out",
521
521
  Dt[n],
522
522
  Tt[s],
523
- h && "cursor-not-allowed opacity-50"
523
+ f && "cursor-not-allowed opacity-50"
524
524
  ),
525
525
  children: /* @__PURE__ */ e(ge, { className: "size-icon-md" })
526
526
  }
527
527
  ),
528
- children: (x) => /* @__PURE__ */ e(xe, { children: o.map((p) => /* @__PURE__ */ c(
528
+ children: (b) => /* @__PURE__ */ e(xe, { children: o.map((p) => /* @__PURE__ */ c(
529
529
  "button",
530
530
  {
531
531
  type: "button",
532
532
  onClick: () => {
533
- p.onClick(), x();
533
+ p.onClick(), b();
534
534
  },
535
535
  className: d(
536
536
  "flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm",
@@ -575,23 +575,23 @@ const _t = {
575
575
  labelClassName: l,
576
576
  className: u,
577
577
  id: m,
578
- ...y
579
- }, h) => {
580
- const f = oe.useId(), x = m || `checkbox-${f}`, p = !!n, w = oe.useRef(null), g = oe.useCallback(
581
- (b) => {
582
- w.current = b, typeof h == "function" ? h(b) : h && typeof h == "object" && (h.current = b);
578
+ ...N
579
+ }, f) => {
580
+ const h = oe.useId(), b = m || `checkbox-${h}`, p = !!n, C = oe.useRef(null), g = oe.useCallback(
581
+ (x) => {
582
+ C.current = x, typeof f == "function" ? f(x) : f && typeof f == "object" && (f.current = x);
583
583
  },
584
- [h]
584
+ [f]
585
585
  );
586
586
  return oe.useEffect(() => {
587
- w.current && (w.current.indeterminate = a);
587
+ C.current && (C.current.indeterminate = a);
588
588
  }, [a]), /* @__PURE__ */ c("div", { className: d("flex flex-col", o), children: [
589
589
  /* @__PURE__ */ c("div", { className: d("flex items-center gap-3", At[s]), children: [
590
590
  /* @__PURE__ */ e(
591
591
  "input",
592
592
  {
593
593
  ref: g,
594
- id: x,
594
+ id: b,
595
595
  type: "checkbox",
596
596
  "aria-invalid": p || void 0,
597
597
  className: d(
@@ -605,14 +605,14 @@ const _t = {
605
605
  p ? "border-danger-border" : "border-border-strong",
606
606
  u
607
607
  ),
608
- ...y
608
+ ...N
609
609
  }
610
610
  ),
611
611
  t && /* @__PURE__ */ c("div", { className: "flex-1", children: [
612
612
  /* @__PURE__ */ e(
613
613
  "label",
614
614
  {
615
- htmlFor: x,
615
+ htmlFor: b,
616
616
  className: d(
617
617
  "cursor-pointer",
618
618
  p ? "text-danger-fg" : "text-text",
@@ -640,47 +640,47 @@ const It = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
640
640
  className: l,
641
641
  minDate: u,
642
642
  maxDate: m,
643
- format: y = "MM/dd/yyyy",
644
- withTime: h = !1
645
- }, f) => {
646
- const [x, p] = B(!1), [w, g] = B(() => t || /* @__PURE__ */ new Date()), b = se(null), A = se(null), _ = ze(x, A);
643
+ format: N = "MM/dd/yyyy",
644
+ withTime: f = !1
645
+ }, h) => {
646
+ const [b, p] = R(!1), [C, g] = R(() => t || /* @__PURE__ */ new Date()), x = se(null), _ = se(null), E = ze(b, _);
647
647
  Q(() => {
648
648
  const i = (S) => {
649
- b.current && !b.current.contains(S.target) && p(!1);
649
+ x.current && !x.current.contains(S.target) && p(!1);
650
650
  };
651
- return x && document.addEventListener("mousedown", i), () => {
651
+ return b && document.addEventListener("mousedown", i), () => {
652
652
  document.removeEventListener("mousedown", i);
653
653
  };
654
- }, [x]);
655
- const K = (i) => {
654
+ }, [b]);
655
+ const W = (i) => {
656
656
  if (!i) return "";
657
- const S = i.getDate().toString().padStart(2, "0"), N = (i.getMonth() + 1).toString().padStart(2, "0"), T = i.getFullYear(), k = y === "dd/MM/yyyy" ? `${S}/${N}/${T}` : y === "yyyy-MM-dd" ? `${T}-${N}-${S}` : `${N}/${S}/${T}`;
658
- return h ? `${k} ${$(i)}` : k;
659
- }, $ = (i) => `${i.getHours().toString().padStart(2, "0")}:${i.getMinutes().toString().padStart(2, "0")}`, X = (i) => {
660
- const [S, N] = i.split(":").map(Number);
661
- if (Number.isNaN(S) || Number.isNaN(N)) return;
662
- const T = t ? new Date(t) : /* @__PURE__ */ new Date();
663
- T.setHours(S, N, 0, 0), r?.(T);
657
+ const S = i.getDate().toString().padStart(2, "0"), y = (i.getMonth() + 1).toString().padStart(2, "0"), A = i.getFullYear(), w = N === "dd/MM/yyyy" ? `${S}/${y}/${A}` : N === "yyyy-MM-dd" ? `${A}-${y}-${S}` : `${y}/${S}/${A}`;
658
+ return f ? `${w} ${D(i)}` : w;
659
+ }, D = (i) => `${i.getHours().toString().padStart(2, "0")}:${i.getMinutes().toString().padStart(2, "0")}`, X = (i) => {
660
+ const [S, y] = i.split(":").map(Number);
661
+ if (Number.isNaN(S) || Number.isNaN(y)) return;
662
+ const A = t ? new Date(t) : /* @__PURE__ */ new Date();
663
+ A.setHours(S, y, 0, 0), r?.(A);
664
664
  }, U = () => {
665
- const i = w.getFullYear(), S = w.getMonth(), N = new Date(i, S, 1), T = new Date(N);
666
- T.setDate(T.getDate() - N.getDay());
667
- const k = [], ee = new Date(T);
665
+ const i = C.getFullYear(), S = C.getMonth(), y = new Date(i, S, 1), A = new Date(y);
666
+ A.setDate(A.getDate() - y.getDay());
667
+ const w = [], ee = new Date(A);
668
668
  for (let ae = 0; ae < 42; ae++)
669
- k.push(new Date(ee)), ee.setDate(ee.getDate() + 1);
670
- return k;
669
+ w.push(new Date(ee)), ee.setDate(ee.getDate() + 1);
670
+ return w;
671
671
  }, I = (i) => {
672
- if (i.getMonth() === w.getMonth() && !(u && i < u) && !(m && i > m)) {
673
- if (h) {
674
- const N = new Date(i);
675
- N.setHours(t?.getHours() ?? 0, t?.getMinutes() ?? 0, 0, 0), r?.(N);
672
+ if (i.getMonth() === C.getMonth() && !(u && i < u) && !(m && i > m)) {
673
+ if (f) {
674
+ const y = new Date(i);
675
+ y.setHours(t?.getHours() ?? 0, t?.getMinutes() ?? 0, 0, 0), r?.(y);
676
676
  return;
677
677
  }
678
678
  r?.(i), p(!1);
679
679
  }
680
680
  }, q = () => {
681
- g(new Date(w.getFullYear(), w.getMonth() - 1, 1));
682
- }, W = () => {
683
- g(new Date(w.getFullYear(), w.getMonth() + 1, 1));
681
+ g(new Date(C.getFullYear(), C.getMonth() - 1, 1));
682
+ }, K = () => {
683
+ g(new Date(C.getFullYear(), C.getMonth() + 1, 1));
684
684
  }, re = () => {
685
685
  r?.(null), p(!1);
686
686
  }, P = d(
@@ -696,7 +696,7 @@ const It = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
696
696
  "h-control-md w-full px-3 text-base": o === "full"
697
697
  },
698
698
  l
699
- ), ce = U(), C = [
699
+ ), ce = U(), k = [
700
700
  "January",
701
701
  "February",
702
702
  "March",
@@ -710,19 +710,19 @@ const It = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
710
710
  "November",
711
711
  "December"
712
712
  ];
713
- return /* @__PURE__ */ c("div", { ref: b, className: "relative", children: [
714
- /* @__PURE__ */ c("div", { ref: A, className: "relative", children: [
713
+ return /* @__PURE__ */ c("div", { ref: x, className: "relative", children: [
714
+ /* @__PURE__ */ c("div", { ref: _, className: "relative", children: [
715
715
  /* @__PURE__ */ e(
716
716
  "input",
717
717
  {
718
- ref: f,
718
+ ref: h,
719
719
  type: "text",
720
- value: K(t ?? null),
720
+ value: W(t ?? null),
721
721
  placeholder: n,
722
722
  disabled: s,
723
723
  required: a,
724
724
  readOnly: !0,
725
- onClick: () => !s && p(!x),
725
+ onClick: () => !s && p(!b),
726
726
  className: d(P, "pr-10 cursor-pointer")
727
727
  }
728
728
  ),
@@ -730,14 +730,14 @@ const It = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
730
730
  "button",
731
731
  {
732
732
  type: "button",
733
- onClick: () => !s && p(!x),
733
+ onClick: () => !s && p(!b),
734
734
  disabled: s,
735
735
  className: "absolute inset-y-0 right-0 flex items-center pr-3 text-text-muted hover:text-text-muted",
736
736
  children: /* @__PURE__ */ e(It, {})
737
737
  }
738
738
  )
739
739
  ] }),
740
- x && /* @__PURE__ */ c("div", { style: _, className: "fixed z-overlay overflow-auto rounded-lg border border-border bg-surface p-4 shadow-overlay min-w-panel", children: [
740
+ b && /* @__PURE__ */ c("div", { style: E, className: "fixed z-overlay overflow-auto rounded-lg border border-border bg-surface p-4 shadow-overlay min-w-panel", children: [
741
741
  /* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-4", children: [
742
742
  /* @__PURE__ */ e(
743
743
  "button",
@@ -748,14 +748,14 @@ const It = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
748
748
  }
749
749
  ),
750
750
  /* @__PURE__ */ c("h3", { className: "text-sm font-medium text-text", children: [
751
- C[w.getMonth()],
751
+ k[C.getMonth()],
752
752
  " ",
753
- w.getFullYear()
753
+ C.getFullYear()
754
754
  ] }),
755
755
  /* @__PURE__ */ e(
756
756
  "button",
757
757
  {
758
- onClick: W,
758
+ onClick: K,
759
759
  className: "p-1 hover:bg-surface-hover rounded",
760
760
  children: /* @__PURE__ */ e(Pt, {})
761
761
  }
@@ -763,7 +763,7 @@ const It = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
763
763
  ] }),
764
764
  /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((i) => /* @__PURE__ */ e("div", { className: "text-xs font-medium text-text-muted text-center py-1", children: i }, i)) }),
765
765
  /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: ce.map((i, S) => {
766
- const N = i.getMonth() === w.getMonth(), T = t && i.toDateString() === t.toDateString(), k = i.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), ee = !N || u && i < u || m && i > m;
766
+ const y = i.getMonth() === C.getMonth(), A = t && i.toDateString() === t.toDateString(), w = i.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), ee = !y || u && i < u || m && i > m;
767
767
  return /* @__PURE__ */ e(
768
768
  "button",
769
769
  {
@@ -772,9 +772,9 @@ const It = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
772
772
  className: d(
773
773
  "w-8 h-8 text-sm rounded transition-colors duration-fast",
774
774
  {
775
- "text-text hover:bg-surface-hover": N && !T && !ee,
776
- "bg-accent text-accent-fg": T,
777
- "bg-surface-hover text-text": k && !T,
775
+ "text-text hover:bg-surface-hover": y && !A && !ee,
776
+ "bg-accent text-accent-fg": A,
777
+ "bg-surface-hover text-text": w && !A,
778
778
  "text-text-muted cursor-not-allowed": ee
779
779
  }
780
780
  ),
@@ -783,14 +783,14 @@ const It = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
783
783
  S
784
784
  );
785
785
  }) }),
786
- h && /* @__PURE__ */ c("div", { className: "mt-3 flex items-center gap-2 border-t border-border pt-3", children: [
786
+ f && /* @__PURE__ */ c("div", { className: "mt-3 flex items-center gap-2 border-t border-border pt-3", children: [
787
787
  /* @__PURE__ */ e("label", { htmlFor: "datepicker-time", className: "text-sm text-text-muted", children: "Tijd" }),
788
788
  /* @__PURE__ */ e(
789
789
  "input",
790
790
  {
791
791
  id: "datepicker-time",
792
792
  type: "time",
793
- value: t ? $(t) : "",
793
+ value: t ? D(t) : "",
794
794
  onChange: (i) => X(i.target.value),
795
795
  className: "h-control-sm rounded-md border border-border bg-surface-input px-2 text-sm text-text focus-visible:outline-none focus-visible:focus-ring"
796
796
  }
@@ -832,70 +832,70 @@ const It = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
832
832
  options: l,
833
833
  placeholder: u,
834
834
  containerClassName: m,
835
- labelClassName: y,
836
- className: h,
837
- id: f,
838
- searchable: x,
835
+ labelClassName: N,
836
+ className: f,
837
+ id: h,
838
+ searchable: b,
839
839
  multiple: p,
840
- value: w,
840
+ value: C,
841
841
  onChange: g,
842
- allowCreate: b,
843
- onCreateOption: A,
844
- ..._
845
- }, K) => {
846
- const $ = f || `select-${Math.random().toString(36).substr(2, 9)}`, X = !!n, [U, I] = oe.useState(!1), [q, W] = oe.useState(""), re = oe.useRef(null), P = oe.useRef(null), ce = ze(U, P, { matchWidth: !0 }), [C, i] = oe.useState(l);
847
- oe.useImperativeHandle(K, () => re.current), oe.useEffect(() => {
848
- const E = (D) => {
849
- re.current && !re.current.contains(D.target) && I(!1);
842
+ allowCreate: x,
843
+ onCreateOption: _,
844
+ ...E
845
+ }, W) => {
846
+ const D = h || `select-${Math.random().toString(36).substr(2, 9)}`, X = !!n, [U, I] = oe.useState(!1), [q, K] = oe.useState(""), re = oe.useRef(null), P = oe.useRef(null), ce = ze(U, P, { matchWidth: !0 }), [k, i] = oe.useState(l);
847
+ oe.useImperativeHandle(W, () => re.current), oe.useEffect(() => {
848
+ const M = (T) => {
849
+ re.current && !re.current.contains(T.target) && I(!1);
850
850
  };
851
- return document.addEventListener("mousedown", E), () => document.removeEventListener("mousedown", E);
851
+ return document.addEventListener("mousedown", M), () => document.removeEventListener("mousedown", M);
852
852
  }, []);
853
853
  const S = oe.useCallback(
854
- (E, D) => E.some(
855
- (z) => ye(z.value) === ye(D) || ye(z.label) === ye(D)
854
+ (M, T) => M.some(
855
+ (z) => ye(z.value) === ye(T) || ye(z.label) === ye(T)
856
856
  ),
857
857
  []
858
- ), N = oe.useCallback(
859
- (E, D) => {
860
- const z = [...E], R = (F) => {
858
+ ), y = oe.useCallback(
859
+ (M, T) => {
860
+ const z = [...M], B = (F) => {
861
861
  const H = (F ?? "").trim();
862
862
  H && (S(z, H) || z.push({ value: H, label: H }));
863
863
  };
864
- return Array.isArray(D) ? D.forEach(R) : R(D), z;
864
+ return Array.isArray(T) ? T.forEach(B) : B(T), z;
865
865
  },
866
866
  [S]
867
867
  );
868
868
  oe.useEffect(() => {
869
- i((E) => {
870
- const D = [...l];
871
- return E.forEach((z) => {
872
- !S(D, z.value) && !S(D, z.label) && D.push(z);
873
- }), N(D, w);
869
+ i((M) => {
870
+ const T = [...l];
871
+ return M.forEach((z) => {
872
+ !S(T, z.value) && !S(T, z.label) && T.push(z);
873
+ }), y(T, C);
874
874
  });
875
- }, [l, w, N, S]);
876
- const T = (E) => {
875
+ }, [l, C, y, S]);
876
+ const A = (M) => {
877
877
  if (p) {
878
- const D = Array.isArray(w) ? w : [], z = D.includes(E) ? D.filter((R) => R !== E) : [...D, E];
878
+ const T = Array.isArray(C) ? C : [], z = T.includes(M) ? T.filter((B) => B !== M) : [...T, M];
879
879
  g?.(z);
880
880
  } else
881
- g?.(E), I(!1), W("");
882
- }, k = p ? null : C.find((E) => E.value === w), ee = p ? C.filter(
883
- (E) => Array.isArray(w) && w.includes(E.value)
884
- ) : [], ae = x && q ? C.filter(
885
- (E) => E.label.toLowerCase().includes(q.toLowerCase())
886
- ) : C, le = !!b && !!x && !!q.trim() && !S(C, q), G = (E) => {
887
- const D = E.trim();
888
- if (!D) return;
889
- const z = A?.(D) ?? {
890
- value: D,
891
- label: D
881
+ g?.(M), I(!1), K("");
882
+ }, w = p ? null : k.find((M) => M.value === C), ee = p ? k.filter(
883
+ (M) => Array.isArray(C) && C.includes(M.value)
884
+ ) : [], ae = b && q ? k.filter(
885
+ (M) => M.label.toLowerCase().includes(q.toLowerCase())
886
+ ) : k, le = !!x && !!b && !!q.trim() && !S(k, q), G = (M) => {
887
+ const T = M.trim();
888
+ if (!T) return;
889
+ const z = _?.(T) ?? {
890
+ value: T,
891
+ label: T
892
892
  };
893
- if (S(C, z.value) || S(C, z.label)) {
894
- T(z.value), W(""), p || I(!1);
893
+ if (S(k, z.value) || S(k, z.label)) {
894
+ A(z.value), K(""), p || I(!1);
895
895
  return;
896
896
  }
897
- i((R) => [...R, z]), T(z.value), W(""), p || I(!1);
898
- }, j = () => p ? ee.length > 0 ? ee.map((E) => E.label).join(", ") : u || "Select options" : k?.label || u || "Select an option";
897
+ i((B) => [...B, z]), A(z.value), K(""), p || I(!1);
898
+ }, j = () => p ? ee.length > 0 ? ee.map((M) => M.label).join(", ") : u || "Select options" : w?.label || u || "Select an option";
899
899
  return /* @__PURE__ */ c(
900
900
  "div",
901
901
  {
@@ -905,17 +905,17 @@ const It = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
905
905
  a && "w-full",
906
906
  m
907
907
  ),
908
- ..._,
908
+ ...E,
909
909
  children: [
910
910
  t && /* @__PURE__ */ e(
911
911
  "label",
912
912
  {
913
- htmlFor: $,
913
+ htmlFor: D,
914
914
  onClick: () => I(!U),
915
915
  className: d(
916
916
  "block text-xs font-semibold uppercase tracking-label mb-1.5",
917
917
  X ? "text-danger-fg" : "text-text-muted",
918
- y
918
+ N
919
919
  ),
920
920
  children: t
921
921
  }
@@ -926,7 +926,7 @@ const It = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
926
926
  {
927
927
  ref: P,
928
928
  type: "button",
929
- id: $,
929
+ id: D,
930
930
  disabled: o,
931
931
  onClick: () => I(!U),
932
932
  className: d(
@@ -936,7 +936,7 @@ const It = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
936
936
  "bg-surface",
937
937
  Ot[s],
938
938
  X ? "border-danger-border text-danger-fg focus-visible:focus-ring" : "border-border text-text",
939
- h
939
+ f
940
940
  ),
941
941
  children: [
942
942
  /* @__PURE__ */ e("span", { className: "truncate flex-1 min-w-0", children: j() }),
@@ -954,15 +954,15 @@ const It = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
954
954
  }
955
955
  ),
956
956
  U && /* @__PURE__ */ c("div", { style: ce, className: "fixed z-overlay flex flex-col overflow-hidden rounded-lg border border-border bg-surface shadow-overlay", children: [
957
- x && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e(
957
+ b && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e(
958
958
  "input",
959
959
  {
960
960
  type: "text",
961
961
  placeholder: "Search...",
962
962
  value: q,
963
- onChange: (E) => W(E.target.value),
964
- onKeyDown: (E) => {
965
- E.key === "Enter" && le && (E.preventDefault(), G(q));
963
+ onChange: (M) => K(M.target.value),
964
+ onKeyDown: (M) => {
965
+ M.key === "Enter" && le && (M.preventDefault(), G(q));
966
966
  },
967
967
  className: d(
968
968
  "w-full px-3 py-2 text-sm rounded-md border",
@@ -996,32 +996,32 @@ const It = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
996
996
  children: u
997
997
  }
998
998
  ),
999
- ae.map((E) => {
1000
- const D = p ? Array.isArray(w) && w.includes(E.value) : w === E.value;
999
+ ae.map((M) => {
1000
+ const T = p ? Array.isArray(C) && C.includes(M.value) : C === M.value;
1001
1001
  return /* @__PURE__ */ e(
1002
1002
  "li",
1003
1003
  {
1004
- onClick: () => !E.disabled && T(E.value),
1004
+ onClick: () => !M.disabled && A(M.value),
1005
1005
  className: d(
1006
1006
  "cursor-pointer px-3 py-1.5 text-sm",
1007
1007
  "text-text",
1008
- E.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-surface-hover",
1009
- D && "bg-accent-soft text-accent font-semibold"
1008
+ M.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-surface-hover",
1009
+ T && "bg-accent-soft text-accent font-semibold"
1010
1010
  ),
1011
1011
  children: /* @__PURE__ */ c("div", { className: "flex items-center", children: [
1012
1012
  p && /* @__PURE__ */ e(
1013
1013
  "input",
1014
1014
  {
1015
1015
  type: "checkbox",
1016
- checked: D,
1016
+ checked: T,
1017
1017
  readOnly: !0,
1018
1018
  className: "mr-3 h-4 w-4 rounded border-border [&:not(:checked)]:bg-surface-input text-accent "
1019
1019
  }
1020
1020
  ),
1021
- /* @__PURE__ */ e("span", { children: E.label })
1021
+ /* @__PURE__ */ e("span", { children: M.label })
1022
1022
  ] })
1023
1023
  },
1024
- E.value
1024
+ M.value
1025
1025
  );
1026
1026
  })
1027
1027
  ] })
@@ -1048,7 +1048,7 @@ const Ft = {
1048
1048
  md: "h-control-md px-3 text-base",
1049
1049
  lg: "h-control-lg px-3 text-base",
1050
1050
  full: "h-control-md px-3 text-base"
1051
- }, Re = "mb-1.5 block text-xs font-semibold uppercase tracking-label", be = me(
1051
+ }, Be = "mb-1.5 block text-xs font-semibold uppercase tracking-label", be = me(
1052
1052
  ({
1053
1053
  label: t,
1054
1054
  helperText: r,
@@ -1059,21 +1059,21 @@ const Ft = {
1059
1059
  endIcon: l,
1060
1060
  loading: u = !1,
1061
1061
  containerClassName: m,
1062
- labelClassName: y,
1063
- className: h,
1064
- id: f,
1065
- ...x
1062
+ labelClassName: N,
1063
+ className: f,
1064
+ id: h,
1065
+ ...b
1066
1066
  }, p) => {
1067
- const w = oe.useId(), g = f || `textfield-${w}`, b = !!n, A = n || r ? `${g}-description` : void 0;
1067
+ const C = oe.useId(), g = h || `textfield-${C}`, x = !!n, _ = n || r ? `${g}-description` : void 0;
1068
1068
  return /* @__PURE__ */ c("div", { className: d("flex flex-col", a && "w-full", m), children: [
1069
1069
  t && /* @__PURE__ */ e(
1070
1070
  "label",
1071
1071
  {
1072
1072
  htmlFor: g,
1073
1073
  className: d(
1074
- Re,
1075
- b ? "text-danger-fg" : "text-text-subtle",
1076
- y
1074
+ Be,
1075
+ x ? "text-danger-fg" : "text-text-subtle",
1076
+ N
1077
1077
  ),
1078
1078
  children: t
1079
1079
  }
@@ -1085,8 +1085,8 @@ const Ft = {
1085
1085
  {
1086
1086
  ref: p,
1087
1087
  id: g,
1088
- "aria-invalid": b || void 0,
1089
- "aria-describedby": A,
1088
+ "aria-invalid": x || void 0,
1089
+ "aria-describedby": _,
1090
1090
  className: d(
1091
1091
  "block w-full rounded-md border bg-surface-input text-text",
1092
1092
  "transition-colors duration-fast ease-out",
@@ -1096,10 +1096,10 @@ const Ft = {
1096
1096
  Ft[s],
1097
1097
  o && "pl-9",
1098
1098
  (l || u) && "pr-9",
1099
- b ? "border-danger-border bg-danger-soft" : "border-border hover:border-border-strong",
1100
- h
1099
+ x ? "border-danger-border bg-danger-soft" : "border-border hover:border-border-strong",
1100
+ f
1101
1101
  ),
1102
- ...x
1102
+ ...b
1103
1103
  }
1104
1104
  ),
1105
1105
  (l || u) && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-3 text-text-muted", children: u ? /* @__PURE__ */ e(
@@ -1113,8 +1113,8 @@ const Ft = {
1113
1113
  (n || r) && /* @__PURE__ */ e(
1114
1114
  "p",
1115
1115
  {
1116
- id: A,
1117
- className: d("mt-1 text-xs", b ? "text-danger-fg" : "text-text-subtle"),
1116
+ id: _,
1117
+ className: d("mt-1 text-xs", x ? "text-danger-fg" : "text-text-subtle"),
1118
1118
  children: n || r
1119
1119
  }
1120
1120
  )
@@ -1122,7 +1122,7 @@ const Ft = {
1122
1122
  }
1123
1123
  );
1124
1124
  be.displayName = "TextField";
1125
- function Bt({
1125
+ function Rt({
1126
1126
  value: t,
1127
1127
  onChange: r,
1128
1128
  onListFolders: n,
@@ -1132,27 +1132,27 @@ function Bt({
1132
1132
  templatePlaceholder: l,
1133
1133
  showTemplate: u = !0
1134
1134
  }) {
1135
- const [m, y] = B([]);
1135
+ const [m, N] = R([]);
1136
1136
  Q(() => {
1137
- let f = !0;
1138
- return Promise.resolve(n?.()).then((x) => {
1139
- f && x && y(x.data ?? []);
1137
+ let h = !0;
1138
+ return Promise.resolve(n?.()).then((b) => {
1139
+ h && b && N(b.data ?? []);
1140
1140
  }).catch(() => {
1141
1141
  }), () => {
1142
- f = !1;
1142
+ h = !1;
1143
1143
  };
1144
1144
  }, []);
1145
- const h = t ?? {};
1145
+ const f = t ?? {};
1146
1146
  return /* @__PURE__ */ c("div", { className: "flex flex-col gap-2", children: [
1147
1147
  /* @__PURE__ */ e(
1148
1148
  Ne,
1149
1149
  {
1150
1150
  size: a,
1151
1151
  fullWidth: !0,
1152
- value: h.folderId ?? "",
1153
- options: m.map((f) => ({ value: f.id, label: f.name })),
1152
+ value: f.folderId ?? "",
1153
+ options: m.map((h) => ({ value: h.id, label: h.name })),
1154
1154
  placeholder: o ?? "Select a folder",
1155
- onChange: (f) => r?.({ ...h, folderId: f })
1155
+ onChange: (h) => r?.({ ...f, folderId: h })
1156
1156
  }
1157
1157
  ),
1158
1158
  u && /* @__PURE__ */ e(
@@ -1160,14 +1160,14 @@ function Bt({
1160
1160
  {
1161
1161
  size: a,
1162
1162
  disabled: s ?? !1,
1163
- value: h.pathTemplate ?? "",
1163
+ value: f.pathTemplate ?? "",
1164
1164
  placeholder: l ?? "Sub-path e.g. {yyyy}/{mm}/{dd} (optional)",
1165
- onChange: (f) => r?.({ ...h, pathTemplate: f.target.value })
1165
+ onChange: (h) => r?.({ ...f, pathTemplate: h.target.value })
1166
1166
  }
1167
1167
  )
1168
1168
  ] });
1169
1169
  }
1170
- const fe = (...t) => t.filter(Boolean).join(" "), Rt = (t) => /* @__PURE__ */ e(Se, { ...t, strokeWidth: 1.5, "aria-hidden": !0 }), Ht = (t) => /* @__PURE__ */ e(ge, { ...t, strokeWidth: 1.5, "aria-hidden": !0 }), Vt = {
1170
+ const fe = (...t) => t.filter(Boolean).join(" "), Bt = (t) => /* @__PURE__ */ e(Se, { ...t, strokeWidth: 1.5, "aria-hidden": !0 }), Ht = (t) => /* @__PURE__ */ e(ge, { ...t, strokeWidth: 1.5, "aria-hidden": !0 }), Vt = {
1171
1171
  sm: "h-control-sm px-3 text-sm",
1172
1172
  md: "h-control-md px-3 text-base",
1173
1173
  lg: "h-control-lg px-3 text-base",
@@ -1184,64 +1184,64 @@ const fe = (...t) => t.filter(Boolean).join(" "), Rt = (t) => /* @__PURE__ */ e(
1184
1184
  error: n,
1185
1185
  size: s = "md",
1186
1186
  fullWidth: a = !1,
1187
- startIcon: o = /* @__PURE__ */ e(Rt, {}),
1187
+ startIcon: o = /* @__PURE__ */ e(Bt, {}),
1188
1188
  loading: l = !1,
1189
1189
  containerClassName: u,
1190
1190
  labelClassName: m,
1191
- className: y,
1192
- id: h,
1193
- options: f,
1194
- onRemoteSearch: x,
1191
+ className: N,
1192
+ id: f,
1193
+ options: h,
1194
+ onRemoteSearch: b,
1195
1195
  onSelect: p,
1196
- debounceTime: w = 500,
1196
+ debounceTime: C = 500,
1197
1197
  showAllOnOpen: g = !1,
1198
- value: b,
1199
- onChange: A,
1200
- ..._
1201
- }, K) => {
1202
- const $ = h || `searchfield-${Math.random().toString(36).substr(2, 9)}`, X = !!n, U = se(null), I = se(null), [q, W] = B(b || ""), [re, P] = B(!1), [ce, C] = B(!1), [i, S] = B(!1);
1198
+ value: x,
1199
+ onChange: _,
1200
+ ...E
1201
+ }, W) => {
1202
+ const D = f || `searchfield-${Math.random().toString(36).substr(2, 9)}`, X = !!n, U = se(null), I = se(null), [q, K] = R(x || ""), [re, P] = R(!1), [ce, k] = R(!1), [i, S] = R(!1);
1203
1203
  Q(() => {
1204
- b !== void 0 && W(b);
1205
- }, [b]);
1206
- const N = he(() => {
1207
- if (g && !i || !q) return f;
1204
+ x !== void 0 && K(x);
1205
+ }, [x]);
1206
+ const y = he(() => {
1207
+ if (g && !i || !q) return h;
1208
1208
  const j = String(q).toLowerCase();
1209
- return f.filter(
1210
- (E) => String(E.label).toLowerCase().includes(j)
1209
+ return h.filter(
1210
+ (M) => String(M.label).toLowerCase().includes(j)
1211
1211
  );
1212
- }, [q, f, g, i]);
1212
+ }, [q, h, g, i]);
1213
1213
  Q(() => {
1214
- if (!x || !q) {
1215
- C(!1);
1214
+ if (!b || !q) {
1215
+ k(!1);
1216
1216
  return;
1217
1217
  }
1218
1218
  const j = setTimeout(async () => {
1219
- C(!0);
1219
+ k(!0);
1220
1220
  try {
1221
- await x(String(q));
1222
- } catch (E) {
1223
- console.error("Remote search failed:", E);
1221
+ await b(String(q));
1222
+ } catch (M) {
1223
+ console.error("Remote search failed:", M);
1224
1224
  } finally {
1225
- C(!1);
1225
+ k(!1);
1226
1226
  }
1227
- }, w);
1227
+ }, C);
1228
1228
  return () => {
1229
- clearTimeout(j), C(!1);
1229
+ clearTimeout(j), k(!1);
1230
1230
  };
1231
- }, [q, w, x]), Q(() => {
1232
- const j = (E) => {
1233
- U.current && !U.current.contains(E.target) && P(!1);
1231
+ }, [q, C, b]), Q(() => {
1232
+ const j = (M) => {
1233
+ U.current && !U.current.contains(M.target) && P(!1);
1234
1234
  };
1235
1235
  return document.addEventListener("mousedown", j), () => document.removeEventListener("mousedown", j);
1236
1236
  }, []);
1237
- const T = (j) => {
1238
- const E = j.target.value;
1239
- W(E), P(!0), S(!0), A && A(j);
1240
- }, k = (j) => {
1241
- W(j.label), P(!1), S(!1), p && p(j.value);
1237
+ const A = (j) => {
1238
+ const M = j.target.value;
1239
+ K(M), P(!0), S(!0), _ && _(j);
1240
+ }, w = (j) => {
1241
+ K(j.label), P(!1), S(!1), p && p(j.value);
1242
1242
  }, ee = () => {
1243
- (f.length > 0 || x) && (P(!0), S(!1));
1244
- }, ae = l || ce, le = re && (N.length > 0 || ae), G = he(() => K || I, [K]);
1243
+ (h.length > 0 || b) && (P(!0), S(!1));
1244
+ }, ae = l || ce, le = re && (y.length > 0 || ae), G = he(() => W || I, [W]);
1245
1245
  return /* @__PURE__ */ c(
1246
1246
  "div",
1247
1247
  {
@@ -1256,7 +1256,7 @@ const fe = (...t) => t.filter(Boolean).join(" "), Rt = (t) => /* @__PURE__ */ e(
1256
1256
  t && /* @__PURE__ */ e(
1257
1257
  "label",
1258
1258
  {
1259
- htmlFor: $,
1259
+ htmlFor: D,
1260
1260
  className: fe(
1261
1261
  "block text-sm font-medium mb-1",
1262
1262
  X ? "text-danger-fg" : "text-text",
@@ -1271,9 +1271,9 @@ const fe = (...t) => t.filter(Boolean).join(" "), Rt = (t) => /* @__PURE__ */ e(
1271
1271
  "input",
1272
1272
  {
1273
1273
  ref: G,
1274
- id: $,
1274
+ id: D,
1275
1275
  value: q,
1276
- onChange: T,
1276
+ onChange: A,
1277
1277
  onFocus: ee,
1278
1278
  className: fe(
1279
1279
  // Base styles
@@ -1288,9 +1288,9 @@ const fe = (...t) => t.filter(Boolean).join(" "), Rt = (t) => /* @__PURE__ */ e(
1288
1288
  // Altijd padding rechts voor de dropdown/loading icon
1289
1289
  // State styles
1290
1290
  X ? "border-danger-border text-danger-fg focus-visible:focus-ring" : "border-border text-text",
1291
- y || ""
1291
+ N || ""
1292
1292
  ),
1293
- ..._
1293
+ ...E
1294
1294
  }
1295
1295
  ),
1296
1296
  /* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: ae || l ? (
@@ -1324,11 +1324,11 @@ const fe = (...t) => t.filter(Boolean).join(" "), Rt = (t) => /* @__PURE__ */ e(
1324
1324
  {
1325
1325
  className: "absolute z-10 mt-1 w-full bg-surface border border-border rounded-lg shadow-lg max-h-60 overflow-auto top-full",
1326
1326
  role: "listbox",
1327
- children: N.length > 0 ? N.map((j) => /* @__PURE__ */ e(
1327
+ children: y.length > 0 ? y.map((j) => /* @__PURE__ */ e(
1328
1328
  "li",
1329
1329
  {
1330
1330
  className: "px-4 py-2 cursor-pointer text-text hover:bg-accent-soft hover:text-accent transition-colors",
1331
- onClick: () => k(j),
1331
+ onClick: () => w(j),
1332
1332
  role: "option",
1333
1333
  "aria-selected": q === j.label,
1334
1334
  children: j.label
@@ -1347,7 +1347,7 @@ const fe = (...t) => t.filter(Boolean).join(" "), Rt = (t) => /* @__PURE__ */ e(
1347
1347
  children: n || r
1348
1348
  }
1349
1349
  ),
1350
- x && /* @__PURE__ */ c("p", { className: "mt-2 text-xs text-success-fg", children: [
1350
+ b && /* @__PURE__ */ c("p", { className: "mt-2 text-xs text-success-fg", children: [
1351
1351
  "Huidige zoekterm (niet-gedebounced): ",
1352
1352
  String(q)
1353
1353
  ] })
@@ -1447,12 +1447,12 @@ function Wt({
1447
1447
  {
1448
1448
  className: "grid gap-2 border-t border-border-subtle p-3",
1449
1449
  style: { gridTemplateColumns: `repeat(${s}, minmax(0, 1fr))` },
1450
- children: Array.from({ length: s }).map((m, y) => /* @__PURE__ */ e(
1450
+ children: Array.from({ length: s }).map((m, N) => /* @__PURE__ */ e(
1451
1451
  "div",
1452
1452
  {
1453
1453
  className: "h-4 w-full rounded-sm bg-surface-hover"
1454
1454
  },
1455
- `cell-${u}-${y}`
1455
+ `cell-${u}-${N}`
1456
1456
  ))
1457
1457
  },
1458
1458
  `row-${u}`
@@ -1471,66 +1471,66 @@ const Kt = ({
1471
1471
  showCheck: u = !0,
1472
1472
  header: m
1473
1473
  }) => {
1474
- const [y, h] = B(!1), [f, x] = B(null), [p, w] = B({ top: 0, left: 0 }), g = se(null), b = se(null), A = se(null), _ = se(null), K = ze(y, b, { placement: a }), $ = se(null), X = () => Array.from(
1475
- _.current?.querySelectorAll("button[data-option-value]:not(:disabled)") ?? []
1474
+ const [N, f] = R(!1), [h, b] = R(null), [p, C] = R({ top: 0, left: 0 }), g = se(null), x = se(null), _ = se(null), E = se(null), W = ze(N, x, { placement: a }), D = se(null), X = () => Array.from(
1475
+ E.current?.querySelectorAll("button[data-option-value]:not(:disabled)") ?? []
1476
1476
  );
1477
1477
  Q(() => {
1478
- y && X()[0]?.focus();
1479
- }, [y]);
1478
+ N && X()[0]?.focus();
1479
+ }, [N]);
1480
1480
  const U = (i) => {
1481
1481
  if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(i.key)) return;
1482
- const N = X();
1483
- if (N.length === 0) return;
1482
+ const y = X();
1483
+ if (y.length === 0) return;
1484
1484
  i.preventDefault();
1485
- const T = N.indexOf(document.activeElement), k = i.key === "Home" ? 0 : i.key === "End" ? N.length - 1 : i.key === "ArrowDown" ? (T + 1) % N.length : (T - 1 + N.length) % N.length;
1486
- N[k]?.focus();
1485
+ const A = y.indexOf(document.activeElement), w = i.key === "Home" ? 0 : i.key === "End" ? y.length - 1 : i.key === "ArrowDown" ? (A + 1) % y.length : (A - 1 + y.length) % y.length;
1486
+ y[w]?.focus();
1487
1487
  };
1488
1488
  Q(() => {
1489
1489
  const i = (S) => {
1490
- g.current && (!g.current.contains(S.target) || A.current && !A.current.contains(S.target)) && (h(!1), x(null), $.current && (clearTimeout($.current), $.current = null));
1490
+ g.current && (!g.current.contains(S.target) || _.current && !_.current.contains(S.target)) && (f(!1), b(null), D.current && (clearTimeout(D.current), D.current = null));
1491
1491
  };
1492
- return y && document.addEventListener("mousedown", i), () => {
1492
+ return N && document.addEventListener("mousedown", i), () => {
1493
1493
  document.removeEventListener("mousedown", i);
1494
1494
  };
1495
- }, [y]), Q(() => {
1495
+ }, [N]), Q(() => {
1496
1496
  const i = (S) => {
1497
- S.key === "Escape" && (h(!1), x(null), b.current?.focus(), $.current && (clearTimeout($.current), $.current = null));
1497
+ S.key === "Escape" && (f(!1), b(null), x.current?.focus(), D.current && (clearTimeout(D.current), D.current = null));
1498
1498
  };
1499
- return y && document.addEventListener("keydown", i), () => {
1499
+ return N && document.addEventListener("keydown", i), () => {
1500
1500
  document.removeEventListener("keydown", i);
1501
1501
  };
1502
- }, [y]), Q(() => {
1503
- if (f && g.current) {
1502
+ }, [N]), Q(() => {
1503
+ if (h && g.current) {
1504
1504
  const i = g.current.querySelector(
1505
- `[data-option-value="${f}"]`
1505
+ `[data-option-value="${h}"]`
1506
1506
  );
1507
1507
  if (i) {
1508
1508
  const S = i.getBoundingClientRect();
1509
- w({
1509
+ C({
1510
1510
  top: S.top,
1511
1511
  left: S.right + 8
1512
1512
  });
1513
1513
  }
1514
1514
  }
1515
- }, [f]), Q(() => () => {
1516
- $.current && clearTimeout($.current);
1515
+ }, [h]), Q(() => () => {
1516
+ D.current && clearTimeout(D.current);
1517
1517
  }, []);
1518
1518
  const I = (i) => {
1519
- i.stopPropagation(), !o && (h(!y), x(null), $.current && (clearTimeout($.current), $.current = null));
1520
- }, q = (i, S, N) => {
1521
- i.stopPropagation(), !S.disabled && !S.divider && (!S.children || S.children.length === 0) && (s?.(S.value, N), h(!1), x(null));
1522
- }, W = (i) => {
1523
- $.current && (clearTimeout($.current), $.current = null), i.children && i.children.length > 0 ? x(i.value) : x(null);
1519
+ i.stopPropagation(), !o && (f(!N), b(null), D.current && (clearTimeout(D.current), D.current = null));
1520
+ }, q = (i, S, y) => {
1521
+ i.stopPropagation(), !S.disabled && !S.divider && (!S.children || S.children.length === 0) && (s?.(S.value, y), f(!1), b(null));
1522
+ }, K = (i) => {
1523
+ D.current && (clearTimeout(D.current), D.current = null), i.children && i.children.length > 0 ? b(i.value) : b(null);
1524
1524
  }, re = (i) => {
1525
- i.children && i.children.length > 0 ? $.current = setTimeout(() => {
1526
- x(null);
1527
- }, 150) : x(null);
1528
- }, P = (i, S, N) => {
1529
- i.stopPropagation(), !S.disabled && !S.divider && (s?.(S.value, N), h(!1), x(null));
1525
+ i.children && i.children.length > 0 ? D.current = setTimeout(() => {
1526
+ b(null);
1527
+ }, 150) : b(null);
1528
+ }, P = (i, S, y) => {
1529
+ i.stopPropagation(), !S.disabled && !S.divider && (s?.(S.value, y), f(!1), b(null));
1530
1530
  }, ce = d(
1531
1531
  "fixed z-overlay min-w-menu bg-surface rounded-lg shadow-overlay border border-border",
1532
1532
  "max-h-60 overflow-auto"
1533
- ), C = d(
1533
+ ), k = d(
1534
1534
  "fixed z-overlay min-w-menu bg-surface rounded-lg shadow-overlay border border-border",
1535
1535
  "max-h-60 overflow-auto"
1536
1536
  );
@@ -1546,18 +1546,18 @@ const Kt = ({
1546
1546
  /* @__PURE__ */ e(
1547
1547
  "button",
1548
1548
  {
1549
- ref: b,
1549
+ ref: x,
1550
1550
  onClick: I,
1551
1551
  disabled: o,
1552
1552
  "aria-haspopup": "menu",
1553
- "aria-expanded": y,
1553
+ "aria-expanded": N,
1554
1554
  className: d("inline-flex items-center justify-center", {
1555
1555
  "opacity-50 cursor-not-allowed": o
1556
1556
  }),
1557
1557
  children: t
1558
1558
  }
1559
1559
  ),
1560
- y && /* @__PURE__ */ e("div", { ref: _, className: ce, style: K, onKeyDown: U, children: /* @__PURE__ */ c("div", { className: "p-2", role: "menu", children: [
1560
+ N && /* @__PURE__ */ e("div", { ref: E, className: ce, style: W, onKeyDown: U, children: /* @__PURE__ */ c("div", { className: "p-2", role: "menu", children: [
1561
1561
  m && (typeof m == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-text-muted uppercase tracking-label px-3 py-2", children: m }) : m),
1562
1562
  r.map((i, S) => {
1563
1563
  if (i.divider)
@@ -1568,23 +1568,23 @@ const Kt = ({
1568
1568
  },
1569
1569
  `divider-${S}`
1570
1570
  );
1571
- const N = i.children && i.children.length > 0, T = f === i.value;
1571
+ const y = i.children && i.children.length > 0, A = h === i.value;
1572
1572
  return /* @__PURE__ */ c("div", { className: "relative group", children: [
1573
1573
  /* @__PURE__ */ c(
1574
1574
  "button",
1575
1575
  {
1576
1576
  "data-option-value": i.value,
1577
1577
  role: "menuitem",
1578
- "aria-haspopup": N ? "menu" : void 0,
1579
- onClick: (k) => q(k, i),
1580
- onMouseEnter: () => W(i),
1578
+ "aria-haspopup": y ? "menu" : void 0,
1579
+ onClick: (w) => q(w, i),
1580
+ onMouseEnter: () => K(i),
1581
1581
  onMouseLeave: () => re(i),
1582
1582
  disabled: i.disabled,
1583
1583
  className: d(
1584
1584
  "flex w-full items-center justify-between rounded-md px-3 py-1.5 text-sm text-text transition-colors duration-fast ease-out hover:bg-surface-hover focus-visible:outline-none focus-visible:focus-ring",
1585
1585
  {
1586
1586
  "opacity-50 cursor-not-allowed": i.disabled,
1587
- "bg-surface-hover": T && N
1587
+ "bg-surface-hover": A && y
1588
1588
  }
1589
1589
  ),
1590
1590
  children: [
@@ -1597,30 +1597,30 @@ const Kt = ({
1597
1597
  ] }),
1598
1598
  /* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
1599
1599
  u && n === i.value && /* @__PURE__ */ e(Te, { className: "size-icon-md shrink-0 text-success-fg", "aria-hidden": !0 }),
1600
- N && /* @__PURE__ */ e("span", { className: "text-text-muted text-xs", children: "▶" })
1600
+ y && /* @__PURE__ */ e("span", { className: "text-text-muted text-xs", children: "▶" })
1601
1601
  ] })
1602
1602
  ]
1603
1603
  }
1604
1604
  ),
1605
- N && T && /* @__PURE__ */ e(
1605
+ y && A && /* @__PURE__ */ e(
1606
1606
  "div",
1607
1607
  {
1608
- ref: A,
1609
- className: C,
1608
+ ref: _,
1609
+ className: k,
1610
1610
  style: {
1611
1611
  top: `${p.top}px`,
1612
1612
  left: `${p.left}px`
1613
1613
  },
1614
1614
  onMouseEnter: () => {
1615
- $.current && (clearTimeout($.current), $.current = null), x(i.value);
1615
+ D.current && (clearTimeout(D.current), D.current = null), b(i.value);
1616
1616
  },
1617
1617
  onMouseLeave: () => {
1618
- $.current = setTimeout(() => {
1619
- x(null);
1618
+ D.current = setTimeout(() => {
1619
+ b(null);
1620
1620
  }, 150);
1621
1621
  },
1622
- children: /* @__PURE__ */ e("div", { className: "p-2", children: i.children.map((k, ee) => {
1623
- if (k.divider)
1622
+ children: /* @__PURE__ */ e("div", { className: "p-2", children: i.children.map((w, ee) => {
1623
+ if (w.divider)
1624
1624
  return /* @__PURE__ */ e(
1625
1625
  "div",
1626
1626
  {
@@ -1629,35 +1629,35 @@ const Kt = ({
1629
1629
  `divider-${ee}`
1630
1630
  );
1631
1631
  const ae = typeof n == "object" && n[i.value] && n[i.value].includes(
1632
- k.value
1633
- ) || n === k.value;
1632
+ w.value
1633
+ ) || n === w.value;
1634
1634
  return /* @__PURE__ */ c(
1635
1635
  "button",
1636
1636
  {
1637
1637
  onClick: (le) => P(
1638
1638
  le,
1639
- k,
1639
+ w,
1640
1640
  i.value
1641
1641
  ),
1642
- disabled: k.disabled,
1642
+ disabled: w.disabled,
1643
1643
  className: d(
1644
1644
  "flex w-full items-center justify-between rounded-md px-3 py-1.5 text-sm text-text transition-colors duration-fast ease-out hover:bg-surface-hover",
1645
1645
  {
1646
- "opacity-50 cursor-not-allowed": k.disabled
1646
+ "opacity-50 cursor-not-allowed": w.disabled
1647
1647
  }
1648
1648
  ),
1649
1649
  children: [
1650
1650
  /* @__PURE__ */ c("div", { className: "flex items-center space-x-2 min-w-0", children: [
1651
- k.icon && /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: k.icon }),
1651
+ w.icon && /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: w.icon }),
1652
1652
  /* @__PURE__ */ c("div", { className: "flex flex-col items-start min-w-0", children: [
1653
- /* @__PURE__ */ e("span", { className: "font-base truncate", children: k.label }),
1654
- k.description && /* @__PURE__ */ e("span", { className: "text-xs text-text-muted", children: k.description })
1653
+ /* @__PURE__ */ e("span", { className: "font-base truncate", children: w.label }),
1654
+ w.description && /* @__PURE__ */ e("span", { className: "text-xs text-text-muted", children: w.description })
1655
1655
  ] })
1656
1656
  ] }),
1657
1657
  u && ae && /* @__PURE__ */ e(Te, { className: "size-icon-md shrink-0 text-success-fg", "aria-hidden": !0 })
1658
1658
  ]
1659
1659
  },
1660
- k.value
1660
+ w.value
1661
1661
  );
1662
1662
  }) })
1663
1663
  }
@@ -1665,10 +1665,10 @@ const Kt = ({
1665
1665
  ] }, i.value);
1666
1666
  }),
1667
1667
  (() => {
1668
- const i = r.reduce((S, N) => {
1669
- if (N.divider) return S;
1670
- const T = N.children ? N.children.filter((k) => !k.divider).length : 0;
1671
- return S + 1 + T;
1668
+ const i = r.reduce((S, y) => {
1669
+ if (y.divider) return S;
1670
+ const A = y.children ? y.children.filter((w) => !w.divider).length : 0;
1671
+ return S + 1 + A;
1672
1672
  }, 0);
1673
1673
  return i > 1 && /* @__PURE__ */ e("div", { className: "border-t border-border mt-2 pt-2", children: /* @__PURE__ */ c("div", { className: "text-xs text-text-muted px-3 py-1", children: [
1674
1674
  i,
@@ -1746,28 +1746,28 @@ const Kt = ({
1746
1746
  paginated: l = !1,
1747
1747
  pageSizeOptions: u = [10, 25, 50, 100],
1748
1748
  defaultPageSize: m = 10,
1749
- actions: y = [],
1750
- onRowClick: h,
1751
- selectable: f = !1,
1752
- selectedRows: x = [],
1749
+ actions: N = [],
1750
+ onRowClick: f,
1751
+ selectable: h = !1,
1752
+ selectedRows: b = [],
1753
1753
  onSelectionChange: p,
1754
- getRowKey: w = (I, q) => q,
1754
+ getRowKey: C = (I, q) => q,
1755
1755
  emptyContent: g,
1756
- hoverable: b = !0,
1757
- bordered: A = !1,
1758
- striped: _ = !1,
1759
- padding: K = "md",
1760
- className: $,
1756
+ hoverable: x = !0,
1757
+ bordered: _ = !1,
1758
+ striped: E = !1,
1759
+ padding: W = "md",
1760
+ className: D,
1761
1761
  rowClassName: X,
1762
1762
  headerBackground: U = !0
1763
1763
  }) => {
1764
- const [I, q] = B(""), [W, re] = B({
1764
+ const [I, q] = R(""), [K, re] = R({
1765
1765
  column: null,
1766
1766
  direction: null
1767
- }), [P, ce] = B({
1767
+ }), [P, ce] = R({
1768
1768
  page: 0,
1769
1769
  pageSize: m
1770
- }), C = se(null), i = he(() => {
1770
+ }), k = se(null), i = he(() => {
1771
1771
  let v = t;
1772
1772
  if (s && I.trim()) {
1773
1773
  const V = r.filter(
@@ -1787,64 +1787,64 @@ const Kt = ({
1787
1787
  }));
1788
1788
  }), v;
1789
1789
  }, [t, I, r, s, o]), S = he(() => {
1790
- if (!W.column || !W.direction) return i;
1791
- const v = r.find((V) => V.id === W.column);
1790
+ if (!K.column || !K.direction) return i;
1791
+ const v = r.find((V) => V.id === K.column);
1792
1792
  return v ? [...i].sort((V, Z) => {
1793
1793
  const J = typeof v.accessor == "function" ? v.accessor(V) : V[v.accessor], O = typeof v.accessor == "function" ? v.accessor(Z) : Z[v.accessor];
1794
1794
  let ie = 0;
1795
- return J < O ? ie = -1 : J > O && (ie = 1), W.direction === "desc" ? -ie : ie;
1795
+ return J < O ? ie = -1 : J > O && (ie = 1), K.direction === "desc" ? -ie : ie;
1796
1796
  }) : i;
1797
- }, [i, W, r]), N = he(() => {
1797
+ }, [i, K, r]), y = he(() => {
1798
1798
  if (!l) return S;
1799
1799
  const v = P.page * P.pageSize, V = v + P.pageSize;
1800
1800
  return S.slice(v, V);
1801
- }, [S, P, l]), T = ue(
1801
+ }, [S, P, l]), A = ue(
1802
1802
  (v) => {
1803
1803
  r.find((Z) => Z.id === v)?.sortable && re((Z) => Z.column !== v ? { column: v, direction: "asc" } : Z.direction === "asc" ? { column: v, direction: "desc" } : { column: null, direction: null });
1804
1804
  },
1805
1805
  [r]
1806
- ), k = ue((v) => {
1806
+ ), w = ue((v) => {
1807
1807
  ce((V) => ({ ...V, page: v }));
1808
1808
  }, []), ee = ue((v) => {
1809
1809
  ce({ page: 0, pageSize: v });
1810
1810
  }, []), ae = ue(
1811
1811
  (v, V) => {
1812
1812
  if (!p) return;
1813
- const Z = w(v, 0);
1814
- x.map((J, O) => w(J, O)), p(V ? [...x, v] : x.filter(
1815
- (J, O) => w(x[O], O) !== Z
1813
+ const Z = C(v, 0);
1814
+ b.map((J, O) => C(J, O)), p(V ? [...b, v] : b.filter(
1815
+ (J, O) => C(b[O], O) !== Z
1816
1816
  ));
1817
1817
  },
1818
- [x, p, w]
1818
+ [b, p, C]
1819
1819
  ), le = ue(
1820
1820
  (v) => {
1821
- p && p(v ? [...N] : []);
1821
+ p && p(v ? [...y] : []);
1822
1822
  },
1823
- [N, p]
1823
+ [y, p]
1824
1824
  );
1825
1825
  Q(() => {
1826
1826
  ce((v) => ({ ...v, page: 0 }));
1827
- }, [I, W]), Q(() => {
1827
+ }, [I, K]), Q(() => {
1828
1828
  ce((v) => ({ ...v, page: 0 }));
1829
1829
  }, [o.map((v) => v.value).join(",")]);
1830
- const G = S.length, j = Math.ceil(G / P.pageSize), E = P.page * P.pageSize + 1, D = Math.min(E + P.pageSize - 1, G), z = N.length > 0 && N.every((v) => {
1831
- const V = w(v, 0);
1832
- return x.some(
1833
- (Z, J) => w(Z, J) === V
1830
+ const G = S.length, j = Math.ceil(G / P.pageSize), M = P.page * P.pageSize + 1, T = Math.min(M + P.pageSize - 1, G), z = y.length > 0 && y.every((v) => {
1831
+ const V = C(v, 0);
1832
+ return b.some(
1833
+ (Z, J) => C(Z, J) === V
1834
1834
  );
1835
- }), R = N.some((v) => {
1836
- const V = w(v, 0);
1837
- return x.some(
1838
- (Z, J) => w(Z, J) === V
1835
+ }), B = y.some((v) => {
1836
+ const V = C(v, 0);
1837
+ return b.some(
1838
+ (Z, J) => C(Z, J) === V
1839
1839
  );
1840
1840
  }), F = d(
1841
1841
  "w-full text-sm leading-5 text-text border-collapse",
1842
- $
1843
- ), H = U ? "bg-surface-sunk border-border border-t" : "bg-surface", M = d(H, "h-control-lg"), L = d(
1842
+ D
1843
+ ), H = U ? "bg-surface-sunk border-border border-t" : "bg-surface", $ = d(H, "h-control-lg"), L = d(
1844
1844
  "text-text border-b border-border p-2"
1845
1845
  ), te = d("h-row-lg", {
1846
- "hover:bg-surface-sunk": b,
1847
- "cursor-pointer": h
1846
+ "hover:bg-surface-sunk": x,
1847
+ "cursor-pointer": f
1848
1848
  });
1849
1849
  return /* @__PURE__ */ c("div", { className: "space-y-4", children: [
1850
1850
  (s || o.length > 0) && /* @__PURE__ */ e("div", { className: "px-4 pt-4 pb-2", children: /* @__PURE__ */ c("div", { className: "flex flex-wrap gap-4 items-start", children: [
@@ -1869,15 +1869,15 @@ const Kt = ({
1869
1869
  tableColumns: r.length
1870
1870
  }
1871
1871
  ) }),
1872
- /* @__PURE__ */ c("table", { ref: C, className: d(F, "min-w-full"), children: [
1873
- /* @__PURE__ */ e("thead", { className: M, children: /* @__PURE__ */ c("tr", { children: [
1874
- f && /* @__PURE__ */ e("th", { className: d(L, "w-12"), children: /* @__PURE__ */ e(
1872
+ /* @__PURE__ */ c("table", { ref: k, className: d(F, "min-w-full"), children: [
1873
+ /* @__PURE__ */ e("thead", { className: $, children: /* @__PURE__ */ c("tr", { children: [
1874
+ h && /* @__PURE__ */ e("th", { className: d(L, "w-12"), children: /* @__PURE__ */ e(
1875
1875
  "input",
1876
1876
  {
1877
1877
  type: "checkbox",
1878
1878
  checked: z,
1879
1879
  ref: (v) => {
1880
- v && (v.indeterminate = R && !z);
1880
+ v && (v.indeterminate = B && !z);
1881
1881
  },
1882
1882
  onChange: (v) => le(v.target.checked),
1883
1883
  className: "rounded border-border [&:not(:checked)]:bg-surface-input text-accent"
@@ -1898,11 +1898,11 @@ const Kt = ({
1898
1898
  [`sticky left-0 ${H}`]: v.sticky === "left",
1899
1899
  [`sticky right-0 ${H}`]: v.sticky === "right"
1900
1900
  },
1901
- V === 0 && Le[K],
1902
- V === r.length - 1 && Ie[K]
1901
+ V === 0 && Le[W],
1902
+ V === r.length - 1 && Ie[W]
1903
1903
  ),
1904
1904
  style: { width: v.width },
1905
- onClick: () => v.sortable && T(v.id),
1905
+ onClick: () => v.sortable && A(v.id),
1906
1906
  children: /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
1907
1907
  v.headerCell ? v.headerCell() : v.header,
1908
1908
  v.sortable && /* @__PURE__ */ c(
@@ -1910,19 +1910,19 @@ const Kt = ({
1910
1910
  {
1911
1911
  className: d(
1912
1912
  "flex flex-col opacity-0 group-hover:opacity-100 transition-opacity",
1913
- W.column === v.id && "opacity-100"
1913
+ K.column === v.id && "opacity-100"
1914
1914
  ),
1915
1915
  children: [
1916
1916
  /* @__PURE__ */ e(
1917
1917
  Jt,
1918
1918
  {
1919
- active: W.column === v.id && W.direction === "asc"
1919
+ active: K.column === v.id && K.direction === "asc"
1920
1920
  }
1921
1921
  ),
1922
1922
  /* @__PURE__ */ e(
1923
1923
  Yt,
1924
1924
  {
1925
- active: W.column === v.id && W.direction === "desc"
1925
+ active: K.column === v.id && K.direction === "desc"
1926
1926
  }
1927
1927
  )
1928
1928
  ]
@@ -1932,21 +1932,21 @@ const Kt = ({
1932
1932
  },
1933
1933
  v.id
1934
1934
  )),
1935
- y.length > 0 && /* @__PURE__ */ e("th", { className: d(L, "w-20"), children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Actions" }) })
1935
+ N.length > 0 && /* @__PURE__ */ e("th", { className: d(L, "w-20"), children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Actions" }) })
1936
1936
  ] }) }),
1937
- /* @__PURE__ */ e("tbody", { children: N.length === 0 || n ? !n && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
1937
+ /* @__PURE__ */ e("tbody", { children: y.length === 0 || n ? !n && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
1938
1938
  "td",
1939
1939
  {
1940
- colSpan: r.length + (f ? 1 : 0) + (y.length > 0 ? 1 : 0),
1940
+ colSpan: r.length + (h ? 1 : 0) + (N.length > 0 ? 1 : 0),
1941
1941
  className: d(
1942
1942
  L,
1943
1943
  "text-center py-8 text-text-muted"
1944
1944
  ),
1945
1945
  children: g || "No data available"
1946
1946
  }
1947
- ) }) : N.map((v, V) => {
1948
- const Z = w(v, V), J = x.some(
1949
- (O, ie) => w(O, ie) === Z
1947
+ ) }) : y.map((v, V) => {
1948
+ const Z = C(v, V), J = b.some(
1949
+ (O, ie) => C(O, ie) === Z
1950
1950
  );
1951
1951
  return /* @__PURE__ */ c(
1952
1952
  "tr",
@@ -1957,10 +1957,10 @@ const Kt = ({
1957
1957
  X?.(v, V)
1958
1958
  ),
1959
1959
  onClick: (O) => {
1960
- O.stopPropagation(), h?.(v, V);
1960
+ O.stopPropagation(), f?.(v, V);
1961
1961
  },
1962
1962
  children: [
1963
- f && /* @__PURE__ */ e("td", { className: L, children: /* @__PURE__ */ e(
1963
+ h && /* @__PURE__ */ e("td", { className: L, children: /* @__PURE__ */ e(
1964
1964
  "input",
1965
1965
  {
1966
1966
  type: "checkbox",
@@ -1985,29 +1985,29 @@ const Kt = ({
1985
1985
  "sticky left-0 bg-surface": O.sticky === "left",
1986
1986
  "sticky right-0 bg-surface": O.sticky === "right"
1987
1987
  },
1988
- ie === 0 && Le[K],
1989
- ie === r.length - 1 && Ie[K]
1988
+ ie === 0 && Le[W],
1989
+ ie === r.length - 1 && Ie[W]
1990
1990
  ),
1991
1991
  children: O.cell ? O.cell(ve, v, ie) : String(ve || "")
1992
1992
  },
1993
1993
  O.id
1994
1994
  );
1995
1995
  }),
1996
- y.length > 0 && /* @__PURE__ */ e("td", { className: L, children: /* @__PURE__ */ e(
1996
+ N.length > 0 && /* @__PURE__ */ e("td", { className: L, children: /* @__PURE__ */ e(
1997
1997
  Kt,
1998
1998
  {
1999
1999
  trigger: /* @__PURE__ */ c("div", { className: "inline-flex items-center gap-1 px-2 py-1 text-sm text-text-muted hover:text-text", children: [
2000
2000
  /* @__PURE__ */ e("span", { children: "Options" }),
2001
2001
  /* @__PURE__ */ e(He, {})
2002
2002
  ] }),
2003
- options: y.map((O) => ({
2003
+ options: N.map((O) => ({
2004
2004
  value: O.id,
2005
2005
  label: O.label,
2006
2006
  icon: O.icon,
2007
2007
  disabled: O.disabled?.(v)
2008
2008
  })),
2009
2009
  onSelect: (O) => {
2010
- const ie = y.find(
2010
+ const ie = N.find(
2011
2011
  (ve) => ve.id === O
2012
2012
  );
2013
2013
  ie && ie.onClick(v, V);
@@ -2026,9 +2026,9 @@ const Kt = ({
2026
2026
  /* @__PURE__ */ c("div", { className: "flex items-center gap-4", children: [
2027
2027
  /* @__PURE__ */ c("span", { className: "text-sm text-text-muted", children: [
2028
2028
  "Showing ",
2029
- E,
2029
+ M,
2030
2030
  " to ",
2031
- D,
2031
+ T,
2032
2032
  " of ",
2033
2033
  G,
2034
2034
  " results"
@@ -2052,7 +2052,7 @@ const Kt = ({
2052
2052
  {
2053
2053
  size: "sm",
2054
2054
  variant: "ghost",
2055
- onClick: () => k(0),
2055
+ onClick: () => w(0),
2056
2056
  disabled: P.page === 0,
2057
2057
  iconOnly: !0,
2058
2058
  children: /* @__PURE__ */ e(Qt, {})
@@ -2063,7 +2063,7 @@ const Kt = ({
2063
2063
  {
2064
2064
  size: "sm",
2065
2065
  variant: "ghost",
2066
- onClick: () => k(P.page - 1),
2066
+ onClick: () => w(P.page - 1),
2067
2067
  disabled: P.page === 0,
2068
2068
  iconOnly: !0,
2069
2069
  children: /* @__PURE__ */ e(Xt, {})
@@ -2080,7 +2080,7 @@ const Kt = ({
2080
2080
  {
2081
2081
  size: "sm",
2082
2082
  variant: "ghost",
2083
- onClick: () => k(P.page + 1),
2083
+ onClick: () => w(P.page + 1),
2084
2084
  disabled: P.page >= j - 1,
2085
2085
  iconOnly: !0,
2086
2086
  children: /* @__PURE__ */ e(Zt, {})
@@ -2091,7 +2091,7 @@ const Kt = ({
2091
2091
  {
2092
2092
  size: "sm",
2093
2093
  variant: "ghost",
2094
- onClick: () => k(j - 1),
2094
+ onClick: () => w(j - 1),
2095
2095
  disabled: P.page >= j - 1,
2096
2096
  iconOnly: !0,
2097
2097
  children: /* @__PURE__ */ e(er, {})
@@ -2106,7 +2106,7 @@ const Kt = ({
2106
2106
  onTabChange: n,
2107
2107
  className: s
2108
2108
  }) => {
2109
- const [a, o] = B(t[0]?.id || ""), l = r || a, u = (m) => {
2109
+ const [a, o] = R(t[0]?.id || ""), l = r || a, u = (m) => {
2110
2110
  n ? n(m) : o(m);
2111
2111
  };
2112
2112
  return /* @__PURE__ */ e("div", { className: d("border-b border-border", s), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: t.map((m) => /* @__PURE__ */ e(
@@ -2141,14 +2141,14 @@ const Kt = ({
2141
2141
  size: o = "md",
2142
2142
  className: l
2143
2143
  }) => {
2144
- const [u, m] = B(
2144
+ const [u, m] = R(
2145
2145
  r || n || t[0]?.id || ""
2146
- ), y = n || u, h = (g) => {
2146
+ ), N = n || u, f = (g) => {
2147
2147
  s ? s(g) : m(g);
2148
- }, f = {
2149
- activeTab: y,
2150
- setActiveTab: h
2151
- }, x = t.find((g) => g.id === y), p = d(
2148
+ }, h = {
2149
+ activeTab: N,
2150
+ setActiveTab: f
2151
+ }, b = t.find((g) => g.id === N), p = d(
2152
2152
  "flex",
2153
2153
  {
2154
2154
  "border-b border-border px-2": a === "default" || a === "underline",
@@ -2157,42 +2157,42 @@ const Kt = ({
2157
2157
  "space-x-8": a === "default" || a === "underline"
2158
2158
  },
2159
2159
  l
2160
- ), w = (g, b) => {
2161
- const A = "transition-colors duration-fast font-medium", _ = {
2160
+ ), C = (g, x) => {
2161
+ const _ = "transition-colors duration-fast font-medium", E = {
2162
2162
  "text-xs px-2 py-1": o === "sm",
2163
2163
  "text-sm px-3 py-2": o === "md",
2164
2164
  "text-base px-4 py-3": o === "lg"
2165
- }, K = {
2165
+ }, W = {
2166
2166
  // Default variant
2167
2167
  "border-b-2 -mb-px": a === "default",
2168
2168
  // Pills variant
2169
2169
  "rounded-md": a === "pills",
2170
2170
  // Underline variant
2171
2171
  "border-b-2 pb-2": a === "underline"
2172
- }, $ = {
2172
+ }, D = {
2173
2173
  "opacity-50 cursor-not-allowed": g.disabled,
2174
2174
  "cursor-pointer": !g.disabled
2175
- }, X = b ? {
2175
+ }, X = x ? {
2176
2176
  "border-accent-border text-text": a === "default" || a === "underline",
2177
2177
  "bg-surface text-text shadow-none": a === "pills"
2178
- } : {}, U = !b && !g.disabled ? {
2178
+ } : {}, U = !x && !g.disabled ? {
2179
2179
  "border-transparent text-text-muted hover:text-text": a === "default",
2180
2180
  "text-text-muted hover:text-text": a === "pills",
2181
2181
  "border-transparent text-text-muted hover:text-text hover:border-border": a === "underline"
2182
2182
  } : {};
2183
- return d(A, _, K, $, X, U);
2183
+ return d(_, E, W, D, X, U);
2184
2184
  };
2185
- return /* @__PURE__ */ e(rr.Provider, { value: f, children: /* @__PURE__ */ c("div", { children: [
2185
+ return /* @__PURE__ */ e(rr.Provider, { value: h, children: /* @__PURE__ */ c("div", { children: [
2186
2186
  /* @__PURE__ */ e("div", { className: p, role: "tablist", children: t.map((g) => /* @__PURE__ */ e(
2187
2187
  "button",
2188
2188
  {
2189
2189
  type: "button",
2190
2190
  role: "tab",
2191
- "aria-selected": y === g.id,
2191
+ "aria-selected": N === g.id,
2192
2192
  "aria-controls": `tabpanel-${g.id}`,
2193
2193
  disabled: g.disabled,
2194
- onClick: () => !g.disabled && h(g.id),
2195
- className: w(g, y === g.id),
2194
+ onClick: () => !g.disabled && f(g.id),
2195
+ className: C(g, N === g.id),
2196
2196
  children: /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: [
2197
2197
  g.label,
2198
2198
  g.badge && /* @__PURE__ */ e("span", { className: "inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-surface-hover text-text-muted", children: g.badge })
@@ -2200,14 +2200,14 @@ const Kt = ({
2200
2200
  },
2201
2201
  g.id
2202
2202
  )) }),
2203
- x?.content && /* @__PURE__ */ e(
2203
+ b?.content && /* @__PURE__ */ e(
2204
2204
  "div",
2205
2205
  {
2206
2206
  role: "tabpanel",
2207
- id: `tabpanel-${y}`,
2208
- "aria-labelledby": `tab-${y}`,
2207
+ id: `tabpanel-${N}`,
2208
+ "aria-labelledby": `tab-${N}`,
2209
2209
  className: "mt-4",
2210
- children: x.content
2210
+ children: b.content
2211
2211
  }
2212
2212
  )
2213
2213
  ] }) });
@@ -2228,21 +2228,21 @@ function Ve({
2228
2228
  className: l,
2229
2229
  backdropClassName: u,
2230
2230
  children: m,
2231
- footer: y,
2232
- showCloseButton: h = !0
2231
+ footer: N,
2232
+ showCloseButton: f = !0
2233
2233
  }) {
2234
- const f = se(null), x = se(null);
2234
+ const h = se(null), b = se(null);
2235
2235
  Q(() => {
2236
2236
  if (!t || !o) return;
2237
- const w = (g) => {
2237
+ const C = (g) => {
2238
2238
  g.key === "Escape" && r();
2239
2239
  };
2240
- return document.addEventListener("keydown", w), () => document.removeEventListener("keydown", w);
2241
- }, [t, o, r]), Q(() => (t ? (x.current = document.activeElement, f.current && f.current.focus(), document.body.style.overflow = "hidden") : (x.current && x.current.focus(), document.body.style.overflow = ""), () => {
2240
+ return document.addEventListener("keydown", C), () => document.removeEventListener("keydown", C);
2241
+ }, [t, o, r]), Q(() => (t ? (b.current = document.activeElement, h.current && h.current.focus(), document.body.style.overflow = "hidden") : (b.current && b.current.focus(), document.body.style.overflow = ""), () => {
2242
2242
  document.body.style.overflow = "";
2243
2243
  }), [t]);
2244
- const p = (w) => {
2245
- a && w.target === w.currentTarget && r();
2244
+ const p = (C) => {
2245
+ a && C.target === C.currentTarget && r();
2246
2246
  };
2247
2247
  return t ? /* @__PURE__ */ e(
2248
2248
  "div",
@@ -2257,7 +2257,7 @@ function Ve({
2257
2257
  children: /* @__PURE__ */ c(
2258
2258
  "div",
2259
2259
  {
2260
- ref: f,
2260
+ ref: h,
2261
2261
  className: d(
2262
2262
  "relative w-full bg-surface rounded-lg shadow-modal",
2263
2263
  // 'animate-scale-in',
@@ -2270,7 +2270,7 @@ function Ve({
2270
2270
  "aria-labelledby": n ? "modal-title" : void 0,
2271
2271
  tabIndex: -1,
2272
2272
  children: [
2273
- (n || h) && /* @__PURE__ */ c("div", { className: "flex items-center justify-between p-6 pb-0", children: [
2273
+ (n || f) && /* @__PURE__ */ c("div", { className: "flex items-center justify-between p-6 pb-0", children: [
2274
2274
  n && /* @__PURE__ */ e(
2275
2275
  "span",
2276
2276
  {
@@ -2279,7 +2279,7 @@ function Ve({
2279
2279
  children: n
2280
2280
  }
2281
2281
  ),
2282
- h && /* @__PURE__ */ e(
2282
+ f && /* @__PURE__ */ e(
2283
2283
  "button",
2284
2284
  {
2285
2285
  onClick: r,
@@ -2290,7 +2290,7 @@ function Ve({
2290
2290
  )
2291
2291
  ] }),
2292
2292
  /* @__PURE__ */ e("div", { className: "p-6", children: m }),
2293
- y && /* @__PURE__ */ e("div", { className: "px-6 py-4", children: y })
2293
+ N && /* @__PURE__ */ e("div", { className: "px-6 py-4", children: N })
2294
2294
  ]
2295
2295
  }
2296
2296
  )
@@ -2339,19 +2339,19 @@ const ar = {
2339
2339
  italic: l = !1,
2340
2340
  underline: u = !1,
2341
2341
  lineHeight: m = "normal",
2342
- as: y,
2343
- className: h,
2344
- children: f,
2345
- ...x
2342
+ as: N,
2343
+ className: f,
2344
+ children: h,
2345
+ ...b
2346
2346
  }) => {
2347
- const p = y || dr(t), w = t === "caption", g = t === "label", b = t === "code", A = d(
2347
+ const p = N || dr(t), C = t === "caption", g = t === "label", x = t === "code", _ = d(
2348
2348
  "font-sans",
2349
2349
  // Variant — caption and label pin their own size/weight
2350
- w && "text-xs text-text-subtle",
2350
+ C && "text-xs text-text-subtle",
2351
2351
  g && "text-xs font-semibold uppercase tracking-label text-text-subtle",
2352
- b && "font-mono text-sm rounded-sm bg-surface-hover px-1 py-0.5",
2352
+ x && "font-mono text-sm rounded-sm bg-surface-hover px-1 py-0.5",
2353
2353
  // Size — only where the variant does not pin it
2354
- !w && !g && !b && ar[r],
2354
+ !C && !g && !x && ar[r],
2355
2355
  // Weight — label owns its weight
2356
2356
  !g && lr[n],
2357
2357
  or[s],
@@ -2361,9 +2361,9 @@ const ar = {
2361
2361
  l && "italic",
2362
2362
  u && "underline",
2363
2363
  o && "truncate",
2364
- h
2364
+ f
2365
2365
  );
2366
- return /* @__PURE__ */ e(p, { className: A, ...x, children: f });
2366
+ return /* @__PURE__ */ e(p, { className: _, ...b, children: h });
2367
2367
  };
2368
2368
  function dr(t) {
2369
2369
  return {
@@ -2383,42 +2383,42 @@ const ur = ({
2383
2383
  accept: l,
2384
2384
  onListFiles: u,
2385
2385
  onListMounts: m,
2386
- onUploadFile: y,
2387
- onDownloadFile: h,
2388
- onRegisterFile: f
2386
+ onUploadFile: N,
2387
+ onDownloadFile: f,
2388
+ onRegisterFile: h
2389
2389
  }) => {
2390
- const [x, p] = B(!1), [w, g] = B([]), [b, A] = B(null), [_, K] = B("/"), [$, X] = B([]), [U, I] = B(!1), [q, W] = B(""), [re, P] = B(
2390
+ const [b, p] = R(!1), [C, g] = R([]), [x, _] = R(null), [E, W] = R("/"), [D, X] = R([]), [U, I] = R(!1), [q, K] = R(""), [re, P] = R(
2391
2391
  typeof t == "object" ? t : null
2392
- ), [ce, C] = B(!1), [i, S] = B(""), N = se(null);
2392
+ ), [ce, k] = R(!1), [i, S] = R(""), y = se(null);
2393
2393
  Q(() => {
2394
- x && T();
2395
- }, [x]), Q(() => {
2396
- x && b && k();
2397
- }, [x, b, _, q]);
2398
- const T = async () => {
2394
+ b && A();
2395
+ }, [b]), Q(() => {
2396
+ b && x && w();
2397
+ }, [b, x, E, q]);
2398
+ const A = async () => {
2399
2399
  I(!0);
2400
2400
  try {
2401
- const M = await m?.();
2402
- M?.data && g(M.data);
2403
- } catch (M) {
2404
- console.error("Failed to load mounts", M);
2401
+ const $ = await m?.();
2402
+ $?.data && g($.data);
2403
+ } catch ($) {
2404
+ console.error("Failed to load mounts", $);
2405
2405
  } finally {
2406
2406
  I(!1);
2407
2407
  }
2408
- }, k = async () => {
2409
- if (b) {
2408
+ }, w = async () => {
2409
+ if (x) {
2410
2410
  I(!0);
2411
2411
  try {
2412
- const M = await u?.({ mountId: b.id, name: q, path: _ });
2413
- M?.data && X(M.data);
2414
- } catch (M) {
2415
- console.error("Failed to load files", M);
2412
+ const $ = await u?.({ mountId: x.id, name: q, path: E });
2413
+ $?.data && X($.data);
2414
+ } catch ($) {
2415
+ console.error("Failed to load files", $);
2416
2416
  } finally {
2417
2417
  I(!1);
2418
2418
  }
2419
2419
  }
2420
- }, ee = async (M) => {
2421
- const L = M.target.files?.[0];
2420
+ }, ee = async ($) => {
2421
+ const L = $.target.files?.[0];
2422
2422
  if (L) {
2423
2423
  I(!0);
2424
2424
  try {
@@ -2440,17 +2440,17 @@ const ur = ({
2440
2440
  I(!1);
2441
2441
  }
2442
2442
  }
2443
- }, ae = async (M) => {
2444
- const L = M.target.files?.[0];
2445
- if (!(!L || !b)) {
2443
+ }, ae = async ($) => {
2444
+ const L = $.target.files?.[0];
2445
+ if (!(!L || !x)) {
2446
2446
  I(!0);
2447
2447
  try {
2448
- const te = await L.arrayBuffer(), v = await y?.({
2448
+ const te = await L.arrayBuffer(), v = await N?.({
2449
2449
  file: new Uint8Array(te),
2450
2450
  filename: L.name,
2451
2451
  mimeType: L.type || "application/octet-stream",
2452
- mountId: b.id,
2453
- path: _
2452
+ mountId: x.id,
2453
+ path: E
2454
2454
  });
2455
2455
  if (v?.data) {
2456
2456
  const V = v.data;
@@ -2463,74 +2463,74 @@ const ur = ({
2463
2463
  }
2464
2464
  }
2465
2465
  }, le = async () => {
2466
- if (!(!i || !b)) {
2466
+ if (!(!i || !x)) {
2467
2467
  I(!0);
2468
2468
  try {
2469
- const M = `${_}${i}/`;
2470
- f && (await f({
2469
+ const $ = `${E}${i}/`;
2470
+ h && (await h({
2471
2471
  name: i,
2472
2472
  type: "folder",
2473
- path: _,
2473
+ path: E,
2474
2474
  mimeType: "application/x-directory",
2475
2475
  size: 0,
2476
- mountId: b.id,
2477
- providerKey: M,
2476
+ mountId: x.id,
2477
+ providerKey: $,
2478
2478
  ownerId: "me"
2479
- }), await k()), C(!1), S("");
2480
- } catch (M) {
2481
- console.error("Failed to create folder", M);
2479
+ }), await w()), k(!1), S("");
2480
+ } catch ($) {
2481
+ console.error("Failed to create folder", $);
2482
2482
  } finally {
2483
2483
  I(!1);
2484
2484
  }
2485
2485
  }
2486
- }, G = async (M) => {
2486
+ }, G = async ($) => {
2487
2487
  I(!0);
2488
2488
  try {
2489
- const L = await h?.(M.id);
2490
- P(M), r(M, L), p(!1);
2489
+ const L = await f?.($.id);
2490
+ P($), r($, L), p(!1);
2491
2491
  } catch (L) {
2492
2492
  console.error("Failed to download file", L);
2493
2493
  } finally {
2494
2494
  I(!1);
2495
2495
  }
2496
- }, j = (M) => {
2497
- M.stopPropagation(), P(null), r(null);
2498
- }, E = he(() => {
2499
- const M = /* @__PURE__ */ new Set(), L = [];
2500
- return $.forEach((te) => {
2496
+ }, j = ($) => {
2497
+ $.stopPropagation(), P(null), r(null);
2498
+ }, M = he(() => {
2499
+ const $ = /* @__PURE__ */ new Set(), L = [];
2500
+ return D.forEach((te) => {
2501
2501
  if (te.type === "folder") {
2502
- te.path === _ && M.add(te.name);
2502
+ te.path === E && $.add(te.name);
2503
2503
  return;
2504
2504
  }
2505
- const v = te.providerKey || te.name, Z = (_ ? v.substring(_.length) : v).split("/").filter((J) => J !== "");
2506
- Z.length > 1 ? M.add(Z[0]) : Z.length === 1 && L.push(te);
2505
+ const v = te.providerKey || te.name, Z = (E ? v.substring(E.length) : v).split("/").filter((J) => J !== "");
2506
+ Z.length > 1 ? $.add(Z[0]) : Z.length === 1 && L.push(te);
2507
2507
  }), {
2508
- folders: Array.from(M).sort(),
2508
+ folders: Array.from($).sort(),
2509
2509
  files: L.sort((te, v) => te.name.localeCompare(v.name))
2510
2510
  };
2511
- }, [$, _]), D = (M) => {
2512
- K((L) => `${L}${M}/`);
2511
+ }, [D, E]), T = ($) => {
2512
+ W((L) => `${L}${$}/`);
2513
2513
  }, z = () => {
2514
- const M = _.split("/").filter((L) => L !== "");
2515
- M.pop(), M.length === 0 ? K("/") : K(`${M.join("/")}/`);
2516
- }, R = he(() => {
2517
- const M = E.folders.map((L) => ({
2514
+ const $ = E.split("/").filter((L) => L !== "");
2515
+ $.pop(), $.length === 0 ? W("/") : W(`${$.join("/")}/`);
2516
+ }, B = he(() => {
2517
+ const $ = M.folders.map((L) => ({
2518
2518
  id: `folder-${L}`,
2519
2519
  name: L,
2520
2520
  type: "folder"
2521
2521
  }));
2522
- return E.files.forEach((L) => {
2523
- M.push({
2522
+ return M.files.forEach((L) => {
2523
+ $.push({
2524
2524
  ...L,
2525
2525
  type: "file"
2526
2526
  });
2527
- }), M;
2528
- }, [E]), F = [
2527
+ }), $;
2528
+ }, [M]), F = [
2529
2529
  {
2530
2530
  id: "name",
2531
2531
  header: "Name",
2532
2532
  accessor: "name",
2533
- cell: (M, L) => /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
2533
+ cell: ($, L) => /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
2534
2534
  /* @__PURE__ */ e(
2535
2535
  Y,
2536
2536
  {
@@ -2539,31 +2539,31 @@ const ur = ({
2539
2539
  color: L.type === "folder" ? "warning" : "secondary"
2540
2540
  }
2541
2541
  ),
2542
- /* @__PURE__ */ e("span", { className: d(L.type === "folder" && "font-medium"), children: M })
2542
+ /* @__PURE__ */ e("span", { className: d(L.type === "folder" && "font-medium"), children: $ })
2543
2543
  ] })
2544
2544
  },
2545
2545
  {
2546
2546
  id: "type",
2547
2547
  header: "Type",
2548
- accessor: (M) => M.type === "folder" ? "Folder" : M.mimeType
2548
+ accessor: ($) => $.type === "folder" ? "Folder" : $.mimeType
2549
2549
  },
2550
2550
  {
2551
2551
  id: "size",
2552
2552
  header: "Size",
2553
- accessor: (M) => M.type === "file" ? `${(M.size / 1024).toFixed(1)} KB` : "-"
2553
+ accessor: ($) => $.type === "file" ? `${($.size / 1024).toFixed(1)} KB` : "-"
2554
2554
  },
2555
2555
  {
2556
2556
  id: "actions",
2557
2557
  header: "",
2558
2558
  accessor: "id",
2559
2559
  align: "right",
2560
- cell: (M, L) => /* @__PURE__ */ e(
2560
+ cell: ($, L) => /* @__PURE__ */ e(
2561
2561
  ne,
2562
2562
  {
2563
2563
  size: "sm",
2564
2564
  variant: "outline",
2565
2565
  onClick: (te) => {
2566
- te.stopPropagation(), L.type === "folder" ? D(L.name) : G(L);
2566
+ te.stopPropagation(), L.type === "folder" ? T(L.name) : G(L);
2567
2567
  },
2568
2568
  loading: U && L.type === "file" && re?.id === L.id,
2569
2569
  children: L.type === "folder" ? "Open" : "Select"
@@ -2575,9 +2575,9 @@ const ur = ({
2575
2575
  id: "name",
2576
2576
  header: "Mount Name",
2577
2577
  accessor: "name",
2578
- cell: (M) => /* @__PURE__ */ c("div", { className: "flex items-center gap-2 font-medium", children: [
2578
+ cell: ($) => /* @__PURE__ */ c("div", { className: "flex items-center gap-2 font-medium", children: [
2579
2579
  /* @__PURE__ */ e(Y, { icon: _e, size: "sm", color: "primary" }),
2580
- /* @__PURE__ */ e("span", { children: M })
2580
+ /* @__PURE__ */ e("span", { children: $ })
2581
2581
  ] })
2582
2582
  },
2583
2583
  {
@@ -2585,7 +2585,7 @@ const ur = ({
2585
2585
  header: "",
2586
2586
  accessor: "id",
2587
2587
  align: "right",
2588
- cell: (M, L) => /* @__PURE__ */ e(ne, { size: "sm", variant: "outline", onClick: () => A(L), children: "Open" })
2588
+ cell: ($, L) => /* @__PURE__ */ e(ne, { size: "sm", variant: "outline", onClick: () => _(L), children: "Open" })
2589
2589
  }
2590
2590
  ];
2591
2591
  return /* @__PURE__ */ c("div", { className: "space-y-1", children: [
@@ -2618,11 +2618,11 @@ const ur = ({
2618
2618
  /* @__PURE__ */ e(
2619
2619
  Ve,
2620
2620
  {
2621
- open: x,
2621
+ open: b,
2622
2622
  onClose: () => {
2623
- p(!1), A(null), K("/"), C(!1);
2623
+ p(!1), _(null), W("/"), k(!1);
2624
2624
  },
2625
- title: b ? `Explorer: ${b.name}` : "Select Storage Mount",
2625
+ title: x ? `Explorer: ${x.name}` : "Select Storage Mount",
2626
2626
  size: "lg",
2627
2627
  children: /* @__PURE__ */ e(
2628
2628
  nr,
@@ -2632,7 +2632,7 @@ const ur = ({
2632
2632
  {
2633
2633
  id: "remote",
2634
2634
  label: "Platform Storage",
2635
- content: /* @__PURE__ */ e("div", { className: "space-y-4", children: b ? /* @__PURE__ */ c(xe, { children: [
2635
+ content: /* @__PURE__ */ e("div", { className: "space-y-4", children: x ? /* @__PURE__ */ c(xe, { children: [
2636
2636
  /* @__PURE__ */ c("div", { className: "flex flex-wrap items-center gap-2", children: [
2637
2637
  /* @__PURE__ */ e(
2638
2638
  ne,
@@ -2640,19 +2640,19 @@ const ur = ({
2640
2640
  variant: "ghost",
2641
2641
  size: "sm",
2642
2642
  onClick: () => {
2643
- _ && _ !== "/" ? z() : A(null);
2643
+ E && E !== "/" ? z() : _(null);
2644
2644
  },
2645
2645
  leftIcon: /* @__PURE__ */ e(Y, { icon: st, size: "xs" }),
2646
- children: _ ? "Back" : "Back to Mounts"
2646
+ children: E ? "Back" : "Back to Mounts"
2647
2647
  }
2648
2648
  ),
2649
- /* @__PURE__ */ e("div", { className: "flex items-center gap-1 text-xs text-text-muted overflow-hidden bg-surface-hover px-2 py-1 rounded", children: /* @__PURE__ */ e("span", { className: "truncate", children: _ }) }),
2649
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-1 text-xs text-text-muted overflow-hidden bg-surface-hover px-2 py-1 rounded", children: /* @__PURE__ */ e("span", { className: "truncate", children: E }) }),
2650
2650
  /* @__PURE__ */ e("div", { className: "flex-grow min-w-40", children: /* @__PURE__ */ e(
2651
2651
  be,
2652
2652
  {
2653
2653
  placeholder: "Search...",
2654
2654
  value: q,
2655
- onChange: (M) => W(M.target.value),
2655
+ onChange: ($) => K($.target.value),
2656
2656
  startIcon: /* @__PURE__ */ e(Se, { size: 14 }),
2657
2657
  fullWidth: !0,
2658
2658
  size: "sm"
@@ -2664,7 +2664,7 @@ const ur = ({
2664
2664
  {
2665
2665
  variant: "outline",
2666
2666
  size: "sm",
2667
- onClick: () => C(!0),
2667
+ onClick: () => k(!0),
2668
2668
  leftIcon: /* @__PURE__ */ e(Y, { icon: at, size: "xs" }),
2669
2669
  children: "New Folder"
2670
2670
  }
@@ -2674,7 +2674,7 @@ const ur = ({
2674
2674
  {
2675
2675
  variant: "primary",
2676
2676
  size: "sm",
2677
- onClick: () => N.current?.click(),
2677
+ onClick: () => y.current?.click(),
2678
2678
  leftIcon: /* @__PURE__ */ e(Y, { icon: lt, size: "xs" }),
2679
2679
  loading: U,
2680
2680
  children: "Upload"
@@ -2685,7 +2685,7 @@ const ur = ({
2685
2685
  {
2686
2686
  type: "file",
2687
2687
  className: "hidden",
2688
- ref: N,
2688
+ ref: y,
2689
2689
  onChange: ae,
2690
2690
  accept: l
2691
2691
  }
@@ -2700,31 +2700,31 @@ const ur = ({
2700
2700
  size: "sm",
2701
2701
  placeholder: "Folder name",
2702
2702
  value: i,
2703
- onChange: (M) => S(M.target.value),
2703
+ onChange: ($) => S($.target.value),
2704
2704
  autoFocus: !0
2705
2705
  }
2706
2706
  ),
2707
2707
  /* @__PURE__ */ e(ne, { size: "sm", onClick: le, loading: U, children: "Create" }),
2708
- /* @__PURE__ */ e(ne, { size: "sm", variant: "ghost", onClick: () => C(!1), children: "Cancel" })
2708
+ /* @__PURE__ */ e(ne, { size: "sm", variant: "ghost", onClick: () => k(!1), children: "Cancel" })
2709
2709
  ] }),
2710
2710
  /* @__PURE__ */ e("div", { className: "max-h-100 overflow-auto rounded-lg border border-border", children: /* @__PURE__ */ e(
2711
2711
  je,
2712
2712
  {
2713
- data: R,
2713
+ data: B,
2714
2714
  columns: F,
2715
2715
  loading: U,
2716
2716
  emptyContent: "This folder is empty",
2717
- onRowClick: (M) => M.type === "folder" ? D(M.name) : G(M)
2717
+ onRowClick: ($) => $.type === "folder" ? T($.name) : G($)
2718
2718
  }
2719
2719
  ) })
2720
2720
  ] }) : /* @__PURE__ */ e("div", { className: "max-h-100 overflow-auto rounded-lg border border-border", children: /* @__PURE__ */ e(
2721
2721
  je,
2722
2722
  {
2723
- data: w,
2723
+ data: C,
2724
2724
  columns: H,
2725
2725
  loading: U,
2726
2726
  emptyContent: "No storage mounts configured",
2727
- onRowClick: (M) => A(M)
2727
+ onRowClick: ($) => _($)
2728
2728
  }
2729
2729
  ) }) })
2730
2730
  },
@@ -2776,18 +2776,18 @@ const ur = ({
2776
2776
  containerClassName: l,
2777
2777
  labelClassName: u,
2778
2778
  className: m,
2779
- id: y,
2780
- rows: h = 4,
2781
- ...f
2782
- }, x) => {
2783
- const p = oe.useId(), w = y || `textarea-${p}`, g = !!n, b = n || r ? `${w}-description` : void 0;
2779
+ id: N,
2780
+ rows: f = 4,
2781
+ ...h
2782
+ }, b) => {
2783
+ const p = oe.useId(), C = N || `textarea-${p}`, g = !!n, x = n || r ? `${C}-description` : void 0;
2784
2784
  return /* @__PURE__ */ c("div", { className: d("flex flex-col", a && "w-full", l), children: [
2785
2785
  t && /* @__PURE__ */ e(
2786
2786
  "label",
2787
2787
  {
2788
- htmlFor: w,
2788
+ htmlFor: C,
2789
2789
  className: d(
2790
- Re,
2790
+ Be,
2791
2791
  g ? "text-danger-fg" : "text-text-subtle",
2792
2792
  u
2793
2793
  ),
@@ -2798,11 +2798,11 @@ const ur = ({
2798
2798
  /* @__PURE__ */ e(
2799
2799
  "textarea",
2800
2800
  {
2801
- ref: x,
2802
- id: w,
2803
- rows: h,
2801
+ ref: b,
2802
+ id: C,
2803
+ rows: f,
2804
2804
  "aria-invalid": g || void 0,
2805
- "aria-describedby": b,
2805
+ "aria-describedby": x,
2806
2806
  className: d(
2807
2807
  "block w-full resize-y rounded-md border bg-surface-input text-text",
2808
2808
  "transition-colors duration-fast ease-out",
@@ -2813,7 +2813,7 @@ const ur = ({
2813
2813
  g ? "border-danger-border bg-danger-soft" : "border-border hover:border-border-strong",
2814
2814
  m
2815
2815
  ),
2816
- ...f
2816
+ ...h
2817
2817
  }
2818
2818
  ),
2819
2819
  o && /* @__PURE__ */ e(
@@ -2827,7 +2827,7 @@ const ur = ({
2827
2827
  (n || r) && /* @__PURE__ */ e(
2828
2828
  "p",
2829
2829
  {
2830
- id: b,
2830
+ id: x,
2831
2831
  className: d("mt-1 text-xs", g ? "text-danger-fg" : "text-text-subtle"),
2832
2832
  children: n || r
2833
2833
  }
@@ -2871,100 +2871,100 @@ const hn = ({
2871
2871
  validate: l,
2872
2872
  submitButton: u = { label: "Submit", variant: "primary" },
2873
2873
  cancelButton: m = { label: "Cancel", variant: "outline" },
2874
- showButtons: y = !0,
2875
- layout: h = "vertical",
2876
- size: f = "md",
2877
- loading: x = !1,
2874
+ showButtons: N = !0,
2875
+ layout: f = "vertical",
2876
+ size: h = "md",
2877
+ loading: b = !1,
2878
2878
  className: p,
2879
- ref: w,
2879
+ ref: C,
2880
2880
  sdk: g
2881
2881
  }) => {
2882
- const [b, A] = B(r || {}), [_, K] = B({}), [$, X] = B({});
2882
+ const [x, _] = R(r || {}), [E, W] = R({}), [D, X] = R({});
2883
2883
  Q(() => {
2884
- r && A({ ...r });
2884
+ r && _({ ...r });
2885
2885
  }, [r]);
2886
2886
  const U = ue(
2887
- (C, i, S) => {
2888
- const N = t.flatMap((T) => T.items).find((T) => T.name === C);
2889
- if (!N) return null;
2890
- if (N.required && (i == null || i === ""))
2891
- return `${N.label} is required`;
2892
- if (N.type === "array") {
2893
- if (N.required && (!i || i.length === 0))
2894
- return `${N.label} cannot be empty.`;
2887
+ (k, i, S) => {
2888
+ const y = t.flatMap((A) => A.items).find((A) => A.name === k);
2889
+ if (!y) return null;
2890
+ if (y.required && (i == null || i === ""))
2891
+ return `${y.label} is required`;
2892
+ if (y.type === "array") {
2893
+ if (y.required && (!i || i.length === 0))
2894
+ return `${y.label} cannot be empty.`;
2895
2895
  if (i && !Array.isArray(i))
2896
- return `${N.label} must be an array.`;
2897
- if (Array.isArray(i) && N.arrayFields) {
2898
- const T = [];
2899
- let k = !1;
2896
+ return `${y.label} must be an array.`;
2897
+ if (Array.isArray(i) && y.arrayFields) {
2898
+ const A = [];
2899
+ let w = !1;
2900
2900
  if (i.forEach((ee, ae) => {
2901
2901
  const le = {};
2902
- for (const G of N.arrayFields) {
2902
+ for (const G of y.arrayFields) {
2903
2903
  const j = ee?.[G.name];
2904
2904
  if (G.required && (j == null || j === ""))
2905
- le[G.name] = `${G.label} is required`, k = !0;
2905
+ le[G.name] = `${G.label} is required`, w = !0;
2906
2906
  else if (G.validator) {
2907
- const E = G.validator(j, ee);
2908
- E && (le[G.name] = E, k = !0);
2907
+ const M = G.validator(j, ee);
2908
+ M && (le[G.name] = M, w = !0);
2909
2909
  }
2910
2910
  }
2911
- T[ae] = le;
2912
- }), k)
2913
- return JSON.stringify(T);
2911
+ A[ae] = le;
2912
+ }), w)
2913
+ return JSON.stringify(A);
2914
2914
  }
2915
2915
  }
2916
- return N.validator ? N.validator(i, S) : null;
2916
+ return y.validator ? y.validator(i, S) : null;
2917
2917
  },
2918
2918
  [t]
2919
2919
  ), I = ue(
2920
- (C, i) => {
2920
+ (k, i) => {
2921
2921
  let S = fr(
2922
- b,
2923
- C,
2922
+ x,
2923
+ k,
2924
2924
  i
2925
2925
  );
2926
- t.flatMap((k) => k.items).find((k) => k.name === C)?.removeIfEmpty && (i == null || i === "") && (S = hr(S, C)), A(S), X((k) => ({ ...k, [C]: !0 }));
2927
- const T = U(C, i, S);
2928
- K((k) => ({
2929
- ...k,
2930
- [C]: T || ""
2931
- })), a?.(S, C);
2926
+ t.flatMap((w) => w.items).find((w) => w.name === k)?.removeIfEmpty && (i == null || i === "") && (S = hr(S, k)), _(S), X((w) => ({ ...w, [k]: !0 }));
2927
+ const A = U(k, i, S);
2928
+ W((w) => ({
2929
+ ...w,
2930
+ [k]: A || ""
2931
+ })), a?.(S, k);
2932
2932
  },
2933
- [b, t, U, a]
2933
+ [x, t, U, a]
2934
2934
  ), q = ue(
2935
- async (C) => {
2936
- if (C.preventDefault(), x) return;
2937
- const i = {}, S = t.flatMap((T) => T.items);
2938
- for (const T of S) {
2939
- if (T.hidden || T.conditional && !T.conditional(b))
2935
+ async (k) => {
2936
+ if (k.preventDefault(), b) return;
2937
+ const i = {}, S = t.flatMap((A) => A.items);
2938
+ for (const A of S) {
2939
+ if (A.hidden || A.conditional && !A.conditional(x))
2940
2940
  continue;
2941
- const k = U(
2942
- T.name,
2943
- Pe(b, T.name),
2944
- b
2941
+ const w = U(
2942
+ A.name,
2943
+ Pe(x, A.name),
2944
+ x
2945
2945
  );
2946
- k && (i[T.name] = k);
2946
+ w && (i[A.name] = w);
2947
2947
  }
2948
2948
  if (l) {
2949
- const T = l(b);
2950
- T && Object.assign(i, T);
2949
+ const A = l(x);
2950
+ A && Object.assign(i, A);
2951
2951
  }
2952
- if (K(i), Object.keys(i).some((T) => i[T]))
2952
+ if (W(i), Object.keys(i).some((A) => i[A]))
2953
2953
  return;
2954
- const N = o ? o(b) : b;
2955
- await n?.(b, N);
2954
+ const y = o ? o(x) : x;
2955
+ await n?.(x, y);
2956
2956
  },
2957
- [b, t, U, l, o, n, x]
2958
- ), W = ue(
2959
- (C) => {
2960
- const i = Pe(b, C.name), S = $[C.name] ? _[C.name] : void 0, N = C.disabled || x, T = {
2957
+ [x, t, U, l, o, n, b]
2958
+ ), K = ue(
2959
+ (k) => {
2960
+ const i = Pe(x, k.name), S = D[k.name] ? E[k.name] : void 0, y = k.disabled || b, A = {
2961
2961
  value: i || "",
2962
- disabled: N,
2963
- required: C.required,
2964
- placeholder: C.placeholder,
2965
- ...C.fieldProps
2962
+ disabled: y,
2963
+ required: k.required,
2964
+ placeholder: k.placeholder,
2965
+ ...k.fieldProps
2966
2966
  };
2967
- switch (C.type) {
2967
+ switch (k.type) {
2968
2968
  case "text":
2969
2969
  case "email":
2970
2970
  case "password":
@@ -2974,55 +2974,55 @@ const hn = ({
2974
2974
  return /* @__PURE__ */ e(
2975
2975
  be,
2976
2976
  {
2977
- ...T,
2978
- onChange: (k) => I(C.name, k.target.value),
2979
- type: C.textType || C.type,
2980
- autoComplete: C.autocomplete,
2977
+ ...A,
2978
+ onChange: (w) => I(k.name, w.target.value),
2979
+ type: k.textType || k.type,
2980
+ autoComplete: k.autocomplete,
2981
2981
  error: S,
2982
- size: f
2982
+ size: h
2983
2983
  }
2984
2984
  );
2985
2985
  case "textarea":
2986
2986
  return /* @__PURE__ */ e(
2987
2987
  De,
2988
2988
  {
2989
- ...T,
2990
- onChange: (k) => I(C.name, k.target.value),
2989
+ ...A,
2990
+ onChange: (w) => I(k.name, w.target.value),
2991
2991
  rows: 4,
2992
2992
  error: S,
2993
- size: f
2993
+ size: h
2994
2994
  }
2995
2995
  );
2996
2996
  case "select":
2997
2997
  return /* @__PURE__ */ e(
2998
2998
  Ne,
2999
2999
  {
3000
- ...T,
3001
- onChange: (k) => I(C.name, k),
3002
- options: (C.options || []).map((k) => ({
3003
- ...k,
3004
- value: String(k.value)
3000
+ ...A,
3001
+ onChange: (w) => I(k.name, w),
3002
+ options: (k.options || []).map((w) => ({
3003
+ ...w,
3004
+ value: String(w.value)
3005
3005
  })),
3006
- searchable: C.searchable,
3007
- multiple: C.multiple,
3008
- allowCreate: C.allowCreate,
3006
+ searchable: k.searchable,
3007
+ multiple: k.multiple,
3008
+ allowCreate: k.allowCreate,
3009
3009
  error: S,
3010
- size: f
3010
+ size: h
3011
3011
  }
3012
3012
  );
3013
3013
  case "checkbox":
3014
3014
  return /* @__PURE__ */ e(
3015
3015
  pe,
3016
3016
  {
3017
- ...T,
3018
- label: C.label,
3017
+ ...A,
3018
+ label: k.label,
3019
3019
  checked: !!i,
3020
- onChange: (k) => I(C.name, k.target.checked),
3021
- size: f
3020
+ onChange: (w) => I(k.name, w.target.checked),
3021
+ size: h
3022
3022
  }
3023
3023
  );
3024
3024
  case "radio":
3025
- return /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: C.options?.map((k) => /* @__PURE__ */ c(
3025
+ return /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: k.options?.map((w) => /* @__PURE__ */ c(
3026
3026
  "label",
3027
3027
  {
3028
3028
  className: "flex cursor-pointer items-center gap-3 text-base text-text",
@@ -3031,86 +3031,86 @@ const hn = ({
3031
3031
  "input",
3032
3032
  {
3033
3033
  type: "radio",
3034
- name: C.name,
3035
- value: k.value,
3036
- checked: i === k.value,
3037
- onChange: () => I(C.name, k.value),
3038
- disabled: N || k.disabled,
3034
+ name: k.name,
3035
+ value: w.value,
3036
+ checked: i === w.value,
3037
+ onChange: () => I(k.name, w.value),
3038
+ disabled: y || w.disabled,
3039
3039
  className: "size-checkbox shrink-0 border border-border-strong bg-surface-input accent-accent focus-visible:outline-none focus-visible:focus-ring"
3040
3040
  }
3041
3041
  ),
3042
- k.label
3042
+ w.label
3043
3043
  ]
3044
3044
  },
3045
- k.value
3045
+ w.value
3046
3046
  )) });
3047
3047
  case "date":
3048
3048
  return /* @__PURE__ */ e(
3049
3049
  $e,
3050
3050
  {
3051
- ...T,
3051
+ ...A,
3052
3052
  value: i ? new Date(i) : null,
3053
- onChange: (k) => I(C.name, k),
3054
- size: f
3053
+ onChange: (w) => I(k.name, w),
3054
+ size: h
3055
3055
  }
3056
3056
  );
3057
3057
  case "file":
3058
3058
  return /* @__PURE__ */ e(
3059
3059
  ur,
3060
3060
  {
3061
- ...T,
3061
+ ...A,
3062
3062
  value: i,
3063
- onChange: (k) => I(C.name, k),
3063
+ onChange: (w) => I(k.name, w),
3064
3064
  error: S,
3065
- onListFiles: (k) => g?.http.invoke({
3065
+ onListFiles: (w) => g?.http.invoke({
3066
3066
  method: "POST",
3067
3067
  action: "storage.file.list",
3068
- body: k
3068
+ body: w
3069
3069
  }),
3070
3070
  onListMounts: () => g?.http.invoke({
3071
3071
  method: "GET",
3072
3072
  action: "storage.mount"
3073
3073
  }),
3074
- onUploadFile: (k) => g?.http.invoke({
3074
+ onUploadFile: (w) => g?.http.invoke({
3075
3075
  method: "POST",
3076
3076
  action: "storage.file.upload",
3077
- body: k
3077
+ body: w
3078
3078
  }),
3079
- onDownloadFile: (k) => g?.http.invoke({
3079
+ onDownloadFile: (w) => g?.http.invoke({
3080
3080
  method: "GET",
3081
- action: `storage.file.${k}.download`
3081
+ action: `storage.file.${w}.download`
3082
3082
  }),
3083
- onRegisterFile: (k) => g?.http.invoke({
3083
+ onRegisterFile: (w) => g?.http.invoke({
3084
3084
  method: "POST",
3085
3085
  action: "storage.file.folder",
3086
- body: k
3086
+ body: w
3087
3087
  })
3088
3088
  }
3089
3089
  );
3090
3090
  case "folder":
3091
3091
  return /* @__PURE__ */ e(
3092
- Bt,
3092
+ Rt,
3093
3093
  {
3094
3094
  value: i || {},
3095
- onChange: (k) => I(C.name, k),
3095
+ onChange: (w) => I(k.name, w),
3096
3096
  onListFolders: () => g?.http.invoke({
3097
3097
  method: "GET",
3098
3098
  action: "storage.mount"
3099
3099
  }),
3100
- disabled: N,
3101
- size: f,
3102
- placeholder: C.placeholder
3100
+ disabled: y,
3101
+ size: h,
3102
+ placeholder: k.placeholder
3103
3103
  }
3104
3104
  );
3105
3105
  case "custom":
3106
- return C.customComponent?.({
3106
+ return k.customComponent?.({
3107
3107
  value: i,
3108
- onChange: (k) => I(C.name, k),
3108
+ onChange: (w) => I(k.name, w),
3109
3109
  error: S,
3110
- disabled: N
3110
+ disabled: y
3111
3111
  });
3112
3112
  case "array": {
3113
- const k = i || [];
3113
+ const w = i || [];
3114
3114
  let ee = [];
3115
3115
  if (typeof S == "string" && S.startsWith("["))
3116
3116
  try {
@@ -3118,41 +3118,41 @@ const hn = ({
3118
3118
  } catch {
3119
3119
  }
3120
3120
  const ae = () => {
3121
- I(C.name, [...k, {}]);
3121
+ I(k.name, [...w, {}]);
3122
3122
  }, le = (j) => {
3123
3123
  I(
3124
- C.name,
3125
- k.filter((E, D) => D !== j)
3124
+ k.name,
3125
+ w.filter((M, T) => T !== j)
3126
3126
  );
3127
- }, G = (j, E, D) => {
3128
- const z = [...k];
3127
+ }, G = (j, M, T) => {
3128
+ const z = [...w];
3129
3129
  z[j] = {
3130
3130
  ...z[j],
3131
- [E]: D
3132
- }, I(C.name, z);
3131
+ [M]: T
3132
+ }, I(k.name, z);
3133
3133
  };
3134
3134
  return /* @__PURE__ */ c("div", { className: "flex flex-col gap-2", children: [
3135
- k.map((j, E) => /* @__PURE__ */ c("div", { className: "flex items-start gap-2", children: [
3136
- /* @__PURE__ */ e("div", { className: "grid flex-1 gap-2 sm:grid-cols-2", children: C.arrayFields?.map((D) => {
3137
- const z = ee?.[E]?.[D.name];
3135
+ w.map((j, M) => /* @__PURE__ */ c("div", { className: "flex items-start gap-2", children: [
3136
+ /* @__PURE__ */ e("div", { className: "grid flex-1 gap-2 sm:grid-cols-2", children: k.arrayFields?.map((T) => {
3137
+ const z = ee?.[M]?.[T.name];
3138
3138
  return /* @__PURE__ */ c(
3139
3139
  "div",
3140
3140
  {
3141
3141
  className: "flex flex-col gap-1",
3142
3142
  children: [
3143
- E === 0 && /* @__PURE__ */ c("label", { className: "block text-xs font-semibold uppercase tracking-label text-text-subtle", children: [
3144
- D.label,
3145
- D.required && /* @__PURE__ */ e("span", { className: "ml-1 text-danger-fg", children: "*" })
3143
+ M === 0 && /* @__PURE__ */ c("label", { className: "block text-xs font-semibold uppercase tracking-label text-text-subtle", children: [
3144
+ T.label,
3145
+ T.required && /* @__PURE__ */ e("span", { className: "ml-1 text-danger-fg", children: "*" })
3146
3146
  ] }),
3147
3147
  (() => {
3148
- const R = {
3149
- value: j?.[D.name] || "",
3150
- disabled: N,
3151
- required: D.required,
3152
- placeholder: D.placeholder,
3153
- ...D.fieldProps
3148
+ const B = {
3149
+ value: j?.[T.name] || "",
3150
+ disabled: y,
3151
+ required: T.required,
3152
+ placeholder: T.placeholder,
3153
+ ...T.fieldProps
3154
3154
  };
3155
- switch (D.type) {
3155
+ switch (T.type) {
3156
3156
  case "text":
3157
3157
  case "email":
3158
3158
  case "password":
@@ -3162,72 +3162,72 @@ const hn = ({
3162
3162
  return /* @__PURE__ */ e(
3163
3163
  be,
3164
3164
  {
3165
- ...R,
3165
+ ...B,
3166
3166
  onChange: (F) => G(
3167
- E,
3168
- D.name,
3167
+ M,
3168
+ T.name,
3169
3169
  F.target.value
3170
3170
  ),
3171
- type: D.textType || D.type,
3172
- autoComplete: D.autocomplete,
3171
+ type: T.textType || T.type,
3172
+ autoComplete: T.autocomplete,
3173
3173
  error: z,
3174
- size: f
3174
+ size: h
3175
3175
  }
3176
3176
  );
3177
3177
  case "textarea":
3178
3178
  return /* @__PURE__ */ e(
3179
3179
  De,
3180
3180
  {
3181
- ...R,
3181
+ ...B,
3182
3182
  onChange: (F) => G(
3183
- E,
3184
- D.name,
3183
+ M,
3184
+ T.name,
3185
3185
  F.target.value
3186
3186
  ),
3187
3187
  rows: 4,
3188
3188
  error: z,
3189
- size: f
3189
+ size: h
3190
3190
  }
3191
3191
  );
3192
3192
  case "select":
3193
3193
  return /* @__PURE__ */ e(
3194
3194
  Ne,
3195
3195
  {
3196
- ...R,
3196
+ ...B,
3197
3197
  onChange: (F) => G(
3198
- E,
3199
- D.name,
3198
+ M,
3199
+ T.name,
3200
3200
  F
3201
3201
  ),
3202
- options: (D.options || []).map(
3202
+ options: (T.options || []).map(
3203
3203
  (F) => ({
3204
3204
  ...F,
3205
3205
  value: String(F.value)
3206
3206
  })
3207
3207
  ),
3208
- searchable: D.searchable,
3209
- multiple: D.multiple,
3210
- allowCreate: D.allowCreate,
3208
+ searchable: T.searchable,
3209
+ multiple: T.multiple,
3210
+ allowCreate: T.allowCreate,
3211
3211
  error: z,
3212
- size: f
3212
+ size: h
3213
3213
  }
3214
3214
  );
3215
3215
  case "checkbox":
3216
3216
  return /* @__PURE__ */ e(
3217
3217
  pe,
3218
3218
  {
3219
- ...R,
3220
- checked: !!j?.[D.name],
3219
+ ...B,
3220
+ checked: !!j?.[T.name],
3221
3221
  onChange: (F) => G(
3222
- E,
3223
- D.name,
3222
+ M,
3223
+ T.name,
3224
3224
  F.target.checked
3225
3225
  ),
3226
- size: f
3226
+ size: h
3227
3227
  }
3228
3228
  );
3229
3229
  case "radio":
3230
- return /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: D.options?.map((F) => /* @__PURE__ */ c(
3230
+ return /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: T.options?.map((F) => /* @__PURE__ */ c(
3231
3231
  "label",
3232
3232
  {
3233
3233
  className: "flex cursor-pointer items-center gap-2 text-base text-text",
@@ -3236,15 +3236,15 @@ const hn = ({
3236
3236
  "input",
3237
3237
  {
3238
3238
  type: "radio",
3239
- name: `${C.name}.${E}.${D.name}`,
3239
+ name: `${k.name}.${M}.${T.name}`,
3240
3240
  value: F.value,
3241
- checked: j?.[D.name] === F.value,
3241
+ checked: j?.[T.name] === F.value,
3242
3242
  onChange: () => G(
3243
- E,
3244
- D.name,
3243
+ M,
3244
+ T.name,
3245
3245
  F.value
3246
3246
  ),
3247
- disabled: N || F.disabled,
3247
+ disabled: y || F.disabled,
3248
3248
  className: "size-checkbox shrink-0 border border-border-strong bg-surface-input accent-accent focus-visible:outline-none focus-visible:focus-ring"
3249
3249
  }
3250
3250
  ),
@@ -3254,45 +3254,45 @@ const hn = ({
3254
3254
  F.value
3255
3255
  )) });
3256
3256
  case "date": {
3257
- const F = j?.[D.name];
3257
+ const F = j?.[T.name];
3258
3258
  return /* @__PURE__ */ e(
3259
3259
  $e,
3260
3260
  {
3261
- ...R,
3261
+ ...B,
3262
3262
  value: F ? new Date(F) : null,
3263
3263
  onChange: (H) => G(
3264
- E,
3265
- D.name,
3264
+ M,
3265
+ T.name,
3266
3266
  H
3267
3267
  ),
3268
- size: f
3268
+ size: h
3269
3269
  }
3270
3270
  );
3271
3271
  }
3272
3272
  case "custom":
3273
- return D.customComponent?.({
3274
- value: j?.[D.name],
3273
+ return T.customComponent?.({
3274
+ value: j?.[T.name],
3275
3275
  onChange: (F) => G(
3276
- E,
3277
- D.name,
3276
+ M,
3277
+ T.name,
3278
3278
  F
3279
3279
  ),
3280
3280
  error: z,
3281
- disabled: N
3281
+ disabled: y
3282
3282
  });
3283
3283
  // Add other field types here as needed
3284
3284
  default:
3285
3285
  return /* @__PURE__ */ c("p", { children: [
3286
3286
  "Unsupported field type in array:",
3287
3287
  " ",
3288
- D.type
3288
+ T.type
3289
3289
  ] });
3290
3290
  }
3291
3291
  })(),
3292
3292
  z && /* @__PURE__ */ e("p", { className: "text-xs text-danger-fg", children: z })
3293
3293
  ]
3294
3294
  },
3295
- D.name
3295
+ T.name
3296
3296
  );
3297
3297
  }) }),
3298
3298
  /* @__PURE__ */ e(
@@ -3302,14 +3302,14 @@ const hn = ({
3302
3302
  iconOnly: !0,
3303
3303
  variant: "ghost",
3304
3304
  size: "md",
3305
- "aria-label": `${C.label} verwijderen`,
3306
- onClick: () => le(E),
3307
- disabled: N,
3308
- className: d("shrink-0", E === 0 && "mt-5"),
3305
+ "aria-label": `${k.label} verwijderen`,
3306
+ onClick: () => le(M),
3307
+ disabled: y,
3308
+ className: d("shrink-0", M === 0 && "mt-5"),
3309
3309
  children: /* @__PURE__ */ e(ot, { className: "size-icon-md" })
3310
3310
  }
3311
3311
  )
3312
- ] }, E)),
3312
+ ] }, M)),
3313
3313
  /* @__PURE__ */ c(
3314
3314
  ne,
3315
3315
  {
@@ -3318,9 +3318,9 @@ const hn = ({
3318
3318
  size: "sm",
3319
3319
  leftIcon: /* @__PURE__ */ e(ct, { className: "size-icon-sm" }),
3320
3320
  onClick: ae,
3321
- disabled: N,
3321
+ disabled: y,
3322
3322
  children: [
3323
- C.label,
3323
+ k.label,
3324
3324
  " toevoegen"
3325
3325
  ]
3326
3326
  }
@@ -3331,22 +3331,22 @@ const hn = ({
3331
3331
  return null;
3332
3332
  }
3333
3333
  },
3334
- [b, $, _, x, f, I]
3334
+ [x, D, E, b, h, I]
3335
3335
  ), re = ue(
3336
- (C) => {
3337
- if (C.conditional && !C.conditional(b))
3336
+ (k) => {
3337
+ if (k.conditional && !k.conditional(x))
3338
3338
  return null;
3339
- const i = C.items.filter((N) => !(N.hidden || N.conditional && !N.conditional(b)));
3339
+ const i = k.items.filter((y) => !(y.hidden || y.conditional && !y.conditional(x)));
3340
3340
  if (i.length === 0) return null;
3341
3341
  const S = d(
3342
- C.layout === "flex" ? "flex flex-wrap gap-3" : "grid gap-3",
3343
- C.layout !== "flex" && {
3344
- "grid-cols-1": !C.columns || C.columns === 1,
3345
- "grid-cols-2": C.columns === 2,
3346
- "grid-cols-3": C.columns === 3,
3347
- "grid-cols-4": C.columns === 4
3342
+ k.layout === "flex" ? "flex flex-wrap gap-3" : "grid gap-3",
3343
+ k.layout !== "flex" && {
3344
+ "grid-cols-1": !k.columns || k.columns === 1,
3345
+ "grid-cols-2": k.columns === 2,
3346
+ "grid-cols-3": k.columns === 3,
3347
+ "grid-cols-4": k.columns === 4
3348
3348
  },
3349
- C.className
3349
+ k.className
3350
3350
  );
3351
3351
  return /* @__PURE__ */ c(
3352
3352
  "div",
@@ -3354,54 +3354,54 @@ const hn = ({
3354
3354
  className: "flex flex-col gap-4 px-5 py-4 not-first:border-t not-first:border-border-subtle sm:flex-row sm:gap-5",
3355
3355
  children: [
3356
3356
  /* @__PURE__ */ c("div", { className: "w-full shrink-0 sm:w-form-label", children: [
3357
- /* @__PURE__ */ e("span", { className: "text-sm font-semibold text-text", children: C.title }),
3358
- C.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs leading-4 text-text-subtle", children: C.description })
3357
+ /* @__PURE__ */ e("span", { className: "text-sm font-semibold text-text", children: k.title }),
3358
+ k.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs leading-4 text-text-subtle", children: k.description })
3359
3359
  ] }),
3360
- /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e("div", { className: S, children: i.map((N) => {
3361
- const T = $[N.name] ? _[N.name] : void 0;
3360
+ /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e("div", { className: S, children: i.map((y) => {
3361
+ const A = D[y.name] ? E[y.name] : void 0;
3362
3362
  return /* @__PURE__ */ c(
3363
3363
  "div",
3364
3364
  {
3365
3365
  className: d(
3366
3366
  "flex min-w-0 flex-col gap-1.5",
3367
- N.type === "checkbox" && "justify-center"
3367
+ y.type === "checkbox" && "justify-center"
3368
3368
  ),
3369
3369
  style: {
3370
- width: typeof N.width == "string" ? N.width : void 0,
3371
- gridColumn: typeof N.width == "number" ? `span ${N.width} / span ${N.width}` : void 0
3370
+ width: typeof y.width == "string" ? y.width : void 0,
3371
+ gridColumn: typeof y.width == "number" ? `span ${y.width} / span ${y.width}` : void 0
3372
3372
  },
3373
3373
  children: [
3374
- N.type !== "custom" && N.type !== "checkbox" && /* @__PURE__ */ c("label", { className: "block text-xs font-semibold uppercase tracking-label text-text-subtle", children: [
3375
- N.label,
3376
- N.required && /* @__PURE__ */ e("span", { className: "ml-1 text-danger-fg", children: "*" })
3374
+ y.type !== "custom" && y.type !== "checkbox" && /* @__PURE__ */ c("label", { className: "block text-xs font-semibold uppercase tracking-label text-text-subtle", children: [
3375
+ y.label,
3376
+ y.required && /* @__PURE__ */ e("span", { className: "ml-1 text-danger-fg", children: "*" })
3377
3377
  ] }),
3378
- W(N),
3379
- N.help && !T && /* @__PURE__ */ e("p", { className: "text-xs leading-4 text-text-subtle", children: N.help })
3378
+ K(y),
3379
+ y.help && !A && /* @__PURE__ */ e("p", { className: "text-xs leading-4 text-text-subtle", children: y.help })
3380
3380
  ]
3381
3381
  },
3382
- N.name
3382
+ y.name
3383
3383
  );
3384
3384
  }) }) })
3385
3385
  ]
3386
3386
  },
3387
- C.id
3387
+ k.id
3388
3388
  );
3389
3389
  },
3390
- [b, $, _, W]
3390
+ [x, D, E, K]
3391
3391
  ), P = d(
3392
3392
  "overflow-hidden rounded-lg border border-border bg-surface",
3393
3393
  {
3394
- "max-w-md": f === "sm",
3395
- "max-w-2xl": f === "md",
3396
- "max-w-4xl": f === "lg",
3397
- "max-w-full": f === "full"
3394
+ "max-w-md": h === "sm",
3395
+ "max-w-2xl": h === "md",
3396
+ "max-w-4xl": h === "lg",
3397
+ "max-w-full": h === "full"
3398
3398
  },
3399
3399
  p
3400
- ), ce = f === "full" ? "md" : f;
3401
- return /* @__PURE__ */ c("form", { ref: w, onSubmit: q, className: P, children: [
3402
- !y && /* @__PURE__ */ e("button", { type: "submit", className: "hidden", tabIndex: -1, "aria-hidden": !0 }),
3400
+ ), ce = h === "full" ? "md" : h;
3401
+ return /* @__PURE__ */ c("form", { ref: C, onSubmit: q, className: P, children: [
3402
+ !N && /* @__PURE__ */ e("button", { type: "submit", className: "hidden", tabIndex: -1, "aria-hidden": !0 }),
3403
3403
  /* @__PURE__ */ e("div", { className: "flex flex-col", children: t.map(re) }),
3404
- /* @__PURE__ */ e("div", { className: "flex items-center gap-2 border-t border-border-subtle bg-surface-sunk px-5 py-3", children: y && /* @__PURE__ */ c(xe, { children: [
3404
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-2 border-t border-border-subtle bg-surface-sunk px-5 py-3", children: N && /* @__PURE__ */ c(xe, { children: [
3405
3405
  /* @__PURE__ */ e("div", { className: "ml-auto" }),
3406
3406
  s && /* @__PURE__ */ e(
3407
3407
  ne,
@@ -3409,7 +3409,7 @@ const hn = ({
3409
3409
  type: "button",
3410
3410
  variant: m.variant ?? "ghost",
3411
3411
  size: m.size || ce,
3412
- disabled: m.disabled || x,
3412
+ disabled: m.disabled || b,
3413
3413
  onClick: s,
3414
3414
  className: m.className,
3415
3415
  children: m.label
@@ -3421,8 +3421,8 @@ const hn = ({
3421
3421
  type: "submit",
3422
3422
  variant: u.variant,
3423
3423
  size: u.size || ce,
3424
- disabled: u.disabled || x,
3425
- loading: x,
3424
+ disabled: u.disabled || b,
3425
+ loading: b,
3426
3426
  className: u.className,
3427
3427
  children: u.label
3428
3428
  }
@@ -3889,20 +3889,20 @@ const zn = ({
3889
3889
  showError: l = !0,
3890
3890
  fallback: u,
3891
3891
  loadingContent: m,
3892
- errorContent: y,
3893
- className: h,
3894
- onLoad: f,
3895
- onError: x,
3892
+ errorContent: N,
3893
+ className: f,
3894
+ onLoad: h,
3895
+ onError: b,
3896
3896
  ...p
3897
3897
  }) => {
3898
- const [w, g] = B(!0), [b, A] = B(!1), [_, K] = B(t), $ = (P) => {
3899
- g(!1), A(!1), f?.(P);
3898
+ const [C, g] = R(!0), [x, _] = R(!1), [E, W] = R(t), D = (P) => {
3899
+ g(!1), _(!1), h?.(P);
3900
3900
  }, X = (P) => {
3901
- if (g(!1), A(!0), u && _ !== u) {
3902
- K(u), A(!1), g(!0);
3901
+ if (g(!1), _(!0), u && E !== u) {
3902
+ W(u), _(!1), g(!0);
3903
3903
  return;
3904
3904
  }
3905
- x?.(P);
3905
+ b?.(P);
3906
3906
  }, U = d(
3907
3907
  "relative overflow-hidden bg-surface-hover",
3908
3908
  // Size variants
@@ -3930,17 +3930,17 @@ const zn = ({
3930
3930
  "rounded-xl": a === "xl",
3931
3931
  "rounded-full": a === "full"
3932
3932
  },
3933
- h
3933
+ f
3934
3934
  ), I = d(
3935
3935
  "w-full h-full object-cover transition-opacity duration-fast",
3936
3936
  {
3937
- "opacity-0": w || b,
3938
- "opacity-100": !w && !b
3937
+ "opacity-0": C || x,
3938
+ "opacity-100": !C && !x
3939
3939
  }
3940
3940
  ), q = d(
3941
3941
  "absolute inset-0 flex items-center justify-center",
3942
3942
  "text-text-muted"
3943
- ), W = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-surface-hover rounded" }) }), re = /* @__PURE__ */ c("div", { className: "text-center", children: [
3943
+ ), K = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-surface-hover rounded" }) }), re = /* @__PURE__ */ c("div", { className: "text-center", children: [
3944
3944
  /* @__PURE__ */ e(Y, { icon: dt, size: "lg", className: "mx-auto mb-1" }),
3945
3945
  /* @__PURE__ */ e("span", { className: "text-xs", children: "Failed to load" })
3946
3946
  ] });
@@ -3949,15 +3949,15 @@ const zn = ({
3949
3949
  "img",
3950
3950
  {
3951
3951
  ...p,
3952
- src: _,
3952
+ src: E,
3953
3953
  alt: r,
3954
3954
  className: I,
3955
- onLoad: $,
3955
+ onLoad: D,
3956
3956
  onError: X
3957
3957
  }
3958
3958
  ),
3959
- w && o && /* @__PURE__ */ e("div", { className: q, children: m || W }),
3960
- b && l && /* @__PURE__ */ e("div", { className: q, children: y || re })
3959
+ C && o && /* @__PURE__ */ e("div", { className: q, children: m || K }),
3960
+ x && l && /* @__PURE__ */ e("div", { className: q, children: N || re })
3961
3961
  ] });
3962
3962
  };
3963
3963
  function En({
@@ -3970,56 +3970,56 @@ function En({
3970
3970
  onSelect: l,
3971
3971
  onActiveIndexChange: u,
3972
3972
  isActive: m,
3973
- unread: y,
3974
- dimmed: h,
3975
- groupBy: f,
3976
- groups: x,
3973
+ unread: N,
3974
+ dimmed: f,
3975
+ groupBy: h,
3976
+ groups: b,
3977
3977
  renderGroupHeader: p,
3978
- stickyGroupHeaders: w = !1,
3978
+ stickyGroupHeaders: C = !1,
3979
3979
  collapsibleGroups: g = !1,
3980
- hideGroupCount: b = !1,
3981
- selectable: A = !1,
3982
- selectedItems: _ = [],
3983
- onSelectionChange: K,
3984
- bulkActions: $,
3980
+ hideGroupCount: x = !1,
3981
+ selectable: _ = !1,
3982
+ selectedItems: E = [],
3983
+ onSelectionChange: W,
3984
+ bulkActions: D,
3985
3985
  header: X,
3986
3986
  stickyHeader: U = !1,
3987
3987
  bordered: I = !1,
3988
3988
  emptyContent: q,
3989
- loading: W = !1,
3989
+ loading: K = !1,
3990
3990
  loadingRows: re = 4,
3991
3991
  className: P,
3992
3992
  "aria-label": ce
3993
3993
  }) {
3994
- const [C, i] = oe.useState(
3994
+ const [k, i] = oe.useState(
3995
3995
  () => Object.fromEntries(
3996
- (x ?? []).filter((z) => z.defaultCollapsed).map((z) => [z.id, !0])
3996
+ (b ?? []).filter((z) => z.defaultCollapsed).map((z) => [z.id, !0])
3997
3997
  )
3998
- ), S = oe.useRef(null), N = (z) => {
3998
+ ), S = oe.useRef(null), y = (z) => {
3999
3999
  if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(z.key)) return;
4000
4000
  const F = Array.from(
4001
4001
  S.current?.querySelectorAll("li[data-list-row]") ?? []
4002
4002
  );
4003
4003
  if (F.length === 0) return;
4004
4004
  z.preventDefault();
4005
- const H = F.indexOf(document.activeElement), M = z.key === "Home" ? 0 : z.key === "End" ? F.length - 1 : z.key === "ArrowDown" ? (H + 1) % F.length : (H - 1 + F.length) % F.length;
4006
- F[M]?.focus();
4007
- }, T = (z, R) => r ? r(z, R) : R, k = (z) => _.includes(z), ee = (z, R) => {
4008
- K && K(
4009
- R ? [..._, z] : _.filter((F) => F !== z)
4005
+ const H = F.indexOf(document.activeElement), $ = z.key === "Home" ? 0 : z.key === "End" ? F.length - 1 : z.key === "ArrowDown" ? (H + 1) % F.length : (H - 1 + F.length) % F.length;
4006
+ F[$]?.focus();
4007
+ }, A = (z, B) => r ? r(z, B) : B, w = (z) => E.includes(z), ee = (z, B) => {
4008
+ W && W(
4009
+ B ? [...E, z] : E.filter((F) => F !== z)
4010
4010
  );
4011
- }, ae = (z) => K?.(z ? [...t] : []), le = d(
4011
+ }, ae = (z) => W?.(z ? [...t] : []), le = d(
4012
4012
  "flex flex-col",
4013
4013
  I && "overflow-hidden rounded-lg border border-border-subtle",
4014
4014
  P
4015
4015
  );
4016
- if (W)
4017
- return /* @__PURE__ */ e("div", { className: le, children: Array.from({ length: re }).map((z, R) => /* @__PURE__ */ c(
4016
+ if (K)
4017
+ return /* @__PURE__ */ e("div", { className: le, children: Array.from({ length: re }).map((z, B) => /* @__PURE__ */ c(
4018
4018
  "div",
4019
4019
  {
4020
4020
  className: d(
4021
4021
  "flex animate-pulse items-center gap-3 px-4 py-2",
4022
- n === "divided" && R > 0 && "border-t border-border-subtle"
4022
+ n === "divided" && B > 0 && "border-t border-border-subtle"
4023
4023
  ),
4024
4024
  children: [
4025
4025
  /* @__PURE__ */ e("span", { className: "size-tile-sm shrink-0 rounded-md bg-surface-hover" }),
@@ -4028,12 +4028,12 @@ function En({
4028
4028
  /* @__PURE__ */ e("span", { className: "h-3 w-8 shrink-0 rounded-sm bg-surface-hover" })
4029
4029
  ]
4030
4030
  },
4031
- `skeleton-${R}`
4031
+ `skeleton-${B}`
4032
4032
  )) });
4033
4033
  if (t.length === 0 && q)
4034
4034
  return /* @__PURE__ */ e("div", { className: le, children: q });
4035
- const G = t.length > 0 && _.length === t.length, j = _.length > 0 && !G, E = (z, R, F) => {
4036
- const H = m?.(z, R) ?? !1, M = y?.(z, R) ?? !1, L = h?.(z, R) ?? !1, te = A && k(z);
4035
+ const G = t.length > 0 && E.length === t.length, j = E.length > 0 && !G, M = (z, B, F) => {
4036
+ const H = m?.(z, B) ?? !1, $ = N?.(z, B) ?? !1, L = f?.(z, B) ?? !1, te = _ && w(z);
4037
4037
  return /* @__PURE__ */ c(
4038
4038
  "li",
4039
4039
  {
@@ -4042,10 +4042,10 @@ function En({
4042
4042
  tabIndex: 0,
4043
4043
  "data-list-row": "",
4044
4044
  "aria-current": H || void 0,
4045
- onClick: () => l(z, R),
4046
- onFocus: () => u?.(R),
4045
+ onClick: () => l(z, B),
4046
+ onFocus: () => u?.(B),
4047
4047
  onKeyDown: (v) => {
4048
- v.key !== "Enter" && v.key !== " " || (v.preventDefault(), l(z, R));
4048
+ v.key !== "Enter" && v.key !== " " || (v.preventDefault(), l(z, B));
4049
4049
  }
4050
4050
  } : {},
4051
4051
  className: d(
@@ -4054,14 +4054,14 @@ function En({
4054
4054
  n === "divided" && !F && "border-t border-border-subtle",
4055
4055
  l && "cursor-pointer focus-visible:outline-none focus-visible:focus-ring",
4056
4056
  H || te ? "bg-accent-soft text-text" : l && "hover:bg-surface-hover",
4057
- M && "font-bold",
4057
+ $ && "font-bold",
4058
4058
  L && "opacity-55"
4059
4059
  ),
4060
4060
  children: [
4061
- A && /* @__PURE__ */ e("span", { onClick: (v) => v.stopPropagation(), children: /* @__PURE__ */ e(
4061
+ _ && /* @__PURE__ */ e("span", { onClick: (v) => v.stopPropagation(), children: /* @__PURE__ */ e(
4062
4062
  pe,
4063
4063
  {
4064
- checked: k(z),
4064
+ checked: w(z),
4065
4065
  onChange: (v) => ee(z, v.target.checked),
4066
4066
  "aria-label": "Rij selecteren"
4067
4067
  }
@@ -4073,27 +4073,27 @@ function En({
4073
4073
  className: "mt-2 size-1.5 shrink-0 self-start rounded-full bg-border-strong"
4074
4074
  }
4075
4075
  ),
4076
- s && /* @__PURE__ */ e("span", { className: "shrink-0", children: s(z, R) }),
4077
- /* @__PURE__ */ e("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: a ? a(z, R) : String(z) }),
4078
- o && /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-text-subtle", children: o(z, R) })
4076
+ s && /* @__PURE__ */ e("span", { className: "shrink-0", children: s(z, B) }),
4077
+ /* @__PURE__ */ e("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: a ? a(z, B) : String(z) }),
4078
+ o && /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-text-subtle", children: o(z, B) })
4079
4079
  ]
4080
4080
  },
4081
- T(z, R)
4081
+ A(z, B)
4082
4082
  );
4083
- }, D = (() => {
4084
- if (!f)
4085
- return t.map((H, M) => E(H, M, M === 0));
4083
+ }, T = (() => {
4084
+ if (!h)
4085
+ return t.map((H, $) => M(H, $, $ === 0));
4086
4086
  const z = /* @__PURE__ */ new Map();
4087
- t.forEach((H, M) => {
4088
- const L = f(H, M);
4089
- z.has(L) || z.set(L, []), z.get(L).push({ item: H, index: M });
4087
+ t.forEach((H, $) => {
4088
+ const L = h(H, $);
4089
+ z.has(L) || z.set(L, []), z.get(L).push({ item: H, index: $ });
4090
4090
  });
4091
- const R = x ?? [];
4091
+ const B = b ?? [];
4092
4092
  return [
4093
- ...R.filter((H) => z.has(H.id)),
4094
- ...[...z.keys()].filter((H) => !R.some((M) => M.id === H)).map((H) => ({ id: H }))
4095
- ].flatMap((H, M) => {
4096
- const L = z.get(H.id) ?? [], te = g && C[H.id], v = H.title ?? H.id, V = H.count ?? L.length, Z = /* @__PURE__ */ e(
4093
+ ...B.filter((H) => z.has(H.id)),
4094
+ ...[...z.keys()].filter((H) => !B.some(($) => $.id === H)).map((H) => ({ id: H }))
4095
+ ].flatMap((H, $) => {
4096
+ const L = z.get(H.id) ?? [], te = g && k[H.id], v = H.title ?? H.id, V = H.count ?? L.length, Z = /* @__PURE__ */ e(
4097
4097
  "li",
4098
4098
  {
4099
4099
  onClick: g ? () => i((J) => ({ ...J, [H.id]: !J[H.id] })) : void 0,
@@ -4101,13 +4101,13 @@ function En({
4101
4101
  "flex items-center gap-2 bg-surface-sunk px-4 py-1.5",
4102
4102
  "text-xs font-semibold uppercase tracking-label text-text-subtle",
4103
4103
  "border-border-subtle",
4104
- M > 0 && "border-t",
4104
+ $ > 0 && "border-t",
4105
4105
  "border-b",
4106
- w && "sticky z-10",
4106
+ C && "sticky z-10",
4107
4107
  g && "cursor-pointer select-none hover:text-text"
4108
4108
  ),
4109
4109
  "aria-expanded": g ? !te : void 0,
4110
- style: w ? { top: U ? 28 : 0 } : void 0,
4110
+ style: C ? { top: U ? 28 : 0 } : void 0,
4111
4111
  children: p ? p(H, L.map((J) => J.item)) : /* @__PURE__ */ c(xe, { children: [
4112
4112
  g && /* @__PURE__ */ e(
4113
4113
  Ce,
@@ -4120,7 +4120,7 @@ function En({
4120
4120
  }
4121
4121
  ),
4122
4122
  /* @__PURE__ */ e("span", { children: v }),
4123
- !b && /* @__PURE__ */ e("span", { className: "ml-auto font-normal tabular-nums", children: V })
4123
+ !x && /* @__PURE__ */ e("span", { className: "ml-auto font-normal tabular-nums", children: V })
4124
4124
  ] })
4125
4125
  },
4126
4126
  `group-${H.id}`
@@ -4128,13 +4128,13 @@ function En({
4128
4128
  return te ? [Z] : [
4129
4129
  Z,
4130
4130
  ...L.map(
4131
- ({ item: J, index: O }, ie) => E(J, O, ie === 0)
4131
+ ({ item: J, index: O }, ie) => M(J, O, ie === 0)
4132
4132
  )
4133
4133
  ];
4134
4134
  });
4135
4135
  })();
4136
- return /* @__PURE__ */ c("div", { ref: S, className: le, onKeyDown: l ? N : void 0, children: [
4137
- A && _.length > 0 && /* @__PURE__ */ c("div", { className: "flex items-center gap-3 border-b border-border-subtle bg-surface-sunk px-4 py-2", children: [
4136
+ return /* @__PURE__ */ c("div", { ref: S, className: le, onKeyDown: l ? y : void 0, children: [
4137
+ _ && E.length > 0 && /* @__PURE__ */ c("div", { className: "flex items-center gap-3 border-b border-border-subtle bg-surface-sunk px-4 py-2", children: [
4138
4138
  /* @__PURE__ */ e(
4139
4139
  pe,
4140
4140
  {
@@ -4145,10 +4145,10 @@ function En({
4145
4145
  }
4146
4146
  ),
4147
4147
  /* @__PURE__ */ c("span", { className: "text-xs text-text-subtle", children: [
4148
- _.length,
4148
+ E.length,
4149
4149
  " geselecteerd"
4150
4150
  ] }),
4151
- $ && /* @__PURE__ */ e("div", { className: "ml-auto flex gap-2", children: $ })
4151
+ D && /* @__PURE__ */ e("div", { className: "ml-auto flex gap-2", children: D })
4152
4152
  ] }),
4153
4153
  X && /* @__PURE__ */ e(
4154
4154
  "div",
@@ -4161,7 +4161,7 @@ function En({
4161
4161
  children: X
4162
4162
  }
4163
4163
  ),
4164
- /* @__PURE__ */ e("ul", { "aria-label": ce, className: "flex flex-col", children: D })
4164
+ /* @__PURE__ */ e("ul", { "aria-label": ce, className: "flex flex-col", children: T })
4165
4165
  ] });
4166
4166
  }
4167
4167
  function Mn({
@@ -4215,22 +4215,22 @@ const Dn = ({
4215
4215
  className: l,
4216
4216
  backLabel: u = "Back",
4217
4217
  backClassName: m,
4218
- onBack: y,
4219
- editable: h = !1,
4220
- onTitleChange: f
4218
+ onBack: N,
4219
+ editable: f = !1,
4220
+ onTitleChange: h
4221
4221
  }) => {
4222
- const [x, p] = B(!1), [w, g] = B(r), b = se(null);
4222
+ const [b, p] = R(!1), [C, g] = R(r), x = se(null);
4223
4223
  Q(() => {
4224
4224
  g(r);
4225
4225
  }, [r]), Q(() => {
4226
- x && b.current && (b.current.focus(), b.current.select());
4227
- }, [x]);
4228
- const A = () => {
4229
- h && p(!0);
4230
- }, _ = () => {
4231
- p(!1), w.trim() !== "" && w !== r && f ? f(w.trim()) : g(r);
4232
- }, K = ($) => {
4233
- $.key === "Enter" ? b.current?.blur() : $.key === "Escape" && (g(r), p(!1));
4226
+ b && x.current && (x.current.focus(), x.current.select());
4227
+ }, [b]);
4228
+ const _ = () => {
4229
+ f && p(!0);
4230
+ }, E = () => {
4231
+ p(!1), C.trim() !== "" && C !== r && h ? h(C.trim()) : g(r);
4232
+ }, W = (D) => {
4233
+ D.key === "Enter" ? x.current?.blur() : D.key === "Escape" && (g(r), p(!1));
4234
4234
  };
4235
4235
  return /* @__PURE__ */ c(
4236
4236
  "div",
@@ -4244,38 +4244,38 @@ const Dn = ({
4244
4244
  children: [
4245
4245
  /* @__PURE__ */ c("div", { className: "flex flex-row sm:items-start sm:justify-between items-center gap-4", children: [
4246
4246
  /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ c("div", { className: "flex items-start gap-4 text-text", children: [
4247
- y && /* @__PURE__ */ e(ne, { variant: "outline", onClick: y, leftIcon: /* @__PURE__ */ e(Y, { icon: ke, size: "sm" }), iconOnly: !0 }),
4247
+ N && /* @__PURE__ */ e(ne, { variant: "outline", onClick: N, leftIcon: /* @__PURE__ */ e(Y, { icon: ke, size: "sm" }), iconOnly: !0 }),
4248
4248
  /* @__PURE__ */ c("div", { className: "min-w-0 flex-1", children: [
4249
- x ? /* @__PURE__ */ e(
4249
+ b ? /* @__PURE__ */ e(
4250
4250
  "input",
4251
4251
  {
4252
- ref: b,
4252
+ ref: x,
4253
4253
  type: "text",
4254
- value: w,
4255
- onChange: ($) => g($.target.value),
4256
- onBlur: _,
4257
- onKeyDown: K,
4254
+ value: C,
4255
+ onChange: (D) => g(D.target.value),
4256
+ onBlur: E,
4257
+ onKeyDown: W,
4258
4258
  className: "text-1xl font-semibold bg-transparent border-b-1 border-border rounded-lg outline-none focus:border-none px-1 -mx-1 min-w-0 w-full"
4259
4259
  }
4260
4260
  ) : /* @__PURE__ */ c("div", { className: "group flex items-baseline gap-2.5 min-w-0", children: [
4261
4261
  /* @__PURE__ */ e(
4262
4262
  "h2",
4263
4263
  {
4264
- onClick: A,
4264
+ onClick: _,
4265
4265
  className: d(
4266
4266
  "text-xl font-semibold truncate",
4267
- h && "cursor-pointer"
4267
+ f && "cursor-pointer"
4268
4268
  ),
4269
- title: h ? "Click to edit" : void 0,
4269
+ title: f ? "Click to edit" : void 0,
4270
4270
  children: r
4271
4271
  }
4272
4272
  ),
4273
4273
  n && /* @__PURE__ */ e("span", { className: "shrink-0 text-base text-text-muted truncate", children: n }),
4274
- h && /* @__PURE__ */ e(
4274
+ f && /* @__PURE__ */ e(
4275
4275
  ut,
4276
4276
  {
4277
4277
  size: 15,
4278
- onClick: A,
4278
+ onClick: _,
4279
4279
  className: "shrink-0 cursor-pointer text-text-muted opacity-0 group-hover:opacity-100 transition-opacity"
4280
4280
  }
4281
4281
  )
@@ -4284,29 +4284,29 @@ const Dn = ({
4284
4284
  ] })
4285
4285
  ] }) }),
4286
4286
  a.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap sm:flex-nowrap gap-2 sm:gap-3", children: a.map(
4287
- ($) => $.render ? /* @__PURE__ */ e(oe.Fragment, { children: $.render() }, $.id) : $.splitOptions && $.splitOptions.length > 0 ? /* @__PURE__ */ e(
4288
- Be,
4287
+ (D) => D.render ? /* @__PURE__ */ e(oe.Fragment, { children: D.render() }, D.id) : D.splitOptions && D.splitOptions.length > 0 ? /* @__PURE__ */ e(
4288
+ Re,
4289
4289
  {
4290
- label: $.label,
4291
- onClick: $.onClick,
4292
- icon: $.icon,
4293
- variant: $.variant === "primary" ? "primary" : "outline",
4294
- options: $.splitOptions,
4295
- disabled: $.disabled
4290
+ label: D.label,
4291
+ onClick: D.onClick,
4292
+ icon: D.icon,
4293
+ variant: D.variant === "primary" ? "primary" : "outline",
4294
+ options: D.splitOptions,
4295
+ disabled: D.disabled
4296
4296
  },
4297
- $.id
4297
+ D.id
4298
4298
  ) : /* @__PURE__ */ e(
4299
4299
  ne,
4300
4300
  {
4301
- variant: $.variant ?? "secondary",
4301
+ variant: D.variant ?? "secondary",
4302
4302
  onClick: (X) => {
4303
- X.stopPropagation(), X.target.blur(), $.onClick();
4303
+ X.stopPropagation(), X.target.blur(), D.onClick();
4304
4304
  },
4305
- disabled: $.disabled,
4306
- leftIcon: $.icon,
4307
- children: $.label
4305
+ disabled: D.disabled,
4306
+ leftIcon: D.icon,
4307
+ children: D.label
4308
4308
  },
4309
- $.id
4309
+ D.id
4310
4310
  )
4311
4311
  ) })
4312
4312
  ] }),
@@ -4331,7 +4331,7 @@ const Dn = ({
4331
4331
  o && /* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: o }),
4332
4332
  t.length > 0 && /* @__PURE__ */ e("div", { className: d("flex flex-wrap gap-4", !o && "ml-auto"), children: t.map(
4333
4333
  (l) => l.splitOptions && l.splitOptions.length > 0 ? /* @__PURE__ */ e(
4334
- Be,
4334
+ Re,
4335
4335
  {
4336
4336
  label: l.label,
4337
4337
  onClick: l.onClick,
@@ -4490,26 +4490,26 @@ const Pn = ({
4490
4490
  size: n = "md",
4491
4491
  className: s
4492
4492
  }) => {
4493
- const a = (h) => {
4494
- if (!h) return "-";
4493
+ const a = (f) => {
4494
+ if (!f) return "-";
4495
4495
  try {
4496
- return new Date(h).toLocaleDateString("nl-NL", {
4496
+ return new Date(f).toLocaleDateString("nl-NL", {
4497
4497
  year: "numeric",
4498
4498
  month: "long",
4499
4499
  day: "numeric"
4500
4500
  });
4501
4501
  } catch {
4502
- return String(h);
4502
+ return String(f);
4503
4503
  }
4504
- }, o = (h) => h ? "Ja" : "Nee", l = (h, f) => {
4505
- if (!f) return String(h || "-");
4506
- const x = f.find((p) => p.value === h);
4507
- return x ? x.label : String(h || "-");
4504
+ }, o = (f) => f ? "Ja" : "Nee", l = (f, h) => {
4505
+ if (!h) return String(f || "-");
4506
+ const b = h.find((p) => p.value === f);
4507
+ return b ? b.label : String(f || "-");
4508
4508
  }, u = ue(
4509
- (h) => {
4510
- const f = Ir(r, h.name);
4511
- if (h.type === "array") {
4512
- const p = f;
4509
+ (f) => {
4510
+ const h = Ir(r, f.name);
4511
+ if (f.type === "array") {
4512
+ const p = h;
4513
4513
  return !p || p.length === 0 ? /* @__PURE__ */ e(
4514
4514
  de,
4515
4515
  {
@@ -4518,7 +4518,7 @@ const Pn = ({
4518
4518
  className: "text-text-muted",
4519
4519
  children: "Geen items"
4520
4520
  }
4521
- ) : /* @__PURE__ */ e("div", { className: "space-y-3", children: p.map((w, g) => /* @__PURE__ */ c(
4521
+ ) : /* @__PURE__ */ e("div", { className: "space-y-3", children: p.map((C, g) => /* @__PURE__ */ c(
4522
4522
  "div",
4523
4523
  {
4524
4524
  className: "p-4 border border-border rounded-xl space-y-3",
@@ -4531,53 +4531,53 @@ const Pn = ({
4531
4531
  weight: "medium",
4532
4532
  className: "text-text-muted",
4533
4533
  children: [
4534
- h.label,
4534
+ f.label,
4535
4535
  " ",
4536
4536
  g + 1
4537
4537
  ]
4538
4538
  }
4539
4539
  ) }),
4540
- /* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: h.arrayFields?.map((b) => {
4541
- const A = w?.[b.name];
4542
- let _ = "-";
4543
- switch (b.type) {
4540
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: f.arrayFields?.map((x) => {
4541
+ const _ = C?.[x.name];
4542
+ let E = "-";
4543
+ switch (x.type) {
4544
4544
  case "text":
4545
4545
  case "email":
4546
4546
  case "number":
4547
4547
  case "tel":
4548
4548
  case "url":
4549
4549
  case "textarea":
4550
- _ = A || "-";
4550
+ E = _ || "-";
4551
4551
  break;
4552
4552
  case "select":
4553
4553
  case "radio":
4554
- _ = l(
4555
- A,
4556
- b.options
4554
+ E = l(
4555
+ _,
4556
+ x.options
4557
4557
  );
4558
4558
  break;
4559
4559
  case "checkbox":
4560
- _ = o(A);
4560
+ E = o(_);
4561
4561
  break;
4562
4562
  case "date":
4563
- _ = a(A);
4563
+ E = a(_);
4564
4564
  break;
4565
4565
  case "custom":
4566
- _ = b.customComponent?.({
4567
- value: A
4566
+ E = x.customComponent?.({
4567
+ value: _
4568
4568
  });
4569
4569
  break;
4570
4570
  default:
4571
- _ = String(A || "-");
4571
+ E = String(_ || "-");
4572
4572
  }
4573
- return b.format && (_ = b.format(A, w)), /* @__PURE__ */ c("div", { className: "space-y-1", children: [
4573
+ return x.format && (E = x.format(_, C)), /* @__PURE__ */ c("div", { className: "space-y-1", children: [
4574
4574
  /* @__PURE__ */ e(
4575
4575
  de,
4576
4576
  {
4577
4577
  variant: "label",
4578
4578
  size: "xs",
4579
4579
  className: "text-text-muted",
4580
- children: b.label
4580
+ children: x.label
4581
4581
  }
4582
4582
  ),
4583
4583
  /* @__PURE__ */ e(
@@ -4586,20 +4586,20 @@ const Pn = ({
4586
4586
  variant: "body",
4587
4587
  size: "sm",
4588
4588
  className: "text-text",
4589
- children: _
4589
+ children: E
4590
4590
  }
4591
4591
  )
4592
- ] }, b.name);
4592
+ ] }, x.name);
4593
4593
  }) })
4594
4594
  ]
4595
4595
  },
4596
4596
  g
4597
4597
  )) });
4598
4598
  }
4599
- if (h.type === "custom" && h.customComponent)
4600
- return h.customComponent({ value: f });
4601
- if (h.format) {
4602
- const p = h.format(f, r);
4599
+ if (f.type === "custom" && f.customComponent)
4600
+ return f.customComponent({ value: h });
4601
+ if (f.format) {
4602
+ const p = f.format(h, r);
4603
4603
  return /* @__PURE__ */ e(
4604
4604
  de,
4605
4605
  {
@@ -4610,31 +4610,31 @@ const Pn = ({
4610
4610
  }
4611
4611
  );
4612
4612
  }
4613
- let x = "-";
4614
- switch (h.type) {
4613
+ let b = "-";
4614
+ switch (f.type) {
4615
4615
  case "text":
4616
4616
  case "email":
4617
4617
  case "password":
4618
4618
  case "number":
4619
4619
  case "tel":
4620
4620
  case "url":
4621
- x = f ? String(f) : "-";
4621
+ b = h ? String(h) : "-";
4622
4622
  break;
4623
4623
  case "textarea":
4624
- x = f ? /* @__PURE__ */ e("div", { className: "whitespace-pre-wrap", children: String(f || "-") }) : "-";
4624
+ b = h ? /* @__PURE__ */ e("div", { className: "whitespace-pre-wrap", children: String(h || "-") }) : "-";
4625
4625
  break;
4626
4626
  case "select":
4627
4627
  case "radio":
4628
- x = l(f, h.options);
4628
+ b = l(h, f.options);
4629
4629
  break;
4630
4630
  case "checkbox":
4631
- x = o(f);
4631
+ b = o(h);
4632
4632
  break;
4633
4633
  case "date":
4634
- x = a(f);
4634
+ b = a(h);
4635
4635
  break;
4636
4636
  default:
4637
- x = f ? String(f) : "-";
4637
+ b = h ? String(h) : "-";
4638
4638
  }
4639
4639
  return /* @__PURE__ */ e(
4640
4640
  de,
@@ -4642,30 +4642,30 @@ const Pn = ({
4642
4642
  variant: "body",
4643
4643
  size: "sm",
4644
4644
  className: "text-text",
4645
- children: x
4645
+ children: b
4646
4646
  }
4647
4647
  );
4648
4648
  },
4649
4649
  [r]
4650
4650
  ), m = ue(
4651
- (h) => {
4652
- if (h.conditional && !h.conditional(r))
4651
+ (f) => {
4652
+ if (f.conditional && !f.conditional(r))
4653
4653
  return null;
4654
- const f = h.items.filter((p) => !(p.hidden || p.conditional && !p.conditional(r)));
4655
- if (f.length === 0) return null;
4656
- const x = d(
4654
+ const h = f.items.filter((p) => !(p.hidden || p.conditional && !p.conditional(r)));
4655
+ if (h.length === 0) return null;
4656
+ const b = d(
4657
4657
  "space-y-4",
4658
4658
  {
4659
- "grid gap-4": h.layout === "grid",
4660
- "flex flex-wrap gap-4": h.layout === "flex"
4659
+ "grid gap-4": f.layout === "grid",
4660
+ "flex flex-wrap gap-4": f.layout === "flex"
4661
4661
  },
4662
- h.layout === "grid" && {
4663
- "grid-cols-1": !h.columns || h.columns === 1,
4664
- "grid-cols-2": h.columns === 2,
4665
- "grid-cols-3": h.columns === 3,
4666
- "grid-cols-4": h.columns === 4
4662
+ f.layout === "grid" && {
4663
+ "grid-cols-1": !f.columns || f.columns === 1,
4664
+ "grid-cols-2": f.columns === 2,
4665
+ "grid-cols-3": f.columns === 3,
4666
+ "grid-cols-4": f.columns === 4
4667
4667
  },
4668
- h.className
4668
+ f.className
4669
4669
  );
4670
4670
  return /* @__PURE__ */ c(
4671
4671
  "div",
@@ -4680,20 +4680,20 @@ const Pn = ({
4680
4680
  size: "lg",
4681
4681
  weight: "semibold",
4682
4682
  className: "text-text",
4683
- children: h.title
4683
+ children: f.title
4684
4684
  }
4685
4685
  ),
4686
- h.description && /* @__PURE__ */ e(
4686
+ f.description && /* @__PURE__ */ e(
4687
4687
  de,
4688
4688
  {
4689
4689
  variant: "body",
4690
4690
  size: "sm",
4691
4691
  className: "text-text-muted mt-1",
4692
- children: h.description
4692
+ children: f.description
4693
4693
  }
4694
4694
  )
4695
4695
  ] }),
4696
- /* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: x, children: f.map((p) => /* @__PURE__ */ c(
4696
+ /* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: b, children: h.map((p) => /* @__PURE__ */ c(
4697
4697
  "div",
4698
4698
  {
4699
4699
  className: "space-y-1",
@@ -4718,11 +4718,11 @@ const Pn = ({
4718
4718
  )) }) })
4719
4719
  ]
4720
4720
  },
4721
- h.id
4721
+ f.id
4722
4722
  );
4723
4723
  },
4724
4724
  [r, u]
4725
- ), y = d(
4725
+ ), N = d(
4726
4726
  "space-y-6",
4727
4727
  {
4728
4728
  "max-w-md": n === "sm",
@@ -4732,7 +4732,7 @@ const Pn = ({
4732
4732
  },
4733
4733
  s
4734
4734
  );
4735
- return /* @__PURE__ */ e("div", { className: y, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(m) }) });
4735
+ return /* @__PURE__ */ e("div", { className: N, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(m) }) });
4736
4736
  }, qe = ({ item: t, isSelectedHandler: r, onClick: n, depth: s = 0 }) => {
4737
4737
  const a = !!(t.children && t.children.length > 0), o = r ? r(t.path) : !1;
4738
4738
  if (a)
@@ -4749,7 +4749,7 @@ const Pn = ({
4749
4749
  ]
4750
4750
  }
4751
4751
  ),
4752
- /* @__PURE__ */ e("ul", { className: "flex flex-col gap-0.5", children: t.children?.map((m, y) => /* @__PURE__ */ e(
4752
+ /* @__PURE__ */ e("ul", { className: "flex flex-col gap-0.5", children: t.children?.map((m, N) => /* @__PURE__ */ e(
4753
4753
  qe,
4754
4754
  {
4755
4755
  item: m,
@@ -4757,7 +4757,7 @@ const Pn = ({
4757
4757
  onClick: n,
4758
4758
  depth: s + 1
4759
4759
  },
4760
- y
4760
+ N
4761
4761
  )) })
4762
4762
  ] });
4763
4763
  const l = t.action, u = l?.visibility !== "always";
@@ -4888,18 +4888,18 @@ const Pn = ({
4888
4888
  children: u,
4889
4889
  ...m
4890
4890
  }) => {
4891
- const y = `h${t}`, h = d(
4891
+ const N = `h${t}`, f = d(
4892
4892
  "font-sans text-pretty",
4893
- jr[r || Br(t)],
4893
+ jr[r || Rr(t)],
4894
4894
  Pr[n],
4895
4895
  Or[s],
4896
4896
  Fr[a],
4897
4897
  o && "truncate",
4898
4898
  l
4899
4899
  );
4900
- return /* @__PURE__ */ e(y, { className: h, ...m, children: u });
4900
+ return /* @__PURE__ */ e(N, { className: f, ...m, children: u });
4901
4901
  };
4902
- function Br(t) {
4902
+ function Rr(t) {
4903
4903
  return {
4904
4904
  1: "2xl",
4905
4905
  2: "xl",
@@ -4909,7 +4909,7 @@ function Br(t) {
4909
4909
  6: "md"
4910
4910
  }[t] || "md";
4911
4911
  }
4912
- const Bn = ({
4912
+ const Rn = ({
4913
4913
  commands: t,
4914
4914
  isOpen: r,
4915
4915
  onClose: n,
@@ -4917,44 +4917,44 @@ const Bn = ({
4917
4917
  initialCommandPath: a,
4918
4918
  initialActiveIndex: o
4919
4919
  }) => {
4920
- const [l, u] = B(""), [m, y] = B(a || []), [h, f] = B(o || 0), x = se(null), p = se(null), g = (m.length ? t.find((b) => b.id === m[0])?.subCommands || [] : t).filter(
4921
- (b) => b.label.toLowerCase().includes(l.toLowerCase())
4920
+ const [l, u] = R(""), [m, N] = R(a || []), [f, h] = R(o || 0), b = se(null), p = se(null), g = (m.length ? t.find((x) => x.id === m[0])?.subCommands || [] : t).filter(
4921
+ (x) => x.label.toLowerCase().includes(l.toLowerCase())
4922
4922
  );
4923
4923
  return Q(() => {
4924
- r || (u(""), y(a || []), f(o || 0));
4924
+ r || (u(""), N(a || []), h(o || 0));
4925
4925
  }, [r]), Q(() => {
4926
- const b = (A) => {
4926
+ const x = (_) => {
4927
4927
  if (r) {
4928
- if (A.key === "Escape")
4928
+ if (_.key === "Escape")
4929
4929
  n();
4930
- else if (A.key === "ArrowUp")
4931
- f(
4932
- (_) => _ > 0 ? _ - 1 : g.length - 1
4930
+ else if (_.key === "ArrowUp")
4931
+ h(
4932
+ (E) => E > 0 ? E - 1 : g.length - 1
4933
4933
  );
4934
- else if (A.key === "ArrowDown")
4935
- f(
4936
- (_) => _ < g.length - 1 ? _ + 1 : 0
4934
+ else if (_.key === "ArrowDown")
4935
+ h(
4936
+ (E) => E < g.length - 1 ? E + 1 : 0
4937
4937
  );
4938
- else if (A.key === "Enter") {
4939
- const _ = g[h];
4940
- _ && (_.subCommands ? (y([...m, _.id]), f(0)) : _.action && (_.action(), n()));
4938
+ else if (_.key === "Enter") {
4939
+ const E = g[f];
4940
+ E && (E.subCommands ? (N([...m, E.id]), h(0)) : E.action && (E.action(), n()));
4941
4941
  }
4942
4942
  }
4943
4943
  };
4944
- return document.addEventListener("keydown", b), () => document.removeEventListener("keydown", b);
4945
- }, [r, n, g, h, m]), Q(() => {
4946
- const b = (A) => {
4947
- x.current && !x.current.contains(A.target) && n();
4944
+ return document.addEventListener("keydown", x), () => document.removeEventListener("keydown", x);
4945
+ }, [r, n, g, f, m]), Q(() => {
4946
+ const x = (_) => {
4947
+ b.current && !b.current.contains(_.target) && n();
4948
4948
  };
4949
- return r && document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
4949
+ return r && document.addEventListener("mousedown", x), () => document.removeEventListener("mousedown", x);
4950
4950
  }, [r, n]), Q(() => {
4951
4951
  if (!r) return;
4952
- p.current?.querySelector(`[data-index="${h}"]`)?.scrollIntoView({ block: "nearest" });
4953
- }, [h, r]), r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim", children: /* @__PURE__ */ c(
4952
+ p.current?.querySelector(`[data-index="${f}"]`)?.scrollIntoView({ block: "nearest" });
4953
+ }, [f, r]), r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim", children: /* @__PURE__ */ c(
4954
4954
  "div",
4955
4955
  {
4956
4956
  className: "flex flex-col w-full max-w-lg max-h-dialog p-2 mx-auto rounded-lg border border-border shadow-modal bg-surface",
4957
- ref: x,
4957
+ ref: b,
4958
4958
  children: [
4959
4959
  /* @__PURE__ */ c("div", { className: "flex items-center gap-2 px-3 flex-shrink-0", children: [
4960
4960
  /* @__PURE__ */ e(Se, { className: "w-4 h-4 text-text-muted shrink-0" }),
@@ -4965,7 +4965,7 @@ const Bn = ({
4965
4965
  autoFocus: !0,
4966
4966
  placeholder: s?.searchPlaceholder || "Search commands...",
4967
4967
  value: l,
4968
- onChange: (b) => u(b.target.value),
4968
+ onChange: (x) => u(x.target.value),
4969
4969
  className: "w-full border-0 bg-transparent py-2 text-text focus:outline-none"
4970
4970
  }
4971
4971
  )
@@ -4977,22 +4977,22 @@ const Bn = ({
4977
4977
  className: "mt-2 pt-2 text-sm border-t border-border max-h-dialog-list overflow-y-auto",
4978
4978
  children: [
4979
4979
  g.length === 0 && /* @__PURE__ */ e("div", { className: "text-text-muted text-center text-sm", children: s?.noCommandsFound || "No commands found" }),
4980
- g.map((b, A) => /* @__PURE__ */ c(
4980
+ g.map((x, _) => /* @__PURE__ */ c(
4981
4981
  "div",
4982
4982
  {
4983
- "data-index": A,
4984
- className: `flex items-center p-2 cursor-pointer rounded-md ${A === h ? "bg-accent-soft text-accent" : "text-text"}`,
4983
+ "data-index": _,
4984
+ className: `flex items-center p-2 cursor-pointer rounded-md ${_ === f ? "bg-accent-soft text-accent" : "text-text"}`,
4985
4985
  onClick: () => {
4986
- b.subCommands ? (y([...m, b.id]), f(0)) : b.action && (b.action(), n());
4986
+ x.subCommands ? (N([...m, x.id]), h(0)) : x.action && (x.action(), n());
4987
4987
  },
4988
- onMouseEnter: () => f(A),
4988
+ onMouseEnter: () => h(_),
4989
4989
  children: [
4990
- b.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: b.icon }),
4991
- /* @__PURE__ */ e("span", { className: "flex-grow", children: b.label }),
4992
- b.subCommands && /* @__PURE__ */ e("span", { className: "text-text-muted", children: /* @__PURE__ */ e(Ce, { className: "w-4 h-4" }) })
4990
+ x.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: x.icon }),
4991
+ /* @__PURE__ */ e("span", { className: "flex-grow", children: x.label }),
4992
+ x.subCommands && /* @__PURE__ */ e("span", { className: "text-text-muted", children: /* @__PURE__ */ e(Ce, { className: "w-4 h-4" }) })
4993
4993
  ]
4994
4994
  },
4995
- b.id
4995
+ x.id
4996
4996
  ))
4997
4997
  ]
4998
4998
  }
@@ -5014,7 +5014,7 @@ const Bn = ({
5014
5014
  ]
5015
5015
  }
5016
5016
  ) }) : null;
5017
- }, Rr = {
5017
+ }, Br = {
5018
5018
  none: "p-0",
5019
5019
  xs: "p-1",
5020
5020
  sm: "p-2",
@@ -5086,13 +5086,13 @@ const Bn = ({
5086
5086
  borderColor: l,
5087
5087
  className: u,
5088
5088
  children: m,
5089
- ...y
5090
- }, h) => /* @__PURE__ */ e(
5089
+ ...N
5090
+ }, f) => /* @__PURE__ */ e(
5091
5091
  "div",
5092
5092
  {
5093
- ref: h,
5093
+ ref: f,
5094
5094
  className: d(
5095
- t && Rr[t],
5095
+ t && Br[t],
5096
5096
  r && Hr[r],
5097
5097
  n && Vr[n],
5098
5098
  s && qr[s],
@@ -5101,13 +5101,13 @@ const Bn = ({
5101
5101
  l && Kr[l],
5102
5102
  u
5103
5103
  ),
5104
- ...y,
5104
+ ...N,
5105
5105
  children: m
5106
5106
  }
5107
5107
  )
5108
5108
  );
5109
5109
  Ue.displayName = "Box";
5110
- const Rn = ({ children: t, title: r, ...n }) => /* @__PURE__ */ c(
5110
+ const Bn = ({ children: t, title: r, ...n }) => /* @__PURE__ */ c(
5111
5111
  Ue,
5112
5112
  {
5113
5113
  background: "module",
@@ -5127,47 +5127,51 @@ function Hn({
5127
5127
  resourceLoader: r,
5128
5128
  framework: n = "react",
5129
5129
  fallback: s,
5130
- componentProps: a,
5131
- className: o
5130
+ errorFallback: a,
5131
+ componentProps: o,
5132
+ className: l
5132
5133
  }) {
5133
- const l = se(null), [u, m] = B(!0), [y, h] = B(null), f = se(null);
5134
- return se(null), Q(() => {
5134
+ const u = se(null), [m, N] = R(!0), [f, h] = R(!1), [b, p] = R(null), C = se(null);
5135
+ se(null);
5136
+ const g = se(r);
5137
+ return g.current = r, Q(() => {
5135
5138
  let x = !0;
5136
5139
  return (async () => {
5137
- m(!0);
5140
+ N(!0), h(!1), p(null);
5138
5141
  try {
5139
- const w = await r();
5142
+ const E = await g.current();
5140
5143
  if (!x) return;
5141
- const g = w.component || w.default || w;
5142
- h(n === "react" ? () => g : () => w);
5143
- } catch (w) {
5144
- console.error(`[FederatedResource] Load failed: ${t}`, w);
5144
+ const W = E.component || E.default || E;
5145
+ p(n === "react" ? () => W : () => E);
5146
+ } catch (E) {
5147
+ console.error(`[FederatedResource] Load failed: ${t}`, E), x && h(!0);
5145
5148
  } finally {
5146
- x && m(!1);
5149
+ x && N(!1);
5147
5150
  }
5148
5151
  })(), () => {
5149
5152
  x = !1;
5150
5153
  };
5151
- }, [t, r]), Q(() => {
5152
- if (u || !y || n === "react") return;
5153
- const x = l.current;
5154
+ }, [t, n]), Q(() => {
5155
+ if (m || !b || n === "react") return;
5156
+ const x = u.current;
5154
5157
  if (x) {
5155
5158
  if (n === "svelte") {
5156
- const p = y.default || y, w = new p({ target: x, props: a || {} });
5157
- return f.current = w, () => w.$destroy();
5159
+ const _ = b.default || b, E = new _({ target: x, props: o || {} });
5160
+ return C.current = E, () => E.$destroy();
5158
5161
  }
5159
- if (y.mount) {
5160
- const p = y.mount({ container: x, props: a || {} });
5162
+ if (b.mount) {
5163
+ const _ = b.mount({ container: x, props: o || {} });
5161
5164
  return () => {
5162
- typeof p == "function" ? p() : y.unmount?.(x);
5165
+ typeof _ == "function" ? _() : b.unmount?.(x);
5163
5166
  };
5164
5167
  }
5165
5168
  }
5166
- }, [y, n, u]), Q(() => {
5167
- n === "svelte" && f.current && f.current.$set?.(a);
5168
- }, [a, n]), /* @__PURE__ */ c("div", { ref: l, className: o, style: { display: "contents" }, children: [
5169
- u && s,
5170
- n === "react" && y && /* @__PURE__ */ e(y, { ...a })
5169
+ }, [b, n, m]), Q(() => {
5170
+ n === "svelte" && C.current && C.current.$set?.(o);
5171
+ }, [o, n]), /* @__PURE__ */ c("div", { ref: u, className: l, style: { display: "contents" }, children: [
5172
+ m && s,
5173
+ !m && f && a,
5174
+ n === "react" && !f && b && /* @__PURE__ */ e(b, { ...o })
5171
5175
  ] });
5172
5176
  }
5173
5177
  class Vn extends xt {
@@ -5206,10 +5210,10 @@ export {
5206
5210
  Ue as Box,
5207
5211
  ne as Button,
5208
5212
  ln as ButtonGroup,
5209
- Rn as Card,
5213
+ Bn as Card,
5210
5214
  Sn as ChannelBadge,
5211
5215
  pe as Checkbox,
5212
- Bn as CommandPalette,
5216
+ Rn as CommandPalette,
5213
5217
  xn as ConfirmDialog,
5214
5218
  Wt as ContentLoading,
5215
5219
  $e as DatePicker,
@@ -5218,7 +5222,7 @@ export {
5218
5222
  Vn as ErrorBoundary,
5219
5223
  Hn as FederatedResource,
5220
5224
  on as FilterChip,
5221
- Bt as FolderSelect,
5225
+ Rt as FolderSelect,
5222
5226
  hn as Form,
5223
5227
  Fn as Heading,
5224
5228
  Y as Icon,
@@ -5245,7 +5249,7 @@ export {
5245
5249
  On as SidebarMenu,
5246
5250
  jn as SourceChip,
5247
5251
  yn as Spinner,
5248
- Be as SplitButton,
5252
+ Re as SplitButton,
5249
5253
  Nn as StatusDot,
5250
5254
  wn as StepIndicator,
5251
5255
  ur as StorageInput,