@opencxh/ui-kit 3.112.0 → 3.112.2

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,24 +1,24 @@
1
- import { clsx as qe } from "clsx";
1
+ import { clsx as Ue } from "clsx";
2
2
  import { jsxs as i, jsx as e, Fragment as fe } from "react/jsx-runtime";
3
3
  import { VideoOff as We, User as Ke, MicOff as _e, Mic as Ge, X as ve, ChevronDown as be, ExternalLink as Je, Calendar as Ye, ChevronLeft as Pe, ChevronRight as ye, ChevronDownIcon as Xe, Loader2 as Ze, Search as Ne, Check as Me, ChevronUp as Qe, ChevronsLeft as et, ChevronsRight as tt, FileText as we, HardDrive as $e, ArrowLeft as ze, FolderPlus as rt, Upload as nt, Folder as De, Trash2 as st, Plus as at, Sparkles as lt, ImageOff as ot, Pencil as ct, ArrowUpRight as it } from "lucide-react";
4
4
  import le, { useRef as se, useEffect as Y, forwardRef as de, useState as R, useLayoutEffect as dt, useMemo as me, useCallback as ce, createContext as ut, Component as mt } from "react";
5
- function d(...t) {
6
- return qe(t);
5
+ function u(...t) {
6
+ return Ue(t);
7
7
  }
8
- function Ur(t) {
8
+ function qr(t) {
9
9
  return (r, n) => t[r]?.[n] || "";
10
10
  }
11
- function qr(t) {
11
+ function Ur(t) {
12
12
  return (r) => t[r] || "";
13
13
  }
14
14
  function Wr({ tiles: t, pinned: r, className: n }) {
15
15
  if (r)
16
- return /* @__PURE__ */ i("div", { className: d("flex flex-col md:flex-row gap-2 h-full min-h-0", n), children: [
16
+ return /* @__PURE__ */ i("div", { className: u("flex flex-col md:flex-row gap-2 h-full min-h-0", n), children: [
17
17
  /* @__PURE__ */ e("div", { className: "flex-1 min-h-0", children: r }),
18
18
  t.length > 0 && /* @__PURE__ */ e("div", { className: "flex md:flex-col gap-2 md:w-48 overflow-auto", children: t.map((a, l) => /* @__PURE__ */ e("div", { className: "min-w-40 md:min-w-0", children: a }, l)) })
19
19
  ] });
20
20
  const s = t.length <= 1 ? "grid-cols-1" : t.length <= 4 ? "grid-cols-2" : t.length <= 9 ? "grid-cols-3" : "grid-cols-4";
21
- return /* @__PURE__ */ e("div", { className: d("grid gap-2 h-full", s, n), children: t.map((a, l) => /* @__PURE__ */ e("div", { children: a }, l)) });
21
+ return /* @__PURE__ */ e("div", { className: u("grid gap-2 h-full", s, n), children: t.map((a, l) => /* @__PURE__ */ e("div", { children: a }, l)) });
22
22
  }
23
23
  function Kr({
24
24
  name: t,
@@ -33,7 +33,7 @@ function Kr({
33
33
  return /* @__PURE__ */ i(
34
34
  "div",
35
35
  {
36
- className: d(
36
+ className: u(
37
37
  "relative rounded-lg overflow-hidden bg-video-surface flex items-center justify-center",
38
38
  f ? "h-full w-full" : "aspect-video",
39
39
  s && "ring-2 ring-speaking",
@@ -61,7 +61,7 @@ function _r({ attach: t, active: r = !0, mirrored: n = !1, className: s }) {
61
61
  "div",
62
62
  {
63
63
  ref: a,
64
- className: d(
64
+ className: u(
65
65
  "w-full h-full bg-video-surface-strong overflow-hidden",
66
66
  n && "[&>*]:scale-x-[-1]",
67
67
  s
@@ -108,16 +108,16 @@ const ft = {
108
108
  shape: f = "default",
109
109
  className: p,
110
110
  children: N,
111
- disabled: h,
112
- ...m
113
- }, x) => {
114
- const v = h || s;
111
+ disabled: x,
112
+ ...d
113
+ }, h) => {
114
+ const y = x || s;
115
115
  return /* @__PURE__ */ i(
116
116
  "button",
117
117
  {
118
- ref: x,
118
+ ref: h,
119
119
  type: "button",
120
- className: d(
120
+ className: u(
121
121
  "inline-flex shrink-0 items-center justify-center gap-2 cursor-pointer font-semibold",
122
122
  f === "circle" ? "rounded-full" : "rounded-md",
123
123
  "transition-colors duration-fast ease-out",
@@ -130,9 +130,9 @@ const ft = {
130
130
  s && "cursor-wait",
131
131
  p
132
132
  ),
133
- disabled: v,
133
+ disabled: y,
134
134
  "aria-busy": s || void 0,
135
- ...m,
135
+ ...d,
136
136
  children: [
137
137
  s && /* @__PURE__ */ e(
138
138
  "span",
@@ -158,7 +158,7 @@ const Gr = ({
158
158
  attached: s = !0,
159
159
  className: a
160
160
  }) => {
161
- const l = d(
161
+ const l = u(
162
162
  "inline-flex",
163
163
  {
164
164
  // Orientation
@@ -201,7 +201,7 @@ const Gr = ({
201
201
  "aria-label": c,
202
202
  ...f
203
203
  }) => {
204
- const p = typeof r == "number" ? r : gt(r), N = d(
204
+ const p = typeof r == "number" ? r : gt(r), N = u(
205
205
  "inline-block shrink-0",
206
206
  bt[n],
207
207
  s && [
@@ -209,7 +209,7 @@ const Gr = ({
209
209
  "focus-visible:outline-none focus-visible:focus-ring"
210
210
  ],
211
211
  l
212
- ), h = {
212
+ ), x = {
213
213
  size: p,
214
214
  strokeWidth: 2,
215
215
  className: N,
@@ -218,12 +218,12 @@ const Gr = ({
218
218
  "aria-hidden": c ? void 0 : !0,
219
219
  role: s ? "button" : void 0,
220
220
  tabIndex: s ? 0 : void 0,
221
- onKeyDown: s ? (m) => {
222
- (m.key === "Enter" || m.key === " ") && (m.preventDefault(), a?.());
221
+ onKeyDown: s ? (d) => {
222
+ (d.key === "Enter" || d.key === " ") && (d.preventDefault(), a?.());
223
223
  } : void 0,
224
224
  ...f
225
225
  };
226
- return /* @__PURE__ */ e(t, { ...h });
226
+ return /* @__PURE__ */ e(t, { ...x });
227
227
  };
228
228
  function gt(t) {
229
229
  return {
@@ -251,41 +251,41 @@ function Jr({
251
251
  onClear: f,
252
252
  clearLabel: p = "Filter wissen",
253
253
  onClick: N,
254
- title: h,
255
- className: m
254
+ title: x,
255
+ className: d
256
256
  }) {
257
- const x = l && !!f, v = s === "pill" ? "rounded-full" : "rounded-md", C = d(
257
+ const h = l && !!f, y = s === "pill" ? "rounded-full" : "rounded-md", C = u(
258
258
  // A button's default cursor is an arrow, so it has to be asked for.
259
259
  "inline-flex cursor-pointer select-none items-center text-sm font-semibold",
260
260
  a === "sm" ? "h-control-sm" : "h-control-md",
261
261
  "transition-colors duration-fast ease-out",
262
- v,
262
+ y,
263
263
  // Picking a value outranks whatever the value happens to mean.
264
- l ? "bg-accent text-accent-fg" : d("border", pt[n]),
265
- m
266
- ), y = /* @__PURE__ */ i(fe, { children: [
264
+ l ? "bg-accent text-accent-fg" : u("border", pt[n]),
265
+ d
266
+ ), g = /* @__PURE__ */ i(fe, { children: [
267
267
  r,
268
268
  t,
269
269
  c && /* @__PURE__ */ e(J, { icon: be, size: "xs" })
270
- ] }), g = d(
270
+ ] }), v = u(
271
271
  "inline-flex items-center gap-1.5 pl-3",
272
- v,
273
- x ? "pr-1.5" : "pr-3",
272
+ y,
273
+ h ? "pr-1.5" : "pr-3",
274
274
  "focus-visible:outline-none focus-visible:focus-ring"
275
275
  );
276
- return x ? /* @__PURE__ */ i("span", { className: C, title: h, children: [
277
- /* @__PURE__ */ e("button", { type: "button", onClick: N, className: g, children: y }),
276
+ return h ? /* @__PURE__ */ i("span", { className: C, title: x, children: [
277
+ /* @__PURE__ */ e("button", { type: "button", onClick: N, className: v, children: g }),
278
278
  /* @__PURE__ */ e(
279
279
  "button",
280
280
  {
281
281
  type: "button",
282
282
  "aria-label": p,
283
283
  onClick: f,
284
- className: d("inline-flex h-full items-center pr-3 focus-visible:outline-none focus-visible:focus-ring", v),
284
+ className: u("inline-flex h-full items-center pr-3 focus-visible:outline-none focus-visible:focus-ring", y),
285
285
  children: /* @__PURE__ */ e(J, { icon: ve, size: "xs" })
286
286
  }
287
287
  )
288
- ] }) : /* @__PURE__ */ e("button", { type: "button", title: h, onClick: N, className: d(C, g), children: y });
288
+ ] }) : /* @__PURE__ */ e("button", { type: "button", title: x, onClick: N, className: u(C, v), children: g });
289
289
  }
290
290
  const vt = {
291
291
  xs: "text-xs",
@@ -322,9 +322,9 @@ const vt = {
322
322
  href: f,
323
323
  target: p,
324
324
  rel: N,
325
- ...h
325
+ ...x
326
326
  }) => {
327
- const m = a || f && (f.startsWith("http") || f.startsWith("mailto:")), x = d(
327
+ const d = a || f && (f.startsWith("http") || f.startsWith("mailto:")), h = u(
328
328
  "inline-flex items-center gap-1 underline-offset-2",
329
329
  "transition-colors duration-fast ease-out",
330
330
  "focus-visible:outline-none focus-visible:focus-ring",
@@ -338,16 +338,16 @@ const vt = {
338
338
  ],
339
339
  s && "pointer-events-none cursor-not-allowed text-text-disabled opacity-50",
340
340
  l
341
- ), v = {
342
- ...h,
341
+ ), y = {
342
+ ...x,
343
343
  href: s ? void 0 : f,
344
- target: m ? "_blank" : p,
345
- rel: m ? "noopener noreferrer" : N,
344
+ target: d ? "_blank" : p,
345
+ rel: d ? "noopener noreferrer" : N,
346
346
  "aria-disabled": s || void 0
347
347
  };
348
- return /* @__PURE__ */ i("a", { className: x, ...v, children: [
348
+ return /* @__PURE__ */ i("a", { className: h, ...y, children: [
349
349
  c,
350
- m && /* @__PURE__ */ e(Je, { className: "size-icon-sm shrink-0", "aria-hidden": !0 })
350
+ d && /* @__PURE__ */ e(Je, { className: "size-icon-sm shrink-0", "aria-hidden": !0 })
351
351
  ] });
352
352
  }, wt = {
353
353
  sm: "h-control-sm px-3 text-sm",
@@ -366,7 +366,7 @@ function Xr({
366
366
  {
367
367
  role: "tablist",
368
368
  "aria-label": l,
369
- className: d("inline-flex gap-0.5 rounded-md bg-surface-hover p-0.5", a),
369
+ className: u("inline-flex gap-0.5 rounded-md bg-surface-hover p-0.5", a),
370
370
  children: t.map((c) => {
371
371
  const f = c.value === r;
372
372
  return /* @__PURE__ */ e(
@@ -376,7 +376,7 @@ function Xr({
376
376
  "aria-selected": f,
377
377
  type: "button",
378
378
  onClick: () => n(c.value),
379
- className: d(
379
+ className: u(
380
380
  "inline-flex items-center justify-center rounded-sm",
381
381
  "transition-colors duration-fast ease-out",
382
382
  "focus-visible:outline-none focus-visible:focus-ring",
@@ -399,53 +399,53 @@ const kt = ({
399
399
  disabled: a = !1,
400
400
  triggerLabel: l
401
401
  }) => {
402
- const [c, f] = R(!1), [p, N] = R({}), h = se(null), m = se(null);
402
+ const [c, f] = R(!1), [p, N] = R({}), x = se(null), d = se(null);
403
403
  Y(() => {
404
404
  if (!c) return;
405
- const C = (g) => {
406
- h.current && !h.current.contains(g.target) && f(!1);
407
- }, y = (g) => {
408
- g.key === "Escape" && f(!1);
405
+ const C = (v) => {
406
+ x.current && !x.current.contains(v.target) && f(!1);
407
+ }, g = (v) => {
408
+ v.key === "Escape" && f(!1);
409
409
  };
410
- return document.addEventListener("mousedown", C), document.addEventListener("keydown", y), () => {
411
- document.removeEventListener("mousedown", C), document.removeEventListener("keydown", y);
410
+ return document.addEventListener("mousedown", C), document.addEventListener("keydown", g), () => {
411
+ document.removeEventListener("mousedown", C), document.removeEventListener("keydown", g);
412
412
  };
413
413
  }, [c]);
414
- const x = (C) => {
414
+ const h = (C) => {
415
415
  if (C.stopPropagation(), !a) {
416
416
  if (!c) {
417
- const y = m.current?.getBoundingClientRect();
418
- if (y) {
419
- const A = {};
420
- n.startsWith("bottom") ? A.top = y.bottom + 6 : A.bottom = window.innerHeight - y.top + 6, n.endsWith("start") ? A.left = y.left : A.right = window.innerWidth - y.right, N(A);
417
+ const g = d.current?.getBoundingClientRect();
418
+ if (g) {
419
+ const $ = {};
420
+ n.startsWith("bottom") ? $.top = g.bottom + 6 : $.bottom = window.innerHeight - g.top + 6, n.endsWith("start") ? $.left = g.left : $.right = window.innerWidth - g.right, N($);
421
421
  }
422
422
  }
423
- f((y) => !y);
423
+ f((g) => !g);
424
424
  }
425
- }, v = () => f(!1);
426
- return /* @__PURE__ */ i("div", { ref: h, className: "relative inline-flex", children: [
425
+ }, y = () => f(!1);
426
+ return /* @__PURE__ */ i("div", { ref: x, className: "relative inline-flex", children: [
427
427
  /* @__PURE__ */ e(
428
428
  "button",
429
429
  {
430
- ref: m,
430
+ ref: d,
431
431
  type: "button",
432
- onClick: x,
432
+ onClick: h,
433
433
  disabled: a,
434
434
  "aria-label": l,
435
435
  "aria-expanded": c,
436
- className: d("inline-flex items-center", a && "cursor-not-allowed opacity-50"),
436
+ className: u("inline-flex items-center", a && "cursor-not-allowed opacity-50"),
437
437
  children: t
438
438
  }
439
439
  ),
440
440
  c && /* @__PURE__ */ e(
441
441
  "div",
442
442
  {
443
- className: d(
443
+ className: u(
444
444
  "fixed z-overlay bg-surface rounded-lg shadow-overlay border border-border",
445
445
  s
446
446
  ),
447
447
  style: p,
448
- children: typeof r == "function" ? r(v) : r
448
+ children: typeof r == "function" ? r(y) : r
449
449
  }
450
450
  )
451
451
  ] });
@@ -469,7 +469,7 @@ function je({
469
469
  menuPlacement: p = "bottom-end",
470
470
  menuLabel: N = "More options"
471
471
  }) {
472
- const h = c || f, m = l.length > 0;
472
+ const x = c || f, d = l.length > 0;
473
473
  return /* @__PURE__ */ i("div", { className: "inline-flex items-center gap-px", children: [
474
474
  /* @__PURE__ */ e(
475
475
  ee,
@@ -480,50 +480,50 @@ function je({
480
480
  disabled: c,
481
481
  loading: f,
482
482
  leftIcon: a,
483
- className: d(m && "rounded-r-none"),
483
+ className: u(d && "rounded-r-none"),
484
484
  children: t
485
485
  }
486
486
  ),
487
- m && /* @__PURE__ */ e(
487
+ d && /* @__PURE__ */ e(
488
488
  kt,
489
489
  {
490
490
  placement: p,
491
- disabled: h,
491
+ disabled: x,
492
492
  triggerLabel: N,
493
493
  className: "min-w-menu py-1",
494
494
  trigger: /* @__PURE__ */ e(
495
495
  "span",
496
496
  {
497
497
  "aria-hidden": "true",
498
- className: d(
498
+ className: u(
499
499
  "inline-flex items-center justify-center rounded-md rounded-l-none",
500
500
  "transition-colors duration-fast ease-out",
501
501
  Ct[n],
502
502
  St[s],
503
- h && "cursor-not-allowed opacity-50"
503
+ x && "cursor-not-allowed opacity-50"
504
504
  ),
505
505
  children: /* @__PURE__ */ e(be, { className: "size-icon-md" })
506
506
  }
507
507
  ),
508
- children: (x) => /* @__PURE__ */ e(fe, { children: l.map((v) => /* @__PURE__ */ i(
508
+ children: (h) => /* @__PURE__ */ e(fe, { children: l.map((y) => /* @__PURE__ */ i(
509
509
  "button",
510
510
  {
511
511
  type: "button",
512
512
  onClick: () => {
513
- v.onClick(), x();
513
+ y.onClick(), h();
514
514
  },
515
- className: d(
515
+ className: u(
516
516
  "flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm",
517
517
  "transition-colors duration-fast ease-out",
518
518
  "focus-visible:outline-none focus-visible:focus-ring",
519
- v.variant === "destructive" ? "text-danger-fg hover:bg-danger-soft" : "text-text hover:bg-surface-hover"
519
+ y.variant === "destructive" ? "text-danger-fg hover:bg-danger-soft" : "text-text hover:bg-surface-hover"
520
520
  ),
521
521
  children: [
522
- v.icon && /* @__PURE__ */ e("span", { className: "shrink-0", children: v.icon }),
523
- v.label
522
+ y.icon && /* @__PURE__ */ e("span", { className: "shrink-0", children: y.icon }),
523
+ y.label
524
524
  ]
525
525
  },
526
- v.id
526
+ y.id
527
527
  )) })
528
528
  }
529
529
  )
@@ -551,51 +551,53 @@ const zt = {
551
551
  error: n,
552
552
  size: s = "md",
553
553
  indeterminate: a = !1,
554
- containerClassName: l,
555
- labelClassName: c,
556
- className: f,
557
- id: p,
558
- ...N
559
- }, h) => {
560
- const m = le.useId(), x = p || `checkbox-${m}`, v = !!n, C = le.useRef(null), y = le.useCallback(
561
- (g) => {
562
- C.current = g, typeof h == "function" ? h(g) : h && typeof h == "object" && (h.current = g);
554
+ shape: l = "square",
555
+ containerClassName: c,
556
+ labelClassName: f,
557
+ className: p,
558
+ id: N,
559
+ ...x
560
+ }, d) => {
561
+ const h = le.useId(), y = N || `checkbox-${h}`, C = !!n, g = le.useRef(null), v = le.useCallback(
562
+ ($) => {
563
+ g.current = $, typeof d == "function" ? d($) : d && typeof d == "object" && (d.current = $);
563
564
  },
564
- [h]
565
+ [d]
565
566
  );
566
567
  return le.useEffect(() => {
567
- C.current && (C.current.indeterminate = a);
568
- }, [a]), /* @__PURE__ */ i("div", { className: d("flex flex-col", l), children: [
569
- /* @__PURE__ */ i("div", { className: d("flex items-center gap-3", Et[s]), children: [
568
+ g.current && (g.current.indeterminate = a);
569
+ }, [a]), /* @__PURE__ */ i("div", { className: u("flex flex-col", c), children: [
570
+ /* @__PURE__ */ i("div", { className: u("flex items-center gap-3", Et[s]), children: [
570
571
  /* @__PURE__ */ e(
571
572
  "input",
572
573
  {
573
- ref: y,
574
- id: x,
574
+ ref: v,
575
+ id: y,
575
576
  type: "checkbox",
576
- "aria-invalid": v || void 0,
577
- className: d(
578
- "shrink-0 rounded-sm border bg-surface-input accent-accent",
577
+ "aria-invalid": C || void 0,
578
+ className: u(
579
+ "shrink-0 border bg-surface-input accent-accent",
580
+ l === "circle" ? "rounded-full" : "rounded-sm",
579
581
  "transition-colors duration-fast ease-out",
580
582
  "focus-visible:outline-none focus-visible:focus-ring",
581
583
  "disabled:cursor-not-allowed disabled:bg-surface-hover",
582
584
  zt[s],
583
- v ? "border-danger-border" : "border-border-strong",
584
- f
585
+ C ? "border-danger-border" : "border-border-strong",
586
+ p
585
587
  ),
586
- ...N
588
+ ...x
587
589
  }
588
590
  ),
589
591
  t && /* @__PURE__ */ i("div", { className: "flex-1", children: [
590
592
  /* @__PURE__ */ e(
591
593
  "label",
592
594
  {
593
- htmlFor: x,
594
- className: d(
595
+ htmlFor: y,
596
+ className: u(
595
597
  "cursor-pointer",
596
- v ? "text-danger-fg" : "text-text",
598
+ C ? "text-danger-fg" : "text-text",
597
599
  Mt[s],
598
- c
600
+ f
599
601
  ),
600
602
  children: t
601
603
  }
@@ -615,8 +617,8 @@ function Ee(t, r, { gap: n = 6, matchWidth: s = !1, placement: a = "bottom-start
615
617
  const f = () => {
616
618
  const p = r.current;
617
619
  if (!p) return;
618
- const N = p.getBoundingClientRect(), h = window.innerHeight - N.bottom, m = N.top, x = a.startsWith("top"), v = x ? m < 200 && h > m : h < 200 && m > h, C = x !== v, y = { position: "fixed" };
619
- C ? (y.bottom = window.innerHeight - N.top + n, y.maxHeight = Math.max(120, m - n * 2)) : (y.top = N.bottom + n, y.maxHeight = Math.max(120, h - n * 2)), a.endsWith("end") ? y.right = window.innerWidth - N.right : y.left = N.left, s && (y.width = N.width), c(y);
620
+ const N = p.getBoundingClientRect(), x = window.innerHeight - N.bottom, d = N.top, h = a.startsWith("top"), y = h ? d < 200 && x > d : x < 200 && d > x, C = h !== y, g = { position: "fixed" };
621
+ C ? (g.bottom = window.innerHeight - N.top + n, g.maxHeight = Math.max(120, d - n * 2)) : (g.top = N.bottom + n, g.maxHeight = Math.max(120, x - n * 2)), a.endsWith("end") ? g.right = window.innerWidth - N.right : g.left = N.left, s && (g.width = N.width), c(g);
620
622
  };
621
623
  return f(), window.addEventListener("scroll", f, !0), window.addEventListener("resize", f), () => {
622
624
  window.removeEventListener("scroll", f, !0), window.removeEventListener("resize", f);
@@ -634,28 +636,28 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
634
636
  minDate: f,
635
637
  maxDate: p,
636
638
  format: N = "MM/dd/yyyy",
637
- withTime: h = !1
638
- }, m) => {
639
- const [x, v] = R(!1), [C, y] = R(() => t || /* @__PURE__ */ new Date()), g = se(null), A = Ee(x, g);
639
+ withTime: x = !1
640
+ }, d) => {
641
+ const [h, y] = R(!1), [C, g] = R(() => t || /* @__PURE__ */ new Date()), v = se(null), $ = Ee(h, v);
640
642
  Y(() => {
641
- const b = (u) => {
642
- g.current && !g.current.contains(u.target) && v(!1);
643
+ const b = (m) => {
644
+ v.current && !v.current.contains(m.target) && y(!1);
643
645
  };
644
- return x && document.addEventListener("mousedown", b), () => {
646
+ return h && document.addEventListener("mousedown", b), () => {
645
647
  document.removeEventListener("mousedown", b);
646
648
  };
647
- }, [x]);
648
- const $ = (b) => {
649
+ }, [h]);
650
+ const D = (b) => {
649
651
  if (!b) return "";
650
- const u = b.getDate().toString().padStart(2, "0"), E = (b.getMonth() + 1).toString().padStart(2, "0"), w = b.getFullYear(), P = N === "dd/MM/yyyy" ? `${u}/${E}/${w}` : N === "yyyy-MM-dd" ? `${w}-${E}-${u}` : `${E}/${u}/${w}`;
651
- return h ? `${P} ${_(b)}` : P;
652
+ const m = b.getDate().toString().padStart(2, "0"), E = (b.getMonth() + 1).toString().padStart(2, "0"), w = b.getFullYear(), P = N === "dd/MM/yyyy" ? `${m}/${E}/${w}` : N === "yyyy-MM-dd" ? `${w}-${E}-${m}` : `${E}/${m}/${w}`;
653
+ return x ? `${P} ${_(b)}` : P;
652
654
  }, _ = (b) => `${b.getHours().toString().padStart(2, "0")}:${b.getMinutes().toString().padStart(2, "0")}`, M = (b) => {
653
- const [u, E] = b.split(":").map(Number);
654
- if (Number.isNaN(u) || Number.isNaN(E)) return;
655
+ const [m, E] = b.split(":").map(Number);
656
+ if (Number.isNaN(m) || Number.isNaN(E)) return;
655
657
  const w = t ? new Date(t) : /* @__PURE__ */ new Date();
656
- w.setHours(u, E, 0, 0), r?.(w);
657
- }, U = () => {
658
- const b = C.getFullYear(), u = C.getMonth(), E = new Date(b, u, 1), w = new Date(E);
658
+ w.setHours(m, E, 0, 0), r?.(w);
659
+ }, q = () => {
660
+ const b = C.getFullYear(), m = C.getMonth(), E = new Date(b, m, 1), w = new Date(E);
659
661
  w.setDate(w.getDate() - E.getDay());
660
662
  const P = [], k = new Date(w);
661
663
  for (let ae = 0; ae < 42; ae++)
@@ -663,20 +665,20 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
663
665
  return P;
664
666
  }, V = (b) => {
665
667
  if (b.getMonth() === C.getMonth() && !(f && b < f) && !(p && b > p)) {
666
- if (h) {
668
+ if (x) {
667
669
  const E = new Date(b);
668
670
  E.setHours(t?.getHours() ?? 0, t?.getMinutes() ?? 0, 0, 0), r?.(E);
669
671
  return;
670
672
  }
671
- r?.(b), v(!1);
673
+ r?.(b), y(!1);
672
674
  }
673
675
  }, I = () => {
674
- y(new Date(C.getFullYear(), C.getMonth() - 1, 1));
676
+ g(new Date(C.getFullYear(), C.getMonth() - 1, 1));
675
677
  }, W = () => {
676
- y(new Date(C.getFullYear(), C.getMonth() + 1, 1));
678
+ g(new Date(C.getFullYear(), C.getMonth() + 1, 1));
677
679
  }, H = () => {
678
- r?.(null), v(!1);
679
- }, X = d(
680
+ r?.(null), y(!1);
681
+ }, X = u(
680
682
  "w-full border border-border rounded-md transition-colors duration-fast",
681
683
  "bg-surface text-text",
682
684
  "placeholder:text-text-muted",
@@ -689,7 +691,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
689
691
  "h-control-md w-full px-3 text-base": l === "full"
690
692
  },
691
693
  c
692
- ), Z = U(), Q = [
694
+ ), Z = q(), Q = [
693
695
  "January",
694
696
  "February",
695
697
  "March",
@@ -703,34 +705,34 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
703
705
  "November",
704
706
  "December"
705
707
  ];
706
- return /* @__PURE__ */ i("div", { ref: g, className: "relative", children: [
708
+ return /* @__PURE__ */ i("div", { ref: v, className: "relative", children: [
707
709
  /* @__PURE__ */ i("div", { className: "relative", children: [
708
710
  /* @__PURE__ */ e(
709
711
  "input",
710
712
  {
711
- ref: m,
713
+ ref: d,
712
714
  type: "text",
713
- value: $(t ?? null),
715
+ value: D(t ?? null),
714
716
  placeholder: n,
715
717
  disabled: s,
716
718
  required: a,
717
719
  readOnly: !0,
718
- onClick: () => !s && v(!x),
719
- className: d(X, "pr-10 cursor-pointer")
720
+ onClick: () => !s && y(!h),
721
+ className: u(X, "pr-10 cursor-pointer")
720
722
  }
721
723
  ),
722
724
  /* @__PURE__ */ e(
723
725
  "button",
724
726
  {
725
727
  type: "button",
726
- onClick: () => !s && v(!x),
728
+ onClick: () => !s && y(!h),
727
729
  disabled: s,
728
730
  className: "absolute inset-y-0 right-0 flex items-center pr-3 text-text-muted hover:text-text-muted",
729
731
  children: /* @__PURE__ */ e($t, {})
730
732
  }
731
733
  )
732
734
  ] }),
733
- x && /* @__PURE__ */ i("div", { style: A, className: "z-overlay overflow-auto rounded-lg border border-border bg-surface p-4 shadow-overlay min-w-panel", children: [
735
+ h && /* @__PURE__ */ i("div", { style: $, className: "z-overlay overflow-auto rounded-lg border border-border bg-surface p-4 shadow-overlay min-w-panel", children: [
734
736
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-4", children: [
735
737
  /* @__PURE__ */ e(
736
738
  "button",
@@ -755,14 +757,14 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
755
757
  )
756
758
  ] }),
757
759
  /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((b) => /* @__PURE__ */ e("div", { className: "text-xs font-medium text-text-muted text-center py-1", children: b }, b)) }),
758
- /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: Z.map((b, u) => {
760
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: Z.map((b, m) => {
759
761
  const E = b.getMonth() === C.getMonth(), w = t && b.toDateString() === t.toDateString(), P = b.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), k = !E || f && b < f || p && b > p;
760
762
  return /* @__PURE__ */ e(
761
763
  "button",
762
764
  {
763
765
  onClick: () => !k && V(b),
764
766
  disabled: k,
765
- className: d(
767
+ className: u(
766
768
  "w-8 h-8 text-sm rounded transition-colors duration-fast",
767
769
  {
768
770
  "text-text hover:bg-surface-hover": E && !w && !k,
@@ -773,10 +775,10 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
773
775
  ),
774
776
  children: b.getDate()
775
777
  },
776
- u
778
+ m
777
779
  );
778
780
  }) }),
779
- h && /* @__PURE__ */ i("div", { className: "mt-3 flex items-center gap-2 border-t border-border pt-3", children: [
781
+ x && /* @__PURE__ */ i("div", { className: "mt-3 flex items-center gap-2 border-t border-border pt-3", children: [
780
782
  /* @__PURE__ */ e("label", { htmlFor: "datepicker-time", className: "text-sm text-text-muted", children: "Tijd" }),
781
783
  /* @__PURE__ */ e(
782
784
  "input",
@@ -801,7 +803,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
801
803
  /* @__PURE__ */ e(
802
804
  "button",
803
805
  {
804
- onClick: () => v(!1),
806
+ onClick: () => y(!1),
805
807
  className: "text-sm text-info-fg hover:underline",
806
808
  children: "Close"
807
809
  }
@@ -826,85 +828,85 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
826
828
  containerClassName: f,
827
829
  labelClassName: p,
828
830
  className: N,
829
- id: h,
830
- searchable: m,
831
- multiple: x,
832
- value: v,
831
+ id: x,
832
+ searchable: d,
833
+ multiple: h,
834
+ value: y,
833
835
  onChange: C,
834
- allowCreate: y,
835
- onCreateOption: g,
836
- ...A
837
- }, $) => {
838
- const _ = h || `select-${Math.random().toString(36).substr(2, 9)}`, M = !!n, [U, V] = le.useState(!1), [I, W] = le.useState(""), H = le.useRef(null), X = le.useRef(null), Z = Ee(U, X, { matchWidth: !0 }), [Q, b] = le.useState(l);
839
- le.useImperativeHandle($, () => H.current), le.useEffect(() => {
840
- const S = (T) => {
841
- H.current && !H.current.contains(T.target) && V(!1);
836
+ allowCreate: g,
837
+ onCreateOption: v,
838
+ ...$
839
+ }, D) => {
840
+ const _ = x || `select-${Math.random().toString(36).substr(2, 9)}`, M = !!n, [q, V] = le.useState(!1), [I, W] = le.useState(""), H = le.useRef(null), X = le.useRef(null), Z = Ee(q, X, { matchWidth: !0 }), [Q, b] = le.useState(l);
841
+ le.useImperativeHandle(D, () => H.current), le.useEffect(() => {
842
+ const S = (A) => {
843
+ H.current && !H.current.contains(A.target) && V(!1);
842
844
  };
843
845
  return document.addEventListener("mousedown", S), () => document.removeEventListener("mousedown", S);
844
846
  }, []);
845
- const u = le.useCallback(
846
- (S, T) => S.some(
847
- (L) => ge(L.value) === ge(T) || ge(L.label) === ge(T)
847
+ const m = le.useCallback(
848
+ (S, A) => S.some(
849
+ (L) => ge(L.value) === ge(A) || ge(L.label) === ge(A)
848
850
  ),
849
851
  []
850
852
  ), E = le.useCallback(
851
- (S, T) => {
852
- const L = [...S], D = (q) => {
853
- const j = (q ?? "").trim();
854
- j && (u(L, j) || L.push({ value: j, label: j }));
853
+ (S, A) => {
854
+ const L = [...S], T = (U) => {
855
+ const j = (U ?? "").trim();
856
+ j && (m(L, j) || L.push({ value: j, label: j }));
855
857
  };
856
- return Array.isArray(T) ? T.forEach(D) : D(T), L;
858
+ return Array.isArray(A) ? A.forEach(T) : T(A), L;
857
859
  },
858
- [u]
860
+ [m]
859
861
  );
860
862
  le.useEffect(() => {
861
863
  b((S) => {
862
- const T = [...l];
864
+ const A = [...l];
863
865
  return S.forEach((L) => {
864
- !u(T, L.value) && !u(T, L.label) && T.push(L);
865
- }), E(T, v);
866
+ !m(A, L.value) && !m(A, L.label) && A.push(L);
867
+ }), E(A, y);
866
868
  });
867
- }, [l, v, E, u]);
869
+ }, [l, y, E, m]);
868
870
  const w = (S) => {
869
- if (x) {
870
- const T = Array.isArray(v) ? v : [], L = T.includes(S) ? T.filter((D) => D !== S) : [...T, S];
871
+ if (h) {
872
+ const A = Array.isArray(y) ? y : [], L = A.includes(S) ? A.filter((T) => T !== S) : [...A, S];
871
873
  C?.(L);
872
874
  } else
873
875
  C?.(S), V(!1), W("");
874
- }, P = x ? null : Q.find((S) => S.value === v), k = x ? Q.filter(
875
- (S) => Array.isArray(v) && v.includes(S.value)
876
- ) : [], ae = m && I ? Q.filter(
876
+ }, P = h ? null : Q.find((S) => S.value === y), k = h ? Q.filter(
877
+ (S) => Array.isArray(y) && y.includes(S.value)
878
+ ) : [], ae = d && I ? Q.filter(
877
879
  (S) => S.label.toLowerCase().includes(I.toLowerCase())
878
- ) : Q, ne = !!y && !!m && !!I.trim() && !u(Q, I), te = (S) => {
879
- const T = S.trim();
880
- if (!T) return;
881
- const L = g?.(T) ?? {
882
- value: T,
883
- label: T
880
+ ) : Q, ne = !!g && !!d && !!I.trim() && !m(Q, I), te = (S) => {
881
+ const A = S.trim();
882
+ if (!A) return;
883
+ const L = v?.(A) ?? {
884
+ value: A,
885
+ label: A
884
886
  };
885
- if (u(Q, L.value) || u(Q, L.label)) {
886
- w(L.value), W(""), x || V(!1);
887
+ if (m(Q, L.value) || m(Q, L.label)) {
888
+ w(L.value), W(""), h || V(!1);
887
889
  return;
888
890
  }
889
- b((D) => [...D, L]), w(L.value), W(""), x || V(!1);
890
- }, G = () => x ? k.length > 0 ? k.map((S) => S.label).join(", ") : c || "Select options" : P?.label || c || "Select an option";
891
+ b((T) => [...T, L]), w(L.value), W(""), h || V(!1);
892
+ }, G = () => h ? k.length > 0 ? k.map((S) => S.label).join(", ") : c || "Select options" : P?.label || c || "Select an option";
891
893
  return /* @__PURE__ */ i(
892
894
  "div",
893
895
  {
894
896
  ref: H,
895
- className: d(
897
+ className: u(
896
898
  "relative flex flex-col",
897
899
  a && "w-full",
898
900
  f
899
901
  ),
900
- ...A,
902
+ ...$,
901
903
  children: [
902
904
  t && /* @__PURE__ */ e(
903
905
  "label",
904
906
  {
905
907
  htmlFor: _,
906
- onClick: () => V(!U),
907
- className: d(
908
+ onClick: () => V(!q),
909
+ className: u(
908
910
  "block text-xs font-semibold uppercase tracking-label mb-1.5",
909
911
  M ? "text-danger-fg" : "text-text-muted",
910
912
  p
@@ -919,8 +921,8 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
919
921
  ref: X,
920
922
  type: "button",
921
923
  id: _,
922
- onClick: () => V(!U),
923
- className: d(
924
+ onClick: () => V(!q),
925
+ className: u(
924
926
  "flex w-full items-center justify-between gap-2 rounded-md border transition-colors duration-fast text-left",
925
927
  "focus-visible:outline-none focus-visible:focus-ring",
926
928
  "disabled:cursor-not-allowed disabled:bg-surface-hover disabled:text-text-disabled",
@@ -935,17 +937,17 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
935
937
  Xe,
936
938
  {
937
939
  size: 16,
938
- className: d(
940
+ className: u(
939
941
  "shrink-0 opacity-60 transition-transform duration-fast",
940
- U && "rotate-180"
942
+ q && "rotate-180"
941
943
  )
942
944
  }
943
945
  )
944
946
  ]
945
947
  }
946
948
  ),
947
- U && /* @__PURE__ */ i("div", { style: Z, className: "z-overlay flex flex-col overflow-hidden rounded-lg border border-border bg-surface shadow-overlay", children: [
948
- m && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e(
949
+ q && /* @__PURE__ */ i("div", { style: Z, className: "z-overlay flex flex-col overflow-hidden rounded-lg border border-border bg-surface shadow-overlay", children: [
950
+ d && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e(
949
951
  "input",
950
952
  {
951
953
  type: "text",
@@ -955,7 +957,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
955
957
  onKeyDown: (S) => {
956
958
  S.key === "Enter" && ne && (S.preventDefault(), te(I));
957
959
  },
958
- className: d(
960
+ className: u(
959
961
  "w-full px-3 py-2 text-sm rounded-md border",
960
962
  "text-text border-border focus-visible:outline-none focus-visible:focus-ring"
961
963
  )
@@ -964,7 +966,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
964
966
  ne && /* @__PURE__ */ i(
965
967
  "div",
966
968
  {
967
- className: d(
969
+ className: u(
968
970
  "cursor-pointer px-3 py-1.5 text-sm",
969
971
  "text-info-fg hover:bg-surface-hover"
970
972
  ),
@@ -977,7 +979,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
977
979
  }
978
980
  ),
979
981
  /* @__PURE__ */ i("ul", { className: "min-h-0 flex-1 overflow-auto py-1", children: [
980
- c && !x && /* @__PURE__ */ e(
982
+ c && !h && /* @__PURE__ */ e(
981
983
  "li",
982
984
  {
983
985
  className: "cursor-pointer px-3 py-1.5 text-sm text-text-muted hover:bg-surface-hover",
@@ -988,23 +990,23 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
988
990
  }
989
991
  ),
990
992
  ae.map((S) => {
991
- const T = x ? Array.isArray(v) && v.includes(S.value) : v === S.value;
993
+ const A = h ? Array.isArray(y) && y.includes(S.value) : y === S.value;
992
994
  return /* @__PURE__ */ e(
993
995
  "li",
994
996
  {
995
997
  onClick: () => !S.disabled && w(S.value),
996
- className: d(
998
+ className: u(
997
999
  "cursor-pointer px-3 py-1.5 text-sm",
998
1000
  "text-text",
999
1001
  S.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-surface-hover",
1000
- T && "bg-accent-soft text-accent font-semibold"
1002
+ A && "bg-accent-soft text-accent font-semibold"
1001
1003
  ),
1002
1004
  children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
1003
- x && /* @__PURE__ */ e(
1005
+ h && /* @__PURE__ */ e(
1004
1006
  "input",
1005
1007
  {
1006
1008
  type: "checkbox",
1007
- checked: T,
1009
+ checked: A,
1008
1010
  readOnly: !0,
1009
1011
  className: "mr-3 h-4 w-4 rounded border-border [&:not(:checked)]:bg-surface-input text-accent "
1010
1012
  }
@@ -1021,7 +1023,7 @@ const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }
1021
1023
  (n || r) && /* @__PURE__ */ e(
1022
1024
  "p",
1023
1025
  {
1024
- className: d(
1026
+ className: u(
1025
1027
  "mt-1 text-xs",
1026
1028
  M ? "text-danger-fg" : "text-text-muted"
1027
1029
  ),
@@ -1051,19 +1053,19 @@ const Lt = {
1051
1053
  loading: f = !1,
1052
1054
  containerClassName: p,
1053
1055
  labelClassName: N,
1054
- className: h,
1055
- id: m,
1056
- ...x
1057
- }, v) => {
1058
- const C = le.useId(), y = m || `textfield-${C}`, g = !!n, A = n || r ? `${y}-description` : void 0;
1059
- return /* @__PURE__ */ i("div", { className: d("flex flex-col", a && "w-full", p), children: [
1056
+ className: x,
1057
+ id: d,
1058
+ ...h
1059
+ }, y) => {
1060
+ const C = le.useId(), g = d || `textfield-${C}`, v = !!n, $ = n || r ? `${g}-description` : void 0;
1061
+ return /* @__PURE__ */ i("div", { className: u("flex flex-col", a && "w-full", p), children: [
1060
1062
  t && /* @__PURE__ */ e(
1061
1063
  "label",
1062
1064
  {
1063
- htmlFor: y,
1064
- className: d(
1065
+ htmlFor: g,
1066
+ className: u(
1065
1067
  Oe,
1066
- g ? "text-danger-fg" : "text-text-subtle",
1068
+ v ? "text-danger-fg" : "text-text-subtle",
1067
1069
  N
1068
1070
  ),
1069
1071
  children: t
@@ -1074,11 +1076,11 @@ const Lt = {
1074
1076
  /* @__PURE__ */ e(
1075
1077
  "input",
1076
1078
  {
1077
- ref: v,
1078
- id: y,
1079
- "aria-invalid": g || void 0,
1080
- "aria-describedby": A,
1081
- className: d(
1079
+ ref: y,
1080
+ id: g,
1081
+ "aria-invalid": v || void 0,
1082
+ "aria-describedby": $,
1083
+ className: u(
1082
1084
  "block w-full rounded-md border bg-surface-input text-text",
1083
1085
  "transition-colors duration-fast ease-out",
1084
1086
  "placeholder:text-text-subtle",
@@ -1087,10 +1089,10 @@ const Lt = {
1087
1089
  Lt[s],
1088
1090
  l && "pl-9",
1089
1091
  (c || f) && "pr-9",
1090
- g ? "border-danger-border bg-danger-soft" : "border-border hover:border-border-strong",
1091
- h
1092
+ v ? "border-danger-border bg-danger-soft" : "border-border hover:border-border-strong",
1093
+ x
1092
1094
  ),
1093
- ...x
1095
+ ...h
1094
1096
  }
1095
1097
  ),
1096
1098
  (c || f) && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-3 text-text-muted", children: f ? /* @__PURE__ */ e(
@@ -1104,8 +1106,8 @@ const Lt = {
1104
1106
  (n || r) && /* @__PURE__ */ e(
1105
1107
  "p",
1106
1108
  {
1107
- id: A,
1108
- className: d("mt-1 text-xs", g ? "text-danger-fg" : "text-text-subtle"),
1109
+ id: $,
1110
+ className: u("mt-1 text-xs", v ? "text-danger-fg" : "text-text-subtle"),
1109
1111
  children: n || r
1110
1112
  }
1111
1113
  )
@@ -1125,25 +1127,25 @@ function It({
1125
1127
  }) {
1126
1128
  const [p, N] = R([]);
1127
1129
  Y(() => {
1128
- let m = !0;
1129
- return Promise.resolve(n?.()).then((x) => {
1130
- m && x && N(x.data ?? []);
1130
+ let d = !0;
1131
+ return Promise.resolve(n?.()).then((h) => {
1132
+ d && h && N(h.data ?? []);
1131
1133
  }).catch(() => {
1132
1134
  }), () => {
1133
- m = !1;
1135
+ d = !1;
1134
1136
  };
1135
1137
  }, []);
1136
- const h = t ?? {};
1138
+ const x = t ?? {};
1137
1139
  return /* @__PURE__ */ i("div", { className: "flex flex-col gap-2", children: [
1138
1140
  /* @__PURE__ */ e(
1139
1141
  pe,
1140
1142
  {
1141
1143
  size: a,
1142
1144
  fullWidth: !0,
1143
- value: h.folderId ?? "",
1144
- options: p.map((m) => ({ value: m.id, label: m.name })),
1145
+ value: x.folderId ?? "",
1146
+ options: p.map((d) => ({ value: d.id, label: d.name })),
1145
1147
  placeholder: l ?? "Select a folder",
1146
- onChange: (m) => r?.({ ...h, folderId: m })
1148
+ onChange: (d) => r?.({ ...x, folderId: d })
1147
1149
  }
1148
1150
  ),
1149
1151
  f && /* @__PURE__ */ e(
@@ -1151,9 +1153,9 @@ function It({
1151
1153
  {
1152
1154
  size: a,
1153
1155
  disabled: s ?? !1,
1154
- value: h.pathTemplate ?? "",
1156
+ value: x.pathTemplate ?? "",
1155
1157
  placeholder: c ?? "Sub-path e.g. {yyyy}/{mm}/{dd} (optional)",
1156
- onChange: (m) => r?.({ ...h, pathTemplate: m.target.value })
1158
+ onChange: (d) => r?.({ ...x, pathTemplate: d.target.value })
1157
1159
  }
1158
1160
  )
1159
1161
  ] });
@@ -1180,38 +1182,38 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
1180
1182
  containerClassName: f,
1181
1183
  labelClassName: p,
1182
1184
  className: N,
1183
- id: h,
1184
- options: m,
1185
- onRemoteSearch: x,
1186
- onSelect: v,
1185
+ id: x,
1186
+ options: d,
1187
+ onRemoteSearch: h,
1188
+ onSelect: y,
1187
1189
  debounceTime: C = 500,
1188
- showAllOnOpen: y = !1,
1189
- value: g,
1190
- onChange: A,
1191
- ...$
1190
+ showAllOnOpen: g = !1,
1191
+ value: v,
1192
+ onChange: $,
1193
+ ...D
1192
1194
  }, _) => {
1193
- const M = h || `searchfield-${Math.random().toString(36).substr(2, 9)}`, U = !!n, V = se(null), I = se(null), [W, H] = R(g || ""), [X, Z] = R(!1), [Q, b] = R(!1), [u, E] = R(!1);
1195
+ const M = x || `searchfield-${Math.random().toString(36).substr(2, 9)}`, q = !!n, V = se(null), I = se(null), [W, H] = R(v || ""), [X, Z] = R(!1), [Q, b] = R(!1), [m, E] = R(!1);
1194
1196
  Y(() => {
1195
- g !== void 0 && H(g);
1196
- }, [g]);
1197
+ v !== void 0 && H(v);
1198
+ }, [v]);
1197
1199
  const w = me(() => {
1198
- if (y && !u || !W) return m;
1200
+ if (g && !m || !W) return d;
1199
1201
  const S = String(W).toLowerCase();
1200
- return m.filter(
1201
- (T) => String(T.label).toLowerCase().includes(S)
1202
+ return d.filter(
1203
+ (A) => String(A.label).toLowerCase().includes(S)
1202
1204
  );
1203
- }, [W, m, y, u]);
1205
+ }, [W, d, g, m]);
1204
1206
  Y(() => {
1205
- if (!x || !W) {
1207
+ if (!h || !W) {
1206
1208
  b(!1);
1207
1209
  return;
1208
1210
  }
1209
1211
  const S = setTimeout(async () => {
1210
1212
  b(!0);
1211
1213
  try {
1212
- await x(String(W));
1213
- } catch (T) {
1214
- console.error("Remote search failed:", T);
1214
+ await h(String(W));
1215
+ } catch (A) {
1216
+ console.error("Remote search failed:", A);
1215
1217
  } finally {
1216
1218
  b(!1);
1217
1219
  }
@@ -1219,19 +1221,19 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
1219
1221
  return () => {
1220
1222
  clearTimeout(S), b(!1);
1221
1223
  };
1222
- }, [W, C, x]), Y(() => {
1223
- const S = (T) => {
1224
- V.current && !V.current.contains(T.target) && Z(!1);
1224
+ }, [W, C, h]), Y(() => {
1225
+ const S = (A) => {
1226
+ V.current && !V.current.contains(A.target) && Z(!1);
1225
1227
  };
1226
1228
  return document.addEventListener("mousedown", S), () => document.removeEventListener("mousedown", S);
1227
1229
  }, []);
1228
1230
  const P = (S) => {
1229
- const T = S.target.value;
1230
- H(T), Z(!0), E(!0), A && A(S);
1231
+ const A = S.target.value;
1232
+ H(A), Z(!0), E(!0), $ && $(S);
1231
1233
  }, k = (S) => {
1232
- H(S.label), Z(!1), E(!1), v && v(S.value);
1234
+ H(S.label), Z(!1), E(!1), y && y(S.value);
1233
1235
  }, ae = () => {
1234
- (m.length > 0 || x) && (Z(!0), E(!1));
1236
+ (d.length > 0 || h) && (Z(!0), E(!1));
1235
1237
  }, ne = c || Q, te = X && (w.length > 0 || ne), G = me(() => _ || I, [_]);
1236
1238
  return /* @__PURE__ */ i(
1237
1239
  "div",
@@ -1250,7 +1252,7 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
1250
1252
  htmlFor: M,
1251
1253
  className: ue(
1252
1254
  "block text-sm font-medium mb-1",
1253
- U ? "text-danger-fg" : "text-text",
1255
+ q ? "text-danger-fg" : "text-text",
1254
1256
  p || ""
1255
1257
  ),
1256
1258
  children: t
@@ -1278,10 +1280,10 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
1278
1280
  "pr-10",
1279
1281
  // Altijd padding rechts voor de dropdown/loading icon
1280
1282
  // State styles
1281
- U ? "border-danger-border text-danger-fg focus-visible:focus-ring" : "border-border text-text",
1283
+ q ? "border-danger-border text-danger-fg focus-visible:focus-ring" : "border-border text-text",
1282
1284
  N || ""
1283
1285
  ),
1284
- ...$
1286
+ ...D
1285
1287
  }
1286
1288
  ),
1287
1289
  /* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: ne || c ? (
@@ -1333,12 +1335,12 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
1333
1335
  {
1334
1336
  className: ue(
1335
1337
  "mt-1 text-xs",
1336
- U ? "text-danger-fg" : "text-text-muted"
1338
+ q ? "text-danger-fg" : "text-text-muted"
1337
1339
  ),
1338
1340
  children: n || r
1339
1341
  }
1340
1342
  ),
1341
- x && /* @__PURE__ */ i("p", { className: "mt-2 text-xs text-success-fg", children: [
1343
+ h && /* @__PURE__ */ i("p", { className: "mt-2 text-xs text-success-fg", children: [
1342
1344
  "Huidige zoekterm (niet-gedebounced): ",
1343
1345
  String(W)
1344
1346
  ] })
@@ -1354,7 +1356,7 @@ const Ft = de(
1354
1356
  "span",
1355
1357
  {
1356
1358
  "aria-hidden": !0,
1357
- className: d(
1359
+ className: u(
1358
1360
  "relative inline-flex size-switch-track shrink-0 items-center rounded-full",
1359
1361
  "transition-colors duration-fast ease-out",
1360
1362
  t ? "bg-accent" : "bg-surface-hover",
@@ -1363,7 +1365,7 @@ const Ft = de(
1363
1365
  children: /* @__PURE__ */ e(
1364
1366
  "span",
1365
1367
  {
1366
- className: d(
1368
+ className: u(
1367
1369
  "absolute left-0.5 size-switch-knob rounded-full bg-surface shadow-overlay",
1368
1370
  "transition-transform duration-fast ease-out",
1369
1371
  t && "translate-switch"
@@ -1375,7 +1377,7 @@ const Ft = de(
1375
1377
  return /* @__PURE__ */ i(
1376
1378
  "label",
1377
1379
  {
1378
- className: d(
1380
+ className: u(
1379
1381
  "inline-flex items-center gap-2",
1380
1382
  s ? "cursor-not-allowed" : "cursor-pointer",
1381
1383
  a
@@ -1462,74 +1464,74 @@ const Vt = ({
1462
1464
  showCheck: f = !0,
1463
1465
  header: p
1464
1466
  }) => {
1465
- const [N, h] = R(!1), [m, x] = R(null), [v, C] = R({ top: 0, left: 0 }), y = se(null), g = se(null), A = se(null), $ = se(null), _ = Ee(N, g, { placement: a }), M = se(null), U = () => Array.from(
1466
- $.current?.querySelectorAll("button[data-option-value]:not(:disabled)") ?? []
1467
+ const [N, x] = R(!1), [d, h] = R(null), [y, C] = R({ top: 0, left: 0 }), g = se(null), v = se(null), $ = se(null), D = se(null), _ = Ee(N, v, { placement: a }), M = se(null), q = () => Array.from(
1468
+ D.current?.querySelectorAll("button[data-option-value]:not(:disabled)") ?? []
1467
1469
  );
1468
1470
  Y(() => {
1469
- N && U()[0]?.focus();
1471
+ N && q()[0]?.focus();
1470
1472
  }, [N]);
1471
- const V = (u) => {
1472
- if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(u.key)) return;
1473
- const w = U();
1473
+ const V = (m) => {
1474
+ if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(m.key)) return;
1475
+ const w = q();
1474
1476
  if (w.length === 0) return;
1475
- u.preventDefault();
1476
- const P = w.indexOf(document.activeElement), k = u.key === "Home" ? 0 : u.key === "End" ? w.length - 1 : u.key === "ArrowDown" ? (P + 1) % w.length : (P - 1 + w.length) % w.length;
1477
+ m.preventDefault();
1478
+ const P = w.indexOf(document.activeElement), k = m.key === "Home" ? 0 : m.key === "End" ? w.length - 1 : m.key === "ArrowDown" ? (P + 1) % w.length : (P - 1 + w.length) % w.length;
1477
1479
  w[k]?.focus();
1478
1480
  };
1479
1481
  Y(() => {
1480
- const u = (E) => {
1481
- y.current && (!y.current.contains(E.target) || A.current && !A.current.contains(E.target)) && (h(!1), x(null), M.current && (clearTimeout(M.current), M.current = null));
1482
+ const m = (E) => {
1483
+ g.current && (!g.current.contains(E.target) || $.current && !$.current.contains(E.target)) && (x(!1), h(null), M.current && (clearTimeout(M.current), M.current = null));
1482
1484
  };
1483
- return N && document.addEventListener("mousedown", u), () => {
1484
- document.removeEventListener("mousedown", u);
1485
+ return N && document.addEventListener("mousedown", m), () => {
1486
+ document.removeEventListener("mousedown", m);
1485
1487
  };
1486
1488
  }, [N]), Y(() => {
1487
- const u = (E) => {
1488
- E.key === "Escape" && (h(!1), x(null), g.current?.focus(), M.current && (clearTimeout(M.current), M.current = null));
1489
+ const m = (E) => {
1490
+ E.key === "Escape" && (x(!1), h(null), v.current?.focus(), M.current && (clearTimeout(M.current), M.current = null));
1489
1491
  };
1490
- return N && document.addEventListener("keydown", u), () => {
1491
- document.removeEventListener("keydown", u);
1492
+ return N && document.addEventListener("keydown", m), () => {
1493
+ document.removeEventListener("keydown", m);
1492
1494
  };
1493
1495
  }, [N]), Y(() => {
1494
- if (m && y.current) {
1495
- const u = y.current.querySelector(
1496
- `[data-option-value="${m}"]`
1496
+ if (d && g.current) {
1497
+ const m = g.current.querySelector(
1498
+ `[data-option-value="${d}"]`
1497
1499
  );
1498
- if (u) {
1499
- const E = u.getBoundingClientRect();
1500
+ if (m) {
1501
+ const E = m.getBoundingClientRect();
1500
1502
  C({
1501
1503
  top: E.top,
1502
1504
  left: E.right + 8
1503
1505
  });
1504
1506
  }
1505
1507
  }
1506
- }, [m]), Y(() => () => {
1508
+ }, [d]), Y(() => () => {
1507
1509
  M.current && clearTimeout(M.current);
1508
1510
  }, []);
1509
- const I = (u) => {
1510
- u.stopPropagation(), !l && (h(!N), x(null), M.current && (clearTimeout(M.current), M.current = null));
1511
- }, W = (u, E, w) => {
1512
- u.stopPropagation(), !E.disabled && !E.divider && (!E.children || E.children.length === 0) && (s?.(E.value, w), h(!1), x(null));
1513
- }, H = (u) => {
1514
- M.current && (clearTimeout(M.current), M.current = null), u.children && u.children.length > 0 ? x(u.value) : x(null);
1515
- }, X = (u) => {
1516
- u.children && u.children.length > 0 ? M.current = setTimeout(() => {
1517
- x(null);
1518
- }, 150) : x(null);
1519
- }, Z = (u, E, w) => {
1520
- u.stopPropagation(), !E.disabled && !E.divider && (s?.(E.value, w), h(!1), x(null));
1521
- }, Q = d(
1511
+ const I = (m) => {
1512
+ m.stopPropagation(), !l && (x(!N), h(null), M.current && (clearTimeout(M.current), M.current = null));
1513
+ }, W = (m, E, w) => {
1514
+ m.stopPropagation(), !E.disabled && !E.divider && (!E.children || E.children.length === 0) && (s?.(E.value, w), x(!1), h(null));
1515
+ }, H = (m) => {
1516
+ M.current && (clearTimeout(M.current), M.current = null), m.children && m.children.length > 0 ? h(m.value) : h(null);
1517
+ }, X = (m) => {
1518
+ m.children && m.children.length > 0 ? M.current = setTimeout(() => {
1519
+ h(null);
1520
+ }, 150) : h(null);
1521
+ }, Z = (m, E, w) => {
1522
+ m.stopPropagation(), !E.disabled && !E.divider && (s?.(E.value, w), x(!1), h(null));
1523
+ }, Q = u(
1522
1524
  "fixed z-overlay min-w-menu bg-surface rounded-lg shadow-overlay border border-border",
1523
1525
  "max-h-60 overflow-auto"
1524
- ), b = d(
1526
+ ), b = u(
1525
1527
  "fixed z-overlay min-w-menu bg-surface rounded-lg shadow-overlay border border-border",
1526
1528
  "max-h-60 overflow-auto"
1527
1529
  );
1528
1530
  return /* @__PURE__ */ i(
1529
1531
  "div",
1530
1532
  {
1531
- ref: y,
1532
- className: d(
1533
+ ref: g,
1534
+ className: u(
1533
1535
  "relative flex flex-row items-center justify-center rounded-lg hover:bg-surface-hover",
1534
1536
  c
1535
1537
  ),
@@ -1537,21 +1539,21 @@ const Vt = ({
1537
1539
  /* @__PURE__ */ e(
1538
1540
  "button",
1539
1541
  {
1540
- ref: g,
1542
+ ref: v,
1541
1543
  onClick: I,
1542
1544
  disabled: l,
1543
1545
  "aria-haspopup": "menu",
1544
1546
  "aria-expanded": N,
1545
- className: d("inline-flex items-center justify-center", {
1547
+ className: u("inline-flex items-center justify-center", {
1546
1548
  "opacity-50 cursor-not-allowed": l
1547
1549
  }),
1548
1550
  children: t
1549
1551
  }
1550
1552
  ),
1551
- N && /* @__PURE__ */ e("div", { ref: $, className: Q, style: _, onKeyDown: V, children: /* @__PURE__ */ i("div", { className: "p-2", role: "menu", children: [
1553
+ N && /* @__PURE__ */ e("div", { ref: D, className: Q, style: _, onKeyDown: V, children: /* @__PURE__ */ i("div", { className: "p-2", role: "menu", children: [
1552
1554
  p && (typeof p == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-text-muted uppercase tracking-label px-3 py-2", children: p }) : p),
1553
- r.map((u, E) => {
1554
- if (u.divider)
1555
+ r.map((m, E) => {
1556
+ if (m.divider)
1555
1557
  return /* @__PURE__ */ e(
1556
1558
  "div",
1557
1559
  {
@@ -1559,35 +1561,35 @@ const Vt = ({
1559
1561
  },
1560
1562
  `divider-${E}`
1561
1563
  );
1562
- const w = u.children && u.children.length > 0, P = m === u.value;
1564
+ const w = m.children && m.children.length > 0, P = d === m.value;
1563
1565
  return /* @__PURE__ */ i("div", { className: "relative group", children: [
1564
1566
  /* @__PURE__ */ i(
1565
1567
  "button",
1566
1568
  {
1567
- "data-option-value": u.value,
1569
+ "data-option-value": m.value,
1568
1570
  role: "menuitem",
1569
1571
  "aria-haspopup": w ? "menu" : void 0,
1570
- onClick: (k) => W(k, u),
1571
- onMouseEnter: () => H(u),
1572
- onMouseLeave: () => X(u),
1573
- disabled: u.disabled,
1574
- className: d(
1572
+ onClick: (k) => W(k, m),
1573
+ onMouseEnter: () => H(m),
1574
+ onMouseLeave: () => X(m),
1575
+ disabled: m.disabled,
1576
+ className: u(
1575
1577
  "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",
1576
1578
  {
1577
- "opacity-50 cursor-not-allowed": u.disabled,
1579
+ "opacity-50 cursor-not-allowed": m.disabled,
1578
1580
  "bg-surface-hover": P && w
1579
1581
  }
1580
1582
  ),
1581
1583
  children: [
1582
1584
  /* @__PURE__ */ i("div", { className: "flex items-center space-x-2 min-w-0", children: [
1583
- u.icon && /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: u.icon }),
1585
+ m.icon && /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: m.icon }),
1584
1586
  /* @__PURE__ */ i("div", { className: "flex flex-col items-start min-w-0", children: [
1585
- /* @__PURE__ */ e("span", { className: "font-base truncate", children: u.label }),
1586
- u.description && /* @__PURE__ */ e("span", { className: "text-xs text-text-muted", children: u.description })
1587
+ /* @__PURE__ */ e("span", { className: "font-base truncate", children: m.label }),
1588
+ m.description && /* @__PURE__ */ e("span", { className: "text-xs text-text-muted", children: m.description })
1587
1589
  ] })
1588
1590
  ] }),
1589
1591
  /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1590
- f && n === u.value && /* @__PURE__ */ e(Me, { className: "size-icon-md shrink-0 text-success-fg", "aria-hidden": !0 }),
1592
+ f && n === m.value && /* @__PURE__ */ e(Me, { className: "size-icon-md shrink-0 text-success-fg", "aria-hidden": !0 }),
1591
1593
  w && /* @__PURE__ */ e("span", { className: "text-text-muted text-xs", children: "▶" })
1592
1594
  ] })
1593
1595
  ]
@@ -1596,21 +1598,21 @@ const Vt = ({
1596
1598
  w && P && /* @__PURE__ */ e(
1597
1599
  "div",
1598
1600
  {
1599
- ref: A,
1601
+ ref: $,
1600
1602
  className: b,
1601
1603
  style: {
1602
- top: `${v.top}px`,
1603
- left: `${v.left}px`
1604
+ top: `${y.top}px`,
1605
+ left: `${y.left}px`
1604
1606
  },
1605
1607
  onMouseEnter: () => {
1606
- M.current && (clearTimeout(M.current), M.current = null), x(u.value);
1608
+ M.current && (clearTimeout(M.current), M.current = null), h(m.value);
1607
1609
  },
1608
1610
  onMouseLeave: () => {
1609
1611
  M.current = setTimeout(() => {
1610
- x(null);
1612
+ h(null);
1611
1613
  }, 150);
1612
1614
  },
1613
- children: /* @__PURE__ */ e("div", { className: "p-2", children: u.children.map((k, ae) => {
1615
+ children: /* @__PURE__ */ e("div", { className: "p-2", children: m.children.map((k, ae) => {
1614
1616
  if (k.divider)
1615
1617
  return /* @__PURE__ */ e(
1616
1618
  "div",
@@ -1619,7 +1621,7 @@ const Vt = ({
1619
1621
  },
1620
1622
  `divider-${ae}`
1621
1623
  );
1622
- const ne = typeof n == "object" && n[u.value] && n[u.value].includes(
1624
+ const ne = typeof n == "object" && n[m.value] && n[m.value].includes(
1623
1625
  k.value
1624
1626
  ) || n === k.value;
1625
1627
  return /* @__PURE__ */ i(
@@ -1628,10 +1630,10 @@ const Vt = ({
1628
1630
  onClick: (te) => Z(
1629
1631
  te,
1630
1632
  k,
1631
- u.value
1633
+ m.value
1632
1634
  ),
1633
1635
  disabled: k.disabled,
1634
- className: d(
1636
+ className: u(
1635
1637
  "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",
1636
1638
  {
1637
1639
  "opacity-50 cursor-not-allowed": k.disabled
@@ -1653,16 +1655,16 @@ const Vt = ({
1653
1655
  }) })
1654
1656
  }
1655
1657
  )
1656
- ] }, u.value);
1658
+ ] }, m.value);
1657
1659
  }),
1658
1660
  (() => {
1659
- const u = r.reduce((E, w) => {
1661
+ const m = r.reduce((E, w) => {
1660
1662
  if (w.divider) return E;
1661
1663
  const P = w.children ? w.children.filter((k) => !k.divider).length : 0;
1662
1664
  return E + 1 + P;
1663
1665
  }, 0);
1664
- return u > 1 && /* @__PURE__ */ e("div", { className: "border-t border-border mt-2 pt-2", children: /* @__PURE__ */ i("div", { className: "text-xs text-text-muted px-3 py-1", children: [
1665
- u,
1666
+ return m > 1 && /* @__PURE__ */ e("div", { className: "border-t border-border mt-2 pt-2", children: /* @__PURE__ */ i("div", { className: "text-xs text-text-muted px-3 py-1", children: [
1667
+ m,
1666
1668
  " options available"
1667
1669
  ] }) });
1668
1670
  })()
@@ -1670,7 +1672,7 @@ const Vt = ({
1670
1672
  ]
1671
1673
  }
1672
1674
  );
1673
- }, Ht = () => /* @__PURE__ */ e(J, { icon: Ne, size: "md", color: "current" }), Ut = ({ active: t }) => /* @__PURE__ */ e(J, { icon: Qe, size: "sm", className: t ? "text-text" : "text-text-subtle" }), qt = ({ active: t }) => /* @__PURE__ */ e(J, { icon: be, size: "sm", className: t ? "text-text" : "text-text-subtle" }), Wt = () => /* @__PURE__ */ e(J, { icon: Pe, size: "md", color: "current" }), Kt = () => /* @__PURE__ */ e(J, { icon: ye, size: "md", color: "current" }), _t = () => /* @__PURE__ */ e(J, { icon: et, size: "md", color: "current" }), Gt = () => /* @__PURE__ */ e(J, { icon: tt, size: "md", color: "current" }), Be = () => /* @__PURE__ */ e(J, { icon: be, size: "md", color: "current" }), Jt = (t) => {
1675
+ }, Ht = () => /* @__PURE__ */ e(J, { icon: Ne, size: "md", color: "current" }), qt = ({ active: t }) => /* @__PURE__ */ e(J, { icon: Qe, size: "sm", className: t ? "text-text" : "text-text-subtle" }), Ut = ({ active: t }) => /* @__PURE__ */ e(J, { icon: be, size: "sm", className: t ? "text-text" : "text-text-subtle" }), Wt = () => /* @__PURE__ */ e(J, { icon: Pe, size: "md", color: "current" }), Kt = () => /* @__PURE__ */ e(J, { icon: ye, size: "md", color: "current" }), _t = () => /* @__PURE__ */ e(J, { icon: et, size: "md", color: "current" }), Gt = () => /* @__PURE__ */ e(J, { icon: tt, size: "md", color: "current" }), Be = () => /* @__PURE__ */ e(J, { icon: be, size: "md", color: "current" }), Jt = (t) => {
1674
1676
  const r = (s) => t.multiSelect && Array.isArray(t.value) ? t.value?.includes(s) : t.value === s, n = (s) => {
1675
1677
  t.multiSelect && Array.isArray(t.value) ? t.onChange(t.value.filter((a) => a !== s)) : t.onChange(s);
1676
1678
  };
@@ -1700,7 +1702,7 @@ const Vt = ({
1700
1702
  children: /* @__PURE__ */ e(
1701
1703
  "span",
1702
1704
  {
1703
- className: d(r(s.value) && "text-accent"),
1705
+ className: u(r(s.value) && "text-accent"),
1704
1706
  children: s.label
1705
1707
  }
1706
1708
  )
@@ -1728,19 +1730,19 @@ const Vt = ({
1728
1730
  pageSizeOptions: f = [10, 25, 50, 100],
1729
1731
  defaultPageSize: p = 10,
1730
1732
  actions: N = [],
1731
- onRowClick: h,
1732
- selectable: m = !1,
1733
- selectedRows: x = [],
1734
- onSelectionChange: v,
1735
- getRowKey: C = (U, V) => V,
1736
- emptyContent: y,
1737
- hoverable: g = !0,
1738
- bordered: A = !1,
1739
- striped: $ = !1,
1733
+ onRowClick: x,
1734
+ selectable: d = !1,
1735
+ selectedRows: h = [],
1736
+ onSelectionChange: y,
1737
+ getRowKey: C = (q, V) => V,
1738
+ emptyContent: g,
1739
+ hoverable: v = !0,
1740
+ bordered: $ = !1,
1741
+ striped: D = !1,
1740
1742
  className: _,
1741
1743
  rowClassName: M
1742
1744
  }) => {
1743
- const [U, V] = R(""), [I, W] = R({
1745
+ const [q, V] = R(""), [I, W] = R({
1744
1746
  column: null,
1745
1747
  direction: null
1746
1748
  }), [H, X] = R({
@@ -1748,10 +1750,10 @@ const Vt = ({
1748
1750
  pageSize: p
1749
1751
  }), Z = se(null), Q = me(() => {
1750
1752
  let o = t;
1751
- if (s && U.trim()) {
1753
+ if (s && q.trim()) {
1752
1754
  const z = r.filter(
1753
1755
  (F) => F.searchable !== !1
1754
- ), B = U.toLowerCase();
1756
+ ), B = q.toLowerCase();
1755
1757
  o = o.filter((F) => z.some((O) => {
1756
1758
  const re = typeof O.accessor == "function" ? O.accessor(F) : F[O.accessor];
1757
1759
  return String(re || "").toLowerCase().includes(B);
@@ -1765,7 +1767,7 @@ const Vt = ({
1765
1767
  return String(O || "") === z.value;
1766
1768
  }));
1767
1769
  }), o;
1768
- }, [t, U, r, s, l]), b = me(() => {
1770
+ }, [t, q, r, s, l]), b = me(() => {
1769
1771
  if (!I.column || !I.direction) return Q;
1770
1772
  const o = r.find((z) => z.id === I.column);
1771
1773
  return o ? [...Q].sort((z, B) => {
@@ -1773,7 +1775,7 @@ const Vt = ({
1773
1775
  let re = 0;
1774
1776
  return F < O ? re = -1 : F > O && (re = 1), I.direction === "desc" ? -re : re;
1775
1777
  }) : Q;
1776
- }, [Q, I, r]), u = me(() => {
1778
+ }, [Q, I, r]), m = me(() => {
1777
1779
  if (!c) return b;
1778
1780
  const o = H.page * H.pageSize, z = o + H.pageSize;
1779
1781
  return b.slice(o, z);
@@ -1788,42 +1790,42 @@ const Vt = ({
1788
1790
  X({ page: 0, pageSize: o });
1789
1791
  }, []), k = ce(
1790
1792
  (o, z) => {
1791
- if (!v) return;
1793
+ if (!y) return;
1792
1794
  const B = C(o, 0);
1793
- x.map((F, O) => C(F, O)), v(z ? [...x, o] : x.filter(
1794
- (F, O) => C(x[O], O) !== B
1795
+ h.map((F, O) => C(F, O)), y(z ? [...h, o] : h.filter(
1796
+ (F, O) => C(h[O], O) !== B
1795
1797
  ));
1796
1798
  },
1797
- [x, v, C]
1799
+ [h, y, C]
1798
1800
  ), ae = ce(
1799
1801
  (o) => {
1800
- v && v(o ? [...u] : []);
1802
+ y && y(o ? [...m] : []);
1801
1803
  },
1802
- [u, v]
1804
+ [m, y]
1803
1805
  );
1804
1806
  Y(() => {
1805
1807
  X((o) => ({ ...o, page: 0 }));
1806
- }, [U, I]), Y(() => {
1808
+ }, [q, I]), Y(() => {
1807
1809
  X((o) => ({ ...o, page: 0 }));
1808
1810
  }, [l.map((o) => o.value).join(",")]);
1809
- const ne = b.length, te = Math.ceil(ne / H.pageSize), G = H.page * H.pageSize + 1, S = Math.min(G + H.pageSize - 1, ne), T = u.length > 0 && u.every((o) => {
1811
+ const ne = b.length, te = Math.ceil(ne / H.pageSize), G = H.page * H.pageSize + 1, S = Math.min(G + H.pageSize - 1, ne), A = m.length > 0 && m.every((o) => {
1810
1812
  const z = C(o, 0);
1811
- return x.some(
1813
+ return h.some(
1812
1814
  (B, F) => C(B, F) === z
1813
1815
  );
1814
- }), L = u.some((o) => {
1816
+ }), L = m.some((o) => {
1815
1817
  const z = C(o, 0);
1816
- return x.some(
1818
+ return h.some(
1817
1819
  (B, F) => C(B, F) === z
1818
1820
  );
1819
- }), D = d(
1821
+ }), T = u(
1820
1822
  "w-full text-sm leading-5 text-text border-collapse",
1821
1823
  _
1822
- ), q = d("bg-surface"), j = d(
1824
+ ), U = u("bg-surface"), j = u(
1823
1825
  "text-text p-3 border-b border-border"
1824
- ), K = d("h-row-lg", {
1825
- "hover:bg-surface-sunk": g,
1826
- "cursor-pointer": h
1826
+ ), K = u("h-row-lg", {
1827
+ "hover:bg-surface-sunk": v,
1828
+ "cursor-pointer": x
1827
1829
  });
1828
1830
  return /* @__PURE__ */ i("div", { className: "space-y-4", children: [
1829
1831
  (s || l.length > 0) && /* @__PURE__ */ e("div", { className: "pt-4 pb-2", children: /* @__PURE__ */ i("div", { className: "flex flex-wrap gap-4 items-start", children: [
@@ -1832,7 +1834,7 @@ const Vt = ({
1832
1834
  he,
1833
1835
  {
1834
1836
  placeholder: a,
1835
- value: U,
1837
+ value: q,
1836
1838
  onChange: (o) => V(o.target.value),
1837
1839
  startIcon: /* @__PURE__ */ e(Ht, {}),
1838
1840
  className: "max-w-sm"
@@ -1848,15 +1850,15 @@ const Vt = ({
1848
1850
  tableColumns: r.length
1849
1851
  }
1850
1852
  ) }),
1851
- /* @__PURE__ */ i("table", { ref: Z, className: d(D, "min-w-full"), children: [
1852
- /* @__PURE__ */ e("thead", { className: q, children: /* @__PURE__ */ i("tr", { children: [
1853
- m && /* @__PURE__ */ e("th", { className: d(j, "w-12"), children: /* @__PURE__ */ e(
1853
+ /* @__PURE__ */ i("table", { ref: Z, className: u(T, "min-w-full"), children: [
1854
+ /* @__PURE__ */ e("thead", { className: U, children: /* @__PURE__ */ i("tr", { children: [
1855
+ d && /* @__PURE__ */ e("th", { className: u(j, "w-12"), children: /* @__PURE__ */ e(
1854
1856
  "input",
1855
1857
  {
1856
1858
  type: "checkbox",
1857
- checked: T,
1859
+ checked: A,
1858
1860
  ref: (o) => {
1859
- o && (o.indeterminate = L && !T);
1861
+ o && (o.indeterminate = L && !A);
1860
1862
  },
1861
1863
  onChange: (o) => ae(o.target.checked),
1862
1864
  className: "rounded border-border [&:not(:checked)]:bg-surface-input text-accent"
@@ -1865,7 +1867,7 @@ const Vt = ({
1865
1867
  !n && r.map((o) => /* @__PURE__ */ e(
1866
1868
  "th",
1867
1869
  {
1868
- className: d(
1870
+ className: u(
1869
1871
  j,
1870
1872
  "font-semibold text-xs text-text-muted uppercase tracking-label",
1871
1873
  "group",
@@ -1885,19 +1887,19 @@ const Vt = ({
1885
1887
  o.sortable && /* @__PURE__ */ i(
1886
1888
  "div",
1887
1889
  {
1888
- className: d(
1890
+ className: u(
1889
1891
  "flex flex-col opacity-0 group-hover:opacity-100 transition-opacity",
1890
1892
  I.column === o.id && "opacity-100"
1891
1893
  ),
1892
1894
  children: [
1893
1895
  /* @__PURE__ */ e(
1894
- Ut,
1896
+ qt,
1895
1897
  {
1896
1898
  active: I.column === o.id && I.direction === "asc"
1897
1899
  }
1898
1900
  ),
1899
1901
  /* @__PURE__ */ e(
1900
- qt,
1902
+ Ut,
1901
1903
  {
1902
1904
  active: I.column === o.id && I.direction === "desc"
1903
1905
  }
@@ -1909,35 +1911,35 @@ const Vt = ({
1909
1911
  },
1910
1912
  o.id
1911
1913
  )),
1912
- N.length > 0 && /* @__PURE__ */ e("th", { className: d(j, "w-20"), children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Actions" }) })
1914
+ N.length > 0 && /* @__PURE__ */ e("th", { className: u(j, "w-20"), children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Actions" }) })
1913
1915
  ] }) }),
1914
- /* @__PURE__ */ e("tbody", { children: u.length === 0 || n ? !n && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
1916
+ /* @__PURE__ */ e("tbody", { children: m.length === 0 || n ? !n && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
1915
1917
  "td",
1916
1918
  {
1917
- colSpan: r.length + (m ? 1 : 0) + (N.length > 0 ? 1 : 0),
1918
- className: d(
1919
+ colSpan: r.length + (d ? 1 : 0) + (N.length > 0 ? 1 : 0),
1920
+ className: u(
1919
1921
  j,
1920
1922
  "text-center py-8 text-text-muted"
1921
1923
  ),
1922
- children: y || "No data available"
1924
+ children: g || "No data available"
1923
1925
  }
1924
- ) }) : u.map((o, z) => {
1925
- const B = C(o, z), F = x.some(
1926
+ ) }) : m.map((o, z) => {
1927
+ const B = C(o, z), F = h.some(
1926
1928
  (O, re) => C(O, re) === B
1927
1929
  );
1928
1930
  return /* @__PURE__ */ i(
1929
1931
  "tr",
1930
1932
  {
1931
- className: d(
1933
+ className: u(
1932
1934
  K,
1933
1935
  { "bg-accent-soft": F },
1934
1936
  M?.(o, z)
1935
1937
  ),
1936
1938
  onClick: (O) => {
1937
- O.stopPropagation(), h?.(o, z);
1939
+ O.stopPropagation(), x?.(o, z);
1938
1940
  },
1939
1941
  children: [
1940
- m && /* @__PURE__ */ e("td", { className: j, children: /* @__PURE__ */ e(
1942
+ d && /* @__PURE__ */ e("td", { className: j, children: /* @__PURE__ */ e(
1941
1943
  "input",
1942
1944
  {
1943
1945
  type: "checkbox",
@@ -1953,7 +1955,7 @@ const Vt = ({
1953
1955
  return /* @__PURE__ */ e(
1954
1956
  "td",
1955
1957
  {
1956
- className: d(j, {
1958
+ className: u(j, {
1957
1959
  "text-left": O.align === "left" || !O.align,
1958
1960
  "text-center": O.align === "center",
1959
1961
  "text-right": O.align === "right",
@@ -2081,12 +2083,12 @@ const Vt = ({
2081
2083
  const [a, l] = R(t[0]?.id || ""), c = r || a, f = (p) => {
2082
2084
  n ? n(p) : l(p);
2083
2085
  };
2084
- 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((p) => /* @__PURE__ */ e(
2086
+ return /* @__PURE__ */ e("div", { className: u("border-b border-border", s), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: t.map((p) => /* @__PURE__ */ e(
2085
2087
  "button",
2086
2088
  {
2087
2089
  onClick: () => !p.disabled && f(p.id),
2088
2090
  disabled: p.disabled,
2089
- className: d(
2091
+ className: u(
2090
2092
  "border-b-2 py-2 px-1 text-sm font-medium transition-colors duration-fast",
2091
2093
  {
2092
2094
  "border-accent-border text-text": c === p.id,
@@ -2096,7 +2098,7 @@ const Vt = ({
2096
2098
  ),
2097
2099
  children: /* @__PURE__ */ i("span", { className: "flex items-center gap-2", children: [
2098
2100
  p.label,
2099
- p.badge && /* @__PURE__ */ e("span", { className: d(
2101
+ p.badge && /* @__PURE__ */ e("span", { className: u(
2100
2102
  "inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",
2101
2103
  c === p.id ? "bg-accent-soft text-accent" : "bg-surface-hover text-text-muted"
2102
2104
  ), children: p.badge })
@@ -2115,12 +2117,12 @@ const Vt = ({
2115
2117
  }) => {
2116
2118
  const [f, p] = R(
2117
2119
  r || n || t[0]?.id || ""
2118
- ), N = n || f, h = (y) => {
2119
- s ? s(y) : p(y);
2120
- }, m = {
2120
+ ), N = n || f, x = (g) => {
2121
+ s ? s(g) : p(g);
2122
+ }, d = {
2121
2123
  activeTab: N,
2122
- setActiveTab: h
2123
- }, x = t.find((y) => y.id === N), v = d(
2124
+ setActiveTab: x
2125
+ }, h = t.find((g) => g.id === N), y = u(
2124
2126
  "flex",
2125
2127
  {
2126
2128
  "border-b border-border px-2": a === "default" || a === "underline",
@@ -2129,8 +2131,8 @@ const Vt = ({
2129
2131
  "space-x-8": a === "default" || a === "underline"
2130
2132
  },
2131
2133
  c
2132
- ), C = (y, g) => {
2133
- const A = "transition-colors duration-fast font-medium", $ = {
2134
+ ), C = (g, v) => {
2135
+ const $ = "transition-colors duration-fast font-medium", D = {
2134
2136
  "text-xs px-2 py-1": l === "sm",
2135
2137
  "text-sm px-3 py-2": l === "md",
2136
2138
  "text-base px-4 py-3": l === "lg"
@@ -2142,44 +2144,44 @@ const Vt = ({
2142
2144
  // Underline variant
2143
2145
  "border-b-2 pb-2": a === "underline"
2144
2146
  }, M = {
2145
- "opacity-50 cursor-not-allowed": y.disabled,
2146
- "cursor-pointer": !y.disabled
2147
- }, U = g ? {
2147
+ "opacity-50 cursor-not-allowed": g.disabled,
2148
+ "cursor-pointer": !g.disabled
2149
+ }, q = v ? {
2148
2150
  "border-accent-border text-text": a === "default" || a === "underline",
2149
2151
  "bg-surface text-text shadow-none": a === "pills"
2150
- } : {}, V = !g && !y.disabled ? {
2152
+ } : {}, V = !v && !g.disabled ? {
2151
2153
  "border-transparent text-text-muted hover:text-text": a === "default",
2152
2154
  "text-text-muted hover:text-text": a === "pills",
2153
2155
  "border-transparent text-text-muted hover:text-text hover:border-border": a === "underline"
2154
2156
  } : {};
2155
- return d(A, $, _, M, U, V);
2157
+ return u($, D, _, M, q, V);
2156
2158
  };
2157
- return /* @__PURE__ */ e(Yt.Provider, { value: m, children: /* @__PURE__ */ i("div", { children: [
2158
- /* @__PURE__ */ e("div", { className: v, role: "tablist", children: t.map((y) => /* @__PURE__ */ e(
2159
+ return /* @__PURE__ */ e(Yt.Provider, { value: d, children: /* @__PURE__ */ i("div", { children: [
2160
+ /* @__PURE__ */ e("div", { className: y, role: "tablist", children: t.map((g) => /* @__PURE__ */ e(
2159
2161
  "button",
2160
2162
  {
2161
2163
  type: "button",
2162
2164
  role: "tab",
2163
- "aria-selected": N === y.id,
2164
- "aria-controls": `tabpanel-${y.id}`,
2165
- disabled: y.disabled,
2166
- onClick: () => !y.disabled && h(y.id),
2167
- className: C(y, N === y.id),
2165
+ "aria-selected": N === g.id,
2166
+ "aria-controls": `tabpanel-${g.id}`,
2167
+ disabled: g.disabled,
2168
+ onClick: () => !g.disabled && x(g.id),
2169
+ className: C(g, N === g.id),
2168
2170
  children: /* @__PURE__ */ i("span", { className: "flex items-center gap-2", children: [
2169
- y.label,
2170
- y.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: y.badge })
2171
+ g.label,
2172
+ 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 })
2171
2173
  ] })
2172
2174
  },
2173
- y.id
2175
+ g.id
2174
2176
  )) }),
2175
- x?.content && /* @__PURE__ */ e(
2177
+ h?.content && /* @__PURE__ */ e(
2176
2178
  "div",
2177
2179
  {
2178
2180
  role: "tabpanel",
2179
2181
  id: `tabpanel-${N}`,
2180
2182
  "aria-labelledby": `tab-${N}`,
2181
2183
  className: "mt-4",
2182
- children: x.content
2184
+ children: h.content
2183
2185
  }
2184
2186
  )
2185
2187
  ] }) });
@@ -2201,36 +2203,36 @@ function Fe({
2201
2203
  backdropClassName: f,
2202
2204
  children: p,
2203
2205
  footer: N,
2204
- showCloseButton: h = !0
2206
+ showCloseButton: x = !0
2205
2207
  }) {
2206
- const m = se(null), x = se(null);
2208
+ const d = se(null), h = se(null);
2207
2209
  Y(() => {
2208
2210
  if (!t || !l) return;
2209
- const C = (y) => {
2210
- y.key === "Escape" && r();
2211
+ const C = (g) => {
2212
+ g.key === "Escape" && r();
2211
2213
  };
2212
2214
  return document.addEventListener("keydown", C), () => document.removeEventListener("keydown", C);
2213
- }, [t, l, r]), Y(() => (t ? (x.current = document.activeElement, m.current && m.current.focus(), document.body.style.overflow = "hidden") : (x.current && x.current.focus(), document.body.style.overflow = ""), () => {
2215
+ }, [t, l, r]), Y(() => (t ? (h.current = document.activeElement, d.current && d.current.focus(), document.body.style.overflow = "hidden") : (h.current && h.current.focus(), document.body.style.overflow = ""), () => {
2214
2216
  document.body.style.overflow = "";
2215
2217
  }), [t]);
2216
- const v = (C) => {
2218
+ const y = (C) => {
2217
2219
  a && C.target === C.currentTarget && r();
2218
2220
  };
2219
2221
  return t ? /* @__PURE__ */ e(
2220
2222
  "div",
2221
2223
  {
2222
- className: d(
2224
+ className: u(
2223
2225
  "fixed inset-0 z-modal flex items-center justify-center p-4",
2224
2226
  "bg-scrim",
2225
2227
  // 'animate-fade-in',
2226
2228
  f
2227
2229
  ),
2228
- onClick: v,
2230
+ onClick: y,
2229
2231
  children: /* @__PURE__ */ i(
2230
2232
  "div",
2231
2233
  {
2232
- ref: m,
2233
- className: d(
2234
+ ref: d,
2235
+ className: u(
2234
2236
  "relative w-full bg-surface rounded-lg shadow-modal",
2235
2237
  // 'animate-scale-in',
2236
2238
  "focus:outline-none",
@@ -2242,7 +2244,7 @@ function Fe({
2242
2244
  "aria-labelledby": n ? "modal-title" : void 0,
2243
2245
  tabIndex: -1,
2244
2246
  children: [
2245
- (n || h) && /* @__PURE__ */ i("div", { className: "flex items-center justify-between p-6 pb-0", children: [
2247
+ (n || x) && /* @__PURE__ */ i("div", { className: "flex items-center justify-between p-6 pb-0", children: [
2246
2248
  n && /* @__PURE__ */ e(
2247
2249
  "span",
2248
2250
  {
@@ -2251,7 +2253,7 @@ function Fe({
2251
2253
  children: n
2252
2254
  }
2253
2255
  ),
2254
- h && /* @__PURE__ */ e(
2256
+ x && /* @__PURE__ */ e(
2255
2257
  "button",
2256
2258
  {
2257
2259
  onClick: r,
@@ -2312,20 +2314,20 @@ const Qt = {
2312
2314
  underline: f = !1,
2313
2315
  lineHeight: p = "normal",
2314
2316
  as: N,
2315
- className: h,
2316
- children: m,
2317
- ...x
2317
+ className: x,
2318
+ children: d,
2319
+ ...h
2318
2320
  }) => {
2319
- const v = N || sr(t), C = t === "caption", y = t === "label", g = t === "code", A = d(
2321
+ const y = N || sr(t), C = t === "caption", g = t === "label", v = t === "code", $ = u(
2320
2322
  "font-sans",
2321
2323
  // Variant — caption and label pin their own size/weight
2322
2324
  C && "text-xs text-text-subtle",
2323
- y && "text-xs font-semibold uppercase tracking-label text-text-subtle",
2324
- g && "font-mono text-sm rounded-sm bg-surface-hover px-1 py-0.5",
2325
+ g && "text-xs font-semibold uppercase tracking-label text-text-subtle",
2326
+ v && "font-mono text-sm rounded-sm bg-surface-hover px-1 py-0.5",
2325
2327
  // Size — only where the variant does not pin it
2326
- !C && !y && !g && Qt[r],
2328
+ !C && !g && !v && Qt[r],
2327
2329
  // Weight — label owns its weight
2328
- !y && er[n],
2330
+ !g && er[n],
2329
2331
  tr[s],
2330
2332
  rr[a],
2331
2333
  // Line height only overrides the body variant
@@ -2333,9 +2335,9 @@ const Qt = {
2333
2335
  c && "italic",
2334
2336
  f && "underline",
2335
2337
  l && "truncate",
2336
- h
2338
+ x
2337
2339
  );
2338
- return /* @__PURE__ */ e(v, { className: A, ...x, children: m });
2340
+ return /* @__PURE__ */ e(y, { className: $, ...h, children: d });
2339
2341
  };
2340
2342
  function sr(t) {
2341
2343
  return {
@@ -2356,33 +2358,33 @@ const ar = ({
2356
2358
  onListFiles: f,
2357
2359
  onListMounts: p,
2358
2360
  onUploadFile: N,
2359
- onDownloadFile: h,
2360
- onRegisterFile: m
2361
+ onDownloadFile: x,
2362
+ onRegisterFile: d
2361
2363
  }) => {
2362
- const [x, v] = R(!1), [C, y] = R([]), [g, A] = R(null), [$, _] = R("/"), [M, U] = R([]), [V, I] = R(!1), [W, H] = R(""), [X, Z] = R(
2364
+ const [h, y] = R(!1), [C, g] = R([]), [v, $] = R(null), [D, _] = R("/"), [M, q] = R([]), [V, I] = R(!1), [W, H] = R(""), [X, Z] = R(
2363
2365
  typeof t == "object" ? t : null
2364
- ), [Q, b] = R(!1), [u, E] = R(""), w = se(null);
2366
+ ), [Q, b] = R(!1), [m, E] = R(""), w = se(null);
2365
2367
  Y(() => {
2366
- x && P();
2367
- }, [x]), Y(() => {
2368
- x && g && k();
2369
- }, [x, g, $, W]);
2368
+ h && P();
2369
+ }, [h]), Y(() => {
2370
+ h && v && k();
2371
+ }, [h, v, D, W]);
2370
2372
  const P = async () => {
2371
2373
  I(!0);
2372
2374
  try {
2373
2375
  const o = await p?.();
2374
- o?.data && y(o.data);
2376
+ o?.data && g(o.data);
2375
2377
  } catch (o) {
2376
2378
  console.error("Failed to load mounts", o);
2377
2379
  } finally {
2378
2380
  I(!1);
2379
2381
  }
2380
2382
  }, k = async () => {
2381
- if (g) {
2383
+ if (v) {
2382
2384
  I(!0);
2383
2385
  try {
2384
- const o = await f?.({ mountId: g.id, name: W, path: $ });
2385
- o?.data && U(o.data);
2386
+ const o = await f?.({ mountId: v.id, name: W, path: D });
2387
+ o?.data && q(o.data);
2386
2388
  } catch (o) {
2387
2389
  console.error("Failed to load files", o);
2388
2390
  } finally {
@@ -2405,7 +2407,7 @@ const ar = ({
2405
2407
  providerKey: z.name,
2406
2408
  ownerId: "me"
2407
2409
  };
2408
- Z(O), r(O, F), v(!1);
2410
+ Z(O), r(O, F), y(!1);
2409
2411
  } catch (B) {
2410
2412
  console.error("Local file selection failed", B);
2411
2413
  } finally {
@@ -2414,19 +2416,19 @@ const ar = ({
2414
2416
  }
2415
2417
  }, ne = async (o) => {
2416
2418
  const z = o.target.files?.[0];
2417
- if (!(!z || !g)) {
2419
+ if (!(!z || !v)) {
2418
2420
  I(!0);
2419
2421
  try {
2420
2422
  const B = await z.arrayBuffer(), F = await N?.({
2421
2423
  file: new Uint8Array(B),
2422
2424
  filename: z.name,
2423
2425
  mimeType: z.type || "application/octet-stream",
2424
- mountId: g.id,
2425
- path: $
2426
+ mountId: v.id,
2427
+ path: D
2426
2428
  });
2427
2429
  if (F?.data) {
2428
2430
  const O = F.data;
2429
- Z(O), r(O, new Uint8Array(B)), v(!1);
2431
+ Z(O), r(O, new Uint8Array(B)), y(!1);
2430
2432
  }
2431
2433
  } catch (B) {
2432
2434
  console.error("Upload failed", B);
@@ -2435,17 +2437,17 @@ const ar = ({
2435
2437
  }
2436
2438
  }
2437
2439
  }, te = async () => {
2438
- if (!(!u || !g)) {
2440
+ if (!(!m || !v)) {
2439
2441
  I(!0);
2440
2442
  try {
2441
- const o = `${$}${u}/`;
2442
- m && (await m({
2443
- name: u,
2443
+ const o = `${D}${m}/`;
2444
+ d && (await d({
2445
+ name: m,
2444
2446
  type: "folder",
2445
- path: $,
2447
+ path: D,
2446
2448
  mimeType: "application/x-directory",
2447
2449
  size: 0,
2448
- mountId: g.id,
2450
+ mountId: v.id,
2449
2451
  providerKey: o,
2450
2452
  ownerId: "me"
2451
2453
  }), await k()), b(!1), E("");
@@ -2458,8 +2460,8 @@ const ar = ({
2458
2460
  }, G = async (o) => {
2459
2461
  I(!0);
2460
2462
  try {
2461
- const z = await h?.(o.id);
2462
- Z(o), r(o, z), v(!1);
2463
+ const z = await x?.(o.id);
2464
+ Z(o), r(o, z), y(!1);
2463
2465
  } catch (z) {
2464
2466
  console.error("Failed to download file", z);
2465
2467
  } finally {
@@ -2467,37 +2469,37 @@ const ar = ({
2467
2469
  }
2468
2470
  }, S = (o) => {
2469
2471
  o.stopPropagation(), Z(null), r(null);
2470
- }, T = me(() => {
2472
+ }, A = me(() => {
2471
2473
  const o = /* @__PURE__ */ new Set(), z = [];
2472
2474
  return M.forEach((B) => {
2473
2475
  if (B.type === "folder") {
2474
- B.path === $ && o.add(B.name);
2476
+ B.path === D && o.add(B.name);
2475
2477
  return;
2476
2478
  }
2477
- const F = B.providerKey || B.name, re = ($ ? F.substring($.length) : F).split("/").filter((ie) => ie !== "");
2479
+ const F = B.providerKey || B.name, re = (D ? F.substring(D.length) : F).split("/").filter((ie) => ie !== "");
2478
2480
  re.length > 1 ? o.add(re[0]) : re.length === 1 && z.push(B);
2479
2481
  }), {
2480
2482
  folders: Array.from(o).sort(),
2481
2483
  files: z.sort((B, F) => B.name.localeCompare(F.name))
2482
2484
  };
2483
- }, [M, $]), L = (o) => {
2485
+ }, [M, D]), L = (o) => {
2484
2486
  _((z) => `${z}${o}/`);
2485
- }, D = () => {
2486
- const o = $.split("/").filter((z) => z !== "");
2487
+ }, T = () => {
2488
+ const o = D.split("/").filter((z) => z !== "");
2487
2489
  o.pop(), o.length === 0 ? _("/") : _(`${o.join("/")}/`);
2488
- }, q = me(() => {
2489
- const o = T.folders.map((z) => ({
2490
+ }, U = me(() => {
2491
+ const o = A.folders.map((z) => ({
2490
2492
  id: `folder-${z}`,
2491
2493
  name: z,
2492
2494
  type: "folder"
2493
2495
  }));
2494
- return T.files.forEach((z) => {
2496
+ return A.files.forEach((z) => {
2495
2497
  o.push({
2496
2498
  ...z,
2497
2499
  type: "file"
2498
2500
  });
2499
2501
  }), o;
2500
- }, [T]), j = [
2502
+ }, [A]), j = [
2501
2503
  {
2502
2504
  id: "name",
2503
2505
  header: "Name",
@@ -2511,7 +2513,7 @@ const ar = ({
2511
2513
  color: z.type === "folder" ? "warning" : "secondary"
2512
2514
  }
2513
2515
  ),
2514
- /* @__PURE__ */ e("span", { className: d(z.type === "folder" && "font-medium"), children: o })
2516
+ /* @__PURE__ */ e("span", { className: u(z.type === "folder" && "font-medium"), children: o })
2515
2517
  ] })
2516
2518
  },
2517
2519
  {
@@ -2557,7 +2559,7 @@ const ar = ({
2557
2559
  header: "",
2558
2560
  accessor: "id",
2559
2561
  align: "right",
2560
- cell: (o, z) => /* @__PURE__ */ e(ee, { size: "sm", variant: "outline", onClick: () => A(z), children: "Open" })
2562
+ cell: (o, z) => /* @__PURE__ */ e(ee, { size: "sm", variant: "outline", onClick: () => $(z), children: "Open" })
2561
2563
  }
2562
2564
  ];
2563
2565
  return /* @__PURE__ */ i("div", { className: "space-y-1", children: [
@@ -2565,8 +2567,8 @@ const ar = ({
2565
2567
  /* @__PURE__ */ i(
2566
2568
  "div",
2567
2569
  {
2568
- onClick: () => !l && v(!0),
2569
- className: d(
2570
+ onClick: () => !l && y(!0),
2571
+ className: u(
2570
2572
  "flex items-center gap-3 px-3 py-2 border rounded-lg cursor-pointer transition-colors",
2571
2573
  "hover:border-border-strong bg-surface",
2572
2574
  a ? "border-danger-border" : "border-border",
@@ -2590,11 +2592,11 @@ const ar = ({
2590
2592
  /* @__PURE__ */ e(
2591
2593
  Fe,
2592
2594
  {
2593
- open: x,
2595
+ open: h,
2594
2596
  onClose: () => {
2595
- v(!1), A(null), _("/"), b(!1);
2597
+ y(!1), $(null), _("/"), b(!1);
2596
2598
  },
2597
- title: g ? `Explorer: ${g.name}` : "Select Storage Mount",
2599
+ title: v ? `Explorer: ${v.name}` : "Select Storage Mount",
2598
2600
  size: "lg",
2599
2601
  children: /* @__PURE__ */ e(
2600
2602
  Xt,
@@ -2604,7 +2606,7 @@ const ar = ({
2604
2606
  {
2605
2607
  id: "remote",
2606
2608
  label: "Platform Storage",
2607
- content: /* @__PURE__ */ e("div", { className: "space-y-4", children: g ? /* @__PURE__ */ i(fe, { children: [
2609
+ content: /* @__PURE__ */ e("div", { className: "space-y-4", children: v ? /* @__PURE__ */ i(fe, { children: [
2608
2610
  /* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-2", children: [
2609
2611
  /* @__PURE__ */ e(
2610
2612
  ee,
@@ -2612,13 +2614,13 @@ const ar = ({
2612
2614
  variant: "ghost",
2613
2615
  size: "sm",
2614
2616
  onClick: () => {
2615
- $ && $ !== "/" ? D() : A(null);
2617
+ D && D !== "/" ? T() : $(null);
2616
2618
  },
2617
2619
  leftIcon: /* @__PURE__ */ e(J, { icon: ze, size: "xs" }),
2618
- children: $ ? "Back" : "Back to Mounts"
2620
+ children: D ? "Back" : "Back to Mounts"
2619
2621
  }
2620
2622
  ),
2621
- /* @__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: $ }) }),
2623
+ /* @__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: D }) }),
2622
2624
  /* @__PURE__ */ e("div", { className: "flex-grow min-w-40", children: /* @__PURE__ */ e(
2623
2625
  he,
2624
2626
  {
@@ -2671,7 +2673,7 @@ const ar = ({
2671
2673
  {
2672
2674
  size: "sm",
2673
2675
  placeholder: "Folder name",
2674
- value: u,
2676
+ value: m,
2675
2677
  onChange: (o) => E(o.target.value),
2676
2678
  autoFocus: !0
2677
2679
  }
@@ -2682,7 +2684,7 @@ const ar = ({
2682
2684
  /* @__PURE__ */ e("div", { className: "max-h-100 overflow-auto rounded-lg border border-border", children: /* @__PURE__ */ e(
2683
2685
  Te,
2684
2686
  {
2685
- data: q,
2687
+ data: U,
2686
2688
  columns: j,
2687
2689
  loading: V,
2688
2690
  emptyContent: "This folder is empty",
@@ -2696,7 +2698,7 @@ const ar = ({
2696
2698
  columns: K,
2697
2699
  loading: V,
2698
2700
  emptyContent: "No storage mounts configured",
2699
- onRowClick: (o) => A(o)
2701
+ onRowClick: (o) => $(o)
2700
2702
  }
2701
2703
  ) }) })
2702
2704
  },
@@ -2749,18 +2751,18 @@ const ar = ({
2749
2751
  labelClassName: f,
2750
2752
  className: p,
2751
2753
  id: N,
2752
- rows: h = 4,
2753
- ...m
2754
- }, x) => {
2755
- const v = le.useId(), C = N || `textarea-${v}`, y = !!n, g = n || r ? `${C}-description` : void 0;
2756
- return /* @__PURE__ */ i("div", { className: d("flex flex-col", a && "w-full", c), children: [
2754
+ rows: x = 4,
2755
+ ...d
2756
+ }, h) => {
2757
+ const y = le.useId(), C = N || `textarea-${y}`, g = !!n, v = n || r ? `${C}-description` : void 0;
2758
+ return /* @__PURE__ */ i("div", { className: u("flex flex-col", a && "w-full", c), children: [
2757
2759
  t && /* @__PURE__ */ e(
2758
2760
  "label",
2759
2761
  {
2760
2762
  htmlFor: C,
2761
- className: d(
2763
+ className: u(
2762
2764
  Oe,
2763
- y ? "text-danger-fg" : "text-text-subtle",
2765
+ g ? "text-danger-fg" : "text-text-subtle",
2764
2766
  f
2765
2767
  ),
2766
2768
  children: t
@@ -2770,22 +2772,22 @@ const ar = ({
2770
2772
  /* @__PURE__ */ e(
2771
2773
  "textarea",
2772
2774
  {
2773
- ref: x,
2775
+ ref: h,
2774
2776
  id: C,
2775
- rows: h,
2776
- "aria-invalid": y || void 0,
2777
- "aria-describedby": g,
2778
- className: d(
2777
+ rows: x,
2778
+ "aria-invalid": g || void 0,
2779
+ "aria-describedby": v,
2780
+ className: u(
2779
2781
  "block w-full resize-y rounded-md border bg-surface-input text-text",
2780
2782
  "transition-colors duration-fast ease-out",
2781
2783
  "placeholder:text-text-subtle",
2782
2784
  "focus-visible:outline-none focus-visible:focus-ring",
2783
2785
  "disabled:cursor-not-allowed disabled:bg-surface-hover disabled:text-text-disabled",
2784
2786
  lr[s],
2785
- y ? "border-danger-border bg-danger-soft" : "border-border hover:border-border-strong",
2787
+ g ? "border-danger-border bg-danger-soft" : "border-border hover:border-border-strong",
2786
2788
  p
2787
2789
  ),
2788
- ...m
2790
+ ...d
2789
2791
  }
2790
2792
  ),
2791
2793
  l && /* @__PURE__ */ e(
@@ -2799,8 +2801,8 @@ const ar = ({
2799
2801
  (n || r) && /* @__PURE__ */ e(
2800
2802
  "p",
2801
2803
  {
2802
- id: g,
2803
- className: d("mt-1 text-xs", y ? "text-danger-fg" : "text-text-subtle"),
2804
+ id: v,
2805
+ className: u("mt-1 text-xs", g ? "text-danger-fg" : "text-text-subtle"),
2804
2806
  children: n || r
2805
2807
  }
2806
2808
  )
@@ -2844,40 +2846,40 @@ const Qr = ({
2844
2846
  submitButton: f = { label: "Submit", variant: "primary" },
2845
2847
  cancelButton: p = { label: "Cancel", variant: "outline" },
2846
2848
  showButtons: N = !0,
2847
- layout: h = "vertical",
2848
- size: m = "md",
2849
- loading: x = !1,
2850
- className: v,
2849
+ layout: x = "vertical",
2850
+ size: d = "md",
2851
+ loading: h = !1,
2852
+ className: y,
2851
2853
  ref: C,
2852
- sdk: y
2854
+ sdk: g
2853
2855
  }) => {
2854
- const [g, A] = R(r || {}), [$, _] = R({}), [M, U] = R({});
2856
+ const [v, $] = R(r || {}), [D, _] = R({}), [M, q] = R({});
2855
2857
  Y(() => {
2856
- r && A({ ...r });
2858
+ r && $({ ...r });
2857
2859
  }, [r]);
2858
2860
  const V = ce(
2859
- (b, u, E) => {
2861
+ (b, m, E) => {
2860
2862
  const w = t.flatMap((P) => P.items).find((P) => P.name === b);
2861
2863
  if (!w) return null;
2862
- if (w.required && (u == null || u === ""))
2864
+ if (w.required && (m == null || m === ""))
2863
2865
  return `${w.label} is required`;
2864
2866
  if (w.type === "array") {
2865
- if (w.required && (!u || u.length === 0))
2867
+ if (w.required && (!m || m.length === 0))
2866
2868
  return `${w.label} cannot be empty.`;
2867
- if (u && !Array.isArray(u))
2869
+ if (m && !Array.isArray(m))
2868
2870
  return `${w.label} must be an array.`;
2869
- if (Array.isArray(u) && w.arrayFields) {
2871
+ if (Array.isArray(m) && w.arrayFields) {
2870
2872
  const P = [];
2871
2873
  let k = !1;
2872
- if (u.forEach((ae, ne) => {
2874
+ if (m.forEach((ae, ne) => {
2873
2875
  const te = {};
2874
2876
  for (const G of w.arrayFields) {
2875
2877
  const S = ae?.[G.name];
2876
2878
  if (G.required && (S == null || S === ""))
2877
2879
  te[G.name] = `${G.label} is required`, k = !0;
2878
2880
  else if (G.validator) {
2879
- const T = G.validator(S, ae);
2880
- T && (te[G.name] = T, k = !0);
2881
+ const A = G.validator(S, ae);
2882
+ A && (te[G.name] = A, k = !0);
2881
2883
  }
2882
2884
  }
2883
2885
  P[ne] = te;
@@ -2885,52 +2887,52 @@ const Qr = ({
2885
2887
  return JSON.stringify(P);
2886
2888
  }
2887
2889
  }
2888
- return w.validator ? w.validator(u, E) : null;
2890
+ return w.validator ? w.validator(m, E) : null;
2889
2891
  },
2890
2892
  [t]
2891
2893
  ), I = ce(
2892
- (b, u) => {
2894
+ (b, m) => {
2893
2895
  let E = or(
2894
- g,
2896
+ v,
2895
2897
  b,
2896
- u
2898
+ m
2897
2899
  );
2898
- t.flatMap((k) => k.items).find((k) => k.name === b)?.removeIfEmpty && (u == null || u === "") && (E = cr(E, b)), A(E), U((k) => ({ ...k, [b]: !0 }));
2899
- const P = V(b, u, E);
2900
+ t.flatMap((k) => k.items).find((k) => k.name === b)?.removeIfEmpty && (m == null || m === "") && (E = cr(E, b)), $(E), q((k) => ({ ...k, [b]: !0 }));
2901
+ const P = V(b, m, E);
2900
2902
  _((k) => ({
2901
2903
  ...k,
2902
2904
  [b]: P || ""
2903
2905
  })), a?.(E, b);
2904
2906
  },
2905
- [g, t, V, a]
2907
+ [v, t, V, a]
2906
2908
  ), W = ce(
2907
2909
  async (b) => {
2908
- if (b.preventDefault(), x) return;
2909
- const u = {}, E = t.flatMap((P) => P.items);
2910
+ if (b.preventDefault(), h) return;
2911
+ const m = {}, E = t.flatMap((P) => P.items);
2910
2912
  for (const P of E) {
2911
- if (P.hidden || P.conditional && !P.conditional(g))
2913
+ if (P.hidden || P.conditional && !P.conditional(v))
2912
2914
  continue;
2913
2915
  const k = V(
2914
2916
  P.name,
2915
- Ae(g, P.name),
2916
- g
2917
+ Ae(v, P.name),
2918
+ v
2917
2919
  );
2918
- k && (u[P.name] = k);
2920
+ k && (m[P.name] = k);
2919
2921
  }
2920
2922
  if (c) {
2921
- const P = c(g);
2922
- P && Object.assign(u, P);
2923
+ const P = c(v);
2924
+ P && Object.assign(m, P);
2923
2925
  }
2924
- if (_(u), Object.keys(u).some((P) => u[P]))
2926
+ if (_(m), Object.keys(m).some((P) => m[P]))
2925
2927
  return;
2926
- const w = l ? l(g) : g;
2927
- await n?.(g, w);
2928
+ const w = l ? l(v) : v;
2929
+ await n?.(v, w);
2928
2930
  },
2929
- [g, t, V, c, l, n, x]
2931
+ [v, t, V, c, l, n, h]
2930
2932
  ), H = ce(
2931
2933
  (b) => {
2932
- const u = Ae(g, b.name), E = M[b.name] ? $[b.name] : void 0, w = b.disabled || x, P = {
2933
- value: u || "",
2934
+ const m = Ae(v, b.name), E = M[b.name] ? D[b.name] : void 0, w = b.disabled || h, P = {
2935
+ value: m || "",
2934
2936
  disabled: w,
2935
2937
  required: b.required,
2936
2938
  placeholder: b.placeholder,
@@ -2951,7 +2953,7 @@ const Qr = ({
2951
2953
  type: b.textType || b.type,
2952
2954
  autoComplete: b.autocomplete,
2953
2955
  error: E,
2954
- size: m
2956
+ size: d
2955
2957
  }
2956
2958
  );
2957
2959
  case "textarea":
@@ -2962,7 +2964,7 @@ const Qr = ({
2962
2964
  onChange: (k) => I(b.name, k.target.value),
2963
2965
  rows: 4,
2964
2966
  error: E,
2965
- size: m
2967
+ size: d
2966
2968
  }
2967
2969
  );
2968
2970
  case "select":
@@ -2979,7 +2981,7 @@ const Qr = ({
2979
2981
  multiple: b.multiple,
2980
2982
  allowCreate: b.allowCreate,
2981
2983
  error: E,
2982
- size: m
2984
+ size: d
2983
2985
  }
2984
2986
  );
2985
2987
  case "checkbox":
@@ -2987,9 +2989,9 @@ const Qr = ({
2987
2989
  xe,
2988
2990
  {
2989
2991
  ...P,
2990
- checked: !!u,
2992
+ checked: !!m,
2991
2993
  onChange: (k) => I(b.name, k.target.checked),
2992
- size: m
2994
+ size: d
2993
2995
  }
2994
2996
  );
2995
2997
  case "radio":
@@ -3004,7 +3006,7 @@ const Qr = ({
3004
3006
  type: "radio",
3005
3007
  name: b.name,
3006
3008
  value: k.value,
3007
- checked: u === k.value,
3009
+ checked: m === k.value,
3008
3010
  onChange: () => I(b.name, k.value),
3009
3011
  disabled: w || k.disabled,
3010
3012
  className: "size-checkbox shrink-0 border border-border-strong bg-surface-input accent-accent focus-visible:outline-none focus-visible:focus-ring"
@@ -3020,9 +3022,9 @@ const Qr = ({
3020
3022
  Ce,
3021
3023
  {
3022
3024
  ...P,
3023
- value: u ? new Date(u) : null,
3025
+ value: m ? new Date(m) : null,
3024
3026
  onChange: (k) => I(b.name, k),
3025
- size: m
3027
+ size: d
3026
3028
  }
3027
3029
  );
3028
3030
  case "file":
@@ -3030,28 +3032,28 @@ const Qr = ({
3030
3032
  ar,
3031
3033
  {
3032
3034
  ...P,
3033
- value: u,
3035
+ value: m,
3034
3036
  onChange: (k) => I(b.name, k),
3035
3037
  error: E,
3036
- onListFiles: (k) => y?.http.invoke({
3038
+ onListFiles: (k) => g?.http.invoke({
3037
3039
  method: "POST",
3038
3040
  action: "storage.file.list",
3039
3041
  body: k
3040
3042
  }),
3041
- onListMounts: () => y?.http.invoke({
3043
+ onListMounts: () => g?.http.invoke({
3042
3044
  method: "GET",
3043
3045
  action: "storage.mount"
3044
3046
  }),
3045
- onUploadFile: (k) => y?.http.invoke({
3047
+ onUploadFile: (k) => g?.http.invoke({
3046
3048
  method: "POST",
3047
3049
  action: "storage.file.upload",
3048
3050
  body: k
3049
3051
  }),
3050
- onDownloadFile: (k) => y?.http.invoke({
3052
+ onDownloadFile: (k) => g?.http.invoke({
3051
3053
  method: "GET",
3052
3054
  action: `storage.file.${k}.download`
3053
3055
  }),
3054
- onRegisterFile: (k) => y?.http.invoke({
3056
+ onRegisterFile: (k) => g?.http.invoke({
3055
3057
  method: "POST",
3056
3058
  action: "storage.file.folder",
3057
3059
  body: k
@@ -3062,26 +3064,26 @@ const Qr = ({
3062
3064
  return /* @__PURE__ */ e(
3063
3065
  It,
3064
3066
  {
3065
- value: u || {},
3067
+ value: m || {},
3066
3068
  onChange: (k) => I(b.name, k),
3067
- onListFolders: () => y?.http.invoke({
3069
+ onListFolders: () => g?.http.invoke({
3068
3070
  method: "GET",
3069
3071
  action: "storage.mount"
3070
3072
  }),
3071
3073
  disabled: w,
3072
- size: m,
3074
+ size: d,
3073
3075
  placeholder: b.placeholder
3074
3076
  }
3075
3077
  );
3076
3078
  case "custom":
3077
3079
  return b.customComponent?.({
3078
- value: u,
3080
+ value: m,
3079
3081
  onChange: (k) => I(b.name, k),
3080
3082
  error: E,
3081
3083
  disabled: w
3082
3084
  });
3083
3085
  case "array": {
3084
- const k = u || [];
3086
+ const k = m || [];
3085
3087
  let ae = [];
3086
3088
  if (typeof E == "string" && E.startsWith("["))
3087
3089
  try {
@@ -3093,30 +3095,30 @@ const Qr = ({
3093
3095
  }, te = (S) => {
3094
3096
  I(
3095
3097
  b.name,
3096
- k.filter((T, L) => L !== S)
3098
+ k.filter((A, L) => L !== S)
3097
3099
  );
3098
- }, G = (S, T, L) => {
3099
- const D = [...k];
3100
- D[S] = {
3101
- ...D[S],
3102
- [T]: L
3103
- }, I(b.name, D);
3100
+ }, G = (S, A, L) => {
3101
+ const T = [...k];
3102
+ T[S] = {
3103
+ ...T[S],
3104
+ [A]: L
3105
+ }, I(b.name, T);
3104
3106
  };
3105
3107
  return /* @__PURE__ */ i("div", { className: "flex flex-col gap-2", children: [
3106
- k.map((S, T) => /* @__PURE__ */ i("div", { className: "flex items-start gap-2", children: [
3108
+ k.map((S, A) => /* @__PURE__ */ i("div", { className: "flex items-start gap-2", children: [
3107
3109
  /* @__PURE__ */ e("div", { className: "grid flex-1 gap-2 sm:grid-cols-2", children: b.arrayFields?.map((L) => {
3108
- const D = ae?.[T]?.[L.name];
3110
+ const T = ae?.[A]?.[L.name];
3109
3111
  return /* @__PURE__ */ i(
3110
3112
  "div",
3111
3113
  {
3112
3114
  className: "flex flex-col gap-1",
3113
3115
  children: [
3114
- T === 0 && /* @__PURE__ */ i("label", { className: "block text-xs font-semibold uppercase tracking-label text-text-subtle", children: [
3116
+ A === 0 && /* @__PURE__ */ i("label", { className: "block text-xs font-semibold uppercase tracking-label text-text-subtle", children: [
3115
3117
  L.label,
3116
3118
  L.required && /* @__PURE__ */ e("span", { className: "ml-1 text-danger-fg", children: "*" })
3117
3119
  ] }),
3118
3120
  (() => {
3119
- const q = {
3121
+ const U = {
3120
3122
  value: S?.[L.name] || "",
3121
3123
  disabled: w,
3122
3124
  required: L.required,
@@ -3133,40 +3135,40 @@ const Qr = ({
3133
3135
  return /* @__PURE__ */ e(
3134
3136
  he,
3135
3137
  {
3136
- ...q,
3138
+ ...U,
3137
3139
  onChange: (j) => G(
3138
- T,
3140
+ A,
3139
3141
  L.name,
3140
3142
  j.target.value
3141
3143
  ),
3142
3144
  type: L.textType || L.type,
3143
3145
  autoComplete: L.autocomplete,
3144
- error: D,
3145
- size: m
3146
+ error: T,
3147
+ size: d
3146
3148
  }
3147
3149
  );
3148
3150
  case "textarea":
3149
3151
  return /* @__PURE__ */ e(
3150
3152
  Se,
3151
3153
  {
3152
- ...q,
3154
+ ...U,
3153
3155
  onChange: (j) => G(
3154
- T,
3156
+ A,
3155
3157
  L.name,
3156
3158
  j.target.value
3157
3159
  ),
3158
3160
  rows: 4,
3159
- error: D,
3160
- size: m
3161
+ error: T,
3162
+ size: d
3161
3163
  }
3162
3164
  );
3163
3165
  case "select":
3164
3166
  return /* @__PURE__ */ e(
3165
3167
  pe,
3166
3168
  {
3167
- ...q,
3169
+ ...U,
3168
3170
  onChange: (j) => G(
3169
- T,
3171
+ A,
3170
3172
  L.name,
3171
3173
  j
3172
3174
  ),
@@ -3179,22 +3181,22 @@ const Qr = ({
3179
3181
  searchable: L.searchable,
3180
3182
  multiple: L.multiple,
3181
3183
  allowCreate: L.allowCreate,
3182
- error: D,
3183
- size: m
3184
+ error: T,
3185
+ size: d
3184
3186
  }
3185
3187
  );
3186
3188
  case "checkbox":
3187
3189
  return /* @__PURE__ */ e(
3188
3190
  xe,
3189
3191
  {
3190
- ...q,
3192
+ ...U,
3191
3193
  checked: !!S?.[L.name],
3192
3194
  onChange: (j) => G(
3193
- T,
3195
+ A,
3194
3196
  L.name,
3195
3197
  j.target.checked
3196
3198
  ),
3197
- size: m
3199
+ size: d
3198
3200
  }
3199
3201
  );
3200
3202
  case "radio":
@@ -3207,11 +3209,11 @@ const Qr = ({
3207
3209
  "input",
3208
3210
  {
3209
3211
  type: "radio",
3210
- name: `${b.name}.${T}.${L.name}`,
3212
+ name: `${b.name}.${A}.${L.name}`,
3211
3213
  value: j.value,
3212
3214
  checked: S?.[L.name] === j.value,
3213
3215
  onChange: () => G(
3214
- T,
3216
+ A,
3215
3217
  L.name,
3216
3218
  j.value
3217
3219
  ),
@@ -3229,14 +3231,14 @@ const Qr = ({
3229
3231
  return /* @__PURE__ */ e(
3230
3232
  Ce,
3231
3233
  {
3232
- ...q,
3234
+ ...U,
3233
3235
  value: j ? new Date(j) : null,
3234
3236
  onChange: (K) => G(
3235
- T,
3237
+ A,
3236
3238
  L.name,
3237
3239
  K
3238
3240
  ),
3239
- size: m
3241
+ size: d
3240
3242
  }
3241
3243
  );
3242
3244
  }
@@ -3244,11 +3246,11 @@ const Qr = ({
3244
3246
  return L.customComponent?.({
3245
3247
  value: S?.[L.name],
3246
3248
  onChange: (j) => G(
3247
- T,
3249
+ A,
3248
3250
  L.name,
3249
3251
  j
3250
3252
  ),
3251
- error: D,
3253
+ error: T,
3252
3254
  disabled: w
3253
3255
  });
3254
3256
  // Add other field types here as needed
@@ -3260,7 +3262,7 @@ const Qr = ({
3260
3262
  ] });
3261
3263
  }
3262
3264
  })(),
3263
- D && /* @__PURE__ */ e("p", { className: "text-xs text-danger-fg", children: D })
3265
+ T && /* @__PURE__ */ e("p", { className: "text-xs text-danger-fg", children: T })
3264
3266
  ]
3265
3267
  },
3266
3268
  L.name
@@ -3274,13 +3276,13 @@ const Qr = ({
3274
3276
  variant: "ghost",
3275
3277
  size: "md",
3276
3278
  "aria-label": `${b.label} verwijderen`,
3277
- onClick: () => te(T),
3279
+ onClick: () => te(A),
3278
3280
  disabled: w,
3279
- className: d("shrink-0", T === 0 && "mt-5"),
3281
+ className: u("shrink-0", A === 0 && "mt-5"),
3280
3282
  children: /* @__PURE__ */ e(st, { className: "size-icon-md" })
3281
3283
  }
3282
3284
  )
3283
- ] }, T)),
3285
+ ] }, A)),
3284
3286
  /* @__PURE__ */ i(
3285
3287
  ee,
3286
3288
  {
@@ -3302,14 +3304,14 @@ const Qr = ({
3302
3304
  return null;
3303
3305
  }
3304
3306
  },
3305
- [g, M, $, x, m, I]
3307
+ [v, M, D, h, d, I]
3306
3308
  ), X = ce(
3307
3309
  (b) => {
3308
- if (b.conditional && !b.conditional(g))
3310
+ if (b.conditional && !b.conditional(v))
3309
3311
  return null;
3310
- const u = b.items.filter((w) => !(w.hidden || w.conditional && !w.conditional(g)));
3311
- if (u.length === 0) return null;
3312
- const E = d(
3312
+ const m = b.items.filter((w) => !(w.hidden || w.conditional && !w.conditional(v)));
3313
+ if (m.length === 0) return null;
3314
+ const E = u(
3313
3315
  b.layout === "flex" ? "flex flex-wrap gap-3" : "grid gap-3",
3314
3316
  b.layout !== "flex" && {
3315
3317
  "grid-cols-1": !b.columns || b.columns === 1,
@@ -3328,10 +3330,10 @@ const Qr = ({
3328
3330
  /* @__PURE__ */ e("span", { className: "text-sm font-semibold text-text", children: b.title }),
3329
3331
  b.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs leading-4 text-text-subtle", children: b.description })
3330
3332
  ] }),
3331
- /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e("div", { className: E, children: u.map((w) => (M[w.name] && $[w.name], /* @__PURE__ */ i(
3333
+ /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e("div", { className: E, children: m.map((w) => (M[w.name] && D[w.name], /* @__PURE__ */ i(
3332
3334
  "div",
3333
3335
  {
3334
- className: d(
3336
+ className: u(
3335
3337
  "flex min-w-0 flex-col gap-1.5",
3336
3338
  w.type === "checkbox" && "justify-center"
3337
3339
  ),
@@ -3354,17 +3356,17 @@ const Qr = ({
3354
3356
  b.id
3355
3357
  );
3356
3358
  },
3357
- [g, M, $, H]
3358
- ), Z = d(
3359
+ [v, M, D, H]
3360
+ ), Z = u(
3359
3361
  "overflow-hidden rounded-lg border border-border bg-surface",
3360
3362
  {
3361
- "max-w-md": m === "sm",
3362
- "max-w-2xl": m === "md",
3363
- "max-w-4xl": m === "lg",
3364
- "max-w-full": m === "full"
3363
+ "max-w-md": d === "sm",
3364
+ "max-w-2xl": d === "md",
3365
+ "max-w-4xl": d === "lg",
3366
+ "max-w-full": d === "full"
3365
3367
  },
3366
- v
3367
- ), Q = m === "full" ? "md" : m;
3368
+ y
3369
+ ), Q = d === "full" ? "md" : d;
3368
3370
  return /* @__PURE__ */ i("form", { ref: C, onSubmit: W, className: Z, children: [
3369
3371
  /* @__PURE__ */ e("div", { className: "flex flex-col", children: t.map(X) }),
3370
3372
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2 border-t border-border-subtle bg-surface-sunk px-5 py-3", children: N && /* @__PURE__ */ i(fe, { children: [
@@ -3375,7 +3377,7 @@ const Qr = ({
3375
3377
  type: "button",
3376
3378
  variant: p.variant ?? "ghost",
3377
3379
  size: p.size || Q,
3378
- disabled: p.disabled || x,
3380
+ disabled: p.disabled || h,
3379
3381
  onClick: s,
3380
3382
  className: p.className,
3381
3383
  children: p.label
@@ -3387,8 +3389,8 @@ const Qr = ({
3387
3389
  type: "submit",
3388
3390
  variant: f.variant,
3389
3391
  size: f.size || Q,
3390
- disabled: f.disabled || x,
3391
- loading: x,
3392
+ disabled: f.disabled || h,
3393
+ loading: h,
3392
3394
  className: f.className,
3393
3395
  children: f.label
3394
3396
  }
@@ -3468,7 +3470,7 @@ function tn({
3468
3470
  return /* @__PURE__ */ i(
3469
3471
  "span",
3470
3472
  {
3471
- className: d(
3473
+ className: u(
3472
3474
  // Base styles
3473
3475
  "inline-flex items-center font-medium rounded-full",
3474
3476
  // Variant styles
@@ -3482,13 +3484,13 @@ function tn({
3482
3484
  n && /* @__PURE__ */ e(
3483
3485
  "span",
3484
3486
  {
3485
- className: d(
3487
+ className: u(
3486
3488
  "w-2 h-2 rounded-full mr-1.5",
3487
3489
  ur[t]
3488
3490
  )
3489
3491
  }
3490
3492
  ),
3491
- s && /* @__PURE__ */ e("span", { className: d("flex-shrink-0", f && "mr-1"), children: s }),
3493
+ s && /* @__PURE__ */ e("span", { className: u("flex-shrink-0", f && "mr-1"), children: s }),
3492
3494
  f,
3493
3495
  a && l && /* @__PURE__ */ e(
3494
3496
  "button",
@@ -3520,14 +3522,14 @@ function rn({
3520
3522
  return /* @__PURE__ */ i(
3521
3523
  "div",
3522
3524
  {
3523
- className: d(
3525
+ className: u(
3524
3526
  "flex flex-col items-center gap-2.5 text-center",
3525
3527
  l && "rounded-lg border border-border bg-surface px-11 py-9 shadow-overlay",
3526
3528
  c
3527
3529
  ),
3528
3530
  ...f,
3529
3531
  children: [
3530
- t != null && /* @__PURE__ */ e("span", { className: d("flex size-disc items-center justify-center rounded-full text-2xl", mr[r]), children: t }),
3532
+ t != null && /* @__PURE__ */ e("span", { className: u("flex size-disc items-center justify-center rounded-full text-2xl", mr[r]), children: t }),
3531
3533
  /* @__PURE__ */ e("div", { className: "text-lg font-semibold text-text", children: n }),
3532
3534
  s && /* @__PURE__ */ e("div", { className: "max-w-sm text-sm leading-relaxed text-text-muted", children: s }),
3533
3535
  a && /* @__PURE__ */ e("div", { className: "flex gap-2 pt-1.5", children: a })
@@ -3539,7 +3541,7 @@ function nn({ children: t, className: r, ...n }) {
3539
3541
  return /* @__PURE__ */ e(
3540
3542
  "kbd",
3541
3543
  {
3542
- className: d(
3544
+ className: u(
3543
3545
  "inline-flex items-center rounded border border-border px-1.5 py-px text-xs font-medium leading-none text-text-muted",
3544
3546
  r
3545
3547
  ),
@@ -3564,12 +3566,12 @@ function sn({ value: t, variant: r = "accent", size: n = "md", className: s, ...
3564
3566
  "aria-valuenow": Math.round(l),
3565
3567
  "aria-valuemin": 0,
3566
3568
  "aria-valuemax": 100,
3567
- className: d("w-full overflow-hidden rounded-full bg-surface-hover", fr[n], s),
3569
+ className: u("w-full overflow-hidden rounded-full bg-surface-hover", fr[n], s),
3568
3570
  ...a,
3569
3571
  children: /* @__PURE__ */ e(
3570
3572
  "div",
3571
3573
  {
3572
- className: d("h-full rounded-full transition-[width] duration-300 ease-out", hr[r]),
3574
+ className: u("h-full rounded-full transition-[width] duration-300 ease-out", hr[r]),
3573
3575
  style: { width: `${l}%` }
3574
3576
  }
3575
3577
  )
@@ -3605,7 +3607,7 @@ function an({
3605
3607
  return /* @__PURE__ */ i(
3606
3608
  "div",
3607
3609
  {
3608
- className: d(
3610
+ className: u(
3609
3611
  "inline-flex items-center",
3610
3612
  s ? "flex-col space-y-2" : "",
3611
3613
  a
@@ -3615,7 +3617,7 @@ function an({
3615
3617
  /* @__PURE__ */ i(
3616
3618
  "svg",
3617
3619
  {
3618
- className: d(
3620
+ className: u(
3619
3621
  "animate-spin",
3620
3622
  xr[t],
3621
3623
  br[r]
@@ -3650,7 +3652,7 @@ function an({
3650
3652
  s && /* @__PURE__ */ e(
3651
3653
  "span",
3652
3654
  {
3653
- className: d(
3655
+ className: u(
3654
3656
  "text-text-muted",
3655
3657
  gr[t]
3656
3658
  ),
@@ -3689,7 +3691,7 @@ function ln({
3689
3691
  role: s ? "img" : void 0,
3690
3692
  "aria-label": s,
3691
3693
  "aria-hidden": s ? void 0 : !0,
3692
- className: d(
3694
+ className: u(
3693
3695
  "inline-block size-dot shrink-0",
3694
3696
  r === "round" ? "rounded-full" : "rounded-sm",
3695
3697
  pr[t],
@@ -3707,10 +3709,10 @@ function on({
3707
3709
  className: a
3708
3710
  }) {
3709
3711
  const l = t.indexOf(r), c = { role: s ? "group" : void 0, "aria-label": s, "aria-hidden": s ? void 0 : !0 };
3710
- return n === "dots" ? /* @__PURE__ */ e("div", { ...c, className: d("flex items-center gap-1.5", a), children: t.map((f, p) => /* @__PURE__ */ e(
3712
+ return n === "dots" ? /* @__PURE__ */ e("div", { ...c, className: u("flex items-center gap-1.5", a), children: t.map((f, p) => /* @__PURE__ */ e(
3711
3713
  "span",
3712
3714
  {
3713
- className: d(
3715
+ className: u(
3714
3716
  "h-step-bar rounded-full transition-all duration-fast ease-out",
3715
3717
  p === l ? "w-5 bg-accent" : "w-3.5",
3716
3718
  p < l && "bg-border-strong",
@@ -3718,12 +3720,12 @@ function on({
3718
3720
  )
3719
3721
  },
3720
3722
  f
3721
- )) }) : /* @__PURE__ */ e("div", { ...c, className: d("flex items-center gap-2", a), children: t.map((f, p) => /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
3723
+ )) }) : /* @__PURE__ */ e("div", { ...c, className: u("flex items-center gap-2", a), children: t.map((f, p) => /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
3722
3724
  /* @__PURE__ */ e(
3723
3725
  "span",
3724
3726
  {
3725
3727
  "aria-current": p === l ? "step" : void 0,
3726
- className: d(
3728
+ className: u(
3727
3729
  "flex size-tile-sm items-center justify-center rounded-full text-xs font-medium",
3728
3730
  p === l && "bg-accent text-accent-fg",
3729
3731
  p < l && "bg-accent-soft text-accent",
@@ -3739,7 +3741,7 @@ function cn({ title: t, icon: r = /* @__PURE__ */ e(lt, { className: "size-icon-
3739
3741
  return /* @__PURE__ */ i(
3740
3742
  "div",
3741
3743
  {
3742
- className: d(
3744
+ className: u(
3743
3745
  "flex flex-col gap-2 rounded-xl border p-4",
3744
3746
  "border-assistant-border bg-assistant-soft",
3745
3747
  a
@@ -3768,7 +3770,7 @@ function yr(t) {
3768
3770
  return r.length >= 2 ? (r[0][0] + r[1][0]).toUpperCase() : r.length === 1 ? r[0].slice(0, 2).toUpperCase() : "?";
3769
3771
  }
3770
3772
  const Nr = ({ name: t, src: r, size: n = "sm", className: s, title: a }) => {
3771
- const [l, c] = le.useState(!1), f = d(
3773
+ const [l, c] = le.useState(!1), f = u(
3772
3774
  "inline-flex items-center justify-center rounded-full overflow-hidden shrink-0 font-semibold select-none bg-surface-hover-border-emphasis text-text",
3773
3775
  vr[n],
3774
3776
  s
@@ -3779,14 +3781,14 @@ const Nr = ({ name: t, src: r, size: n = "sm", className: s, title: a }) => {
3779
3781
  src: r,
3780
3782
  alt: t ?? "",
3781
3783
  title: a ?? t,
3782
- className: d(f, "object-cover"),
3784
+ className: u(f, "object-cover"),
3783
3785
  onError: () => c(!0)
3784
3786
  }
3785
3787
  ) : /* @__PURE__ */ e("span", { className: f, title: a ?? t, "aria-label": t, children: yr(t) });
3786
3788
  }, Le = "ring-surface", wr = "ring-surface-accent", dn = ({ people: t, max: r = 4, size: n = "sm", className: s }) => {
3787
3789
  if (t.length === 0) return null;
3788
3790
  const a = t.slice(0, r), l = t.length - a.length;
3789
- return /* @__PURE__ */ i("span", { className: d("inline-flex items-center", s), children: [
3791
+ return /* @__PURE__ */ i("span", { className: u("inline-flex items-center", s), children: [
3790
3792
  a.map((c, f) => /* @__PURE__ */ e(
3791
3793
  Nr,
3792
3794
  {
@@ -3794,7 +3796,7 @@ const Nr = ({ name: t, src: r, size: n = "sm", className: s, title: a }) => {
3794
3796
  src: c.src,
3795
3797
  size: n,
3796
3798
  title: c.name ? c.seen === !1 ? `${c.name} — nog niet gelezen` : c.name : void 0,
3797
- className: d(
3799
+ className: u(
3798
3800
  f > 0 && "-ml-2",
3799
3801
  c.owner ? wr : Le,
3800
3802
  c.seen === !1 && "opacity-40"
@@ -3805,7 +3807,7 @@ const Nr = ({ name: t, src: r, size: n = "sm", className: s, title: a }) => {
3805
3807
  l > 0 && /* @__PURE__ */ i(
3806
3808
  "span",
3807
3809
  {
3808
- className: d(
3810
+ className: u(
3809
3811
  "inline-flex items-center justify-center rounded-full shrink-0 -ml-2 font-semibold bg-surface-hover text-text-muted",
3810
3812
  n === "xs" ? "w-5 h-5 text-xs" : n === "md" ? "w-7 h-7 text-xs" : n === "lg" ? "w-9 h-9 text-xs" : "w-6 h-6 text-xs",
3811
3813
  Le
@@ -3834,7 +3836,7 @@ function un({ channel: t, children: r, size: n = "md", className: s, title: a })
3834
3836
  "span",
3835
3837
  {
3836
3838
  title: a,
3837
- className: d(
3839
+ className: u(
3838
3840
  "inline-flex shrink-0 items-center justify-center font-bold",
3839
3841
  kr[n],
3840
3842
  l.fg,
@@ -3856,20 +3858,20 @@ const mn = ({
3856
3858
  fallback: f,
3857
3859
  loadingContent: p,
3858
3860
  errorContent: N,
3859
- className: h,
3860
- onLoad: m,
3861
- onError: x,
3862
- ...v
3861
+ className: x,
3862
+ onLoad: d,
3863
+ onError: h,
3864
+ ...y
3863
3865
  }) => {
3864
- const [C, y] = R(!0), [g, A] = R(!1), [$, _] = R(t), M = (Z) => {
3865
- y(!1), A(!1), m?.(Z);
3866
- }, U = (Z) => {
3867
- if (y(!1), A(!0), f && $ !== f) {
3868
- _(f), A(!1), y(!0);
3866
+ const [C, g] = R(!0), [v, $] = R(!1), [D, _] = R(t), M = (Z) => {
3867
+ g(!1), $(!1), d?.(Z);
3868
+ }, q = (Z) => {
3869
+ if (g(!1), $(!0), f && D !== f) {
3870
+ _(f), $(!1), g(!0);
3869
3871
  return;
3870
3872
  }
3871
- x?.(Z);
3872
- }, V = d(
3873
+ h?.(Z);
3874
+ }, V = u(
3873
3875
  "relative overflow-hidden bg-surface-hover",
3874
3876
  // Size variants
3875
3877
  {
@@ -3896,14 +3898,14 @@ const mn = ({
3896
3898
  "rounded-xl": a === "xl",
3897
3899
  "rounded-full": a === "full"
3898
3900
  },
3899
- h
3900
- ), I = d(
3901
+ x
3902
+ ), I = u(
3901
3903
  "w-full h-full object-cover transition-opacity duration-fast",
3902
3904
  {
3903
- "opacity-0": C || g,
3904
- "opacity-100": !C && !g
3905
+ "opacity-0": C || v,
3906
+ "opacity-100": !C && !v
3905
3907
  }
3906
- ), W = d(
3908
+ ), W = u(
3907
3909
  "absolute inset-0 flex items-center justify-center",
3908
3910
  "text-text-muted"
3909
3911
  ), H = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-surface-hover rounded" }) }), X = /* @__PURE__ */ i("div", { className: "text-center", children: [
@@ -3914,16 +3916,16 @@ const mn = ({
3914
3916
  /* @__PURE__ */ e(
3915
3917
  "img",
3916
3918
  {
3917
- ...v,
3918
- src: $,
3919
+ ...y,
3920
+ src: D,
3919
3921
  alt: r,
3920
3922
  className: I,
3921
3923
  onLoad: M,
3922
- onError: U
3924
+ onError: q
3923
3925
  }
3924
3926
  ),
3925
3927
  C && l && /* @__PURE__ */ e("div", { className: W, children: p || H }),
3926
- g && c && /* @__PURE__ */ e("div", { className: W, children: N || X })
3928
+ v && c && /* @__PURE__ */ e("div", { className: W, children: N || X })
3927
3929
  ] });
3928
3930
  };
3929
3931
  function fn({
@@ -3937,18 +3939,18 @@ function fn({
3937
3939
  onActiveIndexChange: f,
3938
3940
  isActive: p,
3939
3941
  unread: N,
3940
- dimmed: h,
3941
- groupBy: m,
3942
- groups: x,
3943
- renderGroupHeader: v,
3942
+ dimmed: x,
3943
+ groupBy: d,
3944
+ groups: h,
3945
+ renderGroupHeader: y,
3944
3946
  stickyGroupHeaders: C = !1,
3945
- collapsibleGroups: y = !1,
3946
- hideGroupCount: g = !1,
3947
- selectable: A = !1,
3948
- selectedItems: $ = [],
3947
+ collapsibleGroups: g = !1,
3948
+ hideGroupCount: v = !1,
3949
+ selectable: $ = !1,
3950
+ selectedItems: D = [],
3949
3951
  onSelectionChange: _,
3950
3952
  bulkActions: M,
3951
- header: U,
3953
+ header: q,
3952
3954
  stickyHeader: V = !1,
3953
3955
  bordered: I = !1,
3954
3956
  emptyContent: W,
@@ -3957,35 +3959,35 @@ function fn({
3957
3959
  className: Z,
3958
3960
  "aria-label": Q
3959
3961
  }) {
3960
- const [b, u] = le.useState(
3962
+ const [b, m] = le.useState(
3961
3963
  () => Object.fromEntries(
3962
- (x ?? []).filter((D) => D.defaultCollapsed).map((D) => [D.id, !0])
3964
+ (h ?? []).filter((T) => T.defaultCollapsed).map((T) => [T.id, !0])
3963
3965
  )
3964
- ), E = le.useRef(null), w = (D) => {
3965
- if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(D.key)) return;
3966
+ ), E = le.useRef(null), w = (T) => {
3967
+ if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(T.key)) return;
3966
3968
  const j = Array.from(
3967
3969
  E.current?.querySelectorAll("li[data-list-row]") ?? []
3968
3970
  );
3969
3971
  if (j.length === 0) return;
3970
- D.preventDefault();
3971
- const K = j.indexOf(document.activeElement), o = D.key === "Home" ? 0 : D.key === "End" ? j.length - 1 : D.key === "ArrowDown" ? (K + 1) % j.length : (K - 1 + j.length) % j.length;
3972
+ T.preventDefault();
3973
+ const K = j.indexOf(document.activeElement), o = T.key === "Home" ? 0 : T.key === "End" ? j.length - 1 : T.key === "ArrowDown" ? (K + 1) % j.length : (K - 1 + j.length) % j.length;
3972
3974
  j[o]?.focus();
3973
- }, P = (D, q) => r ? r(D, q) : q, k = (D) => $.includes(D), ae = (D, q) => {
3975
+ }, P = (T, U) => r ? r(T, U) : U, k = (T) => D.includes(T), ae = (T, U) => {
3974
3976
  _ && _(
3975
- q ? [...$, D] : $.filter((j) => j !== D)
3977
+ U ? [...D, T] : D.filter((j) => j !== T)
3976
3978
  );
3977
- }, ne = (D) => _?.(D ? [...t] : []), te = d(
3979
+ }, ne = (T) => _?.(T ? [...t] : []), te = u(
3978
3980
  "flex flex-col",
3979
3981
  I && "overflow-hidden rounded-lg border border-border-subtle",
3980
3982
  Z
3981
3983
  );
3982
3984
  if (H)
3983
- return /* @__PURE__ */ e("div", { className: te, children: Array.from({ length: X }).map((D, q) => /* @__PURE__ */ i(
3985
+ return /* @__PURE__ */ e("div", { className: te, children: Array.from({ length: X }).map((T, U) => /* @__PURE__ */ i(
3984
3986
  "div",
3985
3987
  {
3986
- className: d(
3988
+ className: u(
3987
3989
  "flex animate-pulse items-center gap-3 px-4 py-2",
3988
- n === "divided" && q > 0 && "border-t border-border-subtle"
3990
+ n === "divided" && U > 0 && "border-t border-border-subtle"
3989
3991
  ),
3990
3992
  children: [
3991
3993
  /* @__PURE__ */ e("span", { className: "size-tile-sm shrink-0 rounded-md bg-surface-hover" }),
@@ -3994,12 +3996,12 @@ function fn({
3994
3996
  /* @__PURE__ */ e("span", { className: "h-3 w-8 shrink-0 rounded-sm bg-surface-hover" })
3995
3997
  ]
3996
3998
  },
3997
- `skeleton-${q}`
3999
+ `skeleton-${U}`
3998
4000
  )) });
3999
4001
  if (t.length === 0 && W)
4000
4002
  return /* @__PURE__ */ e("div", { className: te, children: W });
4001
- const G = t.length > 0 && $.length === t.length, S = $.length > 0 && !G, T = (D, q, j) => {
4002
- const K = p?.(D, q) ?? !1, o = N?.(D, q) ?? !1, z = h?.(D, q) ?? !1, B = A && k(D);
4003
+ const G = t.length > 0 && D.length === t.length, S = D.length > 0 && !G, A = (T, U, j) => {
4004
+ const K = p?.(T, U) ?? !1, o = N?.(T, U) ?? !1, z = x?.(T, U) ?? !1, B = $ && k(T);
4003
4005
  return /* @__PURE__ */ i(
4004
4006
  "li",
4005
4007
  {
@@ -4008,13 +4010,13 @@ function fn({
4008
4010
  tabIndex: 0,
4009
4011
  "data-list-row": "",
4010
4012
  "aria-current": K || void 0,
4011
- onClick: () => c(D, q),
4012
- onFocus: () => f?.(q),
4013
+ onClick: () => c(T, U),
4014
+ onFocus: () => f?.(U),
4013
4015
  onKeyDown: (F) => {
4014
- F.key !== "Enter" && F.key !== " " || (F.preventDefault(), c(D, q));
4016
+ F.key !== "Enter" && F.key !== " " || (F.preventDefault(), c(T, U));
4015
4017
  }
4016
4018
  } : {},
4017
- className: d(
4019
+ className: u(
4018
4020
  "flex items-center gap-3 px-4 py-2 text-base",
4019
4021
  "transition-colors duration-fast ease-out",
4020
4022
  n === "divided" && !j && "border-t border-border-subtle",
@@ -4024,11 +4026,11 @@ function fn({
4024
4026
  z && "opacity-55"
4025
4027
  ),
4026
4028
  children: [
4027
- A && /* @__PURE__ */ e("span", { onClick: (F) => F.stopPropagation(), children: /* @__PURE__ */ e(
4029
+ $ && /* @__PURE__ */ e("span", { onClick: (F) => F.stopPropagation(), children: /* @__PURE__ */ e(
4028
4030
  xe,
4029
4031
  {
4030
- checked: k(D),
4031
- onChange: (F) => ae(D, F.target.checked),
4032
+ checked: k(T),
4033
+ onChange: (F) => ae(T, F.target.checked),
4032
4034
  "aria-label": "Rij selecteren"
4033
4035
  }
4034
4036
  ) }),
@@ -4039,54 +4041,54 @@ function fn({
4039
4041
  className: "mt-2 size-1.5 shrink-0 self-start rounded-full bg-border-strong"
4040
4042
  }
4041
4043
  ),
4042
- s && /* @__PURE__ */ e("span", { className: "shrink-0", children: s(D, q) }),
4043
- /* @__PURE__ */ e("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: a ? a(D, q) : String(D) }),
4044
- l && /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-text-subtle", children: l(D, q) })
4044
+ s && /* @__PURE__ */ e("span", { className: "shrink-0", children: s(T, U) }),
4045
+ /* @__PURE__ */ e("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: a ? a(T, U) : String(T) }),
4046
+ l && /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-text-subtle", children: l(T, U) })
4045
4047
  ]
4046
4048
  },
4047
- P(D, q)
4049
+ P(T, U)
4048
4050
  );
4049
4051
  }, L = (() => {
4050
- if (!m)
4051
- return t.map((K, o) => T(K, o, o === 0));
4052
- const D = /* @__PURE__ */ new Map();
4052
+ if (!d)
4053
+ return t.map((K, o) => A(K, o, o === 0));
4054
+ const T = /* @__PURE__ */ new Map();
4053
4055
  t.forEach((K, o) => {
4054
- const z = m(K, o);
4055
- D.has(z) || D.set(z, []), D.get(z).push({ item: K, index: o });
4056
+ const z = d(K, o);
4057
+ T.has(z) || T.set(z, []), T.get(z).push({ item: K, index: o });
4056
4058
  });
4057
- const q = x ?? [];
4059
+ const U = h ?? [];
4058
4060
  return [
4059
- ...q.filter((K) => D.has(K.id)),
4060
- ...[...D.keys()].filter((K) => !q.some((o) => o.id === K)).map((K) => ({ id: K }))
4061
+ ...U.filter((K) => T.has(K.id)),
4062
+ ...[...T.keys()].filter((K) => !U.some((o) => o.id === K)).map((K) => ({ id: K }))
4061
4063
  ].flatMap((K, o) => {
4062
- const z = D.get(K.id) ?? [], B = y && b[K.id], F = K.title ?? K.id, O = K.count ?? z.length, re = /* @__PURE__ */ e(
4064
+ const z = T.get(K.id) ?? [], B = g && b[K.id], F = K.title ?? K.id, O = K.count ?? z.length, re = /* @__PURE__ */ e(
4063
4065
  "li",
4064
4066
  {
4065
- onClick: y ? () => u((ie) => ({ ...ie, [K.id]: !ie[K.id] })) : void 0,
4066
- className: d(
4067
+ onClick: g ? () => m((ie) => ({ ...ie, [K.id]: !ie[K.id] })) : void 0,
4068
+ className: u(
4067
4069
  "flex items-center gap-2 bg-surface-sunk px-4 py-1.5",
4068
4070
  "text-xs font-semibold uppercase tracking-label text-text-subtle",
4069
4071
  "border-border-subtle",
4070
4072
  o > 0 && "border-t",
4071
4073
  "border-b",
4072
4074
  C && "sticky z-10",
4073
- y && "cursor-pointer select-none hover:text-text"
4075
+ g && "cursor-pointer select-none hover:text-text"
4074
4076
  ),
4075
- "aria-expanded": y ? !B : void 0,
4077
+ "aria-expanded": g ? !B : void 0,
4076
4078
  style: C ? { top: V ? 28 : 0 } : void 0,
4077
- children: v ? v(K, z.map((ie) => ie.item)) : /* @__PURE__ */ i(fe, { children: [
4078
- y && /* @__PURE__ */ e(
4079
+ children: y ? y(K, z.map((ie) => ie.item)) : /* @__PURE__ */ i(fe, { children: [
4080
+ g && /* @__PURE__ */ e(
4079
4081
  ye,
4080
4082
  {
4081
4083
  "aria-hidden": !0,
4082
- className: d(
4084
+ className: u(
4083
4085
  "size-icon-sm shrink-0 transition-transform duration-fast ease-out",
4084
4086
  !B && "rotate-90"
4085
4087
  )
4086
4088
  }
4087
4089
  ),
4088
4090
  /* @__PURE__ */ e("span", { children: F }),
4089
- !g && /* @__PURE__ */ e("span", { className: "ml-auto font-normal tabular-nums", children: O })
4091
+ !v && /* @__PURE__ */ e("span", { className: "ml-auto font-normal tabular-nums", children: O })
4090
4092
  ] })
4091
4093
  },
4092
4094
  `group-${K.id}`
@@ -4094,37 +4096,37 @@ function fn({
4094
4096
  return B ? [re] : [
4095
4097
  re,
4096
4098
  ...z.map(
4097
- ({ item: ie, index: He }, Ue) => T(ie, He, Ue === 0)
4099
+ ({ item: ie, index: He }, qe) => A(ie, He, qe === 0)
4098
4100
  )
4099
4101
  ];
4100
4102
  });
4101
4103
  })();
4102
4104
  return /* @__PURE__ */ i("div", { ref: E, className: te, onKeyDown: c ? w : void 0, children: [
4103
- A && $.length > 0 && /* @__PURE__ */ i("div", { className: "flex items-center gap-3 border-b border-border-subtle bg-surface-sunk px-4 py-2", children: [
4105
+ $ && D.length > 0 && /* @__PURE__ */ i("div", { className: "flex items-center gap-3 border-b border-border-subtle bg-surface-sunk px-4 py-2", children: [
4104
4106
  /* @__PURE__ */ e(
4105
4107
  xe,
4106
4108
  {
4107
4109
  checked: G,
4108
4110
  indeterminate: S,
4109
- onChange: (D) => ne(D.target.checked),
4111
+ onChange: (T) => ne(T.target.checked),
4110
4112
  "aria-label": "Alles selecteren"
4111
4113
  }
4112
4114
  ),
4113
4115
  /* @__PURE__ */ i("span", { className: "text-xs text-text-subtle", children: [
4114
- $.length,
4116
+ D.length,
4115
4117
  " geselecteerd"
4116
4118
  ] }),
4117
4119
  M && /* @__PURE__ */ e("div", { className: "ml-auto flex gap-2", children: M })
4118
4120
  ] }),
4119
- U && /* @__PURE__ */ e(
4121
+ q && /* @__PURE__ */ e(
4120
4122
  "div",
4121
4123
  {
4122
- className: d(
4124
+ className: u(
4123
4125
  "flex items-center gap-3 border-b border-border-subtle px-4 py-1.5",
4124
4126
  "text-xs font-semibold uppercase tracking-label text-text-subtle",
4125
4127
  V && "sticky top-0 z-20"
4126
4128
  ),
4127
- children: U
4129
+ children: q
4128
4130
  }
4129
4131
  ),
4130
4132
  /* @__PURE__ */ e("ul", { "aria-label": Q, className: "flex flex-col", children: L })
@@ -4140,8 +4142,10 @@ function hn({
4140
4142
  return /* @__PURE__ */ e(
4141
4143
  "div",
4142
4144
  {
4143
- className: d(
4144
- "min-w-0 border",
4145
+ className: u(
4146
+ // A bubble never spans the whole column; it narrows further from md,
4147
+ // where the thread itself is wide enough for the difference to matter.
4148
+ "min-w-0 max-w-bubble border md:max-w-bubble-md",
4145
4149
  n === "warning" && "border-warning-border",
4146
4150
  n === "note" && "border-note-border",
4147
4151
  n === "default" && "border-border",
@@ -4165,8 +4169,8 @@ const Cr = {
4165
4169
  success: "border-border"
4166
4170
  };
4167
4171
  function xn({ value: t, label: r, tone: n = "default", className: s, ...a }) {
4168
- return /* @__PURE__ */ i("div", { className: d("rounded-xl border bg-surface px-4 py-3.5", Sr[n], s), ...a, children: [
4169
- /* @__PURE__ */ e("div", { className: d("text-2xl font-semibold", Cr[n]), children: t }),
4172
+ return /* @__PURE__ */ i("div", { className: u("rounded-xl border bg-surface px-4 py-3.5", Sr[n], s), ...a, children: [
4173
+ /* @__PURE__ */ e("div", { className: u("text-2xl font-semibold", Cr[n]), children: t }),
4170
4174
  /* @__PURE__ */ e("div", { className: "pt-0.5 text-xs text-text-muted", children: r })
4171
4175
  ] });
4172
4176
  }
@@ -4181,26 +4185,26 @@ const bn = ({
4181
4185
  backLabel: f = "Back",
4182
4186
  backClassName: p,
4183
4187
  onBack: N,
4184
- editable: h = !1,
4185
- onTitleChange: m
4188
+ editable: x = !1,
4189
+ onTitleChange: d
4186
4190
  }) => {
4187
- const [x, v] = R(!1), [C, y] = R(r), g = se(null);
4191
+ const [h, y] = R(!1), [C, g] = R(r), v = se(null);
4188
4192
  Y(() => {
4189
- y(r);
4193
+ g(r);
4190
4194
  }, [r]), Y(() => {
4191
- x && g.current && (g.current.focus(), g.current.select());
4192
- }, [x]);
4193
- const A = () => {
4194
- h && v(!0);
4195
- }, $ = () => {
4196
- v(!1), C.trim() !== "" && C !== r && m ? m(C.trim()) : y(r);
4195
+ h && v.current && (v.current.focus(), v.current.select());
4196
+ }, [h]);
4197
+ const $ = () => {
4198
+ x && y(!0);
4199
+ }, D = () => {
4200
+ y(!1), C.trim() !== "" && C !== r && d ? d(C.trim()) : g(r);
4197
4201
  }, _ = (M) => {
4198
- M.key === "Enter" ? g.current?.blur() : M.key === "Escape" && (y(r), v(!1));
4202
+ M.key === "Enter" ? v.current?.blur() : M.key === "Escape" && (g(r), y(!1));
4199
4203
  };
4200
4204
  return /* @__PURE__ */ i(
4201
4205
  "div",
4202
4206
  {
4203
- className: d(
4207
+ className: u(
4204
4208
  "p-5 pb-3",
4205
4209
  // App-bar treatment: own background, full-bleed, closed with a rule.
4206
4210
  t && "bg-surface border-b border-border",
@@ -4211,14 +4215,14 @@ const bn = ({
4211
4215
  /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ i("div", { className: "flex items-start gap-2 text-text", children: [
4212
4216
  N && /* @__PURE__ */ e(ee, { variant: "secondary", onClick: N, leftIcon: /* @__PURE__ */ e(J, { icon: ze, size: "sm" }), iconOnly: !0 }),
4213
4217
  /* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
4214
- x ? /* @__PURE__ */ e(
4218
+ h ? /* @__PURE__ */ e(
4215
4219
  "input",
4216
4220
  {
4217
- ref: g,
4221
+ ref: v,
4218
4222
  type: "text",
4219
4223
  value: C,
4220
- onChange: (M) => y(M.target.value),
4221
- onBlur: $,
4224
+ onChange: (M) => g(M.target.value),
4225
+ onBlur: D,
4222
4226
  onKeyDown: _,
4223
4227
  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"
4224
4228
  }
@@ -4226,21 +4230,21 @@ const bn = ({
4226
4230
  /* @__PURE__ */ e(
4227
4231
  "h2",
4228
4232
  {
4229
- onClick: A,
4230
- className: d(
4233
+ onClick: $,
4234
+ className: u(
4231
4235
  "text-2xl font-semibold truncate",
4232
- h && "cursor-pointer"
4236
+ x && "cursor-pointer"
4233
4237
  ),
4234
- title: h ? "Klik om te bewerken" : void 0,
4238
+ title: x ? "Klik om te bewerken" : void 0,
4235
4239
  children: r
4236
4240
  }
4237
4241
  ),
4238
4242
  n && /* @__PURE__ */ e("span", { className: "shrink-0 text-base text-text-muted truncate", children: n }),
4239
- h && /* @__PURE__ */ e(
4243
+ x && /* @__PURE__ */ e(
4240
4244
  ct,
4241
4245
  {
4242
4246
  size: 15,
4243
- onClick: A,
4247
+ onClick: $,
4244
4248
  className: "shrink-0 cursor-pointer text-text-muted opacity-0 group-hover:opacity-100 transition-opacity"
4245
4249
  }
4246
4250
  )
@@ -4264,8 +4268,8 @@ const bn = ({
4264
4268
  ee,
4265
4269
  {
4266
4270
  variant: M.variant ?? "secondary",
4267
- onClick: (U) => {
4268
- U.stopPropagation(), U.target.blur(), M.onClick();
4271
+ onClick: (q) => {
4272
+ q.stopPropagation(), q.target.blur(), M.onClick();
4269
4273
  },
4270
4274
  disabled: M.disabled,
4271
4275
  leftIcon: M.icon,
@@ -4285,10 +4289,10 @@ const bn = ({
4285
4289
  backLabel: n = "Back",
4286
4290
  className: s,
4287
4291
  children: a
4288
- }) => /* @__PURE__ */ i("div", { className: d("flex items-center gap-2 mb-3", s), children: [
4292
+ }) => /* @__PURE__ */ i("div", { className: u("flex items-center gap-2 mb-3", s), children: [
4289
4293
  r && /* @__PURE__ */ e(ee, { variant: "ghost", size: "sm", onClick: r, leftIcon: /* @__PURE__ */ e(ze, { size: 14 }), children: n }),
4290
4294
  a && /* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: a }),
4291
- t.length > 0 && /* @__PURE__ */ e("div", { className: d("flex flex-wrap gap-2", !a && "ml-auto"), children: t.map(
4295
+ t.length > 0 && /* @__PURE__ */ e("div", { className: u("flex flex-wrap gap-2", !a && "ml-auto"), children: t.map(
4292
4296
  (l) => l.splitOptions && l.splitOptions.length > 0 ? /* @__PURE__ */ e(
4293
4297
  je,
4294
4298
  {
@@ -4318,7 +4322,7 @@ const bn = ({
4318
4322
  ] });
4319
4323
  function pn({ label: t, trailing: r, align: n = "center", className: s }) {
4320
4324
  const a = /* @__PURE__ */ e("span", { className: "h-px flex-1 bg-border-subtle", "aria-hidden": !0 });
4321
- return !t && !r ? /* @__PURE__ */ e("div", { className: d("flex items-center py-2", s), children: a }) : /* @__PURE__ */ i("div", { className: d("flex items-center gap-3 py-2", s), children: [
4325
+ return !t && !r ? /* @__PURE__ */ e("div", { className: u("flex items-center py-2", s), children: a }) : /* @__PURE__ */ i("div", { className: u("flex items-center gap-3 py-2", s), children: [
4322
4326
  n === "center" && a,
4323
4327
  /* @__PURE__ */ e("span", { className: "shrink-0 text-xs font-medium text-text-muted", children: t }),
4324
4328
  a,
@@ -4336,7 +4340,7 @@ function vn({
4336
4340
  return /* @__PURE__ */ i(
4337
4341
  "div",
4338
4342
  {
4339
- className: d(
4343
+ className: u(
4340
4344
  "flex items-center justify-between gap-4 py-2",
4341
4345
  s && "rounded-lg border border-border px-3",
4342
4346
  a && "opacity-50",
@@ -4360,7 +4364,7 @@ function yn({
4360
4364
  children: a,
4361
4365
  className: l
4362
4366
  }) {
4363
- return /* @__PURE__ */ i("section", { className: d("flex flex-col gap-2", l), children: [
4367
+ return /* @__PURE__ */ i("section", { className: u("flex flex-col gap-2", l), children: [
4364
4368
  /* @__PURE__ */ i("div", { className: "flex items-start gap-2", children: [
4365
4369
  t && /* @__PURE__ */ e(J, { icon: t, size: "md", color: "secondary", className: "mt-0.5" }),
4366
4370
  /* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
@@ -4369,7 +4373,7 @@ function yn({
4369
4373
  ] }),
4370
4374
  s && /* @__PURE__ */ e("div", { className: "shrink-0", children: s })
4371
4375
  ] }),
4372
- /* @__PURE__ */ e("div", { className: d("flex flex-col", t && "pl-6"), children: a })
4376
+ /* @__PURE__ */ e("div", { className: u("flex flex-col", t && "pl-6"), children: a })
4373
4377
  ] });
4374
4378
  }
4375
4379
  function Nn({ label: t, dotColor: r, onClick: n, className: s }) {
@@ -4378,7 +4382,7 @@ function Nn({ label: t, dotColor: r, onClick: n, className: s }) {
4378
4382
  {
4379
4383
  type: "button",
4380
4384
  onClick: n,
4381
- className: d(
4385
+ className: u(
4382
4386
  "inline-flex max-w-full items-center gap-1.5 rounded-full bg-surface-sunk px-2.5 py-1 text-xs text-text-muted transition-colors duration-fast ease-out hover:bg-surface-hover hover:text-text",
4383
4387
  s
4384
4388
  ),
@@ -4402,27 +4406,27 @@ const wn = ({
4402
4406
  size: n = "md",
4403
4407
  className: s
4404
4408
  }) => {
4405
- const a = (h) => {
4406
- if (!h) return "-";
4409
+ const a = (x) => {
4410
+ if (!x) return "-";
4407
4411
  try {
4408
- return new Date(h).toLocaleDateString("nl-NL", {
4412
+ return new Date(x).toLocaleDateString("nl-NL", {
4409
4413
  year: "numeric",
4410
4414
  month: "long",
4411
4415
  day: "numeric"
4412
4416
  });
4413
4417
  } catch {
4414
- return String(h);
4418
+ return String(x);
4415
4419
  }
4416
- }, l = (h) => h ? "Ja" : "Nee", c = (h, m) => {
4417
- if (!m) return String(h || "-");
4418
- const x = m.find((v) => v.value === h);
4419
- return x ? x.label : String(h || "-");
4420
+ }, l = (x) => x ? "Ja" : "Nee", c = (x, d) => {
4421
+ if (!d) return String(x || "-");
4422
+ const h = d.find((y) => y.value === x);
4423
+ return h ? h.label : String(x || "-");
4420
4424
  }, f = ce(
4421
- (h) => {
4422
- const m = zr(r, h.name);
4423
- if (h.type === "array") {
4424
- const v = m;
4425
- return !v || v.length === 0 ? /* @__PURE__ */ e(
4425
+ (x) => {
4426
+ const d = zr(r, x.name);
4427
+ if (x.type === "array") {
4428
+ const y = d;
4429
+ return !y || y.length === 0 ? /* @__PURE__ */ e(
4426
4430
  oe,
4427
4431
  {
4428
4432
  variant: "body",
@@ -4430,7 +4434,7 @@ const wn = ({
4430
4434
  className: "text-text-muted",
4431
4435
  children: "Geen items"
4432
4436
  }
4433
- ) : /* @__PURE__ */ e("div", { className: "space-y-3", children: v.map((C, y) => /* @__PURE__ */ i(
4437
+ ) : /* @__PURE__ */ e("div", { className: "space-y-3", children: y.map((C, g) => /* @__PURE__ */ i(
4434
4438
  "div",
4435
4439
  {
4436
4440
  className: "p-4 border border-border rounded-xl space-y-3",
@@ -4443,53 +4447,53 @@ const wn = ({
4443
4447
  weight: "medium",
4444
4448
  className: "text-text-muted",
4445
4449
  children: [
4446
- h.label,
4450
+ x.label,
4447
4451
  " ",
4448
- y + 1
4452
+ g + 1
4449
4453
  ]
4450
4454
  }
4451
4455
  ) }),
4452
- /* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: h.arrayFields?.map((g) => {
4453
- const A = C?.[g.name];
4454
- let $ = "-";
4455
- switch (g.type) {
4456
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: x.arrayFields?.map((v) => {
4457
+ const $ = C?.[v.name];
4458
+ let D = "-";
4459
+ switch (v.type) {
4456
4460
  case "text":
4457
4461
  case "email":
4458
4462
  case "number":
4459
4463
  case "tel":
4460
4464
  case "url":
4461
4465
  case "textarea":
4462
- $ = A || "-";
4466
+ D = $ || "-";
4463
4467
  break;
4464
4468
  case "select":
4465
4469
  case "radio":
4466
- $ = c(
4467
- A,
4468
- g.options
4470
+ D = c(
4471
+ $,
4472
+ v.options
4469
4473
  );
4470
4474
  break;
4471
4475
  case "checkbox":
4472
- $ = l(A);
4476
+ D = l($);
4473
4477
  break;
4474
4478
  case "date":
4475
- $ = a(A);
4479
+ D = a($);
4476
4480
  break;
4477
4481
  case "custom":
4478
- $ = g.customComponent?.({
4479
- value: A
4482
+ D = v.customComponent?.({
4483
+ value: $
4480
4484
  });
4481
4485
  break;
4482
4486
  default:
4483
- $ = String(A || "-");
4487
+ D = String($ || "-");
4484
4488
  }
4485
- return g.format && ($ = g.format(A, C)), /* @__PURE__ */ i("div", { className: "space-y-1", children: [
4489
+ return v.format && (D = v.format($, C)), /* @__PURE__ */ i("div", { className: "space-y-1", children: [
4486
4490
  /* @__PURE__ */ e(
4487
4491
  oe,
4488
4492
  {
4489
4493
  variant: "label",
4490
4494
  size: "xs",
4491
4495
  className: "text-text-muted",
4492
- children: g.label
4496
+ children: v.label
4493
4497
  }
4494
4498
  ),
4495
4499
  /* @__PURE__ */ e(
@@ -4498,55 +4502,55 @@ const wn = ({
4498
4502
  variant: "body",
4499
4503
  size: "sm",
4500
4504
  className: "text-text",
4501
- children: $
4505
+ children: D
4502
4506
  }
4503
4507
  )
4504
- ] }, g.name);
4508
+ ] }, v.name);
4505
4509
  }) })
4506
4510
  ]
4507
4511
  },
4508
- y
4512
+ g
4509
4513
  )) });
4510
4514
  }
4511
- if (h.type === "custom" && h.customComponent)
4512
- return h.customComponent({ value: m });
4513
- if (h.format) {
4514
- const v = h.format(m, r);
4515
+ if (x.type === "custom" && x.customComponent)
4516
+ return x.customComponent({ value: d });
4517
+ if (x.format) {
4518
+ const y = x.format(d, r);
4515
4519
  return /* @__PURE__ */ e(
4516
4520
  oe,
4517
4521
  {
4518
4522
  variant: "body",
4519
4523
  size: "sm",
4520
4524
  className: "text-text",
4521
- children: v
4525
+ children: y
4522
4526
  }
4523
4527
  );
4524
4528
  }
4525
- let x = "-";
4526
- switch (h.type) {
4529
+ let h = "-";
4530
+ switch (x.type) {
4527
4531
  case "text":
4528
4532
  case "email":
4529
4533
  case "password":
4530
4534
  case "number":
4531
4535
  case "tel":
4532
4536
  case "url":
4533
- x = m ? String(m) : "-";
4537
+ h = d ? String(d) : "-";
4534
4538
  break;
4535
4539
  case "textarea":
4536
- x = m ? /* @__PURE__ */ e("div", { className: "whitespace-pre-wrap", children: String(m || "-") }) : "-";
4540
+ h = d ? /* @__PURE__ */ e("div", { className: "whitespace-pre-wrap", children: String(d || "-") }) : "-";
4537
4541
  break;
4538
4542
  case "select":
4539
4543
  case "radio":
4540
- x = c(m, h.options);
4544
+ h = c(d, x.options);
4541
4545
  break;
4542
4546
  case "checkbox":
4543
- x = l(m);
4547
+ h = l(d);
4544
4548
  break;
4545
4549
  case "date":
4546
- x = a(m);
4550
+ h = a(d);
4547
4551
  break;
4548
4552
  default:
4549
- x = m ? String(m) : "-";
4553
+ h = d ? String(d) : "-";
4550
4554
  }
4551
4555
  return /* @__PURE__ */ e(
4552
4556
  oe,
@@ -4554,30 +4558,30 @@ const wn = ({
4554
4558
  variant: "body",
4555
4559
  size: "sm",
4556
4560
  className: "text-text",
4557
- children: x
4561
+ children: h
4558
4562
  }
4559
4563
  );
4560
4564
  },
4561
4565
  [r]
4562
4566
  ), p = ce(
4563
- (h) => {
4564
- if (h.conditional && !h.conditional(r))
4567
+ (x) => {
4568
+ if (x.conditional && !x.conditional(r))
4565
4569
  return null;
4566
- const m = h.items.filter((v) => !(v.hidden || v.conditional && !v.conditional(r)));
4567
- if (m.length === 0) return null;
4568
- const x = d(
4570
+ const d = x.items.filter((y) => !(y.hidden || y.conditional && !y.conditional(r)));
4571
+ if (d.length === 0) return null;
4572
+ const h = u(
4569
4573
  "space-y-4",
4570
4574
  {
4571
- "grid gap-4": h.layout === "grid",
4572
- "flex flex-wrap gap-4": h.layout === "flex"
4575
+ "grid gap-4": x.layout === "grid",
4576
+ "flex flex-wrap gap-4": x.layout === "flex"
4573
4577
  },
4574
- h.layout === "grid" && {
4575
- "grid-cols-1": !h.columns || h.columns === 1,
4576
- "grid-cols-2": h.columns === 2,
4577
- "grid-cols-3": h.columns === 3,
4578
- "grid-cols-4": h.columns === 4
4578
+ x.layout === "grid" && {
4579
+ "grid-cols-1": !x.columns || x.columns === 1,
4580
+ "grid-cols-2": x.columns === 2,
4581
+ "grid-cols-3": x.columns === 3,
4582
+ "grid-cols-4": x.columns === 4
4579
4583
  },
4580
- h.className
4584
+ x.className
4581
4585
  );
4582
4586
  return /* @__PURE__ */ i(
4583
4587
  "div",
@@ -4592,49 +4596,49 @@ const wn = ({
4592
4596
  size: "lg",
4593
4597
  weight: "semibold",
4594
4598
  className: "text-text",
4595
- children: h.title
4599
+ children: x.title
4596
4600
  }
4597
4601
  ),
4598
- h.description && /* @__PURE__ */ e(
4602
+ x.description && /* @__PURE__ */ e(
4599
4603
  oe,
4600
4604
  {
4601
4605
  variant: "body",
4602
4606
  size: "sm",
4603
4607
  className: "text-text-muted mt-1",
4604
- children: h.description
4608
+ children: x.description
4605
4609
  }
4606
4610
  )
4607
4611
  ] }),
4608
- /* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: x, children: m.map((v) => /* @__PURE__ */ i(
4612
+ /* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: h, children: d.map((y) => /* @__PURE__ */ i(
4609
4613
  "div",
4610
4614
  {
4611
4615
  className: "space-y-1",
4612
4616
  style: {
4613
- width: typeof v.width == "string" ? v.width : void 0,
4614
- gridColumn: typeof v.width == "number" ? `span ${v.width} / span ${v.width}` : void 0
4617
+ width: typeof y.width == "string" ? y.width : void 0,
4618
+ gridColumn: typeof y.width == "number" ? `span ${y.width} / span ${y.width}` : void 0
4615
4619
  },
4616
4620
  children: [
4617
- v.type !== "custom" && /* @__PURE__ */ e(
4621
+ y.type !== "custom" && /* @__PURE__ */ e(
4618
4622
  oe,
4619
4623
  {
4620
4624
  variant: "label",
4621
4625
  size: "sm",
4622
4626
  className: "font-medium text-text-muted",
4623
- children: v.label
4627
+ children: y.label
4624
4628
  }
4625
4629
  ),
4626
- f(v)
4630
+ f(y)
4627
4631
  ]
4628
4632
  },
4629
- v.name
4633
+ y.name
4630
4634
  )) }) })
4631
4635
  ]
4632
4636
  },
4633
- h.id
4637
+ x.id
4634
4638
  );
4635
4639
  },
4636
4640
  [r, f]
4637
- ), N = d(
4641
+ ), N = u(
4638
4642
  "space-y-6",
4639
4643
  {
4640
4644
  "max-w-md": n === "sm",
@@ -4651,7 +4655,7 @@ const wn = ({
4651
4655
  /* @__PURE__ */ i(
4652
4656
  "div",
4653
4657
  {
4654
- className: d(
4658
+ className: u(
4655
4659
  "flex items-center gap-2 px-2 pt-4 pb-1 text-xs font-semibold uppercase tracking-label text-text-subtle"
4656
4660
  ),
4657
4661
  children: [
@@ -4679,7 +4683,7 @@ const wn = ({
4679
4683
  onKeyDown: (c) => {
4680
4684
  (c.key === "Enter" || c.key === " ") && (c.preventDefault(), t.path && n?.(t.path));
4681
4685
  },
4682
- className: d(
4686
+ className: u(
4683
4687
  "flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-base no-underline",
4684
4688
  "transition-colors duration-fast ease-out",
4685
4689
  "focus-visible:outline-none focus-visible:focus-ring",
@@ -4691,7 +4695,7 @@ const wn = ({
4691
4695
  t.count !== void 0 && t.count > 0 && /* @__PURE__ */ e(
4692
4696
  "span",
4693
4697
  {
4694
- className: d(
4698
+ className: u(
4695
4699
  "shrink-0 text-xs tabular-nums",
4696
4700
  l ? "rounded-full bg-accent px-2 font-semibold text-accent-fg" : "text-text-subtle"
4697
4701
  ),
@@ -4714,7 +4718,7 @@ const wn = ({
4714
4718
  r && r.length > 0 && /* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-1", children: r.map((c, f) => /* @__PURE__ */ e(
4715
4719
  "span",
4716
4720
  {
4717
- className: d(
4721
+ className: u(
4718
4722
  "flex h-control-sm w-7 cursor-pointer items-center justify-center rounded-md text-text-strong",
4719
4723
  "transition-colors duration-fast ease-out hover:bg-surface-hover hover:text-text-strong",
4720
4724
  "focus-visible:outline-none focus-visible:focus-ring"
@@ -4776,7 +4780,7 @@ const wn = ({
4776
4780
  children: f,
4777
4781
  ...p
4778
4782
  }) => {
4779
- const N = `h${t}`, h = d(
4783
+ const N = `h${t}`, x = u(
4780
4784
  "font-sans text-pretty",
4781
4785
  Er[r || Tr(t)],
4782
4786
  Mr[n],
@@ -4785,7 +4789,7 @@ const wn = ({
4785
4789
  l && "truncate",
4786
4790
  c
4787
4791
  );
4788
- return /* @__PURE__ */ e(N, { className: h, ...p, children: f });
4792
+ return /* @__PURE__ */ e(N, { className: x, ...p, children: f });
4789
4793
  };
4790
4794
  function Tr(t) {
4791
4795
  return {
@@ -4805,44 +4809,44 @@ const Sn = ({
4805
4809
  initialCommandPath: a,
4806
4810
  initialActiveIndex: l
4807
4811
  }) => {
4808
- const [c, f] = R(""), [p, N] = R(a || []), [h, m] = R(l || 0), x = se(null), v = se(null), y = (p.length ? t.find((g) => g.id === p[0])?.subCommands || [] : t).filter(
4809
- (g) => g.label.toLowerCase().includes(c.toLowerCase())
4812
+ const [c, f] = R(""), [p, N] = R(a || []), [x, d] = R(l || 0), h = se(null), y = se(null), g = (p.length ? t.find((v) => v.id === p[0])?.subCommands || [] : t).filter(
4813
+ (v) => v.label.toLowerCase().includes(c.toLowerCase())
4810
4814
  );
4811
4815
  return Y(() => {
4812
- r || (f(""), N(a || []), m(l || 0));
4816
+ r || (f(""), N(a || []), d(l || 0));
4813
4817
  }, [r]), Y(() => {
4814
- const g = (A) => {
4818
+ const v = ($) => {
4815
4819
  if (r) {
4816
- if (A.key === "Escape")
4820
+ if ($.key === "Escape")
4817
4821
  n();
4818
- else if (A.key === "ArrowUp")
4819
- m(
4820
- ($) => $ > 0 ? $ - 1 : y.length - 1
4822
+ else if ($.key === "ArrowUp")
4823
+ d(
4824
+ (D) => D > 0 ? D - 1 : g.length - 1
4821
4825
  );
4822
- else if (A.key === "ArrowDown")
4823
- m(
4824
- ($) => $ < y.length - 1 ? $ + 1 : 0
4826
+ else if ($.key === "ArrowDown")
4827
+ d(
4828
+ (D) => D < g.length - 1 ? D + 1 : 0
4825
4829
  );
4826
- else if (A.key === "Enter") {
4827
- const $ = y[h];
4828
- $ && ($.subCommands ? (N([...p, $.id]), m(0)) : $.action && ($.action(), n()));
4830
+ else if ($.key === "Enter") {
4831
+ const D = g[x];
4832
+ D && (D.subCommands ? (N([...p, D.id]), d(0)) : D.action && (D.action(), n()));
4829
4833
  }
4830
4834
  }
4831
4835
  };
4832
- return document.addEventListener("keydown", g), () => document.removeEventListener("keydown", g);
4833
- }, [r, n, y, h, p]), Y(() => {
4834
- const g = (A) => {
4835
- x.current && !x.current.contains(A.target) && n();
4836
+ return document.addEventListener("keydown", v), () => document.removeEventListener("keydown", v);
4837
+ }, [r, n, g, x, p]), Y(() => {
4838
+ const v = ($) => {
4839
+ h.current && !h.current.contains($.target) && n();
4836
4840
  };
4837
- return r && document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
4841
+ return r && document.addEventListener("mousedown", v), () => document.removeEventListener("mousedown", v);
4838
4842
  }, [r, n]), Y(() => {
4839
4843
  if (!r) return;
4840
- v.current?.querySelector(`[data-index="${h}"]`)?.scrollIntoView({ block: "nearest" });
4841
- }, [h, r]), r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim", children: /* @__PURE__ */ i(
4844
+ y.current?.querySelector(`[data-index="${x}"]`)?.scrollIntoView({ block: "nearest" });
4845
+ }, [x, r]), r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim", children: /* @__PURE__ */ i(
4842
4846
  "div",
4843
4847
  {
4844
4848
  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",
4845
- ref: x,
4849
+ ref: h,
4846
4850
  children: [
4847
4851
  /* @__PURE__ */ i("div", { className: "flex items-center gap-2 px-3 flex-shrink-0", children: [
4848
4852
  /* @__PURE__ */ e(Ne, { className: "w-4 h-4 text-text-muted shrink-0" }),
@@ -4853,7 +4857,7 @@ const Sn = ({
4853
4857
  autoFocus: !0,
4854
4858
  placeholder: s?.searchPlaceholder || "Search commands...",
4855
4859
  value: c,
4856
- onChange: (g) => f(g.target.value),
4860
+ onChange: (v) => f(v.target.value),
4857
4861
  className: "w-full border-0 bg-transparent py-2 text-text focus:outline-none"
4858
4862
  }
4859
4863
  )
@@ -4861,26 +4865,26 @@ const Sn = ({
4861
4865
  /* @__PURE__ */ i(
4862
4866
  "div",
4863
4867
  {
4864
- ref: v,
4868
+ ref: y,
4865
4869
  className: "mt-2 pt-2 text-sm border-t border-border max-h-dialog-list overflow-y-auto",
4866
4870
  children: [
4867
- y.length === 0 && /* @__PURE__ */ e("div", { className: "text-text-muted text-center text-sm", children: s?.noCommandsFound || "No commands found" }),
4868
- y.map((g, A) => /* @__PURE__ */ i(
4871
+ g.length === 0 && /* @__PURE__ */ e("div", { className: "text-text-muted text-center text-sm", children: s?.noCommandsFound || "No commands found" }),
4872
+ g.map((v, $) => /* @__PURE__ */ i(
4869
4873
  "div",
4870
4874
  {
4871
- "data-index": A,
4872
- className: `flex items-center p-2 cursor-pointer rounded-md ${A === h ? "bg-accent-soft text-accent" : "text-text"}`,
4875
+ "data-index": $,
4876
+ className: `flex items-center p-2 cursor-pointer rounded-md ${$ === x ? "bg-accent-soft text-accent" : "text-text"}`,
4873
4877
  onClick: () => {
4874
- g.subCommands ? (N([...p, g.id]), m(0)) : g.action && (g.action(), n());
4878
+ v.subCommands ? (N([...p, v.id]), d(0)) : v.action && (v.action(), n());
4875
4879
  },
4876
- onMouseEnter: () => m(A),
4880
+ onMouseEnter: () => d($),
4877
4881
  children: [
4878
- g.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: g.icon }),
4879
- /* @__PURE__ */ e("span", { className: "flex-grow", children: g.label }),
4880
- g.subCommands && /* @__PURE__ */ e("span", { className: "text-text-muted", children: /* @__PURE__ */ e(ye, { className: "w-4 h-4" }) })
4882
+ v.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: v.icon }),
4883
+ /* @__PURE__ */ e("span", { className: "flex-grow", children: v.label }),
4884
+ v.subCommands && /* @__PURE__ */ e("span", { className: "text-text-muted", children: /* @__PURE__ */ e(ye, { className: "w-4 h-4" }) })
4881
4885
  ]
4882
4886
  },
4883
- g.id
4887
+ v.id
4884
4888
  ))
4885
4889
  ]
4886
4890
  }
@@ -4975,11 +4979,11 @@ const Sn = ({
4975
4979
  className: f,
4976
4980
  children: p,
4977
4981
  ...N
4978
- }, h) => /* @__PURE__ */ e(
4982
+ }, x) => /* @__PURE__ */ e(
4979
4983
  "div",
4980
4984
  {
4981
- ref: h,
4982
- className: d(
4985
+ ref: x,
4986
+ className: u(
4983
4987
  t && Ar[t],
4984
4988
  r && Lr[r],
4985
4989
  n && Ir[n],
@@ -5018,41 +5022,41 @@ function En({
5018
5022
  componentProps: a,
5019
5023
  className: l
5020
5024
  }) {
5021
- const c = se(null), [f, p] = R(!0), [N, h] = R(null), m = se(null);
5025
+ const c = se(null), [f, p] = R(!0), [N, x] = R(null), d = se(null);
5022
5026
  return se(null), Y(() => {
5023
- let x = !0;
5027
+ let h = !0;
5024
5028
  return (async () => {
5025
5029
  p(!0);
5026
5030
  try {
5027
5031
  const C = await r();
5028
- if (!x) return;
5029
- const y = C.component || C.default || C;
5030
- h(n === "react" ? () => y : () => C);
5032
+ if (!h) return;
5033
+ const g = C.component || C.default || C;
5034
+ x(n === "react" ? () => g : () => C);
5031
5035
  } catch (C) {
5032
5036
  console.error(`[FederatedResource] Load failed: ${t}`, C);
5033
5037
  } finally {
5034
- x && p(!1);
5038
+ h && p(!1);
5035
5039
  }
5036
5040
  })(), () => {
5037
- x = !1;
5041
+ h = !1;
5038
5042
  };
5039
5043
  }, [t, r]), Y(() => {
5040
5044
  if (f || !N || n === "react") return;
5041
- const x = c.current;
5042
- if (x) {
5045
+ const h = c.current;
5046
+ if (h) {
5043
5047
  if (n === "svelte") {
5044
- const v = N.default || N, C = new v({ target: x, props: a || {} });
5045
- return m.current = C, () => C.$destroy();
5048
+ const y = N.default || N, C = new y({ target: h, props: a || {} });
5049
+ return d.current = C, () => C.$destroy();
5046
5050
  }
5047
5051
  if (N.mount) {
5048
- const v = N.mount({ container: x, props: a || {} });
5052
+ const y = N.mount({ container: h, props: a || {} });
5049
5053
  return () => {
5050
- typeof v == "function" ? v() : N.unmount?.(x);
5054
+ typeof y == "function" ? y() : N.unmount?.(h);
5051
5055
  };
5052
5056
  }
5053
5057
  }
5054
5058
  }, [N, n, f]), Y(() => {
5055
- n === "svelte" && m.current && m.current.$set?.(a);
5059
+ n === "svelte" && d.current && d.current.$set?.(a);
5056
5060
  }, [a, n]), /* @__PURE__ */ i("div", { ref: c, className: l, style: { display: "contents" }, children: [
5057
5061
  f && s,
5058
5062
  n === "react" && N && /* @__PURE__ */ e(N, { ...a })
@@ -5145,8 +5149,8 @@ export {
5145
5149
  he as TextField,
5146
5150
  _r as VideoSurface,
5147
5151
  wn as View,
5148
- d as cn,
5149
- qr as createSizes,
5150
- Ur as createVariants
5152
+ u as cn,
5153
+ Ur as createSizes,
5154
+ qr as createVariants
5151
5155
  };
5152
5156
  //# sourceMappingURL=index.js.map