unifyedx-storybook-new 0.2.14 → 0.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { jsxs as l, jsx as e, Fragment as ee } from "react/jsx-runtime";
2
- import ae, { useState as B, useMemo as ce, useId as ea, Fragment as Q, useEffect as X, useCallback as K, useRef as ue } from "react";
3
- import { a as J, U as ut, X as ye, P as _, L as mt, C as je, b as Ge, f as Ue, d as va, D as Na, F as ht, e as pt, h as gt, T as Ve, u as yt, i as ft, I as bt, j as vt, k as Nt, l as xt, m as kt, n as wt, S as xa, o as ka, M as Ct, p as St, q as wa, r as Dt, A as $t, E as Ft, s as Tt, t as At, v as Et, w as Rt, x as Ca, y as It, z as Sa, B as Da, G as zt, H as Pt, J as Bt, K as qe, N as aa, O as ta, Q as Lt, R as Ot, V as $a, W as Mt, Y as sa, Z as Ut, _ as Vt, $ as Fa, a0 as qt, a1 as jt, a2 as Gt, a3 as _t, a4 as Wt, a5 as Yt, a6 as Jt, a7 as Qt, a8 as Xt, a9 as Zt, aa as Ht, ab as Kt, ac as er, ad as ar, ae as tr } from "./vendor-zgKTz69B.js";
4
- import { Popover as rr, PopoverButton as nr, PopoverPanel as sr, Transition as oe, Dialog as me, TransitionChild as ge, DialogPanel as Se, DialogTitle as _e, TabGroup as lr, TabList as or, Tab as re, TabPanels as ir, RadioGroup as ze, Listbox as Z, ListboxButton as cr, ListboxOptions as dr, ListboxOption as ur, SwitchGroup as mr, Switch as Ze, Menu as hr, MenuButton as pr, Portal as gr, MenuItems as yr, MenuItem as fr, DialogBackdrop as br } from "@headlessui/react";
2
+ import ae, { useState as B, useMemo as ce, useId as ea, Fragment as J, useEffect as Q, useCallback as K, useRef as ue } from "react";
3
+ import { a as Y, U as ut, X as ye, P as G, L as mt, C as je, b as Ge, f as Ue, d as va, D as Na, F as ht, e as pt, h as gt, T as Ve, u as yt, i as ft, I as bt, j as vt, k as Nt, l as xt, m as kt, n as wt, S as xa, o as ka, M as Ct, p as St, q as wa, r as Dt, A as $t, E as Ft, s as Tt, t as At, v as Et, w as Rt, x as Ca, y as It, z as Sa, B as Da, G as zt, H as Pt, J as Bt, K as qe, N as aa, O as ta, Q as Lt, R as Ot, V as $a, W as Mt, Y as sa, Z as Ut, _ as Vt, $ as Fa, a0 as qt, a1 as jt, a2 as Gt, a3 as _t, a4 as Wt, a5 as Yt, a6 as Jt, a7 as Qt, a8 as Xt, a9 as Zt, aa as Ht, ab as Kt, ac as er, ad as ar, ae as tr } from "./vendor-zgKTz69B.js";
4
+ import { Popover as rr, PopoverButton as nr, PopoverPanel as sr, Transition as oe, Dialog as me, TransitionChild as ge, DialogPanel as Se, DialogTitle as _e, TabGroup as lr, TabList as or, Tab as re, TabPanels as ir, RadioGroup as ze, Listbox as X, ListboxButton as cr, ListboxOptions as dr, ListboxOption as ur, SwitchGroup as mr, Switch as Ze, Menu as hr, MenuButton as pr, Portal as gr, MenuItems as yr, MenuItem as fr, DialogBackdrop as br } from "@headlessui/react";
5
5
  import { motion as ne, AnimatePresence as be } from "framer-motion";
6
6
  import { d as vr } from "./vendor-lodash-BD0xlZyL.js";
7
7
  import { useFloating as Ta, offset as Aa, flip as Ea, shift as Ra, autoUpdate as Ia, useClick as Nr, useDismiss as xr, useInteractions as kr, FloatingPortal as wr } from "@floating-ui/react";
@@ -15,7 +15,7 @@ const Vr = (t) => {
15
15
  r ^= t.charCodeAt(s), r += (r << 1) + (r << 4) + (r << 7) + (r << 8) + (r << 24);
16
16
  return r >>> 0;
17
17
  }, qr = (t) => {
18
- const r = (t ?? "").trim().toLowerCase(), s = parseInt((r.match(/\d+$/) ?? [0])[0], 10) || 0, o = Vr(r), n = (o % 360 + 37 * s) % 360, u = 55 + (o >>> 8) % 20, i = 30 + (o >>> 16) % 10, d = 86 + (o >>> 24) % 8, y = `hsl(${n}, ${u}%, ${d}%)`, b = `hsl(${n}, ${u}%, ${i}%)`;
18
+ const r = (t ?? "").trim().toLowerCase(), s = parseInt((r.match(/\d+$/) ?? [0])[0], 10) || 0, o = Vr(r), n = (o % 360 + 37 * s) % 360, u = 55 + (o >>> 8) % 20, i = 30 + (o >>> 16) % 10, c = 86 + (o >>> 24) % 8, y = `hsl(${n}, ${u}%, ${c}%)`, b = `hsl(${n}, ${u}%, ${i}%)`;
19
19
  return { bg: y, text: b };
20
20
  }, jr = (t = "") => t.split(" ").map((r) => r[0]).slice(0, 2).join("").toUpperCase(), za = ({
21
21
  src: t,
@@ -29,7 +29,7 @@ const Vr = (t) => {
29
29
  className: u,
30
30
  ...i
31
31
  }) => {
32
- const [d, y] = B(!1), b = ce(() => qr(r), []), N = t && !d, a = !N && r, k = !N && !r, m = J(
32
+ const [c, y] = B(!1), b = ce(() => qr(r), []), N = t && !c, a = !N && r, k = !N && !r, m = Y(
33
33
  "avatar-container",
34
34
  `avatar--size-${s}`,
35
35
  u
@@ -71,15 +71,15 @@ const Vr = (t) => {
71
71
  onRemove: n,
72
72
  bgColor: u,
73
73
  textColor: i,
74
- className: d,
74
+ className: c,
75
75
  ...y
76
76
  }) => {
77
- const b = J(
77
+ const b = Y(
78
78
  "badge",
79
79
  `badge--variant-${r}`,
80
80
  `badge--size-${s}`,
81
81
  { "badge--with-remove": !!n },
82
- d
82
+ c
83
83
  );
84
84
  return /* @__PURE__ */ l("span", { className: b, style: u && i ? {
85
85
  backgroundColor: u,
@@ -120,15 +120,15 @@ const Vr = (t) => {
120
120
  };
121
121
  Gr.propTypes = {
122
122
  /** Is this the principal call to action on the page? */
123
- primary: _.bool,
123
+ primary: G.bool,
124
124
  /** What background color to use */
125
- backgroundColor: _.string,
125
+ backgroundColor: G.string,
126
126
  /** How large should the button be? */
127
- size: _.oneOf(["small", "medium", "large"]),
127
+ size: G.oneOf(["small", "medium", "large"]),
128
128
  /** Button contents */
129
- label: _.string.isRequired,
129
+ label: G.string.isRequired,
130
130
  /** Optional click handler */
131
- onClick: _.func
131
+ onClick: G.func
132
132
  };
133
133
  const _r = {
134
134
  small: "btn-sm",
@@ -137,7 +137,7 @@ const _r = {
137
137
  }, Wr = {
138
138
  primary: "btn-primary",
139
139
  secondary: "btn-secondary"
140
- }, H = ({
140
+ }, Z = ({
141
141
  dataTestId: t,
142
142
  title: r,
143
143
  type: s = "button",
@@ -146,7 +146,7 @@ const _r = {
146
146
  // ✅ Default is now empty
147
147
  loader: u = !1,
148
148
  category: i = "primary",
149
- icon: d,
149
+ icon: c,
150
150
  // Renamed for clarity, expecting a component type e.g., CheckCircle
151
151
  disabled: y = !1,
152
152
  size: b = "medium",
@@ -156,7 +156,7 @@ const _r = {
156
156
  onClick: k,
157
157
  ...m
158
158
  }) => {
159
- const g = y || u, $ = d && !N, L = J(
159
+ const g = y || u, $ = c && !N, L = Y(
160
160
  "btn-base",
161
161
  _r[b],
162
162
  Wr[i],
@@ -178,7 +178,7 @@ const _r = {
178
178
  "aria-label": o || $ && r || (typeof N == "string" ? N : void 0),
179
179
  ...m,
180
180
  children: u ? /* @__PURE__ */ e(mt, { className: "loader-spin", "data-testid": "button-loader" }) : /* @__PURE__ */ l(ee, { children: [
181
- d && /* @__PURE__ */ e(d, { size: b === "large" ? 20 : 16 }),
181
+ c && /* @__PURE__ */ e(c, { size: b === "large" ? 20 : 16 }),
182
182
  N,
183
183
  a,
184
184
  " "
@@ -216,7 +216,7 @@ const _r = {
216
216
  ref: n,
217
217
  checked: u,
218
218
  onChange: i,
219
- ...d
219
+ ...c
220
220
  }) => {
221
221
  const y = ea(), b = r || y;
222
222
  return /* @__PURE__ */ l("div", { className: `checkbox-container ${o || ""}`, children: [
@@ -230,13 +230,13 @@ const _r = {
230
230
  className: "checkbox-input",
231
231
  checked: u,
232
232
  onChange: i,
233
- ...d
233
+ ...c
234
234
  }
235
235
  ),
236
236
  /* @__PURE__ */ e(
237
237
  "div",
238
238
  {
239
- className: J("checkbox-box", {
239
+ className: Y("checkbox-box", {
240
240
  "checkbox-box--checked": u,
241
241
  "checkbox-box--error": !!s
242
242
  }),
@@ -256,13 +256,13 @@ const _r = {
256
256
  label: n,
257
257
  error: u,
258
258
  disabled: i = !1,
259
- className: d,
259
+ className: c,
260
260
  ...y
261
261
  }) => {
262
262
  const b = (N) => {
263
263
  N.stopPropagation(), N.preventDefault(), s?.();
264
264
  };
265
- return /* @__PURE__ */ l("div", { className: J("datepicker-wrapper", d), children: [
265
+ return /* @__PURE__ */ l("div", { className: Y("datepicker-wrapper", c), children: [
266
266
  n && /* @__PURE__ */ e("label", { className: "datepicker-label", htmlFor: "datepicker-input", children: n }),
267
267
  /* @__PURE__ */ l(Ba, { children: [
268
268
  /* @__PURE__ */ e(La, { asChild: !0, children: /* @__PURE__ */ l("div", { className: "datepicker-input-container", children: [
@@ -271,7 +271,7 @@ const _r = {
271
271
  {
272
272
  id: "datepicker-input",
273
273
  type: "button",
274
- className: J("datepicker-trigger", {
274
+ className: Y("datepicker-trigger", {
275
275
  "datepicker-trigger--error": !!u,
276
276
  "datepicker-trigger--disabled": i
277
277
  }),
@@ -316,7 +316,7 @@ const _r = {
316
316
  label: n,
317
317
  error: u,
318
318
  disabled: i = !1,
319
- className: d,
319
+ className: c,
320
320
  ...y
321
321
  }) => {
322
322
  const b = t?.from, N = t?.to, a = (m) => {
@@ -326,7 +326,7 @@ const _r = {
326
326
  " - ",
327
327
  Ue(N, "MMM d, y")
328
328
  ] }) : /* @__PURE__ */ e("span", { className: "datepicker-placeholder", children: o });
329
- return /* @__PURE__ */ l("div", { className: J("datepicker-wrapper", d), children: [
329
+ return /* @__PURE__ */ l("div", { className: Y("datepicker-wrapper", c), children: [
330
330
  n && /* @__PURE__ */ e("label", { className: "datepicker-label", htmlFor: "daterangepicker-input", children: n }),
331
331
  /* @__PURE__ */ l(Ba, { children: [
332
332
  /* @__PURE__ */ e(La, { asChild: !0, children: /* @__PURE__ */ l("div", { className: "datepicker-input-container", children: [
@@ -335,7 +335,7 @@ const _r = {
335
335
  {
336
336
  id: "daterangepicker-input",
337
337
  type: "button",
338
- className: J("datepicker-trigger", {
338
+ className: Y("datepicker-trigger", {
339
339
  "datepicker-trigger--error": !!u,
340
340
  "datepicker-trigger--disabled": i
341
341
  }),
@@ -625,7 +625,7 @@ const _r = {
625
625
  open: u,
626
626
  // --- Form and File State ---
627
627
  validFiles: i = [],
628
- rejectedFiles: d = [],
628
+ rejectedFiles: c = [],
629
629
  handleRemoveValidFile: y,
630
630
  handleRemoveRejectedFile: b,
631
631
  handleSubmit: N,
@@ -635,8 +635,8 @@ const _r = {
635
635
  title: m = "Upload Files",
636
636
  subHeading: g = "Supports PNG, JPG, PDF. Max size: 50MB."
637
637
  }) => {
638
- const $ = i.length > 0 || d.length > 0;
639
- return /* @__PURE__ */ e(oe, { appear: !0, show: t, as: Q, children: /* @__PURE__ */ l(
638
+ const $ = i.length > 0 || c.length > 0;
639
+ return /* @__PURE__ */ e(oe, { appear: !0, show: t, as: J, children: /* @__PURE__ */ l(
640
640
  me,
641
641
  {
642
642
  as: "div",
@@ -647,7 +647,7 @@ const _r = {
647
647
  /* @__PURE__ */ e(
648
648
  ge,
649
649
  {
650
- as: Q,
650
+ as: J,
651
651
  enter: "ease-out duration-300",
652
652
  enterFrom: "opacity-0",
653
653
  enterTo: "opacity-100",
@@ -660,7 +660,7 @@ const _r = {
660
660
  /* @__PURE__ */ e("div", { className: "dialog-positioner", children: /* @__PURE__ */ e(
661
661
  ge,
662
662
  {
663
- as: Q,
663
+ as: J,
664
664
  enter: "ease-out duration-300",
665
665
  enterFrom: "opacity-0 scale-95",
666
666
  enterTo: "opacity-100 scale-100",
@@ -714,7 +714,7 @@ const _r = {
714
714
  $ && /* @__PURE__ */ l("div", { className: "file-list-container", children: [
715
715
  /* @__PURE__ */ e("h3", { children: "Upload Queue" }),
716
716
  /* @__PURE__ */ l("ul", { className: "file-list", children: [
717
- i.map((L, O) => /* @__PURE__ */ l(
717
+ i.map((L, M) => /* @__PURE__ */ l(
718
718
  "li",
719
719
  {
720
720
  className: "file-item",
@@ -735,16 +735,16 @@ const _r = {
735
735
  "button",
736
736
  {
737
737
  type: "button",
738
- onClick: () => y(O),
738
+ onClick: () => y(M),
739
739
  className: "remove-file-button",
740
740
  children: /* @__PURE__ */ e(Ve, { size: 16 })
741
741
  }
742
742
  )
743
743
  ]
744
744
  },
745
- `${L.name}-${O}`
745
+ `${L.name}-${M}`
746
746
  )),
747
- d.map(({ file: L, message: O }, C) => /* @__PURE__ */ l(
747
+ c.map(({ file: L, message: M }, C) => /* @__PURE__ */ l(
748
748
  "li",
749
749
  {
750
750
  className: "file-item file-item--rejected",
@@ -759,7 +759,7 @@ const _r = {
759
759
  /* @__PURE__ */ l("div", { children: [
760
760
  /* @__PURE__ */ e("p", { className: "file-item-name", children: L.name }),
761
761
  /* @__PURE__ */ e("p", { className: "file-item-size", children: ua(L.size) }),
762
- /* @__PURE__ */ e("p", { className: "rejection-reason", children: O })
762
+ /* @__PURE__ */ e("p", { className: "rejection-reason", children: M })
763
763
  ] })
764
764
  ] }),
765
765
  /* @__PURE__ */ e(
@@ -780,7 +780,7 @@ const _r = {
780
780
  ] }),
781
781
  /* @__PURE__ */ l("div", { className: "dialog-footer", children: [
782
782
  /* @__PURE__ */ e(
783
- H,
783
+ Z,
784
784
  {
785
785
  type: "button",
786
786
  category: "secondary",
@@ -789,7 +789,7 @@ const _r = {
789
789
  }
790
790
  ),
791
791
  /* @__PURE__ */ e(
792
- H,
792
+ Z,
793
793
  {
794
794
  type: "submit",
795
795
  label: a ? "Uploading..." : "Upload Files",
@@ -817,7 +817,7 @@ const _r = {
817
817
  fetchCreatedOrUpdatedByUsers: i = async () => []
818
818
  // Mockable fetcher
819
819
  }) => {
820
- const [d, y] = B({
820
+ const [c, y] = B({
821
821
  createdBy: [],
822
822
  updatedBy: []
823
823
  }), [b, N] = B({
@@ -842,18 +842,18 @@ const _r = {
842
842
  enableReinitialize: !0
843
843
  }), k = ce(() => n.reduce((C, T) => {
844
844
  const E = T.key, R = a.values[E];
845
- let V = !1;
845
+ let U = !1;
846
846
  if (R)
847
847
  switch (T.type) {
848
848
  case "multiselect":
849
849
  case "multiselect-users":
850
- V = Array.isArray(R.values) && R.values.length > 0;
850
+ U = Array.isArray(R.values) && R.values.length > 0;
851
851
  break;
852
852
  case "date":
853
- (R.range && R.range !== "" || Array.isArray(R.values) && R.values.length > 0) && (V = !0);
853
+ (R.range && R.range !== "" || Array.isArray(R.values) && R.values.length > 0) && (U = !0);
854
854
  break;
855
855
  }
856
- return C[E] = V, C;
856
+ return C[E] = U, C;
857
857
  }, {}), [n, a.values]), m = Object.values(k).filter(Boolean).length, g = async (C, T) => {
858
858
  try {
859
859
  N((R) => ({ ...R, [C]: !0 }));
@@ -866,11 +866,11 @@ const _r = {
866
866
  }
867
867
  }, $ = (C) => {
868
868
  const T = n[C].key, E = n[C].url;
869
- n[C].type === "multiselect-users" && d[T].length === 0 && !b[T] && g(T, E);
869
+ n[C].type === "multiselect-users" && c[T].length === 0 && !b[T] && g(T, E);
870
870
  }, L = () => {
871
871
  a.resetForm(), y({ createdBy: [], updatedBy: [] }), o();
872
- }, O = (C) => {
873
- const T = n.find((V) => V.key === C);
872
+ }, M = (C) => {
873
+ const T = n.find((U) => U.key === C);
874
874
  if (!T) return null;
875
875
  const E = a.values[C] || u[C], R = Array.isArray(E.values) ? E.values : [];
876
876
  switch (T.type) {
@@ -882,9 +882,9 @@ const _r = {
882
882
  "select",
883
883
  {
884
884
  value: E.operator || "in",
885
- onChange: (c) => a.setFieldValue(`${C}.operator`, c.target.value),
885
+ onChange: (d) => a.setFieldValue(`${C}.operator`, d.target.value),
886
886
  className: "filter-select",
887
- children: T.operators.map((c) => /* @__PURE__ */ e("option", { value: c, children: c === "in" ? "Includes" : "Excludes" }, c))
887
+ children: T.operators.map((d) => /* @__PURE__ */ e("option", { value: d, children: d === "in" ? "Includes" : "Excludes" }, d))
888
888
  }
889
889
  )
890
890
  ] }),
@@ -897,8 +897,8 @@ const _r = {
897
897
  id: `select-all-${C}`,
898
898
  className: "filter-checkbox-input",
899
899
  checked: T.options.length > 0 && R.length === T.options.length,
900
- onChange: (c) => {
901
- const h = c.target.checked ? T.options.map((x) => x.value) : [];
900
+ onChange: (d) => {
901
+ const h = d.target.checked ? T.options.map((x) => x.value) : [];
902
902
  a.setFieldValue(`${C}.values`, h);
903
903
  }
904
904
  }
@@ -912,16 +912,16 @@ const _r = {
912
912
  }
913
913
  )
914
914
  ] }),
915
- T.options.map((c) => /* @__PURE__ */ l("div", { className: "filter-checkbox-item", children: [
915
+ T.options.map((d) => /* @__PURE__ */ l("div", { className: "filter-checkbox-item", children: [
916
916
  /* @__PURE__ */ e(
917
917
  "input",
918
918
  {
919
919
  type: "checkbox",
920
- id: `${C}-${c.value}`,
920
+ id: `${C}-${d.value}`,
921
921
  className: "filter-checkbox-input",
922
- checked: R.includes(c.value),
922
+ checked: R.includes(d.value),
923
923
  onChange: (h) => {
924
- const x = h.target.checked ? [...R, c.value] : R.filter((F) => F !== c.value);
924
+ const x = h.target.checked ? [...R, d.value] : R.filter((F) => F !== d.value);
925
925
  a.setFieldValue(`${C}.values`, x);
926
926
  }
927
927
  }
@@ -929,16 +929,16 @@ const _r = {
929
929
  /* @__PURE__ */ e(
930
930
  "label",
931
931
  {
932
- htmlFor: `${C}-${c.value}`,
932
+ htmlFor: `${C}-${d.value}`,
933
933
  className: "filter-checkbox-label",
934
- children: c.label
934
+ children: d.label
935
935
  }
936
936
  )
937
- ] }, c.value))
937
+ ] }, d.value))
938
938
  ] })
939
939
  ] });
940
940
  case "multiselect-users":
941
- const V = d[C] || [], q = b[C];
941
+ const U = c[C] || [], V = b[C];
942
942
  return /* @__PURE__ */ l("div", { className: "filter-panel-content", children: [
943
943
  /* @__PURE__ */ l("div", { className: "filter-operator-group", children: [
944
944
  /* @__PURE__ */ e("label", { className: "filter-label", children: "Operator:" }),
@@ -946,13 +946,13 @@ const _r = {
946
946
  "select",
947
947
  {
948
948
  value: E.operator || "in",
949
- onChange: (c) => a.setFieldValue(`${C}.operator`, c.target.value),
949
+ onChange: (d) => a.setFieldValue(`${C}.operator`, d.target.value),
950
950
  className: "filter-select",
951
- children: T.operators.map((c) => /* @__PURE__ */ e("option", { value: c, children: c === "in" ? "Includes" : "Excludes" }, c))
951
+ children: T.operators.map((d) => /* @__PURE__ */ e("option", { value: d, children: d === "in" ? "Includes" : "Excludes" }, d))
952
952
  }
953
953
  )
954
954
  ] }),
955
- q ? /* @__PURE__ */ e("div", { className: "loading-spinner", children: /* @__PURE__ */ e("div", {}) }) : /* @__PURE__ */ e("div", { className: "filter-checkbox-list", children: V.length > 0 ? /* @__PURE__ */ l(ee, { children: [
955
+ V ? /* @__PURE__ */ e("div", { className: "loading-spinner", children: /* @__PURE__ */ e("div", {}) }) : /* @__PURE__ */ e("div", { className: "filter-checkbox-list", children: U.length > 0 ? /* @__PURE__ */ l(ee, { children: [
956
956
  /* @__PURE__ */ l("div", { className: "filter-checkbox-item", children: [
957
957
  /* @__PURE__ */ e(
958
958
  "input",
@@ -960,9 +960,9 @@ const _r = {
960
960
  type: "checkbox",
961
961
  id: `select-all-users-${C}`,
962
962
  className: "filter-checkbox-input",
963
- checked: V.length > 0 && R.length === V.length,
964
- onChange: (c) => {
965
- const h = c.target.checked ? V.map((x) => x.email) : [];
963
+ checked: U.length > 0 && R.length === U.length,
964
+ onChange: (d) => {
965
+ const h = d.target.checked ? U.map((x) => x.email) : [];
966
966
  a.setFieldValue(
967
967
  `${C}.values`,
968
968
  h
@@ -979,16 +979,16 @@ const _r = {
979
979
  }
980
980
  )
981
981
  ] }),
982
- V.map((c) => /* @__PURE__ */ l("div", { className: "filter-checkbox-item createdby", children: [
982
+ U.map((d) => /* @__PURE__ */ l("div", { className: "filter-checkbox-item createdby", children: [
983
983
  /* @__PURE__ */ e(
984
984
  "input",
985
985
  {
986
986
  type: "checkbox",
987
- id: `${C}-${c.email}`,
987
+ id: `${C}-${d.email}`,
988
988
  className: "filter-checkbox-input",
989
- checked: R.includes(c.email),
989
+ checked: R.includes(d.email),
990
990
  onChange: (h) => {
991
- const x = h.target.checked ? [...R, c.email] : R.filter((F) => F !== c.email);
991
+ const x = h.target.checked ? [...R, d.email] : R.filter((F) => F !== d.email);
992
992
  a.setFieldValue(
993
993
  `${C}.values`,
994
994
  x
@@ -999,19 +999,19 @@ const _r = {
999
999
  /* @__PURE__ */ l(
1000
1000
  "label",
1001
1001
  {
1002
- htmlFor: `${C}-${c.email}`,
1002
+ htmlFor: `${C}-${d.email}`,
1003
1003
  className: "filter-checkbox-label",
1004
1004
  children: [
1005
- /* @__PURE__ */ e("span", { className: "user-label-name", children: c.name }),
1006
- /* @__PURE__ */ e("span", { className: "user-label-email", children: c.email })
1005
+ /* @__PURE__ */ e("span", { className: "user-label-name", children: d.name }),
1006
+ /* @__PURE__ */ e("span", { className: "user-label-email", children: d.email })
1007
1007
  ]
1008
1008
  }
1009
1009
  )
1010
- ] }, c.email))
1010
+ ] }, d.email))
1011
1011
  ] }) : /* @__PURE__ */ e("div", { className: "text-center py-4 text-gray-500 text-sm", children: "No users loaded." }) })
1012
1012
  ] });
1013
1013
  case "date":
1014
- const G = E.values || [], [v, p] = G, f = v && p, w = {
1014
+ const j = E.values || [], [v, p] = j, f = v && p, w = {
1015
1015
  startDate: v instanceof Date ? v : /* @__PURE__ */ new Date(),
1016
1016
  // Fallback to today
1017
1017
  endDate: p instanceof Date ? p : /* @__PURE__ */ new Date(),
@@ -1025,9 +1025,9 @@ const _r = {
1025
1025
  "select",
1026
1026
  {
1027
1027
  value: E.operator,
1028
- onChange: (c) => a.setFieldValue(`${C}.operator`, c.target.value),
1028
+ onChange: (d) => a.setFieldValue(`${C}.operator`, d.target.value),
1029
1029
  className: "filter-select",
1030
- children: T.operators.map((c) => /* @__PURE__ */ e("option", { value: c, children: c === "in" ? "Is" : "Is not" }, c))
1030
+ children: T.operators.map((d) => /* @__PURE__ */ e("option", { value: d, children: d === "in" ? "Is" : "Is not" }, d))
1031
1031
  }
1032
1032
  ),
1033
1033
  f && /* @__PURE__ */ e(
@@ -1049,8 +1049,8 @@ const _r = {
1049
1049
  ft.DateRangePicker,
1050
1050
  {
1051
1051
  ranges: [w],
1052
- onChange: (c) => {
1053
- const { startDate: h, endDate: x } = c.selection;
1052
+ onChange: (d) => {
1053
+ const { startDate: h, endDate: x } = d.selection;
1054
1054
  a.setFieldValue(`${C}.values`, [
1055
1055
  h,
1056
1056
  x
@@ -1068,11 +1068,11 @@ const _r = {
1068
1068
  return null;
1069
1069
  }
1070
1070
  };
1071
- return /* @__PURE__ */ e(oe, { appear: !0, show: t, as: Q, children: /* @__PURE__ */ l(me, { as: "div", className: "relative z-50", onClose: r, children: [
1071
+ return /* @__PURE__ */ e(oe, { appear: !0, show: t, as: J, children: /* @__PURE__ */ l(me, { as: "div", className: "relative z-50", onClose: r, children: [
1072
1072
  /* @__PURE__ */ e(
1073
1073
  ge,
1074
1074
  {
1075
- as: Q,
1075
+ as: J,
1076
1076
  enter: "ease-out duration-300",
1077
1077
  enterFrom: "opacity-0",
1078
1078
  enterTo: "opacity-100",
@@ -1085,7 +1085,7 @@ const _r = {
1085
1085
  /* @__PURE__ */ e("div", { className: "filter-modal-container", children: /* @__PURE__ */ e("div", { className: "filter-modal-positioner", children: /* @__PURE__ */ e(
1086
1086
  ge,
1087
1087
  {
1088
- as: Q,
1088
+ as: J,
1089
1089
  enter: "ease-out duration-300",
1090
1090
  enterFrom: "opacity-0 translate-x-full",
1091
1091
  enterTo: "opacity-100 translate-x-0",
@@ -1140,7 +1140,7 @@ const _r = {
1140
1140
  animate: { opacity: 1, x: 0 },
1141
1141
  transition: { duration: 0.3 },
1142
1142
  className: "h-full",
1143
- children: O(C.key)
1143
+ children: M(C.key)
1144
1144
  },
1145
1145
  C.key
1146
1146
  )
@@ -1179,7 +1179,7 @@ const _r = {
1179
1179
  }
1180
1180
  ) }) })
1181
1181
  ] }) });
1182
- }, Y = ({
1182
+ }, W = ({
1183
1183
  label: t,
1184
1184
  id: r,
1185
1185
  type: s = "text",
@@ -1188,9 +1188,9 @@ const _r = {
1188
1188
  className: u,
1189
1189
  ref: i,
1190
1190
  // ✅ 'ref' is now received directly as a prop
1191
- ...d
1191
+ ...c
1192
1192
  }) => {
1193
- const y = r || d.name;
1193
+ const y = r || c.name;
1194
1194
  return /* @__PURE__ */ l("div", { className: `input-wrapper ${u || ""}`, children: [
1195
1195
  t && /* @__PURE__ */ e("label", { htmlFor: y, className: "input-label", children: t }),
1196
1196
  /* @__PURE__ */ l("div", { className: "input-field-container", children: [
@@ -1201,11 +1201,11 @@ const _r = {
1201
1201
  id: y,
1202
1202
  type: s,
1203
1203
  ref: i,
1204
- className: J("input-field", {
1204
+ className: Y("input-field", {
1205
1205
  "input-field--error": !!n,
1206
1206
  "input-field--with-icon": !!o
1207
1207
  }),
1208
- ...d
1208
+ ...c
1209
1209
  }
1210
1210
  )
1211
1211
  ] }),
@@ -1241,7 +1241,7 @@ const _r = {
1241
1241
  // No default
1242
1242
  variant: i = "info",
1243
1243
  // 'info', 'warning', 'delete'
1244
- loading: d = !1,
1244
+ loading: c = !1,
1245
1245
  buttonProps: y = {},
1246
1246
  size: b
1247
1247
  // Add size prop
@@ -1251,11 +1251,11 @@ const _r = {
1251
1251
  }, m = () => {
1252
1252
  r({ primary: !1, secondary: !0 });
1253
1253
  };
1254
- return /* @__PURE__ */ e(oe, { appear: !0, show: t, as: Q, children: /* @__PURE__ */ l(me, { as: "div", className: "modal-dialog", onClose: () => r({}), children: [
1254
+ return /* @__PURE__ */ e(oe, { appear: !0, show: t, as: J, children: /* @__PURE__ */ l(me, { as: "div", className: "modal-dialog", onClose: () => r({}), children: [
1255
1255
  /* @__PURE__ */ e(
1256
1256
  ge,
1257
1257
  {
1258
- as: Q,
1258
+ as: J,
1259
1259
  enter: "ease-out duration-300",
1260
1260
  enterFrom: "opacity-0",
1261
1261
  enterTo: "opacity-100",
@@ -1268,7 +1268,7 @@ const _r = {
1268
1268
  /* @__PURE__ */ e("div", { className: "modal-positioner", children: /* @__PURE__ */ e(
1269
1269
  ge,
1270
1270
  {
1271
- as: Q,
1271
+ as: J,
1272
1272
  enter: "ease-out duration-300",
1273
1273
  enterFrom: "opacity-0 scale-95",
1274
1274
  enterTo: "opacity-100 scale-100",
@@ -1285,7 +1285,7 @@ const _r = {
1285
1285
  ] }),
1286
1286
  (n || u) && /* @__PURE__ */ l("div", { className: "modal-footer", children: [
1287
1287
  u && /* @__PURE__ */ e(
1288
- H,
1288
+ Z,
1289
1289
  {
1290
1290
  onClick: m,
1291
1291
  label: u,
@@ -1293,7 +1293,7 @@ const _r = {
1293
1293
  }
1294
1294
  ),
1295
1295
  n && /* @__PURE__ */ e(
1296
- H,
1296
+ Z,
1297
1297
  {
1298
1298
  onClick: k,
1299
1299
  label: n,
@@ -1313,13 +1313,13 @@ const _r = {
1313
1313
  onItemsPerPageChange: n,
1314
1314
  itemsPerPageOptions: u = [10, 15, 20]
1315
1315
  }) => {
1316
- const i = Math.ceil(r / s), [d, y] = B(t);
1317
- X(() => {
1316
+ const i = Math.ceil(r / s), [c, y] = B(t);
1317
+ Q(() => {
1318
1318
  y(t);
1319
1319
  }, [t]);
1320
1320
  const b = Math.min((t - 1) * s + 1, r), N = Math.min(t * s, r), a = (k) => {
1321
1321
  k.preventDefault();
1322
- let m = parseInt(d, 10);
1322
+ let m = parseInt(c, 10);
1323
1323
  isNaN(m) || m < 1 ? m = 1 : m > i && (m = i), y(m), m !== t && o(m);
1324
1324
  };
1325
1325
  return /* @__PURE__ */ l("div", { className: "pagination-container", children: [
@@ -1370,7 +1370,7 @@ const _r = {
1370
1370
  {
1371
1371
  type: "number",
1372
1372
  className: "page-input",
1373
- value: d,
1373
+ value: c,
1374
1374
  onChange: (k) => y(k.target.value),
1375
1375
  onBlur: a,
1376
1376
  "aria-label": `Current page, Page ${t}`
@@ -1422,12 +1422,12 @@ const _r = {
1422
1422
  ze.Option,
1423
1423
  {
1424
1424
  value: i.value,
1425
- className: ({ active: d, checked: y }) => J("radiogroup-option", {
1426
- "radiogroup-option--active": d,
1425
+ className: ({ active: c, checked: y }) => Y("radiogroup-option", {
1426
+ "radiogroup-option--active": c,
1427
1427
  "radiogroup-option--checked": y,
1428
1428
  "radiogroup-option--error": !!n
1429
1429
  }),
1430
- children: ({ checked: d }) => /* @__PURE__ */ l(ee, { children: [
1430
+ children: ({ checked: c }) => /* @__PURE__ */ l(ee, { children: [
1431
1431
  /* @__PURE__ */ l("div", { className: "radiogroup-option-content", children: [
1432
1432
  /* @__PURE__ */ e(ze.Label, { as: "p", className: "option-label", children: i.label }),
1433
1433
  i.description && /* @__PURE__ */ e(
@@ -1439,7 +1439,7 @@ const _r = {
1439
1439
  }
1440
1440
  )
1441
1441
  ] }),
1442
- d && /* @__PURE__ */ e("div", { className: "option-checkmark", children: /* @__PURE__ */ e(wt, { size: 20 }) })
1442
+ c && /* @__PURE__ */ e("div", { className: "option-checkmark", children: /* @__PURE__ */ e(wt, { size: 20 }) })
1443
1443
  ] })
1444
1444
  },
1445
1445
  i.value
@@ -1457,8 +1457,8 @@ const _r = {
1457
1457
  customClass: u = "",
1458
1458
  ...i
1459
1459
  }) => {
1460
- const [d, y] = B(t);
1461
- X(() => {
1460
+ const [c, y] = B(t);
1461
+ Q(() => {
1462
1462
  y(t);
1463
1463
  }, [t]);
1464
1464
  const b = K(
@@ -1467,9 +1467,9 @@ const _r = {
1467
1467
  }, s),
1468
1468
  [s, r]
1469
1469
  );
1470
- X(() => (d !== t && b(d), () => {
1470
+ Q(() => (c !== t && b(c), () => {
1471
1471
  b.cancel();
1472
- }), [d, b, t]);
1472
+ }), [c, b, t]);
1473
1473
  const N = (a) => {
1474
1474
  y(a.target.value);
1475
1475
  };
@@ -1484,7 +1484,7 @@ const _r = {
1484
1484
  placeholder: o,
1485
1485
  type: "search",
1486
1486
  name: "search",
1487
- value: d,
1487
+ value: c,
1488
1488
  onChange: N,
1489
1489
  ...i
1490
1490
  }
@@ -1500,20 +1500,20 @@ const _r = {
1500
1500
  placeholder: n = "Select an option...",
1501
1501
  disabled: u = !1,
1502
1502
  error: i,
1503
- ref: d,
1503
+ ref: c,
1504
1504
  // From RHF's <Controller>
1505
1505
  showSearch: y = !0
1506
1506
  }) => {
1507
1507
  const [b, N] = B(""), a = b === "" ? o : o.filter(
1508
1508
  (m) => m.label.toLowerCase().includes(b.toLowerCase())
1509
1509
  ), k = o.find((m) => r?.id ? m.id === r.id : m.id === r || m.value === r);
1510
- return /* @__PURE__ */ e(Z, { value: r, onChange: s, disabled: u, children: /* @__PURE__ */ l("div", { className: "select-wrapper", ref: d, children: [
1510
+ return /* @__PURE__ */ e(X, { value: r, onChange: s, disabled: u, children: /* @__PURE__ */ l("div", { className: "select-wrapper", ref: c, children: [
1511
1511
  t && /* @__PURE__ */ e("label", { className: "select-label", children: t }),
1512
1512
  /* @__PURE__ */ l("div", { className: "select-button-container", children: [
1513
1513
  /* @__PURE__ */ l(
1514
1514
  cr,
1515
1515
  {
1516
- className: J("select-button", {
1516
+ className: Y("select-button", {
1517
1517
  "select-button--error": !!i
1518
1518
  }),
1519
1519
  children: [
@@ -1572,7 +1572,7 @@ const _r = {
1572
1572
  ] }) });
1573
1573
  }, Hr = () => {
1574
1574
  const [t, r] = B(window.location.pathname);
1575
- return X(() => {
1575
+ return Q(() => {
1576
1576
  const s = () => {
1577
1577
  r(window.location.pathname);
1578
1578
  };
@@ -1586,8 +1586,8 @@ const _r = {
1586
1586
  return s;
1587
1587
  return null;
1588
1588
  }, Va = ({ item: t, isCollapsed: r, level: s = 0 }) => {
1589
- const { pathname: o } = Hr(), n = t.href || t.url || t.path, [u, i] = B(!1), d = t.icon;
1590
- X(() => {
1589
+ const { pathname: o } = Hr(), n = t.href || t.url || t.path, [u, i] = B(!1), c = t.icon;
1590
+ Q(() => {
1591
1591
  na([t], o) && i(!0);
1592
1592
  }, [t, o]);
1593
1593
  const y = o === n, b = !y && !!na([t], o), N = (a) => {
@@ -1596,7 +1596,7 @@ const _r = {
1596
1596
  return /* @__PURE__ */ l(
1597
1597
  "div",
1598
1598
  {
1599
- className: J("nav-item-container", {
1599
+ className: Y("nav-item-container", {
1600
1600
  "nav-item-container--parent-active": b,
1601
1601
  [`nav-item-container--level-${s}`]: s > 0
1602
1602
  }),
@@ -1607,13 +1607,13 @@ const _r = {
1607
1607
  href: n,
1608
1608
  target: t.target,
1609
1609
  rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
1610
- className: J("nav-item", {
1610
+ className: Y("nav-item", {
1611
1611
  "nav-item--active": y,
1612
1612
  "nav-item--collapsed": r
1613
1613
  }),
1614
1614
  "aria-current": y ? "page" : void 0,
1615
1615
  children: [
1616
- d && /* @__PURE__ */ e(d, { className: "nav-icon", "aria-hidden": "true" }),
1616
+ c && /* @__PURE__ */ e(c, { className: "nav-icon", "aria-hidden": "true" }),
1617
1617
  /* @__PURE__ */ e("span", { className: "nav-label", children: t.label || t.name }),
1618
1618
  t.children && /* @__PURE__ */ e(
1619
1619
  "button",
@@ -1625,7 +1625,7 @@ const _r = {
1625
1625
  children: /* @__PURE__ */ e(
1626
1626
  wa,
1627
1627
  {
1628
- className: J("nav-chevron", {
1628
+ className: Y("nav-chevron", {
1629
1629
  "nav-chevron--open": u
1630
1630
  })
1631
1631
  }
@@ -1638,7 +1638,7 @@ const _r = {
1638
1638
  t.children && /* @__PURE__ */ e(
1639
1639
  "div",
1640
1640
  {
1641
- className: J("sub-menu", {
1641
+ className: Y("sub-menu", {
1642
1642
  "sub-menu--open": u,
1643
1643
  "sub-menu--collapsed": r
1644
1644
  }),
@@ -1665,7 +1665,7 @@ const _r = {
1665
1665
  onToggleMobile: n,
1666
1666
  logoSmall: u,
1667
1667
  logoLarge: i,
1668
- user: d = { name: "", email: "" }
1668
+ user: c = { name: "", email: "" }
1669
1669
  }) => /* @__PURE__ */ l(ee, { children: [
1670
1670
  o && /* @__PURE__ */ e(
1671
1671
  "div",
@@ -1678,7 +1678,7 @@ const _r = {
1678
1678
  /* @__PURE__ */ l(
1679
1679
  "aside",
1680
1680
  {
1681
- className: J("sidebar", {
1681
+ className: Y("sidebar", {
1682
1682
  "sidebar--collapsed": r,
1683
1683
  "sidebar--mobile-open": o
1684
1684
  }),
@@ -1710,10 +1710,10 @@ const _r = {
1710
1710
  ] }),
1711
1711
  /* @__PURE__ */ e("nav", { className: "sidebar-nav", "aria-label": "Primary", children: /* @__PURE__ */ e("ul", { className: "sidebar-nav-list", children: t.map((y) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(Va, { item: y, isCollapsed: r }) }, y.label || y.name)) }) }),
1712
1712
  /* @__PURE__ */ l("div", { className: "sidebar-footer", children: [
1713
- /* @__PURE__ */ e(za, { src: d.avatar, name: d.name, size: "medium" }),
1713
+ /* @__PURE__ */ e(za, { src: c.avatar, name: c.name, size: "medium" }),
1714
1714
  /* @__PURE__ */ l("div", { className: "user-info", children: [
1715
- /* @__PURE__ */ e("span", { className: "user-name", children: d.name }),
1716
- /* @__PURE__ */ e("span", { className: "user-email", children: d.email })
1715
+ /* @__PURE__ */ e("span", { className: "user-name", children: c.name }),
1716
+ /* @__PURE__ */ e("span", { className: "user-email", children: c.email })
1717
1717
  ] }),
1718
1718
  /* @__PURE__ */ e(
1719
1719
  "button",
@@ -1736,7 +1736,7 @@ const _r = {
1736
1736
  className: s,
1737
1737
  ...o
1738
1738
  }) => {
1739
- const n = J(
1739
+ const n = Y(
1740
1740
  "spinner",
1741
1741
  `spinner--size-${t}`,
1742
1742
  `spinner--color-${r}`,
@@ -1774,12 +1774,12 @@ const _r = {
1774
1774
  // ✅ New prop for max length
1775
1775
  showCharCount: i = !1,
1776
1776
  // ✅ New prop to control visibility
1777
- ...d
1777
+ ...c
1778
1778
  }) => {
1779
- const y = r || d.name, [b, N] = B(
1780
- d.value?.length || d.defaultValue?.length || 0
1779
+ const y = r || c.name, [b, N] = B(
1780
+ c.value?.length || c.defaultValue?.length || 0
1781
1781
  ), a = (m) => {
1782
- N(m.target.value.length), d.onChange && d.onChange(m);
1782
+ N(m.target.value.length), c.onChange && c.onChange(m);
1783
1783
  }, k = u - b;
1784
1784
  return /* @__PURE__ */ l("div", { className: `textarea-wrapper ${o || ""}`, children: [
1785
1785
  /* @__PURE__ */ l("div", { className: "textarea-header", children: [
@@ -1794,12 +1794,12 @@ const _r = {
1794
1794
  {
1795
1795
  id: y,
1796
1796
  ref: n,
1797
- className: J("textarea-field", {
1797
+ className: Y("textarea-field", {
1798
1798
  "textarea-field--error": !!s
1799
1799
  }),
1800
1800
  maxLength: u,
1801
1801
  onChange: a,
1802
- ...d
1802
+ ...c
1803
1803
  }
1804
1804
  ),
1805
1805
  s && /* @__PURE__ */ e("p", { className: "textarea-error-message", children: s })
@@ -1819,7 +1819,7 @@ const _r = {
1819
1819
  {
1820
1820
  checked: r,
1821
1821
  onChange: s,
1822
- className: J("switch-element", {
1822
+ className: Y("switch-element", {
1823
1823
  // Renamed from switch-wrapper
1824
1824
  "switch-element--error": !!n
1825
1825
  }),
@@ -1843,13 +1843,13 @@ const _r = {
1843
1843
  // For external styling of the tooltip itself
1844
1844
  ...i
1845
1845
  }) => {
1846
- const d = ae.useId();
1846
+ const c = ae.useId();
1847
1847
  return /* @__PURE__ */ l(ee, { children: [
1848
- ae.cloneElement(t, { "data-tooltip-id": d }),
1848
+ ae.cloneElement(t, { "data-tooltip-id": c }),
1849
1849
  /* @__PURE__ */ e(
1850
1850
  Dt,
1851
1851
  {
1852
- id: d,
1852
+ id: c,
1853
1853
  content: r,
1854
1854
  place: n,
1855
1855
  variant: s,
@@ -1879,12 +1879,12 @@ const _r = {
1879
1879
  direction: n = 1,
1880
1880
  stepProps: u = {},
1881
1881
  title: i,
1882
- description: d,
1882
+ description: c,
1883
1883
  showProgress: y = !0,
1884
1884
  closeOnOverlayClick: b = !0
1885
1885
  }) => {
1886
1886
  const N = s[o], a = Object.keys(s), k = a.indexOf(o), m = (k + 1) / a.length * 100, g = k > 0 && u.onBack;
1887
- return /* @__PURE__ */ e(oe, { show: t, as: Q, children: /* @__PURE__ */ l(
1887
+ return /* @__PURE__ */ e(oe, { show: t, as: J, children: /* @__PURE__ */ l(
1888
1888
  me,
1889
1889
  {
1890
1890
  as: "div",
@@ -1895,7 +1895,7 @@ const _r = {
1895
1895
  /* @__PURE__ */ e(
1896
1896
  ge,
1897
1897
  {
1898
- as: Q,
1898
+ as: J,
1899
1899
  enter: "ease-out duration-300",
1900
1900
  enterFrom: "opacity-0",
1901
1901
  enterTo: "opacity-100",
@@ -1908,7 +1908,7 @@ const _r = {
1908
1908
  /* @__PURE__ */ e("div", { className: "wizard-container", children: /* @__PURE__ */ e("div", { className: "wizard-positioner", children: /* @__PURE__ */ e(
1909
1909
  ge,
1910
1910
  {
1911
- as: Q,
1911
+ as: J,
1912
1912
  enter: "transform transition ease-in-out duration-500",
1913
1913
  enterFrom: "translate-x-full",
1914
1914
  enterTo: "translate-x-0",
@@ -1929,7 +1929,7 @@ const _r = {
1929
1929
  ),
1930
1930
  /* @__PURE__ */ l("div", { className: "wizard-header-text", children: [
1931
1931
  /* @__PURE__ */ e(me.Title, { as: "h3", className: "wizard-title", children: i }),
1932
- d && /* @__PURE__ */ e(me.Description, { className: "wizard-description", children: d })
1932
+ c && /* @__PURE__ */ e(me.Description, { className: "wizard-description", children: c })
1933
1933
  ] })
1934
1934
  ] }),
1935
1935
  /* @__PURE__ */ e(
@@ -1991,21 +1991,21 @@ const _r = {
1991
1991
  tertiary: u,
1992
1992
  fullHeight: i = !1,
1993
1993
  // A clearer prop name
1994
- ...d
1994
+ ...c
1995
1995
  }) => {
1996
- const y = J(
1996
+ const y = Y(
1997
1997
  "page-layout",
1998
1998
  {
1999
1999
  "page-layout--with-footer": r,
2000
2000
  "page-layout--full-height": i
2001
2001
  },
2002
- d.className
2002
+ c.className
2003
2003
  );
2004
- return /* @__PURE__ */ l("div", { className: y, ...d, children: [
2004
+ return /* @__PURE__ */ l("div", { className: y, ...c, children: [
2005
2005
  /* @__PURE__ */ e("div", { className: "page-layout-content", children: t }),
2006
2006
  r && /* @__PURE__ */ e("footer", { className: "page-layout-footer", children: s || /* @__PURE__ */ l("div", { className: "footer-actions", children: [
2007
2007
  u?.show && /* @__PURE__ */ e(
2008
- H,
2008
+ Z,
2009
2009
  {
2010
2010
  category: "secondary",
2011
2011
  label: u.label || "Tertiary",
@@ -2013,7 +2013,7 @@ const _r = {
2013
2013
  }
2014
2014
  ),
2015
2015
  n?.show && /* @__PURE__ */ e(
2016
- H,
2016
+ Z,
2017
2017
  {
2018
2018
  category: "secondary",
2019
2019
  label: n.label || "Cancel",
@@ -2021,7 +2021,7 @@ const _r = {
2021
2021
  }
2022
2022
  ),
2023
2023
  o?.show && /* @__PURE__ */ e(
2024
- H,
2024
+ Z,
2025
2025
  {
2026
2026
  category: "primary",
2027
2027
  label: o.label || "Save",
@@ -2067,7 +2067,7 @@ const _r = {
2067
2067
  /* @__PURE__ */ e(gr, { children: /* @__PURE__ */ e(
2068
2068
  oe,
2069
2069
  {
2070
- as: Q,
2070
+ as: J,
2071
2071
  enter: "transition ease-out duration-100",
2072
2072
  enterFrom: "transform opacity-0 scale-95",
2073
2073
  enterTo: "transform opacity-100 scale-100",
@@ -2256,13 +2256,13 @@ function ha() {
2256
2256
  }
2257
2257
  function cn(t) {
2258
2258
  if (t && t.isAxiosError) {
2259
- const { response: r, config: s, message: o } = t, n = r?.status ?? null, u = r?.statusText ?? null, i = r?.data ?? null, d = typeof i == "string" && i || i?.message || i?.msg || i?.error || i?.errors?.[0]?.message || null;
2259
+ const { response: r, config: s, message: o } = t, n = r?.status ?? null, u = r?.statusText ?? null, i = r?.data ?? null, c = typeof i == "string" && i || i?.message || i?.msg || i?.error || i?.errors?.[0]?.message || null;
2260
2260
  return {
2261
2261
  ok: !1,
2262
2262
  status: n,
2263
2263
  statusText: u,
2264
2264
  code: i?.code || null,
2265
- message: d || o || "Request failed",
2265
+ message: c || o || "Request failed",
2266
2266
  details: i || null,
2267
2267
  request: {
2268
2268
  url: s?.url || null,
@@ -2323,7 +2323,7 @@ function dn({
2323
2323
  async function i(b, N = {}, a = !1, k = {}) {
2324
2324
  return s.post(b, N, o({ open: a, customHeader: k }));
2325
2325
  }
2326
- async function d(b, N = {}, a = !1, k = {}) {
2326
+ async function c(b, N = {}, a = !1, k = {}) {
2327
2327
  return s.put(b, N, o({ open: a, customHeader: k }));
2328
2328
  }
2329
2329
  async function y(b, N = {}, a = !1, k = {}) {
@@ -2335,7 +2335,7 @@ function dn({
2335
2335
  axiosGet: n,
2336
2336
  axiosDelete: u,
2337
2337
  axiosPost: i,
2338
- axiosPut: d,
2338
+ axiosPut: c,
2339
2339
  axiosPatch: y
2340
2340
  };
2341
2341
  }
@@ -2426,7 +2426,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2426
2426
  }
2427
2427
  }, oa = (t, r) => {
2428
2428
  const [s, o] = B(t);
2429
- return X(
2429
+ return Q(
2430
2430
  () => {
2431
2431
  const n = Cr(() => {
2432
2432
  o(t);
@@ -2446,9 +2446,9 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2446
2446
  }) => {
2447
2447
  const n = t.slice(0, 2), u = [];
2448
2448
  t.length > 0 && u.push(t[0].name), r.length > 0 && u.push(r[0].name), s.length > 0 && u.length < 2 && u.push(s[0].name);
2449
- const i = t.length + r.length + s.length, d = i - u.length;
2449
+ const i = t.length + r.length + s.length, c = i - u.length;
2450
2450
  let y = u.join(", ");
2451
- return d > 0 && (y += ` and ${d} others`), i === 0 ? /* @__PURE__ */ e(
2451
+ return c > 0 && (y += ` and ${c} others`), i === 0 ? /* @__PURE__ */ e(
2452
2452
  "div",
2453
2453
  {
2454
2454
  className: "flex items-center justify-between p-3 border border-dashed border-gray-400 rounded-lg hover:bg-gray-50",
@@ -2495,82 +2495,82 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2495
2495
  showExistingShares: u = !1,
2496
2496
  onFinalSubmit: i = () => {
2497
2497
  },
2498
- isChanged: d = !1
2498
+ isChanged: c = !1
2499
2499
  }) => {
2500
- const [y, b] = B(ga[0]), [N, a] = B(""), k = oa(N, 400), [m, g] = B([]), [$, L] = B(/* @__PURE__ */ new Set()), [O, C] = B(!1), [T, E] = B(ya[0]), {
2500
+ const [y, b] = B(ga[0]), [N, a] = B(""), k = oa(N, 400), [m, g] = B([]), [$, L] = B(/* @__PURE__ */ new Set()), [M, C] = B(!1), [T, E] = B(ya[0]), {
2501
2501
  control: R,
2502
- handleSubmit: V,
2503
- watch: q,
2504
- formState: { errors: G, isSubmitting: v }
2502
+ handleSubmit: U,
2503
+ watch: V,
2504
+ formState: { errors: j, isSubmitting: v }
2505
2505
  } = zt({
2506
2506
  defaultValues: { pendingInvites: [] },
2507
2507
  resolver: Lt(yn)
2508
- }), { fields: p, append: f, remove: w, update: c } = Pt({
2508
+ }), { fields: p, append: f, remove: w, update: d } = Pt({
2509
2509
  control: R,
2510
2510
  name: "pendingInvites"
2511
- }), h = q("pendingInvites");
2512
- X(() => {
2513
- k.length > 1 ? (C(!0), hn(y.name, k).then((D) => {
2514
- g(D);
2515
- }).catch((D) => console.error("Search failed:", D)).finally(() => C(!1))) : (g([]), L(/* @__PURE__ */ new Set()));
2511
+ }), h = V("pendingInvites");
2512
+ Q(() => {
2513
+ k.length > 1 ? (C(!0), hn(y.name, k).then((S) => {
2514
+ g(S);
2515
+ }).catch((S) => console.error("Search failed:", S)).finally(() => C(!1))) : (g([]), L(/* @__PURE__ */ new Set()));
2516
2516
  }, [k, y]);
2517
- const x = (D) => {
2518
- L((z) => {
2519
- const U = new Set(z);
2520
- return U.has(D) ? U.delete(D) : U.add(D), U;
2517
+ const x = (S) => {
2518
+ L((I) => {
2519
+ const O = new Set(I);
2520
+ return O.has(S) ? O.delete(S) : O.add(S), O;
2521
2521
  });
2522
2522
  }, F = () => {
2523
- m.filter((D) => $.has(D.id)).forEach((D) => {
2524
- p.find((z) => z.id === D.id) || f({ ...D, permission: T.name });
2523
+ m.filter((S) => $.has(S.id)).forEach((S) => {
2524
+ p.find((I) => I.id === S.id) || f({ ...S, permission: T.name });
2525
2525
  }), L(/* @__PURE__ */ new Set()), a("");
2526
- }, I = (D) => {
2527
- E(D), p.forEach(
2528
- (z, U) => c(U, { ...p[U], permission: D.name })
2526
+ }, z = (S) => {
2527
+ E(S), p.forEach(
2528
+ (I, O) => d(O, { ...p[O], permission: S.name })
2529
2529
  );
2530
- }, j = async (D) => {
2530
+ }, q = async (S) => {
2531
2531
  try {
2532
2532
  if (n === se.DRIVE) {
2533
- const z = {
2533
+ const I = {
2534
2534
  entity: t,
2535
- userGroupRolesObj: D.pendingInvites.map((U) => ({
2536
- id: U.id,
2537
- permission: U.permission,
2538
- type: U.type.toLowerCase()
2535
+ userGroupRolesObj: S.pendingInvites.map((O) => ({
2536
+ id: O.id,
2537
+ permission: O.permission,
2538
+ type: O.type.toLowerCase()
2539
2539
  }))
2540
2540
  };
2541
- i(z, o);
2541
+ i(I, o);
2542
2542
  } else if (n === se.INTEREST) {
2543
- const z = D.pendingInvites.map((U) => ({
2544
- identity: U.id,
2545
- type: U.type.toLowerCase(),
2543
+ const I = S.pendingInvites.map((O) => ({
2544
+ identity: O.id,
2545
+ type: O.type.toLowerCase(),
2546
2546
  opt: !0,
2547
2547
  lock: !1,
2548
2548
  moderator: !1,
2549
- userName: U.name,
2549
+ userName: O.name,
2550
2550
  interestId: t?.data?.id
2551
2551
  }));
2552
- i(z, o);
2552
+ i(I, o);
2553
2553
  } else if (n === se.ARTICLE) {
2554
- const z = {
2554
+ const I = {
2555
2555
  entity: t,
2556
- userGroupRolesObj: D.pendingInvites.map((U) => ({
2557
- id: U.id,
2558
- permission: U.permission,
2559
- type: U.type.toLowerCase()
2556
+ userGroupRolesObj: S.pendingInvites.map((O) => ({
2557
+ id: O.id,
2558
+ permission: O.permission,
2559
+ type: O.type.toLowerCase()
2560
2560
  }))
2561
2561
  };
2562
- i(z, o);
2562
+ i(I, o);
2563
2563
  } else
2564
- i(D, o);
2564
+ i(S, o);
2565
2565
  setTimeout(() => {
2566
2566
  s();
2567
2567
  }, 1e3);
2568
- } catch (z) {
2569
- throw console.error("Failed to submit invites:", z), z;
2568
+ } catch (I) {
2569
+ throw console.error("Failed to submit invites:", I), I;
2570
2570
  }
2571
- }, S = (D) => {
2572
- const z = o[y.code].find((U) => U.name === D.name) || h.find((U) => U.name === D.name);
2573
- return z ? `${z.permission}` : "";
2571
+ }, D = (S) => {
2572
+ const I = o[y.code].find((O) => O.name === S.name && O.permission !== "remove") || h.find((O) => O.name === S.name);
2573
+ return I ? `${I.permission}` : "";
2574
2574
  }, A = () => {
2575
2575
  switch (n) {
2576
2576
  case se.DRIVE:
@@ -2582,8 +2582,8 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2582
2582
  default:
2583
2583
  return "Add User, Groups or Roles test";
2584
2584
  }
2585
- }, M = ce(() => $.size === 0 && !d, [$, d]);
2586
- return /* @__PURE__ */ l("div", { className: "flex flex-col h-full bg-white", children: [
2585
+ };
2586
+ return ce(() => $.size === 0 && !c, [$, c]), /* @__PURE__ */ l("div", { className: "flex flex-col h-full bg-white", children: [
2587
2587
  /* @__PURE__ */ l("header", { className: "flex items-center justify-between p-4 border-b border-gray-300 flex-shrink-0", children: [
2588
2588
  /* @__PURE__ */ e(me.Title, { className: " text-gray-900 !mb-0 text-lg font-semibold", children: A() }),
2589
2589
  /* @__PURE__ */ l("div", { className: "flex items-center gap-4", children: [
@@ -2605,15 +2605,15 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2605
2605
  (n === se.DRIVE || u) && /* @__PURE__ */ e(
2606
2606
  gn,
2607
2607
  {
2608
- users: o.users.filter((D) => D.permission !== "remove"),
2609
- groups: o.groups.filter((D) => D.permission !== "remove"),
2610
- roles: o.roles.filter((D) => D.permission !== "remove"),
2608
+ users: o.users.filter((S) => S.permission !== "remove"),
2609
+ groups: o.groups.filter((S) => S.permission !== "remove"),
2610
+ roles: o.roles.filter((S) => S.permission !== "remove"),
2611
2611
  onClick: r
2612
2612
  }
2613
2613
  ),
2614
2614
  /* @__PURE__ */ l("div", { className: "relative grid grid-cols-3 gap-2 items-start", children: [
2615
- /* @__PURE__ */ e("div", { className: "col-span-1", children: /* @__PURE__ */ e(Z, { value: y, onChange: b, children: /* @__PURE__ */ l("div", { className: "relative", children: [
2616
- /* @__PURE__ */ l(Z.Button, { className: "relative w-full border border-gray-300 rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
2615
+ /* @__PURE__ */ e("div", { className: "col-span-1", children: /* @__PURE__ */ e(X, { value: y, onChange: b, children: /* @__PURE__ */ l("div", { className: "relative", children: [
2616
+ /* @__PURE__ */ l(X.Button, { className: "relative w-full border border-gray-300 rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
2617
2617
  /* @__PURE__ */ l("span", { className: "flex items-center", children: [
2618
2618
  /* @__PURE__ */ e(y.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
2619
2619
  /* @__PURE__ */ e("span", { className: "truncate", children: y.name })
@@ -2623,35 +2623,35 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2623
2623
  /* @__PURE__ */ e(
2624
2624
  oe,
2625
2625
  {
2626
- as: Q,
2626
+ as: J,
2627
2627
  leave: "transition ease-in duration-100",
2628
2628
  leaveFrom: "opacity-100",
2629
2629
  leaveTo: "opacity-0",
2630
- children: /* @__PURE__ */ e(Z.Options, { className: "absolute z-10 mt-1 w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: ga.map((D) => /* @__PURE__ */ e(
2631
- Z.Option,
2630
+ children: /* @__PURE__ */ e(X.Options, { className: "absolute z-10 mt-1 w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: ga.map((S) => /* @__PURE__ */ e(
2631
+ X.Option,
2632
2632
  {
2633
- value: D,
2634
- className: ({ active: z }) => `${z ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
2635
- children: ({ selected: z }) => /* @__PURE__ */ l(ee, { children: [
2633
+ value: S,
2634
+ className: ({ active: I }) => `${I ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
2635
+ children: ({ selected: I }) => /* @__PURE__ */ l(ee, { children: [
2636
2636
  /* @__PURE__ */ l(
2637
2637
  "span",
2638
2638
  {
2639
- className: `${z ? "font-medium" : "font-normal"} flex items-center`,
2639
+ className: `${I ? "font-medium" : "font-normal"} flex items-center`,
2640
2640
  children: [
2641
2641
  /* @__PURE__ */ e(
2642
- D.icon,
2642
+ S.icon,
2643
2643
  {
2644
- className: `h-5 w-5 mr-2 ${z ? "text-white" : "text-gray-400"}`
2644
+ className: `h-5 w-5 mr-2 ${I ? "text-white" : "text-gray-400"}`
2645
2645
  }
2646
2646
  ),
2647
- D.name
2647
+ S.name
2648
2648
  ]
2649
2649
  }
2650
2650
  ),
2651
- z && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-white", children: /* @__PURE__ */ e(ta, { className: "h-5 w-5" }) })
2651
+ I && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-white", children: /* @__PURE__ */ e(ta, { className: "h-5 w-5" }) })
2652
2652
  ] })
2653
2653
  },
2654
- D.id
2654
+ S.id
2655
2655
  )) })
2656
2656
  }
2657
2657
  )
@@ -2660,11 +2660,11 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2660
2660
  he,
2661
2661
  {
2662
2662
  placeholder: `Search by ${y.name.toLowerCase()}...`,
2663
- onDebouncedChange: (D) => a(D),
2663
+ onDebouncedChange: (S) => a(S),
2664
2664
  value: N
2665
2665
  }
2666
2666
  ) }),
2667
- /* @__PURE__ */ e(be, { children: (m?.length > 0 || O) && /* @__PURE__ */ e(
2667
+ /* @__PURE__ */ e(be, { children: (m?.length > 0 || M) && /* @__PURE__ */ e(
2668
2668
  ne.div,
2669
2669
  {
2670
2670
  initial: { opacity: 0, y: -10 },
@@ -2672,41 +2672,41 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2672
2672
  exit: { opacity: 0, y: -10 },
2673
2673
  transition: { duration: 0.2 },
2674
2674
  className: "absolute top-full mt-2 w-full col-span-3 bg-white border border-gray-300 rounded-lg shadow-lg z-10",
2675
- children: O ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500", children: "Loading..." }) : /* @__PURE__ */ l(ee, { children: [
2676
- /* @__PURE__ */ e("div", { className: "max-h-60 overflow-y-auto p-2 space-y-1", children: m.map((D) => {
2677
- const z = S(D);
2675
+ children: M ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500", children: "Loading..." }) : /* @__PURE__ */ l(ee, { children: [
2676
+ /* @__PURE__ */ e("div", { className: "max-h-60 overflow-y-auto p-2 space-y-1", children: m.map((S) => {
2677
+ const I = D(S);
2678
2678
  return /* @__PURE__ */ l(
2679
2679
  "div",
2680
2680
  {
2681
- onClick: () => z ? null : x(D.id),
2682
- className: `flex items-center gap-3 p-2 rounded-md hover:bg-blue-50 ${z ? " hover:cursor-not-allowed" : "hover:cursor-pointer"}`,
2681
+ onClick: () => I ? null : x(S.id),
2682
+ className: `flex items-center gap-3 p-2 rounded-md hover:bg-blue-50 ${I ? " hover:cursor-not-allowed" : "hover:cursor-pointer"}`,
2683
2683
  children: [
2684
2684
  /* @__PURE__ */ e(
2685
2685
  "input",
2686
2686
  {
2687
2687
  type: "checkbox",
2688
- checked: $.has(D.id),
2688
+ checked: $.has(S.id),
2689
2689
  readOnly: !0,
2690
2690
  className: "h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500",
2691
- disabled: !!z
2691
+ disabled: !!I
2692
2692
  }
2693
2693
  ),
2694
2694
  /* @__PURE__ */ e(
2695
2695
  "img",
2696
2696
  {
2697
- src: D.avatarUrl || `https://avatar.vercel.sh/${D.name}.svg?text=${D.name.charAt(0)}`,
2698
- alt: D.name,
2697
+ src: S.avatarUrl || `https://avatar.vercel.sh/${S.name}.svg?text=${S.name.charAt(0)}`,
2698
+ alt: S.name,
2699
2699
  className: "w-8 h-8 rounded-full"
2700
2700
  }
2701
2701
  ),
2702
- /* @__PURE__ */ e("span", { className: "text-md font-medium text-gray-800 truncate", children: D.name }),
2703
- z ? /* @__PURE__ */ l(ee, { children: [
2704
- /* @__PURE__ */ e("span", { className: "text-sm px-[12px] py-[2px] border border-dashed rounded-xl bg-teal-100 text-teal-700", children: z }),
2702
+ /* @__PURE__ */ e("span", { className: "text-md font-medium text-gray-800 truncate", children: S.name }),
2703
+ I ? /* @__PURE__ */ l(ee, { children: [
2704
+ /* @__PURE__ */ e("span", { className: "text-sm px-[12px] py-[2px] border border-dashed rounded-xl bg-teal-100 text-teal-700", children: I }),
2705
2705
  /* @__PURE__ */ e("span", { className: "text-sm text-gray-400", children: "Already added" })
2706
2706
  ] }) : ""
2707
2707
  ]
2708
2708
  },
2709
- D.id
2709
+ S.id
2710
2710
  );
2711
2711
  }) }),
2712
2712
  /* @__PURE__ */ l("div", { className: "flex justify-end gap-2 p-2 border-t border-gray-300", children: [
@@ -2746,12 +2746,12 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2746
2746
  ")"
2747
2747
  ] }),
2748
2748
  n === se.DRIVE && /* @__PURE__ */ e(
2749
- Z,
2749
+ X,
2750
2750
  {
2751
2751
  value: T,
2752
- onChange: I,
2752
+ onChange: z,
2753
2753
  children: /* @__PURE__ */ l("div", { className: "relative", children: [
2754
- /* @__PURE__ */ l(Z.Button, { className: "relative w-full border border-gray-300 bg-white rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
2754
+ /* @__PURE__ */ l(X.Button, { className: "relative w-full border border-gray-300 bg-white rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
2755
2755
  /* @__PURE__ */ l("span", { className: "flex items-center", children: [
2756
2756
  /* @__PURE__ */ e(T.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
2757
2757
  /* @__PURE__ */ l("span", { className: "truncate", children: [
@@ -2764,33 +2764,33 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2764
2764
  /* @__PURE__ */ e(
2765
2765
  oe,
2766
2766
  {
2767
- as: Q,
2767
+ as: J,
2768
2768
  leave: "transition ease-in duration-100",
2769
2769
  leaveFrom: "opacity-100",
2770
2770
  leaveTo: "opacity-0",
2771
- children: /* @__PURE__ */ e(Z.Options, { className: "absolute z-10 mt-1 w-auto min-w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: ya.map((D) => /* @__PURE__ */ e(
2772
- Z.Option,
2771
+ children: /* @__PURE__ */ e(X.Options, { className: "absolute z-10 mt-1 w-auto min-w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: ya.map((S) => /* @__PURE__ */ e(
2772
+ X.Option,
2773
2773
  {
2774
- value: D,
2775
- className: ({ active: z }) => `${z ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
2776
- children: ({ selected: z, active: U }) => /* @__PURE__ */ l(ee, { children: [
2774
+ value: S,
2775
+ className: ({ active: I }) => `${I ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
2776
+ children: ({ selected: I, active: O }) => /* @__PURE__ */ l(ee, { children: [
2777
2777
  /* @__PURE__ */ l(
2778
2778
  "span",
2779
2779
  {
2780
- className: `${z ? "font-medium" : "font-normal"} flex items-center`,
2780
+ className: `${I ? "font-medium" : "font-normal"} flex items-center`,
2781
2781
  children: [
2782
2782
  /* @__PURE__ */ e(
2783
- D.icon,
2783
+ S.icon,
2784
2784
  {
2785
- className: `h-5 w-5 mr-2 ${U ? "text-white" : "text-gray-400"}`
2785
+ className: `h-5 w-5 mr-2 ${O ? "text-white" : "text-gray-400"}`
2786
2786
  }
2787
2787
  ),
2788
2788
  "Can ",
2789
- D.name
2789
+ S.name
2790
2790
  ]
2791
2791
  }
2792
2792
  ),
2793
- z && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-blue-600", children: /* @__PURE__ */ e(
2793
+ I && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-blue-600", children: /* @__PURE__ */ e(
2794
2794
  ta,
2795
2795
  {
2796
2796
  className: "h-5 w-5",
@@ -2799,7 +2799,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2799
2799
  ) })
2800
2800
  ] })
2801
2801
  },
2802
- D.id
2802
+ S.id
2803
2803
  )) })
2804
2804
  }
2805
2805
  )
@@ -2807,7 +2807,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2807
2807
  }
2808
2808
  )
2809
2809
  ] }),
2810
- /* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e(be, { children: p.map((D, z) => /* @__PURE__ */ l(
2810
+ /* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e(be, { children: p.map((S, I) => /* @__PURE__ */ l(
2811
2811
  ne.div,
2812
2812
  {
2813
2813
  layout: !0,
@@ -2821,21 +2821,21 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2821
2821
  /* @__PURE__ */ e(
2822
2822
  "img",
2823
2823
  {
2824
- src: D.avatarUrl || `https://avatar.vercel.sh/${D.name}.svg?text=${D.name.charAt(0)}`,
2824
+ src: S.avatarUrl || `https://avatar.vercel.sh/${S.name}.svg?text=${S.name.charAt(0)}`,
2825
2825
  className: "w-8 h-8 rounded-full flex-shrink-0"
2826
2826
  }
2827
2827
  ),
2828
- /* @__PURE__ */ e("span", { className: "font-medium text-sm text-gray-800 truncate", children: D.name })
2828
+ /* @__PURE__ */ e("span", { className: "font-medium text-sm text-gray-800 truncate", children: S.name })
2829
2829
  ] }),
2830
2830
  /* @__PURE__ */ l("div", { className: "flex items-center gap-3", children: [
2831
2831
  n === se.DRIVE && /* @__PURE__ */ l("span", { className: "text-sm text-gray-500", children: [
2832
2832
  "can ",
2833
- D.permission
2833
+ S.permission
2834
2834
  ] }),
2835
2835
  /* @__PURE__ */ e(
2836
2836
  "button",
2837
2837
  {
2838
- onClick: () => w(z),
2838
+ onClick: () => w(I),
2839
2839
  className: "text-gray-400 hover:text-red-500 hover:cursor-pointer",
2840
2840
  children: /* @__PURE__ */ e(qe, { className: "h-5 w-5" })
2841
2841
  }
@@ -2843,7 +2843,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2843
2843
  ] })
2844
2844
  ]
2845
2845
  },
2846
- D.id
2846
+ S.id
2847
2847
  )) }) })
2848
2848
  ]
2849
2849
  }
@@ -2868,8 +2868,8 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2868
2868
  /* @__PURE__ */ e(
2869
2869
  "button",
2870
2870
  {
2871
- onClick: V(j),
2872
- disabled: v || h.length === 0 && M,
2871
+ onClick: () => U(q)(),
2872
+ disabled: v || h.length === 0 && !c,
2873
2873
  className: "px-4 py-2 text-sm font-medium text-white bg-blue-600 border border-transparent rounded-md shadow-sm hover:bg-blue-700 hover:cursor-pointer focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-blue-300 disabled:cursor-not-allowed",
2874
2874
  children: v ? "Inviting..." : n === se.DRIVE ? "Send Invites" : "Add"
2875
2875
  }
@@ -2882,24 +2882,24 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2882
2882
  { name: "Can manage", icon: Da, value: "edit" },
2883
2883
  { name: "Remove", icon: Ot, isDestructive: !0, value: "remove" }
2884
2884
  ], bn = ({ item: t, allowedPermissions: r, onPermissionChange: s }) => {
2885
- const [o, n] = B(!1), { refs: u, floatingStyles: i, context: d } = Ta({
2885
+ const [o, n] = B(!1), { refs: u, floatingStyles: i, context: c } = Ta({
2886
2886
  open: o,
2887
2887
  onOpenChange: n,
2888
2888
  middleware: [Aa(8), Ea(), Ra({ padding: 8 })],
2889
2889
  whileElementsMounted: Ia,
2890
2890
  placement: "bottom-end"
2891
- }), y = Nr(d), b = xr(d), { getReferenceProps: N, getFloatingProps: a } = kr([
2891
+ }), y = Nr(c), b = xr(c), { getReferenceProps: N, getFloatingProps: a } = kr([
2892
2892
  y,
2893
2893
  b
2894
2894
  ]), k = Ke.find((g) => g.name === t.permission || g.value === t.permission) || Ke[0];
2895
2895
  return (
2896
2896
  // FIX: The <Listbox> component now wraps both the button and the portal.
2897
2897
  // This provides the necessary context for both children.
2898
- /* @__PURE__ */ l(Z, { value: k, onChange: (g) => {
2898
+ /* @__PURE__ */ l(X, { value: k, onChange: (g) => {
2899
2899
  s(g), n(!1);
2900
2900
  }, children: [
2901
2901
  /* @__PURE__ */ l(
2902
- Z.Button,
2902
+ X.Button,
2903
2903
  {
2904
2904
  ref: u.setReference,
2905
2905
  ...N(),
@@ -2913,7 +2913,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2913
2913
  /* @__PURE__ */ e(wr, { children: /* @__PURE__ */ e(
2914
2914
  oe,
2915
2915
  {
2916
- as: Q,
2916
+ as: J,
2917
2917
  show: o,
2918
2918
  enter: "transition ease-out duration-100",
2919
2919
  enterFrom: "transform opacity-0 scale-95",
@@ -2922,7 +2922,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2922
2922
  leaveFrom: "transform opacity-100 scale-100",
2923
2923
  leaveTo: "transform opacity-0 scale-95",
2924
2924
  children: /* @__PURE__ */ e(
2925
- Z.Options,
2925
+ X.Options,
2926
2926
  {
2927
2927
  ref: u.setFloating,
2928
2928
  style: i,
@@ -2930,7 +2930,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2930
2930
  static: !0,
2931
2931
  className: "z-50 w-48 bg-white shadow-lg rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm",
2932
2932
  children: Ke.filter((g) => r.includes(g.value)).map((g) => /* @__PURE__ */ e(
2933
- Z.Option,
2933
+ X.Option,
2934
2934
  {
2935
2935
  className: ({
2936
2936
  active: $
@@ -2970,7 +2970,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2970
2970
  existingShares: n,
2971
2971
  allowedPermissions: u
2972
2972
  }) => {
2973
- const [i, d] = B(n), [y, b] = B(0), [N, a] = B(""), k = oa(N, 300), m = {
2973
+ const [i, c] = B(n), [y, b] = B(0), [N, a] = B(""), k = oa(N, 300), m = {
2974
2974
  users: i.users.filter(
2975
2975
  (C) => C.name.toLowerCase().includes(k.toLowerCase())
2976
2976
  ),
@@ -2981,15 +2981,15 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2981
2981
  (C) => C.name.toLowerCase().includes(k.toLowerCase())
2982
2982
  )
2983
2983
  }, g = async (C, T, E, R) => {
2984
- const V = T.value;
2985
- d((q) => ({
2986
- ...q,
2987
- [E]: q[E].map(
2988
- (G) => G.id === C.id ? { ...G, permission: V } : G
2984
+ const U = T.value;
2985
+ c((V) => ({
2986
+ ...V,
2987
+ [E]: V[E].map(
2988
+ (j) => j.id === C.id ? { ...j, permission: U } : j
2989
2989
  )
2990
2990
  }));
2991
2991
  }, $ = () => {
2992
- d((C) => {
2992
+ c((C) => {
2993
2993
  const T = {
2994
2994
  users: C.users.filter((E) => E.permission !== "remove"),
2995
2995
  groups: C.groups.filter((E) => E.permission !== "remove"),
@@ -2997,7 +2997,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
2997
2997
  };
2998
2998
  return r(T), T;
2999
2999
  });
3000
- }, L = ["users", "groups", "roles"], O = ["Users", "Groups", "Roles"];
3000
+ }, L = ["users", "groups", "roles"], M = ["Users", "Groups", "Roles"];
3001
3001
  return (
3002
3002
  // The main structure remains the same...
3003
3003
  /* @__PURE__ */ l("div", { className: "flex flex-col h-full bg-gray-50", children: [
@@ -3026,7 +3026,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
3026
3026
  /* @__PURE__ */ l("div", { className: "flex flex-col flex-grow", children: [
3027
3027
  /* @__PURE__ */ l(re.Group, { selectedIndex: y, onChange: b, children: [
3028
3028
  /* @__PURE__ */ l("div", { className: "p-4 bg-white border-b border-gray-300", children: [
3029
- /* @__PURE__ */ e(re.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children: O.map((C) => /* @__PURE__ */ e(
3029
+ /* @__PURE__ */ e(re.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children: M.map((C) => /* @__PURE__ */ e(
3030
3030
  re,
3031
3031
  {
3032
3032
  className: ({
@@ -3043,7 +3043,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
3043
3043
  {
3044
3044
  onDebouncedChange: a,
3045
3045
  value: N,
3046
- placeholder: `Search in ${O[y]}...`
3046
+ placeholder: `Search in ${M[y]}...`
3047
3047
  }
3048
3048
  ) })
3049
3049
  ] }),
@@ -3054,7 +3054,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
3054
3054
  animate: { y: 0, opacity: 1 },
3055
3055
  exit: { y: -10, opacity: 0 },
3056
3056
  transition: { duration: 0.2 },
3057
- children: /* @__PURE__ */ e(re.Panels, { as: Q, children: L.map((C) => /* @__PURE__ */ e(
3057
+ children: /* @__PURE__ */ e(re.Panels, { as: J, children: L.map((C) => /* @__PURE__ */ e(
3058
3058
  re.Panel,
3059
3059
  {
3060
3060
  className: "space-y-3 focus:outline-none",
@@ -3123,10 +3123,10 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
3123
3123
  /* @__PURE__ */ e(Ca, { className: "h-12 w-12 text-gray-400" }),
3124
3124
  /* @__PURE__ */ l("h3", { className: "mt-2 text-sm font-medium text-gray-900", children: [
3125
3125
  "No ",
3126
- O[y],
3126
+ M[y],
3127
3127
  " Found"
3128
3128
  ] }),
3129
- /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: N ? `No results for "${N}"` : `There are no ${O[y].toLowerCase()} with access.` })
3129
+ /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: N ? `No results for "${N}"` : `There are no ${M[y].toLowerCase()} with access.` })
3130
3130
  ]
3131
3131
  }
3132
3132
  )
@@ -3162,7 +3162,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
3162
3162
  onClose: s,
3163
3163
  members: o
3164
3164
  }) => {
3165
- const [n, u] = B(!0), [i, d] = B(""), y = oa(i, 300), b = o.filter(
3165
+ const [n, u] = B(!0), [i, c] = B(""), y = oa(i, 300), b = o.filter(
3166
3166
  (m) => m.name.toLowerCase().includes(y.toLowerCase())
3167
3167
  ), N = {
3168
3168
  hidden: { opacity: 0 },
@@ -3255,7 +3255,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
3255
3255
  /* @__PURE__ */ e("div", { className: "p-4 border-b border-gray-200 flex-shrink-0", children: /* @__PURE__ */ e(
3256
3256
  he,
3257
3257
  {
3258
- onDebouncedChange: d,
3258
+ onDebouncedChange: c,
3259
3259
  value: i,
3260
3260
  placeholder: "Search members..."
3261
3261
  }
@@ -3280,32 +3280,32 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
3280
3280
  onClose: u = () => {
3281
3281
  },
3282
3282
  showExistingShares: i = !0,
3283
- allowedPermissions: d = [],
3283
+ allowedPermissions: c = [],
3284
3284
  ...y
3285
3285
  }) => {
3286
- const [b, N] = B(de.INVITE), [a, k] = B(t), [m, g] = B(null), [$, L] = B(!1), [O, C] = B([]), [T, E] = B(de.MANAGE), R = () => {
3286
+ const [b, N] = B(de.INVITE), [a, k] = B(t), [m, g] = B(null), [$, L] = B(!1), [M, C] = B([]), [T, E] = B(de.MANAGE), R = () => {
3287
3287
  N(de.INVITE), g(null), u();
3288
- }, V = () => {
3288
+ }, U = () => {
3289
3289
  N(de.MANAGE);
3290
- }, q = async ({ id: p, name: f, type: w }) => {
3290
+ }, V = async ({ id: p, name: f, type: w }) => {
3291
3291
  if (w === "groups") {
3292
3292
  try {
3293
- const c = await Ee(`${Oe.getMembersForGroup(f)}`);
3294
- } catch (c) {
3295
- console.log("Error searching entities:", c);
3293
+ const d = await Ee(`${Oe.getMembersForGroup(f)}`);
3294
+ } catch (d) {
3295
+ console.log("Error searching entities:", d);
3296
3296
  }
3297
3297
  C(resp);
3298
3298
  }
3299
3299
  g({ id: p, type: w, name: f }), E(b), N(de.MEMBERS);
3300
- }, G = (p) => {
3300
+ }, j = (p) => {
3301
3301
  k(p);
3302
3302
  const f = !He.isEqual(
3303
- He.mapValues(t, (w) => w.map((c) => ({ id: c.id, permission: c.permission }))),
3304
- He.mapValues(p, (w) => w.map((c) => ({ id: c.id, permission: c.permission })))
3303
+ He.mapValues(t, (w) => w.map((d) => ({ id: d.id, permission: d.permission }))),
3304
+ He.mapValues(p, (w) => w.map((d) => ({ id: d.id, permission: d.permission })))
3305
3305
  );
3306
3306
  L(f), N(b === de.MEMBERS ? T : de.INVITE);
3307
3307
  };
3308
- return /* @__PURE__ */ e(oe, { appear: !0, show: r, as: Q, children: /* @__PURE__ */ l(me, { as: "div", className: "relative z-50", onClose: R, children: [
3308
+ return /* @__PURE__ */ e(oe, { appear: !0, show: r, as: J, children: /* @__PURE__ */ l(me, { as: "div", className: "relative z-50", onClose: R, children: [
3309
3309
  /* @__PURE__ */ e("div", { className: "filter-modal-overlay", "aria-hidden": "true" }),
3310
3310
  /* @__PURE__ */ e("div", { className: "filter-modal-container", children: /* @__PURE__ */ e("div", { className: "filter-modal-positioner", children: /* @__PURE__ */ e(Se, { className: "filter-modal-panel", style: { background: "white" }, children: (() => {
3311
3311
  switch (b) {
@@ -3322,12 +3322,12 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
3322
3322
  vn,
3323
3323
  {
3324
3324
  entity: o,
3325
- onBack: G,
3325
+ onBack: j,
3326
3326
  onClose: R,
3327
- onOpenMembers: q,
3327
+ onOpenMembers: V,
3328
3328
  existingShares: a,
3329
3329
  calledBy: n,
3330
- allowedPermissions: d
3330
+ allowedPermissions: c
3331
3331
  }
3332
3332
  )
3333
3333
  },
@@ -3346,11 +3346,11 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
3346
3346
  xn,
3347
3347
  {
3348
3348
  entity: m,
3349
- onBack: G,
3349
+ onBack: j,
3350
3350
  onClose: R,
3351
3351
  calledBy: n,
3352
3352
  existingShares: a,
3353
- members: O
3353
+ members: M
3354
3354
  }
3355
3355
  )
3356
3356
  },
@@ -3369,7 +3369,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
3369
3369
  fn,
3370
3370
  {
3371
3371
  entity: o,
3372
- onManage: V,
3372
+ onManage: U,
3373
3373
  onClose: R,
3374
3374
  existingShares: a,
3375
3375
  calledBy: n,
@@ -3400,7 +3400,7 @@ function Ye({
3400
3400
  },
3401
3401
  placeholder: u = "Select options",
3402
3402
  error: i = null,
3403
- displayLimit: d = 3,
3403
+ displayLimit: c = 3,
3404
3404
  selectionLimit: y = -1,
3405
3405
  // NEW: search behavior
3406
3406
  searchMode: b = "client",
@@ -3413,22 +3413,22 @@ function Ye({
3413
3413
  getOptionId: m = ($) => String($.id),
3414
3414
  getOptionLabel: g = ($) => $.name
3415
3415
  }) {
3416
- const $ = ea(), L = ea(), [O, C] = B(""), T = ue(""), E = ce(() => {
3416
+ const $ = ea(), L = ea(), [M, C] = B(""), T = ue(""), E = ce(() => {
3417
3417
  const p = /* @__PURE__ */ new Map();
3418
3418
  for (const f of r) p.set(m(f), f);
3419
3419
  return p;
3420
- }, [r, m]), R = ce(() => Array.isArray(s) ? s.map((p) => p && typeof p == "object" ? E.get(m(p)) || null : E.get(String(p))).filter(Boolean) : [], [s, E, m]), V = ce(() => {
3421
- if (!O) return r;
3422
- const p = O.toLowerCase();
3420
+ }, [r, m]), R = ce(() => Array.isArray(s) ? s.map((p) => p && typeof p == "object" ? E.get(m(p)) || null : E.get(String(p))).filter(Boolean) : [], [s, E, m]), U = ce(() => {
3421
+ if (!M) return r;
3422
+ const p = M.toLowerCase();
3423
3423
  return r.filter((f) => g(f).toLowerCase().includes(p));
3424
- }, [r, O, g]);
3425
- X(() => {
3426
- b === "server" && O.length >= k && O !== T.current && (T.current = O, N && N(O));
3427
- }, [O, b, k, N]);
3428
- const q = b === "client" ? V : r, G = () => {
3424
+ }, [r, M, g]);
3425
+ Q(() => {
3426
+ b === "server" && M.length >= k && M !== T.current && (T.current = M, N && N(M));
3427
+ }, [M, b, k, N]);
3428
+ const V = b === "client" ? U : r, j = () => {
3429
3429
  if (!R.length)
3430
3430
  return /* @__PURE__ */ e("span", { className: "text-gray-500", children: u });
3431
- const p = R.slice(0, d), f = R.length - d;
3431
+ const p = R.slice(0, c), f = R.length - c;
3432
3432
  return /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-2", children: [
3433
3433
  p.map((w) => /* @__PURE__ */ e(
3434
3434
  "span",
@@ -3445,12 +3445,12 @@ function Ye({
3445
3445
  ] })
3446
3446
  ] });
3447
3447
  };
3448
- return /* @__PURE__ */ e(Z, { value: R, onChange: (p) => {
3448
+ return /* @__PURE__ */ e(X, { value: R, onChange: (p) => {
3449
3449
  const f = Array.from(new Set(p.map((w) => m(w))));
3450
3450
  y !== -1 && f.length > y || o(f);
3451
3451
  }, multiple: !0, by: "id", children: ({ open: p }) => /* @__PURE__ */ l("div", { children: [
3452
3452
  /* @__PURE__ */ e(
3453
- Z.Label,
3453
+ X.Label,
3454
3454
  {
3455
3455
  id: $,
3456
3456
  className: "block text-sm font-medium leading-6 text-gray-900",
@@ -3459,7 +3459,7 @@ function Ye({
3459
3459
  ),
3460
3460
  /* @__PURE__ */ l("div", { className: "relative mt-2", children: [
3461
3461
  /* @__PURE__ */ l(
3462
- Z.Button,
3462
+ X.Button,
3463
3463
  {
3464
3464
  "aria-labelledby": $,
3465
3465
  "aria-invalid": !!i,
@@ -3470,7 +3470,7 @@ function Ye({
3470
3470
  i ? "ring-red-500" : "ring-gray-300"
3471
3471
  ),
3472
3472
  children: [
3473
- /* @__PURE__ */ e("span", { className: "block truncate", children: G() }),
3473
+ /* @__PURE__ */ e("span", { className: "block truncate", children: j() }),
3474
3474
  /* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ e(ka, { className: "w-5 h-5 text-gray-400", "aria-hidden": "true" }) })
3475
3475
  ]
3476
3476
  }
@@ -3478,25 +3478,25 @@ function Ye({
3478
3478
  /* @__PURE__ */ e(
3479
3479
  oe,
3480
3480
  {
3481
- as: Q,
3481
+ as: J,
3482
3482
  show: p,
3483
3483
  leave: "transition ease-in duration-100",
3484
3484
  leaveFrom: "opacity-100",
3485
3485
  leaveTo: "opacity-0",
3486
- children: /* @__PURE__ */ l(Z.Options, { className: "absolute z-10 w-full py-1 mt-1 overflow-auto text-base bg-white rounded-md shadow-lg max-h-60 ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: [
3486
+ children: /* @__PURE__ */ l(X.Options, { className: "absolute z-10 w-full py-1 mt-1 overflow-auto text-base bg-white rounded-md shadow-lg max-h-60 ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: [
3487
3487
  /* @__PURE__ */ e("div", { className: "p-2 sticky top-0 bg-white z-20 shadow-sm", children: /* @__PURE__ */ e(
3488
3488
  he,
3489
3489
  {
3490
- value: O,
3490
+ value: M,
3491
3491
  onDebouncedChange: C,
3492
3492
  placeholder: b === "server" ? `Search (min ${k})…` : "Search options…"
3493
3493
  }
3494
3494
  ) }),
3495
3495
  b === "server" && a && /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: "Loading…" }),
3496
- q.length === 0 && !a ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: b === "server" ? O.length < k ? `Type at least ${k} characters to search.` : "No results." : "No options found." }) : q.map((f) => {
3497
- const w = m(f), c = g(f), h = R.some((F) => m(F) === w), x = y !== -1 && R.length >= y && !h;
3496
+ V.length === 0 && !a ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: b === "server" ? M.length < k ? `Type at least ${k} characters to search.` : "No results." : "No options found." }) : V.map((f) => {
3497
+ const w = m(f), d = g(f), h = R.some((F) => m(F) === w), x = y !== -1 && R.length >= y && !h;
3498
3498
  return /* @__PURE__ */ e(
3499
- Z.Option,
3499
+ X.Option,
3500
3500
  {
3501
3501
  value: f,
3502
3502
  disabled: x,
@@ -3504,7 +3504,7 @@ function Ye({
3504
3504
  x ? " text-gray-400 bg-white cursor-not-allowed" : F ? " bg-gray-200 text-gray-900" : " text-gray-900",
3505
3505
  " relative cursor-default select-none py-2 pl-3 pr-9"
3506
3506
  ),
3507
- children: ({ selected: F, active: I }) => /* @__PURE__ */ l(ee, { children: [
3507
+ children: ({ selected: F, active: z }) => /* @__PURE__ */ l(ee, { children: [
3508
3508
  /* @__PURE__ */ e(
3509
3509
  "span",
3510
3510
  {
@@ -3512,14 +3512,14 @@ function Ye({
3512
3512
  F ? "font-semibold" : "font-normal",
3513
3513
  "block truncate"
3514
3514
  ),
3515
- children: c
3515
+ children: d
3516
3516
  }
3517
3517
  ),
3518
3518
  F && /* @__PURE__ */ e(
3519
3519
  "span",
3520
3520
  {
3521
3521
  className: Pe(
3522
- I ? " text-gray-900" : " text-gray-600",
3522
+ z ? " text-gray-900" : " text-gray-600",
3523
3523
  " absolute inset-y-0 right-0 flex items-center pr-4"
3524
3524
  ),
3525
3525
  children: /* @__PURE__ */ e(Ge, { className: "w-5 h-5", "aria-hidden": "true" })
@@ -3538,28 +3538,28 @@ function Ye({
3538
3538
  ] }) });
3539
3539
  }
3540
3540
  Ye.propTypes = {
3541
- label: _.string.isRequired,
3542
- options: _.arrayOf(
3543
- _.shape({
3544
- id: _.oneOfType([_.string, _.number]),
3545
- name: _.string
3541
+ label: G.string.isRequired,
3542
+ options: G.arrayOf(
3543
+ G.shape({
3544
+ id: G.oneOfType([G.string, G.number]),
3545
+ name: G.string
3546
3546
  })
3547
3547
  ),
3548
- selected: _.array,
3549
- onChange: _.func,
3550
- onBlur: _.func,
3551
- placeholder: _.string,
3552
- error: _.string,
3553
- displayLimit: _.number,
3554
- selectionLimit: _.number,
3548
+ selected: G.array,
3549
+ onChange: G.func,
3550
+ onBlur: G.func,
3551
+ placeholder: G.string,
3552
+ error: G.string,
3553
+ displayLimit: G.number,
3554
+ selectionLimit: G.number,
3555
3555
  // NEW
3556
- searchMode: _.oneOf(["client", "server"]),
3557
- onSearch: _.func,
3556
+ searchMode: G.oneOf(["client", "server"]),
3557
+ onSearch: G.func,
3558
3558
  // required when searchMode="server"
3559
- serverLoading: _.bool,
3560
- minSearchChars: _.number,
3561
- getOptionId: _.func,
3562
- getOptionLabel: _.func
3559
+ serverLoading: G.bool,
3560
+ minSearchChars: G.number,
3561
+ getOptionId: G.func,
3562
+ getOptionLabel: G.func
3563
3563
  };
3564
3564
  Ye.defaultProps = {
3565
3565
  options: [],
@@ -3587,7 +3587,7 @@ const hs = ({
3587
3587
  footer: n = { show: !0, customFooter: null },
3588
3588
  primaryAction: u = { onSubmit: null, label: "Save", loader: !1, disabled: !1 },
3589
3589
  secondaryAction: i = { onCancel: null, label: "Cancel" },
3590
- dialogPanelClass: d = ""
3590
+ dialogPanelClass: c = ""
3591
3591
  }) => {
3592
3592
  const y = (N) => {
3593
3593
  N.target === N.currentTarget && r(!1);
@@ -3611,7 +3611,7 @@ const hs = ({
3611
3611
  /* @__PURE__ */ e("div", { className: "fixed inset-0 overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "flex min-h-full items-center justify-center p-4", children: /* @__PURE__ */ l(
3612
3612
  Se,
3613
3613
  {
3614
- className: `${d} relative bg-white align-middle w-full lg:w-[36rem] mx-5 lg:mx-0 transform overflow-hidden rounded-2xl text-left shadow-xl lg:min-w-[36rem] md:min-w-96 transition-all`,
3614
+ className: `${c} relative bg-white align-middle w-full lg:w-[36rem] mx-5 lg:mx-0 transform overflow-hidden rounded-2xl text-left shadow-xl lg:min-w-[36rem] md:min-w-96 transition-all`,
3615
3615
  onClick: b,
3616
3616
  children: [
3617
3617
  /* @__PURE__ */ l("div", { className: "flex justify-between items-center border-b border-gray-200 p-6 flex-shrink-0", children: [
@@ -3629,7 +3629,7 @@ const hs = ({
3629
3629
  ),
3630
3630
  n?.show && !n?.customFooter && /* @__PURE__ */ l("div", { className: "border-t flex justify-end border-gray-200 p-6 flex-shrink-0", children: [
3631
3631
  i?.onCancel && /* @__PURE__ */ e(
3632
- H,
3632
+ Z,
3633
3633
  {
3634
3634
  "data-testid": "cancel-button",
3635
3635
  label: i?.label,
@@ -3641,7 +3641,7 @@ const hs = ({
3641
3641
  }
3642
3642
  ),
3643
3643
  u?.onSubmit && /* @__PURE__ */ e(
3644
- H,
3644
+ Z,
3645
3645
  {
3646
3646
  label: u?.label,
3647
3647
  loader: u?.loader,
@@ -3684,16 +3684,16 @@ function Cn({
3684
3684
  onSelect: n,
3685
3685
  onCreateChild: u,
3686
3686
  onRename: i,
3687
- onDelete: d,
3687
+ onDelete: c,
3688
3688
  renderActions: y,
3689
3689
  // optional override
3690
3690
  dragId: b,
3691
3691
  dropId: N,
3692
3692
  indent: a = 24
3693
3693
  }) {
3694
- const { setNodeRef: k, isOver: m } = Ut({ id: N }), { attributes: g, listeners: $, setNodeRef: L, transform: O, isDragging: C } = Vt({ id: b }), T = O ? { transform: `translate3d(${Math.round(O.x)}px, ${Math.round(O.y)}px, 0)` } : void 0, [E, R] = B(!1), [V, q] = B(t.name), G = () => {
3695
- const p = V.trim();
3696
- R(!1), p && p !== t.name ? i?.(t, p) : q(t.name);
3694
+ const { setNodeRef: k, isOver: m } = Ut({ id: N }), { attributes: g, listeners: $, setNodeRef: L, transform: M, isDragging: C } = Vt({ id: b }), T = M ? { transform: `translate3d(${Math.round(M.x)}px, ${Math.round(M.y)}px, 0)` } : void 0, [E, R] = B(!1), [U, V] = B(t.name), j = () => {
3695
+ const p = U.trim();
3696
+ R(!1), p && p !== t.name ? i?.(t, p) : V(t.name);
3697
3697
  }, v = ce(() => /* @__PURE__ */ e(
3698
3698
  an,
3699
3699
  {
@@ -3703,10 +3703,10 @@ function Cn({
3703
3703
  { action: "delete", label: "Delete" }
3704
3704
  ],
3705
3705
  onSelect: (f) => {
3706
- f.action === "create" ? u?.(t) : f.action === "rename" ? R(!0) : f.action === "delete" && d?.(t);
3706
+ f.action === "create" ? u?.(t) : f.action === "rename" ? R(!0) : f.action === "delete" && c?.(t);
3707
3707
  }
3708
3708
  }
3709
- ), [t, u, d]);
3709
+ ), [t, u, c]);
3710
3710
  return /* @__PURE__ */ l(
3711
3711
  "div",
3712
3712
  {
@@ -3723,11 +3723,11 @@ function Cn({
3723
3723
  "input",
3724
3724
  {
3725
3725
  className: "tv-input",
3726
- value: V,
3727
- onChange: (p) => q(p.target.value),
3728
- onBlur: G,
3726
+ value: U,
3727
+ onChange: (p) => V(p.target.value),
3728
+ onBlur: j,
3729
3729
  onKeyDown: (p) => {
3730
- p.key === "Enter" && G(), p.key === "Escape" && (R(!1), q(t.name));
3730
+ p.key === "Enter" && j(), p.key === "Escape" && (R(!1), V(t.name));
3731
3731
  },
3732
3732
  autoFocus: !0
3733
3733
  }
@@ -3736,7 +3736,7 @@ function Cn({
3736
3736
  /* @__PURE__ */ e("div", { className: "tv-actions", children: y ? y(t, {
3737
3737
  onCreateChild: () => u?.(t),
3738
3738
  onRename: () => R(!0),
3739
- onDelete: () => d?.(t)
3739
+ onDelete: () => c?.(t)
3740
3740
  }) : v })
3741
3741
  ]
3742
3742
  }
@@ -3745,35 +3745,35 @@ function Cn({
3745
3745
  const Sn = (t) => String(t.id ?? t._id), Dn = (t) => t.parent !== void 0 ? String(t.parent) : t.parentId != null ? String(t.parentId) : "root", $n = (t) => t.name ?? t.label ?? "", Fn = (t) => Array.isArray(t) && t.some((r) => Array.isArray(r.children));
3746
3746
  function Tn(t, { rootId: r, getId: s, getParent: o, getName: n }) {
3747
3747
  const u = /* @__PURE__ */ new Map();
3748
- t.forEach((d) => {
3749
- const y = s(d);
3748
+ t.forEach((c) => {
3749
+ const y = s(c);
3750
3750
  u.set(y, {
3751
- ...d,
3751
+ ...c,
3752
3752
  id: y,
3753
- name: n(d),
3754
- parentId: o(d) || r,
3753
+ name: n(c),
3754
+ parentId: o(c) || r,
3755
3755
  children: []
3756
3756
  });
3757
3757
  });
3758
3758
  const i = [];
3759
- return u.forEach((d) => {
3760
- const y = d.parentId || r;
3761
- y !== r && u.has(y) ? u.get(y).children.push(d) : i.push(d);
3759
+ return u.forEach((c) => {
3760
+ const y = c.parentId || r;
3761
+ y !== r && u.has(y) ? u.get(y).children.push(c) : i.push(c);
3762
3762
  }), { roots: i, byId: u };
3763
3763
  }
3764
3764
  function An(t, { rootId: r, getId: s, getName: o }) {
3765
3765
  const n = /* @__PURE__ */ new Map();
3766
- function u(d, y) {
3767
- const b = s(d), N = {
3768
- ...d,
3766
+ function u(c, y) {
3767
+ const b = s(c), N = {
3768
+ ...c,
3769
3769
  id: b,
3770
- name: o(d),
3770
+ name: o(c),
3771
3771
  parentId: y || r,
3772
- children: (d.children || []).map((a) => u(a, b))
3772
+ children: (c.children || []).map((a) => u(a, b))
3773
3773
  };
3774
3774
  return n.set(b, N), N;
3775
3775
  }
3776
- return { roots: t.map((d) => u(d, null)), byId: n };
3776
+ return { roots: t.map((c) => u(c, null)), byId: n };
3777
3777
  }
3778
3778
  const Ae = (t) => t.map((r) => ({ ...r, children: Ae(r.children || []) }));
3779
3779
  function En(t, r) {
@@ -3783,8 +3783,8 @@ function En(t, r) {
3783
3783
  if (i.id === r)
3784
3784
  return s = i, null;
3785
3785
  if (i.children?.length) {
3786
- const d = o(i.children);
3787
- if (d !== i.children) return { ...i, children: d };
3786
+ const c = o(i.children);
3787
+ if (c !== i.children) return { ...i, children: c };
3788
3788
  }
3789
3789
  return i;
3790
3790
  }).filter(Boolean);
@@ -3823,7 +3823,7 @@ function ps({
3823
3823
  getParent: n = Dn,
3824
3824
  getName: u = $n,
3825
3825
  onSelect: i,
3826
- onCreateRoot: d,
3826
+ onCreateRoot: c,
3827
3827
  onCreateChild: y,
3828
3828
  onRename: b,
3829
3829
  onDelete: N,
@@ -3836,38 +3836,38 @@ function ps({
3836
3836
  const { roots: $ } = ce(() => Fn(t) ? An(t, { rootId: r, getId: o, getName: u }) : Tn(
3837
3837
  t.map((x) => ({ ...x })),
3838
3838
  { rootId: r, getId: o, getParent: n, getName: u }
3839
- ), [t, r, o, n, u]), [L, O] = B({}), C = K((x) => {
3839
+ ), [t, r, o, n, u]), [L, M] = B({}), C = K((x) => {
3840
3840
  const F = {};
3841
- return (function I(j) {
3842
- j.forEach((S) => {
3843
- F[S.id] = !0, S.children?.length && I(S.children);
3841
+ return (function z(q) {
3842
+ q.forEach((D) => {
3843
+ F[D.id] = !0, D.children?.length && z(D.children);
3844
3844
  });
3845
3845
  })(x), F;
3846
3846
  }, []);
3847
3847
  ae.useEffect(() => {
3848
- O(C($));
3848
+ M(C($));
3849
3849
  }, [$, C]);
3850
3850
  const T = K(
3851
- (x) => O((F) => ({ ...F, [x]: !F[x] })),
3851
+ (x) => M((F) => ({ ...F, [x]: !F[x] })),
3852
3852
  []
3853
3853
  ), [E, R] = B(() => Ae($));
3854
3854
  ae.useEffect(() => R(Ae($)), [$]);
3855
- const V = qt(
3855
+ const U = qt(
3856
3856
  jt(Yt, { activationConstraint: { delay: 250, tolerance: 5 } })
3857
- ), q = ue(null), [G, v] = B(null), p = ue(0), f = () => {
3857
+ ), V = ue(null), [j, v] = B(null), p = ue(0), f = () => {
3858
3858
  }, w = ({ delta: x }) => {
3859
3859
  p.current = x?.x ?? 0;
3860
- }, c = K(
3860
+ }, d = K(
3861
3861
  ({ active: x, over: F }) => {
3862
- const I = p.current;
3862
+ const z = p.current;
3863
3863
  if (p.current = 0, v(null), !x || !F) return;
3864
- const j = String(x.id).replace(/^drag-/, ""), S = String(F.id).replace(/^drop-/, "");
3865
- if (!j || !S || j === S) return;
3866
- let A = S;
3867
- const M = Math.max(0, Math.floor(-I / g));
3868
- if (M > 0) {
3869
- let ie = S;
3870
- for (let xe = 0; xe < M; xe++) {
3864
+ const q = String(x.id).replace(/^drag-/, ""), D = String(F.id).replace(/^drop-/, "");
3865
+ if (!q || !D || q === D) return;
3866
+ let A = D;
3867
+ const S = Math.max(0, Math.floor(-z / g));
3868
+ if (S > 0) {
3869
+ let ie = D;
3870
+ for (let xe = 0; xe < S; xe++) {
3871
3871
  const P = Ka(E, ie, null);
3872
3872
  if (!P) break;
3873
3873
  if (!P.parentId) {
@@ -3881,67 +3881,67 @@ function ps({
3881
3881
  R(Ae($));
3882
3882
  return;
3883
3883
  }
3884
- const D = Ae(E), { newRoots: z, removed: U } = En(D, j);
3885
- if (!U) return;
3886
- const Ne = Rn(z, A, U);
3887
- R(Ne), a?.({ sourceId: j, destParentId: A, newTree: Ne });
3884
+ const I = Ae(E), { newRoots: O, removed: H } = En(I, q);
3885
+ if (!H) return;
3886
+ const Ne = Rn(O, A, H);
3887
+ R(Ne), a?.({ sourceId: q, destParentId: A, newTree: Ne });
3888
3888
  },
3889
3889
  [E, $, r, m, g, a]
3890
3890
  ), h = K(
3891
- (x, F = 0) => x.map((I) => /* @__PURE__ */ l(ae.Fragment, { children: [
3891
+ (x, F = 0) => x.map((z) => /* @__PURE__ */ l(ae.Fragment, { children: [
3892
3892
  /* @__PURE__ */ e(
3893
3893
  Cn,
3894
3894
  {
3895
- node: I,
3895
+ node: z,
3896
3896
  depth: F,
3897
- expanded: !!L[I.id],
3898
- onToggle: () => T(I.id),
3897
+ expanded: !!L[z.id],
3898
+ onToggle: () => T(z.id),
3899
3899
  onSelect: i,
3900
3900
  onCreateChild: y,
3901
3901
  onRename: b,
3902
3902
  onDelete: N,
3903
3903
  renderActions: k,
3904
- dragId: `drag-${I.id}`,
3905
- dropId: `drop-${I.id}`,
3904
+ dragId: `drag-${z.id}`,
3905
+ dropId: `drop-${z.id}`,
3906
3906
  indent: g
3907
3907
  }
3908
3908
  ),
3909
- L[I.id] && I.children?.length > 0 ? h(I.children, F + 1) : null
3910
- ] }, I.id)),
3909
+ L[z.id] && z.children?.length > 0 ? h(z.children, F + 1) : null
3910
+ ] }, z.id)),
3911
3911
  [L, g, y, N, b, i, k, T]
3912
3912
  );
3913
3913
  return ae.useMemo(() => {
3914
- if (!G) return null;
3915
- const x = String(G).replace(/^drag-/, "");
3916
- function F(I) {
3917
- for (const j of I) {
3918
- if (j.id === x) return j;
3919
- const S = j.children?.length ? F(j.children) : null;
3920
- if (S) return S;
3914
+ if (!j) return null;
3915
+ const x = String(j).replace(/^drag-/, "");
3916
+ function F(z) {
3917
+ for (const q of z) {
3918
+ if (q.id === x) return q;
3919
+ const D = q.children?.length ? F(q.children) : null;
3920
+ if (D) return D;
3921
3921
  }
3922
3922
  return null;
3923
3923
  }
3924
3924
  return F(E);
3925
- }, [G, E]), /* @__PURE__ */ l("div", { className: "tv", children: [
3925
+ }, [j, E]), /* @__PURE__ */ l("div", { className: "tv", children: [
3926
3926
  s !== !1 && /* @__PURE__ */ l("div", { className: "tv-header", children: [
3927
3927
  /* @__PURE__ */ e("div", { className: "tv-title", children: s }),
3928
- /* @__PURE__ */ e("button", { className: "tv-btn", onClick: d, children: "+ New folder" })
3928
+ /* @__PURE__ */ e("button", { className: "tv-btn", onClick: c, children: "+ New folder" })
3929
3929
  ] }),
3930
3930
  /* @__PURE__ */ l("div", { className: "tv-root-row", children: [
3931
3931
  /* @__PURE__ */ e(Fa, { size: 16, className: "tv-folder-ic" }),
3932
3932
  /* @__PURE__ */ e("strong", { children: "ROOT" }),
3933
- /* @__PURE__ */ e("button", { className: "tv-icon", title: "Create top-level", onClick: d, children: "+" })
3933
+ /* @__PURE__ */ e("button", { className: "tv-icon", title: "Create top-level", onClick: c, children: "+" })
3934
3934
  ] }),
3935
3935
  /* @__PURE__ */ e(
3936
3936
  Gt,
3937
3937
  {
3938
3938
  collisionDetection: Wt,
3939
- sensors: V,
3939
+ sensors: U,
3940
3940
  onDragStart: f,
3941
3941
  onDragMove: w,
3942
- onDragEnd: c,
3942
+ onDragEnd: d,
3943
3943
  modifiers: [_t],
3944
- children: /* @__PURE__ */ e("div", { ref: q, className: "tv-list", children: h(E, 0) })
3944
+ children: /* @__PURE__ */ e("div", { ref: V, className: "tv-list", children: h(E, 0) })
3945
3945
  }
3946
3946
  )
3947
3947
  ] });
@@ -3957,7 +3957,7 @@ const gs = ({
3957
3957
  listClassName: n = "",
3958
3958
  panelClassName: u = "",
3959
3959
  tabClassName: i,
3960
- ...d
3960
+ ...c
3961
3961
  // Pass remaining props to Tab.Group
3962
3962
  }) => {
3963
3963
  const y = s === "vertical", b = (k) => fe(
@@ -3967,7 +3967,7 @@ const gs = ({
3967
3967
  "py-2 -mb-px text-sm font-medium focus:outline-none border-b-2",
3968
3968
  k ? "border-indigo-600 text-indigo-700" : "border-transparent text-slate-600 hover:text-indigo-700"
3969
3969
  ), a = ({ selected: k }) => i ? typeof i == "function" ? i(k) : i : y ? b(k) : N(k);
3970
- return /* @__PURE__ */ e(re.Group, { vertical: y, ...d, children: y ? /* @__PURE__ */ l("div", { className: fe("flex gap-4", o), children: [
3970
+ return /* @__PURE__ */ e(re.Group, { vertical: y, ...c, children: y ? /* @__PURE__ */ l("div", { className: fe("flex gap-4", o), children: [
3971
3971
  /* @__PURE__ */ e(re.List, { className: fe("w-[150px] flex flex-col gap-1 border-r border-gray-300 pr-2", n), children: t.map((k) => /* @__PURE__ */ e(re, { className: a, children: k.label }, k.key)) }),
3972
3972
  /* @__PURE__ */ e(re.Panels, { unmount: !r, className: fe("flex-1", u), children: t.map((k) => /* @__PURE__ */ e(re.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: k.content }) }, k.key)) })
3973
3973
  ] }) : /* @__PURE__ */ l(ee, { children: [
@@ -3977,19 +3977,19 @@ const gs = ({
3977
3977
  };
3978
3978
  function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
3979
3979
  console.log(t);
3980
- const [n, u] = ae.useState(t), [i, d] = ae.useState(() => {
3980
+ const [n, u] = ae.useState(t), [i, c] = ae.useState(() => {
3981
3981
  const a = r && r[t.key] || {};
3982
3982
  return console.log("Initial Section data for", t.key, a), a;
3983
3983
  }), y = ue(r);
3984
- X(() => {
3984
+ Q(() => {
3985
3985
  if (y.current !== r) {
3986
3986
  y.current = r;
3987
3987
  const a = r && r[t.key] || {};
3988
- console.log("Updated Section data for", t.key, a), d(a);
3988
+ console.log("Updated Section data for", t.key, a), c(a);
3989
3989
  }
3990
3990
  }, [r, t.key]), console.log("Section data", i);
3991
3991
  const b = ue(i);
3992
- X(() => {
3992
+ Q(() => {
3993
3993
  b.current !== i && s && typeof s == "function" && (b.current = i, s(n.key, i));
3994
3994
  }, [n.key, i, s]);
3995
3995
  const N = (a) => {
@@ -4047,7 +4047,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4047
4047
  ),
4048
4048
  a.fieldtype === "text" && /* @__PURE__ */ l("div", { children: [
4049
4049
  /* @__PURE__ */ e(
4050
- Y,
4050
+ W,
4051
4051
  {
4052
4052
  type: "text",
4053
4053
  name: a.key,
@@ -4056,7 +4056,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4056
4056
  value: i[a.key] || "",
4057
4057
  onChange: (m) => {
4058
4058
  const g = { ...i, [a.key]: m.target.value };
4059
- d(g), s && s(n.key, g);
4059
+ c(g), s && s(n.key, g);
4060
4060
  },
4061
4061
  required: a.required,
4062
4062
  disabled: a.disabled ? a.disabled : !1,
@@ -4075,7 +4075,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4075
4075
  value: i[a.key] || "",
4076
4076
  onChange: (m) => {
4077
4077
  const g = { ...i, [a.key]: m.target.value };
4078
- d(g), s && s(n.key, g);
4078
+ c(g), s && s(n.key, g);
4079
4079
  },
4080
4080
  rows: 3,
4081
4081
  required: a.required,
@@ -4087,7 +4087,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4087
4087
  ] }),
4088
4088
  a.fieldtype === "number" && /* @__PURE__ */ l("div", { children: [
4089
4089
  /* @__PURE__ */ e(
4090
- Y,
4090
+ W,
4091
4091
  {
4092
4092
  type: "number",
4093
4093
  name: a.key,
@@ -4096,7 +4096,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4096
4096
  value: i[a.key] || "",
4097
4097
  onChange: (m) => {
4098
4098
  const g = { ...i, [a.key]: m.target.value };
4099
- d(g), s && s(n.key, g);
4099
+ c(g), s && s(n.key, g);
4100
4100
  },
4101
4101
  required: a.required,
4102
4102
  disabled: a.disabled ? a.disabled : !1,
@@ -4113,7 +4113,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4113
4113
  checked: !!(i[a.key] || a.default),
4114
4114
  onChange: (m) => {
4115
4115
  const g = { ...i, [a.key]: m };
4116
- d(g), s && s(n.key, g);
4116
+ c(g), s && s(n.key, g);
4117
4117
  },
4118
4118
  label: a.placeholder || a.label,
4119
4119
  disabled: a.disabled ? a.disabled : !1,
@@ -4131,7 +4131,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4131
4131
  value: i[a.key] || "",
4132
4132
  onChange: (m) => {
4133
4133
  const g = { ...i, [a.key]: m };
4134
- d(g);
4134
+ c(g);
4135
4135
  },
4136
4136
  options: a.options || [],
4137
4137
  placeholder: a.placeholder || `Select ${a.label}`,
@@ -4144,7 +4144,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4144
4144
  ] }),
4145
4145
  a.fieldtype === "email" && /* @__PURE__ */ l("div", { children: [
4146
4146
  /* @__PURE__ */ e(
4147
- Y,
4147
+ W,
4148
4148
  {
4149
4149
  type: "email",
4150
4150
  name: a.key,
@@ -4153,7 +4153,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4153
4153
  value: i[a.key] || "",
4154
4154
  onChange: (m) => {
4155
4155
  const g = { ...i, [a.key]: m.target.value };
4156
- d(g), s && s(n.key, g);
4156
+ c(g), s && s(n.key, g);
4157
4157
  },
4158
4158
  required: a.required,
4159
4159
  disabled: a.disabled ? a.disabled : !1,
@@ -4164,7 +4164,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4164
4164
  ] }),
4165
4165
  a.fieldtype === "url" && /* @__PURE__ */ l("div", { children: [
4166
4166
  /* @__PURE__ */ e(
4167
- Y,
4167
+ W,
4168
4168
  {
4169
4169
  type: "url",
4170
4170
  name: a.key,
@@ -4173,7 +4173,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4173
4173
  value: i[a.key] || "",
4174
4174
  onChange: (m) => {
4175
4175
  const g = { ...i, [a.key]: m.target.value };
4176
- d(g), s && s(n.key, g);
4176
+ c(g), s && s(n.key, g);
4177
4177
  },
4178
4178
  required: a.required,
4179
4179
  disabled: a.disabled ? a.disabled : !1,
@@ -4184,7 +4184,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4184
4184
  ] }),
4185
4185
  a.fieldtype === "password" && /* @__PURE__ */ l("div", { children: [
4186
4186
  /* @__PURE__ */ e(
4187
- Y,
4187
+ W,
4188
4188
  {
4189
4189
  type: "password",
4190
4190
  name: a.key,
@@ -4193,7 +4193,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4193
4193
  value: i[a.key] || "",
4194
4194
  onChange: (m) => {
4195
4195
  const g = { ...i, [a.key]: m.target.value };
4196
- d(g), s && s(n.key, g);
4196
+ c(g), s && s(n.key, g);
4197
4197
  },
4198
4198
  required: a.required,
4199
4199
  disabled: a.disabled ? a.disabled : !1,
@@ -4209,7 +4209,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4209
4209
  selectedItems: i[a.key] || [],
4210
4210
  onSelectionChange: (m) => {
4211
4211
  const g = { ...i, [a.key]: m };
4212
- d(g), s && s(n.key, g);
4212
+ c(g), s && s(n.key, g);
4213
4213
  },
4214
4214
  options: a.options || [],
4215
4215
  placeholder: a.placeholder || `Select ${a.label}`,
@@ -4227,7 +4227,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4227
4227
  onChange: (m) => {
4228
4228
  console.log("Toggle changed:", a.key, m);
4229
4229
  const g = { ...i, [a.key]: m };
4230
- d(g), s && s(n.key, g);
4230
+ c(g), s && s(n.key, g);
4231
4231
  },
4232
4232
  label: a.placeholder || a.label,
4233
4233
  disabled: a.disabled ? a.disabled : !1
@@ -4242,7 +4242,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4242
4242
  value: i[a.key] ? new Date(i[a.key]) : null,
4243
4243
  onChange: (m) => {
4244
4244
  const g = { ...i, [a.key]: m ? m.toISOString().split("T")[0] : "" };
4245
- d(g), s && s(n.key, g);
4245
+ c(g), s && s(n.key, g);
4246
4246
  },
4247
4247
  placeholder: a.placeholder || "Select date",
4248
4248
  disabled: a.disabled ? a.disabled : !1,
@@ -4257,7 +4257,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4257
4257
  value: i[a.key] || { from: null, to: null },
4258
4258
  onChange: (m) => {
4259
4259
  const g = { ...i, [a.key]: m };
4260
- d(g), s && s(n.key, g);
4260
+ c(g), s && s(n.key, g);
4261
4261
  },
4262
4262
  placeholder: a.placeholder || "Select date range",
4263
4263
  disabled: a.disabled ? a.disabled : !1,
@@ -4272,7 +4272,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4272
4272
  selectedValue: typeof i[a.key] < "u" ? i[a.key] : a.default || "",
4273
4273
  onValueChange: (m) => {
4274
4274
  const g = { ...i, [a.key]: m };
4275
- d(g), s && s(n.key, g);
4275
+ c(g), s && s(n.key, g);
4276
4276
  },
4277
4277
  options: a.options || [],
4278
4278
  disabled: a.disabled ? a.disabled : !1,
@@ -4293,7 +4293,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4293
4293
  checked: i[a.key] === m.value,
4294
4294
  onChange: (g) => {
4295
4295
  const $ = { ...i, [a.key]: g.target.value };
4296
- d($), s && s(n.key, $);
4296
+ c($), s && s(n.key, $);
4297
4297
  },
4298
4298
  disabled: a.disabled
4299
4299
  }
@@ -4312,7 +4312,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4312
4312
  value: i[a.key] || "",
4313
4313
  onChange: (m) => {
4314
4314
  const g = { ...i, [a.key]: m };
4315
- d(g), s && s(n.key, g);
4315
+ c(g), s && s(n.key, g);
4316
4316
  },
4317
4317
  placeholder: a.placeholder || `Search ${a.label}`,
4318
4318
  className: `w-full ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
@@ -4322,7 +4322,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4322
4322
  ] }),
4323
4323
  (a.fieldtype === "datetime" || a.fieldtype === "datetime-local") && /* @__PURE__ */ l("div", { children: [
4324
4324
  /* @__PURE__ */ e(
4325
- Y,
4325
+ W,
4326
4326
  {
4327
4327
  type: "datetime-local",
4328
4328
  name: a.key,
@@ -4331,7 +4331,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4331
4331
  value: i[a.key] || "",
4332
4332
  onChange: (m) => {
4333
4333
  const g = { ...i, [a.key]: m.target.value };
4334
- d(g), s && s(n.key, g);
4334
+ c(g), s && s(n.key, g);
4335
4335
  },
4336
4336
  required: a.required,
4337
4337
  className: `w-full ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
@@ -4341,7 +4341,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4341
4341
  ] }),
4342
4342
  a.fieldtype === "time" && /* @__PURE__ */ l("div", { children: [
4343
4343
  /* @__PURE__ */ e(
4344
- Y,
4344
+ W,
4345
4345
  {
4346
4346
  type: "time",
4347
4347
  name: a.key,
@@ -4350,7 +4350,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4350
4350
  value: i[a.key] || "",
4351
4351
  onChange: (m) => {
4352
4352
  const g = { ...i, [a.key]: m.target.value };
4353
- d(g), s && s(n.key, g);
4353
+ c(g), s && s(n.key, g);
4354
4354
  },
4355
4355
  required: a.required,
4356
4356
  className: `w-full ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
@@ -4360,7 +4360,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4360
4360
  ] }),
4361
4361
  a.fieldtype === "color" && /* @__PURE__ */ l("div", { children: [
4362
4362
  /* @__PURE__ */ e(
4363
- Y,
4363
+ W,
4364
4364
  {
4365
4365
  type: "color",
4366
4366
  name: a.key,
@@ -4368,7 +4368,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4368
4368
  value: i[a.key] || "#000000",
4369
4369
  onChange: (m) => {
4370
4370
  const g = { ...i, [a.key]: m.target.value };
4371
- d(g), s && s(n.key, g);
4371
+ c(g), s && s(n.key, g);
4372
4372
  },
4373
4373
  className: `w-full h-10 ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
4374
4374
  }
@@ -4377,7 +4377,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4377
4377
  ] }),
4378
4378
  a.fieldtype === "range" && /* @__PURE__ */ l("div", { children: [
4379
4379
  /* @__PURE__ */ e(
4380
- Y,
4380
+ W,
4381
4381
  {
4382
4382
  type: "range",
4383
4383
  name: a.key,
@@ -4385,7 +4385,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4385
4385
  value: i[a.key] || a.min || 0,
4386
4386
  onChange: (m) => {
4387
4387
  const g = { ...i, [a.key]: m.target.value };
4388
- d(g), s && s(n.key, g);
4388
+ c(g), s && s(n.key, g);
4389
4389
  },
4390
4390
  min: a.min || 0,
4391
4391
  max: a.max || 100,
@@ -4405,13 +4405,13 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4405
4405
  ] }),
4406
4406
  a.fieldtype === "file" && /* @__PURE__ */ l("div", { children: [
4407
4407
  /* @__PURE__ */ e(
4408
- Y,
4408
+ W,
4409
4409
  {
4410
4410
  type: "file",
4411
4411
  name: a.key,
4412
4412
  onChange: (m) => {
4413
4413
  const g = m.target.files[0], $ = { ...i, [a.key]: g ? g.name : "" };
4414
- d($), s && s(n.key, $);
4414
+ c($), s && s(n.key, $);
4415
4415
  },
4416
4416
  accept: a.accept,
4417
4417
  className: `w-full ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
@@ -4428,7 +4428,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4428
4428
  className: a.className || "",
4429
4429
  onCollectionChange: (m) => {
4430
4430
  const g = { ...i, [a.key]: m };
4431
- d(g), s && s(n.key, g);
4431
+ c(g), s && s(n.key, g);
4432
4432
  },
4433
4433
  showSearch: a.showSearch !== !1,
4434
4434
  allowAdd: a.allowAdd !== !1,
@@ -4456,13 +4456,13 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4456
4456
  const zn = ({ children: t }) => /* @__PURE__ */ e("div", { className: "flex -space-x-2", children: t });
4457
4457
  function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4458
4458
  console.log(`[DynamicConfig/DataTableRenderer] Component loaded for section: ${t.key}`);
4459
- const [n, u] = B(t), [i, d] = B(null), [y, b] = B(null);
4459
+ const [n, u] = B(t), [i, c] = B(null), [y, b] = B(null);
4460
4460
  console.log(`[DataTableRenderer] ${n.key} - Received props:`, { item: t, initialData: r });
4461
4461
  const [N, a] = B(() => {
4462
4462
  const v = r && r[n.key] || [], p = v.length > 0 ? v : [{ id: 0 }];
4463
4463
  return console.log(`[DataTableRenderer] ${n.key} - Initial data:`, p), p;
4464
4464
  }), k = ue(r);
4465
- X(() => {
4465
+ Q(() => {
4466
4466
  if (console.log(`[DataTableRenderer] ${n.key} - Checking for initialData changes`), console.log(`[DataTableRenderer] ${n.key} - Previous:`, k.current), console.log(`[DataTableRenderer] ${n.key} - Current:`, r), k.current !== r) {
4467
4467
  k.current = r;
4468
4468
  const v = r && r[n.key] || [], p = v.length > 0 ? v : [{ id: 0 }];
@@ -4470,30 +4470,30 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4470
4470
  }
4471
4471
  }, [r, n.key]);
4472
4472
  const m = ue(N), g = ue(null);
4473
- X(() => {
4473
+ Q(() => {
4474
4474
  m.current !== N && s && typeof s == "function" && (m.current = N, g.current && clearTimeout(g.current), g.current = setTimeout(() => {
4475
4475
  s(n.key, N);
4476
4476
  }, 300));
4477
- }, [n.key, N, s]), X(() => () => {
4477
+ }, [n.key, N, s]), Q(() => () => {
4478
4478
  g.current && clearTimeout(g.current);
4479
4479
  }, []);
4480
4480
  const $ = (v) => {
4481
- const p = (c, h) => {
4482
- console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex: c, value: h, type: typeof h }), a((x) => {
4481
+ const p = (d, h) => {
4482
+ console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex: d, value: h, type: typeof h }), a((x) => {
4483
4483
  const F = [...x];
4484
- return F[c][v.key] = h, F;
4484
+ return F[d][v.key] = h, F;
4485
4485
  });
4486
- }, f = (c) => o[n.key]?.[c]?.[v.key], w = (c) => {
4487
- const h = f(c);
4486
+ }, f = (d) => o[n.key]?.[d]?.[v.key], w = (d) => {
4487
+ const h = f(d);
4488
4488
  return h ? /* @__PURE__ */ e("div", { className: "text-red-500 text-xs mt-1", children: h }) : null;
4489
4489
  };
4490
4490
  switch (v.fieldtype) {
4491
4491
  case "text":
4492
- return (c, h) => /* @__PURE__ */ l("div", { children: [
4492
+ return (d, h) => /* @__PURE__ */ l("div", { children: [
4493
4493
  /* @__PURE__ */ e(
4494
- Y,
4494
+ W,
4495
4495
  {
4496
- value: c[v.key] || "",
4496
+ value: d[v.key] || "",
4497
4497
  onChange: (x) => p(h, x.target.value),
4498
4498
  placeholder: v.placeholder || `Enter ${v.label}`,
4499
4499
  required: v.required,
@@ -4503,11 +4503,11 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4503
4503
  w(h)
4504
4504
  ] });
4505
4505
  case "textarea":
4506
- return (c, h) => /* @__PURE__ */ l("div", { children: [
4506
+ return (d, h) => /* @__PURE__ */ l("div", { children: [
4507
4507
  /* @__PURE__ */ e(
4508
4508
  ja,
4509
4509
  {
4510
- value: c[v.key] || "",
4510
+ value: d[v.key] || "",
4511
4511
  onChange: (x) => p(h, x.target.value),
4512
4512
  placeholder: v.placeholder || `Enter ${v.label}`,
4513
4513
  required: v.required,
@@ -4518,12 +4518,12 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4518
4518
  w(h)
4519
4519
  ] });
4520
4520
  case "number":
4521
- return (c, h) => /* @__PURE__ */ l("div", { children: [
4521
+ return (d, h) => /* @__PURE__ */ l("div", { children: [
4522
4522
  /* @__PURE__ */ e(
4523
- Y,
4523
+ W,
4524
4524
  {
4525
4525
  type: "number",
4526
- value: c[v.key] || "",
4526
+ value: d[v.key] || "",
4527
4527
  onChange: (x) => p(h, x.target.value),
4528
4528
  placeholder: v.placeholder || `Enter ${v.label}`,
4529
4529
  required: v.required,
@@ -4533,12 +4533,12 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4533
4533
  w(h)
4534
4534
  ] });
4535
4535
  case "email":
4536
- return (c, h) => /* @__PURE__ */ l("div", { children: [
4536
+ return (d, h) => /* @__PURE__ */ l("div", { children: [
4537
4537
  /* @__PURE__ */ e(
4538
- Y,
4538
+ W,
4539
4539
  {
4540
4540
  type: "email",
4541
- value: c[v.key] || "",
4541
+ value: d[v.key] || "",
4542
4542
  onChange: (x) => p(h, x.target.value),
4543
4543
  placeholder: v.placeholder || "Enter email address",
4544
4544
  required: v.required,
@@ -4548,12 +4548,12 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4548
4548
  w(h)
4549
4549
  ] });
4550
4550
  case "url":
4551
- return (c, h) => /* @__PURE__ */ l("div", { children: [
4551
+ return (d, h) => /* @__PURE__ */ l("div", { children: [
4552
4552
  /* @__PURE__ */ e(
4553
- Y,
4553
+ W,
4554
4554
  {
4555
4555
  type: "url",
4556
- value: c[v.key] || "",
4556
+ value: d[v.key] || "",
4557
4557
  onChange: (x) => p(h, x.target.value),
4558
4558
  placeholder: v.placeholder || "Enter URL",
4559
4559
  required: v.required,
@@ -4563,12 +4563,12 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4563
4563
  w(h)
4564
4564
  ] });
4565
4565
  case "password":
4566
- return (c, h) => /* @__PURE__ */ l("div", { children: [
4566
+ return (d, h) => /* @__PURE__ */ l("div", { children: [
4567
4567
  /* @__PURE__ */ e(
4568
- Y,
4568
+ W,
4569
4569
  {
4570
4570
  type: "password",
4571
- value: c[v.key] || "",
4571
+ value: d[v.key] || "",
4572
4572
  onChange: (x) => p(h, x.target.value),
4573
4573
  placeholder: v.placeholder || "Enter password",
4574
4574
  required: v.required,
@@ -4579,11 +4579,11 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4579
4579
  ] });
4580
4580
  case "select":
4581
4581
  case "dropdown":
4582
- return (c, h) => /* @__PURE__ */ l("div", { children: [
4582
+ return (d, h) => /* @__PURE__ */ l("div", { children: [
4583
4583
  /* @__PURE__ */ e(
4584
4584
  ra,
4585
4585
  {
4586
- value: c[v.key] || "",
4586
+ value: d[v.key] || "",
4587
4587
  onChange: (x) => p(h, x),
4588
4588
  options: v.options || [],
4589
4589
  placeholder: v.placeholder || `Select ${v.label}`,
@@ -4594,15 +4594,15 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4594
4594
  w(h)
4595
4595
  ] });
4596
4596
  case "selectDynamic":
4597
- return (c, h) => {
4597
+ return (d, h) => {
4598
4598
  const x = () => {
4599
4599
  if (v.optionsFrom && r) {
4600
- const { config: F, valueField: I, labelField: j } = v.optionsFrom, S = r[F] || [];
4601
- if (Array.isArray(S))
4602
- return S.map((A) => ({
4603
- id: A[I] || "",
4604
- value: A[I] || "",
4605
- label: A[j] || ""
4600
+ const { config: F, valueField: z, labelField: q } = v.optionsFrom, D = r[F] || [];
4601
+ if (Array.isArray(D))
4602
+ return D.map((A) => ({
4603
+ id: A[z] || "",
4604
+ value: A[z] || "",
4605
+ label: A[q] || ""
4606
4606
  }));
4607
4607
  }
4608
4608
  return v.options || [];
@@ -4612,7 +4612,7 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4612
4612
  ra,
4613
4613
  {
4614
4614
  index: h,
4615
- value: c[v.key] || "",
4615
+ value: d[v.key] || "",
4616
4616
  onChange: (F) => p(h, F),
4617
4617
  options: x(),
4618
4618
  placeholder: v.placeholder || `Select ${v.label}`,
@@ -4625,8 +4625,8 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4625
4625
  ] });
4626
4626
  };
4627
4627
  case "multiselect":
4628
- return (c, h) => {
4629
- const x = c[v.key] || [];
4628
+ return (d, h) => {
4629
+ const x = d[v.key] || [];
4630
4630
  return /* @__PURE__ */ e(
4631
4631
  Ye,
4632
4632
  {
@@ -4640,10 +4640,10 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4640
4640
  };
4641
4641
  case "checkbox":
4642
4642
  case "boolean":
4643
- return (c, h) => /* @__PURE__ */ e(
4643
+ return (d, h) => /* @__PURE__ */ e(
4644
4644
  Pa,
4645
4645
  {
4646
- checked: !!c[v.key],
4646
+ checked: !!d[v.key],
4647
4647
  onChange: (x) => p(h, x),
4648
4648
  label: v.placeholder || v.label,
4649
4649
  className: "w-full"
@@ -4651,31 +4651,31 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4651
4651
  );
4652
4652
  case "toggle":
4653
4653
  case "switch":
4654
- return (c, h) => /* @__PURE__ */ e(
4654
+ return (d, h) => /* @__PURE__ */ e(
4655
4655
  Ga,
4656
4656
  {
4657
- isOn: !!c[v.key],
4657
+ isOn: !!d[v.key],
4658
4658
  onToggle: (x) => p(h, x),
4659
4659
  label: v.placeholder || v.label,
4660
4660
  className: "w-full"
4661
4661
  }
4662
4662
  );
4663
4663
  case "date":
4664
- return (c, h) => /* @__PURE__ */ e(
4664
+ return (d, h) => /* @__PURE__ */ e(
4665
4665
  Ma,
4666
4666
  {
4667
- selectedDate: c[v.key] ? new Date(c[v.key]) : null,
4667
+ selectedDate: d[v.key] ? new Date(d[v.key]) : null,
4668
4668
  onDateChange: (x) => p(h, x ? x.toISOString().split("T")[0] : ""),
4669
4669
  placeholder: v.placeholder || "Select date",
4670
4670
  className: "w-full"
4671
4671
  }
4672
4672
  );
4673
4673
  case "datetime":
4674
- return (c, h) => /* @__PURE__ */ e(
4675
- Y,
4674
+ return (d, h) => /* @__PURE__ */ e(
4675
+ W,
4676
4676
  {
4677
4677
  type: "datetime-local",
4678
- value: c[v.key] || "",
4678
+ value: d[v.key] || "",
4679
4679
  onChange: (x) => p(h, x.target.value),
4680
4680
  placeholder: v.placeholder || "Select date and time",
4681
4681
  required: v.required,
@@ -4683,11 +4683,11 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4683
4683
  }
4684
4684
  );
4685
4685
  case "time":
4686
- return (c, h) => /* @__PURE__ */ e(
4687
- Y,
4686
+ return (d, h) => /* @__PURE__ */ e(
4687
+ W,
4688
4688
  {
4689
4689
  type: "time",
4690
- value: c[v.key] || "",
4690
+ value: d[v.key] || "",
4691
4691
  onChange: (x) => p(h, x.target.value),
4692
4692
  placeholder: v.placeholder || "Select time",
4693
4693
  required: v.required,
@@ -4695,48 +4695,48 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4695
4695
  }
4696
4696
  );
4697
4697
  case "radio":
4698
- return (c, h) => /* @__PURE__ */ e(
4698
+ return (d, h) => /* @__PURE__ */ e(
4699
4699
  Ua,
4700
4700
  {
4701
- selectedValue: c[v.key] || "",
4701
+ selectedValue: d[v.key] || "",
4702
4702
  onValueChange: (x) => p(h, x),
4703
4703
  options: v.options || [],
4704
4704
  className: "w-full"
4705
4705
  }
4706
4706
  );
4707
4707
  case "search":
4708
- return (c, h) => /* @__PURE__ */ e(
4708
+ return (d, h) => /* @__PURE__ */ e(
4709
4709
  he,
4710
4710
  {
4711
- value: c[v.key] || "",
4711
+ value: d[v.key] || "",
4712
4712
  onChange: (x) => p(h, x),
4713
4713
  placeholder: v.placeholder || `Search ${v.label}`,
4714
4714
  className: "w-full"
4715
4715
  }
4716
4716
  );
4717
4717
  case "audience":
4718
- return (c, h) => {
4719
- const x = c[v.key] || { users: [], groups: [], roles: [] }, F = [
4718
+ return (d, h) => {
4719
+ const x = d[v.key] || { users: [], groups: [], roles: [] }, F = [
4720
4720
  ...x.users || [],
4721
4721
  ...x.groups || [],
4722
4722
  ...x.roles || []
4723
4723
  ];
4724
4724
  return /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
4725
- /* @__PURE__ */ e(zn, { children: F.length > 0 ? F.slice(0, 3).map((I, j) => /* @__PURE__ */ e(
4725
+ /* @__PURE__ */ e(zn, { children: F.length > 0 ? F.slice(0, 3).map((z, q) => /* @__PURE__ */ e(
4726
4726
  za,
4727
4727
  {
4728
4728
  size: "small",
4729
- name: I.name || I.displayName || I.id,
4730
- src: I.avatarUrl
4729
+ name: z.name || z.displayName || z.id,
4730
+ src: z.avatarUrl
4731
4731
  },
4732
- j
4732
+ q
4733
4733
  )) : null }),
4734
4734
  /* @__PURE__ */ e(
4735
4735
  "button",
4736
4736
  {
4737
4737
  className: "text-blue-600 font-semibold hover:text-blue-800",
4738
4738
  onClick: () => {
4739
- b(v.key), d(h);
4739
+ b(v.key), c(h);
4740
4740
  },
4741
4741
  children: F.length > 0 ? "Edit" : "Assign"
4742
4742
  }
@@ -4744,22 +4744,22 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4744
4744
  ] });
4745
4745
  };
4746
4746
  case "color":
4747
- return (c, h) => /* @__PURE__ */ e(
4748
- Y,
4747
+ return (d, h) => /* @__PURE__ */ e(
4748
+ W,
4749
4749
  {
4750
4750
  type: "color",
4751
- value: c[v.key] || "#000000",
4751
+ value: d[v.key] || "#000000",
4752
4752
  onChange: (x) => p(h, x.target.value),
4753
4753
  className: "w-full h-10"
4754
4754
  }
4755
4755
  );
4756
4756
  case "range":
4757
- return (c, h) => /* @__PURE__ */ l("div", { className: "w-full", children: [
4757
+ return (d, h) => /* @__PURE__ */ l("div", { className: "w-full", children: [
4758
4758
  /* @__PURE__ */ e(
4759
- Y,
4759
+ W,
4760
4760
  {
4761
4761
  type: "range",
4762
- value: c[v.key] || v.min || 0,
4762
+ value: d[v.key] || v.min || 0,
4763
4763
  onChange: (x) => p(h, x.target.value),
4764
4764
  min: v.min || 0,
4765
4765
  max: v.max || 100,
@@ -4767,11 +4767,11 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4767
4767
  className: "w-full"
4768
4768
  }
4769
4769
  ),
4770
- /* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children: c[v.key] || v.min || 0 })
4770
+ /* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children: d[v.key] || v.min || 0 })
4771
4771
  ] });
4772
4772
  case "file":
4773
- return (c, h) => /* @__PURE__ */ e(
4774
- Y,
4773
+ return (d, h) => /* @__PURE__ */ e(
4774
+ W,
4775
4775
  {
4776
4776
  type: "file",
4777
4777
  onChange: (x) => {
@@ -4783,21 +4783,21 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4783
4783
  }
4784
4784
  );
4785
4785
  case "hidden":
4786
- return (c, h) => /* @__PURE__ */ e(
4787
- Y,
4786
+ return (d, h) => /* @__PURE__ */ e(
4787
+ W,
4788
4788
  {
4789
4789
  type: "hidden",
4790
- value: c[v.key] || "",
4790
+ value: d[v.key] || "",
4791
4791
  onChange: (x) => p(h, x.target.value)
4792
4792
  }
4793
4793
  );
4794
4794
  // Default fallback for unknown field types
4795
4795
  default:
4796
- return (c, h) => /* @__PURE__ */ l("div", { children: [
4796
+ return (d, h) => /* @__PURE__ */ l("div", { children: [
4797
4797
  /* @__PURE__ */ e(
4798
- Y,
4798
+ W,
4799
4799
  {
4800
- value: c[v.key] || "",
4800
+ value: d[v.key] || "",
4801
4801
  onChange: (x) => p(h, x.target.value),
4802
4802
  placeholder: v.placeholder || `Enter ${v.label}`,
4803
4803
  required: v.required,
@@ -4820,7 +4820,7 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4820
4820
  const f = [...v, p];
4821
4821
  return console.log("[DataTableRenderer] Updated data:", f), f;
4822
4822
  });
4823
- }, [n.fields]), O = K((v) => {
4823
+ }, [n.fields]), M = K((v) => {
4824
4824
  a((p) => {
4825
4825
  if (p.length <= 1)
4826
4826
  return p;
@@ -4831,26 +4831,26 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4831
4831
  T(p), v.dataTransfer.effectAllowed = "move", v.dataTransfer.setData("text/html", "");
4832
4832
  }, []), R = K((v) => {
4833
4833
  v.preventDefault(), v.dataTransfer.dropEffect = "move";
4834
- }, []), V = K((v, p) => {
4834
+ }, []), U = K((v, p) => {
4835
4835
  v.preventDefault(), !(C === null || C === p) && (a((f) => {
4836
- const w = [...f], c = w[C];
4837
- return w.splice(C, 1), w.splice(p, 0, c), w;
4836
+ const w = [...f], d = w[C];
4837
+ return w.splice(C, 1), w.splice(p, 0, d), w;
4838
4838
  }), T(null));
4839
- }, [C]), q = K(() => {
4839
+ }, [C]), V = K(() => {
4840
4840
  T(null);
4841
- }, []), G = K((v) => {
4841
+ }, []), j = K((v) => {
4842
4842
  console.log("[DataTableRenderer] handleAddAudience called with:", v), a((p) => {
4843
4843
  const f = [...p];
4844
4844
  if (i !== null && y && f[i]) {
4845
- const w = v.pendingInvites || [], c = w.filter((F) => F.type === "User"), h = w.filter((F) => F.type === "Group"), x = w.filter((F) => F.type === "Role");
4845
+ const w = v.pendingInvites || [], d = w.filter((F) => F.type === "User"), h = w.filter((F) => F.type === "Group"), x = w.filter((F) => F.type === "Role");
4846
4846
  f[i][y] = {
4847
- users: [...f[i][y]?.users || [], ...c],
4847
+ users: [...f[i][y]?.users || [], ...d],
4848
4848
  groups: [...f[i][y]?.groups || [], ...h],
4849
4849
  roles: [...f[i][y]?.roles || [], ...x]
4850
4850
  }, console.log("[DataTableRenderer] Updated audience data:", f[i][y]);
4851
4851
  }
4852
4852
  return f;
4853
- }), d(null), b(null);
4853
+ }), c(null), b(null);
4854
4854
  }, [i, y]);
4855
4855
  return /* @__PURE__ */ l("div", { children: [
4856
4856
  /* @__PURE__ */ l("div", { style: { marginBottom: "20px" }, children: [
@@ -4887,15 +4887,15 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4887
4887
  draggable: !0,
4888
4888
  onDragStart: (f) => E(f, p),
4889
4889
  onDragOver: R,
4890
- onDrop: (f) => V(f, p),
4891
- onDragEnd: q,
4890
+ onDrop: (f) => U(f, p),
4891
+ onDragEnd: V,
4892
4892
  children: [
4893
4893
  /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ e("div", { className: "cursor-move text-gray-400 hover:text-gray-600", children: /* @__PURE__ */ e(sa, { size: 16 }) }) }),
4894
4894
  n.fields.map((f, w) => /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: $(f)(v, p) }, w)),
4895
4895
  /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ e(
4896
4896
  "button",
4897
4897
  {
4898
- onClick: () => O(p),
4898
+ onClick: () => M(p),
4899
4899
  className: "text-red-500 hover:text-red-700",
4900
4900
  title: "Delete row",
4901
4901
  children: /* @__PURE__ */ e(Jt, { size: 16 })
@@ -4917,9 +4917,9 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4917
4917
  {
4918
4918
  isOpen: !0,
4919
4919
  onClose: () => {
4920
- d(null), b(null);
4920
+ c(null), b(null);
4921
4921
  },
4922
- onFinalSubmit: G,
4922
+ onFinalSubmit: j,
4923
4923
  existingShares: v,
4924
4924
  allowedPermissions: ["view", "remove"]
4925
4925
  }
@@ -4990,118 +4990,118 @@ const fa = () => {
4990
4990
  allowAdd: n = !0,
4991
4991
  allowEdit: u = !0,
4992
4992
  allowDelete: i = !0,
4993
- allowReorder: d = !0,
4993
+ allowReorder: c = !0,
4994
4994
  initialData: y = null
4995
4995
  // Add prop for initial demo data
4996
4996
  }) => {
4997
- const [b, N] = B(null), [a, k] = B(""), [m, g] = B(() => Array.isArray(y) ? y : []), [$, L] = B(null), [O, C] = B(null), [T, E] = B(""), R = async () => {
4997
+ const [b, N] = B(null), [a, k] = B(""), [m, g] = B(() => Array.isArray(y) ? y : []), [$, L] = B(null), [M, C] = B(null), [T, E] = B(""), R = async () => {
4998
4998
  try {
4999
- const S = await Ee(t.collectionList);
5000
- if (S) {
5001
- const A = S.map((M, D) => ({
5002
- ...M,
5003
- order: typeof M.order == "number" ? M.order : D + 1
4999
+ const D = await Ee(t.collectionList);
5000
+ if (D) {
5001
+ const A = D.map((S, I) => ({
5002
+ ...S,
5003
+ order: typeof S.order == "number" ? S.order : I + 1
5004
5004
  }));
5005
- A.sort((M, D) => (M.order ?? 0) - (D.order ?? 0)), g(A), s?.(A);
5005
+ A.sort((S, I) => (S.order ?? 0) - (I.order ?? 0)), g(A), s?.(A);
5006
5006
  }
5007
- } catch (S) {
5008
- console.log("Error loading collections:", S), typeof window < "u" && !window.location.pathname.includes("iframe.html") && le.error("Failed to load collections");
5007
+ } catch (D) {
5008
+ console.log("Error loading collections:", D), typeof window < "u" && !window.location.pathname.includes("iframe.html") && le.error("Failed to load collections");
5009
5009
  }
5010
5010
  };
5011
- X(() => {
5011
+ Q(() => {
5012
5012
  (!y || y.length === 0) && R();
5013
- }, [y]), X(() => {
5013
+ }, [y]), Q(() => {
5014
5014
  Array.isArray(y) && g(y);
5015
5015
  }, [y]);
5016
- const V = (S) => {
5017
- u && (N(S.id), k(S.categoryName || ""));
5018
- }, q = () => {
5016
+ const U = (D) => {
5017
+ u && (N(D.id), k(D.categoryName || ""));
5018
+ }, V = () => {
5019
5019
  if (!n || b !== null) return;
5020
- const S = `temp-${Date.now()}`;
5020
+ const D = `temp-${Date.now()}`;
5021
5021
  g((A) => [
5022
5022
  ...A,
5023
5023
  {
5024
- id: S,
5024
+ id: D,
5025
5025
  categoryName: "",
5026
5026
  links: [],
5027
5027
  order: (A.at(-1)?.order ?? 0) + 1,
5028
5028
  _temp: !0
5029
5029
  }
5030
- ]), N(S), k("");
5031
- }, G = () => {
5032
- b != null && (g((S) => {
5033
- const A = S.find((D) => D.id === b), M = A && A._temp ? S.filter((D) => D.id !== b) : S;
5034
- return s?.(M), M;
5030
+ ]), N(D), k("");
5031
+ }, j = () => {
5032
+ b != null && (g((D) => {
5033
+ const A = D.find((I) => I.id === b), S = A && A._temp ? D.filter((I) => I.id !== b) : D;
5034
+ return s?.(S), S;
5035
5035
  }), N(null), k(""));
5036
5036
  }, v = async () => {
5037
5037
  if (b == null || !a.trim()) return;
5038
- const S = typeof b == "string" && b.startsWith("temp-");
5038
+ const D = typeof b == "string" && b.startsWith("temp-");
5039
5039
  try {
5040
- if (S) {
5040
+ if (D) {
5041
5041
  const A = await Re(t.collectionCreate, {
5042
5042
  categoryName: a.trim(),
5043
5043
  order: (Array.isArray(m) && m.length > 0 ? m.at(-1)?.order ?? 0 : 0) + 1
5044
5044
  });
5045
- A && (g((M) => {
5046
- const D = M.map((z) => z.id === b ? A : z);
5047
- return s?.(D), D;
5045
+ A && (g((S) => {
5046
+ const I = S.map((O) => O.id === b ? A : O);
5047
+ return s?.(I), I;
5048
5048
  }), ke.success("Collection created successfully"));
5049
5049
  } else {
5050
5050
  const A = await mn(
5051
5051
  `${t.collectionUpdate}/${b}?newName=${a.trim()}`
5052
5052
  );
5053
- g((M) => {
5054
- const D = M.map(
5055
- (z) => z.id === b ? A && A.id ? { ...z, ...A } : { ...z, categoryName: a.trim() } : z
5053
+ g((S) => {
5054
+ const I = S.map(
5055
+ (O) => O.id === b ? A && A.id ? { ...O, ...A } : { ...O, categoryName: a.trim() } : O
5056
5056
  );
5057
- return s?.(D), D;
5057
+ return s?.(I), I;
5058
5058
  }), le.success("Collection updated successfully");
5059
5059
  }
5060
5060
  N(null), k("");
5061
5061
  } catch (A) {
5062
5062
  console.log(A), le.error("Failed to save collection");
5063
5063
  }
5064
- }, p = async (S) => {
5064
+ }, p = async (D) => {
5065
5065
  if (i)
5066
5066
  try {
5067
- await un(`${t.collectionUpdate}/${S.id}`) && (le.success("Deleted successfully", { autoClose: 3e3 }), R());
5067
+ await un(`${t.collectionUpdate}/${D.id}`) && (le.success("Deleted successfully", { autoClose: 3e3 }), R());
5068
5068
  } catch (A) {
5069
5069
  console.log(A), le.error("Failed to delete collection");
5070
5070
  }
5071
- }, f = (S, A, M) => {
5072
- if (!d || !A || !M || A === M) return S;
5073
- const D = S.findIndex((ie) => ie.id === A), z = S.findIndex((ie) => ie.id === M);
5074
- if (D === -1 || z === -1) return S;
5075
- const U = [...S], [Ne] = U.splice(D, 1);
5076
- return U.splice(z, 0, Ne), U.map((ie, xe) => ({ ...ie, order: xe + 1 }));
5077
- }, w = async (S) => {
5078
- const A = S.map((M) => ({
5079
- id: M.id,
5080
- order: M.order,
5081
- categoryName: M.categoryName
5071
+ }, f = (D, A, S) => {
5072
+ if (!c || !A || !S || A === S) return D;
5073
+ const I = D.findIndex((ie) => ie.id === A), O = D.findIndex((ie) => ie.id === S);
5074
+ if (I === -1 || O === -1) return D;
5075
+ const H = [...D], [Ne] = H.splice(I, 1);
5076
+ return H.splice(O, 0, Ne), H.map((ie, xe) => ({ ...ie, order: xe + 1 }));
5077
+ }, w = async (D) => {
5078
+ const A = D.map((S) => ({
5079
+ id: S.id,
5080
+ order: S.order,
5081
+ categoryName: S.categoryName
5082
5082
  }));
5083
5083
  try {
5084
5084
  await Re(t.updateCollection, A);
5085
- } catch (M) {
5086
- console.log(M), le.error("Failed to save order", { autoClose: 2500 });
5085
+ } catch (S) {
5086
+ console.log(S), le.error("Failed to save order", { autoClose: 2500 });
5087
5087
  }
5088
- }, c = (S, A) => {
5089
- d && (S.dataTransfer.effectAllowed = "move", S.dataTransfer.setData("text/plain", String(A)), L(A));
5090
- }, h = (S) => {
5091
- $ && S !== O && C(S);
5092
- }, x = (S) => {
5093
- S.preventDefault();
5094
- }, F = async (S, A) => {
5095
- S.preventDefault();
5096
- const M = S.dataTransfer.getData("text/plain");
5097
- M && (g((D) => {
5098
- const z = f(D, M, A);
5099
- return console.log("Reordered", z), w(z), s?.(z), z;
5088
+ }, d = (D, A) => {
5089
+ c && (D.dataTransfer.effectAllowed = "move", D.dataTransfer.setData("text/plain", String(A)), L(A));
5090
+ }, h = (D) => {
5091
+ $ && D !== M && C(D);
5092
+ }, x = (D) => {
5093
+ D.preventDefault();
5094
+ }, F = async (D, A) => {
5095
+ D.preventDefault();
5096
+ const S = D.dataTransfer.getData("text/plain");
5097
+ S && (g((I) => {
5098
+ const O = f(I, S, A);
5099
+ return console.log("Reordered", O), w(O), s?.(O), O;
5100
5100
  }), L(null), C(null));
5101
- }, I = () => {
5101
+ }, z = () => {
5102
5102
  L(null), C(null);
5103
- }, j = Array.isArray(m) ? m.filter(
5104
- (S) => S.categoryName?.toLowerCase().includes(T.toLowerCase())
5103
+ }, q = Array.isArray(m) ? m.filter(
5104
+ (D) => D.categoryName?.toLowerCase().includes(T.toLowerCase())
5105
5105
  ) : [];
5106
5106
  return /* @__PURE__ */ l("div", { className: `manage-collection-list ${r}`, children: [
5107
5107
  /* @__PURE__ */ e("div", { className: "flex justify-end", children: /* @__PURE__ */ l("div", { className: "w-1/2 flex justify-end", children: [
@@ -5121,26 +5121,26 @@ const fa = () => {
5121
5121
  "px-4 py-3 bg-black text-white rounded-2xl ml-4",
5122
5122
  b !== null ? "opacity-60 cursor-not-allowed" : "cursor-pointer"
5123
5123
  ].join(" "),
5124
- onClick: q,
5124
+ onClick: V,
5125
5125
  disabled: b !== null,
5126
5126
  children: "Add a Collection"
5127
5127
  }
5128
5128
  )
5129
5129
  ] }) }),
5130
- /* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children: j.map((S) => {
5131
- const A = b === S.id, M = S?.links?.length ?? 0, D = $ === S.id, z = O === S.id && $ !== S.id;
5130
+ /* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children: q.map((D) => {
5131
+ const A = b === D.id, S = D?.links?.length ?? 0, I = $ === D.id, O = M === D.id && $ !== D.id;
5132
5132
  return /* @__PURE__ */ e(
5133
5133
  "div",
5134
5134
  {
5135
- onDragEnter: () => h(S.id),
5135
+ onDragEnter: () => h(D.id),
5136
5136
  onDragOver: x,
5137
- onDrop: (U) => F(U, S.id),
5138
- onDragEnd: I,
5137
+ onDrop: (H) => F(H, D.id),
5138
+ onDragEnd: z,
5139
5139
  className: [
5140
5140
  "flex items-center justify-between p-3 border rounded-2xl mb-3",
5141
5141
  "border-gray-300",
5142
- z ? "ring-2 ring-gray-800/20" : "",
5143
- D ? "opacity-60" : ""
5142
+ O ? "ring-2 ring-gray-800/20" : "",
5143
+ I ? "opacity-60" : ""
5144
5144
  ].join(" "),
5145
5145
  children: A ? /* @__PURE__ */ l(ee, { children: [
5146
5146
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2 flex-1", children: /* @__PURE__ */ e(
@@ -5149,10 +5149,10 @@ const fa = () => {
5149
5149
  type: "text",
5150
5150
  className: "flex-1 h-10 px-3 max-w-[200px] border border-gray-300 rounded-2xl outline-none focus:ring-2 focus:ring-gray-800/20",
5151
5151
  value: a,
5152
- placeholder: S._temp ? "New collection name" : "Edit collection name",
5153
- onChange: (U) => k(U.target.value),
5154
- onKeyDown: (U) => {
5155
- U.key === "Enter" && v(), U.key === "Escape" && G();
5152
+ placeholder: D._temp ? "New collection name" : "Edit collection name",
5153
+ onChange: (H) => k(H.target.value),
5154
+ onKeyDown: (H) => {
5155
+ H.key === "Enter" && v(), H.key === "Escape" && j();
5156
5156
  },
5157
5157
  autoFocus: !0
5158
5158
  }
@@ -5162,7 +5162,7 @@ const fa = () => {
5162
5162
  "button",
5163
5163
  {
5164
5164
  className: "cursor-pointer border border-gray-300 p-2 rounded-2xl",
5165
- onClick: G,
5165
+ onClick: j,
5166
5166
  "aria-label": "Cancel edit",
5167
5167
  children: /* @__PURE__ */ e(ye, { color: "#767676" })
5168
5168
  }
@@ -5184,43 +5184,43 @@ const fa = () => {
5184
5184
  ] })
5185
5185
  ] }) : /* @__PURE__ */ l(ee, { children: [
5186
5186
  /* @__PURE__ */ l("div", { className: "flex gap-2 items-center", children: [
5187
- d && /* @__PURE__ */ e(
5187
+ c && /* @__PURE__ */ e(
5188
5188
  "span",
5189
5189
  {
5190
5190
  role: "button",
5191
5191
  "aria-label": "Drag to reorder",
5192
5192
  className: "cursor-grab active:cursor-grabbing p-1 -m-1 rounded-md hover:bg-gray-50",
5193
5193
  draggable: !0,
5194
- onDragStart: (U) => c(U, S.id),
5194
+ onDragStart: (H) => d(H, D.id),
5195
5195
  children: /* @__PURE__ */ e(sa, {})
5196
5196
  }
5197
5197
  ),
5198
- /* @__PURE__ */ e("span", { children: S.categoryName })
5198
+ /* @__PURE__ */ e("span", { children: D.categoryName })
5199
5199
  ] }),
5200
5200
  /* @__PURE__ */ l("div", { className: "flex gap-2 items-center", children: [
5201
- S.protected ? /* @__PURE__ */ e("span", { className: "text-sm text-gray-600 cursor-default", children: S.qlAppName }) : /* @__PURE__ */ e("span", { className: "text-sm text-blue-600 cursor-default", children: `${M} ${M === 1 ? "link" : "links"}` }),
5201
+ D.protected ? /* @__PURE__ */ e("span", { className: "text-sm text-gray-600 cursor-default", children: D.qlAppName }) : /* @__PURE__ */ e("span", { className: "text-sm text-blue-600 cursor-default", children: `${S} ${S === 1 ? "link" : "links"}` }),
5202
5202
  u && /* @__PURE__ */ e(
5203
5203
  "button",
5204
5204
  {
5205
5205
  className: "cursor-pointer",
5206
- onClick: () => V(S),
5207
- "aria-label": `Edit ${S.categoryName}`,
5206
+ onClick: () => U(D),
5207
+ "aria-label": `Edit ${D.categoryName}`,
5208
5208
  children: /* @__PURE__ */ e(Qt, { color: "#767676" })
5209
5209
  }
5210
5210
  ),
5211
5211
  i && /* @__PURE__ */ e(
5212
5212
  "span",
5213
5213
  {
5214
- className: M === 0 && !S.protected ? "cursor-pointer" : "cursor-not-allowed",
5215
- title: M === 0 && !S.protected ? "Delete" : "Cannot delete this collection",
5216
- onClick: M === 0 ? () => p(S) : null,
5217
- children: /* @__PURE__ */ e(Ve, { color: M === 0 ? "#767676" : "#C2C2C2" })
5214
+ className: S === 0 && !D.protected ? "cursor-pointer" : "cursor-not-allowed",
5215
+ title: S === 0 && !D.protected ? "Delete" : "Cannot delete this collection",
5216
+ onClick: S === 0 ? () => p(D) : null,
5217
+ children: /* @__PURE__ */ e(Ve, { color: S === 0 ? "#767676" : "#C2C2C2" })
5218
5218
  }
5219
5219
  )
5220
5220
  ] })
5221
5221
  ] })
5222
5222
  },
5223
- S.id
5223
+ D.id
5224
5224
  );
5225
5225
  }) })
5226
5226
  ] });
@@ -5230,7 +5230,7 @@ const fa = () => {
5230
5230
  description: n = "",
5231
5231
  endpoints: u = {},
5232
5232
  initialData: i = null,
5233
- showSearch: d = !0,
5233
+ showSearch: c = !0,
5234
5234
  allowAdd: y = !0,
5235
5235
  allowEdit: b = !0,
5236
5236
  allowDelete: N = !0,
@@ -5251,7 +5251,7 @@ const fa = () => {
5251
5251
  onCollectionChange: (L) => {
5252
5252
  s && s(t.key, L);
5253
5253
  },
5254
- showSearch: d,
5254
+ showSearch: c,
5255
5255
  allowAdd: y,
5256
5256
  allowEdit: b,
5257
5257
  allowDelete: N,
@@ -5282,34 +5282,34 @@ function Un({
5282
5282
  onCancel: o,
5283
5283
  onSave: n
5284
5284
  }) {
5285
- const [u, i] = ae.useState(r), [d, y] = ae.useState(null), [b, N] = B(!1), [a, k] = B(!1), [m, g] = B({}), $ = `${ve()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, L = $, [O, C] = B(1), T = (f) => {
5285
+ const [u, i] = ae.useState(r), [c, y] = ae.useState(null), [b, N] = B(!1), [a, k] = B(!1), [m, g] = B({}), $ = `${ve()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, L = $, [M, C] = B(1), T = (f) => {
5286
5286
  if (!r || !r.configuration)
5287
5287
  return f;
5288
- const w = {}, c = f?.configuration || {};
5288
+ const w = {}, d = f?.configuration || {};
5289
5289
  return r.configuration.forEach((h) => {
5290
5290
  if (h.key && h.type === "datatable") {
5291
- const F = (c[h.key] || []).map((I, j) => {
5292
- const S = { id: I.id || 0 };
5291
+ const F = (d[h.key] || []).map((z, q) => {
5292
+ const D = { id: z.id || 0 };
5293
5293
  return h.fields && h.fields.forEach((A) => {
5294
5294
  if (A.fieldtype === "audience") {
5295
- let M = { users: [], groups: [], roles: [] };
5296
- I[A.key] && (Array.isArray(I[A.key]) ? M = { users: [], groups: [], roles: [] } : typeof I[A.key] == "object" && (M = {
5297
- users: I[A.key].users || [],
5298
- groups: I[A.key].groups || [],
5299
- roles: I[A.key].roles || []
5300
- })), S[A.key] = M;
5295
+ let S = { users: [], groups: [], roles: [] };
5296
+ z[A.key] && (Array.isArray(z[A.key]) ? S = { users: [], groups: [], roles: [] } : typeof z[A.key] == "object" && (S = {
5297
+ users: z[A.key].users || [],
5298
+ groups: z[A.key].groups || [],
5299
+ roles: z[A.key].roles || []
5300
+ })), D[A.key] = S;
5301
5301
  } else
5302
- S[A.key] = I[A.key] || A.default || "";
5303
- }), S;
5302
+ D[A.key] = z[A.key] || A.default || "";
5303
+ }), D;
5304
5304
  });
5305
5305
  if (F.length === 0) {
5306
- const I = { id: 0 };
5307
- h.fields && h.fields.forEach((j) => {
5308
- j.fieldtype === "audience" ? I[j.key] = { users: [], groups: [], roles: [] } : I[j.key] = j.default || "";
5309
- }), F.push(I);
5306
+ const z = { id: 0 };
5307
+ h.fields && h.fields.forEach((q) => {
5308
+ q.fieldtype === "audience" ? z[q.key] = { users: [], groups: [], roles: [] } : z[q.key] = q.default || "";
5309
+ }), F.push(z);
5310
5310
  }
5311
5311
  w[h.key] = F;
5312
- } else h.key && (w[h.key] = c[h.key] || {});
5312
+ } else h.key && (w[h.key] = d[h.key] || {});
5313
5313
  }), w;
5314
5314
  }, E = () => {
5315
5315
  if (r && r.configuration) {
@@ -5317,21 +5317,21 @@ function Un({
5317
5317
  r.configuration.forEach((w) => {
5318
5318
  if (w.key)
5319
5319
  if (w.type === "datatable") {
5320
- const c = { id: 0 };
5320
+ const d = { id: 0 };
5321
5321
  w.fields && w.fields.forEach((h) => {
5322
- h.fieldtype === "audience" ? c[h.key] = { users: [], groups: [], roles: [] } : c[h.key] = h.default || "";
5323
- }), f[w.key] = [c];
5322
+ h.fieldtype === "audience" ? d[h.key] = { users: [], groups: [], roles: [] } : d[h.key] = h.default || "";
5323
+ }), f[w.key] = [d];
5324
5324
  } else if (w.type === "section") {
5325
- const c = {};
5325
+ const d = {};
5326
5326
  w.fields && Array.isArray(w.fields) && w.fields.forEach((h) => {
5327
- h.key && (c[h.key] = h.default || "");
5328
- }), f[w.key] = c;
5327
+ h.key && (d[h.key] = h.default || "");
5328
+ }), f[w.key] = d;
5329
5329
  } else
5330
5330
  f[w.key] = {};
5331
5331
  }), y(f);
5332
5332
  }
5333
5333
  };
5334
- X(() => {
5334
+ Q(() => {
5335
5335
  if (s) {
5336
5336
  N(!1);
5337
5337
  return;
@@ -5341,63 +5341,63 @@ function Un({
5341
5341
  N(!0);
5342
5342
  let w = await Ee($);
5343
5343
  if (w) {
5344
- const c = T(w);
5345
- y(c);
5344
+ const d = T(w);
5345
+ y(d);
5346
5346
  } else
5347
5347
  E();
5348
5348
  } catch (w) {
5349
5349
  console.error("Error fetching configuration:", w);
5350
- let c = "Failed to load configuration";
5350
+ let d = "Failed to load configuration";
5351
5351
  if (w.response) {
5352
5352
  const h = w.response.status, x = w.response.data?.message || w.response.data?.error;
5353
- h === 400 ? c = x || "Invalid request. Please check the application ID." : h === 401 ? c = "You are not authorized to access this configuration." : h === 403 ? c = "Access denied. You don't have permission to view this configuration." : h === 404 ? c = "Configuration not found. It may not exist yet or the application ID is incorrect." : h >= 500 ? c = x || "Server error. Please try again later." : c = x || `Failed to load configuration (Error ${h})`;
5354
- } else w.request ? c = "Network error. Please check your connection and try again." : c = w.message || "An unexpected error occurred while loading configuration.";
5355
- ke.error(c), E();
5353
+ h === 400 ? d = x || "Invalid request. Please check the application ID." : h === 401 ? d = "You are not authorized to access this configuration." : h === 403 ? d = "Access denied. You don't have permission to view this configuration." : h === 404 ? d = "Configuration not found. It may not exist yet or the application ID is incorrect." : h >= 500 ? d = x || "Server error. Please try again later." : d = x || `Failed to load configuration (Error ${h})`;
5354
+ } else w.request ? d = "Network error. Please check your connection and try again." : d = w.message || "An unexpected error occurred while loading configuration.";
5355
+ ke.error(d), E();
5356
5356
  } finally {
5357
5357
  N(!1);
5358
5358
  }
5359
5359
  };
5360
5360
  r && (i(r), t ? f() : E());
5361
- }, [r, O, t, s]);
5361
+ }, [r, M, t, s]);
5362
5362
  const R = (f, w) => {
5363
- y((c) => ({
5364
- ...c,
5363
+ y((d) => ({
5364
+ ...d,
5365
5365
  [f]: w
5366
- })), g((c) => {
5367
- const h = { ...c };
5366
+ })), g((d) => {
5367
+ const h = { ...d };
5368
5368
  return h[f] && delete h[f], h;
5369
5369
  });
5370
- }, V = () => {
5370
+ }, U = () => {
5371
5371
  const f = {};
5372
- return !u || !d || u.configuration.forEach((w) => {
5372
+ return !u || !c || u.configuration.forEach((w) => {
5373
5373
  if (w.type === "section")
5374
- w.fields.forEach((c) => {
5375
- if (c.required) {
5376
- const h = d[w.key]?.[c.key];
5377
- (!h || typeof h == "string" && h.trim() === "") && (f[w.key] || (f[w.key] = {}), f[w.key][c.key] = `${c.label} is required`);
5374
+ w.fields.forEach((d) => {
5375
+ if (d.required) {
5376
+ const h = c[w.key]?.[d.key];
5377
+ (!h || typeof h == "string" && h.trim() === "") && (f[w.key] || (f[w.key] = {}), f[w.key][d.key] = `${d.label} is required`);
5378
5378
  }
5379
5379
  });
5380
5380
  else if (w.type === "datatable") {
5381
- const c = d[w.key];
5382
- Array.isArray(c) && c.forEach((h, x) => {
5381
+ const d = c[w.key];
5382
+ Array.isArray(d) && d.forEach((h, x) => {
5383
5383
  w.fields.forEach((F) => {
5384
5384
  if (F.required) {
5385
- const I = h[F.key];
5386
- (!I || typeof I == "string" && I.trim() === "") && (f[w.key] || (f[w.key] = {}), f[w.key][x] || (f[w.key][x] = {}), f[w.key][x][F.key] = `${F.label} is required`);
5385
+ const z = h[F.key];
5386
+ (!z || typeof z == "string" && z.trim() === "") && (f[w.key] || (f[w.key] = {}), f[w.key][x] || (f[w.key][x] = {}), f[w.key][x][F.key] = `${F.label} is required`);
5387
5387
  }
5388
5388
  });
5389
5389
  });
5390
5390
  }
5391
5391
  }), f;
5392
- }, q = (f) => Object.keys(f).length > 0, G = () => {
5393
- const f = V();
5394
- if (g(f), q(f)) {
5395
- let c = [];
5392
+ }, V = (f) => Object.keys(f).length > 0, j = () => {
5393
+ const f = U();
5394
+ if (g(f), V(f)) {
5395
+ let d = [];
5396
5396
  Object.keys(f).forEach((h) => {
5397
5397
  typeof f[h] == "object" && Object.keys(f[h]).forEach((x) => {
5398
5398
  typeof f[h][x] == "object" ? Object.keys(f[h][x]).forEach((F) => {
5399
- c.push(`${h} row ${parseInt(x) + 1}: ${f[h][x][F]}`);
5400
- }) : c.push(`${h}: ${f[h][x]}`);
5399
+ d.push(`${h} row ${parseInt(x) + 1}: ${f[h][x][F]}`);
5400
+ }) : d.push(`${h}: ${f[h][x]}`);
5401
5401
  });
5402
5402
  });
5403
5403
  return;
@@ -5405,35 +5405,35 @@ function Un({
5405
5405
  (async () => {
5406
5406
  try {
5407
5407
  k(!0);
5408
- const c = {};
5409
- d && Object.keys(d).forEach((x) => {
5408
+ const d = {};
5409
+ c && Object.keys(c).forEach((x) => {
5410
5410
  const F = r?.configuration?.find(
5411
- (I) => I.key === x && I.type === "datatable"
5411
+ (z) => z.key === x && z.type === "datatable"
5412
5412
  );
5413
- F && Array.isArray(d[x]) ? c[x] = d[x].map((I) => {
5414
- const j = { id: I.id || 0 };
5415
- return F.fields && F.fields.forEach((S) => {
5416
- if (S.fieldtype === "audience") {
5413
+ F && Array.isArray(c[x]) ? d[x] = c[x].map((z) => {
5414
+ const q = { id: z.id || 0 };
5415
+ return F.fields && F.fields.forEach((D) => {
5416
+ if (D.fieldtype === "audience") {
5417
5417
  let A = { users: [], groups: [], roles: [] };
5418
- I[S.key] && typeof I[S.key] == "object" && !Array.isArray(I[S.key]) && (A = {
5419
- users: I[S.key].users || [],
5420
- groups: I[S.key].groups || [],
5421
- roles: I[S.key].roles || []
5422
- }), j[S.key] = A;
5418
+ z[D.key] && typeof z[D.key] == "object" && !Array.isArray(z[D.key]) && (A = {
5419
+ users: z[D.key].users || [],
5420
+ groups: z[D.key].groups || [],
5421
+ roles: z[D.key].roles || []
5422
+ }), q[D.key] = A;
5423
5423
  } else
5424
- j[S.key] = I[S.key] || "";
5425
- }), j;
5426
- }) : c[x] = d[x];
5424
+ q[D.key] = z[D.key] || "";
5425
+ }), q;
5426
+ }) : d[x] = c[x];
5427
5427
  });
5428
- let h = await Re(L, c);
5428
+ let h = await Re(L, d);
5429
5429
  if (console.log(), h && h.status != "fail") {
5430
5430
  g({});
5431
5431
  const x = h.message || "Configuration has been saved successfully";
5432
- ke.success(x), n && typeof n == "function" && n(d);
5432
+ ke.success(x), n && typeof n == "function" && n(c);
5433
5433
  } else
5434
5434
  throw ke.error(h?.message || "Failed to save configuration"), new Error("No response received from server");
5435
- } catch (c) {
5436
- console.error("Error saving configuration:", c), ke.error(c?.message || "Failed to save configuration");
5435
+ } catch (d) {
5436
+ console.error("Error saving configuration:", d), ke.error(d?.message || "Failed to save configuration");
5437
5437
  } finally {
5438
5438
  k(!1);
5439
5439
  }
@@ -5450,8 +5450,8 @@ function Un({
5450
5450
  if (!u?.configuration && !r?.configuration)
5451
5451
  return /* @__PURE__ */ e("div", { className: "min-h-screen flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "text-gray-500", children: "No configuration available" }) });
5452
5452
  const p = r?.configuration || u?.configuration;
5453
- return X(() => {
5454
- s && r ? (!d || Object.keys(d).length === 0) && E() : s && !r && E();
5453
+ return Q(() => {
5454
+ s && r ? (!c || Object.keys(c).length === 0) && E() : s && !r && E();
5455
5455
  }, [s, r]), /* @__PURE__ */ l("div", { children: [
5456
5456
  /* @__PURE__ */ l(
5457
5457
  "div",
@@ -5461,13 +5461,13 @@ function Un({
5461
5461
  children: [
5462
5462
  b && /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-64", children: /* @__PURE__ */ e(qa, { size: "large" }) }),
5463
5463
  !b && p?.map((f, w) => {
5464
- const c = Mn(f.type);
5465
- if (c && c !== "UnknownType")
5464
+ const d = Mn(f.type);
5465
+ if (d && d !== "UnknownType")
5466
5466
  return /* @__PURE__ */ e(
5467
- c,
5467
+ d,
5468
5468
  {
5469
5469
  item: f,
5470
- data: d,
5470
+ data: c,
5471
5471
  updateHandler: R,
5472
5472
  validationErrors: m
5473
5473
  },
@@ -5479,7 +5479,7 @@ function Un({
5479
5479
  ),
5480
5480
  /* @__PURE__ */ l("div", { className: "w-full gap-5 bg-white flex justify-end py-3 px-7 rounded-t-md rounded-b-2xl border border-gray-300", style: { boxShadow: "0 -2px 10px 0 rgba(0, 0, 0, 0.20)", marginTop: "20px" }, children: [
5481
5481
  /* @__PURE__ */ e(
5482
- H,
5482
+ Z,
5483
5483
  {
5484
5484
  category: "secondary",
5485
5485
  onClick: v,
@@ -5488,10 +5488,10 @@ function Un({
5488
5488
  }
5489
5489
  ),
5490
5490
  /* @__PURE__ */ e(
5491
- H,
5491
+ Z,
5492
5492
  {
5493
5493
  category: "primary",
5494
- onClick: G,
5494
+ onClick: j,
5495
5495
  disabled: a,
5496
5496
  label: a ? "Saving..." : "Apply",
5497
5497
  type: "submit"
@@ -5505,7 +5505,7 @@ const ys = ({
5505
5505
  appid: r = "Configuration-Page",
5506
5506
  disableApi: s = !1
5507
5507
  }) => {
5508
- const [o, n] = B(0), [u, i] = B(!1), [d, y] = B(r), {
5508
+ const [o, n] = B(0), [u, i] = B(!1), [c, y] = B(r), {
5509
5509
  pageHeader: b = {},
5510
5510
  appletHeader: N = {},
5511
5511
  breadcrumb: a = [],
@@ -5513,11 +5513,11 @@ const ys = ({
5513
5513
  configuration: m = []
5514
5514
  } = t, g = m.map((p) => {
5515
5515
  if (p.type === "section" && p.fields) {
5516
- const f = [...p.fields], w = f.findIndex((c) => c.key === "appkey");
5516
+ const f = [...p.fields], w = f.findIndex((d) => d.key === "appkey");
5517
5517
  if (w !== -1) {
5518
- const c = f[w];
5518
+ const d = f[w];
5519
5519
  if (f[w] = {
5520
- ...c,
5520
+ ...d,
5521
5521
  default: r,
5522
5522
  value: r,
5523
5523
  disabled: !0,
@@ -5557,7 +5557,7 @@ const ys = ({
5557
5557
  }, L = a.map((p) => ({
5558
5558
  label: p.text,
5559
5559
  href: p.href || "#"
5560
- })), O = K(() => {
5560
+ })), M = K(() => {
5561
5561
  console.log("handleCancelRequest called - showing modal"), i(!0);
5562
5562
  }, []), C = K((p) => {
5563
5563
  i(!1), p.primary ? (console.log("User confirmed cancel - navigating back"), window.history.back()) : console.log("User cancelled the cancel action - modal closed, data preserved");
@@ -5582,9 +5582,9 @@ const ys = ({
5582
5582
  subHeading: "Application configuration and details",
5583
5583
  tags: [],
5584
5584
  ...N,
5585
- heading: d
5585
+ heading: c
5586
5586
  // Ensure displayname always overrides config heading
5587
- }, V = {
5587
+ }, U = {
5588
5588
  about: "This application provides comprehensive functionality for your organization.",
5589
5589
  images: {
5590
5590
  desktop: "https://via.placeholder.com/600x400?text=Desktop+View",
@@ -5602,11 +5602,11 @@ const ys = ({
5602
5602
  }
5603
5603
  ],
5604
5604
  ...k
5605
- }, q = [
5606
- { label: "Overview", content: v(V) },
5607
- { label: "Configuration", content: /* @__PURE__ */ e(Un, { appid: r, configdata: { configuration: g }, disableApi: s, onCancel: O, onSave: E }) }
5605
+ }, V = [
5606
+ { label: "Overview", content: v(U) },
5607
+ { label: "Configuration", content: /* @__PURE__ */ e(Un, { appid: r, configdata: { configuration: g }, disableApi: s, onCancel: M, onSave: E }) }
5608
5608
  ];
5609
- function G(p) {
5609
+ function j(p) {
5610
5610
  return p ? p.includes("<svg") ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: p } }) : p : "📱";
5611
5611
  }
5612
5612
  function v(p) {
@@ -5663,7 +5663,7 @@ const ys = ({
5663
5663
  }
5664
5664
  ),
5665
5665
  /* @__PURE__ */ l("div", { className: "bg-[#ffffff] border border-[#eef2f6] rounded-[12px] px-6 py-5 flex gap-4 items-start mb-4 shadow-sm", children: [
5666
- /* @__PURE__ */ e("div", { className: "icon w-[72px] h-[72px] rounded-full flex items-center justify-center bg-[#F5F5F6] text-[#1C274C] font-bold text-[18px]", children: G(R.icon) }),
5666
+ /* @__PURE__ */ e("div", { className: "icon w-[72px] h-[72px] rounded-full flex items-center justify-center bg-[#F5F5F6] text-[#1C274C] font-bold text-[18px]", children: j(R.icon) }),
5667
5667
  /* @__PURE__ */ l("div", { className: "flex flex-col min-w-0", children: [
5668
5668
  /* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children: R.heading }),
5669
5669
  /* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children: R.subHeading }),
@@ -5678,7 +5678,7 @@ const ys = ({
5678
5678
  ] })
5679
5679
  ] }),
5680
5680
  /* @__PURE__ */ l("div", { className: "bg-white border border-gray-300 rounded-2xl w-full mt-5 ", children: [
5681
- /* @__PURE__ */ e("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ e("nav", { className: "flex space-x-8", "aria-label": "Tabs", children: q.map((p, f) => /* @__PURE__ */ e(
5681
+ /* @__PURE__ */ e("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ e("nav", { className: "flex space-x-8", "aria-label": "Tabs", children: V.map((p, f) => /* @__PURE__ */ e(
5682
5682
  "button",
5683
5683
  {
5684
5684
  onClick: () => n(f),
@@ -5687,7 +5687,7 @@ const ys = ({
5687
5687
  },
5688
5688
  f
5689
5689
  )) }) }),
5690
- /* @__PURE__ */ e("div", { className: "p-8 h-full overflow-y-auto", children: q[o].content })
5690
+ /* @__PURE__ */ e("div", { className: "p-8 h-full overflow-y-auto", children: V[o].content })
5691
5691
  ] }),
5692
5692
  /* @__PURE__ */ e(
5693
5693
  Zr,
@@ -5739,7 +5739,7 @@ const bs = ({
5739
5739
  // preferred
5740
5740
  onAdd: u,
5741
5741
  onFilterOpen: i,
5742
- addBtnText: d = "Add",
5742
+ addBtnText: c = "Add",
5743
5743
  // Feature toggles
5744
5744
  showSearch: y = !0,
5745
5745
  showColumnChooser: b = !0,
@@ -5751,7 +5751,7 @@ const bs = ({
5751
5751
  showAdd: $ = !1,
5752
5752
  // Additional props
5753
5753
  searchPlaceholder: L = "Search...",
5754
- handleRefreshClick: O = () => {
5754
+ handleRefreshClick: M = () => {
5755
5755
  },
5756
5756
  handleSearchChange: C = () => {
5757
5757
  },
@@ -5759,7 +5759,7 @@ const bs = ({
5759
5759
  excelFileName: T,
5760
5760
  pdfFileName: E
5761
5761
  }) => {
5762
- const R = () => n?.current || o?.current, [V, q] = ae.useState(""), G = (t || "export").toString().trim() || "export", v = `${T || G}.xlsx`, p = `${E || G}.pdf`, f = (h, x, F) => Math.max(x, Math.min(h, F)), w = K(
5762
+ const R = () => n?.current || o?.current, [U, V] = ae.useState(""), j = (t || "export").toString().trim() || "export", v = `${T || j}.xlsx`, p = `${E || j}.pdf`, f = (h, x, F) => Math.max(x, Math.min(h, F)), w = K(
5763
5763
  (h) => {
5764
5764
  const x = R();
5765
5765
  if (console.log("openColumnChooserNear", x), !!x?.openColumnChooser) {
@@ -5768,10 +5768,10 @@ const bs = ({
5768
5768
  return;
5769
5769
  }
5770
5770
  try {
5771
- const F = h.currentTarget.getBoundingClientRect(), I = F.left + window.scrollX, j = F.bottom + window.scrollY;
5772
- let S = I - 120, A = j - 120;
5773
- const M = window.innerWidth, D = window.innerHeight;
5774
- S = f(S, window.scrollX + 8, window.scrollX + M - 340), A = f(A, window.scrollY, window.scrollY + D - 120), console.log("openColumnChooserNear", S, A), x.openColumnChooser(S, A);
5771
+ const F = h.currentTarget.getBoundingClientRect(), z = F.left + window.scrollX, q = F.bottom + window.scrollY;
5772
+ let D = z - 120, A = q - 120;
5773
+ const S = window.innerWidth, I = window.innerHeight;
5774
+ D = f(D, window.scrollX + 8, window.scrollX + S - 340), A = f(A, window.scrollY, window.scrollY + I - 120), console.log("openColumnChooserNear", D, A), x.openColumnChooser(D, A);
5775
5775
  } catch (F) {
5776
5776
  console.log("coloumn choose error", F);
5777
5777
  }
@@ -5779,7 +5779,7 @@ const bs = ({
5779
5779
  },
5780
5780
  []
5781
5781
  // no external deps; reads ref at call time
5782
- ), c = K(
5782
+ ), d = K(
5783
5783
  (h, x) => {
5784
5784
  const F = R();
5785
5785
  if (F)
@@ -5797,11 +5797,11 @@ const bs = ({
5797
5797
  m && F.pdfExport?.({ fileName: p });
5798
5798
  break;
5799
5799
  case "Refresh":
5800
- g && O();
5800
+ g && M();
5801
5801
  break;
5802
5802
  }
5803
5803
  },
5804
- [b, a, k, m, g, v, p, O, w]
5804
+ [b, a, k, m, g, v, p, M, w]
5805
5805
  );
5806
5806
  return /* @__PURE__ */ l("div", { className: "flex items-center flex-wrap justify-between w-full px-4 py-2 bg-white border border-gray-200 rounded-t-2xl mb-0", children: [
5807
5807
  /* @__PURE__ */ l("div", { className: "flex flex-col", children: [
@@ -5817,19 +5817,19 @@ const bs = ({
5817
5817
  he,
5818
5818
  {
5819
5819
  placeholder: L,
5820
- value: V,
5820
+ value: U,
5821
5821
  onDebouncedChange: (h) => {
5822
- q(h), C(h);
5822
+ V(h), C(h);
5823
5823
  }
5824
5824
  }
5825
5825
  ) }),
5826
5826
  /* @__PURE__ */ l("div", { className: "flex gap-3", children: [
5827
5827
  /* @__PURE__ */ l("div", { className: "flex items-center gap-1.5", children: [
5828
5828
  b && /* @__PURE__ */ e(
5829
- H,
5829
+ Z,
5830
5830
  {
5831
5831
  icon: Xt,
5832
- onClick: (h) => c("ColumnChooser", h),
5832
+ onClick: (h) => d("ColumnChooser", h),
5833
5833
  size: "small",
5834
5834
  ariaLabel: "Column Chooser",
5835
5835
  category: "secondary",
@@ -5837,7 +5837,7 @@ const bs = ({
5837
5837
  }
5838
5838
  ),
5839
5839
  N && /* @__PURE__ */ e(
5840
- H,
5840
+ Z,
5841
5841
  {
5842
5842
  icon: Zt,
5843
5843
  onClick: i,
@@ -5848,10 +5848,10 @@ const bs = ({
5848
5848
  }
5849
5849
  ),
5850
5850
  a && /* @__PURE__ */ e(
5851
- H,
5851
+ Z,
5852
5852
  {
5853
5853
  icon: Ht,
5854
- onClick: () => c("Print"),
5854
+ onClick: () => d("Print"),
5855
5855
  ariaLabel: "Print",
5856
5856
  size: "small",
5857
5857
  category: "secondary",
@@ -5859,10 +5859,10 @@ const bs = ({
5859
5859
  }
5860
5860
  ),
5861
5861
  k && /* @__PURE__ */ e(
5862
- H,
5862
+ Z,
5863
5863
  {
5864
5864
  icon: Kt,
5865
- onClick: () => c("Excel"),
5865
+ onClick: () => d("Excel"),
5866
5866
  ariaLabel: "Excel Download",
5867
5867
  size: "small",
5868
5868
  category: "secondary",
@@ -5870,10 +5870,10 @@ const bs = ({
5870
5870
  }
5871
5871
  ),
5872
5872
  m && /* @__PURE__ */ e(
5873
- H,
5873
+ Z,
5874
5874
  {
5875
5875
  icon: er,
5876
- onClick: () => c("Pdf"),
5876
+ onClick: () => d("Pdf"),
5877
5877
  ariaLabel: "PDF Download",
5878
5878
  size: "small",
5879
5879
  category: "secondary",
@@ -5881,10 +5881,10 @@ const bs = ({
5881
5881
  }
5882
5882
  ),
5883
5883
  g && /* @__PURE__ */ e(
5884
- H,
5884
+ Z,
5885
5885
  {
5886
5886
  icon: ar,
5887
- onClick: () => c("Refresh"),
5887
+ onClick: () => d("Refresh"),
5888
5888
  ariaLabel: "Refresh",
5889
5889
  size: "small",
5890
5890
  category: "secondary",
@@ -5893,14 +5893,14 @@ const bs = ({
5893
5893
  )
5894
5894
  ] }),
5895
5895
  $ && u && /* @__PURE__ */ e(
5896
- H,
5896
+ Z,
5897
5897
  {
5898
- label: d,
5898
+ label: c,
5899
5899
  icon: tr,
5900
5900
  onClick: u,
5901
5901
  size: "small",
5902
5902
  ariaLabel: "Add New",
5903
- title: d
5903
+ title: c
5904
5904
  }
5905
5905
  )
5906
5906
  ] })
@@ -5917,7 +5917,7 @@ function vs(t) {
5917
5917
  // pageSize = 10,
5918
5918
  allowPaging: u = !0,
5919
5919
  allowSorting: i = !0,
5920
- allowFiltering: d = !1,
5920
+ allowFiltering: c = !1,
5921
5921
  allowGrouping: y = !1,
5922
5922
  allowReordering: b = !0,
5923
5923
  allowResizing: N = !0,
@@ -5927,59 +5927,59 @@ function vs(t) {
5927
5927
  enableSearchApi: g = !1,
5928
5928
  height: $ = "600",
5929
5929
  selectionSettings: L = { type: "Multiple", mode: "Row" },
5930
- enableCheckbox: O = !1,
5930
+ enableCheckbox: M = !1,
5931
5931
  columns: C = [],
5932
5932
  onGridStateChange: T,
5933
5933
  onRowSelected: E,
5934
5934
  onRowDeselected: R,
5935
- onRowDoubleClick: V,
5936
- apiRef: q,
5937
- gridProps: G = {}
5935
+ onRowDoubleClick: U,
5936
+ apiRef: V,
5937
+ gridProps: j = {}
5938
5938
  } = t, v = ue(null), {
5939
5939
  pageSettings: p,
5940
5940
  sortSettings: f,
5941
5941
  ...w
5942
- } = G || {}, [c, h] = ae.useState(p?.page || 1), [x, F] = ae.useState(f?.pageSize || 20), [I, j] = ae.useState(f?.sortKey || "updatedDate"), [S, A] = ae.useState(f?.direction || "Descending"), M = ce(() => {
5942
+ } = j || {}, [d, h] = ae.useState(p?.page || 1), [x, F] = ae.useState(f?.pageSize || 20), [z, q] = ae.useState(f?.sortKey || "updatedDate"), [D, A] = ae.useState(f?.direction || "Descending"), S = ce(() => {
5943
5943
  const P = [$r];
5944
- return i && P.push(Fr), d && P.push(Tr), y && P.push(Ar), g && P.push(Er), a && P.push(Rr), k && P.push(Ir), m && P.push(zr), N && P.push(Pr), b && P.push(Br), P.push(Lr), P;
5945
- }, [i, d, y, g, a, k, m, N, b]), D = ce(() => {
5946
- const P = () => v.current, te = (W, pe) => {
5947
- !pe && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${W} requested but related service/feature is disabled.`);
5944
+ return i && P.push(Fr), c && P.push(Tr), y && P.push(Ar), g && P.push(Er), a && P.push(Rr), k && P.push(Ir), m && P.push(zr), N && P.push(Pr), b && P.push(Br), P.push(Lr), P;
5945
+ }, [i, c, y, g, a, k, m, N, b]), I = ce(() => {
5946
+ const P = () => v.current, te = (_, pe) => {
5947
+ !pe && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${_} requested but related service/feature is disabled.`);
5948
5948
  };
5949
5949
  return {
5950
5950
  getInstance: () => P(),
5951
5951
  refresh: () => P()?.refresh?.(),
5952
5952
  getSelectedRecords: () => P()?.getSelectedRecords?.() ?? [],
5953
5953
  clearSelection: () => P()?.clearSelection?.(),
5954
- selectRow: (W) => P()?.selectRow?.(W),
5955
- selectRows: (W) => P()?.selectRows?.(W),
5956
- search: (W) => {
5957
- te("search()", g), P()?.search?.(W);
5954
+ selectRow: (_) => P()?.selectRow?.(_),
5955
+ selectRows: (_) => P()?.selectRows?.(_),
5956
+ search: (_) => {
5957
+ te("search()", g), P()?.search?.(_);
5958
5958
  },
5959
5959
  print: () => P()?.print?.(),
5960
- excelExport: (W) => {
5961
- te("excelExport()", a), P()?.excelExport?.(W);
5960
+ excelExport: (_) => {
5961
+ te("excelExport()", a), P()?.excelExport?.(_);
5962
5962
  },
5963
- pdfExport: (W) => {
5964
- te("pdfExport()", k), P()?.pdfExport?.(W);
5963
+ pdfExport: (_) => {
5964
+ te("pdfExport()", k), P()?.pdfExport?.(_);
5965
5965
  },
5966
- openColumnChooser: (W, pe) => {
5967
- te("openColumnChooser()", m), P()?.columnChooserModule?.openColumnChooser?.(W, pe);
5966
+ openColumnChooser: (_, pe) => {
5967
+ te("openColumnChooser()", m), P()?.columnChooserModule?.openColumnChooser?.(_, pe);
5968
5968
  }
5969
5969
  };
5970
5970
  }, []);
5971
- X(() => {
5972
- q && (q.current = D);
5973
- }, [q, D]), X(() => () => {
5974
- q && (q.current = null);
5971
+ Q(() => {
5972
+ V && (V.current = I);
5973
+ }, [V, I]), Q(() => () => {
5974
+ V && (V.current = null);
5975
5975
  }, []);
5976
- const z = (P) => {
5976
+ const O = (P) => {
5977
5977
  const te = String(P || "");
5978
5978
  return te === "Ascending" || te === "Descending" ? te : te.toLowerCase() === "ascending" ? "Ascending" : "Descending";
5979
- }, U = (P) => {
5980
- const te = v.current, W = P?.requestType, pe = W === "paging" ? "paging" : W === "sorting" ? "sorting" : W === "searching" ? "searching" : W === "filtering" ? "filtering" : W === "grouping" ? "grouping" : W === "reorder" ? "reorder" : W === "columnstate" ? "columnstate" : "other", $e = P?.pageSize ?? te?.pageSettings?.pageSize ?? x, Ie = P?.currentPage ?? te?.pageSettings?.currentPage ?? n, Je = P?.columnName && P?.direction ? [{ field: P.columnName, dir: z(P.direction) }] : (te?.sortSettings?.columns || []).map((Fe) => ({
5979
+ }, H = (P) => {
5980
+ const te = v.current, _ = P?.requestType, pe = _ === "paging" ? "paging" : _ === "sorting" ? "sorting" : _ === "searching" ? "searching" : _ === "filtering" ? "filtering" : _ === "grouping" ? "grouping" : _ === "reorder" ? "reorder" : _ === "columnstate" ? "columnstate" : "other", $e = P?.pageSize ?? te?.pageSettings?.pageSize ?? x, Ie = P?.currentPage ?? te?.pageSettings?.currentPage ?? n, Je = P?.columnName && P?.direction ? [{ field: P.columnName, dir: O(P.direction) }] : (te?.sortSettings?.columns || []).map((Fe) => ({
5981
5981
  field: Fe.field,
5982
- dir: z(Fe.direction ?? Fe.dir)
5982
+ dir: O(Fe.direction ?? Fe.dir)
5983
5983
  })), Qe = P?.searchString ?? "", Xe = P?.columns ?? te?.filterSettings?.columns ?? [];
5984
5984
  return {
5985
5985
  reason: pe,
@@ -5993,12 +5993,12 @@ function vs(t) {
5993
5993
  }, Ne = (P) => {
5994
5994
  setTimeout(() => {
5995
5995
  v?.current?.hideSpinner();
5996
- }, 1e3), P.requestType === "paging" && (h(P.currentPage), F(P.pageSize)), P.requestType === "sorting" && (j(P.columnName || "updatedDate"), A(P.direction === "Ascending" ? "ASC" : "DESC")), T && T(U(P), P);
5996
+ }, 1e3), P.requestType === "paging" && (h(P.currentPage), F(P.pageSize)), P.requestType === "sorting" && (q(P.columnName || "updatedDate"), A(P.direction === "Ascending" ? "ASC" : "DESC")), T && T(H(P), P);
5997
5997
  }, ie = (P) => {
5998
- typeof V == "function" && V(P?.rowData, P);
5998
+ typeof U == "function" && U(P?.rowData, P);
5999
5999
  }, xe = () => {
6000
6000
  const P = [];
6001
- return O && P.push(/* @__PURE__ */ e(ia, { type: "checkbox", width: "50" }, "__checkbox__")), C.forEach((te, W) => {
6001
+ return M && P.push(/* @__PURE__ */ e(ia, { type: "checkbox", width: "50" }, "__checkbox__")), C.forEach((te, _) => {
6002
6002
  const {
6003
6003
  field: pe,
6004
6004
  headerText: $e,
@@ -6038,7 +6038,7 @@ function vs(t) {
6038
6038
  customAttributes: ct,
6039
6039
  ...dt
6040
6040
  },
6041
- pe || `col-${W}`
6041
+ pe || `col-${_}`
6042
6042
  )
6043
6043
  );
6044
6044
  }), P;
@@ -6055,7 +6055,7 @@ function vs(t) {
6055
6055
  height: $,
6056
6056
  allowPaging: u,
6057
6057
  allowSorting: i,
6058
- allowFiltering: d,
6058
+ allowFiltering: c,
6059
6059
  allowGrouping: y,
6060
6060
  allowReordering: b,
6061
6061
  allowResizing: N,
@@ -6063,7 +6063,7 @@ function vs(t) {
6063
6063
  selectionSettings: L,
6064
6064
  pageSettings: { pageSize: 10, pageSizes: p?.pageSizes ?? [20, 40, 60, 80, 100] },
6065
6065
  sortSettings: f ?? {
6066
- columns: [{ field: I, direction: z(S) }],
6066
+ columns: [{ field: z, direction: O(D) }],
6067
6067
  allowUnsort: !1
6068
6068
  },
6069
6069
  actionBegin: Ne,
@@ -6073,7 +6073,7 @@ function vs(t) {
6073
6073
  ...w,
6074
6074
  children: [
6075
6075
  /* @__PURE__ */ e(Mr, { children: xe() }),
6076
- /* @__PURE__ */ e(Ur, { services: M })
6076
+ /* @__PURE__ */ e(Ur, { services: S })
6077
6077
  ]
6078
6078
  }
6079
6079
  );
@@ -6097,7 +6097,7 @@ export {
6097
6097
  ys as FullConfigPage,
6098
6098
  ns as FullScreenLoader,
6099
6099
  as as GenericFilter,
6100
- Y as Input,
6100
+ W as Input,
6101
6101
  et as ManageCollectionList,
6102
6102
  Zr as Modal,
6103
6103
  Ye as MultiSelect,
@@ -6115,7 +6115,7 @@ export {
6115
6115
  Ga as ToggleSwitch,
6116
6116
  ss as Tooltip,
6117
6117
  ps as TreeView,
6118
- H as UnifyedCoreButton,
6118
+ Z as UnifyedCoreButton,
6119
6119
  ls as WizardModal,
6120
6120
  Qa as adGroupsListSearchApi,
6121
6121
  un as axiosDelete,