unifyedx-storybook-new 0.1.85 → 0.1.86

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,11 +1,11 @@
1
1
  import { jsxs as l, jsx as e, Fragment as K } from "react/jsx-runtime";
2
2
  import re, { useState as M, useMemo as ne, useId as Qe, Fragment as J, useEffect as Q, useCallback as ae, useRef as ue } from "react";
3
- import { a as W, U as lt, X as ge, P as _, L as ot, C as Oe, b as Me, f as Pe, d as pa, D as ga, F as it, e as ct, h as dt, T as Be, u as ut, i as mt, I as ht, j as pt, k as gt, l as yt, m as ft, n as bt, S as ya, o as fa, M as vt, p as xt, q as ba, r as Nt, A as kt, s as wt, E as Ct, t as St, v as Dt, w as Ft, x as $t, y as va, z as Tt, B as xa, G as Na, H as At, J as Et, K as Rt, N as Le, O as Xe, Q as Ze, R as It, V as zt, W as ka, Y as Pt, Z as ea, _ as Bt, $ as Lt, a0 as wa, a1 as Ot, a2 as Mt, a3 as Vt, a4 as Ut, a5 as qt, a6 as jt, a7 as Gt, a8 as le, a9 as _t, aa as Yt, ab as Wt, ac as Jt, ad as Qt, ae as Xt, af as Zt, ag as Ht, ah as Kt, ai as er } from "./vendor-CugE0rJ9.js";
4
- import { Popover as ar, PopoverButton as tr, PopoverPanel as rr, Transition as oe, Dialog as me, TransitionChild as pe, DialogPanel as Ne, DialogTitle as Ve, TabGroup as nr, TabList as sr, Tab as ee, TabPanels as lr, RadioGroup as Te, Listbox as X, ListboxButton as or, ListboxOptions as ir, ListboxOption as cr, SwitchGroup as dr, Switch as Ye, Menu as ur, MenuButton as mr, Portal as hr, MenuItems as pr, MenuItem as gr, DialogBackdrop as yr } from "@headlessui/react";
3
+ import { a as W, U as lt, X as ge, P as _, L as ot, C as Oe, b as Me, f as Be, d as pa, D as ga, F as it, e as ct, h as dt, T as Pe, u as ut, i as mt, I as ht, j as pt, k as gt, l as yt, m as ft, n as bt, S as ya, o as fa, M as vt, p as xt, q as ba, r as Nt, A as kt, s as wt, E as Ct, t as St, v as Dt, w as Ft, x as $t, y as va, z as Tt, B as xa, G as Na, H as At, J as Et, K as Rt, N as Le, O as Xe, Q as Ze, R as It, V as zt, W as ka, Y as Bt, Z as ea, _ as Pt, $ as Lt, a0 as wa, a1 as Ot, a2 as Mt, a3 as Vt, a4 as Ut, a5 as qt, a6 as jt, a7 as Gt, a8 as le, a9 as _t, aa as Yt, ab as Wt, ac as Jt, ad as Qt, ae as Xt, af as Zt, ag as Ht, ah as Kt, ai as er } from "./vendor-CugE0rJ9.js";
4
+ import { Popover as ar, PopoverButton as tr, PopoverPanel as rr, Transition as oe, Dialog as me, TransitionChild as pe, DialogPanel as ke, DialogTitle as Ve, TabGroup as nr, TabList as sr, Tab as ee, TabPanels as lr, RadioGroup as Te, Listbox as X, ListboxButton as or, ListboxOptions as ir, ListboxOption as cr, SwitchGroup as dr, Switch as Ye, Menu as ur, MenuButton as mr, Portal as hr, MenuItems as pr, MenuItem as gr, DialogBackdrop as yr } from "@headlessui/react";
5
5
  import { motion as te, AnimatePresence as fe } from "framer-motion";
6
6
  import { d as fr, l as br, _ as We } from "./vendor-lodash-BvgZjhaA.js";
7
7
  import { useFloating as Ca, offset as Sa, flip as Da, shift as Fa, autoUpdate as $a, useClick as vr, useDismiss as xr, useInteractions as Nr, FloatingPortal as kr } from "@floating-ui/react";
8
- import { P as wr, S as Cr, F as Sr, G as Dr, a as Fr, E as $r, b as Tr, C as Ar, R as Er, c as Rr, d as Ir, e as zr, f as Pr, I as Br, g as ra } from "./vendor-syncfusion-DGcZfoFG.js";
8
+ import { P as wr, S as Cr, F as Sr, G as Dr, a as Fr, E as $r, b as Tr, C as Ar, R as Er, c as Rr, d as Ir, e as zr, f as Br, I as Pr, g as ra } from "./vendor-syncfusion-DGcZfoFG.js";
9
9
  const Lr = (t) => {
10
10
  let r = 2166136261;
11
11
  for (let s = 0; s < t.length; s++)
@@ -26,7 +26,7 @@ const Lr = (t) => {
26
26
  className: m,
27
27
  ...i
28
28
  }) => {
29
- const [u, y] = M(!1), f = ne(() => Or(r), []), v = t && !u, a = !v && r, k = !v && !r, d = W(
29
+ const [u, y] = M(!1), f = ne(() => Or(r), []), v = t && !u, a = !v && r, N = !v && !r, d = W(
30
30
  "avatar-container",
31
31
  `avatar--size-${s}`,
32
32
  m
@@ -45,7 +45,7 @@ const Lr = (t) => {
45
45
  }
46
46
  ),
47
47
  a && /* @__PURE__ */ e("span", { className: "avatar-initials", "aria-label": r, children: Mr(r) }),
48
- k && /* @__PURE__ */ e("span", { className: "avatar-icon", children: /* @__PURE__ */ e(lt, {}) })
48
+ N && /* @__PURE__ */ e("span", { className: "avatar-icon", children: /* @__PURE__ */ e(lt, {}) })
49
49
  ] });
50
50
  }, Gn = ({ children: t, max: r = 4, truncatedMessage: s = "Members", ...o }) => {
51
51
  const n = re.Children.toArray(t), m = n.slice(0, r), i = n.length - r;
@@ -150,7 +150,7 @@ const Ur = {
150
150
  label: v,
151
151
  children: a,
152
152
  // ✅ Add children to the props list
153
- onClick: k,
153
+ onClick: N,
154
154
  ...d
155
155
  }) => {
156
156
  const p = y || m, T = u && !v, L = W(
@@ -170,7 +170,7 @@ const Ur = {
170
170
  type: s,
171
171
  className: L,
172
172
  disabled: p,
173
- onClick: k,
173
+ onClick: N,
174
174
  title: r || T && o || (typeof v == "string" ? v : void 0),
175
175
  "aria-label": o || T && r || (typeof v == "string" ? v : void 0),
176
176
  ...d,
@@ -273,10 +273,10 @@ const Ur = {
273
273
  "datepicker-trigger--disabled": i
274
274
  }),
275
275
  disabled: i,
276
- "aria-label": t ? `Selected date is ${Pe(t, "PPP")}` : o,
276
+ "aria-label": t ? `Selected date is ${Be(t, "PPP")}` : o,
277
277
  children: [
278
278
  /* @__PURE__ */ e(pa, { className: "datepicker-icon" }),
279
- t ? /* @__PURE__ */ e("span", { className: "datepicker-value", children: Pe(t, "PPP") }) : /* @__PURE__ */ e("span", { className: "datepicker-placeholder", children: o })
279
+ t ? /* @__PURE__ */ e("span", { className: "datepicker-value", children: Be(t, "PPP") }) : /* @__PURE__ */ e("span", { className: "datepicker-placeholder", children: o })
280
280
  ]
281
281
  }
282
282
  ),
@@ -318,10 +318,10 @@ const Ur = {
318
318
  }) => {
319
319
  const f = t?.from, v = t?.to, a = (d) => {
320
320
  d.stopPropagation(), d.preventDefault(), s?.();
321
- }, k = f && v ? /* @__PURE__ */ l(K, { children: [
322
- Pe(f, "MMM d, y"),
321
+ }, N = f && v ? /* @__PURE__ */ l(K, { children: [
322
+ Be(f, "MMM d, y"),
323
323
  " - ",
324
- Pe(v, "MMM d, y")
324
+ Be(v, "MMM d, y")
325
325
  ] }) : /* @__PURE__ */ e("span", { className: "datepicker-placeholder", children: o });
326
326
  return /* @__PURE__ */ l("div", { className: W("datepicker-wrapper", u), children: [
327
327
  n && /* @__PURE__ */ e("label", { className: "datepicker-label", htmlFor: "daterangepicker-input", children: n }),
@@ -337,10 +337,10 @@ const Ur = {
337
337
  "datepicker-trigger--disabled": i
338
338
  }),
339
339
  disabled: i,
340
- "aria-label": f && v ? `Selected range is ${k}` : o,
340
+ "aria-label": f && v ? `Selected range is ${N}` : o,
341
341
  children: [
342
342
  /* @__PURE__ */ e(pa, { className: "datepicker-icon" }),
343
- /* @__PURE__ */ e("span", { className: "datepicker-value", children: k })
343
+ /* @__PURE__ */ e("span", { className: "datepicker-value", children: N })
344
344
  ]
345
345
  }
346
346
  ),
@@ -572,7 +572,7 @@ const Ur = {
572
572
  labelColor: "#FFEDD5",
573
573
  labelTextColor: "#7C2D12"
574
574
  }
575
- }, ve = {
575
+ }, xe = {
576
576
  USER: "User",
577
577
  GROUP: "Group",
578
578
  ROLE: "Role"
@@ -627,7 +627,7 @@ const Ur = {
627
627
  handleRemoveRejectedFile: f,
628
628
  handleSubmit: v,
629
629
  isSubmitting: a,
630
- formErrors: k,
630
+ formErrors: N,
631
631
  // --- UI Text ---
632
632
  title: d = "Upload Files",
633
633
  subHeading: p = "Supports PNG, JPG, PDF. Max size: 50MB."
@@ -665,7 +665,7 @@ const Ur = {
665
665
  leaveFrom: "opacity-100 scale-100",
666
666
  leaveTo: "opacity-0 scale-95",
667
667
  children: /* @__PURE__ */ l(
668
- Ne,
668
+ ke,
669
669
  {
670
670
  className: "dialog-panel",
671
671
  onClick: (L) => L.stopPropagation(),
@@ -707,7 +707,7 @@ const Ur = {
707
707
  ]
708
708
  }
709
709
  ),
710
- k.filesToUpload && /* @__PURE__ */ e("p", { className: "form-error-message", children: k.filesToUpload.message }),
710
+ N.filesToUpload && /* @__PURE__ */ e("p", { className: "form-error-message", children: N.filesToUpload.message }),
711
711
  T && /* @__PURE__ */ l("div", { className: "file-list-container", children: [
712
712
  /* @__PURE__ */ e("h3", { children: "Upload Queue" }),
713
713
  /* @__PURE__ */ l("ul", { className: "file-list", children: [
@@ -734,7 +734,7 @@ const Ur = {
734
734
  type: "button",
735
735
  onClick: () => y(R),
736
736
  className: "remove-file-button",
737
- children: /* @__PURE__ */ e(Be, { size: 16 })
737
+ children: /* @__PURE__ */ e(Pe, { size: 16 })
738
738
  }
739
739
  )
740
740
  ]
@@ -765,7 +765,7 @@ const Ur = {
765
765
  type: "button",
766
766
  onClick: () => f(S),
767
767
  className: "remove-file-button",
768
- children: /* @__PURE__ */ e(Be, { size: 16 })
768
+ children: /* @__PURE__ */ e(Pe, { size: 16 })
769
769
  }
770
770
  )
771
771
  ]
@@ -825,11 +825,11 @@ const Ur = {
825
825
  // Deep copy
826
826
  onSubmit: (S) => {
827
827
  const A = {};
828
- Object.keys(S).forEach((P) => {
829
- A[P] = {
830
- operator: S[P].operator || "in",
831
- values: Array.isArray(S[P].values) ? S[P].values : [],
832
- range: S[P].range || null
828
+ Object.keys(S).forEach((B) => {
829
+ A[B] = {
830
+ operator: S[B].operator || "in",
831
+ values: Array.isArray(S[B].values) ? S[B].values : [],
832
+ range: S[B].range || null
833
833
  };
834
834
  }), console.log("[storybook filter] Applied Filters:", A), typeof s == "function" && s({
835
835
  filters: A,
@@ -837,8 +837,8 @@ const Ur = {
837
837
  }), r();
838
838
  },
839
839
  enableReinitialize: !0
840
- }), k = ne(() => n.reduce((S, A) => {
841
- const P = A.key, I = a.values[P];
840
+ }), N = ne(() => n.reduce((S, A) => {
841
+ const B = A.key, I = a.values[B];
842
842
  let V = !1;
843
843
  if (I)
844
844
  switch (A.type) {
@@ -850,26 +850,26 @@ const Ur = {
850
850
  (I.range && I.range !== "" || Array.isArray(I.values) && I.values.length > 0) && (V = !0);
851
851
  break;
852
852
  }
853
- return S[P] = V, S;
854
- }, {}), [n, a.values]), d = Object.values(k).filter(Boolean).length, p = async (S, A) => {
853
+ return S[B] = V, S;
854
+ }, {}), [n, a.values]), d = Object.values(N).filter(Boolean).length, p = async (S, A) => {
855
855
  try {
856
856
  v((I) => ({ ...I, [S]: !0 }));
857
- const P = await i(S, A);
858
- y((I) => ({ ...I, [S]: P }));
859
- } catch (P) {
860
- console.error(`Error fetching ${S} users:`, P);
857
+ const B = await i(S, A);
858
+ y((I) => ({ ...I, [S]: B }));
859
+ } catch (B) {
860
+ console.error(`Error fetching ${S} users:`, B);
861
861
  } finally {
862
- v((P) => ({ ...P, [S]: !1 }));
862
+ v((B) => ({ ...B, [S]: !1 }));
863
863
  }
864
864
  }, T = (S) => {
865
- const A = n[S].key, P = n[S].url;
866
- n[S].type === "multiselect-users" && u[A].length === 0 && !f[A] && p(A, P);
865
+ const A = n[S].key, B = n[S].url;
866
+ n[S].type === "multiselect-users" && u[A].length === 0 && !f[A] && p(A, B);
867
867
  }, L = () => {
868
868
  a.resetForm(), y({ createdBy: [], updatedBy: [] }), o();
869
869
  }, R = (S) => {
870
870
  const A = n.find((V) => V.key === S);
871
871
  if (!A) return null;
872
- const P = a.values[S] || m[S], I = Array.isArray(P.values) ? P.values : [];
872
+ const B = a.values[S] || m[S], I = Array.isArray(B.values) ? B.values : [];
873
873
  switch (A.type) {
874
874
  case "multiselect":
875
875
  return /* @__PURE__ */ l("div", { className: "filter-panel-content", children: [
@@ -878,7 +878,7 @@ const Ur = {
878
878
  /* @__PURE__ */ e(
879
879
  "select",
880
880
  {
881
- value: P.operator || "in",
881
+ value: B.operator || "in",
882
882
  onChange: (c) => a.setFieldValue(`${S}.operator`, c.target.value),
883
883
  className: "filter-select",
884
884
  children: A.operators.map((c) => /* @__PURE__ */ e("option", { value: c, children: c === "in" ? "Includes" : "Excludes" }, c))
@@ -895,7 +895,7 @@ const Ur = {
895
895
  className: "filter-checkbox-input",
896
896
  checked: A.options.length > 0 && I.length === A.options.length,
897
897
  onChange: (c) => {
898
- const b = c.target.checked ? A.options.map((x) => x.value) : [];
898
+ const b = c.target.checked ? A.options.map((k) => k.value) : [];
899
899
  a.setFieldValue(`${S}.values`, b);
900
900
  }
901
901
  }
@@ -918,8 +918,8 @@ const Ur = {
918
918
  className: "filter-checkbox-input",
919
919
  checked: I.includes(c.value),
920
920
  onChange: (b) => {
921
- const x = b.target.checked ? [...I, c.value] : I.filter((D) => D !== c.value);
922
- a.setFieldValue(`${S}.values`, x);
921
+ const k = b.target.checked ? [...I, c.value] : I.filter((D) => D !== c.value);
922
+ a.setFieldValue(`${S}.values`, k);
923
923
  }
924
924
  }
925
925
  ),
@@ -942,7 +942,7 @@ const Ur = {
942
942
  /* @__PURE__ */ e(
943
943
  "select",
944
944
  {
945
- value: P.operator || "in",
945
+ value: B.operator || "in",
946
946
  onChange: (c) => a.setFieldValue(`${S}.operator`, c.target.value),
947
947
  className: "filter-select",
948
948
  children: A.operators.map((c) => /* @__PURE__ */ e("option", { value: c, children: c === "in" ? "Includes" : "Excludes" }, c))
@@ -959,7 +959,7 @@ const Ur = {
959
959
  className: "filter-checkbox-input",
960
960
  checked: V.length > 0 && I.length === V.length,
961
961
  onChange: (c) => {
962
- const b = c.target.checked ? V.map((x) => x.email) : [];
962
+ const b = c.target.checked ? V.map((k) => k.email) : [];
963
963
  a.setFieldValue(
964
964
  `${S}.values`,
965
965
  b
@@ -985,10 +985,10 @@ const Ur = {
985
985
  className: "filter-checkbox-input",
986
986
  checked: I.includes(c.email),
987
987
  onChange: (b) => {
988
- const x = b.target.checked ? [...I, c.email] : I.filter((D) => D !== c.email);
988
+ const k = b.target.checked ? [...I, c.email] : I.filter((D) => D !== c.email);
989
989
  a.setFieldValue(
990
990
  `${S}.values`,
991
- x
991
+ k
992
992
  );
993
993
  }
994
994
  }
@@ -1008,7 +1008,7 @@ const Ur = {
1008
1008
  ] }) : /* @__PURE__ */ e("div", { className: "text-center py-4 text-gray-500 text-sm", children: "No users loaded." }) })
1009
1009
  ] });
1010
1010
  case "date":
1011
- const B = P.values || [], [g, h] = B, N = g && h, w = {
1011
+ const P = B.values || [], [g, h] = P, x = g && h, w = {
1012
1012
  startDate: g instanceof Date ? g : /* @__PURE__ */ new Date(),
1013
1013
  // Fallback to today
1014
1014
  endDate: h instanceof Date ? h : /* @__PURE__ */ new Date(),
@@ -1021,13 +1021,13 @@ const Ur = {
1021
1021
  /* @__PURE__ */ e(
1022
1022
  "select",
1023
1023
  {
1024
- value: P.operator,
1024
+ value: B.operator,
1025
1025
  onChange: (c) => a.setFieldValue(`${S}.operator`, c.target.value),
1026
1026
  className: "filter-select",
1027
1027
  children: A.operators.map((c) => /* @__PURE__ */ e("option", { value: c, children: c === "in" ? "Is" : "Is not" }, c))
1028
1028
  }
1029
1029
  ),
1030
- N && /* @__PURE__ */ e(
1030
+ x && /* @__PURE__ */ e(
1031
1031
  "button",
1032
1032
  {
1033
1033
  type: "button",
@@ -1047,10 +1047,10 @@ const Ur = {
1047
1047
  {
1048
1048
  ranges: [w],
1049
1049
  onChange: (c) => {
1050
- const { startDate: b, endDate: x } = c.selection;
1050
+ const { startDate: b, endDate: k } = c.selection;
1051
1051
  a.setFieldValue(`${S}.values`, [
1052
1052
  b,
1053
- x
1053
+ k
1054
1054
  ]);
1055
1055
  },
1056
1056
  showSelectionPreview: !0,
@@ -1089,7 +1089,7 @@ const Ur = {
1089
1089
  leave: "ease-in duration-200",
1090
1090
  leaveFrom: "opacity-100 translate-x-0",
1091
1091
  leaveTo: "opacity-0 translate-x-full",
1092
- children: /* @__PURE__ */ l(Ne, { className: "filter-modal-panel", children: [
1092
+ children: /* @__PURE__ */ l(ke, { className: "filter-modal-panel", children: [
1093
1093
  /* @__PURE__ */ l("div", { className: "filter-header", children: [
1094
1094
  /* @__PURE__ */ e(Ve, { as: "h3", className: "filter-title", children: "Filters" }),
1095
1095
  /* @__PURE__ */ e(
@@ -1115,7 +1115,7 @@ const Ur = {
1115
1115
  children: [
1116
1116
  /* @__PURE__ */ e(sr, { className: "filter-tabs-list", children: n.map((S) => /* @__PURE__ */ l(ee, { className: "filter-tab-item", children: [
1117
1117
  S.label,
1118
- k[S.key] && /* @__PURE__ */ e(
1118
+ N[S.key] && /* @__PURE__ */ e(
1119
1119
  "span",
1120
1120
  {
1121
1121
  className: "filter-active-indicator",
@@ -1207,7 +1207,7 @@ const Ur = {
1207
1207
  ] });
1208
1208
  }, oa = {
1209
1209
  delete: {
1210
- icon: Be,
1210
+ icon: Pe,
1211
1211
  iconClass: "icon--delete",
1212
1212
  primaryButtonCategory: "danger"
1213
1213
  // Assuming you add a 'danger' category to your Button
@@ -1238,7 +1238,7 @@ const Ur = {
1238
1238
  }) => {
1239
1239
  const f = oa[i] || oa.info, v = f.icon, a = () => {
1240
1240
  r({ primary: !0, secondary: !1 });
1241
- }, k = () => {
1241
+ }, N = () => {
1242
1242
  r({ primary: !1, secondary: !0 });
1243
1243
  };
1244
1244
  return /* @__PURE__ */ e(oe, { appear: !0, show: t, as: J, children: /* @__PURE__ */ l(me, { as: "div", className: "modal-dialog", onClose: () => r({}), children: [
@@ -1265,7 +1265,7 @@ const Ur = {
1265
1265
  leave: "ease-in duration-200",
1266
1266
  leaveFrom: "opacity-100 scale-100",
1267
1267
  leaveTo: "opacity-0 scale-95",
1268
- children: /* @__PURE__ */ l(Ne, { className: "modal-panel", children: [
1268
+ children: /* @__PURE__ */ l(ke, { className: "modal-panel", children: [
1269
1269
  /* @__PURE__ */ l("div", { className: "modal-content-wrapper", children: [
1270
1270
  /* @__PURE__ */ e("div", { className: `modal-icon-container ${f.iconClass}`, children: /* @__PURE__ */ e(v, { size: 24, "aria-hidden": "true" }) }),
1271
1271
  /* @__PURE__ */ l("div", { className: "modal-text-content", children: [
@@ -1277,7 +1277,7 @@ const Ur = {
1277
1277
  /* @__PURE__ */ e(
1278
1278
  Z,
1279
1279
  {
1280
- onClick: k,
1280
+ onClick: N,
1281
1281
  label: m,
1282
1282
  category: "secondary"
1283
1283
  }
@@ -1307,8 +1307,8 @@ const Ur = {
1307
1307
  Q(() => {
1308
1308
  y(t);
1309
1309
  }, [t]);
1310
- const f = Math.min((t - 1) * s + 1, r), v = Math.min(t * s, r), a = (k) => {
1311
- k.preventDefault();
1310
+ const f = Math.min((t - 1) * s + 1, r), v = Math.min(t * s, r), a = (N) => {
1311
+ N.preventDefault();
1312
1312
  let d = parseInt(u, 10);
1313
1313
  isNaN(d) || d < 1 ? d = 1 : d > i && (d = i), y(d), d !== t && o(d);
1314
1314
  };
@@ -1321,8 +1321,8 @@ const Ur = {
1321
1321
  id: "items-per-page",
1322
1322
  className: "pagination-select",
1323
1323
  value: s,
1324
- onChange: (k) => n(Number(k.target.value)),
1325
- children: m.map((k) => /* @__PURE__ */ e("option", { value: k, children: k }, k))
1324
+ onChange: (N) => n(Number(N.target.value)),
1325
+ children: m.map((N) => /* @__PURE__ */ e("option", { value: N, children: N }, N))
1326
1326
  }
1327
1327
  ),
1328
1328
  /* @__PURE__ */ l("span", { className: "pagination-info", children: [
@@ -1361,7 +1361,7 @@ const Ur = {
1361
1361
  type: "number",
1362
1362
  className: "page-input",
1363
1363
  value: u,
1364
- onChange: (k) => y(k.target.value),
1364
+ onChange: (N) => y(N.target.value),
1365
1365
  onBlur: a,
1366
1366
  "aria-label": `Current page, Page ${t}`
1367
1367
  }
@@ -1391,7 +1391,7 @@ const Ur = {
1391
1391
  )
1392
1392
  ] })
1393
1393
  ] });
1394
- }, Pa = ({
1394
+ }, Ba = ({
1395
1395
  label: t,
1396
1396
  value: r,
1397
1397
  // The currently selected option's value (e.g., 'work')
@@ -1496,7 +1496,7 @@ const Ur = {
1496
1496
  }) => {
1497
1497
  const [f, v] = M(""), a = f === "" ? o : o.filter(
1498
1498
  (d) => d.label.toLowerCase().includes(f.toLowerCase())
1499
- ), k = o.find((d) => r?.id ? d.id === r.id : d.id === r || d.value === r);
1499
+ ), N = o.find((d) => r?.id ? d.id === r.id : d.id === r || d.value === r);
1500
1500
  return /* @__PURE__ */ e(X, { value: r, onChange: s, disabled: m, children: /* @__PURE__ */ l("div", { className: "select-wrapper", ref: u, children: [
1501
1501
  t && /* @__PURE__ */ e("label", { className: "select-label", children: t }),
1502
1502
  /* @__PURE__ */ l("div", { className: "select-button-container", children: [
@@ -1507,7 +1507,7 @@ const Ur = {
1507
1507
  "select-button--error": !!i
1508
1508
  }),
1509
1509
  children: [
1510
- /* @__PURE__ */ e("span", { className: "select-value-display", children: k ? k.label : /* @__PURE__ */ e("span", { className: "placeholder", children: n }) }),
1510
+ /* @__PURE__ */ e("span", { className: "select-value-display", children: N ? N.label : /* @__PURE__ */ e("span", { className: "placeholder", children: n }) }),
1511
1511
  /* @__PURE__ */ e(fa, { className: "select-chevron", "aria-hidden": "true" })
1512
1512
  ]
1513
1513
  }
@@ -1575,7 +1575,7 @@ const Ur = {
1575
1575
  if ((s.href || s.url || s.path) === r || s.children && Ke(s.children, r))
1576
1576
  return s;
1577
1577
  return null;
1578
- }, Ba = ({ item: t, isCollapsed: r, level: s = 0 }) => {
1578
+ }, Pa = ({ item: t, isCollapsed: r, level: s = 0 }) => {
1579
1579
  const { pathname: o } = Wr(), n = t.href || t.url || t.path, [m, i] = M(!1), u = t.icon;
1580
1580
  Q(() => {
1581
1581
  Ke([t], o) && i(!0);
@@ -1634,7 +1634,7 @@ const Ur = {
1634
1634
  }),
1635
1635
  "aria-hidden": !m || r,
1636
1636
  children: t.children.map((a) => /* @__PURE__ */ e(
1637
- Ba,
1637
+ Pa,
1638
1638
  {
1639
1639
  item: a,
1640
1640
  isCollapsed: r,
@@ -1698,7 +1698,7 @@ const Ur = {
1698
1698
  }
1699
1699
  )
1700
1700
  ] }),
1701
- /* @__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(Ba, { item: y, isCollapsed: r }) }, y.label || y.name)) }) }),
1701
+ /* @__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(Pa, { item: y, isCollapsed: r }) }, y.label || y.name)) }) }),
1702
1702
  /* @__PURE__ */ l("div", { className: "sidebar-footer", children: [
1703
1703
  /* @__PURE__ */ e(Ta, { src: u.avatar, name: u.name, size: "medium" }),
1704
1704
  /* @__PURE__ */ l("div", { className: "user-info", children: [
@@ -1770,12 +1770,12 @@ const Ur = {
1770
1770
  u.value?.length || u.defaultValue?.length || 0
1771
1771
  ), a = (d) => {
1772
1772
  v(d.target.value.length), u.onChange && u.onChange(d);
1773
- }, k = m - f;
1773
+ }, N = m - f;
1774
1774
  return /* @__PURE__ */ l("div", { className: `textarea-wrapper ${o || ""}`, children: [
1775
1775
  /* @__PURE__ */ l("div", { className: "textarea-header", children: [
1776
1776
  t && /* @__PURE__ */ e("label", { htmlFor: y, className: "textarea-label", children: t }),
1777
1777
  i && m && /* @__PURE__ */ l("span", { className: "char-counter", children: [
1778
- k,
1778
+ N,
1779
1779
  " characters remaining"
1780
1780
  ] })
1781
1781
  ] }),
@@ -1873,7 +1873,7 @@ const Ur = {
1873
1873
  showProgress: y = !0,
1874
1874
  closeOnOverlayClick: f = !0
1875
1875
  }) => {
1876
- const v = s[o], a = Object.keys(s), k = a.indexOf(o), d = (k + 1) / a.length * 100, p = k > 0 && m.onBack;
1876
+ const v = s[o], a = Object.keys(s), N = a.indexOf(o), d = (N + 1) / a.length * 100, p = N > 0 && m.onBack;
1877
1877
  return /* @__PURE__ */ e(oe, { show: t, as: J, children: /* @__PURE__ */ l(
1878
1878
  me,
1879
1879
  {
@@ -1905,7 +1905,7 @@ const Ur = {
1905
1905
  leave: "transform transition ease-in-out duration-500",
1906
1906
  leaveFrom: "translate-x-0",
1907
1907
  leaveTo: "translate-x-full",
1908
- children: /* @__PURE__ */ l(Ne, { className: "wizard-panel", children: [
1908
+ children: /* @__PURE__ */ l(ke, { className: "wizard-panel", children: [
1909
1909
  /* @__PURE__ */ l("header", { className: "wizard-header", children: [
1910
1910
  /* @__PURE__ */ l("div", { className: "wizard-header-content", children: [
1911
1911
  p && /* @__PURE__ */ e(
@@ -2293,31 +2293,31 @@ function nn({
2293
2293
  );
2294
2294
  function o({ open: f = !1, customHeader: v = {} } = {}) {
2295
2295
  if (f) {
2296
- const { Authorization: a, ...k } = ia();
2296
+ const { Authorization: a, ...N } = ia();
2297
2297
  return {
2298
- headers: { ...k, ...r, ...v }
2298
+ headers: { ...N, ...r, ...v }
2299
2299
  };
2300
2300
  }
2301
2301
  return { headers: { ...ia(), ...v } };
2302
2302
  }
2303
- async function n(f, v, a = !1, k = {}) {
2303
+ async function n(f, v, a = !1, N = {}) {
2304
2304
  return s.get(f, {
2305
2305
  params: v,
2306
- ...o({ open: a, customHeader: k })
2306
+ ...o({ open: a, customHeader: N })
2307
2307
  });
2308
2308
  }
2309
- async function m(f, v, a = !1, k = {}) {
2310
- const d = { ...o({ open: a, customHeader: k }) };
2309
+ async function m(f, v, a = !1, N = {}) {
2310
+ const d = { ...o({ open: a, customHeader: N }) };
2311
2311
  return v !== void 0 && (d.data = v), s.delete(f, d);
2312
2312
  }
2313
- async function i(f, v = {}, a = !1, k = {}) {
2314
- return s.post(f, v, o({ open: a, customHeader: k }));
2313
+ async function i(f, v = {}, a = !1, N = {}) {
2314
+ return s.post(f, v, o({ open: a, customHeader: N }));
2315
2315
  }
2316
- async function u(f, v = {}, a = !1, k = {}) {
2317
- return s.put(f, v, o({ open: a, customHeader: k }));
2316
+ async function u(f, v = {}, a = !1, N = {}) {
2317
+ return s.put(f, v, o({ open: a, customHeader: N }));
2318
2318
  }
2319
- async function y(f, v = {}, a = !1, k = {}) {
2320
- return s.patch(f, v, o({ open: a, customHeader: k }));
2319
+ async function y(f, v = {}, a = !1, N = {}) {
2320
+ return s.patch(f, v, o({ open: a, customHeader: N }));
2321
2321
  }
2322
2322
  return {
2323
2323
  instance: s,
@@ -2329,18 +2329,18 @@ function nn({
2329
2329
  axiosPatch: y
2330
2330
  };
2331
2331
  }
2332
- const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln = ke.axiosPut, rs = ke.axiosPatch, ns = ke.instance, on = async (t, r) => {
2332
+ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln = we.axiosPut, rs = we.axiosPatch, ns = we.instance, on = async (t, r) => {
2333
2333
  try {
2334
2334
  switch (t) {
2335
- case ve.USER: {
2335
+ case xe.USER: {
2336
2336
  const s = {
2337
2337
  q: r
2338
2338
  };
2339
2339
  return Ie.userSearch(s);
2340
2340
  }
2341
- case ve.GROUP:
2341
+ case xe.GROUP:
2342
2342
  return Ie.getAdGroups(r);
2343
- case ve.ROLE:
2343
+ case xe.ROLE:
2344
2344
  return Ie.searchRoles(r);
2345
2345
  default:
2346
2346
  break;
@@ -2468,9 +2468,9 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
2468
2468
  }
2469
2469
  );
2470
2470
  }, da = [
2471
- { id: 1, name: ve.USER, icon: $t, code: "users" },
2472
- { id: 2, name: ve.GROUP, icon: va, code: "groups" },
2473
- { id: 3, name: ve.ROLE, icon: Tt, code: "roles" }
2471
+ { id: 1, name: xe.USER, icon: $t, code: "users" },
2472
+ { id: 2, name: xe.GROUP, icon: va, code: "groups" },
2473
+ { id: 3, name: xe.ROLE, icon: Tt, code: "roles" }
2474
2474
  ], ua = [
2475
2475
  { id: 1, name: na.View, icon: xa },
2476
2476
  { id: 2, name: na.Manage, icon: Na }
@@ -2487,34 +2487,34 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
2487
2487
  },
2488
2488
  isChanged: u = !1
2489
2489
  }) => {
2490
- const [y, f] = M(da[0]), [v, a] = M(""), k = ta(v, 400), [d, p] = M([]), [T, L] = M(/* @__PURE__ */ new Set()), [R, S] = M(!1), [A, P] = M(ua[0]), {
2490
+ const [y, f] = M(da[0]), [v, a] = M(""), N = ta(v, 400), [d, p] = M([]), [T, L] = M(/* @__PURE__ */ new Set()), [R, S] = M(!1), [A, B] = M(ua[0]), {
2491
2491
  control: I,
2492
2492
  handleSubmit: V,
2493
2493
  watch: z,
2494
- formState: { errors: B, isSubmitting: g }
2494
+ formState: { errors: P, isSubmitting: g }
2495
2495
  } = At({
2496
2496
  defaultValues: { pendingInvites: [] },
2497
2497
  resolver: It(un)
2498
- }), { fields: h, append: N, remove: w, update: c } = Et({
2498
+ }), { fields: h, append: x, remove: w, update: c } = Et({
2499
2499
  control: I,
2500
2500
  name: "pendingInvites"
2501
2501
  }), b = z("pendingInvites");
2502
2502
  Q(() => {
2503
- k.length > 1 ? (S(!0), on(y.name, k).then((F) => {
2503
+ N.length > 1 ? (S(!0), on(y.name, N).then((F) => {
2504
2504
  p(F);
2505
2505
  }).catch((F) => console.error("Search failed:", F)).finally(() => S(!1))) : (p([]), L(/* @__PURE__ */ new Set()));
2506
- }, [k, y]);
2507
- const x = (F) => {
2506
+ }, [N, y]);
2507
+ const k = (F) => {
2508
2508
  L((C) => {
2509
2509
  const E = new Set(C);
2510
2510
  return E.has(F) ? E.delete(F) : E.add(F), E;
2511
2511
  });
2512
2512
  }, D = () => {
2513
2513
  d.filter((F) => T.has(F.id)).forEach((F) => {
2514
- h.find((C) => C.id === F.id) || N({ ...F, permission: A.name });
2514
+ h.find((C) => C.id === F.id) || x({ ...F, permission: A.name });
2515
2515
  }), L(/* @__PURE__ */ new Set()), a("");
2516
2516
  }, q = (F) => {
2517
- P(F), h.forEach(
2517
+ B(F), h.forEach(
2518
2518
  (C, E) => c(E, { ...h[E], permission: F.name })
2519
2519
  );
2520
2520
  }, G = async (F) => {
@@ -2668,7 +2668,7 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
2668
2668
  return /* @__PURE__ */ l(
2669
2669
  "div",
2670
2670
  {
2671
- onClick: () => C ? null : x(F.id),
2671
+ onClick: () => C ? null : k(F.id),
2672
2672
  className: `flex items-center gap-3 p-2 rounded-md hover:bg-blue-50 ${C ? " hover:cursor-not-allowed" : "hover:cursor-pointer"}`,
2673
2673
  children: [
2674
2674
  /* @__PURE__ */ e(
@@ -2881,11 +2881,11 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
2881
2881
  }), y = vr(u), f = xr(u), { getReferenceProps: v, getFloatingProps: a } = Nr([
2882
2882
  y,
2883
2883
  f
2884
- ]), k = Je.find((p) => p.name === t.permission || p.value === t.permission) || Je[0];
2884
+ ]), N = Je.find((p) => p.name === t.permission || p.value === t.permission) || Je[0];
2885
2885
  return (
2886
2886
  // FIX: The <Listbox> component now wraps both the button and the portal.
2887
2887
  // This provides the necessary context for both children.
2888
- /* @__PURE__ */ l(X, { value: k, onChange: (p) => {
2888
+ /* @__PURE__ */ l(X, { value: N, onChange: (p) => {
2889
2889
  s(p), n(!1);
2890
2890
  }, children: [
2891
2891
  /* @__PURE__ */ l(
@@ -2960,17 +2960,17 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
2960
2960
  existingShares: n,
2961
2961
  allowedPermissions: m
2962
2962
  }) => {
2963
- const [i, u] = M(n), [y, f] = M(0), [v, a] = M(""), k = ta(v, 300), d = {
2963
+ const [i, u] = M(n), [y, f] = M(0), [v, a] = M(""), N = ta(v, 300), d = {
2964
2964
  users: i.users.filter(
2965
- (R) => R.name.toLowerCase().includes(k.toLowerCase())
2965
+ (R) => R.name.toLowerCase().includes(N.toLowerCase())
2966
2966
  ),
2967
2967
  groups: i.groups.filter(
2968
- (R) => R.name.toLowerCase().includes(k.toLowerCase())
2968
+ (R) => R.name.toLowerCase().includes(N.toLowerCase())
2969
2969
  ),
2970
2970
  roles: i.roles.filter(
2971
- (R) => R.name.toLowerCase().includes(k.toLowerCase())
2971
+ (R) => R.name.toLowerCase().includes(N.toLowerCase())
2972
2972
  )
2973
- }, p = async (R, S, A, P) => {
2973
+ }, p = async (R, S, A, B) => {
2974
2974
  const I = S.value;
2975
2975
  u(I === "Remove" ? (V) => ({
2976
2976
  ...V,
@@ -3150,7 +3150,7 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
3150
3150
  hidden: { y: 20, opacity: 0 },
3151
3151
  visible: { y: 0, opacity: 1 },
3152
3152
  exit: { opacity: 0, x: -20 }
3153
- }, k = () => n ? (
3153
+ }, N = () => n ? (
3154
3154
  // Show 5 skeleton items while loading
3155
3155
  /* @__PURE__ */ e("div", { children: Array.from({ length: 5 }).map((d, p) => /* @__PURE__ */ e(gn, {}, p)) })
3156
3156
  ) : f.length === 0 ? /* @__PURE__ */ l(
@@ -3160,7 +3160,7 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
3160
3160
  animate: { opacity: 1, scale: 1 },
3161
3161
  className: "flex flex-col items-center justify-center text-center p-8 mt-10",
3162
3162
  children: [
3163
- /* @__PURE__ */ e(Pt, { className: "h-12 w-12 text-gray-400" }),
3163
+ /* @__PURE__ */ e(Bt, { className: "h-12 w-12 text-gray-400" }),
3164
3164
  /* @__PURE__ */ e("h3", { className: "mt-2 text-sm font-medium text-gray-900", children: "No Users Found" }),
3165
3165
  /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: y ? `No one found matching "${y}"` : `There are no users in this ${t.type}.` })
3166
3166
  ]
@@ -3234,7 +3234,7 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
3234
3234
  placeholder: "Search members..."
3235
3235
  }
3236
3236
  ) }),
3237
- /* @__PURE__ */ e("div", { className: "flex-grow overflow-y-auto", children: k() })
3237
+ /* @__PURE__ */ e("div", { className: "flex-grow overflow-y-auto", children: N() })
3238
3238
  ] });
3239
3239
  }, de = {
3240
3240
  INVITE: "invite",
@@ -3257,31 +3257,31 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
3257
3257
  allowedPermissions: u = [],
3258
3258
  ...y
3259
3259
  }) => {
3260
- const [f, v] = M(de.INVITE), [a, k] = M(t), [d, p] = M(null), [T, L] = M(!1), [R, S] = M([]), [A, P] = M(de.MANAGE), I = () => {
3260
+ const [f, v] = M(de.INVITE), [a, N] = M(t), [d, p] = M(null), [T, L] = M(!1), [R, S] = M([]), [A, B] = M(de.MANAGE), I = () => {
3261
3261
  v(de.INVITE), p(null), m();
3262
3262
  }, V = () => {
3263
3263
  v(de.MANAGE);
3264
- }, z = async ({ id: h, name: N, type: w }) => {
3265
- if (console.log("handleToMembers", { id: h, name: N, type: w }), w === "groups") {
3264
+ }, z = async ({ id: h, name: x, type: w }) => {
3265
+ if (console.log("handleToMembers", { id: h, name: x, type: w }), w === "groups") {
3266
3266
  try {
3267
- const c = await Fe(`${Ie.getMembersForGroup(N)}`);
3267
+ const c = await Fe(`${Ie.getMembersForGroup(x)}`);
3268
3268
  } catch (c) {
3269
3269
  console.log("Error searching entities:", c);
3270
3270
  }
3271
3271
  S(resp);
3272
3272
  }
3273
- p({ id: h, type: w, name: N }), P(f), v(de.MEMBERS);
3274
- }, B = (h) => {
3275
- console.log("changedExistingShares", h), k(h);
3276
- const N = !We.isEqual(
3273
+ p({ id: h, type: w, name: x }), B(f), v(de.MEMBERS);
3274
+ }, P = (h) => {
3275
+ console.log("changedExistingShares", h), N(h);
3276
+ const x = !We.isEqual(
3277
3277
  We.mapValues(t, (w) => w.map((c) => ({ id: c.id, permission: c.permission }))),
3278
3278
  We.mapValues(h, (w) => w.map((c) => ({ id: c.id, permission: c.permission })))
3279
3279
  );
3280
- L(N), v(f === de.MEMBERS ? A : de.INVITE);
3280
+ L(x), v(f === de.MEMBERS ? A : de.INVITE);
3281
3281
  };
3282
3282
  return /* @__PURE__ */ e(oe, { appear: !0, show: r, as: J, children: /* @__PURE__ */ l(me, { as: "div", className: "relative z-50", onClose: I, children: [
3283
3283
  /* @__PURE__ */ e("div", { className: "filter-modal-overlay", "aria-hidden": "true" }),
3284
- /* @__PURE__ */ e("div", { className: "filter-modal-container", children: /* @__PURE__ */ e("div", { className: "filter-modal-positioner", children: /* @__PURE__ */ e(Ne, { className: "filter-modal-panel", style: { background: "white" }, children: (() => {
3284
+ /* @__PURE__ */ e("div", { className: "filter-modal-container", children: /* @__PURE__ */ e("div", { className: "filter-modal-positioner", children: /* @__PURE__ */ e(ke, { className: "filter-modal-panel", style: { background: "white" }, children: (() => {
3285
3285
  switch (f) {
3286
3286
  case de.MANAGE:
3287
3287
  return /* @__PURE__ */ e(
@@ -3296,7 +3296,7 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
3296
3296
  pn,
3297
3297
  {
3298
3298
  entity: o,
3299
- onBack: B,
3299
+ onBack: P,
3300
3300
  onClose: I,
3301
3301
  onOpenMembers: z,
3302
3302
  existingShares: a,
@@ -3320,7 +3320,7 @@ const ke = nn(), Fe = ke.axiosGet, sn = ke.axiosDelete, $e = ke.axiosPost, ln =
3320
3320
  yn,
3321
3321
  {
3322
3322
  entity: d,
3323
- onBack: B,
3323
+ onBack: P,
3324
3324
  onClose: I,
3325
3325
  calledBy: n,
3326
3326
  existingShares: a,
@@ -3382,27 +3382,27 @@ function qe({
3382
3382
  onSearch: v,
3383
3383
  // (query: string) => void (required if searchMode==="server")
3384
3384
  serverLoading: a = !1,
3385
- minSearchChars: k = 2,
3385
+ minSearchChars: N = 2,
3386
3386
  // NEW: mappers (id/label keys)
3387
3387
  getOptionId: d = (T) => String(T.id),
3388
3388
  getOptionLabel: p = (T) => T.name
3389
3389
  }) {
3390
- const T = Qe(), L = Qe(), [R, S] = M(""), A = ue(""), P = ne(() => {
3390
+ const T = Qe(), L = Qe(), [R, S] = M(""), A = ue(""), B = ne(() => {
3391
3391
  const h = /* @__PURE__ */ new Map();
3392
- for (const N of r) h.set(d(N), N);
3392
+ for (const x of r) h.set(d(x), x);
3393
3393
  return h;
3394
- }, [r, d]), I = ne(() => Array.isArray(s) ? s.map((h) => h && typeof h == "object" ? P.get(d(h)) || null : P.get(String(h))).filter(Boolean) : [], [s, P, d]), V = ne(() => {
3394
+ }, [r, d]), I = ne(() => Array.isArray(s) ? s.map((h) => h && typeof h == "object" ? B.get(d(h)) || null : B.get(String(h))).filter(Boolean) : [], [s, B, d]), V = ne(() => {
3395
3395
  if (!R) return r;
3396
3396
  const h = R.toLowerCase();
3397
- return r.filter((N) => p(N).toLowerCase().includes(h));
3397
+ return r.filter((x) => p(x).toLowerCase().includes(h));
3398
3398
  }, [r, R, p]);
3399
3399
  Q(() => {
3400
- f === "server" && R.length >= k && R !== A.current && (A.current = R, v && v(R));
3401
- }, [R, f, k, v]);
3402
- const z = f === "client" ? V : r, B = () => {
3400
+ f === "server" && R.length >= N && R !== A.current && (A.current = R, v && v(R));
3401
+ }, [R, f, N, v]);
3402
+ const z = f === "client" ? V : r, P = () => {
3403
3403
  if (!I.length)
3404
3404
  return /* @__PURE__ */ e("span", { className: "text-gray-500", children: m });
3405
- const h = I.slice(0, u), N = I.length - u;
3405
+ const h = I.slice(0, u), x = I.length - u;
3406
3406
  return /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-2", children: [
3407
3407
  h.map((w) => /* @__PURE__ */ e(
3408
3408
  "span",
@@ -3412,16 +3412,16 @@ function qe({
3412
3412
  },
3413
3413
  d(w)
3414
3414
  )),
3415
- N > 0 && /* @__PURE__ */ l("span", { className: "px-2 py-1 text-xs font-medium text-gray-600 bg-gray-200 rounded-full", children: [
3415
+ x > 0 && /* @__PURE__ */ l("span", { className: "px-2 py-1 text-xs font-medium text-gray-600 bg-gray-200 rounded-full", children: [
3416
3416
  "+",
3417
- N,
3417
+ x,
3418
3418
  " more"
3419
3419
  ] })
3420
3420
  ] });
3421
3421
  };
3422
3422
  return /* @__PURE__ */ e(X, { value: I, onChange: (h) => {
3423
- const N = Array.from(new Set(h.map((w) => d(w))));
3424
- y !== -1 && N.length > y || o(N);
3423
+ const x = Array.from(new Set(h.map((w) => d(w))));
3424
+ y !== -1 && x.length > y || o(x);
3425
3425
  }, multiple: !0, by: "id", children: ({ open: h }) => /* @__PURE__ */ l("div", { children: [
3426
3426
  /* @__PURE__ */ e(
3427
3427
  X.Label,
@@ -3444,7 +3444,7 @@ function qe({
3444
3444
  i ? "ring-red-500" : "ring-gray-300"
3445
3445
  ),
3446
3446
  children: [
3447
- /* @__PURE__ */ e("span", { className: "block truncate", children: B() }),
3447
+ /* @__PURE__ */ e("span", { className: "block truncate", children: P() }),
3448
3448
  /* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ e(fa, { className: "w-5 h-5 text-gray-400", "aria-hidden": "true" }) })
3449
3449
  ]
3450
3450
  }
@@ -3463,19 +3463,19 @@ function qe({
3463
3463
  {
3464
3464
  value: R,
3465
3465
  onDebouncedChange: S,
3466
- placeholder: f === "server" ? `Search (min ${k})…` : "Search options…"
3466
+ placeholder: f === "server" ? `Search (min ${N})…` : "Search options…"
3467
3467
  }
3468
3468
  ) }),
3469
3469
  f === "server" && a && /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: "Loading…" }),
3470
- z.length === 0 && !a ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: f === "server" ? R.length < k ? `Type at least ${k} characters to search.` : "No results." : "No options found." }) : z.map((N) => {
3471
- const w = d(N), c = p(N), b = I.some((D) => d(D) === w), x = y !== -1 && I.length >= y && !b;
3470
+ z.length === 0 && !a ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: f === "server" ? R.length < N ? `Type at least ${N} characters to search.` : "No results." : "No options found." }) : z.map((x) => {
3471
+ const w = d(x), c = p(x), b = I.some((D) => d(D) === w), k = y !== -1 && I.length >= y && !b;
3472
3472
  return /* @__PURE__ */ e(
3473
3473
  X.Option,
3474
3474
  {
3475
- value: N,
3476
- disabled: x,
3475
+ value: x,
3476
+ disabled: k,
3477
3477
  className: ({ active: D }) => Ae(
3478
- x ? " text-gray-400 bg-white cursor-not-allowed" : D ? " bg-gray-200 text-gray-900" : " text-gray-900",
3478
+ k ? " text-gray-400 bg-white cursor-not-allowed" : D ? " bg-gray-200 text-gray-900" : " text-gray-900",
3479
3479
  " relative cursor-default select-none py-2 pl-3 pr-9"
3480
3480
  ),
3481
3481
  children: ({ selected: D, active: q }) => /* @__PURE__ */ l(K, { children: [
@@ -3583,7 +3583,7 @@ const ss = ({
3583
3583
  }
3584
3584
  ),
3585
3585
  /* @__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(
3586
- Ne,
3586
+ ke,
3587
3587
  {
3588
3588
  className: `${u} 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`,
3589
3589
  onClick: f,
@@ -3665,7 +3665,7 @@ function vn({
3665
3665
  dropId: v,
3666
3666
  indent: a = 24
3667
3667
  }) {
3668
- const { setNodeRef: k, isOver: d } = Bt({ id: v }), { attributes: p, listeners: T, setNodeRef: L, transform: R, isDragging: S } = Lt({ id: f }), A = R ? { transform: `translate3d(${Math.round(R.x)}px, ${Math.round(R.y)}px, 0)` } : void 0, [P, I] = M(!1), [V, z] = M(t.name), B = () => {
3668
+ const { setNodeRef: N, isOver: d } = Pt({ id: v }), { attributes: p, listeners: T, setNodeRef: L, transform: R, isDragging: S } = Lt({ id: f }), A = R ? { transform: `translate3d(${Math.round(R.x)}px, ${Math.round(R.y)}px, 0)` } : void 0, [B, I] = M(!1), [V, z] = M(t.name), P = () => {
3669
3669
  const h = V.trim();
3670
3670
  I(!1), h && h !== t.name ? i?.(t, h) : z(t.name);
3671
3671
  }, g = ne(() => /* @__PURE__ */ e(
@@ -3676,15 +3676,15 @@ function vn({
3676
3676
  { action: "rename", label: "Rename" },
3677
3677
  { action: "delete", label: "Delete" }
3678
3678
  ],
3679
- onSelect: (N) => {
3680
- N.action === "create" ? m?.(t) : N.action === "rename" ? I(!0) : N.action === "delete" && u?.(t);
3679
+ onSelect: (x) => {
3680
+ x.action === "create" ? m?.(t) : x.action === "rename" ? I(!0) : x.action === "delete" && u?.(t);
3681
3681
  }
3682
3682
  }
3683
3683
  ), [t, m, u]);
3684
3684
  return /* @__PURE__ */ l(
3685
3685
  "div",
3686
3686
  {
3687
- ref: k,
3687
+ ref: N,
3688
3688
  className: `tv-row ${d ? "tv-drop-over" : ""} ${S ? "dragging" : ""}`,
3689
3689
  style: { ...A, paddingLeft: 8 + r * a },
3690
3690
  onClick: (h) => {
@@ -3693,15 +3693,15 @@ function vn({
3693
3693
  children: [
3694
3694
  /* @__PURE__ */ e("button", { className: "tv-toggle", onClick: o, "aria-label": "toggle", children: t.children?.length ? s ? /* @__PURE__ */ e(ba, { size: 16 }) : /* @__PURE__ */ e(Oe, { size: 16 }) : /* @__PURE__ */ e("span", { className: "tv-spacer" }) }),
3695
3695
  /* @__PURE__ */ e(wa, { size: 16, className: "tv-folder-ic" }),
3696
- /* @__PURE__ */ e("div", { className: "tv-name", ref: L, children: P ? /* @__PURE__ */ e(
3696
+ /* @__PURE__ */ e("div", { className: "tv-name", ref: L, children: B ? /* @__PURE__ */ e(
3697
3697
  "input",
3698
3698
  {
3699
3699
  className: "tv-input",
3700
3700
  value: V,
3701
3701
  onChange: (h) => z(h.target.value),
3702
- onBlur: B,
3702
+ onBlur: P,
3703
3703
  onKeyDown: (h) => {
3704
- h.key === "Enter" && B(), h.key === "Escape" && (I(!1), z(t.name));
3704
+ h.key === "Enter" && P(), h.key === "Escape" && (I(!1), z(t.name));
3705
3705
  },
3706
3706
  autoFocus: !0
3707
3707
  }
@@ -3749,7 +3749,7 @@ function Sn(t, { rootId: r, getId: s, getName: o }) {
3749
3749
  }
3750
3750
  return { roots: t.map((u) => m(u, null)), byId: n };
3751
3751
  }
3752
- const Se = (t) => t.map((r) => ({ ...r, children: Se(r.children || []) }));
3752
+ const De = (t) => t.map((r) => ({ ...r, children: De(r.children || []) }));
3753
3753
  function Dn(t, r) {
3754
3754
  let s = null;
3755
3755
  function o(m) {
@@ -3802,47 +3802,47 @@ function ls({
3802
3802
  onRename: f,
3803
3803
  onDelete: v,
3804
3804
  onMove: a,
3805
- renderActions: k,
3805
+ renderActions: N,
3806
3806
  disableMoveToRoot: d = !1,
3807
3807
  // ← allow root moves by default now
3808
3808
  indentUnit: p = 24
3809
3809
  }) {
3810
3810
  const { roots: T } = ne(() => wn(t) ? Sn(t, { rootId: r, getId: o, getName: m }) : Cn(
3811
- t.map((x) => ({ ...x })),
3811
+ t.map((k) => ({ ...k })),
3812
3812
  { rootId: r, getId: o, getParent: n, getName: m }
3813
- ), [t, r, o, n, m]), [L, R] = M({}), S = ae((x) => {
3813
+ ), [t, r, o, n, m]), [L, R] = M({}), S = ae((k) => {
3814
3814
  const D = {};
3815
3815
  return (function q(G) {
3816
3816
  G.forEach(($) => {
3817
3817
  D[$.id] = !0, $.children?.length && q($.children);
3818
3818
  });
3819
- })(x), D;
3819
+ })(k), D;
3820
3820
  }, []);
3821
3821
  re.useEffect(() => {
3822
3822
  R(S(T));
3823
3823
  }, [T, S]);
3824
3824
  const A = ae(
3825
- (x) => R((D) => ({ ...D, [x]: !D[x] })),
3825
+ (k) => R((D) => ({ ...D, [k]: !D[k] })),
3826
3826
  []
3827
- ), [P, I] = M(() => Se(T));
3828
- re.useEffect(() => I(Se(T)), [T]);
3827
+ ), [B, I] = M(() => De(T));
3828
+ re.useEffect(() => I(De(T)), [T]);
3829
3829
  const V = Ot(
3830
3830
  Mt(jt, { activationConstraint: { delay: 250, tolerance: 5 } })
3831
- ), z = ue(null), [B, g] = M(null), h = ue(0), N = () => {
3832
- }, w = ({ delta: x }) => {
3833
- h.current = x?.x ?? 0;
3831
+ ), z = ue(null), [P, g] = M(null), h = ue(0), x = () => {
3832
+ }, w = ({ delta: k }) => {
3833
+ h.current = k?.x ?? 0;
3834
3834
  }, c = ae(
3835
- ({ active: x, over: D }) => {
3835
+ ({ active: k, over: D }) => {
3836
3836
  const q = h.current;
3837
- if (h.current = 0, g(null), !x || !D) return;
3838
- const G = String(x.id).replace(/^drag-/, ""), $ = String(D.id).replace(/^drop-/, "");
3837
+ if (h.current = 0, g(null), !k || !D) return;
3838
+ const G = String(k.id).replace(/^drag-/, ""), $ = String(D.id).replace(/^drop-/, "");
3839
3839
  if (!G || !$ || G === $) return;
3840
3840
  let O = $;
3841
3841
  const U = Math.max(0, Math.floor(-q / p));
3842
3842
  if (U > 0) {
3843
3843
  let H = $;
3844
3844
  for (let ie = 0; ie < U; ie++) {
3845
- const ce = Ja(P, H, null);
3845
+ const ce = Ja(B, H, null);
3846
3846
  if (!ce) break;
3847
3847
  if (!ce.parentId) {
3848
3848
  O = r;
@@ -3852,17 +3852,17 @@ function ls({
3852
3852
  }
3853
3853
  }
3854
3854
  if (d && O === r) {
3855
- I(Se(T));
3855
+ I(De(T));
3856
3856
  return;
3857
3857
  }
3858
- const F = Se(P), { newRoots: C, removed: E } = Dn(F, G);
3858
+ const F = De(B), { newRoots: C, removed: E } = Dn(F, G);
3859
3859
  if (!E) return;
3860
3860
  const j = Fn(C, O, E);
3861
3861
  I(j), a?.({ sourceId: G, destParentId: O, newTree: j });
3862
3862
  },
3863
- [P, T, r, d, p, a]
3863
+ [B, T, r, d, p, a]
3864
3864
  ), b = ae(
3865
- (x, D = 0) => x.map((q) => /* @__PURE__ */ l(re.Fragment, { children: [
3865
+ (k, D = 0) => k.map((q) => /* @__PURE__ */ l(re.Fragment, { children: [
3866
3866
  /* @__PURE__ */ e(
3867
3867
  vn,
3868
3868
  {
@@ -3874,7 +3874,7 @@ function ls({
3874
3874
  onCreateChild: y,
3875
3875
  onRename: f,
3876
3876
  onDelete: v,
3877
- renderActions: k,
3877
+ renderActions: N,
3878
3878
  dragId: `drag-${q.id}`,
3879
3879
  dropId: `drop-${q.id}`,
3880
3880
  indent: p
@@ -3882,21 +3882,21 @@ function ls({
3882
3882
  ),
3883
3883
  L[q.id] && q.children?.length > 0 ? b(q.children, D + 1) : null
3884
3884
  ] }, q.id)),
3885
- [L, p, y, v, f, i, k, A]
3885
+ [L, p, y, v, f, i, N, A]
3886
3886
  );
3887
3887
  return re.useMemo(() => {
3888
- if (!B) return null;
3889
- const x = String(B).replace(/^drag-/, "");
3888
+ if (!P) return null;
3889
+ const k = String(P).replace(/^drag-/, "");
3890
3890
  function D(q) {
3891
3891
  for (const G of q) {
3892
- if (G.id === x) return G;
3892
+ if (G.id === k) return G;
3893
3893
  const $ = G.children?.length ? D(G.children) : null;
3894
3894
  if ($) return $;
3895
3895
  }
3896
3896
  return null;
3897
3897
  }
3898
- return D(P);
3899
- }, [B, P]), /* @__PURE__ */ l("div", { className: "tv", children: [
3898
+ return D(B);
3899
+ }, [P, B]), /* @__PURE__ */ l("div", { className: "tv", children: [
3900
3900
  s !== !1 && /* @__PURE__ */ l("div", { className: "tv-header", children: [
3901
3901
  /* @__PURE__ */ e("div", { className: "tv-title", children: s }),
3902
3902
  /* @__PURE__ */ e("button", { className: "tv-btn", onClick: u, children: "+ New folder" })
@@ -3911,11 +3911,11 @@ function ls({
3911
3911
  {
3912
3912
  collisionDetection: qt,
3913
3913
  sensors: V,
3914
- onDragStart: N,
3914
+ onDragStart: x,
3915
3915
  onDragMove: w,
3916
3916
  onDragEnd: c,
3917
3917
  modifiers: [Ut],
3918
- children: /* @__PURE__ */ e("div", { ref: z, className: "tv-list", children: b(P, 0) })
3918
+ children: /* @__PURE__ */ e("div", { ref: z, className: "tv-list", children: b(B, 0) })
3919
3919
  }
3920
3920
  )
3921
3921
  ] });
@@ -3934,19 +3934,19 @@ const os = ({
3934
3934
  ...u
3935
3935
  // Pass remaining props to Tab.Group
3936
3936
  }) => {
3937
- const y = s === "vertical", f = (k) => ye(
3937
+ const y = s === "vertical", f = (N) => ye(
3938
3938
  "text-left text-sm rounded-md px-2 py-1.5 focus:outline-none",
3939
- k ? "bg-indigo-50 text-indigo-700" : "text-slate-600 hover:bg-slate-50 hover:text-indigo-700"
3940
- ), v = (k) => ye(
3939
+ N ? "bg-indigo-50 text-indigo-700" : "text-slate-600 hover:bg-slate-50 hover:text-indigo-700"
3940
+ ), v = (N) => ye(
3941
3941
  "py-2 -mb-px text-sm font-medium focus:outline-none border-b-2",
3942
- k ? "border-indigo-600 text-indigo-700" : "border-transparent text-slate-600 hover:text-indigo-700"
3943
- ), a = ({ selected: k }) => i ? typeof i == "function" ? i(k) : i : y ? f(k) : v(k);
3942
+ N ? "border-indigo-600 text-indigo-700" : "border-transparent text-slate-600 hover:text-indigo-700"
3943
+ ), a = ({ selected: N }) => i ? typeof i == "function" ? i(N) : i : y ? f(N) : v(N);
3944
3944
  return /* @__PURE__ */ e(ee.Group, { vertical: y, ...u, children: y ? /* @__PURE__ */ l("div", { className: ye("flex gap-4", o), children: [
3945
- /* @__PURE__ */ e(ee.List, { className: ye("w-[150px] flex flex-col gap-1 border-r border-gray-300 pr-2", n), children: t.map((k) => /* @__PURE__ */ e(ee, { className: a, children: k.label }, k.key)) }),
3946
- /* @__PURE__ */ e(ee.Panels, { unmount: !r, className: ye("flex-1", m), children: t.map((k) => /* @__PURE__ */ e(ee.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: k.content }) }, k.key)) })
3945
+ /* @__PURE__ */ e(ee.List, { className: ye("w-[150px] flex flex-col gap-1 border-r border-gray-300 pr-2", n), children: t.map((N) => /* @__PURE__ */ e(ee, { className: a, children: N.label }, N.key)) }),
3946
+ /* @__PURE__ */ e(ee.Panels, { unmount: !r, className: ye("flex-1", m), children: t.map((N) => /* @__PURE__ */ e(ee.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: N.content }) }, N.key)) })
3947
3947
  ] }) : /* @__PURE__ */ l(K, { children: [
3948
- /* @__PURE__ */ e(ee.List, { className: ye("flex gap-6 border-b border-gray-300 mb-3", n), children: t.map((k) => /* @__PURE__ */ e(ee, { className: a, children: k.label }, k.key)) }),
3949
- /* @__PURE__ */ e(ee.Panels, { unmount: !r, className: ye("mt-2", m), children: t.map((k) => /* @__PURE__ */ e(ee.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: k.content }) }, k.key)) })
3948
+ /* @__PURE__ */ e(ee.List, { className: ye("flex gap-6 border-b border-gray-300 mb-3", n), children: t.map((N) => /* @__PURE__ */ e(ee, { className: a, children: N.label }, N.key)) }),
3949
+ /* @__PURE__ */ e(ee.Panels, { unmount: !r, className: ye("mt-2", m), children: t.map((N) => /* @__PURE__ */ e(ee.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: N.content }) }, N.key)) })
3950
3950
  ] }) });
3951
3951
  };
3952
3952
  function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
@@ -3968,7 +3968,7 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
3968
3968
  }, [n.key, i, s]);
3969
3969
  const v = (a) => {
3970
3970
  if (!a.dependsOn) return !0;
3971
- const { field: k, value: d, operator: p = "equals" } = a.dependsOn, T = i[k];
3971
+ const { field: N, value: d, operator: p = "equals" } = a.dependsOn, T = i[N];
3972
3972
  switch (p) {
3973
3973
  case "equals":
3974
3974
  return T === d;
@@ -4003,7 +4003,7 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4003
4003
  }
4004
4004
  ),
4005
4005
  /* @__PURE__ */ e("p", { style: { fontSize: "14px", marginBottom: "10px" }, children: n.description }),
4006
- /* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: n.fields.map((a, k) => v(a) && /* @__PURE__ */ l("div", { style: { marginBottom: "10px" }, children: [
4006
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: n.fields.map((a, N) => v(a) && /* @__PURE__ */ l("div", { style: { marginBottom: "10px" }, children: [
4007
4007
  /* @__PURE__ */ l(
4008
4008
  "label",
4009
4009
  {
@@ -4241,7 +4241,7 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4241
4241
  ) }),
4242
4242
  a.fieldtype === "radio" && /* @__PURE__ */ l("div", { children: [
4243
4243
  /* @__PURE__ */ e(
4244
- Pa,
4244
+ Ba,
4245
4245
  {
4246
4246
  selectedValue: typeof i[a.key] < "u" ? i[a.key] : a.default || "",
4247
4247
  onValueChange: (d) => {
@@ -4424,7 +4424,7 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4424
4424
  children: a.info
4425
4425
  }
4426
4426
  )
4427
- ] }, k)) })
4427
+ ] }, N)) })
4428
4428
  ] }) });
4429
4429
  }
4430
4430
  const Tn = ({ children: t }) => /* @__PURE__ */ e("div", { className: "flex -space-x-2", children: t });
@@ -4435,10 +4435,10 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4435
4435
  const [v, a] = M(() => {
4436
4436
  const g = r && r[n.key] || [], h = g.length > 0 ? g : [{ id: 0 }];
4437
4437
  return console.log(`[DataTableRenderer] ${n.key} - Initial data:`, h), h;
4438
- }), k = ue(r);
4438
+ }), N = ue(r);
4439
4439
  Q(() => {
4440
- 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) {
4441
- k.current = r;
4440
+ if (console.log(`[DataTableRenderer] ${n.key} - Checking for initialData changes`), console.log(`[DataTableRenderer] ${n.key} - Previous:`, N.current), console.log(`[DataTableRenderer] ${n.key} - Current:`, r), N.current !== r) {
4441
+ N.current = r;
4442
4442
  const g = r && r[n.key] || [], h = g.length > 0 ? g : [{ id: 0 }];
4443
4443
  console.log(`[DataTableRenderer] ${n.key} - Setting new data:`, h), a(h);
4444
4444
  }
@@ -4453,12 +4453,12 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4453
4453
  }, []);
4454
4454
  const T = (g) => {
4455
4455
  const h = (c, b) => {
4456
- console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex: c, value: b, type: typeof b }), a((x) => {
4457
- const D = [...x];
4456
+ console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex: c, value: b, type: typeof b }), a((k) => {
4457
+ const D = [...k];
4458
4458
  return D[c][g.key] = b, D;
4459
4459
  });
4460
- }, N = (c) => o[n.key]?.[c]?.[g.key], w = (c) => {
4461
- const b = N(c);
4460
+ }, x = (c) => o[n.key]?.[c]?.[g.key], w = (c) => {
4461
+ const b = x(c);
4462
4462
  return b ? /* @__PURE__ */ e("div", { className: "text-red-500 text-xs mt-1", children: b }) : null;
4463
4463
  };
4464
4464
  switch (g.fieldtype) {
@@ -4468,10 +4468,10 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4468
4468
  Y,
4469
4469
  {
4470
4470
  value: c[g.key] || "",
4471
- onChange: (x) => h(b, x.target.value),
4471
+ onChange: (k) => h(b, k.target.value),
4472
4472
  placeholder: g.placeholder || `Enter ${g.label}`,
4473
4473
  required: g.required,
4474
- className: `w-full ${N(b) ? "border-red-500" : ""}`
4474
+ className: `w-full ${x(b) ? "border-red-500" : ""}`
4475
4475
  }
4476
4476
  ),
4477
4477
  w(b)
@@ -4482,10 +4482,10 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4482
4482
  Oa,
4483
4483
  {
4484
4484
  value: c[g.key] || "",
4485
- onChange: (x) => h(b, x.target.value),
4485
+ onChange: (k) => h(b, k.target.value),
4486
4486
  placeholder: g.placeholder || `Enter ${g.label}`,
4487
4487
  required: g.required,
4488
- className: `w-full ${N(b) ? "border-red-500" : ""}`,
4488
+ className: `w-full ${x(b) ? "border-red-500" : ""}`,
4489
4489
  rows: 3
4490
4490
  }
4491
4491
  ),
@@ -4498,10 +4498,10 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4498
4498
  {
4499
4499
  type: "number",
4500
4500
  value: c[g.key] || "",
4501
- onChange: (x) => h(b, x.target.value),
4501
+ onChange: (k) => h(b, k.target.value),
4502
4502
  placeholder: g.placeholder || `Enter ${g.label}`,
4503
4503
  required: g.required,
4504
- className: `w-full ${N(b) ? "border-red-500" : ""}`
4504
+ className: `w-full ${x(b) ? "border-red-500" : ""}`
4505
4505
  }
4506
4506
  ),
4507
4507
  w(b)
@@ -4513,10 +4513,10 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4513
4513
  {
4514
4514
  type: "email",
4515
4515
  value: c[g.key] || "",
4516
- onChange: (x) => h(b, x.target.value),
4516
+ onChange: (k) => h(b, k.target.value),
4517
4517
  placeholder: g.placeholder || "Enter email address",
4518
4518
  required: g.required,
4519
- className: `w-full ${N(b) ? "border-red-500" : ""}`
4519
+ className: `w-full ${x(b) ? "border-red-500" : ""}`
4520
4520
  }
4521
4521
  ),
4522
4522
  w(b)
@@ -4528,10 +4528,10 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4528
4528
  {
4529
4529
  type: "url",
4530
4530
  value: c[g.key] || "",
4531
- onChange: (x) => h(b, x.target.value),
4531
+ onChange: (k) => h(b, k.target.value),
4532
4532
  placeholder: g.placeholder || "Enter URL",
4533
4533
  required: g.required,
4534
- className: `w-full ${N(b) ? "border-red-500" : ""}`
4534
+ className: `w-full ${x(b) ? "border-red-500" : ""}`
4535
4535
  }
4536
4536
  ),
4537
4537
  w(b)
@@ -4543,10 +4543,10 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4543
4543
  {
4544
4544
  type: "password",
4545
4545
  value: c[g.key] || "",
4546
- onChange: (x) => h(b, x.target.value),
4546
+ onChange: (k) => h(b, k.target.value),
4547
4547
  placeholder: g.placeholder || "Enter password",
4548
4548
  required: g.required,
4549
- className: `w-full ${N(b) ? "border-red-500" : ""}`
4549
+ className: `w-full ${x(b) ? "border-red-500" : ""}`
4550
4550
  }
4551
4551
  ),
4552
4552
  w(b)
@@ -4558,18 +4558,18 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4558
4558
  He,
4559
4559
  {
4560
4560
  value: c[g.key] || "",
4561
- onChange: (x) => h(b, x),
4561
+ onChange: (k) => h(b, k),
4562
4562
  options: g.options || [],
4563
4563
  placeholder: g.placeholder || `Select ${g.label}`,
4564
4564
  required: g.required,
4565
- className: `w-full ${N(b) ? "border-red-500" : ""}`
4565
+ className: `w-full ${x(b) ? "border-red-500" : ""}`
4566
4566
  }
4567
4567
  ),
4568
4568
  w(b)
4569
4569
  ] });
4570
4570
  case "selectDynamic":
4571
4571
  return (c, b) => {
4572
- const x = () => {
4572
+ const k = () => {
4573
4573
  if (g.optionsFrom && r) {
4574
4574
  const { config: D, valueField: q, labelField: G } = g.optionsFrom, $ = r[D] || [];
4575
4575
  if (Array.isArray($))
@@ -4588,10 +4588,10 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4588
4588
  index: b,
4589
4589
  value: c[g.key] || "",
4590
4590
  onChange: (D) => h(b, D),
4591
- options: x(),
4591
+ options: k(),
4592
4592
  placeholder: g.placeholder || `Select ${g.label}`,
4593
4593
  required: g.required,
4594
- className: `w-full ${N(b) ? "border-red-500" : ""}`
4594
+ className: `w-full ${x(b) ? "border-red-500" : ""}`
4595
4595
  },
4596
4596
  Math.random()
4597
4597
  ),
@@ -4600,11 +4600,11 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4600
4600
  };
4601
4601
  case "multiselect":
4602
4602
  return (c, b) => {
4603
- const x = c[g.key] || [];
4603
+ const k = c[g.key] || [];
4604
4604
  return /* @__PURE__ */ e(
4605
4605
  qe,
4606
4606
  {
4607
- selectedItems: x,
4607
+ selectedItems: k,
4608
4608
  onSelectionChange: (D) => h(b, D),
4609
4609
  options: g.options || [],
4610
4610
  placeholder: g.placeholder || `Select ${g.label}`,
@@ -4618,7 +4618,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4618
4618
  Aa,
4619
4619
  {
4620
4620
  checked: !!c[g.key],
4621
- onChange: (x) => h(b, x),
4621
+ onChange: (k) => h(b, k),
4622
4622
  label: g.placeholder || g.label,
4623
4623
  className: "w-full"
4624
4624
  }
@@ -4629,7 +4629,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4629
4629
  Ma,
4630
4630
  {
4631
4631
  isOn: !!c[g.key],
4632
- onToggle: (x) => h(b, x),
4632
+ onToggle: (k) => h(b, k),
4633
4633
  label: g.placeholder || g.label,
4634
4634
  className: "w-full"
4635
4635
  }
@@ -4639,7 +4639,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4639
4639
  za,
4640
4640
  {
4641
4641
  selectedDate: c[g.key] ? new Date(c[g.key]) : null,
4642
- onDateChange: (x) => h(b, x ? x.toISOString().split("T")[0] : ""),
4642
+ onDateChange: (k) => h(b, k ? k.toISOString().split("T")[0] : ""),
4643
4643
  placeholder: g.placeholder || "Select date",
4644
4644
  className: "w-full"
4645
4645
  }
@@ -4650,7 +4650,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4650
4650
  {
4651
4651
  type: "datetime-local",
4652
4652
  value: c[g.key] || "",
4653
- onChange: (x) => h(b, x.target.value),
4653
+ onChange: (k) => h(b, k.target.value),
4654
4654
  placeholder: g.placeholder || "Select date and time",
4655
4655
  required: g.required,
4656
4656
  className: "w-full"
@@ -4662,7 +4662,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4662
4662
  {
4663
4663
  type: "time",
4664
4664
  value: c[g.key] || "",
4665
- onChange: (x) => h(b, x.target.value),
4665
+ onChange: (k) => h(b, k.target.value),
4666
4666
  placeholder: g.placeholder || "Select time",
4667
4667
  required: g.required,
4668
4668
  className: "w-full"
@@ -4670,10 +4670,10 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4670
4670
  );
4671
4671
  case "radio":
4672
4672
  return (c, b) => /* @__PURE__ */ e(
4673
- Pa,
4673
+ Ba,
4674
4674
  {
4675
4675
  selectedValue: c[g.key] || "",
4676
- onValueChange: (x) => h(b, x),
4676
+ onValueChange: (k) => h(b, k),
4677
4677
  options: g.options || [],
4678
4678
  className: "w-full"
4679
4679
  }
@@ -4683,17 +4683,17 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4683
4683
  he,
4684
4684
  {
4685
4685
  value: c[g.key] || "",
4686
- onChange: (x) => h(b, x),
4686
+ onChange: (k) => h(b, k),
4687
4687
  placeholder: g.placeholder || `Search ${g.label}`,
4688
4688
  className: "w-full"
4689
4689
  }
4690
4690
  );
4691
4691
  case "audience":
4692
4692
  return (c, b) => {
4693
- const x = c[g.key] || { users: [], groups: [], roles: [] }, D = [
4694
- ...x.users || [],
4695
- ...x.groups || [],
4696
- ...x.roles || []
4693
+ const k = c[g.key] || { users: [], groups: [], roles: [] }, D = [
4694
+ ...k.users || [],
4695
+ ...k.groups || [],
4696
+ ...k.roles || []
4697
4697
  ];
4698
4698
  return /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
4699
4699
  /* @__PURE__ */ e(Tn, { children: D.length > 0 ? D.slice(0, 3).map((q, G) => /* @__PURE__ */ e(
@@ -4723,7 +4723,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4723
4723
  {
4724
4724
  type: "color",
4725
4725
  value: c[g.key] || "#000000",
4726
- onChange: (x) => h(b, x.target.value),
4726
+ onChange: (k) => h(b, k.target.value),
4727
4727
  className: "w-full h-10"
4728
4728
  }
4729
4729
  );
@@ -4734,7 +4734,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4734
4734
  {
4735
4735
  type: "range",
4736
4736
  value: c[g.key] || g.min || 0,
4737
- onChange: (x) => h(b, x.target.value),
4737
+ onChange: (k) => h(b, k.target.value),
4738
4738
  min: g.min || 0,
4739
4739
  max: g.max || 100,
4740
4740
  step: g.step || 1,
@@ -4748,8 +4748,8 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4748
4748
  Y,
4749
4749
  {
4750
4750
  type: "file",
4751
- onChange: (x) => {
4752
- const D = x.target.files[0];
4751
+ onChange: (k) => {
4752
+ const D = k.target.files[0];
4753
4753
  h(b, D ? D.name : "");
4754
4754
  },
4755
4755
  accept: g.accept,
@@ -4762,7 +4762,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4762
4762
  {
4763
4763
  type: "hidden",
4764
4764
  value: c[g.key] || "",
4765
- onChange: (x) => h(b, x.target.value)
4765
+ onChange: (k) => h(b, k.target.value)
4766
4766
  }
4767
4767
  );
4768
4768
  // Default fallback for unknown field types
@@ -4772,10 +4772,10 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4772
4772
  Y,
4773
4773
  {
4774
4774
  value: c[g.key] || "",
4775
- onChange: (x) => h(b, x.target.value),
4775
+ onChange: (k) => h(b, k.target.value),
4776
4776
  placeholder: g.placeholder || `Enter ${g.label}`,
4777
4777
  required: g.required,
4778
- className: `w-full ${N(b) ? "border-red-500" : ""}`
4778
+ className: `w-full ${x(b) ? "border-red-500" : ""}`
4779
4779
  }
4780
4780
  ),
4781
4781
  w(b)
@@ -4791,39 +4791,39 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4791
4791
  n.fields.forEach((w) => {
4792
4792
  w.fieldtype === "audience" ? h[w.key] = { users: [], groups: [], roles: [] } : h[w.key] = w.default || "";
4793
4793
  }), console.log("[DataTableRenderer] New blank row:", h);
4794
- const N = [...g, h];
4795
- return console.log("[DataTableRenderer] Updated data:", N), N;
4794
+ const x = [...g, h];
4795
+ return console.log("[DataTableRenderer] Updated data:", x), x;
4796
4796
  });
4797
4797
  }, [n.fields]), R = ae((g) => {
4798
4798
  a((h) => {
4799
4799
  if (h.length <= 1)
4800
4800
  return h;
4801
- const N = [...h];
4802
- return N.splice(g, 1), N;
4801
+ const x = [...h];
4802
+ return x.splice(g, 1), x;
4803
4803
  });
4804
- }, []), [S, A] = M(null), P = ae((g, h) => {
4804
+ }, []), [S, A] = M(null), B = ae((g, h) => {
4805
4805
  A(h), g.dataTransfer.effectAllowed = "move", g.dataTransfer.setData("text/html", "");
4806
4806
  }, []), I = ae((g) => {
4807
4807
  g.preventDefault(), g.dataTransfer.dropEffect = "move";
4808
4808
  }, []), V = ae((g, h) => {
4809
- g.preventDefault(), !(S === null || S === h) && (a((N) => {
4810
- const w = [...N], c = w[S];
4809
+ g.preventDefault(), !(S === null || S === h) && (a((x) => {
4810
+ const w = [...x], c = w[S];
4811
4811
  return w.splice(S, 1), w.splice(h, 0, c), w;
4812
4812
  }), A(null));
4813
4813
  }, [S]), z = ae(() => {
4814
4814
  A(null);
4815
- }, []), B = ae((g) => {
4815
+ }, []), P = ae((g) => {
4816
4816
  console.log("[DataTableRenderer] handleAddAudience called with:", g), a((h) => {
4817
- const N = [...h];
4818
- if (i !== null && y && N[i]) {
4819
- const w = g.pendingInvites || [], c = w.filter((D) => D.type === "User"), b = w.filter((D) => D.type === "Group"), x = w.filter((D) => D.type === "Role");
4820
- N[i][y] = {
4821
- users: [...N[i][y]?.users || [], ...c],
4822
- groups: [...N[i][y]?.groups || [], ...b],
4823
- roles: [...N[i][y]?.roles || [], ...x]
4824
- }, console.log("[DataTableRenderer] Updated audience data:", N[i][y]);
4817
+ const x = [...h];
4818
+ if (i !== null && y && x[i]) {
4819
+ const w = g.pendingInvites || [], c = w.filter((D) => D.type === "User"), b = w.filter((D) => D.type === "Group"), k = w.filter((D) => D.type === "Role");
4820
+ x[i][y] = {
4821
+ users: [...x[i][y]?.users || [], ...c],
4822
+ groups: [...x[i][y]?.groups || [], ...b],
4823
+ roles: [...x[i][y]?.roles || [], ...k]
4824
+ }, console.log("[DataTableRenderer] Updated audience data:", x[i][y]);
4825
4825
  }
4826
- return N;
4826
+ return x;
4827
4827
  }), u(null), f(null);
4828
4828
  }, [i, y]);
4829
4829
  return /* @__PURE__ */ l("div", { children: [
@@ -4859,13 +4859,13 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4859
4859
  {
4860
4860
  className: `hover:bg-gray-50 ${S === h ? "opacity-50" : ""}`,
4861
4861
  draggable: !0,
4862
- onDragStart: (N) => P(N, h),
4862
+ onDragStart: (x) => B(x, h),
4863
4863
  onDragOver: I,
4864
- onDrop: (N) => V(N, h),
4864
+ onDrop: (x) => V(x, h),
4865
4865
  onDragEnd: z,
4866
4866
  children: [
4867
4867
  /* @__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(ea, { size: 16 }) }) }),
4868
- n.fields.map((N, w) => /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: T(N)(g, h) }, w)),
4868
+ n.fields.map((x, w) => /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: T(x)(g, h) }, w)),
4869
4869
  /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ e(
4870
4870
  "button",
4871
4871
  {
@@ -4893,7 +4893,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4893
4893
  onClose: () => {
4894
4894
  u(null), f(null);
4895
4895
  },
4896
- onFinalSubmit: B,
4896
+ onFinalSubmit: P,
4897
4897
  existingShares: g,
4898
4898
  allowedPermissions: ["view", "remove"]
4899
4899
  }
@@ -4901,7 +4901,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4901
4901
  })()
4902
4902
  ] });
4903
4903
  }
4904
- const Ce = {
4904
+ const Se = {
4905
4905
  containerId: "ui-toast",
4906
4906
  position: "bottom-right",
4907
4907
  autoClose: 3500,
@@ -4914,13 +4914,13 @@ const ma = () => {
4914
4914
  typeof document > "u" || (ze += 1, document.body.classList.add("toast-backdrop"));
4915
4915
  }, ha = () => {
4916
4916
  typeof document > "u" || (ze = Math.max(0, ze - 1), ze === 0 && document.body.classList.remove("toast-backdrop"));
4917
- }, De = {
4918
- success: (t, r) => le.success(t, { ...Ce, ...r }),
4919
- info: (t, r) => le.info(t, { ...Ce, ...r }),
4920
- warn: (t, r) => le.warn(t, { ...Ce, ...r }),
4917
+ }, ve = {
4918
+ success: (t, r) => le.success(t, { ...Se, ...r }),
4919
+ info: (t, r) => le.info(t, { ...Se, ...r }),
4920
+ warn: (t, r) => le.warn(t, { ...Se, ...r }),
4921
4921
  // Error: no autoClose + modal-like behavior via backdrop
4922
4922
  error: (t, r) => le.error(t, {
4923
- ...Ce,
4923
+ ...Se,
4924
4924
  autoClose: !1,
4925
4925
  closeOnClick: !1,
4926
4926
  draggable: !1,
@@ -4943,7 +4943,7 @@ const ma = () => {
4943
4943
  onClose: ha
4944
4944
  }
4945
4945
  },
4946
- { ...Ce, ...s }
4946
+ { ...Se, ...s }
4947
4947
  )
4948
4948
  }, Ee = (t) => {
4949
4949
  try {
@@ -4968,7 +4968,7 @@ const ma = () => {
4968
4968
  initialData: y = null
4969
4969
  // Add prop for initial demo data
4970
4970
  }) => {
4971
- const [f, v] = M(null), [a, k] = M(""), [d, p] = M(() => Array.isArray(y) ? y : []), [T, L] = M(null), [R, S] = M(null), [A, P] = M(""), I = async () => {
4971
+ const [f, v] = M(null), [a, N] = M(""), [d, p] = M(() => Array.isArray(y) ? y : []), [T, L] = M(null), [R, S] = M(null), [A, B] = M(""), I = async () => {
4972
4972
  try {
4973
4973
  const $ = await Fe(t.collectionList);
4974
4974
  if ($) {
@@ -4988,7 +4988,7 @@ const ma = () => {
4988
4988
  Array.isArray(y) && p(y);
4989
4989
  }, [y]);
4990
4990
  const V = ($) => {
4991
- m && (v($.id), k($.categoryName || ""));
4991
+ m && (v($.id), N($.categoryName || ""));
4992
4992
  }, z = () => {
4993
4993
  if (!n || f !== null) return;
4994
4994
  const $ = `temp-${Date.now()}`;
@@ -5001,12 +5001,12 @@ const ma = () => {
5001
5001
  order: (O.at(-1)?.order ?? 0) + 1,
5002
5002
  _temp: !0
5003
5003
  }
5004
- ]), v($), k("");
5005
- }, B = () => {
5004
+ ]), v($), N("");
5005
+ }, P = () => {
5006
5006
  f != null && (p(($) => {
5007
5007
  const O = $.find((F) => F.id === f), U = O && O._temp ? $.filter((F) => F.id !== f) : $;
5008
5008
  return s?.(U), U;
5009
- }), v(null), k(""));
5009
+ }), v(null), N(""));
5010
5010
  }, g = async () => {
5011
5011
  if (f == null || !a.trim()) return;
5012
5012
  const $ = typeof f == "string" && f.startsWith("temp-");
@@ -5019,7 +5019,7 @@ const ma = () => {
5019
5019
  O && (p((U) => {
5020
5020
  const F = U.map((C) => C.id === f ? O : C);
5021
5021
  return s?.(F), F;
5022
- }), De.success("Collection created successfully"));
5022
+ }), ve.success("Collection created successfully"));
5023
5023
  } else {
5024
5024
  const O = await ln(
5025
5025
  `${t.collectionUpdate}/${f}?newName=${a.trim()}`
@@ -5031,7 +5031,7 @@ const ma = () => {
5031
5031
  return s?.(F), F;
5032
5032
  }), le.success("Collection updated successfully");
5033
5033
  }
5034
- v(null), k("");
5034
+ v(null), N("");
5035
5035
  } catch (O) {
5036
5036
  console.log(O), le.error("Failed to save collection");
5037
5037
  }
@@ -5042,7 +5042,7 @@ const ma = () => {
5042
5042
  } catch (O) {
5043
5043
  console.log(O), le.error("Failed to delete collection");
5044
5044
  }
5045
- }, N = ($, O, U) => {
5045
+ }, x = ($, O, U) => {
5046
5046
  if (!u || !O || !U || O === U) return $;
5047
5047
  const F = $.findIndex((H) => H.id === O), C = $.findIndex((H) => H.id === U);
5048
5048
  if (F === -1 || C === -1) return $;
@@ -5063,13 +5063,13 @@ const ma = () => {
5063
5063
  u && ($.dataTransfer.effectAllowed = "move", $.dataTransfer.setData("text/plain", String(O)), L(O));
5064
5064
  }, b = ($) => {
5065
5065
  T && $ !== R && S($);
5066
- }, x = ($) => {
5066
+ }, k = ($) => {
5067
5067
  $.preventDefault();
5068
5068
  }, D = async ($, O) => {
5069
5069
  $.preventDefault();
5070
5070
  const U = $.dataTransfer.getData("text/plain");
5071
5071
  U && (p((F) => {
5072
- const C = N(F, U, O);
5072
+ const C = x(F, U, O);
5073
5073
  return console.log("Reordered", C), w(C), s?.(C), C;
5074
5074
  }), L(null), S(null));
5075
5075
  }, q = () => {
@@ -5083,7 +5083,7 @@ const ma = () => {
5083
5083
  he,
5084
5084
  {
5085
5085
  value: A,
5086
- onDebouncedChange: P,
5086
+ onDebouncedChange: B,
5087
5087
  placeholder: "Search Collection",
5088
5088
  customClass: "mr-4 searchmanagecollection"
5089
5089
  }
@@ -5107,7 +5107,7 @@ const ma = () => {
5107
5107
  "div",
5108
5108
  {
5109
5109
  onDragEnter: () => b($.id),
5110
- onDragOver: x,
5110
+ onDragOver: k,
5111
5111
  onDrop: (E) => D(E, $.id),
5112
5112
  onDragEnd: q,
5113
5113
  className: [
@@ -5124,9 +5124,9 @@ const ma = () => {
5124
5124
  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",
5125
5125
  value: a,
5126
5126
  placeholder: $._temp ? "New collection name" : "Edit collection name",
5127
- onChange: (E) => k(E.target.value),
5127
+ onChange: (E) => N(E.target.value),
5128
5128
  onKeyDown: (E) => {
5129
- E.key === "Enter" && g(), E.key === "Escape" && B();
5129
+ E.key === "Enter" && g(), E.key === "Escape" && P();
5130
5130
  },
5131
5131
  autoFocus: !0
5132
5132
  }
@@ -5136,7 +5136,7 @@ const ma = () => {
5136
5136
  "button",
5137
5137
  {
5138
5138
  className: "cursor-pointer border border-gray-300 p-2 rounded-2xl",
5139
- onClick: B,
5139
+ onClick: P,
5140
5140
  "aria-label": "Cancel edit",
5141
5141
  children: /* @__PURE__ */ e(ge, { color: "#767676" })
5142
5142
  }
@@ -5188,7 +5188,7 @@ const ma = () => {
5188
5188
  className: U === 0 && !$.protected ? "cursor-pointer" : "cursor-not-allowed",
5189
5189
  title: U === 0 && !$.protected ? "Delete" : "Cannot delete this collection",
5190
5190
  onClick: U === 0 ? () => h($) : null,
5191
- children: /* @__PURE__ */ e(Be, { color: U === 0 ? "#767676" : "#C2C2C2" })
5191
+ children: /* @__PURE__ */ e(Pe, { color: U === 0 ? "#767676" : "#C2C2C2" })
5192
5192
  }
5193
5193
  )
5194
5194
  ] })
@@ -5209,7 +5209,7 @@ const ma = () => {
5209
5209
  allowEdit: f = !0,
5210
5210
  allowDelete: v = !0,
5211
5211
  allowReorder: a = !0,
5212
- className: k = ""
5212
+ className: N = ""
5213
5213
  } = t, d = r?.[t.key] || i || [], p = Array.isArray(d) ? d : [];
5214
5214
  return /* @__PURE__ */ l("div", { className: "dynamic-config-manage-collection-list", children: [
5215
5215
  (o || n) && /* @__PURE__ */ l("div", { className: "mb-4", children: [
@@ -5221,7 +5221,7 @@ const ma = () => {
5221
5221
  {
5222
5222
  endpoints: m,
5223
5223
  initialData: p,
5224
- className: k,
5224
+ className: N,
5225
5225
  onCollectionChange: (L) => {
5226
5226
  s && s(t.key, L);
5227
5227
  },
@@ -5237,31 +5237,31 @@ const ma = () => {
5237
5237
  "Unknown type:",
5238
5238
  " ",
5239
5239
  /* @__PURE__ */ e("span", { className: "font-mono", children: String(t?.type ?? "N/A") })
5240
- ] }), xe = /* @__PURE__ */ Object.create(null);
5241
- xe.section = $n;
5242
- xe.datatable = An;
5243
- xe.managecollectionlist = Xa;
5244
- xe["manage-collection-list"] = Xa;
5240
+ ] }), Ne = /* @__PURE__ */ Object.create(null);
5241
+ Ne.section = $n;
5242
+ Ne.datatable = An;
5243
+ Ne.managecollectionlist = Xa;
5244
+ Ne["manage-collection-list"] = Xa;
5245
5245
  function In(t) {
5246
5246
  return typeof t == "string" ? t.trim() : t && typeof t == "object" ? String(t.type || "").trim() : "";
5247
5247
  }
5248
5248
  function zn(t) {
5249
5249
  const r = In(t);
5250
- return xe[r] || xe[r.toLowerCase?.()] || Rn;
5250
+ return Ne[r] || Ne[r.toLowerCase?.()] || Rn;
5251
5251
  }
5252
- function Pn({
5252
+ function Bn({
5253
5253
  appid: t,
5254
5254
  configdata: r = null,
5255
5255
  disableApi: s = !1,
5256
5256
  onCancel: o
5257
5257
  }) {
5258
- const [n, m] = re.useState(r), [i, u] = re.useState(null), [y, f] = M(!1), [v, a] = M(!1), [k, d] = M({}), p = `${be()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, T = p, [L, R] = M(1), S = (h) => {
5258
+ const [n, m] = re.useState(r), [i, u] = re.useState(null), [y, f] = M(!1), [v, a] = M(!1), [N, d] = M({}), p = `${be()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, T = p, [L, R] = M(1), S = (h) => {
5259
5259
  if (!r || !r.configuration)
5260
5260
  return h;
5261
- const N = {}, w = h?.configuration || {};
5261
+ const x = {}, w = h?.configuration || {};
5262
5262
  return r.configuration.forEach((c) => {
5263
5263
  if (c.key && c.type === "datatable" && c.key === "newsFeeds") {
5264
- const x = (w.newsFeeds || []).map((D, q) => {
5264
+ const k = (w.newsFeeds || []).map((D, q) => {
5265
5265
  let G = { users: [], groups: [], roles: [] };
5266
5266
  return D.audience && (Array.isArray(D.audience) ? G = { users: [], groups: [], roles: [] } : typeof D.audience == "object" && (G = {
5267
5267
  users: D.audience.users || [],
@@ -5275,32 +5275,32 @@ function Pn({
5275
5275
  audience: G
5276
5276
  };
5277
5277
  });
5278
- if (x.length === 0) {
5278
+ if (k.length === 0) {
5279
5279
  const D = { id: 0 };
5280
5280
  c.fields && c.fields.forEach((q) => {
5281
5281
  q.fieldtype === "audience" ? D[q.key] = { users: [], groups: [], roles: [] } : D[q.key] = q.default || "";
5282
- }), x.push(D);
5282
+ }), k.push(D);
5283
5283
  }
5284
- N[c.key] = x;
5285
- } else c.key && (N[c.key] = w[c.key] || {});
5286
- }), N;
5284
+ x[c.key] = k;
5285
+ } else c.key && (x[c.key] = w[c.key] || {});
5286
+ }), x;
5287
5287
  }, A = () => {
5288
5288
  if (r && r.configuration) {
5289
5289
  const h = {};
5290
- r.configuration.forEach((N) => {
5291
- if (N.key)
5292
- if (N.type === "datatable") {
5290
+ r.configuration.forEach((x) => {
5291
+ if (x.key)
5292
+ if (x.type === "datatable") {
5293
5293
  const w = { id: 0 };
5294
- N.fields && N.fields.forEach((c) => {
5294
+ x.fields && x.fields.forEach((c) => {
5295
5295
  c.fieldtype === "audience" ? w[c.key] = { users: [], groups: [], roles: [] } : w[c.key] = c.default || "";
5296
- }), h[N.key] = [w];
5297
- } else if (N.type === "section") {
5296
+ }), h[x.key] = [w];
5297
+ } else if (x.type === "section") {
5298
5298
  const w = {};
5299
- N.fields && Array.isArray(N.fields) && N.fields.forEach((c) => {
5299
+ x.fields && Array.isArray(x.fields) && x.fields.forEach((c) => {
5300
5300
  c.key && (w[c.key] = c.default || "");
5301
- }), h[N.key] = w;
5301
+ }), h[x.key] = w;
5302
5302
  } else
5303
- h[N.key] = {};
5303
+ h[x.key] = {};
5304
5304
  }), u(h);
5305
5305
  }
5306
5306
  };
@@ -5312,51 +5312,51 @@ function Pn({
5312
5312
  const h = async () => {
5313
5313
  try {
5314
5314
  f(!0);
5315
- let N = await Fe(p);
5316
- if (N) {
5317
- const w = S(N);
5315
+ let x = await Fe(p);
5316
+ if (x) {
5317
+ const w = S(x);
5318
5318
  u(w);
5319
5319
  } else
5320
5320
  A();
5321
- } catch (N) {
5322
- console.error("Error fetching configuration:", N);
5321
+ } catch (x) {
5322
+ console.error("Error fetching configuration:", x);
5323
5323
  let w = "Failed to load configuration";
5324
- if (N.response) {
5325
- const c = N.response.status, b = N.response.data?.message || N.response.data?.error;
5324
+ if (x.response) {
5325
+ const c = x.response.status, b = x.response.data?.message || x.response.data?.error;
5326
5326
  c === 400 ? w = b || "Invalid request. Please check the application ID." : c === 401 ? w = "You are not authorized to access this configuration." : c === 403 ? w = "Access denied. You don't have permission to view this configuration." : c === 404 ? w = "Configuration not found. It may not exist yet or the application ID is incorrect." : c >= 500 ? w = b || "Server error. Please try again later." : w = b || `Failed to load configuration (Error ${c})`;
5327
- } else N.request ? w = "Network error. Please check your connection and try again." : w = N.message || "An unexpected error occurred while loading configuration.";
5328
- De.error(w), A();
5327
+ } else x.request ? w = "Network error. Please check your connection and try again." : w = x.message || "An unexpected error occurred while loading configuration.";
5328
+ ve.error(w), A();
5329
5329
  } finally {
5330
5330
  f(!1);
5331
5331
  }
5332
5332
  };
5333
5333
  r && (m(r), t ? h() : A());
5334
5334
  }, [r, L, t, s]);
5335
- const P = (h, N) => {
5335
+ const B = (h, x) => {
5336
5336
  u((w) => ({
5337
5337
  ...w,
5338
- [h]: N
5338
+ [h]: x
5339
5339
  })), d((w) => {
5340
5340
  const c = { ...w };
5341
5341
  return c[h] && delete c[h], c;
5342
5342
  });
5343
5343
  }, I = () => {
5344
5344
  const h = {};
5345
- return !n || !i || n.configuration.forEach((N) => {
5346
- if (N.type === "section")
5347
- N.fields.forEach((w) => {
5345
+ return !n || !i || n.configuration.forEach((x) => {
5346
+ if (x.type === "section")
5347
+ x.fields.forEach((w) => {
5348
5348
  if (w.required) {
5349
- const c = i[N.key]?.[w.key];
5350
- (!c || typeof c == "string" && c.trim() === "") && (h[N.key] || (h[N.key] = {}), h[N.key][w.key] = `${w.label} is required`);
5349
+ const c = i[x.key]?.[w.key];
5350
+ (!c || typeof c == "string" && c.trim() === "") && (h[x.key] || (h[x.key] = {}), h[x.key][w.key] = `${w.label} is required`);
5351
5351
  }
5352
5352
  });
5353
- else if (N.type === "datatable") {
5354
- const w = i[N.key];
5353
+ else if (x.type === "datatable") {
5354
+ const w = i[x.key];
5355
5355
  Array.isArray(w) && w.forEach((c, b) => {
5356
- N.fields.forEach((x) => {
5357
- if (x.required) {
5358
- const D = c[x.key];
5359
- (!D || typeof D == "string" && D.trim() === "") && (h[N.key] || (h[N.key] = {}), h[N.key][b] || (h[N.key][b] = {}), h[N.key][b][x.key] = `${x.label} is required`);
5356
+ x.fields.forEach((k) => {
5357
+ if (k.required) {
5358
+ const D = c[k.key];
5359
+ (!D || typeof D == "string" && D.trim() === "") && (h[x.key] || (h[x.key] = {}), h[x.key][b] || (h[x.key][b] = {}), h[x.key][b][k.key] = `${k.label} is required`);
5360
5360
  }
5361
5361
  });
5362
5362
  });
@@ -5368,8 +5368,8 @@ function Pn({
5368
5368
  let w = [];
5369
5369
  Object.keys(h).forEach((c) => {
5370
5370
  typeof h[c] == "object" && Object.keys(h[c]).forEach((b) => {
5371
- typeof h[c][b] == "object" ? Object.keys(h[c][b]).forEach((x) => {
5372
- w.push(`${c} row ${parseInt(b) + 1}: ${h[c][b][x]}`);
5371
+ typeof h[c][b] == "object" ? Object.keys(h[c][b]).forEach((k) => {
5372
+ w.push(`${c} row ${parseInt(b) + 1}: ${h[c][b][k]}`);
5373
5373
  }) : w.push(`${c}: ${h[c][b]}`);
5374
5374
  });
5375
5375
  });
@@ -5380,47 +5380,42 @@ function Pn({
5380
5380
  a(!0);
5381
5381
  const w = {};
5382
5382
  i && Object.keys(i).forEach((b) => {
5383
- b === "newsFeeds" && Array.isArray(i[b]) ? w[b] = i[b].map((x) => {
5383
+ b === "newsFeeds" && Array.isArray(i[b]) ? w[b] = i[b].map((k) => {
5384
5384
  let D = { users: [], groups: [], roles: [] };
5385
- return x.audience && typeof x.audience == "object" && !Array.isArray(x.audience) && (D = {
5386
- users: x.audience.users || [],
5387
- groups: x.audience.groups || [],
5388
- roles: x.audience.roles || []
5385
+ return k.audience && typeof k.audience == "object" && !Array.isArray(k.audience) && (D = {
5386
+ users: k.audience.users || [],
5387
+ groups: k.audience.groups || [],
5388
+ roles: k.audience.roles || []
5389
5389
  }), {
5390
- id: x.id || 0,
5391
- category: x.category || "",
5392
- url: x.url || "",
5390
+ id: k.id || 0,
5391
+ category: k.category || "",
5392
+ url: k.url || "",
5393
5393
  // Keep as 'url' to match API and config
5394
5394
  audience: D
5395
5395
  };
5396
5396
  }) : w[b] = i[b];
5397
5397
  });
5398
5398
  let c = await $e(T, w);
5399
- if (c && c.data?.status != "fail") {
5399
+ if (console.log(), c && c.status != "fail") {
5400
5400
  d({});
5401
5401
  const b = c.message || "Configuration has been saved successfully";
5402
- De.success(b);
5402
+ ve.success(b);
5403
5403
  } else
5404
- throw new Error("No response received from server");
5404
+ throw ve.error(c?.message || "Failed to save configuration"), new Error("No response received from server");
5405
5405
  } catch (w) {
5406
- let c = "Failed to save configuration";
5407
- if (w.response) {
5408
- const b = w.response.status, x = w.response.data?.message || w.response.data?.error;
5409
- b === 400 ? c = x || "Invalid configuration data. Please check your inputs." : b === 401 ? c = "You are not authorized to save this configuration." : b === 403 ? c = "Access denied. You don't have permission to save this configuration." : b === 404 ? c = "Configuration endpoint not found. Please contact support." : b >= 500 ? c = x || "Server error. Please try again later." : c = x || `Failed to save configuration (Error ${b})`;
5410
- } else w.request ? c = "Network error. Please check your connection and try again." : c = w.message || "An unexpected error occurred while saving.";
5411
- De.error(c);
5406
+ console.error("Error saving configuration:", w), ve.error(w?.message || "Failed to save configuration");
5412
5407
  } finally {
5413
5408
  a(!1);
5414
5409
  }
5415
5410
  })();
5416
- }, B = () => {
5411
+ }, P = () => {
5417
5412
  if (o) {
5418
5413
  o();
5419
5414
  return;
5420
5415
  }
5421
- k && Object.keys(k).length > 0 && !window.confirm(
5416
+ N && Object.keys(N).length > 0 && !window.confirm(
5422
5417
  "You have validation errors that will be lost. Are you sure you want to cancel?"
5423
- ) || (d({}), u(null), R((N) => N + 1), De.info("Configuration changes cancelled"));
5418
+ ) || (d({}), u(null), R((x) => x + 1), ve.info("Configuration changes cancelled"));
5424
5419
  };
5425
5420
  if (!n?.configuration && !r?.configuration)
5426
5421
  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" }) });
@@ -5435,7 +5430,7 @@ function Pn({
5435
5430
  style: { padding: "0px 20px 0px 0px" },
5436
5431
  children: [
5437
5432
  y && /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-64", children: /* @__PURE__ */ e(La, { size: "large" }) }),
5438
- !y && g?.map((h, N) => {
5433
+ !y && g?.map((h, x) => {
5439
5434
  const w = zn(h.type);
5440
5435
  if (w && w !== "UnknownType")
5441
5436
  return /* @__PURE__ */ e(
@@ -5443,10 +5438,10 @@ function Pn({
5443
5438
  {
5444
5439
  item: h,
5445
5440
  data: i,
5446
- updateHandler: P,
5447
- validationErrors: k
5441
+ updateHandler: B,
5442
+ validationErrors: N
5448
5443
  },
5449
- N
5444
+ x
5450
5445
  );
5451
5446
  })
5452
5447
  ]
@@ -5457,7 +5452,7 @@ function Pn({
5457
5452
  Z,
5458
5453
  {
5459
5454
  category: "secondary",
5460
- onClick: B,
5455
+ onClick: P,
5461
5456
  label: "Cancel",
5462
5457
  disabled: v
5463
5458
  }
@@ -5486,21 +5481,21 @@ const is = ({
5486
5481
  breadcrumb: f = [],
5487
5482
  overview: v = {},
5488
5483
  configuration: a = []
5489
- } = t, k = a.map((z) => {
5484
+ } = t, N = a.map((z) => {
5490
5485
  if (z.type === "section" && z.fields) {
5491
- const B = [...z.fields], g = B.findIndex((h) => h.key === "appkey");
5486
+ const P = [...z.fields], g = P.findIndex((h) => h.key === "appkey");
5492
5487
  if (g !== -1) {
5493
- const h = B[g];
5494
- if (B[g] = {
5488
+ const h = P[g];
5489
+ if (P[g] = {
5495
5490
  ...h,
5496
5491
  default: r,
5497
5492
  value: r,
5498
5493
  disabled: !0,
5499
5494
  placeholder: r
5500
- }, B.some((w) => w.key === "displayname")) {
5501
- const w = B.findIndex((c) => c.key === "displayname");
5502
- B[w] = {
5503
- ...B[w],
5495
+ }, P.some((w) => w.key === "displayname")) {
5496
+ const w = P.findIndex((c) => c.key === "displayname");
5497
+ P[w] = {
5498
+ ...P[w],
5504
5499
  default: r,
5505
5500
  value: r
5506
5501
  };
@@ -5514,12 +5509,12 @@ const is = ({
5514
5509
  placeholder: "Enter display name",
5515
5510
  required: !1
5516
5511
  };
5517
- B.splice(g + 1, 0, w);
5512
+ P.splice(g + 1, 0, w);
5518
5513
  }
5519
5514
  }
5520
5515
  return {
5521
5516
  ...z,
5522
- fields: B
5517
+ fields: P
5523
5518
  };
5524
5519
  }
5525
5520
  return z;
@@ -5538,11 +5533,11 @@ const is = ({
5538
5533
  i(!1), z.primary ? (console.log("User confirmed cancel - navigating back"), window.history.back()) : console.log("User cancelled the cancel action - modal closed, data preserved");
5539
5534
  }, []), S = {
5540
5535
  heading: (() => {
5541
- for (const z of k)
5536
+ for (const z of N)
5542
5537
  if (z.type === "section" && z.fields) {
5543
- const B = z.fields.find((g) => g.key === "displayname");
5544
- if (B)
5545
- return B.default || B.value || r;
5538
+ const P = z.fields.find((g) => g.key === "displayname");
5539
+ if (P)
5540
+ return P.default || P.value || r;
5546
5541
  }
5547
5542
  return r;
5548
5543
  })(),
@@ -5567,9 +5562,9 @@ const is = ({
5567
5562
  }
5568
5563
  ],
5569
5564
  ...v
5570
- }, P = [
5565
+ }, B = [
5571
5566
  { label: "Overview", content: V(A) },
5572
- { label: "Configuration", content: /* @__PURE__ */ e(Pn, { appid: r, configdata: { configuration: k }, disableApi: s, onCancel: T }) }
5567
+ { label: "Configuration", content: /* @__PURE__ */ e(Bn, { appid: r, configdata: { configuration: N }, disableApi: s, onCancel: T }) }
5573
5568
  ];
5574
5569
  function I(z) {
5575
5570
  return z ? z.includes("<svg") ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: z } }) : z : "📱";
@@ -5608,10 +5603,10 @@ const is = ({
5608
5603
  ] }),
5609
5604
  /* @__PURE__ */ l("section", { children: [
5610
5605
  /* @__PURE__ */ e("h3", { className: "text-lg font-semibold mb-4", children: "Key Features" }),
5611
- /* @__PURE__ */ e("ul", { className: "space-y-3", children: z.features.map((B, g) => /* @__PURE__ */ l("li", { children: [
5612
- /* @__PURE__ */ e("span", { className: "font-semibold", children: B.title }),
5606
+ /* @__PURE__ */ e("ul", { className: "space-y-3", children: z.features.map((P, g) => /* @__PURE__ */ l("li", { children: [
5607
+ /* @__PURE__ */ e("span", { className: "font-semibold", children: P.title }),
5613
5608
  /* @__PURE__ */ e("br", {}),
5614
- /* @__PURE__ */ e("span", { className: "text-gray-700", children: B.description })
5609
+ /* @__PURE__ */ e("span", { className: "text-gray-700", children: P.description })
5615
5610
  ] }, g)) })
5616
5611
  ] })
5617
5612
  ] });
@@ -5632,27 +5627,27 @@ const is = ({
5632
5627
  /* @__PURE__ */ l("div", { className: "flex flex-col min-w-0", children: [
5633
5628
  /* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children: S.heading }),
5634
5629
  /* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children: S.subHeading }),
5635
- /* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: S.tags && S.tags.map((z, B) => /* @__PURE__ */ e(
5630
+ /* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: S.tags && S.tags.map((z, P) => /* @__PURE__ */ e(
5636
5631
  "span",
5637
5632
  {
5638
5633
  className: "pill inline-block px-[10px] py-[6px] rounded-[14px] text-[11px] border border-[#e6e9ee] text-[#767676] font-semibold mt-1",
5639
5634
  children: z
5640
5635
  },
5641
- B
5636
+ P
5642
5637
  )) })
5643
5638
  ] })
5644
5639
  ] }),
5645
5640
  /* @__PURE__ */ l("div", { className: "bg-white border border-gray-300 rounded-2xl w-full mt-5 ", children: [
5646
- /* @__PURE__ */ e("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ e("nav", { className: "flex space-x-8", "aria-label": "Tabs", children: P.map((z, B) => /* @__PURE__ */ e(
5641
+ /* @__PURE__ */ e("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ e("nav", { className: "flex space-x-8", "aria-label": "Tabs", children: B.map((z, P) => /* @__PURE__ */ e(
5647
5642
  "button",
5648
5643
  {
5649
- onClick: () => n(B),
5650
- className: `${o === B ? "border-black text-black" : "border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"} whitespace-nowrap py-3 px-6 border-b-2 font-medium text-sm transition-colors duration-200`,
5644
+ onClick: () => n(P),
5645
+ className: `${o === P ? "border-black text-black" : "border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"} whitespace-nowrap py-3 px-6 border-b-2 font-medium text-sm transition-colors duration-200`,
5651
5646
  children: z.label
5652
5647
  },
5653
- B
5648
+ P
5654
5649
  )) }) }),
5655
- /* @__PURE__ */ e("div", { className: "p-8 h-full overflow-y-auto", children: P[o].content })
5650
+ /* @__PURE__ */ e("div", { className: "p-8 h-full overflow-y-auto", children: B[o].content })
5656
5651
  ] }),
5657
5652
  /* @__PURE__ */ e(
5658
5653
  Yr,
@@ -5710,7 +5705,7 @@ const ds = ({
5710
5705
  showColumnChooser: f = !0,
5711
5706
  showFilter: v = !1,
5712
5707
  showPrint: a = !1,
5713
- showExcel: k = !1,
5708
+ showExcel: N = !1,
5714
5709
  showPdf: d = !1,
5715
5710
  showRefresh: p = !1,
5716
5711
  showAdd: T = !1,
@@ -5722,21 +5717,21 @@ const ds = ({
5722
5717
  },
5723
5718
  // Optional: override export file names
5724
5719
  excelFileName: A,
5725
- pdfFileName: P
5720
+ pdfFileName: B
5726
5721
  }) => {
5727
- const I = () => n?.current || o?.current, [V, z] = re.useState(""), B = (t || "export").toString().trim() || "export", g = `${A || B}.xlsx`, h = `${P || B}.pdf`, N = (b, x, D) => Math.max(x, Math.min(b, D)), w = ae(
5722
+ const I = () => n?.current || o?.current, [V, z] = re.useState(""), P = (t || "export").toString().trim() || "export", g = `${A || P}.xlsx`, h = `${B || P}.pdf`, x = (b, k, D) => Math.max(k, Math.min(b, D)), w = ae(
5728
5723
  (b) => {
5729
- const x = I();
5730
- if (console.log("openColumnChooserNear", x), !!x?.openColumnChooser) {
5724
+ const k = I();
5725
+ if (console.log("openColumnChooserNear", k), !!k?.openColumnChooser) {
5731
5726
  if (typeof window > "u" || !b?.currentTarget) {
5732
- x.openColumnChooser();
5727
+ k.openColumnChooser();
5733
5728
  return;
5734
5729
  }
5735
5730
  try {
5736
5731
  const D = b.currentTarget.getBoundingClientRect(), q = D.left + window.scrollX, G = D.bottom + window.scrollY;
5737
5732
  let $ = q - 120, O = G - 120;
5738
5733
  const U = window.innerWidth, F = window.innerHeight;
5739
- $ = N($, window.scrollX + 8, window.scrollX + U - 340), O = N(O, window.scrollY, window.scrollY + F - 120), console.log("openColumnChooserNear", $, O), x.openColumnChooser($, O);
5734
+ $ = x($, window.scrollX + 8, window.scrollX + U - 340), O = x(O, window.scrollY, window.scrollY + F - 120), console.log("openColumnChooserNear", $, O), k.openColumnChooser($, O);
5740
5735
  } catch (D) {
5741
5736
  console.log("coloumn choose error", D);
5742
5737
  }
@@ -5745,18 +5740,18 @@ const ds = ({
5745
5740
  []
5746
5741
  // no external deps; reads ref at call time
5747
5742
  ), c = ae(
5748
- (b, x) => {
5743
+ (b, k) => {
5749
5744
  const D = I();
5750
5745
  if (D)
5751
5746
  switch (b) {
5752
5747
  case "ColumnChooser":
5753
- f && (console.log("openColumnChooser", x), x ? w(x) : D.openColumnChooser?.()), console.log("openColumnChooser out", x);
5748
+ f && (console.log("openColumnChooser", k), k ? w(k) : D.openColumnChooser?.()), console.log("openColumnChooser out", k);
5754
5749
  break;
5755
5750
  case "Print":
5756
5751
  a && D.print?.();
5757
5752
  break;
5758
5753
  case "Excel":
5759
- k && D.excelExport?.({ fileName: g });
5754
+ N && D.excelExport?.({ fileName: g });
5760
5755
  break;
5761
5756
  case "Pdf":
5762
5757
  d && D.pdfExport?.({ fileName: h });
@@ -5766,7 +5761,7 @@ const ds = ({
5766
5761
  break;
5767
5762
  }
5768
5763
  },
5769
- [f, a, k, d, p, g, h, R, w]
5764
+ [f, a, N, d, p, g, h, R, w]
5770
5765
  );
5771
5766
  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: [
5772
5767
  /* @__PURE__ */ l("div", { className: "flex flex-col", children: [
@@ -5823,7 +5818,7 @@ const ds = ({
5823
5818
  title: "Print Grid"
5824
5819
  }
5825
5820
  ),
5826
- k && /* @__PURE__ */ e(
5821
+ N && /* @__PURE__ */ e(
5827
5822
  Z,
5828
5823
  {
5829
5824
  icon: Zt,
@@ -5886,7 +5881,7 @@ function us(t) {
5886
5881
  allowGrouping: f = !1,
5887
5882
  allowReordering: v = !0,
5888
5883
  allowResizing: a = !0,
5889
- allowExcelExport: k = !1,
5884
+ allowExcelExport: N = !1,
5890
5885
  allowPdfExport: d = !1,
5891
5886
  showColumnChooser: p = !1,
5892
5887
  enableSearchApi: T = !1,
@@ -5894,20 +5889,20 @@ function us(t) {
5894
5889
  selectionSettings: R = { type: "Multiple", mode: "Row" },
5895
5890
  enableCheckbox: S = !1,
5896
5891
  columns: A = [],
5897
- onGridStateChange: P,
5892
+ onGridStateChange: B,
5898
5893
  onRowSelected: I,
5899
5894
  onRowDeselected: V,
5900
5895
  onRowDoubleClick: z,
5901
- apiRef: B,
5896
+ apiRef: P,
5902
5897
  gridProps: g = {}
5903
5898
  } = t, h = ue(null), {
5904
- pageSettings: N,
5899
+ pageSettings: x,
5905
5900
  sortSettings: w,
5906
5901
  ...c
5907
5902
  } = g || {}, b = ne(() => {
5908
5903
  const C = [wr];
5909
- return u && C.push(Cr), y && C.push(Sr), f && C.push(Dr), T && C.push(Fr), k && C.push($r), d && C.push(Tr), p && C.push(Ar), a && C.push(Er), v && C.push(Rr), C.push(Ir), C;
5910
- }, [u, y, f, T, k, d, p, a, v]), x = ne(() => {
5904
+ return u && C.push(Cr), y && C.push(Sr), f && C.push(Dr), T && C.push(Fr), N && C.push($r), d && C.push(Tr), p && C.push(Ar), a && C.push(Er), v && C.push(Rr), C.push(Ir), C;
5905
+ }, [u, y, f, T, N, d, p, a, v]), k = ne(() => {
5911
5906
  const C = () => h.current, E = (j, H) => {
5912
5907
  !H && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${j} requested but related service/feature is disabled.`);
5913
5908
  };
@@ -5923,7 +5918,7 @@ function us(t) {
5923
5918
  },
5924
5919
  print: () => C()?.print?.(),
5925
5920
  excelExport: (j) => {
5926
- E("excelExport()", k), C()?.excelExport?.(j);
5921
+ E("excelExport()", N), C()?.excelExport?.(j);
5927
5922
  },
5928
5923
  pdfExport: (j) => {
5929
5924
  E("pdfExport()", d), C()?.pdfExport?.(j);
@@ -5934,9 +5929,9 @@ function us(t) {
5934
5929
  };
5935
5930
  }, []);
5936
5931
  Q(() => {
5937
- B && (B.current = x);
5938
- }, [B, x]), Q(() => () => {
5939
- B && (B.current = null);
5932
+ P && (P.current = k);
5933
+ }, [P, k]), Q(() => () => {
5934
+ P && (P.current = null);
5940
5935
  }, []);
5941
5936
  const D = (C) => {
5942
5937
  const E = String(C || "");
@@ -5946,8 +5941,8 @@ function us(t) {
5946
5941
  currentPage: n,
5947
5942
  totalRecordsCount: s,
5948
5943
  pageSizes: !0,
5949
- ...N || {}
5950
- }), [n, m, s, N]), G = ne(() => {
5944
+ ...x || {}
5945
+ }), [n, m, s, x]), G = ne(() => {
5951
5946
  if (!u || !w) return;
5952
5947
  const C = (w.columns || []).map((E) => ({
5953
5948
  ...E,
@@ -5955,9 +5950,9 @@ function us(t) {
5955
5950
  }));
5956
5951
  return { allowUnsort: !0, ...w, columns: C };
5957
5952
  }, [w, u]), $ = (C) => {
5958
- const E = h.current, j = C?.requestType, H = j === "paging" ? "paging" : j === "sorting" ? "sorting" : j === "searching" ? "searching" : j === "filtering" ? "filtering" : j === "grouping" ? "grouping" : j === "reorder" ? "reorder" : j === "columnstate" ? "columnstate" : "other", ie = C?.pageSize ?? E?.pageSettings?.pageSize ?? m, ce = C?.currentPage ?? E?.pageSettings?.currentPage ?? n, je = C?.columnName && C?.direction ? [{ field: C.columnName, dir: D(C.direction) }] : (E?.sortSettings?.columns || []).map((we) => ({
5959
- field: we.field,
5960
- dir: D(we.direction ?? we.dir)
5953
+ const E = h.current, j = C?.requestType, H = j === "paging" ? "paging" : j === "sorting" ? "sorting" : j === "searching" ? "searching" : j === "filtering" ? "filtering" : j === "grouping" ? "grouping" : j === "reorder" ? "reorder" : j === "columnstate" ? "columnstate" : "other", ie = C?.pageSize ?? E?.pageSettings?.pageSize ?? m, ce = C?.currentPage ?? E?.pageSettings?.currentPage ?? n, je = C?.columnName && C?.direction ? [{ field: C.columnName, dir: D(C.direction) }] : (E?.sortSettings?.columns || []).map((Ce) => ({
5954
+ field: Ce.field,
5955
+ dir: D(Ce.direction ?? Ce.dir)
5961
5956
  })), Ge = C?.searchString ?? "", _e = C?.columns ?? E?.filterSettings?.columns ?? [];
5962
5957
  return {
5963
5958
  reason: H,
@@ -5987,9 +5982,9 @@ function us(t) {
5987
5982
  pageSettings: q,
5988
5983
  sortSettings: G,
5989
5984
  actionBegin: (C) => {
5990
- if (["paging", "sorting", "searching", "filtering", "grouping", "reorder", "columnstate"].includes(C?.requestType) && (C.cancel = !0), typeof P == "function") {
5985
+ if (["paging", "sorting", "searching", "filtering", "grouping", "reorder", "columnstate"].includes(C?.requestType) && (C.cancel = !0), typeof B == "function") {
5991
5986
  const j = $(C);
5992
- P(j, C);
5987
+ B(j, C);
5993
5988
  }
5994
5989
  },
5995
5990
  rowSelected: I,
@@ -5999,7 +5994,7 @@ function us(t) {
5999
5994
  },
6000
5995
  ...c,
6001
5996
  children: [
6002
- /* @__PURE__ */ e(Pr, { children: (() => {
5997
+ /* @__PURE__ */ e(Br, { children: (() => {
6003
5998
  const C = [];
6004
5999
  return S && C.push(/* @__PURE__ */ e(ra, { type: "checkbox", width: "50" }, "__checkbox__")), A.forEach((E, j) => {
6005
6000
  const {
@@ -6009,7 +6004,7 @@ function us(t) {
6009
6004
  textAlign: je = "Left",
6010
6005
  template: Ge,
6011
6006
  isPrimaryKey: _e,
6012
- showInColumnChooser: we = !0,
6007
+ showInColumnChooser: Ce = !0,
6013
6008
  allowFiltering: Za = !0,
6014
6009
  allowSorting: Ha = !0,
6015
6010
  type: Ka,
@@ -6030,7 +6025,7 @@ function us(t) {
6030
6025
  textAlign: je,
6031
6026
  template: Ge,
6032
6027
  isPrimaryKey: _e,
6033
- showInColumnChooser: we,
6028
+ showInColumnChooser: Ce,
6034
6029
  allowFiltering: Za,
6035
6030
  allowSorting: Ha,
6036
6031
  type: Ka,
@@ -6046,7 +6041,7 @@ function us(t) {
6046
6041
  );
6047
6042
  }), C;
6048
6043
  })() }),
6049
- /* @__PURE__ */ e(Br, { services: b })
6044
+ /* @__PURE__ */ e(Pr, { services: b })
6050
6045
  ]
6051
6046
  }
6052
6047
  );
@@ -6065,7 +6060,7 @@ export {
6065
6060
  os as CustomTab,
6066
6061
  za as DatePicker,
6067
6062
  Gr as DateRangePicker,
6068
- Pn as DynamicConfig,
6063
+ Bn as DynamicConfig,
6069
6064
  Yn as FileUploadModal,
6070
6065
  is as FullConfigPage,
6071
6066
  Xn as FullScreenLoader,
@@ -6078,7 +6073,7 @@ export {
6078
6073
  Qr as PageHeader,
6079
6074
  Kn as PageLayout,
6080
6075
  Jn as Pagination,
6081
- Pa as RadioGroup,
6076
+ Ba as RadioGroup,
6082
6077
  he as SearchBar,
6083
6078
  He as Select,
6084
6079
  Qn as Sidebar,
@@ -6107,7 +6102,7 @@ export {
6107
6102
  ns as http,
6108
6103
  Kr as localStore,
6109
6104
  aa as myDriveGatewayBaseV2,
6110
- De as notify,
6105
+ ve as notify,
6111
6106
  _a as provisioningBase,
6112
6107
  Ya as rbacBase,
6113
6108
  Wa as searchRolesApi,